diff --git a/CHANGES.md b/CHANGES.md index 89fbcbd06..fa9b8669d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,11 @@ +## Changes in 1.13.2 + +### Enhancements +* Bundled [xcube Viewer 1.7.2](https://github.com/xcube-dev/xcube-viewer/releases/tag/v1.7.2) + that comes with, e.g., several bug fixes including issues with the time series legend, + the zoom information box, persisted states, and the progress bar, as well as updated + dependencies such as `chartlets ^0.2.0`. + ## Changes in 1.13.1 ### Enhancements diff --git a/xcube/version.py b/xcube/version.py index 02468ccb9..38cfc95f2 100644 --- a/xcube/version.py +++ b/xcube/version.py @@ -2,4 +2,4 @@ # Permissions are hereby granted under the terms of the MIT License: # https://opensource.org/licenses/MIT. -version = "1.13.1" +version = "1.13.2" diff --git a/xcube/webapi/viewer/dist/about.en.md b/xcube/webapi/viewer/dist/about.en.md index 350e73151..03012ac12 100644 --- a/xcube/webapi/viewer/dist/about.en.md +++ b/xcube/webapi/viewer/dist/about.en.md @@ -1,4 +1,4 @@ ![xcube-light.png](images/xcube-light.png#light-mode-only) ![xcube-light.png](images/xcube-dark.png#dark-mode-only) -Version 1.7.1 (open-source) +Version 1.7.2 (open-source) diff --git a/xcube/webapi/viewer/dist/assets/html-DLIAq51Y.js b/xcube/webapi/viewer/dist/assets/html-BcKqsdK3.js similarity index 91% rename from xcube/webapi/viewer/dist/assets/html-DLIAq51Y.js rename to xcube/webapi/viewer/dist/assets/html-BcKqsdK3.js index e67164a19..730ebdc54 100644 --- a/xcube/webapi/viewer/dist/assets/html-DLIAq51Y.js +++ b/xcube/webapi/viewer/dist/assets/html-BcKqsdK3.js @@ -1 +1 @@ -import"./main-qd3DiARX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})(); +import"./main-CvAypEXI.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})(); diff --git a/xcube/webapi/viewer/dist/assets/main-3E2vygGN.css b/xcube/webapi/viewer/dist/assets/main-3E2vygGN.css new file mode 100644 index 000000000..25ef51d11 --- /dev/null +++ b/xcube/webapi/viewer/dist/assets/main-3E2vygGN.css @@ -0,0 +1 @@ +@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-cyrillic-ext-300-normal-DIxttMbC.woff2) format("woff2"),url(./roboto-cyrillic-ext-300-normal-D7ank4TF.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-cyrillic-300-normal-DzUz0kzv.woff2) format("woff2"),url(./roboto-cyrillic-300-normal-DEFNdjk5.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(data:font/woff2;base64,d09GMgABAAAAAA5kABIAAAAAGswAAA4EAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbHhw0BmA/U1RBVFoAXgiBfgmfBhEMCoJsgnMLFAABNgIkAyQEIAWEeAcgDIVOG4QZIxG2k7QyCPCXB+YQMaYH5wNNykYrVMIrLNl8cs67CxUK70wolH28ovl/w0gcQHaiTmMstz8bIcnsT9/p/5moACbp1huxVtI6bWptkkLKhZAH+w/w17tzr+3bzEQ2K6eeYy9BxHLmDr6IbVd9Oh5lQVPyeeA5Zn/RoFE43KjS9mZ7XoEX5A16B954DXYg5ze/1zTdVYpLRdtoBm9KkKovBS6jA5NlzKoBCJJnFZ1jLb1x13w47pVO/Q+cHjw+uuqr4+lPa+bbt7tJbwsEUUUhSckas+9NJtk3kw1scZIy3fFuMaeSaxWgqhHEKQB9QMXCfqFlhf06R1gE0blLNgFa9r8NZwdl4kgUgqx9aQsIgKvIIGpYuBXAWfXaigY5RRWI4iTtCAEAge+o5rjbhc/HmT4IXjPtvdGoQ7NlQNBW8T2bEypFQuAC7kVEAYBy+Rj7DTqCAJA6wGlArWhd7kSf674aj3nwH3TETgRBQ7cAgFPj2gHwsWH9iVv75t5GiHXeZulCUQCj6y4LigX0rzCPRXJgucAfD0MIy7RKIb8BlZEQhnglBtouwMpK15gfzNFl3CnVkqp9Du1crrjFVTBAVyT/+pp0fv6EvQVtLArgF7HzTd1wwgRAfl57L5B/MPbLoz8BwFOehdP34Mcd1TGQrSuedLN6txM+gAccD3wOR9zrXQ+4wGd3nLPlsMdcF8CGTT9p03mfrjztYUl8acMFrJlnPN5rdpwYT7/fB7DvuNse8HTgNfS/fJPrWJfQgbh/NrsDu3nLNh3a/BDrWxHAoNWYaYs27Tnmgjs+hE9RNExaZ3PaZQ+Gt3l2Co4fO3pkdWV5aXFhfm52ZnpqcmJ8bHTEajEzw0ODA/19vT3dXZ0d7W2tLc1NjQ31prpaY011VWVFealBX1JcVFiQn5ebE4s9nZ2E6L6UcyaV2e4sEsJ9SZfUd9FWqAWAbIaH+BL0O4Kbeztd+LpvrBXDFg7c1OmmuNFlpC8dXHSGkGLuNl3ydN54qnXBYbVuBZE0hT28LC0HNW+DNrcPvUB7Veipg6RX5x2ZAAOabjIwg613JmPh8aL5l0n0O2EsObbst/xIVvCofhUun17RnUoagpqpzS/Wfmf6hlt0kcZDh52MOtYDGSRtli3c5+/K7xWgExGk4fXMaz1wgQ1s8MJz40Wj9WxJpM0udPuZ2Pa6meAix+XHwezKn8ONb/ML6I8j/ldCag4XkhtwDwHtOJtwCoCtJxfdZffCVmvEtI7uJDbX8lmfWgS4o+DaRUhQLl+ZbRG1KMHzjsPiCZVIkpcsZee3ugZCwC0dhRl650lnD4S75+67R5RDVRnB/Ou87V+Ewkf4LcIchCBxFmv+YPKbv920CNjE00roAUnm3YfgUGG+XOnG13zdir1HG/9bBI+xKocsdRFdptetM/U5HtqeXw4yAOC6IIZBwJh0HdzS068NxoorSr//OxFggDxvDUsufqEHNfod58U7NjgdaDS8lnN1cGJgZpx4EKgMuHE8LkfSWwpYCi5dS9VAKWWdIsePgtJMzGTkpjwpTjKSjDJBvL1AGF9gh50Wp7YEbwWw1NZ/dM01ffJel3lNBDfzV2YnETrBcQSPL0zmcGGtfFL2ulRn6HP9Xnc6z+4rN3vnyQRbSNM+VbfdsjHFc7u+NWwVfW7c7wtXpCbNnMUUWG4tQiQz8NhWjrSBm4MbAgxzGjYN39esGq/RCm946bM700VK0VASo5PJzmv6vW7poKi5vSbJoGimG5N2QdtWF+vAa+DZocOtxyvHO2aVD3miUuQd3KpdXG9YlPrRYqx54S1thPL8MmDAbyXMjesJzChYpfmHkCTixHMWzVyFpm/VIJ0cwM0bEUJLwg+y2DLYEUfWKCJZk+qKDzgjBFhDGLJIYkmKIAM5/rBoTbqSXxsr4FbzOuq8ibWstjOx58Q2YAKOeAsyTYoimVEQCgGBwaI1sSXKtIsDjBZbNWsThoMbTybqcH8IkzNnLbwRT962ZWss3LvSPUD1fCw3E8CwB1RpypopZ8kMGmIEYSHtOIsnduA4bqGDTl8P4kdqTi1EEreYmq2AuMieZLx1LcE682sljSNhNjgI09FC1fs6cQ2zVQFu09vg2FJFA+ruUjSVMaqr8QY57HWJXd8IGSI5yGLX5dm7Bpp2i/cdQx9lOxJgyGOATHseRLNDByrbI5ABWuFQ48E7KwQjKY5DL7jQGgnrCTTiA/5SY/bAQIEnpJLItpk6O6FUrGXiROCDKu654bVKEuU1KSNXlJcMOD5gwWEjUEhdQFhbBAFQ5maLT38JUiNguQ4uctrAtNkMHi5wGopUQStlxCXEaz1To+lxeGUOwmYTO9TjZlShdOC1V2/EZbPqhPGzFqy02awnzvJG2JXMfJiZcu7BKmzkNpzBnVXcEKVToTTfx4i889ayvWsAi9pGwrDT5fblPlg2N1khMDuAygEXA4gQg9ICEI/KzJpCA60I0qYyxr8SlCreu4LfMhN6GSxdkO5RPX6ULrMuh83Xc/OZBzwyRzAZBHzLb2xx5hgw4m9X3ZLLBmlx3q3a5ogoExDFH8h71lTKNSkIxwMJUuRwHP4e50lI7ykEpcNE+U6sSCdg7z1zNzupMgHP5m5I54knT/M61HR5K+fZJ7PURLaDNX+GwOzD81RTYZ9t7xxgQL1WUHENV74xQdh1JfMQ5Iqv/x7eWLI8kNpQ0s20Wf+75JCGQKEPHkkiJdBbeZ7F1CDl8FUDl55NKBBRUr3yZ1WAT74bggILpC/7AkslSDGjPm3lb1XdFgSWKjBzYFPfvtmrFfUJqb9nbQG0StOH3wEUtl8DuGKX8qwwqcDrgfeu19X0Xg62x3sY/fgke7rwOE8IOSW2Bc0Im/dhOHKVPwjavYEwP/+/7hyFG+PY4ihgmFWfQK19ECzdd/xJC2vJje794JX/maxl/gfFFpaFtaky5iONYpwv2Xe7t/wzN8RnkRjNSfQ+gjeXcbgQykZH6sAjFjqjaQRULKYPXvxPLJwu9onvsWw8V1QeFUeHQAEfXbyGJ3Djj8y+ABfa7EPlIR+aYdpspZqqDhxV/Qy4iG/OklwzfCcTpKXEDD+LNaWlFsQeUdq9BLfHYb7iORs7W/aw6riP0SSKLyNuR9Sj0FUaE9ij2aPQUBoXQM0oO59vqqHewQ6PKk4bNzb4t6KOoRZPa3JEAAik5RCBcX8mywNh9RQQXP/Dhh01P0puhlIC3U3zMCpK+Y2HtxbcOcjOiVZ1OZEsChHQr9feAVUZLEv9zTdMG7WUgCKo8I+sE8HAvWLnRD9sW2NAiKKOeIj6OHG9uc7cCq5N4P7zi1VyvBv2DiKgw9tt/P15zpPgHnAZD9nD83hemhyL/YnqmkmY+7wGOW98j0Jo/meQy+aXX5Ni0UMQNgBz4glKdBLVucDEDLl8iskGTlfpYbt6Qx0C3BB98JA3AesE0jz2sinKz5Igq4B7Urp9yUf0yeP6/2x3362fnx1bjtwt/e94cbDh38Pu7LwXP1L/74Ti9HzCW8z+5eLurovFcdekt+ZPLyS/Y94vFLt69F89vJ/wjo/f1ytuy81Zv6dVmT81DhuzRM3/QkGpbMnbDSzuCFAM5H83AMyBe6/kZ66C+26aUwwv1IvN8JwYoMtyL4VU9jCX6+bAYjnAzYrE8y25xH7/R9gssReA9xToqhIQAHbok6Rbv6kaPZL+UcYRAABe/L0jBgD4ZtvA1qDf6yBNF0BdHA73XAvg3jNcqDiaI0QzOYW2tFmM/m4x7h5mgo9oKgtujeT+ntfwPMNB8kmcAKxfDyuwIAAPf7Fh2AkA7g+4+hQq93eK5PqXYm54tJbTpQTrgCWWnEjleiArlc/Vo2kFnN0ooShJNqRiwFW5FZuMamkelsvjAfJZNOvTrVW19th06qq3LDGI0Y9HndytjaVQRGOVcYsHC8FwzznELIGEBPOt7QZ0LC8KLBoIymbRYun1nVJqRY6reMywdbcEw6foai4lo5JYYfnyfL0aszWXnj46skS5VtmVO1n1acZQzs3XmbVfNY6BSp0suw1fhUB7dxKMAaPcg+pWnko6q7X0YDvOzhdroUqnbipj1SLcylb9GIx5cK3u0247NmP1TKtUaytQtNmq6+OwRQsjPdDmtmnHGeV05VQKmUw87kTy/xbjiWl4LImMJiXjEZUDtiYQS0InNuv0mNGRYTUZ0r6FB7VkQNOA+zVv4T4N6dWIcI8mEHcrSZecdMrfwh0K0i4jbVLSKr2JW6SduFlMmsRzuFFCGiQ2XC8iJiGpo0lt/FvYGE9q4t1wdRypiiWVMZG4IkaEy6MacFkUKY26iQ3RRB89h0siSTFF4yLqJi6kSAFVhfMpGudFkFw+yeEzOFtAsgQMzsQkI9yG08NJWhhJDSXJiba0H3FSohInqNyxTs1grVqPNeoIrFbZsEKehmVSBkvEBZiOT8MxQRwcHRWLoxQhQabIYG9McYODTBFBRMBPxnxtoL8JB4pweAAJ8yeh/g44RBEUWheo9A+tCy7ZAd8cv6AU/2lXGh+Zd2VH5ln5zFgZHysjQslFRm6s48RZHpxZ/htnHg25laEy4CkllEGluzEwSuNHHpLIy0HJTpXJWckGkQCSwCD8hjkpFaYkykjGOlbE8mDN0m/E2GmOix4t91BBF7YOZKjb7mSYtqM1RC0j+slM0c57XhvU1tXch9COLG9vwzKm9r3ymvvZkPoiy1mZgwSXw46YLUADTdMx+rIV6DMFiZSwWrTRQ6HLYKABL/kSrroovfQSnblJZ0P3mwoE) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAYMAA8AAAAABtQAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAABQAAAAUAA8ACEdQT1MAAAFsAAAAHgAAAB5EdEx1R1NVQgAAAYwAAAA0AAAANJMNggJPUy8yAAABwAAAAGAAAABglx7Qx1NUQVQAAAIgAAAAWgAAAFpfmEARY21hcAAAAnwAAABUAAAAVADNH/FnYXNwAAAC0AAAAAwAAAAMAAgAGWdseWYAAALcAAABLgAAAS7SK1I/aGVhZAAABAwAAAA2AAAANgzosE5oaGVhAAAERAAAACQAAAAkCqkNkWhtdHgAAARoAAAAIAAAACAXOQALbG9jYQAABIgAAAASAAAAEgF8AVFtYXhwAAAEnAAAACAAAAAgACgBIW5hbWUAAAS8AAABLQAAAlQzIV4ocG9zdAAABewAAAAgAAAAIP9tAGQAAQAAAAwAAAAAAAAAAQAHAAEAAQABAAAACgAcABwAAURGTFQACAAEAAAAAP//AAAAAAAAAAEAAAAKADIAMgAEREZMVAAeY3lybAAaZ3JlawAabGF0bgAaAAAAAAAEAAAAAP//AAAAAAAEBHUBLAAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HAEAAAB9NBgD+AABmB5oCACAAAZ8AAAAABDoFsAAAACAAAwABAAEACAADAAAAFAADAAAALAACd2R0aAElAAB3Z2h0ASgAAWl0YWwBMgACAAYAEgAeAAEAAAACAScAZAAAAAEAAQAAASsBLAAAAAMAAgACASgAAAAAAAEAAAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAAAAA0AIACgH03//wAAAAAADQAgAKAfTf//AAH/9f/j/2bgugABAAAAAAAAAAAAAAAAAAEAAgAIAAj//wAPAAUAZAAAAygFsAADAAYACQAMAA8AAAERIREFAQElCQMhCQIDKP08Ao7+7wER/agBDf7zASr+/gID/f0BAgEBBbD6UAWwVP18/XwMAngCeP1E/aIFRP2iAl4AAAIAfv/sBO0FxAAVACsAAAEVFA4CIyIuAjU1ND4CMzIeAgM1NC4CIyIOAhUVFB4CMzI+AgTtUJTRgX/Rl1JRltF/gdGWUHs7c6ZpaKRzPT50pGhqpHI7AyabmfiwXl6w+JmbmfewXl6w9/7MnYHOkk5Oks6BnYLQkk5OktAAAAIAYAR6AmMF0QAFAA8AAAE1EzMVAyU1MxUUFhcHJiYBXoZ/v/68cS4wMUtTBIYNAT4V/srsX1lEYicxJIX///7J/+wFMwXQACYABEYAAAcABf5pAAAAAAABAAAAAwPXDGsJnl8PPPUAGwgAAAAAAMTwES4AAAAA5Y1QA/of/dUJGwhzAAAACQACAAAAAAAAAAEAAAds/gwAAAk4+h/+RQkbCAAAAAAAAAAAAAAAAAAAAAAIA4wAZAAAAAAB8wAAAfMAAAVrAH4CtwBgAfMAAAWx/skAAAAtAC0ALQAtAGwAiwCLAJcAAAABAAAACACpABUAdgAHAAEAAAAAAAAAAAAAAAAAAwABeJx1kMFKw0AURU9sFSq1S3EZBLUiRhtRRFfSRRFEpYhd1xjTinYkSRf+gB/i2pWf4xf4Gd5MxpIiMkzm5M59b957wArv1PDqDeDTw7HHGt+OF2jx5bhGwIfjesWzyCZvjpekTxy3OOK4ZG+DZUWXvEWTdcdt8arjHXmajkMRnJMz5IkxERf6JoykDIhnfIkh5dm6BlLvpY3sTc4LGSfsaRlxrLoeRBPdlBkLJdM3sDkS+jrvtHPt3cp7t/Kkco5ttM+BIvbpcMip/kJxqE6rao8rrZ7ov5x95UyYqpKhclddfsXVtZW/yvGrlO91tHxupMQ656Ov5TY86iay/jO9UszE2B582n+mkyh74ZgqS6Aoo3kWqtFKVGE8m1smPZ3rKLIdZHY6Eds/0JpXhAAAAAADAAAAAAAA/2oAZAAAAAAAAAAAAAAAAAAAAAAAAAAA) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-greek-300-normal-DJEM9B4Z.woff2) format("woff2"),url(./roboto-greek-300-normal-C_Dgaih9.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-math-300-normal-5dF_7mZP.woff2) format("woff2"),url(./roboto-math-300-normal-Ds0YpBw2.woff) format("woff");unicode-range:U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE00-1EEFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-symbols-300-normal-DDU7avhj.woff2) format("woff2"),url(./roboto-symbols-300-normal-BCnjhQd_.woff) format("woff");unicode-range:U+0001-000C,U+000E-001F,U+007F-009F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+2800-28FF,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B00-2BFF,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F000-1F0FF,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F700-1F7FF,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB00-1FBFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-vietnamese-300-normal-BPvXm_f1.woff2) format("woff2"),url(./roboto-vietnamese-300-normal-INUupD3o.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-latin-ext-300-normal-B90pq-BC.woff2) format("woff2"),url(./roboto-latin-ext-300-normal-CTCCHkZF.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-latin-300-normal-CCzlftfr.woff2) format("woff2"),url(./roboto-latin-300-normal-BARJ-h6h.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-cyrillic-ext-400-normal-qHufge6k.woff2) format("woff2"),url(./roboto-cyrillic-ext-400-normal-CaK1767H.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-cyrillic-400-normal-CBPI_iaY.woff2) format("woff2"),url(./roboto-cyrillic-400-normal-Bjg-1-sg.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA5gABIAAAAAGsQAAA39AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbHhw0BmA/U1RBVF4AXgiBfgmfBhEMCoJ0gnQLFAABNgIkAyQEIAWEYgcgDIVOG3MZIxH2i7OyB/jrA24MgRr6HmlzCaM2go+1uUKrrwjEMmJDDee8Dlpr4LD+LsxoDHtdq5H/CxNGSDJrT+/U5u2uVjIEWQV0gAqsEod8Fwep4BDXSdkFJh8yft1FBMil99se9ONjNt7Um9rENUgrVOQlWCvXvPx/CRRhZlcXSHYmukAgXG1qXUHAbSnx3RSVErGy1NxVitTdOcJhUOMM8t5KgcvowHQSQDkAXJI6OYf3qca/T8Nx5V8ECeZsY4V8I35GFL5GVulKnf4A0lAfHz8/5/v2JG33MgQ1rhqQMKTkjOk5t7fNuTfp68vwtmPKOBnmqQGQEYT4Scgvv9AWUPfDt4fWOtddK5CE+23D2UGZOBKFIGtfFgcBsCMyBM00wY0VsftMmrdgWd6XEiRLmCYBAqd3Ldzl4vddzasRfW6uXhV1eJS3rhW0Cb77C95Au6EAylElA6CEfIy/gZoQQJoCGNtyRJMWLlYuRHzDhLnEENRkRxl0dAoAxFTFB0DHQSBo4ABCc8+SiHVUtdbRKKDjXNdKY0H/CnNHSgfDaOEkOBjYI1uFmEUtEmn3cPYwHK06BlVUwIoaNOVbCiwx/tB4Lbcl/aA7XSxvdQIGag3zX742zz5/yOYFH2cSCEt8CE2deGpHMH+eOOTNfzgOy6M/AXjE407sLR90SI95zdzkYdfQax31lrscCT7HQfdkVwIbBt102nYHPOCKCPu4Hntsc8anY0+4VxKfn3AWMfOYB2vNTkft3nd6yx5H3HCXR4MX6H/5ZqHDVUIH8u6p7Ap8Bmy0zf7J96iuFCFLpU591jO8u+bXedZNb/s0GI0eW+1zwgV3xzsQOF1y5PChg5s3bdywfnDAs66/r7enu6uzH/nm66++/OLzzz795OOPPvzg/euHV9PJOB8F/96777x9OXT24vzBoN/tvPXmG6+3W81GvfbK86WV5XIabeEzPpusVMpJtEZSd/VYJIU0UBFvg5WGYHStbvdsVlVaO8UaBgSydFoYSyXSdRWcVAaQYq7V7nO7O7SUSZlDdL0BRNLUbuNlaTSYmQYLzFz7AgsTwVqUcKXFJFdkAibiHUe44CYbKlLhzor52YWVxjEqDGu2E30karJWHfizq4H9SinVwQwVgcnIz80vuCAXGVrofuoaFZPhAMli/QId/rb8Qh56TgQJHnWsDANdWMFa9ixf/apkGGtyrjCfiG5fiHWlHJmcxhHpTXY00pvcoS0CE+g3efYXpmbO/KmLI/kcA3rKsB0KBLArXZKlabtnByc4VRjylMf2tPtMzgsSeCoItw5JmnlJZfZoZC2WFqUBhyXSWtpmxlqaHbjILRyV4JaPgojeudvxyvzx0vHy8drM+oyKBOZfjsv+RZJYVPKrXa2nFHhSvQkF2Tv0c1VBgg0/lqUH2MK7EZO1hbluyzd+nQetWNE5tL/aZV2pHKrUaXSaSjmLbGR4aOf8aDAQQJO8UwwCztQnwehb+oleaefe21UrZQImZHmi2MXQe9KYYaXhWL7wkjcy0Gh4jebS7oqBo5lzzVMZCDhuwpH8nDwqvEknUqkmkoqeB45PQioy98VI3ovpYXIYyVlYg1VPTmHTp9g2R8mRLUEdA0rZ+hfOOKMnr6WSR0QwOvZKTV2AnsPgAKFPVRRyqrV7Mq2UKYsYmWql3O5G4y3TubQoUGcSb5Vmzb0U8nBeoqoVa0EfO6JadVyRjMR3HHKvcjInRDITd5zPgcYwuhAgYM5pMBzyvctgaMX+4DH3bTSOpZzyoCh3Sly5nSdUK+XUQbLO/Jokg5qZ6Qb5NFi80JOR5xHwwND9bYNXjqfKhA+4pVLkUzRTlnA2VlHqhhHjpmc1jR3l8WVgYicuDEyTCRwKxkngHiRDeOA6gPiuQs1DVUu7eAjcFyEgCV9Do0FhtTNkVwvwjEj0Eu9yRgiw6lBnJYl58gAGyPGHoNVanuxIaQfBXpJRlzsQK2rbH2uN2KswgRZWg6FJUXg65B15z8C0rFVsKRWahgFGi63qtAnDlkNLJkhufYDtzJkIdWHFoyesEYJrZ1vqHVJ/pxYwt0BevCy+dItyrSBGUAjJZhZXrNFwmED3Ol3diB+lnliIJM5QGWtH4kn2JONNKpiMMk+ey4hAKPYGCrYkWPQdyb/FsZQIr5Wfe8OaSlSj7i4HhZAhVNOV3Z7liR0LhAyRrEGsMbF48UVo3g13G4ZGGpcmYGaRRaZVD0qoyYCltwVkgEVoNrQQnRWAk5SbvhaMQCsJkwls4X3xUk12X0FBpKVyka0LdU7ZpGItk5QdLKBNWGsgSiWJUptUkCvKI7IMH3C/qRHYSJ1PWFvxPaAiMHnlvwSpEdCfBCNwehVVmI/PWxie08C5KmhNGXEJ8VrO1Gh6bFwzB2GLiW3TzWYkUNrqtVpv5GWz1leMX7BgtTAft544yxthx3I8mply7kE11HljTn9hFTdE+apS3t3HiFxarVkvKsJiiwdCrpHK9nmPLOu1VgjMVqO0xkkNSoghlQC6kWYmJDpo1IFBxVKMf2GSBnn7CqGFI1OLoNSCdJ3S+ppUslT68ddzuGOBvtqnySBgsSxXJ9oNAws7r+bcxZWo19GtmjkiKgRk8RuUVGsqzdUI3YUDCZJy5Da+xLkHvEsKQdO2RFmcWJF2g0tPb7aTqi2IrDcjnVuePM3rQLzLWyUWb8xSY+cWF74DK3ageqqpsM+sXgNM1GsNKq7BwDbGt3VdHVZJLun138MbIUsFqRUl3Uxhmr+75JCGwEYfXJJESqC3Uj27oWop+0fVXH42YQM7JcmVv6gCLOTrIahlgfRl77FUCSlH6vca2Dk172AllcCxa1OXb1axskwVNQ28ZCvAxol39TuAwuxbiJHsUh4QWwGeD/SZSlm8SzHsBpcwev0ke7p2PU8IOSVmWQ1sZh+Gg1ZZBsES96Hgp//XnR0IGMdWdgCOGfcktLUPrCPdhj9DqMnU1e9bDuxPZC3zP1hsUUWhTln9+4RGMc5HuM3uLf+kDTAoEqO+ia4DhEk5KPNloweqwCUWOiPeQKhQzB+8uE+OoN3bJ75Of2i5ROl+sn8I5PPRxRNYgoDdVzsOdCnMH6LuIh+gnoYGolNpi46Kfgd0xUYzMkIzfC4TJCkxw3u4eGmpBbG1GVnah+BxmLsyeGUUD6t2+bAhUSQjDtIFPvyttkeowIm/01SIodPbVnoF4I/hM068tKsRx1DDz22OCICgTjsm23hGPFBcn4EQ/Q3iS6+FeS3KWnfND76iVJJH7hzym4ZdQPucSIYpTT+5D+jKICz1h6VIClizgEuPrJOAQbwKwYe97+qKAoFBg2YigaiRBU4wxwonj7Of4w/Hjo7pJAZgYIBpxpcJD5fWHviTrSvkAM9deV1PZ+x2o4/bA8/v7bet3nff/ZBo4KP33rNte+edD/Ie913LMe7bWwfA886Z+55Fe6jQhvwd2e7yjDzN8qkHfBO9E2OghOj9px+G2rqZ8NgLRaPCWqe2cVBaS5fPesmi89n8yD3vlm4csBnH73Hy82CHPHbsXmdg41/x0Xtz2KPm7mDmc9Wb984vLtg9v2bzpOcGT+snPV+3Zff8gpI986u2ZDwfEjVyQ1DL7KfCPp3R9b/z0spF42qPL5riTCzcGeyH0ZQFIBVyKGjCwlCn+bOSpbxrWMbI2CDeLC3NcJTpQRmpafcqip/KmIqUMSXwlfSU1LT7OEsOAoKXcEwyQQA4f29LdFxGacD0f4IxGgDg6f9WDwDfPCdcg36vhzS7AC2nrh6yA8pzCgf5O9IQ9WLh21FlOP2XxpQBdETD0FgW3Jrk/pCJJKYTYAiU4iiwbwPawEAA/HAWBwkLgDsDf58l2IllGfzxd5Yj3ZNZgVgXswpG87DkMlXd/TFR8hI0ClaMdNkxsCPSGpuxr5Oor47S29sDi7Uqt1q9SrerVq9WnVYruDVbg0frUq9KK05s4UYtpkrZ2Z2Hq61Vwx35rbIIyi1NJ8sxtXJirvBWKychXI1zm57LFXxb5+YKXS/F6DIqw6nSTDCtc/q5f7qJ22D0JJdZaOV+6AtN05uEJKn13FZxFyNtIevBabvR5aFQXV+NOKsbtwZWV/JUZ2uzl3a37cC6sZar1qqnCrepkKyyqTUYjF13w7O22qbcwq3f3BpVWXNsusXak8fhiIZmNqDKZTeN/vXn753J1+Odz+9n+Hj6eX95e3vkdbP66ub5PuPpmuPx4mHn/tTcJ7fHLjdH7qw+/vdeHVW5PIJysXI+czZrNQsnE8cjR6OqYjzjoGe//1c6sDsoihvbla3CZtZcmfVsc5FYjayEjCyHqiy5XRYdC06V5Znz/1ZYZkxZpo1qqWHSrDJhyjKuGZOMykdGFMPqkSEYFIrZgv6Ovig9XUqf3tUsnS12O62PtLfO0daaktYWRUZjPw31j9TVJimX+smHTF7KFiTbFAlt27Bb0uY9ta1DJBM9kmgP+rcJViUeIOYn6rdSTSGM2MLIzPDYwuizHfG7ExY1M/xiQUhasDMoLdAZ7Ap0+WXanUqmcNpdwpUgSgULEOvEb4IHlPg7bZlWp5opnZQGZ+6yuqRrnaQUuVK6JZ8lS+U6yeFqQSlw+w23ZGpOnsmcmou5ElgpYwFsHfuNcW4YCt1Pu315jqX3q+biUp8lq9BHW3yjcnNvamQX+OQWH5zbwvw7iHa6Nu7YgbjZUt/u3Pw7Oa7LuO5gbG52/h2CCyItrXBwlI4bfaUNjjMFiZSwdWmjh6JLSzjgJl/CJYvSSy/RhZt0NurfVCQAAAA=) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAYYAA8AAAAABvAAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAABQAAAAUAA8ACEdQT1MAAAFsAAAAHgAAAB5EdEx1R1NVQgAAAYwAAAA0AAAANJMNggJPUy8yAAABwAAAAGAAAABgl4LQ2VNUQVQAAAIgAAAAXgAAAF5fnUM1Y21hcAAAAoAAAABUAAAAVADNH/FnYXNwAAAC1AAAAAwAAAAMAAgAGWdseWYAAALgAAABNgAAATZng0GjaGVhZAAABBgAAAA2AAAANgz5sE5oaGVhAAAEUAAAACQAAAAkCroNqGhtdHgAAAR0AAAAIAAAACAX6f/DbG9jYQAABJQAAAASAAAAEgGEAVltYXhwAAAEqAAAACAAAAAgACgBIW5hbWUAAATIAAABMAAAAmI2jl6RcG9zdAAABfgAAAAgAAAAIP9tAGQAAQAAAAwAAAAAAAAAAQAHAAEAAQABAAAACgAcABwAAURGTFQACAAEAAAAAP//AAAAAAAAAAEAAAAKADIAMgAEREZMVAAeY3lybAAaZ3JlawAabGF0bgAaAAAAAAAEAAAAAP//AAAAAAAEBIcBkAAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HAEAAAB9NBgD+AABmB5oCACAAAZ8AAAAABDoFsAAAACAAAwABAAEACAADAAAAFAADAAAALAACd2R0aAElAAB3Z2h0ASgAAWl0YWwBMgACAAYAEgAiAAEAAAACAScAZAAAAAMAAQACASwBkAAAArwAAAADAAIAAgEoAAAAAAABAAAAAAAAAAIAAAADAAAAFAADAAEAAAAUAAQAQAAAAAwACAACAAQAAAANACAAoB9N//8AAAAAAA0AIACgH03//wAB//X/4/9m4LoAAQAAAAAAAAAAAAAAAAABAAIACAAI//8ADwAFAGQAAAMoBbAAAwAGAAkADAAPAAABESERBQEBJQkDIQkCAyj9PAKO/u8BEf2oAQ3+8wEq/v4CA/39AQIBAQWw+lAFsFT9fP18DAJ4Anj9RP2iBUT9ogJeAAACAHf/7AUKBcQAFQArAAABFRQCBgYjIiYmAjU1NBI2NjMyFhYSAzU0LgIjIg4CFRUUHgIzMj4CBQpSmteFgdedVlWc14GF15tTvzVmk11akWc4OGmRWl6SZTQDBlyk/vy2YGC2AQSkXKQBA7dgYLf+/f8AXoLIiEZGiMiCXoPJiUZGickAAAIAcARxAskF1wAFAA8AAAE1EzMVAyU1MxUUFhcHJiYBknTD3/6GpyoqSVZcBIQRAUIV/sL+VU9IaC06LY////54/+wFUAXWACYABEYAAAcABf4I//8AAAABAAAAAwPX2FkjvF8PPPUAGwgAAAAAAMTwES4AAAAA5Y1QA/oa/dUJMQhzAAAACQACAAAAAAAAAAEAAAds/gwAAAlK+hr+SgkxCAAAAAAAAAAAAAAAAAAAAAAIA4wAZAAAAAAB/AAAAfwAAAWBAHcDIQBwAfwAAAXH/ngAAAAtAC0ALQAtAHAAjwCPAJsAAAABAAAACACpABUAdgAHAAEAAAAAAAAAAAAAAAAAAwABeJx9kD1Ow0AQRp+TgAQyrikoXPATJDDECIpQIYqIBhBCpA6OcYIgRrZT0HEWCg7AETgTB+DzeiEmSGhk75tvZmdnBljhlSZOawl4dzzLDq7TsNzA49Nyk5APyy3WeLO8wCYvlhelDy17HBFU7GywzLrlLVxWLbfFruWd2VtOKBXOKBjwwJiIPrHOhJG0c1IyHk2sL3UobWQiBU/kdNmTpeKYCXeiiSJVnVLJ9Q9MjYQrnbf6Cn278mJpU+UOFL2Rlyl7bCr4HOjWPh0OOZYXikPNWK/gz1Wo3+hxIeuJ/ntz3ptlnpqJnqV+76HqoSPzuZYSm/fr3VwqO+Vekcjkn6hyuavUzOXT/rO1RNXLjKmqBLqVas+lmsoSdRX/7DOXnv2aJDJd52ZjEdtfVntaWwADAAAAAAAA/2oAZAAAAAAAAAAAAAAAAAAAAAAAAAAA) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-greek-400-normal-ai2Z1K3C.woff2) format("woff2"),url(./roboto-greek-400-normal-Bb5mj_fZ.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-math-400-normal-BEFej5gc.woff2) format("woff2"),url(./roboto-math-400-normal-C9RxBKAh.woff) format("woff");unicode-range:U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE00-1EEFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-symbols-400-normal-CB1Ce4Gk.woff2) format("woff2"),url(./roboto-symbols-400-normal-DLYbZahX.woff) format("woff");unicode-range:U+0001-000C,U+000E-001F,U+007F-009F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+2800-28FF,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B00-2BFF,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F000-1F0FF,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F700-1F7FF,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB00-1FBFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-vietnamese-400-normal-D2PTxGxD.woff2) format("woff2"),url(./roboto-vietnamese-400-normal-DnpnVwnf.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-latin-ext-400-normal-C3tdtHj3.woff2) format("woff2"),url(./roboto-latin-ext-400-normal-scX0fKtV.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-latin-400-normal-BqEyEoaF.woff2) format("woff2"),url(./roboto-latin-400-normal-DyYNIH4P.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-cyrillic-ext-500-normal-BWC_xYeb.woff2) format("woff2"),url(./roboto-cyrillic-ext-500-normal-DqF2hftb.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-cyrillic-500-normal-CLao9AfR.woff2) format("woff2"),url(./roboto-cyrillic-500-normal-CBKMylY4.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(data:font/woff2;base64,d09GMgABAAAAAA5YABIAAAAAGtwAAA34AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbHhw0BmA/U1RBVFoAXgiBfgmfBhEMCoJ0gnQLFAABNgIkAyQEIAWFAAcgDIVOG40ZsxE1bBwMA50XA/wfEughKnuK7YfAQd7oCKWRnZ7rMH3WH3FsBrJK3bzAMeKEykqrc8fNcEo8/9JCPtUOSEZIMgsR4dRmT2A5BPzAKrLVj5KUOQV2SkTvPBPJ/6yZqYewZ4G08FV/WXYY3caAaSeSJyC57ZnkuCeCU6b+3i5POXVqT6iwuVQOw+WiJZ6nd/du+xh4IpEGjG2Z3dGcAqlNjz9FxiQtBwosfI2s0pP64PnlfSgiK6u63puWvyu6zeJKfGytZZLFgy+Pz4NRVSkDrVA18oRwmx9A6j+t+Wbf7ib9WwRVjioKSUrWmLw3mWTfzG5gPk5Spi1ni/kq+XUItp44LR8Qu7MnT2h78nSJ6eEnrpetMSCJfdtw0sGYOIEYTZC1L3siQASZFSxzZBOEkXFtks5dewcYpbPs5XmAxHVd6+FJWaPmz5xM2riZYyZFkyaPaJ0qeBvk3l3XJsmvGGDsM+pBsssJ7SXGKgB6sE00k63u1q9ft/CNs/uY/A9jffsUOchhAP1qIwTkoCHbT9I6ofRJKlBzR7eOl0KYO258q5Qg/xXmjVKHIo8kTDQUistbpSSulUr5FYd8rZjRV1AF7VrKo3V62iisrk2uvSPJ4ci+b3EDDuQo7/d+6uEf3uPvfEwqExKNEAnQ16+eDN63q/4P3m8cJ+b13wD3eZCD5+i77dbF702r3Os8+qx9XuEWe/Mhu8JHO5twlrnkiA12ustZyWznZl3Ieke9v+yg2zXxiQXHELMPuLvWbrLP3vlmr7DVXhfd4v48Jf/pt93YUyXaQD44nD1FSJuV1tux+DbV05LpzyjmsZjlDG+p+Wcec8mrvC9FLGSt7Q466dbZSIzdc++e3btWr1q5YvmytuDSJYsXLSzbbTfrFcvQ1HIxn00n4xFJ4NEezmflNIZnT588Pph492j/m/Fo0H/44P69XrfTbjW//CTfWK9laXO5y3fnG/WaSmFrGmyO3TKsJBzh62DEEmTgTG/oioY2xms2EGgKuD7OZIMY+ApWlQZWzbN6I+4NJo4KWQ2Itowxkqd0iS5rfaBcFt12HXuFnoY0UC/LoL6nMgH6EmYJFgu5NaITVt5s8s85jFjPWLds2M31dclHRO443L0H5U/LqAVKqhrU1G8rH3GFoW7iwOHQtyvWwEIhwB6jCs7z9/XPFMAlESw87TspAz/WuNFDx+2bljIb8r6KD/2cfiI29Vqi6Jiq2fEgSXY8mriqQSHneNK9om7hbrjjU43PMsCe7faUCOGe01Qv6w3deaXXlci9oDtq/11TVqsLeM+Cu3whpcKYxtwiZB2V0ou2hKOnrFQwXeJYbsxud6GE0D2XmXZ65212mGFbtt+OUJEqvV3QfPN44t0CfuGWJZFCQdAbuPJOCbbrt6TfKYRO4uUE6QnB/GeI4lhlgXvkjG9yrDj4NjXeEkGk+FRdQpW6k92hXisSXZaHdtb3gSAAVwevGQWKqa+GjBz/qqCNd9/aN+o1AvTJ8VyzTy1vyWmBEctpbeXzYGWg0fDq4/zKTkDRKbkZuCw0jjtwX7lPw64Hm66ivCmSKpdR4gfBO4mGzxKOn2U31I2E/coWNsr8DrJyhzruprrproBbCtx9/RcXXNB7L2SDp0SQvjvShz6CSwhH6HJHJx0djfHvZfUaFQke2Ea91hskeWj7Bw4FnEoSGrR56fNYxsteDaPZCPnaaqPhpeoKkuJWLIPKL7xQyUy8sYsjzSADaAgw4tRMJnLfZDxxkv8845FLckvWqIyaSq9lrvTzyka9ljlQTctrkkxqYaZbysNgz4rVNPAUeWFwuA94FPhQ2RANd5sUZQ83ST8XMxXBIM6EyqEzNPOcN5YBfTf3aUFcQ1A0sFwarmLSiAP3BaQ4Sh3PVRNOC9CcEMlIyo8y2Nc49JatXcTrlIRzvsIFocBpQYtNkngtIwjY8Yeg0z2Q3FQbD20vyqjLDsQKrZ2PY6u2DROwOgPCpHq89il4CoGBu2x07JgqHcYBRout6tuE4eiJIxtlot6Anzmr4KoT983ZIITv8r4HaDvfqOkCRg6gJbAU2ajQLEgQjLB2irgTp5bjHBzaDNhIHqWheIg0btIFGy8zhD/JeasripGFX2qUVCNhKVgY9qRJ+LLMvoYnuYJuuR8sG8qpSd1djhohR6hOKPurlmP2/QgdAhwljmxaWv0MmwtdJ1ZgiOW+BBg6jLJpF8HEzizouCQgB+yGz8RBd5aBYil3Qi2IMVrDGgLVGOm36ohHGgs6ZZXPXJPfZi9cNqwt8HJIwK88ttClkkU5k/J6Rb171MqBCs+MoEjNRUR1TRQQVc38nfsRJCNgtBoSGbbRVXww7SCBofF+E7RvjKSEei0XMpqex/fuIGoBuJnumNFA0mnUbruRl2a1GufnPVir4oPeExd5J+oyxcuZKecebMFuOJOMVlZxS1TuGpWDfYy6A2cMm1VNOLRnJExY2bAvfOnZsLtCYHYEZU1WTZiUgHcU4HZWWKkIOCsgqFBL8CsKsfjSDfy7JupWke0L0nPy7S0pWTbC7Oc53neAS/oaTQ6BxEnai2vLgLFb1kv+Glg0vOlWbYmY8glZ/AZF503lQ4eA8RxYsFSicPw1yTMQ1hoErzOgkiBWpNNw7RUudlKtC10MF7Rz11OkeW0kLG/VtLQzS23uHhd/AymX4TxtqfDP5kcL6DfPHpU3M3bGRFnXVdgkOdfrv4c3Qs4qWK056W6r6P3uUkI6Aht9cUsWqYE+ykX2UzUhh0c1Q242YYMtAo0rf6EJWKfYD0OJFdKPfchaJaacsL/T2C3pZY9UyqG44tPAD17FytIqGj597hqg5RI2fwMobXkNyla7lBfEC/JB4MnWaxLWNuqAaxS9fZY9XdouE0FOic1pIst9GI5alQyCvU7A8Mv/684JNM5xzQmgKMvfg1/7IO05sfJpYTu9238cPXa/kLfs/1Cxg1VDA1n/+0SLYpx3n9jdW/5Fa/CuEqP5iV5E6MzYrIa65UgVuMVCZyVEQsVq7uAleG+a3nCf+DmjieOcsmvq2iFQxEcXH8ERNO6avuyBXxW/+vE3RUMLxsbClO/R9cJvABu+7ExrzfhtTLByYobvLgm8ZEFia0F6I2iPw4KNyRuzcFh1yv+WRZGOJLBU8Jy/N/6IVfCUfzBUjMH02EmfAqi4/6GXQKeqHkN17bsSMQDCqao2fn+mIAMftTIStv6FFFmr4vkfNm13/AHfiVpRntlr8Uc07Ay+JQE6teFfcwnAG4OwbD8uizLPhgX88SO3SeBgpwbt093eXmUoLCyv7JIN8ePHqc8cBgSUYgeKKCACqFMrZFg7SoHWwxPeeWdl4ye1I5s/hLzr+Ye8wszCeXGwAP2wCwn+V18NW/f662+LtL3zxhvh61977a3AE7xuWSZ49ZgEwZe14A2rXyjN4TSOlPB3+bqA5sCanaHL5XKNEaKPHi1bmb2AiX95sqUwsfXqthyjtfahBrxC/5OOceiO94avXvXu8KN3NBonwZU36kfufMqrVhMf4vCdg/W/f30WVN3dtGS5PWhQmx33Vd+9oE+tvqcl2AaBv7cbrPor/r1bVyR8e/1TiR9dt/TPyZlAx8IRu3p361vcvCFumyKMrogP83/LA0H8P9n71hhlvG77i82MWG2m6Z9JeXldbH1N7e2GEelTykd1fXXMc3XV87e/Q1NVsRA3mPKGBgTQtDfuSn7tDIu+9jcr3QLg0R/3CsBnG9NaC/qNHtLqCnKAb/L/W2A8pfBxTmSRzeHXNjCaLvkPJozljNHSGV0X0lr0/pYVmFyLjiKGavZBfR49G4UA0dxNQ3Q/cHMSYkZI4++MIopvMxo13Nus82UMitjFJpdelInicrpmYojgao5tqao5pJAwCrjY0ilcYumI5koZrrM3Qw9aGcFkbozUUzKILY7Ad02ao0zpyE0j9TGcUHF/MctytnHXA0NSuOILNCvVyfM8PjAzNI8ipg3CMt20Un8rrqVVEbiYM6XXpA6L0dXF1TQMbAhrr6xvNVJsSOrzUkNsmp0s49n1Ex0U78KY9tmwfIvyiGyXNafF5FEY9KfDplGdR6zuydQ8WK/puS0Xxoj9VMORXJbVbdxTqykFY55fKyYGHmSaa6UsUz07sGnat2skHmVLgpG+J7p7Osf/4IT94/3d9ydsHzc2L6xfB1ptr+wNzI2DvlKgLljusDj/5yfMjiamR+5Pjg8xPhRodHwgcgViAD44fzjLg27/C/sNeu2m23B0CrTLRatCs141MtQT1CJUw38lQDm8lTwUHRQsH+WtAuV0E1kNGX2TNpAyF0kFCSlDcXkTkxCVRUSkDIUFhBgEGYUABz+n4AN46ZWHgpuA6wcctmvbbXpkNbxbjBTMxhRMRi4yGq50Wjc0agoqZRQyqRuizyehQIwEkOrTU1sK0uKy84201Ja8VI/nXJedc2VKUkt2SmV2VrJHkrwlyZedXp+a0ZzSkJTRnHZxk/9zElOvTzrVFF8b58TWxjhxbowb2RDhGA26E+HqbrY+TFfR+lL9B12LHhrlhDeEOb4G05FanCg3zDXdpaZUm/3MaaZ2gznMXGpquNVINdP4Ac3fYDlag3IsV7nZaphS0Wqp+kFpmm0bcqdsCQXKe93p87K9Qv7+zSFZEyoclb6qPaApZK4J4TQ1N7aLbHJXbtxIZsdeoS2DGm/WuD+S265UpwGN7bq2yZ3VSjnl5eUv9NXZlF8oSaLENcuJnkquoykHD/kWobEqo4ySnL/L4NL/SaUA) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAYUAA8AAAAABuAAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAABQAAAAUAA8ACEdQT1MAAAFsAAAAHgAAAB5EdEx1R1NVQgAAAYwAAAA0AAAANJMNggJPUy8yAAABwAAAAGAAAABgl+bQ5lNUQVQAAAIgAAAAWgAAAFpfmkDZY21hcAAAAnwAAABUAAAAVADNH/FnYXNwAAAC0AAAAAwAAAAMAAgAGWdseWYAAALcAAABNAAAATRvqViDaGVhZAAABBAAAAA2AAAANg01sE5oaGVhAAAESAAAACQAAAAkCvYNwGhtdHgAAARsAAAAIAAAACAX6v+ZbG9jYQAABIwAAAASAAAAEgGCAVdtYXhwAAAEoAAAACAAAAAgACgBIW5hbWUAAATAAAABMQAAAlw0y15acG9zdAAABfQAAAAgAAAAIP9tAGQAAQAAAAwAAAAAAAAAAQAHAAEAAQABAAAACgAcABwAAURGTFQACAAEAAAAAP//AAAAAAAAAAEAAAAKADIAMgAEREZMVAAeY3lybAAaZ3JlawAabGF0bgAaAAAAAAAEAAAAAP//AAAAAAAEBJQB9AAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HAEAAAB9NBgD+AABmB5oCACAAAZ8AAAAABDoFsAAAACAAAwABAAEACAADAAAAFAADAAAALAACd2R0aAElAAB3Z2h0ASgAAWl0YWwBMgACAAYAEgAeAAEAAAACAScAZAAAAAEAAQAAAS0B9AAAAAMAAgACASgAAAAAAAEAAAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAAAAA0AIACgH03//wAAAAAADQAgAKAfTf//AAH/9f/j/2bgugABAAAAAAAAAAAAAAAAAAEAAgAIAAj//wAPAAUAZAAAAygFsAADAAYACQAMAA8AAAERIREFAQElCQMhCQIDKP08Ao7+7wER/agBDf7zASr+/gID/f0BAgEBBbD6UAWwVP18/XwMAngCeP1E/aIFRP2iAl4AAAIAZf/sBR0FxAAVACsAAAEVFAIGBiMiJiYCNTU0EjY2MzIWFhIHNTQuAiMiDgIVFRQeAjMyPgIFHVaf3oeG3aJZWKHdhofeoFf7L1uEU1OCWzAwXYJTVIJaLwMAUKX++rhhYbgBBqVQpQEFuWFhuf779VJ6u39BQX+7elJ6vIFBQYG8AAIAZARwAsYF1wAFAA8AAAE1EzMVAyU1MxUUFhcHJiYBi3LJ4v6AqCYqTU9cBIQUAT8V/sL5WlRCYidIKI3///5s/+wFYwXWACYABEYAAAcABf4I//8AAQAAAAMD18ni+0xfDzz1ABsIAAAAAADE8BEuAAAAAOWNUAP6Jv3VCWEIcwAAAAkAAgAAAAAAAAABAAAHbP4MAAAJbvom/j4JYQgAAAAAAAAAAAAAAAAAAAAACAOMAGQAAAAAAf0AAAH9AAAFgwBlAxsAZAH9AAAFyf5sAAAALQAtAC0ALQBvAI4AjgCaAAAAAQAAAAgAqQAVAHYABwABAAAAAAAAAAAAAAAAAAMAAXicdZA9TsNAEIU/k4AAhdSIygU/oUhIjKAIFaKIKPhRhEgNjnGMQhbZTsEVOAYnQJyIE3AGntcLioXQar2f37yZnVlggzdqePU14MNbdeyxxZfjJZp8Oq7R5d1xfcGzzC6vjlekPztucky/ZG+HdWWXvEeDbcct8abjtrjhOBDBOTl3TEkIuSBiLJrzxEicEDNR/BJDKq3wjaSOpU1sJFcnmTo40DLiiBkPopkiZc1CyfTt2BoxQ5332rl2u3LjrTiVN7H5PofK6dLjiBP9BeJA0y6qA660BqL/qw7FsWiq7tOKz6/4zmz/L/L8TF3e2dPyuZES6azmX8tteFQktP5TVSpextg5fFp/3ihW9cIxV5WOsoxuLlSjFavH6Pf1MulpZarQzpDZFwrZ/wZC5llgAAAAAAMAAAAAAAD/agBkAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-greek-500-normal-C9AnhcmC.woff2) format("woff2"),url(./roboto-greek-500-normal-oCqhoyfc.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-math-500-normal-C4NU9gLX.woff2) format("woff2"),url(./roboto-math-500-normal-C-7mKPO3.woff) format("woff");unicode-range:U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE00-1EEFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-symbols-500-normal-B_CZKVJS.woff2) format("woff2"),url(./roboto-symbols-500-normal-F7c8nfcH.woff) format("woff");unicode-range:U+0001-000C,U+000E-001F,U+007F-009F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+2800-28FF,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B00-2BFF,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F000-1F0FF,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F700-1F7FF,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB00-1FBFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-vietnamese-500-normal-B3ncpOoB.woff2) format("woff2"),url(./roboto-vietnamese-500-normal-D380IkQ8.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-latin-ext-500-normal-pMCM9Ixg.woff2) format("woff2"),url(./roboto-latin-ext-500-normal-Cyc0AKLz.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-latin-500-normal-7RbcRiD8.woff2) format("woff2"),url(./roboto-latin-500-normal-DQZyH_nt.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-cyrillic-ext-700-normal-DmFxo5wj.woff2) format("woff2"),url(./roboto-cyrillic-ext-700-normal-CI7FH63F.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-cyrillic-700-normal-C2o7G-SM.woff2) format("woff2"),url(./roboto-cyrillic-700-normal-DhZFXDSN.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(data:font/woff2;base64,d09GMgABAAAAAA5cABIAAAAAGqgAAA37AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbHhw0BmA/U1RBVFoAXgiBfgmfBhEMCoJ0gnQLFAABNgIkAyQEIAWESgcgDIVOG1cZIwPBxgEIZL0e4K8ObEPUOqx/RlhaxGdLcUECIUjZFAN1lOQYjjf+W38d3tVNMLC3IZYDS3uEJLPwPL1X/bmVqiSNpbOQsyCH6lmwF+qFNXik/97k+Dn9UAHwypCWBwBvW9aOKf2IloVnNTdjpsxHIc/q99s3gWr6ZjcjVpmLiGloZBpDSwxd86OJXugxOtaFfjcd2/zS9PVOKd5XtA2HxWwJUnXIDNGBab53KRcAQfJbRedYS7PumgdVp9IpPo7m/N5OkvZeDkEdVx0KSUqeMZnZbpvZTfrSPdz2mHKcHOYpckdsBMIHZiG//EJbQN2L7R89NuvUFUiC/3iN2Wn+2ILISBxf+yJAlMwKrjmyBcI0PLbI8JHjpzNKs+wXBACJu3Wtw5MaJ60szKZ+WmFKVjQue0ksV/AW5F5fW5nqEQyYE6Y7SBM8Z71JqgKgB/tEd7LvdNSkSaPwoMkEmwqKVOeEwkPOAuh+pgTwsBAEV3p4TayfrgNqeXIsXVrC8rT0mLRBMmJLsqUbimbUxsZCoaRNq5Rg66WzeoSGfLs1yTdQde1a8OGasbYybtc21/6V8DjXZEKLCzSQ44L/8Jvg4Iufv2sxr2yoZUqoCX3dbzwEv6ypiMG/HNfKsz8Dj/IEp/fhD3FUt/5s2coj3ESf6wRvU85x+YIj4Z1dlwgbucM5dnGYB7lOHQ5y065mJ+f5bMVp7tPEl064gJh9nIdq7R5O2GuX8Tb7Oc5tynlMXpT/9dtRHKsSNpAPz2ZPoYQNbGEnh3K+V/W0OkwmiRWsZRPD+2p+nRe4wzt8Jq1YzQ4OcprL3KN3U9Ufe/zY0SPbtm7ZvGnjhvh69LPP+/V83G/Xy/l0POx32816tVzM0zj0XdvUVVnkWZrEURj4nmNbpqFrqiJLIg96pSJFX18PDwQH9rh0irpWRtJQNfbirWELnIpPg0mB4C/Fz1cyHDjv1bGHD40h3Jj2llQZagVXlQa2muear3m+3AoNbXFAtMeGInk6H9fL0jIoyS1GhvPEG4wqJGd0ITTGsDyVCYwssS+Y4Nb5rkjhlY38NQeTgjKWBvYsB32muNqN4ib2r37Rp9U0hhJqq1Y7vyP/yK2EzFbgxaNOKtZhAGCfdUuDfyl/oAgvE8EG7xZiTSEndrThK+Fnn501ZU+qbfBkZvuG2Hc7RWm90rz+MKX49XfaVtqqFbwP0+Wj0g2JPS0t+IABz/NdgxIR3MKkal53V663Wl3ry724a2n9rcvtuED3XHjQF0oqqmrMbYWso0q64Us4uuSW4uU2jutW3etBlFDyqGamlN55NT9sfNcP+VFVSTUoFTKXjSc+JBASyqNSSSiIe1NXPyDxUv2OBg8IJRu+nDi9IF77DlCcqCycs1Ub321GKw6fMXd2eZRK0humMVSpXnaHbmdY1CDw0A78MigQIGujOiaBxdTXwl8L/5rovLpEB/Wfi8CIhA+OtdS8Z/lDTApcllxiDDbQaHgt4+bpysHCNPMoclloOJ7CmXxKEUtjSNdQMzJJy8tJ4isRK8pEEQv1y+plEcOJ/MPq0ENE9WpHvapeuTY4yyExX//CQx7SZ+8siXdE8Bdy5o6a4GX4nKBVzxWt9bzXz+puh4aFQRh0O/Nl8X8Ii7eCgkwkSwxo6wWmnK77Dbxjb9XXNx8MVCozJCt5nXJU+UMVKpmJVxzBifbwl9AgMOXUbLdyn2WzFYveeM9rKf5rW0I5OcrqbE728+pBt1M7qLpdXJNkUsZMt8jHYN/Wq3aRd8SLw4uPXs8CH5WFaHhmUuCebLGxPNyrCIZp5ixZiae9ct5YBiM5aJpT1hEsGFhpVZ9RyoID10Ws5Cx1/KxGcFKExiORDEn5cR6ZDtka2J6VEN+ReQ0/ZUQocMYwZpPk4jlBAfb4Q9CZHUqyc16h2Rs26oKBWN3ahcgNap/BBJmJh0KTsogvKCrFyMA48S52TIuOaYDRYqsWbcJw+FbIJptWb1jPnDVwZiJedmCPEH2Rag/Qfr6ixgxMBaQtwVZSjyZGBTmCIWxOUVy5/MDpAC/aDD0jeZRG5iHSuMUN2avMKPiTnLe2VdoOeefZmifCghhgcGLVzXtisz+xbyrhc+XTGNhTQyPq7iQ5hByhpiHRZ1Zl9kMQOgQ4jsgJZcFlUKthUV4QGODyQAITwWQ27UQwqYIAFX8sIAfsJZOtQHeWgcWSTGMt+MY7DesIahZj/VFT8dhRQZdspZnra/vsRaRhbQMvCiFwk9xgQalkUU6TanpFefHkIAdWXNAIbGQuplrXxJHQ0jh8qn+C1AhYr4WfGD7DtcETI4EfGRrVXdCuMZIS6rVdqdH06tt1B9XWgRvR02YUqnQ4ame/kZfN6mmcX/Nguw2e8J64ygfVrrDwfmbKuQcpkB7tJeNLq7glyqtNeXmMkXkr3rO/7AhH7ZsI04IltS9679lotkJgdgzVI65GMClHrAJqUiOrK4LMJhRUL+X4o9JqTz2+g79nUbr7l9iC9DzNzRu/JLakuP97Ti8EtN1zmhwCISf0bGJZYDCTi+kLegttNFrerZoYMdUSsvgFDcebyg0dBsZzwAabMAp9X5E8C4krBsHVEaBCQaxIZ8Ar7+h8J7Vn0Gh0TjvPPEWa18YSy1urLLg1S22UJ1z6DsJ4AsfTngr/bF0TwMg8u6i8m400Jo50XRPXSW70+u/hjZDjgK0dJz1sGwS/u5SQjsBGP1ySRWqgr3Ii61QjyPFWo1CdTdggSqC48tdNQIhiFwydrJD+7CPWKilJkf5aG7mQvqgIkxpYeOrTkE92sMT6iQa7dA2olZa4/h9AadsnNL86pLwoayM+CKwN3Y4lrkRre71So29eZE933sSpQk6JrWFBRI5hOGlVaBDs9wgGf/6/7pxEwzmuOQmsmpWfwV37ILwkL8iXCanl9K7j8I38Sd6y/0PFjrQMPWT37xMWxThfnBcOb/lPrcFGlRjNTvQuQUutzOJYtl6iClxiobOWSIRKxerJS/jZNPPVMfHzrLfCDdXPq+enQDGfXbwDIWjIc/dEIac2+DGjF0WDMUxtzKPmhM6adwdyxpYwy1ozfQcTbHJihp9FluClFuRuGL9xa2ieh4XXJl+b9dOq0z4WWBTpyENUy4t/8f5ItRz4V0+lGB79JNIE4Kn+l2oJ2lXzc6hFp4IRAwiUW87r8UxdBrI9mQiR32Al9bkNbmbY2+74wFuUGvYKjvk/adgZ2WICLHSef10bqJ1BWNpP23yby54FXCaNb7lPggaV2yW61cv9/GwEhYsbIFXIBoTwq/OBw8B04BBQGYgC3bDJsHaYAq3DE2rXtsOrqSyRlSFX8bwyb65eEYer0Le7mvgH77wTTrz33kciGz5+//3Iznff/XDxHb5nARO+s42D+LuBhe9bdrXMizB7qUQ+ycDpmkO7HC7plejVABOij5/BrRSvYtJtLs9vWSvWr63ExEpPnvrVf3hljnPxga+WJHbYky4/MNe5MuLqHPvSg3eyI2FB/Dbm2p1+Hom1vTtlefGA8eNjAyYvzw+NjSpqWzJlRfFAMPDJpBXtL6VG3emb6ub3f83ydfeWf9evzR7UbP65KVNHNZ+3vXolWmFGIg52RShA4lCxHfxiYuY9P9TabljNKrRDhbRv361a9y5d7zOmkqOUQ+funau+Wujcpev9lupUDarPpH2PHghgWe+3+qa7/aIqA/51G7gAPPPHSQbg290jywK/r2+HUCxPEnCyK6JgXho+007mks0QsnaRzCL5H+bMZmZadZhbFtJKuH9QOmAzAI2iKp05Aeq7KsUoBKjEBSxEh4Ay/osVIcpPFYXLVxWLDtxX0dTmXMXQilVsc+XkqZXpRaf9pCVhWoRKa6LUddqUo90622tKt/bpYQwxlpBNBknMIoUM0kgnxkTyKCSnHm1SBsnE8MSWzqeIfnTeOS9Pp5BLKnlRHNNFVC5qupMem8bUmJd6J2Y7MrQH2uHJzHQKdYa89ehek+5CV3rSH+Fux4XdkFx56+cr8tsRZvbLGaFhS+JFDj2w9ysfIrZZWuX8bn0sorDXlX07ixjzMat3ZNp93PWLvmjJxX3EPNQ+4IgrfZdtMuw0fVbDF8YHZ+ee77jD9RRbwDsHbzXd8eq6OCzZgvCY2uWJvcEz/il5C/i44f1HXT/Dw0YvPGji/WYX3CvJ4G4d79QPoFObAbGGV2W8rN5eVPG8sg5nldw/rbyNk0oajit2OOLxsIAHBc7fLyZ7eftfuJvDndxPuOQOYCuDm5kXcMzievYz7NPYTmEriauJWyGBKwkNLMdxKYYkGoLFaBoWwuswH8a58E8YRXAm8gIGIZwKJmEy+BO6QRwPLsFYMAmjARzx4bBPhCE/DvpFGADs936Gjhd7Pdjjxq7G595fzQYP9ZIWamURquUZqJQDUC59hlqhF/I5EbKZcUgmeiHq4CASjkG46HK0Q04jBCVORzvgQL+vC3xVu7UN9jR4beixotsqA1fR4W7Zeau75by6tt8di6Pb+mXVlDcSQ15PjIJe0PBqIuE5ohY4AbgNjtFxz7n/2tKta4mKVxIZLyV0niKVBaUgFZ5TdFY6I72Qsj3SDelzKUtpZ4ruTF3wHyvEywnLM0QuMAIwGwyjY54z/5XF9vaS9E29D9OTEzdOMJkAocktINvRcop9Un8uBfZ2QOZmMRR5p29378YzdALsm7bytbjekQCVGpiLobbeaeeMJEm2Tz7Qty5I8kpJVkpad3qjl6Jvw6kkuMmPCMWijDLK6tpDBpfqelN2AA==) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAYQAA8AAAAABtQAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAABQAAAAUAA8ACEdQT1MAAAFsAAAAHgAAAB5EdEx1R1NVQgAAAYwAAAA0AAAANJMNggJPUy8yAAABwAAAAGAAAABgmK7Q0VNUQVQAAAIgAAAAWgAAAFpfnEGhY21hcAAAAnwAAABUAAAAVADNH/FnYXNwAAAC0AAAAAwAAAAMAAgAGWdseWYAAALcAAABNgAAATZveQfraGVhZAAABBQAAAA2AAAANg1psE5oaGVhAAAETAAAACQAAAAkCykN02htdHgAAARwAAAAIAAAACAX6P92bG9jYQAABJAAAAASAAAAEgGEAVltYXhwAAAEpAAAACAAAAAgACgBIW5hbWUAAATEAAABKwAAAkozllu+cG9zdAAABfAAAAAgAAAAIP9tAGQAAQAAAAwAAAAAAAAAAQAHAAEAAQABAAAACgAcABwAAURGTFQACAAEAAAAAP//AAAAAAAAAAEAAAAKADIAMgAEREZMVAAeY3lybAAaZ3JlawAabGF0bgAaAAAAAAAEAAAAAP//AAAAAAAEBJ8CvAAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HACAAAB9NBgD+AABmB5oCACAAAZ8AAAAABDoFsAAAACAAAwABAAEACAADAAAAFAADAAAALAACd2R0aAElAAB3Z2h0ASgAAWl0YWwBMgACAAYAEgAeAAEAAAACAScAZAAAAAEAAQAAAS8CvAAAAAMAAgACASgAAAAAAAEAAAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAAAAA0AIACgH03//wAAAAAADQAgAKAfTf//AAH/9f/j/2bgugABAAAAAAAAAAAAAAAAAAEAAgAIAAj//wAPAAUAZAAAAygFsAADAAYACQAMAA8AAAERIREFAQElCQMhCQIDKP08Ao7+7wER/agBDf7zASr+/gID/f0BAgEBBbD6UAWwVP18/XwMAngCeP1E/aIFRP2iAl4AAAIAVv/sBS4FxAAVACsAAAEVFAIGBiMiJiYCNTU0EjY2MzIWFhIFNTQuAiMiDgIVFRQeAjMyPgIFLlqk44qJ46ZbWqXjiYrjpVv+0SpSdkxMdVEqKlJ2TEx2UCoC+kWm/vi5YmK5AQimRacBB7piYrr++exHdLB4PT14sHRHc7F5Pj55sQAAAgBaBHACxAXXAAUADwAAATUTMxUDJTUzFRQWFwcmJgGFcc7k/nqoIytSSFwEgxgBPBX+wfZeWD5dIVMkif///mL/7AV0BdYAJgAERgAABwAF/gn//wAAAAEAAAADA9fKS6B2Xw889QAbCAAAAAAAxPARLgAAAADljVAD+jH91QmJCHMAAQAJAAIAAAAAAAAAAQAAB2z+DAAACYz6Mf4zCYkIAAAAAAAAAAAAAAAAAAAAAAgDjABkAAAAAAH9AAAB/QAABYQAVgMXAFoB/QAABcr+YgAAAC0ALQAtAC0AcACPAI8AmwAAAAEAAAAIAKkAFQB2AAcAAQAAAAAAAAAAAAAAAAADAAF4nG2Qu07DQBBFj0lAgAIlonTBI0jgECNSQAUUEQ0ghEgdHOMEhRjZTgFfg/gECj6Ikg+g5nq9CY5Ao/Uc33ntDrDCGxWc6hLwzrdlhxpfludY5NNyhV0+LFdZ49XyPFu8WF6Q3rO8SguvYGeTZTYsb6v/uuW6uGa58TvL8aXCORldhgwI6BDKR/SlXRCT8GhiHak9aX0TyXgi5YiGLBaHjLgXjRQp+uRKqq9nekRcy9/pZDp7nOo7VL9bZSTKG5halwPl79PkkGP9+WJfryvXutPacm6bS1lb9P+ciS9Hz8zNnzV/8t5iYlPmciMllJ+dfaXsmAdFApN/wtjsJDavcKn/2U6k7nnGWF08VcXaZ67Gskh3Cqd7S6UnM7cPFO9KT81Gd34AgExWjgAAAwAAAAAAAP9qAGQAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-greek-700-normal-0aHWxGLu.woff2) format("woff2"),url(./roboto-greek-700-normal-DjRqqLBV.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-math-700-normal-B8YqGHVc.woff2) format("woff2"),url(./roboto-math-700-normal-DVoD5t2k.woff) format("woff");unicode-range:U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE00-1EEFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-symbols-700-normal-BiFDindJ.woff2) format("woff2"),url(./roboto-symbols-700-normal-BoS6HWkc.woff) format("woff");unicode-range:U+0001-000C,U+000E-001F,U+007F-009F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+2800-28FF,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B00-2BFF,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F000-1F0FF,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F700-1F7FF,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB00-1FBFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-vietnamese-700-normal-BEVeWqJt.woff2) format("woff2"),url(./roboto-vietnamese-700-normal-DsFyXAL4.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-latin-ext-700-normal-DSBUz0N1.woff2) format("woff2"),url(./roboto-latin-ext-700-normal-BUhwtWwy.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-latin-700-normal-BZpUvMxY.woff2) format("woff2"),url(./roboto-latin-700-normal-DLgJJpmK.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Material Icons;font-style:normal;font-display:swap;font-weight:400;src:url(./material-icons-latin-400-normal-kAwBdRge.woff2) format("woff2"),url(./material-icons-latin-400-normal-B5tbEuci.woff) format("woff")}body{margin:0;padding:0;width:100vw;height:100vh;overflow:hidden;font-family:Roboto,Segoe UI,"sans-serif"}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid rgb(179,197,219);background-color:#fff6}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:#003c884d;border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-singlebar-even{background-color:#000}.ol-scale-singlebar-odd{background-color:#fff}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:12px;z-index:11;color:#000;text-shadow:-2px 0 #FFFFFF,0 2px #FFFFFF,2px 0 #FFFFFF,0 -2px #FFFFFF}.ol-scale-text{position:absolute;font-size:14px;text-align:center;bottom:25px;color:#000;text-shadow:-2px 0 #FFFFFF,0 2px #FFFFFF,2px 0 #FFFFFF,0 -2px #FFFFFF}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid black}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ol-viewport canvas{all:unset}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:#fff6;border-radius:4px;padding:2px}.ol-control:hover{background-color:#fff9}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:#003c8880;border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;background-color:#003c88b3}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:#003c88b3;text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:#000;text-shadow:0 0 2px #fff;font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:#fffc}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:2px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:#fffc}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map{height:100%}.ol-control{background-color:var(--mui-palette-background-default)!important;border-radius:4px;padding:0;opacity:.85}.ol-control button{display:block;margin:0;padding:calc(.5 * var(--mui-spacing));text-align:center;font-size:inherit;height:1.9em;width:1.9em;border:solid 1px;border-radius:var(--mui-shape-borderRadius);border-color:var(--mui-palette-divider)!important;background-color:var(--mui-palette-background-default)!important;color:var(--mui-palette-text-primary)}.ol-control button:hover{background-color:rgba(var(--mui-palette-text-primaryChannel) / var(--mui-palette-action-hoverOpacity))!important}.ol-control button .MuiSvgIcon-root{font-size:1rem}.ol-control button[data-selected=true]{background-color:var(--mui-palette-action-selected)!important;color:var(--mui-palette-text-primary)!important}.ol-control button[data-selected=true]:hover{background-color:rgba(var(--mui-palette-text-primaryChannel) / calc(var(--mui-palette-action-selectedOpacity) + var(--mui-palette-action-hoverOpacity)))!important}.layer-panel{border-radius:var(--mui-shape-borderRadius) var(--mui-shape-borderRadius) 0 0!important;border-bottom:none!important}.split-mode{border-radius:0!important;border-bottom:none!important}.info-box{border-radius:0!important}.snapshot-button{border-radius:0 0 var(--mui-shape-borderRadius) var(--mui-shape-borderRadius)!important;border-top:none!important}.ol-scale-line{border:solid 1px;border-color:var(--mui-palette-divider);border-radius:var(--mui-shape-borderRadius);background-color:var(--mui-palette-background-default);opacity:.85}.ol-scale-line-inner{border:1px solid;border-color:var(--mui-palette-action-active);border-top:none;color:var(--mui-palette-text-primary)}.ol-zoom{top:10px}.ol-zoom .ol-zoom-in{border-radius:var(--mui-shape-borderRadius) var(--mui-shape-borderRadius) 0 0;border-bottom:none;cursor:pointer}.ol-zoom .ol-zoom-out{border-radius:0 0 var(--mui-shape-borderRadius) var(--mui-shape-borderRadius);cursor:pointer}.ol-attribution a{color:var(--mui-palette-action-active)}.ol-attribution li{color:var(--mui-palette-action-active);text-shadow:none}@keyframes hint{0%,to{opacity:20%}10%{opacity:100%}90%{opacity:100%}}.hint_wrap{animation:hint 4s linear none;opacity:20%;transition:all .3s ease-in-out;color:orange;position:absolute;bottom:8px;right:16px;z-index:10}.hint_wrap:hover{opacity:100%}.react-resizable{position:relative}.react-resizable-handle{position:absolute;width:20px;height:20px;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+);background-position:bottom right;padding:0 3px 3px 0}.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-resizable-handle-w,.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)} diff --git a/xcube/webapi/viewer/dist/assets/main-qd3DiARX.js b/xcube/webapi/viewer/dist/assets/main-CvAypEXI.js similarity index 50% rename from xcube/webapi/viewer/dist/assets/main-qd3DiARX.js rename to xcube/webapi/viewer/dist/assets/main-CvAypEXI.js index 66a7f56c7..e5a000f36 100644 --- a/xcube/webapi/viewer/dist/assets/main-qd3DiARX.js +++ b/xcube/webapi/viewer/dist/assets/main-CvAypEXI.js @@ -1,11 +1,11 @@ -function wdt(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Rs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Sdt(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var GG={exports:{}},xk={},qG={exports:{}},pr={};var Lbe;function _dt(){if(Lbe)return pr;Lbe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),f=Symbol.iterator;function d(N){return N===null||typeof N!="object"?null:(N=f&&N[f]||N["@@iterator"],typeof N=="function"?N:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,g={};function m(N,B,H){this.props=N,this.context=B,this.refs=g,this.updater=H||h}m.prototype.isReactComponent={},m.prototype.setState=function(N,B){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,B,"setState")},m.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function v(){}v.prototype=m.prototype;function y(N,B,H){this.props=N,this.context=B,this.refs=g,this.updater=H||h}var b=y.prototype=new v;b.constructor=y,p(b,m.prototype),b.isPureReactComponent=!0;var w=Array.isArray,S=Object.prototype.hasOwnProperty,_={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function T(N,B,H){var Q,Y={},Z=null,pe=null;if(B!=null)for(Q in B.ref!==void 0&&(pe=B.ref),B.key!==void 0&&(Z=""+B.key),B)S.call(B,Q)&&!E.hasOwnProperty(Q)&&(Y[Q]=B[Q]);var ie=arguments.length-2;if(ie===1)Y.children=H;else if(1>>1,B=V[N];if(0>>1;Ni(Y,z))Zi(pe,Y)?(V[N]=pe,V[Z]=z,N=Z):(V[N]=Y,V[Q]=z,N=Q);else if(Zi(pe,z))V[N]=pe,V[Z]=z,N=Z;else break e}}return U}function i(V,U){var z=V.sortIndex-U.sortIndex;return z!==0?z:V.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,g=!1,m=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(V){for(var U=n(c);U!==null;){if(U.callback===null)r(c);else if(U.startTime<=V)r(c),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(c)}}function w(V){if(g=!1,b(V),!p)if(n(l)!==null)p=!0,$(S);else{var U=n(c);U!==null&&j(w,U.startTime-V)}}function S(V,U){p=!1,g&&(g=!1,v(T),T=-1),h=!0;var z=d;try{for(b(U),f=n(l);f!==null&&(!(f.expirationTime>U)||V&&!R());){var N=f.callback;if(typeof N=="function"){f.callback=null,d=f.priorityLevel;var B=N(f.expirationTime<=U);U=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(l)&&r(l),b(U)}else r(l);f=n(l)}if(f!==null)var H=!0;else{var Q=n(c);Q!==null&&j(w,Q.startTime-U),H=!1}return H}finally{f=null,d=z,h=!1}}var _=!1,E=null,T=-1,k=5,P=-1;function R(){return!(e.unstable_now()-PV||125N?(V.sortIndex=z,t(c,V),n(l)===null&&V===n(c)&&(g?(v(T),T=-1):g=!0,j(w,z-N))):(V.sortIndex=B,t(l,V),p||h||(p=!0,$(S))),V},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(V){var U=d;return function(){var z=d;d=U;try{return V.apply(this,arguments)}finally{d=z}}}})(QG)),QG}var jbe;function Tdt(){return jbe||(jbe=1,YG.exports=Edt()),YG.exports}var Bbe;function Pdt(){if(Bbe)return dc;Bbe=1;var e=hg(),t=Tdt();function n(x){for(var C="https://reactjs.org/docs/error-decoder.html?invariant="+x,D=1;D"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},f={};function d(x){return l.call(f,x)?!0:l.call(u,x)?!1:c.test(x)?f[x]=!0:(u[x]=!0,!1)}function h(x,C,D,W){if(D!==null&&D.type===0)return!1;switch(typeof C){case"function":case"symbol":return!0;case"boolean":return W?!1:D!==null?!D.acceptsBooleans:(x=x.toLowerCase().slice(0,5),x!=="data-"&&x!=="aria-");default:return!1}}function p(x,C,D,W){if(C===null||typeof C>"u"||h(x,C,D,W))return!0;if(W)return!1;if(D!==null)switch(D.type){case 3:return!C;case 4:return C===!1;case 5:return isNaN(C);case 6:return isNaN(C)||1>C}return!1}function g(x,C,D,W,q,K,de){this.acceptsBooleans=C===2||C===3||C===4,this.attributeName=W,this.attributeNamespace=q,this.mustUseProperty=D,this.propertyName=x,this.type=C,this.sanitizeURL=K,this.removeEmptyString=de}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(x){m[x]=new g(x,0,!1,x,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(x){var C=x[0];m[C]=new g(C,1,!1,x[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(x){m[x]=new g(x,2,!1,x.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(x){m[x]=new g(x,2,!1,x,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(x){m[x]=new g(x,3,!1,x.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(x){m[x]=new g(x,3,!0,x,null,!1,!1)}),["capture","download"].forEach(function(x){m[x]=new g(x,4,!1,x,null,!1,!1)}),["cols","rows","size","span"].forEach(function(x){m[x]=new g(x,6,!1,x,null,!1,!1)}),["rowSpan","start"].forEach(function(x){m[x]=new g(x,5,!1,x.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(x){return x[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(x){var C=x.replace(v,y);m[C]=new g(C,1,!1,x,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(x){var C=x.replace(v,y);m[C]=new g(C,1,!1,x,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(x){var C=x.replace(v,y);m[C]=new g(C,1,!1,x,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(x){m[x]=new g(x,1,!1,x.toLowerCase(),null,!1,!1)}),m.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(x){m[x]=new g(x,1,!1,x.toLowerCase(),null,!0,!0)});function b(x,C,D,W){var q=m.hasOwnProperty(C)?m[C]:null;(q!==null?q.type!==0:W||!(2r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Rs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sut(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var SG={exports:{}},hk={},_G={exports:{}},gr={};var k0e;function aut(){if(k0e)return gr;k0e=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),f=Symbol.iterator;function d(N){return N===null||typeof N!="object"?null:(N=f&&N[f]||N["@@iterator"],typeof N=="function"?N:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,g={};function m(N,B,H){this.props=N,this.context=B,this.refs=g,this.updater=H||h}m.prototype.isReactComponent={},m.prototype.setState=function(N,B){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,B,"setState")},m.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function v(){}v.prototype=m.prototype;function y(N,B,H){this.props=N,this.context=B,this.refs=g,this.updater=H||h}var b=y.prototype=new v;b.constructor=y,p(b,m.prototype),b.isPureReactComponent=!0;var w=Array.isArray,S=Object.prototype.hasOwnProperty,_={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function T(N,B,H){var Q,Y={},Z=null,ge=null;if(B!=null)for(Q in B.ref!==void 0&&(ge=B.ref),B.key!==void 0&&(Z=""+B.key),B)S.call(B,Q)&&!E.hasOwnProperty(Q)&&(Y[Q]=B[Q]);var ne=arguments.length-2;if(ne===1)Y.children=H;else if(1>>1,B=V[N];if(0>>1;Ni(Y,z))Zi(ge,Y)?(V[N]=ge,V[Z]=z,N=Z):(V[N]=Y,V[Q]=z,N=Q);else if(Zi(ge,z))V[N]=ge,V[Z]=z,N=Z;else break e}}return U}function i(V,U){var z=V.sortIndex-U.sortIndex;return z!==0?z:V.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,g=!1,m=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(V){for(var U=n(c);U!==null;){if(U.callback===null)r(c);else if(U.startTime<=V)r(c),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(c)}}function w(V){if(g=!1,b(V),!p)if(n(l)!==null)p=!0,$(S);else{var U=n(c);U!==null&&j(w,U.startTime-V)}}function S(V,U){p=!1,g&&(g=!1,v(T),T=-1),h=!0;var z=d;try{for(b(U),f=n(l);f!==null&&(!(f.expirationTime>U)||V&&!I());){var N=f.callback;if(typeof N=="function"){f.callback=null,d=f.priorityLevel;var B=N(f.expirationTime<=U);U=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(l)&&r(l),b(U)}else r(l);f=n(l)}if(f!==null)var H=!0;else{var Q=n(c);Q!==null&&j(w,Q.startTime-U),H=!1}return H}finally{f=null,d=z,h=!1}}var _=!1,E=null,T=-1,k=5,P=-1;function I(){return!(e.unstable_now()-PV||125N?(V.sortIndex=z,t(c,V),n(l)===null&&V===n(c)&&(g?(v(T),T=-1):g=!0,j(w,z-N))):(V.sortIndex=B,t(l,V),p||h||(p=!0,$(S))),V},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(V){var U=d;return function(){var z=d;d=U;try{return V.apply(this,arguments)}finally{d=z}}}})(EG)),EG}var D0e;function fut(){return D0e||(D0e=1,OG.exports=uut()),OG.exports}var L0e;function dut(){if(L0e)return cc;L0e=1;var e=fg(),t=fut();function n(x){for(var C="https://reactjs.org/docs/error-decoder.html?invariant="+x,D=1;D"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},f={};function d(x){return l.call(f,x)?!0:l.call(u,x)?!1:c.test(x)?f[x]=!0:(u[x]=!0,!1)}function h(x,C,D,W){if(D!==null&&D.type===0)return!1;switch(typeof C){case"function":case"symbol":return!0;case"boolean":return W?!1:D!==null?!D.acceptsBooleans:(x=x.toLowerCase().slice(0,5),x!=="data-"&&x!=="aria-");default:return!1}}function p(x,C,D,W){if(C===null||typeof C>"u"||h(x,C,D,W))return!0;if(W)return!1;if(D!==null)switch(D.type){case 3:return!C;case 4:return C===!1;case 5:return isNaN(C);case 6:return isNaN(C)||1>C}return!1}function g(x,C,D,W,q,K,de){this.acceptsBooleans=C===2||C===3||C===4,this.attributeName=W,this.attributeNamespace=q,this.mustUseProperty=D,this.propertyName=x,this.type=C,this.sanitizeURL=K,this.removeEmptyString=de}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(x){m[x]=new g(x,0,!1,x,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(x){var C=x[0];m[C]=new g(C,1,!1,x[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(x){m[x]=new g(x,2,!1,x.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(x){m[x]=new g(x,2,!1,x,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(x){m[x]=new g(x,3,!1,x.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(x){m[x]=new g(x,3,!0,x,null,!1,!1)}),["capture","download"].forEach(function(x){m[x]=new g(x,4,!1,x,null,!1,!1)}),["cols","rows","size","span"].forEach(function(x){m[x]=new g(x,6,!1,x,null,!1,!1)}),["rowSpan","start"].forEach(function(x){m[x]=new g(x,5,!1,x.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(x){return x[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(x){var C=x.replace(v,y);m[C]=new g(C,1,!1,x,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(x){var C=x.replace(v,y);m[C]=new g(C,1,!1,x,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(x){var C=x.replace(v,y);m[C]=new g(C,1,!1,x,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(x){m[x]=new g(x,1,!1,x.toLowerCase(),null,!1,!1)}),m.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(x){m[x]=new g(x,1,!1,x.toLowerCase(),null,!0,!0)});function b(x,C,D,W){var q=m.hasOwnProperty(C)?m[C]:null;(q!==null?q.type!==0:W||!(2Ae||q[de]!==K[Ae]){var Ie=` -`+q[de].replace(" at new "," at ");return x.displayName&&Ie.includes("")&&(Ie=Ie.replace("",x.displayName)),Ie}while(1<=de&&0<=Ae);break}}}finally{H=!1,Error.prepareStackTrace=D}return(x=x?x.displayName||x.name:"")?B(x):""}function Y(x){switch(x.tag){case 5:return B(x.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return x=Q(x.type,!1),x;case 11:return x=Q(x.type.render,!1),x;case 1:return x=Q(x.type,!0),x;default:return""}}function Z(x){if(x==null)return null;if(typeof x=="function")return x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case E:return"Fragment";case _:return"Portal";case k:return"Profiler";case T:return"StrictMode";case F:return"Suspense";case A:return"SuspenseList"}if(typeof x=="object")switch(x.$$typeof){case R:return(x.displayName||"Context")+".Consumer";case P:return(x._context.displayName||"Context")+".Provider";case I:var C=x.render;return x=x.displayName,x||(x=C.displayName||C.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case L:return C=x.displayName||null,C!==null?C:Z(x.type)||"Memo";case $:C=x._payload,x=x._init;try{return Z(x(C))}catch{}}return null}function pe(x){var C=x.type;switch(x.tag){case 24:return"Cache";case 9:return(C.displayName||"Context")+".Consumer";case 10:return(C._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return x=C.render,x=x.displayName||x.name||"",C.displayName||(x!==""?"ForwardRef("+x+")":"ForwardRef");case 7:return"Fragment";case 5:return C;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(C);case 8:return C===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C}return null}function ie(x){switch(typeof x){case"boolean":case"number":case"string":case"undefined":return x;case"object":return x;default:return""}}function ne(x){var C=x.type;return(x=x.nodeName)&&x.toLowerCase()==="input"&&(C==="checkbox"||C==="radio")}function fe(x){var C=ne(x)?"checked":"value",D=Object.getOwnPropertyDescriptor(x.constructor.prototype,C),W=""+x[C];if(!x.hasOwnProperty(C)&&typeof D<"u"&&typeof D.get=="function"&&typeof D.set=="function"){var q=D.get,K=D.set;return Object.defineProperty(x,C,{configurable:!0,get:function(){return q.call(this)},set:function(de){W=""+de,K.call(this,de)}}),Object.defineProperty(x,C,{enumerable:D.enumerable}),{getValue:function(){return W},setValue:function(de){W=""+de},stopTracking:function(){x._valueTracker=null,delete x[C]}}}}function me(x){x._valueTracker||(x._valueTracker=fe(x))}function se(x){if(!x)return!1;var C=x._valueTracker;if(!C)return!0;var D=C.getValue(),W="";return x&&(W=ne(x)?x.checked?"true":"false":x.value),x=W,x!==D?(C.setValue(x),!0):!1}function ue(x){if(x=x||(typeof document<"u"?document:void 0),typeof x>"u")return null;try{return x.activeElement||x.body}catch{return x.body}}function G(x,C){var D=C.checked;return z({},C,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:D??x._wrapperState.initialChecked})}function ce(x,C){var D=C.defaultValue==null?"":C.defaultValue,W=C.checked!=null?C.checked:C.defaultChecked;D=ie(C.value!=null?C.value:D),x._wrapperState={initialChecked:W,initialValue:D,controlled:C.type==="checkbox"||C.type==="radio"?C.checked!=null:C.value!=null}}function he(x,C){C=C.checked,C!=null&&b(x,"checked",C,!1)}function J(x,C){he(x,C);var D=ie(C.value),W=C.type;if(D!=null)W==="number"?(D===0&&x.value===""||x.value!=D)&&(x.value=""+D):x.value!==""+D&&(x.value=""+D);else if(W==="submit"||W==="reset"){x.removeAttribute("value");return}C.hasOwnProperty("value")?ae(x,C.type,D):C.hasOwnProperty("defaultValue")&&ae(x,C.type,ie(C.defaultValue)),C.checked==null&&C.defaultChecked!=null&&(x.defaultChecked=!!C.defaultChecked)}function te(x,C,D){if(C.hasOwnProperty("value")||C.hasOwnProperty("defaultValue")){var W=C.type;if(!(W!=="submit"&&W!=="reset"||C.value!==void 0&&C.value!==null))return;C=""+x._wrapperState.initialValue,D||C===x.value||(x.value=C),x.defaultValue=C}D=x.name,D!==""&&(x.name=""),x.defaultChecked=!!x._wrapperState.initialChecked,D!==""&&(x.name=D)}function ae(x,C,D){(C!=="number"||ue(x.ownerDocument)!==x)&&(D==null?x.defaultValue=""+x._wrapperState.initialValue:x.defaultValue!==""+D&&(x.defaultValue=""+D))}var we=Array.isArray;function Pe(x,C,D,W){if(x=x.options,C){C={};for(var q=0;q"+C.valueOf().toString()+"",C=xe.firstChild;x.firstChild;)x.removeChild(x.firstChild);for(;C.firstChild;)x.appendChild(C.firstChild)}});function Ee(x,C){if(C){var D=x.firstChild;if(D&&D===x.lastChild&&D.nodeType===3){D.nodeValue=C;return}}x.textContent=C}var ke={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},je=["Webkit","ms","Moz","O"];Object.keys(ke).forEach(function(x){je.forEach(function(C){C=C+x.charAt(0).toUpperCase()+x.substring(1),ke[C]=ke[x]})});function De(x,C,D){return C==null||typeof C=="boolean"||C===""?"":D||typeof C!="number"||C===0||ke.hasOwnProperty(x)&&ke[x]?(""+C).trim():C+"px"}function ze(x,C){x=x.style;for(var D in C)if(C.hasOwnProperty(D)){var W=D.indexOf("--")===0,q=De(D,C[D],W);D==="float"&&(D="cssFloat"),W?x.setProperty(D,q):x[D]=q}}var Je=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mt(x,C){if(C){if(Je[x]&&(C.children!=null||C.dangerouslySetInnerHTML!=null))throw Error(n(137,x));if(C.dangerouslySetInnerHTML!=null){if(C.children!=null)throw Error(n(60));if(typeof C.dangerouslySetInnerHTML!="object"||!("__html"in C.dangerouslySetInnerHTML))throw Error(n(61))}if(C.style!=null&&typeof C.style!="object")throw Error(n(62))}}function Me(x,C){if(x.indexOf("-")===-1)return typeof C.is=="string";switch(x){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var st=null;function Fe(x){return x=x.target||x.srcElement||window,x.correspondingUseElement&&(x=x.correspondingUseElement),x.nodeType===3?x.parentNode:x}var ht=null,gt=null,St=null;function on(x){if(x=ok(x)){if(typeof ht!="function")throw Error(n(280));var C=x.stateNode;C&&(C=TF(C),ht(x.stateNode,x.type,C))}}function Dn(x){gt?St?St.push(x):St=[x]:gt=x}function wi(){if(gt){var x=gt,C=St;if(St=gt=null,on(x),C)for(x=0;x>>=0,x===0?32:31-(Sl(x)/jP|0)|0}var Zb=64,uF=4194304;function BP(x){switch(x&-x){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return x&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return x&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return x}}function fF(x,C){var D=x.pendingLanes;if(D===0)return 0;var W=0,q=x.suspendedLanes,K=x.pingedLanes,de=D&268435455;if(de!==0){var Ae=de&~q;Ae!==0?W=BP(Ae):(K&=de,K!==0&&(W=BP(K)))}else de=D&~q,de!==0?W=BP(de):K!==0&&(W=BP(K));if(W===0)return 0;if(C!==0&&C!==W&&(C&q)===0&&(q=W&-W,K=C&-C,q>=K||q===16&&(K&4194240)!==0))return C;if((W&4)!==0&&(W|=D&16),C=x.entangledLanes,C!==0)for(x=x.entanglements,C&=W;0D;D++)C.push(x);return C}function UP(x,C,D){x.pendingLanes|=C,C!==536870912&&(x.suspendedLanes=0,x.pingedLanes=0),x=x.eventTimes,C=31-wl(C),x[C]=D}function Uut(x,C){var D=x.pendingLanes&~C;x.pendingLanes=C,x.suspendedLanes=0,x.pingedLanes=0,x.expiredLanes&=C,x.mutableReadLanes&=C,x.entangledLanes&=C,C=x.entanglements;var W=x.eventTimes;for(x=x.expirationTimes;0=QP),Pye=" ",kye=!1;function Mye(x,C){switch(x){case"keyup":return mft.indexOf(C.keyCode)!==-1;case"keydown":return C.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Aye(x){return x=x.detail,typeof x=="object"&&"data"in x?x.data:null}var YS=!1;function yft(x,C){switch(x){case"compositionend":return Aye(C);case"keypress":return C.which!==32?null:(kye=!0,Pye);case"textInput":return x=C.data,x===Pye&&kye?null:x;default:return null}}function bft(x,C){if(YS)return x==="compositionend"||!EH&&Mye(x,C)?(x=Sye(),mF=xH=Yv=null,YS=!1,x):null;switch(x){case"paste":return null;case"keypress":if(!(C.ctrlKey||C.altKey||C.metaKey)||C.ctrlKey&&C.altKey){if(C.char&&1=C)return{node:D,offset:C-x};x=W}e:{for(;D;){if(D.nextSibling){D=D.nextSibling;break e}D=D.parentNode}D=void 0}D=Nye(D)}}function jye(x,C){return x&&C?x===C?!0:x&&x.nodeType===3?!1:C&&C.nodeType===3?jye(x,C.parentNode):"contains"in x?x.contains(C):x.compareDocumentPosition?!!(x.compareDocumentPosition(C)&16):!1:!1}function Bye(){for(var x=window,C=ue();C instanceof x.HTMLIFrameElement;){try{var D=typeof C.contentWindow.location.href=="string"}catch{D=!1}if(D)x=C.contentWindow;else break;C=ue(x.document)}return C}function kH(x){var C=x&&x.nodeName&&x.nodeName.toLowerCase();return C&&(C==="input"&&(x.type==="text"||x.type==="search"||x.type==="tel"||x.type==="url"||x.type==="password")||C==="textarea"||x.contentEditable==="true")}function Pft(x){var C=Bye(),D=x.focusedElem,W=x.selectionRange;if(C!==D&&D&&D.ownerDocument&&jye(D.ownerDocument.documentElement,D)){if(W!==null&&kH(D)){if(C=W.start,x=W.end,x===void 0&&(x=C),"selectionStart"in D)D.selectionStart=C,D.selectionEnd=Math.min(x,D.value.length);else if(x=(C=D.ownerDocument||document)&&C.defaultView||window,x.getSelection){x=x.getSelection();var q=D.textContent.length,K=Math.min(W.start,q);W=W.end===void 0?K:Math.min(W.end,q),!x.extend&&K>W&&(q=W,W=K,K=q),q=zye(D,K);var de=zye(D,W);q&&de&&(x.rangeCount!==1||x.anchorNode!==q.node||x.anchorOffset!==q.offset||x.focusNode!==de.node||x.focusOffset!==de.offset)&&(C=C.createRange(),C.setStart(q.node,q.offset),x.removeAllRanges(),K>W?(x.addRange(C),x.extend(de.node,de.offset)):(C.setEnd(de.node,de.offset),x.addRange(C)))}}for(C=[],x=D;x=x.parentNode;)x.nodeType===1&&C.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D=document.documentMode,QS=null,MH=null,ek=null,AH=!1;function Uye(x,C,D){var W=D.window===D?D.document:D.nodeType===9?D:D.ownerDocument;AH||QS==null||QS!==ue(W)||(W=QS,"selectionStart"in W&&kH(W)?W={start:W.selectionStart,end:W.selectionEnd}:(W=(W.ownerDocument&&W.ownerDocument.defaultView||window).getSelection(),W={anchorNode:W.anchorNode,anchorOffset:W.anchorOffset,focusNode:W.focusNode,focusOffset:W.focusOffset}),ek&&JP(ek,W)||(ek=W,W=CF(MH,"onSelect"),0t_||(x.current=VH[t_],VH[t_]=null,t_--)}function Gi(x,C){t_++,VH[t_]=x.current,x.current=C}var Jv={},Ua=Zv(Jv),ac=Zv(!1),ex=Jv;function n_(x,C){var D=x.type.contextTypes;if(!D)return Jv;var W=x.stateNode;if(W&&W.__reactInternalMemoizedUnmaskedChildContext===C)return W.__reactInternalMemoizedMaskedChildContext;var q={},K;for(K in D)q[K]=C[K];return W&&(x=x.stateNode,x.__reactInternalMemoizedUnmaskedChildContext=C,x.__reactInternalMemoizedMaskedChildContext=q),q}function lc(x){return x=x.childContextTypes,x!=null}function PF(){to(ac),to(Ua)}function r0e(x,C,D){if(Ua.current!==Jv)throw Error(n(168));Gi(Ua,C),Gi(ac,D)}function i0e(x,C,D){var W=x.stateNode;if(C=C.childContextTypes,typeof W.getChildContext!="function")return D;W=W.getChildContext();for(var q in W)if(!(q in C))throw Error(n(108,pe(x)||"Unknown",q));return z({},D,W)}function kF(x){return x=(x=x.stateNode)&&x.__reactInternalMemoizedMergedChildContext||Jv,ex=Ua.current,Gi(Ua,x),Gi(ac,ac.current),!0}function o0e(x,C,D){var W=x.stateNode;if(!W)throw Error(n(169));D?(x=i0e(x,C,ex),W.__reactInternalMemoizedMergedChildContext=x,to(ac),to(Ua),Gi(Ua,x)):to(ac),Gi(ac,D)}var Ng=null,MF=!1,WH=!1;function s0e(x){Ng===null?Ng=[x]:Ng.push(x)}function jft(x){MF=!0,s0e(x)}function ey(){if(!WH&&Ng!==null){WH=!0;var x=0,C=Si;try{var D=Ng;for(Si=1;x>=de,q-=de,zg=1<<32-wl(C)+q|D<Bn?(Vs=Rn,Rn=null):Vs=Rn.sibling;var Gr=vt(He,Rn,qe[Bn],kt);if(Gr===null){Rn===null&&(Rn=Vs);break}x&&Rn&&Gr.alternate===null&&C(He,Rn),Le=K(Gr,Le,Bn),An===null?pn=Gr:An.sibling=Gr,An=Gr,Rn=Vs}if(Bn===qe.length)return D(He,Rn),go&&nx(He,Bn),pn;if(Rn===null){for(;BnBn?(Vs=Rn,Rn=null):Vs=Rn.sibling;var cy=vt(He,Rn,Gr.value,kt);if(cy===null){Rn===null&&(Rn=Vs);break}x&&Rn&&cy.alternate===null&&C(He,Rn),Le=K(cy,Le,Bn),An===null?pn=cy:An.sibling=cy,An=cy,Rn=Vs}if(Gr.done)return D(He,Rn),go&&nx(He,Bn),pn;if(Rn===null){for(;!Gr.done;Bn++,Gr=qe.next())Gr=Ct(He,Gr.value,kt),Gr!==null&&(Le=K(Gr,Le,Bn),An===null?pn=Gr:An.sibling=Gr,An=Gr);return go&&nx(He,Bn),pn}for(Rn=W(He,Rn);!Gr.done;Bn++,Gr=qe.next())Gr=Jt(Rn,He,Bn,Gr.value,kt),Gr!==null&&(x&&Gr.alternate!==null&&Rn.delete(Gr.key===null?Bn:Gr.key),Le=K(Gr,Le,Bn),An===null?pn=Gr:An.sibling=Gr,An=Gr);return x&&Rn.forEach(function(xdt){return C(He,xdt)}),go&&nx(He,Bn),pn}function Go(He,Le,qe,kt){if(typeof qe=="object"&&qe!==null&&qe.type===E&&qe.key===null&&(qe=qe.props.children),typeof qe=="object"&&qe!==null){switch(qe.$$typeof){case S:e:{for(var pn=qe.key,An=Le;An!==null;){if(An.key===pn){if(pn=qe.type,pn===E){if(An.tag===7){D(He,An.sibling),Le=q(An,qe.props.children),Le.return=He,He=Le;break e}}else if(An.elementType===pn||typeof pn=="object"&&pn!==null&&pn.$$typeof===$&&d0e(pn)===An.type){D(He,An.sibling),Le=q(An,qe.props),Le.ref=sk(He,An,qe),Le.return=He,He=Le;break e}D(He,An);break}else C(He,An);An=An.sibling}qe.type===E?(Le=ux(qe.props.children,He.mode,kt,qe.key),Le.return=He,He=Le):(kt=i$(qe.type,qe.key,qe.props,null,He.mode,kt),kt.ref=sk(He,Le,qe),kt.return=He,He=kt)}return de(He);case _:e:{for(An=qe.key;Le!==null;){if(Le.key===An)if(Le.tag===4&&Le.stateNode.containerInfo===qe.containerInfo&&Le.stateNode.implementation===qe.implementation){D(He,Le.sibling),Le=q(Le,qe.children||[]),Le.return=He,He=Le;break e}else{D(He,Le);break}else C(He,Le);Le=Le.sibling}Le=BG(qe,He.mode,kt),Le.return=He,He=Le}return de(He);case $:return An=qe._init,Go(He,Le,An(qe._payload),kt)}if(we(qe))return cn(He,Le,qe,kt);if(U(qe))return fn(He,Le,qe,kt);DF(He,qe)}return typeof qe=="string"&&qe!==""||typeof qe=="number"?(qe=""+qe,Le!==null&&Le.tag===6?(D(He,Le.sibling),Le=q(Le,qe),Le.return=He,He=Le):(D(He,Le),Le=jG(qe,He.mode,kt),Le.return=He,He=Le),de(He)):D(He,Le)}return Go}var s_=h0e(!0),p0e=h0e(!1),LF=Zv(null),FF=null,a_=null,QH=null;function KH(){QH=a_=FF=null}function ZH(x){var C=LF.current;to(LF),x._currentValue=C}function JH(x,C,D){for(;x!==null;){var W=x.alternate;if((x.childLanes&C)!==C?(x.childLanes|=C,W!==null&&(W.childLanes|=C)):W!==null&&(W.childLanes&C)!==C&&(W.childLanes|=C),x===D)break;x=x.return}}function l_(x,C){FF=x,QH=a_=null,x=x.dependencies,x!==null&&x.firstContext!==null&&((x.lanes&C)!==0&&(cc=!0),x.firstContext=null)}function Qu(x){var C=x._currentValue;if(QH!==x)if(x={context:x,memoizedValue:C,next:null},a_===null){if(FF===null)throw Error(n(308));a_=x,FF.dependencies={lanes:0,firstContext:x}}else a_=a_.next=x;return C}var rx=null;function eG(x){rx===null?rx=[x]:rx.push(x)}function g0e(x,C,D,W){var q=C.interleaved;return q===null?(D.next=D,eG(C)):(D.next=q.next,q.next=D),C.interleaved=D,Bg(x,W)}function Bg(x,C){x.lanes|=C;var D=x.alternate;for(D!==null&&(D.lanes|=C),D=x,x=x.return;x!==null;)x.childLanes|=C,D=x.alternate,D!==null&&(D.childLanes|=C),D=x,x=x.return;return D.tag===3?D.stateNode:null}var ty=!1;function tG(x){x.updateQueue={baseState:x.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function m0e(x,C){x=x.updateQueue,C.updateQueue===x&&(C.updateQueue={baseState:x.baseState,firstBaseUpdate:x.firstBaseUpdate,lastBaseUpdate:x.lastBaseUpdate,shared:x.shared,effects:x.effects})}function Ug(x,C){return{eventTime:x,lane:C,tag:0,payload:null,callback:null,next:null}}function ny(x,C,D){var W=x.updateQueue;if(W===null)return null;if(W=W.shared,(jr&2)!==0){var q=W.pending;return q===null?C.next=C:(C.next=q.next,q.next=C),W.pending=C,Bg(x,D)}return q=W.interleaved,q===null?(C.next=C,eG(W)):(C.next=q.next,q.next=C),W.interleaved=C,Bg(x,D)}function $F(x,C,D){if(C=C.updateQueue,C!==null&&(C=C.shared,(D&4194240)!==0)){var W=C.lanes;W&=x.pendingLanes,D|=W,C.lanes=D,gH(x,D)}}function v0e(x,C){var D=x.updateQueue,W=x.alternate;if(W!==null&&(W=W.updateQueue,D===W)){var q=null,K=null;if(D=D.firstBaseUpdate,D!==null){do{var de={eventTime:D.eventTime,lane:D.lane,tag:D.tag,payload:D.payload,callback:D.callback,next:null};K===null?q=K=de:K=K.next=de,D=D.next}while(D!==null);K===null?q=K=C:K=K.next=C}else q=K=C;D={baseState:W.baseState,firstBaseUpdate:q,lastBaseUpdate:K,shared:W.shared,effects:W.effects},x.updateQueue=D;return}x=D.lastBaseUpdate,x===null?D.firstBaseUpdate=C:x.next=C,D.lastBaseUpdate=C}function NF(x,C,D,W){var q=x.updateQueue;ty=!1;var K=q.firstBaseUpdate,de=q.lastBaseUpdate,Ae=q.shared.pending;if(Ae!==null){q.shared.pending=null;var Ie=Ae,Ye=Ie.next;Ie.next=null,de===null?K=Ye:de.next=Ye,de=Ie;var xt=x.alternate;xt!==null&&(xt=xt.updateQueue,Ae=xt.lastBaseUpdate,Ae!==de&&(Ae===null?xt.firstBaseUpdate=Ye:Ae.next=Ye,xt.lastBaseUpdate=Ie))}if(K!==null){var Ct=q.baseState;de=0,xt=Ye=Ie=null,Ae=K;do{var vt=Ae.lane,Jt=Ae.eventTime;if((W&vt)===vt){xt!==null&&(xt=xt.next={eventTime:Jt,lane:0,tag:Ae.tag,payload:Ae.payload,callback:Ae.callback,next:null});e:{var cn=x,fn=Ae;switch(vt=C,Jt=D,fn.tag){case 1:if(cn=fn.payload,typeof cn=="function"){Ct=cn.call(Jt,Ct,vt);break e}Ct=cn;break e;case 3:cn.flags=cn.flags&-65537|128;case 0:if(cn=fn.payload,vt=typeof cn=="function"?cn.call(Jt,Ct,vt):cn,vt==null)break e;Ct=z({},Ct,vt);break e;case 2:ty=!0}}Ae.callback!==null&&Ae.lane!==0&&(x.flags|=64,vt=q.effects,vt===null?q.effects=[Ae]:vt.push(Ae))}else Jt={eventTime:Jt,lane:vt,tag:Ae.tag,payload:Ae.payload,callback:Ae.callback,next:null},xt===null?(Ye=xt=Jt,Ie=Ct):xt=xt.next=Jt,de|=vt;if(Ae=Ae.next,Ae===null){if(Ae=q.shared.pending,Ae===null)break;vt=Ae,Ae=vt.next,vt.next=null,q.lastBaseUpdate=vt,q.shared.pending=null}}while(!0);if(xt===null&&(Ie=Ct),q.baseState=Ie,q.firstBaseUpdate=Ye,q.lastBaseUpdate=xt,C=q.shared.interleaved,C!==null){q=C;do de|=q.lane,q=q.next;while(q!==C)}else K===null&&(q.shared.lanes=0);sx|=de,x.lanes=de,x.memoizedState=Ct}}function y0e(x,C,D){if(x=C.effects,C.effects=null,x!==null)for(C=0;CD?D:4,x(!0);var W=sG.transition;sG.transition={};try{x(!1),C()}finally{Si=D,sG.transition=W}}function $0e(){return Ku().memoizedState}function Wft(x,C,D){var W=sy(x);if(D={lane:W,action:D,hasEagerState:!1,eagerState:null,next:null},N0e(x))z0e(C,D);else if(D=g0e(x,C,D,W),D!==null){var q=Cl();_d(D,x,W,q),j0e(D,C,W)}}function Hft(x,C,D){var W=sy(x),q={lane:W,action:D,hasEagerState:!1,eagerState:null,next:null};if(N0e(x))z0e(C,q);else{var K=x.alternate;if(x.lanes===0&&(K===null||K.lanes===0)&&(K=C.lastRenderedReducer,K!==null))try{var de=C.lastRenderedState,Ae=K(de,D);if(q.hasEagerState=!0,q.eagerState=Ae,yd(Ae,de)){var Ie=C.interleaved;Ie===null?(q.next=q,eG(C)):(q.next=Ie.next,Ie.next=q),C.interleaved=q;return}}catch{}finally{}D=g0e(x,C,q,W),D!==null&&(q=Cl(),_d(D,x,W,q),j0e(D,C,W))}}function N0e(x){var C=x.alternate;return x===Eo||C!==null&&C===Eo}function z0e(x,C){uk=BF=!0;var D=x.pending;D===null?C.next=C:(C.next=D.next,D.next=C),x.pending=C}function j0e(x,C,D){if((D&4194240)!==0){var W=C.lanes;W&=x.pendingLanes,D|=W,C.lanes=D,gH(x,D)}}var WF={readContext:Qu,useCallback:Va,useContext:Va,useEffect:Va,useImperativeHandle:Va,useInsertionEffect:Va,useLayoutEffect:Va,useMemo:Va,useReducer:Va,useRef:Va,useState:Va,useDebugValue:Va,useDeferredValue:Va,useTransition:Va,useMutableSource:Va,useSyncExternalStore:Va,useId:Va,unstable_isNewReconciler:!1},Gft={readContext:Qu,useCallback:function(x,C){return Vh().memoizedState=[x,C===void 0?null:C],x},useContext:Qu,useEffect:k0e,useImperativeHandle:function(x,C,D){return D=D!=null?D.concat([x]):null,UF(4194308,4,R0e.bind(null,C,x),D)},useLayoutEffect:function(x,C){return UF(4194308,4,x,C)},useInsertionEffect:function(x,C){return UF(4,2,x,C)},useMemo:function(x,C){var D=Vh();return C=C===void 0?null:C,x=x(),D.memoizedState=[x,C],x},useReducer:function(x,C,D){var W=Vh();return C=D!==void 0?D(C):C,W.memoizedState=W.baseState=C,x={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:x,lastRenderedState:C},W.queue=x,x=x.dispatch=Wft.bind(null,Eo,x),[W.memoizedState,x]},useRef:function(x){var C=Vh();return x={current:x},C.memoizedState=x},useState:T0e,useDebugValue:hG,useDeferredValue:function(x){return Vh().memoizedState=x},useTransition:function(){var x=T0e(!1),C=x[0];return x=Vft.bind(null,x[1]),Vh().memoizedState=x,[C,x]},useMutableSource:function(){},useSyncExternalStore:function(x,C,D){var W=Eo,q=Vh();if(go){if(D===void 0)throw Error(n(407));D=D()}else{if(D=C(),Us===null)throw Error(n(349));(ox&30)!==0||S0e(W,C,D)}q.memoizedState=D;var K={value:D,getSnapshot:C};return q.queue=K,k0e(C0e.bind(null,W,K,x),[x]),W.flags|=2048,hk(9,_0e.bind(null,W,K,D,C),void 0,null),D},useId:function(){var x=Vh(),C=Us.identifierPrefix;if(go){var D=jg,W=zg;D=(W&~(1<<32-wl(W)-1)).toString(32)+D,C=":"+C+"R"+D,D=fk++,0")&&(Ie=Ie.replace("",x.displayName)),Ie}while(1<=de&&0<=Ae);break}}}finally{H=!1,Error.prepareStackTrace=D}return(x=x?x.displayName||x.name:"")?B(x):""}function Y(x){switch(x.tag){case 5:return B(x.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return x=Q(x.type,!1),x;case 11:return x=Q(x.type.render,!1),x;case 1:return x=Q(x.type,!0),x;default:return""}}function Z(x){if(x==null)return null;if(typeof x=="function")return x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case E:return"Fragment";case _:return"Portal";case k:return"Profiler";case T:return"StrictMode";case F:return"Suspense";case A:return"SuspenseList"}if(typeof x=="object")switch(x.$$typeof){case I:return(x.displayName||"Context")+".Consumer";case P:return(x._context.displayName||"Context")+".Provider";case R:var C=x.render;return x=x.displayName,x||(x=C.displayName||C.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case L:return C=x.displayName||null,C!==null?C:Z(x.type)||"Memo";case $:C=x._payload,x=x._init;try{return Z(x(C))}catch{}}return null}function ge(x){var C=x.type;switch(x.tag){case 24:return"Cache";case 9:return(C.displayName||"Context")+".Consumer";case 10:return(C._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return x=C.render,x=x.displayName||x.name||"",C.displayName||(x!==""?"ForwardRef("+x+")":"ForwardRef");case 7:return"Fragment";case 5:return C;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(C);case 8:return C===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C}return null}function ne(x){switch(typeof x){case"boolean":case"number":case"string":case"undefined":return x;case"object":return x;default:return""}}function ie(x){var C=x.type;return(x=x.nodeName)&&x.toLowerCase()==="input"&&(C==="checkbox"||C==="radio")}function fe(x){var C=ie(x)?"checked":"value",D=Object.getOwnPropertyDescriptor(x.constructor.prototype,C),W=""+x[C];if(!x.hasOwnProperty(C)&&typeof D<"u"&&typeof D.get=="function"&&typeof D.set=="function"){var q=D.get,K=D.set;return Object.defineProperty(x,C,{configurable:!0,get:function(){return q.call(this)},set:function(de){W=""+de,K.call(this,de)}}),Object.defineProperty(x,C,{enumerable:D.enumerable}),{getValue:function(){return W},setValue:function(de){W=""+de},stopTracking:function(){x._valueTracker=null,delete x[C]}}}}function ve(x){x._valueTracker||(x._valueTracker=fe(x))}function se(x){if(!x)return!1;var C=x._valueTracker;if(!C)return!0;var D=C.getValue(),W="";return x&&(W=ie(x)?x.checked?"true":"false":x.value),x=W,x!==D?(C.setValue(x),!0):!1}function ue(x){if(x=x||(typeof document<"u"?document:void 0),typeof x>"u")return null;try{return x.activeElement||x.body}catch{return x.body}}function G(x,C){var D=C.checked;return z({},C,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:D??x._wrapperState.initialChecked})}function ce(x,C){var D=C.defaultValue==null?"":C.defaultValue,W=C.checked!=null?C.checked:C.defaultChecked;D=ne(C.value!=null?C.value:D),x._wrapperState={initialChecked:W,initialValue:D,controlled:C.type==="checkbox"||C.type==="radio"?C.checked!=null:C.value!=null}}function pe(x,C){C=C.checked,C!=null&&b(x,"checked",C,!1)}function J(x,C){pe(x,C);var D=ne(C.value),W=C.type;if(D!=null)W==="number"?(D===0&&x.value===""||x.value!=D)&&(x.value=""+D):x.value!==""+D&&(x.value=""+D);else if(W==="submit"||W==="reset"){x.removeAttribute("value");return}C.hasOwnProperty("value")?ae(x,C.type,D):C.hasOwnProperty("defaultValue")&&ae(x,C.type,ne(C.defaultValue)),C.checked==null&&C.defaultChecked!=null&&(x.defaultChecked=!!C.defaultChecked)}function te(x,C,D){if(C.hasOwnProperty("value")||C.hasOwnProperty("defaultValue")){var W=C.type;if(!(W!=="submit"&&W!=="reset"||C.value!==void 0&&C.value!==null))return;C=""+x._wrapperState.initialValue,D||C===x.value||(x.value=C),x.defaultValue=C}D=x.name,D!==""&&(x.name=""),x.defaultChecked=!!x._wrapperState.initialChecked,D!==""&&(x.name=D)}function ae(x,C,D){(C!=="number"||ue(x.ownerDocument)!==x)&&(D==null?x.defaultValue=""+x._wrapperState.initialValue:x.defaultValue!==""+D&&(x.defaultValue=""+D))}var we=Array.isArray;function Pe(x,C,D,W){if(x=x.options,C){C={};for(var q=0;q"+C.valueOf().toString()+"",C=be.firstChild;x.firstChild;)x.removeChild(x.firstChild);for(;C.firstChild;)x.appendChild(C.firstChild)}});function Ee(x,C){if(C){var D=x.firstChild;if(D&&D===x.lastChild&&D.nodeType===3){D.nodeValue=C;return}}x.textContent=C}var ke={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ze=["Webkit","ms","Moz","O"];Object.keys(ke).forEach(function(x){ze.forEach(function(C){C=C+x.charAt(0).toUpperCase()+x.substring(1),ke[C]=ke[x]})});function De(x,C,D){return C==null||typeof C=="boolean"||C===""?"":D||typeof C!="number"||C===0||ke.hasOwnProperty(x)&&ke[x]?(""+C).trim():C+"px"}function Ve(x,C){x=x.style;for(var D in C)if(C.hasOwnProperty(D)){var W=D.indexOf("--")===0,q=De(D,C[D],W);D==="float"&&(D="cssFloat"),W?x.setProperty(D,q):x[D]=q}}var Ze=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mt(x,C){if(C){if(Ze[x]&&(C.children!=null||C.dangerouslySetInnerHTML!=null))throw Error(n(137,x));if(C.dangerouslySetInnerHTML!=null){if(C.children!=null)throw Error(n(60));if(typeof C.dangerouslySetInnerHTML!="object"||!("__html"in C.dangerouslySetInnerHTML))throw Error(n(61))}if(C.style!=null&&typeof C.style!="object")throw Error(n(62))}}function Me(x,C){if(x.indexOf("-")===-1)return typeof C.is=="string";switch(x){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ct=null;function Fe(x){return x=x.target||x.srcElement||window,x.correspondingUseElement&&(x=x.correspondingUseElement),x.nodeType===3?x.parentNode:x}var ht=null,gt=null,St=null;function on(x){if(x=ZP(x)){if(typeof ht!="function")throw Error(n(280));var C=x.stateNode;C&&(C=hF(C),ht(x.stateNode,x.type,C))}}function Ln(x){gt?St?St.push(x):St=[x]:gt=x}function xi(){if(gt){var x=gt,C=St;if(St=gt=null,on(x),C)for(x=0;x>>=0,x===0?32:31-(wl(x)/IP|0)|0}var Xb=64,QL=4194304;function DP(x){switch(x&-x){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return x&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return x&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return x}}function KL(x,C){var D=x.pendingLanes;if(D===0)return 0;var W=0,q=x.suspendedLanes,K=x.pingedLanes,de=D&268435455;if(de!==0){var Ae=de&~q;Ae!==0?W=DP(Ae):(K&=de,K!==0&&(W=DP(K)))}else de=D&~q,de!==0?W=DP(de):K!==0&&(W=DP(K));if(W===0)return 0;if(C!==0&&C!==W&&(C&q)===0&&(q=W&-W,K=C&-C,q>=K||q===16&&(K&4194240)!==0))return C;if((W&4)!==0&&(W|=D&16),C=x.entangledLanes,C!==0)for(x=x.entanglements,C&=W;0D;D++)C.push(x);return C}function LP(x,C,D){x.pendingLanes|=C,C!==536870912&&(x.suspendedLanes=0,x.pingedLanes=0),x=x.eventTimes,C=31-xl(C),x[C]=D}function Elt(x,C){var D=x.pendingLanes&~C;x.pendingLanes=C,x.suspendedLanes=0,x.pingedLanes=0,x.expiredLanes&=C,x.mutableReadLanes&=C,x.entangledLanes&=C,C=x.entanglements;var W=x.eventTimes;for(x=x.expirationTimes;0=VP),Sve=" ",_ve=!1;function Cve(x,C){switch(x){case"keyup":return ect.indexOf(C.keyCode)!==-1;case"keydown":return C.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ove(x){return x=x.detail,typeof x=="object"&&"data"in x?x.data:null}var BS=!1;function nct(x,C){switch(x){case"compositionend":return Ove(C);case"keypress":return C.which!==32?null:(_ve=!0,Sve);case"textInput":return x=C.data,x===Sve&&_ve?null:x;default:return null}}function rct(x,C){if(BS)return x==="compositionend"||!nH&&Cve(x,C)?(x=mve(),nF=QW=Hv=null,BS=!1,x):null;switch(x){case"paste":return null;case"keypress":if(!(C.ctrlKey||C.altKey||C.metaKey)||C.ctrlKey&&C.altKey){if(C.char&&1=C)return{node:D,offset:C-x};x=W}e:{for(;D;){if(D.nextSibling){D=D.nextSibling;break e}D=D.parentNode}D=void 0}D=Rve(D)}}function Dve(x,C){return x&&C?x===C?!0:x&&x.nodeType===3?!1:C&&C.nodeType===3?Dve(x,C.parentNode):"contains"in x?x.contains(C):x.compareDocumentPosition?!!(x.compareDocumentPosition(C)&16):!1:!1}function Lve(){for(var x=window,C=ue();C instanceof x.HTMLIFrameElement;){try{var D=typeof C.contentWindow.location.href=="string"}catch{D=!1}if(D)x=C.contentWindow;else break;C=ue(x.document)}return C}function oH(x){var C=x&&x.nodeName&&x.nodeName.toLowerCase();return C&&(C==="input"&&(x.type==="text"||x.type==="search"||x.type==="tel"||x.type==="url"||x.type==="password")||C==="textarea"||x.contentEditable==="true")}function dct(x){var C=Lve(),D=x.focusedElem,W=x.selectionRange;if(C!==D&&D&&D.ownerDocument&&Dve(D.ownerDocument.documentElement,D)){if(W!==null&&oH(D)){if(C=W.start,x=W.end,x===void 0&&(x=C),"selectionStart"in D)D.selectionStart=C,D.selectionEnd=Math.min(x,D.value.length);else if(x=(C=D.ownerDocument||document)&&C.defaultView||window,x.getSelection){x=x.getSelection();var q=D.textContent.length,K=Math.min(W.start,q);W=W.end===void 0?K:Math.min(W.end,q),!x.extend&&K>W&&(q=W,W=K,K=q),q=Ive(D,K);var de=Ive(D,W);q&&de&&(x.rangeCount!==1||x.anchorNode!==q.node||x.anchorOffset!==q.offset||x.focusNode!==de.node||x.focusOffset!==de.offset)&&(C=C.createRange(),C.setStart(q.node,q.offset),x.removeAllRanges(),K>W?(x.addRange(C),x.extend(de.node,de.offset)):(C.setEnd(de.node,de.offset),x.addRange(C)))}}for(C=[],x=D;x=x.parentNode;)x.nodeType===1&&C.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D=document.documentMode,US=null,sH=null,qP=null,aH=!1;function Fve(x,C,D){var W=D.window===D?D.document:D.nodeType===9?D:D.ownerDocument;aH||US==null||US!==ue(W)||(W=US,"selectionStart"in W&&oH(W)?W={start:W.selectionStart,end:W.selectionEnd}:(W=(W.ownerDocument&&W.ownerDocument.defaultView||window).getSelection(),W={anchorNode:W.anchorNode,anchorOffset:W.anchorOffset,focusNode:W.focusNode,focusOffset:W.focusOffset}),qP&&GP(qP,W)||(qP=W,W=uF(sH,"onSelect"),0qS||(x.current=bH[qS],bH[qS]=null,qS--)}function Gi(x,C){qS++,bH[qS]=x.current,x.current=C}var Yv={},Ua=Xv(Yv),ic=Xv(!1),Qb=Yv;function XS(x,C){var D=x.type.contextTypes;if(!D)return Yv;var W=x.stateNode;if(W&&W.__reactInternalMemoizedUnmaskedChildContext===C)return W.__reactInternalMemoizedMaskedChildContext;var q={},K;for(K in D)q[K]=C[K];return W&&(x=x.stateNode,x.__reactInternalMemoizedUnmaskedChildContext=C,x.__reactInternalMemoizedMaskedChildContext=q),q}function oc(x){return x=x.childContextTypes,x!=null}function pF(){no(ic),no(Ua)}function Kve(x,C,D){if(Ua.current!==Yv)throw Error(n(168));Gi(Ua,C),Gi(ic,D)}function Zve(x,C,D){var W=x.stateNode;if(C=C.childContextTypes,typeof W.getChildContext!="function")return D;W=W.getChildContext();for(var q in W)if(!(q in C))throw Error(n(108,ge(x)||"Unknown",q));return z({},D,W)}function gF(x){return x=(x=x.stateNode)&&x.__reactInternalMemoizedMergedChildContext||Yv,Qb=Ua.current,Gi(Ua,x),Gi(ic,ic.current),!0}function Jve(x,C,D){var W=x.stateNode;if(!W)throw Error(n(169));D?(x=Zve(x,C,Qb),W.__reactInternalMemoizedMergedChildContext=x,no(ic),no(Ua),Gi(Ua,x)):no(ic),Gi(ic,D)}var Lg=null,mF=!1,xH=!1;function eye(x){Lg===null?Lg=[x]:Lg.push(x)}function Cct(x){mF=!0,eye(x)}function Qv(){if(!xH&&Lg!==null){xH=!0;var x=0,C=wi;try{var D=Lg;for(wi=1;x>=de,q-=de,Fg=1<<32-xl(C)+q|D<Bn?(Vs=Rn,Rn=null):Vs=Rn.sibling;var Gr=vt(He,Rn,qe[Bn],kt);if(Gr===null){Rn===null&&(Rn=Vs);break}x&&Rn&&Gr.alternate===null&&C(He,Rn),Le=K(Gr,Le,Bn),An===null?pn=Gr:An.sibling=Gr,An=Gr,Rn=Vs}if(Bn===qe.length)return D(He,Rn),po&&Zb(He,Bn),pn;if(Rn===null){for(;BnBn?(Vs=Rn,Rn=null):Vs=Rn.sibling;var oy=vt(He,Rn,Gr.value,kt);if(oy===null){Rn===null&&(Rn=Vs);break}x&&Rn&&oy.alternate===null&&C(He,Rn),Le=K(oy,Le,Bn),An===null?pn=oy:An.sibling=oy,An=oy,Rn=Vs}if(Gr.done)return D(He,Rn),po&&Zb(He,Bn),pn;if(Rn===null){for(;!Gr.done;Bn++,Gr=qe.next())Gr=Ot(He,Gr.value,kt),Gr!==null&&(Le=K(Gr,Le,Bn),An===null?pn=Gr:An.sibling=Gr,An=Gr);return po&&Zb(He,Bn),pn}for(Rn=W(He,Rn);!Gr.done;Bn++,Gr=qe.next())Gr=en(Rn,He,Bn,Gr.value,kt),Gr!==null&&(x&&Gr.alternate!==null&&Rn.delete(Gr.key===null?Bn:Gr.key),Le=K(Gr,Le,Bn),An===null?pn=Gr:An.sibling=Gr,An=Gr);return x&&Rn.forEach(function(iut){return C(He,iut)}),po&&Zb(He,Bn),pn}function Yo(He,Le,qe,kt){if(typeof qe=="object"&&qe!==null&&qe.type===E&&qe.key===null&&(qe=qe.props.children),typeof qe=="object"&&qe!==null){switch(qe.$$typeof){case S:e:{for(var pn=qe.key,An=Le;An!==null;){if(An.key===pn){if(pn=qe.type,pn===E){if(An.tag===7){D(He,An.sibling),Le=q(An,qe.props.children),Le.return=He,He=Le;break e}}else if(An.elementType===pn||typeof pn=="object"&&pn!==null&&pn.$$typeof===$&&sye(pn)===An.type){D(He,An.sibling),Le=q(An,qe.props),Le.ref=JP(He,An,qe),Le.return=He,He=Le;break e}D(He,An);break}else C(He,An);An=An.sibling}qe.type===E?(Le=sx(qe.props.children,He.mode,kt,qe.key),Le.return=He,He=Le):(kt=WF(qe.type,qe.key,qe.props,null,He.mode,kt),kt.ref=JP(He,Le,qe),kt.return=He,He=kt)}return de(He);case _:e:{for(An=qe.key;Le!==null;){if(Le.key===An)if(Le.tag===4&&Le.stateNode.containerInfo===qe.containerInfo&&Le.stateNode.implementation===qe.implementation){D(He,Le.sibling),Le=q(Le,qe.children||[]),Le.return=He,He=Le;break e}else{D(He,Le);break}else C(He,Le);Le=Le.sibling}Le=vG(qe,He.mode,kt),Le.return=He,He=Le}return de(He);case $:return An=qe._init,Yo(He,Le,An(qe._payload),kt)}if(we(qe))return cn(He,Le,qe,kt);if(U(qe))return fn(He,Le,qe,kt);xF(He,qe)}return typeof qe=="string"&&qe!==""||typeof qe=="number"?(qe=""+qe,Le!==null&&Le.tag===6?(D(He,Le.sibling),Le=q(Le,qe),Le.return=He,He=Le):(D(He,Le),Le=mG(qe,He.mode,kt),Le.return=He,He=Le),de(He)):D(He,Le)}return Yo}var ZS=aye(!0),lye=aye(!1),wF=Xv(null),SF=null,JS=null,EH=null;function TH(){EH=JS=SF=null}function PH(x){var C=wF.current;no(wF),x._currentValue=C}function kH(x,C,D){for(;x!==null;){var W=x.alternate;if((x.childLanes&C)!==C?(x.childLanes|=C,W!==null&&(W.childLanes|=C)):W!==null&&(W.childLanes&C)!==C&&(W.childLanes|=C),x===D)break;x=x.return}}function e_(x,C){SF=x,EH=JS=null,x=x.dependencies,x!==null&&x.firstContext!==null&&((x.lanes&C)!==0&&(sc=!0),x.firstContext=null)}function Qu(x){var C=x._currentValue;if(EH!==x)if(x={context:x,memoizedValue:C,next:null},JS===null){if(SF===null)throw Error(n(308));JS=x,SF.dependencies={lanes:0,firstContext:x}}else JS=JS.next=x;return C}var Jb=null;function MH(x){Jb===null?Jb=[x]:Jb.push(x)}function cye(x,C,D,W){var q=C.interleaved;return q===null?(D.next=D,MH(C)):(D.next=q.next,q.next=D),C.interleaved=D,Ng(x,W)}function Ng(x,C){x.lanes|=C;var D=x.alternate;for(D!==null&&(D.lanes|=C),D=x,x=x.return;x!==null;)x.childLanes|=C,D=x.alternate,D!==null&&(D.childLanes|=C),D=x,x=x.return;return D.tag===3?D.stateNode:null}var Kv=!1;function AH(x){x.updateQueue={baseState:x.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uye(x,C){x=x.updateQueue,C.updateQueue===x&&(C.updateQueue={baseState:x.baseState,firstBaseUpdate:x.firstBaseUpdate,lastBaseUpdate:x.lastBaseUpdate,shared:x.shared,effects:x.effects})}function zg(x,C){return{eventTime:x,lane:C,tag:0,payload:null,callback:null,next:null}}function Zv(x,C,D){var W=x.updateQueue;if(W===null)return null;if(W=W.shared,(Br&2)!==0){var q=W.pending;return q===null?C.next=C:(C.next=q.next,q.next=C),W.pending=C,Ng(x,D)}return q=W.interleaved,q===null?(C.next=C,MH(W)):(C.next=q.next,q.next=C),W.interleaved=C,Ng(x,D)}function _F(x,C,D){if(C=C.updateQueue,C!==null&&(C=C.shared,(D&4194240)!==0)){var W=C.lanes;W&=x.pendingLanes,D|=W,C.lanes=D,HW(x,D)}}function fye(x,C){var D=x.updateQueue,W=x.alternate;if(W!==null&&(W=W.updateQueue,D===W)){var q=null,K=null;if(D=D.firstBaseUpdate,D!==null){do{var de={eventTime:D.eventTime,lane:D.lane,tag:D.tag,payload:D.payload,callback:D.callback,next:null};K===null?q=K=de:K=K.next=de,D=D.next}while(D!==null);K===null?q=K=C:K=K.next=C}else q=K=C;D={baseState:W.baseState,firstBaseUpdate:q,lastBaseUpdate:K,shared:W.shared,effects:W.effects},x.updateQueue=D;return}x=D.lastBaseUpdate,x===null?D.firstBaseUpdate=C:x.next=C,D.lastBaseUpdate=C}function CF(x,C,D,W){var q=x.updateQueue;Kv=!1;var K=q.firstBaseUpdate,de=q.lastBaseUpdate,Ae=q.shared.pending;if(Ae!==null){q.shared.pending=null;var Ie=Ae,Ye=Ie.next;Ie.next=null,de===null?K=Ye:de.next=Ye,de=Ie;var xt=x.alternate;xt!==null&&(xt=xt.updateQueue,Ae=xt.lastBaseUpdate,Ae!==de&&(Ae===null?xt.firstBaseUpdate=Ye:Ae.next=Ye,xt.lastBaseUpdate=Ie))}if(K!==null){var Ot=q.baseState;de=0,xt=Ye=Ie=null,Ae=K;do{var vt=Ae.lane,en=Ae.eventTime;if((W&vt)===vt){xt!==null&&(xt=xt.next={eventTime:en,lane:0,tag:Ae.tag,payload:Ae.payload,callback:Ae.callback,next:null});e:{var cn=x,fn=Ae;switch(vt=C,en=D,fn.tag){case 1:if(cn=fn.payload,typeof cn=="function"){Ot=cn.call(en,Ot,vt);break e}Ot=cn;break e;case 3:cn.flags=cn.flags&-65537|128;case 0:if(cn=fn.payload,vt=typeof cn=="function"?cn.call(en,Ot,vt):cn,vt==null)break e;Ot=z({},Ot,vt);break e;case 2:Kv=!0}}Ae.callback!==null&&Ae.lane!==0&&(x.flags|=64,vt=q.effects,vt===null?q.effects=[Ae]:vt.push(Ae))}else en={eventTime:en,lane:vt,tag:Ae.tag,payload:Ae.payload,callback:Ae.callback,next:null},xt===null?(Ye=xt=en,Ie=Ot):xt=xt.next=en,de|=vt;if(Ae=Ae.next,Ae===null){if(Ae=q.shared.pending,Ae===null)break;vt=Ae,Ae=vt.next,vt.next=null,q.lastBaseUpdate=vt,q.shared.pending=null}}while(!0);if(xt===null&&(Ie=Ot),q.baseState=Ie,q.firstBaseUpdate=Ye,q.lastBaseUpdate=xt,C=q.shared.interleaved,C!==null){q=C;do de|=q.lane,q=q.next;while(q!==C)}else K===null&&(q.shared.lanes=0);nx|=de,x.lanes=de,x.memoizedState=Ot}}function dye(x,C,D){if(x=C.effects,C.effects=null,x!==null)for(C=0;CD?D:4,x(!0);var W=FH.transition;FH.transition={};try{x(!1),C()}finally{wi=D,FH.transition=W}}function Aye(){return Ku().memoizedState}function Pct(x,C,D){var W=ny(x);if(D={lane:W,action:D,hasEagerState:!1,eagerState:null,next:null},Rye(x))Iye(C,D);else if(D=cye(x,C,D,W),D!==null){var q=_l();wd(D,x,W,q),Dye(D,C,W)}}function kct(x,C,D){var W=ny(x),q={lane:W,action:D,hasEagerState:!1,eagerState:null,next:null};if(Rye(x))Iye(C,q);else{var K=x.alternate;if(x.lanes===0&&(K===null||K.lanes===0)&&(K=C.lastRenderedReducer,K!==null))try{var de=C.lastRenderedState,Ae=K(de,D);if(q.hasEagerState=!0,q.eagerState=Ae,md(Ae,de)){var Ie=C.interleaved;Ie===null?(q.next=q,MH(C)):(q.next=Ie.next,Ie.next=q),C.interleaved=q;return}}catch{}D=cye(x,C,q,W),D!==null&&(q=_l(),wd(D,x,W,q),Dye(D,C,W))}}function Rye(x){var C=x.alternate;return x===Eo||C!==null&&C===Eo}function Iye(x,C){rk=TF=!0;var D=x.pending;D===null?C.next=C:(C.next=D.next,D.next=C),x.pending=C}function Dye(x,C,D){if((D&4194240)!==0){var W=C.lanes;W&=x.pendingLanes,D|=W,C.lanes=D,HW(x,D)}}var MF={readContext:Qu,useCallback:Va,useContext:Va,useEffect:Va,useImperativeHandle:Va,useInsertionEffect:Va,useLayoutEffect:Va,useMemo:Va,useReducer:Va,useRef:Va,useState:Va,useDebugValue:Va,useDeferredValue:Va,useTransition:Va,useMutableSource:Va,useSyncExternalStore:Va,useId:Va,unstable_isNewReconciler:!1},Mct={readContext:Qu,useCallback:function(x,C){return jh().memoizedState=[x,C===void 0?null:C],x},useContext:Qu,useEffect:_ye,useImperativeHandle:function(x,C,D){return D=D!=null?D.concat([x]):null,PF(4194308,4,Eye.bind(null,C,x),D)},useLayoutEffect:function(x,C){return PF(4194308,4,x,C)},useInsertionEffect:function(x,C){return PF(4,2,x,C)},useMemo:function(x,C){var D=jh();return C=C===void 0?null:C,x=x(),D.memoizedState=[x,C],x},useReducer:function(x,C,D){var W=jh();return C=D!==void 0?D(C):C,W.memoizedState=W.baseState=C,x={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:x,lastRenderedState:C},W.queue=x,x=x.dispatch=Pct.bind(null,Eo,x),[W.memoizedState,x]},useRef:function(x){var C=jh();return x={current:x},C.memoizedState=x},useState:wye,useDebugValue:VH,useDeferredValue:function(x){return jh().memoizedState=x},useTransition:function(){var x=wye(!1),C=x[0];return x=Tct.bind(null,x[1]),jh().memoizedState=x,[C,x]},useMutableSource:function(){},useSyncExternalStore:function(x,C,D){var W=Eo,q=jh();if(po){if(D===void 0)throw Error(n(407));D=D()}else{if(D=C(),Us===null)throw Error(n(349));(tx&30)!==0||mye(W,C,D)}q.memoizedState=D;var K={value:D,getSnapshot:C};return q.queue=K,_ye(yye.bind(null,W,K,x),[x]),W.flags|=2048,sk(9,vye.bind(null,W,K,D,C),void 0,null),D},useId:function(){var x=jh(),C=Us.identifierPrefix;if(po){var D=$g,W=Fg;D=(W&~(1<<32-xl(W)-1)).toString(32)+D,C=":"+C+"R"+D,D=ik++,0<\/script>",x=x.removeChild(x.firstChild)):typeof W.is=="string"?x=de.createElement(D,{is:W.is}):(x=de.createElement(D),D==="select"&&(de=x,W.multiple?de.multiple=!0:W.size&&(de.size=W.size))):x=de.createElementNS(x,D),x[Bh]=C,x[ik]=W,sbe(x,C,!1,!1),C.stateNode=x;e:{switch(de=Me(D,W),D){case"dialog":eo("cancel",x),eo("close",x),q=W;break;case"iframe":case"object":case"embed":eo("load",x),q=W;break;case"video":case"audio":for(q=0;qh_&&(C.flags|=128,W=!0,pk(K,!1),C.lanes=4194304)}else{if(!W)if(x=zF(de),x!==null){if(C.flags|=128,W=!0,D=x.updateQueue,D!==null&&(C.updateQueue=D,C.flags|=4),pk(K,!0),K.tail===null&&K.tailMode==="hidden"&&!de.alternate&&!go)return Wa(C),null}else 2*Ir()-K.renderingStartTime>h_&&D!==1073741824&&(C.flags|=128,W=!0,pk(K,!1),C.lanes=4194304);K.isBackwards?(de.sibling=C.child,C.child=de):(D=K.last,D!==null?D.sibling=de:C.child=de,K.last=de)}return K.tail!==null?(C=K.tail,K.rendering=C,K.tail=C.sibling,K.renderingStartTime=Ir(),C.sibling=null,D=Oo.current,Gi(Oo,W?D&1|2:D&1),C):(Wa(C),null);case 22:case 23:return $G(),W=C.memoizedState!==null,x!==null&&x.memoizedState!==null!==W&&(C.flags|=8192),W&&(C.mode&1)!==0?(eu&1073741824)!==0&&(Wa(C),C.subtreeFlags&6&&(C.flags|=8192)):Wa(C),null;case 24:return null;case 25:return null}throw Error(n(156,C.tag))}function edt(x,C){switch(GH(C),C.tag){case 1:return lc(C.type)&&PF(),x=C.flags,x&65536?(C.flags=x&-65537|128,C):null;case 3:return c_(),to(ac),to(Ua),oG(),x=C.flags,(x&65536)!==0&&(x&128)===0?(C.flags=x&-65537|128,C):null;case 5:return rG(C),null;case 13:if(to(Oo),x=C.memoizedState,x!==null&&x.dehydrated!==null){if(C.alternate===null)throw Error(n(340));o_()}return x=C.flags,x&65536?(C.flags=x&-65537|128,C):null;case 19:return to(Oo),null;case 4:return c_(),null;case 10:return ZH(C.type._context),null;case 22:case 23:return $G(),null;case 24:return null;default:return null}}var XF=!1,Ha=!1,tdt=typeof WeakSet=="function"?WeakSet:Set,an=null;function f_(x,C){var D=x.ref;if(D!==null)if(typeof D=="function")try{D(null)}catch(W){Ro(x,C,W)}else D.current=null}function OG(x,C,D){try{D()}catch(W){Ro(x,C,W)}}var cbe=!1;function ndt(x,C){if($H=pF,x=Bye(),kH(x)){if("selectionStart"in x)var D={start:x.selectionStart,end:x.selectionEnd};else e:{D=(D=x.ownerDocument)&&D.defaultView||window;var W=D.getSelection&&D.getSelection();if(W&&W.rangeCount!==0){D=W.anchorNode;var q=W.anchorOffset,K=W.focusNode;W=W.focusOffset;try{D.nodeType,K.nodeType}catch{D=null;break e}var de=0,Ae=-1,Ie=-1,Ye=0,xt=0,Ct=x,vt=null;t:for(;;){for(var Jt;Ct!==D||q!==0&&Ct.nodeType!==3||(Ae=de+q),Ct!==K||W!==0&&Ct.nodeType!==3||(Ie=de+W),Ct.nodeType===3&&(de+=Ct.nodeValue.length),(Jt=Ct.firstChild)!==null;)vt=Ct,Ct=Jt;for(;;){if(Ct===x)break t;if(vt===D&&++Ye===q&&(Ae=de),vt===K&&++xt===W&&(Ie=de),(Jt=Ct.nextSibling)!==null)break;Ct=vt,vt=Ct.parentNode}Ct=Jt}D=Ae===-1||Ie===-1?null:{start:Ae,end:Ie}}else D=null}D=D||{start:0,end:0}}else D=null;for(NH={focusedElem:x,selectionRange:D},pF=!1,an=C;an!==null;)if(C=an,x=C.child,(C.subtreeFlags&1028)!==0&&x!==null)x.return=C,an=x;else for(;an!==null;){C=an;try{var cn=C.alternate;if((C.flags&1024)!==0)switch(C.tag){case 0:case 11:case 15:break;case 1:if(cn!==null){var fn=cn.memoizedProps,Go=cn.memoizedState,He=C.stateNode,Le=He.getSnapshotBeforeUpdate(C.elementType===C.type?fn:xd(C.type,fn),Go);He.__reactInternalSnapshotBeforeUpdate=Le}break;case 3:var qe=C.stateNode.containerInfo;qe.nodeType===1?qe.textContent="":qe.nodeType===9&&qe.documentElement&&qe.removeChild(qe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(kt){Ro(C,C.return,kt)}if(x=C.sibling,x!==null){x.return=C.return,an=x;break}an=C.return}return cn=cbe,cbe=!1,cn}function gk(x,C,D){var W=C.updateQueue;if(W=W!==null?W.lastEffect:null,W!==null){var q=W=W.next;do{if((q.tag&x)===x){var K=q.destroy;q.destroy=void 0,K!==void 0&&OG(C,D,K)}q=q.next}while(q!==W)}}function YF(x,C){if(C=C.updateQueue,C=C!==null?C.lastEffect:null,C!==null){var D=C=C.next;do{if((D.tag&x)===x){var W=D.create;D.destroy=W()}D=D.next}while(D!==C)}}function EG(x){var C=x.ref;if(C!==null){var D=x.stateNode;switch(x.tag){case 5:x=D;break;default:x=D}typeof C=="function"?C(x):C.current=x}}function ube(x){var C=x.alternate;C!==null&&(x.alternate=null,ube(C)),x.child=null,x.deletions=null,x.sibling=null,x.tag===5&&(C=x.stateNode,C!==null&&(delete C[Bh],delete C[ik],delete C[UH],delete C[Nft],delete C[zft])),x.stateNode=null,x.return=null,x.dependencies=null,x.memoizedProps=null,x.memoizedState=null,x.pendingProps=null,x.stateNode=null,x.updateQueue=null}function fbe(x){return x.tag===5||x.tag===3||x.tag===4}function dbe(x){e:for(;;){for(;x.sibling===null;){if(x.return===null||fbe(x.return))return null;x=x.return}for(x.sibling.return=x.return,x=x.sibling;x.tag!==5&&x.tag!==6&&x.tag!==18;){if(x.flags&2||x.child===null||x.tag===4)continue e;x.child.return=x,x=x.child}if(!(x.flags&2))return x.stateNode}}function TG(x,C,D){var W=x.tag;if(W===5||W===6)x=x.stateNode,C?D.nodeType===8?D.parentNode.insertBefore(x,C):D.insertBefore(x,C):(D.nodeType===8?(C=D.parentNode,C.insertBefore(x,D)):(C=D,C.appendChild(x)),D=D._reactRootContainer,D!=null||C.onclick!==null||(C.onclick=EF));else if(W!==4&&(x=x.child,x!==null))for(TG(x,C,D),x=x.sibling;x!==null;)TG(x,C,D),x=x.sibling}function PG(x,C,D){var W=x.tag;if(W===5||W===6)x=x.stateNode,C?D.insertBefore(x,C):D.appendChild(x);else if(W!==4&&(x=x.child,x!==null))for(PG(x,C,D),x=x.sibling;x!==null;)PG(x,C,D),x=x.sibling}var va=null,wd=!1;function ry(x,C,D){for(D=D.child;D!==null;)hbe(x,C,D),D=D.sibling}function hbe(x,C,D){if(Pi&&typeof Pi.onCommitFiberUnmount=="function")try{Pi.onCommitFiberUnmount(sc,D)}catch{}switch(D.tag){case 5:Ha||f_(D,C);case 6:var W=va,q=wd;va=null,ry(x,C,D),va=W,wd=q,va!==null&&(wd?(x=va,D=D.stateNode,x.nodeType===8?x.parentNode.removeChild(D):x.removeChild(D)):va.removeChild(D.stateNode));break;case 18:va!==null&&(wd?(x=va,D=D.stateNode,x.nodeType===8?BH(x.parentNode,D):x.nodeType===1&&BH(x,D),qP(x)):BH(va,D.stateNode));break;case 4:W=va,q=wd,va=D.stateNode.containerInfo,wd=!0,ry(x,C,D),va=W,wd=q;break;case 0:case 11:case 14:case 15:if(!Ha&&(W=D.updateQueue,W!==null&&(W=W.lastEffect,W!==null))){q=W=W.next;do{var K=q,de=K.destroy;K=K.tag,de!==void 0&&((K&2)!==0||(K&4)!==0)&&OG(D,C,de),q=q.next}while(q!==W)}ry(x,C,D);break;case 1:if(!Ha&&(f_(D,C),W=D.stateNode,typeof W.componentWillUnmount=="function"))try{W.props=D.memoizedProps,W.state=D.memoizedState,W.componentWillUnmount()}catch(Ae){Ro(D,C,Ae)}ry(x,C,D);break;case 21:ry(x,C,D);break;case 22:D.mode&1?(Ha=(W=Ha)||D.memoizedState!==null,ry(x,C,D),Ha=W):ry(x,C,D);break;default:ry(x,C,D)}}function pbe(x){var C=x.updateQueue;if(C!==null){x.updateQueue=null;var D=x.stateNode;D===null&&(D=x.stateNode=new tdt),C.forEach(function(W){var q=fdt.bind(null,x,W);D.has(W)||(D.add(W),W.then(q,q))})}}function Sd(x,C){var D=C.deletions;if(D!==null)for(var W=0;Wq&&(q=de),W&=~K}if(W=q,W=Ir()-W,W=(120>W?120:480>W?480:1080>W?1080:1920>W?1920:3e3>W?3e3:4320>W?4320:1960*idt(W/1960))-W,10x?16:x,oy===null)var W=!1;else{if(x=oy,oy=null,e$=0,(jr&6)!==0)throw Error(n(331));var q=jr;for(jr|=4,an=x.current;an!==null;){var K=an,de=K.child;if((an.flags&16)!==0){var Ae=K.deletions;if(Ae!==null){for(var Ie=0;IeIr()-AG?lx(x,0):MG|=D),fc(x,C)}function Tbe(x,C){C===0&&((x.mode&1)===0?C=1:(C=uF,uF<<=1,(uF&130023424)===0&&(uF=4194304)));var D=Cl();x=Bg(x,C),x!==null&&(UP(x,C,D),fc(x,D))}function udt(x){var C=x.memoizedState,D=0;C!==null&&(D=C.retryLane),Tbe(x,D)}function fdt(x,C){var D=0;switch(x.tag){case 13:var W=x.stateNode,q=x.memoizedState;q!==null&&(D=q.retryLane);break;case 19:W=x.stateNode;break;default:throw Error(n(314))}W!==null&&W.delete(C),Tbe(x,D)}var Pbe;Pbe=function(x,C,D){if(x!==null)if(x.memoizedProps!==C.pendingProps||ac.current)cc=!0;else{if((x.lanes&D)===0&&(C.flags&128)===0)return cc=!1,Zft(x,C,D);cc=(x.flags&131072)!==0}else cc=!1,go&&(C.flags&1048576)!==0&&a0e(C,RF,C.index);switch(C.lanes=0,C.tag){case 2:var W=C.type;qF(x,C),x=C.pendingProps;var q=n_(C,Ua.current);l_(C,D),q=lG(null,C,W,x,q,D);var K=cG();return C.flags|=1,typeof q=="object"&&q!==null&&typeof q.render=="function"&&q.$$typeof===void 0?(C.tag=1,C.memoizedState=null,C.updateQueue=null,lc(W)?(K=!0,kF(C)):K=!1,C.memoizedState=q.state!==null&&q.state!==void 0?q.state:null,tG(C),q.updater=HF,C.stateNode=q,q._reactInternals=C,gG(C,W,x,D),C=bG(null,C,W,!0,K,D)):(C.tag=0,go&&K&&HH(C),_l(null,C,q,D),C=C.child),C;case 16:W=C.elementType;e:{switch(qF(x,C),x=C.pendingProps,q=W._init,W=q(W._payload),C.type=W,q=C.tag=hdt(W),x=xd(W,x),q){case 0:C=yG(null,C,W,x,D);break e;case 1:C=ebe(null,C,W,x,D);break e;case 11:C=Y0e(null,C,W,x,D);break e;case 14:C=Q0e(null,C,W,xd(W.type,x),D);break e}throw Error(n(306,W,""))}return C;case 0:return W=C.type,q=C.pendingProps,q=C.elementType===W?q:xd(W,q),yG(x,C,W,q,D);case 1:return W=C.type,q=C.pendingProps,q=C.elementType===W?q:xd(W,q),ebe(x,C,W,q,D);case 3:e:{if(tbe(C),x===null)throw Error(n(387));W=C.pendingProps,K=C.memoizedState,q=K.element,m0e(x,C),NF(C,W,null,D);var de=C.memoizedState;if(W=de.element,K.isDehydrated)if(K={element:W,isDehydrated:!1,cache:de.cache,pendingSuspenseBoundaries:de.pendingSuspenseBoundaries,transitions:de.transitions},C.updateQueue.baseState=K,C.memoizedState=K,C.flags&256){q=u_(Error(n(423)),C),C=nbe(x,C,W,D,q);break e}else if(W!==q){q=u_(Error(n(424)),C),C=nbe(x,C,W,D,q);break e}else for(Jc=Kv(C.stateNode.containerInfo.firstChild),Zc=C,go=!0,bd=null,D=p0e(C,null,W,D),C.child=D;D;)D.flags=D.flags&-3|4096,D=D.sibling;else{if(o_(),W===q){C=Vg(x,C,D);break e}_l(x,C,W,D)}C=C.child}return C;case 5:return b0e(C),x===null&&XH(C),W=C.type,q=C.pendingProps,K=x!==null?x.memoizedProps:null,de=q.children,zH(W,q)?de=null:K!==null&&zH(W,K)&&(C.flags|=32),J0e(x,C),_l(x,C,de,D),C.child;case 6:return x===null&&XH(C),null;case 13:return rbe(x,C,D);case 4:return nG(C,C.stateNode.containerInfo),W=C.pendingProps,x===null?C.child=s_(C,null,W,D):_l(x,C,W,D),C.child;case 11:return W=C.type,q=C.pendingProps,q=C.elementType===W?q:xd(W,q),Y0e(x,C,W,q,D);case 7:return _l(x,C,C.pendingProps,D),C.child;case 8:return _l(x,C,C.pendingProps.children,D),C.child;case 12:return _l(x,C,C.pendingProps.children,D),C.child;case 10:e:{if(W=C.type._context,q=C.pendingProps,K=C.memoizedProps,de=q.value,Gi(LF,W._currentValue),W._currentValue=de,K!==null)if(yd(K.value,de)){if(K.children===q.children&&!ac.current){C=Vg(x,C,D);break e}}else for(K=C.child,K!==null&&(K.return=C);K!==null;){var Ae=K.dependencies;if(Ae!==null){de=K.child;for(var Ie=Ae.firstContext;Ie!==null;){if(Ie.context===W){if(K.tag===1){Ie=Ug(-1,D&-D),Ie.tag=2;var Ye=K.updateQueue;if(Ye!==null){Ye=Ye.shared;var xt=Ye.pending;xt===null?Ie.next=Ie:(Ie.next=xt.next,xt.next=Ie),Ye.pending=Ie}}K.lanes|=D,Ie=K.alternate,Ie!==null&&(Ie.lanes|=D),JH(K.return,D,C),Ae.lanes|=D;break}Ie=Ie.next}}else if(K.tag===10)de=K.type===C.type?null:K.child;else if(K.tag===18){if(de=K.return,de===null)throw Error(n(341));de.lanes|=D,Ae=de.alternate,Ae!==null&&(Ae.lanes|=D),JH(de,D,C),de=K.sibling}else de=K.child;if(de!==null)de.return=K;else for(de=K;de!==null;){if(de===C){de=null;break}if(K=de.sibling,K!==null){K.return=de.return,de=K;break}de=de.return}K=de}_l(x,C,q.children,D),C=C.child}return C;case 9:return q=C.type,W=C.pendingProps.children,l_(C,D),q=Qu(q),W=W(q),C.flags|=1,_l(x,C,W,D),C.child;case 14:return W=C.type,q=xd(W,C.pendingProps),q=xd(W.type,q),Q0e(x,C,W,q,D);case 15:return K0e(x,C,C.type,C.pendingProps,D);case 17:return W=C.type,q=C.pendingProps,q=C.elementType===W?q:xd(W,q),qF(x,C),C.tag=1,lc(W)?(x=!0,kF(C)):x=!1,l_(C,D),U0e(C,W,q),gG(C,W,q,D),bG(null,C,W,!0,x,D);case 19:return obe(x,C,D);case 22:return Z0e(x,C,D)}throw Error(n(156,C.tag))};function kbe(x,C){return Tn(x,C)}function ddt(x,C,D,W){this.tag=x,this.key=D,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=C,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=W,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ju(x,C,D,W){return new ddt(x,C,D,W)}function zG(x){return x=x.prototype,!(!x||!x.isReactComponent)}function hdt(x){if(typeof x=="function")return zG(x)?1:0;if(x!=null){if(x=x.$$typeof,x===I)return 11;if(x===L)return 14}return 2}function ly(x,C){var D=x.alternate;return D===null?(D=Ju(x.tag,C,x.key,x.mode),D.elementType=x.elementType,D.type=x.type,D.stateNode=x.stateNode,D.alternate=x,x.alternate=D):(D.pendingProps=C,D.type=x.type,D.flags=0,D.subtreeFlags=0,D.deletions=null),D.flags=x.flags&14680064,D.childLanes=x.childLanes,D.lanes=x.lanes,D.child=x.child,D.memoizedProps=x.memoizedProps,D.memoizedState=x.memoizedState,D.updateQueue=x.updateQueue,C=x.dependencies,D.dependencies=C===null?null:{lanes:C.lanes,firstContext:C.firstContext},D.sibling=x.sibling,D.index=x.index,D.ref=x.ref,D}function i$(x,C,D,W,q,K){var de=2;if(W=x,typeof x=="function")zG(x)&&(de=1);else if(typeof x=="string")de=5;else e:switch(x){case E:return ux(D.children,q,K,C);case T:de=8,q|=8;break;case k:return x=Ju(12,D,C,q|2),x.elementType=k,x.lanes=K,x;case F:return x=Ju(13,D,C,q),x.elementType=F,x.lanes=K,x;case A:return x=Ju(19,D,C,q),x.elementType=A,x.lanes=K,x;case j:return o$(D,q,K,C);default:if(typeof x=="object"&&x!==null)switch(x.$$typeof){case P:de=10;break e;case R:de=9;break e;case I:de=11;break e;case L:de=14;break e;case $:de=16,W=null;break e}throw Error(n(130,x==null?x:typeof x,""))}return C=Ju(de,D,C,q),C.elementType=x,C.type=W,C.lanes=K,C}function ux(x,C,D,W){return x=Ju(7,x,W,C),x.lanes=D,x}function o$(x,C,D,W){return x=Ju(22,x,W,C),x.elementType=j,x.lanes=D,x.stateNode={isHidden:!1},x}function jG(x,C,D){return x=Ju(6,x,null,C),x.lanes=D,x}function BG(x,C,D){return C=Ju(4,x.children!==null?x.children:[],x.key,C),C.lanes=D,C.stateNode={containerInfo:x.containerInfo,pendingChildren:null,implementation:x.implementation},C}function pdt(x,C,D,W,q){this.tag=C,this.containerInfo=x,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pH(0),this.expirationTimes=pH(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pH(0),this.identifierPrefix=W,this.onRecoverableError=q,this.mutableSourceEagerHydrationData=null}function UG(x,C,D,W,q,K,de,Ae,Ie){return x=new pdt(x,C,D,Ae,Ie),C===1?(C=1,K===!0&&(C|=8)):C=0,K=Ju(3,null,null,C),x.current=K,K.stateNode=x,K.memoizedState={element:W,isDehydrated:D,cache:null,transitions:null,pendingSuspenseBoundaries:null},tG(K),x}function gdt(x,C,D){var W=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),XG.exports=Pdt(),XG.exports}var Vbe;function kdt(){if(Vbe)return d$;Vbe=1;var e=D6();return d$.createRoot=e.createRoot,d$.hydrateRoot=e.hydrateRoot,d$}var Mdt=kdt();const Adt=Vn(Mdt);var M=hg();const Te=Vn(M),R5=wdt({__proto__:null,default:Te},[M]);var KG={exports:{}},ZG,Wbe;function Rdt(){if(Wbe)return ZG;Wbe=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ZG=e,ZG}var JG,Hbe;function Idt(){if(Hbe)return JG;Hbe=1;var e=Rdt();function t(){}function n(){}return n.resetWarningCache=t,JG=function(){function r(s,a,l,c,u,f){if(f!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},JG}var Gbe;function UI(){return Gbe||(Gbe=1,KG.exports=Idt()()),KG.exports}var Ddt=UI();const le=Vn(Ddt);var L6=Te.createContext(null);function Ldt(e){e()}var g5e=Ldt,Fdt=function(t){return g5e=t},$dt=function(){return g5e};function Ndt(){var e=$dt(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var i=t;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=t;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,s=n={callback:i,next:null,prev:n};return s.prev?s.prev.next=s:t=s,function(){!o||t===null||(o=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}var qbe={notify:function(){},get:function(){return[]}};function m5e(e,t){var n,r=qbe;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function s(){u.onStateChange&&u.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=Ndt())}function c(){n&&(n(),n=void 0,r.clear(),r=qbe)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var v5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?M.useLayoutEffect:M.useEffect;function zdt(e){var t=e.store,n=e.context,r=e.children,i=M.useMemo(function(){var a=m5e(t);return{store:t,subscription:a}},[t]),o=M.useMemo(function(){return t.getState()},[t]);v5e(function(){var a=i.subscription;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),o!==t.getState()&&a.notifyNestedSubs(),function(){a.tryUnsubscribe(),a.onStateChange=null}},[i,o]);var s=n||L6;return Te.createElement(s.Provider,{value:i},r)}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;r--){var i=t[r](e);if(i)return i}return function(o,s){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+s.wrappedComponentName+".")}}function xht(e,t){return e===t}function wht(e){var t={},n=t.connectHOC,r=n===void 0?tht:n,i=t.mapStateToPropsFactories,o=i===void 0?cht:i,s=t.mapDispatchToPropsFactories,a=s===void 0?sht:s,l=t.mergePropsFactories,c=l===void 0?pht:l,u=t.selectorFactory,f=u===void 0?yht:u;return function(h,p,g,m){m===void 0&&(m={});var v=m,y=v.pure,b=y===void 0?!0:y,w=v.areStatesEqual,S=w===void 0?xht:w,_=v.areOwnPropsEqual,E=_===void 0?r9:_,T=v.areStatePropsEqual,k=T===void 0?r9:T,P=v.areMergedPropsEqual,R=P===void 0?r9:P,I=it(v,bht),F=i9(h,o,"mapStateToProps"),A=i9(p,a,"mapDispatchToProps"),L=i9(g,c,"mergeProps");return r(f,X({methodName:"connect",getDisplayName:function(j){return"Connect("+j+")"},shouldHandleStateChanges:!!h,initMapStateToProps:F,initMapDispatchToProps:A,initMergeProps:L,pure:b,areStatesEqual:S,areOwnPropsEqual:E,areStatePropsEqual:k,areMergedPropsEqual:R},I))}}const dr=wht();var F6=D6();const h$=Vn(F6);Fdt(F6.unstable_batchedUpdates);function lv(e){"@babel/helpers - typeof";return lv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lv(e)}function Sht(e,t){if(lv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tw(e){var t=Sht(e,"string");return lv(t)=="symbol"?t:t+""}function Qt(e,t,n){return(t=tw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nxe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rxe(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(au(1));return n(b5e)(e,t)}if(typeof e!="function")throw new Error(au(2));var i=e,o=t,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(au(3));return o}function f(g){if(typeof g!="function")throw new Error(au(4));if(l)throw new Error(au(5));var m=!0;return c(),a.push(g),function(){if(m){if(l)throw new Error(au(6));m=!1,c();var y=a.indexOf(g);a.splice(y,1),s=null}}}function d(g){if(!_ht(g))throw new Error(au(7));if(typeof g.type>"u")throw new Error(au(8));if(l)throw new Error(au(9));try{l=!0,o=i(o,g)}finally{l=!1}for(var m=s=a,v=0;v"u"?"undefined":L(N);return B!=="object"?B:N===Math?"math":N===null?"null":Array.isArray(N)?"array":Object.prototype.toString.call(N)==="[object Date]"?"date":typeof N.toString=="function"&&/^\/.*\//.test(N.toString())?"regexp":"object"}function f(N,B,H,Q,Y,Z,pe){Y=Y||[],pe=pe||[];var ie=Y.slice(0);if(typeof Z<"u"){if(Q){if(typeof Q=="function"&&Q(ie,Z))return;if((typeof Q>"u"?"undefined":L(Q))==="object"){if(Q.prefilter&&Q.prefilter(ie,Z))return;if(Q.normalize){var ne=Q.normalize(ie,Z,N,B);ne&&(N=ne[0],B=ne[1])}}}ie.push(Z)}u(N)==="regexp"&&u(B)==="regexp"&&(N=N.toString(),B=B.toString());var fe=typeof N>"u"?"undefined":L(N),me=typeof B>"u"?"undefined":L(B),se=fe!=="undefined"||pe&&pe[pe.length-1].lhs&&pe[pe.length-1].lhs.hasOwnProperty(Z),ue=me!=="undefined"||pe&&pe[pe.length-1].rhs&&pe[pe.length-1].rhs.hasOwnProperty(Z);if(!se&&ue)H(new s(ie,B));else if(!ue&&se)H(new a(ie,N));else if(u(N)!==u(B))H(new o(ie,N,B));else if(u(N)==="date"&&N-B!==0)H(new o(ie,N,B));else if(fe==="object"&&N!==null&&B!==null)if(pe.filter(function(J){return J.lhs===N}).length)N!==B&&H(new o(ie,N,B));else{if(pe.push({lhs:N,rhs:B}),Array.isArray(N)){var G;for(N.length,G=0;G=B.length?H(new l(ie,G,new a(void 0,N[G]))):f(N[G],B[G],H,Q,ie,G,pe);for(;G=0?(f(N[J],B[J],H,Q,ie,J,pe),he=c(he,ae)):f(N[J],void 0,H,Q,ie,J,pe)}),he.forEach(function(J){f(void 0,B[J],H,Q,ie,J,pe)})}pe.length=pe.length-1}else N!==B&&(fe==="number"&&isNaN(N)&&isNaN(B)||H(new o(ie,N,B)))}function d(N,B,H,Q){return Q=Q||[],f(N,B,function(Y){Y&&Q.push(Y)},H),Q.length?Q:void 0}function h(N,B,H){if(H.path&&H.path.length){var Q,Y=N[B],Z=H.path.length-1;for(Q=0;Q"u"&&(Q[H.path[Y]]=typeof H.path[Y]=="number"?[]:{}),Q=Q[H.path[Y]];switch(H.kind){case"A":h(H.path?Q[H.path[Y]]:Q,H.index,H.item);break;case"D":delete Q[H.path[Y]];break;case"E":case"N":Q[H.path[Y]]=H.rhs}}}function g(N,B,H){if(H.path&&H.path.length){var Q,Y=N[B],Z=H.path.length-1;for(Q=0;Q"u"&&(Z[H.path[Q]]={}),Z=Z[H.path[Q]];switch(H.kind){case"A":g(Z[H.path[Q]],H.index,H.item);break;case"D":Z[H.path[Q]]=H.lhs;break;case"E":Z[H.path[Q]]=H.lhs;break;case"N":delete Z[H.path[Q]]}}}function v(N,B,H){if(N&&B){var Q=function(Y){H&&!H(N,B,Y)||p(N,B,Y)};f(N,B,Q)}}function y(N){return"color: "+V[N].color+"; font-weight: bold"}function b(N){var B=N.kind,H=N.path,Q=N.lhs,Y=N.rhs,Z=N.index,pe=N.item;switch(B){case"E":return[H.join("."),Q,"→",Y];case"N":return[H.join("."),Y];case"D":return[H.join(".")];case"A":return[H.join(".")+"["+Z+"]",pe];default:return[]}}function w(N,B,H,Q){var Y=d(N,B);try{Q?H.groupCollapsed("diff"):H.group("diff")}catch{H.log("diff")}Y?Y.forEach(function(Z){var pe=Z.kind,ie=b(Z);H.log.apply(H,["%c "+V[pe].text,y(pe)].concat($(ie)))}):H.log("—— no diff ——");try{H.groupEnd()}catch{H.log("—— diff end —— ")}}function S(N,B,H,Q){switch(typeof N>"u"?"undefined":L(N)){case"object":return typeof N[Q]=="function"?N[Q].apply(N,$(H)):N[Q];case"function":return N(B);default:return N}}function _(N){var B=N.timestamp,H=N.duration;return function(Q,Y,Z){var pe=["action"];return pe.push("%c"+String(Q.type)),B&&pe.push("%c@ "+Y),H&&pe.push("%c(in "+Z.toFixed(2)+" ms)"),pe.join(" ")}}function E(N,B){var H=B.logger,Q=B.actionTransformer,Y=B.titleFormatter,Z=Y===void 0?_(B):Y,pe=B.collapsed,ie=B.colors,ne=B.level,fe=B.diff,me=typeof B.titleFormatter>"u";N.forEach(function(se,ue){var G=se.started,ce=se.startedTime,he=se.action,J=se.prevState,te=se.error,ae=se.took,we=se.nextState,Pe=N[ue+1];Pe&&(we=Pe.prevState,ae=Pe.started-G);var ee=Q(he),oe=typeof pe=="function"?pe(function(){return we},he,se):pe,Se=F(ce),ye=ie.title?"color: "+ie.title(ee)+";":"",be=["color: gray; font-weight: lighter;"];be.push(ye),B.timestamp&&be.push("color: gray; font-weight: lighter;"),B.duration&&be.push("color: gray; font-weight: lighter;");var ge=Z(ee,Se,ae);try{oe?ie.title&&me?H.groupCollapsed.apply(H,["%c "+ge].concat(be)):H.groupCollapsed(ge):ie.title&&me?H.group.apply(H,["%c "+ge].concat(be)):H.group(ge)}catch{H.log(ge)}var xe=S(ne,ee,[J],"prevState"),re=S(ne,ee,[ee],"action"),Ee=S(ne,ee,[te,J],"error"),ke=S(ne,ee,[we],"nextState");if(xe)if(ie.prevState){var je="color: "+ie.prevState(J)+"; font-weight: bold";H[xe]("%c prev state",je,J)}else H[xe]("prev state",J);if(re)if(ie.action){var De="color: "+ie.action(ee)+"; font-weight: bold";H[re]("%c action ",De,ee)}else H[re]("action ",ee);if(te&&Ee)if(ie.error){var ze="color: "+ie.error(te,J)+"; font-weight: bold;";H[Ee]("%c error ",ze,te)}else H[Ee]("error ",te);if(ke)if(ie.nextState){var Je="color: "+ie.nextState(we)+"; font-weight: bold";H[ke]("%c next state",Je,we)}else H[ke]("next state",we);fe&&w(J,we,H,oe);try{H.groupEnd()}catch{H.log("—— log end ——")}})}function T(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=Object.assign({},U,N),H=B.logger,Q=B.stateTransformer,Y=B.errorTransformer,Z=B.predicate,pe=B.logErrors,ie=B.diffPredicate;if(typeof H>"u")return function(){return function(fe){return function(me){return fe(me)}}};if(N.getState&&N.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware: +`+K.stack}return{value:x,source:C,stack:q,digest:null}}function GH(x,C,D){return{value:x,source:null,stack:D??null,digest:C??null}}function qH(x,C){try{console.error(C.value)}catch(D){setTimeout(function(){throw D})}}var Ict=typeof WeakMap=="function"?WeakMap:Map;function Nye(x,C,D){D=zg(-1,D),D.tag=3,D.payload={element:null};var W=C.value;return D.callback=function(){NF||(NF=!0,lG=W),qH(x,C)},D}function zye(x,C,D){D=zg(-1,D),D.tag=3;var W=x.type.getDerivedStateFromError;if(typeof W=="function"){var q=C.value;D.payload=function(){return W(q)},D.callback=function(){qH(x,C)}}var K=x.stateNode;return K!==null&&typeof K.componentDidCatch=="function"&&(D.callback=function(){qH(x,C),typeof W!="function"&&(ey===null?ey=new Set([this]):ey.add(this));var de=C.stack;this.componentDidCatch(C.value,{componentStack:de!==null?de:""})}),D}function jye(x,C,D){var W=x.pingCache;if(W===null){W=x.pingCache=new Ict;var q=new Set;W.set(C,q)}else q=W.get(C),q===void 0&&(q=new Set,W.set(C,q));q.has(D)||(q.add(D),x=qct.bind(null,x,C,D),C.then(x,x))}function Bye(x){do{var C;if((C=x.tag===13)&&(C=x.memoizedState,C=C!==null?C.dehydrated!==null:!0),C)return x;x=x.return}while(x!==null);return null}function Uye(x,C,D,W,q){return(x.mode&1)===0?(x===C?x.flags|=65536:(x.flags|=128,D.flags|=131072,D.flags&=-52805,D.tag===1&&(D.alternate===null?D.tag=17:(C=zg(-1,1),C.tag=2,Zv(D,C,1))),D.lanes|=1),x):(x.flags|=65536,x.lanes=q,x)}var Dct=w.ReactCurrentOwner,sc=!1;function Sl(x,C,D,W){C.child=x===null?lye(C,null,D,W):ZS(C,x.child,D,W)}function Vye(x,C,D,W,q){D=D.render;var K=C.ref;return e_(C,q),W=NH(x,C,D,W,K,q),D=zH(),x!==null&&!sc?(C.updateQueue=x.updateQueue,C.flags&=-2053,x.lanes&=~q,jg(x,C,q)):(po&&D&&wH(C),C.flags|=1,Sl(x,C,W,q),C.child)}function Wye(x,C,D,W,q){if(x===null){var K=D.type;return typeof K=="function"&&!gG(K)&&K.defaultProps===void 0&&D.compare===null&&D.defaultProps===void 0?(C.tag=15,C.type=K,Hye(x,C,K,W,q)):(x=WF(D.type,null,W,C,C.mode,q),x.ref=C.ref,x.return=C,C.child=x)}if(K=x.child,(x.lanes&q)===0){var de=K.memoizedProps;if(D=D.compare,D=D!==null?D:GP,D(de,W)&&x.ref===C.ref)return jg(x,C,q)}return C.flags|=1,x=iy(K,W),x.ref=C.ref,x.return=C,C.child=x}function Hye(x,C,D,W,q){if(x!==null){var K=x.memoizedProps;if(GP(K,W)&&x.ref===C.ref)if(sc=!1,C.pendingProps=W=K,(x.lanes&q)!==0)(x.flags&131072)!==0&&(sc=!0);else return C.lanes=x.lanes,jg(x,C,q)}return XH(x,C,D,W,q)}function Gye(x,C,D){var W=C.pendingProps,q=W.children,K=x!==null?x.memoizedState:null;if(W.mode==="hidden")if((C.mode&1)===0)C.memoizedState={baseLanes:0,cachePool:null,transitions:null},Gi(i_,Jc),Jc|=D;else{if((D&1073741824)===0)return x=K!==null?K.baseLanes|D:D,C.lanes=C.childLanes=1073741824,C.memoizedState={baseLanes:x,cachePool:null,transitions:null},C.updateQueue=null,Gi(i_,Jc),Jc|=x,null;C.memoizedState={baseLanes:0,cachePool:null,transitions:null},W=K!==null?K.baseLanes:D,Gi(i_,Jc),Jc|=W}else K!==null?(W=K.baseLanes|D,C.memoizedState=null):W=D,Gi(i_,Jc),Jc|=W;return Sl(x,C,q,D),C.child}function qye(x,C){var D=C.ref;(x===null&&D!==null||x!==null&&x.ref!==D)&&(C.flags|=512,C.flags|=2097152)}function XH(x,C,D,W,q){var K=oc(D)?Qb:Ua.current;return K=XS(C,K),e_(C,q),D=NH(x,C,D,W,K,q),W=zH(),x!==null&&!sc?(C.updateQueue=x.updateQueue,C.flags&=-2053,x.lanes&=~q,jg(x,C,q)):(po&&W&&wH(C),C.flags|=1,Sl(x,C,D,q),C.child)}function Xye(x,C,D,W,q){if(oc(D)){var K=!0;gF(C)}else K=!1;if(e_(C,q),C.stateNode===null)IF(x,C),Fye(C,D,W),HH(C,D,W,q),W=!0;else if(x===null){var de=C.stateNode,Ae=C.memoizedProps;de.props=Ae;var Ie=de.context,Ye=D.contextType;typeof Ye=="object"&&Ye!==null?Ye=Qu(Ye):(Ye=oc(D)?Qb:Ua.current,Ye=XS(C,Ye));var xt=D.getDerivedStateFromProps,Ot=typeof xt=="function"||typeof de.getSnapshotBeforeUpdate=="function";Ot||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(Ae!==W||Ie!==Ye)&&$ye(C,de,W,Ye),Kv=!1;var vt=C.memoizedState;de.state=vt,CF(C,W,de,q),Ie=C.memoizedState,Ae!==W||vt!==Ie||ic.current||Kv?(typeof xt=="function"&&(WH(C,D,xt,W),Ie=C.memoizedState),(Ae=Kv||Lye(C,D,Ae,W,vt,Ie,Ye))?(Ot||typeof de.UNSAFE_componentWillMount!="function"&&typeof de.componentWillMount!="function"||(typeof de.componentWillMount=="function"&&de.componentWillMount(),typeof de.UNSAFE_componentWillMount=="function"&&de.UNSAFE_componentWillMount()),typeof de.componentDidMount=="function"&&(C.flags|=4194308)):(typeof de.componentDidMount=="function"&&(C.flags|=4194308),C.memoizedProps=W,C.memoizedState=Ie),de.props=W,de.state=Ie,de.context=Ye,W=Ae):(typeof de.componentDidMount=="function"&&(C.flags|=4194308),W=!1)}else{de=C.stateNode,uye(x,C),Ae=C.memoizedProps,Ye=C.type===C.elementType?Ae:yd(C.type,Ae),de.props=Ye,Ot=C.pendingProps,vt=de.context,Ie=D.contextType,typeof Ie=="object"&&Ie!==null?Ie=Qu(Ie):(Ie=oc(D)?Qb:Ua.current,Ie=XS(C,Ie));var en=D.getDerivedStateFromProps;(xt=typeof en=="function"||typeof de.getSnapshotBeforeUpdate=="function")||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(Ae!==Ot||vt!==Ie)&&$ye(C,de,W,Ie),Kv=!1,vt=C.memoizedState,de.state=vt,CF(C,W,de,q);var cn=C.memoizedState;Ae!==Ot||vt!==cn||ic.current||Kv?(typeof en=="function"&&(WH(C,D,en,W),cn=C.memoizedState),(Ye=Kv||Lye(C,D,Ye,W,vt,cn,Ie)||!1)?(xt||typeof de.UNSAFE_componentWillUpdate!="function"&&typeof de.componentWillUpdate!="function"||(typeof de.componentWillUpdate=="function"&&de.componentWillUpdate(W,cn,Ie),typeof de.UNSAFE_componentWillUpdate=="function"&&de.UNSAFE_componentWillUpdate(W,cn,Ie)),typeof de.componentDidUpdate=="function"&&(C.flags|=4),typeof de.getSnapshotBeforeUpdate=="function"&&(C.flags|=1024)):(typeof de.componentDidUpdate!="function"||Ae===x.memoizedProps&&vt===x.memoizedState||(C.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||Ae===x.memoizedProps&&vt===x.memoizedState||(C.flags|=1024),C.memoizedProps=W,C.memoizedState=cn),de.props=W,de.state=cn,de.context=Ie,W=Ye):(typeof de.componentDidUpdate!="function"||Ae===x.memoizedProps&&vt===x.memoizedState||(C.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||Ae===x.memoizedProps&&vt===x.memoizedState||(C.flags|=1024),W=!1)}return YH(x,C,D,W,K,q)}function YH(x,C,D,W,q,K){qye(x,C);var de=(C.flags&128)!==0;if(!W&&!de)return q&&Jve(C,D,!1),jg(x,C,K);W=C.stateNode,Dct.current=C;var Ae=de&&typeof D.getDerivedStateFromError!="function"?null:W.render();return C.flags|=1,x!==null&&de?(C.child=ZS(C,x.child,null,K),C.child=ZS(C,null,Ae,K)):Sl(x,C,Ae,K),C.memoizedState=W.state,q&&Jve(C,D,!0),C.child}function Yye(x){var C=x.stateNode;C.pendingContext?Kve(x,C.pendingContext,C.pendingContext!==C.context):C.context&&Kve(x,C.context,!1),RH(x,C.containerInfo)}function Qye(x,C,D,W,q){return KS(),OH(q),C.flags|=256,Sl(x,C,D,W),C.child}var QH={dehydrated:null,treeContext:null,retryLane:0};function KH(x){return{baseLanes:x,cachePool:null,transitions:null}}function Kye(x,C,D){var W=C.pendingProps,q=Oo.current,K=!1,de=(C.flags&128)!==0,Ae;if((Ae=de)||(Ae=x!==null&&x.memoizedState===null?!1:(q&2)!==0),Ae?(K=!0,C.flags&=-129):(x===null||x.memoizedState!==null)&&(q|=1),Gi(Oo,q&1),x===null)return CH(C),x=C.memoizedState,x!==null&&(x=x.dehydrated,x!==null)?((C.mode&1)===0?C.lanes=1:x.data==="$!"?C.lanes=8:C.lanes=1073741824,null):(de=W.children,x=W.fallback,K?(W=C.mode,K=C.child,de={mode:"hidden",children:de},(W&1)===0&&K!==null?(K.childLanes=0,K.pendingProps=de):K=HF(de,W,0,null),x=sx(x,W,D,null),K.return=C,x.return=C,K.sibling=x,C.child=K,C.child.memoizedState=KH(D),C.memoizedState=QH,x):ZH(C,de));if(q=x.memoizedState,q!==null&&(Ae=q.dehydrated,Ae!==null))return Lct(x,C,de,W,Ae,q,D);if(K){K=W.fallback,de=C.mode,q=x.child,Ae=q.sibling;var Ie={mode:"hidden",children:W.children};return(de&1)===0&&C.child!==q?(W=C.child,W.childLanes=0,W.pendingProps=Ie,C.deletions=null):(W=iy(q,Ie),W.subtreeFlags=q.subtreeFlags&14680064),Ae!==null?K=iy(Ae,K):(K=sx(K,de,D,null),K.flags|=2),K.return=C,W.return=C,W.sibling=K,C.child=W,W=K,K=C.child,de=x.child.memoizedState,de=de===null?KH(D):{baseLanes:de.baseLanes|D,cachePool:null,transitions:de.transitions},K.memoizedState=de,K.childLanes=x.childLanes&~D,C.memoizedState=QH,W}return K=x.child,x=K.sibling,W=iy(K,{mode:"visible",children:W.children}),(C.mode&1)===0&&(W.lanes=D),W.return=C,W.sibling=null,x!==null&&(D=C.deletions,D===null?(C.deletions=[x],C.flags|=16):D.push(x)),C.child=W,C.memoizedState=null,W}function ZH(x,C){return C=HF({mode:"visible",children:C},x.mode,0,null),C.return=x,x.child=C}function RF(x,C,D,W){return W!==null&&OH(W),ZS(C,x.child,null,D),x=ZH(C,C.pendingProps.children),x.flags|=2,C.memoizedState=null,x}function Lct(x,C,D,W,q,K,de){if(D)return C.flags&256?(C.flags&=-257,W=GH(Error(n(422))),RF(x,C,de,W)):C.memoizedState!==null?(C.child=x.child,C.flags|=128,null):(K=W.fallback,q=C.mode,W=HF({mode:"visible",children:W.children},q,0,null),K=sx(K,q,de,null),K.flags|=2,W.return=C,K.return=C,W.sibling=K,C.child=W,(C.mode&1)!==0&&ZS(C,x.child,null,de),C.child.memoizedState=KH(de),C.memoizedState=QH,K);if((C.mode&1)===0)return RF(x,C,de,null);if(q.data==="$!"){if(W=q.nextSibling&&q.nextSibling.dataset,W)var Ae=W.dgst;return W=Ae,K=Error(n(419)),W=GH(K,W,void 0),RF(x,C,de,W)}if(Ae=(de&x.childLanes)!==0,sc||Ae){if(W=Us,W!==null){switch(de&-de){case 4:q=2;break;case 16:q=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:q=32;break;case 536870912:q=268435456;break;default:q=0}q=(q&(W.suspendedLanes|de))!==0?0:q,q!==0&&q!==K.retryLane&&(K.retryLane=q,Ng(x,q),wd(W,x,q,-1))}return pG(),W=GH(Error(n(421))),RF(x,C,de,W)}return q.data==="$?"?(C.flags|=128,C.child=x.child,C=Xct.bind(null,x),q._reactRetry=C,null):(x=K.treeContext,Zc=qv(q.nextSibling),Kc=C,po=!0,vd=null,x!==null&&(Xu[Yu++]=Fg,Xu[Yu++]=$g,Xu[Yu++]=Kb,Fg=x.id,$g=x.overflow,Kb=C),C=ZH(C,W.children),C.flags|=4096,C)}function Zye(x,C,D){x.lanes|=C;var W=x.alternate;W!==null&&(W.lanes|=C),kH(x.return,C,D)}function JH(x,C,D,W,q){var K=x.memoizedState;K===null?x.memoizedState={isBackwards:C,rendering:null,renderingStartTime:0,last:W,tail:D,tailMode:q}:(K.isBackwards=C,K.rendering=null,K.renderingStartTime=0,K.last=W,K.tail=D,K.tailMode=q)}function Jye(x,C,D){var W=C.pendingProps,q=W.revealOrder,K=W.tail;if(Sl(x,C,W.children,D),W=Oo.current,(W&2)!==0)W=W&1|2,C.flags|=128;else{if(x!==null&&(x.flags&128)!==0)e:for(x=C.child;x!==null;){if(x.tag===13)x.memoizedState!==null&&Zye(x,D,C);else if(x.tag===19)Zye(x,D,C);else if(x.child!==null){x.child.return=x,x=x.child;continue}if(x===C)break e;for(;x.sibling===null;){if(x.return===null||x.return===C)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}W&=1}if(Gi(Oo,W),(C.mode&1)===0)C.memoizedState=null;else switch(q){case"forwards":for(D=C.child,q=null;D!==null;)x=D.alternate,x!==null&&OF(x)===null&&(q=D),D=D.sibling;D=q,D===null?(q=C.child,C.child=null):(q=D.sibling,D.sibling=null),JH(C,!1,q,D,K);break;case"backwards":for(D=null,q=C.child,C.child=null;q!==null;){if(x=q.alternate,x!==null&&OF(x)===null){C.child=q;break}x=q.sibling,q.sibling=D,D=q,q=x}JH(C,!0,D,null,K);break;case"together":JH(C,!1,null,null,void 0);break;default:C.memoizedState=null}return C.child}function IF(x,C){(C.mode&1)===0&&x!==null&&(x.alternate=null,C.alternate=null,C.flags|=2)}function jg(x,C,D){if(x!==null&&(C.dependencies=x.dependencies),nx|=C.lanes,(D&C.childLanes)===0)return null;if(x!==null&&C.child!==x.child)throw Error(n(153));if(C.child!==null){for(x=C.child,D=iy(x,x.pendingProps),C.child=D,D.return=C;x.sibling!==null;)x=x.sibling,D=D.sibling=iy(x,x.pendingProps),D.return=C;D.sibling=null}return C.child}function Fct(x,C,D){switch(C.tag){case 3:Yye(C),KS();break;case 5:hye(C);break;case 1:oc(C.type)&&gF(C);break;case 4:RH(C,C.stateNode.containerInfo);break;case 10:var W=C.type._context,q=C.memoizedProps.value;Gi(wF,W._currentValue),W._currentValue=q;break;case 13:if(W=C.memoizedState,W!==null)return W.dehydrated!==null?(Gi(Oo,Oo.current&1),C.flags|=128,null):(D&C.child.childLanes)!==0?Kye(x,C,D):(Gi(Oo,Oo.current&1),x=jg(x,C,D),x!==null?x.sibling:null);Gi(Oo,Oo.current&1);break;case 19:if(W=(D&C.childLanes)!==0,(x.flags&128)!==0){if(W)return Jye(x,C,D);C.flags|=128}if(q=C.memoizedState,q!==null&&(q.rendering=null,q.tail=null,q.lastEffect=null),Gi(Oo,Oo.current),W)break;return null;case 22:case 23:return C.lanes=0,Gye(x,C,D)}return jg(x,C,D)}var e0e,eG,t0e,n0e;e0e=function(x,C){for(var D=C.child;D!==null;){if(D.tag===5||D.tag===6)x.appendChild(D.stateNode);else if(D.tag!==4&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===C)break;for(;D.sibling===null;){if(D.return===null||D.return===C)return;D=D.return}D.sibling.return=D.return,D=D.sibling}},eG=function(){},t0e=function(x,C,D,W){var q=x.memoizedProps;if(q!==W){x=C.stateNode,ex(zh.current);var K=null;switch(D){case"input":q=G(x,q),W=G(x,W),K=[];break;case"select":q=z({},q,{value:void 0}),W=z({},W,{value:void 0}),K=[];break;case"textarea":q=ee(x,q),W=ee(x,W),K=[];break;default:typeof q.onClick!="function"&&typeof W.onClick=="function"&&(x.onclick=dF)}mt(D,W);var de;D=null;for(Ye in q)if(!W.hasOwnProperty(Ye)&&q.hasOwnProperty(Ye)&&q[Ye]!=null)if(Ye==="style"){var Ae=q[Ye];for(de in Ae)Ae.hasOwnProperty(de)&&(D||(D={}),D[de]="")}else Ye!=="dangerouslySetInnerHTML"&&Ye!=="children"&&Ye!=="suppressContentEditableWarning"&&Ye!=="suppressHydrationWarning"&&Ye!=="autoFocus"&&(i.hasOwnProperty(Ye)?K||(K=[]):(K=K||[]).push(Ye,null));for(Ye in W){var Ie=W[Ye];if(Ae=q?.[Ye],W.hasOwnProperty(Ye)&&Ie!==Ae&&(Ie!=null||Ae!=null))if(Ye==="style")if(Ae){for(de in Ae)!Ae.hasOwnProperty(de)||Ie&&Ie.hasOwnProperty(de)||(D||(D={}),D[de]="");for(de in Ie)Ie.hasOwnProperty(de)&&Ae[de]!==Ie[de]&&(D||(D={}),D[de]=Ie[de])}else D||(K||(K=[]),K.push(Ye,D)),D=Ie;else Ye==="dangerouslySetInnerHTML"?(Ie=Ie?Ie.__html:void 0,Ae=Ae?Ae.__html:void 0,Ie!=null&&Ae!==Ie&&(K=K||[]).push(Ye,Ie)):Ye==="children"?typeof Ie!="string"&&typeof Ie!="number"||(K=K||[]).push(Ye,""+Ie):Ye!=="suppressContentEditableWarning"&&Ye!=="suppressHydrationWarning"&&(i.hasOwnProperty(Ye)?(Ie!=null&&Ye==="onScroll"&&to("scroll",x),K||Ae===Ie||(K=[])):(K=K||[]).push(Ye,Ie))}D&&(K=K||[]).push("style",D);var Ye=K;(C.updateQueue=Ye)&&(C.flags|=4)}},n0e=function(x,C,D,W){D!==W&&(C.flags|=4)};function ak(x,C){if(!po)switch(x.tailMode){case"hidden":C=x.tail;for(var D=null;C!==null;)C.alternate!==null&&(D=C),C=C.sibling;D===null?x.tail=null:D.sibling=null;break;case"collapsed":D=x.tail;for(var W=null;D!==null;)D.alternate!==null&&(W=D),D=D.sibling;W===null?C||x.tail===null?x.tail=null:x.tail.sibling=null:W.sibling=null}}function Wa(x){var C=x.alternate!==null&&x.alternate.child===x.child,D=0,W=0;if(C)for(var q=x.child;q!==null;)D|=q.lanes|q.childLanes,W|=q.subtreeFlags&14680064,W|=q.flags&14680064,q.return=x,q=q.sibling;else for(q=x.child;q!==null;)D|=q.lanes|q.childLanes,W|=q.subtreeFlags,W|=q.flags,q.return=x,q=q.sibling;return x.subtreeFlags|=W,x.childLanes=D,C}function $ct(x,C,D){var W=C.pendingProps;switch(SH(C),C.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wa(C),null;case 1:return oc(C.type)&&pF(),Wa(C),null;case 3:return W=C.stateNode,t_(),no(ic),no(Ua),LH(),W.pendingContext&&(W.context=W.pendingContext,W.pendingContext=null),(x===null||x.child===null)&&(bF(C)?C.flags|=4:x===null||x.memoizedState.isDehydrated&&(C.flags&256)===0||(C.flags|=1024,vd!==null&&(fG(vd),vd=null))),eG(x,C),Wa(C),null;case 5:IH(C);var q=ex(nk.current);if(D=C.type,x!==null&&C.stateNode!=null)t0e(x,C,D,W,q),x.ref!==C.ref&&(C.flags|=512,C.flags|=2097152);else{if(!W){if(C.stateNode===null)throw Error(n(166));return Wa(C),null}if(x=ex(zh.current),bF(C)){W=C.stateNode,D=C.type;var K=C.memoizedProps;switch(W[Nh]=C,W[KP]=K,x=(C.mode&1)!==0,D){case"dialog":to("cancel",W),to("close",W);break;case"iframe":case"object":case"embed":to("load",W);break;case"video":case"audio":for(q=0;q<\/script>",x=x.removeChild(x.firstChild)):typeof W.is=="string"?x=de.createElement(D,{is:W.is}):(x=de.createElement(D),D==="select"&&(de=x,W.multiple?de.multiple=!0:W.size&&(de.size=W.size))):x=de.createElementNS(x,D),x[Nh]=C,x[KP]=W,e0e(x,C,!1,!1),C.stateNode=x;e:{switch(de=Me(D,W),D){case"dialog":to("cancel",x),to("close",x),q=W;break;case"iframe":case"object":case"embed":to("load",x),q=W;break;case"video":case"audio":for(q=0;qo_&&(C.flags|=128,W=!0,ak(K,!1),C.lanes=4194304)}else{if(!W)if(x=OF(de),x!==null){if(C.flags|=128,W=!0,D=x.updateQueue,D!==null&&(C.updateQueue=D,C.flags|=4),ak(K,!0),K.tail===null&&K.tailMode==="hidden"&&!de.alternate&&!po)return Wa(C),null}else 2*Dr()-K.renderingStartTime>o_&&D!==1073741824&&(C.flags|=128,W=!0,ak(K,!1),C.lanes=4194304);K.isBackwards?(de.sibling=C.child,C.child=de):(D=K.last,D!==null?D.sibling=de:C.child=de,K.last=de)}return K.tail!==null?(C=K.tail,K.rendering=C,K.tail=C.sibling,K.renderingStartTime=Dr(),C.sibling=null,D=Oo.current,Gi(Oo,W?D&1|2:D&1),C):(Wa(C),null);case 22:case 23:return hG(),W=C.memoizedState!==null,x!==null&&x.memoizedState!==null!==W&&(C.flags|=8192),W&&(C.mode&1)!==0?(Jc&1073741824)!==0&&(Wa(C),C.subtreeFlags&6&&(C.flags|=8192)):Wa(C),null;case 24:return null;case 25:return null}throw Error(n(156,C.tag))}function Nct(x,C){switch(SH(C),C.tag){case 1:return oc(C.type)&&pF(),x=C.flags,x&65536?(C.flags=x&-65537|128,C):null;case 3:return t_(),no(ic),no(Ua),LH(),x=C.flags,(x&65536)!==0&&(x&128)===0?(C.flags=x&-65537|128,C):null;case 5:return IH(C),null;case 13:if(no(Oo),x=C.memoizedState,x!==null&&x.dehydrated!==null){if(C.alternate===null)throw Error(n(340));KS()}return x=C.flags,x&65536?(C.flags=x&-65537|128,C):null;case 19:return no(Oo),null;case 4:return t_(),null;case 10:return PH(C.type._context),null;case 22:case 23:return hG(),null;case 24:return null;default:return null}}var DF=!1,Ha=!1,zct=typeof WeakSet=="function"?WeakSet:Set,an=null;function r_(x,C){var D=x.ref;if(D!==null)if(typeof D=="function")try{D(null)}catch(W){Ro(x,C,W)}else D.current=null}function tG(x,C,D){try{D()}catch(W){Ro(x,C,W)}}var r0e=!1;function jct(x,C){if(hH=eF,x=Lve(),oH(x)){if("selectionStart"in x)var D={start:x.selectionStart,end:x.selectionEnd};else e:{D=(D=x.ownerDocument)&&D.defaultView||window;var W=D.getSelection&&D.getSelection();if(W&&W.rangeCount!==0){D=W.anchorNode;var q=W.anchorOffset,K=W.focusNode;W=W.focusOffset;try{D.nodeType,K.nodeType}catch{D=null;break e}var de=0,Ae=-1,Ie=-1,Ye=0,xt=0,Ot=x,vt=null;t:for(;;){for(var en;Ot!==D||q!==0&&Ot.nodeType!==3||(Ae=de+q),Ot!==K||W!==0&&Ot.nodeType!==3||(Ie=de+W),Ot.nodeType===3&&(de+=Ot.nodeValue.length),(en=Ot.firstChild)!==null;)vt=Ot,Ot=en;for(;;){if(Ot===x)break t;if(vt===D&&++Ye===q&&(Ae=de),vt===K&&++xt===W&&(Ie=de),(en=Ot.nextSibling)!==null)break;Ot=vt,vt=Ot.parentNode}Ot=en}D=Ae===-1||Ie===-1?null:{start:Ae,end:Ie}}else D=null}D=D||{start:0,end:0}}else D=null;for(pH={focusedElem:x,selectionRange:D},eF=!1,an=C;an!==null;)if(C=an,x=C.child,(C.subtreeFlags&1028)!==0&&x!==null)x.return=C,an=x;else for(;an!==null;){C=an;try{var cn=C.alternate;if((C.flags&1024)!==0)switch(C.tag){case 0:case 11:case 15:break;case 1:if(cn!==null){var fn=cn.memoizedProps,Yo=cn.memoizedState,He=C.stateNode,Le=He.getSnapshotBeforeUpdate(C.elementType===C.type?fn:yd(C.type,fn),Yo);He.__reactInternalSnapshotBeforeUpdate=Le}break;case 3:var qe=C.stateNode.containerInfo;qe.nodeType===1?qe.textContent="":qe.nodeType===9&&qe.documentElement&&qe.removeChild(qe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(kt){Ro(C,C.return,kt)}if(x=C.sibling,x!==null){x.return=C.return,an=x;break}an=C.return}return cn=r0e,r0e=!1,cn}function lk(x,C,D){var W=C.updateQueue;if(W=W!==null?W.lastEffect:null,W!==null){var q=W=W.next;do{if((q.tag&x)===x){var K=q.destroy;q.destroy=void 0,K!==void 0&&tG(C,D,K)}q=q.next}while(q!==W)}}function LF(x,C){if(C=C.updateQueue,C=C!==null?C.lastEffect:null,C!==null){var D=C=C.next;do{if((D.tag&x)===x){var W=D.create;D.destroy=W()}D=D.next}while(D!==C)}}function nG(x){var C=x.ref;if(C!==null){var D=x.stateNode;x.tag,x=D,typeof C=="function"?C(x):C.current=x}}function i0e(x){var C=x.alternate;C!==null&&(x.alternate=null,i0e(C)),x.child=null,x.deletions=null,x.sibling=null,x.tag===5&&(C=x.stateNode,C!==null&&(delete C[Nh],delete C[KP],delete C[yH],delete C[Sct],delete C[_ct])),x.stateNode=null,x.return=null,x.dependencies=null,x.memoizedProps=null,x.memoizedState=null,x.pendingProps=null,x.stateNode=null,x.updateQueue=null}function o0e(x){return x.tag===5||x.tag===3||x.tag===4}function s0e(x){e:for(;;){for(;x.sibling===null;){if(x.return===null||o0e(x.return))return null;x=x.return}for(x.sibling.return=x.return,x=x.sibling;x.tag!==5&&x.tag!==6&&x.tag!==18;){if(x.flags&2||x.child===null||x.tag===4)continue e;x.child.return=x,x=x.child}if(!(x.flags&2))return x.stateNode}}function rG(x,C,D){var W=x.tag;if(W===5||W===6)x=x.stateNode,C?D.nodeType===8?D.parentNode.insertBefore(x,C):D.insertBefore(x,C):(D.nodeType===8?(C=D.parentNode,C.insertBefore(x,D)):(C=D,C.appendChild(x)),D=D._reactRootContainer,D!=null||C.onclick!==null||(C.onclick=dF));else if(W!==4&&(x=x.child,x!==null))for(rG(x,C,D),x=x.sibling;x!==null;)rG(x,C,D),x=x.sibling}function iG(x,C,D){var W=x.tag;if(W===5||W===6)x=x.stateNode,C?D.insertBefore(x,C):D.appendChild(x);else if(W!==4&&(x=x.child,x!==null))for(iG(x,C,D),x=x.sibling;x!==null;)iG(x,C,D),x=x.sibling}var ma=null,bd=!1;function Jv(x,C,D){for(D=D.child;D!==null;)a0e(x,C,D),D=D.sibling}function a0e(x,C,D){if(Pi&&typeof Pi.onCommitFiberUnmount=="function")try{Pi.onCommitFiberUnmount(rc,D)}catch{}switch(D.tag){case 5:Ha||r_(D,C);case 6:var W=ma,q=bd;ma=null,Jv(x,C,D),ma=W,bd=q,ma!==null&&(bd?(x=ma,D=D.stateNode,x.nodeType===8?x.parentNode.removeChild(D):x.removeChild(D)):ma.removeChild(D.stateNode));break;case 18:ma!==null&&(bd?(x=ma,D=D.stateNode,x.nodeType===8?vH(x.parentNode,D):x.nodeType===1&&vH(x,D),jP(x)):vH(ma,D.stateNode));break;case 4:W=ma,q=bd,ma=D.stateNode.containerInfo,bd=!0,Jv(x,C,D),ma=W,bd=q;break;case 0:case 11:case 14:case 15:if(!Ha&&(W=D.updateQueue,W!==null&&(W=W.lastEffect,W!==null))){q=W=W.next;do{var K=q,de=K.destroy;K=K.tag,de!==void 0&&((K&2)!==0||(K&4)!==0)&&tG(D,C,de),q=q.next}while(q!==W)}Jv(x,C,D);break;case 1:if(!Ha&&(r_(D,C),W=D.stateNode,typeof W.componentWillUnmount=="function"))try{W.props=D.memoizedProps,W.state=D.memoizedState,W.componentWillUnmount()}catch(Ae){Ro(D,C,Ae)}Jv(x,C,D);break;case 21:Jv(x,C,D);break;case 22:D.mode&1?(Ha=(W=Ha)||D.memoizedState!==null,Jv(x,C,D),Ha=W):Jv(x,C,D);break;default:Jv(x,C,D)}}function l0e(x){var C=x.updateQueue;if(C!==null){x.updateQueue=null;var D=x.stateNode;D===null&&(D=x.stateNode=new zct),C.forEach(function(W){var q=Yct.bind(null,x,W);D.has(W)||(D.add(W),W.then(q,q))})}}function xd(x,C){var D=C.deletions;if(D!==null)for(var W=0;Wq&&(q=de),W&=~K}if(W=q,W=Dr()-W,W=(120>W?120:480>W?480:1080>W?1080:1920>W?1920:3e3>W?3e3:4320>W?4320:1960*Uct(W/1960))-W,10x?16:x,ty===null)var W=!1;else{if(x=ty,ty=null,jF=0,(Br&6)!==0)throw Error(n(331));var q=Br;for(Br|=4,an=x.current;an!==null;){var K=an,de=K.child;if((an.flags&16)!==0){var Ae=K.deletions;if(Ae!==null){for(var Ie=0;IeDr()-aG?ix(x,0):sG|=D),lc(x,C)}function w0e(x,C){C===0&&((x.mode&1)===0?C=1:(C=QL,QL<<=1,(QL&130023424)===0&&(QL=4194304)));var D=_l();x=Ng(x,C),x!==null&&(LP(x,C,D),lc(x,D))}function Xct(x){var C=x.memoizedState,D=0;C!==null&&(D=C.retryLane),w0e(x,D)}function Yct(x,C){var D=0;switch(x.tag){case 13:var W=x.stateNode,q=x.memoizedState;q!==null&&(D=q.retryLane);break;case 19:W=x.stateNode;break;default:throw Error(n(314))}W!==null&&W.delete(C),w0e(x,D)}var S0e;S0e=function(x,C,D){if(x!==null)if(x.memoizedProps!==C.pendingProps||ic.current)sc=!0;else{if((x.lanes&D)===0&&(C.flags&128)===0)return sc=!1,Fct(x,C,D);sc=(x.flags&131072)!==0}else sc=!1,po&&(C.flags&1048576)!==0&&tye(C,yF,C.index);switch(C.lanes=0,C.tag){case 2:var W=C.type;IF(x,C),x=C.pendingProps;var q=XS(C,Ua.current);e_(C,D),q=NH(null,C,W,x,q,D);var K=zH();return C.flags|=1,typeof q=="object"&&q!==null&&typeof q.render=="function"&&q.$$typeof===void 0?(C.tag=1,C.memoizedState=null,C.updateQueue=null,oc(W)?(K=!0,gF(C)):K=!1,C.memoizedState=q.state!==null&&q.state!==void 0?q.state:null,AH(C),q.updater=AF,C.stateNode=q,q._reactInternals=C,HH(C,W,x,D),C=YH(null,C,W,!0,K,D)):(C.tag=0,po&&K&&wH(C),Sl(null,C,q,D),C=C.child),C;case 16:W=C.elementType;e:{switch(IF(x,C),x=C.pendingProps,q=W._init,W=q(W._payload),C.type=W,q=C.tag=Kct(W),x=yd(W,x),q){case 0:C=XH(null,C,W,x,D);break e;case 1:C=Xye(null,C,W,x,D);break e;case 11:C=Vye(null,C,W,x,D);break e;case 14:C=Wye(null,C,W,yd(W.type,x),D);break e}throw Error(n(306,W,""))}return C;case 0:return W=C.type,q=C.pendingProps,q=C.elementType===W?q:yd(W,q),XH(x,C,W,q,D);case 1:return W=C.type,q=C.pendingProps,q=C.elementType===W?q:yd(W,q),Xye(x,C,W,q,D);case 3:e:{if(Yye(C),x===null)throw Error(n(387));W=C.pendingProps,K=C.memoizedState,q=K.element,uye(x,C),CF(C,W,null,D);var de=C.memoizedState;if(W=de.element,K.isDehydrated)if(K={element:W,isDehydrated:!1,cache:de.cache,pendingSuspenseBoundaries:de.pendingSuspenseBoundaries,transitions:de.transitions},C.updateQueue.baseState=K,C.memoizedState=K,C.flags&256){q=n_(Error(n(423)),C),C=Qye(x,C,W,D,q);break e}else if(W!==q){q=n_(Error(n(424)),C),C=Qye(x,C,W,D,q);break e}else for(Zc=qv(C.stateNode.containerInfo.firstChild),Kc=C,po=!0,vd=null,D=lye(C,null,W,D),C.child=D;D;)D.flags=D.flags&-3|4096,D=D.sibling;else{if(KS(),W===q){C=jg(x,C,D);break e}Sl(x,C,W,D)}C=C.child}return C;case 5:return hye(C),x===null&&CH(C),W=C.type,q=C.pendingProps,K=x!==null?x.memoizedProps:null,de=q.children,gH(W,q)?de=null:K!==null&&gH(W,K)&&(C.flags|=32),qye(x,C),Sl(x,C,de,D),C.child;case 6:return x===null&&CH(C),null;case 13:return Kye(x,C,D);case 4:return RH(C,C.stateNode.containerInfo),W=C.pendingProps,x===null?C.child=ZS(C,null,W,D):Sl(x,C,W,D),C.child;case 11:return W=C.type,q=C.pendingProps,q=C.elementType===W?q:yd(W,q),Vye(x,C,W,q,D);case 7:return Sl(x,C,C.pendingProps,D),C.child;case 8:return Sl(x,C,C.pendingProps.children,D),C.child;case 12:return Sl(x,C,C.pendingProps.children,D),C.child;case 10:e:{if(W=C.type._context,q=C.pendingProps,K=C.memoizedProps,de=q.value,Gi(wF,W._currentValue),W._currentValue=de,K!==null)if(md(K.value,de)){if(K.children===q.children&&!ic.current){C=jg(x,C,D);break e}}else for(K=C.child,K!==null&&(K.return=C);K!==null;){var Ae=K.dependencies;if(Ae!==null){de=K.child;for(var Ie=Ae.firstContext;Ie!==null;){if(Ie.context===W){if(K.tag===1){Ie=zg(-1,D&-D),Ie.tag=2;var Ye=K.updateQueue;if(Ye!==null){Ye=Ye.shared;var xt=Ye.pending;xt===null?Ie.next=Ie:(Ie.next=xt.next,xt.next=Ie),Ye.pending=Ie}}K.lanes|=D,Ie=K.alternate,Ie!==null&&(Ie.lanes|=D),kH(K.return,D,C),Ae.lanes|=D;break}Ie=Ie.next}}else if(K.tag===10)de=K.type===C.type?null:K.child;else if(K.tag===18){if(de=K.return,de===null)throw Error(n(341));de.lanes|=D,Ae=de.alternate,Ae!==null&&(Ae.lanes|=D),kH(de,D,C),de=K.sibling}else de=K.child;if(de!==null)de.return=K;else for(de=K;de!==null;){if(de===C){de=null;break}if(K=de.sibling,K!==null){K.return=de.return,de=K;break}de=de.return}K=de}Sl(x,C,q.children,D),C=C.child}return C;case 9:return q=C.type,W=C.pendingProps.children,e_(C,D),q=Qu(q),W=W(q),C.flags|=1,Sl(x,C,W,D),C.child;case 14:return W=C.type,q=yd(W,C.pendingProps),q=yd(W.type,q),Wye(x,C,W,q,D);case 15:return Hye(x,C,C.type,C.pendingProps,D);case 17:return W=C.type,q=C.pendingProps,q=C.elementType===W?q:yd(W,q),IF(x,C),C.tag=1,oc(W)?(x=!0,gF(C)):x=!1,e_(C,D),Fye(C,W,q),HH(C,W,q,D),YH(null,C,W,!0,x,D);case 19:return Jye(x,C,D);case 22:return Gye(x,C,D)}throw Error(n(156,C.tag))};function _0e(x,C){return Tn(x,C)}function Qct(x,C,D,W){this.tag=x,this.key=D,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=C,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=W,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ju(x,C,D,W){return new Qct(x,C,D,W)}function gG(x){return x=x.prototype,!(!x||!x.isReactComponent)}function Kct(x){if(typeof x=="function")return gG(x)?1:0;if(x!=null){if(x=x.$$typeof,x===R)return 11;if(x===L)return 14}return 2}function iy(x,C){var D=x.alternate;return D===null?(D=Ju(x.tag,C,x.key,x.mode),D.elementType=x.elementType,D.type=x.type,D.stateNode=x.stateNode,D.alternate=x,x.alternate=D):(D.pendingProps=C,D.type=x.type,D.flags=0,D.subtreeFlags=0,D.deletions=null),D.flags=x.flags&14680064,D.childLanes=x.childLanes,D.lanes=x.lanes,D.child=x.child,D.memoizedProps=x.memoizedProps,D.memoizedState=x.memoizedState,D.updateQueue=x.updateQueue,C=x.dependencies,D.dependencies=C===null?null:{lanes:C.lanes,firstContext:C.firstContext},D.sibling=x.sibling,D.index=x.index,D.ref=x.ref,D}function WF(x,C,D,W,q,K){var de=2;if(W=x,typeof x=="function")gG(x)&&(de=1);else if(typeof x=="string")de=5;else e:switch(x){case E:return sx(D.children,q,K,C);case T:de=8,q|=8;break;case k:return x=Ju(12,D,C,q|2),x.elementType=k,x.lanes=K,x;case F:return x=Ju(13,D,C,q),x.elementType=F,x.lanes=K,x;case A:return x=Ju(19,D,C,q),x.elementType=A,x.lanes=K,x;case j:return HF(D,q,K,C);default:if(typeof x=="object"&&x!==null)switch(x.$$typeof){case P:de=10;break e;case I:de=9;break e;case R:de=11;break e;case L:de=14;break e;case $:de=16,W=null;break e}throw Error(n(130,x==null?x:typeof x,""))}return C=Ju(de,D,C,q),C.elementType=x,C.type=W,C.lanes=K,C}function sx(x,C,D,W){return x=Ju(7,x,W,C),x.lanes=D,x}function HF(x,C,D,W){return x=Ju(22,x,W,C),x.elementType=j,x.lanes=D,x.stateNode={isHidden:!1},x}function mG(x,C,D){return x=Ju(6,x,null,C),x.lanes=D,x}function vG(x,C,D){return C=Ju(4,x.children!==null?x.children:[],x.key,C),C.lanes=D,C.stateNode={containerInfo:x.containerInfo,pendingChildren:null,implementation:x.implementation},C}function Zct(x,C,D,W,q){this.tag=C,this.containerInfo=x,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=WW(0),this.expirationTimes=WW(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=WW(0),this.identifierPrefix=W,this.onRecoverableError=q,this.mutableSourceEagerHydrationData=null}function yG(x,C,D,W,q,K,de,Ae,Ie){return x=new Zct(x,C,D,Ae,Ie),C===1?(C=1,K===!0&&(C|=8)):C=0,K=Ju(3,null,null,C),x.current=K,K.stateNode=x,K.memoizedState={element:W,isDehydrated:D,cache:null,transitions:null,pendingSuspenseBoundaries:null},AH(K),x}function Jct(x,C,D){var W=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),CG.exports=dut(),CG.exports}var $0e;function hut(){if($0e)return ZF;$0e=1;var e=d6();return ZF.createRoot=e.createRoot,ZF.hydrateRoot=e.hydrateRoot,ZF}var put=hut();const gut=Yn(put);var M=fg();const Te=Yn(M),c5=out({__proto__:null,default:Te},[M]);var TG={exports:{}},PG,N0e;function mut(){if(N0e)return PG;N0e=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return PG=e,PG}var kG,z0e;function vut(){if(z0e)return kG;z0e=1;var e=mut();function t(){}function n(){}return n.resetWarningCache=t,kG=function(){function r(s,a,l,c,u,f){if(f!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},kG}var j0e;function AI(){return j0e||(j0e=1,TG.exports=vut()()),TG.exports}var yut=AI();const le=Yn(yut);var h6=Te.createContext(null);function but(e){e()}var f3e=but,xut=function(t){return f3e=t},wut=function(){return f3e};function Sut(){var e=wut(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var i=t;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=t;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,s=n={callback:i,next:null,prev:n};return s.prev?s.prev.next=s:t=s,function(){!o||t===null||(o=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}var B0e={notify:function(){},get:function(){return[]}};function d3e(e,t){var n,r=B0e;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function s(){u.onStateChange&&u.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=Sut())}function c(){n&&(n(),n=void 0,r.clear(),r=B0e)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var h3e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?M.useLayoutEffect:M.useEffect;function _ut(e){var t=e.store,n=e.context,r=e.children,i=M.useMemo(function(){var a=d3e(t);return{store:t,subscription:a}},[t]),o=M.useMemo(function(){return t.getState()},[t]);h3e(function(){var a=i.subscription;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),o!==t.getState()&&a.notifyNestedSubs(),function(){a.tryUnsubscribe(),a.onStateChange=null}},[i,o]);var s=n||h6;return Te.createElement(s.Provider,{value:i},r)}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;r--){var i=t[r](e);if(i)return i}return function(o,s){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+s.wrappedComponentName+".")}}function ift(e,t){return e===t}function oft(e){var t={},n=t.connectHOC,r=n===void 0?zut:n,i=t.mapStateToPropsFactories,o=i===void 0?qut:i,s=t.mapDispatchToPropsFactories,a=s===void 0?Wut:s,l=t.mergePropsFactories,c=l===void 0?Zut:l,u=t.selectorFactory,f=u===void 0?nft:u;return function(h,p,g,m){m===void 0&&(m={});var v=m,y=v.pure,b=y===void 0?!0:y,w=v.areStatesEqual,S=w===void 0?ift:w,_=v.areOwnPropsEqual,E=_===void 0?IG:_,T=v.areStatePropsEqual,k=T===void 0?IG:T,P=v.areMergedPropsEqual,I=P===void 0?IG:P,R=st(v,rft),F=DG(h,o,"mapStateToProps"),A=DG(p,a,"mapDispatchToProps"),L=DG(g,c,"mergeProps");return r(f,X({methodName:"connect",getDisplayName:function(j){return"Connect("+j+")"},shouldHandleStateChanges:!!h,initMapStateToProps:F,initMapDispatchToProps:A,initMergeProps:L,pure:b,areStatesEqual:S,areOwnPropsEqual:E,areStatePropsEqual:k,areMergedPropsEqual:I},R))}}const hr=oft();var p6=d6();const JF=Yn(p6);xut(p6.unstable_batchedUpdates);function iv(e){"@babel/helpers - typeof";return iv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iv(e)}function sft(e,t){if(iv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(iv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function q1(e){var t=sft(e,"string");return iv(t)=="symbol"?t:t+""}function Kt(e,t,n){return(t=q1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q0e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function K0e(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(su(1));return n(g3e)(e,t)}if(typeof e!="function")throw new Error(su(2));var i=e,o=t,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(su(3));return o}function f(g){if(typeof g!="function")throw new Error(su(4));if(l)throw new Error(su(5));var m=!0;return c(),a.push(g),function(){if(m){if(l)throw new Error(su(6));m=!1,c();var y=a.indexOf(g);a.splice(y,1),s=null}}}function d(g){if(!aft(g))throw new Error(su(7));if(typeof g.type>"u")throw new Error(su(8));if(l)throw new Error(su(9));try{l=!0,o=i(o,g)}finally{l=!1}for(var m=s=a,v=0;v"u"?"undefined":L(N);return B!=="object"?B:N===Math?"math":N===null?"null":Array.isArray(N)?"array":Object.prototype.toString.call(N)==="[object Date]"?"date":typeof N.toString=="function"&&/^\/.*\//.test(N.toString())?"regexp":"object"}function f(N,B,H,Q,Y,Z,ge){Y=Y||[],ge=ge||[];var ne=Y.slice(0);if(typeof Z<"u"){if(Q){if(typeof Q=="function"&&Q(ne,Z))return;if((typeof Q>"u"?"undefined":L(Q))==="object"){if(Q.prefilter&&Q.prefilter(ne,Z))return;if(Q.normalize){var ie=Q.normalize(ne,Z,N,B);ie&&(N=ie[0],B=ie[1])}}}ne.push(Z)}u(N)==="regexp"&&u(B)==="regexp"&&(N=N.toString(),B=B.toString());var fe=typeof N>"u"?"undefined":L(N),ve=typeof B>"u"?"undefined":L(B),se=fe!=="undefined"||ge&&ge[ge.length-1].lhs&&ge[ge.length-1].lhs.hasOwnProperty(Z),ue=ve!=="undefined"||ge&&ge[ge.length-1].rhs&&ge[ge.length-1].rhs.hasOwnProperty(Z);if(!se&&ue)H(new s(ne,B));else if(!ue&&se)H(new a(ne,N));else if(u(N)!==u(B))H(new o(ne,N,B));else if(u(N)==="date"&&N-B!==0)H(new o(ne,N,B));else if(fe==="object"&&N!==null&&B!==null)if(ge.filter(function(J){return J.lhs===N}).length)N!==B&&H(new o(ne,N,B));else{if(ge.push({lhs:N,rhs:B}),Array.isArray(N)){var G;for(N.length,G=0;G=B.length?H(new l(ne,G,new a(void 0,N[G]))):f(N[G],B[G],H,Q,ne,G,ge);for(;G=0?(f(N[J],B[J],H,Q,ne,J,ge),pe=c(pe,ae)):f(N[J],void 0,H,Q,ne,J,ge)}),pe.forEach(function(J){f(void 0,B[J],H,Q,ne,J,ge)})}ge.length=ge.length-1}else N!==B&&(fe==="number"&&isNaN(N)&&isNaN(B)||H(new o(ne,N,B)))}function d(N,B,H,Q){return Q=Q||[],f(N,B,function(Y){Y&&Q.push(Y)},H),Q.length?Q:void 0}function h(N,B,H){if(H.path&&H.path.length){var Q,Y=N[B],Z=H.path.length-1;for(Q=0;Q"u"&&(Q[H.path[Y]]=typeof H.path[Y]=="number"?[]:{}),Q=Q[H.path[Y]];switch(H.kind){case"A":h(H.path?Q[H.path[Y]]:Q,H.index,H.item);break;case"D":delete Q[H.path[Y]];break;case"E":case"N":Q[H.path[Y]]=H.rhs}}}function g(N,B,H){if(H.path&&H.path.length){var Q,Y=N[B],Z=H.path.length-1;for(Q=0;Q"u"&&(Z[H.path[Q]]={}),Z=Z[H.path[Q]];switch(H.kind){case"A":g(Z[H.path[Q]],H.index,H.item);break;case"D":Z[H.path[Q]]=H.lhs;break;case"E":Z[H.path[Q]]=H.lhs;break;case"N":delete Z[H.path[Q]]}}}function v(N,B,H){if(N&&B){var Q=function(Y){H&&!H(N,B,Y)||p(N,B,Y)};f(N,B,Q)}}function y(N){return"color: "+V[N].color+"; font-weight: bold"}function b(N){var B=N.kind,H=N.path,Q=N.lhs,Y=N.rhs,Z=N.index,ge=N.item;switch(B){case"E":return[H.join("."),Q,"→",Y];case"N":return[H.join("."),Y];case"D":return[H.join(".")];case"A":return[H.join(".")+"["+Z+"]",ge];default:return[]}}function w(N,B,H,Q){var Y=d(N,B);try{Q?H.groupCollapsed("diff"):H.group("diff")}catch{H.log("diff")}Y?Y.forEach(function(Z){var ge=Z.kind,ne=b(Z);H.log.apply(H,["%c "+V[ge].text,y(ge)].concat($(ne)))}):H.log("—— no diff ——");try{H.groupEnd()}catch{H.log("—— diff end —— ")}}function S(N,B,H,Q){switch(typeof N>"u"?"undefined":L(N)){case"object":return typeof N[Q]=="function"?N[Q].apply(N,$(H)):N[Q];case"function":return N(B);default:return N}}function _(N){var B=N.timestamp,H=N.duration;return function(Q,Y,Z){var ge=["action"];return ge.push("%c"+String(Q.type)),B&&ge.push("%c@ "+Y),H&&ge.push("%c(in "+Z.toFixed(2)+" ms)"),ge.join(" ")}}function E(N,B){var H=B.logger,Q=B.actionTransformer,Y=B.titleFormatter,Z=Y===void 0?_(B):Y,ge=B.collapsed,ne=B.colors,ie=B.level,fe=B.diff,ve=typeof B.titleFormatter>"u";N.forEach(function(se,ue){var G=se.started,ce=se.startedTime,pe=se.action,J=se.prevState,te=se.error,ae=se.took,we=se.nextState,Pe=N[ue+1];Pe&&(we=Pe.prevState,ae=Pe.started-G);var ee=Q(pe),re=typeof ge=="function"?ge(function(){return we},pe,se):ge,Se=F(ce),he=ne.title?"color: "+ne.title(ee)+";":"",xe=["color: gray; font-weight: lighter;"];xe.push(he),B.timestamp&&xe.push("color: gray; font-weight: lighter;"),B.duration&&xe.push("color: gray; font-weight: lighter;");var me=Z(ee,Se,ae);try{re?ne.title&&ve?H.groupCollapsed.apply(H,["%c "+me].concat(xe)):H.groupCollapsed(me):ne.title&&ve?H.group.apply(H,["%c "+me].concat(xe)):H.group(me)}catch{H.log(me)}var be=S(ie,ee,[J],"prevState"),oe=S(ie,ee,[ee],"action"),Ee=S(ie,ee,[te,J],"error"),ke=S(ie,ee,[we],"nextState");if(be)if(ne.prevState){var ze="color: "+ne.prevState(J)+"; font-weight: bold";H[be]("%c prev state",ze,J)}else H[be]("prev state",J);if(oe)if(ne.action){var De="color: "+ne.action(ee)+"; font-weight: bold";H[oe]("%c action ",De,ee)}else H[oe]("action ",ee);if(te&&Ee)if(ne.error){var Ve="color: "+ne.error(te,J)+"; font-weight: bold;";H[Ee]("%c error ",Ve,te)}else H[Ee]("error ",te);if(ke)if(ne.nextState){var Ze="color: "+ne.nextState(we)+"; font-weight: bold";H[ke]("%c next state",Ze,we)}else H[ke]("next state",we);fe&&w(J,we,H,re);try{H.groupEnd()}catch{H.log("—— log end ——")}})}function T(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=Object.assign({},U,N),H=B.logger,Q=B.stateTransformer,Y=B.errorTransformer,Z=B.predicate,ge=B.logErrors,ne=B.diffPredicate;if(typeof H>"u")return function(){return function(fe){return function(ve){return fe(ve)}}};if(N.getState&&N.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware: // Logger with default options import { logger } from 'redux-logger' const store = createStore( @@ -21,15 +21,15 @@ const store = createStore( reducer, applyMiddleware(logger) ) -`),function(){return function(fe){return function(me){return fe(me)}}};var ne=[];return function(fe){var me=fe.getState;return function(se){return function(ue){if(typeof Z=="function"&&!Z(me,ue))return se(ue);var G={};ne.push(G),G.started=A.now(),G.startedTime=new Date,G.prevState=Q(me()),G.action=ue;var ce=void 0;if(pe)try{ce=se(ue)}catch(J){G.error=Y(J)}else ce=se(ue);G.took=A.now()-G.started,G.nextState=Q(me());var he=B.diff&&typeof ie=="function"?ie(me,ue):B.diff;if(E(ne,Object.assign({},B,{diff:he})),ne.length=0,G.error)throw G.error;return ce}}}}var k,P,R=function(N,B){return new Array(B+1).join(N)},I=function(N,B){return R("0",B-N.toString().length)+N},F=function(N){return I(N.getHours(),2)+":"+I(N.getMinutes(),2)+":"+I(N.getSeconds(),2)+"."+I(N.getMilliseconds(),3)},A=typeof performance<"u"&&performance!==null&&typeof performance.now=="function"?performance:Date,L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},$=function(N){if(Array.isArray(N)){for(var B=0,H=Array(N.length);B"u"?"undefined":L(Rs))==="object"&&Rs?Rs:typeof window<"u"?window:{},P=k.DeepDiff,P&&j.push(function(){typeof P<"u"&&k.DeepDiff===d&&(k.DeepDiff=P,P=void 0)}),r(o,i),r(s,i),r(a,i),r(l,i),Object.defineProperties(d,{diff:{value:d,enumerable:!0},observableDiff:{value:f,enumerable:!0},applyDiff:{value:v,enumerable:!0},applyChange:{value:p,enumerable:!0},revertChange:{value:m,enumerable:!0},isConflict:{value:function(){return typeof P<"u"},enumerable:!0},noConflict:{value:function(){return j&&(j.forEach(function(N){N()}),j=null),d},enumerable:!0}});var V={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},U={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(N){return N},actionTransformer:function(N){return N},errorTransformer:function(N){return N},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},z=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=N.dispatch,H=N.getState;return typeof B=="function"||typeof H=="function"?T()({dispatch:B,getState:H}):void console.error(` +`),function(){return function(fe){return function(ve){return fe(ve)}}};var ie=[];return function(fe){var ve=fe.getState;return function(se){return function(ue){if(typeof Z=="function"&&!Z(ve,ue))return se(ue);var G={};ie.push(G),G.started=A.now(),G.startedTime=new Date,G.prevState=Q(ve()),G.action=ue;var ce=void 0;if(ge)try{ce=se(ue)}catch(J){G.error=Y(J)}else ce=se(ue);G.took=A.now()-G.started,G.nextState=Q(ve());var pe=B.diff&&typeof ne=="function"?ne(ve,ue):B.diff;if(E(ie,Object.assign({},B,{diff:pe})),ie.length=0,G.error)throw G.error;return ce}}}}var k,P,I=function(N,B){return new Array(B+1).join(N)},R=function(N,B){return I("0",B-N.toString().length)+N},F=function(N){return R(N.getHours(),2)+":"+R(N.getMinutes(),2)+":"+R(N.getSeconds(),2)+"."+R(N.getMilliseconds(),3)},A=typeof performance<"u"&&performance!==null&&typeof performance.now=="function"?performance:Date,L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},$=function(N){if(Array.isArray(N)){for(var B=0,H=Array(N.length);B"u"?"undefined":L(Rs))==="object"&&Rs?Rs:typeof window<"u"?window:{},P=k.DeepDiff,P&&j.push(function(){typeof P<"u"&&k.DeepDiff===d&&(k.DeepDiff=P,P=void 0)}),r(o,i),r(s,i),r(a,i),r(l,i),Object.defineProperties(d,{diff:{value:d,enumerable:!0},observableDiff:{value:f,enumerable:!0},applyDiff:{value:v,enumerable:!0},applyChange:{value:p,enumerable:!0},revertChange:{value:m,enumerable:!0},isConflict:{value:function(){return typeof P<"u"},enumerable:!0},noConflict:{value:function(){return j&&(j.forEach(function(N){N()}),j=null),d},enumerable:!0}});var V={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},U={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(N){return N},actionTransformer:function(N){return N},errorTransformer:function(N){return N},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},z=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=N.dispatch,H=N.getState;return typeof B=="function"||typeof H=="function"?T()({dispatch:B,getState:H}):void console.error(` [redux-logger v3] BREAKING CHANGE [redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings. [redux-logger v3] Change [redux-logger v3] import createLogger from 'redux-logger' [redux-logger v3] to [redux-logger v3] import { createLogger } from 'redux-logger' -`)};n.defaults=U,n.createLogger=T,n.logger=z,n.default=z,Object.defineProperty(n,"__esModule",{value:!0})})})(H2,H2.exports)),H2.exports}var Pht=Tht();function x5e(e){var t=function(r){var i=r.dispatch,o=r.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,e):s(a)}}};return t}var w5e=x5e();w5e.withExtraArgument=x5e;const kA={black:"#000",white:"#fff"},jy={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},S5e={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},By={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},kht={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},_5e={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},Uy={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Vy={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},C5e={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},O5e={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},bm={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Mht={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},E5e={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},T5e={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"},P5e={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},Zx={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},P1={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},k5e={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},M5e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Aht={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"};function cv(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const If="$$material";function Rht(e){if(e.sheet)return e.sheet;for(var t=0;t0?Sa(bT,--Fc):0,jO--,fs===10&&(jO=1,N6--),fs}function ku(){return fs=Fc2||AA(fs)>3?"":" "}function Wht(e,t){for(;--t&&ku()&&!(fs<48||fs>102||fs>57&&fs<65||fs>70&&fs<97););return VI(e,wz()+(t<6&&Fp()==32&&ku()==32))}function Qee(e){for(;ku();)switch(fs){case e:return Fc;case 34:case 39:e!==34&&e!==39&&Qee(fs);break;case 40:e===41&&Qee(e);break;case 92:ku();break}return Fc}function Hht(e,t){for(;ku()&&e+fs!==57;)if(e+fs===84&&Fp()===47)break;return"/*"+VI(t,Fc-1)+"*"+$6(e===47?e:ku())}function Ght(e){for(;!AA(Fp());)ku();return VI(e,Fc)}function qht(e){return $5e(_z("",null,null,null,[""],e=F5e(e),0,[0],e))}function _z(e,t,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,d=0,h=0,p=0,g=1,m=1,v=1,y=0,b="",w=i,S=o,_=r,E=b;m;)switch(p=y,y=ku()){case 40:if(p!=108&&Sa(E,f-1)==58){Yee(E+=ri(Sz(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=Sz(y);break;case 9:case 10:case 13:case 32:E+=Vht(p);break;case 92:E+=Wht(wz()-1,7);continue;case 47:switch(Fp()){case 42:case 47:p$(Xht(Hht(ku(),wz()),t,n),l);break;default:E+="/"}break;case 123*g:a[c++]=ap(E)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:v==-1&&(E=ri(E,/\f/g,"")),h>0&&ap(E)-f&&p$(h>32?cxe(E+";",r,n,f-1):cxe(ri(E," ","")+";",r,n,f-2),l);break;case 59:E+=";";default:if(p$(_=lxe(E,t,n,c,u,i,a,b,w=[],S=[],f),o),y===123)if(u===0)_z(E,t,_,_,w,o,f,a,S);else switch(d===99&&Sa(E,3)===110?100:d){case 100:case 108:case 109:case 115:_z(e,_,_,r&&p$(lxe(e,_,_,0,0,i,a,b,i,w=[],f),S),i,S,f,a,r?w:S);break;default:_z(E,_,_,_,[""],S,0,a,S)}}c=u=h=0,g=v=1,b=E="",f=s;break;case 58:f=1+ap(E),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&Uht()==125)continue}switch(E+=$6(y),y*g){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(ap(E)-1)*v,v=1;break;case 64:Fp()===45&&(E+=Sz(ku())),d=Fp(),u=f=ap(b=E+=Ght(wz())),y++;break;case 45:p===45&&ap(E)==2&&(g=0)}}return o}function lxe(e,t,n,r,i,o,s,a,l,c,u){for(var f=i-1,d=i===0?o:[""],h=kae(d),p=0,g=0,m=0;p0?d[v]+" "+y:ri(y,/&\f/g,d[v])))&&(l[m++]=b);return z6(e,t,n,i===0?Tae:a,l,c,u)}function Xht(e,t,n){return z6(e,t,n,R5e,$6(Bht()),MA(e,2,-2),0)}function cxe(e,t,n,r){return z6(e,t,n,Pae,MA(e,0,r),MA(e,r+1,-1),r)}function aO(e,t){for(var n="",r=kae(e),i=0;i6)switch(Sa(e,t+1)){case 109:if(Sa(e,t+4)!==45)break;case 102:return ri(e,/(.+:)(.+)-([^]+)/,"$1"+ei+"$2-$3$1"+I5+(Sa(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Yee(e,"stretch")?z5e(ri(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Sa(e,t+1)!==115)break;case 6444:switch(Sa(e,ap(e)-3-(~Yee(e,"!important")&&10))){case 107:return ri(e,":",":"+ei)+e;case 101:return ri(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ei+(Sa(e,14)===45?"inline-":"")+"box$3$1"+ei+"$2$3$1"+Ya+"$2box$3")+e}break;case 5936:switch(Sa(e,t+11)){case 114:return ei+e+Ya+ri(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ei+e+Ya+ri(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ei+e+Ya+ri(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ei+e+Ya+e+e}return e}var rpt=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Pae:t.return=z5e(t.value,t.length);break;case I5e:return aO([wk(t,{value:ri(t.value,"@","@"+ei)})],i);case Tae:if(t.length)return jht(t.props,function(o){switch(zht(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return aO([wk(t,{props:[ri(o,/:(read-\w+)/,":"+I5+"$1")]})],i);case"::placeholder":return aO([wk(t,{props:[ri(o,/:(plac\w+)/,":"+ei+"input-$1")]}),wk(t,{props:[ri(o,/:(plac\w+)/,":"+I5+"$1")]}),wk(t,{props:[ri(o,/:(plac\w+)/,Ya+"input-$1")]})],i)}return""})}},ipt=[rpt],j5e=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=t.stylisPlugins||ipt,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),v=1;v=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var apt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},lpt=/[A-Z]|^ms/g,cpt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,U5e=function(t){return t.charCodeAt(1)===45},fxe=function(t){return t!=null&&typeof t!="boolean"},o9=N5e(function(e){return U5e(e)?e:e.replace(lpt,"-$&").toLowerCase()}),dxe=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(cpt,function(r,i,o){return lp={name:i,styles:o,next:lp},i})}return apt[t]!==1&&!U5e(t)&&typeof n=="number"&&n!==0?n+"px":n};function RA(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return lp={name:i.name,styles:i.styles,next:lp},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)lp={name:s.name,styles:s.styles,next:lp},s=s.next;var a=o.styles+";";return a}return upt(e,t,n)}case"function":{if(e!==void 0){var l=lp,c=n(e);return lp=l,RA(e,t,c)}break}}var u=n;if(t==null)return u;var f=t[u];return f!==void 0?f:u}function upt(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i96?xpt:wpt},vxe=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(s){return t.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},Spt=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Mae(n,r,i),W5e(function(){return Aae(n,r,i)}),null},_pt=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,s;n!==void 0&&(o=n.label,s=n.target);var a=vxe(t,n,r),l=a||mxe(i),c=!l("as");return function(){var u=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{var d=u[0];f.push(d[0]);for(var h=u.length,p=1;p{const n=j5e(e);return n.sheet=new t({key:n.key,nonce:n.sheet.nonce,container:n.sheet.container,speedy:n.sheet.isSpeedy,prepend:n.sheet.prepend,insertionPoint:n.sheet.insertionPoint}),n};let Wy;if(typeof document=="object"&&(Wy=document.querySelector('[name="emotion-insertion-point"]'),!Wy)){Wy=document.createElement("meta"),Wy.setAttribute("name","emotion-insertion-point"),Wy.setAttribute("content","");const e=document.querySelector("head");e&&e.prepend(Wy)}function Ept(e,t){if(e||t){class n extends A5e{insert(o,s){return this.key&&this.key.endsWith("global")&&(this.before=Wy),super.insert(o,s)}}const r=Opt({key:"css",insertionPoint:e?Wy:void 0},n);if(t){const i=r.insert;r.insert=(...o)=>(o[1].styles.match(/^@layer\s+[^{]*$/)||(o[1].styles=`@layer mui {${o[1].styles}}`),i(...o))}return r}}function Tpt(e){const{injectFirst:t,enableCssLayer:n,children:r}=e,i=M.useMemo(()=>{const o=`${t}-${n}`;if(typeof document=="object"&&s9.has(o))return s9.get(o);const s=Ept(t,n);return s9.set(o,s),s},[t,n]);return i?O.jsx(dpt,{value:i,children:r}):r}function Ppt(e){return e==null||Object.keys(e).length===0}function G5e(e){const{styles:t,defaultTheme:n={}}=e,r=typeof t=="function"?i=>t(Ppt(i)?n:i):t;return O.jsx(vpt,{styles:r})}function q5e(e,t){return Zee(e,t)}function kpt(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const yxe=[];function T0(e){return yxe[0]=e,WI(yxe)}var a9={exports:{}},Mi={};var bxe;function Mpt(){if(bxe)return Mi;bxe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),d=Symbol.for("react.view_transition"),h=Symbol.for("react.client.reference");function p(g){if(typeof g=="object"&&g!==null){var m=g.$$typeof;switch(m){case e:switch(g=g.type,g){case n:case i:case r:case l:case c:case d:return g;default:switch(g=g&&g.$$typeof,g){case s:case a:case f:case u:return g;case o:return g;default:return m}}case t:return m}}}return Mi.ContextConsumer=o,Mi.ContextProvider=s,Mi.Element=e,Mi.ForwardRef=a,Mi.Fragment=n,Mi.Lazy=f,Mi.Memo=u,Mi.Portal=t,Mi.Profiler=i,Mi.StrictMode=r,Mi.Suspense=l,Mi.SuspenseList=c,Mi.isContextConsumer=function(g){return p(g)===o},Mi.isContextProvider=function(g){return p(g)===s},Mi.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},Mi.isForwardRef=function(g){return p(g)===a},Mi.isFragment=function(g){return p(g)===n},Mi.isLazy=function(g){return p(g)===f},Mi.isMemo=function(g){return p(g)===u},Mi.isPortal=function(g){return p(g)===t},Mi.isProfiler=function(g){return p(g)===i},Mi.isStrictMode=function(g){return p(g)===r},Mi.isSuspense=function(g){return p(g)===l},Mi.isSuspenseList=function(g){return p(g)===c},Mi.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===i||g===r||g===l||g===c||typeof g=="object"&&g!==null&&(g.$$typeof===f||g.$$typeof===u||g.$$typeof===s||g.$$typeof===o||g.$$typeof===a||g.$$typeof===h||g.getModuleId!==void 0)},Mi.typeOf=p,Mi}var xxe;function Apt(){return xxe||(xxe=1,a9.exports=Mpt()),a9.exports}var X5e=Apt();function dp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Y5e(e){if(M.isValidElement(e)||X5e.isValidElementType(e)||!dp(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Y5e(e[n])}),t}function ia(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return dp(e)&&dp(t)&&Object.keys(t).forEach(i=>{M.isValidElement(t[i])||X5e.isValidElementType(t[i])?r[i]=t[i]:dp(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&dp(e[i])?r[i]=ia(e[i],t[i],n):n.clone?r[i]=dp(t[i])?Y5e(t[i]):t[i]:r[i]=t[i]}),r}const Rpt=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function Ipt(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,o=Rpt(t),s=Object.keys(o);function a(d){return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof t[d]=="number"?t[d]:d)-r/100}${n})`}function c(d,h){const p=s.indexOf(h);return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n}) and (max-width:${(p!==-1&&typeof t[s[p]]=="number"?t[s[p]]:h)-r/100}${n})`}function u(d){return s.indexOf(d)+1r.startsWith("@container")).sort((r,i)=>{const o=/min-width:\s*([0-9.]+)/;return+(r.match(o)?.[1]||0)-+(i.match(o)?.[1]||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},{...t}):t}function Dpt(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function Lpt(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function Fpt(e){const t=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>t(e.breakpoints.up(...a),s),o.down=(...a)=>t(e.breakpoints.down(...a),s),o.between=(...a)=>t(e.breakpoints.between(...a),s),o.only=(...a)=>t(e.breakpoints.only(...a),s),o.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...e,containerQueries:i}}const $pt={borderRadius:4};function jM(e,t){return t?ia(e,t,{clone:!1}):e}const j6={xs:0,sm:600,md:900,lg:1200,xl:1536},Sxe={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${j6[e]}px)`},Npt={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:j6[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Hf(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Sxe;return t.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const o=r.breakpoints||Sxe;return Object.keys(t).reduce((s,a)=>{if(Dpt(o.keys,a)){const l=Lpt(r.containerQueries?r:Npt,a);l&&(s[l]=n(t[a],a))}else if(Object.keys(o.values||j6).includes(a)){const l=o.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function zpt(e={}){return e.keys?.reduce((n,r)=>{const i=e.up(r);return n[i]={},n},{})||{}}function _xe(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function jpt(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((i,o)=>{o{e[i]!=null&&(n[i]=!0)}),n}function B6({values:e,breakpoints:t,base:n}){const r=n||jpt(e,t),i=Object.keys(r);if(i.length===0)return e;let o;return i.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[o],o=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[o],o=a):s[a]=e,s),{})}function Ve(e){if(typeof e!="string")throw new Error(cv(7));return e.charAt(0).toUpperCase()+e.slice(1)}function c0(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function D5(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=c0(e,n)||r,t&&(i=t(i,r,e)),i}function rs(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=c0(l,r)||{};return Hf(s,a,f=>{let d=D5(c,i,f);return f===d&&typeof f=="string"&&(d=D5(c,i,`${t}${f==="default"?"":Ve(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[t],o}function Bpt(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Upt={m:"margin",p:"padding"},Vpt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Cxe={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Wpt=Bpt(e=>{if(e.length>2)if(Cxe[e])e=Cxe[e];else return[e];const[t,n]=e.split(""),r=Upt[t],i=Vpt[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Dae=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Lae=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Dae,...Lae];function GI(e,t,n,r){const i=c0(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:typeof i=="string"?`calc(${o} * ${i})`:i*o:Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o),a=i[s];return o>=0?a:typeof a=="number"?-a:`-${a}`}:typeof i=="function"?i:()=>{}}function Fae(e){return GI(e,"spacing",8)}function qI(e,t){return typeof t=="string"||t==null?t:e(t)}function Hpt(e,t){return n=>e.reduce((r,i)=>(r[i]=qI(t,n),r),{})}function Gpt(e,t,n,r){if(!t.includes(n))return null;const i=Wpt(n),o=Hpt(i,r),s=e[n];return Hf(e,s,o)}function Q5e(e,t){const n=Fae(e.theme);return Object.keys(e).map(r=>Gpt(e,t,r,n)).reduce(jM,{})}function Io(e){return Q5e(e,Dae)}Io.propTypes={};Io.filterProps=Dae;function Do(e){return Q5e(e,Lae)}Do.propTypes={};Do.filterProps=Lae;function K5e(e=8,t=Fae({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function U6(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?jM(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function gf(e){return typeof e!="number"?e:`${e}px solid`}function sd(e,t){return rs({prop:e,themeKey:"borders",transform:t})}const qpt=sd("border",gf),Xpt=sd("borderTop",gf),Ypt=sd("borderRight",gf),Qpt=sd("borderBottom",gf),Kpt=sd("borderLeft",gf),Zpt=sd("borderColor"),Jpt=sd("borderTopColor"),egt=sd("borderRightColor"),tgt=sd("borderBottomColor"),ngt=sd("borderLeftColor"),rgt=sd("outline",gf),igt=sd("outlineColor"),V6=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=GI(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:qI(t,r)});return Hf(e,e.borderRadius,n)}return null};V6.propTypes={};V6.filterProps=["borderRadius"];U6(qpt,Xpt,Ypt,Qpt,Kpt,Zpt,Jpt,egt,tgt,ngt,V6,rgt,igt);const W6=e=>{if(e.gap!==void 0&&e.gap!==null){const t=GI(e.theme,"spacing",8),n=r=>({gap:qI(t,r)});return Hf(e,e.gap,n)}return null};W6.propTypes={};W6.filterProps=["gap"];const H6=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=GI(e.theme,"spacing",8),n=r=>({columnGap:qI(t,r)});return Hf(e,e.columnGap,n)}return null};H6.propTypes={};H6.filterProps=["columnGap"];const G6=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=GI(e.theme,"spacing",8),n=r=>({rowGap:qI(t,r)});return Hf(e,e.rowGap,n)}return null};G6.propTypes={};G6.filterProps=["rowGap"];const ogt=rs({prop:"gridColumn"}),sgt=rs({prop:"gridRow"}),agt=rs({prop:"gridAutoFlow"}),lgt=rs({prop:"gridAutoColumns"}),cgt=rs({prop:"gridAutoRows"}),ugt=rs({prop:"gridTemplateColumns"}),fgt=rs({prop:"gridTemplateRows"}),dgt=rs({prop:"gridTemplateAreas"}),hgt=rs({prop:"gridArea"});U6(W6,H6,G6,ogt,sgt,agt,lgt,cgt,ugt,fgt,dgt,hgt);function lO(e,t){return t==="grey"?t:e}const pgt=rs({prop:"color",themeKey:"palette",transform:lO}),ggt=rs({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:lO}),mgt=rs({prop:"backgroundColor",themeKey:"palette",transform:lO});U6(pgt,ggt,mgt);function bu(e){return e<=1&&e!==0?`${e*100}%`:e}const vgt=rs({prop:"width",transform:bu}),$ae=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||j6[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:bu(n)}};return Hf(e,e.maxWidth,t)}return null};$ae.filterProps=["maxWidth"];const ygt=rs({prop:"minWidth",transform:bu}),bgt=rs({prop:"height",transform:bu}),xgt=rs({prop:"maxHeight",transform:bu}),wgt=rs({prop:"minHeight",transform:bu});rs({prop:"size",cssProperty:"width",transform:bu});rs({prop:"size",cssProperty:"height",transform:bu});const Sgt=rs({prop:"boxSizing"});U6(vgt,$ae,ygt,bgt,xgt,wgt,Sgt);const XI={border:{themeKey:"borders",transform:gf},borderTop:{themeKey:"borders",transform:gf},borderRight:{themeKey:"borders",transform:gf},borderBottom:{themeKey:"borders",transform:gf},borderLeft:{themeKey:"borders",transform:gf},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:gf},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:V6},color:{themeKey:"palette",transform:lO},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:lO},backgroundColor:{themeKey:"palette",transform:lO},p:{style:Do},pt:{style:Do},pr:{style:Do},pb:{style:Do},pl:{style:Do},px:{style:Do},py:{style:Do},padding:{style:Do},paddingTop:{style:Do},paddingRight:{style:Do},paddingBottom:{style:Do},paddingLeft:{style:Do},paddingX:{style:Do},paddingY:{style:Do},paddingInline:{style:Do},paddingInlineStart:{style:Do},paddingInlineEnd:{style:Do},paddingBlock:{style:Do},paddingBlockStart:{style:Do},paddingBlockEnd:{style:Do},m:{style:Io},mt:{style:Io},mr:{style:Io},mb:{style:Io},ml:{style:Io},mx:{style:Io},my:{style:Io},margin:{style:Io},marginTop:{style:Io},marginRight:{style:Io},marginBottom:{style:Io},marginLeft:{style:Io},marginX:{style:Io},marginY:{style:Io},marginInline:{style:Io},marginInlineStart:{style:Io},marginInlineEnd:{style:Io},marginBlock:{style:Io},marginBlockStart:{style:Io},marginBlockEnd:{style:Io},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:W6},rowGap:{style:G6},columnGap:{style:H6},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:bu},maxWidth:{style:$ae},minWidth:{transform:bu},height:{transform:bu},maxHeight:{transform:bu},minHeight:{transform:bu},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function _gt(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function Cgt(e,t){return typeof e=="function"?e(t):e}function Ogt(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=c0(i,c)||{};return f?f(s):Hf(s,r,p=>{let g=D5(d,u,p);return p===g&&typeof p=="string"&&(g=D5(d,u,`${n}${p==="default"?"":Ve(p)}`,p)),l===!1?g:{[l]:g}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const s=i.unstable_sxConfig??XI;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=zpt(i.breakpoints),f=Object.keys(u);let d=u;return Object.keys(c).forEach(h=>{const p=Cgt(c[h],i);if(p!=null)if(typeof p=="object")if(s[h])d=jM(d,e(h,p,i,s));else{const g=Hf({theme:i},p,m=>({[h]:m}));_gt(g,p)?d[h]=t({sx:p,theme:i,nested:!0}):d=jM(d,g)}else d=jM(d,e(h,p,i,s))}),!o&&i.modularCssLayers?{"@layer sx":wxe(i,_xe(f,d))}:wxe(i,_xe(f,d))}return Array.isArray(r)?r.map(a):a(r)}return t}const W0=Ogt();W0.filterProps=["sx"];function Egt(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function Nae(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=e,a=Ipt(n),l=K5e(i);let c=ia({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...$pt,...o}},s);return c=Fpt(c),c.applyStyles=Egt,c=t.reduce((u,f)=>ia(u,f),c),c.unstable_sxConfig={...XI,...s?.unstable_sxConfig},c.unstable_sx=function(f){return W0({sx:f,theme:this})},c}function Tgt(e){return Object.keys(e).length===0}function q6(e=null){const t=M.useContext(HI);return!t||Tgt(t)?e:t}const Pgt=Nae();function tS(e=Pgt){return q6(e)}function l9(e){const t=T0(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Z5e({styles:e,themeId:t,defaultTheme:n={}}){const r=tS(n),i=t&&r[t]||r;let o=typeof e=="function"?e(i):e;return i.modularCssLayers&&(Array.isArray(o)?o=o.map(s=>l9(typeof s=="function"?s(i):s)):o=l9(o)),O.jsx(G5e,{styles:o})}const kgt=e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??XI;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function zae(e){const{sx:t,...n}=e,{systemProps:r,otherProps:i}=kgt(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...s)=>{const a=t(...s);return dp(a)?{...r,...a}:r}:o={...r,...t},{...i,sx:o}}const Oxe=e=>e,Mgt=()=>{let e=Oxe;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Oxe}}},J5e=Mgt();function eje(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(W0);return M.forwardRef(function(l,c){const u=tS(n),{className:f,component:d="div",...h}=zae(l);return O.jsx(o,{as:d,ref:c,className:Re(f,i?i(r):r),theme:t&&u[t]||u,...h})})}const Rgt={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function pt(e,t,n="Mui"){const r=Rgt[t];return r?`${n}-${r}`:`${J5e.generate(e)}-${t}`}function dt(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=pt(e,i,n)}),r}function tje(e){const{variants:t,...n}=e,r={variants:t,style:T0(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=T0(i.style))}),r}const Igt=Nae();function Cz(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function u1(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Dgt(e){return e?(t,n)=>n[e]:null}function Lgt(e,t,n){e.theme=$gt(e.theme)?n:e.theme[t]||e.theme}function Oz(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>Oz(e,i,n));if(Array.isArray(r?.variants)){let i;if(r.isProcessed)i=n?u1(r.style,n):r.style;else{const{variants:o,...s}=r;i=n?u1(T0(s),n):s}return nje(e,r.variants,[i],n)}return r?.isProcessed?n?u1(T0(r.style),n):r.style:n?u1(T0(r),n):r}function nje(e,t,n=[],r=void 0){let i;e:for(let o=0;o{kpt(a,_=>_.filter(E=>E!==W0));const{name:c,slot:u,skipVariantsResolver:f,skipSx:d,overridesResolver:h=Dgt(zgt(u)),...p}=l,g=c&&c.startsWith("Mui")||u?"components":"custom",m=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,v=d||!1;let y=Cz;u==="Root"||u==="root"?y=r:u?y=i:Ngt(a)&&(y=void 0);const b=q5e(a,{shouldForwardProp:y,label:Fgt(),...p}),w=_=>{if(_.__emotion_real===_)return _;if(typeof _=="function")return function(T){return Oz(T,_,T.theme.modularCssLayers?g:void 0)};if(dp(_)){const E=tje(_);return function(k){return E.variants?Oz(k,E,k.theme.modularCssLayers?g:void 0):k.theme.modularCssLayers?u1(E.style,g):E.style}}return _},S=(..._)=>{const E=[],T=_.map(w),k=[];if(E.push(o),c&&h&&k.push(function(F){const L=F.theme.components?.[c]?.styleOverrides;if(!L)return null;const $={};for(const j in L)$[j]=Oz(F,L[j],F.theme.modularCssLayers?"theme":void 0);return h(F,$)}),c&&!m&&k.push(function(F){const L=F.theme?.components?.[c]?.variants;return L?nje(F,L,[],F.theme.modularCssLayers?"theme":void 0):null}),v||k.push(W0),Array.isArray(T[0])){const I=T.shift(),F=new Array(E.length).fill(""),A=new Array(k.length).fill("");let L;L=[...F,...I,...A],L.raw=[...F,...I.raw,...A],E.unshift(L)}const P=[...E,...T,...k],R=b(...P);return a.muiName&&(R.muiName=a.muiName),R};return b.withConfig&&(S.withConfig=b.withConfig),S}}function Fgt(e,t){return void 0}function $gt(e){for(const t in e)return!1;return!0}function Ngt(e){return typeof e=="string"&&e.charCodeAt(0)>96}function zgt(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const Qn=rje();function nw(e,t){const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=r;if(i==="components"||i==="slots")n[i]={...e[i],...n[i]};else if(i==="componentsProps"||i==="slotProps"){const o=e[i],s=t[i];if(!s)n[i]=o||{};else if(!o)n[i]=s;else{n[i]={...s};for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const l=a;n[i][l]=nw(o[l],s[l])}}}else n[i]===void 0&&(n[i]=e[i])}return n}function jae(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:nw(t.components[n].defaultProps,r)}function jgt({props:e,name:t,defaultTheme:n,themeId:r}){let i=tS(n);return i=i[r]||i,jae({theme:i,name:t,props:e})}const ar=typeof window<"u"?M.useLayoutEffect:M.useEffect;function Bgt(e,t,n,r,i){const[o,s]=M.useState(()=>i&&n?n(e).matches:r?r(e).matches:t);return ar(()=>{if(!n)return;const a=n(e),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[e,n]),o}const Ugt={...R5},ije=Ugt.useSyncExternalStore;function Vgt(e,t,n,r,i){const o=M.useCallback(()=>t,[t]),s=M.useMemo(()=>{if(i&&n)return()=>n(e).matches;if(r!==null){const{matches:u}=r(e);return()=>u}return o},[o,e,r,i,n]),[a,l]=M.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(e);return[()=>u.matches,f=>(u.addEventListener("change",f),()=>{u.removeEventListener("change",f)})]},[o,n,e]);return ije(l,a,s)}function oje(e={}){const{themeId:t}=e;return function(r,i={}){let o=q6();o&&t&&(o=o[t]||o);const s=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:a=!1,matchMedia:l=s?window.matchMedia:null,ssrMatchMedia:c=null,noSsr:u=!1}=jae({name:"MuiUseMediaQuery",props:i,theme:o});let f=typeof r=="function"?r(o):r;return f=f.replace(/^@media( ?)/m,""),f.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(` -`)),(ije!==void 0?Vgt:Bgt)(f,a,l,c,u)}}oje();function yC(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Bae(e,t=0,n=1){return yC(e,t,n)}function Wgt(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Zp(e){if(e.type)return e;if(e.charAt(0)==="#")return Zp(Wgt(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(cv(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(cv(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const Hgt=e=>{const t=Zp(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},G2=(e,t)=>{try{return Hgt(e)}catch{return e}};function YI(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function sje(e){e=Zp(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),YI({type:a,values:l})}function Jee(e){e=Zp(e);let t=e.type==="hsl"||e.type==="hsla"?Zp(sje(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Ggt(e,t){const n=Jee(e),r=Jee(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Bt(e,t){return e=Zp(e),t=Bae(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,YI(e)}function g$(e,t,n){try{return Bt(e,t)}catch{return e}}function dh(e,t){if(e=Zp(e),t=Bae(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return YI(e)}function Li(e,t,n){try{return dh(e,t)}catch{return e}}function hh(e,t){if(e=Zp(e),t=Bae(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return YI(e)}function Fi(e,t,n){try{return hh(e,t)}catch{return e}}function aje(e,t=.15){return Jee(e)>.5?dh(e,t):hh(e,t)}function m$(e,t,n){try{return aje(e,t)}catch{return e}}const lje=le.oneOfType([le.func,le.object]);function ete(...e){return e.reduce((t,n)=>n==null?t:function(...i){t.apply(this,i),n.apply(this,i)},()=>{})}function QI(e,t=166){let n;function r(...i){const o=()=>{e.apply(this,i)};clearTimeout(n),n=setTimeout(o,t)}return r.clear=()=>{clearTimeout(n)},r}function Ez(e,t){return M.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}function ci(e){return e&&e.ownerDocument||document}function $c(e){return ci(e).defaultView||window}function tte(e,t){typeof e=="function"?e(t):e&&(e.current=t)}let Exe=0;function qgt(e){const[t,n]=M.useState(e),r=e||t;return M.useEffect(()=>{t==null&&(Exe+=1,n(`mui-${Exe}`))},[t]),r}const Xgt={...R5},Txe=Xgt.useId;function ur(e){if(Txe!==void 0){const t=Txe();return e??t}return qgt(e)}function Fa({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=M.useRef(e!==void 0),[o,s]=M.useState(t),a=i?e:o,l=M.useCallback(c=>{i||s(c)},[]);return[a,l]}function ft(e){const t=M.useRef(e);return ar(()=>{t.current=e}),M.useRef((...n)=>(0,t.current)(...n)).current}function zn(...e){const t=M.useRef(void 0),n=M.useCallback(r=>{const i=e.map(o=>{if(o==null)return null;if(typeof o=="function"){const s=o,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return o.current=r,()=>{o.current=null}});return()=>{i.forEach(o=>o?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Pxe={};function ad(e,t){const n=M.useRef(Pxe);return n.current===Pxe&&(n.current=e(t)),n}const Ygt=[];function Uae(e){M.useEffect(e,Ygt)}class X6{static create(){return new X6}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function jl(){const e=ad(X6.create).current;return Uae(e.disposeEffect),e}function H0(e){try{return e.matches(":focus-visible")}catch{}return!1}function cje(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}const Vae=e=>{const t=M.useRef({});return M.useEffect(()=>{t.current=e}),t.current};function Qgt(e){return M.Children.toArray(e).filter(t=>M.isValidElement(t))}const uje={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function Xe(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let s="",a=!0;for(let l=0;lr.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function kxe(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function dje(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const h=Re(n?.className,o,i?.className,r?.className),p={...n?.style,...i?.style,...r?.style},g={...n,...i,...r};return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const s=k1({...i,...r}),a=kxe(r),l=kxe(i),c=t(s),u=Re(c?.className,n?.className,o,i?.className,r?.className),f={...c?.style,...n?.style,...i?.style,...r?.style},d={...c,...n,...l,...a};return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}function IA(e,t,n){return typeof e=="function"?e(t,n):e}function Yn(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,s=i?{}:IA(n,r),{props:a,internalRef:l}=dje({...o,externalSlotProps:s}),c=zn(l,s?.ref,e.additionalProps?.ref);return fje(t,{...a,ref:c},r)}function xb(e){return parseInt(M.version,10)>=19?e?.props?.ref||null:e?.ref||null}const hje=M.createContext(null);function Y6(){return M.useContext(hje)}const Zgt=typeof Symbol=="function"&&Symbol.for,pje=Zgt?Symbol.for("mui.nested"):"__THEME_NESTED__";function Jgt(e,t){return typeof t=="function"?t(e):{...e,...t}}function emt(e){const{children:t,theme:n}=e,r=Y6(),i=M.useMemo(()=>{const o=r===null?{...n}:Jgt(r,n);return o!=null&&(o[pje]=r!==null),o},[n,r]);return O.jsx(hje.Provider,{value:i,children:t})}const gje=M.createContext();function tmt({value:e,...t}){return O.jsx(gje.Provider,{value:e??!0,...t})}const bi=()=>M.useContext(gje)??!1,mje=M.createContext(void 0);function nmt({value:e,children:t}){return O.jsx(mje.Provider,{value:e,children:t})}function rmt(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?nw(i.defaultProps,r):!i.styleOverrides&&!i.variants?nw(i,r):r}function imt({props:e,name:t}){const n=M.useContext(mje);return rmt({props:e,name:t,theme:{components:n}})}function omt(e){const t=q6(),n=ur()||"",{modularCssLayers:r}=e;let i="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!r||t!==null?i="":typeof r=="string"?i=r.replace(/mui(?!\.)/g,i):i=`@layer ${i};`,ar(()=>{const o=document.querySelector("head");if(!o)return;const s=o.firstChild;if(i){if(s&&s.hasAttribute?.("data-mui-layer-order")&&s.getAttribute("data-mui-layer-order")===n)return;const a=document.createElement("style");a.setAttribute("data-mui-layer-order",n),a.textContent=i,o.prepend(a)}else o.querySelector(`style[data-mui-layer-order="${n}"]`)?.remove()},[i,n]),i?O.jsx(Z5e,{styles:i}):null}const Mxe={};function Axe(e,t,n,r=!1){return M.useMemo(()=>{const i=e&&t[e]||t;if(typeof n=="function"){const o=n(i),s=e?{...t,[e]:o}:o;return r?()=>s:s}return e?{...t,[e]:n}:{...t,...n}},[e,t,n,r])}function vje(e){const{children:t,theme:n,themeId:r}=e,i=q6(Mxe),o=Y6()||Mxe,s=Axe(r,i,n),a=Axe(r,o,n,!0),l=(r?s[r]:s).direction==="rtl",c=omt(s);return O.jsx(emt,{theme:a,children:O.jsx(HI.Provider,{value:s,children:O.jsx(tmt,{value:l,children:O.jsxs(nmt,{value:r?s[r].components:s.components,children:[c,t]})})})})}const Rxe={theme:void 0};function smt(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(Rxe.theme=i.theme,o=tje(e(Rxe)),t=o,n=i.theme),o}}const Wae="mode",Hae="color-scheme",amt="data-color-scheme";function lmt(e){const{defaultMode:t="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:i=Wae,colorSchemeStorageKey:o=Hae,attribute:s=amt,colorSchemeNode:a="document.documentElement",nonce:l}=e||{};let c="",u=s;if(s==="class"&&(u=".%s"),s==="data"&&(u="[data-%s]"),u.startsWith(".")){const d=u.substring(1);c+=`${a}.classList.remove('${d}'.replace('%s', light), '${d}'.replace('%s', dark)); +`)};n.defaults=U,n.createLogger=T,n.logger=z,n.default=z,Object.defineProperty(n,"__esModule",{value:!0})})})(L2,L2.exports)),L2.exports}var dft=fft();function m3e(e){var t=function(r){var i=r.dispatch,o=r.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,e):s(a)}}};return t}var v3e=m3e();v3e.withExtraArgument=m3e;const yA={black:"#000",white:"#fff"},Fy={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},y3e={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},$y={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},hft={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},b3e={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},Ny={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},zy={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},x3e={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},w3e={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},mm={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},pft={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},S3e={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},_3e={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"},C3e={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},Vx={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},x1={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},O3e={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},E3e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},gft={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"};function ov(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const If="$$material";function mft(e){if(e.sheet)return e.sheet;for(var t=0;t0?wa(fT,--Dc):0,RO--,hs===10&&(RO=1,m6--),hs}function ku(){return hs=Dc2||xA(hs)>3?"":" "}function Pft(e,t){for(;--t&&ku()&&!(hs<48||hs>102||hs>57&&hs<65||hs>70&&hs<97););return RI(e,ez()+(t<6&&Lp()==32&&ku()==32))}function GJ(e){for(;ku();)switch(hs){case e:return Dc;case 34:case 39:e!==34&&e!==39&&GJ(hs);break;case 40:e===41&&GJ(e);break;case 92:ku();break}return Dc}function kft(e,t){for(;ku()&&e+hs!==57;)if(e+hs===84&&Lp()===47)break;return"/*"+RI(t,Dc-1)+"*"+g6(e===47?e:ku())}function Mft(e){for(;!xA(Lp());)ku();return RI(e,Dc)}function Aft(e){return I3e(nz("",null,null,null,[""],e=R3e(e),0,[0],e))}function nz(e,t,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,d=0,h=0,p=0,g=1,m=1,v=1,y=0,b="",w=i,S=o,_=r,E=b;m;)switch(p=y,y=ku()){case 40:if(p!=108&&wa(E,f-1)==58){HJ(E+=ri(tz(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=tz(y);break;case 9:case 10:case 13:case 32:E+=Tft(p);break;case 92:E+=Pft(ez()-1,7);continue;case 47:switch(Lp()){case 42:case 47:e$(Rft(kft(ku(),ez()),t,n),l);break;default:E+="/"}break;case 123*g:a[c++]=op(E)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:v==-1&&(E=ri(E,/\f/g,"")),h>0&&op(E)-f&&e$(h>32?rbe(E+";",r,n,f-1):rbe(ri(E," ","")+";",r,n,f-2),l);break;case 59:E+=";";default:if(e$(_=nbe(E,t,n,c,u,i,a,b,w=[],S=[],f),o),y===123)if(u===0)nz(E,t,_,_,w,o,f,a,S);else switch(d===99&&wa(E,3)===110?100:d){case 100:case 108:case 109:case 115:nz(e,_,_,r&&e$(nbe(e,_,_,0,0,i,a,b,i,w=[],f),S),i,S,f,a,r?w:S);break;default:nz(E,_,_,_,[""],S,0,a,S)}}c=u=h=0,g=v=1,b=E="",f=s;break;case 58:f=1+op(E),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&Eft()==125)continue}switch(E+=g6(y),y*g){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(op(E)-1)*v,v=1;break;case 64:Lp()===45&&(E+=tz(ku())),d=Lp(),u=f=op(b=E+=Mft(ez())),y++;break;case 45:p===45&&op(E)==2&&(g=0)}}return o}function nbe(e,t,n,r,i,o,s,a,l,c,u){for(var f=i-1,d=i===0?o:[""],h=xse(d),p=0,g=0,m=0;p0?d[v]+" "+y:ri(y,/&\f/g,d[v])))&&(l[m++]=b);return v6(e,t,n,i===0?yse:a,l,c,u)}function Rft(e,t,n){return v6(e,t,n,P3e,g6(Oft()),bA(e,2,-2),0)}function rbe(e,t,n,r){return v6(e,t,n,bse,bA(e,0,r),bA(e,r+1,-1),r)}function ZC(e,t){for(var n="",r=xse(e),i=0;i6)switch(wa(e,t+1)){case 109:if(wa(e,t+4)!==45)break;case 102:return ri(e,/(.+:)(.+)-([^]+)/,"$1"+ei+"$2-$3$1"+u5+(wa(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~HJ(e,"stretch")?L3e(ri(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(wa(e,t+1)!==115)break;case 6444:switch(wa(e,op(e)-3-(~HJ(e,"!important")&&10))){case 107:return ri(e,":",":"+ei)+e;case 101:return ri(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ei+(wa(e,14)===45?"inline-":"")+"box$3$1"+ei+"$2$3$1"+Ya+"$2box$3")+e}break;case 5936:switch(wa(e,t+11)){case 114:return ei+e+Ya+ri(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ei+e+Ya+ri(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ei+e+Ya+ri(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ei+e+Ya+e+e}return e}var Bft=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case bse:t.return=L3e(t.value,t.length);break;case k3e:return ZC([pk(t,{value:ri(t.value,"@","@"+ei)})],i);case yse:if(t.length)return Cft(t.props,function(o){switch(_ft(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ZC([pk(t,{props:[ri(o,/:(read-\w+)/,":"+u5+"$1")]})],i);case"::placeholder":return ZC([pk(t,{props:[ri(o,/:(plac\w+)/,":"+ei+"input-$1")]}),pk(t,{props:[ri(o,/:(plac\w+)/,":"+u5+"$1")]}),pk(t,{props:[ri(o,/:(plac\w+)/,Ya+"input-$1")]})],i)}return""})}},Uft=[Bft],F3e=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=t.stylisPlugins||Uft,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),v=1;v=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Hft={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Gft=/[A-Z]|^ms/g,qft=/_EMO_([^_]+?)_([^]*?)_EMO_/g,N3e=function(t){return t.charCodeAt(1)===45},obe=function(t){return t!=null&&typeof t!="boolean"},LG=D3e(function(e){return N3e(e)?e:e.replace(Gft,"-$&").toLowerCase()}),sbe=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(qft,function(r,i,o){return sp={name:i,styles:o,next:sp},i})}return Hft[t]!==1&&!N3e(t)&&typeof n=="number"&&n!==0?n+"px":n};function wA(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return sp={name:i.name,styles:i.styles,next:sp},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)sp={name:s.name,styles:s.styles,next:sp},s=s.next;var a=o.styles+";";return a}return Xft(e,t,n)}case"function":{if(e!==void 0){var l=sp,c=n(e);return sp=l,wA(e,t,c)}break}}var u=n;if(t==null)return u;var f=t[u];return f!==void 0?f:u}function Xft(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i96?idt:odt},fbe=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(s){return t.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},sdt=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return wse(n,r,i),j3e(function(){return Sse(n,r,i)}),null},adt=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,s;n!==void 0&&(o=n.label,s=n.target);var a=fbe(t,n,r),l=a||ube(i),c=!l("as");return function(){var u=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{var d=u[0];f.push(d[0]);for(var h=u.length,p=1;p{const n=F3e(e);return n.sheet=new t({key:n.key,nonce:n.sheet.nonce,container:n.sheet.container,speedy:n.sheet.isSpeedy,prepend:n.sheet.prepend,insertionPoint:n.sheet.insertionPoint}),n};let jy;if(typeof document=="object"&&(jy=document.querySelector('[name="emotion-insertion-point"]'),!jy)){jy=document.createElement("meta"),jy.setAttribute("name","emotion-insertion-point"),jy.setAttribute("content","");const e=document.querySelector("head");e&&e.prepend(jy)}function udt(e,t){if(e||t){class n extends T3e{insert(o,s){return this.key&&this.key.endsWith("global")&&(this.before=jy),super.insert(o,s)}}const r=cdt({key:"css",insertionPoint:e?jy:void 0},n);if(t){const i=r.insert;r.insert=(...o)=>(o[1].styles.match(/^@layer\s+[^{]*$/)||(o[1].styles=`@layer mui {${o[1].styles}}`),i(...o))}return r}}function fdt(e){const{injectFirst:t,enableCssLayer:n,children:r}=e,i=M.useMemo(()=>{const o=`${t}-${n}`;if(typeof document=="object"&&FG.has(o))return FG.get(o);const s=udt(t,n);return FG.set(o,s),s},[t,n]);return i?O.jsx(Qft,{value:i,children:r}):r}function ddt(e){return e==null||Object.keys(e).length===0}function U3e(e){const{styles:t,defaultTheme:n={}}=e,r=typeof t=="function"?i=>t(ddt(i)?n:i):t;return O.jsx(tdt,{styles:r})}function V3e(e,t){return XJ(e,t)}function hdt(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const dbe=[];function w0(e){return dbe[0]=e,II(dbe)}var $G={exports:{}},Mi={};var hbe;function pdt(){if(hbe)return Mi;hbe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),d=Symbol.for("react.view_transition"),h=Symbol.for("react.client.reference");function p(g){if(typeof g=="object"&&g!==null){var m=g.$$typeof;switch(m){case e:switch(g=g.type,g){case n:case i:case r:case l:case c:case d:return g;default:switch(g=g&&g.$$typeof,g){case s:case a:case f:case u:return g;case o:return g;default:return m}}case t:return m}}}return Mi.ContextConsumer=o,Mi.ContextProvider=s,Mi.Element=e,Mi.ForwardRef=a,Mi.Fragment=n,Mi.Lazy=f,Mi.Memo=u,Mi.Portal=t,Mi.Profiler=i,Mi.StrictMode=r,Mi.Suspense=l,Mi.SuspenseList=c,Mi.isContextConsumer=function(g){return p(g)===o},Mi.isContextProvider=function(g){return p(g)===s},Mi.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},Mi.isForwardRef=function(g){return p(g)===a},Mi.isFragment=function(g){return p(g)===n},Mi.isLazy=function(g){return p(g)===f},Mi.isMemo=function(g){return p(g)===u},Mi.isPortal=function(g){return p(g)===t},Mi.isProfiler=function(g){return p(g)===i},Mi.isStrictMode=function(g){return p(g)===r},Mi.isSuspense=function(g){return p(g)===l},Mi.isSuspenseList=function(g){return p(g)===c},Mi.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===i||g===r||g===l||g===c||typeof g=="object"&&g!==null&&(g.$$typeof===f||g.$$typeof===u||g.$$typeof===s||g.$$typeof===o||g.$$typeof===a||g.$$typeof===h||g.getModuleId!==void 0)},Mi.typeOf=p,Mi}var pbe;function gdt(){return pbe||(pbe=1,$G.exports=pdt()),$G.exports}var W3e=gdt();function fp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function H3e(e){if(M.isValidElement(e)||W3e.isValidElementType(e)||!fp(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=H3e(e[n])}),t}function oa(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return fp(e)&&fp(t)&&Object.keys(t).forEach(i=>{M.isValidElement(t[i])||W3e.isValidElementType(t[i])?r[i]=t[i]:fp(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&fp(e[i])?r[i]=oa(e[i],t[i],n):n.clone?r[i]=fp(t[i])?H3e(t[i]):t[i]:r[i]=t[i]}),r}const mdt=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function vdt(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=e,o=mdt(t),s=Object.keys(o);function a(d){return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof t[d]=="number"?t[d]:d)-r/100}${n})`}function c(d,h){const p=s.indexOf(h);return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n}) and (max-width:${(p!==-1&&typeof t[s[p]]=="number"?t[s[p]]:h)-r/100}${n})`}function u(d){return s.indexOf(d)+1r.startsWith("@container")).sort((r,i)=>{const o=/min-width:\s*([0-9.]+)/;return+(r.match(o)?.[1]||0)-+(i.match(o)?.[1]||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},{...t}):t}function ydt(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function bdt(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function xdt(e){const t=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>t(e.breakpoints.up(...a),s),o.down=(...a)=>t(e.breakpoints.down(...a),s),o.between=(...a)=>t(e.breakpoints.between(...a),s),o.only=(...a)=>t(e.breakpoints.only(...a),s),o.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...e,containerQueries:i}}const wdt={borderRadius:4};function PM(e,t){return t?oa(e,t,{clone:!1}):e}const y6={xs:0,sm:600,md:900,lg:1200,xl:1536},mbe={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${y6[e]}px)`},Sdt={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:y6[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Wf(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||mbe;return t.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const o=r.breakpoints||mbe;return Object.keys(t).reduce((s,a)=>{if(ydt(o.keys,a)){const l=bdt(r.containerQueries?r:Sdt,a);l&&(s[l]=n(t[a],a))}else if(Object.keys(o.values||y6).includes(a)){const l=o.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function _dt(e={}){return e.keys?.reduce((n,r)=>{const i=e.up(r);return n[i]={},n},{})||{}}function vbe(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Cdt(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((i,o)=>{o{e[i]!=null&&(n[i]=!0)}),n}function b6({values:e,breakpoints:t,base:n}){const r=n||Cdt(e,t),i=Object.keys(r);if(i.length===0)return e;let o;return i.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[o],o=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[o],o=a):s[a]=e,s),{})}function Ue(e){if(typeof e!="string")throw new Error(ov(7));return e.charAt(0).toUpperCase()+e.slice(1)}function i0(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function f5(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=i0(e,n)||r,t&&(i=t(i,r,e)),i}function ss(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=i0(l,r)||{};return Wf(s,a,f=>{let d=f5(c,i,f);return f===d&&typeof f=="string"&&(d=f5(c,i,`${t}${f==="default"?"":Ue(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[t],o}function Odt(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Edt={m:"margin",p:"padding"},Tdt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},ybe={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Pdt=Odt(e=>{if(e.length>2)if(ybe[e])e=ybe[e];else return[e];const[t,n]=e.split(""),r=Edt[t],i=Tdt[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Ose=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ese=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Ose,...Ese];function LI(e,t,n,r){const i=i0(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:typeof i=="string"?`calc(${o} * ${i})`:i*o:Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o),a=i[s];return o>=0?a:typeof a=="number"?-a:`-${a}`}:typeof i=="function"?i:()=>{}}function Tse(e){return LI(e,"spacing",8)}function FI(e,t){return typeof t=="string"||t==null?t:e(t)}function kdt(e,t){return n=>e.reduce((r,i)=>(r[i]=FI(t,n),r),{})}function Mdt(e,t,n,r){if(!t.includes(n))return null;const i=Pdt(n),o=kdt(i,r),s=e[n];return Wf(e,s,o)}function G3e(e,t){const n=Tse(e.theme);return Object.keys(e).map(r=>Mdt(e,t,r,n)).reduce(PM,{})}function Io(e){return G3e(e,Ose)}Io.propTypes={};Io.filterProps=Ose;function Do(e){return G3e(e,Ese)}Do.propTypes={};Do.filterProps=Ese;function q3e(e=8,t=Tse({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function x6(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?PM(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function pf(e){return typeof e!="number"?e:`${e}px solid`}function id(e,t){return ss({prop:e,themeKey:"borders",transform:t})}const Adt=id("border",pf),Rdt=id("borderTop",pf),Idt=id("borderRight",pf),Ddt=id("borderBottom",pf),Ldt=id("borderLeft",pf),Fdt=id("borderColor"),$dt=id("borderTopColor"),Ndt=id("borderRightColor"),zdt=id("borderBottomColor"),jdt=id("borderLeftColor"),Bdt=id("outline",pf),Udt=id("outlineColor"),w6=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=LI(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:FI(t,r)});return Wf(e,e.borderRadius,n)}return null};w6.propTypes={};w6.filterProps=["borderRadius"];x6(Adt,Rdt,Idt,Ddt,Ldt,Fdt,$dt,Ndt,zdt,jdt,w6,Bdt,Udt);const S6=e=>{if(e.gap!==void 0&&e.gap!==null){const t=LI(e.theme,"spacing",8),n=r=>({gap:FI(t,r)});return Wf(e,e.gap,n)}return null};S6.propTypes={};S6.filterProps=["gap"];const _6=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=LI(e.theme,"spacing",8),n=r=>({columnGap:FI(t,r)});return Wf(e,e.columnGap,n)}return null};_6.propTypes={};_6.filterProps=["columnGap"];const C6=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=LI(e.theme,"spacing",8),n=r=>({rowGap:FI(t,r)});return Wf(e,e.rowGap,n)}return null};C6.propTypes={};C6.filterProps=["rowGap"];const Vdt=ss({prop:"gridColumn"}),Wdt=ss({prop:"gridRow"}),Hdt=ss({prop:"gridAutoFlow"}),Gdt=ss({prop:"gridAutoColumns"}),qdt=ss({prop:"gridAutoRows"}),Xdt=ss({prop:"gridTemplateColumns"}),Ydt=ss({prop:"gridTemplateRows"}),Qdt=ss({prop:"gridTemplateAreas"}),Kdt=ss({prop:"gridArea"});x6(S6,_6,C6,Vdt,Wdt,Hdt,Gdt,qdt,Xdt,Ydt,Qdt,Kdt);function JC(e,t){return t==="grey"?t:e}const Zdt=ss({prop:"color",themeKey:"palette",transform:JC}),Jdt=ss({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:JC}),eht=ss({prop:"backgroundColor",themeKey:"palette",transform:JC});x6(Zdt,Jdt,eht);function yu(e){return e<=1&&e!==0?`${e*100}%`:e}const tht=ss({prop:"width",transform:yu}),Pse=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||y6[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:yu(n)}};return Wf(e,e.maxWidth,t)}return null};Pse.filterProps=["maxWidth"];const nht=ss({prop:"minWidth",transform:yu}),rht=ss({prop:"height",transform:yu}),iht=ss({prop:"maxHeight",transform:yu}),oht=ss({prop:"minHeight",transform:yu});ss({prop:"size",cssProperty:"width",transform:yu});ss({prop:"size",cssProperty:"height",transform:yu});const sht=ss({prop:"boxSizing"});x6(tht,Pse,nht,rht,iht,oht,sht);const $I={border:{themeKey:"borders",transform:pf},borderTop:{themeKey:"borders",transform:pf},borderRight:{themeKey:"borders",transform:pf},borderBottom:{themeKey:"borders",transform:pf},borderLeft:{themeKey:"borders",transform:pf},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:pf},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:w6},color:{themeKey:"palette",transform:JC},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:JC},backgroundColor:{themeKey:"palette",transform:JC},p:{style:Do},pt:{style:Do},pr:{style:Do},pb:{style:Do},pl:{style:Do},px:{style:Do},py:{style:Do},padding:{style:Do},paddingTop:{style:Do},paddingRight:{style:Do},paddingBottom:{style:Do},paddingLeft:{style:Do},paddingX:{style:Do},paddingY:{style:Do},paddingInline:{style:Do},paddingInlineStart:{style:Do},paddingInlineEnd:{style:Do},paddingBlock:{style:Do},paddingBlockStart:{style:Do},paddingBlockEnd:{style:Do},m:{style:Io},mt:{style:Io},mr:{style:Io},mb:{style:Io},ml:{style:Io},mx:{style:Io},my:{style:Io},margin:{style:Io},marginTop:{style:Io},marginRight:{style:Io},marginBottom:{style:Io},marginLeft:{style:Io},marginX:{style:Io},marginY:{style:Io},marginInline:{style:Io},marginInlineStart:{style:Io},marginInlineEnd:{style:Io},marginBlock:{style:Io},marginBlockStart:{style:Io},marginBlockEnd:{style:Io},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:S6},rowGap:{style:C6},columnGap:{style:_6},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:yu},maxWidth:{style:Pse},minWidth:{transform:yu},height:{transform:yu},maxHeight:{transform:yu},minHeight:{transform:yu},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function aht(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function lht(e,t){return typeof e=="function"?e(t):e}function cht(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=i0(i,c)||{};return f?f(s):Wf(s,r,p=>{let g=f5(d,u,p);return p===g&&typeof p=="string"&&(g=f5(d,u,`${n}${p==="default"?"":Ue(p)}`,p)),l===!1?g:{[l]:g}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const s=i.unstable_sxConfig??$I;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=_dt(i.breakpoints),f=Object.keys(u);let d=u;return Object.keys(c).forEach(h=>{const p=lht(c[h],i);if(p!=null)if(typeof p=="object")if(s[h])d=PM(d,e(h,p,i,s));else{const g=Wf({theme:i},p,m=>({[h]:m}));aht(g,p)?d[h]=t({sx:p,theme:i,nested:!0}):d=PM(d,g)}else d=PM(d,e(h,p,i,s))}),!o&&i.modularCssLayers?{"@layer sx":gbe(i,vbe(f,d))}:gbe(i,vbe(f,d))}return Array.isArray(r)?r.map(a):a(r)}return t}const N0=cht();N0.filterProps=["sx"];function uht(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function kse(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=e,a=vdt(n),l=q3e(i);let c=oa({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...wdt,...o}},s);return c=xdt(c),c.applyStyles=uht,c=t.reduce((u,f)=>oa(u,f),c),c.unstable_sxConfig={...$I,...s?.unstable_sxConfig},c.unstable_sx=function(f){return N0({sx:f,theme:this})},c}function fht(e){return Object.keys(e).length===0}function O6(e=null){const t=M.useContext(DI);return!t||fht(t)?e:t}const dht=kse();function qw(e=dht){return O6(e)}function NG(e){const t=w0(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function X3e({styles:e,themeId:t,defaultTheme:n={}}){const r=qw(n),i=t&&r[t]||r;let o=typeof e=="function"?e(i):e;return i.modularCssLayers&&(Array.isArray(o)?o=o.map(s=>NG(typeof s=="function"?s(i):s)):o=NG(o)),O.jsx(U3e,{styles:o})}const hht=e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??$I;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function Mse(e){const{sx:t,...n}=e,{systemProps:r,otherProps:i}=hht(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...s)=>{const a=t(...s);return fp(a)?{...r,...a}:r}:o={...r,...t},{...i,sx:o}}const bbe=e=>e,pht=()=>{let e=bbe;return{configure(t){e=t},generate(t){return e(t)},reset(){e=bbe}}},Y3e=pht();function Q3e(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(N0);return M.forwardRef(function(l,c){const u=qw(n),{className:f,component:d="div",...h}=Mse(l);return O.jsx(o,{as:d,ref:c,className:Re(f,i?i(r):r),theme:t&&u[t]||u,...h})})}const mht={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function pt(e,t,n="Mui"){const r=mht[t];return r?`${n}-${r}`:`${Y3e.generate(e)}-${t}`}function dt(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=pt(e,i,n)}),r}function K3e(e){const{variants:t,...n}=e,r={variants:t,style:w0(n),isProcessed:!0};return r.style===n||t&&t.forEach(i=>{typeof i.style!="function"&&(i.style=w0(i.style))}),r}const vht=kse();function rz(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function t1(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function yht(e){return e?(t,n)=>n[e]:null}function bht(e,t,n){e.theme=wht(e.theme)?n:e.theme[t]||e.theme}function iz(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(i=>iz(e,i,n));if(Array.isArray(r?.variants)){let i;if(r.isProcessed)i=n?t1(r.style,n):r.style;else{const{variants:o,...s}=r;i=n?t1(w0(s),n):s}return Z3e(e,r.variants,[i],n)}return r?.isProcessed?n?t1(w0(r.style),n):r.style:n?t1(w0(r),n):r}function Z3e(e,t,n=[],r=void 0){let i;e:for(let o=0;o{hdt(a,_=>_.filter(E=>E!==N0));const{name:c,slot:u,skipVariantsResolver:f,skipSx:d,overridesResolver:h=yht(_ht(u)),...p}=l,g=c&&c.startsWith("Mui")||u?"components":"custom",m=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,v=d||!1;let y=rz;u==="Root"||u==="root"?y=r:u?y=i:Sht(a)&&(y=void 0);const b=V3e(a,{shouldForwardProp:y,label:xht(),...p}),w=_=>{if(_.__emotion_real===_)return _;if(typeof _=="function")return function(T){return iz(T,_,T.theme.modularCssLayers?g:void 0)};if(fp(_)){const E=K3e(_);return function(k){return E.variants?iz(k,E,k.theme.modularCssLayers?g:void 0):k.theme.modularCssLayers?t1(E.style,g):E.style}}return _},S=(..._)=>{const E=[],T=_.map(w),k=[];if(E.push(o),c&&h&&k.push(function(F){const L=F.theme.components?.[c]?.styleOverrides;if(!L)return null;const $={};for(const j in L)$[j]=iz(F,L[j],F.theme.modularCssLayers?"theme":void 0);return h(F,$)}),c&&!m&&k.push(function(F){const L=F.theme?.components?.[c]?.variants;return L?Z3e(F,L,[],F.theme.modularCssLayers?"theme":void 0):null}),v||k.push(N0),Array.isArray(T[0])){const R=T.shift(),F=new Array(E.length).fill(""),A=new Array(k.length).fill("");let L;L=[...F,...R,...A],L.raw=[...F,...R.raw,...A],E.unshift(L)}const P=[...E,...T,...k],I=b(...P);return a.muiName&&(I.muiName=a.muiName),I};return b.withConfig&&(S.withConfig=b.withConfig),S}}function xht(e,t){return void 0}function wht(e){for(const t in e)return!1;return!0}function Sht(e){return typeof e=="string"&&e.charCodeAt(0)>96}function _ht(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const Qn=J3e();function X1(e,t){const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=r;if(i==="components"||i==="slots")n[i]={...e[i],...n[i]};else if(i==="componentsProps"||i==="slotProps"){const o=e[i],s=t[i];if(!s)n[i]=o||{};else if(!o)n[i]=s;else{n[i]={...s};for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const l=a;n[i][l]=X1(o[l],s[l])}}}else n[i]===void 0&&(n[i]=e[i])}return n}function Ase(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:X1(t.components[n].defaultProps,r)}function Cht({props:e,name:t,defaultTheme:n,themeId:r}){let i=qw(n);return i=i[r]||i,Ase({theme:i,name:t,props:e})}const lr=typeof window<"u"?M.useLayoutEffect:M.useEffect;function Oht(e,t,n,r,i){const[o,s]=M.useState(()=>i&&n?n(e).matches:r?r(e).matches:t);return lr(()=>{if(!n)return;const a=n(e),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[e,n]),o}const Eht={...c5},eze=Eht.useSyncExternalStore;function Tht(e,t,n,r,i){const o=M.useCallback(()=>t,[t]),s=M.useMemo(()=>{if(i&&n)return()=>n(e).matches;if(r!==null){const{matches:u}=r(e);return()=>u}return o},[o,e,r,i,n]),[a,l]=M.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(e);return[()=>u.matches,f=>(u.addEventListener("change",f),()=>{u.removeEventListener("change",f)})]},[o,n,e]);return eze(l,a,s)}function tze(e={}){const{themeId:t}=e;return function(r,i={}){let o=O6();o&&t&&(o=o[t]||o);const s=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:a=!1,matchMedia:l=s?window.matchMedia:null,ssrMatchMedia:c=null,noSsr:u=!1}=Ase({name:"MuiUseMediaQuery",props:i,theme:o});let f=typeof r=="function"?r(o):r;return f=f.replace(/^@media( ?)/m,""),f.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(` +`)),(eze!==void 0?Tht:Oht)(f,a,l,c,u)}}tze();function lC(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Rse(e,t=0,n=1){return lC(e,t,n)}function Pht(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Kp(e){if(e.type)return e;if(e.charAt(0)==="#")return Kp(Pht(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(ov(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(ov(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const kht=e=>{const t=Kp(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},F2=(e,t)=>{try{return kht(e)}catch{return e}};function NI(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function nze(e){e=Kp(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),NI({type:a,values:l})}function YJ(e){e=Kp(e);let t=e.type==="hsl"||e.type==="hsla"?Kp(nze(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Mht(e,t){const n=YJ(e),r=YJ(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Vt(e,t){return e=Kp(e),t=Rse(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,NI(e)}function t$(e,t,n){try{return Vt(e,t)}catch{return e}}function fh(e,t){if(e=Kp(e),t=Rse(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return NI(e)}function Li(e,t,n){try{return fh(e,t)}catch{return e}}function dh(e,t){if(e=Kp(e),t=Rse(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return NI(e)}function Fi(e,t,n){try{return dh(e,t)}catch{return e}}function rze(e,t=.15){return YJ(e)>.5?fh(e,t):dh(e,t)}function n$(e,t,n){try{return rze(e,t)}catch{return e}}const ize=le.oneOfType([le.func,le.object]);function QJ(...e){return e.reduce((t,n)=>n==null?t:function(...i){t.apply(this,i),n.apply(this,i)},()=>{})}function zI(e,t=166){let n;function r(...i){const o=()=>{e.apply(this,i)};clearTimeout(n),n=setTimeout(o,t)}return r.clear=()=>{clearTimeout(n)},r}function oz(e,t){return M.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}function ci(e){return e&&e.ownerDocument||document}function Lc(e){return ci(e).defaultView||window}function KJ(e,t){typeof e=="function"?e(t):e&&(e.current=t)}let xbe=0;function Aht(e){const[t,n]=M.useState(e),r=e||t;return M.useEffect(()=>{t==null&&(xbe+=1,n(`mui-${xbe}`))},[t]),r}const Rht={...c5},wbe=Rht.useId;function fr(e){if(wbe!==void 0){const t=wbe();return e??t}return Aht(e)}function Da({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=M.useRef(e!==void 0),[o,s]=M.useState(t),a=i?e:o,l=M.useCallback(c=>{i||s(c)},[]);return[a,l]}function ft(e){const t=M.useRef(e);return lr(()=>{t.current=e}),M.useRef((...n)=>(0,t.current)(...n)).current}function zn(...e){const t=M.useRef(void 0),n=M.useCallback(r=>{const i=e.map(o=>{if(o==null)return null;if(typeof o=="function"){const s=o,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return o.current=r,()=>{o.current=null}});return()=>{i.forEach(o=>o?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Sbe={};function od(e,t){const n=M.useRef(Sbe);return n.current===Sbe&&(n.current=e(t)),n}const Iht=[];function Ise(e){M.useEffect(e,Iht)}class E6{static create(){return new E6}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function zl(){const e=od(E6.create).current;return Ise(e.disposeEffect),e}function z0(e){try{return e.matches(":focus-visible")}catch{}return!1}function oze(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}const Dse=e=>{const t=M.useRef({});return M.useEffect(()=>{t.current=e}),t.current};function Dht(e){return M.Children.toArray(e).filter(t=>M.isValidElement(t))}const sze={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function Xe(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let s="",a=!0;for(let l=0;lr.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function _be(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function lze(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const h=Re(n?.className,o,i?.className,r?.className),p={...n?.style,...i?.style,...r?.style},g={...n,...i,...r};return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const s=w1({...i,...r}),a=_be(r),l=_be(i),c=t(s),u=Re(c?.className,n?.className,o,i?.className,r?.className),f={...c?.style,...n?.style,...i?.style,...r?.style},d={...c,...n,...l,...a};return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}function SA(e,t,n){return typeof e=="function"?e(t,n):e}function Xn(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=e,s=i?{}:SA(n,r),{props:a,internalRef:l}=lze({...o,externalSlotProps:s}),c=zn(l,s?.ref,e.additionalProps?.ref);return aze(t,{...a,ref:c},r)}function mb(e){return parseInt(M.version,10)>=19?e?.props?.ref||null:e?.ref||null}const cze=M.createContext(null);function T6(){return M.useContext(cze)}const Fht=typeof Symbol=="function"&&Symbol.for,uze=Fht?Symbol.for("mui.nested"):"__THEME_NESTED__";function $ht(e,t){return typeof t=="function"?t(e):{...e,...t}}function Nht(e){const{children:t,theme:n}=e,r=T6(),i=M.useMemo(()=>{const o=r===null?{...n}:$ht(r,n);return o!=null&&(o[uze]=r!==null),o},[n,r]);return O.jsx(cze.Provider,{value:i,children:t})}const fze=M.createContext();function zht({value:e,...t}){return O.jsx(fze.Provider,{value:e??!0,...t})}const yi=()=>M.useContext(fze)??!1,dze=M.createContext(void 0);function jht({value:e,children:t}){return O.jsx(dze.Provider,{value:e,children:t})}function Bht(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?X1(i.defaultProps,r):!i.styleOverrides&&!i.variants?X1(i,r):r}function Uht({props:e,name:t}){const n=M.useContext(dze);return Bht({props:e,name:t,theme:{components:n}})}function Vht(e){const t=O6(),n=fr()||"",{modularCssLayers:r}=e;let i="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!r||t!==null?i="":typeof r=="string"?i=r.replace(/mui(?!\.)/g,i):i=`@layer ${i};`,lr(()=>{const o=document.querySelector("head");if(!o)return;const s=o.firstChild;if(i){if(s&&s.hasAttribute?.("data-mui-layer-order")&&s.getAttribute("data-mui-layer-order")===n)return;const a=document.createElement("style");a.setAttribute("data-mui-layer-order",n),a.textContent=i,o.prepend(a)}else o.querySelector(`style[data-mui-layer-order="${n}"]`)?.remove()},[i,n]),i?O.jsx(X3e,{styles:i}):null}const Cbe={};function Obe(e,t,n,r=!1){return M.useMemo(()=>{const i=e&&t[e]||t;if(typeof n=="function"){const o=n(i),s=e?{...t,[e]:o}:o;return r?()=>s:s}return e?{...t,[e]:n}:{...t,...n}},[e,t,n,r])}function hze(e){const{children:t,theme:n,themeId:r}=e,i=O6(Cbe),o=T6()||Cbe,s=Obe(r,i,n),a=Obe(r,o,n,!0),l=(r?s[r]:s).direction==="rtl",c=Vht(s);return O.jsx(Nht,{theme:a,children:O.jsx(DI.Provider,{value:s,children:O.jsx(zht,{value:l,children:O.jsxs(jht,{value:r?s[r].components:s.components,children:[c,t]})})})})}const Ebe={theme:void 0};function Wht(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(Ebe.theme=i.theme,o=K3e(e(Ebe)),t=o,n=i.theme),o}}const Lse="mode",Fse="color-scheme",Hht="data-color-scheme";function Ght(e){const{defaultMode:t="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:i=Lse,colorSchemeStorageKey:o=Fse,attribute:s=Hht,colorSchemeNode:a="document.documentElement",nonce:l}=e||{};let c="",u=s;if(s==="class"&&(u=".%s"),s==="data"&&(u="[data-%s]"),u.startsWith(".")){const d=u.substring(1);c+=`${a}.classList.remove('${d}'.replace('%s', light), '${d}'.replace('%s', dark)); ${a}.classList.add('${d}'.replace('%s', colorScheme));`}const f=u.match(/\[([^\]]+)\]/);if(f){const[d,h]=f[1].split("=");h||(c+=`${a}.removeAttribute('${d}'.replace('%s', light)); ${a}.removeAttribute('${d}'.replace('%s', dark));`),c+=` ${a}.setAttribute('${d}'.replace('%s', colorScheme), ${h?`${h}.replace('%s', colorScheme)`:'""'});`}else c+=`${a}.setAttribute('${u}', colorScheme);`;return O.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(function() { @@ -56,14 +56,14 @@ try { if (colorScheme) { ${c} } -} catch(e){}})();`}},"mui-color-scheme-init")}function cmt(){}const umt=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(n){if(typeof window>"u")return;if(!t)return n;let r;try{r=t.localStorage.getItem(e)}catch{}return r||n},set:n=>{if(t)try{t.localStorage.setItem(e,n)}catch{}},subscribe:n=>{if(!t)return cmt;const r=i=>{const o=i.newValue;i.key===e&&n(o)};return t.addEventListener("storage",r),()=>{t.removeEventListener("storage",r)}}});function c9(){}function Ixe(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function yje(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function fmt(e){return yje(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function dmt(e){const{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:o=Wae,colorSchemeStorageKey:s=Hae,storageWindow:a=typeof window>"u"?void 0:window,storageManager:l=umt,noSsr:c=!1}=e,u=i.join(","),f=i.length>1,d=M.useMemo(()=>l?.({key:o,storageWindow:a}),[l,o,a]),h=M.useMemo(()=>l?.({key:`${s}-light`,storageWindow:a}),[l,s,a]),p=M.useMemo(()=>l?.({key:`${s}-dark`,storageWindow:a}),[l,s,a]),[g,m]=M.useState(()=>{const T=d?.get(t)||t,k=h?.get(n)||n,P=p?.get(r)||r;return{mode:T,systemMode:Ixe(T),lightColorScheme:k,darkColorScheme:P}}),[v,y]=M.useState(c||!f);M.useEffect(()=>{y(!0)},[]);const b=fmt(g),w=M.useCallback(T=>{m(k=>{if(T===k.mode)return k;const P=T??t;return d?.set(P),{...k,mode:P,systemMode:Ixe(P)}})},[d,t]),S=M.useCallback(T=>{T?typeof T=="string"?T&&!u.includes(T)?console.error(`\`${T}\` does not exist in \`theme.colorSchemes\`.`):m(k=>{const P={...k};return yje(k,R=>{R==="light"&&(h?.set(T),P.lightColorScheme=T),R==="dark"&&(p?.set(T),P.darkColorScheme=T)}),P}):m(k=>{const P={...k},R=T.light===null?n:T.light,I=T.dark===null?r:T.dark;return R&&(u.includes(R)?(P.lightColorScheme=R,h?.set(R)):console.error(`\`${R}\` does not exist in \`theme.colorSchemes\`.`)),I&&(u.includes(I)?(P.darkColorScheme=I,p?.set(I)):console.error(`\`${I}\` does not exist in \`theme.colorSchemes\`.`)),P}):m(k=>(h?.set(n),p?.set(r),{...k,lightColorScheme:n,darkColorScheme:r}))},[u,h,p,n,r]),_=M.useCallback(T=>{g.mode==="system"&&m(k=>{const P=T?.matches?"dark":"light";return k.systemMode===P?k:{...k,systemMode:P}})},[g.mode]),E=M.useRef(_);return E.current=_,M.useEffect(()=>{if(typeof window.matchMedia!="function"||!f)return;const T=(...P)=>E.current(...P),k=window.matchMedia("(prefers-color-scheme: dark)");return k.addListener(T),T(k),()=>{k.removeListener(T)}},[f]),M.useEffect(()=>{if(f){const T=d?.subscribe(R=>{(!R||["light","dark","system"].includes(R))&&w(R||t)})||c9,k=h?.subscribe(R=>{(!R||u.match(R))&&S({light:R})})||c9,P=p?.subscribe(R=>{(!R||u.match(R))&&S({dark:R})})||c9;return()=>{T(),k(),P()}}},[S,w,u,t,a,f,d,h,p]),{...g,mode:v?g.mode:void 0,systemMode:v?g.systemMode:void 0,colorScheme:v?b:void 0,setMode:w,setColorScheme:S}}const hmt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function pmt(e){const{themeId:t,theme:n={},modeStorageKey:r=Wae,colorSchemeStorageKey:i=Hae,disableTransitionOnChange:o=!1,defaultColorScheme:s,resolveTheme:a}=e,l={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},c=M.createContext(void 0),u=()=>M.useContext(c)||l,f={},d={};function h(v){const{children:y,theme:b,modeStorageKey:w=r,colorSchemeStorageKey:S=i,disableTransitionOnChange:_=o,storageManager:E,storageWindow:T=typeof window>"u"?void 0:window,documentNode:k=typeof document>"u"?void 0:document,colorSchemeNode:P=typeof document>"u"?void 0:document.documentElement,disableNestedContext:R=!1,disableStyleSheetGeneration:I=!1,defaultMode:F="system",noSsr:A}=v,L=M.useRef(!1),$=Y6(),j=M.useContext(c),V=!!j&&!R,U=M.useMemo(()=>b||(typeof n=="function"?n():n),[b]),z=U[t],N=z||U,{colorSchemes:B=f,components:H=d,cssVarPrefix:Q}=N,Y=Object.keys(B).filter(Se=>!!B[Se]).join(","),Z=M.useMemo(()=>Y.split(","),[Y]),pe=typeof s=="string"?s:s.light,ie=typeof s=="string"?s:s.dark,ne=B[pe]&&B[ie]?F:B[N.defaultColorScheme]?.palette?.mode||N.palette?.mode,{mode:fe,setMode:me,systemMode:se,lightColorScheme:ue,darkColorScheme:G,colorScheme:ce,setColorScheme:he}=dmt({supportedColorSchemes:Z,defaultLightColorScheme:pe,defaultDarkColorScheme:ie,modeStorageKey:w,colorSchemeStorageKey:S,defaultMode:ne,storageManager:E,storageWindow:T,noSsr:A});let J=fe,te=ce;V&&(J=j.mode,te=j.colorScheme);const ae=M.useMemo(()=>{const Se=te||N.defaultColorScheme,ye=N.generateThemeVars?.()||N.vars,be={...N,components:H,colorSchemes:B,cssVarPrefix:Q,vars:ye};if(typeof be.generateSpacing=="function"&&(be.spacing=be.generateSpacing()),Se){const ge=B[Se];ge&&typeof ge=="object"&&Object.keys(ge).forEach(xe=>{ge[xe]&&typeof ge[xe]=="object"?be[xe]={...be[xe],...ge[xe]}:be[xe]=ge[xe]})}return a?a(be):be},[N,te,H,B,Q]),we=N.colorSchemeSelector;ar(()=>{if(te&&P&&we&&we!=="media"){const Se=we;let ye=we;if(Se==="class"&&(ye=".%s"),Se==="data"&&(ye="[data-%s]"),Se?.startsWith("data-")&&!Se.includes("%s")&&(ye=`[${Se}="%s"]`),ye.startsWith("."))P.classList.remove(...Z.map(be=>ye.substring(1).replace("%s",be))),P.classList.add(ye.substring(1).replace("%s",te));else{const be=ye.replace("%s",te).match(/\[([^\]]+)\]/);if(be){const[ge,xe]=be[1].split("=");xe||Z.forEach(re=>{P.removeAttribute(ge.replace(te,re))}),P.setAttribute(ge,xe?xe.replace(/"|'/g,""):"")}else P.setAttribute(ye,te)}}},[te,we,P,Z]),M.useEffect(()=>{let Se;if(_&&L.current&&k){const ye=k.createElement("style");ye.appendChild(k.createTextNode(hmt)),k.head.appendChild(ye),window.getComputedStyle(k.body),Se=setTimeout(()=>{k.head.removeChild(ye)},1)}return()=>{clearTimeout(Se)}},[te,_,k]),M.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);const Pe=M.useMemo(()=>({allColorSchemes:Z,colorScheme:te,darkColorScheme:G,lightColorScheme:ue,mode:J,setColorScheme:he,setMode:me,systemMode:se}),[Z,te,G,ue,J,he,me,se,ae.colorSchemeSelector]);let ee=!0;(I||N.cssVariables===!1||V&&$?.cssVarPrefix===Q)&&(ee=!1);const oe=O.jsxs(M.Fragment,{children:[O.jsx(vje,{themeId:z?t:void 0,theme:ae,children:y}),ee&&O.jsx(G5e,{styles:ae.generateStyleSheets?.()||[]})]});return V?oe:O.jsx(c.Provider,{value:Pe,children:oe})}const p=typeof s=="string"?s:s.light,g=typeof s=="string"?s:s.dark;return{CssVarsProvider:h,useColorScheme:u,getInitColorSchemeScript:v=>lmt({colorSchemeStorageKey:i,defaultLightColorScheme:p,defaultDarkColorScheme:g,modeStorageKey:r,...v})}}function gmt(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const Dxe=(e,t,n,r=[])=>{let i=e;t.forEach((o,s)=>{s===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},mmt=(e,t,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):t([...o,a],l,s))})}r(e)},vmt=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function u9(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},s={};return mmt(e,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=vmt(a,l);Object.assign(i,{[u]:f}),Dxe(o,a,`var(${u})`,c),Dxe(s,a,`var(${u}, ${f})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function ymt(e,t={}){const{getSelector:n=m,disableCssColorScheme:r,colorSchemeSelector:i}=t,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=e,{vars:c,css:u,varsWithDefaults:f}=u9(l,t);let d=f;const h={},{[a]:p,...g}=o;if(Object.entries(g||{}).forEach(([b,w])=>{const{vars:S,css:_,varsWithDefaults:E}=u9(w,t);d=ia(d,E),h[b]={css:_,vars:S}}),p){const{css:b,vars:w,varsWithDefaults:S}=u9(p,t);d=ia(d,S),h[a]={css:b,vars:w}}function m(b,w){let S=i;if(i==="class"&&(S=".%s"),i==="data"&&(S="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(S=`[${i}="%s"]`),b){if(S==="media")return e.defaultColorScheme===b?":root":{[`@media (prefers-color-scheme: ${o[b]?.palette?.mode||b})`]:{":root":w}};if(S)return e.defaultColorScheme===b?`:root, ${S.replace("%s",String(b))}`:S.replace("%s",String(b))}return":root"}return{vars:d,generateThemeVars:()=>{let b={...c};return Object.entries(h).forEach(([,{vars:w}])=>{b=ia(b,w)}),b},generateStyleSheets:()=>{const b=[],w=e.defaultColorScheme||"light";function S(T,k){Object.keys(k).length&&b.push(typeof T=="string"?{[T]:{...k}}:T)}S(n(void 0,{...u}),u);const{[w]:_,...E}=h;if(_){const{css:T}=_,k=o[w]?.palette?.mode,P=!r&&k?{colorScheme:k,...T}:{...T};S(n(w,{...P}),P)}return Object.entries(E).forEach(([T,{css:k}])=>{const P=o[T]?.palette?.mode,R=!r&&P?{colorScheme:P,...k}:{...k};S(n(T,{...R}),R)}),b}}}function bmt(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function bje(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:kA.white,default:kA.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const xmt=bje();function xje(){return{text:{primary:kA.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:kA.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Lxe=xje();function Fxe(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=hh(e.main,i):t==="dark"&&(e.dark=dh(e.main,o)))}function wmt(e="light"){return e==="dark"?{main:Uy[200],light:Uy[50],dark:Uy[400]}:{main:Uy[700],light:Uy[400],dark:Uy[800]}}function Smt(e="light"){return e==="dark"?{main:By[200],light:By[50],dark:By[400]}:{main:By[500],light:By[300],dark:By[700]}}function _mt(e="light"){return e==="dark"?{main:jy[500],light:jy[300],dark:jy[700]}:{main:jy[700],light:jy[400],dark:jy[800]}}function Cmt(e="light"){return e==="dark"?{main:Vy[400],light:Vy[300],dark:Vy[700]}:{main:Vy[700],light:Vy[500],dark:Vy[900]}}function Omt(e="light"){return e==="dark"?{main:bm[400],light:bm[300],dark:bm[700]}:{main:bm[800],light:bm[500],dark:bm[900]}}function Emt(e="light"){return e==="dark"?{main:Zx[400],light:Zx[300],dark:Zx[700]}:{main:"#ed6c02",light:Zx[500],dark:Zx[900]}}function Gae(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=e,o=e.primary||wmt(t),s=e.secondary||Smt(t),a=e.error||_mt(t),l=e.info||Cmt(t),c=e.success||Omt(t),u=e.warning||Emt(t);function f(g){return Ggt(g,Lxe.text.primary)>=n?Lxe.text.primary:xmt.text.primary}const d=({color:g,name:m,mainShade:v=500,lightShade:y=300,darkShade:b=700})=>{if(g={...g},!g.main&&g[v]&&(g.main=g[v]),!g.hasOwnProperty("main"))throw new Error(cv(11,m?` (${m})`:"",v));if(typeof g.main!="string")throw new Error(cv(12,m?` (${m})`:"",JSON.stringify(g.main)));return Fxe(g,"light",y,r),Fxe(g,"dark",b,r),g.contrastText||(g.contrastText=f(g.main)),g};let h;return t==="light"?h=bje():t==="dark"&&(h=xje()),ia({common:{...kA},mode:t,primary:d({color:o,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:a,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:M5e,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r,...h},i)}function Tmt(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function Pmt(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function kmt(e){return Math.round(e*1e5)/1e5}const $xe={textTransform:"uppercase"},Nxe='"Roboto", "Helvetica", "Arial", sans-serif';function wje(e,t){const{fontFamily:n=Nxe,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...f}=typeof t=="function"?t(e):t,d=r/14,h=u||(m=>`${m/l*d}rem`),p=(m,v,y,b,w)=>({fontFamily:n,fontWeight:m,fontSize:h(v),lineHeight:y,...n===Nxe?{letterSpacing:`${kmt(b/v)}em`}:{},...w,...c}),g={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(o,48,1.167,0),h4:p(o,34,1.235,.25),h5:p(o,24,1.334,0),h6:p(s,20,1.6,.15),subtitle1:p(o,16,1.75,.15),subtitle2:p(s,14,1.57,.1),body1:p(o,16,1.5,.15),body2:p(o,14,1.43,.15),button:p(s,14,1.75,.4,$xe),caption:p(o,12,1.66,.4),overline:p(o,12,2.66,1,$xe),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ia({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...g},f,{clone:!1})}const Mmt=.2,Amt=.14,Rmt=.12;function mo(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Mmt})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Amt})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Rmt})`].join(",")}const Imt=["none",mo(0,2,1,-1,0,1,1,0,0,1,3,0),mo(0,3,1,-2,0,2,2,0,0,1,5,0),mo(0,3,3,-2,0,3,4,0,0,1,8,0),mo(0,2,4,-1,0,4,5,0,0,1,10,0),mo(0,3,5,-1,0,5,8,0,0,1,14,0),mo(0,3,5,-1,0,6,10,0,0,1,18,0),mo(0,4,5,-2,0,7,10,1,0,2,16,1),mo(0,5,5,-3,0,8,10,1,0,3,14,2),mo(0,5,6,-3,0,9,12,1,0,3,16,2),mo(0,6,6,-3,0,10,14,1,0,4,18,3),mo(0,6,7,-4,0,11,15,1,0,4,20,3),mo(0,7,8,-4,0,12,17,2,0,5,22,4),mo(0,7,8,-4,0,13,19,2,0,5,24,4),mo(0,7,9,-4,0,14,21,2,0,5,26,4),mo(0,8,9,-5,0,15,22,2,0,6,28,5),mo(0,8,10,-5,0,16,24,2,0,6,30,5),mo(0,8,11,-5,0,17,26,2,0,6,32,5),mo(0,9,11,-5,0,18,28,2,0,7,34,6),mo(0,9,12,-6,0,19,29,2,0,7,36,6),mo(0,10,13,-6,0,20,31,3,0,8,38,7),mo(0,10,13,-6,0,21,33,3,0,8,40,7),mo(0,10,14,-6,0,22,35,3,0,8,42,7),mo(0,11,14,-7,0,23,36,3,0,9,44,8),mo(0,11,15,-7,0,24,38,3,0,9,46,8)],Dmt={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Sje={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function zxe(e){return`${Math.round(e)}ms`}function Lmt(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Fmt(e){const t={...Dmt,...e.easing},n={...Sje,...e.duration};return{getAutoHeightDuration:Lmt,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=o;return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:zxe(s)} ${a} ${typeof l=="string"?l:zxe(l)}`).join(",")},...e,easing:t,duration:n}}const $mt={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Nmt(e){return dp(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function _je(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let o=0;o(!t&&typeof window<"u"&&(t=window),{get(n){if(typeof window>"u")return;if(!t)return n;let r;try{r=t.localStorage.getItem(e)}catch{}return r||n},set:n=>{if(t)try{t.localStorage.setItem(e,n)}catch{}},subscribe:n=>{if(!t)return qht;const r=i=>{const o=i.newValue;i.key===e&&n(o)};return t.addEventListener("storage",r),()=>{t.removeEventListener("storage",r)}}});function zG(){}function Tbe(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function pze(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function Yht(e){return pze(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function Qht(e){const{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:o=Lse,colorSchemeStorageKey:s=Fse,storageWindow:a=typeof window>"u"?void 0:window,storageManager:l=Xht,noSsr:c=!1}=e,u=i.join(","),f=i.length>1,d=M.useMemo(()=>l?.({key:o,storageWindow:a}),[l,o,a]),h=M.useMemo(()=>l?.({key:`${s}-light`,storageWindow:a}),[l,s,a]),p=M.useMemo(()=>l?.({key:`${s}-dark`,storageWindow:a}),[l,s,a]),[g,m]=M.useState(()=>{const T=d?.get(t)||t,k=h?.get(n)||n,P=p?.get(r)||r;return{mode:T,systemMode:Tbe(T),lightColorScheme:k,darkColorScheme:P}}),[v,y]=M.useState(c||!f);M.useEffect(()=>{y(!0)},[]);const b=Yht(g),w=M.useCallback(T=>{m(k=>{if(T===k.mode)return k;const P=T??t;return d?.set(P),{...k,mode:P,systemMode:Tbe(P)}})},[d,t]),S=M.useCallback(T=>{T?typeof T=="string"?T&&!u.includes(T)?console.error(`\`${T}\` does not exist in \`theme.colorSchemes\`.`):m(k=>{const P={...k};return pze(k,I=>{I==="light"&&(h?.set(T),P.lightColorScheme=T),I==="dark"&&(p?.set(T),P.darkColorScheme=T)}),P}):m(k=>{const P={...k},I=T.light===null?n:T.light,R=T.dark===null?r:T.dark;return I&&(u.includes(I)?(P.lightColorScheme=I,h?.set(I)):console.error(`\`${I}\` does not exist in \`theme.colorSchemes\`.`)),R&&(u.includes(R)?(P.darkColorScheme=R,p?.set(R)):console.error(`\`${R}\` does not exist in \`theme.colorSchemes\`.`)),P}):m(k=>(h?.set(n),p?.set(r),{...k,lightColorScheme:n,darkColorScheme:r}))},[u,h,p,n,r]),_=M.useCallback(T=>{g.mode==="system"&&m(k=>{const P=T?.matches?"dark":"light";return k.systemMode===P?k:{...k,systemMode:P}})},[g.mode]),E=M.useRef(_);return E.current=_,M.useEffect(()=>{if(typeof window.matchMedia!="function"||!f)return;const T=(...P)=>E.current(...P),k=window.matchMedia("(prefers-color-scheme: dark)");return k.addListener(T),T(k),()=>{k.removeListener(T)}},[f]),M.useEffect(()=>{if(f){const T=d?.subscribe(I=>{(!I||["light","dark","system"].includes(I))&&w(I||t)})||zG,k=h?.subscribe(I=>{(!I||u.match(I))&&S({light:I})})||zG,P=p?.subscribe(I=>{(!I||u.match(I))&&S({dark:I})})||zG;return()=>{T(),k(),P()}}},[S,w,u,t,a,f,d,h,p]),{...g,mode:v?g.mode:void 0,systemMode:v?g.systemMode:void 0,colorScheme:v?b:void 0,setMode:w,setColorScheme:S}}const Kht="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Zht(e){const{themeId:t,theme:n={},modeStorageKey:r=Lse,colorSchemeStorageKey:i=Fse,disableTransitionOnChange:o=!1,defaultColorScheme:s,resolveTheme:a}=e,l={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},c=M.createContext(void 0),u=()=>M.useContext(c)||l,f={},d={};function h(v){const{children:y,theme:b,modeStorageKey:w=r,colorSchemeStorageKey:S=i,disableTransitionOnChange:_=o,storageManager:E,storageWindow:T=typeof window>"u"?void 0:window,documentNode:k=typeof document>"u"?void 0:document,colorSchemeNode:P=typeof document>"u"?void 0:document.documentElement,disableNestedContext:I=!1,disableStyleSheetGeneration:R=!1,defaultMode:F="system",noSsr:A}=v,L=M.useRef(!1),$=T6(),j=M.useContext(c),V=!!j&&!I,U=M.useMemo(()=>b||(typeof n=="function"?n():n),[b]),z=U[t],N=z||U,{colorSchemes:B=f,components:H=d,cssVarPrefix:Q}=N,Y=Object.keys(B).filter(Se=>!!B[Se]).join(","),Z=M.useMemo(()=>Y.split(","),[Y]),ge=typeof s=="string"?s:s.light,ne=typeof s=="string"?s:s.dark,ie=B[ge]&&B[ne]?F:B[N.defaultColorScheme]?.palette?.mode||N.palette?.mode,{mode:fe,setMode:ve,systemMode:se,lightColorScheme:ue,darkColorScheme:G,colorScheme:ce,setColorScheme:pe}=Qht({supportedColorSchemes:Z,defaultLightColorScheme:ge,defaultDarkColorScheme:ne,modeStorageKey:w,colorSchemeStorageKey:S,defaultMode:ie,storageManager:E,storageWindow:T,noSsr:A});let J=fe,te=ce;V&&(J=j.mode,te=j.colorScheme);const ae=M.useMemo(()=>{const Se=te||N.defaultColorScheme,he=N.generateThemeVars?.()||N.vars,xe={...N,components:H,colorSchemes:B,cssVarPrefix:Q,vars:he};if(typeof xe.generateSpacing=="function"&&(xe.spacing=xe.generateSpacing()),Se){const me=B[Se];me&&typeof me=="object"&&Object.keys(me).forEach(be=>{me[be]&&typeof me[be]=="object"?xe[be]={...xe[be],...me[be]}:xe[be]=me[be]})}return a?a(xe):xe},[N,te,H,B,Q]),we=N.colorSchemeSelector;lr(()=>{if(te&&P&&we&&we!=="media"){const Se=we;let he=we;if(Se==="class"&&(he=".%s"),Se==="data"&&(he="[data-%s]"),Se?.startsWith("data-")&&!Se.includes("%s")&&(he=`[${Se}="%s"]`),he.startsWith("."))P.classList.remove(...Z.map(xe=>he.substring(1).replace("%s",xe))),P.classList.add(he.substring(1).replace("%s",te));else{const xe=he.replace("%s",te).match(/\[([^\]]+)\]/);if(xe){const[me,be]=xe[1].split("=");be||Z.forEach(oe=>{P.removeAttribute(me.replace(te,oe))}),P.setAttribute(me,be?be.replace(/"|'/g,""):"")}else P.setAttribute(he,te)}}},[te,we,P,Z]),M.useEffect(()=>{let Se;if(_&&L.current&&k){const he=k.createElement("style");he.appendChild(k.createTextNode(Kht)),k.head.appendChild(he),window.getComputedStyle(k.body),Se=setTimeout(()=>{k.head.removeChild(he)},1)}return()=>{clearTimeout(Se)}},[te,_,k]),M.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);const Pe=M.useMemo(()=>({allColorSchemes:Z,colorScheme:te,darkColorScheme:G,lightColorScheme:ue,mode:J,setColorScheme:pe,setMode:ve,systemMode:se}),[Z,te,G,ue,J,pe,ve,se,ae.colorSchemeSelector]);let ee=!0;(R||N.cssVariables===!1||V&&$?.cssVarPrefix===Q)&&(ee=!1);const re=O.jsxs(M.Fragment,{children:[O.jsx(hze,{themeId:z?t:void 0,theme:ae,children:y}),ee&&O.jsx(U3e,{styles:ae.generateStyleSheets?.()||[]})]});return V?re:O.jsx(c.Provider,{value:Pe,children:re})}const p=typeof s=="string"?s:s.light,g=typeof s=="string"?s:s.dark;return{CssVarsProvider:h,useColorScheme:u,getInitColorSchemeScript:v=>Ght({colorSchemeStorageKey:i,defaultLightColorScheme:p,defaultDarkColorScheme:g,modeStorageKey:r,...v})}}function Jht(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const Pbe=(e,t,n,r=[])=>{let i=e;t.forEach((o,s)=>{s===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},ept=(e,t,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):t([...o,a],l,s))})}r(e)},tpt=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function jG(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},s={};return ept(e,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=tpt(a,l);Object.assign(i,{[u]:f}),Pbe(o,a,`var(${u})`,c),Pbe(s,a,`var(${u}, ${f})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function npt(e,t={}){const{getSelector:n=m,disableCssColorScheme:r,colorSchemeSelector:i}=t,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=e,{vars:c,css:u,varsWithDefaults:f}=jG(l,t);let d=f;const h={},{[a]:p,...g}=o;if(Object.entries(g||{}).forEach(([b,w])=>{const{vars:S,css:_,varsWithDefaults:E}=jG(w,t);d=oa(d,E),h[b]={css:_,vars:S}}),p){const{css:b,vars:w,varsWithDefaults:S}=jG(p,t);d=oa(d,S),h[a]={css:b,vars:w}}function m(b,w){let S=i;if(i==="class"&&(S=".%s"),i==="data"&&(S="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(S=`[${i}="%s"]`),b){if(S==="media")return e.defaultColorScheme===b?":root":{[`@media (prefers-color-scheme: ${o[b]?.palette?.mode||b})`]:{":root":w}};if(S)return e.defaultColorScheme===b?`:root, ${S.replace("%s",String(b))}`:S.replace("%s",String(b))}return":root"}return{vars:d,generateThemeVars:()=>{let b={...c};return Object.entries(h).forEach(([,{vars:w}])=>{b=oa(b,w)}),b},generateStyleSheets:()=>{const b=[],w=e.defaultColorScheme||"light";function S(T,k){Object.keys(k).length&&b.push(typeof T=="string"?{[T]:{...k}}:T)}S(n(void 0,{...u}),u);const{[w]:_,...E}=h;if(_){const{css:T}=_,k=o[w]?.palette?.mode,P=!r&&k?{colorScheme:k,...T}:{...T};S(n(w,{...P}),P)}return Object.entries(E).forEach(([T,{css:k}])=>{const P=o[T]?.palette?.mode,I=!r&&P?{colorScheme:P,...k}:{...k};S(n(T,{...I}),I)}),b}}}function rpt(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function gze(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:yA.white,default:yA.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const ipt=gze();function mze(){return{text:{primary:yA.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:yA.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const kbe=mze();function Mbe(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=dh(e.main,i):t==="dark"&&(e.dark=fh(e.main,o)))}function opt(e="light"){return e==="dark"?{main:Ny[200],light:Ny[50],dark:Ny[400]}:{main:Ny[700],light:Ny[400],dark:Ny[800]}}function spt(e="light"){return e==="dark"?{main:$y[200],light:$y[50],dark:$y[400]}:{main:$y[500],light:$y[300],dark:$y[700]}}function apt(e="light"){return e==="dark"?{main:Fy[500],light:Fy[300],dark:Fy[700]}:{main:Fy[700],light:Fy[400],dark:Fy[800]}}function lpt(e="light"){return e==="dark"?{main:zy[400],light:zy[300],dark:zy[700]}:{main:zy[700],light:zy[500],dark:zy[900]}}function cpt(e="light"){return e==="dark"?{main:mm[400],light:mm[300],dark:mm[700]}:{main:mm[800],light:mm[500],dark:mm[900]}}function upt(e="light"){return e==="dark"?{main:Vx[400],light:Vx[300],dark:Vx[700]}:{main:"#ed6c02",light:Vx[500],dark:Vx[900]}}function $se(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=e,o=e.primary||opt(t),s=e.secondary||spt(t),a=e.error||apt(t),l=e.info||lpt(t),c=e.success||cpt(t),u=e.warning||upt(t);function f(g){return Mht(g,kbe.text.primary)>=n?kbe.text.primary:ipt.text.primary}const d=({color:g,name:m,mainShade:v=500,lightShade:y=300,darkShade:b=700})=>{if(g={...g},!g.main&&g[v]&&(g.main=g[v]),!g.hasOwnProperty("main"))throw new Error(ov(11,m?` (${m})`:"",v));if(typeof g.main!="string")throw new Error(ov(12,m?` (${m})`:"",JSON.stringify(g.main)));return Mbe(g,"light",y,r),Mbe(g,"dark",b,r),g.contrastText||(g.contrastText=f(g.main)),g};let h;return t==="light"?h=gze():t==="dark"&&(h=mze()),oa({common:{...yA},mode:t,primary:d({color:o,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:a,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:E3e,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r,...h},i)}function fpt(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function dpt(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function hpt(e){return Math.round(e*1e5)/1e5}const Abe={textTransform:"uppercase"},Rbe='"Roboto", "Helvetica", "Arial", sans-serif';function vze(e,t){const{fontFamily:n=Rbe,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...f}=typeof t=="function"?t(e):t,d=r/14,h=u||(m=>`${m/l*d}rem`),p=(m,v,y,b,w)=>({fontFamily:n,fontWeight:m,fontSize:h(v),lineHeight:y,...n===Rbe?{letterSpacing:`${hpt(b/v)}em`}:{},...w,...c}),g={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(o,48,1.167,0),h4:p(o,34,1.235,.25),h5:p(o,24,1.334,0),h6:p(s,20,1.6,.15),subtitle1:p(o,16,1.75,.15),subtitle2:p(s,14,1.57,.1),body1:p(o,16,1.5,.15),body2:p(o,14,1.43,.15),button:p(s,14,1.75,.4,Abe),caption:p(o,12,1.66,.4),overline:p(o,12,2.66,1,Abe),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return oa({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...g},f,{clone:!1})}const ppt=.2,gpt=.14,mpt=.12;function go(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${ppt})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${gpt})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${mpt})`].join(",")}const vpt=["none",go(0,2,1,-1,0,1,1,0,0,1,3,0),go(0,3,1,-2,0,2,2,0,0,1,5,0),go(0,3,3,-2,0,3,4,0,0,1,8,0),go(0,2,4,-1,0,4,5,0,0,1,10,0),go(0,3,5,-1,0,5,8,0,0,1,14,0),go(0,3,5,-1,0,6,10,0,0,1,18,0),go(0,4,5,-2,0,7,10,1,0,2,16,1),go(0,5,5,-3,0,8,10,1,0,3,14,2),go(0,5,6,-3,0,9,12,1,0,3,16,2),go(0,6,6,-3,0,10,14,1,0,4,18,3),go(0,6,7,-4,0,11,15,1,0,4,20,3),go(0,7,8,-4,0,12,17,2,0,5,22,4),go(0,7,8,-4,0,13,19,2,0,5,24,4),go(0,7,9,-4,0,14,21,2,0,5,26,4),go(0,8,9,-5,0,15,22,2,0,6,28,5),go(0,8,10,-5,0,16,24,2,0,6,30,5),go(0,8,11,-5,0,17,26,2,0,6,32,5),go(0,9,11,-5,0,18,28,2,0,7,34,6),go(0,9,12,-6,0,19,29,2,0,7,36,6),go(0,10,13,-6,0,20,31,3,0,8,38,7),go(0,10,13,-6,0,21,33,3,0,8,40,7),go(0,10,14,-6,0,22,35,3,0,8,42,7),go(0,11,14,-7,0,23,36,3,0,9,44,8),go(0,11,15,-7,0,24,38,3,0,9,46,8)],ypt={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},yze={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Ibe(e){return`${Math.round(e)}ms`}function bpt(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function xpt(e){const t={...ypt,...e.easing},n={...yze,...e.duration};return{getAutoHeightDuration:bpt,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=o;return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:Ibe(s)} ${a} ${typeof l=="string"?l:Ibe(l)}`).join(",")},...e,easing:t,duration:n}}const wpt={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Spt(e){return fp(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function bze(e={}){const t={...e};function n(r){const i=Object.entries(r);for(let o=0;oia(h,p),d),d.unstable_sxConfig={...XI,...c?.unstable_sxConfig},d.unstable_sx=function(p){return W0({sx:p,theme:this})},d.toRuntimeSource=_je,d}function rte(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const zmt=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=rte(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Cje(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Oje(e){return e==="dark"?zmt:[]}function jmt(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...i}=e,o=Gae(t);return{palette:o,opacity:{...Cje(o.mode),...n},overlays:r||Oje(o.mode),...i}}function Bmt(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const Umt=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Vmt=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return Umt(e.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",t)]:s,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function Wmt(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function tt(e,t,n){!e[t]&&n&&(e[t]=n)}function q2(e){return typeof e!="string"||!e.startsWith("hsl")?e:sje(e)}function Hg(e,t){`${t}Channel`in e||(e[`${t}Channel`]=G2(q2(e[t])))}function Hmt(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Hh=e=>{try{return e()}catch{}},Gmt=(e="mui")=>gmt(e);function f9(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=jmt({...t,palette:{mode:i,...t?.palette}});return}const{palette:o,...s}=nte({...n,palette:{mode:i,...t?.palette}});return e[r]={...t,palette:o,opacity:{...Cje(i),...t?.opacity},overlays:t?.overlays||Oje(i)},s}function qmt(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=Bmt,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=e,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),d=Gmt(o),{[f]:h,light:p,dark:g,...m}=n,v={...m};let y=h;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(cv(21,f));const b=f9(v,y,c,f);p&&!v.light&&f9(v,p,void 0,"light"),g&&!v.dark&&f9(v,g,void 0,"dark");let w={defaultColorScheme:f,...b,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:d,colorSchemes:v,font:{...Tmt(b.typography),...b.font},spacing:Hmt(c.spacing)};Object.keys(w.colorSchemes).forEach(k=>{const P=w.colorSchemes[k].palette,R=I=>{const F=I.split("-"),A=F[1],L=F[2];return d(I,P[A][L])};if(P.mode==="light"&&(tt(P.common,"background","#fff"),tt(P.common,"onBackground","#000")),P.mode==="dark"&&(tt(P.common,"background","#000"),tt(P.common,"onBackground","#fff")),Wmt(P,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),P.mode==="light"){tt(P.Alert,"errorColor",Li(P.error.light,.6)),tt(P.Alert,"infoColor",Li(P.info.light,.6)),tt(P.Alert,"successColor",Li(P.success.light,.6)),tt(P.Alert,"warningColor",Li(P.warning.light,.6)),tt(P.Alert,"errorFilledBg",R("palette-error-main")),tt(P.Alert,"infoFilledBg",R("palette-info-main")),tt(P.Alert,"successFilledBg",R("palette-success-main")),tt(P.Alert,"warningFilledBg",R("palette-warning-main")),tt(P.Alert,"errorFilledColor",Hh(()=>P.getContrastText(P.error.main))),tt(P.Alert,"infoFilledColor",Hh(()=>P.getContrastText(P.info.main))),tt(P.Alert,"successFilledColor",Hh(()=>P.getContrastText(P.success.main))),tt(P.Alert,"warningFilledColor",Hh(()=>P.getContrastText(P.warning.main))),tt(P.Alert,"errorStandardBg",Fi(P.error.light,.9)),tt(P.Alert,"infoStandardBg",Fi(P.info.light,.9)),tt(P.Alert,"successStandardBg",Fi(P.success.light,.9)),tt(P.Alert,"warningStandardBg",Fi(P.warning.light,.9)),tt(P.Alert,"errorIconColor",R("palette-error-main")),tt(P.Alert,"infoIconColor",R("palette-info-main")),tt(P.Alert,"successIconColor",R("palette-success-main")),tt(P.Alert,"warningIconColor",R("palette-warning-main")),tt(P.AppBar,"defaultBg",R("palette-grey-100")),tt(P.Avatar,"defaultBg",R("palette-grey-400")),tt(P.Button,"inheritContainedBg",R("palette-grey-300")),tt(P.Button,"inheritContainedHoverBg",R("palette-grey-A100")),tt(P.Chip,"defaultBorder",R("palette-grey-400")),tt(P.Chip,"defaultAvatarColor",R("palette-grey-700")),tt(P.Chip,"defaultIconColor",R("palette-grey-700")),tt(P.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),tt(P.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),tt(P.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),tt(P.LinearProgress,"primaryBg",Fi(P.primary.main,.62)),tt(P.LinearProgress,"secondaryBg",Fi(P.secondary.main,.62)),tt(P.LinearProgress,"errorBg",Fi(P.error.main,.62)),tt(P.LinearProgress,"infoBg",Fi(P.info.main,.62)),tt(P.LinearProgress,"successBg",Fi(P.success.main,.62)),tt(P.LinearProgress,"warningBg",Fi(P.warning.main,.62)),tt(P.Skeleton,"bg",`rgba(${R("palette-text-primaryChannel")} / 0.11)`),tt(P.Slider,"primaryTrack",Fi(P.primary.main,.62)),tt(P.Slider,"secondaryTrack",Fi(P.secondary.main,.62)),tt(P.Slider,"errorTrack",Fi(P.error.main,.62)),tt(P.Slider,"infoTrack",Fi(P.info.main,.62)),tt(P.Slider,"successTrack",Fi(P.success.main,.62)),tt(P.Slider,"warningTrack",Fi(P.warning.main,.62));const I=m$(P.background.default,.8);tt(P.SnackbarContent,"bg",I),tt(P.SnackbarContent,"color",Hh(()=>P.getContrastText(I))),tt(P.SpeedDialAction,"fabHoverBg",m$(P.background.paper,.15)),tt(P.StepConnector,"border",R("palette-grey-400")),tt(P.StepContent,"border",R("palette-grey-400")),tt(P.Switch,"defaultColor",R("palette-common-white")),tt(P.Switch,"defaultDisabledColor",R("palette-grey-100")),tt(P.Switch,"primaryDisabledColor",Fi(P.primary.main,.62)),tt(P.Switch,"secondaryDisabledColor",Fi(P.secondary.main,.62)),tt(P.Switch,"errorDisabledColor",Fi(P.error.main,.62)),tt(P.Switch,"infoDisabledColor",Fi(P.info.main,.62)),tt(P.Switch,"successDisabledColor",Fi(P.success.main,.62)),tt(P.Switch,"warningDisabledColor",Fi(P.warning.main,.62)),tt(P.TableCell,"border",Fi(g$(P.divider,1),.88)),tt(P.Tooltip,"bg",g$(P.grey[700],.92))}if(P.mode==="dark"){tt(P.Alert,"errorColor",Fi(P.error.light,.6)),tt(P.Alert,"infoColor",Fi(P.info.light,.6)),tt(P.Alert,"successColor",Fi(P.success.light,.6)),tt(P.Alert,"warningColor",Fi(P.warning.light,.6)),tt(P.Alert,"errorFilledBg",R("palette-error-dark")),tt(P.Alert,"infoFilledBg",R("palette-info-dark")),tt(P.Alert,"successFilledBg",R("palette-success-dark")),tt(P.Alert,"warningFilledBg",R("palette-warning-dark")),tt(P.Alert,"errorFilledColor",Hh(()=>P.getContrastText(P.error.dark))),tt(P.Alert,"infoFilledColor",Hh(()=>P.getContrastText(P.info.dark))),tt(P.Alert,"successFilledColor",Hh(()=>P.getContrastText(P.success.dark))),tt(P.Alert,"warningFilledColor",Hh(()=>P.getContrastText(P.warning.dark))),tt(P.Alert,"errorStandardBg",Li(P.error.light,.9)),tt(P.Alert,"infoStandardBg",Li(P.info.light,.9)),tt(P.Alert,"successStandardBg",Li(P.success.light,.9)),tt(P.Alert,"warningStandardBg",Li(P.warning.light,.9)),tt(P.Alert,"errorIconColor",R("palette-error-main")),tt(P.Alert,"infoIconColor",R("palette-info-main")),tt(P.Alert,"successIconColor",R("palette-success-main")),tt(P.Alert,"warningIconColor",R("palette-warning-main")),tt(P.AppBar,"defaultBg",R("palette-grey-900")),tt(P.AppBar,"darkBg",R("palette-background-paper")),tt(P.AppBar,"darkColor",R("palette-text-primary")),tt(P.Avatar,"defaultBg",R("palette-grey-600")),tt(P.Button,"inheritContainedBg",R("palette-grey-800")),tt(P.Button,"inheritContainedHoverBg",R("palette-grey-700")),tt(P.Chip,"defaultBorder",R("palette-grey-700")),tt(P.Chip,"defaultAvatarColor",R("palette-grey-300")),tt(P.Chip,"defaultIconColor",R("palette-grey-300")),tt(P.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),tt(P.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),tt(P.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),tt(P.LinearProgress,"primaryBg",Li(P.primary.main,.5)),tt(P.LinearProgress,"secondaryBg",Li(P.secondary.main,.5)),tt(P.LinearProgress,"errorBg",Li(P.error.main,.5)),tt(P.LinearProgress,"infoBg",Li(P.info.main,.5)),tt(P.LinearProgress,"successBg",Li(P.success.main,.5)),tt(P.LinearProgress,"warningBg",Li(P.warning.main,.5)),tt(P.Skeleton,"bg",`rgba(${R("palette-text-primaryChannel")} / 0.13)`),tt(P.Slider,"primaryTrack",Li(P.primary.main,.5)),tt(P.Slider,"secondaryTrack",Li(P.secondary.main,.5)),tt(P.Slider,"errorTrack",Li(P.error.main,.5)),tt(P.Slider,"infoTrack",Li(P.info.main,.5)),tt(P.Slider,"successTrack",Li(P.success.main,.5)),tt(P.Slider,"warningTrack",Li(P.warning.main,.5));const I=m$(P.background.default,.98);tt(P.SnackbarContent,"bg",I),tt(P.SnackbarContent,"color",Hh(()=>P.getContrastText(I))),tt(P.SpeedDialAction,"fabHoverBg",m$(P.background.paper,.15)),tt(P.StepConnector,"border",R("palette-grey-600")),tt(P.StepContent,"border",R("palette-grey-600")),tt(P.Switch,"defaultColor",R("palette-grey-300")),tt(P.Switch,"defaultDisabledColor",R("palette-grey-600")),tt(P.Switch,"primaryDisabledColor",Li(P.primary.main,.55)),tt(P.Switch,"secondaryDisabledColor",Li(P.secondary.main,.55)),tt(P.Switch,"errorDisabledColor",Li(P.error.main,.55)),tt(P.Switch,"infoDisabledColor",Li(P.info.main,.55)),tt(P.Switch,"successDisabledColor",Li(P.success.main,.55)),tt(P.Switch,"warningDisabledColor",Li(P.warning.main,.55)),tt(P.TableCell,"border",Li(g$(P.divider,1),.68)),tt(P.Tooltip,"bg",g$(P.grey[700],.92))}Hg(P.background,"default"),Hg(P.background,"paper"),Hg(P.common,"background"),Hg(P.common,"onBackground"),Hg(P,"divider"),Object.keys(P).forEach(I=>{const F=P[I];I!=="tonalOffset"&&F&&typeof F=="object"&&(F.main&&tt(P[I],"mainChannel",G2(q2(F.main))),F.light&&tt(P[I],"lightChannel",G2(q2(F.light))),F.dark&&tt(P[I],"darkChannel",G2(q2(F.dark))),F.contrastText&&tt(P[I],"contrastTextChannel",G2(q2(F.contrastText))),I==="text"&&(Hg(P[I],"primary"),Hg(P[I],"secondary")),I==="action"&&(F.active&&Hg(P[I],"active"),F.selected&&Hg(P[I],"selected")))})}),w=t.reduce((k,P)=>ia(k,P),w);const S={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:Vmt(w)},{vars:_,generateThemeVars:E,generateStyleSheets:T}=ymt(w,S);return w.vars=_,Object.entries(w.colorSchemes[w.defaultColorScheme]).forEach(([k,P])=>{w[k]=P}),w.generateThemeVars=E,w.generateStyleSheets=T,w.generateSpacing=function(){return K5e(c.spacing,Fae(this))},w.getColorSchemeSelector=bmt(a),w.spacing=w.generateSpacing(),w.shouldSkipGeneratingVar=s,w.unstable_sxConfig={...XI,...c?.unstable_sxConfig},w.unstable_sx=function(P){return W0({sx:P,theme:this})},w.toRuntimeSource=_je,w}function jxe(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Gae({...n===!0?{}:n.palette,mode:t})})}function xT(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n?.mode,...s}=e,a=o||"light",l=i?.[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return nte(e,...t);let u=n;"palette"in e||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const f=nte({...e,palette:u},...t);return f.defaultColorScheme=a,f.colorSchemes=c,f.palette.mode==="light"&&(f.colorSchemes.light={...c.light!==!0&&c.light,palette:f.palette},jxe(f,"dark",c.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:f.palette},jxe(f,"light",c.light)),f}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),qmt({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}function Xmt(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function Ymt(e){return parseFloat(e)}const Q6=xT();function is(){const e=tS(Q6);return e[If]||e}function Ar({props:e,name:t}){return jgt({props:e,name:t,defaultTheme:Q6,themeId:If})}function K6(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const ua=e=>K6(e)&&e!=="classes",Oe=rje({themeId:If,defaultTheme:Q6,rootShouldForwardProp:ua});function Qmt({theme:e,...t}){const n=If in e?e[If]:void 0;return O.jsx(vje,{...t,themeId:n?If:void 0,theme:n||e})}const v$={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:Kmt}=pmt({themeId:If,theme:()=>xT({cssVariables:!0}),colorSchemeStorageKey:v$.colorSchemeStorageKey,modeStorageKey:v$.modeStorageKey,defaultColorScheme:{light:v$.defaultLightColorScheme,dark:v$.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:wje(e.palette,e.typography)};return t.unstable_sx=function(r){return W0({sx:r,theme:this})},t}}),Zmt=Kmt;function Jmt({theme:e,...t}){const n=M.useMemo(()=>{if(typeof e=="function")return e;const r=If in e?e[If]:e;return"colorSchemes"in r?null:"vars"in r?e:{...e,vars:null}},[e]);return n?O.jsx(Qmt,{theme:n,...t}):O.jsx(Zmt,{theme:e,...t})}function Eje(e){return O.jsx(Z5e,{...e,defaultTheme:Q6,themeId:If})}function qae(e){return function(n){return O.jsx(Eje,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}function evt(){return zae}const Mt=smt;function Dt(e){return imt(e)}function tvt(e){return pt("MuiSvgIcon",e)}dt("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const nvt=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Ve(t)}`,`fontSize${Ve(n)}`]};return Xe(i,tvt,r)},rvt=Oe("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ve(n.color)}`],t[`fontSize${Ve(n.fontSize)}`]]}})(Mt(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),ite=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,p=M.isValidElement(i)&&i.type==="svg",g={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p},m={};u||(m.viewBox=d);const v=nvt(g);return O.jsxs(rvt,{as:a,className:Re(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...m,...h,...p&&i.props,ownerState:g,children:[p?i.props.children:i,f?O.jsx("title",{children:f}):null]})});ite.muiName="SvgIcon";function ot(e,t){function n(r,i){return O.jsx(ite,{"data-testid":`${t}Icon`,ref:i,...r,children:e})}return n.muiName=ite.muiName,M.memo(M.forwardRef(n))}function Tje(e,t){if(!e)return t;if(typeof e=="function"||typeof t=="function")return i=>{const o=typeof t=="function"?t(i):t,s=typeof e=="function"?e({...i,...o}):e,a=Re(i?.className,o?.className,s?.className);return{...o,...s,...!!a&&{className:a},...o?.style&&s?.style&&{style:{...o.style,...s.style}},...o?.sx&&s?.sx&&{sx:[...Array.isArray(o.sx)?o.sx:[o.sx],...Array.isArray(s.sx)?s.sx:[s.sx]]}}};const n=t,r=Re(n?.className,e?.className);return{...t,...e,...!!r&&{className:r},...n?.style&&e?.style&&{style:{...n.style,...e.style}},...n?.sx&&e?.sx&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function L5(e,t){return L5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},L5(e,t)}function KI(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,L5(e,t)}function ivt(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function ovt(e,t){e.classList?e.classList.add(t):ivt(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function Bxe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function svt(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=Bxe(e.className,t):e.setAttribute("class",Bxe(e.className&&e.className.baseVal||"",t))}const Uxe={disabled:!1},F5=Te.createContext(null);var Pje=function(t){return t.scrollTop},X2="unmounted",Bx="exited",Ux="entering",bC="entered",ote="exiting",Hu=(function(e){KI(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=Bx,o.appearStatus=Ux):l=bC:r.unmountOnExit||r.mountOnEnter?l=X2:l=Bx,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===X2?{status:Bx}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==Ux&&s!==bC&&(o=Ux):(s===Ux||s===bC)&&(o=ote)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Ux){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:h$.findDOMNode(this);s&&Pje(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Bx&&this.setState({status:X2})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[h$.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),d=a?f.appear:f.enter;if(!i&&!s||Uxe.disabled){this.safeSetState({status:bC},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Ux},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:bC},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:h$.findDOMNode(this);if(!o||Uxe.disabled){this.safeSetState({status:Bx},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:ote},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:Bx},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:h$.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===X2)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=it(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Te.createElement(F5.Provider,{value:null},typeof s=="function"?s(i,a):Te.cloneElement(Te.Children.only(s),a))},t})(Te.Component);Hu.contextType=F5;Hu.propTypes={};function g_(){}Hu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:g_,onEntering:g_,onEntered:g_,onExit:g_,onExiting:g_,onExited:g_};Hu.UNMOUNTED=X2;Hu.EXITED=Bx;Hu.ENTERING=Ux;Hu.ENTERED=bC;Hu.EXITING=ote;var avt=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return ovt(t,r)})},d9=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return svt(t,r)})},Xae=(function(e){KI(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;se.scrollTop;function G0(e,t){const{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:i.transitionDelay}}function hvt(e){return pt("MuiCollapse",e)}dt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const pvt=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Xe(r,hvt,n)},gvt=Oe("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(Mt(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),mvt=Oe("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),vvt=Oe("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),$5=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCollapse"}),{addEndListener:i,children:o,className:s,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:g,onExiting:m,orientation:v="vertical",style:y,timeout:b=Sje.standard,TransitionComponent:w=Hu,...S}=r,_={...r,orientation:v,collapsedSize:a},E=pvt(_),T=is(),k=jl(),P=M.useRef(null),R=M.useRef(),I=typeof a=="number"?`${a}px`:a,F=v==="horizontal",A=F?"width":"height",L=M.useRef(null),$=zn(n,L),j=Z=>pe=>{if(Z){const ie=L.current;pe===void 0?Z(ie):Z(ie,pe)}},V=()=>P.current?P.current[F?"clientWidth":"clientHeight"]:0,U=j((Z,pe)=>{P.current&&F&&(P.current.style.position="absolute"),Z.style[A]=I,f&&f(Z,pe)}),z=j((Z,pe)=>{const ie=V();P.current&&F&&(P.current.style.position="");const{duration:ne,easing:fe}=G0({style:y,timeout:b,easing:c},{mode:"enter"});if(b==="auto"){const me=T.transitions.getAutoHeightDuration(ie);Z.style.transitionDuration=`${me}ms`,R.current=me}else Z.style.transitionDuration=typeof ne=="string"?ne:`${ne}ms`;Z.style[A]=`${ie}px`,Z.style.transitionTimingFunction=fe,h&&h(Z,pe)}),N=j((Z,pe)=>{Z.style[A]="auto",d&&d(Z,pe)}),B=j(Z=>{Z.style[A]=`${V()}px`,p&&p(Z)}),H=j(g),Q=j(Z=>{const pe=V(),{duration:ie,easing:ne}=G0({style:y,timeout:b,easing:c},{mode:"exit"});if(b==="auto"){const fe=T.transitions.getAutoHeightDuration(pe);Z.style.transitionDuration=`${fe}ms`,R.current=fe}else Z.style.transitionDuration=typeof ie=="string"?ie:`${ie}ms`;Z.style[A]=I,Z.style.transitionTimingFunction=ne,m&&m(Z)}),Y=Z=>{b==="auto"&&k.start(R.current||0,Z),i&&i(L.current,Z)};return O.jsx(w,{in:u,onEnter:U,onEntered:N,onEntering:z,onExit:B,onExited:H,onExiting:Q,addEndListener:Y,nodeRef:L,timeout:b==="auto"?null:b,...S,children:(Z,{ownerState:pe,...ie})=>O.jsx(gvt,{as:l,className:Re(E.root,s,{entered:E.entered,exited:!u&&I==="0px"&&E.hidden}[Z]),style:{[F?"minWidth":"minHeight"]:I,...y},ref:$,ownerState:{..._,state:Z},...ie,children:O.jsx(mvt,{ownerState:{..._,state:Z},className:E.wrapper,ref:P,children:O.jsx(vvt,{ownerState:{..._,state:Z},className:E.wrapperInner,children:o})})})})});$5&&($5.muiSupportAuto=!0);function yvt(e){return pt("MuiPaper",e)}dt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const bvt=e=>{const{square:t,elevation:n,variant:r,classes:i}=e,o={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Xe(o,yvt,i)},xvt=Oe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(Mt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),fa=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiPaper"}),i=is(),{className:o,component:s="div",elevation:a=1,square:l=!1,variant:c="elevation",...u}=r,f={...r,component:s,elevation:a,square:l,variant:c},d=bvt(f);return O.jsx(xvt,{as:s,ownerState:f,className:Re(d.root,o),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(i.vars||i).shadows[a],...i.vars&&{"--Paper-overlay":i.vars.overlays?.[a]},...!i.vars&&i.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Bt("#fff",rte(a))}, ${Bt("#fff",rte(a))})`}},...u.style}})}),kje=M.createContext({});function Zt(e,t){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,internalForwardedProps:s,shouldForwardComponentProp:a=!1,...l}=t,{component:c,slots:u={[e]:void 0},slotProps:f={[e]:void 0},...d}=o,h=u[e]||r,p=IA(f[e],i),{props:{component:g,...m},internalRef:v}=dje({className:n,...l,externalForwardedProps:e==="root"?d:void 0,externalSlotProps:p}),y=zn(v,p?.ref,t.ref),b=e==="root"?g||c:g,w=fje(h,{...e==="root"&&!c&&!u[e]&&s,...e!=="root"&&!u[e]&&s,...m,...b&&!a&&{as:b},...b&&a&&{component:b},ref:y},i);return[h,w]}function wvt(e){return pt("MuiAccordion",e)}const y$=dt("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Svt=e=>{const{classes:t,square:n,expanded:r,disabled:i,disableGutters:o}=e;return Xe({root:["root",!n&&"rounded",r&&"expanded",i&&"disabled",!o&&"gutters"],heading:["heading"],region:["region"]},wvt,t)},_vt=Oe(fa,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${y$.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(Mt(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${y$.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${y$.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),Mt(({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${y$.expanded}`]:{margin:"16px 0"}}}]}))),Cvt=Oe("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(e,t)=>t.heading})({all:"unset"}),Mje=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAccordion"}),{children:i,className:o,defaultExpanded:s=!1,disabled:a=!1,disableGutters:l=!1,expanded:c,onChange:u,square:f=!1,slots:d={},slotProps:h={},TransitionComponent:p,TransitionProps:g,...m}=r,[v,y]=Fa({controlled:c,default:s,name:"Accordion",state:"expanded"}),b=M.useCallback(V=>{y(!v),u&&u(V,!v)},[v,u,y]),[w,...S]=M.Children.toArray(i),_=M.useMemo(()=>({expanded:v,disabled:a,disableGutters:l,toggle:b}),[v,a,l,b]),E={...r,square:f,disabled:a,disableGutters:l,expanded:v},T=Svt(E),k={transition:p,...d},P={transition:g,...h},R={slots:k,slotProps:P},[I,F]=Zt("root",{elementType:_vt,externalForwardedProps:{...R,...m},className:Re(T.root,o),shouldForwardComponentProp:!0,ownerState:E,ref:n,additionalProps:{square:f}}),[A,L]=Zt("heading",{elementType:Cvt,externalForwardedProps:R,className:T.heading,ownerState:E}),[$,j]=Zt("transition",{elementType:$5,externalForwardedProps:R,ownerState:E});return O.jsxs(I,{...F,children:[O.jsx(A,{...L,children:O.jsx(kje.Provider,{value:_,children:w})}),O.jsx($,{in:v,timeout:"auto",...j,children:O.jsx("div",{"aria-labelledby":w.props.id,id:w.props["aria-controls"],role:"region",className:T.region,children:S})})]})});function Ovt(e){return pt("MuiAccordionDetails",e)}dt("MuiAccordionDetails",["root"]);const Evt=e=>{const{classes:t}=e;return Xe({root:["root"]},Ovt,t)},Tvt=Oe("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(Mt(({theme:e})=>({padding:e.spacing(1,2,2)}))),Aje=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAccordionDetails"}),{className:i,...o}=r,s=r,a=Evt(s);return O.jsx(Tvt,{className:Re(a.root,i),ref:n,ownerState:s,...o})});class N5{static create(){return new N5}static use(){const t=ad(N5.create).current,[n,r]=M.useState(!1);return t.shouldMount=n,t.setShouldMount=r,M.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=kvt(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function Pvt(){return N5.use()}function kvt(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function Mvt(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,f]=M.useState(!1),d=Re(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},p=Re(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),M.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),O.jsx("span",{className:d,style:h,children:O.jsx("span",{className:p})})}const hf=dt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),ste=550,Avt=80,Rvt=pg` +export default theme;`}function ZJ(e={},...t){const{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:s={},typography:a={},shape:l,...c}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(ov(20));const u=$se(o),f=kse(e);let d=oa(f,{mixins:dpt(f.breakpoints,r),palette:u,shadows:vpt.slice(),typography:vze(u,a),transitions:xpt(s),zIndex:{...wpt}});return d=oa(d,c),d=t.reduce((h,p)=>oa(h,p),d),d.unstable_sxConfig={...$I,...c?.unstable_sxConfig},d.unstable_sx=function(p){return N0({sx:p,theme:this})},d.toRuntimeSource=bze,d}function JJ(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const _pt=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=JJ(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function xze(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function wze(e){return e==="dark"?_pt:[]}function Cpt(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...i}=e,o=$se(t);return{palette:o,opacity:{...xze(o.mode),...n},overlays:r||wze(o.mode),...i}}function Opt(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const Ept=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Tpt=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return Ept(e.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",t)]:s,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function Ppt(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function tt(e,t,n){!e[t]&&n&&(e[t]=n)}function $2(e){return typeof e!="string"||!e.startsWith("hsl")?e:nze(e)}function Ug(e,t){`${t}Channel`in e||(e[`${t}Channel`]=F2($2(e[t])))}function kpt(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Uh=e=>{try{return e()}catch{}},Mpt=(e="mui")=>Jht(e);function BG(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=Cpt({...t,palette:{mode:i,...t?.palette}});return}const{palette:o,...s}=ZJ({...n,palette:{mode:i,...t?.palette}});return e[r]={...t,palette:o,opacity:{...xze(i),...t?.opacity},overlays:t?.overlays||wze(i)},s}function Apt(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=Opt,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=e,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),d=Mpt(o),{[f]:h,light:p,dark:g,...m}=n,v={...m};let y=h;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(ov(21,f));const b=BG(v,y,c,f);p&&!v.light&&BG(v,p,void 0,"light"),g&&!v.dark&&BG(v,g,void 0,"dark");let w={defaultColorScheme:f,...b,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:d,colorSchemes:v,font:{...fpt(b.typography),...b.font},spacing:kpt(c.spacing)};Object.keys(w.colorSchemes).forEach(k=>{const P=w.colorSchemes[k].palette,I=R=>{const F=R.split("-"),A=F[1],L=F[2];return d(R,P[A][L])};if(P.mode==="light"&&(tt(P.common,"background","#fff"),tt(P.common,"onBackground","#000")),P.mode==="dark"&&(tt(P.common,"background","#000"),tt(P.common,"onBackground","#fff")),Ppt(P,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),P.mode==="light"){tt(P.Alert,"errorColor",Li(P.error.light,.6)),tt(P.Alert,"infoColor",Li(P.info.light,.6)),tt(P.Alert,"successColor",Li(P.success.light,.6)),tt(P.Alert,"warningColor",Li(P.warning.light,.6)),tt(P.Alert,"errorFilledBg",I("palette-error-main")),tt(P.Alert,"infoFilledBg",I("palette-info-main")),tt(P.Alert,"successFilledBg",I("palette-success-main")),tt(P.Alert,"warningFilledBg",I("palette-warning-main")),tt(P.Alert,"errorFilledColor",Uh(()=>P.getContrastText(P.error.main))),tt(P.Alert,"infoFilledColor",Uh(()=>P.getContrastText(P.info.main))),tt(P.Alert,"successFilledColor",Uh(()=>P.getContrastText(P.success.main))),tt(P.Alert,"warningFilledColor",Uh(()=>P.getContrastText(P.warning.main))),tt(P.Alert,"errorStandardBg",Fi(P.error.light,.9)),tt(P.Alert,"infoStandardBg",Fi(P.info.light,.9)),tt(P.Alert,"successStandardBg",Fi(P.success.light,.9)),tt(P.Alert,"warningStandardBg",Fi(P.warning.light,.9)),tt(P.Alert,"errorIconColor",I("palette-error-main")),tt(P.Alert,"infoIconColor",I("palette-info-main")),tt(P.Alert,"successIconColor",I("palette-success-main")),tt(P.Alert,"warningIconColor",I("palette-warning-main")),tt(P.AppBar,"defaultBg",I("palette-grey-100")),tt(P.Avatar,"defaultBg",I("palette-grey-400")),tt(P.Button,"inheritContainedBg",I("palette-grey-300")),tt(P.Button,"inheritContainedHoverBg",I("palette-grey-A100")),tt(P.Chip,"defaultBorder",I("palette-grey-400")),tt(P.Chip,"defaultAvatarColor",I("palette-grey-700")),tt(P.Chip,"defaultIconColor",I("palette-grey-700")),tt(P.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),tt(P.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),tt(P.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),tt(P.LinearProgress,"primaryBg",Fi(P.primary.main,.62)),tt(P.LinearProgress,"secondaryBg",Fi(P.secondary.main,.62)),tt(P.LinearProgress,"errorBg",Fi(P.error.main,.62)),tt(P.LinearProgress,"infoBg",Fi(P.info.main,.62)),tt(P.LinearProgress,"successBg",Fi(P.success.main,.62)),tt(P.LinearProgress,"warningBg",Fi(P.warning.main,.62)),tt(P.Skeleton,"bg",`rgba(${I("palette-text-primaryChannel")} / 0.11)`),tt(P.Slider,"primaryTrack",Fi(P.primary.main,.62)),tt(P.Slider,"secondaryTrack",Fi(P.secondary.main,.62)),tt(P.Slider,"errorTrack",Fi(P.error.main,.62)),tt(P.Slider,"infoTrack",Fi(P.info.main,.62)),tt(P.Slider,"successTrack",Fi(P.success.main,.62)),tt(P.Slider,"warningTrack",Fi(P.warning.main,.62));const R=n$(P.background.default,.8);tt(P.SnackbarContent,"bg",R),tt(P.SnackbarContent,"color",Uh(()=>P.getContrastText(R))),tt(P.SpeedDialAction,"fabHoverBg",n$(P.background.paper,.15)),tt(P.StepConnector,"border",I("palette-grey-400")),tt(P.StepContent,"border",I("palette-grey-400")),tt(P.Switch,"defaultColor",I("palette-common-white")),tt(P.Switch,"defaultDisabledColor",I("palette-grey-100")),tt(P.Switch,"primaryDisabledColor",Fi(P.primary.main,.62)),tt(P.Switch,"secondaryDisabledColor",Fi(P.secondary.main,.62)),tt(P.Switch,"errorDisabledColor",Fi(P.error.main,.62)),tt(P.Switch,"infoDisabledColor",Fi(P.info.main,.62)),tt(P.Switch,"successDisabledColor",Fi(P.success.main,.62)),tt(P.Switch,"warningDisabledColor",Fi(P.warning.main,.62)),tt(P.TableCell,"border",Fi(t$(P.divider,1),.88)),tt(P.Tooltip,"bg",t$(P.grey[700],.92))}if(P.mode==="dark"){tt(P.Alert,"errorColor",Fi(P.error.light,.6)),tt(P.Alert,"infoColor",Fi(P.info.light,.6)),tt(P.Alert,"successColor",Fi(P.success.light,.6)),tt(P.Alert,"warningColor",Fi(P.warning.light,.6)),tt(P.Alert,"errorFilledBg",I("palette-error-dark")),tt(P.Alert,"infoFilledBg",I("palette-info-dark")),tt(P.Alert,"successFilledBg",I("palette-success-dark")),tt(P.Alert,"warningFilledBg",I("palette-warning-dark")),tt(P.Alert,"errorFilledColor",Uh(()=>P.getContrastText(P.error.dark))),tt(P.Alert,"infoFilledColor",Uh(()=>P.getContrastText(P.info.dark))),tt(P.Alert,"successFilledColor",Uh(()=>P.getContrastText(P.success.dark))),tt(P.Alert,"warningFilledColor",Uh(()=>P.getContrastText(P.warning.dark))),tt(P.Alert,"errorStandardBg",Li(P.error.light,.9)),tt(P.Alert,"infoStandardBg",Li(P.info.light,.9)),tt(P.Alert,"successStandardBg",Li(P.success.light,.9)),tt(P.Alert,"warningStandardBg",Li(P.warning.light,.9)),tt(P.Alert,"errorIconColor",I("palette-error-main")),tt(P.Alert,"infoIconColor",I("palette-info-main")),tt(P.Alert,"successIconColor",I("palette-success-main")),tt(P.Alert,"warningIconColor",I("palette-warning-main")),tt(P.AppBar,"defaultBg",I("palette-grey-900")),tt(P.AppBar,"darkBg",I("palette-background-paper")),tt(P.AppBar,"darkColor",I("palette-text-primary")),tt(P.Avatar,"defaultBg",I("palette-grey-600")),tt(P.Button,"inheritContainedBg",I("palette-grey-800")),tt(P.Button,"inheritContainedHoverBg",I("palette-grey-700")),tt(P.Chip,"defaultBorder",I("palette-grey-700")),tt(P.Chip,"defaultAvatarColor",I("palette-grey-300")),tt(P.Chip,"defaultIconColor",I("palette-grey-300")),tt(P.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),tt(P.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),tt(P.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),tt(P.LinearProgress,"primaryBg",Li(P.primary.main,.5)),tt(P.LinearProgress,"secondaryBg",Li(P.secondary.main,.5)),tt(P.LinearProgress,"errorBg",Li(P.error.main,.5)),tt(P.LinearProgress,"infoBg",Li(P.info.main,.5)),tt(P.LinearProgress,"successBg",Li(P.success.main,.5)),tt(P.LinearProgress,"warningBg",Li(P.warning.main,.5)),tt(P.Skeleton,"bg",`rgba(${I("palette-text-primaryChannel")} / 0.13)`),tt(P.Slider,"primaryTrack",Li(P.primary.main,.5)),tt(P.Slider,"secondaryTrack",Li(P.secondary.main,.5)),tt(P.Slider,"errorTrack",Li(P.error.main,.5)),tt(P.Slider,"infoTrack",Li(P.info.main,.5)),tt(P.Slider,"successTrack",Li(P.success.main,.5)),tt(P.Slider,"warningTrack",Li(P.warning.main,.5));const R=n$(P.background.default,.98);tt(P.SnackbarContent,"bg",R),tt(P.SnackbarContent,"color",Uh(()=>P.getContrastText(R))),tt(P.SpeedDialAction,"fabHoverBg",n$(P.background.paper,.15)),tt(P.StepConnector,"border",I("palette-grey-600")),tt(P.StepContent,"border",I("palette-grey-600")),tt(P.Switch,"defaultColor",I("palette-grey-300")),tt(P.Switch,"defaultDisabledColor",I("palette-grey-600")),tt(P.Switch,"primaryDisabledColor",Li(P.primary.main,.55)),tt(P.Switch,"secondaryDisabledColor",Li(P.secondary.main,.55)),tt(P.Switch,"errorDisabledColor",Li(P.error.main,.55)),tt(P.Switch,"infoDisabledColor",Li(P.info.main,.55)),tt(P.Switch,"successDisabledColor",Li(P.success.main,.55)),tt(P.Switch,"warningDisabledColor",Li(P.warning.main,.55)),tt(P.TableCell,"border",Li(t$(P.divider,1),.68)),tt(P.Tooltip,"bg",t$(P.grey[700],.92))}Ug(P.background,"default"),Ug(P.background,"paper"),Ug(P.common,"background"),Ug(P.common,"onBackground"),Ug(P,"divider"),Object.keys(P).forEach(R=>{const F=P[R];R!=="tonalOffset"&&F&&typeof F=="object"&&(F.main&&tt(P[R],"mainChannel",F2($2(F.main))),F.light&&tt(P[R],"lightChannel",F2($2(F.light))),F.dark&&tt(P[R],"darkChannel",F2($2(F.dark))),F.contrastText&&tt(P[R],"contrastTextChannel",F2($2(F.contrastText))),R==="text"&&(Ug(P[R],"primary"),Ug(P[R],"secondary")),R==="action"&&(F.active&&Ug(P[R],"active"),F.selected&&Ug(P[R],"selected")))})}),w=t.reduce((k,P)=>oa(k,P),w);const S={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:Tpt(w)},{vars:_,generateThemeVars:E,generateStyleSheets:T}=npt(w,S);return w.vars=_,Object.entries(w.colorSchemes[w.defaultColorScheme]).forEach(([k,P])=>{w[k]=P}),w.generateThemeVars=E,w.generateStyleSheets=T,w.generateSpacing=function(){return q3e(c.spacing,Tse(this))},w.getColorSchemeSelector=rpt(a),w.spacing=w.generateSpacing(),w.shouldSkipGeneratingVar=s,w.unstable_sxConfig={...$I,...c?.unstable_sxConfig},w.unstable_sx=function(P){return N0({sx:P,theme:this})},w.toRuntimeSource=bze,w}function Dbe(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:$se({...n===!0?{}:n.palette,mode:t})})}function dT(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n?.mode,...s}=e,a=o||"light",l=i?.[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return ZJ(e,...t);let u=n;"palette"in e||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const f=ZJ({...e,palette:u},...t);return f.defaultColorScheme=a,f.colorSchemes=c,f.palette.mode==="light"&&(f.colorSchemes.light={...c.light!==!0&&c.light,palette:f.palette},Dbe(f,"dark",c.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:f.palette},Dbe(f,"light",c.light)),f}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),Apt({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}function Rpt(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function Ipt(e){return parseFloat(e)}const P6=dT();function as(){const e=qw(P6);return e[If]||e}function Rr({props:e,name:t}){return Cht({props:e,name:t,defaultTheme:P6,themeId:If})}function k6(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const ua=e=>k6(e)&&e!=="classes",Oe=J3e({themeId:If,defaultTheme:P6,rootShouldForwardProp:ua});function Dpt({theme:e,...t}){const n=If in e?e[If]:void 0;return O.jsx(hze,{...t,themeId:n?If:void 0,theme:n||e})}const r$={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:Lpt}=Zht({themeId:If,theme:()=>dT({cssVariables:!0}),colorSchemeStorageKey:r$.colorSchemeStorageKey,modeStorageKey:r$.modeStorageKey,defaultColorScheme:{light:r$.defaultLightColorScheme,dark:r$.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:vze(e.palette,e.typography)};return t.unstable_sx=function(r){return N0({sx:r,theme:this})},t}}),Fpt=Lpt;function $pt({theme:e,...t}){const n=M.useMemo(()=>{if(typeof e=="function")return e;const r=If in e?e[If]:e;return"colorSchemes"in r?null:"vars"in r?e:{...e,vars:null}},[e]);return n?O.jsx(Dpt,{theme:n,...t}):O.jsx(Fpt,{theme:e,...t})}function Sze(e){return O.jsx(X3e,{...e,defaultTheme:P6,themeId:If})}function Nse(e){return function(n){return O.jsx(Sze,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}function Npt(){return Mse}const Mt=Wht;function Dt(e){return Uht(e)}function zpt(e){return pt("MuiSvgIcon",e)}dt("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const jpt=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Ue(t)}`,`fontSize${Ue(n)}`]};return Xe(i,zpt,r)},Bpt=Oe("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ue(n.color)}`],t[`fontSize${Ue(n.fontSize)}`]]}})(Mt(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),eee=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,p=M.isValidElement(i)&&i.type==="svg",g={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p},m={};u||(m.viewBox=d);const v=jpt(g);return O.jsxs(Bpt,{as:a,className:Re(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...m,...h,...p&&i.props,ownerState:g,children:[p?i.props.children:i,f?O.jsx("title",{children:f}):null]})});eee.muiName="SvgIcon";function at(e,t){function n(r,i){return O.jsx(eee,{"data-testid":`${t}Icon`,ref:i,...r,children:e})}return n.muiName=eee.muiName,M.memo(M.forwardRef(n))}function _ze(e,t){if(!e)return t;if(typeof e=="function"||typeof t=="function")return i=>{const o=typeof t=="function"?t(i):t,s=typeof e=="function"?e({...i,...o}):e,a=Re(i?.className,o?.className,s?.className);return{...o,...s,...!!a&&{className:a},...o?.style&&s?.style&&{style:{...o.style,...s.style}},...o?.sx&&s?.sx&&{sx:[...Array.isArray(o.sx)?o.sx:[o.sx],...Array.isArray(s.sx)?s.sx:[s.sx]]}}};const n=t,r=Re(n?.className,e?.className);return{...t,...e,...!!r&&{className:r},...n?.style&&e?.style&&{style:{...n.style,...e.style}},...n?.sx&&e?.sx&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function d5(e,t){return d5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},d5(e,t)}function jI(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,d5(e,t)}function Upt(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function Vpt(e,t){e.classList?e.classList.add(t):Upt(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function Lbe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Wpt(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=Lbe(e.className,t):e.setAttribute("class",Lbe(e.className&&e.className.baseVal||"",t))}const Fbe={disabled:!1},h5=Te.createContext(null);var Cze=function(t){return t.scrollTop},N2="unmounted",Rx="exited",Ix="entering",cC="entered",tee="exiting",Hu=(function(e){jI(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=Rx,o.appearStatus=Ix):l=cC:r.unmountOnExit||r.mountOnEnter?l=N2:l=Rx,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===N2?{status:Rx}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==Ix&&s!==cC&&(o=Ix):(s===Ix||s===cC)&&(o=tee)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Ix){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:JF.findDOMNode(this);s&&Cze(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Rx&&this.setState({status:N2})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[JF.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),d=a?f.appear:f.enter;if(!i&&!s||Fbe.disabled){this.safeSetState({status:cC},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Ix},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:cC},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:JF.findDOMNode(this);if(!o||Fbe.disabled){this.safeSetState({status:Rx},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:tee},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:Rx},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:JF.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===N2)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=st(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Te.createElement(h5.Provider,{value:null},typeof s=="function"?s(i,a):Te.cloneElement(Te.Children.only(s),a))},t})(Te.Component);Hu.contextType=h5;Hu.propTypes={};function a_(){}Hu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:a_,onEntering:a_,onEntered:a_,onExit:a_,onExiting:a_,onExited:a_};Hu.UNMOUNTED=N2;Hu.EXITED=Rx;Hu.ENTERING=Ix;Hu.ENTERED=cC;Hu.EXITING=tee;var Hpt=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return Vpt(t,r)})},UG=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return Wpt(t,r)})},zse=(function(e){jI(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;se.scrollTop;function j0(e,t){const{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:i.transitionDelay}}function Kpt(e){return pt("MuiCollapse",e)}dt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Zpt=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Xe(r,Kpt,n)},Jpt=Oe("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(Mt(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),egt=Oe("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),tgt=Oe("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),p5=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCollapse"}),{addEndListener:i,children:o,className:s,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:g,onExiting:m,orientation:v="vertical",style:y,timeout:b=yze.standard,TransitionComponent:w=Hu,...S}=r,_={...r,orientation:v,collapsedSize:a},E=Zpt(_),T=as(),k=zl(),P=M.useRef(null),I=M.useRef(),R=typeof a=="number"?`${a}px`:a,F=v==="horizontal",A=F?"width":"height",L=M.useRef(null),$=zn(n,L),j=Z=>ge=>{if(Z){const ne=L.current;ge===void 0?Z(ne):Z(ne,ge)}},V=()=>P.current?P.current[F?"clientWidth":"clientHeight"]:0,U=j((Z,ge)=>{P.current&&F&&(P.current.style.position="absolute"),Z.style[A]=R,f&&f(Z,ge)}),z=j((Z,ge)=>{const ne=V();P.current&&F&&(P.current.style.position="");const{duration:ie,easing:fe}=j0({style:y,timeout:b,easing:c},{mode:"enter"});if(b==="auto"){const ve=T.transitions.getAutoHeightDuration(ne);Z.style.transitionDuration=`${ve}ms`,I.current=ve}else Z.style.transitionDuration=typeof ie=="string"?ie:`${ie}ms`;Z.style[A]=`${ne}px`,Z.style.transitionTimingFunction=fe,h&&h(Z,ge)}),N=j((Z,ge)=>{Z.style[A]="auto",d&&d(Z,ge)}),B=j(Z=>{Z.style[A]=`${V()}px`,p&&p(Z)}),H=j(g),Q=j(Z=>{const ge=V(),{duration:ne,easing:ie}=j0({style:y,timeout:b,easing:c},{mode:"exit"});if(b==="auto"){const fe=T.transitions.getAutoHeightDuration(ge);Z.style.transitionDuration=`${fe}ms`,I.current=fe}else Z.style.transitionDuration=typeof ne=="string"?ne:`${ne}ms`;Z.style[A]=R,Z.style.transitionTimingFunction=ie,m&&m(Z)}),Y=Z=>{b==="auto"&&k.start(I.current||0,Z),i&&i(L.current,Z)};return O.jsx(w,{in:u,onEnter:U,onEntered:N,onEntering:z,onExit:B,onExited:H,onExiting:Q,addEndListener:Y,nodeRef:L,timeout:b==="auto"?null:b,...S,children:(Z,{ownerState:ge,...ne})=>O.jsx(Jpt,{as:l,className:Re(E.root,s,{entered:E.entered,exited:!u&&R==="0px"&&E.hidden}[Z]),style:{[F?"minWidth":"minHeight"]:R,...y},ref:$,ownerState:{..._,state:Z},...ne,children:O.jsx(egt,{ownerState:{..._,state:Z},className:E.wrapper,ref:P,children:O.jsx(tgt,{ownerState:{..._,state:Z},className:E.wrapperInner,children:o})})})})});p5&&(p5.muiSupportAuto=!0);function ngt(e){return pt("MuiPaper",e)}dt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const rgt=e=>{const{square:t,elevation:n,variant:r,classes:i}=e,o={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Xe(o,ngt,i)},igt=Oe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(Mt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),fa=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiPaper"}),i=as(),{className:o,component:s="div",elevation:a=1,square:l=!1,variant:c="elevation",...u}=r,f={...r,component:s,elevation:a,square:l,variant:c},d=rgt(f);return O.jsx(igt,{as:s,ownerState:f,className:Re(d.root,o),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(i.vars||i).shadows[a],...i.vars&&{"--Paper-overlay":i.vars.overlays?.[a]},...!i.vars&&i.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Vt("#fff",JJ(a))}, ${Vt("#fff",JJ(a))})`}},...u.style}})}),Oze=M.createContext({});function Zt(e,t){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,internalForwardedProps:s,shouldForwardComponentProp:a=!1,...l}=t,{component:c,slots:u={[e]:void 0},slotProps:f={[e]:void 0},...d}=o,h=u[e]||r,p=SA(f[e],i),{props:{component:g,...m},internalRef:v}=lze({className:n,...l,externalForwardedProps:e==="root"?d:void 0,externalSlotProps:p}),y=zn(v,p?.ref,t.ref),b=e==="root"?g||c:g,w=aze(h,{...e==="root"&&!c&&!u[e]&&s,...e!=="root"&&!u[e]&&s,...m,...b&&!a&&{as:b},...b&&a&&{component:b},ref:y},i);return[h,w]}function ogt(e){return pt("MuiAccordion",e)}const i$=dt("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),sgt=e=>{const{classes:t,square:n,expanded:r,disabled:i,disableGutters:o}=e;return Xe({root:["root",!n&&"rounded",r&&"expanded",i&&"disabled",!o&&"gutters"],heading:["heading"],region:["region"]},ogt,t)},agt=Oe(fa,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${i$.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(Mt(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${i$.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${i$.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),Mt(({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${i$.expanded}`]:{margin:"16px 0"}}}]}))),lgt=Oe("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(e,t)=>t.heading})({all:"unset"}),Use=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAccordion"}),{children:i,className:o,defaultExpanded:s=!1,disabled:a=!1,disableGutters:l=!1,expanded:c,onChange:u,square:f=!1,slots:d={},slotProps:h={},TransitionComponent:p,TransitionProps:g,...m}=r,[v,y]=Da({controlled:c,default:s,name:"Accordion",state:"expanded"}),b=M.useCallback(V=>{y(!v),u&&u(V,!v)},[v,u,y]),[w,...S]=M.Children.toArray(i),_=M.useMemo(()=>({expanded:v,disabled:a,disableGutters:l,toggle:b}),[v,a,l,b]),E={...r,square:f,disabled:a,disableGutters:l,expanded:v},T=sgt(E),k={transition:p,...d},P={transition:g,...h},I={slots:k,slotProps:P},[R,F]=Zt("root",{elementType:agt,externalForwardedProps:{...I,...m},className:Re(T.root,o),shouldForwardComponentProp:!0,ownerState:E,ref:n,additionalProps:{square:f}}),[A,L]=Zt("heading",{elementType:lgt,externalForwardedProps:I,className:T.heading,ownerState:E}),[$,j]=Zt("transition",{elementType:p5,externalForwardedProps:I,ownerState:E});return O.jsxs(R,{...F,children:[O.jsx(A,{...L,children:O.jsx(Oze.Provider,{value:_,children:w})}),O.jsx($,{in:v,timeout:"auto",...j,children:O.jsx("div",{"aria-labelledby":w.props.id,id:w.props["aria-controls"],role:"region",className:T.region,children:S})})]})});function cgt(e){return pt("MuiAccordionDetails",e)}dt("MuiAccordionDetails",["root"]);const ugt=e=>{const{classes:t}=e;return Xe({root:["root"]},cgt,t)},fgt=Oe("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(Mt(({theme:e})=>({padding:e.spacing(1,2,2)}))),Vse=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAccordionDetails"}),{className:i,...o}=r,s=r,a=ugt(s);return O.jsx(fgt,{className:Re(a.root,i),ref:n,ownerState:s,...o})});class g5{static create(){return new g5}static use(){const t=od(g5.create).current,[n,r]=M.useState(!1);return t.shouldMount=n,t.setShouldMount=r,M.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=hgt(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function dgt(){return g5.use()}function hgt(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function pgt(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,f]=M.useState(!1),d=Re(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},p=Re(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),M.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),O.jsx("span",{className:d,style:h,children:O.jsx("span",{className:p})})}const df=dt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),nee=550,ggt=80,mgt=dg` 0% { transform: scale(0); opacity: 0.1; @@ -73,7 +73,7 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s transform: scale(1); opacity: 0.3; } -`,Ivt=pg` +`,vgt=dg` 0% { opacity: 1; } @@ -81,7 +81,7 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s 100% { opacity: 0; } -`,Dvt=pg` +`,ygt=dg` 0% { transform: scale(1); } @@ -93,23 +93,23 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s 100% { transform: scale(1); } -`,Lvt=Oe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Fvt=Oe(Mvt,{name:"MuiTouchRipple",slot:"Ripple"})` +`,bgt=Oe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),xgt=Oe(pgt,{name:"MuiTouchRipple",slot:"Ripple"})` opacity: 0; position: absolute; - &.${hf.rippleVisible} { + &.${df.rippleVisible} { opacity: 0.3; transform: scale(1); - animation-name: ${Rvt}; - animation-duration: ${ste}ms; + animation-name: ${mgt}; + animation-duration: ${nee}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } - &.${hf.ripplePulsate} { + &.${df.ripplePulsate} { animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms; } - & .${hf.child} { + & .${df.child} { opacity: 1; display: block; width: 100%; @@ -118,25 +118,25 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s background-color: currentColor; } - & .${hf.childLeaving} { + & .${df.childLeaving} { opacity: 0; - animation-name: ${Ivt}; - animation-duration: ${ste}ms; + animation-name: ${vgt}; + animation-duration: ${nee}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } - & .${hf.childPulsate} { + & .${df.childPulsate} { position: absolute; /* @noflip */ left: 0px; top: 0; - animation-name: ${Dvt}; + animation-name: ${ygt}; animation-duration: 2500ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; animation-iteration-count: infinite; animation-delay: 200ms; } -`,$vt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s,...a}=r,[l,c]=M.useState([]),u=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=M.useRef(!1),h=jl(),p=M.useRef(null),g=M.useRef(null),m=M.useCallback(w=>{const{pulsate:S,rippleX:_,rippleY:E,rippleSize:T,cb:k}=w;c(P=>[...P,O.jsx(Fvt,{classes:{ripple:Re(o.ripple,hf.ripple),rippleVisible:Re(o.rippleVisible,hf.rippleVisible),ripplePulsate:Re(o.ripplePulsate,hf.ripplePulsate),child:Re(o.child,hf.child),childLeaving:Re(o.childLeaving,hf.childLeaving),childPulsate:Re(o.childPulsate,hf.childPulsate)},timeout:ste,pulsate:S,rippleX:_,rippleY:E,rippleSize:T},u.current)]),u.current+=1,f.current=k},[o]),v=M.useCallback((w={},S={},_=()=>{})=>{const{pulsate:E=!1,center:T=i||S.pulsate,fakeElement:k=!1}=S;if(w?.type==="mousedown"&&d.current){d.current=!1;return}w?.type==="touchstart"&&(d.current=!0);const P=k?null:g.current,R=P?P.getBoundingClientRect():{width:0,height:0,left:0,top:0};let I,F,A;if(T||w===void 0||w.clientX===0&&w.clientY===0||!w.clientX&&!w.touches)I=Math.round(R.width/2),F=Math.round(R.height/2);else{const{clientX:L,clientY:$}=w.touches&&w.touches.length>0?w.touches[0]:w;I=Math.round(L-R.left),F=Math.round($-R.top)}if(T)A=Math.sqrt((2*R.width**2+R.height**2)/3),A%2===0&&(A+=1);else{const L=Math.max(Math.abs((P?P.clientWidth:0)-I),I)*2+2,$=Math.max(Math.abs((P?P.clientHeight:0)-F),F)*2+2;A=Math.sqrt(L**2+$**2)}w?.touches?p.current===null&&(p.current=()=>{m({pulsate:E,rippleX:I,rippleY:F,rippleSize:A,cb:_})},h.start(Avt,()=>{p.current&&(p.current(),p.current=null)})):m({pulsate:E,rippleX:I,rippleY:F,rippleSize:A,cb:_})},[i,m,h]),y=M.useCallback(()=>{v({},{pulsate:!0})},[v]),b=M.useCallback((w,S)=>{if(h.clear(),w?.type==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{b(w,S)});return}p.current=null,c(_=>_.length>0?_.slice(1):_),f.current=S},[h]);return M.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:b}),[y,v,b]),O.jsx(Lvt,{className:Re(hf.root,o.root,s),ref:g,...a,children:O.jsx(ZI,{component:null,exit:!0,children:l})})});function Nvt(e){return pt("MuiButtonBase",e)}const zvt=dt("MuiButtonBase",["root","disabled","focusVisible"]),jvt=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,s=Xe({root:["root",t&&"disabled",n&&"focusVisible"]},Nvt,i);return n&&r&&(s.root+=` ${r}`),s},Bvt=Oe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${zvt.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Gf=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:p="a",onBlur:g,onClick:m,onContextMenu:v,onDragLeave:y,onFocus:b,onFocusVisible:w,onKeyDown:S,onKeyUp:_,onMouseDown:E,onMouseLeave:T,onMouseUp:k,onTouchEnd:P,onTouchMove:R,onTouchStart:I,tabIndex:F=0,TouchRippleProps:A,touchRippleRef:L,type:$,...j}=r,V=M.useRef(null),U=Pvt(),z=zn(U.ref,L),[N,B]=M.useState(!1);c&&N&&B(!1),M.useImperativeHandle(i,()=>({focusVisible:()=>{B(!0),V.current.focus()}}),[]);const H=U.shouldMount&&!u&&!c;M.useEffect(()=>{N&&d&&!u&&U.pulsate()},[u,d,N,U]);const Q=Gg(U,"start",E,f),Y=Gg(U,"stop",v,f),Z=Gg(U,"stop",y,f),pe=Gg(U,"stop",k,f),ie=Gg(U,"stop",ee=>{N&&ee.preventDefault(),T&&T(ee)},f),ne=Gg(U,"start",I,f),fe=Gg(U,"stop",P,f),me=Gg(U,"stop",R,f),se=Gg(U,"stop",ee=>{H0(ee.target)||B(!1),g&&g(ee)},!1),ue=ft(ee=>{V.current||(V.current=ee.currentTarget),H0(ee.target)&&(B(!0),w&&w(ee)),b&&b(ee)}),G=()=>{const ee=V.current;return l&&l!=="button"&&!(ee.tagName==="A"&&ee.href)},ce=ft(ee=>{d&&!ee.repeat&&N&&ee.key===" "&&U.stop(ee,()=>{U.start(ee)}),ee.target===ee.currentTarget&&G()&&ee.key===" "&&ee.preventDefault(),S&&S(ee),ee.target===ee.currentTarget&&G()&&ee.key==="Enter"&&!c&&(ee.preventDefault(),m&&m(ee))}),he=ft(ee=>{d&&ee.key===" "&&N&&!ee.defaultPrevented&&U.stop(ee,()=>{U.pulsate(ee)}),_&&_(ee),m&&ee.target===ee.currentTarget&&G()&&ee.key===" "&&!ee.defaultPrevented&&m(ee)});let J=l;J==="button"&&(j.href||j.to)&&(J=p);const te={};J==="button"?(te.type=$===void 0?"button":$,te.disabled=c):(!j.href&&!j.to&&(te.role="button"),c&&(te["aria-disabled"]=c));const ae=zn(n,V),we={...r,centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:F,focusVisible:N},Pe=jvt(we);return O.jsxs(Bvt,{as:J,className:Re(Pe.root,a),ownerState:we,onBlur:se,onClick:m,onContextMenu:Y,onFocus:ue,onKeyDown:ce,onKeyUp:he,onMouseDown:Q,onMouseLeave:ie,onMouseUp:pe,onDragLeave:Z,onTouchEnd:fe,onTouchMove:me,onTouchStart:ne,ref:ae,tabIndex:c?-1:F,type:$,...te,...j,children:[s,H?O.jsx($vt,{ref:z,center:o,...A}):null]})});function Gg(e,t,n,r=!1){return ft(i=>(n&&n(i),r||e[t](i),!0))}function Uvt(e){return pt("MuiAccordionSummary",e)}const Rm=dt("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),Vvt=e=>{const{classes:t,expanded:n,disabled:r,disableGutters:i}=e;return Xe({root:["root",n&&"expanded",r&&"disabled",!i&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!i&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},Uvt,t)},Wvt=Oe(Gf,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(Mt(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],t),[`&.${Rm.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Rm.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${Rm.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${Rm.expanded}`]:{minHeight:64}}}]}})),Hvt=Oe("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(Mt(({theme:e})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${Rm.expanded}`]:{margin:"20px 0"}}}]}))),Gvt=Oe("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(Mt(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${Rm.expanded}`]:{transform:"rotate(180deg)"}}))),Rje=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAccordionSummary"}),{children:i,className:o,expandIcon:s,focusVisibleClassName:a,onClick:l,slots:c,slotProps:u,...f}=r,{disabled:d=!1,disableGutters:h,expanded:p,toggle:g}=M.useContext(kje),m=P=>{g&&g(P),l&&l(P)},v={...r,expanded:p,disabled:d,disableGutters:h},y=Vvt(v),b={slots:c,slotProps:u},[w,S]=Zt("root",{ref:n,shouldForwardComponentProp:!0,className:Re(y.root,o),elementType:Wvt,externalForwardedProps:{...b,...f},ownerState:v,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:d,"aria-expanded":p,focusVisibleClassName:Re(y.focusVisible,a)},getSlotProps:P=>({...P,onClick:R=>{P.onClick?.(R),m(R)}})}),[_,E]=Zt("content",{className:y.content,elementType:Hvt,externalForwardedProps:b,ownerState:v}),[T,k]=Zt("expandIconWrapper",{className:y.expandIconWrapper,elementType:Gvt,externalForwardedProps:b,ownerState:v});return O.jsxs(w,{...S,children:[O.jsx(_,{...E,children:i}),s&&O.jsx(T,{...k,children:s})]})});function qvt(e){return typeof e.main=="string"}function Xvt(e,t=[]){if(!qvt(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function ai(e=[]){return([,t])=>t&&Xvt(t,e)}function Yvt(e){return pt("MuiCircularProgress",e)}dt("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const uy=44,ate=pg` +`,wgt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s,...a}=r,[l,c]=M.useState([]),u=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=M.useRef(!1),h=zl(),p=M.useRef(null),g=M.useRef(null),m=M.useCallback(w=>{const{pulsate:S,rippleX:_,rippleY:E,rippleSize:T,cb:k}=w;c(P=>[...P,O.jsx(xgt,{classes:{ripple:Re(o.ripple,df.ripple),rippleVisible:Re(o.rippleVisible,df.rippleVisible),ripplePulsate:Re(o.ripplePulsate,df.ripplePulsate),child:Re(o.child,df.child),childLeaving:Re(o.childLeaving,df.childLeaving),childPulsate:Re(o.childPulsate,df.childPulsate)},timeout:nee,pulsate:S,rippleX:_,rippleY:E,rippleSize:T},u.current)]),u.current+=1,f.current=k},[o]),v=M.useCallback((w={},S={},_=()=>{})=>{const{pulsate:E=!1,center:T=i||S.pulsate,fakeElement:k=!1}=S;if(w?.type==="mousedown"&&d.current){d.current=!1;return}w?.type==="touchstart"&&(d.current=!0);const P=k?null:g.current,I=P?P.getBoundingClientRect():{width:0,height:0,left:0,top:0};let R,F,A;if(T||w===void 0||w.clientX===0&&w.clientY===0||!w.clientX&&!w.touches)R=Math.round(I.width/2),F=Math.round(I.height/2);else{const{clientX:L,clientY:$}=w.touches&&w.touches.length>0?w.touches[0]:w;R=Math.round(L-I.left),F=Math.round($-I.top)}if(T)A=Math.sqrt((2*I.width**2+I.height**2)/3),A%2===0&&(A+=1);else{const L=Math.max(Math.abs((P?P.clientWidth:0)-R),R)*2+2,$=Math.max(Math.abs((P?P.clientHeight:0)-F),F)*2+2;A=Math.sqrt(L**2+$**2)}w?.touches?p.current===null&&(p.current=()=>{m({pulsate:E,rippleX:R,rippleY:F,rippleSize:A,cb:_})},h.start(ggt,()=>{p.current&&(p.current(),p.current=null)})):m({pulsate:E,rippleX:R,rippleY:F,rippleSize:A,cb:_})},[i,m,h]),y=M.useCallback(()=>{v({},{pulsate:!0})},[v]),b=M.useCallback((w,S)=>{if(h.clear(),w?.type==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{b(w,S)});return}p.current=null,c(_=>_.length>0?_.slice(1):_),f.current=S},[h]);return M.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:b}),[y,v,b]),O.jsx(bgt,{className:Re(df.root,o.root,s),ref:g,...a,children:O.jsx(BI,{component:null,exit:!0,children:l})})});function Sgt(e){return pt("MuiButtonBase",e)}const _gt=dt("MuiButtonBase",["root","disabled","focusVisible"]),Cgt=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,s=Xe({root:["root",t&&"disabled",n&&"focusVisible"]},Sgt,i);return n&&r&&(s.root+=` ${r}`),s},Ogt=Oe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${_gt.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Hf=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:p="a",onBlur:g,onClick:m,onContextMenu:v,onDragLeave:y,onFocus:b,onFocusVisible:w,onKeyDown:S,onKeyUp:_,onMouseDown:E,onMouseLeave:T,onMouseUp:k,onTouchEnd:P,onTouchMove:I,onTouchStart:R,tabIndex:F=0,TouchRippleProps:A,touchRippleRef:L,type:$,...j}=r,V=M.useRef(null),U=dgt(),z=zn(U.ref,L),[N,B]=M.useState(!1);c&&N&&B(!1),M.useImperativeHandle(i,()=>({focusVisible:()=>{B(!0),V.current.focus()}}),[]);const H=U.shouldMount&&!u&&!c;M.useEffect(()=>{N&&d&&!u&&U.pulsate()},[u,d,N,U]);const Q=Vg(U,"start",E,f),Y=Vg(U,"stop",v,f),Z=Vg(U,"stop",y,f),ge=Vg(U,"stop",k,f),ne=Vg(U,"stop",ee=>{N&&ee.preventDefault(),T&&T(ee)},f),ie=Vg(U,"start",R,f),fe=Vg(U,"stop",P,f),ve=Vg(U,"stop",I,f),se=Vg(U,"stop",ee=>{z0(ee.target)||B(!1),g&&g(ee)},!1),ue=ft(ee=>{V.current||(V.current=ee.currentTarget),z0(ee.target)&&(B(!0),w&&w(ee)),b&&b(ee)}),G=()=>{const ee=V.current;return l&&l!=="button"&&!(ee.tagName==="A"&&ee.href)},ce=ft(ee=>{d&&!ee.repeat&&N&&ee.key===" "&&U.stop(ee,()=>{U.start(ee)}),ee.target===ee.currentTarget&&G()&&ee.key===" "&&ee.preventDefault(),S&&S(ee),ee.target===ee.currentTarget&&G()&&ee.key==="Enter"&&!c&&(ee.preventDefault(),m&&m(ee))}),pe=ft(ee=>{d&&ee.key===" "&&N&&!ee.defaultPrevented&&U.stop(ee,()=>{U.pulsate(ee)}),_&&_(ee),m&&ee.target===ee.currentTarget&&G()&&ee.key===" "&&!ee.defaultPrevented&&m(ee)});let J=l;J==="button"&&(j.href||j.to)&&(J=p);const te={};J==="button"?(te.type=$===void 0?"button":$,te.disabled=c):(!j.href&&!j.to&&(te.role="button"),c&&(te["aria-disabled"]=c));const ae=zn(n,V),we={...r,centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:F,focusVisible:N},Pe=Cgt(we);return O.jsxs(Ogt,{as:J,className:Re(Pe.root,a),ownerState:we,onBlur:se,onClick:m,onContextMenu:Y,onFocus:ue,onKeyDown:ce,onKeyUp:pe,onMouseDown:Q,onMouseLeave:ne,onMouseUp:ge,onDragLeave:Z,onTouchEnd:fe,onTouchMove:ve,onTouchStart:ie,ref:ae,tabIndex:c?-1:F,type:$,...te,...j,children:[s,H?O.jsx(wgt,{ref:z,center:o,...A}):null]})});function Vg(e,t,n,r=!1){return ft(i=>(n&&n(i),r||e[t](i),!0))}function Egt(e){return pt("MuiAccordionSummary",e)}const km=dt("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),Tgt=e=>{const{classes:t,expanded:n,disabled:r,disableGutters:i}=e;return Xe({root:["root",n&&"expanded",r&&"disabled",!i&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!i&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},Egt,t)},Pgt=Oe(Hf,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(Mt(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],t),[`&.${km.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${km.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${km.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${km.expanded}`]:{minHeight:64}}}]}})),kgt=Oe("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(Mt(({theme:e})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${km.expanded}`]:{margin:"20px 0"}}}]}))),Mgt=Oe("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(Mt(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${km.expanded}`]:{transform:"rotate(180deg)"}}))),Wse=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAccordionSummary"}),{children:i,className:o,expandIcon:s,focusVisibleClassName:a,onClick:l,slots:c,slotProps:u,...f}=r,{disabled:d=!1,disableGutters:h,expanded:p,toggle:g}=M.useContext(Oze),m=P=>{g&&g(P),l&&l(P)},v={...r,expanded:p,disabled:d,disableGutters:h},y=Tgt(v),b={slots:c,slotProps:u},[w,S]=Zt("root",{ref:n,shouldForwardComponentProp:!0,className:Re(y.root,o),elementType:Pgt,externalForwardedProps:{...b,...f},ownerState:v,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:d,"aria-expanded":p,focusVisibleClassName:Re(y.focusVisible,a)},getSlotProps:P=>({...P,onClick:I=>{P.onClick?.(I),m(I)}})}),[_,E]=Zt("content",{className:y.content,elementType:kgt,externalForwardedProps:b,ownerState:v}),[T,k]=Zt("expandIconWrapper",{className:y.expandIconWrapper,elementType:Mgt,externalForwardedProps:b,ownerState:v});return O.jsxs(w,{...S,children:[O.jsx(_,{...E,children:i}),s&&O.jsx(T,{...k,children:s})]})});function Agt(e){return typeof e.main=="string"}function Rgt(e,t=[]){if(!Agt(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function ai(e=[]){return([,t])=>t&&Rgt(t,e)}function Igt(e){return pt("MuiCircularProgress",e)}dt("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const sy=44,ree=dg` 0% { transform: rotate(0deg); } @@ -144,7 +144,7 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s 100% { transform: rotate(360deg); } -`,lte=pg` +`,iee=dg` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; @@ -159,12 +159,12 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s stroke-dasharray: 1px, 200px; stroke-dashoffset: -126px; } -`,Qvt=typeof ate!="string"?bb` - animation: ${ate} 1.4s linear infinite; - `:null,Kvt=typeof lte!="string"?bb` - animation: ${lte} 1.4s ease-in-out infinite; - `:null,Zvt=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${Ve(r)}`],svg:["svg"],circle:["circle",`circle${Ve(n)}`,i&&"circleDisableShrink"]};return Xe(o,Yvt,t)},Jvt=Oe("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Ve(n.color)}`]]}})(Mt(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Qvt||{animation:`${ate} 1.4s linear infinite`}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),eyt=Oe("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),tyt=Oe("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Ve(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(Mt(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:Kvt||{animation:`${lte} 1.4s ease-in-out infinite`}}]}))),Eh=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,size:a=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate",...d}=r,h={...r,color:o,disableShrink:s,size:a,thickness:c,value:u,variant:f},p=Zvt(h),g={},m={},v={};if(f==="determinate"){const y=2*Math.PI*((uy-c)/2);g.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,m.transform="rotate(-90deg)"}return O.jsx(Jvt,{className:Re(p.root,i),style:{width:a,height:a,...m,...l},ownerState:h,ref:n,role:"progressbar",...v,...d,children:O.jsx(eyt,{className:p.svg,ownerState:h,viewBox:`${uy/2} ${uy/2} ${uy} ${uy}`,children:O.jsx(tyt,{className:p.circle,style:g,ownerState:h,cx:uy,cy:uy,r:(uy-c)/2,fill:"none",strokeWidth:c})})})});function nyt(e){return pt("MuiIconButton",e)}const Vxe=dt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),ryt=e=>{const{classes:t,disabled:n,color:r,edge:i,size:o,loading:s}=e,a={root:["root",s&&"loading",n&&"disabled",r!=="default"&&`color${Ve(r)}`,i&&`edge${Ve(i)}`,`size${Ve(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Xe(a,nyt,t)},iyt=Oe(Gf,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Ve(n.color)}`],n.edge&&t[`edge${Ve(n.edge)}`],t[`size${Ve(n.size)}`]]}})(Mt(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Mt(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${Vxe.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${Vxe.loading}`]:{color:"transparent"}}))),oyt=Oe("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Mn=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",id:f,loading:d=null,loadingIndicator:h,...p}=r,g=ur(f),m=h??O.jsx(Eh,{"aria-labelledby":g,color:"inherit",size:16}),v={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,loading:d,loadingIndicator:m,size:u},y=ryt(v);return O.jsxs(iyt,{id:d?g:f,className:Re(y.root,s),centerRipple:!0,focusRipple:!c,disabled:l||d,ref:n,...p,ownerState:v,children:[typeof d=="boolean"&&O.jsx("span",{className:y.loadingWrapper,style:{display:"contents"},children:O.jsx(oyt,{className:y.loadingIndicator,ownerState:v,children:d&&m})}),o]})}),syt=ot(O.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function ayt(e){return pt("MuiTypography",e)}const z5=dt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),lyt={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},cyt=evt(),uyt=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=e,a={root:["root",o,e.align!=="inherit"&&`align${Ve(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Xe(a,ayt,s)},fyt=Oe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Ve(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(Mt(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Ve(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),Wxe={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},yn=M.forwardRef(function(t,n){const{color:r,...i}=Dt({props:t,name:"MuiTypography"}),o=!lyt[r],s=cyt({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=Wxe,...g}=s,m={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:f,paragraph:d,variant:h,variantMapping:p},v=c||(d?"p":p[h]||Wxe[h])||"span",y=uyt(m);return O.jsx(fyt,{as:v,ref:n,className:Re(y.root,l),...g,ownerState:m,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...g.style}})});function dyt(e){return pt("MuiAppBar",e)}dt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const hyt=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${Ve(t)}`,`position${Ve(n)}`]};return Xe(i,dyt,r)},Hxe=(e,t)=>e?`${e?.replace(")","")}, ${t})`:t,pyt=Oe(fa,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Ve(n.position)}`],t[`color${Ve(n.color)}`]]}})(Mt(({theme:e})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles("dark",{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(ai(["contrastText"])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:t=>t.enableColorOnDark===!0&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:t=>t.enableColorOnDark===!1&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundColor:e.vars?Hxe(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?Hxe(e.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundImage:"none"})}}]}))),Ije=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=hyt(c);return O.jsx(pyt,{square:!0,component:"header",ownerState:c,elevation:4,className:Re(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function Gxe(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Dje(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:s=!1}=e;return(a,{inputValue:l,getOptionLabel:c})=>{let u=s?l.trim():l;n&&(u=u.toLowerCase()),t&&(u=Gxe(u));const f=u?a.filter(d=>{let h=(o||c)(d);return n&&(h=h.toLowerCase()),t&&(h=Gxe(h)),i==="start"?h.startsWith(u):h.includes(u)}):a;return typeof r=="number"?f.slice(0,r):f}}const gyt=Dje(),qxe=5,myt=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),vyt=[];function Xxe(e,t,n){if(t||e==null)return"";const r=n(e);return typeof r=="string"?r:""}function yyt(e){const{unstable_isActiveElementInListbox:t=myt,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:i=!1,autoSelect:o=!1,blurOnSelect:s=!1,clearOnBlur:a=!e.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=e.multiple?vyt:null,disableClearable:f=!1,disableCloseOnSelect:d=!1,disabled:h,disabledItemsFocusable:p=!1,disableListWrap:g=!1,filterOptions:m=gyt,filterSelectedOptions:v=!1,freeSolo:y=!1,getOptionDisabled:b,getOptionKey:w,getOptionLabel:S=Ge=>Ge.label??Ge,groupBy:_,handleHomeEndKeys:E=!e.freeSolo,id:T,includeInputInList:k=!1,inputValue:P,isOptionEqualToValue:R=(Ge,Be)=>Ge===Be,multiple:I=!1,onChange:F,onClose:A,onHighlightChange:L,onInputChange:$,onOpen:j,open:V,openOnFocus:U=!1,options:z,readOnly:N=!1,selectOnFocus:B=!e.freeSolo,value:H}=e,Q=ur(T);let Y=S;Y=Ge=>{const Be=S(Ge);return typeof Be!="string"?String(Be):Be};const Z=M.useRef(!1),pe=M.useRef(!0),ie=M.useRef(null),ne=M.useRef(null),[fe,me]=M.useState(null),[se,ue]=M.useState(-1),G=i?0:-1,ce=M.useRef(G),he=M.useRef(Xxe(u??H,I,Y)).current,[J,te]=Fa({controlled:H,default:u,name:c}),[ae,we]=Fa({controlled:P,default:he,name:c,state:"inputValue"}),[Pe,ee]=M.useState(!1),oe=M.useCallback((Ge,Be,yt)=>{if(!(I?J.length!(v&&(I?J:[J]).some(Be=>Be!==null&&R(Ge,Be)))),{inputValue:xe&&be?"":ae,getOptionLabel:Y}):[],ke=Vae({filteredOptions:Ee,value:J,inputValue:ae});M.useEffect(()=>{const Ge=J!==ke.value;Pe&&!Ge||y&&!Ge||oe(null,J,"reset")},[J,oe,Pe,ke.value,y]);const je=Se&&Ee.length>0&&!N,De=ft(Ge=>{Ge===-1?ie.current.focus():fe.querySelector(`[data-tag-index="${Ge}"]`).focus()});M.useEffect(()=>{I&&se>J.length-1&&(ue(-1),De(-1))},[J,I,se,De]);function ze(Ge,Be){if(!ne.current||Ge<0||Ge>=Ee.length)return-1;let yt=Ge;for(;;){const Nt=ne.current.querySelector(`[data-option-index="${yt}"]`),Xt=p?!1:!Nt||Nt.disabled||Nt.getAttribute("aria-disabled")==="true";if(Nt&&Nt.hasAttribute("tabindex")&&!Xt)return yt;if(Be==="next"?yt=(yt+1)%Ee.length:yt=(yt-1+Ee.length)%Ee.length,yt===Ge)return-1}}const Je=ft(({event:Ge,index:Be,reason:yt})=>{if(ce.current=Be,Be===-1?ie.current.removeAttribute("aria-activedescendant"):ie.current.setAttribute("aria-activedescendant",`${Q}-option-${Be}`),L&&["mouse","keyboard","touch"].includes(yt)&&L(Ge,Be===-1?null:Ee[Be],yt),!ne.current)return;const Nt=ne.current.querySelector(`[role="option"].${n}-focused`);Nt&&(Nt.classList.remove(`${n}-focused`),Nt.classList.remove(`${n}-focusVisible`));let Xt=ne.current;if(ne.current.getAttribute("role")!=="listbox"&&(Xt=ne.current.parentElement.querySelector('[role="listbox"]')),!Xt)return;if(Be===-1){Xt.scrollTop=0;return}const Tn=ne.current.querySelector(`[data-option-index="${Be}"]`);if(Tn&&(Tn.classList.add(`${n}-focused`),yt==="keyboard"&&Tn.classList.add(`${n}-focusVisible`),Xt.scrollHeight>Xt.clientHeight&&yt!=="mouse"&&yt!=="touch")){const Jr=Tn,Wo=Xt.clientHeight+Xt.scrollTop,qu=Jr.offsetTop+Jr.offsetHeight;qu>Wo?Xt.scrollTop=qu-Xt.clientHeight:Jr.offsetTop-Jr.offsetHeight*(_?1.3:0){if(!re)return;const Tn=ze((()=>{const Jr=Ee.length-1;if(Be==="reset")return G;if(Be==="start")return 0;if(Be==="end")return Jr;const Wo=ce.current+Be;return Wo<0?Wo===-1&&k?-1:g&&ce.current!==-1||Math.abs(Be)>1?0:Jr:Wo>Jr?Wo===Jr+1&&k?-1:g||Math.abs(Be)>1?Jr:0:Wo})(),yt);if(Je({index:Tn,reason:Nt,event:Ge}),r&&Be!=="reset")if(Tn===-1)ie.current.value=ae;else{const Jr=Y(Ee[Tn]);ie.current.value=Jr,Jr.toLowerCase().indexOf(ae.toLowerCase())===0&&ae.length>0&&ie.current.setSelectionRange(ae.length,Jr.length)}}),Me=()=>{const Ge=(Be,yt)=>{const Nt=Be?Y(Be):"",Xt=yt?Y(yt):"";return Nt===Xt};if(ce.current!==-1&&ke.filteredOptions&&ke.filteredOptions.length!==Ee.length&&ke.inputValue===ae&&(I?J.length===ke.value.length&&ke.value.every((Be,yt)=>Y(J[yt])===Y(Be)):Ge(ke.value,J))){const Be=ke.filteredOptions[ce.current];if(Be)return Ee.findIndex(yt=>Y(yt)===Y(Be))}return-1},st=M.useCallback(()=>{if(!re)return;const Ge=Me();if(Ge!==-1){ce.current=Ge;return}const Be=I?J[0]:J;if(Ee.length===0||Be==null){mt({diff:"reset"});return}if(ne.current){if(Be!=null){const yt=Ee[ce.current];if(I&&yt&&J.findIndex(Xt=>R(yt,Xt))!==-1)return;const Nt=Ee.findIndex(Xt=>R(Xt,Be));Nt===-1?mt({diff:"reset"}):Je({index:Nt});return}if(ce.current>=Ee.length-1){Je({index:Ee.length-1});return}Je({index:ce.current})}},[Ee.length,I?!1:J,v,mt,Je,re,ae,I]),Fe=ft(Ge=>{tte(ne,Ge),Ge&&st()});M.useEffect(()=>{st()},[st]);const ht=Ge=>{Se||(ye(!0),ge(!0),j&&j(Ge))},gt=(Ge,Be)=>{Se&&(ye(!1),A&&A(Ge,Be))},St=(Ge,Be,yt,Nt)=>{if(I){if(J.length===Be.length&&J.every((Xt,Tn)=>Xt===Be[Tn]))return}else if(J===Be)return;F&&F(Ge,Be,yt,Nt),te(Be)},on=M.useRef(!1),Dn=(Ge,Be,yt="selectOption",Nt="options")=>{let Xt=yt,Tn=Be;if(I){Tn=Array.isArray(J)?J.slice():[];const Jr=Tn.findIndex(Wo=>R(Be,Wo));Jr===-1?Tn.push(Be):Nt!=="freeSolo"&&(Tn.splice(Jr,1),Xt="removeOption")}oe(Ge,Tn,Xt),St(Ge,Tn,Xt,{option:Be}),!d&&(!Ge||!Ge.ctrlKey&&!Ge.metaKey)&>(Ge,Xt),(s===!0||s==="touch"&&on.current||s==="mouse"&&!on.current)&&ie.current.blur()};function wi(Ge,Be){if(Ge===-1)return-1;let yt=Ge;for(;;){if(Be==="next"&&yt===J.length||Be==="previous"&&yt===-1)return-1;const Nt=fe.querySelector(`[data-tag-index="${yt}"]`);if(!Nt||!Nt.hasAttribute("tabindex")||Nt.disabled||Nt.getAttribute("aria-disabled")==="true")yt+=Be==="next"?1:-1;else return yt}}const jn=(Ge,Be)=>{if(!I)return;ae===""&>(Ge,"toggleInput");let yt=se;se===-1?ae===""&&Be==="previous"&&(yt=J.length-1):(yt+=Be==="next"?1:-1,yt<0&&(yt=0),yt===J.length&&(yt=-1)),yt=wi(yt,Be),ue(yt),De(yt)},sn=Ge=>{Z.current=!0,we(""),$&&$(Ge,"","clear"),St(Ge,I?[]:null,"clear")},br=Ge=>Be=>{if(Ge.onKeyDown&&Ge.onKeyDown(Be),!Be.defaultMuiPrevented&&(se!==-1&&!["ArrowLeft","ArrowRight"].includes(Be.key)&&(ue(-1),De(-1)),Be.which!==229))switch(Be.key){case"Home":re&&E&&(Be.preventDefault(),mt({diff:"start",direction:"next",reason:"keyboard",event:Be}));break;case"End":re&&E&&(Be.preventDefault(),mt({diff:"end",direction:"previous",reason:"keyboard",event:Be}));break;case"PageUp":Be.preventDefault(),mt({diff:-qxe,direction:"previous",reason:"keyboard",event:Be}),ht(Be);break;case"PageDown":Be.preventDefault(),mt({diff:qxe,direction:"next",reason:"keyboard",event:Be}),ht(Be);break;case"ArrowDown":Be.preventDefault(),mt({diff:1,direction:"next",reason:"keyboard",event:Be}),ht(Be);break;case"ArrowUp":Be.preventDefault(),mt({diff:-1,direction:"previous",reason:"keyboard",event:Be}),ht(Be);break;case"ArrowLeft":jn(Be,"previous");break;case"ArrowRight":jn(Be,"next");break;case"Enter":if(ce.current!==-1&&re){const yt=Ee[ce.current],Nt=b?b(yt):!1;if(Be.preventDefault(),Nt)return;Dn(Be,yt,"selectOption"),r&&ie.current.setSelectionRange(ie.current.value.length,ie.current.value.length)}else y&&ae!==""&&xe===!1&&(I&&Be.preventDefault(),Dn(Be,ae,"createOption","freeSolo"));break;case"Escape":re?(Be.preventDefault(),Be.stopPropagation(),gt(Be,"escape")):l&&(ae!==""||I&&J.length>0)&&(Be.preventDefault(),Be.stopPropagation(),sn(Be));break;case"Backspace":if(I&&!N&&ae===""&&J.length>0){const yt=se===-1?J.length-1:se,Nt=J.slice();Nt.splice(yt,1),St(Be,Nt,"removeOption",{option:J[yt]})}break;case"Delete":if(I&&!N&&ae===""&&J.length>0&&se!==-1){const yt=se,Nt=J.slice();Nt.splice(yt,1),St(Be,Nt,"removeOption",{option:J[yt]})}break}},$t=Ge=>{ee(!0),U&&!Z.current&&ht(Ge)},Ut=Ge=>{if(t(ne)){ie.current.focus();return}ee(!1),pe.current=!0,Z.current=!1,o&&ce.current!==-1&&re?Dn(Ge,Ee[ce.current],"blur"):o&&y&&ae!==""?Dn(Ge,ae,"blur","freeSolo"):a&&oe(Ge,J,"blur"),gt(Ge,"blur")},Wn=Ge=>{const Be=Ge.target.value;ae!==Be&&(we(Be),ge(!1),$&&$(Ge,Be,"input")),Be===""?!f&&!I&&St(Ge,null,"clear"):ht(Ge)},Nn=Ge=>{const Be=Number(Ge.currentTarget.getAttribute("data-option-index"));ce.current!==Be&&Je({event:Ge,index:Be,reason:"mouse"})},fi=Ge=>{Je({event:Ge,index:Number(Ge.currentTarget.getAttribute("data-option-index")),reason:"touch"}),on.current=!0},po=Ge=>{const Be=Number(Ge.currentTarget.getAttribute("data-option-index"));Dn(Ge,Ee[Be],"selectOption"),on.current=!1},_e=Ge=>Be=>{const yt=J.slice();yt.splice(Ge,1),St(Be,yt,"removeOption",{option:J[Ge]})},Ue=Ge=>{Se?gt(Ge,"toggleInput"):ht(Ge)},Qe=Ge=>{Ge.currentTarget.contains(Ge.target)&&Ge.target.getAttribute("id")!==Q&&Ge.preventDefault()},$e=Ge=>{Ge.currentTarget.contains(Ge.target)&&(ie.current.focus(),B&&pe.current&&ie.current.selectionEnd-ie.current.selectionStart===0&&ie.current.select(),pe.current=!1)},Ke=Ge=>{!h&&(ae===""||!Se)&&Ue(Ge)};let Lt=y&&ae.length>0;Lt=Lt||(I?J.length>0:J!==null);let rn=Ee;return _&&(rn=Ee.reduce((Ge,Be,yt)=>{const Nt=_(Be);return Ge.length>0&&Ge[Ge.length-1].group===Nt?Ge[Ge.length-1].options.push(Be):Ge.push({key:yt,index:yt,group:Nt,options:[Be]}),Ge},[])),h&&Pe&&Ut(),{getRootProps:(Ge={})=>({...Ge,onKeyDown:br(Ge),onMouseDown:Qe,onClick:$e}),getInputLabelProps:()=>({id:`${Q}-label`,htmlFor:Q}),getInputProps:()=>({id:Q,value:ae,onBlur:Ut,onFocus:$t,onChange:Wn,onMouseDown:Ke,"aria-activedescendant":re?"":null,"aria-autocomplete":r?"both":"list","aria-controls":je?`${Q}-listbox`:void 0,"aria-expanded":je,autoComplete:"off",ref:ie,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:h}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:sn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Ue}),getTagProps:({index:Ge})=>({key:Ge,"data-tag-index":Ge,tabIndex:-1,...!N&&{onDelete:_e(Ge)}}),getListboxProps:()=>({role:"listbox",id:`${Q}-listbox`,"aria-labelledby":`${Q}-label`,ref:Fe,onMouseDown:Ge=>{Ge.preventDefault()}}),getOptionProps:({index:Ge,option:Be})=>{const yt=(I?J:[J]).some(Xt=>Xt!=null&&R(Be,Xt)),Nt=b?b(Be):!1;return{key:w?.(Be)??Y(Be),tabIndex:-1,role:"option",id:`${Q}-option-${Ge}`,onMouseMove:Nn,onClick:po,onTouchStart:fi,"data-option-index":Ge,"aria-disabled":Nt,"aria-selected":yt}},id:Q,inputValue:ae,value:J,dirty:Lt,expanded:re&&fe,popupOpen:re,focused:Pe||se!==-1,anchorEl:fe,setAnchorEl:me,focusedTag:se,groupedOptions:rn}}var Mc="top",qf="bottom",Xf="right",Ac="left",Kae="auto",JI=[Mc,qf,Xf,Ac],BO="start",DA="end",byt="clippingParents",Lje="viewport",Sk="popper",xyt="reference",Yxe=JI.reduce(function(e,t){return e.concat([t+"-"+BO,t+"-"+DA])},[]),Fje=[].concat(JI,[Kae]).reduce(function(e,t){return e.concat([t,t+"-"+BO,t+"-"+DA])},[]),wyt="beforeRead",Syt="read",_yt="afterRead",Cyt="beforeMain",Oyt="main",Eyt="afterMain",Tyt="beforeWrite",Pyt="write",kyt="afterWrite",Myt=[wyt,Syt,_yt,Cyt,Oyt,Eyt,Tyt,Pyt,kyt];function Jp(e){return e?(e.nodeName||"").toLowerCase():null}function $u(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function rw(e){var t=$u(e).Element;return e instanceof t||e instanceof Element}function Df(e){var t=$u(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zae(e){if(typeof ShadowRoot>"u")return!1;var t=$u(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Ayt(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Df(o)||!Jp(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function Ryt(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!Df(i)||!Jp(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Iyt={name:"applyStyles",enabled:!0,phase:"write",fn:Ayt,effect:Ryt,requires:["computeStyles"]};function $p(e){return e.split("-")[0]}var M1=Math.max,j5=Math.min,UO=Math.round;function cte(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function $je(){return!/^((?!chrome|android).)*safari/i.test(cte())}function VO(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Df(e)&&(i=e.offsetWidth>0&&UO(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&UO(r.height)/e.offsetHeight||1);var s=rw(e)?$u(e):window,a=s.visualViewport,l=!$je()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function Jae(e){var t=VO(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Nje(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Zae(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function uv(e){return $u(e).getComputedStyle(e)}function Dyt(e){return["table","td","th"].indexOf(Jp(e))>=0}function wb(e){return((rw(e)?e.ownerDocument:e.document)||window.document).documentElement}function Z6(e){return Jp(e)==="html"?e:e.assignedSlot||e.parentNode||(Zae(e)?e.host:null)||wb(e)}function Qxe(e){return!Df(e)||uv(e).position==="fixed"?null:e.offsetParent}function Lyt(e){var t=/firefox/i.test(cte()),n=/Trident/i.test(cte());if(n&&Df(e)){var r=uv(e);if(r.position==="fixed")return null}var i=Z6(e);for(Zae(i)&&(i=i.host);Df(i)&&["html","body"].indexOf(Jp(i))<0;){var o=uv(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function eD(e){for(var t=$u(e),n=Qxe(e);n&&Dyt(n)&&uv(n).position==="static";)n=Qxe(n);return n&&(Jp(n)==="html"||Jp(n)==="body"&&uv(n).position==="static")?t:n||Lyt(e)||t}function ele(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function BM(e,t,n){return M1(e,j5(t,n))}function Fyt(e,t,n){var r=BM(e,t,n);return r>n?n:r}function zje(){return{top:0,right:0,bottom:0,left:0}}function jje(e){return Object.assign({},zje(),e)}function Bje(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var $yt=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,jje(typeof t!="number"?t:Bje(t,JI))};function Nyt(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=$p(n.placement),l=ele(a),c=[Ac,Xf].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=$yt(i.padding,n),d=Jae(o),h=l==="y"?Mc:Ac,p=l==="y"?qf:Xf,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=eD(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,b=g/2-m/2,w=f[h],S=y-d[u]-f[p],_=y/2-d[u]/2+b,E=BM(w,_,S),T=l;n.modifiersData[r]=(t={},t[T]=E,t.centerOffset=E-_,t)}}function zyt(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Nje(t.elements.popper,i)&&(t.elements.arrow=i))}const jyt={name:"arrow",enabled:!0,phase:"main",fn:Nyt,effect:zyt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function WO(e){return e.split("-")[1]}var Byt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Uyt(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:UO(n*i)/i||0,y:UO(r*i)/i||0}}function Kxe(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=Ac,w=Mc,S=window;if(c){var _=eD(n),E="clientHeight",T="clientWidth";if(_===$u(n)&&(_=wb(n),uv(_).position!=="static"&&a==="absolute"&&(E="scrollHeight",T="scrollWidth")),_=_,i===Mc||(i===Ac||i===Xf)&&o===DA){w=qf;var k=f&&_===S&&S.visualViewport?S.visualViewport.height:_[E];g-=k-r.height,g*=l?1:-1}if(i===Ac||(i===Mc||i===qf)&&o===DA){b=Xf;var P=f&&_===S&&S.visualViewport?S.visualViewport.width:_[T];h-=P-r.width,h*=l?1:-1}}var R=Object.assign({position:a},c&&Byt),I=u===!0?Uyt({x:h,y:g},$u(n)):{x:h,y:g};if(h=I.x,g=I.y,l){var F;return Object.assign({},R,(F={},F[w]=y?"0":"",F[b]=v?"0":"",F.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",F))}return Object.assign({},R,(t={},t[w]=y?g+"px":"",t[b]=v?h+"px":"",t.transform="",t))}function Vyt(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:$p(t.placement),variation:WO(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Kxe(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Kxe(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Wyt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Vyt,data:{}};var b$={passive:!0};function Hyt(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=$u(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,b$)}),a&&l.addEventListener("resize",n.update,b$),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,b$)}),a&&l.removeEventListener("resize",n.update,b$)}}const Gyt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Hyt,data:{}};var qyt={left:"right",right:"left",bottom:"top",top:"bottom"};function Tz(e){return e.replace(/left|right|bottom|top/g,function(t){return qyt[t]})}var Xyt={start:"end",end:"start"};function Zxe(e){return e.replace(/start|end/g,function(t){return Xyt[t]})}function tle(e){var t=$u(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function nle(e){return VO(wb(e)).left+tle(e).scrollLeft}function Yyt(e,t){var n=$u(e),r=wb(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=$je();(c||!c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+nle(e),y:l}}function Qyt(e){var t,n=wb(e),r=tle(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=M1(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=M1(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+nle(e),l=-r.scrollTop;return uv(i||n).direction==="rtl"&&(a+=M1(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function rle(e){var t=uv(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Uje(e){return["html","body","#document"].indexOf(Jp(e))>=0?e.ownerDocument.body:Df(e)&&rle(e)?e:Uje(Z6(e))}function UM(e,t){var n;t===void 0&&(t=[]);var r=Uje(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=$u(r),s=i?[o].concat(o.visualViewport||[],rle(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(UM(Z6(s)))}function ute(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Kyt(e,t){var n=VO(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Jxe(e,t,n){return t===Lje?ute(Yyt(e,n)):rw(t)?Kyt(t,n):ute(Qyt(wb(e)))}function Zyt(e){var t=UM(Z6(e)),n=["absolute","fixed"].indexOf(uv(e).position)>=0,r=n&&Df(e)?eD(e):e;return rw(r)?t.filter(function(i){return rw(i)&&Nje(i,r)&&Jp(i)!=="body"}):[]}function Jyt(e,t,n,r){var i=t==="clippingParents"?Zyt(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=Jxe(e,c,r);return l.top=M1(u.top,l.top),l.right=j5(u.right,l.right),l.bottom=j5(u.bottom,l.bottom),l.left=M1(u.left,l.left),l},Jxe(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Vje(e){var t=e.reference,n=e.element,r=e.placement,i=r?$p(r):null,o=r?WO(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(i){case Mc:l={x:s,y:t.y-n.height};break;case qf:l={x:s,y:t.y+t.height};break;case Xf:l={x:t.x+t.width,y:a};break;case Ac:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=i?ele(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case BO:l[c]=l[c]-(t[u]/2-n[u]/2);break;case DA:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function LA(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?byt:a,c=n.rootBoundary,u=c===void 0?Lje:c,f=n.elementContext,d=f===void 0?Sk:f,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,m=g===void 0?0:g,v=jje(typeof m!="number"?m:Bje(m,JI)),y=d===Sk?xyt:Sk,b=e.rects.popper,w=e.elements[p?y:d],S=Jyt(rw(w)?w:w.contextElement||wb(e.elements.popper),l,u,s),_=VO(e.elements.reference),E=Vje({reference:_,element:b,placement:i}),T=ute(Object.assign({},b,E)),k=d===Sk?T:_,P={top:S.top-k.top+v.top,bottom:k.bottom-S.bottom+v.bottom,left:S.left-k.left+v.left,right:k.right-S.right+v.right},R=e.modifiersData.offset;if(d===Sk&&R){var I=R[i];Object.keys(P).forEach(function(F){var A=[Xf,qf].indexOf(F)>=0?1:-1,L=[Mc,qf].indexOf(F)>=0?"y":"x";P[F]+=I[L]*A})}return P}function e0t(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?Fje:l,u=WO(r),f=u?a?Yxe:Yxe.filter(function(p){return WO(p)===u}):JI,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,g){return p[g]=LA(e,{placement:g,boundary:i,rootBoundary:o,padding:s})[$p(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function t0t(e){if($p(e)===Kae)return[];var t=Tz(e);return[Zxe(e),t,Zxe(t)]}function n0t(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,m=t.options.placement,v=$p(m),y=v===m,b=l||(y||!p?[Tz(m)]:t0t(m)),w=[m].concat(b).reduce(function(Q,Y){return Q.concat($p(Y)===Kae?e0t(t,{placement:Y,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):Y)},[]),S=t.rects.reference,_=t.rects.popper,E=new Map,T=!0,k=w[0],P=0;P=0,L=A?"width":"height",$=LA(t,{placement:R,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),j=A?F?Xf:Ac:F?qf:Mc;S[L]>_[L]&&(j=Tz(j));var V=Tz(j),U=[];if(o&&U.push($[I]<=0),a&&U.push($[j]<=0,$[V]<=0),U.every(function(Q){return Q})){k=R,T=!1;break}E.set(R,U)}if(T)for(var z=p?3:1,N=function(Y){var Z=w.find(function(pe){var ie=E.get(pe);if(ie)return ie.slice(0,Y).every(function(ne){return ne})});if(Z)return k=Z,"break"},B=z;B>0;B--){var H=N(B);if(H==="break")break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}}const r0t={name:"flip",enabled:!0,phase:"main",fn:n0t,requiresIfExists:["offset"],data:{_skip:!1}};function e1e(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function t1e(e){return[Mc,Xf,qf,Ac].some(function(t){return e[t]>=0})}function i0t(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=LA(t,{elementContext:"reference"}),a=LA(t,{altBoundary:!0}),l=e1e(s,r),c=e1e(a,i,o),u=t1e(l),f=t1e(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const o0t={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:i0t};function s0t(e,t,n){var r=$p(e),i=[Ac,Mc].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Ac,Xf].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function a0t(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=Fje.reduce(function(u,f){return u[f]=s0t(f,t.rects,o),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const l0t={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:a0t};function c0t(e){var t=e.state,n=e.name;t.modifiersData[n]=Vje({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const u0t={name:"popperOffsets",enabled:!0,phase:"read",fn:c0t,data:{}};function f0t(e){return e==="x"?"y":"x"}function d0t(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,g=p===void 0?0:p,m=LA(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=$p(t.placement),y=WO(t.placement),b=!y,w=ele(v),S=f0t(w),_=t.modifiersData.popperOffsets,E=t.rects.reference,T=t.rects.popper,k=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,P=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(_){if(o){var F,A=w==="y"?Mc:Ac,L=w==="y"?qf:Xf,$=w==="y"?"height":"width",j=_[w],V=j+m[A],U=j-m[L],z=h?-T[$]/2:0,N=y===BO?E[$]:T[$],B=y===BO?-T[$]:-E[$],H=t.elements.arrow,Q=h&&H?Jae(H):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:zje(),Z=Y[A],pe=Y[L],ie=BM(0,E[$],Q[$]),ne=b?E[$]/2-z-ie-Z-P.mainAxis:N-ie-Z-P.mainAxis,fe=b?-E[$]/2+z+ie+pe+P.mainAxis:B+ie+pe+P.mainAxis,me=t.elements.arrow&&eD(t.elements.arrow),se=me?w==="y"?me.clientTop||0:me.clientLeft||0:0,ue=(F=R?.[w])!=null?F:0,G=j+ne-ue-se,ce=j+fe-ue,he=BM(h?j5(V,G):V,j,h?M1(U,ce):U);_[w]=he,I[w]=he-j}if(a){var J,te=w==="x"?Mc:Ac,ae=w==="x"?qf:Xf,we=_[S],Pe=S==="y"?"height":"width",ee=we+m[te],oe=we-m[ae],Se=[Mc,Ac].indexOf(v)!==-1,ye=(J=R?.[S])!=null?J:0,be=Se?ee:we-E[Pe]-T[Pe]-ye+P.altAxis,ge=Se?we+E[Pe]+T[Pe]-ye-P.altAxis:oe,xe=h&&Se?Fyt(be,we,ge):BM(h?be:ee,we,h?ge:oe);_[S]=xe,I[S]=xe-we}t.modifiersData[r]=I}}const h0t={name:"preventOverflow",enabled:!0,phase:"main",fn:d0t,requiresIfExists:["offset"]};function p0t(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function g0t(e){return e===$u(e)||!Df(e)?tle(e):p0t(e)}function m0t(e){var t=e.getBoundingClientRect(),n=UO(t.width)/e.offsetWidth||1,r=UO(t.height)/e.offsetHeight||1;return n!==1||r!==1}function v0t(e,t,n){n===void 0&&(n=!1);var r=Df(t),i=Df(t)&&m0t(t),o=wb(t),s=VO(e,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Jp(t)!=="body"||rle(o))&&(a=g0t(t)),Df(t)?(l=VO(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=nle(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function y0t(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function b0t(e){var t=y0t(e);return Myt.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function x0t(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function w0t(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var n1e={placement:"bottom",modifiers:[],strategy:"absolute"};function r1e(){for(var e=arguments.length,t=new Array(e),n=0;n{o||a(O0t(i)||document.body)},[i,o]),ar(()=>{if(s&&!o)return tte(n,s),()=>{tte(n,null)}},[n,s,o]),o){if(M.isValidElement(r)){const c={ref:l};return M.cloneElement(r,c)}return r}return s&&F6.createPortal(r,s)});function E0t(e){return pt("MuiPopper",e)}dt("MuiPopper",["root"]);function T0t(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function fte(e){return typeof e=="function"?e():e}function P0t(e){return e.nodeType!==void 0}const k0t=e=>{const{classes:t}=e;return Xe({root:["root"]},E0t,t)},M0t={},A0t=M.forwardRef(function(t,n){const{anchorEl:r,children:i,direction:o,disablePortal:s,modifiers:a,open:l,placement:c,popperOptions:u,popperRef:f,slotProps:d={},slots:h={},TransitionProps:p,ownerState:g,...m}=t,v=M.useRef(null),y=zn(v,n),b=M.useRef(null),w=zn(b,f),S=M.useRef(w);ar(()=>{S.current=w},[w]),M.useImperativeHandle(f,()=>b.current,[]);const _=T0t(c,o),[E,T]=M.useState(_),[k,P]=M.useState(fte(r));M.useEffect(()=>{b.current&&b.current.forceUpdate()}),M.useEffect(()=>{r&&P(fte(r))},[r]),ar(()=>{if(!k||!l)return;const L=V=>{T(V.placement)};let $=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:V})=>{L(V)}}];a!=null&&($=$.concat(a)),u&&u.modifiers!=null&&($=$.concat(u.modifiers));const j=C0t(k,v.current,{placement:_,...u,modifiers:$});return S.current(j),()=>{j.destroy(),S.current(null)}},[k,s,a,l,u,_]);const R={placement:E};p!==null&&(R.TransitionProps=p);const I=k0t(t),F=h.root??"div",A=Yn({elementType:F,externalSlotProps:d.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:y},ownerState:t,className:I.root});return O.jsx(F,{...A,children:typeof i=="function"?i(R):i})}),R0t=M.forwardRef(function(t,n){const{anchorEl:r,children:i,container:o,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=M0t,popperRef:h,style:p,transition:g=!1,slotProps:m={},slots:v={},...y}=t,[b,w]=M.useState(!0),S=()=>{w(!1)},_=()=>{w(!0)};if(!l&&!u&&(!g||b))return null;let E;if(o)E=o;else if(r){const P=fte(r);E=P&&P0t(P)?ci(P).body:ci(null).body}const T=!u&&l&&(!g||b)?"none":void 0,k=g?{in:u,onEnter:S,onExited:_}:void 0;return O.jsx(Wje,{disablePortal:a,container:E,children:O.jsx(A0t,{anchorEl:r,direction:s,disablePortal:a,modifiers:c,ref:n,open:g?!b:u,placement:f,popperOptions:d,popperRef:h,slotProps:m,slots:v,...y,style:{position:"fixed",top:0,left:0,display:T,...p},TransitionProps:k,children:i})})}),I0t=Oe(R0t,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Sb=M.forwardRef(function(t,n){const r=bi(),i=Dt({props:t,name:"MuiPopper"}),{anchorEl:o,component:s,components:a,componentsProps:l,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,slots:y,slotProps:b,...w}=i,S=y?.root??a?.Root,_={anchorEl:o,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,...w};return O.jsx(I0t,{as:s,direction:r?"rtl":"ltr",slots:{root:S},slotProps:b??l,..._,ref:n})});function D0t(e){return pt("MuiListSubheader",e)}dt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const L0t=e=>{const{classes:t,color:n,disableGutters:r,inset:i,disableSticky:o}=e,s={root:["root",n!=="default"&&`color${Ve(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return Xe(s,D0t,t)},F0t=Oe("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Ve(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(Mt(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),dte=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListSubheader"}),{className:i,color:o="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:c=!1,...u}=r,f={...r,color:o,component:s,disableGutters:a,disableSticky:l,inset:c},d=L0t(f);return O.jsx(F0t,{as:s,className:Re(d.root,i),ref:n,ownerState:f,...u})});dte&&(dte.muiSkipListHighlight=!0);const $0t=ot(O.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function N0t(e){return pt("MuiChip",e)}const xr=dt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),z0t=e=>{const{classes:t,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=e,c={root:["root",l,n&&"disabled",`size${Ve(r)}`,`color${Ve(i)}`,a&&"clickable",a&&`clickableColor${Ve(i)}`,s&&"deletable",s&&`deletableColor${Ve(i)}`,`${l}${Ve(i)}`],label:["label",`label${Ve(r)}`],avatar:["avatar",`avatar${Ve(r)}`,`avatarColor${Ve(i)}`],icon:["icon",`icon${Ve(r)}`,`iconColor${Ve(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Ve(r)}`,`deleteIconColor${Ve(i)}`,`deleteIcon${Ve(l)}Color${Ve(i)}`]};return Xe(c,N0t,t)},j0t=Oe("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${xr.avatar}`]:t.avatar},{[`& .${xr.avatar}`]:t[`avatar${Ve(a)}`]},{[`& .${xr.avatar}`]:t[`avatarColor${Ve(r)}`]},{[`& .${xr.icon}`]:t.icon},{[`& .${xr.icon}`]:t[`icon${Ve(a)}`]},{[`& .${xr.icon}`]:t[`iconColor${Ve(i)}`]},{[`& .${xr.deleteIcon}`]:t.deleteIcon},{[`& .${xr.deleteIcon}`]:t[`deleteIcon${Ve(a)}`]},{[`& .${xr.deleteIcon}`]:t[`deleteIconColor${Ve(r)}`]},{[`& .${xr.deleteIcon}`]:t[`deleteIcon${Ve(l)}Color${Ve(r)}`]},t.root,t[`size${Ve(a)}`],t[`color${Ve(r)}`],o&&t.clickable,o&&r!=="default"&&t[`clickableColor${Ve(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${Ve(r)}`],t[l],t[`${l}${Ve(r)}`]]}})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${xr.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${xr.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${xr.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${xr.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${xr.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${xr.icon}`]:{marginLeft:5,marginRight:-6},[`& .${xr.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Bt(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Bt(e.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${xr.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${xr.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(ai(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${xr.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[n].contrastTextChannel} / 0.7)`:Bt(e.palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${xr.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${xr.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${xr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Bt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}},...Object.entries(e.palette).filter(ai(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${xr.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Bt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${xr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Bt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(ai(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${xr.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${xr.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${xr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${xr.avatar}`]:{marginLeft:4},[`& .${xr.avatarSmall}`]:{marginLeft:2},[`& .${xr.icon}`]:{marginLeft:4},[`& .${xr.iconSmall}`]:{marginLeft:2},[`& .${xr.deleteIcon}`]:{marginRight:5},[`& .${xr.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(ai()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[n].mainChannel} / 0.7)`:Bt(e.palette[n].main,.7)}`,[`&.${xr.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[n].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette[n].main,e.palette.action.hoverOpacity)},[`&.${xr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[n].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Bt(e.palette[n].main,e.palette.action.focusOpacity)},[`& .${xr.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[n].mainChannel} / 0.7)`:Bt(e.palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),B0t=Oe("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${Ve(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function i1e(e){return e.key==="Backspace"||e.key==="Delete"}const J6=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:g,onKeyUp:m,size:v="medium",variant:y="filled",tabIndex:b,skipFocusWhenDisabled:w=!1,...S}=r,_=M.useRef(null),E=zn(_,n),T=U=>{U.stopPropagation(),p&&p(U)},k=U=>{U.currentTarget===U.target&&i1e(U)&&U.preventDefault(),g&&g(U)},P=U=>{U.currentTarget===U.target&&p&&i1e(U)&&p(U),m&&m(U)},R=s!==!1&&h?!0:s,I=R||p?Gf:l||"div",F={...r,component:I,disabled:u,size:v,color:a,iconColor:M.isValidElement(f)&&f.props.color||a,onDelete:!!p,clickable:R,variant:y},A=z0t(F),L=I===Gf?{component:l||"div",focusVisibleClassName:A.focusVisible,...p&&{disableRipple:!0}}:{};let $=null;p&&($=c&&M.isValidElement(c)?M.cloneElement(c,{className:Re(c.props.className,A.deleteIcon),onClick:T}):O.jsx($0t,{className:Re(A.deleteIcon),onClick:T}));let j=null;i&&M.isValidElement(i)&&(j=M.cloneElement(i,{className:Re(A.avatar,i.props.className)}));let V=null;return f&&M.isValidElement(f)&&(V=M.cloneElement(f,{className:Re(A.icon,f.props.className)})),O.jsxs(j0t,{as:I,className:Re(A.root,o),disabled:R&&u?!0:void 0,onClick:h,onKeyDown:k,onKeyUp:P,ref:E,tabIndex:w&&u?-1:b,ownerState:F,...L,...S,children:[j||V,O.jsx(B0t,{className:Re(A.label),ownerState:F,children:d}),$]})});function x$(e){return parseInt(e,10)||0}const U0t={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function V0t(e){for(const t in e)return!1;return!0}function o1e(e){return V0t(e)||e.outerHeightStyle===0&&!e.overflowing}const W0t=M.forwardRef(function(t,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a,...l}=t,{current:c}=M.useRef(a!=null),u=M.useRef(null),f=zn(n,u),d=M.useRef(null),h=M.useRef(null),p=M.useCallback(()=>{const b=u.current,w=h.current;if(!b||!w)return;const _=$c(b).getComputedStyle(b);if(_.width==="0px")return{outerHeightStyle:0,overflowing:!1};w.style.width=_.width,w.value=b.value||t.placeholder||"x",w.value.slice(-1)===` -`&&(w.value+=" ");const E=_.boxSizing,T=x$(_.paddingBottom)+x$(_.paddingTop),k=x$(_.borderBottomWidth)+x$(_.borderTopWidth),P=w.scrollHeight;w.value="x";const R=w.scrollHeight;let I=P;o&&(I=Math.max(Number(o)*R,I)),i&&(I=Math.min(Number(i)*R,I)),I=Math.max(I,R);const F=I+(E==="border-box"?T+k:0),A=Math.abs(I-P)<=1;return{outerHeightStyle:F,overflowing:A}},[i,o,t.placeholder]),g=ft(()=>{const b=u.current,w=p();if(!b||!w||o1e(w))return!1;const S=w.outerHeightStyle;return d.current!=null&&d.current!==S}),m=M.useCallback(()=>{const b=u.current,w=p();if(!b||!w||o1e(w))return;const S=w.outerHeightStyle;d.current!==S&&(d.current=S,b.style.height=`${S}px`),b.style.overflow=w.overflowing?"hidden":""},[p]),v=M.useRef(-1);ar(()=>{const b=QI(m),w=u?.current;if(!w)return;const S=$c(w);S.addEventListener("resize",b);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(()=>{g()&&(_.unobserve(w),cancelAnimationFrame(v.current),m(),v.current=requestAnimationFrame(()=>{_.observe(w)}))}),_.observe(w)),()=>{b.clear(),cancelAnimationFrame(v.current),S.removeEventListener("resize",b),_&&_.disconnect()}},[p,m,g]),ar(()=>{m()});const y=b=>{c||m(),r&&r(b)};return O.jsxs(M.Fragment,{children:[O.jsx("textarea",{value:a,onChange:y,ref:f,rows:o,style:s,...l}),O.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:h,tabIndex:-1,style:{...U0t.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function Vm(e){return typeof e=="string"}function _b({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const eU=M.createContext(void 0);function tc(){return M.useContext(eU)}function s1e(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function B5(e,t=!1){return e&&(s1e(e.value)&&e.value!==""||t&&s1e(e.defaultValue)&&e.defaultValue!=="")}function H0t(e){return e.startAdornment}function G0t(e){return pt("MuiInputBase",e)}const Xs=dt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var a1e;const tU=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Ve(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},nU=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},q0t=e=>{const{classes:t,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=e,g={root:["root",`color${Ve(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",d&&d!=="medium"&&`size${Ve(d)}`,u&&"multiline",h&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Xe(g,G0t,t)},rU=Oe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:tU})(Mt(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Xs.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),iU=Oe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:nU})(Mt(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Xs.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${Xs.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:o})=>!o.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:o})=>o.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),l1e=qae({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),wT=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:o,autoFocus:s,className:a,color:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,error:g,fullWidth:m=!1,id:v,inputComponent:y="input",inputProps:b={},inputRef:w,margin:S,maxRows:_,minRows:E,multiline:T=!1,name:k,onBlur:P,onChange:R,onClick:I,onFocus:F,onKeyDown:A,onKeyUp:L,placeholder:$,readOnly:j,renderSuffix:V,rows:U,size:z,slotProps:N={},slots:B={},startAdornment:H,type:Q="text",value:Y,...Z}=r,pe=b.value!=null?b.value:Y,{current:ie}=M.useRef(pe!=null),ne=M.useRef(),fe=M.useCallback(ke=>{},[]),me=zn(ne,w,b.ref,fe),[se,ue]=M.useState(!1),G=tc(),ce=_b({props:r,muiFormControl:G,states:["color","disabled","error","hiddenLabel","size","required","filled"]});ce.focused=G?G.focused:se,M.useEffect(()=>{!G&&d&&se&&(ue(!1),P&&P())},[G,d,se,P]);const he=G&&G.onFilled,J=G&&G.onEmpty,te=M.useCallback(ke=>{B5(ke)?he&&he():J&&J()},[he,J]);ar(()=>{ie&&te({value:pe})},[pe,te,ie]);const ae=ke=>{F&&F(ke),b.onFocus&&b.onFocus(ke),G&&G.onFocus?G.onFocus(ke):ue(!0)},we=ke=>{P&&P(ke),b.onBlur&&b.onBlur(ke),G&&G.onBlur?G.onBlur(ke):ue(!1)},Pe=(ke,...je)=>{if(!ie){const De=ke.target||ne.current;if(De==null)throw new Error(cv(1));te({value:De.value})}b.onChange&&b.onChange(ke,...je),R&&R(ke,...je)};M.useEffect(()=>{te(ne.current)},[]);const ee=ke=>{ne.current&&ke.currentTarget===ke.target&&ne.current.focus(),I&&I(ke)};let oe=y,Se=b;T&&oe==="input"&&(U?Se={type:void 0,minRows:U,maxRows:U,...Se}:Se={type:void 0,maxRows:_,minRows:E,...Se},oe=W0t);const ye=ke=>{te(ke.animationName==="mui-auto-fill-cancel"?ne.current:{value:"x"})};M.useEffect(()=>{G&&G.setAdornedStart(!!H)},[G,H]);const be={...r,color:ce.color||"primary",disabled:ce.disabled,endAdornment:p,error:ce.error,focused:ce.focused,formControl:G,fullWidth:m,hiddenLabel:ce.hiddenLabel,multiline:T,size:ce.size,startAdornment:H,type:Q},ge=q0t(be),xe=B.root||c.Root||rU,re=N.root||u.root||{},Ee=B.input||c.Input||iU;return Se={...Se,...N.input??u.input},O.jsxs(M.Fragment,{children:[!h&&typeof l1e=="function"&&(a1e||(a1e=O.jsx(l1e,{}))),O.jsxs(xe,{...re,ref:n,onClick:ee,...Z,...!Vm(xe)&&{ownerState:{...be,...re.ownerState}},className:Re(ge.root,re.className,a,j&&"MuiInputBase-readOnly"),children:[H,O.jsx(eU.Provider,{value:null,children:O.jsx(Ee,{"aria-invalid":ce.error,"aria-describedby":i,autoComplete:o,autoFocus:s,defaultValue:f,disabled:ce.disabled,id:v,onAnimationStart:ye,name:k,placeholder:$,readOnly:j,required:ce.required,rows:U,value:pe,onKeyDown:A,onKeyUp:L,type:Q,...Se,...!Vm(Ee)&&{as:oe,ownerState:{...be,...Se.ownerState}},ref:me,className:Re(ge.input,Se.className,j&&"MuiInputBase-readOnly"),onBlur:we,onChange:Pe,onFocus:ae})}),p,V?V({...ce,startAdornment:H}):null]})]})});function X0t(e){return pt("MuiInput",e)}const i0={...Xs,...dt("MuiInput",["root","underline","input"])};function Y0t(e){return pt("MuiOutlinedInput",e)}const ff={...Xs,...dt("MuiOutlinedInput",["root","notchedOutline","input"])};function Q0t(e){return pt("MuiFilledInput",e)}const vu={...Xs,...dt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},Hje=ot(O.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function K0t(e){return pt("MuiAutocomplete",e)}const lr=dt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var c1e,u1e;const Z0t=e=>{const{classes:t,disablePortal:n,expanded:r,focused:i,fullWidth:o,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:c,size:u}=e,f={root:["root",r&&"expanded",i&&"focused",o&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Ve(u)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Xe(f,K0t,t)},J0t=Oe("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:i,hasPopupIcon:o,inputFocused:s,size:a}=n;return[{[`& .${lr.tag}`]:t.tag},{[`& .${lr.tag}`]:t[`tagSize${Ve(a)}`]},{[`& .${lr.inputRoot}`]:t.inputRoot},{[`& .${lr.input}`]:t.input},{[`& .${lr.input}`]:s&&t.inputFocused},t.root,r&&t.fullWidth,o&&t.hasPopupIcon,i&&t.hasClearIcon]}})({[`&.${lr.focused} .${lr.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${lr.clearIndicator}`]:{visibility:"visible"}},[`& .${lr.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${lr.inputRoot}`]:{[`.${lr.hasPopupIcon}&, .${lr.hasClearIcon}&`]:{paddingRight:30},[`.${lr.hasPopupIcon}.${lr.hasClearIcon}&`]:{paddingRight:56},[`& .${lr.input}`]:{width:0,minWidth:30}},[`& .${i0.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${i0.root}.${Xs.sizeSmall}`]:{[`& .${i0.input}`]:{padding:"2px 4px 3px 0"}},[`& .${ff.root}`]:{padding:9,[`.${lr.hasPopupIcon}&, .${lr.hasClearIcon}&`]:{paddingRight:39},[`.${lr.hasPopupIcon}.${lr.hasClearIcon}&`]:{paddingRight:65},[`& .${lr.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${lr.endAdornment}`]:{right:9}},[`& .${ff.root}.${Xs.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${lr.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${vu.root}`]:{paddingTop:19,paddingLeft:8,[`.${lr.hasPopupIcon}&, .${lr.hasClearIcon}&`]:{paddingRight:39},[`.${lr.hasPopupIcon}.${lr.hasClearIcon}&`]:{paddingRight:65},[`& .${vu.input}`]:{padding:"7px 4px"},[`& .${lr.endAdornment}`]:{right:9}},[`& .${vu.root}.${Xs.sizeSmall}`]:{paddingBottom:1,[`& .${vu.input}`]:{padding:"2.5px 4px"}},[`& .${Xs.hiddenLabel}`]:{paddingTop:8},[`& .${vu.root}.${Xs.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${lr.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${vu.root}.${Xs.hiddenLabel}.${Xs.sizeSmall}`]:{[`& .${lr.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${lr.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${lr.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${lr.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${lr.inputRoot}`]:{flexWrap:"wrap"}}}]}),ebt=Oe("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),tbt=Oe(Mn,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),nbt=Oe(Mn,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),rbt=Oe(Sb,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${lr.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(Mt(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),ibt=Oe(fa,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(Mt(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),obt=Oe("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),sbt=Oe("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),abt=Oe("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(Mt(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${lr.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${lr.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${lr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${lr.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${lr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}}))),lbt=Oe(dte,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(Mt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),cbt=Oe("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${lr.option}`]:{paddingLeft:24}}),Gje=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAutocomplete"}),{autoComplete:i=!1,autoHighlight:o=!1,autoSelect:s=!1,blurOnSelect:a=!1,ChipProps:l,className:c,clearIcon:u=c1e||(c1e=O.jsx(syt,{fontSize:"small"})),clearOnBlur:f=!r.freeSolo,clearOnEscape:d=!1,clearText:h="Clear",closeText:p="Close",componentsProps:g,defaultValue:m=r.multiple?[]:null,disableClearable:v=!1,disableCloseOnSelect:y=!1,disabled:b=!1,disabledItemsFocusable:w=!1,disableListWrap:S=!1,disablePortal:_=!1,filterOptions:E,filterSelectedOptions:T=!1,forcePopupIcon:k="auto",freeSolo:P=!1,fullWidth:R=!1,getLimitTagsText:I=Fn=>`+${Fn}`,getOptionDisabled:F,getOptionKey:A,getOptionLabel:L,isOptionEqualToValue:$,groupBy:j,handleHomeEndKeys:V=!r.freeSolo,id:U,includeInputInList:z=!1,inputValue:N,limitTags:B=-1,ListboxComponent:H,ListboxProps:Q,loading:Y=!1,loadingText:Z="Loading…",multiple:pe=!1,noOptionsText:ie="No options",onChange:ne,onClose:fe,onHighlightChange:me,onInputChange:se,onOpen:ue,open:G,openOnFocus:ce=!1,openText:he="Open",options:J,PaperComponent:te,PopperComponent:ae,popupIcon:we=u1e||(u1e=O.jsx(Hje,{})),readOnly:Pe=!1,renderGroup:ee,renderInput:oe,renderOption:Se,renderTags:ye,selectOnFocus:be=!r.freeSolo,size:ge="medium",slots:xe={},slotProps:re={},value:Ee,...ke}=r,{getRootProps:je,getInputProps:De,getInputLabelProps:ze,getPopupIndicatorProps:Je,getClearProps:mt,getTagProps:Me,getListboxProps:st,getOptionProps:Fe,value:ht,dirty:gt,expanded:St,id:on,popupOpen:Dn,focused:wi,focusedTag:jn,anchorEl:sn,setAnchorEl:br,inputValue:$t,groupedOptions:Ut}=yyt({...r,componentName:"Autocomplete"}),Wn=!v&&!b&>&&!Pe,Nn=(!P||k===!0)&&k!==!1,{onMouseDown:fi}=De(),{ref:po,..._e}=st(),Qe=L||(Fn=>Fn.label??Fn),$e={...r,disablePortal:_,expanded:St,focused:wi,fullWidth:R,getOptionLabel:Qe,hasClearIcon:Wn,hasPopupIcon:Nn,inputFocused:jn===-1,popupOpen:Dn,size:ge},Ke=Z0t($e),Lt={slots:{paper:te,popper:ae,...xe},slotProps:{chip:l,listbox:Q,...g,...re}},[rn,Ge]=Zt("listbox",{elementType:abt,externalForwardedProps:Lt,ownerState:$e,className:Ke.listbox,additionalProps:_e,ref:po}),[Be,yt]=Zt("paper",{elementType:fa,externalForwardedProps:Lt,ownerState:$e,className:Ke.paper}),[Nt,Xt]=Zt("popper",{elementType:Sb,externalForwardedProps:Lt,ownerState:$e,className:Ke.popper,additionalProps:{disablePortal:_,style:{width:sn?sn.clientWidth:null},role:"presentation",anchorEl:sn,open:Dn}});let Tn;if(pe&&ht.length>0){const Fn=Ho=>({className:Ke.tag,disabled:b,...Me(Ho)});ye?Tn=ye(ht,Fn,$e):Tn=ht.map((Ho,ma)=>{const{key:sc,...Pi}=Fn({index:ma});return O.jsx(J6,{label:Qe(Ho),size:ge,...Pi,...Lt.slotProps.chip},sc)})}if(B>-1&&Array.isArray(Tn)){const Fn=Tn.length-B;!wi&&Fn>0&&(Tn=Tn.splice(0,B),Tn.push(O.jsx("span",{className:Ke.tag,children:I(Fn)},Tn.length)))}const Wo=ee||(Fn=>O.jsxs("li",{children:[O.jsx(lbt,{className:Ke.groupLabel,ownerState:$e,component:"div",children:Fn.group}),O.jsx(cbt,{className:Ke.groupUl,ownerState:$e,children:Fn.children})]},Fn.key)),Ir=Se||((Fn,Ho)=>{const{key:ma,...sc}=Fn;return O.jsx("li",{...sc,children:Qe(Ho)},ma)}),Tr=(Fn,Ho)=>{const ma=Fe({option:Fn,index:Ho});return Ir({...ma,className:Ke.option},Fn,{selected:ma["aria-selected"],index:Ho,inputValue:$t},$e)},Qc=Lt.slotProps.clearIndicator,Hi=Lt.slotProps.popupIndicator;return O.jsxs(M.Fragment,{children:[O.jsx(J0t,{ref:n,className:Re(Ke.root,c),ownerState:$e,...je(ke),children:oe({id:on,disabled:b,fullWidth:!0,size:ge==="small"?"small":void 0,InputLabelProps:ze(),InputProps:{ref:br,className:Ke.inputRoot,startAdornment:Tn,onMouseDown:Fn=>{Fn.target===Fn.currentTarget&&fi(Fn)},...(Wn||Nn)&&{endAdornment:O.jsxs(ebt,{className:Ke.endAdornment,ownerState:$e,children:[Wn?O.jsx(tbt,{...mt(),"aria-label":h,title:h,ownerState:$e,...Qc,className:Re(Ke.clearIndicator,Qc?.className),children:u}):null,Nn?O.jsx(nbt,{...Je(),disabled:b,"aria-label":Dn?p:he,title:Dn?p:he,ownerState:$e,...Hi,className:Re(Ke.popupIndicator,Hi?.className),children:we}):null]})}},inputProps:{className:Ke.input,disabled:b,readOnly:Pe,...De()}})}),sn?O.jsx(rbt,{as:Nt,...Xt,children:O.jsxs(ibt,{as:Be,...yt,children:[Y&&Ut.length===0?O.jsx(obt,{className:Ke.loading,ownerState:$e,children:Z}):null,Ut.length===0&&!P&&!Y?O.jsx(sbt,{className:Ke.noOptions,ownerState:$e,role:"presentation",onMouseDown:Fn=>{Fn.preventDefault()},children:ie}):null,Ut.length>0?O.jsx(rn,{as:H,...Ge,children:Ut.map((Fn,Ho)=>j?Wo({key:Fn.key,group:Fn.group,children:Fn.options.map((ma,sc)=>Tr(ma,Fn.index+sc))}):Tr(Fn,Ho))}):null]})}):null]})}),ubt=ot(O.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function fbt(e){return pt("MuiAvatar",e)}dt("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const dbt=e=>{const{classes:t,variant:n,colorDefault:r}=e;return Xe({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},fbt,t)},hbt=Oe("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(Mt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(e.vars||e).palette.background.default,...e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.grey[400],...e.applyStyles("dark",{backgroundColor:e.palette.grey[600]})}}}]}))),pbt=Oe("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),gbt=Oe(ubt,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});function mbt({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[i,o]=M.useState(!1);return M.useEffect(()=>{if(!n&&!r)return;o(!1);let s=!0;const a=new Image;return a.onload=()=>{s&&o("loaded")},a.onerror=()=>{s&&o("error")},a.crossOrigin=e,a.referrerPolicy=t,a.src=n,r&&(a.srcset=r),()=>{s=!1}},[e,t,n,r]),i}const h9=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAvatar"}),{alt:i,children:o,className:s,component:a="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular",...g}=r;let m=null;const v={...r,component:a,variant:p},y=mbt({...u,...typeof c.img=="function"?c.img(v):c.img,src:d,srcSet:h}),b=d||h,w=b&&y!=="error";v.colorDefault=!w,delete v.ownerState;const S=dbt(v),[_,E]=Zt("img",{className:S.img,elementType:pbt,externalForwardedProps:{slots:l,slotProps:{img:{...u,...c.img}}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:v});return w?m=O.jsx(_,{...E}):o||o===0?m=o:b&&i?m=i[0]:m=O.jsx(gbt,{ownerState:v,className:S.fallback}),O.jsx(hbt,{as:a,className:Re(S.root,s),ref:n,...g,ownerState:v,children:m})}),vbt={entering:{opacity:1},entered:{opacity:1}},iw=M.forwardRef(function(t,n){const r=is(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:g,style:m,timeout:v=i,TransitionComponent:y=Hu,...b}=t,w=M.useRef(null),S=zn(w,xb(a),n),_=A=>L=>{if(A){const $=w.current;L===void 0?A($):A($,L)}},E=_(d),T=_((A,L)=>{Qae(A);const $=G0({style:m,timeout:v,easing:l},{mode:"enter"});A.style.webkitTransition=r.transitions.create("opacity",$),A.style.transition=r.transitions.create("opacity",$),u&&u(A,L)}),k=_(f),P=_(g),R=_(A=>{const L=G0({style:m,timeout:v,easing:l},{mode:"exit"});A.style.webkitTransition=r.transitions.create("opacity",L),A.style.transition=r.transitions.create("opacity",L),h&&h(A)}),I=_(p),F=A=>{o&&o(w.current,A)};return O.jsx(y,{appear:s,in:c,nodeRef:w,onEnter:T,onEntered:k,onEntering:E,onExit:R,onExited:I,onExiting:P,addEndListener:F,timeout:v,...b,children:(A,{ownerState:L,...$})=>M.cloneElement(a,{style:{opacity:0,visibility:A==="exited"&&!c?"hidden":void 0,...vbt[A],...m,...a.props.style},ref:S,...$})})});function ybt(e){return pt("MuiBackdrop",e)}dt("MuiBackdrop",["root","invisible"]);const bbt=e=>{const{classes:t,invisible:n}=e;return Xe({root:["root",n&&"invisible"]},ybt,t)},xbt=Oe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),qje=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiBackdrop"}),{children:i,className:o,component:s="div",invisible:a=!1,open:l,components:c={},componentsProps:u={},slotProps:f={},slots:d={},TransitionComponent:h,transitionDuration:p,...g}=r,m={...r,component:s,invisible:a},v=bbt(m),y={transition:h,root:c.Root,...d},b={...u,...f},w={slots:y,slotProps:b},[S,_]=Zt("root",{elementType:xbt,externalForwardedProps:w,className:Re(v.root,o),ownerState:m}),[E,T]=Zt("transition",{elementType:iw,externalForwardedProps:w,ownerState:m});return O.jsx(E,{in:l,timeout:p,...g,...T,children:O.jsx(S,{"aria-hidden":!0,..._,classes:v,ref:n,children:i})})});function wbt(e){const{badgeContent:t,invisible:n=!1,max:r=99,showZero:i=!1}=e,o=Vae({badgeContent:t,max:r});let s=n;n===!1&&t===0&&!i&&(s=!0);const{badgeContent:a,max:l=r}=s?o:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}function Sbt(e){return pt("MuiBadge",e)}const fy=dt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),p9=10,g9=4,_bt=e=>{const{color:t,anchorOrigin:n,invisible:r,overlap:i,variant:o,classes:s={}}=e,a={root:["root"],badge:["badge",o,r&&"invisible",`anchorOrigin${Ve(n.vertical)}${Ve(n.horizontal)}`,`anchorOrigin${Ve(n.vertical)}${Ve(n.horizontal)}${Ve(i)}`,`overlap${Ve(i)}`,t!=="default"&&`color${Ve(t)}`]};return Xe(a,Sbt,s)},Cbt=Oe("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),Obt=Oe("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${Ve(n.anchorOrigin.vertical)}${Ve(n.anchorOrigin.horizontal)}${Ve(n.overlap)}`],n.color!=="default"&&t[`color${Ve(n.color)}`],n.invisible&&t.invisible]}})(Mt(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:p9*2,lineHeight:1,padding:"0 6px",height:p9*2,borderRadius:p9,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.entries(e.palette).filter(ai(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText}})),{props:{variant:"dot"},style:{borderRadius:g9,height:g9*2,minWidth:g9*2,padding:0}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${fy.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${fy.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${fy.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${fy.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${fy.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${fy.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${fy.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${fy.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]})));function f1e(e){return{vertical:e?.vertical??"top",horizontal:e?.horizontal??"right"}}const Ebt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiBadge"}),{anchorOrigin:i,className:o,classes:s,component:a,components:l={},componentsProps:c={},children:u,overlap:f="rectangular",color:d="default",invisible:h=!1,max:p=99,badgeContent:g,slots:m,slotProps:v,showZero:y=!1,variant:b="standard",...w}=r,{badgeContent:S,invisible:_,max:E,displayValue:T}=wbt({max:p,invisible:h,badgeContent:g,showZero:y}),k=Vae({anchorOrigin:f1e(i),color:d,overlap:f,variant:b,badgeContent:g}),P=_||S==null&&b!=="dot",{color:R=d,overlap:I=f,anchorOrigin:F,variant:A=b}=P?k:r,L=f1e(F),$=A!=="dot"?T:void 0,j={...r,badgeContent:S,invisible:P,max:E,displayValue:$,showZero:y,anchorOrigin:L,color:R,overlap:I,variant:A},V=_bt(j),U={slots:{root:m?.root??l.Root,badge:m?.badge??l.Badge},slotProps:{root:v?.root??c.root,badge:v?.badge??c.badge}},[z,N]=Zt("root",{elementType:Cbt,externalForwardedProps:{...U,...w},ownerState:j,className:Re(V.root,o),ref:n,additionalProps:{as:a}}),[B,H]=Zt("badge",{elementType:Obt,externalForwardedProps:U,ownerState:j,className:V.badge});return O.jsxs(z,{...N,children:[u,O.jsx(B,{...H,children:$})]})}),Tbt=dt("MuiBox",["root"]),Pbt=xT(),bt=Agt({themeId:If,defaultTheme:Pbt,defaultClassName:Tbt.root,generateClassName:J5e.generate});function kbt(e){return pt("MuiButton",e)}const fx=dt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),Mbt=M.createContext({}),Abt=M.createContext(void 0),Rbt=e=>{const{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,loading:s,loadingPosition:a,classes:l}=e,c={root:["root",s&&"loading",o,`${o}${Ve(t)}`,`size${Ve(i)}`,`${o}Size${Ve(i)}`,`color${Ve(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${Ve(a)}`],startIcon:["icon","startIcon",`iconSize${Ve(i)}`],endIcon:["icon","endIcon",`iconSize${Ve(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},u=Xe(c,kbt,l);return{...l,...u}},Xje=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Ibt=Oe(Gf,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Ve(n.color)}`],t[`size${Ve(n.size)}`],t[`${n.variant}Size${Ve(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${fx.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${fx.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${fx.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${fx.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(ai()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.vars?`rgba(${e.vars.palette[r].mainChannel} / 0.5)`:Bt(e.palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette[r].main,e.palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette[r].main,e.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.text.primary,e.palette.action.hoverOpacity),"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.text.primary,e.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${fx.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${fx.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${fx.loading}`]:{color:"transparent"}}}]}})),Dbt=Oe("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Ve(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...Xje]})),Lbt=Oe("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Ve(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Xje]})),Fbt=Oe("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),d1e=Oe("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),ji=M.forwardRef(function(t,n){const r=M.useContext(Mbt),i=M.useContext(Abt),o=nw(r,t),s=Dt({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:g,fullWidth:m=!1,id:v,loading:y=null,loadingIndicator:b,loadingPosition:w="center",size:S="medium",startIcon:_,type:E,variant:T="text",...k}=s,P=ur(v),R=b??O.jsx(Eh,{"aria-labelledby":P,color:"inherit",size:16}),I={...s,color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:m,loading:y,loadingIndicator:R,loadingPosition:w,size:S,type:E,variant:T},F=Rbt(I),A=(_||y&&w==="start")&&O.jsx(Dbt,{className:F.startIcon,ownerState:I,children:_||O.jsx(d1e,{className:F.loadingIconPlaceholder,ownerState:I})}),L=(p||y&&w==="end")&&O.jsx(Lbt,{className:F.endIcon,ownerState:I,children:p||O.jsx(d1e,{className:F.loadingIconPlaceholder,ownerState:I})}),$=i||"",j=typeof y=="boolean"?O.jsx("span",{className:F.loadingWrapper,style:{display:"contents"},children:y&&O.jsx(Fbt,{className:F.loadingIndicator,ownerState:I,children:R})}):null;return O.jsxs(Ibt,{ownerState:I,className:Re(r.className,F.root,u,$),component:c,disabled:f||y,focusRipple:!h,focusVisibleClassName:Re(F.focusVisible,g),ref:n,type:E,id:y?P:v,...k,classes:F,children:[A,w!=="end"&&j,a,w==="end"&&j,L]})});function $bt(e){return pt("MuiCard",e)}dt("MuiCard",["root"]);const Nbt=e=>{const{classes:t}=e;return Xe({root:["root"]},$bt,t)},zbt=Oe(fa,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})({overflow:"hidden"}),jbt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=Nbt(a);return O.jsx(zbt,{className:Re(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function Bbt(e){return pt("MuiCardActions",e)}dt("MuiCardActions",["root","spacing"]);const Ubt=e=>{const{classes:t,disableSpacing:n}=e;return Xe({root:["root",!n&&"spacing"]},Bbt,t)},Vbt=Oe("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Wbt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o,...s}=r,a={...r,disableSpacing:i},l=Ubt(a);return O.jsx(Vbt,{className:Re(l.root,o),ownerState:a,ref:n,...s})});function Hbt(e){return pt("MuiCardContent",e)}dt("MuiCardContent",["root"]);const Gbt=e=>{const{classes:t}=e;return Xe({root:["root"]},Hbt,t)},qbt=Oe("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:16,"&:last-child":{paddingBottom:24}}),Yje=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=Gbt(a);return O.jsx(qbt,{as:o,className:Re(l.root,i),ownerState:a,ref:n,...s})});function Xbt(e){return pt("MuiCardHeader",e)}const U5=dt("MuiCardHeader",["root","avatar","action","content","title","subheader"]),Ybt=e=>{const{classes:t}=e;return Xe({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},Xbt,t)},Qbt=Oe("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(e,t)=>[{[`& .${U5.title}`]:t.title},{[`& .${U5.subheader}`]:t.subheader},t.root]})({display:"flex",alignItems:"center",padding:16}),Kbt=Oe("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(e,t)=>t.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),Zbt=Oe("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(e,t)=>t.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),Jbt=Oe("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(e,t)=>t.content})({flex:"1 1 auto",[`.${z5.root}:where(& .${U5.title})`]:{display:"block"},[`.${z5.root}:where(& .${U5.subheader})`]:{display:"block"}}),ext=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCardHeader"}),{action:i,avatar:o,component:s="div",disableTypography:a=!1,subheader:l,subheaderTypographyProps:c,title:u,titleTypographyProps:f,slots:d={},slotProps:h={},...p}=r,g={...r,component:s,disableTypography:a},m=Ybt(g),v={slots:d,slotProps:{title:f,subheader:c,...h}};let y=u;const[b,w]=Zt("title",{className:m.title,elementType:yn,externalForwardedProps:v,ownerState:g,additionalProps:{variant:o?"body2":"h5",component:"span"}});y!=null&&y.type!==yn&&!a&&(y=O.jsx(b,{...w,children:y}));let S=l;const[_,E]=Zt("subheader",{className:m.subheader,elementType:yn,externalForwardedProps:v,ownerState:g,additionalProps:{variant:o?"body2":"body1",color:"textSecondary",component:"span"}});S!=null&&S.type!==yn&&!a&&(S=O.jsx(_,{...E,children:S}));const[T,k]=Zt("root",{ref:n,className:m.root,elementType:Qbt,externalForwardedProps:{...v,...p,component:s},ownerState:g}),[P,R]=Zt("avatar",{className:m.avatar,elementType:Kbt,externalForwardedProps:v,ownerState:g}),[I,F]=Zt("content",{className:m.content,elementType:Jbt,externalForwardedProps:v,ownerState:g}),[A,L]=Zt("action",{className:m.action,elementType:Zbt,externalForwardedProps:v,ownerState:g});return O.jsxs(T,{...k,children:[o&&O.jsx(P,{...R,children:o}),O.jsxs(I,{...F,children:[y,S]}),i&&O.jsx(A,{...L,children:i})]})});function txt(e){return pt("MuiCardMedia",e)}dt("MuiCardMedia",["root","media","img"]);const nxt=e=>{const{classes:t,isMediaComponent:n,isImageComponent:r}=e;return Xe({root:["root",n&&"media",r&&"img"]},txt,t)},rxt=Oe("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{isMediaComponent:r,isImageComponent:i}=n;return[t.root,r&&t.media,i&&t.img]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),ixt=["video","audio","picture","iframe","img"],oxt=["picture","img"],sxt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCardMedia"}),{children:i,className:o,component:s="div",image:a,src:l,style:c,...u}=r,f=ixt.includes(s),d=!f&&a?{backgroundImage:`url("${a}")`,...c}:c,h={...r,component:s,isMediaComponent:f,isImageComponent:oxt.includes(s)},p=nxt(h);return O.jsx(rxt,{className:Re(p.root,o),as:s,role:!f&&a?"img":void 0,ref:n,style:d,ownerState:h,src:f?a||l:void 0,...u,children:i})});function axt(e){return pt("PrivateSwitchBase",e)}dt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const lxt=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Ve(i)}`],input:["input"]};return Xe(o,axt,t)},cxt=Oe(Gf,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),uxt=Oe("input",{name:"MuiSwitchBase",shouldForwardProp:ua})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),ile=M.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:o,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:f,inputProps:d,inputRef:h,name:p,onBlur:g,onChange:m,onFocus:v,readOnly:y,required:b=!1,tabIndex:w,type:S,value:_,slots:E={},slotProps:T={},...k}=t,[P,R]=Fa({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),I=tc(),F=Y=>{v&&v(Y),I&&I.onFocus&&I.onFocus(Y)},A=Y=>{g&&g(Y),I&&I.onBlur&&I.onBlur(Y)},L=Y=>{if(Y.nativeEvent.defaultPrevented)return;const Z=Y.target.checked;R(Z),m&&m(Y,Z)};let $=a;I&&typeof $>"u"&&($=I.disabled);const j=S==="checkbox"||S==="radio",V={...t,checked:P,disabled:$,disableFocusRipple:l,edge:c},U=lxt(V),z={slots:E,slotProps:{input:d,...T}},[N,B]=Zt("root",{ref:n,elementType:cxt,className:U.root,shouldForwardComponentProp:!0,externalForwardedProps:{...z,component:"span",...k},getSlotProps:Y=>({...Y,onFocus:Z=>{Y.onFocus?.(Z),F(Z)},onBlur:Z=>{Y.onBlur?.(Z),A(Z)}}),ownerState:V,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:$,role:void 0,tabIndex:null}}),[H,Q]=Zt("input",{ref:h,elementType:uxt,className:U.input,externalForwardedProps:z,getSlotProps:Y=>({onChange:Z=>{Y.onChange?.(Z),L(Z)}}),ownerState:V,additionalProps:{autoFocus:r,checked:i,defaultChecked:s,disabled:$,id:j?f:void 0,name:p,readOnly:y,required:b,tabIndex:w,type:S,...S==="checkbox"&&_===void 0?{}:{value:_}}});return O.jsxs(N,{...B,children:[O.jsx(H,{...Q}),P?o:u]})}),fxt=ot(O.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),dxt=ot(O.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),hxt=ot(O.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function pxt(e){return pt("MuiCheckbox",e)}const m9=dt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),gxt=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${Ve(r)}`,`size${Ve(i)}`]},s=Xe(o,pxt,t);return{...t,...s}},mxt=Oe(ile,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Ve(n.size)}`],n.color!=="default"&&t[`color${Ve(n.color)}`]]}})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{[`&.${m9.checked}, &.${m9.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${m9.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),vxt=O.jsx(dxt,{}),yxt=O.jsx(fxt,{}),bxt=O.jsx(hxt,{}),FA=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCheckbox"}),{checkedIcon:i=vxt,color:o="primary",icon:s=yxt,indeterminate:a=!1,indeterminateIcon:l=bxt,inputProps:c,size:u="medium",disableRipple:f=!1,className:d,slots:h={},slotProps:p={},...g}=r,m=a?l:s,v=a?l:i,y={...r,disableRipple:f,color:o,indeterminate:a,size:u},b=gxt(y),w=p.input??c,[S,_]=Zt("root",{ref:n,elementType:mxt,className:Re(b.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:p,...g},ownerState:y,additionalProps:{type:"checkbox",icon:M.cloneElement(m,{fontSize:m.props.fontSize??u}),checkedIcon:M.cloneElement(v,{fontSize:v.props.fontSize??u}),disableRipple:f,slots:h,slotProps:{input:Tje(typeof w=="function"?w(y):w,{"data-indeterminate":a})}}});return O.jsx(S,{..._,classes:b})});function h1e(e){return e.substring(2).toLowerCase()}function xxt(e,t){return t.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=zn(xb(t),a),f=ft(p=>{const g=c.current;c.current=!1;const m=ci(a.current);if(!l.current||!a.current||"clientX"in p&&xxt(p,m))return;if(s.current){s.current=!1;return}let v;p.composedPath?v=p.composedPath().includes(a.current):v=!m.documentElement.contains(p.target)||a.current.contains(p.target),!v&&(n||!g)&&i(p)}),d=p=>g=>{c.current=!0;const m=t.props[p];m&&m(g)},h={ref:u};return o!==!1&&(h[o]=d(o)),M.useEffect(()=>{if(o!==!1){const p=h1e(o),g=ci(a.current),m=()=>{s.current=!0};return g.addEventListener(p,f),g.addEventListener("touchmove",m),()=>{g.removeEventListener(p,f),g.removeEventListener("touchmove",m)}}},[f,o]),r!==!1&&(h[r]=d(r)),M.useEffect(()=>{if(r!==!1){const p=h1e(r),g=ci(a.current);return g.addEventListener(p,f),()=>{g.removeEventListener(p,f)}}},[f,r]),M.cloneElement(t,h)}const hte=typeof qae({})=="function",wxt=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),Sxt=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),Qje=(e,t=!1)=>{const n={};t&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([o,s])=>{const a=e.getColorSchemeSelector(o);a.startsWith("@")?n[a]={":root":{colorScheme:s.palette?.mode}}:n[a.replace(/\s*&/,"")]={colorScheme:s.palette?.mode}});let r={html:wxt(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...Sxt(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...n};const i=e.components?.MuiCssBaseline?.styleOverrides;return i&&(r=[r,i]),r},Pz="mui-ecs",_xt=e=>{const t=Qje(e,!1),n=Array.isArray(t)?t[0]:t;return!e.vars&&n&&(n.html[`:root:has(${Pz})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([r,i])=>{const o=e.getColorSchemeSelector(r);o.startsWith("@")?n[o]={[`:root:not(:has(.${Pz}))`]:{colorScheme:i.palette?.mode}}:n[o.replace(/\s*&/,"")]={[`&:not(:has(.${Pz}))`]:{colorScheme:i.palette?.mode}}}),t},Cxt=qae(hte?({theme:e,enableColorScheme:t})=>Qje(e,t):({theme:e})=>_xt(e));function Oxt(e){const t=Dt({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return O.jsxs(M.Fragment,{children:[hte&&O.jsx(Cxt,{enableColorScheme:r}),!hte&&!r&&O.jsx("span",{className:Pz,style:{display:"none"}}),n]})}function Ext(e){const t=ci(e);return t.body===e?$c(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function VM(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function p1e(e){return parseInt($c(e).getComputedStyle(e).paddingRight,10)||0}function Txt(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function g1e(e,t,n,r,i){const o=[t,n,...r];[].forEach.call(e.children,s=>{const a=!o.includes(s),l=!Txt(s);a&&l&&VM(s,i)})}function v9(e,t){let n=-1;return e.some((r,i)=>t(r)?(n=i,!0):!1),n}function Pxt(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(Ext(r)){const s=cje($c(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${p1e(r)+s}px`;const a=ci(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${p1e(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=ci(r).body;else{const s=r.parentElement,a=$c(r);o=s?.nodeName==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function kxt(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class Mxt{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&VM(t.modalRef,!1);const i=kxt(n);g1e(n,t.mount,t.modalRef,i,!0);const o=v9(this.containers,s=>s.container===n);return o!==-1?(this.containers[o].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:i}),r)}mount(t,n){const r=v9(this.containers,o=>o.modals.includes(t)),i=this.containers[r];i.restore||(i.restore=Pxt(i,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const i=v9(this.containers,s=>s.modals.includes(t)),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(t),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),t.modalRef&&VM(t.modalRef,n),g1e(o.container,t.mount,t.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&VM(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const Axt=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Rxt(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function Ixt(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function Dxt(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||Ixt(e))}function Lxt(e){const t=[],n=[];return Array.from(e.querySelectorAll(Axt)).forEach((r,i)=>{const o=Rxt(r);o===-1||!Dxt(r)||(o===0?t.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(t)}function Fxt(){return!0}function sle(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=Lxt,isEnabled:s=Fxt,open:a}=e,l=M.useRef(!1),c=M.useRef(null),u=M.useRef(null),f=M.useRef(null),d=M.useRef(null),h=M.useRef(!1),p=M.useRef(null),g=zn(xb(t),p),m=M.useRef(null);M.useEffect(()=>{!a||!p.current||(h.current=!n)},[n,a]),M.useEffect(()=>{if(!a||!p.current)return;const b=ci(p.current);return p.current.contains(b.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),M.useEffect(()=>{if(!a||!p.current)return;const b=ci(p.current),w=E=>{m.current=E,!(r||!s()||E.key!=="Tab")&&b.activeElement===p.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},S=()=>{const E=p.current;if(E===null)return;if(!b.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(b.activeElement)||r&&b.activeElement!==c.current&&b.activeElement!==u.current)return;if(b.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!h.current)return;let T=[];if((b.activeElement===c.current||b.activeElement===u.current)&&(T=o(p.current)),T.length>0){const k=!!(m.current?.shiftKey&&m.current?.key==="Tab"),P=T[0],R=T[T.length-1];typeof P!="string"&&typeof R!="string"&&(k?R.focus():P.focus())}else E.focus()};b.addEventListener("focusin",S),b.addEventListener("keydown",w,!0);const _=setInterval(()=>{b.activeElement&&b.activeElement.tagName==="BODY"&&S()},50);return()=>{clearInterval(_),b.removeEventListener("focusin",S),b.removeEventListener("keydown",w,!0)}},[n,r,i,s,a,o]);const v=b=>{f.current===null&&(f.current=b.relatedTarget),h.current=!0,d.current=b.target;const w=t.props.onFocus;w&&w(b)},y=b=>{f.current===null&&(f.current=b.relatedTarget),h.current=!0};return O.jsxs(M.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),M.cloneElement(t,{ref:g,onFocus:v}),O.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function $xt(e){return typeof e=="function"?e():e}function Nxt(e){return e?e.props.hasOwnProperty("in"):!1}const m1e=()=>{},w$=new Mxt;function zxt(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:o,onTransitionExited:s,children:a,onClose:l,open:c,rootRef:u}=e,f=M.useRef({}),d=M.useRef(null),h=M.useRef(null),p=zn(h,u),[g,m]=M.useState(!c),v=Nxt(a);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const b=()=>ci(d.current),w=()=>(f.current.modalRef=h.current,f.current.mount=d.current,f.current),S=()=>{w$.mount(w(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},_=ft(()=>{const L=$xt(t)||b().body;w$.add(w(),L),h.current&&S()}),E=()=>w$.isTopModal(w()),T=ft(L=>{d.current=L,L&&(c&&E()?S():h.current&&VM(h.current,y))}),k=M.useCallback(()=>{w$.remove(w(),y)},[y]);M.useEffect(()=>()=>{k()},[k]),M.useEffect(()=>{c?_():(!v||!i)&&k()},[c,k,v,i,_]);const P=L=>$=>{L.onKeyDown?.($),!($.key!=="Escape"||$.which===229||!E())&&(n||($.stopPropagation(),l&&l($,"escapeKeyDown")))},R=L=>$=>{L.onClick?.($),$.target===$.currentTarget&&l&&l($,"backdropClick")};return{getRootProps:(L={})=>{const $=k1(e);delete $.onTransitionEnter,delete $.onTransitionExited;const j={...$,...L};return{role:"presentation",...j,onKeyDown:P(j),ref:p}},getBackdropProps:(L={})=>{const $=L;return{"aria-hidden":!0,...$,onClick:R($),open:c}},getTransitionProps:()=>{const L=()=>{m(!1),o&&o()},$=()=>{m(!0),s&&s(),i&&k()};return{onEnter:ete(L,a?.props.onEnter??m1e),onExited:ete($,a?.props.onExited??m1e)}},rootRef:p,portalRef:T,isTopModal:E,exited:g,hasTransition:v}}function jxt(e){return pt("MuiModal",e)}dt("MuiModal",["root","hidden","backdrop"]);const Bxt=e=>{const{open:t,exited:n,classes:r}=e;return Xe({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},jxt,r)},Uxt=Oe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(Mt(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),Vxt=Oe(qje,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),Kje=M.forwardRef(function(t,n){const r=Dt({name:"MuiModal",props:t}),{BackdropComponent:i=Vxt,BackdropProps:o,classes:s,className:a,closeAfterTransition:l=!1,children:c,container:u,component:f,components:d={},componentsProps:h={},disableAutoFocus:p=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:m=!1,disablePortal:v=!1,disableRestoreFocus:y=!1,disableScrollLock:b=!1,hideBackdrop:w=!1,keepMounted:S=!1,onBackdropClick:_,onClose:E,onTransitionEnter:T,onTransitionExited:k,open:P,slotProps:R={},slots:I={},theme:F,...A}=r,L={...r,closeAfterTransition:l,disableAutoFocus:p,disableEnforceFocus:g,disableEscapeKeyDown:m,disablePortal:v,disableRestoreFocus:y,disableScrollLock:b,hideBackdrop:w,keepMounted:S},{getRootProps:$,getBackdropProps:j,getTransitionProps:V,portalRef:U,isTopModal:z,exited:N,hasTransition:B}=zxt({...L,rootRef:n}),H={...L,exited:N},Q=Bxt(H),Y={};if(c.props.tabIndex===void 0&&(Y.tabIndex="-1"),B){const{onEnter:me,onExited:se}=V();Y.onEnter=me,Y.onExited=se}const Z={slots:{root:d.Root,backdrop:d.Backdrop,...I},slotProps:{...h,...R}},[pe,ie]=Zt("root",{ref:n,elementType:Uxt,externalForwardedProps:{...Z,...A,component:f},getSlotProps:$,ownerState:H,className:Re(a,Q?.root,!H.open&&H.exited&&Q?.hidden)}),[ne,fe]=Zt("backdrop",{ref:o?.ref,elementType:i,externalForwardedProps:Z,shouldForwardComponentProp:!0,additionalProps:o,getSlotProps:me=>j({...me,onClick:se=>{_&&_(se),me?.onClick&&me.onClick(se)}}),className:Re(o?.className,Q?.backdrop),ownerState:H});return!S&&!P&&(!B||N)?null:O.jsx(Wje,{ref:U,container:u,disablePortal:v,children:O.jsxs(pe,{...ie,children:[!w&&i?O.jsx(ne,{...fe}):null,O.jsx(sle,{disableEnforceFocus:g,disableAutoFocus:p,disableRestoreFocus:y,isEnabled:z,open:P,children:M.cloneElement(c,Y)})]})})});function Wxt(e){return pt("MuiDialog",e)}const WM=dt("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Zje=M.createContext({}),Hxt=Oe(qje,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),Gxt=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=e,s={root:["root"],container:["container",`scroll${Ve(n)}`],paper:["paper",`paperScroll${Ve(n)}`,`paperWidth${Ve(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return Xe(s,Wxt,t)},qxt=Oe(Kje,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),Xxt=Oe("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Ve(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Yxt=Oe(fa,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Ve(n.scroll)}`],t[`paperWidth${Ve(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Mt(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${WM.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${WM.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${WM.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Gu=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialog"}),i=is(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:f,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:g=!1,maxWidth:m="sm",onBackdropClick:v,onClick:y,onClose:b,open:w,PaperComponent:S=fa,PaperProps:_={},scroll:E="paper",slots:T={},slotProps:k={},TransitionComponent:P=iw,transitionDuration:R=o,TransitionProps:I,...F}=r,A={...r,disableEscapeKeyDown:h,fullScreen:p,fullWidth:g,maxWidth:m,scroll:E},L=Gxt(A),$=M.useRef(),j=G=>{$.current=G.target===G.currentTarget},V=G=>{y&&y(G),$.current&&($.current=null,v&&v(G),b&&b(G,"backdropClick"))},U=ur(a),z=M.useMemo(()=>({titleId:U}),[U]),N={transition:P,...T},B={transition:I,paper:_,backdrop:u,...k},H={slots:N,slotProps:B},[Q,Y]=Zt("root",{elementType:qxt,shouldForwardComponentProp:!0,externalForwardedProps:H,ownerState:A,className:Re(L.root,d),ref:n}),[Z,pe]=Zt("backdrop",{elementType:Hxt,shouldForwardComponentProp:!0,externalForwardedProps:H,ownerState:A}),[ie,ne]=Zt("paper",{elementType:Yxt,shouldForwardComponentProp:!0,externalForwardedProps:H,ownerState:A,className:Re(L.paper,_.className)}),[fe,me]=Zt("container",{elementType:Xxt,externalForwardedProps:H,ownerState:A,className:Re(L.container)}),[se,ue]=Zt("transition",{elementType:iw,externalForwardedProps:H,ownerState:A,additionalProps:{appear:!0,in:w,timeout:R,role:"presentation"}});return O.jsx(Q,{closeAfterTransition:!0,slots:{backdrop:Z},slotProps:{backdrop:{transitionDuration:R,as:c,...pe}},disableEscapeKeyDown:h,onClose:b,open:w,onClick:V,...Y,...F,children:O.jsx(se,{...ue,children:O.jsx(fe,{onMouseDown:j,...me,children:O.jsx(ie,{as:S,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":U,"aria-modal":l,...ne,children:O.jsx(Zje.Provider,{value:z,children:f})})})})})});function Qxt(e){return pt("MuiDialogActions",e)}dt("MuiDialogActions",["root","spacing"]);const Kxt=e=>{const{classes:t,disableSpacing:n}=e;return Xe({root:["root",!n&&"spacing"]},Qxt,t)},Zxt=Oe("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Cb=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1,...s}=r,a={...r,disableSpacing:o},l=Kxt(a);return O.jsx(Zxt,{className:Re(l.root,i),ownerState:a,ref:n,...s})});function Jxt(e){return pt("MuiDialogContent",e)}dt("MuiDialogContent",["root","dividers"]);function e1t(e){return pt("MuiDialogTitle",e)}const t1t=dt("MuiDialogTitle",["root"]),n1t=e=>{const{classes:t,dividers:n}=e;return Xe({root:["root",n&&"dividers"]},Jxt,t)},r1t=Oe("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Mt(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${t1t.root} + &`]:{paddingTop:0}}}]}))),Nc=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialogContent"}),{className:i,dividers:o=!1,...s}=r,a={...r,dividers:o},l=n1t(a);return O.jsx(r1t,{className:Re(l.root,i),ownerState:a,ref:n,...s})});function i1t(e){return pt("MuiDialogContentText",e)}dt("MuiDialogContentText",["root"]);const o1t=e=>{const{classes:t}=e,r=Xe({root:["root"]},i1t,t);return{...t,...r}},s1t=Oe(yn,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Jje=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialogContentText"}),{children:i,className:o,...s}=r,a=o1t(s);return O.jsx(s1t,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Re(a.root,o),...r,classes:a})}),a1t=e=>{const{classes:t}=e;return Xe({root:["root"]},e1t,t)},l1t=Oe(yn,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),gg=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialogTitle"}),{className:i,id:o,...s}=r,a=r,l=a1t(a),{titleId:c=o}=M.useContext(Zje);return O.jsx(l1t,{component:"h2",className:Re(l.root,i),ownerState:a,ref:n,variant:"h6",id:o??c,...s})});function c1t(e){return pt("MuiDivider",e)}const v1e=dt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),u1t=e=>{const{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=e;return Xe({root:["root",t&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},c1t,r)},f1t=Oe("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(Mt(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:Bt(e.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:t})=>!!t.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:t})=>t.children&&t.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:t})=>t.orientation==="vertical"&&t.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:t})=>t.textAlign==="right"&&t.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:t})=>t.textAlign==="left"&&t.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),d1t=Oe("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(Mt(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),oa=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,orientation:a="horizontal",component:l=o||a==="vertical"?"div":"hr",flexItem:c=!1,light:u=!1,role:f=l!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth",...p}=r,g={...r,absolute:i,component:l,flexItem:c,light:u,orientation:a,role:f,textAlign:d,variant:h},m=u1t(g);return O.jsx(f1t,{as:l,className:Re(m.root,s),role:f,ref:n,ownerState:g,"aria-orientation":f==="separator"&&(l!=="hr"||a==="vertical")?a:void 0,...p,children:o?O.jsx(d1t,{className:m.wrapper,ownerState:g,children:o}):null})});oa&&(oa.muiSkipListHighlight=!0);function h1t(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=$c(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const c=o.getComputedStyle(t);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:e==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function p1t(e){return typeof e=="function"?e():e}function S$(e,t,n){const r=p1t(n),i=h1t(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const g1t=M.forwardRef(function(t,n){const r=is(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:g,onExit:m,onExited:v,onExiting:y,style:b,timeout:w=o,TransitionComponent:S=Hu,..._}=t,E=M.useRef(null),T=zn(xb(l),E,n),k=V=>U=>{V&&(U===void 0?V(E.current):V(E.current,U))},P=k((V,U)=>{S$(u,V,c),Qae(V),h&&h(V,U)}),R=k((V,U)=>{const z=G0({timeout:w,style:b,easing:f},{mode:"enter"});V.style.webkitTransition=r.transitions.create("-webkit-transform",{...z}),V.style.transition=r.transitions.create("transform",{...z}),V.style.webkitTransform="none",V.style.transform="none",g&&g(V,U)}),I=k(p),F=k(y),A=k(V=>{const U=G0({timeout:w,style:b,easing:f},{mode:"exit"});V.style.webkitTransition=r.transitions.create("-webkit-transform",U),V.style.transition=r.transitions.create("transform",U),S$(u,V,c),m&&m(V)}),L=k(V=>{V.style.webkitTransition="",V.style.transition="",v&&v(V)}),$=V=>{s&&s(E.current,V)},j=M.useCallback(()=>{E.current&&S$(u,E.current,c)},[u,c]);return M.useEffect(()=>{if(d||u==="down"||u==="right")return;const V=QI(()=>{E.current&&S$(u,E.current,c)}),U=$c(E.current);return U.addEventListener("resize",V),()=>{V.clear(),U.removeEventListener("resize",V)}},[u,d,c]),M.useEffect(()=>{d||j()},[d,j]),O.jsx(S,{nodeRef:E,onEnter:P,onEntered:I,onEntering:R,onExit:A,onExited:L,onExiting:F,addEndListener:$,appear:a,in:d,timeout:w,..._,children:(V,{ownerState:U,...z})=>M.cloneElement(l,{ref:T,style:{visibility:V==="exited"&&!d?"hidden":void 0,...b,...l.props.style},...z})})}),m1t=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:i,size:o,hiddenLabel:s,multiline:a}=e,l={root:["root",!n&&"underline",r&&"adornedStart",i&&"adornedEnd",o==="small"&&`size${Ve(o)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},c=Xe(l,Q0t,t);return{...t,...c}},v1t=Oe(rU,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...tU(e,t),!n.disableUnderline&&t.underline]}})(Mt(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${vu.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${vu.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:o},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${vu.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${vu.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${vu.disabled}, .${vu.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${vu.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ai()).map(([s])=>({props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),y1t=Oe(iU,{name:"MuiFilledInput",slot:"Input",overridesResolver:nU})(Mt(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),ale=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFilledInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:f,slots:d={},type:h="text",...p}=r,g={...r,disableUnderline:i,fullWidth:a,inputComponent:c,multiline:u,type:h},m=m1t(r),v={root:{ownerState:g},input:{ownerState:g}},y=f??s?ia(v,f??s):v,b=d.root??o.Root??v1t,w=d.input??o.Input??y1t;return O.jsx(wT,{slots:{root:b,input:w},slotProps:y,fullWidth:a,inputComponent:c,multiline:u,ref:n,type:h,...p,classes:m})});ale.muiName="Input";function b1t(e){return pt("MuiFormControl",e)}dt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const x1t=e=>{const{classes:t,margin:n,fullWidth:r}=e,i={root:["root",n!=="none"&&`margin${Ve(n)}`,r&&"fullWidth"]};return Xe(i,b1t,t)},w1t=Oe("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Ve(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),ld=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:g="medium",variant:m="outlined",...v}=r,y={...r,color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:g,variant:m},b=x1t(y),[w,S]=M.useState(()=>{let L=!1;return i&&M.Children.forEach(i,$=>{if(!Ez($,["Input","Select"]))return;const j=Ez($,["Select"])?$.props.input:$;j&&H0t(j.props)&&(L=!0)}),L}),[_,E]=M.useState(()=>{let L=!1;return i&&M.Children.forEach(i,$=>{Ez($,["Input","Select"])&&(B5($.props,!0)||B5($.props.inputProps,!0))&&(L=!0)}),L}),[T,k]=M.useState(!1);l&&T&&k(!1);const P=u!==void 0&&!l?u:T;let R;M.useRef(!1);const I=M.useCallback(()=>{E(!0)},[]),F=M.useCallback(()=>{E(!1)},[]),A=M.useMemo(()=>({adornedStart:w,setAdornedStart:S,color:s,disabled:l,error:c,filled:_,focused:P,fullWidth:f,hiddenLabel:d,size:g,onBlur:()=>{k(!1)},onFocus:()=>{k(!0)},onEmpty:F,onFilled:I,registerEffect:R,required:p,variant:m}),[w,s,l,c,_,P,f,d,R,F,I,p,g,m]);return O.jsx(eU.Provider,{value:A,children:O.jsx(w1t,{as:a,ownerState:y,className:Re(b.root,o),ref:n,...v,children:i})})});function S1t(e){return pt("MuiFormControlLabel",e)}const Y2=dt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),_1t=e=>{const{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,s={root:["root",n&&"disabled",`labelPlacement${Ve(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return Xe(s,S1t,t)},C1t=Oe("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Y2.label}`]:t.label},t.root,t[`labelPlacement${Ve(n.labelPlacement)}`]]}})(Mt(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Y2.disabled}`]:{cursor:"default"},[`& .${Y2.label}`]:{[`&.${Y2.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),O1t=Oe("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(Mt(({theme:e})=>({[`&.${Y2.error}`]:{color:(e.vars||e).palette.error.main}}))),sh=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormControlLabel"}),{checked:i,className:o,componentsProps:s={},control:a,disabled:l,disableTypography:c,inputRef:u,label:f,labelPlacement:d="end",name:h,onChange:p,required:g,slots:m={},slotProps:v={},value:y,...b}=r,w=tc(),S=l??a.props.disabled??w?.disabled,_=g??a.props.required,E={disabled:S,required:_};["checked","name","onChange","value","inputRef"].forEach(L=>{typeof a.props[L]>"u"&&typeof r[L]<"u"&&(E[L]=r[L])});const T=_b({props:r,muiFormControl:w,states:["error"]}),k={...r,disabled:S,labelPlacement:d,required:_,error:T.error},P=_1t(k),R={slots:m,slotProps:{...s,...v}},[I,F]=Zt("typography",{elementType:yn,externalForwardedProps:R,ownerState:k});let A=f;return A!=null&&A.type!==yn&&!c&&(A=O.jsx(I,{component:"span",...F,className:Re(P.label,F?.className),children:A})),O.jsxs(C1t,{className:Re(P.root,o),ownerState:k,ref:n,...b,children:[M.cloneElement(a,E),_?O.jsxs("div",{children:[A,O.jsxs(O1t,{ownerState:k,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):A]})});function E1t(e){return pt("MuiFormGroup",e)}dt("MuiFormGroup",["root","row","error"]);const T1t=e=>{const{classes:t,row:n,error:r}=e;return Xe({root:["root",n&&"row",r&&"error"]},E1t,t)},P1t=Oe("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),k1t=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormGroup"}),{className:i,row:o=!1,...s}=r,a=tc(),l=_b({props:r,muiFormControl:a,states:["error"]}),c={...r,row:o,error:l.error},u=T1t(c);return O.jsx(P1t,{className:Re(u.root,i),ownerState:c,ref:n,...s})});function M1t(e){return pt("MuiFormHelperText",e)}const y1e=dt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var b1e;const A1t=e=>{const{classes:t,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=e,c={root:["root",i&&"disabled",o&&"error",r&&`size${Ve(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Xe(c,M1t,t)},R1t=Oe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Ve(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${y1e.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${y1e.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),lle=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p",disabled:a,error:l,filled:c,focused:u,margin:f,required:d,variant:h,...p}=r,g=tc(),m=_b({props:r,muiFormControl:g,states:["variant","size","disabled","error","filled","focused","required"]}),v={...r,component:s,contained:m.variant==="filled"||m.variant==="outlined",variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete v.ownerState;const y=A1t(v);return O.jsx(R1t,{as:s,className:Re(y.root,o),ref:n,...p,ownerState:v,children:i===" "?b1e||(b1e=O.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):i})});function I1t(e){return pt("MuiFormLabel",e)}const HM=dt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),D1t=e=>{const{classes:t,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=e,l={root:["root",`color${Ve(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return Xe(l,I1t,t)},L1t=Oe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{[`&.${HM.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${HM.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${HM.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),F1t=Oe("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(Mt(({theme:e})=>({[`&.${HM.error}`]:{color:(e.vars||e).palette.error.main}}))),eBe=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormLabel"}),{children:i,className:o,color:s,component:a="label",disabled:l,error:c,filled:u,focused:f,required:d,...h}=r,p=tc(),g=_b({props:r,muiFormControl:p,states:["color","required","focused","disabled","error","filled"]}),m={...r,color:g.color||"primary",component:a,disabled:g.disabled,error:g.error,filled:g.filled,focused:g.focused,required:g.required},v=D1t(m);return O.jsxs(L1t,{as:a,ownerState:m,className:Re(v.root,o),ref:n,...h,children:[i,g.required&&O.jsxs(F1t,{ownerState:m,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]})}),x1e=M.createContext();function $1t(e){return pt("MuiGrid",e)}const N1t=[0,1,2,3,4,5,6,7,8,9,10],z1t=["column-reverse","column","row-reverse","row"],j1t=["nowrap","wrap-reverse","wrap"],_k=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],$A=dt("MuiGrid",["root","container","item","zeroMinWidth",...N1t.map(e=>`spacing-xs-${e}`),...z1t.map(e=>`direction-xs-${e}`),...j1t.map(e=>`wrap-xs-${e}`),..._k.map(e=>`grid-xs-${e}`),..._k.map(e=>`grid-sm-${e}`),..._k.map(e=>`grid-md-${e}`),..._k.map(e=>`grid-lg-${e}`),..._k.map(e=>`grid-xl-${e}`)]);function B1t({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((r,i)=>{let o={};if(t[i]&&(n=t[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=B6({values:t.columns,breakpoints:e.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(t.container&&t.item&&t.columnSpacing!==0){const u=e.spacing(t.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${u})`;c={flexBasis:f,maxWidth:f}}}o={flexBasis:l,flexGrow:0,maxWidth:l,...c}}return e.breakpoints.values[i]===0?Object.assign(r,o):r[e.breakpoints.up(i)]=o,r},{})}function U1t({theme:e,ownerState:t}){const n=B6({values:t.direction,breakpoints:e.breakpoints.values});return Hf({theme:e},n,r=>{const i={flexDirection:r};return r.startsWith("column")&&(i[`& > .${$A.item}`]={maxWidth:"none"}),i})}function tBe({breakpoints:e,values:t}){let n="";Object.keys(t).forEach(i=>{n===""&&t[i]!==0&&(n=i)});const r=Object.keys(e).sort((i,o)=>e[i]-e[o]);return r.slice(0,r.indexOf(n))}function V1t({theme:e,ownerState:t}){const{container:n,rowSpacing:r}=t;let i={};if(n&&r!==0){const o=B6({values:r,breakpoints:e.breakpoints.values});let s;typeof o=="object"&&(s=tBe({breakpoints:e.breakpoints.values,values:o})),i=Hf({theme:e},o,(a,l)=>{const c=e.spacing(a);return c!=="0px"?{marginTop:`calc(-1 * ${c})`,[`& > .${$A.item}`]:{paddingTop:c}}:s?.includes(l)?{}:{marginTop:0,[`& > .${$A.item}`]:{paddingTop:0}}})}return i}function W1t({theme:e,ownerState:t}){const{container:n,columnSpacing:r}=t;let i={};if(n&&r!==0){const o=B6({values:r,breakpoints:e.breakpoints.values});let s;typeof o=="object"&&(s=tBe({breakpoints:e.breakpoints.values,values:o})),i=Hf({theme:e},o,(a,l)=>{const c=e.spacing(a);if(c!=="0px"){const u=`calc(-1 * ${c})`;return{width:`calc(100% + ${c})`,marginLeft:u,[`& > .${$A.item}`]:{paddingLeft:c}}}return s?.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${$A.item}`]:{paddingLeft:0}}})}return i}function H1t(e,t,n={}){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[n[`spacing-xs-${String(e)}`]];const r=[];return t.forEach(i=>{const o=e[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const G1t=Oe("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=H1t(s,c,t));const f=[];return c.forEach(d=>{const h=n[d];h&&f.push(t[`grid-${d}-${String(h)}`])}),[t.root,r&&t.container,o&&t.item,l&&t.zeroMinWidth,...u,i!=="row"&&t[`direction-xs-${String(i)}`],a!=="wrap"&&t[`wrap-xs-${String(a)}`],...f]}})(({ownerState:e})=>({boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...e.item&&{margin:0},...e.zeroMinWidth&&{minWidth:0},...e.wrap!=="wrap"&&{flexWrap:e.wrap}}),U1t,V1t,W1t,B1t);function q1t(e,t){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[`spacing-xs-${String(e)}`];const n=[];return t.forEach(r=>{const i=e[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const X1t=e=>{const{classes:t,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=e;let c=[];n&&(c=q1t(o,l));const u=[];l.forEach(d=>{const h=e[d];h&&u.push(`grid-${d}-${String(h)}`)});const f={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Xe(f,$1t,t)},y9=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiGrid"}),{breakpoints:i}=is(),o=zae(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:g="wrap",zeroMinWidth:m=!1,...v}=o,y=h||p,b=l||p,w=M.useContext(x1e),S=u?a||12:w,_={},E={...v};i.keys.forEach(P=>{v[P]!=null&&(_[P]=v[P],delete E[P])});const T={...o,columns:S,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:b,wrap:g,zeroMinWidth:m,spacing:p,..._,breakpoints:i.keys},k=X1t(T);return O.jsx(x1e.Provider,{value:S,children:O.jsx(G1t,{ownerState:T,className:Re(k.root,s),as:c,ref:n,...E})})});function pte(e){return`scale(${e}, ${e**2})`}const Y1t={entering:{opacity:1,transform:pte(1)},entered:{opacity:1,transform:"none"}},b9=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ow=M.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:g="auto",TransitionComponent:m=Hu,...v}=t,y=jl(),b=M.useRef(),w=is(),S=M.useRef(null),_=zn(S,xb(o),n),E=L=>$=>{if(L){const j=S.current;$===void 0?L(j):L(j,$)}},T=E(u),k=E((L,$)=>{Qae(L);const{duration:j,delay:V,easing:U}=G0({style:p,timeout:g,easing:s},{mode:"enter"});let z;g==="auto"?(z=w.transitions.getAutoHeightDuration(L.clientHeight),b.current=z):z=j,L.style.transition=[w.transitions.create("opacity",{duration:z,delay:V}),w.transitions.create("transform",{duration:b9?z:z*.666,delay:V,easing:U})].join(","),l&&l(L,$)}),P=E(c),R=E(h),I=E(L=>{const{duration:$,delay:j,easing:V}=G0({style:p,timeout:g,easing:s},{mode:"exit"});let U;g==="auto"?(U=w.transitions.getAutoHeightDuration(L.clientHeight),b.current=U):U=$,L.style.transition=[w.transitions.create("opacity",{duration:U,delay:j}),w.transitions.create("transform",{duration:b9?U:U*.666,delay:b9?j:j||U*.333,easing:V})].join(","),L.style.opacity=0,L.style.transform=pte(.75),f&&f(L)}),F=E(d),A=L=>{g==="auto"&&y.start(b.current||0,L),r&&r(S.current,L)};return O.jsx(m,{appear:i,in:a,nodeRef:S,onEnter:k,onEntered:P,onEntering:T,onExit:I,onExited:F,onExiting:R,addEndListener:A,timeout:g==="auto"?null:g,...v,children:(L,{ownerState:$,...j})=>M.cloneElement(o,{style:{opacity:0,transform:pte(.75),visibility:L==="exited"&&!a?"hidden":void 0,...Y1t[L],...p,...o.props.style},ref:_,...j})})});ow&&(ow.muiSupportAuto=!0);const cle=oje({themeId:If});function Q1t(e){return pt("MuiIcon",e)}dt("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const K1t=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Ve(t)}`,`fontSize${Ve(n)}`]};return Xe(i,Q1t,r)},Z1t=Oe("span",{name:"MuiIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ve(n.color)}`],t[`fontSize${Ve(n.fontSize)}`]]}})(Mt(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:e.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:e.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(e.vars||e).palette.action.active}},{props:{color:"disabled"},style:{color:(e.vars||e).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),HO=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiIcon"}),{baseClassName:i="material-icons",className:o,color:s="inherit",component:a="span",fontSize:l="medium",...c}=r,u={...r,baseClassName:i,color:s,component:a,fontSize:l},f=K1t(u);return O.jsx(Z1t,{as:a,className:Re(i,"notranslate",f.root,o),ownerState:u,"aria-hidden":!0,ref:n,...c})});HO.muiName="Icon";const J1t=e=>{const{classes:t,disableUnderline:n}=e,i=Xe({root:["root",!n&&"underline"],input:["input"]},X0t,t);return{...t,...i}},ewt=Oe(rU,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...tU(e,t),!n.disableUnderline&&t.underline]}})(Mt(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${i0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${i0.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${i0.disabled}, .${i0.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${i0.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ai()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),twt=Oe(iU,{name:"MuiInput",slot:"Input",overridesResolver:nU})({}),Ob=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:f={},type:d="text",...h}=r,p=J1t(r),m={root:{ownerState:{disableUnderline:i}}},v=u??s?ia(u??s,m):m,y=f.root??o.Root??ewt,b=f.input??o.Input??twt;return O.jsx(wT,{slots:{root:y,input:b},slotProps:v,fullWidth:a,inputComponent:l,multiline:c,ref:n,type:d,...h,classes:p})});Ob.muiName="Input";function nwt(e){return pt("MuiInputAdornment",e)}const w1e=dt("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var S1e;const rwt=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Ve(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},iwt=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=e,a={root:["root",n&&"disablePointerEvents",i&&`position${Ve(i)}`,s,r&&"hiddenLabel",o&&`size${Ve(o)}`]};return Xe(a,nwt,t)},owt=Oe("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:rwt})(Mt(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${w1e.positionStart}&:not(.${w1e.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),ule=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u,...f}=r,d=tc()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p={...r,hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:a,position:c,variant:h},g=iwt(p);return O.jsx(eU.Provider,{value:null,children:O.jsx(owt,{as:s,ownerState:p,className:Re(g.root,o),ref:n,...f,children:typeof i=="string"&&!l?O.jsx(yn,{color:"textSecondary",children:i}):O.jsxs(M.Fragment,{children:[c==="start"?S1e||(S1e=O.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,i]})})})});function swt(e){return pt("MuiInputLabel",e)}dt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const awt=e=>{const{classes:t,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=e,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${Ve(r)}`,s],asterisk:[a&&"asterisk"]},c=Xe(l,swt,t);return{...t,...c}},lwt=Oe(eBe,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${HM.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(Mt(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),_v=M.forwardRef(function(t,n){const r=Dt({name:"MuiInputLabel",props:t}),{disableAnimation:i=!1,margin:o,shrink:s,variant:a,className:l,...c}=r,u=tc();let f=s;typeof f>"u"&&u&&(f=u.filled||u.focused||u.adornedStart);const d=_b({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),h={...r,disableAnimation:i,formControl:u,shrink:f,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=awt(h);return O.jsx(lwt,{"data-shrink":f,ref:n,className:Re(p.root,l),...c,ownerState:h,classes:p})});function cwt(e){return pt("MuiLinearProgress",e)}dt("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const gte=4,mte=pg` +`,Dgt=typeof ree!="string"?gb` + animation: ${ree} 1.4s linear infinite; + `:null,Lgt=typeof iee!="string"?gb` + animation: ${iee} 1.4s ease-in-out infinite; + `:null,Fgt=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${Ue(r)}`],svg:["svg"],circle:["circle",`circle${Ue(n)}`,i&&"circleDisableShrink"]};return Xe(o,Igt,t)},$gt=Oe("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Ue(n.color)}`]]}})(Mt(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Dgt||{animation:`${ree} 1.4s linear infinite`}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),Ngt=Oe("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),zgt=Oe("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Ue(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(Mt(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:Lgt||{animation:`${iee} 1.4s ease-in-out infinite`}}]}))),Ch=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,size:a=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate",...d}=r,h={...r,color:o,disableShrink:s,size:a,thickness:c,value:u,variant:f},p=Fgt(h),g={},m={},v={};if(f==="determinate"){const y=2*Math.PI*((sy-c)/2);g.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,m.transform="rotate(-90deg)"}return O.jsx($gt,{className:Re(p.root,i),style:{width:a,height:a,...m,...l},ownerState:h,ref:n,role:"progressbar",...v,...d,children:O.jsx(Ngt,{className:p.svg,ownerState:h,viewBox:`${sy/2} ${sy/2} ${sy} ${sy}`,children:O.jsx(zgt,{className:p.circle,style:g,ownerState:h,cx:sy,cy:sy,r:(sy-c)/2,fill:"none",strokeWidth:c})})})});function jgt(e){return pt("MuiIconButton",e)}const $be=dt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Bgt=e=>{const{classes:t,disabled:n,color:r,edge:i,size:o,loading:s}=e,a={root:["root",s&&"loading",n&&"disabled",r!=="default"&&`color${Ue(r)}`,i&&`edge${Ue(i)}`,`size${Ue(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Xe(a,jgt,t)},Ugt=Oe(Hf,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Ue(n.color)}`],n.edge&&t[`edge${Ue(n.edge)}`],t[`size${Ue(n.size)}`]]}})(Mt(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Mt(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${$be.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${$be.loading}`]:{color:"transparent"}}))),Vgt=Oe("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Mn=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",id:f,loading:d=null,loadingIndicator:h,...p}=r,g=fr(f),m=h??O.jsx(Ch,{"aria-labelledby":g,color:"inherit",size:16}),v={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,loading:d,loadingIndicator:m,size:u},y=Bgt(v);return O.jsxs(Ugt,{id:d?g:f,className:Re(y.root,s),centerRipple:!0,focusRipple:!c,disabled:l||d,ref:n,...p,ownerState:v,children:[typeof d=="boolean"&&O.jsx("span",{className:y.loadingWrapper,style:{display:"contents"},children:O.jsx(Vgt,{className:y.loadingIndicator,ownerState:v,children:d&&m})}),o]})}),Wgt=at(O.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function Hgt(e){return pt("MuiTypography",e)}const m5=dt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),Ggt={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},qgt=Npt(),Xgt=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=e,a={root:["root",o,e.align!=="inherit"&&`align${Ue(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Xe(a,Hgt,s)},Ygt=Oe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Ue(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(Mt(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Ue(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),Nbe={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},mn=M.forwardRef(function(t,n){const{color:r,...i}=Dt({props:t,name:"MuiTypography"}),o=!Ggt[r],s=qgt({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=Nbe,...g}=s,m={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:f,paragraph:d,variant:h,variantMapping:p},v=c||(d?"p":p[h]||Nbe[h])||"span",y=Xgt(m);return O.jsx(Ygt,{as:v,ref:n,className:Re(y.root,l),...g,ownerState:m,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...g.style}})});function Qgt(e){return pt("MuiAppBar",e)}dt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Kgt=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${Ue(t)}`,`position${Ue(n)}`]};return Xe(i,Qgt,r)},zbe=(e,t)=>e?`${e?.replace(")","")}, ${t})`:t,Zgt=Oe(fa,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Ue(n.position)}`],t[`color${Ue(n.color)}`]]}})(Mt(({theme:e})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles("dark",{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(ai(["contrastText"])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:t=>t.enableColorOnDark===!0&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:t=>t.enableColorOnDark===!1&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundColor:e.vars?zbe(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?zbe(e.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundImage:"none"})}}]}))),Eze=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=Kgt(c);return O.jsx(Zgt,{square:!0,component:"header",ownerState:c,elevation:4,className:Re(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function jbe(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Tze(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:s=!1}=e;return(a,{inputValue:l,getOptionLabel:c})=>{let u=s?l.trim():l;n&&(u=u.toLowerCase()),t&&(u=jbe(u));const f=u?a.filter(d=>{let h=(o||c)(d);return n&&(h=h.toLowerCase()),t&&(h=jbe(h)),i==="start"?h.startsWith(u):h.includes(u)}):a;return typeof r=="number"?f.slice(0,r):f}}const Jgt=Tze(),Bbe=5,emt=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),tmt=[];function Ube(e,t,n){if(t||e==null)return"";const r=n(e);return typeof r=="string"?r:""}function nmt(e){const{unstable_isActiveElementInListbox:t=emt,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:i=!1,autoSelect:o=!1,blurOnSelect:s=!1,clearOnBlur:a=!e.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=e.multiple?tmt:null,disableClearable:f=!1,disableCloseOnSelect:d=!1,disabled:h,disabledItemsFocusable:p=!1,disableListWrap:g=!1,filterOptions:m=Jgt,filterSelectedOptions:v=!1,freeSolo:y=!1,getOptionDisabled:b,getOptionKey:w,getOptionLabel:S=Ge=>Ge.label??Ge,groupBy:_,handleHomeEndKeys:E=!e.freeSolo,id:T,includeInputInList:k=!1,inputValue:P,isOptionEqualToValue:I=(Ge,je)=>Ge===je,multiple:R=!1,onChange:F,onClose:A,onHighlightChange:L,onInputChange:$,onOpen:j,open:V,openOnFocus:U=!1,options:z,readOnly:N=!1,selectOnFocus:B=!e.freeSolo,value:H}=e,Q=fr(T);let Y=S;Y=Ge=>{const je=S(Ge);return typeof je!="string"?String(je):je};const Z=M.useRef(!1),ge=M.useRef(!0),ne=M.useRef(null),ie=M.useRef(null),[fe,ve]=M.useState(null),[se,ue]=M.useState(-1),G=i?0:-1,ce=M.useRef(G),pe=M.useRef(Ube(u??H,R,Y)).current,[J,te]=Da({controlled:H,default:u,name:c}),[ae,we]=Da({controlled:P,default:pe,name:c,state:"inputValue"}),[Pe,ee]=M.useState(!1),re=M.useCallback((Ge,je,yt)=>{if(!(R?J.length!(v&&(R?J:[J]).some(je=>je!==null&&I(Ge,je)))),{inputValue:be&&xe?"":ae,getOptionLabel:Y}):[],ke=Dse({filteredOptions:Ee,value:J,inputValue:ae});M.useEffect(()=>{const Ge=J!==ke.value;Pe&&!Ge||y&&!Ge||re(null,J,"reset")},[J,re,Pe,ke.value,y]);const ze=Se&&Ee.length>0&&!N,De=ft(Ge=>{Ge===-1?ne.current.focus():fe.querySelector(`[data-tag-index="${Ge}"]`).focus()});M.useEffect(()=>{R&&se>J.length-1&&(ue(-1),De(-1))},[J,R,se,De]);function Ve(Ge,je){if(!ie.current||Ge<0||Ge>=Ee.length)return-1;let yt=Ge;for(;;){const Nt=ie.current.querySelector(`[data-option-index="${yt}"]`),Xt=p?!1:!Nt||Nt.disabled||Nt.getAttribute("aria-disabled")==="true";if(Nt&&Nt.hasAttribute("tabindex")&&!Xt)return yt;if(je==="next"?yt=(yt+1)%Ee.length:yt=(yt-1+Ee.length)%Ee.length,yt===Ge)return-1}}const Ze=ft(({event:Ge,index:je,reason:yt})=>{if(ce.current=je,je===-1?ne.current.removeAttribute("aria-activedescendant"):ne.current.setAttribute("aria-activedescendant",`${Q}-option-${je}`),L&&["mouse","keyboard","touch"].includes(yt)&&L(Ge,je===-1?null:Ee[je],yt),!ie.current)return;const Nt=ie.current.querySelector(`[role="option"].${n}-focused`);Nt&&(Nt.classList.remove(`${n}-focused`),Nt.classList.remove(`${n}-focusVisible`));let Xt=ie.current;if(ie.current.getAttribute("role")!=="listbox"&&(Xt=ie.current.parentElement.querySelector('[role="listbox"]')),!Xt)return;if(je===-1){Xt.scrollTop=0;return}const Tn=ie.current.querySelector(`[data-option-index="${je}"]`);if(Tn&&(Tn.classList.add(`${n}-focused`),yt==="keyboard"&&Tn.classList.add(`${n}-focusVisible`),Xt.scrollHeight>Xt.clientHeight&&yt!=="mouse"&&yt!=="touch")){const Jr=Tn,qo=Xt.clientHeight+Xt.scrollTop,qu=Jr.offsetTop+Jr.offsetHeight;qu>qo?Xt.scrollTop=qu-Xt.clientHeight:Jr.offsetTop-Jr.offsetHeight*(_?1.3:0){if(!oe)return;const Tn=Ve((()=>{const Jr=Ee.length-1;if(je==="reset")return G;if(je==="start")return 0;if(je==="end")return Jr;const qo=ce.current+je;return qo<0?qo===-1&&k?-1:g&&ce.current!==-1||Math.abs(je)>1?0:Jr:qo>Jr?qo===Jr+1&&k?-1:g||Math.abs(je)>1?Jr:0:qo})(),yt);if(Ze({index:Tn,reason:Nt,event:Ge}),r&&je!=="reset")if(Tn===-1)ne.current.value=ae;else{const Jr=Y(Ee[Tn]);ne.current.value=Jr,Jr.toLowerCase().indexOf(ae.toLowerCase())===0&&ae.length>0&&ne.current.setSelectionRange(ae.length,Jr.length)}}),Me=()=>{const Ge=(je,yt)=>{const Nt=je?Y(je):"",Xt=yt?Y(yt):"";return Nt===Xt};if(ce.current!==-1&&ke.filteredOptions&&ke.filteredOptions.length!==Ee.length&&ke.inputValue===ae&&(R?J.length===ke.value.length&&ke.value.every((je,yt)=>Y(J[yt])===Y(je)):Ge(ke.value,J))){const je=ke.filteredOptions[ce.current];if(je)return Ee.findIndex(yt=>Y(yt)===Y(je))}return-1},ct=M.useCallback(()=>{if(!oe)return;const Ge=Me();if(Ge!==-1){ce.current=Ge;return}const je=R?J[0]:J;if(Ee.length===0||je==null){mt({diff:"reset"});return}if(ie.current){if(je!=null){const yt=Ee[ce.current];if(R&&yt&&J.findIndex(Xt=>I(yt,Xt))!==-1)return;const Nt=Ee.findIndex(Xt=>I(Xt,je));Nt===-1?mt({diff:"reset"}):Ze({index:Nt});return}if(ce.current>=Ee.length-1){Ze({index:Ee.length-1});return}Ze({index:ce.current})}},[Ee.length,R?!1:J,v,mt,Ze,oe,ae,R]),Fe=ft(Ge=>{KJ(ie,Ge),Ge&&ct()});M.useEffect(()=>{ct()},[ct]);const ht=Ge=>{Se||(he(!0),me(!0),j&&j(Ge))},gt=(Ge,je)=>{Se&&(he(!1),A&&A(Ge,je))},St=(Ge,je,yt,Nt)=>{if(R){if(J.length===je.length&&J.every((Xt,Tn)=>Xt===je[Tn]))return}else if(J===je)return;F&&F(Ge,je,yt,Nt),te(je)},on=M.useRef(!1),Ln=(Ge,je,yt="selectOption",Nt="options")=>{let Xt=yt,Tn=je;if(R){Tn=Array.isArray(J)?J.slice():[];const Jr=Tn.findIndex(qo=>I(je,qo));Jr===-1?Tn.push(je):Nt!=="freeSolo"&&(Tn.splice(Jr,1),Xt="removeOption")}re(Ge,Tn,Xt),St(Ge,Tn,Xt,{option:je}),!d&&(!Ge||!Ge.ctrlKey&&!Ge.metaKey)&>(Ge,Xt),(s===!0||s==="touch"&&on.current||s==="mouse"&&!on.current)&&ne.current.blur()};function xi(Ge,je){if(Ge===-1)return-1;let yt=Ge;for(;;){if(je==="next"&&yt===J.length||je==="previous"&&yt===-1)return-1;const Nt=fe.querySelector(`[data-tag-index="${yt}"]`);if(!Nt||!Nt.hasAttribute("tabindex")||Nt.disabled||Nt.getAttribute("aria-disabled")==="true")yt+=je==="next"?1:-1;else return yt}}const jn=(Ge,je)=>{if(!R)return;ae===""&>(Ge,"toggleInput");let yt=se;se===-1?ae===""&&je==="previous"&&(yt=J.length-1):(yt+=je==="next"?1:-1,yt<0&&(yt=0),yt===J.length&&(yt=-1)),yt=xi(yt,je),ue(yt),De(yt)},sn=Ge=>{Z.current=!0,we(""),$&&$(Ge,"","clear"),St(Ge,R?[]:null,"clear")},xr=Ge=>je=>{if(Ge.onKeyDown&&Ge.onKeyDown(je),!je.defaultMuiPrevented&&(se!==-1&&!["ArrowLeft","ArrowRight"].includes(je.key)&&(ue(-1),De(-1)),je.which!==229))switch(je.key){case"Home":oe&&E&&(je.preventDefault(),mt({diff:"start",direction:"next",reason:"keyboard",event:je}));break;case"End":oe&&E&&(je.preventDefault(),mt({diff:"end",direction:"previous",reason:"keyboard",event:je}));break;case"PageUp":je.preventDefault(),mt({diff:-Bbe,direction:"previous",reason:"keyboard",event:je}),ht(je);break;case"PageDown":je.preventDefault(),mt({diff:Bbe,direction:"next",reason:"keyboard",event:je}),ht(je);break;case"ArrowDown":je.preventDefault(),mt({diff:1,direction:"next",reason:"keyboard",event:je}),ht(je);break;case"ArrowUp":je.preventDefault(),mt({diff:-1,direction:"previous",reason:"keyboard",event:je}),ht(je);break;case"ArrowLeft":jn(je,"previous");break;case"ArrowRight":jn(je,"next");break;case"Enter":if(ce.current!==-1&&oe){const yt=Ee[ce.current],Nt=b?b(yt):!1;if(je.preventDefault(),Nt)return;Ln(je,yt,"selectOption"),r&&ne.current.setSelectionRange(ne.current.value.length,ne.current.value.length)}else y&&ae!==""&&be===!1&&(R&&je.preventDefault(),Ln(je,ae,"createOption","freeSolo"));break;case"Escape":oe?(je.preventDefault(),je.stopPropagation(),gt(je,"escape")):l&&(ae!==""||R&&J.length>0)&&(je.preventDefault(),je.stopPropagation(),sn(je));break;case"Backspace":if(R&&!N&&ae===""&&J.length>0){const yt=se===-1?J.length-1:se,Nt=J.slice();Nt.splice(yt,1),St(je,Nt,"removeOption",{option:J[yt]})}break;case"Delete":if(R&&!N&&ae===""&&J.length>0&&se!==-1){const yt=se,Nt=J.slice();Nt.splice(yt,1),St(je,Nt,"removeOption",{option:J[yt]})}break}},$t=Ge=>{ee(!0),U&&!Z.current&&ht(Ge)},Wt=Ge=>{if(t(ie)){ne.current.focus();return}ee(!1),ge.current=!0,Z.current=!1,o&&ce.current!==-1&&oe?Ln(Ge,Ee[ce.current],"blur"):o&&y&&ae!==""?Ln(Ge,ae,"blur","freeSolo"):a&&re(Ge,J,"blur"),gt(Ge,"blur")},Wn=Ge=>{const je=Ge.target.value;ae!==je&&(we(je),me(!1),$&&$(Ge,je,"input")),je===""?!f&&!R&&St(Ge,null,"clear"):ht(Ge)},Nn=Ge=>{const je=Number(Ge.currentTarget.getAttribute("data-option-index"));ce.current!==je&&Ze({event:Ge,index:je,reason:"mouse"})},fi=Ge=>{Ze({event:Ge,index:Number(Ge.currentTarget.getAttribute("data-option-index")),reason:"touch"}),on.current=!0},ho=Ge=>{const je=Number(Ge.currentTarget.getAttribute("data-option-index"));Ln(Ge,Ee[je],"selectOption"),on.current=!1},_e=Ge=>je=>{const yt=J.slice();yt.splice(Ge,1),St(je,yt,"removeOption",{option:J[Ge]})},Be=Ge=>{Se?gt(Ge,"toggleInput"):ht(Ge)},Qe=Ge=>{Ge.currentTarget.contains(Ge.target)&&Ge.target.getAttribute("id")!==Q&&Ge.preventDefault()},$e=Ge=>{Ge.currentTarget.contains(Ge.target)&&(ne.current.focus(),B&&ge.current&&ne.current.selectionEnd-ne.current.selectionStart===0&&ne.current.select(),ge.current=!1)},Ke=Ge=>{!h&&(ae===""||!Se)&&Be(Ge)};let Lt=y&&ae.length>0;Lt=Lt||(R?J.length>0:J!==null);let rn=Ee;return _&&(rn=Ee.reduce((Ge,je,yt)=>{const Nt=_(je);return Ge.length>0&&Ge[Ge.length-1].group===Nt?Ge[Ge.length-1].options.push(je):Ge.push({key:yt,index:yt,group:Nt,options:[je]}),Ge},[])),h&&Pe&&Wt(),{getRootProps:(Ge={})=>({...Ge,onKeyDown:xr(Ge),onMouseDown:Qe,onClick:$e}),getInputLabelProps:()=>({id:`${Q}-label`,htmlFor:Q}),getInputProps:()=>({id:Q,value:ae,onBlur:Wt,onFocus:$t,onChange:Wn,onMouseDown:Ke,"aria-activedescendant":oe?"":null,"aria-autocomplete":r?"both":"list","aria-controls":ze?`${Q}-listbox`:void 0,"aria-expanded":ze,autoComplete:"off",ref:ne,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:h}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:sn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Be}),getTagProps:({index:Ge})=>({key:Ge,"data-tag-index":Ge,tabIndex:-1,...!N&&{onDelete:_e(Ge)}}),getListboxProps:()=>({role:"listbox",id:`${Q}-listbox`,"aria-labelledby":`${Q}-label`,ref:Fe,onMouseDown:Ge=>{Ge.preventDefault()}}),getOptionProps:({index:Ge,option:je})=>{const yt=(R?J:[J]).some(Xt=>Xt!=null&&I(je,Xt)),Nt=b?b(je):!1;return{key:w?.(je)??Y(je),tabIndex:-1,role:"option",id:`${Q}-option-${Ge}`,onMouseMove:Nn,onClick:ho,onTouchStart:fi,"data-option-index":Ge,"aria-disabled":Nt,"aria-selected":yt}},id:Q,inputValue:ae,value:J,dirty:Lt,expanded:oe&&fe,popupOpen:oe,focused:Pe||se!==-1,anchorEl:fe,setAnchorEl:ve,focusedTag:se,groupedOptions:rn}}var Pc="top",Gf="bottom",qf="right",kc="left",Hse="auto",UI=[Pc,Gf,qf,kc],IO="start",_A="end",rmt="clippingParents",Pze="viewport",gk="popper",imt="reference",Vbe=UI.reduce(function(e,t){return e.concat([t+"-"+IO,t+"-"+_A])},[]),kze=[].concat(UI,[Hse]).reduce(function(e,t){return e.concat([t,t+"-"+IO,t+"-"+_A])},[]),omt="beforeRead",smt="read",amt="afterRead",lmt="beforeMain",cmt="main",umt="afterMain",fmt="beforeWrite",dmt="write",hmt="afterWrite",pmt=[omt,smt,amt,lmt,cmt,umt,fmt,dmt,hmt];function Zp(e){return e?(e.nodeName||"").toLowerCase():null}function $u(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Y1(e){var t=$u(e).Element;return e instanceof t||e instanceof Element}function Df(e){var t=$u(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Gse(e){if(typeof ShadowRoot>"u")return!1;var t=$u(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function gmt(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Df(o)||!Zp(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function mmt(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!Df(i)||!Zp(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const vmt={name:"applyStyles",enabled:!0,phase:"write",fn:gmt,effect:mmt,requires:["computeStyles"]};function Fp(e){return e.split("-")[0]}var S1=Math.max,v5=Math.min,DO=Math.round;function oee(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Mze(){return!/^((?!chrome|android).)*safari/i.test(oee())}function LO(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Df(e)&&(i=e.offsetWidth>0&&DO(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&DO(r.height)/e.offsetHeight||1);var s=Y1(e)?$u(e):window,a=s.visualViewport,l=!Mze()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function qse(e){var t=LO(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Aze(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Gse(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function sv(e){return $u(e).getComputedStyle(e)}function ymt(e){return["table","td","th"].indexOf(Zp(e))>=0}function vb(e){return((Y1(e)?e.ownerDocument:e.document)||window.document).documentElement}function M6(e){return Zp(e)==="html"?e:e.assignedSlot||e.parentNode||(Gse(e)?e.host:null)||vb(e)}function Wbe(e){return!Df(e)||sv(e).position==="fixed"?null:e.offsetParent}function bmt(e){var t=/firefox/i.test(oee()),n=/Trident/i.test(oee());if(n&&Df(e)){var r=sv(e);if(r.position==="fixed")return null}var i=M6(e);for(Gse(i)&&(i=i.host);Df(i)&&["html","body"].indexOf(Zp(i))<0;){var o=sv(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function VI(e){for(var t=$u(e),n=Wbe(e);n&&ymt(n)&&sv(n).position==="static";)n=Wbe(n);return n&&(Zp(n)==="html"||Zp(n)==="body"&&sv(n).position==="static")?t:n||bmt(e)||t}function Xse(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function kM(e,t,n){return S1(e,v5(t,n))}function xmt(e,t,n){var r=kM(e,t,n);return r>n?n:r}function Rze(){return{top:0,right:0,bottom:0,left:0}}function Ize(e){return Object.assign({},Rze(),e)}function Dze(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var wmt=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Ize(typeof t!="number"?t:Dze(t,UI))};function Smt(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Fp(n.placement),l=Xse(a),c=[kc,qf].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=wmt(i.padding,n),d=qse(o),h=l==="y"?Pc:kc,p=l==="y"?Gf:qf,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=VI(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,b=g/2-m/2,w=f[h],S=y-d[u]-f[p],_=y/2-d[u]/2+b,E=kM(w,_,S),T=l;n.modifiersData[r]=(t={},t[T]=E,t.centerOffset=E-_,t)}}function _mt(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Aze(t.elements.popper,i)&&(t.elements.arrow=i))}const Cmt={name:"arrow",enabled:!0,phase:"main",fn:Smt,effect:_mt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function FO(e){return e.split("-")[1]}var Omt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Emt(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:DO(n*i)/i||0,y:DO(r*i)/i||0}}function Hbe(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=kc,w=Pc,S=window;if(c){var _=VI(n),E="clientHeight",T="clientWidth";if(_===$u(n)&&(_=vb(n),sv(_).position!=="static"&&a==="absolute"&&(E="scrollHeight",T="scrollWidth")),_=_,i===Pc||(i===kc||i===qf)&&o===_A){w=Gf;var k=f&&_===S&&S.visualViewport?S.visualViewport.height:_[E];g-=k-r.height,g*=l?1:-1}if(i===kc||(i===Pc||i===Gf)&&o===_A){b=qf;var P=f&&_===S&&S.visualViewport?S.visualViewport.width:_[T];h-=P-r.width,h*=l?1:-1}}var I=Object.assign({position:a},c&&Omt),R=u===!0?Emt({x:h,y:g},$u(n)):{x:h,y:g};if(h=R.x,g=R.y,l){var F;return Object.assign({},I,(F={},F[w]=y?"0":"",F[b]=v?"0":"",F.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",F))}return Object.assign({},I,(t={},t[w]=y?g+"px":"",t[b]=v?h+"px":"",t.transform="",t))}function Tmt(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:Fp(t.placement),variation:FO(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Hbe(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Hbe(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Pmt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Tmt,data:{}};var o$={passive:!0};function kmt(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=$u(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,o$)}),a&&l.addEventListener("resize",n.update,o$),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,o$)}),a&&l.removeEventListener("resize",n.update,o$)}}const Mmt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kmt,data:{}};var Amt={left:"right",right:"left",bottom:"top",top:"bottom"};function sz(e){return e.replace(/left|right|bottom|top/g,function(t){return Amt[t]})}var Rmt={start:"end",end:"start"};function Gbe(e){return e.replace(/start|end/g,function(t){return Rmt[t]})}function Yse(e){var t=$u(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Qse(e){return LO(vb(e)).left+Yse(e).scrollLeft}function Imt(e,t){var n=$u(e),r=vb(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=Mze();(c||!c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Qse(e),y:l}}function Dmt(e){var t,n=vb(e),r=Yse(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=S1(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=S1(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Qse(e),l=-r.scrollTop;return sv(i||n).direction==="rtl"&&(a+=S1(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Kse(e){var t=sv(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Lze(e){return["html","body","#document"].indexOf(Zp(e))>=0?e.ownerDocument.body:Df(e)&&Kse(e)?e:Lze(M6(e))}function MM(e,t){var n;t===void 0&&(t=[]);var r=Lze(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=$u(r),s=i?[o].concat(o.visualViewport||[],Kse(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(MM(M6(s)))}function see(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Lmt(e,t){var n=LO(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function qbe(e,t,n){return t===Pze?see(Imt(e,n)):Y1(t)?Lmt(t,n):see(Dmt(vb(e)))}function Fmt(e){var t=MM(M6(e)),n=["absolute","fixed"].indexOf(sv(e).position)>=0,r=n&&Df(e)?VI(e):e;return Y1(r)?t.filter(function(i){return Y1(i)&&Aze(i,r)&&Zp(i)!=="body"}):[]}function $mt(e,t,n,r){var i=t==="clippingParents"?Fmt(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=qbe(e,c,r);return l.top=S1(u.top,l.top),l.right=v5(u.right,l.right),l.bottom=v5(u.bottom,l.bottom),l.left=S1(u.left,l.left),l},qbe(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Fze(e){var t=e.reference,n=e.element,r=e.placement,i=r?Fp(r):null,o=r?FO(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(i){case Pc:l={x:s,y:t.y-n.height};break;case Gf:l={x:s,y:t.y+t.height};break;case qf:l={x:t.x+t.width,y:a};break;case kc:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=i?Xse(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case IO:l[c]=l[c]-(t[u]/2-n[u]/2);break;case _A:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function CA(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?rmt:a,c=n.rootBoundary,u=c===void 0?Pze:c,f=n.elementContext,d=f===void 0?gk:f,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,m=g===void 0?0:g,v=Ize(typeof m!="number"?m:Dze(m,UI)),y=d===gk?imt:gk,b=e.rects.popper,w=e.elements[p?y:d],S=$mt(Y1(w)?w:w.contextElement||vb(e.elements.popper),l,u,s),_=LO(e.elements.reference),E=Fze({reference:_,element:b,placement:i}),T=see(Object.assign({},b,E)),k=d===gk?T:_,P={top:S.top-k.top+v.top,bottom:k.bottom-S.bottom+v.bottom,left:S.left-k.left+v.left,right:k.right-S.right+v.right},I=e.modifiersData.offset;if(d===gk&&I){var R=I[i];Object.keys(P).forEach(function(F){var A=[qf,Gf].indexOf(F)>=0?1:-1,L=[Pc,Gf].indexOf(F)>=0?"y":"x";P[F]+=R[L]*A})}return P}function Nmt(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?kze:l,u=FO(r),f=u?a?Vbe:Vbe.filter(function(p){return FO(p)===u}):UI,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,g){return p[g]=CA(e,{placement:g,boundary:i,rootBoundary:o,padding:s})[Fp(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function zmt(e){if(Fp(e)===Hse)return[];var t=sz(e);return[Gbe(e),t,Gbe(t)]}function jmt(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,m=t.options.placement,v=Fp(m),y=v===m,b=l||(y||!p?[sz(m)]:zmt(m)),w=[m].concat(b).reduce(function(Q,Y){return Q.concat(Fp(Y)===Hse?Nmt(t,{placement:Y,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):Y)},[]),S=t.rects.reference,_=t.rects.popper,E=new Map,T=!0,k=w[0],P=0;P=0,L=A?"width":"height",$=CA(t,{placement:I,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),j=A?F?qf:kc:F?Gf:Pc;S[L]>_[L]&&(j=sz(j));var V=sz(j),U=[];if(o&&U.push($[R]<=0),a&&U.push($[j]<=0,$[V]<=0),U.every(function(Q){return Q})){k=I,T=!1;break}E.set(I,U)}if(T)for(var z=p?3:1,N=function(Y){var Z=w.find(function(ge){var ne=E.get(ge);if(ne)return ne.slice(0,Y).every(function(ie){return ie})});if(Z)return k=Z,"break"},B=z;B>0;B--){var H=N(B);if(H==="break")break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}}const Bmt={name:"flip",enabled:!0,phase:"main",fn:jmt,requiresIfExists:["offset"],data:{_skip:!1}};function Xbe(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ybe(e){return[Pc,qf,Gf,kc].some(function(t){return e[t]>=0})}function Umt(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=CA(t,{elementContext:"reference"}),a=CA(t,{altBoundary:!0}),l=Xbe(s,r),c=Xbe(a,i,o),u=Ybe(l),f=Ybe(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const Vmt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Umt};function Wmt(e,t,n){var r=Fp(e),i=[kc,Pc].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[kc,qf].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Hmt(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=kze.reduce(function(u,f){return u[f]=Wmt(f,t.rects,o),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const Gmt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Hmt};function qmt(e){var t=e.state,n=e.name;t.modifiersData[n]=Fze({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Xmt={name:"popperOffsets",enabled:!0,phase:"read",fn:qmt,data:{}};function Ymt(e){return e==="x"?"y":"x"}function Qmt(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,g=p===void 0?0:p,m=CA(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=Fp(t.placement),y=FO(t.placement),b=!y,w=Xse(v),S=Ymt(w),_=t.modifiersData.popperOffsets,E=t.rects.reference,T=t.rects.popper,k=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,P=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),I=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(_){if(o){var F,A=w==="y"?Pc:kc,L=w==="y"?Gf:qf,$=w==="y"?"height":"width",j=_[w],V=j+m[A],U=j-m[L],z=h?-T[$]/2:0,N=y===IO?E[$]:T[$],B=y===IO?-T[$]:-E[$],H=t.elements.arrow,Q=h&&H?qse(H):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Rze(),Z=Y[A],ge=Y[L],ne=kM(0,E[$],Q[$]),ie=b?E[$]/2-z-ne-Z-P.mainAxis:N-ne-Z-P.mainAxis,fe=b?-E[$]/2+z+ne+ge+P.mainAxis:B+ne+ge+P.mainAxis,ve=t.elements.arrow&&VI(t.elements.arrow),se=ve?w==="y"?ve.clientTop||0:ve.clientLeft||0:0,ue=(F=I?.[w])!=null?F:0,G=j+ie-ue-se,ce=j+fe-ue,pe=kM(h?v5(V,G):V,j,h?S1(U,ce):U);_[w]=pe,R[w]=pe-j}if(a){var J,te=w==="x"?Pc:kc,ae=w==="x"?Gf:qf,we=_[S],Pe=S==="y"?"height":"width",ee=we+m[te],re=we-m[ae],Se=[Pc,kc].indexOf(v)!==-1,he=(J=I?.[S])!=null?J:0,xe=Se?ee:we-E[Pe]-T[Pe]-he+P.altAxis,me=Se?we+E[Pe]+T[Pe]-he-P.altAxis:re,be=h&&Se?xmt(xe,we,me):kM(h?xe:ee,we,h?me:re);_[S]=be,R[S]=be-we}t.modifiersData[r]=R}}const Kmt={name:"preventOverflow",enabled:!0,phase:"main",fn:Qmt,requiresIfExists:["offset"]};function Zmt(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Jmt(e){return e===$u(e)||!Df(e)?Yse(e):Zmt(e)}function evt(e){var t=e.getBoundingClientRect(),n=DO(t.width)/e.offsetWidth||1,r=DO(t.height)/e.offsetHeight||1;return n!==1||r!==1}function tvt(e,t,n){n===void 0&&(n=!1);var r=Df(t),i=Df(t)&&evt(t),o=vb(t),s=LO(e,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Zp(t)!=="body"||Kse(o))&&(a=Jmt(t)),Df(t)?(l=LO(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Qse(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function nvt(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function rvt(e){var t=nvt(e);return pmt.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function ivt(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function ovt(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Qbe={placement:"bottom",modifiers:[],strategy:"absolute"};function Kbe(){for(var e=arguments.length,t=new Array(e),n=0;n{o||a(cvt(i)||document.body)},[i,o]),lr(()=>{if(s&&!o)return KJ(n,s),()=>{KJ(n,null)}},[n,s,o]),o){if(M.isValidElement(r)){const c={ref:l};return M.cloneElement(r,c)}return r}return s&&p6.createPortal(r,s)});function uvt(e){return pt("MuiPopper",e)}dt("MuiPopper",["root"]);function fvt(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function aee(e){return typeof e=="function"?e():e}function dvt(e){return e.nodeType!==void 0}const hvt=e=>{const{classes:t}=e;return Xe({root:["root"]},uvt,t)},pvt={},gvt=M.forwardRef(function(t,n){const{anchorEl:r,children:i,direction:o,disablePortal:s,modifiers:a,open:l,placement:c,popperOptions:u,popperRef:f,slotProps:d={},slots:h={},TransitionProps:p,ownerState:g,...m}=t,v=M.useRef(null),y=zn(v,n),b=M.useRef(null),w=zn(b,f),S=M.useRef(w);lr(()=>{S.current=w},[w]),M.useImperativeHandle(f,()=>b.current,[]);const _=fvt(c,o),[E,T]=M.useState(_),[k,P]=M.useState(aee(r));M.useEffect(()=>{b.current&&b.current.forceUpdate()}),M.useEffect(()=>{r&&P(aee(r))},[r]),lr(()=>{if(!k||!l)return;const L=V=>{T(V.placement)};let $=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:V})=>{L(V)}}];a!=null&&($=$.concat(a)),u&&u.modifiers!=null&&($=$.concat(u.modifiers));const j=lvt(k,v.current,{placement:_,...u,modifiers:$});return S.current(j),()=>{j.destroy(),S.current(null)}},[k,s,a,l,u,_]);const I={placement:E};p!==null&&(I.TransitionProps=p);const R=hvt(t),F=h.root??"div",A=Xn({elementType:F,externalSlotProps:d.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:y},ownerState:t,className:R.root});return O.jsx(F,{...A,children:typeof i=="function"?i(I):i})}),mvt=M.forwardRef(function(t,n){const{anchorEl:r,children:i,container:o,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=pvt,popperRef:h,style:p,transition:g=!1,slotProps:m={},slots:v={},...y}=t,[b,w]=M.useState(!0),S=()=>{w(!1)},_=()=>{w(!0)};if(!l&&!u&&(!g||b))return null;let E;if(o)E=o;else if(r){const P=aee(r);E=P&&dvt(P)?ci(P).body:ci(null).body}const T=!u&&l&&(!g||b)?"none":void 0,k=g?{in:u,onEnter:S,onExited:_}:void 0;return O.jsx($ze,{disablePortal:a,container:E,children:O.jsx(gvt,{anchorEl:r,direction:s,disablePortal:a,modifiers:c,ref:n,open:g?!b:u,placement:f,popperOptions:d,popperRef:h,slotProps:m,slots:v,...y,style:{position:"fixed",top:0,left:0,display:T,...p},TransitionProps:k,children:i})})}),vvt=Oe(mvt,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),yb=M.forwardRef(function(t,n){const r=yi(),i=Dt({props:t,name:"MuiPopper"}),{anchorEl:o,component:s,components:a,componentsProps:l,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,slots:y,slotProps:b,...w}=i,S=y?.root??a?.Root,_={anchorEl:o,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,...w};return O.jsx(vvt,{as:s,direction:r?"rtl":"ltr",slots:{root:S},slotProps:b??l,..._,ref:n})});function yvt(e){return pt("MuiListSubheader",e)}dt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const bvt=e=>{const{classes:t,color:n,disableGutters:r,inset:i,disableSticky:o}=e,s={root:["root",n!=="default"&&`color${Ue(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return Xe(s,yvt,t)},xvt=Oe("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Ue(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(Mt(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),lee=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListSubheader"}),{className:i,color:o="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:c=!1,...u}=r,f={...r,color:o,component:s,disableGutters:a,disableSticky:l,inset:c},d=bvt(f);return O.jsx(xvt,{as:s,className:Re(d.root,i),ref:n,ownerState:f,...u})});lee&&(lee.muiSkipListHighlight=!0);const wvt=at(O.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Svt(e){return pt("MuiChip",e)}const wr=dt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),_vt=e=>{const{classes:t,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=e,c={root:["root",l,n&&"disabled",`size${Ue(r)}`,`color${Ue(i)}`,a&&"clickable",a&&`clickableColor${Ue(i)}`,s&&"deletable",s&&`deletableColor${Ue(i)}`,`${l}${Ue(i)}`],label:["label",`label${Ue(r)}`],avatar:["avatar",`avatar${Ue(r)}`,`avatarColor${Ue(i)}`],icon:["icon",`icon${Ue(r)}`,`iconColor${Ue(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Ue(r)}`,`deleteIconColor${Ue(i)}`,`deleteIcon${Ue(l)}Color${Ue(i)}`]};return Xe(c,Svt,t)},Cvt=Oe("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${wr.avatar}`]:t.avatar},{[`& .${wr.avatar}`]:t[`avatar${Ue(a)}`]},{[`& .${wr.avatar}`]:t[`avatarColor${Ue(r)}`]},{[`& .${wr.icon}`]:t.icon},{[`& .${wr.icon}`]:t[`icon${Ue(a)}`]},{[`& .${wr.icon}`]:t[`iconColor${Ue(i)}`]},{[`& .${wr.deleteIcon}`]:t.deleteIcon},{[`& .${wr.deleteIcon}`]:t[`deleteIcon${Ue(a)}`]},{[`& .${wr.deleteIcon}`]:t[`deleteIconColor${Ue(r)}`]},{[`& .${wr.deleteIcon}`]:t[`deleteIcon${Ue(l)}Color${Ue(r)}`]},t.root,t[`size${Ue(a)}`],t[`color${Ue(r)}`],o&&t.clickable,o&&r!=="default"&&t[`clickableColor${Ue(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${Ue(r)}`],t[l],t[`${l}${Ue(r)}`]]}})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${wr.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${wr.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${wr.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${wr.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${wr.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${wr.icon}`]:{marginLeft:5,marginRight:-6},[`& .${wr.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Vt(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Vt(e.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${wr.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${wr.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(ai(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${wr.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[n].contrastTextChannel} / 0.7)`:Vt(e.palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${wr.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${wr.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${wr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Vt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}},...Object.entries(e.palette).filter(ai(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${wr.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Vt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${wr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Vt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(ai(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${wr.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${wr.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${wr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${wr.avatar}`]:{marginLeft:4},[`& .${wr.avatarSmall}`]:{marginLeft:2},[`& .${wr.icon}`]:{marginLeft:4},[`& .${wr.iconSmall}`]:{marginLeft:2},[`& .${wr.deleteIcon}`]:{marginRight:5},[`& .${wr.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(ai()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[n].mainChannel} / 0.7)`:Vt(e.palette[n].main,.7)}`,[`&.${wr.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[n].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette[n].main,e.palette.action.hoverOpacity)},[`&.${wr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[n].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Vt(e.palette[n].main,e.palette.action.focusOpacity)},[`& .${wr.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[n].mainChannel} / 0.7)`:Vt(e.palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),Ovt=Oe("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${Ue(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function Zbe(e){return e.key==="Backspace"||e.key==="Delete"}const A6=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:g,onKeyUp:m,size:v="medium",variant:y="filled",tabIndex:b,skipFocusWhenDisabled:w=!1,...S}=r,_=M.useRef(null),E=zn(_,n),T=U=>{U.stopPropagation(),p&&p(U)},k=U=>{U.currentTarget===U.target&&Zbe(U)&&U.preventDefault(),g&&g(U)},P=U=>{U.currentTarget===U.target&&p&&Zbe(U)&&p(U),m&&m(U)},I=s!==!1&&h?!0:s,R=I||p?Hf:l||"div",F={...r,component:R,disabled:u,size:v,color:a,iconColor:M.isValidElement(f)&&f.props.color||a,onDelete:!!p,clickable:I,variant:y},A=_vt(F),L=R===Hf?{component:l||"div",focusVisibleClassName:A.focusVisible,...p&&{disableRipple:!0}}:{};let $=null;p&&($=c&&M.isValidElement(c)?M.cloneElement(c,{className:Re(c.props.className,A.deleteIcon),onClick:T}):O.jsx(wvt,{className:Re(A.deleteIcon),onClick:T}));let j=null;i&&M.isValidElement(i)&&(j=M.cloneElement(i,{className:Re(A.avatar,i.props.className)}));let V=null;return f&&M.isValidElement(f)&&(V=M.cloneElement(f,{className:Re(A.icon,f.props.className)})),O.jsxs(Cvt,{as:R,className:Re(A.root,o),disabled:I&&u?!0:void 0,onClick:h,onKeyDown:k,onKeyUp:P,ref:E,tabIndex:w&&u?-1:b,ownerState:F,...L,...S,children:[j||V,O.jsx(Ovt,{className:Re(A.label),ownerState:F,children:d}),$]})});function s$(e){return parseInt(e,10)||0}const Evt={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Tvt(e){for(const t in e)return!1;return!0}function Jbe(e){return Tvt(e)||e.outerHeightStyle===0&&!e.overflowing}const Pvt=M.forwardRef(function(t,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a,...l}=t,{current:c}=M.useRef(a!=null),u=M.useRef(null),f=zn(n,u),d=M.useRef(null),h=M.useRef(null),p=M.useCallback(()=>{const b=u.current,w=h.current;if(!b||!w)return;const _=Lc(b).getComputedStyle(b);if(_.width==="0px")return{outerHeightStyle:0,overflowing:!1};w.style.width=_.width,w.value=b.value||t.placeholder||"x",w.value.slice(-1)===` +`&&(w.value+=" ");const E=_.boxSizing,T=s$(_.paddingBottom)+s$(_.paddingTop),k=s$(_.borderBottomWidth)+s$(_.borderTopWidth),P=w.scrollHeight;w.value="x";const I=w.scrollHeight;let R=P;o&&(R=Math.max(Number(o)*I,R)),i&&(R=Math.min(Number(i)*I,R)),R=Math.max(R,I);const F=R+(E==="border-box"?T+k:0),A=Math.abs(R-P)<=1;return{outerHeightStyle:F,overflowing:A}},[i,o,t.placeholder]),g=ft(()=>{const b=u.current,w=p();if(!b||!w||Jbe(w))return!1;const S=w.outerHeightStyle;return d.current!=null&&d.current!==S}),m=M.useCallback(()=>{const b=u.current,w=p();if(!b||!w||Jbe(w))return;const S=w.outerHeightStyle;d.current!==S&&(d.current=S,b.style.height=`${S}px`),b.style.overflow=w.overflowing?"hidden":""},[p]),v=M.useRef(-1);lr(()=>{const b=zI(m),w=u?.current;if(!w)return;const S=Lc(w);S.addEventListener("resize",b);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(()=>{g()&&(_.unobserve(w),cancelAnimationFrame(v.current),m(),v.current=requestAnimationFrame(()=>{_.observe(w)}))}),_.observe(w)),()=>{b.clear(),cancelAnimationFrame(v.current),S.removeEventListener("resize",b),_&&_.disconnect()}},[p,m,g]),lr(()=>{m()});const y=b=>{c||m(),r&&r(b)};return O.jsxs(M.Fragment,{children:[O.jsx("textarea",{value:a,onChange:y,ref:f,rows:o,style:s,...l}),O.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:h,tabIndex:-1,style:{...Evt.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function zm(e){return typeof e=="string"}function bb({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const R6=M.createContext(void 0);function Jl(){return M.useContext(R6)}function exe(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function y5(e,t=!1){return e&&(exe(e.value)&&e.value!==""||t&&exe(e.defaultValue)&&e.defaultValue!=="")}function kvt(e){return e.startAdornment}function Mvt(e){return pt("MuiInputBase",e)}const Xs=dt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var txe;const I6=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Ue(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},D6=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},Avt=e=>{const{classes:t,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=e,g={root:["root",`color${Ue(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",d&&d!=="medium"&&`size${Ue(d)}`,u&&"multiline",h&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Xe(g,Mvt,t)},L6=Oe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:I6})(Mt(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Xs.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),F6=Oe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:D6})(Mt(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Xs.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${Xs.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:o})=>!o.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:o})=>o.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),nxe=Nse({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),hT=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:o,autoFocus:s,className:a,color:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,error:g,fullWidth:m=!1,id:v,inputComponent:y="input",inputProps:b={},inputRef:w,margin:S,maxRows:_,minRows:E,multiline:T=!1,name:k,onBlur:P,onChange:I,onClick:R,onFocus:F,onKeyDown:A,onKeyUp:L,placeholder:$,readOnly:j,renderSuffix:V,rows:U,size:z,slotProps:N={},slots:B={},startAdornment:H,type:Q="text",value:Y,...Z}=r,ge=b.value!=null?b.value:Y,{current:ne}=M.useRef(ge!=null),ie=M.useRef(),fe=M.useCallback(ke=>{},[]),ve=zn(ie,w,b.ref,fe),[se,ue]=M.useState(!1),G=Jl(),ce=bb({props:r,muiFormControl:G,states:["color","disabled","error","hiddenLabel","size","required","filled"]});ce.focused=G?G.focused:se,M.useEffect(()=>{!G&&d&&se&&(ue(!1),P&&P())},[G,d,se,P]);const pe=G&&G.onFilled,J=G&&G.onEmpty,te=M.useCallback(ke=>{y5(ke)?pe&&pe():J&&J()},[pe,J]);lr(()=>{ne&&te({value:ge})},[ge,te,ne]);const ae=ke=>{F&&F(ke),b.onFocus&&b.onFocus(ke),G&&G.onFocus?G.onFocus(ke):ue(!0)},we=ke=>{P&&P(ke),b.onBlur&&b.onBlur(ke),G&&G.onBlur?G.onBlur(ke):ue(!1)},Pe=(ke,...ze)=>{if(!ne){const De=ke.target||ie.current;if(De==null)throw new Error(ov(1));te({value:De.value})}b.onChange&&b.onChange(ke,...ze),I&&I(ke,...ze)};M.useEffect(()=>{te(ie.current)},[]);const ee=ke=>{ie.current&&ke.currentTarget===ke.target&&ie.current.focus(),R&&R(ke)};let re=y,Se=b;T&&re==="input"&&(U?Se={type:void 0,minRows:U,maxRows:U,...Se}:Se={type:void 0,maxRows:_,minRows:E,...Se},re=Pvt);const he=ke=>{te(ke.animationName==="mui-auto-fill-cancel"?ie.current:{value:"x"})};M.useEffect(()=>{G&&G.setAdornedStart(!!H)},[G,H]);const xe={...r,color:ce.color||"primary",disabled:ce.disabled,endAdornment:p,error:ce.error,focused:ce.focused,formControl:G,fullWidth:m,hiddenLabel:ce.hiddenLabel,multiline:T,size:ce.size,startAdornment:H,type:Q},me=Avt(xe),be=B.root||c.Root||L6,oe=N.root||u.root||{},Ee=B.input||c.Input||F6;return Se={...Se,...N.input??u.input},O.jsxs(M.Fragment,{children:[!h&&typeof nxe=="function"&&(txe||(txe=O.jsx(nxe,{}))),O.jsxs(be,{...oe,ref:n,onClick:ee,...Z,...!zm(be)&&{ownerState:{...xe,...oe.ownerState}},className:Re(me.root,oe.className,a,j&&"MuiInputBase-readOnly"),children:[H,O.jsx(R6.Provider,{value:null,children:O.jsx(Ee,{"aria-invalid":ce.error,"aria-describedby":i,autoComplete:o,autoFocus:s,defaultValue:f,disabled:ce.disabled,id:v,onAnimationStart:he,name:k,placeholder:$,readOnly:j,required:ce.required,rows:U,value:ge,onKeyDown:A,onKeyUp:L,type:Q,...Se,...!zm(Ee)&&{as:re,ownerState:{...xe,...Se.ownerState}},ref:ve,className:Re(me.input,Se.className,j&&"MuiInputBase-readOnly"),onBlur:we,onChange:Pe,onFocus:ae})}),p,V?V({...ce,startAdornment:H}):null]})]})});function Rvt(e){return pt("MuiInput",e)}const e0={...Xs,...dt("MuiInput",["root","underline","input"])};function Ivt(e){return pt("MuiOutlinedInput",e)}const uf={...Xs,...dt("MuiOutlinedInput",["root","notchedOutline","input"])};function Dvt(e){return pt("MuiFilledInput",e)}const mu={...Xs,...dt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},Nze=at(O.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Lvt(e){return pt("MuiAutocomplete",e)}const cr=dt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var rxe,ixe;const Fvt=e=>{const{classes:t,disablePortal:n,expanded:r,focused:i,fullWidth:o,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:c,size:u}=e,f={root:["root",r&&"expanded",i&&"focused",o&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Ue(u)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Xe(f,Lvt,t)},$vt=Oe("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:i,hasPopupIcon:o,inputFocused:s,size:a}=n;return[{[`& .${cr.tag}`]:t.tag},{[`& .${cr.tag}`]:t[`tagSize${Ue(a)}`]},{[`& .${cr.inputRoot}`]:t.inputRoot},{[`& .${cr.input}`]:t.input},{[`& .${cr.input}`]:s&&t.inputFocused},t.root,r&&t.fullWidth,o&&t.hasPopupIcon,i&&t.hasClearIcon]}})({[`&.${cr.focused} .${cr.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${cr.clearIndicator}`]:{visibility:"visible"}},[`& .${cr.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${cr.inputRoot}`]:{[`.${cr.hasPopupIcon}&, .${cr.hasClearIcon}&`]:{paddingRight:30},[`.${cr.hasPopupIcon}.${cr.hasClearIcon}&`]:{paddingRight:56},[`& .${cr.input}`]:{width:0,minWidth:30}},[`& .${e0.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${e0.root}.${Xs.sizeSmall}`]:{[`& .${e0.input}`]:{padding:"2px 4px 3px 0"}},[`& .${uf.root}`]:{padding:9,[`.${cr.hasPopupIcon}&, .${cr.hasClearIcon}&`]:{paddingRight:39},[`.${cr.hasPopupIcon}.${cr.hasClearIcon}&`]:{paddingRight:65},[`& .${cr.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${cr.endAdornment}`]:{right:9}},[`& .${uf.root}.${Xs.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${cr.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${mu.root}`]:{paddingTop:19,paddingLeft:8,[`.${cr.hasPopupIcon}&, .${cr.hasClearIcon}&`]:{paddingRight:39},[`.${cr.hasPopupIcon}.${cr.hasClearIcon}&`]:{paddingRight:65},[`& .${mu.input}`]:{padding:"7px 4px"},[`& .${cr.endAdornment}`]:{right:9}},[`& .${mu.root}.${Xs.sizeSmall}`]:{paddingBottom:1,[`& .${mu.input}`]:{padding:"2.5px 4px"}},[`& .${Xs.hiddenLabel}`]:{paddingTop:8},[`& .${mu.root}.${Xs.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${cr.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${mu.root}.${Xs.hiddenLabel}.${Xs.sizeSmall}`]:{[`& .${cr.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${cr.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${cr.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${cr.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${cr.inputRoot}`]:{flexWrap:"wrap"}}}]}),Nvt=Oe("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),zvt=Oe(Mn,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),jvt=Oe(Mn,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Bvt=Oe(yb,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${cr.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(Mt(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),Uvt=Oe(fa,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(Mt(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),Vvt=Oe("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),Wvt=Oe("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),Hvt=Oe("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(Mt(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${cr.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${cr.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${cr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${cr.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${cr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}}))),Gvt=Oe(lee,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(Mt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),qvt=Oe("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${cr.option}`]:{paddingLeft:24}}),zze=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAutocomplete"}),{autoComplete:i=!1,autoHighlight:o=!1,autoSelect:s=!1,blurOnSelect:a=!1,ChipProps:l,className:c,clearIcon:u=rxe||(rxe=O.jsx(Wgt,{fontSize:"small"})),clearOnBlur:f=!r.freeSolo,clearOnEscape:d=!1,clearText:h="Clear",closeText:p="Close",componentsProps:g,defaultValue:m=r.multiple?[]:null,disableClearable:v=!1,disableCloseOnSelect:y=!1,disabled:b=!1,disabledItemsFocusable:w=!1,disableListWrap:S=!1,disablePortal:_=!1,filterOptions:E,filterSelectedOptions:T=!1,forcePopupIcon:k="auto",freeSolo:P=!1,fullWidth:I=!1,getLimitTagsText:R=Fn=>`+${Fn}`,getOptionDisabled:F,getOptionKey:A,getOptionLabel:L,isOptionEqualToValue:$,groupBy:j,handleHomeEndKeys:V=!r.freeSolo,id:U,includeInputInList:z=!1,inputValue:N,limitTags:B=-1,ListboxComponent:H,ListboxProps:Q,loading:Y=!1,loadingText:Z="Loading…",multiple:ge=!1,noOptionsText:ne="No options",onChange:ie,onClose:fe,onHighlightChange:ve,onInputChange:se,onOpen:ue,open:G,openOnFocus:ce=!1,openText:pe="Open",options:J,PaperComponent:te,PopperComponent:ae,popupIcon:we=ixe||(ixe=O.jsx(Nze,{})),readOnly:Pe=!1,renderGroup:ee,renderInput:re,renderOption:Se,renderTags:he,selectOnFocus:xe=!r.freeSolo,size:me="medium",slots:be={},slotProps:oe={},value:Ee,...ke}=r,{getRootProps:ze,getInputProps:De,getInputLabelProps:Ve,getPopupIndicatorProps:Ze,getClearProps:mt,getTagProps:Me,getListboxProps:ct,getOptionProps:Fe,value:ht,dirty:gt,expanded:St,id:on,popupOpen:Ln,focused:xi,focusedTag:jn,anchorEl:sn,setAnchorEl:xr,inputValue:$t,groupedOptions:Wt}=nmt({...r,componentName:"Autocomplete"}),Wn=!v&&!b&>&&!Pe,Nn=(!P||k===!0)&&k!==!1,{onMouseDown:fi}=De(),{ref:ho,..._e}=ct(),Qe=L||(Fn=>Fn.label??Fn),$e={...r,disablePortal:_,expanded:St,focused:xi,fullWidth:I,getOptionLabel:Qe,hasClearIcon:Wn,hasPopupIcon:Nn,inputFocused:jn===-1,popupOpen:Ln,size:me},Ke=Fvt($e),Lt={slots:{paper:te,popper:ae,...be},slotProps:{chip:l,listbox:Q,...g,...oe}},[rn,Ge]=Zt("listbox",{elementType:Hvt,externalForwardedProps:Lt,ownerState:$e,className:Ke.listbox,additionalProps:_e,ref:ho}),[je,yt]=Zt("paper",{elementType:fa,externalForwardedProps:Lt,ownerState:$e,className:Ke.paper}),[Nt,Xt]=Zt("popper",{elementType:yb,externalForwardedProps:Lt,ownerState:$e,className:Ke.popper,additionalProps:{disablePortal:_,style:{width:sn?sn.clientWidth:null},role:"presentation",anchorEl:sn,open:Ln}});let Tn;if(ge&&ht.length>0){const Fn=Xo=>({className:Ke.tag,disabled:b,...Me(Xo)});he?Tn=he(ht,Fn,$e):Tn=ht.map((Xo,ga)=>{const{key:rc,...Pi}=Fn({index:ga});return O.jsx(A6,{label:Qe(Xo),size:me,...Pi,...Lt.slotProps.chip},rc)})}if(B>-1&&Array.isArray(Tn)){const Fn=Tn.length-B;!xi&&Fn>0&&(Tn=Tn.splice(0,B),Tn.push(O.jsx("span",{className:Ke.tag,children:R(Fn)},Tn.length)))}const qo=ee||(Fn=>O.jsxs("li",{children:[O.jsx(Gvt,{className:Ke.groupLabel,ownerState:$e,component:"div",children:Fn.group}),O.jsx(qvt,{className:Ke.groupUl,ownerState:$e,children:Fn.children})]},Fn.key)),Dr=Se||((Fn,Xo)=>{const{key:ga,...rc}=Fn;return O.jsx("li",{...rc,children:Qe(Xo)},ga)}),Pr=(Fn,Xo)=>{const ga=Fe({option:Fn,index:Xo});return Dr({...ga,className:Ke.option},Fn,{selected:ga["aria-selected"],index:Xo,inputValue:$t},$e)},Yc=Lt.slotProps.clearIndicator,Hi=Lt.slotProps.popupIndicator;return O.jsxs(M.Fragment,{children:[O.jsx($vt,{ref:n,className:Re(Ke.root,c),ownerState:$e,...ze(ke),children:re({id:on,disabled:b,fullWidth:!0,size:me==="small"?"small":void 0,InputLabelProps:Ve(),InputProps:{ref:xr,className:Ke.inputRoot,startAdornment:Tn,onMouseDown:Fn=>{Fn.target===Fn.currentTarget&&fi(Fn)},...(Wn||Nn)&&{endAdornment:O.jsxs(Nvt,{className:Ke.endAdornment,ownerState:$e,children:[Wn?O.jsx(zvt,{...mt(),"aria-label":h,title:h,ownerState:$e,...Yc,className:Re(Ke.clearIndicator,Yc?.className),children:u}):null,Nn?O.jsx(jvt,{...Ze(),disabled:b,"aria-label":Ln?p:pe,title:Ln?p:pe,ownerState:$e,...Hi,className:Re(Ke.popupIndicator,Hi?.className),children:we}):null]})}},inputProps:{className:Ke.input,disabled:b,readOnly:Pe,...De()}})}),sn?O.jsx(Bvt,{as:Nt,...Xt,children:O.jsxs(Uvt,{as:je,...yt,children:[Y&&Wt.length===0?O.jsx(Vvt,{className:Ke.loading,ownerState:$e,children:Z}):null,Wt.length===0&&!P&&!Y?O.jsx(Wvt,{className:Ke.noOptions,ownerState:$e,role:"presentation",onMouseDown:Fn=>{Fn.preventDefault()},children:ne}):null,Wt.length>0?O.jsx(rn,{as:H,...Ge,children:Wt.map((Fn,Xo)=>j?qo({key:Fn.key,group:Fn.group,children:Fn.options.map((ga,rc)=>Pr(ga,Fn.index+rc))}):Pr(Fn,Xo))}):null]})}):null]})}),Xvt=at(O.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function Yvt(e){return pt("MuiAvatar",e)}dt("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Qvt=e=>{const{classes:t,variant:n,colorDefault:r}=e;return Xe({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},Yvt,t)},Kvt=Oe("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(Mt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(e.vars||e).palette.background.default,...e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.grey[400],...e.applyStyles("dark",{backgroundColor:e.palette.grey[600]})}}}]}))),Zvt=Oe("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Jvt=Oe(Xvt,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});function eyt({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[i,o]=M.useState(!1);return M.useEffect(()=>{if(!n&&!r)return;o(!1);let s=!0;const a=new Image;return a.onload=()=>{s&&o("loaded")},a.onerror=()=>{s&&o("error")},a.crossOrigin=e,a.referrerPolicy=t,a.src=n,r&&(a.srcset=r),()=>{s=!1}},[e,t,n,r]),i}const VG=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiAvatar"}),{alt:i,children:o,className:s,component:a="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular",...g}=r;let m=null;const v={...r,component:a,variant:p},y=eyt({...u,...typeof c.img=="function"?c.img(v):c.img,src:d,srcSet:h}),b=d||h,w=b&&y!=="error";v.colorDefault=!w,delete v.ownerState;const S=Qvt(v),[_,E]=Zt("img",{className:S.img,elementType:Zvt,externalForwardedProps:{slots:l,slotProps:{img:{...u,...c.img}}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:v});return w?m=O.jsx(_,{...E}):o||o===0?m=o:b&&i?m=i[0]:m=O.jsx(Jvt,{ownerState:v,className:S.fallback}),O.jsx(Kvt,{as:a,className:Re(S.root,s),ref:n,...g,ownerState:v,children:m})}),tyt={entering:{opacity:1},entered:{opacity:1}},Q1=M.forwardRef(function(t,n){const r=as(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:g,style:m,timeout:v=i,TransitionComponent:y=Hu,...b}=t,w=M.useRef(null),S=zn(w,mb(a),n),_=A=>L=>{if(A){const $=w.current;L===void 0?A($):A($,L)}},E=_(d),T=_((A,L)=>{Bse(A);const $=j0({style:m,timeout:v,easing:l},{mode:"enter"});A.style.webkitTransition=r.transitions.create("opacity",$),A.style.transition=r.transitions.create("opacity",$),u&&u(A,L)}),k=_(f),P=_(g),I=_(A=>{const L=j0({style:m,timeout:v,easing:l},{mode:"exit"});A.style.webkitTransition=r.transitions.create("opacity",L),A.style.transition=r.transitions.create("opacity",L),h&&h(A)}),R=_(p),F=A=>{o&&o(w.current,A)};return O.jsx(y,{appear:s,in:c,nodeRef:w,onEnter:T,onEntered:k,onEntering:E,onExit:I,onExited:R,onExiting:P,addEndListener:F,timeout:v,...b,children:(A,{ownerState:L,...$})=>M.cloneElement(a,{style:{opacity:0,visibility:A==="exited"&&!c?"hidden":void 0,...tyt[A],...m,...a.props.style},ref:S,...$})})});function nyt(e){return pt("MuiBackdrop",e)}dt("MuiBackdrop",["root","invisible"]);const ryt=e=>{const{classes:t,invisible:n}=e;return Xe({root:["root",n&&"invisible"]},nyt,t)},iyt=Oe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),jze=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiBackdrop"}),{children:i,className:o,component:s="div",invisible:a=!1,open:l,components:c={},componentsProps:u={},slotProps:f={},slots:d={},TransitionComponent:h,transitionDuration:p,...g}=r,m={...r,component:s,invisible:a},v=ryt(m),y={transition:h,root:c.Root,...d},b={...u,...f},w={slots:y,slotProps:b},[S,_]=Zt("root",{elementType:iyt,externalForwardedProps:w,className:Re(v.root,o),ownerState:m}),[E,T]=Zt("transition",{elementType:Q1,externalForwardedProps:w,ownerState:m});return O.jsx(E,{in:l,timeout:p,...g,...T,children:O.jsx(S,{"aria-hidden":!0,..._,classes:v,ref:n,children:i})})});function oyt(e){const{badgeContent:t,invisible:n=!1,max:r=99,showZero:i=!1}=e,o=Dse({badgeContent:t,max:r});let s=n;n===!1&&t===0&&!i&&(s=!0);const{badgeContent:a,max:l=r}=s?o:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}function syt(e){return pt("MuiBadge",e)}const ay=dt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),WG=10,HG=4,ayt=e=>{const{color:t,anchorOrigin:n,invisible:r,overlap:i,variant:o,classes:s={}}=e,a={root:["root"],badge:["badge",o,r&&"invisible",`anchorOrigin${Ue(n.vertical)}${Ue(n.horizontal)}`,`anchorOrigin${Ue(n.vertical)}${Ue(n.horizontal)}${Ue(i)}`,`overlap${Ue(i)}`,t!=="default"&&`color${Ue(t)}`]};return Xe(a,syt,s)},lyt=Oe("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),cyt=Oe("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${Ue(n.anchorOrigin.vertical)}${Ue(n.anchorOrigin.horizontal)}${Ue(n.overlap)}`],n.color!=="default"&&t[`color${Ue(n.color)}`],n.invisible&&t.invisible]}})(Mt(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:WG*2,lineHeight:1,padding:"0 6px",height:WG*2,borderRadius:WG,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.entries(e.palette).filter(ai(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText}})),{props:{variant:"dot"},style:{borderRadius:HG,height:HG*2,minWidth:HG*2,padding:0}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${ay.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${ay.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${ay.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${ay.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${ay.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${ay.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${ay.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${ay.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]})));function oxe(e){return{vertical:e?.vertical??"top",horizontal:e?.horizontal??"right"}}const uyt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiBadge"}),{anchorOrigin:i,className:o,classes:s,component:a,components:l={},componentsProps:c={},children:u,overlap:f="rectangular",color:d="default",invisible:h=!1,max:p=99,badgeContent:g,slots:m,slotProps:v,showZero:y=!1,variant:b="standard",...w}=r,{badgeContent:S,invisible:_,max:E,displayValue:T}=oyt({max:p,invisible:h,badgeContent:g,showZero:y}),k=Dse({anchorOrigin:oxe(i),color:d,overlap:f,variant:b,badgeContent:g}),P=_||S==null&&b!=="dot",{color:I=d,overlap:R=f,anchorOrigin:F,variant:A=b}=P?k:r,L=oxe(F),$=A!=="dot"?T:void 0,j={...r,badgeContent:S,invisible:P,max:E,displayValue:$,showZero:y,anchorOrigin:L,color:I,overlap:R,variant:A},V=ayt(j),U={slots:{root:m?.root??l.Root,badge:m?.badge??l.Badge},slotProps:{root:v?.root??c.root,badge:v?.badge??c.badge}},[z,N]=Zt("root",{elementType:lyt,externalForwardedProps:{...U,...w},ownerState:j,className:Re(V.root,o),ref:n,additionalProps:{as:a}}),[B,H]=Zt("badge",{elementType:cyt,externalForwardedProps:U,ownerState:j,className:V.badge});return O.jsxs(z,{...N,children:[u,O.jsx(B,{...H,children:$})]})}),fyt=dt("MuiBox",["root"]),dyt=dT(),bt=ght({themeId:If,defaultTheme:dyt,defaultClassName:fyt.root,generateClassName:Y3e.generate});function hyt(e){return pt("MuiButton",e)}const ax=dt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),pyt=M.createContext({}),gyt=M.createContext(void 0),myt=e=>{const{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,loading:s,loadingPosition:a,classes:l}=e,c={root:["root",s&&"loading",o,`${o}${Ue(t)}`,`size${Ue(i)}`,`${o}Size${Ue(i)}`,`color${Ue(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${Ue(a)}`],startIcon:["icon","startIcon",`iconSize${Ue(i)}`],endIcon:["icon","endIcon",`iconSize${Ue(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},u=Xe(c,hyt,l);return{...l,...u}},Bze=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],vyt=Oe(Hf,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Ue(n.color)}`],t[`size${Ue(n.size)}`],t[`${n.variant}Size${Ue(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${ax.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${ax.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${ax.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${ax.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(ai()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.vars?`rgba(${e.vars.palette[r].mainChannel} / 0.5)`:Vt(e.palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette[r].main,e.palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette[r].main,e.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.text.primary,e.palette.action.hoverOpacity),"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.text.primary,e.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${ax.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${ax.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${ax.loading}`]:{color:"transparent"}}}]}})),yyt=Oe("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Ue(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...Bze]})),byt=Oe("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Ue(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Bze]})),xyt=Oe("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),sxe=Oe("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),zi=M.forwardRef(function(t,n){const r=M.useContext(pyt),i=M.useContext(gyt),o=X1(r,t),s=Dt({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:g,fullWidth:m=!1,id:v,loading:y=null,loadingIndicator:b,loadingPosition:w="center",size:S="medium",startIcon:_,type:E,variant:T="text",...k}=s,P=fr(v),I=b??O.jsx(Ch,{"aria-labelledby":P,color:"inherit",size:16}),R={...s,color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:m,loading:y,loadingIndicator:I,loadingPosition:w,size:S,type:E,variant:T},F=myt(R),A=(_||y&&w==="start")&&O.jsx(yyt,{className:F.startIcon,ownerState:R,children:_||O.jsx(sxe,{className:F.loadingIconPlaceholder,ownerState:R})}),L=(p||y&&w==="end")&&O.jsx(byt,{className:F.endIcon,ownerState:R,children:p||O.jsx(sxe,{className:F.loadingIconPlaceholder,ownerState:R})}),$=i||"",j=typeof y=="boolean"?O.jsx("span",{className:F.loadingWrapper,style:{display:"contents"},children:y&&O.jsx(xyt,{className:F.loadingIndicator,ownerState:R,children:I})}):null;return O.jsxs(vyt,{ownerState:R,className:Re(r.className,F.root,u,$),component:c,disabled:f||y,focusRipple:!h,focusVisibleClassName:Re(F.focusVisible,g),ref:n,type:E,id:y?P:v,...k,classes:F,children:[A,w!=="end"&&j,a,w==="end"&&j,L]})});function wyt(e){return pt("MuiCard",e)}dt("MuiCard",["root"]);const Syt=e=>{const{classes:t}=e;return Xe({root:["root"]},wyt,t)},_yt=Oe(fa,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})({overflow:"hidden"}),Cyt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=Syt(a);return O.jsx(_yt,{className:Re(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function Oyt(e){return pt("MuiCardActions",e)}dt("MuiCardActions",["root","spacing"]);const Eyt=e=>{const{classes:t,disableSpacing:n}=e;return Xe({root:["root",!n&&"spacing"]},Oyt,t)},Tyt=Oe("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Pyt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o,...s}=r,a={...r,disableSpacing:i},l=Eyt(a);return O.jsx(Tyt,{className:Re(l.root,o),ownerState:a,ref:n,...s})});function kyt(e){return pt("MuiCardContent",e)}dt("MuiCardContent",["root"]);const Myt=e=>{const{classes:t}=e;return Xe({root:["root"]},kyt,t)},Ayt=Oe("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:16,"&:last-child":{paddingBottom:24}}),Uze=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=Myt(a);return O.jsx(Ayt,{as:o,className:Re(l.root,i),ownerState:a,ref:n,...s})});function Ryt(e){return pt("MuiCardHeader",e)}const b5=dt("MuiCardHeader",["root","avatar","action","content","title","subheader"]),Iyt=e=>{const{classes:t}=e;return Xe({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},Ryt,t)},Dyt=Oe("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(e,t)=>[{[`& .${b5.title}`]:t.title},{[`& .${b5.subheader}`]:t.subheader},t.root]})({display:"flex",alignItems:"center",padding:16}),Lyt=Oe("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(e,t)=>t.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),Fyt=Oe("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(e,t)=>t.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),$yt=Oe("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(e,t)=>t.content})({flex:"1 1 auto",[`.${m5.root}:where(& .${b5.title})`]:{display:"block"},[`.${m5.root}:where(& .${b5.subheader})`]:{display:"block"}}),Nyt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCardHeader"}),{action:i,avatar:o,component:s="div",disableTypography:a=!1,subheader:l,subheaderTypographyProps:c,title:u,titleTypographyProps:f,slots:d={},slotProps:h={},...p}=r,g={...r,component:s,disableTypography:a},m=Iyt(g),v={slots:d,slotProps:{title:f,subheader:c,...h}};let y=u;const[b,w]=Zt("title",{className:m.title,elementType:mn,externalForwardedProps:v,ownerState:g,additionalProps:{variant:o?"body2":"h5",component:"span"}});y!=null&&y.type!==mn&&!a&&(y=O.jsx(b,{...w,children:y}));let S=l;const[_,E]=Zt("subheader",{className:m.subheader,elementType:mn,externalForwardedProps:v,ownerState:g,additionalProps:{variant:o?"body2":"body1",color:"textSecondary",component:"span"}});S!=null&&S.type!==mn&&!a&&(S=O.jsx(_,{...E,children:S}));const[T,k]=Zt("root",{ref:n,className:m.root,elementType:Dyt,externalForwardedProps:{...v,...p,component:s},ownerState:g}),[P,I]=Zt("avatar",{className:m.avatar,elementType:Lyt,externalForwardedProps:v,ownerState:g}),[R,F]=Zt("content",{className:m.content,elementType:$yt,externalForwardedProps:v,ownerState:g}),[A,L]=Zt("action",{className:m.action,elementType:Fyt,externalForwardedProps:v,ownerState:g});return O.jsxs(T,{...k,children:[o&&O.jsx(P,{...I,children:o}),O.jsxs(R,{...F,children:[y,S]}),i&&O.jsx(A,{...L,children:i})]})});function zyt(e){return pt("MuiCardMedia",e)}dt("MuiCardMedia",["root","media","img"]);const jyt=e=>{const{classes:t,isMediaComponent:n,isImageComponent:r}=e;return Xe({root:["root",n&&"media",r&&"img"]},zyt,t)},Byt=Oe("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{isMediaComponent:r,isImageComponent:i}=n;return[t.root,r&&t.media,i&&t.img]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),Uyt=["video","audio","picture","iframe","img"],Vyt=["picture","img"],Wyt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCardMedia"}),{children:i,className:o,component:s="div",image:a,src:l,style:c,...u}=r,f=Uyt.includes(s),d=!f&&a?{backgroundImage:`url("${a}")`,...c}:c,h={...r,component:s,isMediaComponent:f,isImageComponent:Vyt.includes(s)},p=jyt(h);return O.jsx(Byt,{className:Re(p.root,o),as:s,role:!f&&a?"img":void 0,ref:n,style:d,ownerState:h,src:f?a||l:void 0,...u,children:i})});function Hyt(e){return pt("PrivateSwitchBase",e)}dt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Gyt=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Ue(i)}`],input:["input"]};return Xe(o,Hyt,t)},qyt=Oe(Hf,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),Xyt=Oe("input",{name:"MuiSwitchBase",shouldForwardProp:ua})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Zse=M.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:o,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:f,inputProps:d,inputRef:h,name:p,onBlur:g,onChange:m,onFocus:v,readOnly:y,required:b=!1,tabIndex:w,type:S,value:_,slots:E={},slotProps:T={},...k}=t,[P,I]=Da({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),R=Jl(),F=Y=>{v&&v(Y),R&&R.onFocus&&R.onFocus(Y)},A=Y=>{g&&g(Y),R&&R.onBlur&&R.onBlur(Y)},L=Y=>{if(Y.nativeEvent.defaultPrevented)return;const Z=Y.target.checked;I(Z),m&&m(Y,Z)};let $=a;R&&typeof $>"u"&&($=R.disabled);const j=S==="checkbox"||S==="radio",V={...t,checked:P,disabled:$,disableFocusRipple:l,edge:c},U=Gyt(V),z={slots:E,slotProps:{input:d,...T}},[N,B]=Zt("root",{ref:n,elementType:qyt,className:U.root,shouldForwardComponentProp:!0,externalForwardedProps:{...z,component:"span",...k},getSlotProps:Y=>({...Y,onFocus:Z=>{Y.onFocus?.(Z),F(Z)},onBlur:Z=>{Y.onBlur?.(Z),A(Z)}}),ownerState:V,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:$,role:void 0,tabIndex:null}}),[H,Q]=Zt("input",{ref:h,elementType:Xyt,className:U.input,externalForwardedProps:z,getSlotProps:Y=>({onChange:Z=>{Y.onChange?.(Z),L(Z)}}),ownerState:V,additionalProps:{autoFocus:r,checked:i,defaultChecked:s,disabled:$,id:j?f:void 0,name:p,readOnly:y,required:b,tabIndex:w,type:S,...S==="checkbox"&&_===void 0?{}:{value:_}}});return O.jsxs(N,{...B,children:[O.jsx(H,{...Q}),P?o:u]})}),Yyt=at(O.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Qyt=at(O.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Kyt=at(O.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function Zyt(e){return pt("MuiCheckbox",e)}const GG=dt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Jyt=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${Ue(r)}`,`size${Ue(i)}`]},s=Xe(o,Zyt,t);return{...t,...s}},e0t=Oe(Zse,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Ue(n.size)}`],n.color!=="default"&&t[`color${Ue(n.color)}`]]}})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{[`&.${GG.checked}, &.${GG.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${GG.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),t0t=O.jsx(Qyt,{}),n0t=O.jsx(Yyt,{}),r0t=O.jsx(Kyt,{}),OA=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiCheckbox"}),{checkedIcon:i=t0t,color:o="primary",icon:s=n0t,indeterminate:a=!1,indeterminateIcon:l=r0t,inputProps:c,size:u="medium",disableRipple:f=!1,className:d,slots:h={},slotProps:p={},...g}=r,m=a?l:s,v=a?l:i,y={...r,disableRipple:f,color:o,indeterminate:a,size:u},b=Jyt(y),w=p.input??c,[S,_]=Zt("root",{ref:n,elementType:e0t,className:Re(b.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:p,...g},ownerState:y,additionalProps:{type:"checkbox",icon:M.cloneElement(m,{fontSize:m.props.fontSize??u}),checkedIcon:M.cloneElement(v,{fontSize:v.props.fontSize??u}),disableRipple:f,slots:h,slotProps:{input:_ze(typeof w=="function"?w(y):w,{"data-indeterminate":a})}}});return O.jsx(S,{..._,classes:b})});function axe(e){return e.substring(2).toLowerCase()}function i0t(e,t){return t.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=zn(mb(t),a),f=ft(p=>{const g=c.current;c.current=!1;const m=ci(a.current);if(!l.current||!a.current||"clientX"in p&&i0t(p,m))return;if(s.current){s.current=!1;return}let v;p.composedPath?v=p.composedPath().includes(a.current):v=!m.documentElement.contains(p.target)||a.current.contains(p.target),!v&&(n||!g)&&i(p)}),d=p=>g=>{c.current=!0;const m=t.props[p];m&&m(g)},h={ref:u};return o!==!1&&(h[o]=d(o)),M.useEffect(()=>{if(o!==!1){const p=axe(o),g=ci(a.current),m=()=>{s.current=!0};return g.addEventListener(p,f),g.addEventListener("touchmove",m),()=>{g.removeEventListener(p,f),g.removeEventListener("touchmove",m)}}},[f,o]),r!==!1&&(h[r]=d(r)),M.useEffect(()=>{if(r!==!1){const p=axe(r),g=ci(a.current);return g.addEventListener(p,f),()=>{g.removeEventListener(p,f)}}},[f,r]),M.cloneElement(t,h)}const cee=typeof Nse({})=="function",o0t=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),s0t=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),Vze=(e,t=!1)=>{const n={};t&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([o,s])=>{const a=e.getColorSchemeSelector(o);a.startsWith("@")?n[a]={":root":{colorScheme:s.palette?.mode}}:n[a.replace(/\s*&/,"")]={colorScheme:s.palette?.mode}});let r={html:o0t(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...s0t(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...n};const i=e.components?.MuiCssBaseline?.styleOverrides;return i&&(r=[r,i]),r},az="mui-ecs",a0t=e=>{const t=Vze(e,!1),n=Array.isArray(t)?t[0]:t;return!e.vars&&n&&(n.html[`:root:has(${az})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([r,i])=>{const o=e.getColorSchemeSelector(r);o.startsWith("@")?n[o]={[`:root:not(:has(.${az}))`]:{colorScheme:i.palette?.mode}}:n[o.replace(/\s*&/,"")]={[`&:not(:has(.${az}))`]:{colorScheme:i.palette?.mode}}}),t},l0t=Nse(cee?({theme:e,enableColorScheme:t})=>Vze(e,t):({theme:e})=>a0t(e));function c0t(e){const t=Dt({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return O.jsxs(M.Fragment,{children:[cee&&O.jsx(l0t,{enableColorScheme:r}),!cee&&!r&&O.jsx("span",{className:az,style:{display:"none"}}),n]})}function u0t(e){const t=ci(e);return t.body===e?Lc(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function AM(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function lxe(e){return parseInt(Lc(e).getComputedStyle(e).paddingRight,10)||0}function f0t(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function cxe(e,t,n,r,i){const o=[t,n,...r];[].forEach.call(e.children,s=>{const a=!o.includes(s),l=!f0t(s);a&&l&&AM(s,i)})}function qG(e,t){let n=-1;return e.some((r,i)=>t(r)?(n=i,!0):!1),n}function d0t(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(u0t(r)){const s=oze(Lc(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${lxe(r)+s}px`;const a=ci(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${lxe(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=ci(r).body;else{const s=r.parentElement,a=Lc(r);o=s?.nodeName==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function h0t(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class p0t{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&AM(t.modalRef,!1);const i=h0t(n);cxe(n,t.mount,t.modalRef,i,!0);const o=qG(this.containers,s=>s.container===n);return o!==-1?(this.containers[o].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:i}),r)}mount(t,n){const r=qG(this.containers,o=>o.modals.includes(t)),i=this.containers[r];i.restore||(i.restore=d0t(i,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const i=qG(this.containers,s=>s.modals.includes(t)),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(t),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),t.modalRef&&AM(t.modalRef,n),cxe(o.container,t.mount,t.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&AM(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const g0t=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function m0t(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function v0t(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function y0t(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||v0t(e))}function b0t(e){const t=[],n=[];return Array.from(e.querySelectorAll(g0t)).forEach((r,i)=>{const o=m0t(r);o===-1||!y0t(r)||(o===0?t.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(t)}function x0t(){return!0}function eae(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=b0t,isEnabled:s=x0t,open:a}=e,l=M.useRef(!1),c=M.useRef(null),u=M.useRef(null),f=M.useRef(null),d=M.useRef(null),h=M.useRef(!1),p=M.useRef(null),g=zn(mb(t),p),m=M.useRef(null);M.useEffect(()=>{!a||!p.current||(h.current=!n)},[n,a]),M.useEffect(()=>{if(!a||!p.current)return;const b=ci(p.current);return p.current.contains(b.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),M.useEffect(()=>{if(!a||!p.current)return;const b=ci(p.current),w=E=>{m.current=E,!(r||!s()||E.key!=="Tab")&&b.activeElement===p.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},S=()=>{const E=p.current;if(E===null)return;if(!b.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(b.activeElement)||r&&b.activeElement!==c.current&&b.activeElement!==u.current)return;if(b.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!h.current)return;let T=[];if((b.activeElement===c.current||b.activeElement===u.current)&&(T=o(p.current)),T.length>0){const k=!!(m.current?.shiftKey&&m.current?.key==="Tab"),P=T[0],I=T[T.length-1];typeof P!="string"&&typeof I!="string"&&(k?I.focus():P.focus())}else E.focus()};b.addEventListener("focusin",S),b.addEventListener("keydown",w,!0);const _=setInterval(()=>{b.activeElement&&b.activeElement.tagName==="BODY"&&S()},50);return()=>{clearInterval(_),b.removeEventListener("focusin",S),b.removeEventListener("keydown",w,!0)}},[n,r,i,s,a,o]);const v=b=>{f.current===null&&(f.current=b.relatedTarget),h.current=!0,d.current=b.target;const w=t.props.onFocus;w&&w(b)},y=b=>{f.current===null&&(f.current=b.relatedTarget),h.current=!0};return O.jsxs(M.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),M.cloneElement(t,{ref:g,onFocus:v}),O.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function w0t(e){return typeof e=="function"?e():e}function S0t(e){return e?e.props.hasOwnProperty("in"):!1}const uxe=()=>{},a$=new p0t;function _0t(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:o,onTransitionExited:s,children:a,onClose:l,open:c,rootRef:u}=e,f=M.useRef({}),d=M.useRef(null),h=M.useRef(null),p=zn(h,u),[g,m]=M.useState(!c),v=S0t(a);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const b=()=>ci(d.current),w=()=>(f.current.modalRef=h.current,f.current.mount=d.current,f.current),S=()=>{a$.mount(w(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},_=ft(()=>{const L=w0t(t)||b().body;a$.add(w(),L),h.current&&S()}),E=()=>a$.isTopModal(w()),T=ft(L=>{d.current=L,L&&(c&&E()?S():h.current&&AM(h.current,y))}),k=M.useCallback(()=>{a$.remove(w(),y)},[y]);M.useEffect(()=>()=>{k()},[k]),M.useEffect(()=>{c?_():(!v||!i)&&k()},[c,k,v,i,_]);const P=L=>$=>{L.onKeyDown?.($),!($.key!=="Escape"||$.which===229||!E())&&(n||($.stopPropagation(),l&&l($,"escapeKeyDown")))},I=L=>$=>{L.onClick?.($),$.target===$.currentTarget&&l&&l($,"backdropClick")};return{getRootProps:(L={})=>{const $=w1(e);delete $.onTransitionEnter,delete $.onTransitionExited;const j={...$,...L};return{role:"presentation",...j,onKeyDown:P(j),ref:p}},getBackdropProps:(L={})=>{const $=L;return{"aria-hidden":!0,...$,onClick:I($),open:c}},getTransitionProps:()=>{const L=()=>{m(!1),o&&o()},$=()=>{m(!0),s&&s(),i&&k()};return{onEnter:QJ(L,a?.props.onEnter??uxe),onExited:QJ($,a?.props.onExited??uxe)}},rootRef:p,portalRef:T,isTopModal:E,exited:g,hasTransition:v}}function C0t(e){return pt("MuiModal",e)}dt("MuiModal",["root","hidden","backdrop"]);const O0t=e=>{const{open:t,exited:n,classes:r}=e;return Xe({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},C0t,r)},E0t=Oe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(Mt(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),T0t=Oe(jze,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),Wze=M.forwardRef(function(t,n){const r=Dt({name:"MuiModal",props:t}),{BackdropComponent:i=T0t,BackdropProps:o,classes:s,className:a,closeAfterTransition:l=!1,children:c,container:u,component:f,components:d={},componentsProps:h={},disableAutoFocus:p=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:m=!1,disablePortal:v=!1,disableRestoreFocus:y=!1,disableScrollLock:b=!1,hideBackdrop:w=!1,keepMounted:S=!1,onBackdropClick:_,onClose:E,onTransitionEnter:T,onTransitionExited:k,open:P,slotProps:I={},slots:R={},theme:F,...A}=r,L={...r,closeAfterTransition:l,disableAutoFocus:p,disableEnforceFocus:g,disableEscapeKeyDown:m,disablePortal:v,disableRestoreFocus:y,disableScrollLock:b,hideBackdrop:w,keepMounted:S},{getRootProps:$,getBackdropProps:j,getTransitionProps:V,portalRef:U,isTopModal:z,exited:N,hasTransition:B}=_0t({...L,rootRef:n}),H={...L,exited:N},Q=O0t(H),Y={};if(c.props.tabIndex===void 0&&(Y.tabIndex="-1"),B){const{onEnter:ve,onExited:se}=V();Y.onEnter=ve,Y.onExited=se}const Z={slots:{root:d.Root,backdrop:d.Backdrop,...R},slotProps:{...h,...I}},[ge,ne]=Zt("root",{ref:n,elementType:E0t,externalForwardedProps:{...Z,...A,component:f},getSlotProps:$,ownerState:H,className:Re(a,Q?.root,!H.open&&H.exited&&Q?.hidden)}),[ie,fe]=Zt("backdrop",{ref:o?.ref,elementType:i,externalForwardedProps:Z,shouldForwardComponentProp:!0,additionalProps:o,getSlotProps:ve=>j({...ve,onClick:se=>{_&&_(se),ve?.onClick&&ve.onClick(se)}}),className:Re(o?.className,Q?.backdrop),ownerState:H});return!S&&!P&&(!B||N)?null:O.jsx($ze,{ref:U,container:u,disablePortal:v,children:O.jsxs(ge,{...ne,children:[!w&&i?O.jsx(ie,{...fe}):null,O.jsx(eae,{disableEnforceFocus:g,disableAutoFocus:p,disableRestoreFocus:y,isEnabled:z,open:P,children:M.cloneElement(c,Y)})]})})});function P0t(e){return pt("MuiDialog",e)}const RM=dt("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Hze=M.createContext({}),k0t=Oe(jze,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),M0t=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=e,s={root:["root"],container:["container",`scroll${Ue(n)}`],paper:["paper",`paperScroll${Ue(n)}`,`paperWidth${Ue(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return Xe(s,P0t,t)},A0t=Oe(Wze,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),R0t=Oe("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Ue(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),I0t=Oe(fa,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Ue(n.scroll)}`],t[`paperWidth${Ue(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Mt(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${RM.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${RM.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${RM.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Gu=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialog"}),i=as(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:f,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:g=!1,maxWidth:m="sm",onBackdropClick:v,onClick:y,onClose:b,open:w,PaperComponent:S=fa,PaperProps:_={},scroll:E="paper",slots:T={},slotProps:k={},TransitionComponent:P=Q1,transitionDuration:I=o,TransitionProps:R,...F}=r,A={...r,disableEscapeKeyDown:h,fullScreen:p,fullWidth:g,maxWidth:m,scroll:E},L=M0t(A),$=M.useRef(),j=G=>{$.current=G.target===G.currentTarget},V=G=>{y&&y(G),$.current&&($.current=null,v&&v(G),b&&b(G,"backdropClick"))},U=fr(a),z=M.useMemo(()=>({titleId:U}),[U]),N={transition:P,...T},B={transition:R,paper:_,backdrop:u,...k},H={slots:N,slotProps:B},[Q,Y]=Zt("root",{elementType:A0t,shouldForwardComponentProp:!0,externalForwardedProps:H,ownerState:A,className:Re(L.root,d),ref:n}),[Z,ge]=Zt("backdrop",{elementType:k0t,shouldForwardComponentProp:!0,externalForwardedProps:H,ownerState:A}),[ne,ie]=Zt("paper",{elementType:I0t,shouldForwardComponentProp:!0,externalForwardedProps:H,ownerState:A,className:Re(L.paper,_.className)}),[fe,ve]=Zt("container",{elementType:R0t,externalForwardedProps:H,ownerState:A,className:Re(L.container)}),[se,ue]=Zt("transition",{elementType:Q1,externalForwardedProps:H,ownerState:A,additionalProps:{appear:!0,in:w,timeout:I,role:"presentation"}});return O.jsx(Q,{closeAfterTransition:!0,slots:{backdrop:Z},slotProps:{backdrop:{transitionDuration:I,as:c,...ge}},disableEscapeKeyDown:h,onClose:b,open:w,onClick:V,...Y,...F,children:O.jsx(se,{...ue,children:O.jsx(fe,{onMouseDown:j,...ve,children:O.jsx(ne,{as:S,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":U,"aria-modal":l,...ie,children:O.jsx(Hze.Provider,{value:z,children:f})})})})})});function D0t(e){return pt("MuiDialogActions",e)}dt("MuiDialogActions",["root","spacing"]);const L0t=e=>{const{classes:t,disableSpacing:n}=e;return Xe({root:["root",!n&&"spacing"]},D0t,t)},F0t=Oe("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),xb=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1,...s}=r,a={...r,disableSpacing:o},l=L0t(a);return O.jsx(F0t,{className:Re(l.root,i),ownerState:a,ref:n,...s})});function $0t(e){return pt("MuiDialogContent",e)}dt("MuiDialogContent",["root","dividers"]);function N0t(e){return pt("MuiDialogTitle",e)}const z0t=dt("MuiDialogTitle",["root"]),j0t=e=>{const{classes:t,dividers:n}=e;return Xe({root:["root",n&&"dividers"]},$0t,t)},B0t=Oe("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Mt(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${z0t.root} + &`]:{paddingTop:0}}}]}))),Fc=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialogContent"}),{className:i,dividers:o=!1,...s}=r,a={...r,dividers:o},l=j0t(a);return O.jsx(B0t,{className:Re(l.root,i),ownerState:a,ref:n,...s})});function U0t(e){return pt("MuiDialogContentText",e)}dt("MuiDialogContentText",["root"]);const V0t=e=>{const{classes:t}=e,r=Xe({root:["root"]},U0t,t);return{...t,...r}},W0t=Oe(mn,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Gze=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialogContentText"}),{children:i,className:o,...s}=r,a=V0t(s);return O.jsx(W0t,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Re(a.root,o),...r,classes:a})}),H0t=e=>{const{classes:t}=e;return Xe({root:["root"]},N0t,t)},G0t=Oe(mn,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),hg=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDialogTitle"}),{className:i,id:o,...s}=r,a=r,l=H0t(a),{titleId:c=o}=M.useContext(Hze);return O.jsx(G0t,{component:"h2",className:Re(l.root,i),ownerState:a,ref:n,variant:"h6",id:o??c,...s})});function q0t(e){return pt("MuiDivider",e)}const fxe=dt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),X0t=e=>{const{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=e;return Xe({root:["root",t&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},q0t,r)},Y0t=Oe("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(Mt(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:Vt(e.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:t})=>!!t.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:t})=>t.children&&t.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:t})=>t.orientation==="vertical"&&t.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:t})=>t.textAlign==="right"&&t.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:t})=>t.textAlign==="left"&&t.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),Q0t=Oe("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(Mt(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),sa=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,orientation:a="horizontal",component:l=o||a==="vertical"?"div":"hr",flexItem:c=!1,light:u=!1,role:f=l!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth",...p}=r,g={...r,absolute:i,component:l,flexItem:c,light:u,orientation:a,role:f,textAlign:d,variant:h},m=X0t(g);return O.jsx(Y0t,{as:l,className:Re(m.root,s),role:f,ref:n,ownerState:g,"aria-orientation":f==="separator"&&(l!=="hr"||a==="vertical")?a:void 0,...p,children:o?O.jsx(Q0t,{className:m.wrapper,ownerState:g,children:o}):null})});sa&&(sa.muiSkipListHighlight=!0);function K0t(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=Lc(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const c=o.getComputedStyle(t);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:e==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function Z0t(e){return typeof e=="function"?e():e}function l$(e,t,n){const r=Z0t(n),i=K0t(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const J0t=M.forwardRef(function(t,n){const r=as(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:g,onExit:m,onExited:v,onExiting:y,style:b,timeout:w=o,TransitionComponent:S=Hu,..._}=t,E=M.useRef(null),T=zn(mb(l),E,n),k=V=>U=>{V&&(U===void 0?V(E.current):V(E.current,U))},P=k((V,U)=>{l$(u,V,c),Bse(V),h&&h(V,U)}),I=k((V,U)=>{const z=j0({timeout:w,style:b,easing:f},{mode:"enter"});V.style.webkitTransition=r.transitions.create("-webkit-transform",{...z}),V.style.transition=r.transitions.create("transform",{...z}),V.style.webkitTransform="none",V.style.transform="none",g&&g(V,U)}),R=k(p),F=k(y),A=k(V=>{const U=j0({timeout:w,style:b,easing:f},{mode:"exit"});V.style.webkitTransition=r.transitions.create("-webkit-transform",U),V.style.transition=r.transitions.create("transform",U),l$(u,V,c),m&&m(V)}),L=k(V=>{V.style.webkitTransition="",V.style.transition="",v&&v(V)}),$=V=>{s&&s(E.current,V)},j=M.useCallback(()=>{E.current&&l$(u,E.current,c)},[u,c]);return M.useEffect(()=>{if(d||u==="down"||u==="right")return;const V=zI(()=>{E.current&&l$(u,E.current,c)}),U=Lc(E.current);return U.addEventListener("resize",V),()=>{V.clear(),U.removeEventListener("resize",V)}},[u,d,c]),M.useEffect(()=>{d||j()},[d,j]),O.jsx(S,{nodeRef:E,onEnter:P,onEntered:R,onEntering:I,onExit:A,onExited:L,onExiting:F,addEndListener:$,appear:a,in:d,timeout:w,..._,children:(V,{ownerState:U,...z})=>M.cloneElement(l,{ref:T,style:{visibility:V==="exited"&&!d?"hidden":void 0,...b,...l.props.style},...z})})}),ebt=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:i,size:o,hiddenLabel:s,multiline:a}=e,l={root:["root",!n&&"underline",r&&"adornedStart",i&&"adornedEnd",o==="small"&&`size${Ue(o)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},c=Xe(l,Dvt,t);return{...t,...c}},tbt=Oe(L6,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...I6(e,t),!n.disableUnderline&&t.underline]}})(Mt(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${mu.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${mu.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:o},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${mu.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${mu.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${mu.disabled}, .${mu.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${mu.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ai()).map(([s])=>({props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),nbt=Oe(F6,{name:"MuiFilledInput",slot:"Input",overridesResolver:D6})(Mt(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),tae=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFilledInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:f,slots:d={},type:h="text",...p}=r,g={...r,disableUnderline:i,fullWidth:a,inputComponent:c,multiline:u,type:h},m=ebt(r),v={root:{ownerState:g},input:{ownerState:g}},y=f??s?oa(v,f??s):v,b=d.root??o.Root??tbt,w=d.input??o.Input??nbt;return O.jsx(hT,{slots:{root:b,input:w},slotProps:y,fullWidth:a,inputComponent:c,multiline:u,ref:n,type:h,...p,classes:m})});tae.muiName="Input";function rbt(e){return pt("MuiFormControl",e)}dt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const ibt=e=>{const{classes:t,margin:n,fullWidth:r}=e,i={root:["root",n!=="none"&&`margin${Ue(n)}`,r&&"fullWidth"]};return Xe(i,rbt,t)},obt=Oe("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Ue(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),sd=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:g="medium",variant:m="outlined",...v}=r,y={...r,color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:g,variant:m},b=ibt(y),[w,S]=M.useState(()=>{let L=!1;return i&&M.Children.forEach(i,$=>{if(!oz($,["Input","Select"]))return;const j=oz($,["Select"])?$.props.input:$;j&&kvt(j.props)&&(L=!0)}),L}),[_,E]=M.useState(()=>{let L=!1;return i&&M.Children.forEach(i,$=>{oz($,["Input","Select"])&&(y5($.props,!0)||y5($.props.inputProps,!0))&&(L=!0)}),L}),[T,k]=M.useState(!1);l&&T&&k(!1);const P=u!==void 0&&!l?u:T;let I;M.useRef(!1);const R=M.useCallback(()=>{E(!0)},[]),F=M.useCallback(()=>{E(!1)},[]),A=M.useMemo(()=>({adornedStart:w,setAdornedStart:S,color:s,disabled:l,error:c,filled:_,focused:P,fullWidth:f,hiddenLabel:d,size:g,onBlur:()=>{k(!1)},onFocus:()=>{k(!0)},onEmpty:F,onFilled:R,registerEffect:I,required:p,variant:m}),[w,s,l,c,_,P,f,d,I,F,R,p,g,m]);return O.jsx(R6.Provider,{value:A,children:O.jsx(obt,{as:a,ownerState:y,className:Re(b.root,o),ref:n,...v,children:i})})});function sbt(e){return pt("MuiFormControlLabel",e)}const z2=dt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),abt=e=>{const{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,s={root:["root",n&&"disabled",`labelPlacement${Ue(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return Xe(s,sbt,t)},lbt=Oe("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${z2.label}`]:t.label},t.root,t[`labelPlacement${Ue(n.labelPlacement)}`]]}})(Mt(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${z2.disabled}`]:{cursor:"default"},[`& .${z2.label}`]:{[`&.${z2.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),cbt=Oe("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(Mt(({theme:e})=>({[`&.${z2.error}`]:{color:(e.vars||e).palette.error.main}}))),oh=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormControlLabel"}),{checked:i,className:o,componentsProps:s={},control:a,disabled:l,disableTypography:c,inputRef:u,label:f,labelPlacement:d="end",name:h,onChange:p,required:g,slots:m={},slotProps:v={},value:y,...b}=r,w=Jl(),S=l??a.props.disabled??w?.disabled,_=g??a.props.required,E={disabled:S,required:_};["checked","name","onChange","value","inputRef"].forEach(L=>{typeof a.props[L]>"u"&&typeof r[L]<"u"&&(E[L]=r[L])});const T=bb({props:r,muiFormControl:w,states:["error"]}),k={...r,disabled:S,labelPlacement:d,required:_,error:T.error},P=abt(k),I={slots:m,slotProps:{...s,...v}},[R,F]=Zt("typography",{elementType:mn,externalForwardedProps:I,ownerState:k});let A=f;return A!=null&&A.type!==mn&&!c&&(A=O.jsx(R,{component:"span",...F,className:Re(P.label,F?.className),children:A})),O.jsxs(lbt,{className:Re(P.root,o),ownerState:k,ref:n,...b,children:[M.cloneElement(a,E),_?O.jsxs("div",{children:[A,O.jsxs(cbt,{ownerState:k,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):A]})});function ubt(e){return pt("MuiFormGroup",e)}dt("MuiFormGroup",["root","row","error"]);const fbt=e=>{const{classes:t,row:n,error:r}=e;return Xe({root:["root",n&&"row",r&&"error"]},ubt,t)},dbt=Oe("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),hbt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormGroup"}),{className:i,row:o=!1,...s}=r,a=Jl(),l=bb({props:r,muiFormControl:a,states:["error"]}),c={...r,row:o,error:l.error},u=fbt(c);return O.jsx(dbt,{className:Re(u.root,i),ownerState:c,ref:n,...s})});function pbt(e){return pt("MuiFormHelperText",e)}const dxe=dt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var hxe;const gbt=e=>{const{classes:t,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=e,c={root:["root",i&&"disabled",o&&"error",r&&`size${Ue(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Xe(c,pbt,t)},mbt=Oe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Ue(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${dxe.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${dxe.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),nae=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p",disabled:a,error:l,filled:c,focused:u,margin:f,required:d,variant:h,...p}=r,g=Jl(),m=bb({props:r,muiFormControl:g,states:["variant","size","disabled","error","filled","focused","required"]}),v={...r,component:s,contained:m.variant==="filled"||m.variant==="outlined",variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete v.ownerState;const y=gbt(v);return O.jsx(mbt,{as:s,className:Re(y.root,o),ref:n,...p,ownerState:v,children:i===" "?hxe||(hxe=O.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):i})});function vbt(e){return pt("MuiFormLabel",e)}const IM=dt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ybt=e=>{const{classes:t,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=e,l={root:["root",`color${Ue(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return Xe(l,vbt,t)},bbt=Oe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{[`&.${IM.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${IM.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${IM.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),xbt=Oe("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(Mt(({theme:e})=>({[`&.${IM.error}`]:{color:(e.vars||e).palette.error.main}}))),qze=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiFormLabel"}),{children:i,className:o,color:s,component:a="label",disabled:l,error:c,filled:u,focused:f,required:d,...h}=r,p=Jl(),g=bb({props:r,muiFormControl:p,states:["color","required","focused","disabled","error","filled"]}),m={...r,color:g.color||"primary",component:a,disabled:g.disabled,error:g.error,filled:g.filled,focused:g.focused,required:g.required},v=ybt(m);return O.jsxs(bbt,{as:a,ownerState:m,className:Re(v.root,o),ref:n,...h,children:[i,g.required&&O.jsxs(xbt,{ownerState:m,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]})}),pxe=M.createContext();function wbt(e){return pt("MuiGrid",e)}const Sbt=[0,1,2,3,4,5,6,7,8,9,10],_bt=["column-reverse","column","row-reverse","row"],Cbt=["nowrap","wrap-reverse","wrap"],mk=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],EA=dt("MuiGrid",["root","container","item","zeroMinWidth",...Sbt.map(e=>`spacing-xs-${e}`),..._bt.map(e=>`direction-xs-${e}`),...Cbt.map(e=>`wrap-xs-${e}`),...mk.map(e=>`grid-xs-${e}`),...mk.map(e=>`grid-sm-${e}`),...mk.map(e=>`grid-md-${e}`),...mk.map(e=>`grid-lg-${e}`),...mk.map(e=>`grid-xl-${e}`)]);function Obt({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((r,i)=>{let o={};if(t[i]&&(n=t[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=b6({values:t.columns,breakpoints:e.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(t.container&&t.item&&t.columnSpacing!==0){const u=e.spacing(t.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${u})`;c={flexBasis:f,maxWidth:f}}}o={flexBasis:l,flexGrow:0,maxWidth:l,...c}}return e.breakpoints.values[i]===0?Object.assign(r,o):r[e.breakpoints.up(i)]=o,r},{})}function Ebt({theme:e,ownerState:t}){const n=b6({values:t.direction,breakpoints:e.breakpoints.values});return Wf({theme:e},n,r=>{const i={flexDirection:r};return r.startsWith("column")&&(i[`& > .${EA.item}`]={maxWidth:"none"}),i})}function Xze({breakpoints:e,values:t}){let n="";Object.keys(t).forEach(i=>{n===""&&t[i]!==0&&(n=i)});const r=Object.keys(e).sort((i,o)=>e[i]-e[o]);return r.slice(0,r.indexOf(n))}function Tbt({theme:e,ownerState:t}){const{container:n,rowSpacing:r}=t;let i={};if(n&&r!==0){const o=b6({values:r,breakpoints:e.breakpoints.values});let s;typeof o=="object"&&(s=Xze({breakpoints:e.breakpoints.values,values:o})),i=Wf({theme:e},o,(a,l)=>{const c=e.spacing(a);return c!=="0px"?{marginTop:`calc(-1 * ${c})`,[`& > .${EA.item}`]:{paddingTop:c}}:s?.includes(l)?{}:{marginTop:0,[`& > .${EA.item}`]:{paddingTop:0}}})}return i}function Pbt({theme:e,ownerState:t}){const{container:n,columnSpacing:r}=t;let i={};if(n&&r!==0){const o=b6({values:r,breakpoints:e.breakpoints.values});let s;typeof o=="object"&&(s=Xze({breakpoints:e.breakpoints.values,values:o})),i=Wf({theme:e},o,(a,l)=>{const c=e.spacing(a);if(c!=="0px"){const u=`calc(-1 * ${c})`;return{width:`calc(100% + ${c})`,marginLeft:u,[`& > .${EA.item}`]:{paddingLeft:c}}}return s?.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${EA.item}`]:{paddingLeft:0}}})}return i}function kbt(e,t,n={}){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[n[`spacing-xs-${String(e)}`]];const r=[];return t.forEach(i=>{const o=e[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const Mbt=Oe("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=kbt(s,c,t));const f=[];return c.forEach(d=>{const h=n[d];h&&f.push(t[`grid-${d}-${String(h)}`])}),[t.root,r&&t.container,o&&t.item,l&&t.zeroMinWidth,...u,i!=="row"&&t[`direction-xs-${String(i)}`],a!=="wrap"&&t[`wrap-xs-${String(a)}`],...f]}})(({ownerState:e})=>({boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...e.item&&{margin:0},...e.zeroMinWidth&&{minWidth:0},...e.wrap!=="wrap"&&{flexWrap:e.wrap}}),Ebt,Tbt,Pbt,Obt);function Abt(e,t){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[`spacing-xs-${String(e)}`];const n=[];return t.forEach(r=>{const i=e[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const Rbt=e=>{const{classes:t,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=e;let c=[];n&&(c=Abt(o,l));const u=[];l.forEach(d=>{const h=e[d];h&&u.push(`grid-${d}-${String(h)}`)});const f={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Xe(f,wbt,t)},XG=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiGrid"}),{breakpoints:i}=as(),o=Mse(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:g="wrap",zeroMinWidth:m=!1,...v}=o,y=h||p,b=l||p,w=M.useContext(pxe),S=u?a||12:w,_={},E={...v};i.keys.forEach(P=>{v[P]!=null&&(_[P]=v[P],delete E[P])});const T={...o,columns:S,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:b,wrap:g,zeroMinWidth:m,spacing:p,..._,breakpoints:i.keys},k=Rbt(T);return O.jsx(pxe.Provider,{value:S,children:O.jsx(Mbt,{ownerState:T,className:Re(k.root,s),as:c,ref:n,...E})})});function uee(e){return`scale(${e}, ${e**2})`}const Ibt={entering:{opacity:1,transform:uee(1)},entered:{opacity:1,transform:"none"}},YG=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),K1=M.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:g="auto",TransitionComponent:m=Hu,...v}=t,y=zl(),b=M.useRef(),w=as(),S=M.useRef(null),_=zn(S,mb(o),n),E=L=>$=>{if(L){const j=S.current;$===void 0?L(j):L(j,$)}},T=E(u),k=E((L,$)=>{Bse(L);const{duration:j,delay:V,easing:U}=j0({style:p,timeout:g,easing:s},{mode:"enter"});let z;g==="auto"?(z=w.transitions.getAutoHeightDuration(L.clientHeight),b.current=z):z=j,L.style.transition=[w.transitions.create("opacity",{duration:z,delay:V}),w.transitions.create("transform",{duration:YG?z:z*.666,delay:V,easing:U})].join(","),l&&l(L,$)}),P=E(c),I=E(h),R=E(L=>{const{duration:$,delay:j,easing:V}=j0({style:p,timeout:g,easing:s},{mode:"exit"});let U;g==="auto"?(U=w.transitions.getAutoHeightDuration(L.clientHeight),b.current=U):U=$,L.style.transition=[w.transitions.create("opacity",{duration:U,delay:j}),w.transitions.create("transform",{duration:YG?U:U*.666,delay:YG?j:j||U*.333,easing:V})].join(","),L.style.opacity=0,L.style.transform=uee(.75),f&&f(L)}),F=E(d),A=L=>{g==="auto"&&y.start(b.current||0,L),r&&r(S.current,L)};return O.jsx(m,{appear:i,in:a,nodeRef:S,onEnter:k,onEntered:P,onEntering:T,onExit:R,onExited:F,onExiting:I,addEndListener:A,timeout:g==="auto"?null:g,...v,children:(L,{ownerState:$,...j})=>M.cloneElement(o,{style:{opacity:0,transform:uee(.75),visibility:L==="exited"&&!a?"hidden":void 0,...Ibt[L],...p,...o.props.style},ref:_,...j})})});K1&&(K1.muiSupportAuto=!0);const rae=tze({themeId:If});function Dbt(e){return pt("MuiIcon",e)}dt("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Lbt=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Ue(t)}`,`fontSize${Ue(n)}`]};return Xe(i,Dbt,r)},Fbt=Oe("span",{name:"MuiIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ue(n.color)}`],t[`fontSize${Ue(n.fontSize)}`]]}})(Mt(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:e.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:e.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(e.vars||e).palette.action.active}},{props:{color:"disabled"},style:{color:(e.vars||e).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),iae=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiIcon"}),{baseClassName:i="material-icons",className:o,color:s="inherit",component:a="span",fontSize:l="medium",...c}=r,u={...r,baseClassName:i,color:s,component:a,fontSize:l},f=Lbt(u);return O.jsx(Fbt,{as:a,className:Re(i,"notranslate",f.root,o),ownerState:u,"aria-hidden":!0,ref:n,...c})});iae.muiName="Icon";const $bt=e=>{const{classes:t,disableUnderline:n}=e,i=Xe({root:["root",!n&&"underline"],input:["input"]},Rvt,t);return{...t,...i}},Nbt=Oe(L6,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...I6(e,t),!n.disableUnderline&&t.underline]}})(Mt(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${e0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${e0.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${e0.disabled}, .${e0.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${e0.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ai()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),zbt=Oe(F6,{name:"MuiInput",slot:"Input",overridesResolver:D6})({}),wb=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:f={},type:d="text",...h}=r,p=$bt(r),m={root:{ownerState:{disableUnderline:i}}},v=u??s?oa(u??s,m):m,y=f.root??o.Root??Nbt,b=f.input??o.Input??zbt;return O.jsx(hT,{slots:{root:y,input:b},slotProps:v,fullWidth:a,inputComponent:l,multiline:c,ref:n,type:d,...h,classes:p})});wb.muiName="Input";function jbt(e){return pt("MuiInputAdornment",e)}const gxe=dt("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var mxe;const Bbt=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Ue(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},Ubt=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=e,a={root:["root",n&&"disablePointerEvents",i&&`position${Ue(i)}`,s,r&&"hiddenLabel",o&&`size${Ue(o)}`]};return Xe(a,jbt,t)},Vbt=Oe("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Bbt})(Mt(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${gxe.positionStart}&:not(.${gxe.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),oae=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u,...f}=r,d=Jl()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p={...r,hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:a,position:c,variant:h},g=Ubt(p);return O.jsx(R6.Provider,{value:null,children:O.jsx(Vbt,{as:s,ownerState:p,className:Re(g.root,o),ref:n,...f,children:typeof i=="string"&&!l?O.jsx(mn,{color:"textSecondary",children:i}):O.jsxs(M.Fragment,{children:[c==="start"?mxe||(mxe=O.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,i]})})})});function Wbt(e){return pt("MuiInputLabel",e)}dt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Hbt=e=>{const{classes:t,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=e,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${Ue(r)}`,s],asterisk:[a&&"asterisk"]},c=Xe(l,Wbt,t);return{...t,...c}},Gbt=Oe(qze,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${IM.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(Mt(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),bv=M.forwardRef(function(t,n){const r=Dt({name:"MuiInputLabel",props:t}),{disableAnimation:i=!1,margin:o,shrink:s,variant:a,className:l,...c}=r,u=Jl();let f=s;typeof f>"u"&&u&&(f=u.filled||u.focused||u.adornedStart);const d=bb({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),h={...r,disableAnimation:i,formControl:u,shrink:f,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=Hbt(h);return O.jsx(Gbt,{"data-shrink":f,ref:n,className:Re(p.root,l),...c,ownerState:h,classes:p})});function qbt(e){return pt("MuiLinearProgress",e)}dt("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const fee=4,dee=dg` 0% { left: -35%; right: 100%; @@ -179,9 +179,9 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s left: 100%; right: -90%; } -`,uwt=typeof mte!="string"?bb` - animation: ${mte} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; - `:null,vte=pg` +`,Xbt=typeof dee!="string"?gb` + animation: ${dee} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; + `:null,hee=dg` 0% { left: -200%; right: 100%; @@ -196,9 +196,9 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s left: 107%; right: -8%; } -`,fwt=typeof vte!="string"?bb` - animation: ${vte} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; - `:null,yte=pg` +`,Ybt=typeof hee!="string"?gb` + animation: ${hee} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; + `:null,pee=dg` 0% { opacity: 1; background-position: 0 -23px; @@ -213,9 +213,9 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s opacity: 1; background-position: -200px -23px; } -`,dwt=typeof yte!="string"?bb` - animation: ${yte} 3s infinite linear; - `:null,hwt=e=>{const{classes:t,variant:n,color:r}=e,i={root:["root",`color${Ve(r)}`,n],dashed:["dashed",`dashedColor${Ve(r)}`],bar1:["bar","bar1",`barColor${Ve(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",n!=="buffer"&&`barColor${Ve(r)}`,n==="buffer"&&`color${Ve(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return Xe(i,cwt,t)},fle=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode==="light"?hh(e.palette[t].main,.62):dh(e.palette[t].main,.5),pwt=Oe("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Ve(n.color)}`],t[n.variant]]}})(Mt(({theme:e})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{backgroundColor:fle(e,t)}})),{props:({ownerState:t})=>t.color==="inherit"&&t.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),gwt=Oe("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.dashed,t[`dashedColor${Ve(n.color)}`]]}})(Mt(({theme:e})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(e.palette).filter(ai()).map(([t])=>{const n=fle(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),dwt||{animation:`${yte} 3s infinite linear`}),mwt=Oe("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${Ve(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar1Indeterminate,n.variant==="determinate"&&t.bar1Determinate,n.variant==="buffer"&&t.bar1Buffer]}})(Mt(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:"determinate"},style:{transition:`transform .${gte}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${gte}s linear`}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:uwt||{animation:`${mte} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),vwt=Oe("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${Ve(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar2Indeterminate,n.variant==="buffer"&&t.bar2Buffer]}})(Mt(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:t})=>t.variant!=="buffer"&&t.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:t})=>t.variant!=="buffer"&&t.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,variant:"buffer"},style:{backgroundColor:fle(e,t),transition:`transform .${gte}s linear`}})),{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:fwt||{animation:`${vte} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),nBe=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiLinearProgress"}),{className:i,color:o="primary",value:s,valueBuffer:a,variant:l="indeterminate",...c}=r,u={...r,color:o,variant:l},f=hwt(u),d=bi(),h={},p={bar1:{},bar2:{}};if((l==="determinate"||l==="buffer")&&s!==void 0){h["aria-valuenow"]=Math.round(s),h["aria-valuemin"]=0,h["aria-valuemax"]=100;let g=s-100;d&&(g=-g),p.bar1.transform=`translateX(${g}%)`}if(l==="buffer"&&a!==void 0){let g=(a||0)-100;d&&(g=-g),p.bar2.transform=`translateX(${g}%)`}return O.jsxs(pwt,{className:Re(f.root,i),ownerState:u,role:"progressbar",...h,ref:n,...c,children:[l==="buffer"?O.jsx(gwt,{className:f.dashed,ownerState:u}):null,O.jsx(mwt,{className:f.bar1,ownerState:u,style:p.bar1}),l==="determinate"?null:O.jsx(vwt,{className:f.bar2,ownerState:u,style:p.bar2})]})});function ywt(e){return pt("MuiLink",e)}const bwt=dt("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),xwt=({theme:e,ownerState:t})=>{const n=t.color,r=c0(e,`palette.${n}.main`,!1)||c0(e,`palette.${n}`,!1)||t.color,i=c0(e,`palette.${n}.mainChannel`)||c0(e,`palette.${n}Channel`);return"vars"in e&&i?`rgba(${i} / 0.4)`:Bt(r,.4)},_1e={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},wwt=e=>{const{classes:t,component:n,focusVisible:r,underline:i}=e,o={root:["root",`underline${Ve(i)}`,n==="button"&&"button",r&&"focusVisible"]};return Xe(o,ywt,t)},Swt=Oe(yn,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`underline${Ve(n.underline)}`],n.component==="button"&&t.button]}})(Mt(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:t,ownerState:n})=>t==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.4)`:Bt(e.palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Bt(e.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.secondaryChannel} / 0.4)`:Bt(e.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${bwt.focusVisible}`]:{outline:"auto"}}}]}))),_wt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiLink"}),i=is(),{className:o,color:s="primary",component:a="a",onBlur:l,onFocus:c,TypographyClasses:u,underline:f="always",variant:d="inherit",sx:h,...p}=r,[g,m]=M.useState(!1),v=S=>{H0(S.target)||m(!1),l&&l(S)},y=S=>{H0(S.target)&&m(!0),c&&c(S)},b={...r,color:s,component:a,focusVisible:g,underline:f,variant:d},w=wwt(b);return O.jsx(Swt,{color:s,className:Re(w.root,o),classes:u,component:a,onBlur:v,onFocus:y,ref:n,ownerState:b,variant:d,...p,sx:[..._1e[s]===void 0?[{color:s}]:[],...Array.isArray(h)?h:[h]],style:{...p.style,...f==="always"&&s!=="inherit"&&!_1e[s]&&{"--Link-underlineColor":xwt({theme:i,ownerState:b})}}})}),ah=M.createContext({});function Cwt(e){return pt("MuiList",e)}dt("MuiList",["root","padding","dense","subheader"]);const Owt=e=>{const{classes:t,disablePadding:n,dense:r,subheader:i}=e;return Xe({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},Cwt,t)},Ewt=Oe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),tD=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c,...u}=r,f=M.useMemo(()=>({dense:a}),[a]),d={...r,component:s,dense:a,disablePadding:l},h=Owt(d);return O.jsx(ah.Provider,{value:f,children:O.jsxs(Ewt,{as:s,className:Re(h.root,o),ref:n,ownerState:d,...u,children:[c,i]})})});function Twt(e){return pt("MuiListItem",e)}dt("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function Pwt(e){return pt("MuiListItemButton",e)}const xC=dt("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),kwt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]},Mwt=e=>{const{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=e,c=Xe({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled",t==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},Pwt,n);return{...n,...c}},Awt=Oe(Gf,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:kwt})(Mt(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${xC.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${xC.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${xC.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${xC.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${xC.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.dense,style:{paddingTop:4,paddingBottom:4}}]}))),rBe=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:s="div",children:a,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h,...p}=r,g=M.useContext(ah),m=M.useMemo(()=>({dense:l||g.dense||!1,alignItems:i,disableGutters:c}),[i,g.dense,l,c]),v=M.useRef(null);ar(()=>{o&&v.current&&v.current.focus()},[o]);const y={...r,alignItems:i,dense:m.dense,disableGutters:c,divider:u,selected:d},b=Mwt(y),w=zn(v,n);return O.jsx(ah.Provider,{value:m,children:O.jsx(Awt,{ref:w,href:p.href||p.to,component:(p.href||p.to)&&s==="div"?"button":s,focusVisibleClassName:Re(b.focusVisible,f),ownerState:y,className:Re(b.root,h),...p,classes:b,children:a})})});function Rwt(e){return pt("MuiListItemSecondaryAction",e)}dt("MuiListItemSecondaryAction",["root","disableGutters"]);const Iwt=e=>{const{disableGutters:t,classes:n}=e;return Xe({root:["root",t&&"disableGutters"]},Rwt,n)},Dwt=Oe("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),NA=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItemSecondaryAction"}),{className:i,...o}=r,s=M.useContext(ah),a={...r,disableGutters:s.disableGutters},l=Iwt(a);return O.jsx(Dwt,{className:Re(l.root,i),ownerState:a,ref:n,...o})});NA.muiName="ListItemSecondaryAction";const Lwt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},Fwt=e=>{const{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:s,hasSecondaryAction:a}=e;return Xe({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",s&&"divider",t==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},Twt,n)},$wt=Oe("div",{name:"MuiListItem",slot:"Root",overridesResolver:Lwt})(Mt(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${xC.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),Nwt=Oe("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),cO=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItem"}),{alignItems:i="center",children:o,className:s,component:a,components:l={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:f,...d}={},dense:h=!1,disableGutters:p=!1,disablePadding:g=!1,divider:m=!1,secondaryAction:v,slotProps:y={},slots:b={},...w}=r,S=M.useContext(ah),_=M.useMemo(()=>({dense:h||S.dense||!1,alignItems:i,disableGutters:p}),[i,S.dense,h,p]),E=M.useRef(null),T=M.Children.toArray(o),k=T.length&&Ez(T[T.length-1],["ListItemSecondaryAction"]),P={...r,alignItems:i,dense:_.dense,disableGutters:p,disablePadding:g,divider:m,hasSecondaryAction:k},R=Fwt(P),I=zn(E,n),F=b.root||l.Root||$wt,A=y.root||c.root||{},L={className:Re(R.root,A.className,s),...w};let $=a||"li";return k?($=!L.component&&!a?"div":$,u==="li"&&($==="li"?$="div":L.component==="li"&&(L.component="div")),O.jsx(ah.Provider,{value:_,children:O.jsxs(Nwt,{as:u,className:Re(R.container,f),ref:I,ownerState:P,...d,children:[O.jsx(F,{...A,...!Vm(F)&&{as:$,ownerState:{...P,...A.ownerState}},...L,children:T}),T.pop()]})})):O.jsx(ah.Provider,{value:_,children:O.jsxs(F,{...A,as:$,ref:I,...!Vm(F)&&{ownerState:{...P,...A.ownerState}},...L,children:[T,v&&O.jsx(NA,{children:v})]})})});function zwt(e){return pt("MuiListItemIcon",e)}const C1e=dt("MuiListItemIcon",["root","alignItemsFlexStart"]),jwt=e=>{const{alignItems:t,classes:n}=e;return Xe({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},zwt,n)},Bwt=Oe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(Mt(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),rl=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItemIcon"}),{className:i,...o}=r,s=M.useContext(ah),a={...r,alignItems:s.alignItems},l=jwt(a);return O.jsx(Bwt,{className:Re(l.root,i),ownerState:a,ref:n,...o})});function Uwt(e){return pt("MuiListItemText",e)}const LC=dt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),Vwt=e=>{const{classes:t,inset:n,primary:r,secondary:i,dense:o}=e;return Xe({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},Uwt,t)},Wwt=Oe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${LC.primary}`]:t.primary},{[`& .${LC.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${z5.root}:where(& .${LC.primary})`]:{display:"block"},[`.${z5.root}:where(& .${LC.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),Yi=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItemText"}),{children:i,className:o,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f,slots:d={},slotProps:h={},...p}=r,{dense:g}=M.useContext(ah);let m=l??i,v=u;const y={...r,disableTypography:s,inset:a,primary:!!m,secondary:!!v,dense:g},b=Vwt(y),w={slots:d,slotProps:{primary:c,secondary:f,...h}},[S,_]=Zt("root",{className:Re(b.root,o),elementType:Wwt,externalForwardedProps:{...w,...p},ownerState:y,ref:n}),[E,T]=Zt("primary",{className:b.primary,elementType:yn,externalForwardedProps:w,ownerState:y}),[k,P]=Zt("secondary",{className:b.secondary,elementType:yn,externalForwardedProps:w,ownerState:y});return m!=null&&m.type!==yn&&!s&&(m=O.jsx(E,{variant:g?"body2":"body1",component:T?.variant?void 0:"span",...T,children:m})),v!=null&&v.type!==yn&&!s&&(v=O.jsx(k,{variant:"body2",color:"textSecondary",...P,children:v})),O.jsxs(S,{..._,children:[m,v]})});function x9(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function O1e(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function iBe(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function Ck(e,t,n,r,i,o){let s=!1,a=i(e,t,t?n:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!iBe(a,o)||l)a=i(e,a,n);else return a.focus(),!0}return!1}const nS=M.forwardRef(function(t,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu",...d}=t,h=M.useRef(null),p=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ar(()=>{i&&h.current.focus()},[i]),M.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(b,{direction:w})=>{const S=!h.current.style.width;if(b.clientHeight{const w=h.current,S=b.key;if(b.ctrlKey||b.metaKey||b.altKey){u&&u(b);return}const E=ci(w).activeElement;if(S==="ArrowDown")b.preventDefault(),Ck(w,E,c,l,x9);else if(S==="ArrowUp")b.preventDefault(),Ck(w,E,c,l,O1e);else if(S==="Home")b.preventDefault(),Ck(w,null,c,l,x9);else if(S==="End")b.preventDefault(),Ck(w,null,c,l,O1e);else if(S.length===1){const T=p.current,k=S.toLowerCase(),P=performance.now();T.keys.length>0&&(P-T.lastTime>500?(T.keys=[],T.repeating=!0,T.previousKeyMatched=!0):T.repeating&&k!==T.keys[0]&&(T.repeating=!1)),T.lastTime=P,T.keys.push(k);const R=E&&!T.repeating&&iBe(E,T);T.previousKeyMatched&&(R||Ck(w,E,!1,l,x9,T))?b.preventDefault():T.previousKeyMatched=!1}u&&u(b)},m=zn(h,n);let v=-1;M.Children.forEach(s,(b,w)=>{if(!M.isValidElement(b)){v===w&&(v+=1,v>=s.length&&(v=-1));return}b.props.disabled||(f==="selectedMenu"&&b.props.selected||v===-1)&&(v=w),v===w&&(b.props.disabled||b.props.muiSkipListHighlight||b.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const y=M.Children.map(s,(b,w)=>{if(w===v){const S={};return o&&(S.autoFocus=!0),b.props.tabIndex===void 0&&f==="selectedMenu"&&(S.tabIndex=0),M.cloneElement(b,S)}return b});return O.jsx(tD,{role:"menu",ref:m,className:a,onKeyDown:g,tabIndex:i?0:-1,...d,children:y})});function Hwt(e){return pt("MuiPopover",e)}dt("MuiPopover",["root","paper"]);function E1e(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function T1e(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function P1e(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function _$(e){return typeof e=="function"?e():e}const Gwt=e=>{const{classes:t}=e;return Xe({root:["root"],paper:["paper"]},Hwt,t)},qwt=Oe(Kje,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),oBe=Oe(fa,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),rS=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiPopover"}),{action:i,anchorEl:o,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:c,className:u,container:f,elevation:d=8,marginThreshold:h=16,open:p,PaperProps:g={},slots:m={},slotProps:v={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:b,transitionDuration:w="auto",TransitionProps:S={},disableScrollLock:_=!1,...E}=r,T=M.useRef(),k={...r,anchorOrigin:s,anchorReference:l,elevation:d,marginThreshold:h,transformOrigin:y,TransitionComponent:b,transitionDuration:w,TransitionProps:S},P=Gwt(k),R=M.useCallback(()=>{if(l==="anchorPosition")return a;const fe=_$(o),se=(fe&&fe.nodeType===1?fe:ci(T.current).body).getBoundingClientRect();return{top:se.top+E1e(se,s.vertical),left:se.left+T1e(se,s.horizontal)}},[o,s.horizontal,s.vertical,a,l]),I=M.useCallback(fe=>({vertical:E1e(fe,y.vertical),horizontal:T1e(fe,y.horizontal)}),[y.horizontal,y.vertical]),F=M.useCallback(fe=>{const me={width:fe.offsetWidth,height:fe.offsetHeight},se=I(me);if(l==="none")return{top:null,left:null,transformOrigin:P1e(se)};const ue=R();let G=ue.top-se.vertical,ce=ue.left-se.horizontal;const he=G+me.height,J=ce+me.width,te=$c(_$(o)),ae=te.innerHeight-h,we=te.innerWidth-h;if(h!==null&&Gae){const Pe=he-ae;G-=Pe,se.vertical+=Pe}if(h!==null&&cewe){const Pe=J-we;ce-=Pe,se.horizontal+=Pe}return{top:`${Math.round(G)}px`,left:`${Math.round(ce)}px`,transformOrigin:P1e(se)}},[o,l,R,I,h]),[A,L]=M.useState(p),$=M.useCallback(()=>{const fe=T.current;if(!fe)return;const me=F(fe);me.top!==null&&fe.style.setProperty("top",me.top),me.left!==null&&(fe.style.left=me.left),fe.style.transformOrigin=me.transformOrigin,L(!0)},[F]);M.useEffect(()=>(_&&window.addEventListener("scroll",$),()=>window.removeEventListener("scroll",$)),[o,_,$]);const j=()=>{$()},V=()=>{L(!1)};M.useEffect(()=>{p&&$()}),M.useImperativeHandle(i,()=>p?{updatePosition:()=>{$()}}:null,[p,$]),M.useEffect(()=>{if(!p)return;const fe=QI(()=>{$()}),me=$c(_$(o));return me.addEventListener("resize",fe),()=>{fe.clear(),me.removeEventListener("resize",fe)}},[o,p,$]);let U=w;const z={slots:{transition:b,...m},slotProps:{transition:S,paper:g,...v}},[N,B]=Zt("transition",{elementType:ow,externalForwardedProps:z,ownerState:k,getSlotProps:fe=>({...fe,onEntering:(me,se)=>{fe.onEntering?.(me,se),j()},onExited:me=>{fe.onExited?.(me),V()}}),additionalProps:{appear:!0,in:p}});w==="auto"&&!N.muiSupportAuto&&(U=void 0);const H=f||(o?ci(_$(o)).body:void 0),[Q,{slots:Y,slotProps:Z,...pe}]=Zt("root",{ref:n,elementType:qwt,externalForwardedProps:{...z,...E},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:m.backdrop},slotProps:{backdrop:Tje(typeof v.backdrop=="function"?v.backdrop(k):v.backdrop,{invisible:!0})},container:H,open:p},ownerState:k,className:Re(P.root,u)}),[ie,ne]=Zt("paper",{ref:T,className:P.paper,elementType:oBe,externalForwardedProps:z,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:A?void 0:{opacity:0}},ownerState:k});return O.jsx(Q,{...pe,...!Vm(Q)&&{slots:Y,slotProps:Z,disableScrollLock:_},children:O.jsx(N,{...B,timeout:U,children:O.jsx(ie,{...ne,children:c})})})});function Xwt(e){return pt("MuiMenu",e)}dt("MuiMenu",["root","paper","list"]);const Ywt={vertical:"top",horizontal:"right"},Qwt={vertical:"top",horizontal:"left"},Kwt=e=>{const{classes:t}=e;return Xe({root:["root"],paper:["paper"],list:["list"]},Xwt,t)},Zwt=Oe(rS,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Jwt=Oe(oBe,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),eSt=Oe(nS,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),iS=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiMenu"}),{autoFocus:i=!0,children:o,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:c,open:u,PaperProps:f={},PopoverClasses:d,transitionDuration:h="auto",TransitionProps:{onEntering:p,...g}={},variant:m="selectedMenu",slots:v={},slotProps:y={},...b}=r,w=bi(),S={...r,autoFocus:i,disableAutoFocusItem:a,MenuListProps:l,onEntering:p,PaperProps:f,transitionDuration:h,TransitionProps:g,variant:m},_=Kwt(S),E=i&&!a&&u,T=M.useRef(null),k=(U,z)=>{T.current&&T.current.adjustStyleForScrollbar(U,{direction:w?"rtl":"ltr"}),p&&p(U,z)},P=U=>{U.key==="Tab"&&(U.preventDefault(),c&&c(U,"tabKeyDown"))};let R=-1;M.Children.map(o,(U,z)=>{M.isValidElement(U)&&(U.props.disabled||(m==="selectedMenu"&&U.props.selected||R===-1)&&(R=z))});const I={slots:v,slotProps:{list:l,transition:g,paper:f,...y}},F=Yn({elementType:v.root,externalSlotProps:y.root,ownerState:S,className:[_.root,s]}),[A,L]=Zt("paper",{className:_.paper,elementType:Jwt,externalForwardedProps:I,shouldForwardComponentProp:!0,ownerState:S}),[$,j]=Zt("list",{className:Re(_.list,l.className),elementType:eSt,shouldForwardComponentProp:!0,externalForwardedProps:I,getSlotProps:U=>({...U,onKeyDown:z=>{P(z),U.onKeyDown?.(z)}}),ownerState:S}),V=typeof I.slotProps.transition=="function"?I.slotProps.transition(S):I.slotProps.transition;return O.jsx(Zwt,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:w?"right":"left"},transformOrigin:w?Ywt:Qwt,slots:{root:v.root,paper:A,backdrop:v.backdrop,...v.transition&&{transition:v.transition}},slotProps:{root:F,paper:L,backdrop:typeof y.backdrop=="function"?y.backdrop(S):y.backdrop,transition:{...V,onEntering:(...U)=>{k(...U),V?.onEntering?.(...U)}}},open:u,ref:n,transitionDuration:h,ownerState:S,...b,classes:d,children:O.jsx($,{actions:T,autoFocus:i&&(R===-1||a),autoFocusItem:E,variant:m,...j,children:o})})});function tSt(e){return pt("MuiMenuItem",e)}const Ok=dt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),nSt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},rSt=e=>{const{disabled:t,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=e,l=Xe({root:["root",n&&"dense",t&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},tSt,s);return{...s,...l}},iSt=Oe(Gf,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:nSt})(Mt(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ok.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Ok.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Ok.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Ok.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Ok.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${v1e.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${v1e.inset}`]:{marginLeft:52},[`& .${LC.root}`]:{marginTop:0,marginBottom:0},[`& .${LC.inset}`]:{paddingLeft:36},[`& .${C1e.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${C1e.root} svg`]:{fontSize:"1.25rem"}}}]}))),tr=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d,...h}=r,p=M.useContext(ah),g=M.useMemo(()=>({dense:s||p.dense||!1,disableGutters:l}),[p.dense,s,l]),m=M.useRef(null);ar(()=>{i&&m.current&&m.current.focus()},[i]);const v={...r,dense:g.dense,divider:a,disableGutters:l},y=rSt(r),b=zn(m,n);let w;return r.disabled||(w=f!==void 0?f:-1),O.jsx(ah.Provider,{value:g,children:O.jsx(iSt,{ref:b,role:u,tabIndex:w,component:o,focusVisibleClassName:Re(y.focusVisible,c),className:Re(y.root,d),...h,ownerState:v,classes:y})})});function oSt(e){return pt("MuiNativeSelect",e)}const dle=dt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),sSt=e=>{const{classes:t,variant:n,disabled:r,multiple:i,open:o,error:s}=e,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Ve(n)}`,o&&"iconOpen",r&&"disabled"]};return Xe(a,oSt,t)},sBe=Oe("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${dle.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),aSt=Oe(sBe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:ua,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${dle.multiple}`]:t.multiple}]}})({}),aBe=Oe("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${dle.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),lSt=Oe(aBe,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ve(n.variant)}`],n.open&&t.iconOpen]}})({}),cSt=M.forwardRef(function(t,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard",...c}=t,u={...t,disabled:i,variant:l,error:o},f=sSt(u);return O.jsxs(M.Fragment,{children:[O.jsx(aSt,{ownerState:u,className:Re(f.select,r),disabled:i,ref:a||n,...c}),t.multiple?null:O.jsx(lSt,{as:s,ownerState:u,className:f.icon})]})});var k1e;const uSt=Oe("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:ua})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),fSt=Oe("legend",{name:"MuiNotchedOutlined",shouldForwardProp:ua})(Mt(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function dSt(e){const{children:t,classes:n,className:r,label:i,notched:o,...s}=e,a=i!=null&&i!=="",l={...e,notched:o,withLabel:a};return O.jsx(uSt,{"aria-hidden":!0,className:r,ownerState:l,...s,children:O.jsx(fSt,{ownerState:l,children:a?O.jsx("span",{children:i}):k1e||(k1e=O.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const hSt=e=>{const{classes:t}=e,r=Xe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Y0t,t);return{...t,...r}},pSt=Oe(rU,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:tU})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${ff.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ff.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ff.focused} .${ff.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(ai()).map(([n])=>({props:{color:n},style:{[`&.${ff.focused} .${ff.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${ff.error} .${ff.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${ff.disabled} .${ff.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),gSt=Oe(dSt,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}})),mSt=Oe(iU,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:nU})(Mt(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),hle=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiOutlinedInput"}),{components:i={},fullWidth:o=!1,inputComponent:s="input",label:a,multiline:l=!1,notched:c,slots:u={},slotProps:f={},type:d="text",...h}=r,p=hSt(r),g=tc(),m=_b({props:r,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...r,color:m.color||"primary",disabled:m.disabled,error:m.error,focused:m.focused,formControl:g,fullWidth:o,hiddenLabel:m.hiddenLabel,multiline:l,size:m.size,type:d},y=u.root??i.Root??pSt,b=u.input??i.Input??mSt,[w,S]=Zt("notchedOutline",{elementType:gSt,className:p.notchedOutline,shouldForwardComponentProp:!0,ownerState:v,externalForwardedProps:{slots:u,slotProps:f},additionalProps:{label:a!=null&&a!==""&&m.required?O.jsxs(M.Fragment,{children:[a," ","*"]}):a}});return O.jsx(wT,{slots:{root:y,input:b},slotProps:f,renderSuffix:_=>O.jsx(w,{...S,notched:typeof c<"u"?c:!!(_.startAdornment||_.filled||_.focused)}),fullWidth:o,inputComponent:s,multiline:l,ref:n,type:d,...h,classes:{...p,notchedOutline:null}})});hle.muiName="Input";const vSt=ot(O.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),ySt=ot(O.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),bSt=ot(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),xSt=ot(O.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),wSt=Oe("span",{name:"MuiRadioButtonIcon",shouldForwardProp:ua})({position:"relative",display:"flex"}),SSt=Oe(bSt,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),_St=Oe(xSt,{name:"MuiRadioButtonIcon"})(Mt(({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function lBe(e){const{checked:t=!1,classes:n={},fontSize:r}=e,i={...e,checked:t};return O.jsxs(wSt,{className:n.root,ownerState:i,children:[O.jsx(SSt,{fontSize:r,className:n.background,ownerState:i}),O.jsx(_St,{fontSize:r,className:n.dot,ownerState:i})]})}const cBe=M.createContext(void 0);function CSt(){return M.useContext(cBe)}function OSt(e){return pt("MuiRadio",e)}const M1e=dt("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),ESt=e=>{const{classes:t,color:n,size:r}=e,i={root:["root",`color${Ve(n)}`,r!=="medium"&&`size${Ve(r)}`]};return{...t,...Xe(i,OSt,t)}},TSt=Oe(ile,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size!=="medium"&&t[`size${Ve(n.size)}`],t[`color${Ve(n.color)}`]]}})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${M1e.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${M1e.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function PSt(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const kSt=O.jsx(lBe,{checked:!0}),MSt=O.jsx(lBe,{}),uO=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiRadio"}),{checked:i,checkedIcon:o=kSt,color:s="primary",icon:a=MSt,name:l,onChange:c,size:u="medium",className:f,disabled:d,disableRipple:h=!1,slots:p={},slotProps:g={},inputProps:m,...v}=r,y=tc();let b=d;y&&typeof b>"u"&&(b=y.disabled),b??=!1;const w={...r,disabled:b,disableRipple:h,color:s,size:u},S=ESt(w),_=CSt();let E=i;const T=ete(c,_&&_.onChange);let k=l;_&&(typeof E>"u"&&(E=PSt(_.value,r.value)),typeof k>"u"&&(k=_.name));const P=g.input??m,[R,I]=Zt("root",{ref:n,elementType:TSt,className:Re(S.root,f),shouldForwardComponentProp:!0,externalForwardedProps:{slots:p,slotProps:g,...v},getSlotProps:F=>({...F,onChange:(A,...L)=>{F.onChange?.(A,...L),T(A,...L)}}),ownerState:w,additionalProps:{type:"radio",icon:M.cloneElement(a,{fontSize:a.props.fontSize??u}),checkedIcon:M.cloneElement(o,{fontSize:o.props.fontSize??u}),disabled:b,name:k,checked:E,slots:p,slotProps:{input:typeof P=="function"?P(w):P}}});return O.jsx(R,{...I,classes:S})});function ASt(e){return pt("MuiRadioGroup",e)}dt("MuiRadioGroup",["root","row","error"]);const RSt=e=>{const{classes:t,row:n,error:r}=e;return Xe({root:["root",n&&"row",r&&"error"]},ASt,t)},oU=M.forwardRef(function(t,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:c,...u}=t,f=M.useRef(null),d=RSt(t),[h,p]=Fa({controlled:c,default:s,name:"RadioGroup"});M.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const g=zn(n,f),m=ur(a),v=M.useMemo(()=>({name:m,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[m,l,p,h]);return O.jsx(cBe.Provider,{value:v,children:O.jsx(k1t,{role:"radiogroup",ref:g,className:Re(d.root,o),...u,children:i})})});function uBe(e){return pt("MuiSelect",e)}const Ek=dt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var A1e;const ISt=Oe(sBe,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${Ek.select}`]:t.select},{[`&.${Ek.select}`]:t[n.variant]},{[`&.${Ek.error}`]:t.error},{[`&.${Ek.multiple}`]:t.multiple}]}})({[`&.${Ek.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),DSt=Oe(aBe,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ve(n.variant)}`],n.open&&t.iconOpen]}})({}),LSt=Oe("input",{shouldForwardProp:e=>K6(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function R1e(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function FSt(e){return e==null||typeof e=="string"&&!e.trim()}const $St=e=>{const{classes:t,variant:n,disabled:r,multiple:i,open:o,error:s}=e,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Ve(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Xe(a,uBe,t)},NSt=M.forwardRef(function(t,n){const{"aria-describedby":r,"aria-label":i,autoFocus:o,autoWidth:s,children:a,className:l,defaultOpen:c,defaultValue:u,disabled:f,displayEmpty:d,error:h=!1,IconComponent:p,inputRef:g,labelId:m,MenuProps:v={},multiple:y,name:b,onBlur:w,onChange:S,onClose:_,onFocus:E,onOpen:T,open:k,readOnly:P,renderValue:R,required:I,SelectDisplayProps:F={},tabIndex:A,type:L,value:$,variant:j="standard",...V}=t,[U,z]=Fa({controlled:$,default:u,name:"Select"}),[N,B]=Fa({controlled:k,default:c,name:"Select"}),H=M.useRef(null),Q=M.useRef(null),[Y,Z]=M.useState(null),{current:pe}=M.useRef(k!=null),[ie,ne]=M.useState(),fe=zn(n,g),me=M.useCallback(ze=>{Q.current=ze,ze&&Z(ze)},[]),se=Y?.parentNode;M.useImperativeHandle(fe,()=>({focus:()=>{Q.current.focus()},node:H.current,value:U}),[U]),M.useEffect(()=>{c&&N&&Y&&!pe&&(ne(s?null:se.clientWidth),Q.current.focus())},[Y,s]),M.useEffect(()=>{o&&Q.current.focus()},[o]),M.useEffect(()=>{if(!m)return;const ze=ci(Q.current).getElementById(m);if(ze){const Je=()=>{getSelection().isCollapsed&&Q.current.focus()};return ze.addEventListener("click",Je),()=>{ze.removeEventListener("click",Je)}}},[m]);const ue=(ze,Je)=>{ze?T&&T(Je):_&&_(Je),pe||(ne(s?null:se.clientWidth),B(ze))},G=ze=>{ze.button===0&&(ze.preventDefault(),Q.current.focus(),ue(!0,ze))},ce=ze=>{ue(!1,ze)},he=M.Children.toArray(a),J=ze=>{const Je=he.find(mt=>mt.props.value===ze.target.value);Je!==void 0&&(z(Je.props.value),S&&S(ze,Je))},te=ze=>Je=>{let mt;if(Je.currentTarget.hasAttribute("tabindex")){if(y){mt=Array.isArray(U)?U.slice():[];const Me=U.indexOf(ze.props.value);Me===-1?mt.push(ze.props.value):mt.splice(Me,1)}else mt=ze.props.value;if(ze.props.onClick&&ze.props.onClick(Je),U!==mt&&(z(mt),S)){const Me=Je.nativeEvent||Je,st=new Me.constructor(Me.type,Me);Object.defineProperty(st,"target",{writable:!0,value:{value:mt,name:b}}),S(st,ze)}y||ue(!1,Je)}},ae=ze=>{P||[" ","ArrowUp","ArrowDown","Enter"].includes(ze.key)&&(ze.preventDefault(),ue(!0,ze))},we=Y!==null&&N,Pe=ze=>{!we&&w&&(Object.defineProperty(ze,"target",{writable:!0,value:{value:U,name:b}}),w(ze))};delete V["aria-invalid"];let ee,oe;const Se=[];let ye=!1;(B5({value:U})||d)&&(R?ee=R(U):ye=!0);const be=he.map(ze=>{if(!M.isValidElement(ze))return null;let Je;if(y){if(!Array.isArray(U))throw new Error(cv(2));Je=U.some(mt=>R1e(mt,ze.props.value)),Je&&ye&&Se.push(ze.props.children)}else Je=R1e(U,ze.props.value),Je&&ye&&(oe=ze.props.children);return M.cloneElement(ze,{"aria-selected":Je?"true":"false",onClick:te(ze),onKeyUp:mt=>{mt.key===" "&&mt.preventDefault(),ze.props.onKeyUp&&ze.props.onKeyUp(mt)},role:"option",selected:Je,value:void 0,"data-value":ze.props.value})});ye&&(y?Se.length===0?ee=null:ee=Se.reduce((ze,Je,mt)=>(ze.push(Je),mt{const{classes:t}=e,r=Xe({root:["root"]},uBe,t);return{...t,...r}},ple={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>ua(e)&&e!=="variant",slot:"Root"},jSt=Oe(Ob,ple)(""),BSt=Oe(hle,ple)(""),USt=Oe(ale,ple)(""),Th=M.forwardRef(function(t,n){const r=Dt({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Hje,id:f,input:d,inputProps:h,label:p,labelId:g,MenuProps:m,multiple:v=!1,native:y=!1,onClose:b,onOpen:w,open:S,renderValue:_,SelectDisplayProps:E,variant:T="outlined",...k}=r,P=y?cSt:NSt,R=tc(),I=_b({props:r,muiFormControl:R,states:["variant","error"]}),F=I.variant||T,A={...r,variant:F,classes:s},L=zSt(A),{root:$,...j}=L,V=d||{standard:O.jsx(jSt,{ownerState:A}),outlined:O.jsx(BSt,{label:p,ownerState:A}),filled:O.jsx(USt,{ownerState:A})}[F],U=zn(n,xb(V));return O.jsx(M.Fragment,{children:M.cloneElement(V,{inputComponent:P,inputProps:{children:o,error:I.error,IconComponent:u,variant:F,type:void 0,multiple:v,...y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:m,onClose:b,onOpen:w,open:S,renderValue:_,SelectDisplayProps:{id:f,...E}},...h,classes:h?ia(j,h.classes):j,...d?d.props.inputProps:{}},...(v&&y||c)&&F==="outlined"?{notched:!0}:{},ref:U,className:Re(V.props.className,a,L.root),...!d&&{variant:F},...k})})});Th.muiName="Select";function VSt(e){return pt("MuiSkeleton",e)}dt("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const WSt=e=>{const{classes:t,variant:n,animation:r,hasChildren:i,width:o,height:s}=e;return Xe({root:["root",n,r,i&&"withChildren",i&&!o&&"fitContent",i&&!s&&"heightAuto"]},VSt,t)},bte=pg` +`,Qbt=typeof pee!="string"?gb` + animation: ${pee} 3s infinite linear; + `:null,Kbt=e=>{const{classes:t,variant:n,color:r}=e,i={root:["root",`color${Ue(r)}`,n],dashed:["dashed",`dashedColor${Ue(r)}`],bar1:["bar","bar1",`barColor${Ue(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",n!=="buffer"&&`barColor${Ue(r)}`,n==="buffer"&&`color${Ue(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return Xe(i,qbt,t)},sae=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode==="light"?dh(e.palette[t].main,.62):fh(e.palette[t].main,.5),Zbt=Oe("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Ue(n.color)}`],t[n.variant]]}})(Mt(({theme:e})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{backgroundColor:sae(e,t)}})),{props:({ownerState:t})=>t.color==="inherit"&&t.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),Jbt=Oe("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.dashed,t[`dashedColor${Ue(n.color)}`]]}})(Mt(({theme:e})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(e.palette).filter(ai()).map(([t])=>{const n=sae(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),Qbt||{animation:`${pee} 3s infinite linear`}),ext=Oe("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${Ue(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar1Indeterminate,n.variant==="determinate"&&t.bar1Determinate,n.variant==="buffer"&&t.bar1Buffer]}})(Mt(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:"determinate"},style:{transition:`transform .${fee}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${fee}s linear`}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:Xbt||{animation:`${dee} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),txt=Oe("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${Ue(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar2Indeterminate,n.variant==="buffer"&&t.bar2Buffer]}})(Mt(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:t})=>t.variant!=="buffer"&&t.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:t})=>t.variant!=="buffer"&&t.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,variant:"buffer"},style:{backgroundColor:sae(e,t),transition:`transform .${fee}s linear`}})),{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:Ybt||{animation:`${hee} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),Yze=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiLinearProgress"}),{className:i,color:o="primary",value:s,valueBuffer:a,variant:l="indeterminate",...c}=r,u={...r,color:o,variant:l},f=Kbt(u),d=yi(),h={},p={bar1:{},bar2:{}};if((l==="determinate"||l==="buffer")&&s!==void 0){h["aria-valuenow"]=Math.round(s),h["aria-valuemin"]=0,h["aria-valuemax"]=100;let g=s-100;d&&(g=-g),p.bar1.transform=`translateX(${g}%)`}if(l==="buffer"&&a!==void 0){let g=(a||0)-100;d&&(g=-g),p.bar2.transform=`translateX(${g}%)`}return O.jsxs(Zbt,{className:Re(f.root,i),ownerState:u,role:"progressbar",...h,ref:n,...c,children:[l==="buffer"?O.jsx(Jbt,{className:f.dashed,ownerState:u}):null,O.jsx(ext,{className:f.bar1,ownerState:u,style:p.bar1}),l==="determinate"?null:O.jsx(txt,{className:f.bar2,ownerState:u,style:p.bar2})]})});function nxt(e){return pt("MuiLink",e)}const rxt=dt("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),ixt=({theme:e,ownerState:t})=>{const n=t.color,r=i0(e,`palette.${n}.main`,!1)||i0(e,`palette.${n}`,!1)||t.color,i=i0(e,`palette.${n}.mainChannel`)||i0(e,`palette.${n}Channel`);return"vars"in e&&i?`rgba(${i} / 0.4)`:Vt(r,.4)},vxe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},oxt=e=>{const{classes:t,component:n,focusVisible:r,underline:i}=e,o={root:["root",`underline${Ue(i)}`,n==="button"&&"button",r&&"focusVisible"]};return Xe(o,nxt,t)},sxt=Oe(mn,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`underline${Ue(n.underline)}`],n.component==="button"&&t.button]}})(Mt(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:t,ownerState:n})=>t==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.4)`:Vt(e.palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Vt(e.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.secondaryChannel} / 0.4)`:Vt(e.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${rxt.focusVisible}`]:{outline:"auto"}}}]}))),axt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiLink"}),i=as(),{className:o,color:s="primary",component:a="a",onBlur:l,onFocus:c,TypographyClasses:u,underline:f="always",variant:d="inherit",sx:h,...p}=r,[g,m]=M.useState(!1),v=S=>{z0(S.target)||m(!1),l&&l(S)},y=S=>{z0(S.target)&&m(!0),c&&c(S)},b={...r,color:s,component:a,focusVisible:g,underline:f,variant:d},w=oxt(b);return O.jsx(sxt,{color:s,className:Re(w.root,o),classes:u,component:a,onBlur:v,onFocus:y,ref:n,ownerState:b,variant:d,...p,sx:[...vxe[s]===void 0?[{color:s}]:[],...Array.isArray(h)?h:[h]],style:{...p.style,...f==="always"&&s!=="inherit"&&!vxe[s]&&{"--Link-underlineColor":ixt({theme:i,ownerState:b})}}})}),sh=M.createContext({});function lxt(e){return pt("MuiList",e)}dt("MuiList",["root","padding","dense","subheader"]);const cxt=e=>{const{classes:t,disablePadding:n,dense:r,subheader:i}=e;return Xe({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},lxt,t)},uxt=Oe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),WI=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c,...u}=r,f=M.useMemo(()=>({dense:a}),[a]),d={...r,component:s,dense:a,disablePadding:l},h=cxt(d);return O.jsx(sh.Provider,{value:f,children:O.jsxs(uxt,{as:s,className:Re(h.root,o),ref:n,ownerState:d,...u,children:[c,i]})})});function fxt(e){return pt("MuiListItem",e)}dt("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function dxt(e){return pt("MuiListItemButton",e)}const uC=dt("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),hxt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]},pxt=e=>{const{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=e,c=Xe({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled",t==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},dxt,n);return{...n,...c}},gxt=Oe(Hf,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:hxt})(Mt(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${uC.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${uC.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${uC.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${uC.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${uC.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.dense,style:{paddingTop:4,paddingBottom:4}}]}))),Qze=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:s="div",children:a,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h,...p}=r,g=M.useContext(sh),m=M.useMemo(()=>({dense:l||g.dense||!1,alignItems:i,disableGutters:c}),[i,g.dense,l,c]),v=M.useRef(null);lr(()=>{o&&v.current&&v.current.focus()},[o]);const y={...r,alignItems:i,dense:m.dense,disableGutters:c,divider:u,selected:d},b=pxt(y),w=zn(v,n);return O.jsx(sh.Provider,{value:m,children:O.jsx(gxt,{ref:w,href:p.href||p.to,component:(p.href||p.to)&&s==="div"?"button":s,focusVisibleClassName:Re(b.focusVisible,f),ownerState:y,className:Re(b.root,h),...p,classes:b,children:a})})});function mxt(e){return pt("MuiListItemSecondaryAction",e)}dt("MuiListItemSecondaryAction",["root","disableGutters"]);const vxt=e=>{const{disableGutters:t,classes:n}=e;return Xe({root:["root",t&&"disableGutters"]},mxt,n)},yxt=Oe("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),TA=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItemSecondaryAction"}),{className:i,...o}=r,s=M.useContext(sh),a={...r,disableGutters:s.disableGutters},l=vxt(a);return O.jsx(yxt,{className:Re(l.root,i),ownerState:a,ref:n,...o})});TA.muiName="ListItemSecondaryAction";const bxt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},xxt=e=>{const{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:s,hasSecondaryAction:a}=e;return Xe({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",s&&"divider",t==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},fxt,n)},wxt=Oe("div",{name:"MuiListItem",slot:"Root",overridesResolver:bxt})(Mt(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${uC.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),Sxt=Oe("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),eO=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItem"}),{alignItems:i="center",children:o,className:s,component:a,components:l={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:f,...d}={},dense:h=!1,disableGutters:p=!1,disablePadding:g=!1,divider:m=!1,secondaryAction:v,slotProps:y={},slots:b={},...w}=r,S=M.useContext(sh),_=M.useMemo(()=>({dense:h||S.dense||!1,alignItems:i,disableGutters:p}),[i,S.dense,h,p]),E=M.useRef(null),T=M.Children.toArray(o),k=T.length&&oz(T[T.length-1],["ListItemSecondaryAction"]),P={...r,alignItems:i,dense:_.dense,disableGutters:p,disablePadding:g,divider:m,hasSecondaryAction:k},I=xxt(P),R=zn(E,n),F=b.root||l.Root||wxt,A=y.root||c.root||{},L={className:Re(I.root,A.className,s),...w};let $=a||"li";return k?($=!L.component&&!a?"div":$,u==="li"&&($==="li"?$="div":L.component==="li"&&(L.component="div")),O.jsx(sh.Provider,{value:_,children:O.jsxs(Sxt,{as:u,className:Re(I.container,f),ref:R,ownerState:P,...d,children:[O.jsx(F,{...A,...!zm(F)&&{as:$,ownerState:{...P,...A.ownerState}},...L,children:T}),T.pop()]})})):O.jsx(sh.Provider,{value:_,children:O.jsxs(F,{...A,as:$,ref:R,...!zm(F)&&{ownerState:{...P,...A.ownerState}},...L,children:[T,v&&O.jsx(TA,{children:v})]})})});function _xt(e){return pt("MuiListItemIcon",e)}const yxe=dt("MuiListItemIcon",["root","alignItemsFlexStart"]),Cxt=e=>{const{alignItems:t,classes:n}=e;return Xe({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},_xt,n)},Oxt=Oe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(Mt(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),rl=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItemIcon"}),{className:i,...o}=r,s=M.useContext(sh),a={...r,alignItems:s.alignItems},l=Cxt(a);return O.jsx(Oxt,{className:Re(l.root,i),ownerState:a,ref:n,...o})});function Ext(e){return pt("MuiListItemText",e)}const EC=dt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),Txt=e=>{const{classes:t,inset:n,primary:r,secondary:i,dense:o}=e;return Xe({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},Ext,t)},Pxt=Oe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${EC.primary}`]:t.primary},{[`& .${EC.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${m5.root}:where(& .${EC.primary})`]:{display:"block"},[`.${m5.root}:where(& .${EC.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),Qi=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiListItemText"}),{children:i,className:o,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f,slots:d={},slotProps:h={},...p}=r,{dense:g}=M.useContext(sh);let m=l??i,v=u;const y={...r,disableTypography:s,inset:a,primary:!!m,secondary:!!v,dense:g},b=Txt(y),w={slots:d,slotProps:{primary:c,secondary:f,...h}},[S,_]=Zt("root",{className:Re(b.root,o),elementType:Pxt,externalForwardedProps:{...w,...p},ownerState:y,ref:n}),[E,T]=Zt("primary",{className:b.primary,elementType:mn,externalForwardedProps:w,ownerState:y}),[k,P]=Zt("secondary",{className:b.secondary,elementType:mn,externalForwardedProps:w,ownerState:y});return m!=null&&m.type!==mn&&!s&&(m=O.jsx(E,{variant:g?"body2":"body1",component:T?.variant?void 0:"span",...T,children:m})),v!=null&&v.type!==mn&&!s&&(v=O.jsx(k,{variant:"body2",color:"textSecondary",...P,children:v})),O.jsxs(S,{..._,children:[m,v]})});function QG(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function bxe(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function Kze(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function vk(e,t,n,r,i,o){let s=!1,a=i(e,t,t?n:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!Kze(a,o)||l)a=i(e,a,n);else return a.focus(),!0}return!1}const Xw=M.forwardRef(function(t,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu",...d}=t,h=M.useRef(null),p=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});lr(()=>{i&&h.current.focus()},[i]),M.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(b,{direction:w})=>{const S=!h.current.style.width;if(b.clientHeight{const w=h.current,S=b.key;if(b.ctrlKey||b.metaKey||b.altKey){u&&u(b);return}const E=ci(w).activeElement;if(S==="ArrowDown")b.preventDefault(),vk(w,E,c,l,QG);else if(S==="ArrowUp")b.preventDefault(),vk(w,E,c,l,bxe);else if(S==="Home")b.preventDefault(),vk(w,null,c,l,QG);else if(S==="End")b.preventDefault(),vk(w,null,c,l,bxe);else if(S.length===1){const T=p.current,k=S.toLowerCase(),P=performance.now();T.keys.length>0&&(P-T.lastTime>500?(T.keys=[],T.repeating=!0,T.previousKeyMatched=!0):T.repeating&&k!==T.keys[0]&&(T.repeating=!1)),T.lastTime=P,T.keys.push(k);const I=E&&!T.repeating&&Kze(E,T);T.previousKeyMatched&&(I||vk(w,E,!1,l,QG,T))?b.preventDefault():T.previousKeyMatched=!1}u&&u(b)},m=zn(h,n);let v=-1;M.Children.forEach(s,(b,w)=>{if(!M.isValidElement(b)){v===w&&(v+=1,v>=s.length&&(v=-1));return}b.props.disabled||(f==="selectedMenu"&&b.props.selected||v===-1)&&(v=w),v===w&&(b.props.disabled||b.props.muiSkipListHighlight||b.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const y=M.Children.map(s,(b,w)=>{if(w===v){const S={};return o&&(S.autoFocus=!0),b.props.tabIndex===void 0&&f==="selectedMenu"&&(S.tabIndex=0),M.cloneElement(b,S)}return b});return O.jsx(WI,{role:"menu",ref:m,className:a,onKeyDown:g,tabIndex:i?0:-1,...d,children:y})});function kxt(e){return pt("MuiPopover",e)}dt("MuiPopover",["root","paper"]);function xxe(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function wxe(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function Sxe(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function c$(e){return typeof e=="function"?e():e}const Mxt=e=>{const{classes:t}=e;return Xe({root:["root"],paper:["paper"]},kxt,t)},Axt=Oe(Wze,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Zze=Oe(fa,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Yw=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiPopover"}),{action:i,anchorEl:o,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:c,className:u,container:f,elevation:d=8,marginThreshold:h=16,open:p,PaperProps:g={},slots:m={},slotProps:v={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:b,transitionDuration:w="auto",TransitionProps:S={},disableScrollLock:_=!1,...E}=r,T=M.useRef(),k={...r,anchorOrigin:s,anchorReference:l,elevation:d,marginThreshold:h,transformOrigin:y,TransitionComponent:b,transitionDuration:w,TransitionProps:S},P=Mxt(k),I=M.useCallback(()=>{if(l==="anchorPosition")return a;const fe=c$(o),se=(fe&&fe.nodeType===1?fe:ci(T.current).body).getBoundingClientRect();return{top:se.top+xxe(se,s.vertical),left:se.left+wxe(se,s.horizontal)}},[o,s.horizontal,s.vertical,a,l]),R=M.useCallback(fe=>({vertical:xxe(fe,y.vertical),horizontal:wxe(fe,y.horizontal)}),[y.horizontal,y.vertical]),F=M.useCallback(fe=>{const ve={width:fe.offsetWidth,height:fe.offsetHeight},se=R(ve);if(l==="none")return{top:null,left:null,transformOrigin:Sxe(se)};const ue=I();let G=ue.top-se.vertical,ce=ue.left-se.horizontal;const pe=G+ve.height,J=ce+ve.width,te=Lc(c$(o)),ae=te.innerHeight-h,we=te.innerWidth-h;if(h!==null&&Gae){const Pe=pe-ae;G-=Pe,se.vertical+=Pe}if(h!==null&&cewe){const Pe=J-we;ce-=Pe,se.horizontal+=Pe}return{top:`${Math.round(G)}px`,left:`${Math.round(ce)}px`,transformOrigin:Sxe(se)}},[o,l,I,R,h]),[A,L]=M.useState(p),$=M.useCallback(()=>{const fe=T.current;if(!fe)return;const ve=F(fe);ve.top!==null&&fe.style.setProperty("top",ve.top),ve.left!==null&&(fe.style.left=ve.left),fe.style.transformOrigin=ve.transformOrigin,L(!0)},[F]);M.useEffect(()=>(_&&window.addEventListener("scroll",$),()=>window.removeEventListener("scroll",$)),[o,_,$]);const j=()=>{$()},V=()=>{L(!1)};M.useEffect(()=>{p&&$()}),M.useImperativeHandle(i,()=>p?{updatePosition:()=>{$()}}:null,[p,$]),M.useEffect(()=>{if(!p)return;const fe=zI(()=>{$()}),ve=Lc(c$(o));return ve.addEventListener("resize",fe),()=>{fe.clear(),ve.removeEventListener("resize",fe)}},[o,p,$]);let U=w;const z={slots:{transition:b,...m},slotProps:{transition:S,paper:g,...v}},[N,B]=Zt("transition",{elementType:K1,externalForwardedProps:z,ownerState:k,getSlotProps:fe=>({...fe,onEntering:(ve,se)=>{fe.onEntering?.(ve,se),j()},onExited:ve=>{fe.onExited?.(ve),V()}}),additionalProps:{appear:!0,in:p}});w==="auto"&&!N.muiSupportAuto&&(U=void 0);const H=f||(o?ci(c$(o)).body:void 0),[Q,{slots:Y,slotProps:Z,...ge}]=Zt("root",{ref:n,elementType:Axt,externalForwardedProps:{...z,...E},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:m.backdrop},slotProps:{backdrop:_ze(typeof v.backdrop=="function"?v.backdrop(k):v.backdrop,{invisible:!0})},container:H,open:p},ownerState:k,className:Re(P.root,u)}),[ne,ie]=Zt("paper",{ref:T,className:P.paper,elementType:Zze,externalForwardedProps:z,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:A?void 0:{opacity:0}},ownerState:k});return O.jsx(Q,{...ge,...!zm(Q)&&{slots:Y,slotProps:Z,disableScrollLock:_},children:O.jsx(N,{...B,timeout:U,children:O.jsx(ne,{...ie,children:c})})})});function Rxt(e){return pt("MuiMenu",e)}dt("MuiMenu",["root","paper","list"]);const Ixt={vertical:"top",horizontal:"right"},Dxt={vertical:"top",horizontal:"left"},Lxt=e=>{const{classes:t}=e;return Xe({root:["root"],paper:["paper"],list:["list"]},Rxt,t)},Fxt=Oe(Yw,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),$xt=Oe(Zze,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Nxt=Oe(Xw,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),Qw=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiMenu"}),{autoFocus:i=!0,children:o,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:c,open:u,PaperProps:f={},PopoverClasses:d,transitionDuration:h="auto",TransitionProps:{onEntering:p,...g}={},variant:m="selectedMenu",slots:v={},slotProps:y={},...b}=r,w=yi(),S={...r,autoFocus:i,disableAutoFocusItem:a,MenuListProps:l,onEntering:p,PaperProps:f,transitionDuration:h,TransitionProps:g,variant:m},_=Lxt(S),E=i&&!a&&u,T=M.useRef(null),k=(U,z)=>{T.current&&T.current.adjustStyleForScrollbar(U,{direction:w?"rtl":"ltr"}),p&&p(U,z)},P=U=>{U.key==="Tab"&&(U.preventDefault(),c&&c(U,"tabKeyDown"))};let I=-1;M.Children.map(o,(U,z)=>{M.isValidElement(U)&&(U.props.disabled||(m==="selectedMenu"&&U.props.selected||I===-1)&&(I=z))});const R={slots:v,slotProps:{list:l,transition:g,paper:f,...y}},F=Xn({elementType:v.root,externalSlotProps:y.root,ownerState:S,className:[_.root,s]}),[A,L]=Zt("paper",{className:_.paper,elementType:$xt,externalForwardedProps:R,shouldForwardComponentProp:!0,ownerState:S}),[$,j]=Zt("list",{className:Re(_.list,l.className),elementType:Nxt,shouldForwardComponentProp:!0,externalForwardedProps:R,getSlotProps:U=>({...U,onKeyDown:z=>{P(z),U.onKeyDown?.(z)}}),ownerState:S}),V=typeof R.slotProps.transition=="function"?R.slotProps.transition(S):R.slotProps.transition;return O.jsx(Fxt,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:w?"right":"left"},transformOrigin:w?Ixt:Dxt,slots:{root:v.root,paper:A,backdrop:v.backdrop,...v.transition&&{transition:v.transition}},slotProps:{root:F,paper:L,backdrop:typeof y.backdrop=="function"?y.backdrop(S):y.backdrop,transition:{...V,onEntering:(...U)=>{k(...U),V?.onEntering?.(...U)}}},open:u,ref:n,transitionDuration:h,ownerState:S,...b,classes:d,children:O.jsx($,{actions:T,autoFocus:i&&(I===-1||a),autoFocusItem:E,variant:m,...j,children:o})})});function zxt(e){return pt("MuiMenuItem",e)}const yk=dt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),jxt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},Bxt=e=>{const{disabled:t,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=e,l=Xe({root:["root",n&&"dense",t&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},zxt,s);return{...s,...l}},Uxt=Oe(Hf,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:jxt})(Mt(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${yk.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${yk.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${yk.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${yk.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${yk.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${fxe.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${fxe.inset}`]:{marginLeft:52},[`& .${EC.root}`]:{marginTop:0,marginBottom:0},[`& .${EC.inset}`]:{paddingLeft:36},[`& .${yxe.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${yxe.root} svg`]:{fontSize:"1.25rem"}}}]}))),nr=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d,...h}=r,p=M.useContext(sh),g=M.useMemo(()=>({dense:s||p.dense||!1,disableGutters:l}),[p.dense,s,l]),m=M.useRef(null);lr(()=>{i&&m.current&&m.current.focus()},[i]);const v={...r,dense:g.dense,divider:a,disableGutters:l},y=Bxt(r),b=zn(m,n);let w;return r.disabled||(w=f!==void 0?f:-1),O.jsx(sh.Provider,{value:g,children:O.jsx(Uxt,{ref:b,role:u,tabIndex:w,component:o,focusVisibleClassName:Re(y.focusVisible,c),className:Re(y.root,d),...h,ownerState:v,classes:y})})});function Vxt(e){return pt("MuiNativeSelect",e)}const aae=dt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Wxt=e=>{const{classes:t,variant:n,disabled:r,multiple:i,open:o,error:s}=e,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Ue(n)}`,o&&"iconOpen",r&&"disabled"]};return Xe(a,Vxt,t)},Jze=Oe("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${aae.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),Hxt=Oe(Jze,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:ua,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${aae.multiple}`]:t.multiple}]}})({}),e5e=Oe("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${aae.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),Gxt=Oe(e5e,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ue(n.variant)}`],n.open&&t.iconOpen]}})({}),qxt=M.forwardRef(function(t,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard",...c}=t,u={...t,disabled:i,variant:l,error:o},f=Wxt(u);return O.jsxs(M.Fragment,{children:[O.jsx(Hxt,{ownerState:u,className:Re(f.select,r),disabled:i,ref:a||n,...c}),t.multiple?null:O.jsx(Gxt,{as:s,ownerState:u,className:f.icon})]})});var _xe;const Xxt=Oe("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:ua})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),Yxt=Oe("legend",{name:"MuiNotchedOutlined",shouldForwardProp:ua})(Mt(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function Qxt(e){const{children:t,classes:n,className:r,label:i,notched:o,...s}=e,a=i!=null&&i!=="",l={...e,notched:o,withLabel:a};return O.jsx(Xxt,{"aria-hidden":!0,className:r,ownerState:l,...s,children:O.jsx(Yxt,{ownerState:l,children:a?O.jsx("span",{children:i}):_xe||(_xe=O.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const Kxt=e=>{const{classes:t}=e,r=Xe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Ivt,t);return{...t,...r}},Zxt=Oe(L6,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:I6})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${uf.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${uf.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${uf.focused} .${uf.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(ai()).map(([n])=>({props:{color:n},style:{[`&.${uf.focused} .${uf.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${uf.error} .${uf.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${uf.disabled} .${uf.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),Jxt=Oe(Qxt,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}})),e1t=Oe(F6,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:D6})(Mt(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),lae=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiOutlinedInput"}),{components:i={},fullWidth:o=!1,inputComponent:s="input",label:a,multiline:l=!1,notched:c,slots:u={},slotProps:f={},type:d="text",...h}=r,p=Kxt(r),g=Jl(),m=bb({props:r,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...r,color:m.color||"primary",disabled:m.disabled,error:m.error,focused:m.focused,formControl:g,fullWidth:o,hiddenLabel:m.hiddenLabel,multiline:l,size:m.size,type:d},y=u.root??i.Root??Zxt,b=u.input??i.Input??e1t,[w,S]=Zt("notchedOutline",{elementType:Jxt,className:p.notchedOutline,shouldForwardComponentProp:!0,ownerState:v,externalForwardedProps:{slots:u,slotProps:f},additionalProps:{label:a!=null&&a!==""&&m.required?O.jsxs(M.Fragment,{children:[a," ","*"]}):a}});return O.jsx(hT,{slots:{root:y,input:b},slotProps:f,renderSuffix:_=>O.jsx(w,{...S,notched:typeof c<"u"?c:!!(_.startAdornment||_.filled||_.focused)}),fullWidth:o,inputComponent:s,multiline:l,ref:n,type:d,...h,classes:{...p,notchedOutline:null}})});lae.muiName="Input";const t1t=at(O.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),n1t=at(O.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),r1t=at(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),i1t=at(O.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),o1t=Oe("span",{name:"MuiRadioButtonIcon",shouldForwardProp:ua})({position:"relative",display:"flex"}),s1t=Oe(r1t,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),a1t=Oe(i1t,{name:"MuiRadioButtonIcon"})(Mt(({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function t5e(e){const{checked:t=!1,classes:n={},fontSize:r}=e,i={...e,checked:t};return O.jsxs(o1t,{className:n.root,ownerState:i,children:[O.jsx(s1t,{fontSize:r,className:n.background,ownerState:i}),O.jsx(a1t,{fontSize:r,className:n.dot,ownerState:i})]})}const n5e=M.createContext(void 0);function l1t(){return M.useContext(n5e)}function c1t(e){return pt("MuiRadio",e)}const Cxe=dt("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),u1t=e=>{const{classes:t,color:n,size:r}=e,i={root:["root",`color${Ue(n)}`,r!=="medium"&&`size${Ue(r)}`]};return{...t,...Xe(i,c1t,t)}},f1t=Oe(Zse,{shouldForwardProp:e=>ua(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size!=="medium"&&t[`size${Ue(n.size)}`],t[`color${Ue(n.color)}`]]}})(Mt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${Cxe.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${Cxe.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function d1t(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const h1t=O.jsx(t5e,{checked:!0}),p1t=O.jsx(t5e,{}),tO=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiRadio"}),{checked:i,checkedIcon:o=h1t,color:s="primary",icon:a=p1t,name:l,onChange:c,size:u="medium",className:f,disabled:d,disableRipple:h=!1,slots:p={},slotProps:g={},inputProps:m,...v}=r,y=Jl();let b=d;y&&typeof b>"u"&&(b=y.disabled),b??=!1;const w={...r,disabled:b,disableRipple:h,color:s,size:u},S=u1t(w),_=l1t();let E=i;const T=QJ(c,_&&_.onChange);let k=l;_&&(typeof E>"u"&&(E=d1t(_.value,r.value)),typeof k>"u"&&(k=_.name));const P=g.input??m,[I,R]=Zt("root",{ref:n,elementType:f1t,className:Re(S.root,f),shouldForwardComponentProp:!0,externalForwardedProps:{slots:p,slotProps:g,...v},getSlotProps:F=>({...F,onChange:(A,...L)=>{F.onChange?.(A,...L),T(A,...L)}}),ownerState:w,additionalProps:{type:"radio",icon:M.cloneElement(a,{fontSize:a.props.fontSize??u}),checkedIcon:M.cloneElement(o,{fontSize:o.props.fontSize??u}),disabled:b,name:k,checked:E,slots:p,slotProps:{input:typeof P=="function"?P(w):P}}});return O.jsx(I,{...R,classes:S})});function g1t(e){return pt("MuiRadioGroup",e)}dt("MuiRadioGroup",["root","row","error"]);const m1t=e=>{const{classes:t,row:n,error:r}=e;return Xe({root:["root",n&&"row",r&&"error"]},g1t,t)},$6=M.forwardRef(function(t,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:c,...u}=t,f=M.useRef(null),d=m1t(t),[h,p]=Da({controlled:c,default:s,name:"RadioGroup"});M.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const g=zn(n,f),m=fr(a),v=M.useMemo(()=>({name:m,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[m,l,p,h]);return O.jsx(n5e.Provider,{value:v,children:O.jsx(hbt,{role:"radiogroup",ref:g,className:Re(d.root,o),...u,children:i})})});function r5e(e){return pt("MuiSelect",e)}const bk=dt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Oxe;const v1t=Oe(Jze,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${bk.select}`]:t.select},{[`&.${bk.select}`]:t[n.variant]},{[`&.${bk.error}`]:t.error},{[`&.${bk.multiple}`]:t.multiple}]}})({[`&.${bk.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),y1t=Oe(e5e,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ue(n.variant)}`],n.open&&t.iconOpen]}})({}),b1t=Oe("input",{shouldForwardProp:e=>k6(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Exe(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function x1t(e){return e==null||typeof e=="string"&&!e.trim()}const w1t=e=>{const{classes:t,variant:n,disabled:r,multiple:i,open:o,error:s}=e,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Ue(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Xe(a,r5e,t)},S1t=M.forwardRef(function(t,n){const{"aria-describedby":r,"aria-label":i,autoFocus:o,autoWidth:s,children:a,className:l,defaultOpen:c,defaultValue:u,disabled:f,displayEmpty:d,error:h=!1,IconComponent:p,inputRef:g,labelId:m,MenuProps:v={},multiple:y,name:b,onBlur:w,onChange:S,onClose:_,onFocus:E,onOpen:T,open:k,readOnly:P,renderValue:I,required:R,SelectDisplayProps:F={},tabIndex:A,type:L,value:$,variant:j="standard",...V}=t,[U,z]=Da({controlled:$,default:u,name:"Select"}),[N,B]=Da({controlled:k,default:c,name:"Select"}),H=M.useRef(null),Q=M.useRef(null),[Y,Z]=M.useState(null),{current:ge}=M.useRef(k!=null),[ne,ie]=M.useState(),fe=zn(n,g),ve=M.useCallback(Ve=>{Q.current=Ve,Ve&&Z(Ve)},[]),se=Y?.parentNode;M.useImperativeHandle(fe,()=>({focus:()=>{Q.current.focus()},node:H.current,value:U}),[U]),M.useEffect(()=>{c&&N&&Y&&!ge&&(ie(s?null:se.clientWidth),Q.current.focus())},[Y,s]),M.useEffect(()=>{o&&Q.current.focus()},[o]),M.useEffect(()=>{if(!m)return;const Ve=ci(Q.current).getElementById(m);if(Ve){const Ze=()=>{getSelection().isCollapsed&&Q.current.focus()};return Ve.addEventListener("click",Ze),()=>{Ve.removeEventListener("click",Ze)}}},[m]);const ue=(Ve,Ze)=>{Ve?T&&T(Ze):_&&_(Ze),ge||(ie(s?null:se.clientWidth),B(Ve))},G=Ve=>{Ve.button===0&&(Ve.preventDefault(),Q.current.focus(),ue(!0,Ve))},ce=Ve=>{ue(!1,Ve)},pe=M.Children.toArray(a),J=Ve=>{const Ze=pe.find(mt=>mt.props.value===Ve.target.value);Ze!==void 0&&(z(Ze.props.value),S&&S(Ve,Ze))},te=Ve=>Ze=>{let mt;if(Ze.currentTarget.hasAttribute("tabindex")){if(y){mt=Array.isArray(U)?U.slice():[];const Me=U.indexOf(Ve.props.value);Me===-1?mt.push(Ve.props.value):mt.splice(Me,1)}else mt=Ve.props.value;if(Ve.props.onClick&&Ve.props.onClick(Ze),U!==mt&&(z(mt),S)){const Me=Ze.nativeEvent||Ze,ct=new Me.constructor(Me.type,Me);Object.defineProperty(ct,"target",{writable:!0,value:{value:mt,name:b}}),S(ct,Ve)}y||ue(!1,Ze)}},ae=Ve=>{P||[" ","ArrowUp","ArrowDown","Enter"].includes(Ve.key)&&(Ve.preventDefault(),ue(!0,Ve))},we=Y!==null&&N,Pe=Ve=>{!we&&w&&(Object.defineProperty(Ve,"target",{writable:!0,value:{value:U,name:b}}),w(Ve))};delete V["aria-invalid"];let ee,re;const Se=[];let he=!1;(y5({value:U})||d)&&(I?ee=I(U):he=!0);const xe=pe.map(Ve=>{if(!M.isValidElement(Ve))return null;let Ze;if(y){if(!Array.isArray(U))throw new Error(ov(2));Ze=U.some(mt=>Exe(mt,Ve.props.value)),Ze&&he&&Se.push(Ve.props.children)}else Ze=Exe(U,Ve.props.value),Ze&&he&&(re=Ve.props.children);return M.cloneElement(Ve,{"aria-selected":Ze?"true":"false",onClick:te(Ve),onKeyUp:mt=>{mt.key===" "&&mt.preventDefault(),Ve.props.onKeyUp&&Ve.props.onKeyUp(mt)},role:"option",selected:Ze,value:void 0,"data-value":Ve.props.value})});he&&(y?Se.length===0?ee=null:ee=Se.reduce((Ve,Ze,mt)=>(Ve.push(Ze),mt{const{classes:t}=e,r=Xe({root:["root"]},r5e,t);return{...t,...r}},cae={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>ua(e)&&e!=="variant",slot:"Root"},C1t=Oe(wb,cae)(""),O1t=Oe(lae,cae)(""),E1t=Oe(tae,cae)(""),Oh=M.forwardRef(function(t,n){const r=Dt({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Nze,id:f,input:d,inputProps:h,label:p,labelId:g,MenuProps:m,multiple:v=!1,native:y=!1,onClose:b,onOpen:w,open:S,renderValue:_,SelectDisplayProps:E,variant:T="outlined",...k}=r,P=y?qxt:S1t,I=Jl(),R=bb({props:r,muiFormControl:I,states:["variant","error"]}),F=R.variant||T,A={...r,variant:F,classes:s},L=_1t(A),{root:$,...j}=L,V=d||{standard:O.jsx(C1t,{ownerState:A}),outlined:O.jsx(O1t,{label:p,ownerState:A}),filled:O.jsx(E1t,{ownerState:A})}[F],U=zn(n,mb(V));return O.jsx(M.Fragment,{children:M.cloneElement(V,{inputComponent:P,inputProps:{children:o,error:R.error,IconComponent:u,variant:F,type:void 0,multiple:v,...y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:m,onClose:b,onOpen:w,open:S,renderValue:_,SelectDisplayProps:{id:f,...E}},...h,classes:h?oa(j,h.classes):j,...d?d.props.inputProps:{}},...(v&&y||c)&&F==="outlined"?{notched:!0}:{},ref:U,className:Re(V.props.className,a,L.root),...!d&&{variant:F},...k})})});Oh.muiName="Select";function T1t(e){return pt("MuiSkeleton",e)}dt("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const P1t=e=>{const{classes:t,variant:n,animation:r,hasChildren:i,width:o,height:s}=e;return Xe({root:["root",n,r,i&&"withChildren",i&&!o&&"fitContent",i&&!s&&"heightAuto"]},T1t,t)},gee=dg` 0% { opacity: 1; } @@ -227,7 +227,7 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s 100% { opacity: 1; } -`,xte=pg` +`,mee=dg` 0% { transform: translateX(-100%); } @@ -240,37 +240,37 @@ export default theme;`}function nte(e={},...t){const{breakpoints:n,mixins:r={},s 100% { transform: translateX(100%); } -`,HSt=typeof bte!="string"?bb` - animation: ${bte} 2s ease-in-out 0.5s infinite; - `:null,GSt=typeof xte!="string"?bb` +`,k1t=typeof gee!="string"?gb` + animation: ${gee} 2s ease-in-out 0.5s infinite; + `:null,M1t=typeof mee!="string"?gb` &::after { - animation: ${xte} 2s linear 0.5s infinite; + animation: ${mee} 2s linear 0.5s infinite; } - `:null,qSt=Oe("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.animation!==!1&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(Mt(({theme:e})=>{const t=Xmt(e.shape.borderRadius)||"px",n=Ymt(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:Bt(e.palette.text.primary,e.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${t}/${Math.round(n/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:r})=>r.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:r})=>r.hasChildren&&!r.width,style:{maxWidth:"fit-content"}},{props:({ownerState:r})=>r.hasChildren&&!r.height,style:{height:"auto"}},{props:{animation:"pulse"},style:HSt||{animation:`${bte} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient( + `:null,A1t=Oe("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.animation!==!1&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(Mt(({theme:e})=>{const t=Rpt(e.shape.borderRadius)||"px",n=Ipt(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:Vt(e.palette.text.primary,e.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${t}/${Math.round(n/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:r})=>r.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:r})=>r.hasChildren&&!r.width,style:{maxWidth:"fit-content"}},{props:({ownerState:r})=>r.hasChildren&&!r.height,style:{height:"auto"}},{props:{animation:"pulse"},style:k1t||{animation:`${gee} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient( 90deg, transparent, ${(e.vars||e).palette.action.hover}, transparent - )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:GSt||{"&::after":{animation:`${xte} 2s linear 0.5s infinite`}}}]}})),XSt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSkeleton"}),{animation:i="pulse",className:o,component:s="span",height:a,style:l,variant:c="text",width:u,...f}=r,d={...r,animation:i,component:s,variant:c,hasChildren:!!f.children},h=WSt(d);return O.jsx(qSt,{as:s,ref:n,className:Re(h.root,o),ownerState:d,...f,style:{width:u,height:a,...l}})});function YSt(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const QSt=2;function m_(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function fBe(e,t){return e-t}function I1e(e,t){const{index:n}=e.reduce((r,i,o)=>{const s=Math.abs(t-i);return r===null||s({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},t_t=e=>e;let T$;function L1e(){return T$===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?T$=CSS.supports("touch-action","none"):T$=!0),T$}function n_t(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=t_t,step:g=1,shiftStep:m=10,tabIndex:v,value:y}=e,b=M.useRef(void 0),[w,S]=M.useState(-1),[_,E]=M.useState(-1),[T,k]=M.useState(!1),P=M.useRef(0),R=M.useRef(null),[I,F]=Fa({controlled:y,default:n??l,name:"Slider"}),A=u&&((ye,be,ge)=>{const xe=ye.nativeEvent||ye,re=new xe.constructor(xe.type,xe);Object.defineProperty(re,"target",{writable:!0,value:{value:be,name:c}}),R.current=be,u(re,be,ge)}),L=Array.isArray(I);let $=L?I.slice().sort(fBe):[I];$=$.map(ye=>ye==null?l:yC(ye,l,a));const j=s===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((ye,be)=>({value:l+g*be})):s||[],V=j.map(ye=>ye.value),[U,z]=M.useState(-1),N=M.useRef(null),B=zn(h,N),H=ye=>be=>{const ge=Number(be.currentTarget.getAttribute("data-index"));H0(be.target)&&z(ge),E(ge),ye?.onFocus?.(be)},Q=ye=>be=>{H0(be.target)||z(-1),E(-1),ye?.onBlur?.(be)},Y=(ye,be)=>{const ge=Number(ye.currentTarget.getAttribute("data-index")),xe=$[ge],re=V.indexOf(xe);let Ee=be;if(j&&g==null){const ke=V[V.length-1];Ee>=ke?Ee=ke:Ee<=V[0]?Ee=V[0]:Ee=Eebe=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(be.key)){be.preventDefault();const ge=Number(be.currentTarget.getAttribute("data-index")),xe=$[ge];let re=null;if(g!=null){const Ee=be.shiftKey?m:g;switch(be.key){case"ArrowUp":re=m_(xe,Ee,1,l,a);break;case"ArrowRight":re=m_(xe,Ee,o?-1:1,l,a);break;case"ArrowDown":re=m_(xe,Ee,-1,l,a);break;case"ArrowLeft":re=m_(xe,Ee,o?1:-1,l,a);break;case"PageUp":re=m_(xe,m,1,l,a);break;case"PageDown":re=m_(xe,m,-1,l,a);break;case"Home":re=l;break;case"End":re=a;break}}else if(j){const Ee=V[V.length-1],ke=V.indexOf(xe),je=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],De=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];je.includes(be.key)?ke===0?re=V[0]:re=V[ke-1]:De.includes(be.key)&&(ke===V.length-1?re=Ee:re=V[ke+1])}re!=null&&Y(be,re)}ye?.onKeyDown?.(be)};ar(()=>{r&&N.current.contains(document.activeElement)&&document.activeElement?.blur()},[r]),r&&w!==-1&&S(-1),r&&U!==-1&&z(-1);const pe=ye=>be=>{ye.onChange?.(be),Y(be,be.target.valueAsNumber)},ie=M.useRef(void 0);let ne=d;o&&d==="horizontal"&&(ne+="-reverse");const fe=({finger:ye,move:be=!1})=>{const{current:ge}=N,{width:xe,height:re,bottom:Ee,left:ke}=ge.getBoundingClientRect();let je;ne.startsWith("vertical")?je=(Ee-ye.y)/re:je=(ye.x-ke)/xe,ne.includes("-reverse")&&(je=1-je);let De;if(De=KSt(je,l,a),g)De=JSt(De,g,l);else{const Je=I1e(V,De);De=V[Je]}De=yC(De,l,a);let ze=0;if(L){be?ze=ie.current:ze=I1e($,De),i&&(De=yC(De,$[ze-1]||-1/0,$[ze+1]||1/0));const Je=De;De=D1e({values:$,newValue:De,index:ze}),i&&be||(ze=De.indexOf(Je),ie.current=ze)}return{newValue:De,activeIndex:ze}},me=ft(ye=>{const be=C$(ye,b);if(!be)return;if(P.current+=1,ye.type==="mousemove"&&ye.buttons===0){se(ye);return}const{newValue:ge,activeIndex:xe}=fe({finger:be,move:!0});O$({sliderRef:N,activeIndex:xe,setActive:S}),F(ge),!T&&P.current>QSt&&k(!0),A&&!E$(ge,I)&&A(ye,ge,xe)}),se=ft(ye=>{const be=C$(ye,b);if(k(!1),!be)return;const{newValue:ge}=fe({finger:be,move:!0});S(-1),ye.type==="touchend"&&E(-1),f&&f(ye,R.current??ge),b.current=void 0,G()}),ue=ft(ye=>{if(r)return;L1e()||ye.preventDefault();const be=ye.changedTouches[0];be!=null&&(b.current=be.identifier);const ge=C$(ye,b);if(ge!==!1){const{newValue:re,activeIndex:Ee}=fe({finger:ge});O$({sliderRef:N,activeIndex:Ee,setActive:S}),F(re),A&&!E$(re,I)&&A(ye,re,Ee)}P.current=0;const xe=ci(N.current);xe.addEventListener("touchmove",me,{passive:!0}),xe.addEventListener("touchend",se,{passive:!0})}),G=M.useCallback(()=>{const ye=ci(N.current);ye.removeEventListener("mousemove",me),ye.removeEventListener("mouseup",se),ye.removeEventListener("touchmove",me),ye.removeEventListener("touchend",se)},[se,me]);M.useEffect(()=>{const{current:ye}=N;return ye.addEventListener("touchstart",ue,{passive:L1e()}),()=>{ye.removeEventListener("touchstart",ue),G()}},[G,ue]),M.useEffect(()=>{r&&G()},[r,G]);const ce=ye=>be=>{if(ye.onMouseDown?.(be),r||be.defaultPrevented||be.button!==0)return;be.preventDefault();const ge=C$(be,b);if(ge!==!1){const{newValue:re,activeIndex:Ee}=fe({finger:ge});O$({sliderRef:N,activeIndex:Ee,setActive:S}),F(re),A&&!E$(re,I)&&A(be,re,Ee)}P.current=0;const xe=ci(N.current);xe.addEventListener("mousemove",me,{passive:!0}),xe.addEventListener("mouseup",se)},he=V5(L?$[0]:l,l,a),J=V5($[$.length-1],l,a)-he,te=(ye={})=>{const be=k1(ye),ge={onMouseDown:ce(be||{})},xe={...be,...ge};return{...ye,ref:B,...xe}},ae=ye=>be=>{ye.onMouseOver?.(be);const ge=Number(be.currentTarget.getAttribute("data-index"));E(ge)},we=ye=>be=>{ye.onMouseLeave?.(be),E(-1)},Pe=(ye={})=>{const be=k1(ye),ge={onMouseOver:ae(be||{}),onMouseLeave:we(be||{})};return{...ye,...be,...ge}},ee=ye=>({pointerEvents:w!==-1&&w!==ye?"none":void 0});let oe;return d==="vertical"&&(oe=o?"vertical-rl":"vertical-lr"),{active:w,axis:ne,axisProps:e_t,dragging:T,focusedThumbIndex:U,getHiddenInputProps:(ye={})=>{const be=k1(ye),ge={onChange:pe(be||{}),onFocus:H(be||{}),onBlur:Q(be||{}),onKeyDown:Z(be||{})},xe={...be,...ge};return{tabIndex:v,"aria-labelledby":t,"aria-orientation":d,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:r,...ye,...xe,style:{...uje,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:oe}}},getRootProps:te,getThumbProps:Pe,marks:j,open:_,range:L,rootRef:B,trackLeap:J,trackOffset:he,values:$,getThumbStyle:ee}}const r_t=e=>!e||!Vm(e);function i_t(e){return pt("MuiSlider",e)}const Sf=dt("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),o_t=e=>{const{open:t}=e;return{offset:Re(t&&Sf.valueLabelOpen),circle:Sf.valueLabelCircle,label:Sf.valueLabelLabel}};function s_t(e){const{children:t,className:n,value:r}=e,i=o_t(e);return t?M.cloneElement(t,{className:Re(t.props.className)},O.jsxs(M.Fragment,{children:[t.props.children,O.jsx("span",{className:Re(i.offset,n),"aria-hidden":!0,children:O.jsx("span",{className:i.circle,children:O.jsx("span",{className:i.label,children:r})})})]})):null}function F1e(e){return e}const a_t=Oe("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Ve(n.color)}`],n.size!=="medium"&&t[`size${Ve(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(Mt(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Sf.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Sf.dragging}`]:{[`& .${Sf.thumb}, & .${Sf.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),l_t=Oe("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),c_t=Oe("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(Mt(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:hh(e.palette[t].main,.62),borderColor:hh(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:dh(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:dh(e.palette[t].main,.5)})}}}))]}))),u_t=Oe("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${Ve(n.color)}`],n.size!=="medium"&&t[`thumbSize${Ve(n.size)}`]]}})(Mt(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Sf.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Sf.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${Bt(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${Sf.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${Bt(e.palette[t].main,.16)}`}}}}))]}))),f_t=Oe(s_t,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(Mt(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Sf.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Sf.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),d_t=Oe("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>K6(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(Mt(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),h_t=Oe("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>K6(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(Mt(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),p_t=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=e,c={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Ve(a)}`,l&&`size${Ve(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Ve(l)}`,a&&`thumbColor${Ve(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Xe(c,i_t,s)},g_t=({children:e})=>e,oS=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSlider"}),i=bi(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:f="primary",classes:d,className:h,disableSwap:p=!1,disabled:g=!1,getAriaLabel:m,getAriaValueText:v,marks:y=!1,max:b=100,min:w=0,name:S,onChange:_,onChangeCommitted:E,orientation:T="horizontal",shiftStep:k=10,size:P="medium",step:R=1,scale:I=F1e,slotProps:F,slots:A,tabIndex:L,track:$="normal",value:j,valueLabelDisplay:V="off",valueLabelFormat:U=F1e,...z}=r,N={...r,isRtl:i,max:b,min:w,classes:d,disabled:g,disableSwap:p,orientation:T,marks:y,color:f,size:P,step:R,shiftStep:k,scale:I,track:$,valueLabelDisplay:V,valueLabelFormat:U},{axisProps:B,getRootProps:H,getHiddenInputProps:Q,getThumbProps:Y,open:Z,active:pe,axis:ie,focusedThumbIndex:ne,range:fe,dragging:me,marks:se,values:ue,trackOffset:G,trackLeap:ce,getThumbStyle:he}=n_t({...N,rootRef:n});N.marked=se.length>0&&se.some(St=>St.label),N.dragging=me,N.focusedThumbIndex=ne;const J=p_t(N),te=A?.root??c.Root??a_t,ae=A?.rail??c.Rail??l_t,we=A?.track??c.Track??c_t,Pe=A?.thumb??c.Thumb??u_t,ee=A?.valueLabel??c.ValueLabel??f_t,oe=A?.mark??c.Mark??d_t,Se=A?.markLabel??c.MarkLabel??h_t,ye=A?.input??c.Input??"input",be=F?.root??u.root,ge=F?.rail??u.rail,xe=F?.track??u.track,re=F?.thumb??u.thumb,Ee=F?.valueLabel??u.valueLabel,ke=F?.mark??u.mark,je=F?.markLabel??u.markLabel,De=F?.input??u.input,ze=Yn({elementType:te,getSlotProps:H,externalSlotProps:be,externalForwardedProps:z,additionalProps:{...r_t(te)&&{as:l}},ownerState:{...N,...be?.ownerState},className:[J.root,h]}),Je=Yn({elementType:ae,externalSlotProps:ge,ownerState:N,className:J.rail}),mt=Yn({elementType:we,externalSlotProps:xe,additionalProps:{style:{...B[ie].offset(G),...B[ie].leap(ce)}},ownerState:{...N,...xe?.ownerState},className:J.track}),Me=Yn({elementType:Pe,getSlotProps:Y,externalSlotProps:re,ownerState:{...N,...re?.ownerState},className:J.thumb}),st=Yn({elementType:ee,externalSlotProps:Ee,ownerState:{...N,...Ee?.ownerState},className:J.valueLabel}),Fe=Yn({elementType:oe,externalSlotProps:ke,ownerState:N,className:J.mark}),ht=Yn({elementType:Se,externalSlotProps:je,ownerState:N,className:J.markLabel}),gt=Yn({elementType:ye,getSlotProps:Q,externalSlotProps:De,ownerState:N});return O.jsxs(te,{...ze,children:[O.jsx(ae,{...Je}),O.jsx(we,{...mt}),se.filter(St=>St.value>=w&&St.value<=b).map((St,on)=>{const Dn=V5(St.value,w,b),wi=B[ie].offset(Dn);let jn;return $===!1?jn=ue.includes(St.value):jn=$==="normal"&&(fe?St.value>=ue[0]&&St.value<=ue[ue.length-1]:St.value<=ue[0])||$==="inverted"&&(fe?St.value<=ue[0]||St.value>=ue[ue.length-1]:St.value>=ue[0]),O.jsxs(M.Fragment,{children:[O.jsx(oe,{"data-index":on,...Fe,...!Vm(oe)&&{markActive:jn},style:{...wi,...Fe.style},className:Re(Fe.className,jn&&J.markActive)}),St.label!=null?O.jsx(Se,{"aria-hidden":!0,"data-index":on,...ht,...!Vm(Se)&&{markLabelActive:jn},style:{...wi,...ht.style},className:Re(J.markLabel,ht.className,jn&&J.markLabelActive),children:St.label}):null]},on)}),ue.map((St,on)=>{const Dn=V5(St,w,b),wi=B[ie].offset(Dn),jn=V==="off"?g_t:ee;return O.jsx(jn,{...!Vm(jn)&&{valueLabelFormat:U,valueLabelDisplay:V,value:typeof U=="function"?U(I(St),on):U,index:on,open:Z===on||pe===on||V==="on",disabled:g},...st,children:O.jsx(Pe,{"data-index":on,...Me,className:Re(J.thumb,Me.className,pe===on&&J.active,ne===on&&J.focusVisible),style:{...wi,...he(on),...Me.style},children:O.jsx(ye,{"data-index":on,"aria-label":m?m(on):o,"aria-valuenow":I(St),"aria-labelledby":a,"aria-valuetext":v?v(I(St),on):s,value:ue[on],...gt})})},on)})]})});function m_t(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,s=jl();M.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||y.key==="Escape"&&r?.(y,"escapeKeyDown")}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const a=ft((v,y)=>{r?.(v,y)}),l=ft(v=>{!r||v==null||s.start(v,()=>{a(null,"timeout")})});M.useEffect(()=>(i&&l(t),s.clear),[i,t,l,s]);const c=v=>{r?.(v,"clickaway")},u=s.clear,f=M.useCallback(()=>{t!=null&&l(o??t*.5)},[t,o,l]),d=v=>y=>{const b=v.onBlur;b?.(y),f()},h=v=>y=>{const b=v.onFocus;b?.(y),u()},p=v=>y=>{const b=v.onMouseEnter;b?.(y),u()},g=v=>y=>{const b=v.onMouseLeave;b?.(y),f()};return M.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(v={})=>{const y={...k1(e),...k1(v)};return{role:"presentation",...v,...y,onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:g(y)}},onClickAway:c}}function v_t(e){return pt("MuiSnackbarContent",e)}dt("MuiSnackbarContent",["root","message","action"]);const y_t=e=>{const{classes:t}=e;return Xe({root:["root"],action:["action"],message:["message"]},v_t,t)},b_t=Oe(fa,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(e,t)=>t.root})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98,n=aje(e.palette.background.default,t);return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(n),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),x_t=Oe("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0"}),w_t=Oe("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),dBe=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...l}=r,c=r,u=y_t(c);return O.jsxs(b_t,{role:a,square:!0,elevation:6,className:Re(u.root,o),ownerState:c,ref:n,...l,children:[O.jsx(x_t,{className:u.message,ownerState:c,children:s}),i?O.jsx(w_t,{className:u.action,ownerState:c,children:i}):null]})});function S_t(e){return pt("MuiSnackbar",e)}dt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const __t=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Ve(n.vertical)}${Ve(n.horizontal)}`]};return Xe(r,S_t,t)},C_t=Oe("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Ve(n.anchorOrigin.vertical)}${Ve(n.anchorOrigin.horizontal)}`]]}})(Mt(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),O_t=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSnackbar"}),i=is(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:g,onBlur:m,onClose:v,onFocus:y,onMouseEnter:b,onMouseLeave:w,open:S,resumeHideDuration:_,slots:E={},slotProps:T={},TransitionComponent:k,transitionDuration:P=o,TransitionProps:{onEnter:R,onExited:I,...F}={},...A}=r,L={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:k,transitionDuration:P},$=__t(L),{getRootProps:j,onClickAway:V}=m_t({...L}),[U,z]=M.useState(!0),N=ue=>{z(!0),I&&I(ue)},B=(ue,G)=>{z(!1),R&&R(ue,G)},H={slots:{transition:k,...E},slotProps:{content:h,clickAwayListener:d,transition:F,...T}},[Q,Y]=Zt("root",{ref:n,className:[$.root,f],elementType:C_t,getSlotProps:j,externalForwardedProps:{...H,...A},ownerState:L}),[Z,{ownerState:pe,...ie}]=Zt("clickAwayListener",{elementType:ole,externalForwardedProps:H,getSlotProps:ue=>({onClickAway:(...G)=>{ue.onClickAway?.(...G),V(...G)}}),ownerState:L}),[ne,fe]=Zt("content",{elementType:dBe,shouldForwardComponentProp:!0,externalForwardedProps:H,additionalProps:{message:g,action:s},ownerState:L}),[me,se]=Zt("transition",{elementType:ow,externalForwardedProps:H,getSlotProps:ue=>({onEnter:(...G)=>{ue.onEnter?.(...G),B(...G)},onExited:(...G)=>{ue.onExited?.(...G),N(...G)}}),additionalProps:{appear:!0,in:S,timeout:P,direction:a==="top"?"down":"up"},ownerState:L});return!S&&U?null:O.jsx(Z,{...ie,...E.clickAwayListener&&{ownerState:pe},children:O.jsx(Q,{...Y,children:O.jsx(me,{...se,children:u||O.jsx(ne,{...fe})})})})});function E_t(e){return pt("MuiTooltip",e)}const Fo=dt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function T_t(e){return Math.round(e*1e5)/1e5}const P_t=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${Ve(o.split("-")[0])}`],arrow:["arrow"]};return Xe(s,E_t,t)},k_t=Oe(Sb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(Mt(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${Fo.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Fo.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Fo.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Fo.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Fo.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Fo.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Fo.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Fo.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),M_t=Oe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${Ve(n.placement.split("-")[0])}`]]}})(Mt(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Bt(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Fo.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Fo.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Fo.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${T_t(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Fo.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Fo.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Fo.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Fo.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Fo.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Fo.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),A_t=Oe("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(Mt(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Bt(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let P$=!1;const $1e=new X6;let Tk={x:0,y:0};function k$(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const _n=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:s,components:a={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:f=!1,disableInteractive:d=!1,disableTouchListener:h=!1,enterDelay:p=100,enterNextDelay:g=0,enterTouchDelay:m=700,followCursor:v=!1,id:y,leaveDelay:b=0,leaveTouchDelay:w=1500,onClose:S,onOpen:_,open:E,placement:T="bottom",PopperComponent:k,PopperProps:P={},slotProps:R={},slots:I={},title:F,TransitionComponent:A,TransitionProps:L,...$}=r,j=M.isValidElement(o)?o:O.jsx("span",{children:o}),V=is(),U=bi(),[z,N]=M.useState(),[B,H]=M.useState(null),Q=M.useRef(!1),Y=d||v,Z=jl(),pe=jl(),ie=jl(),ne=jl(),[fe,me]=Fa({controlled:E,default:!1,name:"Tooltip",state:"open"});let se=fe;const ue=ur(y),G=M.useRef(),ce=ft(()=>{G.current!==void 0&&(document.body.style.WebkitUserSelect=G.current,G.current=void 0),ne.clear()});M.useEffect(()=>ce,[ce]);const he=sn=>{$1e.clear(),P$=!0,me(!0),_&&!se&&_(sn)},J=ft(sn=>{$1e.start(800+b,()=>{P$=!1}),me(!1),S&&se&&S(sn),Z.start(V.transitions.duration.shortest,()=>{Q.current=!1})}),te=sn=>{Q.current&&sn.type!=="touchstart"||(z&&z.removeAttribute("title"),pe.clear(),ie.clear(),p||P$&&g?pe.start(P$?g:p,()=>{he(sn)}):he(sn))},ae=sn=>{pe.clear(),ie.start(b,()=>{J(sn)})},[,we]=M.useState(!1),Pe=sn=>{H0(sn.target)||(we(!1),ae(sn))},ee=sn=>{z||N(sn.currentTarget),H0(sn.target)&&(we(!0),te(sn))},oe=sn=>{Q.current=!0;const br=j.props;br.onTouchStart&&br.onTouchStart(sn)},Se=sn=>{oe(sn),ie.clear(),Z.clear(),ce(),G.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ne.start(m,()=>{document.body.style.WebkitUserSelect=G.current,te(sn)})},ye=sn=>{j.props.onTouchEnd&&j.props.onTouchEnd(sn),ce(),ie.start(w,()=>{J(sn)})};M.useEffect(()=>{if(!se)return;function sn(br){br.key==="Escape"&&J(br)}return document.addEventListener("keydown",sn),()=>{document.removeEventListener("keydown",sn)}},[J,se]);const be=zn(xb(j),N,n);!F&&F!==0&&(se=!1);const ge=M.useRef(),xe=sn=>{const br=j.props;br.onMouseMove&&br.onMouseMove(sn),Tk={x:sn.clientX,y:sn.clientY},ge.current&&ge.current.update()},re={},Ee=typeof F=="string";c?(re.title=!se&&Ee&&!f?F:null,re["aria-describedby"]=se?ue:null):(re["aria-label"]=Ee?F:null,re["aria-labelledby"]=se&&!Ee?ue:null);const ke={...re,...$,...j.props,className:Re($.className,j.props.className),onTouchStart:oe,ref:be,...v?{onMouseMove:xe}:{}},je={};h||(ke.onTouchStart=Se,ke.onTouchEnd=ye),f||(ke.onMouseOver=k$(te,ke.onMouseOver),ke.onMouseLeave=k$(ae,ke.onMouseLeave),Y||(je.onMouseOver=te,je.onMouseLeave=ae)),u||(ke.onFocus=k$(ee,ke.onFocus),ke.onBlur=k$(Pe,ke.onBlur),Y||(je.onFocus=ee,je.onBlur=Pe));const De={...r,isRtl:U,arrow:i,disableInteractive:Y,placement:T,PopperComponentProp:k,touch:Q.current},ze=typeof R.popper=="function"?R.popper(De):R.popper,Je=M.useMemo(()=>{let sn=[{name:"arrow",enabled:!!B,options:{element:B,padding:4}}];return P.popperOptions?.modifiers&&(sn=sn.concat(P.popperOptions.modifiers)),ze?.popperOptions?.modifiers&&(sn=sn.concat(ze.popperOptions.modifiers)),{...P.popperOptions,...ze?.popperOptions,modifiers:sn}},[B,P.popperOptions,ze?.popperOptions]),mt=P_t(De),Me=typeof R.transition=="function"?R.transition(De):R.transition,st={slots:{popper:a.Popper,transition:a.Transition??A,tooltip:a.Tooltip,arrow:a.Arrow,...I},slotProps:{arrow:R.arrow??l.arrow,popper:{...P,...ze??l.popper},tooltip:R.tooltip??l.tooltip,transition:{...L,...Me??l.transition}}},[Fe,ht]=Zt("popper",{elementType:k_t,externalForwardedProps:st,ownerState:De,className:Re(mt.popper,P?.className)}),[gt,St]=Zt("transition",{elementType:ow,externalForwardedProps:st,ownerState:De}),[on,Dn]=Zt("tooltip",{elementType:M_t,className:mt.tooltip,externalForwardedProps:st,ownerState:De}),[wi,jn]=Zt("arrow",{elementType:A_t,className:mt.arrow,externalForwardedProps:st,ownerState:De,ref:H});return O.jsxs(M.Fragment,{children:[M.cloneElement(j,ke),O.jsx(Fe,{as:k??Sb,placement:T,anchorEl:v?{getBoundingClientRect:()=>({top:Tk.y,left:Tk.x,right:Tk.x,bottom:Tk.y,width:0,height:0})}:z,popperRef:ge,open:z?se:!1,id:ue,transition:!0,...je,...ht,popperOptions:Je,children:({TransitionProps:sn})=>O.jsx(gt,{timeout:V.transitions.duration.shorter,...sn,...St,children:O.jsxs(on,{...Dn,children:[F,i?O.jsx(wi,{...jn}):null]})})})]})});function R_t(e){return pt("MuiSwitch",e)}const Pl=dt("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),I_t=e=>{const{classes:t,edge:n,size:r,color:i,checked:o,disabled:s}=e,a={root:["root",n&&`edge${Ve(n)}`,`size${Ve(r)}`],switchBase:["switchBase",`color${Ve(i)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Xe(a,R_t,t);return{...t,...l}},D_t=Oe("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Ve(n.edge)}`],t[`size${Ve(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Pl.thumb}`]:{width:16,height:16},[`& .${Pl.switchBase}`]:{padding:4,[`&.${Pl.checked}`]:{transform:"translateX(16px)"}}}}]}),L_t=Oe(ile,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${Pl.input}`]:t.input},n.color!=="default"&&t[`color${Ve(n.color)}`]]}})(Mt(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${Pl.checked}`]:{transform:"translateX(20px)"},[`&.${Pl.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${Pl.checked} + .${Pl.track}`]:{opacity:.5},[`&.${Pl.disabled} + .${Pl.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${Pl.input}`]:{left:"-100%",width:"300%"}})),Mt(({theme:e})=>({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(ai(["light"])).map(([t])=>({props:{color:t},style:{[`&.${Pl.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette[t].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Pl.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?hh(e.palette[t].main,.62):dh(e.palette[t].main,.55)}`}},[`&.${Pl.checked} + .${Pl.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),F_t=Oe("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})(Mt(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),$_t=Oe("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(Mt(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),gle=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSwitch"}),{className:i,color:o="primary",edge:s=!1,size:a="medium",sx:l,slots:c={},slotProps:u={},...f}=r,d={...r,color:o,edge:s,size:a},h=I_t(d),p={slots:c,slotProps:u},[g,m]=Zt("root",{className:Re(h.root,i),elementType:D_t,externalForwardedProps:p,ownerState:d,additionalProps:{sx:l}}),[v,y]=Zt("thumb",{className:h.thumb,elementType:$_t,externalForwardedProps:p,ownerState:d}),b=O.jsx(v,{...y}),[w,S]=Zt("track",{className:h.track,elementType:F_t,externalForwardedProps:p,ownerState:d});return O.jsxs(g,{...m,children:[O.jsx(L_t,{type:"checkbox",icon:b,checkedIcon:b,ref:n,ownerState:d,...f,classes:{...h,root:h.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...u.switchBase&&{root:typeof u.switchBase=="function"?u.switchBase(d):u.switchBase},...u.input&&{input:typeof u.input=="function"?u.input(d):u.input}}}),O.jsx(w,{...S})]})});function N_t(e){return pt("MuiTab",e)}const ef=dt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),z_t=e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:o,label:s,selected:a,disabled:l}=e,c={root:["root",o&&s&&"labelIcon",`textColor${Ve(n)}`,r&&"fullWidth",i&&"wrapped",a&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return Xe(c,N_t,t)},j_t=Oe(Gf,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${Ve(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${ef.iconWrapper}`]:t.iconWrapper},{[`& .${ef.icon}`]:t.icon}]}})(Mt(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="top",style:{[`& > .${ef.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="bottom",style:{[`& > .${ef.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="start",style:{[`& > .${ef.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="end",style:{[`& > .${ef.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${ef.selected}`]:{opacity:1},[`&.${ef.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${ef.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${ef.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${ef.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${ef.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),zA=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:s=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:g,selectionFollowsFocus:m,textColor:v="inherit",value:y,wrapped:b=!1,...w}=r,S={...r,disabled:o,disableFocusRipple:s,selected:g,icon:!!l,iconPosition:c,label:!!f,fullWidth:a,textColor:v,wrapped:b},_=z_t(S),E=l&&f&&M.isValidElement(l)?M.cloneElement(l,{className:Re(_.icon,l.props.className)}):l,T=P=>{!g&&d&&d(P,y),h&&h(P)},k=P=>{m&&!g&&d&&d(P,y),p&&p(P)};return O.jsxs(j_t,{focusRipple:!s,className:Re(_.root,i),ref:n,role:"tab","aria-selected":g,disabled:o,onClick:T,onFocus:k,ownerState:S,tabIndex:g?0:-1,...w,children:[c==="top"||c==="start"?O.jsxs(M.Fragment,{children:[E,f]}):O.jsxs(M.Fragment,{children:[f,E]}),u]})}),hBe=M.createContext();function B_t(e){return pt("MuiTable",e)}dt("MuiTable",["root","stickyHeader"]);const U_t=e=>{const{classes:t,stickyHeader:n}=e;return Xe({root:["root",n&&"stickyHeader"]},B_t,t)},V_t=Oe("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(Mt(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),N1e="table",sU=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTable"}),{className:i,component:o=N1e,padding:s="normal",size:a="medium",stickyHeader:l=!1,...c}=r,u={...r,component:o,padding:s,size:a,stickyHeader:l},f=U_t(u),d=M.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return O.jsx(hBe.Provider,{value:d,children:O.jsx(V_t,{as:o,role:o===N1e?null:"table",ref:n,className:Re(f.root,i),ownerState:u,...c})})}),aU=M.createContext();function W_t(e){return pt("MuiTableBody",e)}dt("MuiTableBody",["root"]);const H_t=e=>{const{classes:t}=e;return Xe({root:["root"]},W_t,t)},G_t=Oe("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),q_t={variant:"body"},z1e="tbody",lU=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableBody"}),{className:i,component:o=z1e,...s}=r,a={...r,component:o},l=H_t(a);return O.jsx(aU.Provider,{value:q_t,children:O.jsx(G_t,{className:Re(l.root,i),as:o,ref:n,role:o===z1e?null:"rowgroup",ownerState:a,...s})})});function X_t(e){return pt("MuiTableCell",e)}const Y_t=dt("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Q_t=e=>{const{classes:t,variant:n,align:r,padding:i,size:o,stickyHeader:s}=e,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${Ve(r)}`,i!=="normal"&&`padding${Ve(i)}`,`size${Ve(o)}`]};return Xe(a,X_t,t)},K_t=Oe("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Ve(n.size)}`],n.padding!=="normal"&&t[`padding${Ve(n.padding)}`],n.align!=="inherit"&&t[`align${Ve(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(Mt(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid - ${e.palette.mode==="light"?hh(Bt(e.palette.divider,1),.88):dh(Bt(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Y_t.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),mi=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:c,sortDirection:u,variant:f,...d}=r,h=M.useContext(hBe),p=M.useContext(aU),g=p&&p.variant==="head";let m;s?m=s:m=g?"th":"td";let v=l;m==="td"?v=void 0:!v&&g&&(v="col");const y=f||p&&p.variant,b={...r,align:i,component:m,padding:a||(h&&h.padding?h.padding:"normal"),size:c||(h&&h.size?h.size:"medium"),sortDirection:u,stickyHeader:y==="head"&&h&&h.stickyHeader,variant:y},w=Q_t(b);let S=null;return u&&(S=u==="asc"?"ascending":"descending"),O.jsx(K_t,{as:m,ref:n,className:Re(w.root,o),"aria-sort":S,scope:v,ownerState:b,...d})});function Z_t(e){return pt("MuiTableContainer",e)}dt("MuiTableContainer",["root"]);const J_t=e=>{const{classes:t}=e;return Xe({root:["root"]},Z_t,t)},eCt=Oe("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),mle=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableContainer"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=J_t(a);return O.jsx(eCt,{ref:n,as:o,className:Re(l.root,i),ownerState:a,...s})});function tCt(e){return pt("MuiTableHead",e)}dt("MuiTableHead",["root"]);const nCt=e=>{const{classes:t}=e;return Xe({root:["root"]},tCt,t)},rCt=Oe("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),iCt={variant:"head"},j1e="thead",pBe=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableHead"}),{className:i,component:o=j1e,...s}=r,a={...r,component:o},l=nCt(a);return O.jsx(aU.Provider,{value:iCt,children:O.jsx(rCt,{as:o,className:Re(l.root,i),ref:n,role:o===j1e?null:"rowgroup",ownerState:a,...s})})});function oCt(e){return pt("MuiToolbar",e)}dt("MuiToolbar",["root","gutters","regular","dense"]);const sCt=e=>{const{classes:t,disableGutters:n,variant:r}=e;return Xe({root:["root",!n&&"gutters",r]},oCt,t)},aCt=Oe("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Mt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),nD=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=sCt(c);return O.jsx(aCt,{as:o,className:Re(u.root,i),ref:n,ownerState:c,...l})}),gBe=ot(O.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),mBe=ot(O.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),lCt=M.forwardRef(function(t,n){const{backIconButtonProps:r,count:i,disabled:o=!1,getItemAriaLabel:s,nextIconButtonProps:a,onPageChange:l,page:c,rowsPerPage:u,showFirstButton:f,showLastButton:d,slots:h={},slotProps:p={},...g}=t,m=bi(),v=N=>{l(N,0)},y=N=>{l(N,c-1)},b=N=>{l(N,c+1)},w=N=>{l(N,Math.max(0,Math.ceil(i/u)-1))},S=h.firstButton??Mn,_=h.lastButton??Mn,E=h.nextButton??Mn,T=h.previousButton??Mn,k=h.firstButtonIcon??vSt,P=h.lastButtonIcon??ySt,R=h.nextButtonIcon??mBe,I=h.previousButtonIcon??gBe,F=m?_:S,A=m?E:T,L=m?T:E,$=m?S:_,j=m?p.lastButton:p.firstButton,V=m?p.nextButton:p.previousButton,U=m?p.previousButton:p.nextButton,z=m?p.firstButton:p.lastButton;return O.jsxs("div",{ref:n,...g,children:[f&&O.jsx(F,{onClick:v,disabled:o||c===0,"aria-label":s("first",c),title:s("first",c),...j,children:m?O.jsx(P,{...p.lastButtonIcon}):O.jsx(k,{...p.firstButtonIcon})}),O.jsx(A,{onClick:y,disabled:o||c===0,color:"inherit","aria-label":s("previous",c),title:s("previous",c),...V??r,children:m?O.jsx(R,{...p.nextButtonIcon}):O.jsx(I,{...p.previousButtonIcon})}),O.jsx(L,{onClick:b,disabled:o||(i!==-1?c>=Math.ceil(i/u)-1:!1),color:"inherit","aria-label":s("next",c),title:s("next",c),...U??a,children:m?O.jsx(I,{...p.previousButtonIcon}):O.jsx(R,{...p.nextButtonIcon})}),d&&O.jsx($,{onClick:w,disabled:o||c>=Math.ceil(i/u)-1,"aria-label":s("last",c),title:s("last",c),...z,children:m?O.jsx(k,{...p.firstButtonIcon}):O.jsx(P,{...p.lastButtonIcon})})]})});function cCt(e){return pt("MuiTablePagination",e)}const A1=dt("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var B1e;const uCt=Oe(mi,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})(Mt(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),fCt=Oe(nD,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${A1.actions}`]:t.actions,...t.toolbar})})(Mt(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${A1.actions}`]:{flexShrink:0,marginLeft:20}}))),dCt=Oe("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),hCt=Oe("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})(Mt(({theme:e})=>({...e.typography.body2,flexShrink:0}))),pCt=Oe(Th,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${A1.selectIcon}`]:t.selectIcon,[`& .${A1.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${A1.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),gCt=Oe(tr,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),mCt=Oe("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})(Mt(({theme:e})=>({...e.typography.body2,flexShrink:0})));function vCt({from:e,to:t,count:n}){return`${e}–${t} of ${n!==-1?n:`more than ${t}`}`}function yCt(e){return`Go to ${e} page`}const bCt=e=>{const{classes:t}=e;return Xe({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},cCt,t)},xCt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTablePagination"}),{ActionsComponent:i=lCt,backIconButtonProps:o,colSpan:s,component:a=mi,count:l,disabled:c=!1,getItemAriaLabel:u=yCt,labelDisplayedRows:f=vCt,labelRowsPerPage:d="Rows per page:",nextIconButtonProps:h,onPageChange:p,onRowsPerPageChange:g,page:m,rowsPerPage:v,rowsPerPageOptions:y=[10,25,50,100],SelectProps:b={},showFirstButton:w=!1,showLastButton:S=!1,slotProps:_={},slots:E={},...T}=r,k=r,P=bCt(k),R=_?.select??b,I=R.native?"option":gCt;let F;(a===mi||a==="td")&&(F=s||1e3);const A=ur(R.id),L=ur(R.labelId),$=()=>l===-1?(m+1)*v:v===-1?l:Math.min(l,(m+1)*v),j={slots:E,slotProps:_},[V,U]=Zt("root",{ref:n,className:P.root,elementType:uCt,externalForwardedProps:{...j,component:a,...T},ownerState:k,additionalProps:{colSpan:F}}),[z,N]=Zt("toolbar",{className:P.toolbar,elementType:fCt,externalForwardedProps:j,ownerState:k}),[B,H]=Zt("spacer",{className:P.spacer,elementType:dCt,externalForwardedProps:j,ownerState:k}),[Q,Y]=Zt("selectLabel",{className:P.selectLabel,elementType:hCt,externalForwardedProps:j,ownerState:k,additionalProps:{id:L}}),[Z,pe]=Zt("select",{className:P.select,elementType:pCt,externalForwardedProps:j,ownerState:k}),[ie,ne]=Zt("menuItem",{className:P.menuItem,elementType:I,externalForwardedProps:j,ownerState:k}),[fe,me]=Zt("displayedRows",{className:P.displayedRows,elementType:mCt,externalForwardedProps:j,ownerState:k});return O.jsx(V,{...U,children:O.jsxs(z,{...N,children:[O.jsx(B,{...H}),y.length>1&&O.jsx(Q,{...Y,children:d}),y.length>1&&O.jsx(Z,{variant:"standard",...!R.variant&&{input:B1e||(B1e=O.jsx(wT,{}))},value:v,onChange:g,id:A,labelId:L,...R,classes:{...R.classes,root:Re(P.input,P.selectRoot,(R.classes||{}).root),select:Re(P.select,(R.classes||{}).select),icon:Re(P.selectIcon,(R.classes||{}).icon)},disabled:c,...pe,children:y.map(se=>M.createElement(ie,{...ne,key:se.label?se.label:se,value:se.value?se.value:se},se.label?se.label:se))}),O.jsx(fe,{...me,children:f({from:l===0?0:m*v+1,to:$(),count:l===-1?-1:l,page:m})}),O.jsx(i,{className:P.actions,backIconButtonProps:o,count:l,nextIconButtonProps:h,onPageChange:p,page:m,rowsPerPage:v,showFirstButton:w,showLastButton:S,slotProps:_.actions,slots:E.actions,getItemAriaLabel:u,disabled:c})]})})});function wCt(e){return pt("MuiTableRow",e)}const U1e=dt("MuiTableRow",["root","selected","hover","head","footer"]),SCt=e=>{const{classes:t,selected:n,hover:r,head:i,footer:o}=e;return Xe({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},wCt,t)},_Ct=Oe("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(Mt(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${U1e.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${U1e.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Bt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}}))),V1e="tr",pf=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableRow"}),{className:i,component:o=V1e,hover:s=!1,selected:a=!1,...l}=r,c=M.useContext(aU),u={...r,component:o,hover:s,selected:a,head:c&&c.variant==="head",footer:c&&c.variant==="footer"},f=SCt(u);return O.jsx(_Ct,{as:o,ref:n,className:Re(f.root,i),role:o===V1e?null:"row",ownerState:u,...l})});function CCt(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function OCt(e,t,n,r={},i=()=>{}){const{ease:o=CCt,duration:s=300}=r;let a=null;const l=t[e];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}a===null&&(a=d);const h=Math.min(1,(d-a)/s);if(t[e]=o(h)*(n-l)+l,h>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const ECt={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function TCt(e){const{onChange:t,...n}=e,r=M.useRef(),i=M.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return ar(()=>{const s=QI(()=>{const l=r.current;o(),l!==r.current&&t(r.current)}),a=$c(i.current);return a.addEventListener("resize",s),()=>{s.clear(),a.removeEventListener("resize",s)}},[t]),M.useEffect(()=>{o(),t(r.current)},[t]),O.jsx("div",{style:ECt,...n,ref:i})}function PCt(e){return pt("MuiTabScrollButton",e)}const kCt=dt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),MCt=e=>{const{classes:t,orientation:n,disabled:r}=e;return Xe({root:["root",n,r&&"disabled"]},PCt,t)},ACt=Oe(Gf,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${kCt.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),RCt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTabScrollButton"}),{className:i,slots:o={},slotProps:s={},direction:a,orientation:l,disabled:c,...u}=r,f=bi(),d={isRtl:f,...r},h=MCt(d),p=o.StartScrollButtonIcon??gBe,g=o.EndScrollButtonIcon??mBe,m=Yn({elementType:p,externalSlotProps:s.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=Yn({elementType:g,externalSlotProps:s.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return O.jsx(ACt,{component:"div",className:Re(h.root,i),ref:n,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${f?-90:90}deg)`}},children:a==="left"?O.jsx(p,{...m}):O.jsx(g,{...v})})});function ICt(e){return pt("MuiTabs",e)}const kz=dt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),W1e=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,H1e=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,M$=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(e,i);else{i.focus();return}}},DCt=e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:s,scrollButtonsHideMobile:a,classes:l}=e;return Xe({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",a&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},ICt,l)},LCt=Oe("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${kz.scrollButtons}`]:t.scrollButtons},{[`& .${kz.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(Mt(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${kz.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),FCt=Oe("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),$Ct=Oe("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),NCt=Oe("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(Mt(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),zCt=Oe(TCt)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),G1e={},vle=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTabs"}),i=is(),o=bi(),{"aria-label":s,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:g,orientation:m="horizontal",ScrollButtonComponent:v,scrollButtons:y="auto",selectionFollowsFocus:b,slots:w={},slotProps:S={},TabIndicatorProps:_={},TabScrollButtonProps:E={},textColor:T="primary",value:k,variant:P="standard",visibleScrollbar:R=!1,...I}=r,F=P==="scrollable",A=m==="vertical",L=A?"scrollTop":"scrollLeft",$=A?"top":"left",j=A?"bottom":"right",V=A?"clientHeight":"clientWidth",U=A?"height":"width",z={...r,component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:m,vertical:A,scrollButtons:y,textColor:T,variant:P,visibleScrollbar:R,fixed:!F,hideScrollbar:F&&!R,scrollableX:F&&!A,scrollableY:F&&A,centered:c&&!F,scrollButtonsHideMobile:!h},N=DCt(z),B=Yn({elementType:w.StartScrollButtonIcon,externalSlotProps:S.startScrollButtonIcon,ownerState:z}),H=Yn({elementType:w.EndScrollButtonIcon,externalSlotProps:S.endScrollButtonIcon,ownerState:z}),[Q,Y]=M.useState(!1),[Z,pe]=M.useState(G1e),[ie,ne]=M.useState(!1),[fe,me]=M.useState(!1),[se,ue]=M.useState(!1),[G,ce]=M.useState({overflow:"hidden",scrollbarWidth:0}),he=new Map,J=M.useRef(null),te=M.useRef(null),ae={slots:w,slotProps:{indicator:_,scrollButton:E,...S}},we=()=>{const $t=J.current;let Ut;if($t){const Nn=$t.getBoundingClientRect();Ut={clientWidth:$t.clientWidth,scrollLeft:$t.scrollLeft,scrollTop:$t.scrollTop,scrollWidth:$t.scrollWidth,top:Nn.top,bottom:Nn.bottom,left:Nn.left,right:Nn.right}}let Wn;if($t&&k!==!1){const Nn=te.current.children;if(Nn.length>0){const fi=Nn[he.get(k)];Wn=fi?fi.getBoundingClientRect():null}}return{tabsMeta:Ut,tabMeta:Wn}},Pe=ft(()=>{const{tabsMeta:$t,tabMeta:Ut}=we();let Wn=0,Nn;A?(Nn="top",Ut&&$t&&(Wn=Ut.top-$t.top+$t.scrollTop)):(Nn=o?"right":"left",Ut&&$t&&(Wn=(o?-1:1)*(Ut[Nn]-$t[Nn]+$t.scrollLeft)));const fi={[Nn]:Wn,[U]:Ut?Ut[U]:0};if(typeof Z[Nn]!="number"||typeof Z[U]!="number")pe(fi);else{const po=Math.abs(Z[Nn]-fi[Nn]),_e=Math.abs(Z[U]-fi[U]);(po>=1||_e>=1)&&pe(fi)}}),ee=($t,{animation:Ut=!0}={})=>{Ut?OCt(L,J.current,$t,{duration:i.transitions.duration.standard}):J.current[L]=$t},oe=$t=>{let Ut=J.current[L];A?Ut+=$t:Ut+=$t*(o?-1:1),ee(Ut)},Se=()=>{const $t=J.current[V];let Ut=0;const Wn=Array.from(te.current.children);for(let Nn=0;Nn$t){Nn===0&&(Ut=$t);break}Ut+=fi[V]}return Ut},ye=()=>{oe(-1*Se())},be=()=>{oe(Se())},[ge,{onChange:xe,...re}]=Zt("scrollbar",{className:Re(N.scrollableX,N.hideScrollbar),elementType:zCt,shouldForwardComponentProp:!0,externalForwardedProps:ae,ownerState:z}),Ee=M.useCallback($t=>{xe?.($t),ce({overflow:null,scrollbarWidth:$t})},[xe]),[ke,je]=Zt("scrollButtons",{className:Re(N.scrollButtons,E.className),elementType:RCt,externalForwardedProps:ae,ownerState:z,additionalProps:{orientation:m,slots:{StartScrollButtonIcon:w.startScrollButtonIcon||w.StartScrollButtonIcon,EndScrollButtonIcon:w.endScrollButtonIcon||w.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:B,endScrollButtonIcon:H}}}),De=()=>{const $t={};$t.scrollbarSizeListener=F?O.jsx(ge,{...re,onChange:Ee}):null;const Wn=F&&(y==="auto"&&(ie||fe)||y===!0);return $t.scrollButtonStart=Wn?O.jsx(ke,{direction:o?"right":"left",onClick:ye,disabled:!ie,...je}):null,$t.scrollButtonEnd=Wn?O.jsx(ke,{direction:o?"left":"right",onClick:be,disabled:!fe,...je}):null,$t},ze=ft($t=>{const{tabsMeta:Ut,tabMeta:Wn}=we();if(!(!Wn||!Ut)){if(Wn[$]Ut[j]){const Nn=Ut[L]+(Wn[j]-Ut[j]);ee(Nn,{animation:$t})}}}),Je=ft(()=>{F&&y!==!1&&ue(!se)});M.useEffect(()=>{const $t=QI(()=>{J.current&&Pe()});let Ut;const Wn=po=>{po.forEach(_e=>{_e.removedNodes.forEach(Ue=>{Ut?.unobserve(Ue)}),_e.addedNodes.forEach(Ue=>{Ut?.observe(Ue)})}),$t(),Je()},Nn=$c(J.current);Nn.addEventListener("resize",$t);let fi;return typeof ResizeObserver<"u"&&(Ut=new ResizeObserver($t),Array.from(te.current.children).forEach(po=>{Ut.observe(po)})),typeof MutationObserver<"u"&&(fi=new MutationObserver(Wn),fi.observe(te.current,{childList:!0})),()=>{$t.clear(),Nn.removeEventListener("resize",$t),fi?.disconnect(),Ut?.disconnect()}},[Pe,Je]),M.useEffect(()=>{const $t=Array.from(te.current.children),Ut=$t.length;if(typeof IntersectionObserver<"u"&&Ut>0&&F&&y!==!1){const Wn=$t[0],Nn=$t[Ut-1],fi={root:J.current,threshold:.99},po=$e=>{ne(!$e[0].isIntersecting)},_e=new IntersectionObserver(po,fi);_e.observe(Wn);const Ue=$e=>{me(!$e[0].isIntersecting)},Qe=new IntersectionObserver(Ue,fi);return Qe.observe(Nn),()=>{_e.disconnect(),Qe.disconnect()}}},[F,y,se,u?.length]),M.useEffect(()=>{Y(!0)},[]),M.useEffect(()=>{Pe()}),M.useEffect(()=>{ze(G1e!==Z)},[ze,Z]),M.useImperativeHandle(l,()=>({updateIndicator:Pe,updateScrollButtons:Je}),[Pe,Je]);const[mt,Me]=Zt("indicator",{className:Re(N.indicator,_.className),elementType:NCt,externalForwardedProps:ae,ownerState:z,additionalProps:{style:Z}}),st=O.jsx(mt,{...Me});let Fe=0;const ht=M.Children.map(u,$t=>{if(!M.isValidElement($t))return null;const Ut=$t.props.value===void 0?Fe:$t.props.value;he.set(Ut,Fe);const Wn=Ut===k;return Fe+=1,M.cloneElement($t,{fullWidth:P==="fullWidth",indicator:Wn&&!Q&&st,selected:Wn,selectionFollowsFocus:b,onChange:g,textColor:T,value:Ut,...Fe===1&&k===!1&&!$t.props.tabIndex?{tabIndex:0}:{}})}),gt=$t=>{if($t.altKey||$t.shiftKey||$t.ctrlKey||$t.metaKey)return;const Ut=te.current,Wn=ci(Ut).activeElement;if(Wn.getAttribute("role")!=="tab")return;let fi=m==="horizontal"?"ArrowLeft":"ArrowUp",po=m==="horizontal"?"ArrowRight":"ArrowDown";switch(m==="horizontal"&&o&&(fi="ArrowRight",po="ArrowLeft"),$t.key){case fi:$t.preventDefault(),M$(Ut,Wn,H1e);break;case po:$t.preventDefault(),M$(Ut,Wn,W1e);break;case"Home":$t.preventDefault(),M$(Ut,null,W1e);break;case"End":$t.preventDefault(),M$(Ut,null,H1e);break}},St=De(),[on,Dn]=Zt("root",{ref:n,className:Re(N.root,f),elementType:LCt,externalForwardedProps:{...ae,...I,component:d},ownerState:z}),[wi,jn]=Zt("scroller",{ref:J,className:N.scroller,elementType:FCt,externalForwardedProps:ae,ownerState:z,additionalProps:{style:{overflow:G.overflow,[A?`margin${o?"Left":"Right"}`:"marginBottom"]:R?void 0:-G.scrollbarWidth}}}),[sn,br]=Zt("list",{ref:te,className:Re(N.list,N.flexContainer),elementType:$Ct,externalForwardedProps:ae,ownerState:z,getSlotProps:$t=>({...$t,onKeyDown:Ut=>{gt(Ut),$t.onKeyDown?.(Ut)}})});return O.jsxs(on,{...Dn,children:[St.scrollButtonStart,St.scrollbarSizeListener,O.jsxs(wi,{...jn,children:[O.jsx(sn,{"aria-label":s,"aria-labelledby":a,"aria-orientation":m==="vertical"?"vertical":null,role:"tablist",...br,children:ht}),Q&&st]}),St.scrollButtonEnd]})});function jCt(e){return pt("MuiTextField",e)}dt("MuiTextField",["root"]);const BCt={standard:Ob,filled:ale,outlined:hle},UCt=e=>{const{classes:t}=e;return Xe({root:["root"]},jCt,t)},VCt=Oe(ld,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Ri=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:m,inputProps:v,InputProps:y,inputRef:b,label:w,maxRows:S,minRows:_,multiline:E=!1,name:T,onBlur:k,onChange:P,onFocus:R,placeholder:I,required:F=!1,rows:A,select:L=!1,SelectProps:$,slots:j={},slotProps:V={},type:U,value:z,variant:N="outlined",...B}=r,H={...r,autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:E,required:F,select:L,variant:N},Q=UCt(H),Y=ur(g),Z=p&&Y?`${Y}-helper-text`:void 0,pe=w&&Y?`${Y}-label`:void 0,ie=BCt[N],ne={slots:j,slotProps:{input:y,inputLabel:m,htmlInput:v,formHelperText:d,select:$,...V}},fe={},me=ne.slotProps.inputLabel;N==="outlined"&&(me&&typeof me.shrink<"u"&&(fe.notched=me.shrink),fe.label=w),L&&((!$||!$.native)&&(fe.id=void 0),fe["aria-describedby"]=void 0);const[se,ue]=Zt("root",{elementType:VCt,shouldForwardComponentProp:!0,externalForwardedProps:{...ne,...B},ownerState:H,className:Re(Q.root,a),ref:n,additionalProps:{disabled:u,error:f,fullWidth:h,required:F,color:l,variant:N}}),[G,ce]=Zt("input",{elementType:ie,externalForwardedProps:ne,additionalProps:fe,ownerState:H}),[he,J]=Zt("inputLabel",{elementType:_v,externalForwardedProps:ne,ownerState:H}),[te,ae]=Zt("htmlInput",{elementType:"input",externalForwardedProps:ne,ownerState:H}),[we,Pe]=Zt("formHelperText",{elementType:lle,externalForwardedProps:ne,ownerState:H}),[ee,oe]=Zt("select",{elementType:Th,externalForwardedProps:ne,ownerState:H}),Se=O.jsx(G,{"aria-describedby":Z,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:E,name:T,rows:A,maxRows:S,minRows:_,type:U,value:z,id:Y,inputRef:b,onBlur:k,onChange:P,onFocus:R,placeholder:I,inputProps:ae,slots:{input:j.htmlInput?te:void 0},...ce});return O.jsxs(se,{...ue,children:[w!=null&&w!==""&&O.jsx(he,{htmlFor:Y,id:pe,...J,children:w}),L?O.jsx(ee,{"aria-describedby":Z,id:Y,labelId:pe,value:z,input:Se,...oe,children:s}):Se,p&&O.jsx(we,{id:Z,...Pe,children:p})]})});function WCt(e){return pt("MuiToggleButton",e)}const d1=dt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),vBe=M.createContext({}),yBe=M.createContext(void 0);function HCt(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}const GCt=e=>{const{classes:t,fullWidth:n,selected:r,disabled:i,size:o,color:s}=e,a={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${Ve(o)}`,s]};return Xe(a,WCt,t)},qCt=Oe(Gf,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${Ve(n.size)}`]]}})(Mt(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${d1.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${d1.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette.text.primary,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Bt(e.palette.text.primary,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette.text.primary,e.palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{[`&.${d1.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette[t].main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Bt(e.palette[t].main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Bt(e.palette[t].main,e.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),oo=M.forwardRef(function(t,n){const{value:r,...i}=M.useContext(vBe),o=M.useContext(yBe),s=nw({...i,selected:HCt(t.value,r)},t),a=Dt({props:s,name:"MuiToggleButton"}),{children:l,className:c,color:u="standard",disabled:f=!1,disableFocusRipple:d=!1,fullWidth:h=!1,onChange:p,onClick:g,selected:m,size:v="medium",value:y,...b}=a,w={...a,color:u,disabled:f,disableFocusRipple:d,fullWidth:h,size:v},S=GCt(w),_=T=>{g&&(g(T,y),T.defaultPrevented)||p&&p(T,y)},E=o||"";return O.jsx(qCt,{className:Re(i.className,S.root,c,E),disabled:f,focusRipple:!d,ref:n,onClick:_,onChange:p,value:y,ownerState:w,"aria-pressed":m,...b,children:l})});function XCt(e){return pt("MuiToggleButtonGroup",e)}const no=dt("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),YCt=e=>{const{classes:t,orientation:n,fullWidth:r,disabled:i}=e,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${Ve(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Xe(o,XCt,t)},QCt=Oe("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${no.grouped}`]:t.grouped},{[`& .${no.grouped}`]:t[`grouped${Ve(n.orientation)}`]},{[`& .${no.firstButton}`]:t.firstButton},{[`& .${no.lastButton}`]:t.lastButton},{[`& .${no.middleButton}`]:t.middleButton},t.root,n.orientation==="vertical"&&t.vertical,n.fullWidth&&t.fullWidth]}})(Mt(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${no.grouped}`]:{[`&.${no.selected} + .${no.grouped}.${no.selected}`]:{borderTop:0,marginTop:0}},[`& .${no.firstButton},& .${no.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${no.lastButton},& .${no.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${no.lastButton}.${d1.disabled},& .${no.middleButton}.${d1.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${no.grouped}`]:{[`&.${no.selected} + .${no.grouped}.${no.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${no.firstButton},& .${no.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${no.lastButton},& .${no.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${no.lastButton}.${d1.disabled},& .${no.middleButton}.${d1.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),rD=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:s="standard",disabled:a=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h,...p}=r,g={...r,disabled:a,fullWidth:c,orientation:f,size:d},m=YCt(g),v=M.useCallback((E,T)=>{if(!u)return;const k=h&&h.indexOf(T);let P;h&&k>=0?(P=h.slice(),P.splice(k,1)):P=h?h.concat(T):[T],u(E,P)},[u,h]),y=M.useCallback((E,T)=>{u&&u(E,h===T?null:T)},[u,h]),b=M.useMemo(()=>({className:m.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:s,disabled:a}),[m.grouped,l,y,v,h,d,c,s,a]),w=Qgt(i),S=w.length,_=E=>{const T=E===0,k=E===S-1;return T&&k?"":T?m.firstButton:k?m.lastButton:m.middleButton};return O.jsx(QCt,{role:"group",className:Re(m.root,o),ref:n,ownerState:g,...p,children:O.jsx(vBe.Provider,{value:b,children:w.map((E,T)=>O.jsx(yBe.Provider,{value:_(T),children:E},T))})})}),KCt="default",ZCt={id:"local",name:"Local Server",url:"http://localhost:8080"},JCt={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",headerBackgroundColor:"#606060",headerIconStyle:{color:"#FFFFFF"},themeMode:"system",compact:!1,organisationUrl:"https://xcube.readthedocs.io/",logoImage:"images/logo.png",logoWidth:32,headerTitleStyle:{fontFamily:"Roboto, Segoe UI, Helvetica, Arial, sans-serif",fontSize:"1.2rem"},baseMapUrl:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",defaultAgg:"mean",polygonFillOpacity:.2,mapProjection:"EPSG:3857",allowAboutPage:!0,allowDownloads:!0,allowRefresh:!0,allowSharing:!0,allowUserVariables:!0,allowViewModePython:!0,allow3D:!0,permalinkExpirationDays:120,showProgressBar:!0,showZoomInfoBox:!0},A$={name:KCt,server:ZCt,branding:JCt};function eOt(){const e=new URL(window.location.href),t=e.pathname.split("/"),n=t.length;return n>0?t[n-1]==="index.html"?new URL(t.slice(0,n-1).join("/"),window.location.origin):new URL(e.pathname,window.location.origin):new URL(window.location.origin)}const ST=eOt();function yle(e,...t){let n=e;for(const r of t)r!==""&&(n.endsWith("/")?r.startsWith("/")?n+=r.substring(1):n+=r:r.startsWith("/")?n+=r:n+="/"+r);return n}const tOt={amber:P5e,blue:Uy,blueGrey:Aht,brown:k5e,cyan:C5e,deepOrange:P1,deepPurple:kht,green:bm,grey:M5e,indigo:_5e,lightBlue:Vy,lightGreen:Mht,lime:E5e,orange:Zx,pink:S5e,purple:By,red:jy,teal:O5e,yellow:T5e};function q1e(e,t){const n=e[t];let r=null;typeof n=="string"?(r=tOt[n]||null,r===null&&n.startsWith("#")&&(n.length===7||n.length===9)&&(r={main:n})):typeof n=="object"&&n!==null&&"main"in n&&(r=n),r!==null?e[t]=r:e[t]=void 0}function nOt(e,t){const n=yle(ST.href,t);e.configPath=n.endsWith("/")?n:n+"/"}function rOt(e,t,n){const r=e[t];typeof r=="string"&&(e[t]=yle(ST.href,n,r))}function iOt(e,t){return e={...e},q1e(e,"primaryColor"),q1e(e,"secondaryColor"),rOt(e,"logoImage",t),nOt(e,t),e}function Lr(e){return typeof e=="number"}function sS(e){return typeof e=="string"}function oOt(e){return typeof e=="function"}function GO(e){return e!==null&&typeof e=="object"&&e.constructor===Object}const X1e="color:green;font-weight:bold;",sOt="color:blue;font-weight:bold;";class aOt{_languages;_content;_locale;constructor(t){const n=Object.getOwnPropertyNames(t.languages);if(n.findIndex(i=>i==="en")<0)throw new Error('Internal error: locale "en" must be included in supported languages');const r={};t.dictionary.forEach((i,o)=>{n.forEach(a=>{if(!i[a])throw new Error(`Internal error: invalid entry at index ${o} in "./resources/lang.json": missing translation for locale: "${a}": ${i}`)});const s=Y1e(i.en);r[s]&&console.warn(`Translation already defined for "${i.en}".`),r[s]=i}),this._languages=t.languages,this._content=r,this._locale="en"}get languages(){return this._languages}get locale(){return this._locale}set locale(t){const n=Object.getOwnPropertyNames(this._languages);if(n.findIndex(r=>r===t)<0){const r=t.split("-")[0];if(n.findIndex(i=>i===r)<0){console.error(`No translations found for locale "${t}", staying with "${this._locale}".`);return}else console.warn(`No translations found for locale "${t}", falling back to "${r}".`),t=r}this._locale=t}get(t,n){const r=Y1e(t),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${t}`,X1e,` for locale %c${this._locale}`,sOt),o=t)):(console.debug(`missing translation for phrase %c${t}`,X1e),o=t),n&&Object.keys(n).forEach(s=>{o=o.replace("${"+s+"}",`${n[s]}`)}),o}}const lOt=()=>{let e;return navigator.languages&&navigator.languages.length>0?e=navigator.languages[0]:e=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",e.split("-")[0]},Y1e=e=>e.toLowerCase(),cOt={en:"English",de:"Deutsch",se:"Svenska"},uOt=JSON.parse('[{"en":"OK","de":"OK","se":"OK"},{"en":"Cancel","de":"Abbrechen","se":"Avbryt"},{"en":"Save","de":"Speichern","se":"Spara"},{"en":"Select","de":"Auswählen","se":"Välj"},{"en":"Add","de":"Hinzufügen","se":"Lägg till"},{"en":"Edit","de":"Bearbeiten","se":"Redigera"},{"en":"Remove","de":"Entfernen","se":"Ta bort"},{"en":"Dataset","de":"Datensatz","se":"Dataset"},{"en":"Variable","de":"Variable","se":"Variabel"},{"en":"My places","de":"Meine Orte","se":"Mina platser"},{"en":"Loading places","de":"Lade Orte","se":"Laddar platser"},{"en":"Places","de":"Orte","se":"Platser"},{"en":"Place","de":"Ort","se":"Plats"},{"en":"Time","de":"Zeit","se":"Tid"},{"en":"Missing time axis","de":"Fehlende Zeitachse","se":"Saknar tidsaxel"},{"en":"Geometry type","de":"Geometry-Typ","se":"Geometri typ"},{"en":"Point","de":"Punkt","se":"Punkt"},{"en":"Polygon","de":"Polygon","se":"Polygon"},{"en":"Circle","de":"Kreis","se":"Cirkel"},{"en":"Multi","de":"Multi","se":"Multi"},{"en":"Something went wrong.","de":"Irgendetwas lief schief.","se":"Något gick fel."},{"en":"Time-Series","de":"Zeitserie","se":"Tidsserier"},{"en":"Quantity","de":"Größe","se":"Kvantitet"},{"en":"unknown units","de":"unbekannte Einheiten","se":"okända enheter"},{"en":"Values","de":"Werte","se":"Värden"},{"en":"Start","de":"Start","se":"Start"},{"en":"Stop","de":"Stopp","se":"Stopp"},{"en":"Please wait...","de":"Bitte warten...","se":"Vänta ..."},{"en":"Loading data","de":"Lade Daten","se":"Laddar data"},{"en":"Connecting to server","de":"Verbindung zum Server wird hergestellt","se":"Ansluta till servern"},{"en":"Cannot reach server","de":"Kann Server nicht erreichen","se":"Kan inte nå servern"},{"en":"Language","de":"Sprache","se":"Språk"},{"en":"Settings","de":"Einstellungen","se":"Inställningar"},{"en":"General","de":"Allgemein","se":"Allmänhet"},{"en":"System Information","de":"Systeminformation","se":"Systeminformation"},{"en":"version","de":"Version","se":"Version"},{"en":"Server","de":"Server","se":"Server"},{"en":"Add Server","de":"Server hinzufügen","se":"Lägg till server"},{"en":"Edit Server","de":"Server bearbeiten","se":"Redigera server"},{"en":"Select Server","de":"Server auswählen","se":"Välj server"},{"en":"On","de":"An","se":"På"},{"en":"Off","de":"Aus","se":"Av"},{"en":"Time interval of the player","de":"Zeitintervall des Abspielers","se":"Spelarens tidsintervall"},{"en":"Show chart after adding a place","de":"Diagram anzeigen, nachdem ein Ort hinzugefügt wurde","se":"Visa diagram efter att du har lagt till en plats"},{"en":"Calculate standard deviation","de":"Berechne Standardabweichung","se":"Beräkna standardavvikelsen"},{"en":"Calculate median instead of mean (disables standard deviation)","de":"Median statt Mittelwert berechnen (deaktiviert Standardabweichung)","se":"Beräkna median istället för medelvärde (inaktiverar standardavvikelse)"},{"en":"Minimal number of data points in a time series update","de":"Minimale Anzahl Datenpunkte in einer Zeitreihen-Aktualisierung","se":"Minimalt antal datapunkter i en tidsserieuppdatering"},{"en":"Map","de":"Karte","se":"Karta"},{"en":"Projection","de":"Projektion","se":"Projektion"},{"en":"Geographic","de":"Geografisch","se":"Geografiskt"},{"en":"Mercator","de":"Mercator","se":"Mercator"},{"en":"Image smoothing","de":"Bildglättung","se":"Bildutjämning"},{"en":"Show dataset boundaries","de":"Datensatzgrenzen anzeigen","se":"Visa datauppsättningsgränser"},{"en":"Overlays","de":"Overlays","se":"Överlagringar"},{"en":"Predefined","de":"Vordefiniert","se":"Fördefinierad"},{"en":"Base maps","de":"Basiskarten","se":"Baskartor"},{"en":"Base map","de":"Basiskarte","se":"Baskarta"},{"en":"Hide small values","de":"Kleine Werte ausblenden","se":"Dölja små värden"},{"en":"Reverse","de":"Umkehren","se":"Omvänt"},{"en":"Color","de":"Farbe","se":"Färg"},{"en":"Opacity","de":"Opazität","se":"Opacitet"},{"en":"Value Range","de":"Wertebereich","se":"Värdeintervall"},{"en":"Assign min/max from color mapping values","de":"Min./Max. aus Farbzuordnungswerten übertragen","se":"Tilldela min/max från färgmappningsvärden"},{"en":"Log-scaled","de":"Log-skaliert","se":"Log-skalad"},{"en":"Logarithmic scaling","de":"Logarithmische Skalierung","se":"Logaritmisk skalning"},{"en":"Others","de":"Andere","se":"Andra"},{"en":"Information about the selected dataset","de":"Informationen über den ausgewählten Datensatz","se":"Information om den valda datamängden"},{"en":"Information about the selected variable","de":"Informationen über die ausgewählte Variable","se":"Information om den valda variabeln"},{"en":"Information about the selected place","de":"Informationen über den ausgewählten Ort","se":"Information om vald plats"},{"en":"Dimension names","de":"Namen der Dimensionen","se":"Dimensioner namn"},{"en":"Dimension data types","de":"Datentypen der Dimensionen","se":"Dimensionsdatatyper"},{"en":"Dimension lengths","de":"Länge der Dimensionen","se":"Måttlängder"},{"en":"Time chunk size","de":"Zeitblockgröße","se":"Tidsblockstorlek"},{"en":"Geographical extent","de":"Geografische Ausdehnung","se":"Geografisk omfattning"},{"en":"Spatial reference system","de":"Räumliches Bezugssystem","se":"Rumsligt referenssystem"},{"en":"No Title","de":"Kein Titel","se":"Ingen Titel"},{"en":"Name","de":"Name","se":"Namn"},{"en":"Title","de":"Titel","se":"Titel"},{"en":"Units","de":"Einheiten","se":"Enheter"},{"en":"Expression","de":"Ausdruck","se":"Uttryck"},{"en":"Data type","de":"Datentyp","se":"Datatyp"},{"en":"There is no information available for this location.","de":"Zu diesem Ort sind keine keine Informationen vorhanden.","se":"Det finns ingen information tillgänglig för den här platsen."},{"en":"Log out","de":"Abmelden","se":"Logga ut"},{"en":"Profile","de":"Profil","se":"Profil"},{"en":"User Profile","de":"Nutzerprofil","se":"Användarprofil"},{"en":"User name","de":"Nutzername","se":"Användarnamn"},{"en":"E-mail","de":"E-mail","se":"E-post"},{"en":"Nickname","de":"Spitzname","se":"Smeknamn"},{"en":"verified","de":"verifiziert","se":"verified"},{"en":"not verified","de":"nicht verifiziert","se":"inte verifierad"},{"en":"RGB","de":"RGB","se":"RGB"},{"en":"Imprint","de":"Impressum","se":"Avtryck"},{"en":"User Manual","de":"Benutzerhandbuch","se":"Användarmanual"},{"en":"Show time-series diagram","de":"Zeitserien-Diagramm anzeigen","se":"Visa tidsseriediagram"},{"en":"Add Statistics","de":"Statistiken hinzufügen","se":"Lägg till statistik"},{"en":"Help","de":"Hilfe","se":"Hjälp"},{"en":"Documentation","de":"Dokumentation","se":"Dokumentation"},{"en":"Developer Reference","de":"Entwicklerreferenz","se":"Utvecklarreferens"},{"en":"Share","de":"Teilen","se":"Dela"},{"en":"Copy snapshot to clipboard","de":"Schnappschuss in die Zwischenablage kopieren","se":"Kopiera ögonblicksbild till urklipp"},{"en":"Snapshot copied to clipboard","de":"Schnappschuss wurde in die Zwischenablage kopiert","se":"Ögonblicksbild har kopierats till urklipp"},{"en":"Error copying snapshot to clipboard","de":"Fehler beim Kopieren des Schnappschusses in die Zwischenablage","se":"Det gick inte att kopiera ögonblicksbilden till urklipp"},{"en":"Export data","de":"Daten exportieren","se":"Exportera data"},{"en":"Export Settings","de":"Export-Einstellungen","se":"Exportera Inställningar"},{"en":"Include time-series data","de":"Zeitseriendaten einschließen","se":"Inkludera tidsseriedata"},{"en":"Include places data","de":"Ortsdaten einschließen","se":"Inkludera platsdata"},{"en":"File name","de":"Dateiname","se":"Filnamn"},{"en":"Separator for time-series data","de":"Trennzeichen für Zeitreihendaten","se":"Separator för tidsseriedata"},{"en":"Combine place data in one file","de":"Ortsdaten in einer Datei zusammenfassen","se":"Kombinera platsdata i en fil"},{"en":"As ZIP archive","de":"Als ZIP-Archiv","se":"Som ett ZIP-arkiv"},{"en":"Download","de":"Herunterladen","se":"Ladda ner"},{"en":"Locate place in map","de":"Lokalisiere Ort in Karte","se":"Leta upp plats på kartan"},{"en":"Locate dataset in map","de":"Lokalisiere Datensatz in Karte","se":"Leta upp dataset på kartan"},{"en":"Open information panel","de":"Informationsfeld öffnen","se":"Öppet informationsfält"},{"en":"Select a place in map","de":"Ort in der Karte auswählen","se":"Välj plats på kartan"},{"en":"Add a point location in map","de":"Punkt zur Karte hinzufügen","se":"Lägg till punkt på kartan"},{"en":"Draw a polygon area in map","de":"Polygonale Fläche in der Karte zeichnen","se":"Rita en polygonal yta på kartan"},{"en":"Draw a circular area in map","de":"Kreisförmige Fläche in der Karte zeichnen","se":"Rita ett cirkulärt område på kartan"},{"en":"Rename place","de":"Ort umbenennen","se":"Byt namn på plats"},{"en":"Style place","de":"Ort stylen","se":"Styla plats"},{"en":"Remove place","de":"Ort entfernen","se":"Ta bort plats"},{"en":"Rename place group","de":"Ortsgruppe umbenennen","se":"Byt namn på platsgrupp"},{"en":"Remove places","de":"Orte entfernen","se":"Ta bort platser"},{"en":"Show RGB layer instead","de":"Stattdessen RGB-Layer anzeigen","se":"Visa RGB-lager istället"},{"en":"Auto-step through times in the dataset","de":"Zeiten im Datensatz automatisch durchlaufen","se":"Kör automatiskt genom tider i dataposten"},{"en":"First time step","de":"Erster Zeitschritt","se":"Första tidssteg"},{"en":"Last time step","de":"Letzter Zeitschritt","se":"Sista tidssteg"},{"en":"Previous time step","de":"Vorheriger Zeitschritt","se":"Föregående tidssteg"},{"en":"Next time step","de":"Nächster Zeitschritt","se":"Nästa tidssteg"},{"en":"Select time in dataset","de":"Datensatz-Zeit auswählen","se":"Välj tid i dataset"},{"en":"Refresh","de":"Aktualisieren","se":"Att uppdatera"},{"en":"Accept and continue","de":"Akzeptieren und weiter","se":"Acceptera och fortsätt"},{"en":"Leave","de":"Verlassen","se":"Lämna"},{"en":"Import places","de":"Orte importieren","se":"Importera platser"},{"en":"Text/CSV","de":"Text/CSV","se":"Text/CSV"},{"en":"GeoJSON","de":"GeoJSON","se":"GeoJSON"},{"en":"WKT","de":"WKT","se":"WKT"},{"en":"Enter text or drag & drop a text file.","de":"Text eingeben oder Textdatei per Drag & Drop einfügen.","se":"Skriv in text eller dra och släpp en textfil."},{"en":"From File","de":"Aus Datei","se":"Från fil"},{"en":"Clear","de":"Löschen","se":"Tömma"},{"en":"Options","de":"Optionen","se":"Alternativ"},{"en":"Time (UTC, ISO-format)","de":"Zeit (UTC, ISO-Format)","se":"Tid (UTC, ISO-format)"},{"en":"Group","de":"Gruppe","se":"Grupp"},{"en":"Label","de":"Label","se":"Etikett"},{"en":"Time property names","de":"Eigenschaftsnamen für Zeit","se":"Gruppegendomsnamn"},{"en":"Group property names","de":"Eigenschaftsnamen für Gruppe","se":"Gruppegendomsnamn"},{"en":"Label property names","de":"Eigenschaftsnamen für Label","se":"Etikett egendomsnamn"},{"en":"Group prefix (used as fallback)","de":"Gruppen-Präfix (als Fallback verwendet)","se":"Gruppprefix (används som reserv)"},{"en":"Label prefix (used as fallback)","de":"Label-Präfix (als Fallback verwendet)","se":"Etikettprefix (används som reserv)"},{"en":"X/longitude column names","de":"Spaltennamen für y/Längengrad","se":"X/longitud kolumnnamn"},{"en":"Y/latitude column names","de":"Spaltennamen für y/Breitengrad","se":"Y/latitud kolumnnamn"},{"en":"Geometry column names","de":"Spaltennamen für Geometrie","se":"Geometrikolumnnamn"},{"en":"Time column names","de":"Spaltennamen für Zeit","se":"Tidskolumnnamn"},{"en":"Group column names","de":"Spaltennamen für Gruppe","se":"Gruppkolumnnamn"},{"en":"Label column names","de":"Spaltennamen für Label","se":"Etikettkolumnnamn"},{"en":"Separator character","de":"Trennzeichen","se":"Skiljetecken"},{"en":"Comment character","de":"Kommentar-Zeichen","se":"Kommentar karaktär"},{"en":"Quote character","de":"Zitierzeichen","se":"Citat karaktär"},{"en":"Escape character","de":"Escape character","se":"Escape karaktär"},{"en":"Not-a-number token","de":"Token für \'keine Zahl\'","se":"Not-a-number token"},{"en":"True token","de":"Token für \'wahr\'","se":"Sann token"},{"en":"False token","de":"Token für \'falsch\'","se":"Falsk token"},{"en":"Revoke consent","de":"Zustimmung widerrufen","se":"Återkalla samtycke "},{"en":"Accepted","de":"Akzeptiert","se":"Accepterad"},{"en":"Legal Agreement","de":"Rechtliches Übereinkommen","se":"Laglig Överenskommelse"},{"en":"Privacy Notice","de":"Datenschutzhinweis","se":"Sekretessmeddelande"},{"en":"WMS URL","de":"WMS URL","se":"WMS URL"},{"en":"WMS Layer","de":"WMS Layer","se":"WMS Lager"},{"en":"Add layer from a Web Map Service","de":"Layer aus einem Web Map Service hinzufügen","se":"Lägg till lager från en Web Map Service"},{"en":"Add layer from a Tiled Web Map","de":"Layer aus einer Tiled Web Map hinzufügen","se":"Lägg till lager från en Tiled Web Map"},{"en":"Show or hide layers panel","de":"Layer-Bedienfeld ein- oder ausblenden","se":"Visa eller dölj panelen Lager"},{"en":"Turn layer split mode on or off","de":"Layer-Split-Modus ein- oder ausschalten","se":"Aktivera eller inaktivera lagerdelningsläget"},{"en":"Turn info box on or off","de":"Infobox ein- oder ausschalten","se":"Slå på eller av informationsrutan"},{"en":"Show sidebar","de":"Seitenleiste einblenden","se":"Visa sidofältet"},{"en":"Hide sidebar","de":"Seitenleiste ausblenden","se":"Dölj sidofältet"},{"en":"Unknown color bar","de":"Unbekannte Farbskala","se":"Färgskala okänd"},{"en":"Points","de":"Punkte","se":"Punkter"},{"en":"Lines","de":"Linien","se":"Linjer"},{"en":"Bars","de":"Balken","se":"Staplar"},{"en":"Default chart type","de":"Diagrammtyp (default)","se":"Diagramtyp (default)"},{"en":"User Base Maps","de":"Nutzer Basiskarten","se":"Användare Baskartor"},{"en":"Switch between dataset RGB layer and variable layer","de":"Zwischen RGB-Layer und Variablen-Layer wechseln","se":"Växla mellan RGB-lager och variabellager"},{"en":"Overlay","de":"Overlay (überlagernder Layer)","se":"Overlay (överliggande lager)"},{"en":"User Overlays","de":"Nutzer Overlays","se":"Användare Överlagringar"},{"en":"On dataset selection","de":"Bei Auswahl von Datensatz","se":"Vid val av dataset"},{"en":"On place selection","de":"Bei Auswahl von Ort","se":"Vid val av plats"},{"en":"Do nothing","de":"Nichts tun","se":"Gör ingenting"},{"en":"Pan","de":"Verschieben","se":"Panorera"},{"en":"Pan and zoom","de":"Verschieben und zoom","se":"Panorera och zooma"},{"en":"User Layers","de":"Nutzer Layer","se":"Användare lager"},{"en":"XYZ Layer URL","de":"XYZ-Layer URL","se":"XYZ lager URL"},{"en":"Layer Title","de":"Layer Titel","se":"Lagertitel "},{"en":"Layer Attribution","de":"Layer Attribution","se":"Lagerattribution"},{"en":"ID","de":"ID","se":"ID"},{"en":"Details","de":"Details","se":"Detaljer"},{"en":"Charts","de":"Diagramme","se":"Diagrammer"},{"en":"Statistics","de":"Statistik","se":"Statistik"},{"en":"Volume","de":"Volumen","se":"Volym"},{"en":"Toggle zoom mode (or press CTRL key)","de":"Zoom-Modus umschalten (oder drücke CTRL-Taste)","se":"Växla zoomläge (eller tryck på CTRL-tangenten)"},{"en":"Enter fixed y-range","de":"Festen y-Bereich angeben","se":"Ange fast y-intervall"},{"en":"Toggle showing info popup on hover","de":"Anzeige des Info-Popups bei Hover umschalten","se":"Växla visning av popup-info vid hover"},{"en":"Show points","de":"Punkte anzeigen","se":"Visa punkter"},{"en":"Show lines","de":"Linien anzeigen","se":"Visa linjer"},{"en":"Show bars","de":"Balken anzeigen","se":"Visa staplar"},{"en":"Show standard deviation (if any)","de":"Standardabweichung anzeigen","se":"Visa standardavvikelsen"},{"en":"Add time-series from places","de":"Zeitserien hinzufügen von Orten","se":"Lägg till tidsserier från platser"},{"en":"Zoom to full range","de":"Zoom auf gesamten x-Bereich","se":"Zooma till hela x-intervallet"},{"en":"Make it 2nd variable for comparison","de":"Festlegen als 2. Variable für Vergleich","se":"Ställ in som 2:a variabel för jämförelse"},{"en":"Load Volume Data","de":"Lade Volumendaten","se":"Ladda volymdata"},{"en":"Please note that the 3D volume rendering is still an experimental feature.","de":"Bitte beachte, dass das 3D-Volumen-Rendering noch eine experimentelle Funktion ist.","se":"Observera att 3D-volymrendering fortfarande är en experimentell funktion."},{"en":"User-defined color bars.","de":"Benutzerdefinierte Farbskalen.","se":"Användardefinierade färgskalor."},{"en":"Contin.","de":"Kontin.","se":"Kontin."},{"en":"Stepwise","de":"Schrittw.","se":"Stegvis"},{"en":"Categ.","de":"Kateg.","se":"Kateg."},{"en":"Continuous color assignment, where each value represents a support point of a color gradient","de":"Kontinuierliche Farbzuordnung, bei der jeder Wert eine Stützstelle eines Farbverlaufs darstellt","se":"Kontinuerlig färgtilldelning där varje värde representerar en punkt i en färggradient"},{"en":"Stepwise color mapping where values are bounds of value ranges mapped to the same color","de":"Schrittweise Farbzuordnung, bei der die Werte Bereichsgrenzen darstellen, die einer einzelnen Farbe zugeordnet werden","se":"Gradvis färgmappning, där värdena representerar intervallgränser mappade till en enda färg"},{"en":"Values represent unique categories or indexes that are mapped to a color","de":"Werte stellen eindeutige Kategorien oder Indizes dar, die einer Farbe zugeordnet sind","se":"Värden representerar unika kategorier eller index som är mappade till en färg"},{"en":"User","de":"Nutzer","se":"Användare"},{"en":"Add Time-Series","de":"Zeitserien hinzufügen","se":"Lägg till tidsserier"},{"en":"No time-series have been obtained yet. Select a variable and a place first.","de":"Es wurden noch keine Zeitreihen abgerufen. Wähle zuerst eine Variable und einen Ort aus.","se":"Inga tidsserier har hämtats ännu. Välj först en variabel och en plats."},{"en":"Count","de":"Anzahl","se":"Antal"},{"en":"Minimum","de":"Minimum","se":"Minimum"},{"en":"Maximum","de":"Maximum","se":"Maximum"},{"en":"Mean","de":"Mittelwert","se":"Medelvärde"},{"en":"Deviation","de":"Abweichung","se":"Avvikelse"},{"en":"Toggle adjustable x-range","de":"Anpassbaren x-Bereich umschalten","se":"Växla justerbart x-intervall"},{"en":"pinned","de":"angepinnt","se":"fäst"},{"en":"Compare Mode (Drag)","de":"Vergleichsmodus (Ziehen)","se":"Jämförelseläge (Dra)"},{"en":"Point Info Mode (Hover)","de":"Punktinformationsmodus (Bewegen)","se":"Punktinformationsläge (Sväva)"},{"en":"Dataset RGB","de":"Datensatz RGB","se":"Dataset RGB"},{"en":"Dataset RGB 2","de":"Datensatz RGB 2","se":"Dataset RGB 2"},{"en":"Dataset Variable","de":"Datensatz Variable","se":"Dataset Variabel"},{"en":"Dataset Variable 2","de":"Datensatz Variable 2","se":"Dataset Variabel 2"},{"en":"Dataset Boundary","de":"Datensatz Außengrenze","se":"Dataset Yttre Gräns"},{"en":"Dataset Places","de":"Datensatz Orte","se":"Dataset Platser"},{"en":"User Places","de":"Nutzer Orte","se":"Användare Platser"},{"en":"Layers","de":"Layer","se":"Lager"},{"en":"User Variables","de":"Nutzer-Variablen","se":"Användarvariabler"},{"en":"Create and manage user variables","de":"Nutzer-Variablen erstellen und verwalten","se":"Skapa och hantera användarvariabler"},{"en":"Manage user variables","de":"Nutzer-Variablen verwalten","se":"Hantera användarvariabler"},{"en":"Add user variable","de":"Nutzer-Variable hinzufügen","se":"Lägg till användarvariabel"},{"en":"Duplicate user variable","de":"Nutzer-Variable duplizieren","se":"Duplicera användarvariabel"},{"en":"Edit user variable","de":"Nutzer-Variable bearbeiten","se":"Redigera användarvariabel"},{"en":"Remove user variable","de":"Nutzer-Variable löschen","se":"Ta bort användarvariabel"},{"en":"Use keys CTRL+SPACE to show autocompletions","de":"Tasten STRG+LEER benutzen, um Autovervollständigungen zu zeigen","se":"Använd tangenterna CTRL+MELLANSLAG för att visa autoslutföranden"},{"en":"Display further elements to be used in expressions","de":"Weitere Elemente anzeigen, die in Ausdrücken verwendet werden können","se":"Visa fler element som kan användas i uttryck"},{"en":"Variables","de":"Variablen","se":"Variabler"},{"en":"Constants","de":"Konstanten","se":"Konstanter"},{"en":"Array operators","de":"Array-Operatoren","se":"Arrayoperatorer"},{"en":"Other operators","de":"Andere Operatoren","se":"Andra Operatorer"},{"en":"Array functions","de":"Array-Funktionen","se":"Arrayfunktioner"},{"en":"Other functions","de":"Andere Funktionen","se":"Andra funktioner"},{"en":"Not a valid identifier","de":"Kein gültiger Bezeichner","se":"Inte en giltig identifierare"},{"en":"Must not be empty","de":"Darf nicht leer sein","se":"Får inte vara tom"},{"en":"Textual format","de":"Textformat","se":"Textformat"},{"en":"Tabular format","de":"Tabellenformat","se":"Tabellformat"},{"en":"JSON format","de":"JSON-Format","se":"JSON-format"},{"en":"defined","de":"definiert","se":"definierad"},{"en":"Appearance Mode","de":"Darstellungsmodus","se":"Utseendeläge"},{"en":"System","de":"System","se":"System"},{"en":"Light","de":"Hell","se":"Ljus"},{"en":"Dark","de":"Dunkel","se":"Mörk"},{"en":"Image export resolution","de":"Auflösung des Bildexports","se":"Upplösning för bildexport"},{"en":"Screen Resolution (96 DPI)","de":"Bildschirmauflösung (96 DPI)","se":"Skärmupplösning (96 DPI)"},{"en":"Intermediate Resolution (150 DPI)","de":"Mittlere Auflösung (150 DPI)","se":"Medelhög upplösning (150 DPI)"},{"en":"Print Resolution (300 DPI)","de":"Druckauflösung (300 DPI)","se":"Utskriftsupplösning (300 DPI)"},{"en":"Professional Print Resolution (600 DPI)","de":"Professionelle Druckauflösung (300 DPI)","se":"Professionell utskriftsupplösning (600 DPI)"},{"en":"Creating permalink","de":"Permalink erstellen","se":"Skapa permalänk"},{"en":"Failed to create permalink","de":"Permalink konnte nicht erstellt werden","se":"Skapa permalänk misslyckades"},{"en":"Permalink copied to clipboard","de":"Permalink in die Zwischenablage kopiert","se":"Permalink kopieras till klippbordet"},{"en":"Permalink copied to clipboard (expires in ${expiration} days)","de":"Permalink in die Zwischenablage kopiert (läuft ab in ${expiration} Tagen)","se":"Permalink kopieras till klippbordet (går ut om ${expiration} dagar)"},{"en":"Back","de":"Zurück","se":"Tillbaka"},{"en":"Apply","de":"Anwenden","se":"Anwända"},{"en":"Already in use","de":"Bereits in Verwendung","se":"Redan i bruk"},{"en":"About ${appName}","de":"Über ${appName}","se":"Om ${appName}"},{"en":"Levels","de":"Levels","se":"Levels"},{"en":"Show zoom level indicator","de":"Zoomstufen anzeigen","se":"Visa zoomnivåer"},{"en":"More","de":"Weiteres","se":"Ytterligare"},{"en":"Show tile loading progress","de":"Ladefortschritt der Tiles anzeigen","se":"Visa laddningsförlopp för tiles"},{"en":"docs/imprint.en.md","de":"docs/imprint.en.md","se":"docs/imprint.en.md"},{"en":"docs/privacy-note.en.md","de":"docs/privacy-note.de.md","se":"docs/privacy-note.se.md"},{"en":"docs/add-layer-wms.en.md","de":"docs/add-layer-wms.de.md","se":"docs/add-layer-wms.se.md"},{"en":"docs/add-layer-xyz.en.md","de":"docs/add-layer-xyz.de.md","se":"docs/add-layer-xyz.se.md"},{"en":"docs/color-mappings.en.md","de":"docs/color-mappings.de.md","se":"docs/color-mappings.se.md"},{"en":"docs/user-variables.en.md","de":"docs/user-variables.de.md","se":"docs/user-variables.se.md"},{"en":"docs/dev-reference.en.md","de":"docs/dev-reference.en.md","se":"docs/dev-reference.en.md"}]'),fOt={languages:cOt,dictionary:uOt},Ce=new aOt(fOt);Ce.locale=lOt();class bBe extends Error{statusCode;constructor(t,n){super(n),this.statusCode=t}}function Eb(e){return e?{headers:[["Authorization",`Bearer ${e}`]]}:{}}function Cv(e,t){if(t.length>0){const n=t.map(r=>r.map(encodeURIComponent).join("=")).join("&");return e.includes("?")?e.endsWith("&")?e+n:e+"&"+n:e+"?"+n}return e}async function xBe(e,t){let n;try{if(n=await fetch(e,t),n.ok)return n}catch(i){throw i instanceof TypeError?(console.error(`Server did not respond for ${e}. May be caused by timeout, refused connection, network error, etc.`,i),new Error(Ce.get("Cannot reach server"))):(console.error(i),i)}let r=n.statusText;try{const i=await n.json();if(i&&i.error){const o=i.error;console.error(o),o.message&&(r+=`: ${o.message}`)}}catch{}throw console.error(n),new bBe(n.status,r)}async function Ph(e,t,n){let r;oOt(t)?n=t:r=t;const o=await(await xBe(e,r)).json();return n?n(o):o}function dOt(e){const t=Cv(`${e}/viewer/state`,[["key","sentinel"]]);try{return fetch(t).then(n=>n.status!==501).catch(()=>!1)}catch{return Promise.resolve(!1)}}const Om=new URLSearchParams(window.location.search);class On{name;server;branding;authClient;static _instance;constructor(t,n,r,i){this.name=t,this.server=n,this.branding=r,this.authClient=i}static async load(){let t=Om.get("configPath")||"config";const n=await this.loadRawConfig(t);n===A$&&(t="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),s=parseInt(Om.get("compact")||"0")!==0;let a=iOt({...A$.branding,...n.branding,compact:s||n.branding.compact},t);return a=w9(a,"allowUserVariables"),a=w9(a,"allow3D"),a=w9(a,"allowSharing"),a.allowSharing&&(await dOt(o.url)||(a={...a,allowSharing:!1})),On._instance=new On(r,o,a,i),a.windowTitle&&this.changeWindowTitle(a.windowTitle),a.windowIcon&&this.changeWindowIcon(a.windowIcon),On._instance}static getAuthConfig(t){let n=t.authClient&&{...t.authClient};const r=On.getAuthClientFromEnv();if(!n&&r.authority&&r.clientId&&(n={authority:r.authority,client_id:r.clientId}),n){if(r.authority){const i=r.authority;n={...n,authority:i}}if(r.clientId){const i=r.clientId;n={...n,client_id:i}}if(r.audience){const i=r.audience,o=n.extraQueryParams;n={...n,extraQueryParams:{...o,audience:i}}}}return n}static getServerConfig(t){const n={...A$.server,...t.server},r=On.getApiServerFromEnv();return n.id=Om.get("serverId")||r.id||n.id,n.name=Om.get("serverName")||r.name||n.name,n.url=Om.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(t){let n=null,r=null;const i=yle(ST.href,t,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:s,statusText:a}=o;r=`HTTP status ${s}`,a&&(r+=` (${a})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=A$),n}static get instance(){return On.assertConfigLoaded(),On._instance}static assertConfigLoaded(){if(!On._instance)throw new Error("internal error: configuration not available yet")}static changeWindowTitle(t){document.title=t}static changeWindowIcon(t){let n=document.querySelector('link[rel="icon"]');n!==null?n.href=t:(n=document.createElement("link"),n.rel="icon",n.href=t,document.head.appendChild(n))}static getAuthClientFromEnv(){return{authority:void 0,clientId:void 0,audience:void 0}}static getApiServerFromEnv(){return{id:void 0,name:void 0,url:void 0}}}const ble=[["red",jy],["yellow",T5e],["blue",Uy],["pink",S5e],["lightBlue",Vy],["green",bm],["orange",Zx],["lime",E5e],["purple",By],["indigo",_5e],["cyan",C5e],["brown",k5e],["teal",O5e]],hOt=(()=>{const e={};return ble.forEach(([t,n])=>{e[t]=n}),e})(),Q1e=ble.map(([e,t])=>e);function pOt(e){return e==="light"?800:400}function sw(e){return Q1e[e%Q1e.length]}function wBe(e,t){const n=pOt(t);return hOt[e][n]}function xle(e){return Lr(e)||(e=On.instance.branding.polygonFillOpacity),Lr(e)?e:.25}function w9(e,t){const n=Om.get(t),r=n?!!parseInt(n):e[t]!==!1;return{...e,[t]:r}}const SBe={typography:{fontSize:12}},gOt=xT({...SBe,cssVariables:!0,palette:{mode:"light",primary:{main:"#1976d2"},secondary:{main:"#00bc4e"},background:{default:"#ffffff"}}}),mOt=xT({...SBe,cssVariables:!0,palette:{mode:"dark",primary:{main:"#39a6f2"},secondary:{main:"#20dc6e"},background:{default:"#2b2d30"}}}),vOt=[{name:"OpenStreetMap",link:"https://openstreetmap.org",baseMaps:[{name:"OSM Mapnik",endpoint:"https://a.tile.osm.org/{z}/{x}/{y}.png"},{name:"OSM Humanitarian",endpoint:"https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"}],overlays:[]},{name:"ESRI",link:"https://services.arcgisonline.com/arcgis/rest/services",baseMaps:[{name:"Dark Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Hillshade",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Street Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Navigation Charts",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/{z}/{y}/{x}"},{name:"National Geographic",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Imagery",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"},{name:"World Shaded Relief",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}"},{name:"World Topo Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"}],overlays:[{name:"Dark Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Boundaries & Places",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}"},{name:"World Reference Overlay",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}"},{name:"World Transportation",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}"}]},{name:"CartoDB",link:"https://cartodb.com/basemaps/",baseMaps:[{name:"Positron",endpoint:"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"},{name:"Dark Matter",endpoint:"https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"},{name:"Positron (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png"},{name:"Dark Matter (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png"}],overlays:[{name:"Positron Labels",endpoint:"https://a.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png"},{name:"Dark Matter Labels",endpoint:"https://a.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png"}]}],yOt=vOt;function _Be(e){const t=[];return yOt.forEach(n=>{n[e].forEach(r=>{t.push({id:`${e}.${n.name}.${r.name}`,attribution:n.link,title:`${n.name} - ${r.name}`,url:r.endpoint,exclusive:e==="baseMaps"})})}),t}function CBe(e){const t=On.instance.branding.layers;return(t&&t[e]||[]).map(({id:n,...r})=>({...r,id:`${e}.${n}`}))}const bOt=_Be("overlays"),OBe=_Be("baseMaps"),xOt=OBe[0].id,aS="EPSG:4326",iD="EPSG:3857",EBe=iD;var mg=(function(){function e(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return e.prototype.preventDefault=function(){this.defaultPrevented=!0},e.prototype.stopPropagation=function(){this.propagationStopped=!0},e})();const qO={PROPERTYCHANGE:"propertychange"};var wle=(function(){function e(){this.disposed=!1}return e.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},e.prototype.disposeInternal=function(){},e})();function wOt(e,t,n){for(var r,i,o=aw,s=0,a=e.length,l=!1;s>1),i=+o(e[r],t),i<0?s=r+1:(a=r,l=!i);return l?s:~s}function aw(e,t){return e>t?1:e0){for(i=1;i0?i-1:i:e[i-1]-t0||s===0)})}function R1(){return!0}function oD(){return!1}function lw(){}function COt(e){var t=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!t||this!==i||!lS(o,r))&&(t=!0,i=this,r=o,n=e.apply(this,arguments)),n}}var bo=typeof Object.assign=="function"?Object.assign:function(e,t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),r=1,i=arguments.length;r0:!1},t.prototype.removeEventListener=function(n,r){var i=this.listeners_&&this.listeners_[n];if(i){var o=i.indexOf(r);o!==-1&&(this.pendingRemovals_&&n in this.pendingRemovals_?(i[o]=lw,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},t})(wle);const Xn={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function Fr(e,t,n,r,i){if(r&&r!==e&&(n=n.bind(r)),i){var o=n;n=function(){e.removeEventListener(t,n),o.apply(this,arguments)}}var s={target:e,type:t,listener:n};return e.addEventListener(t,n),s}function W5(e,t,n,r){return Fr(e,t,n,r,!0)}function uo(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),sD(e))}var EOt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),aD=(function(e){EOt(t,e);function t(){var n=e.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.revision_=0,n}return t.prototype.changed=function(){++this.revision_,this.dispatchEvent(Xn.CHANGE)},t.prototype.getRevision=function(){return this.revision_},t.prototype.onInternal=function(n,r){if(Array.isArray(n)){for(var i=n.length,o=new Array(i),s=0;s=0||q0.match(/cpu (os|iphone os) 15_4 like mac os x/));var DOt=q0.indexOf("webkit")!==-1&&q0.indexOf("edge")==-1,LOt=q0.indexOf("macintosh")!==-1,MBe=typeof devicePixelRatio<"u"?devicePixelRatio:1,cU=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,FOt=typeof Image<"u"&&Image.prototype.decode,ABe=(function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return e})();new Array(6);function Np(){return[1,0,0,1,0,0]}function $Ot(e,t,n,r,i,o,s){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=s,e}function NOt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Xo(e,t){var n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function zOt(e,t,n){return $Ot(e,t,0,0,n,0,0)}function fv(e,t,n,r,i,o,s,a){var l=Math.sin(o),c=Math.cos(o);return e[0]=r*c,e[1]=i*l,e[2]=-r*l,e[3]=i*c,e[4]=s*r*c-a*r*l+t,e[5]=s*i*l+a*i*c+n,e}function _le(e,t){var n=jOt(t);mr(n!==0,32);var r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5];return e[0]=s/n,e[1]=-i/n,e[2]=-o/n,e[3]=r/n,e[4]=(o*l-s*a)/n,e[5]=-(r*l-i*a)/n,e}function jOt(e){return e[0]*e[3]-e[1]*e[2]}var Z1e;function RBe(e){var t="matrix("+e.join(", ")+")";if(cU)return t;var n=Z1e||(Z1e=document.createElement("div"));return n.style.transform=t,n.style.transform}const Gs={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function J1e(e){for(var t=Nu(),n=0,r=e.length;ni&&(l=l|Gs.RIGHT),ao&&(l=l|Gs.ABOVE),l===Gs.UNKNOWN&&(l=Gs.INTERSECTING),l}function Nu(){return[1/0,1/0,-1/0,-1/0]}function gh(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function cD(e){return gh(1/0,1/0,-1/0,-1/0,e)}function UOt(e,t){var n=e[0],r=e[1];return gh(n,r,n,r,t)}function DBe(e,t,n,r,i){var o=cD(i);return FBe(o,e,t,n,r)}function BA(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function LBe(e,t){return t[0]e[2]&&(e[2]=t[2]),t[1]e[3]&&(e[3]=t[3]),e}function GM(e,t){t[0]e[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function FBe(e,t,n,r,i){for(;nt[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function kle(e){return e[2]=s&&g<=l),!r&&o&Gs.RIGHT&&!(i&Gs.RIGHT)&&(m=h-(d-l)*p,r=m>=a&&m<=c),!r&&o&Gs.BELOW&&!(i&Gs.BELOW)&&(g=d-(h-a)/p,r=g>=s&&g<=l),!r&&o&Gs.LEFT&&!(i&Gs.LEFT)&&(m=h-(d-s)*p,r=m>=a&&m<=c)}return r}function qOt(e,t,n,r){var i=[],o;i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]],t(i,i,2);for(var s=[],a=[],o=0,l=i.length;o=n[2])){var i=so(n),o=Math.floor((r[0]-n[0])/i),s=o*i;e[0]-=s,e[2]-=s}return e}function XOt(e,t){if(t.canWrapX()){var n=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[n[0],e[1],n[2],e[3]]];$Be(e,t);var r=so(n);if(so(e)>r)return[[n[0],e[1],n[2],e[3]]];if(e[0]n[2])return[[e[0],e[1],n[2],e[3]],[n[0],e[1],e[2]-r,e[3]]]}return[e]}var NBe=(function(){function e(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return e.prototype.canWrapX=function(){return this.canWrapX_},e.prototype.getCode=function(){return this.code_},e.prototype.getExtent=function(){return this.extent_},e.prototype.getUnits=function(){return this.units_},e.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||ph[this.units_]},e.prototype.getWorldExtent=function(){return this.worldExtent_},e.prototype.getAxisOrientation=function(){return this.axisOrientation_},e.prototype.isGlobal=function(){return this.global_},e.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)},e.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},e.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},e.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)},e.prototype.setWorldExtent=function(t){this.worldExtent_=t},e.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},e.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},e})();function hs(e,t,n){return Math.min(Math.max(e,t),n)}var YOt=(function(){var e;return"cosh"in Math?e=Math.cosh:e=function(t){var n=Math.exp(t);return(n+1/n)/2},e})(),QOt=(function(){var e;return"log2"in Math?e=Math.log2:e=function(t){return Math.log(t)*Math.LOG2E},e})();function KOt(e,t,n,r,i,o){var s=i-n,a=o-r;if(s!==0||a!==0){var l=((e-n)*s+(t-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return D1(e,t,n,r)}function D1(e,t,n,r){var i=n-e,o=r-t;return i*i+o*o}function ZOt(e){for(var t=e.length,n=0;ni&&(i=s,r=o)}if(i===0)return null;var a=e[r];e[r]=e[n],e[n]=a;for(var l=n+1;l=0;d--){f[d]=e[d][t]/e[d][d];for(var h=d-1;h>=0;h--)e[h][t]-=e[h][d]*f[d]}return f}function Mz(e){return e*Math.PI/180}function P0(e,t){var n=e%t;return n*t<0?n+t:n}function xm(e,t,n){return e+n*(t-e)}function zBe(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}function R$(e,t){return Math.floor(zBe(e,t))}function I$(e,t){return Math.ceil(zBe(e,t))}var JOt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),uD=6378137,$C=Math.PI*uD,eEt=[-$C,-$C,$C,$C],tEt=[-180,-85,180,85],D$=uD*Math.log(Math.tan(Math.PI/2)),v_=(function(e){JOt(t,e);function t(n){return e.call(this,{code:n,units:Zs.METERS,extent:eEt,global:!0,worldExtent:tEt,getPointResolution:function(r,i){return r/YOt(i[1]/uD)}})||this}return t})(NBe),ewe=[new v_("EPSG:3857"),new v_("EPSG:102100"),new v_("EPSG:102113"),new v_("EPSG:900913"),new v_("http://www.opengis.net/def/crs/EPSG/0/3857"),new v_("http://www.opengis.net/gml/srs/epsg.xml#3857")];function nEt(e,t,n){var r=e.length,i=n>1?n:2,o=t;o===void 0&&(i>2?o=e.slice():o=new Array(r));for(var s=0;sD$?a=D$:a<-D$&&(a=-D$),o[s+1]=a}return o}function rEt(e,t,n){var r=e.length,i=n>1?n:2,o=t;o===void 0&&(i>2?o=e.slice():o=new Array(r));for(var s=0;ss)return 1;if(s>o)return-1}return 0}function fEt(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function G5(e,t){for(var n=!0,r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Mle(e,t){var n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,o=e[1]*n+e[0]*r;return e[0]=i,e[1]=o,e}function dEt(e,t){return e[0]*=t,e[1]*=t,e}function hEt(e,t){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function jBe(e,t){if(t.canWrapX()){var n=so(t.getExtent()),r=pEt(e,t,n);r&&(e[0]-=r*n)}return e}function pEt(e,t,n){var r=t.getExtent(),i=0;if(t.canWrapX()&&(e[0]r[2])){var o=n||so(r);i=Math.floor((e[0]-r[0])/o)}return i}var gEt=63710088e-1;function rwe(e,t,n){var r=gEt,i=Mz(e[1]),o=Mz(t[1]),s=(o-i)/2,a=Mz(t[0]-e[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var Ete=!0;function mEt(e){Ete=!1}function Ale(e,t,n){var r;if(t!==void 0){for(var i=0,o=e.length;i=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(Ete=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),e}function VBe(e,t){return e}function h1(e,t){return e}function SEt(){iwe(ewe),iwe(nwe),bEt(nwe,ewe,nEt,rEt)}SEt();function L1(e,t,n,r,i,o){for(var s=o||[],a=0,l=t;l1)f=n;else if(d>0){for(var h=0;hi&&(i=c),o=a,s=l}return i}function Fle(e,t,n,r,i){for(var o=0,s=n.length;o0;){for(var f=c.pop(),d=c.pop(),h=0,p=e[d],g=e[d+1],m=e[f],v=e[f+1],y=d+r;yh&&(u=y,h=S)}h>i&&(l[(u-t)/r]=1,d+r0&&g>h)&&(p<0&&m0&&m>p)){c=f,u=d;continue}o[s++]=c,o[s++]=u,a=c,l=u,c=f,u=d}}return o[s++]=c,o[s++]=u,s}function qBe(e,t,n,r,i,o,s,a){for(var l=0,c=n.length;l1?s:2,w=o||new Array(b),p=0;p>1;io&&(c-a)*(o-l)-(i-a)*(u-l)>0&&s++:u<=o&&(c-a)*(o-l)-(i-a)*(u-l)<0&&s--,a=c,l=u}return s!==0}function Ble(e,t,n,r,i,o){if(n.length===0||!p1(e,t,n[0],r,i,o))return!1;for(var s=1,a=n.length;s=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:XBe(e,t,n,r,function(s,a){return GOt(i,s,a)}):!1}function NEt(e,t,n,r,i){for(var o=0,s=n.length;ow&&(c=(u+f)/2,Ble(e,t,n,r,c,p)&&(b=c,w=S)),u=f}return isNaN(b)&&(b=i[o]),s?(s.push(b,p,w),s):[b,p,w]}function GEt(e,t,n,r,i){for(var o=[],s=0,a=n.length;s0}function r4e(e,t,n,r,i){for(var o=0,s=n.length;o="a"&&t<="z"||t>="A"&&t<="Z"},e.prototype.isNumeric_=function(t,n){var r=n!==void 0?n:!1;return t>="0"&&t<="9"||t=="."&&!r},e.prototype.isWhiteSpace_=function(t){return t==" "||t==" "||t=="\r"||t==` -`},e.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},e.prototype.nextToken=function(){var t=this.nextChar_(),n=this.index_,r=t,i;if(t=="(")i=ti.LEFT_PAREN;else if(t==",")i=ti.COMMA;else if(t==")")i=ti.RIGHT_PAREN;else if(this.isNumeric_(t)||t=="-")i=ti.NUMBER,r=this.readNumber_();else if(this.isAlpha_(t))i=ti.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t==="")i=ti.EOF;else throw new Error("Unexpected character: "+t)}return{position:n,value:r,type:i}},e.prototype.readNumber_=function(){var t,n=this.index_,r=!1,i=!1;do t=="."?r=!0:(t=="e"||t=="E")&&(i=!0),t=this.nextChar_();while(this.isNumeric_(t,r)||!i&&(t=="e"||t=="E")||i&&(t=="-"||t=="+"));return parseFloat(this.wkt.substring(n,this.index_--))},e.prototype.readText_=function(){var t,n=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(n,this.index_--).toUpperCase()},e})(),aTt=(function(){function e(t){this.lexer_=t,this.token_={position:0,type:ti.START},this.layout_=qr.XY}return e.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},e.prototype.isTokenType=function(t){return this.token_.type==t},e.prototype.match=function(t){var n=this.isTokenType(t);return n&&this.consume_(),n},e.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},e.prototype.parseGeometryLayout_=function(){var t=qr.XY,n=this.token_;if(this.isTokenType(ti.TEXT)){var r=n.value;r===s4e?t=qr.XYZ:r===a4e?t=qr.XYM:r===iTt&&(t=qr.XYZM),t!==qr.XY&&this.consume_()}return t},e.prototype.parseGeometryCollectionText_=function(){if(this.match(ti.LEFT_PAREN)){var t=[];do t.push(this.parseGeometry_());while(this.match(ti.COMMA));if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parsePointText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parsePoint_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parseLineStringText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parsePointList_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parsePolygonText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parseLineStringTextList_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parseMultiPointText_=function(){if(this.match(ti.LEFT_PAREN)){var t=void 0;if(this.token_.type==ti.LEFT_PAREN?t=this.parsePointTextList_():t=this.parsePointList_(),this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parseMultiLineStringText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parseLineStringTextList_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parseMultiPolygonText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parsePolygonTextList_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parsePoint_=function(){for(var t=[],n=this.layout_.length,r=0;r0&&(i+=" "+o)}return r.length===0?i+" "+o4e:i+"("+r+")"}class pTt extends Error{}const d4e={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function h4e(e,t){return new gTt(t).parse(e)}let gTt=class{options;constructor(t){this.options={...d4e,...t},this.parseLine=this.parseLine.bind(this)}parse(t){return this.parseText(t).map(this.parseLine)}parseText(t){const{comment:n,trim:r}=this.options;return t.split(` -`).map((i,o)=>(r&&(i=i.trim()),[i,o])).filter(([i,o])=>i.trim()!==""&&!i.startsWith(n))}parseLine([t,n]){const{separator:r,quote:i,escape:o}=this.options;let s=!1;const a=[];let l=0,c=0;for(;c-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return K5}function i(a,l){r(a)===K5&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var xTt=function(t,n){return t===n};function wTt(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[0]!==a&&(o=[a,...o])}n.properties&&(s=uwe(n.properties,o)),s===void 0&&(s=uwe(n,o)),e[r]=s||i}function qTt(e,t){let n=t;if(e.properties)for(const r of Object.getOwnPropertyNames(e.properties)){if(!n.includes("${"))break;const i="${"+r+"}";n.includes(i)&&(n=n.replace(i,`${e.properties[r]}`))}return n}function uwe(e,t){let n;for(const r of t)if(r in e)return e[r];return n}function fD(e){let t=[];for(const n of e)t=t.concat(n.toLowerCase(),n.toUpperCase(),n[0].toUpperCase()+n.substring(1).toLowerCase());return t}function qle(e,t){e.forEach(n=>{OT(n)&&n.features.forEach(r=>{t(n,r)})})}function XTt(e,t){const n=sS(t)?(r,i)=>i.id===t:t;for(const r of e)if(OT(r)){const i=r.features.find(o=>n(r,o));if(i)return pU(r,i)}return null}function YTt(e){const t=e.id+"";let n=0,r,i;if(t.length===0)return n;for(r=0;ri.id===t);if(n)return n;const r=e.placeGroups;if(r)for(const i in r){const o=g4e(r[i],t);if(o)return o}return null}function Xle(e,t){if(t)for(const n of e){const r=g4e(n,t);if(r!==null)return r}return null}const QTt=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"].map(e=>e.toLowerCase());function fwe(e){if(e=e.trim(),e==="")return"csv";if(e[0]==="{")return"geojson";const t=e.substring(0,20).toLowerCase();return QTt.find(r=>t.startsWith(r)&&(t.length===r.length||` - (`.indexOf(t[r.length])>=0))?"wkt":"csv"}function Az(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(t=>t!=="")}const KTt=e=>{if(e.trim()!=="")try{h4e(e)}catch(t){return console.error(t),`${t}`}return null},m4e={name:"Text/CSV",fileExt:".txt,.csv",checkError:KTt},Dte={...d4e,xNames:"longitude, lon, x",yNames:"latitude, lat, y",forceGeometry:!1,geometryNames:"geometry, geom",timeNames:"time, date, datetime, date-time",groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-"};let ZTt=0,JTt=0;function ePt(e,t){const n=h4e(e,t);if(n.length<2)throw new Error(Ce.get("Missing header line in CSV"));for(const _ of n[0])if(typeof _!="string"||_==="")throw new Error(Ce.get("Invalid header line in CSV"));const r=n[0].map(_=>_),i=r.map(_=>_.toLowerCase()),o=r.length;for(const _ of n)if(_.length!==o)throw new Error(Ce.get("All rows must have same length"));const s=tPt(i),a=y_(s,t.groupNames),l=y_(s,t.labelNames),c=y_(s,t.timeNames),u=y_(s,t.xNames),f=y_(s,t.yNames);let d=y_(s,t.geometryNames);if(t.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(Ce.get("No geometry column(s) found"))}else d=-1;let p=t.groupPrefix.trim();p===""&&(p=Dte.groupPrefix);let g=t.labelPrefix.trim();g===""&&(g=Dte.labelPrefix);let m="";if(a===-1){const _=++ZTt;m=`${p}${_}`}const v=new l4e,y={};let b=1,w=0,S=sw(0);for(;b=0&&(E=`${_[c]}`),a>=0&&(m=`${_[a]}`);let T=y[m];T||(T=Hle(m,[]),y[m]=T,S=sw(w),w++);let k=null;if(d>=0){if(typeof _[d]=="string")try{k=v.readGeometry(e)}catch{}}else{const I=_[u],F=_[f];typeof I=="number"&&Number.isFinite(I)&&typeof F=="number"&&Number.isFinite(F)&&(k=new zp([I,F]))}if(k===null)throw new Error(Ce.get(`Invalid geometry in data row ${b}`));const P={};_.forEach((I,F)=>{if(F!==u&&F!==f&&F!==d){const A=r[F];P[A]=I}});let R;if(l>=0)R=`${_[l]}`;else{const I=++JTt;R=`${g}${I}`}E!==""&&(P.time=E),P.color||(P.color=S),P.label||(P.label=R),P.source||(P.source="CSV"),T.features.push(Gle(k,P))}return Object.getOwnPropertyNames(y).map(_=>y[_])}function tPt(e){const t={};for(let n=0;n{if(e.trim()!=="")try{JSON.parse(e)}catch(t){return console.error(t),`${t}`}return null},v4e={name:"GeoJSON",fileExt:".json,.geojson",checkError:nPt},Lte={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let rPt=0,iPt=0;function oPt(e,t){const n=Az(t.groupNames||"");let r=t.groupPrefix.trim();r===""&&(r=Lte.groupPrefix);const i=Az(t.labelNames||"");let o=t.labelPrefix.trim();o===""&&(o=Lte.labelPrefix);const s=Az(t.timeNames||""),a=new fS;let l;try{l=a.readFeatures(e)}catch{try{const d=a.readGeometry(e);l=[new Em(d)]}catch{throw new Error(Ce.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",g="",m="",v=sw(0);if(d){const w={};Object.getOwnPropertyNames(d).forEach(S=>{w[S.toLowerCase()]=d[S]}),p=S9(w,s,p),m=S9(w,i,m),g=S9(w,n,g)}if(g===""){const w=++rPt;g=`${r}-${w}`}if(m===""){const w=++iPt;m=`${o}-${w}`}let y=c[g];y||(y=Hle(g,[]),c[g]=y,v=sw(u),u++);const b={...d};p!==""&&(b.time=p),b.color||(b.color=v),b.label||(b.label=m),b.source||(b.source="GeoJSON"),y.features.push(Gle(h,b))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function S9(e,t,n){if(n===""){for(const r of t)if(e[r]==="string")return e[r]}return n}function y4e(e){return e.getTimezoneOffset()*6e4}function sPt(e){return e.getTime()-y4e(e)}function _9(e){const t=new Date(e);return new Date(t.getTime()+y4e(t))}function WA(e){return new Date(e).toISOString().substring(0,10)}function ET(e){return b4e(new Date(e).toISOString())}function b4e(e){return e.substring(0,19).replace("T"," ")}const aPt=e=>null,x4e={name:"WKT",fileExt:".txt,.wkt",checkError:aPt},Fte={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:ET(new Date().getTime())};let lPt=0,cPt=0;function uPt(e,t){let n=t.groupPrefix.trim();n===""&&(n=Fte.groupPrefix);let r=t.group.trim();if(r===""){const a=++lPt;r=`${n}${a}`}let i=t.labelPrefix.trim();i===""&&(i=Fte.labelPrefix);let o=t.label.trim();if(o===""){const a=++cPt;o=`${i}${a}`}const s=t.time.trim();try{const a=new l4e().readGeometry(e);let l={color:sw(Math.floor(1e3*Math.random())),label:o,source:"WKT"};s!==""&&(l={time:s,...l});const c=[Gle(a,l)];return[Hle(r,c)]}catch{throw new Error(Ce.get("Invalid Geometry WKT"))}}function TT(e){return fPt("localStorage",e)}function fPt(e,t){try{const n=window[e],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new dPt(n,t)}catch{return null}}class dPt{nativeStorage;brandingName;constructor(t,n){this.nativeStorage=t,this.brandingName=n}getItem(t,n,r,i){const o=this.nativeStorage.getItem(this.makeKey(t));if(o!==null)try{const s=r?r(o):o;return i?i(s):s}catch(s){console.error(`Failed parsing user setting "${t}": ${s}`)}return typeof n>"u"?null:n}getObjectItem(t,n){return this.getItem(t,n,r=>JSON.parse(r))}getBooleanProperty(t,n,r){this.getProperty(t,n,r,i=>i==="true")}getIntProperty(t,n,r){this.getProperty(t,n,r,parseInt)}getStringProperty(t,n,r){this.getProperty(t,n,r,i=>i)}getArrayProperty(t,n,r,i){this.getProperty(t,n,r,o=>{const s=JSON.parse(o);if(Array.isArray(s))return s;const a=r[t];return Array.isArray(a)?a:[]},i)}getObjectProperty(t,n,r){this.getProperty(t,n,r,i=>{const o=JSON.parse(i),s=r[t],a={...s,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=s[l],u=o[l];GO(c)&&GO(u)&&(a[l]={...c,...u})}),a})}getProperty(t,n,r,i,o){n[t]=this.getItem(t,r[t],i,o)}setItem(t,n,r){if(typeof n>"u"||n===null)this.nativeStorage.removeItem(this.makeKey(t));else{const i=r?r(n):n+"";this.nativeStorage.setItem(this.makeKey(t),i)}}setObjectItem(t,n){this.setItem(t,n,r=>JSON.stringify(r))}setPrimitiveProperty(t,n){this.setItem(t,n[t])}setArrayProperty(t,n){this.setObjectItem(t,n[t])}setObjectProperty(t,n){this.setObjectItem(t,n[t])}makeKey(t){return`xcube.${this.brandingName}.${t}`}}function hPt(e){const t=TT(On.instance.name);if(t)try{t.setObjectItem("userServers",e)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function pPt(){const e=TT(On.instance.name);if(e)try{return e.getObjectItem("userServers",[])}catch(t){console.warn(`failed to load user servers: ${t}`)}return[]}function gPt(e){const t=TT(On.instance.name);if(t)try{t.setObjectItem("userVariables",e)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function mPt(){const e=TT(On.instance.name);if(e)try{return e.getObjectItem("userVariables",{})}catch(t){console.warn(`failed to load user variables: ${t}`)}return{}}function Gh(e){const t=TT(On.instance.name);if(t)try{t.setPrimitiveProperty("locale",e),t.setPrimitiveProperty("privacyNoticeAccepted",e),t.setPrimitiveProperty("autoShowTimeSeries",e),t.setPrimitiveProperty("timeSeriesIncludeStdev",e),t.setPrimitiveProperty("timeSeriesChartTypeDefault",e),t.setPrimitiveProperty("timeSeriesUseMedian",e),t.setPrimitiveProperty("timeAnimationInterval",e),t.setPrimitiveProperty("timeChunkSize",e),t.setPrimitiveProperty("sidePanelOpen",e),t.setPrimitiveProperty("sidePanelId",e),t.setPrimitiveProperty("sidePanelSize",e),t.setPrimitiveProperty("volumeRenderMode",e),t.setObjectProperty("layerVisibilities",e),t.setObjectProperty("infoCardElementStates",e),t.setPrimitiveProperty("imageSmoothingEnabled",e),t.setPrimitiveProperty("mapProjection",e),t.setArrayProperty("userBaseMaps",e),t.setArrayProperty("userOverlays",e),t.setArrayProperty("userColorBars",e),t.setPrimitiveProperty("userDrawnPlaceGroupName",e),t.setPrimitiveProperty("datasetLocateMode",e),t.setPrimitiveProperty("placeLocateMode",e),t.setPrimitiveProperty("exportTimeSeries",e),t.setPrimitiveProperty("exportTimeSeriesSeparator",e),t.setPrimitiveProperty("exportPlaces",e),t.setPrimitiveProperty("exportPlacesAsCollection",e),t.setPrimitiveProperty("exportZipArchive",e),t.setPrimitiveProperty("exportFileName",e),t.setPrimitiveProperty("userPlacesFormatName",e),t.setObjectProperty("userPlacesFormatOptions",e),t.setPrimitiveProperty("themeMode",e),t.setPrimitiveProperty("exportResolution",e),t.setPrimitiveProperty("showProgressBar",e),t.setPrimitiveProperty("showZoomInfoBox",e)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function vPt(e){const t=TT(On.instance.name);if(t){const n={...e};try{t.getStringProperty("locale",n,e),t.getBooleanProperty("privacyNoticeAccepted",n,e),t.getBooleanProperty("autoShowTimeSeries",n,e),t.getBooleanProperty("timeSeriesIncludeStdev",n,e),t.getStringProperty("timeSeriesChartTypeDefault",n,e),t.getBooleanProperty("timeSeriesUseMedian",n,e),t.getIntProperty("timeAnimationInterval",n,e),t.getIntProperty("timeChunkSize",n,e),t.getBooleanProperty("sidePanelOpen",n,e),t.getStringProperty("sidePanelId",n,e),t.getIntProperty("sidePanelSize",n,e),t.getStringProperty("volumeRenderMode",n,e),t.getObjectProperty("infoCardElementStates",n,e),t.getObjectProperty("layerVisibilities",n,e),t.getBooleanProperty("imageSmoothingEnabled",n,e),t.getStringProperty("mapProjection",n,e),t.getArrayProperty("userBaseMaps",n,e),t.getArrayProperty("userOverlays",n,e),t.getArrayProperty("userColorBars",n,e,yPt),t.getStringProperty("userDrawnPlaceGroupName",n,e),t.getStringProperty("datasetLocateMode",n,e),t.getStringProperty("placeLocateMode",n,e),t.getBooleanProperty("exportTimeSeries",n,e),t.getStringProperty("exportTimeSeriesSeparator",n,e),t.getBooleanProperty("exportPlaces",n,e),t.getBooleanProperty("exportPlacesAsCollection",n,e),t.getBooleanProperty("exportZipArchive",n,e),t.getStringProperty("exportFileName",n,e),t.getStringProperty("userPlacesFormatName",n,e),t.getObjectProperty("userPlacesFormatOptions",n,e),t.getStringProperty("themeMode",n,e),t.getStringProperty("exportResolution",n,e)}catch(r){console.warn(`Failed to load user settings: ${r}`)}return n}else console.warn("User settings not found or access denied");return e}const dwe={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function yPt(e){if(Array.isArray(e))return e.map(t=>({...t,type:bPt(t.type)}))}function bPt(e){return sS(e)&&e in dwe?dwe[e]:"continuous"}const xPt=[250,500,1e3,2500],w4e=["light","dark","system"],wPt=[["light","Light"],["dark","Dark"],["system","System"]];function SPt(){const e=On.instance.branding,t={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:On.instance.server.id,selectedTime:null,selectedTimeRange:null,timeSeriesUpdateMode:"add",timeAnimationActive:!1,timeAnimationInterval:1e3,timeChunkSize:20,autoShowTimeSeries:!0,timeSeriesChartTypeDefault:"line",timeSeriesIncludeStdev:!0,timeSeriesUseMedian:e.defaultAgg==="median",userDrawnPlaceGroupName:"",userPlacesFormatName:"csv",userPlacesFormatOptions:{csv:{...Dte},geojson:{...Lte},wkt:{...Fte}},flyTo:null,activities:{},locale:"en",dialogOpen:{},privacyNoticeAccepted:!1,mapInteraction:"Select",lastMapInteraction:"Select",layerMenuOpen:!1,layerVisibilities:{datasetRgb:!1,datasetRgb2:!1,datasetVariable:!0,datasetVariable2:!0,datasetBoundary:!1,datasetPlaces:!0,userPlaces:!0,[xOt]:!0,...e.layerVisibilities},layerGroupStates:{overlays:!1,predefined:!0,baseMaps:!1},variableCompareMode:!1,mapPointInfoBoxEnabled:!1,datasetLocateMode:"panAndZoom",placeLocateMode:"panAndZoom",sidePanelOpen:!1,sidePanelId:"details",sidePanelSize:Math.max(window.innerWidth,window.innerHeight)/3,volumeRenderMode:"mip",volumeStates:{},infoCardElementStates:{dataset:{visible:!0,viewMode:"text"},variable:{visible:!0,viewMode:"text"},place:{visible:!0,viewMode:"text"}},mapProjection:e.mapProjection||EBe,imageSmoothingEnabled:!1,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export",themeMode:_Pt(),exportResolution:300,showProgressBar:e.showProgressBar??!0,showZoomInfoBox:e.showZoomInfoBox||!1,zoomLevel:void 0,datasetZLevel:void 0};return vPt(t)}function _Pt(){const e=On.instance.branding.themeMode;return e&&w4e.includes(e)?e:"system"}function S4e(e,t){return t||(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),e&&w4e.includes(e)&&e!=="system"?e:t}const Qs={},CPt=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,OPt=e=>{let t;if(e.includes(",")){const r=e.split(",");if(r.length===3||r.length===4){const i=[0,0,0,255];for(let o=0;o<3;o++){const s=Number.parseInt(r[o]);if(s<0||s>255)return;i[o]=s}if(r.length===4){if(t=hwe(r[3]),t===void 0)return;i[3]=t}return i}if(r.length!==2||(e=r[0],t=hwe(r[1]),t===void 0))return}const n=(e.startsWith("#")?C4e:TPt)(e);if(n){if(n.length===3)return[...n,t===void 0?255:t];if(n.length===4&&t===void 0)return n}};function _4e(e){return"#"+e.map(t=>{const n=t.toString(16);return n.length===1?"0"+n:n}).join("")}function C4e(e){if(CPt.test(e)){if(e.length===4)return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e.length===7)return[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];if(e.length===9)return[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16),parseInt(e.substring(7,9),16)]}}const hwe=e=>{const t=Number.parseFloat(e);if(t===0)return 0;if(t===1)return 255;if(t>0&&t<1)return Math.round(256*t)},EPt=e=>PPt[e.toLowerCase()],TPt=e=>{const t=EPt(e);if(t)return C4e(t)},PPt={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};function kPt(e){return Ph(`${e}/colorbars`,MPt)}function MPt(e){const t=[],n={},r={};return e.forEach(i=>{const[o,s,a]=i,l=[];a.forEach(c=>{if(c.length===3){const[u,f,d]=c;l.push(u),n[u]=f,r[u]={name:d.name,type:d.type,colorRecords:d.colors.map(APt)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),t.push({title:o,description:s,names:l})}),{groups:t,images:n,customColorMaps:r}}function APt(e){const t=RPt(e[1]),n=e[0];if(e.length===3){const r=e[2];return{value:n,color:t,label:r}}else return{value:n,color:t}}function RPt(e){return e?sS(e)?e:_4e(e):"#000000"}function IPt(e,t){const n=Cv(`${e}/datasets`,[["details","1"]]),r=Eb(t);return Ph(n,r,DPt)}function DPt(e){return{datasets:(e.datasets||[]).map(LPt),entrypointDatasetId:e.entrypointDatasetId}}function LPt(e){if(e.dimensions&&e.dimensions.length){let t=e.dimensions;const n=t.findIndex(r=>r.name==="time");if(n>-1){const r=t[n],i=r.coordinates;if(i&&i.length&&typeof i[0]=="string"){const o=i,s=o.map(a=>new Date(a).getTime());return t=[...t],t[n]={...r,coordinates:s,labels:o},{...e,dimensions:t}}}}return e}function FPt(e,t,n,r){const i=Eb(r),o=encodeURIComponent(t),s=encodeURIComponent(n);return Ph(`${e}/datasets/${o}/places/${s}`,i)}function $Pt(e){return Ph(`${e}/expressions/capabilities`)}function NPt(e){return Ph(`${e}/`)}function dD(e){return sS(e.expression)}function PT(e){return encodeURIComponent(sS(e)?e:e.id)}function hD(e){return encodeURIComponent(sS(e)?e:dD(e)?`${e.name}=${e.expression}`:e.name)}function zPt(e,t,n,r,i,o,s,a,l,c){let u,f=null;const d=[];a?(d.push(["aggMethods","median"]),u="median"):l?(d.push(["aggMethods","mean,std"]),u="mean",f="std"):(d.push(["aggMethods","mean"]),u="mean"),o&&d.push(["startDate",o]),s&&d.push(["endDate",s]);const h=Cv(`${e}/timeseries/${PT(t)}/${hD(n)}`,d),p={...Eb(c),method:"post",body:JSON.stringify(i)};return Ph(h,p,m=>{const v=m.result;if(!v||v.length===0)return null;const y=v.map(w=>({...w,time:new Date(w.time).getTime()}));return{source:{datasetId:t.id,datasetTitle:t.title,variableName:n.name,variableUnits:n.units||void 0,placeId:r,geometry:i,valueDataKey:u,errorDataKey:f},data:y}})}function jPt(e,t,n,r,i,o){const s=i!==null?[["time",i]]:[],a=Cv(`${e}/statistics/${PT(t)}/${hD(n)}`,s),l={...Eb(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:t,variable:n,placeInfo:r,time:i};return Ph(a,l,u=>({source:c,statistics:u.result}))}function BPt(e,t,n,r,i,o,s){const a=[["lon",r.toString()],["lat",i.toString()]];o&&a.push(["time",o]);const l=Cv(`${e}/statistics/${PT(t)}/${hD(n)}`,a);return Ph(l,Eb(s),c=>c.result?c.result:{})}function UPt(e,t){const n=Cv(`${e}/maintenance/update`,[]),r=Eb(t);try{return Ph(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}function VPt(e,t,n){const r=Cv(`${e}/viewer/state`,[["key",n]]);return Ph(r,Eb(t)).then(i=>i).catch(i=>`${i}`)}function WPt(e,t,n){const r=Cv(`${e}/viewer/state`,[]),i={...Eb(t),method:"PUT",body:JSON.stringify(n)};try{return Ph(r,i).then(o=>o.key).catch(o=>{console.error(o)})}catch(o){return console.error(o),Promise.resolve(void 0)}}const _i={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};var HPt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),O4e=(function(e){HPt(t,e);function t(n){var r=e.call(this)||this;r.on,r.once,r.un,r.background_=n.background;var i=bo({},n);return typeof n.properties=="object"&&(delete i.properties,bo(i,n.properties)),i[_i.OPACITY]=n.opacity!==void 0?n.opacity:1,mr(typeof i[_i.OPACITY]=="number",64),i[_i.VISIBLE]=n.visible!==void 0?n.visible:!0,i[_i.Z_INDEX]=n.zIndex,i[_i.MAX_RESOLUTION]=n.maxResolution!==void 0?n.maxResolution:1/0,i[_i.MIN_RESOLUTION]=n.minResolution!==void 0?n.minResolution:0,i[_i.MIN_ZOOM]=n.minZoom!==void 0?n.minZoom:-1/0,i[_i.MAX_ZOOM]=n.maxZoom!==void 0?n.maxZoom:1/0,r.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,r.setProperties(i),r.state_=null,r}return t.prototype.getBackground=function(){return this.background_},t.prototype.getClassName=function(){return this.className_},t.prototype.getLayerState=function(n){var r=this.state_||{layer:this,managed:n===void 0?!0:n},i=this.getZIndex();return r.opacity=hs(Math.round(this.getOpacity()*100)/100,0,1),r.visible=this.getVisible(),r.extent=this.getExtent(),r.zIndex=i===void 0&&!r.managed?1/0:i,r.maxResolution=this.getMaxResolution(),r.minResolution=Math.max(this.getMinResolution(),0),r.minZoom=this.getMinZoom(),r.maxZoom=this.getMaxZoom(),this.state_=r,r},t.prototype.getLayersArray=function(n){return mn()},t.prototype.getLayerStatesArray=function(n){return mn()},t.prototype.getExtent=function(){return this.get(_i.EXTENT)},t.prototype.getMaxResolution=function(){return this.get(_i.MAX_RESOLUTION)},t.prototype.getMinResolution=function(){return this.get(_i.MIN_RESOLUTION)},t.prototype.getMinZoom=function(){return this.get(_i.MIN_ZOOM)},t.prototype.getMaxZoom=function(){return this.get(_i.MAX_ZOOM)},t.prototype.getOpacity=function(){return this.get(_i.OPACITY)},t.prototype.getSourceState=function(){return mn()},t.prototype.getVisible=function(){return this.get(_i.VISIBLE)},t.prototype.getZIndex=function(){return this.get(_i.Z_INDEX)},t.prototype.setBackground=function(n){this.background_=n,this.changed()},t.prototype.setExtent=function(n){this.set(_i.EXTENT,n)},t.prototype.setMaxResolution=function(n){this.set(_i.MAX_RESOLUTION,n)},t.prototype.setMinResolution=function(n){this.set(_i.MIN_RESOLUTION,n)},t.prototype.setMaxZoom=function(n){this.set(_i.MAX_ZOOM,n)},t.prototype.setMinZoom=function(n){this.set(_i.MIN_ZOOM,n)},t.prototype.setOpacity=function(n){mr(typeof n=="number",64),this.set(_i.OPACITY,n)},t.prototype.setVisible=function(n){this.set(_i.VISIBLE,n)},t.prototype.setZIndex=function(n){this.set(_i.Z_INDEX,n)},t.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),e.prototype.disposeInternal.call(this)},t})(vg);const k0={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var GPt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),gU=(function(e){GPt(t,e);function t(n){var r=this,i=bo({},n);delete i.source,r=e.call(this,i)||this,r.on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,n.render&&(r.render=n.render),n.map&&r.setMap(n.map),r.addChangeListener(_i.SOURCE,r.handleSourcePropertyChange_);var o=n.source?n.source:null;return r.setSource(o),r}return t.prototype.getLayersArray=function(n){var r=n||[];return r.push(this),r},t.prototype.getLayerStatesArray=function(n){var r=n||[];return r.push(this.getLayerState()),r},t.prototype.getSource=function(){return this.get(_i.SOURCE)||null},t.prototype.getRenderSource=function(){return this.getSource()},t.prototype.getSourceState=function(){var n=this.getSource();return n?n.getState():"undefined"},t.prototype.handleSourceChange_=function(){this.changed()},t.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(uo(this.sourceChangeKey_),this.sourceChangeKey_=null);var n=this.getSource();n&&(this.sourceChangeKey_=Fr(n,Xn.CHANGE,this.handleSourceChange_,this)),this.changed()},t.prototype.getFeatures=function(n){return this.renderer_?this.renderer_.getFeatures(n):new Promise(function(r){return r([])})},t.prototype.getData=function(n){return!this.renderer_||!this.rendered?null:this.renderer_.getData(n)},t.prototype.render=function(n,r){var i=this.getRenderer();if(i.prepareFrame(n))return this.rendered=!0,i.renderFrame(n,r)},t.prototype.unrender=function(){this.rendered=!1},t.prototype.setMapInternal=function(n){n||this.unrender(),this.set(_i.MAP,n)},t.prototype.getMapInternal=function(){return this.get(_i.MAP)},t.prototype.setMap=function(n){this.mapPrecomposeKey_&&(uo(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),n||this.changed(),this.mapRenderKey_&&(uo(this.mapRenderKey_),this.mapRenderKey_=null),n&&(this.mapPrecomposeKey_=Fr(n,k0.PRECOMPOSE,function(r){var i=r,o=i.frameState.layerStatesArray,s=this.getLayerState(!1);mr(!o.some(function(a){return a.layer===s.layer}),67),o.push(s)},this),this.mapRenderKey_=Fr(this,Xn.CHANGE,n.render,n),this.changed())},t.prototype.setSource=function(n){this.set(_i.SOURCE,n)},t.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},t.prototype.hasRenderer=function(){return!!this.renderer_},t.prototype.createRenderer=function(){return null},t.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),e.prototype.disposeInternal.call(this)},t})(O4e);function Z5(e,t){if(!e.visible)return!1;var n=t.resolution;if(n=e.maxResolution)return!1;var r=t.zoom;return r>e.minZoom&&r<=e.maxZoom}const $$={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var qPt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),XPt=(function(e){qPt(t,e);function t(n){var r=this,i=n||{},o=bo({},i);return delete o.preload,delete o.useInterimTilesOnError,r=e.call(this,o)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return t.prototype.getPreload=function(){return this.get($$.PRELOAD)},t.prototype.setPreload=function(n){this.set($$.PRELOAD,n)},t.prototype.getUseInterimTilesOnError=function(){return this.get($$.USE_INTERIM_TILES_ON_ERROR)},t.prototype.setUseInterimTilesOnError=function(n){this.set($$.USE_INTERIM_TILES_ON_ERROR,n)},t.prototype.getData=function(n){return e.prototype.getData.call(this,n)},t})(gU);const Qi={IDLE:0,LOADING:1,LOADED:2,ERROR:3};var YPt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),QPt=(function(e){YPt(t,e);function t(n){var r=e.call(this)||this;return r.ready=!0,r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=n,r.declutterExecutorGroup=null,r}return t.prototype.getFeatures=function(n){return mn()},t.prototype.getData=function(n){return null},t.prototype.prepareFrame=function(n){return mn()},t.prototype.renderFrame=function(n,r){return mn()},t.prototype.loadedTileCallback=function(n,r,i){n[r]||(n[r]={}),n[r][i.tileCoord.toString()]=i},t.prototype.createLoadedTileFinder=function(n,r,i){return(function(o,s){var a=this.loadedTileCallback.bind(this,i,o);return n.forEachLoadedTile(r,o,s,a)}).bind(this)},t.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){},t.prototype.getDataAtPixel=function(n,r,i){return null},t.prototype.getLayer=function(){return this.layer_},t.prototype.handleFontsChanged=function(){},t.prototype.handleImageChange_=function(n){var r=n.target;r.getState()===Qi.LOADED&&this.renderIfReadyAndVisible()},t.prototype.loadImage=function(n){var r=n.getState();return r!=Qi.LOADED&&r!=Qi.ERROR&&n.addEventListener(Xn.CHANGE,this.boundHandleImageChange_),r==Qi.IDLE&&(n.load(),r=n.getState()),r==Qi.LOADED},t.prototype.renderIfReadyAndVisible=function(){var n=this.getLayer();n&&n.getVisible()&&n.getSourceState()==="ready"&&n.changed()},t.prototype.disposeInternal=function(){delete this.layer_,e.prototype.disposeInternal.call(this)},t})(aD),KPt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),E4e=(function(e){KPt(t,e);function t(n,r,i,o){var s=e.call(this,n)||this;return s.inversePixelTransform=r,s.frameState=i,s.context=o,s}return t})(mg),ZPt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,JPt=/^([a-z]*)$|^hsla?\(.*\)$/i;function T4e(e){return typeof e=="string"?e:P4e(e)}function ekt(e){var t=document.createElement("div");if(t.style.color=e,t.style.color!==""){document.body.appendChild(t);var n=getComputedStyle(t).color;return document.body.removeChild(t),n}else return""}var tkt=(function(){var e=1024,t={},n=0;return(function(r){var i;if(t.hasOwnProperty(r))i=t[r];else{if(n>=e){var o=0;for(var s in t)(o++&3)===0&&(delete t[s],--n)}i=nkt(r),t[r]=i,++n}return i})})();function J5(e){return Array.isArray(e)?e:tkt(e)}function nkt(e){var t,n,r,i,o;if(JPt.exec(e)&&(e=ekt(e)),ZPt.exec(e)){var s=e.length-1,a=void 0;s<=4?a=1:a=2;var l=s===4||s===8;t=parseInt(e.substr(1+0*a,a),16),n=parseInt(e.substr(1+1*a,a),16),r=parseInt(e.substr(1+2*a,a),16),l?i=parseInt(e.substr(1+3*a,a),16):i=255,a==1&&(t=(t<<4)+t,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[t,n,r,i/255]}else e.indexOf("rgba(")==0?(o=e.slice(5,-1).split(",").map(Number),pwe(o)):e.indexOf("rgb(")==0?(o=e.slice(4,-1).split(",").map(Number),o.push(1),pwe(o)):mr(!1,14);return o}function pwe(e){return e[0]=hs(e[0]+.5|0,0,255),e[1]=hs(e[1]+.5|0,0,255),e[2]=hs(e[2]+.5|0,0,255),e[3]=hs(e[3],0,1),e}function P4e(e){var t=e[0];t!=(t|0)&&(t=t+.5|0);var n=e[1];n!=(n|0)&&(n=n+.5|0);var r=e[2];r!=(r|0)&&(r=r+.5|0);var i=e[3]===void 0?1:Math.round(e[3]*100)/100;return"rgba("+t+","+n+","+r+","+i+")"}function zu(e,t,n,r){var i;return n&&n.length?i=n.shift():cU?i=new OffscreenCanvas(e||300,t||300):i=document.createElement("canvas"),e&&(i.width=e),t&&(i.height=t),i.getContext("2d",r)}function k4e(e){var t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function gwe(e,t){var n=t.parentNode;n&&n.replaceChild(e,t)}function $te(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}function rkt(e){for(;e.lastChild;)e.removeChild(e.lastChild)}function ikt(e,t){for(var n=e.childNodes,r=0;;++r){var i=n[r],o=t[r];if(!i&&!o)break;if(i!==o){if(!i){e.appendChild(o);continue}if(!o){e.removeChild(i),--r;continue}e.insertBefore(o,i)}}}var okt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),mwe=[],wC=null;function skt(){var e=document.createElement("canvas");e.width=1,e.height=1,wC=e.getContext("2d")}var M4e=(function(e){okt(t,e);function t(n){var r=e.call(this,n)||this;return r.container=null,r.renderedResolution,r.tempTransform=Np(),r.pixelTransform=Np(),r.inversePixelTransform=Np(),r.context=null,r.containerReused=!1,r.pixelContext_=null,r.frameState=null,r}return t.prototype.getImageData=function(n,r,i){wC||skt(),wC.clearRect(0,0,1,1);var o;try{wC.drawImage(n,r,i,1,1,0,0,1,1),o=wC.getImageData(0,0,1,1).data}catch{return wC=null,null}return o},t.prototype.getBackground=function(n){var r=this.getLayer(),i=r.getBackground();return typeof i=="function"&&(i=i(n.viewState.resolution)),i||void 0},t.prototype.useContainer=function(n,r,i){var o=this.getLayer().getClassName(),s,a;if(n&&n.className===o&&(!i||n&&n.style.backgroundColor&&lS(J5(n.style.backgroundColor),J5(i)))){var l=n.firstElementChild;l instanceof HTMLCanvasElement&&(a=l.getContext("2d"))}if(a&&a.canvas.style.transform===r?(this.container=n,this.context=a,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){s=document.createElement("div"),s.className=o;var c=s.style;c.position="absolute",c.width="100%",c.height="100%",a=zu();var l=a.canvas;s.appendChild(l),c=l.style,c.position="absolute",c.left="0",c.transformOrigin="top left",this.container=s,this.context=a}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)},t.prototype.clipUnrotated=function(n,r,i){var o=uS(i),s=Ple(i),a=Tle(i),l=Ele(i);Xo(r.coordinateToPixelTransform,o),Xo(r.coordinateToPixelTransform,s),Xo(r.coordinateToPixelTransform,a),Xo(r.coordinateToPixelTransform,l);var c=this.inversePixelTransform;Xo(c,o),Xo(c,s),Xo(c,a),Xo(c,l),n.save(),n.beginPath(),n.moveTo(Math.round(o[0]),Math.round(o[1])),n.lineTo(Math.round(s[0]),Math.round(s[1])),n.lineTo(Math.round(a[0]),Math.round(a[1])),n.lineTo(Math.round(l[0]),Math.round(l[1])),n.clip()},t.prototype.dispatchRenderEvent_=function(n,r,i){var o=this.getLayer();if(o.hasListener(n)){var s=new E4e(n,this.inversePixelTransform,i,r);o.dispatchEvent(s)}},t.prototype.preRender=function(n,r){this.frameState=r,this.dispatchRenderEvent_(k0.PRERENDER,n,r)},t.prototype.postRender=function(n,r){this.dispatchRenderEvent_(k0.POSTRENDER,n,r)},t.prototype.getRenderTransform=function(n,r,i,o,s,a,l){var c=s/2,u=a/2,f=o/r,d=-f,h=-n[0]+l,p=-n[1];return fv(this.tempTransform,c,u,f,d,-i,h,p)},t.prototype.getDataAtPixel=function(n,r,i){var o=Xo(this.inversePixelTransform,n.slice()),s=this.context,a=this.getLayer(),l=a.getExtent();if(l){var c=Xo(r.pixelToCoordinateTransform,n.slice());if(!lD(l,c))return null}var u=Math.round(o[0]),f=Math.round(o[1]),d=this.pixelContext_;if(!d){var h=document.createElement("canvas");h.width=1,h.height=1,d=h.getContext("2d"),this.pixelContext_=d}d.clearRect(0,0,1,1);var p;try{d.drawImage(s.canvas,u,f,1,1,0,0,1,1),p=d.getImageData(0,0,1,1).data}catch(g){return g.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):p}return p[3]===0?null:p},t.prototype.disposeInternal=function(){delete this.frameState,e.prototype.disposeInternal.call(this)},t})(QPt);const $n={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function A4e(e){return Math.pow(e,3)}function kT(e){return 1-A4e(1-e)}function akt(e){return 3*e*e-2*e*e*e}function lkt(e){return e}var ckt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),R4e=(function(e){ckt(t,e);function t(n,r,i){var o=e.call(this)||this,s=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=s.transition===void 0?250:s.transition,o.transitionStarts_={},o.interpolate=!!s.interpolate,o}return t.prototype.changed=function(){this.dispatchEvent(Xn.CHANGE)},t.prototype.release=function(){},t.prototype.getKey=function(){return this.key+"/"+this.tileCoord},t.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==$n.LOADED)return this.transition_=0,n;n=n.interimTile}while(n);return this},t.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,r=this;do{if(n.getState()==$n.LOADED){n.interimTile=null;break}else n.getState()==$n.LOADING?r=n:n.getState()==$n.IDLE?r.interimTile=n.interimTile:r=n;n=r.interimTile}while(n)}},t.prototype.getTileCoord=function(){return this.tileCoord},t.prototype.getState=function(){return this.state},t.prototype.setState=function(n){if(this.state!==$n.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},t.prototype.load=function(){mn()},t.prototype.getAlpha=function(n,r){if(!this.transition_)return 1;var i=this.transitionStarts_[n];if(!i)i=r,this.transitionStarts_[n]=i;else if(i===-1)return 1;var o=r-i+1e3/60;return o>=this.transition_?1:A4e(o/this.transition_)},t.prototype.inTransition=function(n){return this.transition_?this.transitionStarts_[n]!==-1:!1},t.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},t})(_T),ukt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),fkt=(function(e){ukt(t,e);function t(n,r,i,o){var s=e.call(this)||this;return s.extent=n,s.pixelRatio_=i,s.resolution=r,s.state=o,s}return t.prototype.changed=function(){this.dispatchEvent(Xn.CHANGE)},t.prototype.getExtent=function(){return this.extent},t.prototype.getImage=function(){return mn()},t.prototype.getPixelRatio=function(){return this.pixelRatio_},t.prototype.getResolution=function(){return this.resolution},t.prototype.getState=function(){return this.state},t.prototype.load=function(){mn()},t})(_T),dkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){dkt(t,e);function t(n,r,i,o,s,a){var l=e.call(this,n,r,i,Qi.IDLE)||this;return l.src_=o,l.image_=new Image,s!==null&&(l.image_.crossOrigin=s),l.unlisten_=null,l.state=Qi.IDLE,l.imageLoadFunction_=a,l}return t.prototype.getImage=function(){return this.image_},t.prototype.handleImageError_=function(){this.state=Qi.ERROR,this.unlistenImage_(),this.changed()},t.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Yf(this.extent)/this.image_.height),this.state=Qi.LOADED,this.unlistenImage_(),this.changed()},t.prototype.load=function(){(this.state==Qi.IDLE||this.state==Qi.ERROR)&&(this.state=Qi.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Yle(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},t.prototype.setImage=function(n){this.image_=n,this.resolution=Yf(this.extent)/this.image_.height},t.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},t})(fkt);function Yle(e,t,n){var r=e,i=!0,o=!1,s=!1,a=[W5(r,Xn.LOAD,function(){s=!0,o||t()})];return r.src&&FOt?(o=!0,r.decode().then(function(){i&&t()}).catch(function(l){i&&(s?t():n())})):a.push(W5(r,Xn.ERROR,n)),function(){i=!1,a.forEach(uo)}}var hkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Qle=(function(e){hkt(t,e);function t(n,r,i,o,s,a){var l=e.call(this,n,r,a)||this;return l.crossOrigin_=o,l.src_=i,l.key=i,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=s,l}return t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(n){this.image_=n,this.state=$n.LOADED,this.unlistenImage_(),this.changed()},t.prototype.handleImageError_=function(){this.state=$n.ERROR,this.unlistenImage_(),this.image_=pkt(),this.changed()},t.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=$n.LOADED:this.state=$n.EMPTY,this.unlistenImage_(),this.changed()},t.prototype.load=function(){this.state==$n.ERROR&&(this.state=$n.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==$n.IDLE&&(this.state=$n.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Yle(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},t.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},t})(R4e);function pkt(){var e=zu(1,1);return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),e.canvas}var gkt=.5,mkt=10,vwe=.25,vkt=(function(){function e(t,n,r,i,o,s){this.sourceProj_=t,this.targetProj_=n;var a={},l=UA(this.targetProj_,this.sourceProj_);this.transformInv_=function(b){var w=b[0]+"/"+b[1];return a[w]||(a[w]=l(b)),a[w]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&so(i)==so(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?so(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?so(this.targetProj_.getExtent()):null;var c=uS(r),u=Ple(r),f=Tle(r),d=Ele(r),h=this.transformInv_(c),p=this.transformInv_(u),g=this.transformInv_(f),m=this.transformInv_(d),v=mkt+(s?Math.max(0,Math.ceil(QOt(Ste(r)/(s*s*256*256)))):0);if(this.addQuad_(c,u,f,d,h,p,g,m,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(b,w,S){y=Math.min(y,b.source[0][0],b.source[1][0],b.source[2][0])}),this.triangles_.forEach((function(b){if(Math.max(b.source[0][0],b.source[1][0],b.source[2][0])-y>this.sourceWorldWidth_/2){var w=[[b.source[0][0],b.source[0][1]],[b.source[1][0],b.source[1][1]],[b.source[2][0],b.source[2][1]]];w[0][0]-y>this.sourceWorldWidth_/2&&(w[0][0]-=this.sourceWorldWidth_),w[1][0]-y>this.sourceWorldWidth_/2&&(w[1][0]-=this.sourceWorldWidth_),w[2][0]-y>this.sourceWorldWidth_/2&&(w[2][0]-=this.sourceWorldWidth_);var S=Math.min(w[0][0],w[1][0],w[2][0]),_=Math.max(w[0][0],w[1][0],w[2][0]);_-S.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var g=J1e([t,n,r,i]),m=so(g)/this.targetWorldWidth_;p=m>vwe||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>vwe||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!Il(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(s[0])||!isFinite(s[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),v!=1&&v!=2&&v!=4&&v!=8)return}if(c>0){if(!p){var y=[(t[0]+r[0])/2,(t[1]+r[1])/2],b=this.transformInv_(y),w=void 0;if(h){var S=(P0(o[0],d)+P0(a[0],d))/2;w=S-P0(b[0],d)}else w=(o[0]+a[0])/2-b[0];var _=(o[1]+a[1])/2-b[1],E=w*w+_*_;p=E>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var T=[(n[0]+r[0])/2,(n[1]+r[1])/2],k=this.transformInv_(T),P=[(i[0]+t[0])/2,(i[1]+t[1])/2],R=this.transformInv_(P);this.addQuad_(t,n,T,P,o,s,k,R,c-1),this.addQuad_(P,T,r,i,R,k,a,l,c-1)}else{var I=[(t[0]+n[0])/2,(t[1]+n[1])/2],F=this.transformInv_(I),A=[(r[0]+i[0])/2,(r[1]+i[1])/2],L=this.transformInv_(A);this.addQuad_(t,I,A,i,o,F,L,l,c-1),this.addQuad_(I,n,r,A,F,s,a,L,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(v&11)==0&&this.addTriangle_(t,r,i,o,a,l),(v&14)==0&&this.addTriangle_(t,r,n,o,a,s),v&&((v&13)==0&&this.addTriangle_(n,i,t,s,l,o),(v&7)==0&&this.addTriangle_(n,i,r,s,l,a))}},e.prototype.calculateSourceExtent=function(){var t=Nu();return this.triangles_.forEach(function(n,r,i){var o=n.source;GM(t,o[0]),GM(t,o[1]),GM(t,o[2])}),t},e.prototype.getTriangles=function(){return this.triangles_},e})(),Nte={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},ykt={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},C9,I4e=[];function ywe(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore()}function O9(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function bkt(){if(C9===void 0){var e=document.createElement("canvas").getContext("2d");e.globalCompositeOperation="lighter",e.fillStyle="rgba(210, 0, 0, 0.75)",ywe(e,4,5,4,0),ywe(e,4,5,0,5);var t=e.getImageData(0,0,3,3).data;C9=O9(t,0)||O9(t,4)||O9(t,8)}return C9}function zte(e,t,n,r){var i=uU(n,t,e),o=q5(t,r,n),s=t.getMetersPerUnit();s!==void 0&&(o*=s);var a=e.getMetersPerUnit();a!==void 0&&(o/=a);var l=e.getExtent();if(!l||lD(l,i)){var c=q5(e,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function xkt(e,t,n,r){var i=X0(n),o=zte(e,t,i,r);return(!isFinite(o)||o<=0)&&Ole(n,function(s){return o=zte(e,t,s,r),isFinite(o)&&o>0}),o}function wkt(e,t,n,r,i,o,s,a,l,c,u,f){var d=zu(Math.round(n*e),Math.round(n*t),I4e);if(f||bo(d,Nte),l.length===0)return d.canvas;d.scale(n,n);function h(w){return Math.round(w*n)/n}d.globalCompositeOperation="lighter";var p=Nu();l.forEach(function(w,S,_){LBe(p,w.extent)});var g=so(p),m=Yf(p),v=zu(Math.round(n*g/r),Math.round(n*m/r));f||bo(v,Nte);var y=n/r;l.forEach(function(w,S,_){var E=w.extent[0]-p[0],T=-(w.extent[3]-p[3]),k=so(w.extent),P=Yf(w.extent);w.image.width>0&&w.image.height>0&&v.drawImage(w.image,c,c,w.image.width-2*c,w.image.height-2*c,E*y,T*y,k*y,P*y)});var b=uS(s);return a.getTriangles().forEach(function(w,S,_){var E=w.source,T=w.target,k=E[0][0],P=E[0][1],R=E[1][0],I=E[1][1],F=E[2][0],A=E[2][1],L=h((T[0][0]-b[0])/o),$=h(-(T[0][1]-b[1])/o),j=h((T[1][0]-b[0])/o),V=h(-(T[1][1]-b[1])/o),U=h((T[2][0]-b[0])/o),z=h(-(T[2][1]-b[1])/o),N=k,B=P;k=0,P=0,R-=N,I-=B,F-=N,A-=B;var H=[[R,I,0,0,j-L],[F,A,0,0,U-L],[0,0,R,I,V-$],[0,0,F,A,z-$]],Q=ZOt(H);if(Q){if(d.save(),d.beginPath(),bkt()||!f){d.moveTo(j,V);for(var Y=4,Z=L-j,pe=$-V,ie=0;iethis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},e.prototype.getHeight=function(){return this.maxY-this.minY+1},e.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},e.prototype.getWidth=function(){return this.maxX-this.minX+1},e.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},e})();function b_(e,t,n,r,i){return i!==void 0?(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i):new Kle(e,t,n,r)}function bwe(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]+2*t,n[1]=e[1]+2*t,n}function xwe(e){return e[0]>0&&e[1]>0}function L4e(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function xu(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var _kt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ckt=(function(e){_kt(t,e);function t(n){var r=e.call(this,n)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Nu(),r.tmpTileRange_=new Kle(0,0,0,0),r}return t.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==$n.LOADED||i==$n.EMPTY||i==$n.ERROR&&!o},t.prototype.getTile=function(n,r,i,o){var s=o.pixelRatio,a=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,s,a);return u.getState()==$n.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState($n.LOADED)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},t.prototype.getData=function(n){var r=this.frameState;if(!r)return null;var i=this.getLayer(),o=Xo(r.pixelToCoordinateTransform,n.slice()),s=i.getExtent();if(s&&!lD(s,o))return null;for(var a=r.pixelRatio,l=r.viewState.projection,c=r.viewState,u=i.getRenderSource(),f=u.getTileGridForProjection(c.projection),d=u.getTilePixelRatio(r.pixelRatio),h=f.getZForResolution(c.resolution);h>=f.getMinZoom();--h){var p=f.getTileCoordForCoordAndZ(o,h),g=u.getTile(h,p[1],p[2],a,l);if(!(g instanceof Qle||g instanceof D4e))return null;if(g.getState()===$n.LOADED){var m=f.getOrigin(h),v=xu(f.getTileSize(h)),y=f.getResolution(h),b=Math.floor(d*((o[0]-m[0])/y-p[1]*v[0])),w=Math.floor(d*((m[1]-o[1])/y-p[2]*v[1])),S=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(g.getImage(),b+S,w+S)}}return null},t.prototype.loadedTileCallback=function(n,r,i){return this.isDrawableTile(i)?e.prototype.loadedTileCallback.call(this,n,r,i):!1},t.prototype.prepareFrame=function(n){return!!this.getLayer().getSource()},t.prototype.renderFrame=function(n,r){var i=n.layerStatesArray[n.layerIndex],o=n.viewState,s=o.projection,a=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(s),g=p.getZForResolution(a,d.zDirection),m=p.getResolution(g),v=n.extent,y=n.viewState.resolution,b=d.getTilePixelRatio(u),w=Math.round(so(v)/y*u),S=Math.round(Yf(v)/y*u),_=i.extent&&h1(i.extent);_&&(v=qM(v,h1(i.extent)));var E=m*w/2/b,T=m*S/2/b,k=[l[0]-E,l[1]-T,l[0]+E,l[1]+T],P=p.getTileRangeForExtentAndZ(v,g),R={};R[g]={};var I=this.createLoadedTileFinder(d,s,R),F=this.tmpExtent,A=this.tmpTileRange_;this.newTiles_=!1;for(var L=c?Cte(o.center,y,c,n.size):void 0,$=P.minX;$<=P.maxX;++$)for(var j=P.minY;j<=P.maxY;++j)if(!(c&&!p.tileCoordIntersectsViewport([g,$,j],L))){var V=this.getTile(g,$,j,n);if(this.isDrawableTile(V)){var U=oi(this);if(V.getState()==$n.LOADED){R[g][V.tileCoord.toString()]=V;var z=V.inTransition(U);z&&i.opacity!==1&&(V.endTransition(U),z=!1),!this.newTiles_&&(z||this.renderedTiles.indexOf(V)===-1)&&(this.newTiles_=!0)}if(V.getAlpha(U,n.time)===1)continue}var N=p.getTileCoordChildTileRange(V.tileCoord,A,F),B=!1;N&&(B=I(g+1,N)),B||p.forEachTileCoordParentTileRange(V.tileCoord,I,A,F)}var H=m/a*u/b;fv(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-w/2,-S/2);var Q=RBe(this.pixelTransform);this.useContainer(r,Q,this.getBackground(n));var Y=this.context,Z=Y.canvas;_le(this.inversePixelTransform,this.pixelTransform),fv(this.tempTransform,w/2,S/2,H,H,0,-w/2,-S/2),Z.width!=w||Z.height!=S?(Z.width=w,Z.height=S):this.containerReused||Y.clearRect(0,0,w,S),_&&this.clipUnrotated(Y,n,_),d.getInterpolate()||bo(Y,Nte),this.preRender(Y,n),this.renderedTiles.length=0;var pe=Object.keys(R).map(Number);pe.sort(aw);var ie,ne,fe;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?pe=pe.reverse():(ie=[],ne=[]);for(var me=pe.length-1;me>=0;--me){var se=pe[me],ue=d.getTilePixelSize(se,u,s),G=p.getResolution(se),ce=G/m,he=ue[0]*ce*H,J=ue[1]*ce*H,te=p.getTileCoordForCoordAndZ(uS(k),se),ae=p.getTileCoordExtent(te),we=Xo(this.tempTransform,[b*(ae[0]-k[0])/m,b*(k[3]-ae[3])/m]),Pe=b*d.getGutterForProjection(s),ee=R[se];for(var oe in ee){var V=ee[oe],Se=V.tileCoord,ye=te[1]-Se[1],be=Math.round(we[0]-(ye-1)*he),ge=te[2]-Se[2],xe=Math.round(we[1]-(ge-1)*J),$=Math.round(we[0]-ye*he),j=Math.round(we[1]-ge*J),re=be-$,Ee=xe-j,ke=g===se,z=ke&&V.getAlpha(oi(this),n.time)!==1,je=!1;if(!z)if(ie){fe=[$,j,$+re,j,$+re,j+Ee,$,j+Ee];for(var De=0,ze=ie.length;De"u")throw new ej(`assertion failed: ${t} must not be undefined`)}function Pkt(e,t){Ekt(e,t),Tkt(e,t)}function E9(e,t){if(Array.isArray(e)){if(e.length===0)throw new ej(`assertion failed: ${t} must be a non-empty array`)}else throw new ej(`assertion failed: ${t} must be an array`)}function dO(e,t){return t&&e.find(n=>n.id===t)||null}function jte(e,t){return t&&e.variables.find(n=>n.name===t)||null}function kkt(e){return e.variables.findIndex(t=>sS(t.expression))}function Jle(e){const t=kkt(e);return t>=0?[e.variables.slice(0,t),e.variables.slice(t)]:[e.variables,[]]}function F4e(e){Pkt(e,"dataset"),E9(e.dimensions,"dataset.dimensions");const t=e.dimensions.find(n=>n.name==="time");return t?(E9(t.coordinates,"timeDimension.coordinates"),E9(t.labels,"timeDimension.labels"),t):null}function $4e(e){const t=F4e(e);if(!t)return null;const n=t.coordinates;return[n[0],n[n.length-1]]}const wwe=(e,t)=>{if(t){const n=e.getResolution(),r=Q2(t,"variable");return r instanceof Zle?r.getSource().getTileGrid().getZForResolution(n):void 0}};function Mkt(e){const t=e.toLowerCase();return["m","metre","metres","meter","meters"].includes(t)}function Akt(e){const t=e.toLowerCase();return["°","deg","degree","degrees","decimal_degree","decimal_degrees"].includes(t)}function Rkt(e,t){const r=2*Math.PI*6378137,i=e===iD,o=e===aS;if(!i&&!o)throw new Error(`Unsupported unit '${e}'. Unit must be either meters or degrees.`);const s=Mkt(t),a=Akt(t);if(!s&&!a)throw new Error(`Unsupported unit '${t}'. Unit must be either meters or degrees.`);return i&&a?360/r:o&&s?r/360:1}function Ikt(e,t,n,r){if(e&&t&&n&&r){let i;r===iD?i=40075017/256:i=180/256;const a=Rkt(r,t)*i/(1<=u)return l-1;for(let f=0;fr===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const D1t=2;function l_(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function i5e(e,t){return e-t}function Txe(e,t){const{index:n}=e.reduce((r,i,o)=>{const s=Math.abs(t-i);return r===null||s({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},z1t=e=>e;let h$;function kxe(){return h$===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?h$=CSS.supports("touch-action","none"):h$=!0),h$}function j1t(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=z1t,step:g=1,shiftStep:m=10,tabIndex:v,value:y}=e,b=M.useRef(void 0),[w,S]=M.useState(-1),[_,E]=M.useState(-1),[T,k]=M.useState(!1),P=M.useRef(0),I=M.useRef(null),[R,F]=Da({controlled:y,default:n??l,name:"Slider"}),A=u&&((he,xe,me)=>{const be=he.nativeEvent||he,oe=new be.constructor(be.type,be);Object.defineProperty(oe,"target",{writable:!0,value:{value:xe,name:c}}),I.current=xe,u(oe,xe,me)}),L=Array.isArray(R);let $=L?R.slice().sort(i5e):[R];$=$.map(he=>he==null?l:lC(he,l,a));const j=s===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((he,xe)=>({value:l+g*xe})):s||[],V=j.map(he=>he.value),[U,z]=M.useState(-1),N=M.useRef(null),B=zn(h,N),H=he=>xe=>{const me=Number(xe.currentTarget.getAttribute("data-index"));z0(xe.target)&&z(me),E(me),he?.onFocus?.(xe)},Q=he=>xe=>{z0(xe.target)||z(-1),E(-1),he?.onBlur?.(xe)},Y=(he,xe)=>{const me=Number(he.currentTarget.getAttribute("data-index")),be=$[me],oe=V.indexOf(be);let Ee=xe;if(j&&g==null){const ke=V[V.length-1];Ee>=ke?Ee=ke:Ee<=V[0]?Ee=V[0]:Ee=Eexe=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(xe.key)){xe.preventDefault();const me=Number(xe.currentTarget.getAttribute("data-index")),be=$[me];let oe=null;if(g!=null){const Ee=xe.shiftKey?m:g;switch(xe.key){case"ArrowUp":oe=l_(be,Ee,1,l,a);break;case"ArrowRight":oe=l_(be,Ee,o?-1:1,l,a);break;case"ArrowDown":oe=l_(be,Ee,-1,l,a);break;case"ArrowLeft":oe=l_(be,Ee,o?1:-1,l,a);break;case"PageUp":oe=l_(be,m,1,l,a);break;case"PageDown":oe=l_(be,m,-1,l,a);break;case"Home":oe=l;break;case"End":oe=a;break}}else if(j){const Ee=V[V.length-1],ke=V.indexOf(be),ze=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],De=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];ze.includes(xe.key)?ke===0?oe=V[0]:oe=V[ke-1]:De.includes(xe.key)&&(ke===V.length-1?oe=Ee:oe=V[ke+1])}oe!=null&&Y(xe,oe)}he?.onKeyDown?.(xe)};lr(()=>{r&&N.current.contains(document.activeElement)&&document.activeElement?.blur()},[r]),r&&w!==-1&&S(-1),r&&U!==-1&&z(-1);const ge=he=>xe=>{he.onChange?.(xe),Y(xe,xe.target.valueAsNumber)},ne=M.useRef(void 0);let ie=d;o&&d==="horizontal"&&(ie+="-reverse");const fe=({finger:he,move:xe=!1})=>{const{current:me}=N,{width:be,height:oe,bottom:Ee,left:ke}=me.getBoundingClientRect();let ze;ie.startsWith("vertical")?ze=(Ee-he.y)/oe:ze=(he.x-ke)/be,ie.includes("-reverse")&&(ze=1-ze);let De;if(De=L1t(ze,l,a),g)De=$1t(De,g,l);else{const Ze=Txe(V,De);De=V[Ze]}De=lC(De,l,a);let Ve=0;if(L){xe?Ve=ne.current:Ve=Txe($,De),i&&(De=lC(De,$[Ve-1]||-1/0,$[Ve+1]||1/0));const Ze=De;De=Pxe({values:$,newValue:De,index:Ve}),i&&xe||(Ve=De.indexOf(Ze),ne.current=Ve)}return{newValue:De,activeIndex:Ve}},ve=ft(he=>{const xe=u$(he,b);if(!xe)return;if(P.current+=1,he.type==="mousemove"&&he.buttons===0){se(he);return}const{newValue:me,activeIndex:be}=fe({finger:xe,move:!0});f$({sliderRef:N,activeIndex:be,setActive:S}),F(me),!T&&P.current>D1t&&k(!0),A&&!d$(me,R)&&A(he,me,be)}),se=ft(he=>{const xe=u$(he,b);if(k(!1),!xe)return;const{newValue:me}=fe({finger:xe,move:!0});S(-1),he.type==="touchend"&&E(-1),f&&f(he,I.current??me),b.current=void 0,G()}),ue=ft(he=>{if(r)return;kxe()||he.preventDefault();const xe=he.changedTouches[0];xe!=null&&(b.current=xe.identifier);const me=u$(he,b);if(me!==!1){const{newValue:oe,activeIndex:Ee}=fe({finger:me});f$({sliderRef:N,activeIndex:Ee,setActive:S}),F(oe),A&&!d$(oe,R)&&A(he,oe,Ee)}P.current=0;const be=ci(N.current);be.addEventListener("touchmove",ve,{passive:!0}),be.addEventListener("touchend",se,{passive:!0})}),G=M.useCallback(()=>{const he=ci(N.current);he.removeEventListener("mousemove",ve),he.removeEventListener("mouseup",se),he.removeEventListener("touchmove",ve),he.removeEventListener("touchend",se)},[se,ve]);M.useEffect(()=>{const{current:he}=N;return he.addEventListener("touchstart",ue,{passive:kxe()}),()=>{he.removeEventListener("touchstart",ue),G()}},[G,ue]),M.useEffect(()=>{r&&G()},[r,G]);const ce=he=>xe=>{if(he.onMouseDown?.(xe),r||xe.defaultPrevented||xe.button!==0)return;xe.preventDefault();const me=u$(xe,b);if(me!==!1){const{newValue:oe,activeIndex:Ee}=fe({finger:me});f$({sliderRef:N,activeIndex:Ee,setActive:S}),F(oe),A&&!d$(oe,R)&&A(xe,oe,Ee)}P.current=0;const be=ci(N.current);be.addEventListener("mousemove",ve,{passive:!0}),be.addEventListener("mouseup",se)},pe=x5(L?$[0]:l,l,a),J=x5($[$.length-1],l,a)-pe,te=(he={})=>{const xe=w1(he),me={onMouseDown:ce(xe||{})},be={...xe,...me};return{...he,ref:B,...be}},ae=he=>xe=>{he.onMouseOver?.(xe);const me=Number(xe.currentTarget.getAttribute("data-index"));E(me)},we=he=>xe=>{he.onMouseLeave?.(xe),E(-1)},Pe=(he={})=>{const xe=w1(he),me={onMouseOver:ae(xe||{}),onMouseLeave:we(xe||{})};return{...he,...xe,...me}},ee=he=>({pointerEvents:w!==-1&&w!==he?"none":void 0});let re;return d==="vertical"&&(re=o?"vertical-rl":"vertical-lr"),{active:w,axis:ie,axisProps:N1t,dragging:T,focusedThumbIndex:U,getHiddenInputProps:(he={})=>{const xe=w1(he),me={onChange:ge(xe||{}),onFocus:H(xe||{}),onBlur:Q(xe||{}),onKeyDown:Z(xe||{})},be={...xe,...me};return{tabIndex:v,"aria-labelledby":t,"aria-orientation":d,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:r,...he,...be,style:{...sze,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:re}}},getRootProps:te,getThumbProps:Pe,marks:j,open:_,range:L,rootRef:B,trackLeap:J,trackOffset:pe,values:$,getThumbStyle:ee}}const B1t=e=>!e||!zm(e);function U1t(e){return pt("MuiSlider",e)}const wf=dt("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),V1t=e=>{const{open:t}=e;return{offset:Re(t&&wf.valueLabelOpen),circle:wf.valueLabelCircle,label:wf.valueLabelLabel}};function W1t(e){const{children:t,className:n,value:r}=e,i=V1t(e);return t?M.cloneElement(t,{className:Re(t.props.className)},O.jsxs(M.Fragment,{children:[t.props.children,O.jsx("span",{className:Re(i.offset,n),"aria-hidden":!0,children:O.jsx("span",{className:i.circle,children:O.jsx("span",{className:i.label,children:r})})})]})):null}function Mxe(e){return e}const H1t=Oe("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Ue(n.color)}`],n.size!=="medium"&&t[`size${Ue(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(Mt(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${wf.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${wf.dragging}`]:{[`& .${wf.thumb}, & .${wf.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),G1t=Oe("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),q1t=Oe("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(Mt(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:dh(e.palette[t].main,.62),borderColor:dh(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:fh(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:fh(e.palette[t].main,.5)})}}}))]}))),X1t=Oe("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${Ue(n.color)}`],n.size!=="medium"&&t[`thumbSize${Ue(n.size)}`]]}})(Mt(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${wf.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${wf.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${Vt(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${wf.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${Vt(e.palette[t].main,.16)}`}}}}))]}))),Y1t=Oe(W1t,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(Mt(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${wf.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${wf.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),Q1t=Oe("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>k6(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(Mt(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),K1t=Oe("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>k6(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(Mt(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),Z1t=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=e,c={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Ue(a)}`,l&&`size${Ue(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Ue(l)}`,a&&`thumbColor${Ue(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Xe(c,U1t,s)},J1t=({children:e})=>e,Kw=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSlider"}),i=yi(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:f="primary",classes:d,className:h,disableSwap:p=!1,disabled:g=!1,getAriaLabel:m,getAriaValueText:v,marks:y=!1,max:b=100,min:w=0,name:S,onChange:_,onChangeCommitted:E,orientation:T="horizontal",shiftStep:k=10,size:P="medium",step:I=1,scale:R=Mxe,slotProps:F,slots:A,tabIndex:L,track:$="normal",value:j,valueLabelDisplay:V="off",valueLabelFormat:U=Mxe,...z}=r,N={...r,isRtl:i,max:b,min:w,classes:d,disabled:g,disableSwap:p,orientation:T,marks:y,color:f,size:P,step:I,shiftStep:k,scale:R,track:$,valueLabelDisplay:V,valueLabelFormat:U},{axisProps:B,getRootProps:H,getHiddenInputProps:Q,getThumbProps:Y,open:Z,active:ge,axis:ne,focusedThumbIndex:ie,range:fe,dragging:ve,marks:se,values:ue,trackOffset:G,trackLeap:ce,getThumbStyle:pe}=j1t({...N,rootRef:n});N.marked=se.length>0&&se.some(St=>St.label),N.dragging=ve,N.focusedThumbIndex=ie;const J=Z1t(N),te=A?.root??c.Root??H1t,ae=A?.rail??c.Rail??G1t,we=A?.track??c.Track??q1t,Pe=A?.thumb??c.Thumb??X1t,ee=A?.valueLabel??c.ValueLabel??Y1t,re=A?.mark??c.Mark??Q1t,Se=A?.markLabel??c.MarkLabel??K1t,he=A?.input??c.Input??"input",xe=F?.root??u.root,me=F?.rail??u.rail,be=F?.track??u.track,oe=F?.thumb??u.thumb,Ee=F?.valueLabel??u.valueLabel,ke=F?.mark??u.mark,ze=F?.markLabel??u.markLabel,De=F?.input??u.input,Ve=Xn({elementType:te,getSlotProps:H,externalSlotProps:xe,externalForwardedProps:z,additionalProps:{...B1t(te)&&{as:l}},ownerState:{...N,...xe?.ownerState},className:[J.root,h]}),Ze=Xn({elementType:ae,externalSlotProps:me,ownerState:N,className:J.rail}),mt=Xn({elementType:we,externalSlotProps:be,additionalProps:{style:{...B[ne].offset(G),...B[ne].leap(ce)}},ownerState:{...N,...be?.ownerState},className:J.track}),Me=Xn({elementType:Pe,getSlotProps:Y,externalSlotProps:oe,ownerState:{...N,...oe?.ownerState},className:J.thumb}),ct=Xn({elementType:ee,externalSlotProps:Ee,ownerState:{...N,...Ee?.ownerState},className:J.valueLabel}),Fe=Xn({elementType:re,externalSlotProps:ke,ownerState:N,className:J.mark}),ht=Xn({elementType:Se,externalSlotProps:ze,ownerState:N,className:J.markLabel}),gt=Xn({elementType:he,getSlotProps:Q,externalSlotProps:De,ownerState:N});return O.jsxs(te,{...Ve,children:[O.jsx(ae,{...Ze}),O.jsx(we,{...mt}),se.filter(St=>St.value>=w&&St.value<=b).map((St,on)=>{const Ln=x5(St.value,w,b),xi=B[ne].offset(Ln);let jn;return $===!1?jn=ue.includes(St.value):jn=$==="normal"&&(fe?St.value>=ue[0]&&St.value<=ue[ue.length-1]:St.value<=ue[0])||$==="inverted"&&(fe?St.value<=ue[0]||St.value>=ue[ue.length-1]:St.value>=ue[0]),O.jsxs(M.Fragment,{children:[O.jsx(re,{"data-index":on,...Fe,...!zm(re)&&{markActive:jn},style:{...xi,...Fe.style},className:Re(Fe.className,jn&&J.markActive)}),St.label!=null?O.jsx(Se,{"aria-hidden":!0,"data-index":on,...ht,...!zm(Se)&&{markLabelActive:jn},style:{...xi,...ht.style},className:Re(J.markLabel,ht.className,jn&&J.markLabelActive),children:St.label}):null]},on)}),ue.map((St,on)=>{const Ln=x5(St,w,b),xi=B[ne].offset(Ln),jn=V==="off"?J1t:ee;return O.jsx(jn,{...!zm(jn)&&{valueLabelFormat:U,valueLabelDisplay:V,value:typeof U=="function"?U(R(St),on):U,index:on,open:Z===on||ge===on||V==="on",disabled:g},...ct,children:O.jsx(Pe,{"data-index":on,...Me,className:Re(J.thumb,Me.className,ge===on&&J.active,ie===on&&J.focusVisible),style:{...xi,...pe(on),...Me.style},children:O.jsx(he,{"data-index":on,"aria-label":m?m(on):o,"aria-valuenow":R(St),"aria-labelledby":a,"aria-valuetext":v?v(R(St),on):s,value:ue[on],...gt})})},on)})]})});function ewt(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,s=zl();M.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||y.key==="Escape"&&r?.(y,"escapeKeyDown")}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const a=ft((v,y)=>{r?.(v,y)}),l=ft(v=>{!r||v==null||s.start(v,()=>{a(null,"timeout")})});M.useEffect(()=>(i&&l(t),s.clear),[i,t,l,s]);const c=v=>{r?.(v,"clickaway")},u=s.clear,f=M.useCallback(()=>{t!=null&&l(o??t*.5)},[t,o,l]),d=v=>y=>{const b=v.onBlur;b?.(y),f()},h=v=>y=>{const b=v.onFocus;b?.(y),u()},p=v=>y=>{const b=v.onMouseEnter;b?.(y),u()},g=v=>y=>{const b=v.onMouseLeave;b?.(y),f()};return M.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(v={})=>{const y={...w1(e),...w1(v)};return{role:"presentation",...v,...y,onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:g(y)}},onClickAway:c}}function twt(e){return pt("MuiSnackbarContent",e)}dt("MuiSnackbarContent",["root","message","action"]);const nwt=e=>{const{classes:t}=e;return Xe({root:["root"],action:["action"],message:["message"]},twt,t)},rwt=Oe(fa,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(e,t)=>t.root})(Mt(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98,n=rze(e.palette.background.default,t);return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(n),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),iwt=Oe("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0"}),owt=Oe("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),o5e=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...l}=r,c=r,u=nwt(c);return O.jsxs(rwt,{role:a,square:!0,elevation:6,className:Re(u.root,o),ownerState:c,ref:n,...l,children:[O.jsx(iwt,{className:u.message,ownerState:c,children:s}),i?O.jsx(owt,{className:u.action,ownerState:c,children:i}):null]})});function swt(e){return pt("MuiSnackbar",e)}dt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const awt=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Ue(n.vertical)}${Ue(n.horizontal)}`]};return Xe(r,swt,t)},lwt=Oe("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Ue(n.anchorOrigin.vertical)}${Ue(n.anchorOrigin.horizontal)}`]]}})(Mt(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),cwt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSnackbar"}),i=as(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:g,onBlur:m,onClose:v,onFocus:y,onMouseEnter:b,onMouseLeave:w,open:S,resumeHideDuration:_,slots:E={},slotProps:T={},TransitionComponent:k,transitionDuration:P=o,TransitionProps:{onEnter:I,onExited:R,...F}={},...A}=r,L={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:k,transitionDuration:P},$=awt(L),{getRootProps:j,onClickAway:V}=ewt({...L}),[U,z]=M.useState(!0),N=ue=>{z(!0),R&&R(ue)},B=(ue,G)=>{z(!1),I&&I(ue,G)},H={slots:{transition:k,...E},slotProps:{content:h,clickAwayListener:d,transition:F,...T}},[Q,Y]=Zt("root",{ref:n,className:[$.root,f],elementType:lwt,getSlotProps:j,externalForwardedProps:{...H,...A},ownerState:L}),[Z,{ownerState:ge,...ne}]=Zt("clickAwayListener",{elementType:Jse,externalForwardedProps:H,getSlotProps:ue=>({onClickAway:(...G)=>{ue.onClickAway?.(...G),V(...G)}}),ownerState:L}),[ie,fe]=Zt("content",{elementType:o5e,shouldForwardComponentProp:!0,externalForwardedProps:H,additionalProps:{message:g,action:s},ownerState:L}),[ve,se]=Zt("transition",{elementType:K1,externalForwardedProps:H,getSlotProps:ue=>({onEnter:(...G)=>{ue.onEnter?.(...G),B(...G)},onExited:(...G)=>{ue.onExited?.(...G),N(...G)}}),additionalProps:{appear:!0,in:S,timeout:P,direction:a==="top"?"down":"up"},ownerState:L});return!S&&U?null:O.jsx(Z,{...ne,...E.clickAwayListener&&{ownerState:ge},children:O.jsx(Q,{...Y,children:O.jsx(ve,{...se,children:u||O.jsx(ie,{...fe})})})})});function uwt(e){return pt("MuiTooltip",e)}const Fo=dt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function fwt(e){return Math.round(e*1e5)/1e5}const dwt=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${Ue(o.split("-")[0])}`],arrow:["arrow"]};return Xe(s,uwt,t)},hwt=Oe(yb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(Mt(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${Fo.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Fo.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Fo.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Fo.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Fo.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Fo.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Fo.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Fo.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),pwt=Oe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${Ue(n.placement.split("-")[0])}`]]}})(Mt(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Vt(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Fo.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Fo.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Fo.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${fwt(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Fo.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Fo.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Fo.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Fo.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Fo.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Fo.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Fo.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),gwt=Oe("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(Mt(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Vt(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let p$=!1;const Axe=new E6;let xk={x:0,y:0};function g$(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const _n=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:s,components:a={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:f=!1,disableInteractive:d=!1,disableTouchListener:h=!1,enterDelay:p=100,enterNextDelay:g=0,enterTouchDelay:m=700,followCursor:v=!1,id:y,leaveDelay:b=0,leaveTouchDelay:w=1500,onClose:S,onOpen:_,open:E,placement:T="bottom",PopperComponent:k,PopperProps:P={},slotProps:I={},slots:R={},title:F,TransitionComponent:A,TransitionProps:L,...$}=r,j=M.isValidElement(o)?o:O.jsx("span",{children:o}),V=as(),U=yi(),[z,N]=M.useState(),[B,H]=M.useState(null),Q=M.useRef(!1),Y=d||v,Z=zl(),ge=zl(),ne=zl(),ie=zl(),[fe,ve]=Da({controlled:E,default:!1,name:"Tooltip",state:"open"});let se=fe;const ue=fr(y),G=M.useRef(),ce=ft(()=>{G.current!==void 0&&(document.body.style.WebkitUserSelect=G.current,G.current=void 0),ie.clear()});M.useEffect(()=>ce,[ce]);const pe=sn=>{Axe.clear(),p$=!0,ve(!0),_&&!se&&_(sn)},J=ft(sn=>{Axe.start(800+b,()=>{p$=!1}),ve(!1),S&&se&&S(sn),Z.start(V.transitions.duration.shortest,()=>{Q.current=!1})}),te=sn=>{Q.current&&sn.type!=="touchstart"||(z&&z.removeAttribute("title"),ge.clear(),ne.clear(),p||p$&&g?ge.start(p$?g:p,()=>{pe(sn)}):pe(sn))},ae=sn=>{ge.clear(),ne.start(b,()=>{J(sn)})},[,we]=M.useState(!1),Pe=sn=>{z0(sn.target)||(we(!1),ae(sn))},ee=sn=>{z||N(sn.currentTarget),z0(sn.target)&&(we(!0),te(sn))},re=sn=>{Q.current=!0;const xr=j.props;xr.onTouchStart&&xr.onTouchStart(sn)},Se=sn=>{re(sn),ne.clear(),Z.clear(),ce(),G.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ie.start(m,()=>{document.body.style.WebkitUserSelect=G.current,te(sn)})},he=sn=>{j.props.onTouchEnd&&j.props.onTouchEnd(sn),ce(),ne.start(w,()=>{J(sn)})};M.useEffect(()=>{if(!se)return;function sn(xr){xr.key==="Escape"&&J(xr)}return document.addEventListener("keydown",sn),()=>{document.removeEventListener("keydown",sn)}},[J,se]);const xe=zn(mb(j),N,n);!F&&F!==0&&(se=!1);const me=M.useRef(),be=sn=>{const xr=j.props;xr.onMouseMove&&xr.onMouseMove(sn),xk={x:sn.clientX,y:sn.clientY},me.current&&me.current.update()},oe={},Ee=typeof F=="string";c?(oe.title=!se&&Ee&&!f?F:null,oe["aria-describedby"]=se?ue:null):(oe["aria-label"]=Ee?F:null,oe["aria-labelledby"]=se&&!Ee?ue:null);const ke={...oe,...$,...j.props,className:Re($.className,j.props.className),onTouchStart:re,ref:xe,...v?{onMouseMove:be}:{}},ze={};h||(ke.onTouchStart=Se,ke.onTouchEnd=he),f||(ke.onMouseOver=g$(te,ke.onMouseOver),ke.onMouseLeave=g$(ae,ke.onMouseLeave),Y||(ze.onMouseOver=te,ze.onMouseLeave=ae)),u||(ke.onFocus=g$(ee,ke.onFocus),ke.onBlur=g$(Pe,ke.onBlur),Y||(ze.onFocus=ee,ze.onBlur=Pe));const De={...r,isRtl:U,arrow:i,disableInteractive:Y,placement:T,PopperComponentProp:k,touch:Q.current},Ve=typeof I.popper=="function"?I.popper(De):I.popper,Ze=M.useMemo(()=>{let sn=[{name:"arrow",enabled:!!B,options:{element:B,padding:4}}];return P.popperOptions?.modifiers&&(sn=sn.concat(P.popperOptions.modifiers)),Ve?.popperOptions?.modifiers&&(sn=sn.concat(Ve.popperOptions.modifiers)),{...P.popperOptions,...Ve?.popperOptions,modifiers:sn}},[B,P.popperOptions,Ve?.popperOptions]),mt=dwt(De),Me=typeof I.transition=="function"?I.transition(De):I.transition,ct={slots:{popper:a.Popper,transition:a.Transition??A,tooltip:a.Tooltip,arrow:a.Arrow,...R},slotProps:{arrow:I.arrow??l.arrow,popper:{...P,...Ve??l.popper},tooltip:I.tooltip??l.tooltip,transition:{...L,...Me??l.transition}}},[Fe,ht]=Zt("popper",{elementType:hwt,externalForwardedProps:ct,ownerState:De,className:Re(mt.popper,P?.className)}),[gt,St]=Zt("transition",{elementType:K1,externalForwardedProps:ct,ownerState:De}),[on,Ln]=Zt("tooltip",{elementType:pwt,className:mt.tooltip,externalForwardedProps:ct,ownerState:De}),[xi,jn]=Zt("arrow",{elementType:gwt,className:mt.arrow,externalForwardedProps:ct,ownerState:De,ref:H});return O.jsxs(M.Fragment,{children:[M.cloneElement(j,ke),O.jsx(Fe,{as:k??yb,placement:T,anchorEl:v?{getBoundingClientRect:()=>({top:xk.y,left:xk.x,right:xk.x,bottom:xk.y,width:0,height:0})}:z,popperRef:me,open:z?se:!1,id:ue,transition:!0,...ze,...ht,popperOptions:Ze,children:({TransitionProps:sn})=>O.jsx(gt,{timeout:V.transitions.duration.shorter,...sn,...St,children:O.jsxs(on,{...Ln,children:[F,i?O.jsx(xi,{...jn}):null]})})})]})});function mwt(e){return pt("MuiSwitch",e)}const Tl=dt("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),vwt=e=>{const{classes:t,edge:n,size:r,color:i,checked:o,disabled:s}=e,a={root:["root",n&&`edge${Ue(n)}`,`size${Ue(r)}`],switchBase:["switchBase",`color${Ue(i)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Xe(a,mwt,t);return{...t,...l}},ywt=Oe("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Ue(n.edge)}`],t[`size${Ue(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Tl.thumb}`]:{width:16,height:16},[`& .${Tl.switchBase}`]:{padding:4,[`&.${Tl.checked}`]:{transform:"translateX(16px)"}}}}]}),bwt=Oe(Zse,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${Tl.input}`]:t.input},n.color!=="default"&&t[`color${Ue(n.color)}`]]}})(Mt(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${Tl.checked}`]:{transform:"translateX(20px)"},[`&.${Tl.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${Tl.checked} + .${Tl.track}`]:{opacity:.5},[`&.${Tl.disabled} + .${Tl.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${Tl.input}`]:{left:"-100%",width:"300%"}})),Mt(({theme:e})=>({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(ai(["light"])).map(([t])=>({props:{color:t},style:{[`&.${Tl.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette[t].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Tl.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?dh(e.palette[t].main,.62):fh(e.palette[t].main,.55)}`}},[`&.${Tl.checked} + .${Tl.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),xwt=Oe("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})(Mt(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),wwt=Oe("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(Mt(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),uae=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiSwitch"}),{className:i,color:o="primary",edge:s=!1,size:a="medium",sx:l,slots:c={},slotProps:u={},...f}=r,d={...r,color:o,edge:s,size:a},h=vwt(d),p={slots:c,slotProps:u},[g,m]=Zt("root",{className:Re(h.root,i),elementType:ywt,externalForwardedProps:p,ownerState:d,additionalProps:{sx:l}}),[v,y]=Zt("thumb",{className:h.thumb,elementType:wwt,externalForwardedProps:p,ownerState:d}),b=O.jsx(v,{...y}),[w,S]=Zt("track",{className:h.track,elementType:xwt,externalForwardedProps:p,ownerState:d});return O.jsxs(g,{...m,children:[O.jsx(bwt,{type:"checkbox",icon:b,checkedIcon:b,ref:n,ownerState:d,...f,classes:{...h,root:h.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...u.switchBase&&{root:typeof u.switchBase=="function"?u.switchBase(d):u.switchBase},...u.input&&{input:typeof u.input=="function"?u.input(d):u.input}}}),O.jsx(w,{...S})]})});function Swt(e){return pt("MuiTab",e)}const ef=dt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),_wt=e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:o,label:s,selected:a,disabled:l}=e,c={root:["root",o&&s&&"labelIcon",`textColor${Ue(n)}`,r&&"fullWidth",i&&"wrapped",a&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return Xe(c,Swt,t)},Cwt=Oe(Hf,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${Ue(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${ef.iconWrapper}`]:t.iconWrapper},{[`& .${ef.icon}`]:t.icon}]}})(Mt(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="top",style:{[`& > .${ef.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="bottom",style:{[`& > .${ef.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="start",style:{[`& > .${ef.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="end",style:{[`& > .${ef.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${ef.selected}`]:{opacity:1},[`&.${ef.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${ef.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${ef.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${ef.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${ef.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),PA=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:s=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:g,selectionFollowsFocus:m,textColor:v="inherit",value:y,wrapped:b=!1,...w}=r,S={...r,disabled:o,disableFocusRipple:s,selected:g,icon:!!l,iconPosition:c,label:!!f,fullWidth:a,textColor:v,wrapped:b},_=_wt(S),E=l&&f&&M.isValidElement(l)?M.cloneElement(l,{className:Re(_.icon,l.props.className)}):l,T=P=>{!g&&d&&d(P,y),h&&h(P)},k=P=>{m&&!g&&d&&d(P,y),p&&p(P)};return O.jsxs(Cwt,{focusRipple:!s,className:Re(_.root,i),ref:n,role:"tab","aria-selected":g,disabled:o,onClick:T,onFocus:k,ownerState:S,tabIndex:g?0:-1,...w,children:[c==="top"||c==="start"?O.jsxs(M.Fragment,{children:[E,f]}):O.jsxs(M.Fragment,{children:[f,E]}),u]})}),s5e=M.createContext();function Owt(e){return pt("MuiTable",e)}dt("MuiTable",["root","stickyHeader"]);const Ewt=e=>{const{classes:t,stickyHeader:n}=e;return Xe({root:["root",n&&"stickyHeader"]},Owt,t)},Twt=Oe("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(Mt(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),Rxe="table",N6=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTable"}),{className:i,component:o=Rxe,padding:s="normal",size:a="medium",stickyHeader:l=!1,...c}=r,u={...r,component:o,padding:s,size:a,stickyHeader:l},f=Ewt(u),d=M.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return O.jsx(s5e.Provider,{value:d,children:O.jsx(Twt,{as:o,role:o===Rxe?null:"table",ref:n,className:Re(f.root,i),ownerState:u,...c})})}),z6=M.createContext();function Pwt(e){return pt("MuiTableBody",e)}dt("MuiTableBody",["root"]);const kwt=e=>{const{classes:t}=e;return Xe({root:["root"]},Pwt,t)},Mwt=Oe("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),Awt={variant:"body"},Ixe="tbody",j6=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableBody"}),{className:i,component:o=Ixe,...s}=r,a={...r,component:o},l=kwt(a);return O.jsx(z6.Provider,{value:Awt,children:O.jsx(Mwt,{className:Re(l.root,i),as:o,ref:n,role:o===Ixe?null:"rowgroup",ownerState:a,...s})})});function Rwt(e){return pt("MuiTableCell",e)}const Iwt=dt("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Dwt=e=>{const{classes:t,variant:n,align:r,padding:i,size:o,stickyHeader:s}=e,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${Ue(r)}`,i!=="normal"&&`padding${Ue(i)}`,`size${Ue(o)}`]};return Xe(a,Rwt,t)},Lwt=Oe("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Ue(n.size)}`],n.padding!=="normal"&&t[`padding${Ue(n.padding)}`],n.align!=="inherit"&&t[`align${Ue(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(Mt(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid + ${e.palette.mode==="light"?dh(Vt(e.palette.divider,1),.88):fh(Vt(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Iwt.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),mi=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:c,sortDirection:u,variant:f,...d}=r,h=M.useContext(s5e),p=M.useContext(z6),g=p&&p.variant==="head";let m;s?m=s:m=g?"th":"td";let v=l;m==="td"?v=void 0:!v&&g&&(v="col");const y=f||p&&p.variant,b={...r,align:i,component:m,padding:a||(h&&h.padding?h.padding:"normal"),size:c||(h&&h.size?h.size:"medium"),sortDirection:u,stickyHeader:y==="head"&&h&&h.stickyHeader,variant:y},w=Dwt(b);let S=null;return u&&(S=u==="asc"?"ascending":"descending"),O.jsx(Lwt,{as:m,ref:n,className:Re(w.root,o),"aria-sort":S,scope:v,ownerState:b,...d})});function Fwt(e){return pt("MuiTableContainer",e)}dt("MuiTableContainer",["root"]);const $wt=e=>{const{classes:t}=e;return Xe({root:["root"]},Fwt,t)},Nwt=Oe("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),fae=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableContainer"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=$wt(a);return O.jsx(Nwt,{ref:n,as:o,className:Re(l.root,i),ownerState:a,...s})});function zwt(e){return pt("MuiTableHead",e)}dt("MuiTableHead",["root"]);const jwt=e=>{const{classes:t}=e;return Xe({root:["root"]},zwt,t)},Bwt=Oe("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),Uwt={variant:"head"},Dxe="thead",a5e=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableHead"}),{className:i,component:o=Dxe,...s}=r,a={...r,component:o},l=jwt(a);return O.jsx(z6.Provider,{value:Uwt,children:O.jsx(Bwt,{as:o,className:Re(l.root,i),ref:n,role:o===Dxe?null:"rowgroup",ownerState:a,...s})})});function Vwt(e){return pt("MuiToolbar",e)}dt("MuiToolbar",["root","gutters","regular","dense"]);const Wwt=e=>{const{classes:t,disableGutters:n,variant:r}=e;return Xe({root:["root",!n&&"gutters",r]},Vwt,t)},Hwt=Oe("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Mt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),HI=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=Wwt(c);return O.jsx(Hwt,{as:o,className:Re(u.root,i),ref:n,ownerState:c,...l})}),l5e=at(O.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),c5e=at(O.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),Gwt=M.forwardRef(function(t,n){const{backIconButtonProps:r,count:i,disabled:o=!1,getItemAriaLabel:s,nextIconButtonProps:a,onPageChange:l,page:c,rowsPerPage:u,showFirstButton:f,showLastButton:d,slots:h={},slotProps:p={},...g}=t,m=yi(),v=N=>{l(N,0)},y=N=>{l(N,c-1)},b=N=>{l(N,c+1)},w=N=>{l(N,Math.max(0,Math.ceil(i/u)-1))},S=h.firstButton??Mn,_=h.lastButton??Mn,E=h.nextButton??Mn,T=h.previousButton??Mn,k=h.firstButtonIcon??t1t,P=h.lastButtonIcon??n1t,I=h.nextButtonIcon??c5e,R=h.previousButtonIcon??l5e,F=m?_:S,A=m?E:T,L=m?T:E,$=m?S:_,j=m?p.lastButton:p.firstButton,V=m?p.nextButton:p.previousButton,U=m?p.previousButton:p.nextButton,z=m?p.firstButton:p.lastButton;return O.jsxs("div",{ref:n,...g,children:[f&&O.jsx(F,{onClick:v,disabled:o||c===0,"aria-label":s("first",c),title:s("first",c),...j,children:m?O.jsx(P,{...p.lastButtonIcon}):O.jsx(k,{...p.firstButtonIcon})}),O.jsx(A,{onClick:y,disabled:o||c===0,color:"inherit","aria-label":s("previous",c),title:s("previous",c),...V??r,children:m?O.jsx(I,{...p.nextButtonIcon}):O.jsx(R,{...p.previousButtonIcon})}),O.jsx(L,{onClick:b,disabled:o||(i!==-1?c>=Math.ceil(i/u)-1:!1),color:"inherit","aria-label":s("next",c),title:s("next",c),...U??a,children:m?O.jsx(R,{...p.previousButtonIcon}):O.jsx(I,{...p.nextButtonIcon})}),d&&O.jsx($,{onClick:w,disabled:o||c>=Math.ceil(i/u)-1,"aria-label":s("last",c),title:s("last",c),...z,children:m?O.jsx(k,{...p.firstButtonIcon}):O.jsx(P,{...p.lastButtonIcon})})]})});function qwt(e){return pt("MuiTablePagination",e)}const _1=dt("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var Lxe;const Xwt=Oe(mi,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})(Mt(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),Ywt=Oe(HI,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${_1.actions}`]:t.actions,...t.toolbar})})(Mt(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${_1.actions}`]:{flexShrink:0,marginLeft:20}}))),Qwt=Oe("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),Kwt=Oe("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})(Mt(({theme:e})=>({...e.typography.body2,flexShrink:0}))),Zwt=Oe(Oh,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${_1.selectIcon}`]:t.selectIcon,[`& .${_1.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${_1.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),Jwt=Oe(nr,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),eSt=Oe("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})(Mt(({theme:e})=>({...e.typography.body2,flexShrink:0})));function tSt({from:e,to:t,count:n}){return`${e}–${t} of ${n!==-1?n:`more than ${t}`}`}function nSt(e){return`Go to ${e} page`}const rSt=e=>{const{classes:t}=e;return Xe({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},qwt,t)},iSt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTablePagination"}),{ActionsComponent:i=Gwt,backIconButtonProps:o,colSpan:s,component:a=mi,count:l,disabled:c=!1,getItemAriaLabel:u=nSt,labelDisplayedRows:f=tSt,labelRowsPerPage:d="Rows per page:",nextIconButtonProps:h,onPageChange:p,onRowsPerPageChange:g,page:m,rowsPerPage:v,rowsPerPageOptions:y=[10,25,50,100],SelectProps:b={},showFirstButton:w=!1,showLastButton:S=!1,slotProps:_={},slots:E={},...T}=r,k=r,P=rSt(k),I=_?.select??b,R=I.native?"option":Jwt;let F;(a===mi||a==="td")&&(F=s||1e3);const A=fr(I.id),L=fr(I.labelId),$=()=>l===-1?(m+1)*v:v===-1?l:Math.min(l,(m+1)*v),j={slots:E,slotProps:_},[V,U]=Zt("root",{ref:n,className:P.root,elementType:Xwt,externalForwardedProps:{...j,component:a,...T},ownerState:k,additionalProps:{colSpan:F}}),[z,N]=Zt("toolbar",{className:P.toolbar,elementType:Ywt,externalForwardedProps:j,ownerState:k}),[B,H]=Zt("spacer",{className:P.spacer,elementType:Qwt,externalForwardedProps:j,ownerState:k}),[Q,Y]=Zt("selectLabel",{className:P.selectLabel,elementType:Kwt,externalForwardedProps:j,ownerState:k,additionalProps:{id:L}}),[Z,ge]=Zt("select",{className:P.select,elementType:Zwt,externalForwardedProps:j,ownerState:k}),[ne,ie]=Zt("menuItem",{className:P.menuItem,elementType:R,externalForwardedProps:j,ownerState:k}),[fe,ve]=Zt("displayedRows",{className:P.displayedRows,elementType:eSt,externalForwardedProps:j,ownerState:k});return O.jsx(V,{...U,children:O.jsxs(z,{...N,children:[O.jsx(B,{...H}),y.length>1&&O.jsx(Q,{...Y,children:d}),y.length>1&&O.jsx(Z,{variant:"standard",...!I.variant&&{input:Lxe||(Lxe=O.jsx(hT,{}))},value:v,onChange:g,id:A,labelId:L,...I,classes:{...I.classes,root:Re(P.input,P.selectRoot,(I.classes||{}).root),select:Re(P.select,(I.classes||{}).select),icon:Re(P.selectIcon,(I.classes||{}).icon)},disabled:c,...ge,children:y.map(se=>M.createElement(ne,{...ie,key:se.label?se.label:se,value:se.value?se.value:se},se.label?se.label:se))}),O.jsx(fe,{...ve,children:f({from:l===0?0:m*v+1,to:$(),count:l===-1?-1:l,page:m})}),O.jsx(i,{className:P.actions,backIconButtonProps:o,count:l,nextIconButtonProps:h,onPageChange:p,page:m,rowsPerPage:v,showFirstButton:w,showLastButton:S,slotProps:_.actions,slots:E.actions,getItemAriaLabel:u,disabled:c})]})})});function oSt(e){return pt("MuiTableRow",e)}const Fxe=dt("MuiTableRow",["root","selected","hover","head","footer"]),sSt=e=>{const{classes:t,selected:n,hover:r,head:i,footer:o}=e;return Xe({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},oSt,t)},aSt=Oe("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(Mt(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Fxe.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Fxe.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Vt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}}))),$xe="tr",hf=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTableRow"}),{className:i,component:o=$xe,hover:s=!1,selected:a=!1,...l}=r,c=M.useContext(z6),u={...r,component:o,hover:s,selected:a,head:c&&c.variant==="head",footer:c&&c.variant==="footer"},f=sSt(u);return O.jsx(aSt,{as:o,ref:n,className:Re(f.root,i),role:o===$xe?null:"row",ownerState:u,...l})});function lSt(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function cSt(e,t,n,r={},i=()=>{}){const{ease:o=lSt,duration:s=300}=r;let a=null;const l=t[e];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}a===null&&(a=d);const h=Math.min(1,(d-a)/s);if(t[e]=o(h)*(n-l)+l,h>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const uSt={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function fSt(e){const{onChange:t,...n}=e,r=M.useRef(),i=M.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return lr(()=>{const s=zI(()=>{const l=r.current;o(),l!==r.current&&t(r.current)}),a=Lc(i.current);return a.addEventListener("resize",s),()=>{s.clear(),a.removeEventListener("resize",s)}},[t]),M.useEffect(()=>{o(),t(r.current)},[t]),O.jsx("div",{style:uSt,...n,ref:i})}function dSt(e){return pt("MuiTabScrollButton",e)}const hSt=dt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),pSt=e=>{const{classes:t,orientation:n,disabled:r}=e;return Xe({root:["root",n,r&&"disabled"]},dSt,t)},gSt=Oe(Hf,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${hSt.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),mSt=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTabScrollButton"}),{className:i,slots:o={},slotProps:s={},direction:a,orientation:l,disabled:c,...u}=r,f=yi(),d={isRtl:f,...r},h=pSt(d),p=o.StartScrollButtonIcon??l5e,g=o.EndScrollButtonIcon??c5e,m=Xn({elementType:p,externalSlotProps:s.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=Xn({elementType:g,externalSlotProps:s.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return O.jsx(gSt,{component:"div",className:Re(h.root,i),ref:n,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${f?-90:90}deg)`}},children:a==="left"?O.jsx(p,{...m}):O.jsx(g,{...v})})});function vSt(e){return pt("MuiTabs",e)}const lz=dt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Nxe=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,zxe=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,m$=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(e,i);else{i.focus();return}}},ySt=e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:s,scrollButtonsHideMobile:a,classes:l}=e;return Xe({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",a&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},vSt,l)},bSt=Oe("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${lz.scrollButtons}`]:t.scrollButtons},{[`& .${lz.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(Mt(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${lz.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),xSt=Oe("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),wSt=Oe("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),SSt=Oe("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(Mt(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),_St=Oe(fSt)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),jxe={},dae=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTabs"}),i=as(),o=yi(),{"aria-label":s,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:g,orientation:m="horizontal",ScrollButtonComponent:v,scrollButtons:y="auto",selectionFollowsFocus:b,slots:w={},slotProps:S={},TabIndicatorProps:_={},TabScrollButtonProps:E={},textColor:T="primary",value:k,variant:P="standard",visibleScrollbar:I=!1,...R}=r,F=P==="scrollable",A=m==="vertical",L=A?"scrollTop":"scrollLeft",$=A?"top":"left",j=A?"bottom":"right",V=A?"clientHeight":"clientWidth",U=A?"height":"width",z={...r,component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:m,vertical:A,scrollButtons:y,textColor:T,variant:P,visibleScrollbar:I,fixed:!F,hideScrollbar:F&&!I,scrollableX:F&&!A,scrollableY:F&&A,centered:c&&!F,scrollButtonsHideMobile:!h},N=ySt(z),B=Xn({elementType:w.StartScrollButtonIcon,externalSlotProps:S.startScrollButtonIcon,ownerState:z}),H=Xn({elementType:w.EndScrollButtonIcon,externalSlotProps:S.endScrollButtonIcon,ownerState:z}),[Q,Y]=M.useState(!1),[Z,ge]=M.useState(jxe),[ne,ie]=M.useState(!1),[fe,ve]=M.useState(!1),[se,ue]=M.useState(!1),[G,ce]=M.useState({overflow:"hidden",scrollbarWidth:0}),pe=new Map,J=M.useRef(null),te=M.useRef(null),ae={slots:w,slotProps:{indicator:_,scrollButton:E,...S}},we=()=>{const $t=J.current;let Wt;if($t){const Nn=$t.getBoundingClientRect();Wt={clientWidth:$t.clientWidth,scrollLeft:$t.scrollLeft,scrollTop:$t.scrollTop,scrollWidth:$t.scrollWidth,top:Nn.top,bottom:Nn.bottom,left:Nn.left,right:Nn.right}}let Wn;if($t&&k!==!1){const Nn=te.current.children;if(Nn.length>0){const fi=Nn[pe.get(k)];Wn=fi?fi.getBoundingClientRect():null}}return{tabsMeta:Wt,tabMeta:Wn}},Pe=ft(()=>{const{tabsMeta:$t,tabMeta:Wt}=we();let Wn=0,Nn;A?(Nn="top",Wt&&$t&&(Wn=Wt.top-$t.top+$t.scrollTop)):(Nn=o?"right":"left",Wt&&$t&&(Wn=(o?-1:1)*(Wt[Nn]-$t[Nn]+$t.scrollLeft)));const fi={[Nn]:Wn,[U]:Wt?Wt[U]:0};if(typeof Z[Nn]!="number"||typeof Z[U]!="number")ge(fi);else{const ho=Math.abs(Z[Nn]-fi[Nn]),_e=Math.abs(Z[U]-fi[U]);(ho>=1||_e>=1)&&ge(fi)}}),ee=($t,{animation:Wt=!0}={})=>{Wt?cSt(L,J.current,$t,{duration:i.transitions.duration.standard}):J.current[L]=$t},re=$t=>{let Wt=J.current[L];A?Wt+=$t:Wt+=$t*(o?-1:1),ee(Wt)},Se=()=>{const $t=J.current[V];let Wt=0;const Wn=Array.from(te.current.children);for(let Nn=0;Nn$t){Nn===0&&(Wt=$t);break}Wt+=fi[V]}return Wt},he=()=>{re(-1*Se())},xe=()=>{re(Se())},[me,{onChange:be,...oe}]=Zt("scrollbar",{className:Re(N.scrollableX,N.hideScrollbar),elementType:_St,shouldForwardComponentProp:!0,externalForwardedProps:ae,ownerState:z}),Ee=M.useCallback($t=>{be?.($t),ce({overflow:null,scrollbarWidth:$t})},[be]),[ke,ze]=Zt("scrollButtons",{className:Re(N.scrollButtons,E.className),elementType:mSt,externalForwardedProps:ae,ownerState:z,additionalProps:{orientation:m,slots:{StartScrollButtonIcon:w.startScrollButtonIcon||w.StartScrollButtonIcon,EndScrollButtonIcon:w.endScrollButtonIcon||w.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:B,endScrollButtonIcon:H}}}),De=()=>{const $t={};$t.scrollbarSizeListener=F?O.jsx(me,{...oe,onChange:Ee}):null;const Wn=F&&(y==="auto"&&(ne||fe)||y===!0);return $t.scrollButtonStart=Wn?O.jsx(ke,{direction:o?"right":"left",onClick:he,disabled:!ne,...ze}):null,$t.scrollButtonEnd=Wn?O.jsx(ke,{direction:o?"left":"right",onClick:xe,disabled:!fe,...ze}):null,$t},Ve=ft($t=>{const{tabsMeta:Wt,tabMeta:Wn}=we();if(!(!Wn||!Wt)){if(Wn[$]Wt[j]){const Nn=Wt[L]+(Wn[j]-Wt[j]);ee(Nn,{animation:$t})}}}),Ze=ft(()=>{F&&y!==!1&&ue(!se)});M.useEffect(()=>{const $t=zI(()=>{J.current&&Pe()});let Wt;const Wn=ho=>{ho.forEach(_e=>{_e.removedNodes.forEach(Be=>{Wt?.unobserve(Be)}),_e.addedNodes.forEach(Be=>{Wt?.observe(Be)})}),$t(),Ze()},Nn=Lc(J.current);Nn.addEventListener("resize",$t);let fi;return typeof ResizeObserver<"u"&&(Wt=new ResizeObserver($t),Array.from(te.current.children).forEach(ho=>{Wt.observe(ho)})),typeof MutationObserver<"u"&&(fi=new MutationObserver(Wn),fi.observe(te.current,{childList:!0})),()=>{$t.clear(),Nn.removeEventListener("resize",$t),fi?.disconnect(),Wt?.disconnect()}},[Pe,Ze]),M.useEffect(()=>{const $t=Array.from(te.current.children),Wt=$t.length;if(typeof IntersectionObserver<"u"&&Wt>0&&F&&y!==!1){const Wn=$t[0],Nn=$t[Wt-1],fi={root:J.current,threshold:.99},ho=$e=>{ie(!$e[0].isIntersecting)},_e=new IntersectionObserver(ho,fi);_e.observe(Wn);const Be=$e=>{ve(!$e[0].isIntersecting)},Qe=new IntersectionObserver(Be,fi);return Qe.observe(Nn),()=>{_e.disconnect(),Qe.disconnect()}}},[F,y,se,u?.length]),M.useEffect(()=>{Y(!0)},[]),M.useEffect(()=>{Pe()}),M.useEffect(()=>{Ve(jxe!==Z)},[Ve,Z]),M.useImperativeHandle(l,()=>({updateIndicator:Pe,updateScrollButtons:Ze}),[Pe,Ze]);const[mt,Me]=Zt("indicator",{className:Re(N.indicator,_.className),elementType:SSt,externalForwardedProps:ae,ownerState:z,additionalProps:{style:Z}}),ct=O.jsx(mt,{...Me});let Fe=0;const ht=M.Children.map(u,$t=>{if(!M.isValidElement($t))return null;const Wt=$t.props.value===void 0?Fe:$t.props.value;pe.set(Wt,Fe);const Wn=Wt===k;return Fe+=1,M.cloneElement($t,{fullWidth:P==="fullWidth",indicator:Wn&&!Q&&ct,selected:Wn,selectionFollowsFocus:b,onChange:g,textColor:T,value:Wt,...Fe===1&&k===!1&&!$t.props.tabIndex?{tabIndex:0}:{}})}),gt=$t=>{if($t.altKey||$t.shiftKey||$t.ctrlKey||$t.metaKey)return;const Wt=te.current,Wn=ci(Wt).activeElement;if(Wn.getAttribute("role")!=="tab")return;let fi=m==="horizontal"?"ArrowLeft":"ArrowUp",ho=m==="horizontal"?"ArrowRight":"ArrowDown";switch(m==="horizontal"&&o&&(fi="ArrowRight",ho="ArrowLeft"),$t.key){case fi:$t.preventDefault(),m$(Wt,Wn,zxe);break;case ho:$t.preventDefault(),m$(Wt,Wn,Nxe);break;case"Home":$t.preventDefault(),m$(Wt,null,Nxe);break;case"End":$t.preventDefault(),m$(Wt,null,zxe);break}},St=De(),[on,Ln]=Zt("root",{ref:n,className:Re(N.root,f),elementType:bSt,externalForwardedProps:{...ae,...R,component:d},ownerState:z}),[xi,jn]=Zt("scroller",{ref:J,className:N.scroller,elementType:xSt,externalForwardedProps:ae,ownerState:z,additionalProps:{style:{overflow:G.overflow,[A?`margin${o?"Left":"Right"}`:"marginBottom"]:I?void 0:-G.scrollbarWidth}}}),[sn,xr]=Zt("list",{ref:te,className:Re(N.list,N.flexContainer),elementType:wSt,externalForwardedProps:ae,ownerState:z,getSlotProps:$t=>({...$t,onKeyDown:Wt=>{gt(Wt),$t.onKeyDown?.(Wt)}})});return O.jsxs(on,{...Ln,children:[St.scrollButtonStart,St.scrollbarSizeListener,O.jsxs(xi,{...jn,children:[O.jsx(sn,{"aria-label":s,"aria-labelledby":a,"aria-orientation":m==="vertical"?"vertical":null,role:"tablist",...xr,children:ht}),Q&&ct]}),St.scrollButtonEnd]})});function CSt(e){return pt("MuiTextField",e)}dt("MuiTextField",["root"]);const OSt={standard:wb,filled:tae,outlined:lae},ESt=e=>{const{classes:t}=e;return Xe({root:["root"]},CSt,t)},TSt=Oe(sd,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Ii=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:m,inputProps:v,InputProps:y,inputRef:b,label:w,maxRows:S,minRows:_,multiline:E=!1,name:T,onBlur:k,onChange:P,onFocus:I,placeholder:R,required:F=!1,rows:A,select:L=!1,SelectProps:$,slots:j={},slotProps:V={},type:U,value:z,variant:N="outlined",...B}=r,H={...r,autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:E,required:F,select:L,variant:N},Q=ESt(H),Y=fr(g),Z=p&&Y?`${Y}-helper-text`:void 0,ge=w&&Y?`${Y}-label`:void 0,ne=OSt[N],ie={slots:j,slotProps:{input:y,inputLabel:m,htmlInput:v,formHelperText:d,select:$,...V}},fe={},ve=ie.slotProps.inputLabel;N==="outlined"&&(ve&&typeof ve.shrink<"u"&&(fe.notched=ve.shrink),fe.label=w),L&&((!$||!$.native)&&(fe.id=void 0),fe["aria-describedby"]=void 0);const[se,ue]=Zt("root",{elementType:TSt,shouldForwardComponentProp:!0,externalForwardedProps:{...ie,...B},ownerState:H,className:Re(Q.root,a),ref:n,additionalProps:{disabled:u,error:f,fullWidth:h,required:F,color:l,variant:N}}),[G,ce]=Zt("input",{elementType:ne,externalForwardedProps:ie,additionalProps:fe,ownerState:H}),[pe,J]=Zt("inputLabel",{elementType:bv,externalForwardedProps:ie,ownerState:H}),[te,ae]=Zt("htmlInput",{elementType:"input",externalForwardedProps:ie,ownerState:H}),[we,Pe]=Zt("formHelperText",{elementType:nae,externalForwardedProps:ie,ownerState:H}),[ee,re]=Zt("select",{elementType:Oh,externalForwardedProps:ie,ownerState:H}),Se=O.jsx(G,{"aria-describedby":Z,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:E,name:T,rows:A,maxRows:S,minRows:_,type:U,value:z,id:Y,inputRef:b,onBlur:k,onChange:P,onFocus:I,placeholder:R,inputProps:ae,slots:{input:j.htmlInput?te:void 0},...ce});return O.jsxs(se,{...ue,children:[w!=null&&w!==""&&O.jsx(pe,{htmlFor:Y,id:ge,...J,children:w}),L?O.jsx(ee,{"aria-describedby":Z,id:Y,labelId:ge,value:z,input:Se,...re,children:s}):Se,p&&O.jsx(we,{id:Z,...Pe,children:p})]})});function PSt(e){return pt("MuiToggleButton",e)}const r1=dt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),u5e=M.createContext({}),f5e=M.createContext(void 0);function kSt(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}const MSt=e=>{const{classes:t,fullWidth:n,selected:r,disabled:i,size:o,color:s}=e,a={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${Ue(o)}`,s]};return Xe(a,PSt,t)},ASt=Oe(Hf,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${Ue(n.size)}`]]}})(Mt(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${r1.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${r1.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette.text.primary,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Vt(e.palette.text.primary,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette.text.primary,e.palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(ai()).map(([t])=>({props:{color:t},style:{[`&.${r1.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette[t].main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Vt(e.palette[t].main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Vt(e.palette[t].main,e.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),oo=M.forwardRef(function(t,n){const{value:r,...i}=M.useContext(u5e),o=M.useContext(f5e),s=X1({...i,selected:kSt(t.value,r)},t),a=Dt({props:s,name:"MuiToggleButton"}),{children:l,className:c,color:u="standard",disabled:f=!1,disableFocusRipple:d=!1,fullWidth:h=!1,onChange:p,onClick:g,selected:m,size:v="medium",value:y,...b}=a,w={...a,color:u,disabled:f,disableFocusRipple:d,fullWidth:h,size:v},S=MSt(w),_=T=>{g&&(g(T,y),T.defaultPrevented)||p&&p(T,y)},E=o||"";return O.jsx(ASt,{className:Re(i.className,S.root,c,E),disabled:f,focusRipple:!d,ref:n,onClick:_,onChange:p,value:y,ownerState:w,"aria-pressed":m,...b,children:l})});function RSt(e){return pt("MuiToggleButtonGroup",e)}const ro=dt("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),ISt=e=>{const{classes:t,orientation:n,fullWidth:r,disabled:i}=e,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${Ue(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Xe(o,RSt,t)},DSt=Oe("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${ro.grouped}`]:t.grouped},{[`& .${ro.grouped}`]:t[`grouped${Ue(n.orientation)}`]},{[`& .${ro.firstButton}`]:t.firstButton},{[`& .${ro.lastButton}`]:t.lastButton},{[`& .${ro.middleButton}`]:t.middleButton},t.root,n.orientation==="vertical"&&t.vertical,n.fullWidth&&t.fullWidth]}})(Mt(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${ro.grouped}`]:{[`&.${ro.selected} + .${ro.grouped}.${ro.selected}`]:{borderTop:0,marginTop:0}},[`& .${ro.firstButton},& .${ro.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${ro.lastButton},& .${ro.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${ro.lastButton}.${r1.disabled},& .${ro.middleButton}.${r1.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${ro.grouped}`]:{[`&.${ro.selected} + .${ro.grouped}.${ro.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${ro.firstButton},& .${ro.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${ro.lastButton},& .${ro.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${ro.lastButton}.${r1.disabled},& .${ro.middleButton}.${r1.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),GI=M.forwardRef(function(t,n){const r=Dt({props:t,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:s="standard",disabled:a=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h,...p}=r,g={...r,disabled:a,fullWidth:c,orientation:f,size:d},m=ISt(g),v=M.useCallback((E,T)=>{if(!u)return;const k=h&&h.indexOf(T);let P;h&&k>=0?(P=h.slice(),P.splice(k,1)):P=h?h.concat(T):[T],u(E,P)},[u,h]),y=M.useCallback((E,T)=>{u&&u(E,h===T?null:T)},[u,h]),b=M.useMemo(()=>({className:m.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:s,disabled:a}),[m.grouped,l,y,v,h,d,c,s,a]),w=Dht(i),S=w.length,_=E=>{const T=E===0,k=E===S-1;return T&&k?"":T?m.firstButton:k?m.lastButton:m.middleButton};return O.jsx(DSt,{role:"group",className:Re(m.root,o),ref:n,ownerState:g,...p,children:O.jsx(u5e.Provider,{value:b,children:w.map((E,T)=>O.jsx(f5e.Provider,{value:_(T),children:E},T))})})}),LSt="default",FSt={id:"local",name:"Local Server",url:"http://localhost:8080"},$St={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",headerBackgroundColor:"#606060",headerIconStyle:{color:"#FFFFFF"},themeMode:"system",compact:!1,organisationUrl:"https://xcube.readthedocs.io/",logoImage:"images/logo.png",logoWidth:32,headerTitleStyle:{fontFamily:"Roboto, Segoe UI, Helvetica, Arial, sans-serif",fontSize:"1.2rem"},baseMapUrl:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",defaultAgg:"mean",polygonFillOpacity:.2,mapProjection:"EPSG:3857",allowAboutPage:!0,allowDownloads:!0,allowRefresh:!0,allowSharing:!0,allowUserVariables:!0,allowViewModePython:!0,permalinkExpirationDays:null,allow3D:!0,showProgressBar:!0,showZoomInfoBox:!0},v$={name:LSt,server:FSt,branding:$St};function NSt(){const e=new URL(window.location.href),t=e.pathname.split("/"),n=t.length;return n>0?t[n-1]==="index.html"?new URL(t.slice(0,n-1).join("/"),window.location.origin):new URL(e.pathname,window.location.origin):new URL(window.location.origin)}const pT=NSt();function B6(e,...t){let n=e;for(const r of t)r!==""&&(n.endsWith("/")?r.startsWith("/")?n+=r.substring(1):n+=r:r.startsWith("/")?n+=r:n+="/"+r);return n}const zSt={amber:C3e,blue:Ny,blueGrey:gft,brown:O3e,cyan:x3e,deepOrange:x1,deepPurple:hft,green:mm,grey:E3e,indigo:b3e,lightBlue:zy,lightGreen:pft,lime:S3e,orange:Vx,pink:y3e,purple:$y,red:Fy,teal:w3e,yellow:_3e};function Bxe(e,t){const n=e[t];let r=null;typeof n=="string"?(r=zSt[n]||null,r===null&&n.startsWith("#")&&(n.length===7||n.length===9)&&(r={main:n})):typeof n=="object"&&n!==null&&"main"in n&&(r=n),r!==null?e[t]=r:e[t]=void 0}function jSt(e,t,n){const r=e[t];typeof r=="string"&&(e[t]=B6(pT.href,n,r))}function BSt(e,t){return e={...e},Bxe(e,"primaryColor"),Bxe(e,"secondaryColor"),jSt(e,"logoImage",t),e}function Fr(e){return typeof e=="number"}function Zw(e){return typeof e=="string"}function USt(e){return typeof e=="function"}function $O(e){return e!==null&&typeof e=="object"&&e.constructor===Object}const Uxe="color:green;font-weight:bold;",VSt="color:blue;font-weight:bold;";class WSt{_languages;_content;_locale;constructor(t){const n=Object.getOwnPropertyNames(t.languages);if(n.findIndex(i=>i==="en")<0)throw new Error('Internal error: locale "en" must be included in supported languages');const r={};t.dictionary.forEach((i,o)=>{n.forEach(a=>{if(!i[a])throw new Error(`Internal error: invalid entry at index ${o} in "./resources/lang.json": missing translation for locale: "${a}": ${i}`)});const s=Vxe(i.en);r[s]&&console.warn(`Translation already defined for "${i.en}".`),r[s]=i}),this._languages=t.languages,this._content=r,this._locale="en"}get languages(){return this._languages}get locale(){return this._locale}set locale(t){const n=Object.getOwnPropertyNames(this._languages);if(n.findIndex(r=>r===t)<0){const r=t.split("-")[0];if(n.findIndex(i=>i===r)<0){console.error(`No translations found for locale "${t}", staying with "${this._locale}".`);return}else console.warn(`No translations found for locale "${t}", falling back to "${r}".`),t=r}this._locale=t}get(t,n){const r=Vxe(t),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${t}`,Uxe,` for locale %c${this._locale}`,VSt),o=t)):(console.debug(`missing translation for phrase %c${t}`,Uxe),o=t),n&&Object.keys(n).forEach(s=>{o=o.replace("${"+s+"}",`${n[s]}`)}),o}}const HSt=()=>{let e;return navigator.languages&&navigator.languages.length>0?e=navigator.languages[0]:e=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",e.split("-")[0]},Vxe=e=>e.toLowerCase(),GSt={en:"English",de:"Deutsch",se:"Svenska"},qSt=JSON.parse('[{"en":"OK","de":"OK","se":"OK"},{"en":"Cancel","de":"Abbrechen","se":"Avbryt"},{"en":"Save","de":"Speichern","se":"Spara"},{"en":"Select","de":"Auswählen","se":"Välj"},{"en":"Add","de":"Hinzufügen","se":"Lägg till"},{"en":"Edit","de":"Bearbeiten","se":"Redigera"},{"en":"Remove","de":"Entfernen","se":"Ta bort"},{"en":"Dataset","de":"Datensatz","se":"Dataset"},{"en":"Variable","de":"Variable","se":"Variabel"},{"en":"My places","de":"Meine Orte","se":"Mina platser"},{"en":"Loading places","de":"Lade Orte","se":"Laddar platser"},{"en":"Places","de":"Orte","se":"Platser"},{"en":"Place","de":"Ort","se":"Plats"},{"en":"Time","de":"Zeit","se":"Tid"},{"en":"Missing time axis","de":"Fehlende Zeitachse","se":"Saknar tidsaxel"},{"en":"Geometry type","de":"Geometry-Typ","se":"Geometri typ"},{"en":"Point","de":"Punkt","se":"Punkt"},{"en":"Polygon","de":"Polygon","se":"Polygon"},{"en":"Circle","de":"Kreis","se":"Cirkel"},{"en":"Multi","de":"Multi","se":"Multi"},{"en":"Something went wrong.","de":"Irgendetwas lief schief.","se":"Något gick fel."},{"en":"Time-Series","de":"Zeitserie","se":"Tidsserier"},{"en":"Quantity","de":"Größe","se":"Kvantitet"},{"en":"unknown units","de":"unbekannte Einheiten","se":"okända enheter"},{"en":"Values","de":"Werte","se":"Värden"},{"en":"Start","de":"Start","se":"Start"},{"en":"Stop","de":"Stopp","se":"Stopp"},{"en":"Please wait...","de":"Bitte warten...","se":"Vänta ..."},{"en":"Loading data","de":"Lade Daten","se":"Laddar data"},{"en":"Connecting to server","de":"Verbindung zum Server wird hergestellt","se":"Ansluta till servern"},{"en":"Cannot reach server","de":"Kann Server nicht erreichen","se":"Kan inte nå servern"},{"en":"Language","de":"Sprache","se":"Språk"},{"en":"Settings","de":"Einstellungen","se":"Inställningar"},{"en":"General","de":"Allgemein","se":"Allmänhet"},{"en":"System Information","de":"Systeminformation","se":"Systeminformation"},{"en":"version","de":"Version","se":"Version"},{"en":"Server","de":"Server","se":"Server"},{"en":"Add Server","de":"Server hinzufügen","se":"Lägg till server"},{"en":"Edit Server","de":"Server bearbeiten","se":"Redigera server"},{"en":"Select Server","de":"Server auswählen","se":"Välj server"},{"en":"On","de":"An","se":"På"},{"en":"Off","de":"Aus","se":"Av"},{"en":"Time interval of the player","de":"Zeitintervall des Abspielers","se":"Spelarens tidsintervall"},{"en":"Show chart after adding a place","de":"Diagram anzeigen, nachdem ein Ort hinzugefügt wurde","se":"Visa diagram efter att du har lagt till en plats"},{"en":"Calculate standard deviation","de":"Berechne Standardabweichung","se":"Beräkna standardavvikelsen"},{"en":"Calculate median instead of mean (disables standard deviation)","de":"Median statt Mittelwert berechnen (deaktiviert Standardabweichung)","se":"Beräkna median istället för medelvärde (inaktiverar standardavvikelse)"},{"en":"Minimal number of data points in a time series update","de":"Minimale Anzahl Datenpunkte in einer Zeitreihen-Aktualisierung","se":"Minimalt antal datapunkter i en tidsserieuppdatering"},{"en":"Map","de":"Karte","se":"Karta"},{"en":"Projection","de":"Projektion","se":"Projektion"},{"en":"Geographic","de":"Geografisch","se":"Geografiskt"},{"en":"Mercator","de":"Mercator","se":"Mercator"},{"en":"Image smoothing","de":"Bildglättung","se":"Bildutjämning"},{"en":"Show dataset boundaries","de":"Datensatzgrenzen anzeigen","se":"Visa datauppsättningsgränser"},{"en":"Overlays","de":"Overlays","se":"Överlagringar"},{"en":"Predefined","de":"Vordefiniert","se":"Fördefinierad"},{"en":"Base maps","de":"Basiskarten","se":"Baskartor"},{"en":"Base map","de":"Basiskarte","se":"Baskarta"},{"en":"Hide small values","de":"Kleine Werte ausblenden","se":"Dölja små värden"},{"en":"Reverse","de":"Umkehren","se":"Omvänt"},{"en":"Color","de":"Farbe","se":"Färg"},{"en":"Opacity","de":"Opazität","se":"Opacitet"},{"en":"Value Range","de":"Wertebereich","se":"Värdeintervall"},{"en":"Assign min/max from color mapping values","de":"Min./Max. aus Farbzuordnungswerten übertragen","se":"Tilldela min/max från färgmappningsvärden"},{"en":"Log-scaled","de":"Log-skaliert","se":"Log-skalad"},{"en":"Logarithmic scaling","de":"Logarithmische Skalierung","se":"Logaritmisk skalning"},{"en":"Others","de":"Andere","se":"Andra"},{"en":"Information about the selected dataset","de":"Informationen über den ausgewählten Datensatz","se":"Information om den valda datamängden"},{"en":"Information about the selected variable","de":"Informationen über die ausgewählte Variable","se":"Information om den valda variabeln"},{"en":"Information about the selected place","de":"Informationen über den ausgewählten Ort","se":"Information om vald plats"},{"en":"Dimension names","de":"Namen der Dimensionen","se":"Dimensioner namn"},{"en":"Dimension data types","de":"Datentypen der Dimensionen","se":"Dimensionsdatatyper"},{"en":"Dimension lengths","de":"Länge der Dimensionen","se":"Måttlängder"},{"en":"Time chunk size","de":"Zeitblockgröße","se":"Tidsblockstorlek"},{"en":"Geographical extent","de":"Geografische Ausdehnung","se":"Geografisk omfattning"},{"en":"Spatial reference system","de":"Räumliches Bezugssystem","se":"Rumsligt referenssystem"},{"en":"No Title","de":"Kein Titel","se":"Ingen Titel"},{"en":"Name","de":"Name","se":"Namn"},{"en":"Title","de":"Titel","se":"Titel"},{"en":"Units","de":"Einheiten","se":"Enheter"},{"en":"Expression","de":"Ausdruck","se":"Uttryck"},{"en":"Data type","de":"Datentyp","se":"Datatyp"},{"en":"There is no information available for this location.","de":"Zu diesem Ort sind keine keine Informationen vorhanden.","se":"Det finns ingen information tillgänglig för den här platsen."},{"en":"Log out","de":"Abmelden","se":"Logga ut"},{"en":"Profile","de":"Profil","se":"Profil"},{"en":"User Profile","de":"Nutzerprofil","se":"Användarprofil"},{"en":"User name","de":"Nutzername","se":"Användarnamn"},{"en":"E-mail","de":"E-mail","se":"E-post"},{"en":"Nickname","de":"Spitzname","se":"Smeknamn"},{"en":"verified","de":"verifiziert","se":"verified"},{"en":"not verified","de":"nicht verifiziert","se":"inte verifierad"},{"en":"RGB","de":"RGB","se":"RGB"},{"en":"Imprint","de":"Impressum","se":"Avtryck"},{"en":"User Manual","de":"Benutzerhandbuch","se":"Användarmanual"},{"en":"Show time-series diagram","de":"Zeitserien-Diagramm anzeigen","se":"Visa tidsseriediagram"},{"en":"Add Statistics","de":"Statistiken hinzufügen","se":"Lägg till statistik"},{"en":"Help","de":"Hilfe","se":"Hjälp"},{"en":"Documentation","de":"Dokumentation","se":"Dokumentation"},{"en":"Developer Reference","de":"Entwicklerreferenz","se":"Utvecklarreferens"},{"en":"Share","de":"Teilen","se":"Dela"},{"en":"Copy snapshot to clipboard","de":"Schnappschuss in die Zwischenablage kopieren","se":"Kopiera ögonblicksbild till urklipp"},{"en":"Snapshot copied to clipboard","de":"Schnappschuss wurde in die Zwischenablage kopiert","se":"Ögonblicksbild har kopierats till urklipp"},{"en":"Error copying snapshot to clipboard","de":"Fehler beim Kopieren des Schnappschusses in die Zwischenablage","se":"Det gick inte att kopiera ögonblicksbilden till urklipp"},{"en":"Export data","de":"Daten exportieren","se":"Exportera data"},{"en":"Export Settings","de":"Export-Einstellungen","se":"Exportera Inställningar"},{"en":"Include time-series data","de":"Zeitseriendaten einschließen","se":"Inkludera tidsseriedata"},{"en":"Include places data","de":"Ortsdaten einschließen","se":"Inkludera platsdata"},{"en":"File name","de":"Dateiname","se":"Filnamn"},{"en":"Separator for time-series data","de":"Trennzeichen für Zeitreihendaten","se":"Separator för tidsseriedata"},{"en":"Combine place data in one file","de":"Ortsdaten in einer Datei zusammenfassen","se":"Kombinera platsdata i en fil"},{"en":"As ZIP archive","de":"Als ZIP-Archiv","se":"Som ett ZIP-arkiv"},{"en":"Download","de":"Herunterladen","se":"Ladda ner"},{"en":"Locate place in map","de":"Lokalisiere Ort in Karte","se":"Leta upp plats på kartan"},{"en":"Locate dataset in map","de":"Lokalisiere Datensatz in Karte","se":"Leta upp dataset på kartan"},{"en":"Open information panel","de":"Informationsfeld öffnen","se":"Öppet informationsfält"},{"en":"Select a place in map","de":"Ort in der Karte auswählen","se":"Välj plats på kartan"},{"en":"Add a point location in map","de":"Punkt zur Karte hinzufügen","se":"Lägg till punkt på kartan"},{"en":"Draw a polygon area in map","de":"Polygonale Fläche in der Karte zeichnen","se":"Rita en polygonal yta på kartan"},{"en":"Draw a circular area in map","de":"Kreisförmige Fläche in der Karte zeichnen","se":"Rita ett cirkulärt område på kartan"},{"en":"Rename place","de":"Ort umbenennen","se":"Byt namn på plats"},{"en":"Style place","de":"Ort stylen","se":"Styla plats"},{"en":"Remove place","de":"Ort entfernen","se":"Ta bort plats"},{"en":"Rename place group","de":"Ortsgruppe umbenennen","se":"Byt namn på platsgrupp"},{"en":"Remove places","de":"Orte entfernen","se":"Ta bort platser"},{"en":"Show RGB layer instead","de":"Stattdessen RGB-Layer anzeigen","se":"Visa RGB-lager istället"},{"en":"Auto-step through times in the dataset","de":"Zeiten im Datensatz automatisch durchlaufen","se":"Kör automatiskt genom tider i dataposten"},{"en":"First time step","de":"Erster Zeitschritt","se":"Första tidssteg"},{"en":"Last time step","de":"Letzter Zeitschritt","se":"Sista tidssteg"},{"en":"Previous time step","de":"Vorheriger Zeitschritt","se":"Föregående tidssteg"},{"en":"Next time step","de":"Nächster Zeitschritt","se":"Nästa tidssteg"},{"en":"Select time in dataset","de":"Datensatz-Zeit auswählen","se":"Välj tid i dataset"},{"en":"Refresh","de":"Aktualisieren","se":"Att uppdatera"},{"en":"Accept and continue","de":"Akzeptieren und weiter","se":"Acceptera och fortsätt"},{"en":"Leave","de":"Verlassen","se":"Lämna"},{"en":"Import places","de":"Orte importieren","se":"Importera platser"},{"en":"Text/CSV","de":"Text/CSV","se":"Text/CSV"},{"en":"GeoJSON","de":"GeoJSON","se":"GeoJSON"},{"en":"WKT","de":"WKT","se":"WKT"},{"en":"Enter text or drag & drop a text file.","de":"Text eingeben oder Textdatei per Drag & Drop einfügen.","se":"Skriv in text eller dra och släpp en textfil."},{"en":"From File","de":"Aus Datei","se":"Från fil"},{"en":"Clear","de":"Löschen","se":"Tömma"},{"en":"Options","de":"Optionen","se":"Alternativ"},{"en":"Time (UTC, ISO-format)","de":"Zeit (UTC, ISO-Format)","se":"Tid (UTC, ISO-format)"},{"en":"Group","de":"Gruppe","se":"Grupp"},{"en":"Label","de":"Label","se":"Etikett"},{"en":"Time property names","de":"Eigenschaftsnamen für Zeit","se":"Gruppegendomsnamn"},{"en":"Group property names","de":"Eigenschaftsnamen für Gruppe","se":"Gruppegendomsnamn"},{"en":"Label property names","de":"Eigenschaftsnamen für Label","se":"Etikett egendomsnamn"},{"en":"Group prefix (used as fallback)","de":"Gruppen-Präfix (als Fallback verwendet)","se":"Gruppprefix (används som reserv)"},{"en":"Label prefix (used as fallback)","de":"Label-Präfix (als Fallback verwendet)","se":"Etikettprefix (används som reserv)"},{"en":"X/longitude column names","de":"Spaltennamen für y/Längengrad","se":"X/longitud kolumnnamn"},{"en":"Y/latitude column names","de":"Spaltennamen für y/Breitengrad","se":"Y/latitud kolumnnamn"},{"en":"Geometry column names","de":"Spaltennamen für Geometrie","se":"Geometrikolumnnamn"},{"en":"Time column names","de":"Spaltennamen für Zeit","se":"Tidskolumnnamn"},{"en":"Group column names","de":"Spaltennamen für Gruppe","se":"Gruppkolumnnamn"},{"en":"Label column names","de":"Spaltennamen für Label","se":"Etikettkolumnnamn"},{"en":"Separator character","de":"Trennzeichen","se":"Skiljetecken"},{"en":"Comment character","de":"Kommentar-Zeichen","se":"Kommentar karaktär"},{"en":"Quote character","de":"Zitierzeichen","se":"Citat karaktär"},{"en":"Escape character","de":"Escape character","se":"Escape karaktär"},{"en":"Not-a-number token","de":"Token für \'keine Zahl\'","se":"Not-a-number token"},{"en":"True token","de":"Token für \'wahr\'","se":"Sann token"},{"en":"False token","de":"Token für \'falsch\'","se":"Falsk token"},{"en":"Revoke consent","de":"Zustimmung widerrufen","se":"Återkalla samtycke "},{"en":"Accepted","de":"Akzeptiert","se":"Accepterad"},{"en":"Legal Agreement","de":"Rechtliches Übereinkommen","se":"Laglig Överenskommelse"},{"en":"Privacy Notice","de":"Datenschutzhinweis","se":"Sekretessmeddelande"},{"en":"WMS URL","de":"WMS URL","se":"WMS URL"},{"en":"WMS Layer","de":"WMS Layer","se":"WMS Lager"},{"en":"Add layer from a Web Map Service","de":"Layer aus einem Web Map Service hinzufügen","se":"Lägg till lager från en Web Map Service"},{"en":"Add layer from a Tiled Web Map","de":"Layer aus einer Tiled Web Map hinzufügen","se":"Lägg till lager från en Tiled Web Map"},{"en":"Show or hide layers panel","de":"Layer-Bedienfeld ein- oder ausblenden","se":"Visa eller dölj panelen Lager"},{"en":"Turn layer split mode on or off","de":"Layer-Split-Modus ein- oder ausschalten","se":"Aktivera eller inaktivera lagerdelningsläget"},{"en":"Turn info box on or off","de":"Infobox ein- oder ausschalten","se":"Slå på eller av informationsrutan"},{"en":"Show sidebar","de":"Seitenleiste einblenden","se":"Visa sidofältet"},{"en":"Hide sidebar","de":"Seitenleiste ausblenden","se":"Dölj sidofältet"},{"en":"Unknown color bar","de":"Unbekannte Farbskala","se":"Färgskala okänd"},{"en":"Points","de":"Punkte","se":"Punkter"},{"en":"Lines","de":"Linien","se":"Linjer"},{"en":"Bars","de":"Balken","se":"Staplar"},{"en":"Default chart type","de":"Diagrammtyp (default)","se":"Diagramtyp (default)"},{"en":"User Base Maps","de":"Nutzer Basiskarten","se":"Användare Baskartor"},{"en":"Switch between dataset RGB layer and variable layer","de":"Zwischen RGB-Layer und Variablen-Layer wechseln","se":"Växla mellan RGB-lager och variabellager"},{"en":"Overlay","de":"Overlay (überlagernder Layer)","se":"Overlay (överliggande lager)"},{"en":"User Overlays","de":"Nutzer Overlays","se":"Användare Överlagringar"},{"en":"On dataset selection","de":"Bei Auswahl von Datensatz","se":"Vid val av dataset"},{"en":"On place selection","de":"Bei Auswahl von Ort","se":"Vid val av plats"},{"en":"Do nothing","de":"Nichts tun","se":"Gör ingenting"},{"en":"Pan","de":"Verschieben","se":"Panorera"},{"en":"Pan and zoom","de":"Verschieben und zoom","se":"Panorera och zooma"},{"en":"User Layers","de":"Nutzer Layer","se":"Användare lager"},{"en":"XYZ Layer URL","de":"XYZ-Layer URL","se":"XYZ lager URL"},{"en":"Layer Title","de":"Layer Titel","se":"Lagertitel "},{"en":"Layer Attribution","de":"Layer Attribution","se":"Lagerattribution"},{"en":"ID","de":"ID","se":"ID"},{"en":"Details","de":"Details","se":"Detaljer"},{"en":"Charts","de":"Diagramme","se":"Diagrammer"},{"en":"Statistics","de":"Statistik","se":"Statistik"},{"en":"Volume","de":"Volumen","se":"Volym"},{"en":"Toggle zoom mode (or press CTRL key)","de":"Zoom-Modus umschalten (oder drücke CTRL-Taste)","se":"Växla zoomläge (eller tryck på CTRL-tangenten)"},{"en":"Enter fixed y-range","de":"Festen y-Bereich angeben","se":"Ange fast y-intervall"},{"en":"Toggle showing info popup on hover","de":"Anzeige des Info-Popups bei Hover umschalten","se":"Växla visning av popup-info vid hover"},{"en":"Show points","de":"Punkte anzeigen","se":"Visa punkter"},{"en":"Show lines","de":"Linien anzeigen","se":"Visa linjer"},{"en":"Show bars","de":"Balken anzeigen","se":"Visa staplar"},{"en":"Show standard deviation (if any)","de":"Standardabweichung anzeigen","se":"Visa standardavvikelsen"},{"en":"Add time-series from places","de":"Zeitserien hinzufügen von Orten","se":"Lägg till tidsserier från platser"},{"en":"Zoom to full range","de":"Zoom auf gesamten x-Bereich","se":"Zooma till hela x-intervallet"},{"en":"Make it 2nd variable for comparison","de":"Festlegen als 2. Variable für Vergleich","se":"Ställ in som 2:a variabel för jämförelse"},{"en":"Load Volume Data","de":"Lade Volumendaten","se":"Ladda volymdata"},{"en":"Please note that the 3D volume rendering is still an experimental feature.","de":"Bitte beachte, dass das 3D-Volumen-Rendering noch eine experimentelle Funktion ist.","se":"Observera att 3D-volymrendering fortfarande är en experimentell funktion."},{"en":"User-defined color bars.","de":"Benutzerdefinierte Farbskalen.","se":"Användardefinierade färgskalor."},{"en":"Contin.","de":"Kontin.","se":"Kontin."},{"en":"Stepwise","de":"Schrittw.","se":"Stegvis"},{"en":"Categ.","de":"Kateg.","se":"Kateg."},{"en":"Continuous color assignment, where each value represents a support point of a color gradient","de":"Kontinuierliche Farbzuordnung, bei der jeder Wert eine Stützstelle eines Farbverlaufs darstellt","se":"Kontinuerlig färgtilldelning där varje värde representerar en punkt i en färggradient"},{"en":"Stepwise color mapping where values are bounds of value ranges mapped to the same color","de":"Schrittweise Farbzuordnung, bei der die Werte Bereichsgrenzen darstellen, die einer einzelnen Farbe zugeordnet werden","se":"Gradvis färgmappning, där värdena representerar intervallgränser mappade till en enda färg"},{"en":"Values represent unique categories or indexes that are mapped to a color","de":"Werte stellen eindeutige Kategorien oder Indizes dar, die einer Farbe zugeordnet sind","se":"Värden representerar unika kategorier eller index som är mappade till en färg"},{"en":"User","de":"Nutzer","se":"Användare"},{"en":"Add Time-Series","de":"Zeitserien hinzufügen","se":"Lägg till tidsserier"},{"en":"No time-series have been obtained yet. Select a variable and a place first.","de":"Es wurden noch keine Zeitreihen abgerufen. Wähle zuerst eine Variable und einen Ort aus.","se":"Inga tidsserier har hämtats ännu. Välj först en variabel och en plats."},{"en":"Count","de":"Anzahl","se":"Antal"},{"en":"Minimum","de":"Minimum","se":"Minimum"},{"en":"Maximum","de":"Maximum","se":"Maximum"},{"en":"Mean","de":"Mittelwert","se":"Medelvärde"},{"en":"Deviation","de":"Abweichung","se":"Avvikelse"},{"en":"Toggle adjustable x-range","de":"Anpassbaren x-Bereich umschalten","se":"Växla justerbart x-intervall"},{"en":"pinned","de":"angepinnt","se":"fäst"},{"en":"Compare Mode (Drag)","de":"Vergleichsmodus (Ziehen)","se":"Jämförelseläge (Dra)"},{"en":"Point Info Mode (Hover)","de":"Punktinformationsmodus (Bewegen)","se":"Punktinformationsläge (Sväva)"},{"en":"Dataset RGB","de":"Datensatz RGB","se":"Dataset RGB"},{"en":"Dataset RGB 2","de":"Datensatz RGB 2","se":"Dataset RGB 2"},{"en":"Dataset Variable","de":"Datensatz Variable","se":"Dataset Variabel"},{"en":"Dataset Variable 2","de":"Datensatz Variable 2","se":"Dataset Variabel 2"},{"en":"Dataset Boundary","de":"Datensatz Außengrenze","se":"Dataset Yttre Gräns"},{"en":"Dataset Places","de":"Datensatz Orte","se":"Dataset Platser"},{"en":"User Places","de":"Nutzer Orte","se":"Användare Platser"},{"en":"Layers","de":"Layer","se":"Lager"},{"en":"User Variables","de":"Nutzer-Variablen","se":"Användarvariabler"},{"en":"Create and manage user variables","de":"Nutzer-Variablen erstellen und verwalten","se":"Skapa och hantera användarvariabler"},{"en":"Manage user variables","de":"Nutzer-Variablen verwalten","se":"Hantera användarvariabler"},{"en":"Add user variable","de":"Nutzer-Variable hinzufügen","se":"Lägg till användarvariabel"},{"en":"Duplicate user variable","de":"Nutzer-Variable duplizieren","se":"Duplicera användarvariabel"},{"en":"Edit user variable","de":"Nutzer-Variable bearbeiten","se":"Redigera användarvariabel"},{"en":"Remove user variable","de":"Nutzer-Variable löschen","se":"Ta bort användarvariabel"},{"en":"Use keys CTRL+SPACE to show autocompletions","de":"Tasten STRG+LEER benutzen, um Autovervollständigungen zu zeigen","se":"Använd tangenterna CTRL+MELLANSLAG för att visa autoslutföranden"},{"en":"Display further elements to be used in expressions","de":"Weitere Elemente anzeigen, die in Ausdrücken verwendet werden können","se":"Visa fler element som kan användas i uttryck"},{"en":"Variables","de":"Variablen","se":"Variabler"},{"en":"Constants","de":"Konstanten","se":"Konstanter"},{"en":"Array operators","de":"Array-Operatoren","se":"Arrayoperatorer"},{"en":"Other operators","de":"Andere Operatoren","se":"Andra Operatorer"},{"en":"Array functions","de":"Array-Funktionen","se":"Arrayfunktioner"},{"en":"Other functions","de":"Andere Funktionen","se":"Andra funktioner"},{"en":"Not a valid identifier","de":"Kein gültiger Bezeichner","se":"Inte en giltig identifierare"},{"en":"Must not be empty","de":"Darf nicht leer sein","se":"Får inte vara tom"},{"en":"Textual format","de":"Textformat","se":"Textformat"},{"en":"Tabular format","de":"Tabellenformat","se":"Tabellformat"},{"en":"JSON format","de":"JSON-Format","se":"JSON-format"},{"en":"defined","de":"definiert","se":"definierad"},{"en":"Appearance Mode","de":"Darstellungsmodus","se":"Utseendeläge"},{"en":"System","de":"System","se":"System"},{"en":"Light","de":"Hell","se":"Ljus"},{"en":"Dark","de":"Dunkel","se":"Mörk"},{"en":"Image export resolution","de":"Auflösung des Bildexports","se":"Upplösning för bildexport"},{"en":"Screen Resolution (96 DPI)","de":"Bildschirmauflösung (96 DPI)","se":"Skärmupplösning (96 DPI)"},{"en":"Intermediate Resolution (150 DPI)","de":"Mittlere Auflösung (150 DPI)","se":"Medelhög upplösning (150 DPI)"},{"en":"Print Resolution (300 DPI)","de":"Druckauflösung (300 DPI)","se":"Utskriftsupplösning (300 DPI)"},{"en":"Professional Print Resolution (600 DPI)","de":"Professionelle Druckauflösung (300 DPI)","se":"Professionell utskriftsupplösning (600 DPI)"},{"en":"Creating permalink","de":"Permalink erstellen","se":"Skapa permalänk"},{"en":"Failed to create permalink","de":"Permalink konnte nicht erstellt werden","se":"Skapa permalänk misslyckades"},{"en":"Permalink copied to clipboard","de":"Permalink in die Zwischenablage kopiert","se":"Permalink kopieras till klippbordet"},{"en":"Permalink copied to clipboard (expires in ${expiration} days)","de":"Permalink in die Zwischenablage kopiert (läuft ab in ${expiration} Tagen)","se":"Permalink kopieras till klippbordet (går ut om ${expiration} dagar)"},{"en":"Back","de":"Zurück","se":"Tillbaka"},{"en":"Apply","de":"Anwenden","se":"Anwända"},{"en":"Already in use","de":"Bereits in Verwendung","se":"Redan i bruk"},{"en":"About ${appName}","de":"Über ${appName}","se":"Om ${appName}"},{"en":"Levels","de":"Levels","se":"Levels"},{"en":"Show zoom level indicator","de":"Zoomstufen anzeigen","se":"Visa zoomnivåer"},{"en":"More","de":"Weiteres","se":"Ytterligare"},{"en":"Show tile loading progress","de":"Ladefortschritt der Tiles anzeigen","se":"Visa laddningsförlopp för tiles"},{"en":"docs/imprint.en.md","de":"docs/imprint.en.md","se":"docs/imprint.en.md"},{"en":"docs/privacy-note.en.md","de":"docs/privacy-note.de.md","se":"docs/privacy-note.se.md"},{"en":"docs/add-layer-wms.en.md","de":"docs/add-layer-wms.de.md","se":"docs/add-layer-wms.se.md"},{"en":"docs/add-layer-xyz.en.md","de":"docs/add-layer-xyz.de.md","se":"docs/add-layer-xyz.se.md"},{"en":"docs/color-mappings.en.md","de":"docs/color-mappings.de.md","se":"docs/color-mappings.se.md"},{"en":"docs/user-variables.en.md","de":"docs/user-variables.de.md","se":"docs/user-variables.se.md"},{"en":"docs/dev-reference.en.md","de":"docs/dev-reference.en.md","se":"docs/dev-reference.en.md"}]'),XSt={languages:GSt,dictionary:qSt},Ce=new WSt(XSt);Ce.locale=HSt();class d5e extends Error{statusCode;constructor(t,n){super(n),this.statusCode=t}}function Sb(e){return e?{headers:[["Authorization",`Bearer ${e}`]]}:{}}function xv(e,t){if(t.length>0){const n=t.map(r=>r.map(encodeURIComponent).join("=")).join("&");return e.includes("?")?e.endsWith("&")?e+n:e+"&"+n:e+"?"+n}return e}async function h5e(e,t){let n;try{if(n=await fetch(e,t),n.ok)return n}catch(i){throw i instanceof TypeError?(console.error(`Server did not respond for ${e}. May be caused by timeout, refused connection, network error, etc.`,i),new Error(Ce.get("Cannot reach server"))):(console.error(i),i)}let r=n.statusText;try{const i=await n.json();if(i&&i.error){const o=i.error;console.error(o),o.message&&(r+=`: ${o.message}`)}}catch{}throw console.error(n),new d5e(n.status,r)}async function Eh(e,t,n){let r;USt(t)?n=t:r=t;const o=await(await h5e(e,r)).json();return n?n(o):o}function YSt(e){const t=xv(`${e}/viewer/state`,[["key","sentinel"]]);try{return fetch(t).then(n=>n.status!==501).catch(()=>!1)}catch{return Promise.resolve(!1)}}const Sm=new URLSearchParams(window.location.search);class On{name;server;branding;authClient;configPath;static _instance;constructor(t,n,r,i,o=""){this.name=t,this.server=n,this.branding=r,this.authClient=i,this.configPath=o}static async load(){let t=Sm.get("configPath")||"config";const n=await this.loadRawConfig(t);n===v$&&(t="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),s=parseInt(Sm.get("compact")||"0")!==0;let a=BSt({...v$.branding,...n.branding,compact:s||n.branding.compact},t);return a=KG(a,"allowUserVariables"),a=KG(a,"allow3D"),a=KG(a,"allowSharing"),a.allowSharing&&(await YSt(o.url)||(a={...a,allowSharing:!1})),On._instance=new On(r,o,a,i,t),a.windowTitle&&this.changeWindowTitle(a.windowTitle),a.windowIcon&&this.changeWindowIcon(a.windowIcon),On._instance}static getAuthConfig(t){let n=t.authClient&&{...t.authClient};const r=On.getAuthClientFromEnv();if(!n&&r.authority&&r.clientId&&(n={authority:r.authority,client_id:r.clientId}),n){if(r.authority){const i=r.authority;n={...n,authority:i}}if(r.clientId){const i=r.clientId;n={...n,client_id:i}}if(r.audience){const i=r.audience,o=n.extraQueryParams;n={...n,extraQueryParams:{...o,audience:i}}}}return n}static getServerConfig(t){const n={...v$.server,...t.server},r=On.getApiServerFromEnv();return n.id=Sm.get("serverId")||r.id||n.id,n.name=Sm.get("serverName")||r.name||n.name,n.url=Sm.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(t){let n=null,r=null;const i=B6(pT.href,t,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:s,statusText:a}=o;r=`HTTP status ${s}`,a&&(r+=` (${a})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=v$),n}static get instance(){return On.assertConfigLoaded(),On._instance}static assertConfigLoaded(){if(!On._instance)throw new Error("internal error: configuration not available yet")}static changeWindowTitle(t){document.title=t}static changeWindowIcon(t){let n=document.querySelector('link[rel="icon"]');n!==null?n.href=t:(n=document.createElement("link"),n.rel="icon",n.href=t,document.head.appendChild(n))}static getAuthClientFromEnv(){return{authority:void 0,clientId:void 0,audience:void 0}}static getApiServerFromEnv(){return{id:void 0,name:void 0,url:void 0}}}const hae=[["red",Fy],["yellow",_3e],["blue",Ny],["pink",y3e],["lightBlue",zy],["green",mm],["orange",Vx],["lime",S3e],["purple",$y],["indigo",b3e],["cyan",x3e],["brown",O3e],["teal",w3e]],QSt=(()=>{const e={};return hae.forEach(([t,n])=>{e[t]=n}),e})(),Wxe=hae.map(([e,t])=>e);function KSt(e){return e==="light"?800:400}function Z1(e){return Wxe[e%Wxe.length]}function p5e(e,t){const n=KSt(t);return QSt[e][n]}function pae(e){return Fr(e)||(e=On.instance.branding.polygonFillOpacity),Fr(e)?e:.25}function KG(e,t){const n=Sm.get(t),r=n?!!parseInt(n):e[t]!==!1;return{...e,[t]:r}}const g5e={typography:{fontSize:12}},ZSt=dT({...g5e,cssVariables:!0,palette:{mode:"light",primary:{main:"#1976d2"},secondary:{main:"#00bc4e"},background:{default:"#ffffff"}}}),JSt=dT({...g5e,cssVariables:!0,palette:{mode:"dark",primary:{main:"#39a6f2"},secondary:{main:"#20dc6e"},background:{default:"#2b2d30"}}}),e_t=[{name:"OpenStreetMap",link:"https://openstreetmap.org",baseMaps:[{name:"OSM Mapnik",endpoint:"https://a.tile.osm.org/{z}/{x}/{y}.png"},{name:"OSM Humanitarian",endpoint:"https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"}],overlays:[]},{name:"ESRI",link:"https://services.arcgisonline.com/arcgis/rest/services",baseMaps:[{name:"Dark Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Hillshade",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Street Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Navigation Charts",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/{z}/{y}/{x}"},{name:"National Geographic",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Imagery",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"},{name:"World Shaded Relief",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}"},{name:"World Topo Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"}],overlays:[{name:"Dark Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Boundaries & Places",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}"},{name:"World Reference Overlay",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}"},{name:"World Transportation",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}"}]},{name:"CartoDB",link:"https://cartodb.com/basemaps/",baseMaps:[{name:"Positron",endpoint:"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"},{name:"Dark Matter",endpoint:"https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"},{name:"Positron (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png"},{name:"Dark Matter (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png"}],overlays:[{name:"Positron Labels",endpoint:"https://a.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png"},{name:"Dark Matter Labels",endpoint:"https://a.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png"}]}],t_t=e_t;function m5e(e){const t=[];return t_t.forEach(n=>{n[e].forEach(r=>{t.push({id:`${e}.${n.name}.${r.name}`,attribution:n.link,title:`${n.name} - ${r.name}`,url:r.endpoint,exclusive:e==="baseMaps"})})}),t}function v5e(e){const t=On.instance.branding.layers;return(t&&t[e]||[]).map(({id:n,...r})=>({...r,id:`${e}.${n}`}))}const n_t=m5e("overlays"),y5e=m5e("baseMaps"),r_t=y5e[0].id,Jw="EPSG:4326",qI="EPSG:3857",b5e=qI;var pg=(function(){function e(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return e.prototype.preventDefault=function(){this.defaultPrevented=!0},e.prototype.stopPropagation=function(){this.propagationStopped=!0},e})();const NO={PROPERTYCHANGE:"propertychange"};var gae=(function(){function e(){this.disposed=!1}return e.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},e.prototype.disposeInternal=function(){},e})();function i_t(e,t,n){for(var r,i,o=J1,s=0,a=e.length,l=!1;s>1),i=+o(e[r],t),i<0?s=r+1:(a=r,l=!i);return l?s:~s}function J1(e,t){return e>t?1:e0){for(i=1;i0?i-1:i:e[i-1]-t0||s===0)})}function C1(){return!0}function XI(){return!1}function ew(){}function a_t(e){var t=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!t||this!==i||!eS(o,r))&&(t=!0,i=this,r=o,n=e.apply(this,arguments)),n}}var bo=typeof Object.assign=="function"?Object.assign:function(e,t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),r=1,i=arguments.length;r0:!1},t.prototype.removeEventListener=function(n,r){var i=this.listeners_&&this.listeners_[n];if(i){var o=i.indexOf(r);o!==-1&&(this.pendingRemovals_&&n in this.pendingRemovals_?(i[o]=ew,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},t})(gae);const qn={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function $r(e,t,n,r,i){if(r&&r!==e&&(n=n.bind(r)),i){var o=n;n=function(){e.removeEventListener(t,n),o.apply(this,arguments)}}var s={target:e,type:t,listener:n};return e.addEventListener(t,n),s}function w5(e,t,n,r){return $r(e,t,n,r,!0)}function uo(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),YI(e))}var c_t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),QI=(function(e){c_t(t,e);function t(){var n=e.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.revision_=0,n}return t.prototype.changed=function(){++this.revision_,this.dispatchEvent(qn.CHANGE)},t.prototype.getRevision=function(){return this.revision_},t.prototype.onInternal=function(n,r){if(Array.isArray(n)){for(var i=n.length,o=new Array(i),s=0;s=0||B0.match(/cpu (os|iphone os) 15_4 like mac os x/));var v_t=B0.indexOf("webkit")!==-1&&B0.indexOf("edge")==-1,y_t=B0.indexOf("macintosh")!==-1,_5e=typeof devicePixelRatio<"u"?devicePixelRatio:1,U6=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,b_t=typeof Image<"u"&&Image.prototype.decode,C5e=(function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return e})();new Array(6);function $p(){return[1,0,0,1,0,0]}function x_t(e,t,n,r,i,o,s){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=s,e}function w_t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Ko(e,t){var n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function S_t(e,t,n){return x_t(e,t,0,0,n,0,0)}function av(e,t,n,r,i,o,s,a){var l=Math.sin(o),c=Math.cos(o);return e[0]=r*c,e[1]=i*l,e[2]=-r*l,e[3]=i*c,e[4]=s*r*c-a*r*l+t,e[5]=s*i*l+a*i*c+n,e}function vae(e,t){var n=__t(t);vr(n!==0,32);var r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5];return e[0]=s/n,e[1]=-i/n,e[2]=-o/n,e[3]=r/n,e[4]=(o*l-s*a)/n,e[5]=-(r*l-i*a)/n,e}function __t(e){return e[0]*e[3]-e[1]*e[2]}var Gxe;function O5e(e){var t="matrix("+e.join(", ")+")";if(U6)return t;var n=Gxe||(Gxe=document.createElement("div"));return n.style.transform=t,n.style.transform}const Gs={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function qxe(e){for(var t=Nu(),n=0,r=e.length;ni&&(l=l|Gs.RIGHT),ao&&(l=l|Gs.ABOVE),l===Gs.UNKNOWN&&(l=Gs.INTERSECTING),l}function Nu(){return[1/0,1/0,-1/0,-1/0]}function ph(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function ZI(e){return ph(1/0,1/0,-1/0,-1/0,e)}function O_t(e,t){var n=e[0],r=e[1];return ph(n,r,n,r,t)}function T5e(e,t,n,r,i){var o=ZI(i);return k5e(o,e,t,n,r)}function MA(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function P5e(e,t){return t[0]e[2]&&(e[2]=t[2]),t[1]e[3]&&(e[3]=t[3]),e}function DM(e,t){t[0]e[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function k5e(e,t,n,r,i){for(;nt[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function _ae(e){return e[2]=s&&g<=l),!r&&o&Gs.RIGHT&&!(i&Gs.RIGHT)&&(m=h-(d-l)*p,r=m>=a&&m<=c),!r&&o&Gs.BELOW&&!(i&Gs.BELOW)&&(g=d-(h-a)/p,r=g>=s&&g<=l),!r&&o&Gs.LEFT&&!(i&Gs.LEFT)&&(m=h-(d-s)*p,r=m>=a&&m<=c)}return r}function M_t(e,t,n,r){var i=[],o;i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]],t(i,i,2);for(var s=[],a=[],o=0,l=i.length;o=n[2])){var i=so(n),o=Math.floor((r[0]-n[0])/i),s=o*i;e[0]-=s,e[2]-=s}return e}function A_t(e,t){if(t.canWrapX()){var n=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[n[0],e[1],n[2],e[3]]];M5e(e,t);var r=so(n);if(so(e)>r)return[[n[0],e[1],n[2],e[3]]];if(e[0]n[2])return[[e[0],e[1],n[2],e[3]],[n[0],e[1],e[2]-r,e[3]]]}return[e]}var A5e=(function(){function e(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return e.prototype.canWrapX=function(){return this.canWrapX_},e.prototype.getCode=function(){return this.code_},e.prototype.getExtent=function(){return this.extent_},e.prototype.getUnits=function(){return this.units_},e.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||hh[this.units_]},e.prototype.getWorldExtent=function(){return this.worldExtent_},e.prototype.getAxisOrientation=function(){return this.axisOrientation_},e.prototype.isGlobal=function(){return this.global_},e.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)},e.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},e.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},e.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)},e.prototype.setWorldExtent=function(t){this.worldExtent_=t},e.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},e.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},e})();function gs(e,t,n){return Math.min(Math.max(e,t),n)}var R_t=(function(){var e;return"cosh"in Math?e=Math.cosh:e=function(t){var n=Math.exp(t);return(n+1/n)/2},e})(),I_t=(function(){var e;return"log2"in Math?e=Math.log2:e=function(t){return Math.log(t)*Math.LOG2E},e})();function D_t(e,t,n,r,i,o){var s=i-n,a=o-r;if(s!==0||a!==0){var l=((e-n)*s+(t-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return O1(e,t,n,r)}function O1(e,t,n,r){var i=n-e,o=r-t;return i*i+o*o}function L_t(e){for(var t=e.length,n=0;ni&&(i=s,r=o)}if(i===0)return null;var a=e[r];e[r]=e[n],e[n]=a;for(var l=n+1;l=0;d--){f[d]=e[d][t]/e[d][d];for(var h=d-1;h>=0;h--)e[h][t]-=e[h][d]*f[d]}return f}function cz(e){return e*Math.PI/180}function S0(e,t){var n=e%t;return n*t<0?n+t:n}function vm(e,t,n){return e+n*(t-e)}function R5e(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}function y$(e,t){return Math.floor(R5e(e,t))}function b$(e,t){return Math.ceil(R5e(e,t))}var F_t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),JI=6378137,PC=Math.PI*JI,$_t=[-PC,-PC,PC,PC],N_t=[-180,-85,180,85],x$=JI*Math.log(Math.tan(Math.PI/2)),c_=(function(e){F_t(t,e);function t(n){return e.call(this,{code:n,units:Zs.METERS,extent:$_t,global:!0,worldExtent:N_t,getPointResolution:function(r,i){return r/R_t(i[1]/JI)}})||this}return t})(A5e),Xxe=[new c_("EPSG:3857"),new c_("EPSG:102100"),new c_("EPSG:102113"),new c_("EPSG:900913"),new c_("http://www.opengis.net/def/crs/EPSG/0/3857"),new c_("http://www.opengis.net/gml/srs/epsg.xml#3857")];function z_t(e,t,n){var r=e.length,i=n>1?n:2,o=t;o===void 0&&(i>2?o=e.slice():o=new Array(r));for(var s=0;sx$?a=x$:a<-x$&&(a=-x$),o[s+1]=a}return o}function j_t(e,t,n){var r=e.length,i=n>1?n:2,o=t;o===void 0&&(i>2?o=e.slice():o=new Array(r));for(var s=0;ss)return 1;if(s>o)return-1}return 0}function X_t(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function _5(e,t){for(var n=!0,r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Cae(e,t){var n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,o=e[1]*n+e[0]*r;return e[0]=i,e[1]=o,e}function Y_t(e,t){return e[0]*=t,e[1]*=t,e}function Q_t(e,t){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function I5e(e,t){if(t.canWrapX()){var n=so(t.getExtent()),r=K_t(e,t,n);r&&(e[0]-=r*n)}return e}function K_t(e,t,n){var r=t.getExtent(),i=0;if(t.canWrapX()&&(e[0]r[2])){var o=n||so(r);i=Math.floor((e[0]-r[0])/o)}return i}var Z_t=63710088e-1;function Kxe(e,t,n){var r=Z_t,i=cz(e[1]),o=cz(t[1]),s=(o-i)/2,a=cz(t[0]-e[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var See=!0;function J_t(e){See=!1}function Oae(e,t,n){var r;if(t!==void 0){for(var i=0,o=e.length;i=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(See=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),e}function F5e(e,t){return e}function i1(e,t){return e}function oCt(){Zxe(Xxe),Zxe(Qxe),nCt(Qxe,Xxe,z_t,j_t)}oCt();function E1(e,t,n,r,i,o){for(var s=o||[],a=0,l=t;l1)f=n;else if(d>0){for(var h=0;hi&&(i=c),o=a,s=l}return i}function Mae(e,t,n,r,i){for(var o=0,s=n.length;o0;){for(var f=c.pop(),d=c.pop(),h=0,p=e[d],g=e[d+1],m=e[f],v=e[f+1],y=d+r;yh&&(u=y,h=S)}h>i&&(l[(u-t)/r]=1,d+r0&&g>h)&&(p<0&&m0&&m>p)){c=f,u=d;continue}o[s++]=c,o[s++]=u,a=c,l=u,c=f,u=d}}return o[s++]=c,o[s++]=u,s}function j5e(e,t,n,r,i,o,s,a){for(var l=0,c=n.length;l1?s:2,w=o||new Array(b),p=0;p>1;io&&(c-a)*(o-l)-(i-a)*(u-l)>0&&s++:u<=o&&(c-a)*(o-l)-(i-a)*(u-l)<0&&s--,a=c,l=u}return s!==0}function Lae(e,t,n,r,i,o){if(n.length===0||!o1(e,t,n[0],r,i,o))return!1;for(var s=1,a=n.length;s=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:B5e(e,t,n,r,function(s,a){return k_t(i,s,a)}):!1}function wCt(e,t,n,r,i){for(var o=0,s=n.length;ow&&(c=(u+f)/2,Lae(e,t,n,r,c,p)&&(b=c,w=S)),u=f}return isNaN(b)&&(b=i[o]),s?(s.push(b,p,w),s):[b,p,w]}function kCt(e,t,n,r,i){for(var o=[],s=0,a=n.length;s0}function Q5e(e,t,n,r,i){for(var o=0,s=n.length;o="a"&&t<="z"||t>="A"&&t<="Z"},e.prototype.isNumeric_=function(t,n){var r=n!==void 0?n:!1;return t>="0"&&t<="9"||t=="."&&!r},e.prototype.isWhiteSpace_=function(t){return t==" "||t==" "||t=="\r"||t==` +`},e.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},e.prototype.nextToken=function(){var t=this.nextChar_(),n=this.index_,r=t,i;if(t=="(")i=ti.LEFT_PAREN;else if(t==",")i=ti.COMMA;else if(t==")")i=ti.RIGHT_PAREN;else if(this.isNumeric_(t)||t=="-")i=ti.NUMBER,r=this.readNumber_();else if(this.isAlpha_(t))i=ti.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t==="")i=ti.EOF;else throw new Error("Unexpected character: "+t)}return{position:n,value:r,type:i}},e.prototype.readNumber_=function(){var t,n=this.index_,r=!1,i=!1;do t=="."?r=!0:(t=="e"||t=="E")&&(i=!0),t=this.nextChar_();while(this.isNumeric_(t,r)||!i&&(t=="e"||t=="E")||i&&(t=="-"||t=="+"));return parseFloat(this.wkt.substring(n,this.index_--))},e.prototype.readText_=function(){var t,n=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(n,this.index_--).toUpperCase()},e})(),WCt=(function(){function e(t){this.lexer_=t,this.token_={position:0,type:ti.START},this.layout_=qr.XY}return e.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},e.prototype.isTokenType=function(t){return this.token_.type==t},e.prototype.match=function(t){var n=this.isTokenType(t);return n&&this.consume_(),n},e.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},e.prototype.parseGeometryLayout_=function(){var t=qr.XY,n=this.token_;if(this.isTokenType(ti.TEXT)){var r=n.value;r===J5e?t=qr.XYZ:r===eje?t=qr.XYM:r===BCt&&(t=qr.XYZM),t!==qr.XY&&this.consume_()}return t},e.prototype.parseGeometryCollectionText_=function(){if(this.match(ti.LEFT_PAREN)){var t=[];do t.push(this.parseGeometry_());while(this.match(ti.COMMA));if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parsePointText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parsePoint_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parseLineStringText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parsePointList_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parsePolygonText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parseLineStringTextList_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parseMultiPointText_=function(){if(this.match(ti.LEFT_PAREN)){var t=void 0;if(this.token_.type==ti.LEFT_PAREN?t=this.parsePointTextList_():t=this.parsePointList_(),this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parseMultiLineStringText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parseLineStringTextList_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parseMultiPolygonText_=function(){if(this.match(ti.LEFT_PAREN)){var t=this.parsePolygonTextList_();if(this.match(ti.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())},e.prototype.parsePoint_=function(){for(var t=[],n=this.layout_.length,r=0;r0&&(i+=" "+o)}return r.length===0?i+" "+Z5e:i+"("+r+")"}class KCt extends Error{}const oje={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function sje(e,t){return new ZCt(t).parse(e)}let ZCt=class{options;constructor(t){this.options={...oje,...t},this.parseLine=this.parseLine.bind(this)}parse(t){return this.parseText(t).map(this.parseLine)}parseText(t){const{comment:n,trim:r}=this.options;return t.split(` +`).map((i,o)=>(r&&(i=i.trim()),[i,o])).filter(([i,o])=>i.trim()!==""&&!i.startsWith(n))}parseLine([t,n]){const{separator:r,quote:i,escape:o}=this.options;let s=!1;const a=[];let l=0,c=0;for(;c-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return P5}function i(a,l){r(a)===P5&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var rOt=function(t,n){return t===n};function iOt(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[0]!==a&&(o=[a,...o])}n.properties&&(s=i1e(n.properties,o)),s===void 0&&(s=i1e(n,o)),e[r]=s||i}function MOt(e,t){let n=t;if(e.properties)for(const r of Object.getOwnPropertyNames(e.properties)){if(!n.includes("${"))break;const i="${"+r+"}";n.includes(i)&&(n=n.replace(i,`${e.properties[r]}`))}return n}function i1e(e,t){let n;for(const r of t)if(r in e)return e[r];return n}function eD(e){let t=[];for(const n of e)t=t.concat(n.toLowerCase(),n.toUpperCase(),n[0].toUpperCase()+n.substring(1).toLowerCase());return t}function Bae(e,t){e.forEach(n=>{vT(n)&&n.features.forEach(r=>{t(n,r)})})}function AOt(e,t){const n=Zw(t)?(r,i)=>i.id===t:t;for(const r of e)if(vT(r)){const i=r.features.find(o=>n(r,o));if(i)return q6(r,i)}return null}function ROt(e){const t=e.id+"";let n=0,r,i;if(t.length===0)return n;for(r=0;ri.id===t);if(n)return n;const r=e.placeGroups;if(r)for(const i in r){const o=lje(r[i],t);if(o)return o}return null}function Uae(e,t){if(t)for(const n of e){const r=lje(n,t);if(r!==null)return r}return null}const IOt=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"].map(e=>e.toLowerCase());function o1e(e){if(e=e.trim(),e==="")return"csv";if(e[0]==="{")return"geojson";const t=e.substring(0,20).toLowerCase();return IOt.find(r=>t.startsWith(r)&&(t.length===r.length||` + (`.indexOf(t[r.length])>=0))?"wkt":"csv"}function uz(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(t=>t!=="")}const DOt=e=>{if(e.trim()!=="")try{sje(e)}catch(t){return console.error(t),`${t}`}return null},cje={name:"Text/CSV",fileExt:".txt,.csv",checkError:DOt},Mee={...oje,xNames:"longitude, lon, x",yNames:"latitude, lat, y",forceGeometry:!1,geometryNames:"geometry, geom",timeNames:"time, date, datetime, date-time",groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-"};let LOt=0,FOt=0;function $Ot(e,t){const n=sje(e,t);if(n.length<2)throw new Error(Ce.get("Missing header line in CSV"));for(const _ of n[0])if(typeof _!="string"||_==="")throw new Error(Ce.get("Invalid header line in CSV"));const r=n[0].map(_=>_),i=r.map(_=>_.toLowerCase()),o=r.length;for(const _ of n)if(_.length!==o)throw new Error(Ce.get("All rows must have same length"));const s=NOt(i),a=u_(s,t.groupNames),l=u_(s,t.labelNames),c=u_(s,t.timeNames),u=u_(s,t.xNames),f=u_(s,t.yNames);let d=u_(s,t.geometryNames);if(t.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(Ce.get("No geometry column(s) found"))}else d=-1;let p=t.groupPrefix.trim();p===""&&(p=Mee.groupPrefix);let g=t.labelPrefix.trim();g===""&&(g=Mee.labelPrefix);let m="";if(a===-1){const _=++LOt;m=`${p}${_}`}const v=new tje,y={};let b=1,w=0,S=Z1(0);for(;b=0&&(E=`${_[c]}`),a>=0&&(m=`${_[a]}`);let T=y[m];T||(T=zae(m,[]),y[m]=T,S=Z1(w),w++);let k=null;if(d>=0){if(typeof _[d]=="string")try{k=v.readGeometry(e)}catch{}}else{const R=_[u],F=_[f];typeof R=="number"&&Number.isFinite(R)&&typeof F=="number"&&Number.isFinite(F)&&(k=new Np([R,F]))}if(k===null)throw new Error(Ce.get(`Invalid geometry in data row ${b}`));const P={};_.forEach((R,F)=>{if(F!==u&&F!==f&&F!==d){const A=r[F];P[A]=R}});let I;if(l>=0)I=`${_[l]}`;else{const R=++FOt;I=`${g}${R}`}E!==""&&(P.time=E),P.color||(P.color=S),P.label||(P.label=I),P.source||(P.source="CSV"),T.features.push(jae(k,P))}return Object.getOwnPropertyNames(y).map(_=>y[_])}function NOt(e){const t={};for(let n=0;n{if(e.trim()!=="")try{JSON.parse(e)}catch(t){return console.error(t),`${t}`}return null},uje={name:"GeoJSON",fileExt:".json,.geojson",checkError:zOt},Aee={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let jOt=0,BOt=0;function UOt(e,t){const n=uz(t.groupNames||"");let r=t.groupPrefix.trim();r===""&&(r=Aee.groupPrefix);const i=uz(t.labelNames||"");let o=t.labelPrefix.trim();o===""&&(o=Aee.labelPrefix);const s=uz(t.timeNames||""),a=new rS;let l;try{l=a.readFeatures(e)}catch{try{const d=a.readGeometry(e);l=[new _m(d)]}catch{throw new Error(Ce.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",g="",m="",v=Z1(0);if(d){const w={};Object.getOwnPropertyNames(d).forEach(S=>{w[S.toLowerCase()]=d[S]}),p=ZG(w,s,p),m=ZG(w,i,m),g=ZG(w,n,g)}if(g===""){const w=++jOt;g=`${r}-${w}`}if(m===""){const w=++BOt;m=`${o}-${w}`}let y=c[g];y||(y=zae(g,[]),c[g]=y,v=Z1(u),u++);const b={...d};p!==""&&(b.time=p),b.color||(b.color=v),b.label||(b.label=m),b.source||(b.source="GeoJSON"),y.features.push(jae(h,b))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function ZG(e,t,n){if(n===""){for(const r of t)if(e[r]==="string")return e[r]}return n}function fje(e){return e.getTimezoneOffset()*6e4}function VOt(e){return e.getTime()-fje(e)}function JG(e){const t=new Date(e);return new Date(t.getTime()+fje(t))}function IA(e){return new Date(e).toISOString().substring(0,10)}function yT(e){return dje(new Date(e).toISOString())}function dje(e){return e.substring(0,19).replace("T"," ")}const WOt=e=>null,hje={name:"WKT",fileExt:".txt,.wkt",checkError:WOt},Ree={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:yT(new Date().getTime())};let HOt=0,GOt=0;function qOt(e,t){let n=t.groupPrefix.trim();n===""&&(n=Ree.groupPrefix);let r=t.group.trim();if(r===""){const a=++HOt;r=`${n}${a}`}let i=t.labelPrefix.trim();i===""&&(i=Ree.labelPrefix);let o=t.label.trim();if(o===""){const a=++GOt;o=`${i}${a}`}const s=t.time.trim();try{const a=new tje().readGeometry(e);let l={color:Z1(Math.floor(1e3*Math.random())),label:o,source:"WKT"};s!==""&&(l={time:s,...l});const c=[jae(a,l)];return[zae(r,c)]}catch{throw new Error(Ce.get("Invalid Geometry WKT"))}}function bT(e){return XOt("localStorage",e)}function XOt(e,t){try{const n=window[e],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new YOt(n,t)}catch{return null}}class YOt{nativeStorage;brandingName;constructor(t,n){this.nativeStorage=t,this.brandingName=n}getItem(t,n,r,i){const o=this.nativeStorage.getItem(this.makeKey(t));if(o!==null)try{const s=r?r(o):o;return i?i(s):s}catch(s){console.error(`Failed parsing user setting "${t}": ${s}`)}return typeof n>"u"?null:n}getObjectItem(t,n){return this.getItem(t,n,r=>JSON.parse(r))}getBooleanProperty(t,n,r){this.getProperty(t,n,r,i=>i==="true")}getIntProperty(t,n,r){this.getProperty(t,n,r,parseInt)}getStringProperty(t,n,r){this.getProperty(t,n,r,i=>i)}getArrayProperty(t,n,r,i){this.getProperty(t,n,r,o=>{const s=JSON.parse(o);if(Array.isArray(s))return s;const a=r[t];return Array.isArray(a)?a:[]},i)}getObjectProperty(t,n,r){this.getProperty(t,n,r,i=>{const o=JSON.parse(i),s=r[t],a={...s,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=s[l],u=o[l];$O(c)&&$O(u)&&(a[l]={...c,...u})}),a})}getProperty(t,n,r,i,o){n[t]=this.getItem(t,r[t],i,o)}setItem(t,n,r){if(typeof n>"u"||n===null)this.nativeStorage.removeItem(this.makeKey(t));else{const i=r?r(n):n+"";this.nativeStorage.setItem(this.makeKey(t),i)}}setObjectItem(t,n){this.setItem(t,n,r=>JSON.stringify(r))}setPrimitiveProperty(t,n){this.setItem(t,n[t])}setArrayProperty(t,n){this.setObjectItem(t,n[t])}setObjectProperty(t,n){this.setObjectItem(t,n[t])}makeKey(t){return`xcube.${this.brandingName}.${t}`}}function QOt(e){const t=bT(On.instance.name);if(t)try{t.setObjectItem("userServers",e)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function KOt(){const e=bT(On.instance.name);if(e)try{return e.getObjectItem("userServers",[])}catch(t){console.warn(`failed to load user servers: ${t}`)}return[]}function ZOt(e){const t=bT(On.instance.name);if(t)try{t.setObjectItem("userVariables",e)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function JOt(){const e=bT(On.instance.name);if(e)try{return e.getObjectItem("userVariables",{})}catch(t){console.warn(`failed to load user variables: ${t}`)}return{}}function Vh(e){const t=bT(On.instance.name);if(t)try{t.setPrimitiveProperty("locale",e),t.setPrimitiveProperty("privacyNoticeAccepted",e),t.setPrimitiveProperty("autoShowTimeSeries",e),t.setPrimitiveProperty("timeSeriesIncludeStdev",e),t.setPrimitiveProperty("timeSeriesChartTypeDefault",e),t.setPrimitiveProperty("timeSeriesUseMedian",e),t.setPrimitiveProperty("timeAnimationInterval",e),t.setPrimitiveProperty("timeChunkSize",e),t.setPrimitiveProperty("sidePanelOpen",e),t.setPrimitiveProperty("sidePanelId",e),t.setPrimitiveProperty("sidePanelSize",e),t.setPrimitiveProperty("volumeRenderMode",e),t.setObjectProperty("layerVisibilities",e),t.setObjectProperty("infoCardElementStates",e),t.setPrimitiveProperty("imageSmoothingEnabled",e),t.setPrimitiveProperty("mapProjection",e),t.setArrayProperty("userBaseMaps",e),t.setArrayProperty("userOverlays",e),t.setArrayProperty("userColorBars",e),t.setPrimitiveProperty("userDrawnPlaceGroupName",e),t.setPrimitiveProperty("datasetLocateMode",e),t.setPrimitiveProperty("placeLocateMode",e),t.setPrimitiveProperty("exportTimeSeries",e),t.setPrimitiveProperty("exportTimeSeriesSeparator",e),t.setPrimitiveProperty("exportPlaces",e),t.setPrimitiveProperty("exportPlacesAsCollection",e),t.setPrimitiveProperty("exportZipArchive",e),t.setPrimitiveProperty("exportFileName",e),t.setPrimitiveProperty("userPlacesFormatName",e),t.setObjectProperty("userPlacesFormatOptions",e),t.setPrimitiveProperty("themeMode",e),t.setPrimitiveProperty("exportResolution",e),t.setPrimitiveProperty("showProgressBar",e),t.setPrimitiveProperty("showZoomInfoBox",e)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function eEt(e){const t=bT(On.instance.name);if(t){const n={...e};try{t.getStringProperty("locale",n,e),t.getBooleanProperty("privacyNoticeAccepted",n,e),t.getBooleanProperty("autoShowTimeSeries",n,e),t.getBooleanProperty("timeSeriesIncludeStdev",n,e),t.getStringProperty("timeSeriesChartTypeDefault",n,e),t.getBooleanProperty("timeSeriesUseMedian",n,e),t.getIntProperty("timeAnimationInterval",n,e),t.getIntProperty("timeChunkSize",n,e),t.getBooleanProperty("sidePanelOpen",n,e),t.getStringProperty("sidePanelId",n,e),t.getIntProperty("sidePanelSize",n,e),t.getStringProperty("volumeRenderMode",n,e),t.getObjectProperty("infoCardElementStates",n,e),t.getObjectProperty("layerVisibilities",n,e),t.getBooleanProperty("imageSmoothingEnabled",n,e),t.getStringProperty("mapProjection",n,e),t.getArrayProperty("userBaseMaps",n,e),t.getArrayProperty("userOverlays",n,e),t.getArrayProperty("userColorBars",n,e,tEt),t.getStringProperty("userDrawnPlaceGroupName",n,e),t.getStringProperty("datasetLocateMode",n,e),t.getStringProperty("placeLocateMode",n,e),t.getBooleanProperty("exportTimeSeries",n,e),t.getStringProperty("exportTimeSeriesSeparator",n,e),t.getBooleanProperty("exportPlaces",n,e),t.getBooleanProperty("exportPlacesAsCollection",n,e),t.getBooleanProperty("exportZipArchive",n,e),t.getStringProperty("exportFileName",n,e),t.getStringProperty("userPlacesFormatName",n,e),t.getObjectProperty("userPlacesFormatOptions",n,e),t.getStringProperty("themeMode",n,e),t.getStringProperty("exportResolution",n,e)}catch(r){console.warn(`Failed to load user settings: ${r}`)}return n}else console.warn("User settings not found or access denied");return e}const s1e={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function tEt(e){if(Array.isArray(e))return e.map(t=>({...t,type:nEt(t.type)}))}function nEt(e){return Zw(e)&&e in s1e?s1e[e]:"continuous"}const rEt=[250,500,1e3,2500],pje=["light","dark","system"],iEt=[["light","Light"],["dark","Dark"],["system","System"]];function oEt(){const e=On.instance.branding,t={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:On.instance.server.id,selectedTime:null,selectedTimeRange:null,timeSeriesUpdateMode:"add",timeAnimationActive:!1,timeAnimationInterval:1e3,timeChunkSize:20,autoShowTimeSeries:!0,timeSeriesChartTypeDefault:"line",timeSeriesIncludeStdev:!0,timeSeriesUseMedian:e.defaultAgg==="median",userDrawnPlaceGroupName:"",userPlacesFormatName:"csv",userPlacesFormatOptions:{csv:{...Mee},geojson:{...Aee},wkt:{...Ree}},flyTo:null,activities:{},locale:"en",dialogOpen:{},privacyNoticeAccepted:!1,mapInteraction:"Select",lastMapInteraction:"Select",layerMenuOpen:!1,layerVisibilities:{datasetRgb:!1,datasetRgb2:!1,datasetVariable:!0,datasetVariable2:!0,datasetBoundary:!1,datasetPlaces:!0,userPlaces:!0,[r_t]:!0,...e.layerVisibilities},layerGroupStates:{overlays:!1,predefined:!0,baseMaps:!1},variableCompareMode:!1,mapPointInfoBoxEnabled:!1,datasetLocateMode:"panAndZoom",placeLocateMode:"panAndZoom",sidePanelOpen:!1,sidePanelId:"details",sidePanelSize:Math.max(window.innerWidth,window.innerHeight)/3,volumeRenderMode:"mip",volumeStates:{},infoCardElementStates:{dataset:{visible:!0,viewMode:"text"},variable:{visible:!0,viewMode:"text"},place:{visible:!0,viewMode:"text"}},mapProjection:e.mapProjection||b5e,imageSmoothingEnabled:!1,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export",themeMode:sEt(),exportResolution:300,showProgressBar:e.showProgressBar??!0,showZoomInfoBox:e.showZoomInfoBox||!1,zoomLevel:void 0,datasetZLevel:void 0};return eEt(t)}function sEt(){const e=On.instance.branding.themeMode;return e&&pje.includes(e)?e:"system"}function gje(e,t){return t||(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),e&&pje.includes(e)&&e!=="system"?e:t}const Qs={},aEt=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,lEt=e=>{let t;if(e.includes(",")){const r=e.split(",");if(r.length===3||r.length===4){const i=[0,0,0,255];for(let o=0;o<3;o++){const s=Number.parseInt(r[o]);if(s<0||s>255)return;i[o]=s}if(r.length===4){if(t=a1e(r[3]),t===void 0)return;i[3]=t}return i}if(r.length!==2||(e=r[0],t=a1e(r[1]),t===void 0))return}const n=(e.startsWith("#")?vje:uEt)(e);if(n){if(n.length===3)return[...n,t===void 0?255:t];if(n.length===4&&t===void 0)return n}};function mje(e){return"#"+e.map(t=>{const n=t.toString(16);return n.length===1?"0"+n:n}).join("")}function vje(e){if(aEt.test(e)){if(e.length===4)return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e.length===7)return[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];if(e.length===9)return[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16),parseInt(e.substring(7,9),16)]}}const a1e=e=>{const t=Number.parseFloat(e);if(t===0)return 0;if(t===1)return 255;if(t>0&&t<1)return Math.round(256*t)},cEt=e=>fEt[e.toLowerCase()],uEt=e=>{const t=cEt(e);if(t)return vje(t)},fEt={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};function dEt(e){return Eh(`${e}/colorbars`,hEt)}function hEt(e){const t=[],n={},r={};return e.forEach(i=>{const[o,s,a]=i,l=[];a.forEach(c=>{if(c.length===3){const[u,f,d]=c;l.push(u),n[u]=f,r[u]={name:d.name,type:d.type,colorRecords:d.colors.map(pEt)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),t.push({title:o,description:s,names:l})}),{groups:t,images:n,customColorMaps:r}}function pEt(e){const t=gEt(e[1]),n=e[0];if(e.length===3){const r=e[2];return{value:n,color:t,label:r}}else return{value:n,color:t}}function gEt(e){return e?Zw(e)?e:mje(e):"#000000"}function mEt(e,t){const n=xv(`${e}/datasets`,[["details","1"]]),r=Sb(t);return Eh(n,r,vEt)}function vEt(e){return{datasets:(e.datasets||[]).map(yEt),entrypointDatasetId:e.entrypointDatasetId}}function yEt(e){if(e.dimensions&&e.dimensions.length){let t=e.dimensions;const n=t.findIndex(r=>r.name==="time");if(n>-1){const r=t[n],i=r.coordinates;if(i&&i.length&&typeof i[0]=="string"){const o=i,s=o.map(a=>new Date(a).getTime());return t=[...t],t[n]={...r,coordinates:s,labels:o},{...e,dimensions:t}}}}return e}function bEt(e,t,n,r){const i=Sb(r),o=encodeURIComponent(t),s=encodeURIComponent(n);return Eh(`${e}/datasets/${o}/places/${s}`,i)}function xEt(e){return Eh(`${e}/expressions/capabilities`)}function wEt(e){return Eh(`${e}/`)}function tD(e){return Zw(e.expression)}function xT(e){return encodeURIComponent(Zw(e)?e:e.id)}function nD(e){return encodeURIComponent(Zw(e)?e:tD(e)?`${e.name}=${e.expression}`:e.name)}function SEt(e,t,n,r,i,o,s,a,l,c){let u,f=null;const d=[];a?(d.push(["aggMethods","median"]),u="median"):l?(d.push(["aggMethods","mean,std"]),u="mean",f="std"):(d.push(["aggMethods","mean"]),u="mean"),o&&d.push(["startDate",o]),s&&d.push(["endDate",s]);const h=xv(`${e}/timeseries/${xT(t)}/${nD(n)}`,d),p={...Sb(c),method:"post",body:JSON.stringify(i)};return Eh(h,p,m=>{const v=m.result;if(!v||v.length===0)return null;const y=v.map(w=>({...w,time:new Date(w.time).getTime()}));return{source:{datasetId:t.id,datasetTitle:t.title,variableName:n.name,variableUnits:n.units||void 0,placeId:r,geometry:i,valueDataKey:u,errorDataKey:f},data:y}})}function _Et(e,t,n,r,i,o){const s=i!==null?[["time",i]]:[],a=xv(`${e}/statistics/${xT(t)}/${nD(n)}`,s),l={...Sb(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:t,variable:n,placeInfo:r,time:i};return Eh(a,l,u=>({source:c,statistics:u.result}))}function CEt(e,t,n,r,i,o,s){const a=[["lon",r.toString()],["lat",i.toString()]];o&&a.push(["time",o]);const l=xv(`${e}/statistics/${xT(t)}/${nD(n)}`,a);return Eh(l,Sb(s),c=>c.result?c.result:{})}function OEt(e,t){const n=xv(`${e}/maintenance/update`,[]),r=Sb(t);try{return Eh(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}function EEt(e,t,n){const r=xv(`${e}/viewer/state`,[["key",n]]);return Eh(r,Sb(t)).then(i=>i).catch(i=>`${i}`)}function TEt(e,t,n){const r=xv(`${e}/viewer/state`,[]),i={...Sb(t),method:"PUT",body:JSON.stringify(n)};try{return Eh(r,i).then(o=>o.key).catch(o=>{console.error(o)})}catch(o){return console.error(o),Promise.resolve(void 0)}}const Si={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};var PEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),yje=(function(e){PEt(t,e);function t(n){var r=e.call(this)||this;r.on,r.once,r.un,r.background_=n.background;var i=bo({},n);return typeof n.properties=="object"&&(delete i.properties,bo(i,n.properties)),i[Si.OPACITY]=n.opacity!==void 0?n.opacity:1,vr(typeof i[Si.OPACITY]=="number",64),i[Si.VISIBLE]=n.visible!==void 0?n.visible:!0,i[Si.Z_INDEX]=n.zIndex,i[Si.MAX_RESOLUTION]=n.maxResolution!==void 0?n.maxResolution:1/0,i[Si.MIN_RESOLUTION]=n.minResolution!==void 0?n.minResolution:0,i[Si.MIN_ZOOM]=n.minZoom!==void 0?n.minZoom:-1/0,i[Si.MAX_ZOOM]=n.maxZoom!==void 0?n.maxZoom:1/0,r.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,r.setProperties(i),r.state_=null,r}return t.prototype.getBackground=function(){return this.background_},t.prototype.getClassName=function(){return this.className_},t.prototype.getLayerState=function(n){var r=this.state_||{layer:this,managed:n===void 0?!0:n},i=this.getZIndex();return r.opacity=gs(Math.round(this.getOpacity()*100)/100,0,1),r.visible=this.getVisible(),r.extent=this.getExtent(),r.zIndex=i===void 0&&!r.managed?1/0:i,r.maxResolution=this.getMaxResolution(),r.minResolution=Math.max(this.getMinResolution(),0),r.minZoom=this.getMinZoom(),r.maxZoom=this.getMaxZoom(),this.state_=r,r},t.prototype.getLayersArray=function(n){return vn()},t.prototype.getLayerStatesArray=function(n){return vn()},t.prototype.getExtent=function(){return this.get(Si.EXTENT)},t.prototype.getMaxResolution=function(){return this.get(Si.MAX_RESOLUTION)},t.prototype.getMinResolution=function(){return this.get(Si.MIN_RESOLUTION)},t.prototype.getMinZoom=function(){return this.get(Si.MIN_ZOOM)},t.prototype.getMaxZoom=function(){return this.get(Si.MAX_ZOOM)},t.prototype.getOpacity=function(){return this.get(Si.OPACITY)},t.prototype.getSourceState=function(){return vn()},t.prototype.getVisible=function(){return this.get(Si.VISIBLE)},t.prototype.getZIndex=function(){return this.get(Si.Z_INDEX)},t.prototype.setBackground=function(n){this.background_=n,this.changed()},t.prototype.setExtent=function(n){this.set(Si.EXTENT,n)},t.prototype.setMaxResolution=function(n){this.set(Si.MAX_RESOLUTION,n)},t.prototype.setMinResolution=function(n){this.set(Si.MIN_RESOLUTION,n)},t.prototype.setMaxZoom=function(n){this.set(Si.MAX_ZOOM,n)},t.prototype.setMinZoom=function(n){this.set(Si.MIN_ZOOM,n)},t.prototype.setOpacity=function(n){vr(typeof n=="number",64),this.set(Si.OPACITY,n)},t.prototype.setVisible=function(n){this.set(Si.VISIBLE,n)},t.prototype.setZIndex=function(n){this.set(Si.Z_INDEX,n)},t.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),e.prototype.disposeInternal.call(this)},t})(gg);const _0={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var kEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),X6=(function(e){kEt(t,e);function t(n){var r=this,i=bo({},n);delete i.source,r=e.call(this,i)||this,r.on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,n.render&&(r.render=n.render),n.map&&r.setMap(n.map),r.addChangeListener(Si.SOURCE,r.handleSourcePropertyChange_);var o=n.source?n.source:null;return r.setSource(o),r}return t.prototype.getLayersArray=function(n){var r=n||[];return r.push(this),r},t.prototype.getLayerStatesArray=function(n){var r=n||[];return r.push(this.getLayerState()),r},t.prototype.getSource=function(){return this.get(Si.SOURCE)||null},t.prototype.getRenderSource=function(){return this.getSource()},t.prototype.getSourceState=function(){var n=this.getSource();return n?n.getState():"undefined"},t.prototype.handleSourceChange_=function(){this.changed()},t.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(uo(this.sourceChangeKey_),this.sourceChangeKey_=null);var n=this.getSource();n&&(this.sourceChangeKey_=$r(n,qn.CHANGE,this.handleSourceChange_,this)),this.changed()},t.prototype.getFeatures=function(n){return this.renderer_?this.renderer_.getFeatures(n):new Promise(function(r){return r([])})},t.prototype.getData=function(n){return!this.renderer_||!this.rendered?null:this.renderer_.getData(n)},t.prototype.render=function(n,r){var i=this.getRenderer();if(i.prepareFrame(n))return this.rendered=!0,i.renderFrame(n,r)},t.prototype.unrender=function(){this.rendered=!1},t.prototype.setMapInternal=function(n){n||this.unrender(),this.set(Si.MAP,n)},t.prototype.getMapInternal=function(){return this.get(Si.MAP)},t.prototype.setMap=function(n){this.mapPrecomposeKey_&&(uo(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),n||this.changed(),this.mapRenderKey_&&(uo(this.mapRenderKey_),this.mapRenderKey_=null),n&&(this.mapPrecomposeKey_=$r(n,_0.PRECOMPOSE,function(r){var i=r,o=i.frameState.layerStatesArray,s=this.getLayerState(!1);vr(!o.some(function(a){return a.layer===s.layer}),67),o.push(s)},this),this.mapRenderKey_=$r(this,qn.CHANGE,n.render,n),this.changed())},t.prototype.setSource=function(n){this.set(Si.SOURCE,n)},t.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},t.prototype.hasRenderer=function(){return!!this.renderer_},t.prototype.createRenderer=function(){return null},t.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),e.prototype.disposeInternal.call(this)},t})(yje);function k5(e,t){if(!e.visible)return!1;var n=t.resolution;if(n=e.maxResolution)return!1;var r=t.zoom;return r>e.minZoom&&r<=e.maxZoom}const _$={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var MEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),AEt=(function(e){MEt(t,e);function t(n){var r=this,i=n||{},o=bo({},i);return delete o.preload,delete o.useInterimTilesOnError,r=e.call(this,o)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return t.prototype.getPreload=function(){return this.get(_$.PRELOAD)},t.prototype.setPreload=function(n){this.set(_$.PRELOAD,n)},t.prototype.getUseInterimTilesOnError=function(){return this.get(_$.USE_INTERIM_TILES_ON_ERROR)},t.prototype.setUseInterimTilesOnError=function(n){this.set(_$.USE_INTERIM_TILES_ON_ERROR,n)},t.prototype.getData=function(n){return e.prototype.getData.call(this,n)},t})(X6);const Ki={IDLE:0,LOADING:1,LOADED:2,ERROR:3};var REt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),IEt=(function(e){REt(t,e);function t(n){var r=e.call(this)||this;return r.ready=!0,r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=n,r.declutterExecutorGroup=null,r}return t.prototype.getFeatures=function(n){return vn()},t.prototype.getData=function(n){return null},t.prototype.prepareFrame=function(n){return vn()},t.prototype.renderFrame=function(n,r){return vn()},t.prototype.loadedTileCallback=function(n,r,i){n[r]||(n[r]={}),n[r][i.tileCoord.toString()]=i},t.prototype.createLoadedTileFinder=function(n,r,i){return(function(o,s){var a=this.loadedTileCallback.bind(this,i,o);return n.forEachLoadedTile(r,o,s,a)}).bind(this)},t.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){},t.prototype.getDataAtPixel=function(n,r,i){return null},t.prototype.getLayer=function(){return this.layer_},t.prototype.handleFontsChanged=function(){},t.prototype.handleImageChange_=function(n){var r=n.target;r.getState()===Ki.LOADED&&this.renderIfReadyAndVisible()},t.prototype.loadImage=function(n){var r=n.getState();return r!=Ki.LOADED&&r!=Ki.ERROR&&n.addEventListener(qn.CHANGE,this.boundHandleImageChange_),r==Ki.IDLE&&(n.load(),r=n.getState()),r==Ki.LOADED},t.prototype.renderIfReadyAndVisible=function(){var n=this.getLayer();n&&n.getVisible()&&n.getSourceState()==="ready"&&n.changed()},t.prototype.disposeInternal=function(){delete this.layer_,e.prototype.disposeInternal.call(this)},t})(QI),DEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),bje=(function(e){DEt(t,e);function t(n,r,i,o){var s=e.call(this,n)||this;return s.inversePixelTransform=r,s.frameState=i,s.context=o,s}return t})(pg),LEt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,FEt=/^([a-z]*)$|^hsla?\(.*\)$/i;function xje(e){return typeof e=="string"?e:wje(e)}function $Et(e){var t=document.createElement("div");if(t.style.color=e,t.style.color!==""){document.body.appendChild(t);var n=getComputedStyle(t).color;return document.body.removeChild(t),n}else return""}var NEt=(function(){var e=1024,t={},n=0;return(function(r){var i;if(t.hasOwnProperty(r))i=t[r];else{if(n>=e){var o=0;for(var s in t)(o++&3)===0&&(delete t[s],--n)}i=zEt(r),t[r]=i,++n}return i})})();function M5(e){return Array.isArray(e)?e:NEt(e)}function zEt(e){var t,n,r,i,o;if(FEt.exec(e)&&(e=$Et(e)),LEt.exec(e)){var s=e.length-1,a=void 0;s<=4?a=1:a=2;var l=s===4||s===8;t=parseInt(e.substr(1+0*a,a),16),n=parseInt(e.substr(1+1*a,a),16),r=parseInt(e.substr(1+2*a,a),16),l?i=parseInt(e.substr(1+3*a,a),16):i=255,a==1&&(t=(t<<4)+t,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[t,n,r,i/255]}else e.indexOf("rgba(")==0?(o=e.slice(5,-1).split(",").map(Number),l1e(o)):e.indexOf("rgb(")==0?(o=e.slice(4,-1).split(",").map(Number),o.push(1),l1e(o)):vr(!1,14);return o}function l1e(e){return e[0]=gs(e[0]+.5|0,0,255),e[1]=gs(e[1]+.5|0,0,255),e[2]=gs(e[2]+.5|0,0,255),e[3]=gs(e[3],0,1),e}function wje(e){var t=e[0];t!=(t|0)&&(t=t+.5|0);var n=e[1];n!=(n|0)&&(n=n+.5|0);var r=e[2];r!=(r|0)&&(r=r+.5|0);var i=e[3]===void 0?1:Math.round(e[3]*100)/100;return"rgba("+t+","+n+","+r+","+i+")"}function zu(e,t,n,r){var i;return n&&n.length?i=n.shift():U6?i=new OffscreenCanvas(e||300,t||300):i=document.createElement("canvas"),e&&(i.width=e),t&&(i.height=t),i.getContext("2d",r)}function Sje(e){var t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function c1e(e,t){var n=t.parentNode;n&&n.replaceChild(e,t)}function Iee(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}function jEt(e){for(;e.lastChild;)e.removeChild(e.lastChild)}function BEt(e,t){for(var n=e.childNodes,r=0;;++r){var i=n[r],o=t[r];if(!i&&!o)break;if(i!==o){if(!i){e.appendChild(o);continue}if(!o){e.removeChild(i),--r;continue}e.insertBefore(o,i)}}}var UEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),u1e=[],fC=null;function VEt(){var e=document.createElement("canvas");e.width=1,e.height=1,fC=e.getContext("2d")}var _je=(function(e){UEt(t,e);function t(n){var r=e.call(this,n)||this;return r.container=null,r.renderedResolution,r.tempTransform=$p(),r.pixelTransform=$p(),r.inversePixelTransform=$p(),r.context=null,r.containerReused=!1,r.pixelContext_=null,r.frameState=null,r}return t.prototype.getImageData=function(n,r,i){fC||VEt(),fC.clearRect(0,0,1,1);var o;try{fC.drawImage(n,r,i,1,1,0,0,1,1),o=fC.getImageData(0,0,1,1).data}catch{return fC=null,null}return o},t.prototype.getBackground=function(n){var r=this.getLayer(),i=r.getBackground();return typeof i=="function"&&(i=i(n.viewState.resolution)),i||void 0},t.prototype.useContainer=function(n,r,i){var o=this.getLayer().getClassName(),s,a;if(n&&n.className===o&&(!i||n&&n.style.backgroundColor&&eS(M5(n.style.backgroundColor),M5(i)))){var l=n.firstElementChild;l instanceof HTMLCanvasElement&&(a=l.getContext("2d"))}if(a&&a.canvas.style.transform===r?(this.container=n,this.context=a,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){s=document.createElement("div"),s.className=o;var c=s.style;c.position="absolute",c.width="100%",c.height="100%",a=zu();var l=a.canvas;s.appendChild(l),c=l.style,c.position="absolute",c.left="0",c.transformOrigin="top left",this.container=s,this.context=a}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)},t.prototype.clipUnrotated=function(n,r,i){var o=nS(i),s=Sae(i),a=wae(i),l=xae(i);Ko(r.coordinateToPixelTransform,o),Ko(r.coordinateToPixelTransform,s),Ko(r.coordinateToPixelTransform,a),Ko(r.coordinateToPixelTransform,l);var c=this.inversePixelTransform;Ko(c,o),Ko(c,s),Ko(c,a),Ko(c,l),n.save(),n.beginPath(),n.moveTo(Math.round(o[0]),Math.round(o[1])),n.lineTo(Math.round(s[0]),Math.round(s[1])),n.lineTo(Math.round(a[0]),Math.round(a[1])),n.lineTo(Math.round(l[0]),Math.round(l[1])),n.clip()},t.prototype.dispatchRenderEvent_=function(n,r,i){var o=this.getLayer();if(o.hasListener(n)){var s=new bje(n,this.inversePixelTransform,i,r);o.dispatchEvent(s)}},t.prototype.preRender=function(n,r){this.frameState=r,this.dispatchRenderEvent_(_0.PRERENDER,n,r)},t.prototype.postRender=function(n,r){this.dispatchRenderEvent_(_0.POSTRENDER,n,r)},t.prototype.getRenderTransform=function(n,r,i,o,s,a,l){var c=s/2,u=a/2,f=o/r,d=-f,h=-n[0]+l,p=-n[1];return av(this.tempTransform,c,u,f,d,-i,h,p)},t.prototype.getDataAtPixel=function(n,r,i){var o=Ko(this.inversePixelTransform,n.slice()),s=this.context,a=this.getLayer(),l=a.getExtent();if(l){var c=Ko(r.pixelToCoordinateTransform,n.slice());if(!KI(l,c))return null}var u=Math.round(o[0]),f=Math.round(o[1]),d=this.pixelContext_;if(!d){var h=document.createElement("canvas");h.width=1,h.height=1,d=h.getContext("2d"),this.pixelContext_=d}d.clearRect(0,0,1,1);var p;try{d.drawImage(s.canvas,u,f,1,1,0,0,1,1),p=d.getImageData(0,0,1,1).data}catch(g){return g.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):p}return p[3]===0?null:p},t.prototype.disposeInternal=function(){delete this.frameState,e.prototype.disposeInternal.call(this)},t})(IEt);const $n={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Cje(e){return Math.pow(e,3)}function wT(e){return 1-Cje(1-e)}function WEt(e){return 3*e*e-2*e*e*e}function HEt(e){return e}var GEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Oje=(function(e){GEt(t,e);function t(n,r,i){var o=e.call(this)||this,s=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=s.transition===void 0?250:s.transition,o.transitionStarts_={},o.interpolate=!!s.interpolate,o}return t.prototype.changed=function(){this.dispatchEvent(qn.CHANGE)},t.prototype.release=function(){},t.prototype.getKey=function(){return this.key+"/"+this.tileCoord},t.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==$n.LOADED)return this.transition_=0,n;n=n.interimTile}while(n);return this},t.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,r=this;do{if(n.getState()==$n.LOADED){n.interimTile=null;break}else n.getState()==$n.LOADING?r=n:n.getState()==$n.IDLE?r.interimTile=n.interimTile:r=n;n=r.interimTile}while(n)}},t.prototype.getTileCoord=function(){return this.tileCoord},t.prototype.getState=function(){return this.state},t.prototype.setState=function(n){if(this.state!==$n.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},t.prototype.load=function(){vn()},t.prototype.getAlpha=function(n,r){if(!this.transition_)return 1;var i=this.transitionStarts_[n];if(!i)i=r,this.transitionStarts_[n]=i;else if(i===-1)return 1;var o=r-i+1e3/60;return o>=this.transition_?1:Cje(o/this.transition_)},t.prototype.inTransition=function(n){return this.transition_?this.transitionStarts_[n]!==-1:!1},t.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},t})(gT),qEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),XEt=(function(e){qEt(t,e);function t(n,r,i,o){var s=e.call(this)||this;return s.extent=n,s.pixelRatio_=i,s.resolution=r,s.state=o,s}return t.prototype.changed=function(){this.dispatchEvent(qn.CHANGE)},t.prototype.getExtent=function(){return this.extent},t.prototype.getImage=function(){return vn()},t.prototype.getPixelRatio=function(){return this.pixelRatio_},t.prototype.getResolution=function(){return this.resolution},t.prototype.getState=function(){return this.state},t.prototype.load=function(){vn()},t})(gT),YEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){YEt(t,e);function t(n,r,i,o,s,a){var l=e.call(this,n,r,i,Ki.IDLE)||this;return l.src_=o,l.image_=new Image,s!==null&&(l.image_.crossOrigin=s),l.unlisten_=null,l.state=Ki.IDLE,l.imageLoadFunction_=a,l}return t.prototype.getImage=function(){return this.image_},t.prototype.handleImageError_=function(){this.state=Ki.ERROR,this.unlistenImage_(),this.changed()},t.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Xf(this.extent)/this.image_.height),this.state=Ki.LOADED,this.unlistenImage_(),this.changed()},t.prototype.load=function(){(this.state==Ki.IDLE||this.state==Ki.ERROR)&&(this.state=Ki.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Vae(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},t.prototype.setImage=function(n){this.image_=n,this.resolution=Xf(this.extent)/this.image_.height},t.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},t})(XEt);function Vae(e,t,n){var r=e,i=!0,o=!1,s=!1,a=[w5(r,qn.LOAD,function(){s=!0,o||t()})];return r.src&&b_t?(o=!0,r.decode().then(function(){i&&t()}).catch(function(l){i&&(s?t():n())})):a.push(w5(r,qn.ERROR,n)),function(){i=!1,a.forEach(uo)}}var QEt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Wae=(function(e){QEt(t,e);function t(n,r,i,o,s,a){var l=e.call(this,n,r,a)||this;return l.crossOrigin_=o,l.src_=i,l.key=i,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=s,l}return t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(n){this.image_=n,this.state=$n.LOADED,this.unlistenImage_(),this.changed()},t.prototype.handleImageError_=function(){this.state=$n.ERROR,this.unlistenImage_(),this.image_=KEt(),this.changed()},t.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=$n.LOADED:this.state=$n.EMPTY,this.unlistenImage_(),this.changed()},t.prototype.load=function(){this.state==$n.ERROR&&(this.state=$n.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==$n.IDLE&&(this.state=$n.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Vae(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},t.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},t})(Oje);function KEt(){var e=zu(1,1);return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),e.canvas}var ZEt=.5,JEt=10,f1e=.25,eTt=(function(){function e(t,n,r,i,o,s){this.sourceProj_=t,this.targetProj_=n;var a={},l=AA(this.targetProj_,this.sourceProj_);this.transformInv_=function(b){var w=b[0]+"/"+b[1];return a[w]||(a[w]=l(b)),a[w]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&so(i)==so(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?so(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?so(this.targetProj_.getExtent()):null;var c=nS(r),u=Sae(r),f=wae(r),d=xae(r),h=this.transformInv_(c),p=this.transformInv_(u),g=this.transformInv_(f),m=this.transformInv_(d),v=JEt+(s?Math.max(0,Math.ceil(I_t(yee(r)/(s*s*256*256)))):0);if(this.addQuad_(c,u,f,d,h,p,g,m,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(b,w,S){y=Math.min(y,b.source[0][0],b.source[1][0],b.source[2][0])}),this.triangles_.forEach((function(b){if(Math.max(b.source[0][0],b.source[1][0],b.source[2][0])-y>this.sourceWorldWidth_/2){var w=[[b.source[0][0],b.source[0][1]],[b.source[1][0],b.source[1][1]],[b.source[2][0],b.source[2][1]]];w[0][0]-y>this.sourceWorldWidth_/2&&(w[0][0]-=this.sourceWorldWidth_),w[1][0]-y>this.sourceWorldWidth_/2&&(w[1][0]-=this.sourceWorldWidth_),w[2][0]-y>this.sourceWorldWidth_/2&&(w[2][0]-=this.sourceWorldWidth_);var S=Math.min(w[0][0],w[1][0],w[2][0]),_=Math.max(w[0][0],w[1][0],w[2][0]);_-S.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var g=qxe([t,n,r,i]),m=so(g)/this.targetWorldWidth_;p=m>f1e||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>f1e||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!Rl(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(s[0])||!isFinite(s[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),v!=1&&v!=2&&v!=4&&v!=8)return}if(c>0){if(!p){var y=[(t[0]+r[0])/2,(t[1]+r[1])/2],b=this.transformInv_(y),w=void 0;if(h){var S=(S0(o[0],d)+S0(a[0],d))/2;w=S-S0(b[0],d)}else w=(o[0]+a[0])/2-b[0];var _=(o[1]+a[1])/2-b[1],E=w*w+_*_;p=E>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var T=[(n[0]+r[0])/2,(n[1]+r[1])/2],k=this.transformInv_(T),P=[(i[0]+t[0])/2,(i[1]+t[1])/2],I=this.transformInv_(P);this.addQuad_(t,n,T,P,o,s,k,I,c-1),this.addQuad_(P,T,r,i,I,k,a,l,c-1)}else{var R=[(t[0]+n[0])/2,(t[1]+n[1])/2],F=this.transformInv_(R),A=[(r[0]+i[0])/2,(r[1]+i[1])/2],L=this.transformInv_(A);this.addQuad_(t,R,A,i,o,F,L,l,c-1),this.addQuad_(R,n,r,A,F,s,a,L,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(v&11)==0&&this.addTriangle_(t,r,i,o,a,l),(v&14)==0&&this.addTriangle_(t,r,n,o,a,s),v&&((v&13)==0&&this.addTriangle_(n,i,t,s,l,o),(v&7)==0&&this.addTriangle_(n,i,r,s,l,a))}},e.prototype.calculateSourceExtent=function(){var t=Nu();return this.triangles_.forEach(function(n,r,i){var o=n.source;DM(t,o[0]),DM(t,o[1]),DM(t,o[2])}),t},e.prototype.getTriangles=function(){return this.triangles_},e})(),Dee={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},tTt={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},e9,Eje=[];function d1e(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore()}function t9(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function nTt(){if(e9===void 0){var e=document.createElement("canvas").getContext("2d");e.globalCompositeOperation="lighter",e.fillStyle="rgba(210, 0, 0, 0.75)",d1e(e,4,5,4,0),d1e(e,4,5,0,5);var t=e.getImageData(0,0,3,3).data;e9=t9(t,0)||t9(t,4)||t9(t,8)}return e9}function Lee(e,t,n,r){var i=V6(n,t,e),o=C5(t,r,n),s=t.getMetersPerUnit();s!==void 0&&(o*=s);var a=e.getMetersPerUnit();a!==void 0&&(o/=a);var l=e.getExtent();if(!l||KI(l,i)){var c=C5(e,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function rTt(e,t,n,r){var i=U0(n),o=Lee(e,t,i,r);return(!isFinite(o)||o<=0)&&bae(n,function(s){return o=Lee(e,t,s,r),isFinite(o)&&o>0}),o}function iTt(e,t,n,r,i,o,s,a,l,c,u,f){var d=zu(Math.round(n*e),Math.round(n*t),Eje);if(f||bo(d,Dee),l.length===0)return d.canvas;d.scale(n,n);function h(w){return Math.round(w*n)/n}d.globalCompositeOperation="lighter";var p=Nu();l.forEach(function(w,S,_){P5e(p,w.extent)});var g=so(p),m=Xf(p),v=zu(Math.round(n*g/r),Math.round(n*m/r));f||bo(v,Dee);var y=n/r;l.forEach(function(w,S,_){var E=w.extent[0]-p[0],T=-(w.extent[3]-p[3]),k=so(w.extent),P=Xf(w.extent);w.image.width>0&&w.image.height>0&&v.drawImage(w.image,c,c,w.image.width-2*c,w.image.height-2*c,E*y,T*y,k*y,P*y)});var b=nS(s);return a.getTriangles().forEach(function(w,S,_){var E=w.source,T=w.target,k=E[0][0],P=E[0][1],I=E[1][0],R=E[1][1],F=E[2][0],A=E[2][1],L=h((T[0][0]-b[0])/o),$=h(-(T[0][1]-b[1])/o),j=h((T[1][0]-b[0])/o),V=h(-(T[1][1]-b[1])/o),U=h((T[2][0]-b[0])/o),z=h(-(T[2][1]-b[1])/o),N=k,B=P;k=0,P=0,I-=N,R-=B,F-=N,A-=B;var H=[[I,R,0,0,j-L],[F,A,0,0,U-L],[0,0,I,R,V-$],[0,0,F,A,z-$]],Q=L_t(H);if(Q){if(d.save(),d.beginPath(),nTt()||!f){d.moveTo(j,V);for(var Y=4,Z=L-j,ge=$-V,ne=0;nethis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},e.prototype.getHeight=function(){return this.maxY-this.minY+1},e.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},e.prototype.getWidth=function(){return this.maxX-this.minX+1},e.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},e})();function f_(e,t,n,r,i){return i!==void 0?(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i):new Hae(e,t,n,r)}function h1e(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]+2*t,n[1]=e[1]+2*t,n}function p1e(e){return e[0]>0&&e[1]>0}function Pje(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function bu(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var sTt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),aTt=(function(e){sTt(t,e);function t(n){var r=e.call(this,n)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Nu(),r.tmpTileRange_=new Hae(0,0,0,0),r}return t.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==$n.LOADED||i==$n.EMPTY||i==$n.ERROR&&!o},t.prototype.getTile=function(n,r,i,o){var s=o.pixelRatio,a=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,s,a);return u.getState()==$n.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState($n.LOADED)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},t.prototype.getData=function(n){var r=this.frameState;if(!r)return null;var i=this.getLayer(),o=Ko(r.pixelToCoordinateTransform,n.slice()),s=i.getExtent();if(s&&!KI(s,o))return null;for(var a=r.pixelRatio,l=r.viewState.projection,c=r.viewState,u=i.getRenderSource(),f=u.getTileGridForProjection(c.projection),d=u.getTilePixelRatio(r.pixelRatio),h=f.getZForResolution(c.resolution);h>=f.getMinZoom();--h){var p=f.getTileCoordForCoordAndZ(o,h),g=u.getTile(h,p[1],p[2],a,l);if(!(g instanceof Wae||g instanceof Tje))return null;if(g.getState()===$n.LOADED){var m=f.getOrigin(h),v=bu(f.getTileSize(h)),y=f.getResolution(h),b=Math.floor(d*((o[0]-m[0])/y-p[1]*v[0])),w=Math.floor(d*((m[1]-o[1])/y-p[2]*v[1])),S=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(g.getImage(),b+S,w+S)}}return null},t.prototype.loadedTileCallback=function(n,r,i){return this.isDrawableTile(i)?e.prototype.loadedTileCallback.call(this,n,r,i):!1},t.prototype.prepareFrame=function(n){return!!this.getLayer().getSource()},t.prototype.renderFrame=function(n,r){var i=n.layerStatesArray[n.layerIndex],o=n.viewState,s=o.projection,a=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(s),g=p.getZForResolution(a,d.zDirection),m=p.getResolution(g),v=n.extent,y=n.viewState.resolution,b=d.getTilePixelRatio(u),w=Math.round(so(v)/y*u),S=Math.round(Xf(v)/y*u),_=i.extent&&i1(i.extent);_&&(v=LM(v,i1(i.extent)));var E=m*w/2/b,T=m*S/2/b,k=[l[0]-E,l[1]-T,l[0]+E,l[1]+T],P=p.getTileRangeForExtentAndZ(v,g),I={};I[g]={};var R=this.createLoadedTileFinder(d,s,I),F=this.tmpExtent,A=this.tmpTileRange_;this.newTiles_=!1;for(var L=c?xee(o.center,y,c,n.size):void 0,$=P.minX;$<=P.maxX;++$)for(var j=P.minY;j<=P.maxY;++j)if(!(c&&!p.tileCoordIntersectsViewport([g,$,j],L))){var V=this.getTile(g,$,j,n);if(this.isDrawableTile(V)){var U=oi(this);if(V.getState()==$n.LOADED){I[g][V.tileCoord.toString()]=V;var z=V.inTransition(U);z&&i.opacity!==1&&(V.endTransition(U),z=!1),!this.newTiles_&&(z||this.renderedTiles.indexOf(V)===-1)&&(this.newTiles_=!0)}if(V.getAlpha(U,n.time)===1)continue}var N=p.getTileCoordChildTileRange(V.tileCoord,A,F),B=!1;N&&(B=R(g+1,N)),B||p.forEachTileCoordParentTileRange(V.tileCoord,R,A,F)}var H=m/a*u/b;av(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-w/2,-S/2);var Q=O5e(this.pixelTransform);this.useContainer(r,Q,this.getBackground(n));var Y=this.context,Z=Y.canvas;vae(this.inversePixelTransform,this.pixelTransform),av(this.tempTransform,w/2,S/2,H,H,0,-w/2,-S/2),Z.width!=w||Z.height!=S?(Z.width=w,Z.height=S):this.containerReused||Y.clearRect(0,0,w,S),_&&this.clipUnrotated(Y,n,_),d.getInterpolate()||bo(Y,Dee),this.preRender(Y,n),this.renderedTiles.length=0;var ge=Object.keys(I).map(Number);ge.sort(J1);var ne,ie,fe;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?ge=ge.reverse():(ne=[],ie=[]);for(var ve=ge.length-1;ve>=0;--ve){var se=ge[ve],ue=d.getTilePixelSize(se,u,s),G=p.getResolution(se),ce=G/m,pe=ue[0]*ce*H,J=ue[1]*ce*H,te=p.getTileCoordForCoordAndZ(nS(k),se),ae=p.getTileCoordExtent(te),we=Ko(this.tempTransform,[b*(ae[0]-k[0])/m,b*(k[3]-ae[3])/m]),Pe=b*d.getGutterForProjection(s),ee=I[se];for(var re in ee){var V=ee[re],Se=V.tileCoord,he=te[1]-Se[1],xe=Math.round(we[0]-(he-1)*pe),me=te[2]-Se[2],be=Math.round(we[1]-(me-1)*J),$=Math.round(we[0]-he*pe),j=Math.round(we[1]-me*J),oe=xe-$,Ee=be-j,ke=g===se,z=ke&&V.getAlpha(oi(this),n.time)!==1,ze=!1;if(!z)if(ne){fe=[$,j,$+oe,j,$+oe,j+Ee,$,j+Ee];for(var De=0,Ve=ne.length;Dej2(e,n)).find(n=>n instanceof Y6)}class A5 extends Error{}function uTt(e,t){if(e===null)throw new A5(`assertion failed: ${t} must not be null`)}function fTt(e,t){if(typeof e>"u")throw new A5(`assertion failed: ${t} must not be undefined`)}function dTt(e,t){uTt(e,t),fTt(e,t)}function n9(e,t){if(Array.isArray(e)){if(e.length===0)throw new A5(`assertion failed: ${t} must be a non-empty array`)}else throw new A5(`assertion failed: ${t} must be an array`)}function rO(e,t){return t&&e.find(n=>n.id===t)||null}function Fee(e,t){return t&&e.variables.find(n=>n.name===t)||null}function hTt(e){return e.variables.findIndex(t=>Zw(t.expression))}function Gae(e){const t=hTt(e);return t>=0?[e.variables.slice(0,t),e.variables.slice(t)]:[e.variables,[]]}function kje(e){dTt(e,"dataset"),n9(e.dimensions,"dataset.dimensions");const t=e.dimensions.find(n=>n.name==="time");return t?(n9(t.coordinates,"timeDimension.coordinates"),n9(t.labels,"timeDimension.labels"),t):null}function Mje(e){const t=kje(e);if(!t)return null;const n=t.coordinates;return[n[0],n[n.length-1]]}const g1e=(e,t)=>{if(t){const n=e.getResolution(),r=cTt(t);return r instanceof Y6?r.getSource().getTileGrid().getZForResolution(n):void 0}};function pTt(e){const t=e.toLowerCase();return["m","metre","metres","meter","meters"].includes(t)}function gTt(e){const t=e.toLowerCase();return["°","deg","degree","degrees","decimal_degree","decimal_degrees"].includes(t)}function mTt(e,t){const r=2*Math.PI*6378137,i=e===qI,o=e===Jw;if(!i&&!o)throw new Error(`Unsupported unit '${e}'. Unit must be either meters or degrees.`);const s=pTt(t),a=gTt(t);if(!s&&!a)throw new Error(`Unsupported unit '${t}'. Unit must be either meters or degrees.`);return i&&a?360/r:o&&s?r/360:1}function vTt(e,t,n,r){if(e&&t&&n&&r){let i;r===qI?i=40075017/256:i=180/256;const a=mTt(r,t)*i/(1<=u)return l-1;for(let f=0;f(f.value-o)/(s-o));let l=0,c=a[0],u=a[1];for(let f=0,d=0;fu&&(l++,c=a[l],u=a[l+1]);const p=(h-c)/(u-c),[g,m,v,y]=e[l].color,[b,w,S,_]=e[l+1].color;r[d]=g+p*(b-g),r[d+1]=m+p*(w-m),r[d+2]=v+p*(S-v),r[d+3]=y+p*(_-y)}}return r}function Lkt(e,t,n){const r=Dkt(e,t,n.width),i=new ImageData(r,r.length/4,1);return createImageBitmap(i).then(o=>{const s=n.getContext("2d");s&&s.drawImage(o,0,0,n.width,n.height)})}function Fkt(e){const{colorRecords:t,errorMessage:n}=B4e(e.code);if(!t)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,Lkt(t,e.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function j4e(e){const{colorRecords:t}=B4e(e);if(t)return t.map(n=>({...n,color:_4e(n.color)}))}function B4e(e){try{return{colorRecords:$kt(e)}}catch(t){if(t instanceof SyntaxError)return{errorMessage:`${t.message}`};throw t}}function $kt(e){const t=[];e.split(` -`).map(o=>o.trim().split(":").map(s=>s.trim())).forEach((o,s)=>{if(o.length==2||o.length==3){const[a,l]=o,c=parseFloat(a),u=OPt(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${s+1}: invalid value: ${a}`);if(!u)throw new SyntaxError(`Line ${s+1}: invalid color: ${l}`);o.length==3?t.push({value:c,color:u,label:o[2]}):t.push({value:c,color:u})}else if(o.length===1&&o[0]!=="")throw new SyntaxError(`Line ${s+1}: invalid color record: ${o[0]}`)});const n=t.length;if(n<2)throw new SyntaxError("At least two color records must be given");t.sort((o,s)=>o.value-s.value);const r=t[0].value,i=t[n-1].value;if(r===i)throw new SyntaxError("Values must form a range");return t}var N$={exports:{}},Swe;function Nkt(){if(Swe)return N$.exports;Swe=1;function e(f,d){var h=d&&d.cache?d.cache:u,p=d&&d.serializer?d.serializer:l,g=d&&d.strategy?d.strategy:o;return g(f,{cache:h,serializer:p})}function t(f){return f==null||typeof f=="number"||typeof f=="boolean"}function n(f,d,h,p){var g=t(p)?p:h(p),m=d.get(g);return typeof m>"u"&&(m=f.call(this,p),d.set(g,m)),m}function r(f,d,h){var p=Array.prototype.slice.call(arguments,3),g=h(p),m=d.get(g);return typeof m>"u"&&(m=f.apply(this,p),d.set(g,m)),m}function i(f,d,h,p,g){return h.bind(d,f,p,g)}function o(f,d){var h=f.length===1?n:r;return i(f,this,h,d.cache.create(),d.serializer)}function s(f,d){var h=r;return i(f,this,h,d.cache.create(),d.serializer)}function a(f,d){var h=n;return i(f,this,h,d.cache.create(),d.serializer)}function l(){return JSON.stringify(arguments)}function c(){this.cache=Object.create(null)}c.prototype.has=function(f){return f in this.cache},c.prototype.get=function(f){return this.cache[f]},c.prototype.set=function(f,d){this.cache[f]=d};var u={create:function(){return new c}};return N$.exports=e,N$.exports.strategies={variadic:s,monadic:a},N$.exports}var zkt=Nkt();const jkt=Vn(zkt),bc={ADD:"add",REMOVE:"remove"};var U4e=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),_we={LENGTH:"length"},z$=(function(e){U4e(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.element=r,o.index=i,o}return t})(mg),_f=(function(e){U4e(t,e);function t(n,r){var i=e.call(this)||this;i.on,i.once,i.un;var o=r||{};if(i.unique_=!!o.unique,i.array_=n||[],i.unique_)for(var s=0,a=i.array_.length;s0;)this.pop()},t.prototype.extend=function(n){for(var r=0,i=n.length;r(f.value-o)/(s-o));let l=0,c=a[0],u=a[1];for(let f=0,d=0;fu&&(l++,c=a[l],u=a[l+1]);const p=(h-c)/(u-c),[g,m,v,y]=e[l].color,[b,w,S,_]=e[l+1].color;r[d]=g+p*(b-g),r[d+1]=m+p*(w-m),r[d+2]=v+p*(S-v),r[d+3]=y+p*(_-y)}}return r}function bTt(e,t,n){const r=yTt(e,t,n.width),i=new ImageData(r,r.length/4,1);return createImageBitmap(i).then(o=>{const s=n.getContext("2d");s&&s.drawImage(o,0,0,n.width,n.height)})}function xTt(e){const{colorRecords:t,errorMessage:n}=Dje(e.code);if(!t)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,bTt(t,e.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function Ije(e){const{colorRecords:t}=Dje(e);if(t)return t.map(n=>({...n,color:mje(n.color)}))}function Dje(e){try{return{colorRecords:wTt(e)}}catch(t){if(t instanceof SyntaxError)return{errorMessage:`${t.message}`};throw t}}function wTt(e){const t=[];e.split(` +`).map(o=>o.trim().split(":").map(s=>s.trim())).forEach((o,s)=>{if(o.length==2||o.length==3){const[a,l]=o,c=parseFloat(a),u=lEt(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${s+1}: invalid value: ${a}`);if(!u)throw new SyntaxError(`Line ${s+1}: invalid color: ${l}`);o.length==3?t.push({value:c,color:u,label:o[2]}):t.push({value:c,color:u})}else if(o.length===1&&o[0]!=="")throw new SyntaxError(`Line ${s+1}: invalid color record: ${o[0]}`)});const n=t.length;if(n<2)throw new SyntaxError("At least two color records must be given");t.sort((o,s)=>o.value-s.value);const r=t[0].value,i=t[n-1].value;if(r===i)throw new SyntaxError("Values must form a range");return t}var C$={exports:{}},m1e;function STt(){if(m1e)return C$.exports;m1e=1;function e(f,d){var h=d&&d.cache?d.cache:u,p=d&&d.serializer?d.serializer:l,g=d&&d.strategy?d.strategy:o;return g(f,{cache:h,serializer:p})}function t(f){return f==null||typeof f=="number"||typeof f=="boolean"}function n(f,d,h,p){var g=t(p)?p:h(p),m=d.get(g);return typeof m>"u"&&(m=f.call(this,p),d.set(g,m)),m}function r(f,d,h){var p=Array.prototype.slice.call(arguments,3),g=h(p),m=d.get(g);return typeof m>"u"&&(m=f.apply(this,p),d.set(g,m)),m}function i(f,d,h,p,g){return h.bind(d,f,p,g)}function o(f,d){var h=f.length===1?n:r;return i(f,this,h,d.cache.create(),d.serializer)}function s(f,d){var h=r;return i(f,this,h,d.cache.create(),d.serializer)}function a(f,d){var h=n;return i(f,this,h,d.cache.create(),d.serializer)}function l(){return JSON.stringify(arguments)}function c(){this.cache=Object.create(null)}c.prototype.has=function(f){return f in this.cache},c.prototype.get=function(f){return this.cache[f]},c.prototype.set=function(f,d){this.cache[f]=d};var u={create:function(){return new c}};return C$.exports=e,C$.exports.strategies={variadic:s,monadic:a},C$.exports}var _Tt=STt();const CTt=Yn(_Tt),mc={ADD:"add",REMOVE:"remove"};var Lje=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),v1e={LENGTH:"length"},O$=(function(e){Lje(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.element=r,o.index=i,o}return t})(pg),Sf=(function(e){Lje(t,e);function t(n,r){var i=e.call(this)||this;i.on,i.once,i.un;var o=r||{};if(i.unique_=!!o.unique,i.array_=n||[],i.unique_)for(var s=0,a=i.array_.length;s0;)this.pop()},t.prototype.extend=function(n){for(var r=0,i=n.length;rn;){if(r-n>600){var o=r-n+1,s=t-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),u=Math.max(n,Math.floor(t-s*l/o+c)),f=Math.min(r,Math.floor(t+(o-s)*l/o+c));q4e(e,t,u,f,i)}var d=e[t],h=n,p=r;for(kk(e,n,t),i(e[r],d)>0&&kk(e,n,r);h0;)p--}i(e[n],d)===0?kk(e,n,p):(p++,kk(e,p,r)),p<=t&&(n=p+1),t<=p&&(r=p-1)}}function kk(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function t2t(e,t){return et?1:0}let X4e=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!U$(t,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(t,n){const r=t[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const s=this._chooseSplitIndex(r,o,i),a=_C(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,x_(r,this.toBBox),x_(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=_C([t,n]),this.data.height=t.height+1,this.data.leaf=!1,x_(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const l=K2(t,0,a,this.toBBox),c=K2(t,a,r,this.toBBox),u=s2t(l,c),f=P9(l)+P9(c);u=n;c--){const u=t.children[c];Z2(a,t.leaf?o(u):u),l+=B$(a)}return l}_adjustParentBBoxes(t,n,r){for(let i=r;i>=0;i--)Z2(n[i],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():x_(t[n],this.toBBox)}};function n2t(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r=e.minX&&t.maxY>=e.minY}function _C(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Pwe(e,t,n,r,i){const o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=r)continue;const s=t+Math.ceil((n-t)/r/2)*r;e2t(e,s,t,n,i),o.push(t,s,s,n)}}var a2t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),kwe={RENDER_ORDER:"renderOrder"},l2t=(function(e){a2t(t,e);function t(n){var r=this,i=n||{},o=bo({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,r=e.call(this,o)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return t.prototype.getDeclutter=function(){return this.declutter_},t.prototype.getFeatures=function(n){return e.prototype.getFeatures.call(this,n)},t.prototype.getRenderBuffer=function(){return this.renderBuffer_},t.prototype.getRenderOrder=function(){return this.get(kwe.RENDER_ORDER)},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},t.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},t.prototype.renderDeclutter=function(n){n.declutterTree||(n.declutterTree=new X4e(9)),this.getRenderer().renderDeclutter(n)},t.prototype.setRenderOrder=function(n){this.set(kwe.RENDER_ORDER,n)},t.prototype.setStyle=function(n){this.style_=n!==void 0?n:Kkt,this.styleFunction_=n===null?void 0:Qkt(this.style_),this.changed()},t})(gU),Pn={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},V$=[Pn.FILL],f0=[Pn.STROKE],m1=[Pn.BEGIN_PATH],Mwe=[Pn.CLOSE_PATH],Y4e=(function(){function e(){}return e.prototype.drawCustom=function(t,n,r,i){},e.prototype.drawGeometry=function(t){},e.prototype.setStyle=function(t){},e.prototype.drawCircle=function(t,n){},e.prototype.drawFeature=function(t,n){},e.prototype.drawGeometryCollection=function(t,n){},e.prototype.drawLineString=function(t,n){},e.prototype.drawMultiLineString=function(t,n){},e.prototype.drawMultiPoint=function(t,n){},e.prototype.drawMultiPolygon=function(t,n){},e.prototype.drawPoint=function(t,n){},e.prototype.drawPolygon=function(t,n){},e.prototype.drawText=function(t,n){},e.prototype.setFillStrokeStyle=function(t,n){},e.prototype.setImageStyle=function(t,n){},e.prototype.setTextStyle=function(t,n){},e})(),c2t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),mD=(function(e){c2t(t,e);function t(n,r,i,o){var s=e.call(this)||this;return s.tolerance=n,s.maxExtent=r,s.pixelRatio=o,s.maxLineWidth=0,s.resolution=i,s.beginGeometryInstruction1_=null,s.beginGeometryInstruction2_=null,s.bufferedMaxExtent_=null,s.instructions=[],s.coordinates=[],s.tmpCoordinate_=[],s.hitDetectionInstructions=[],s.state={},s}return t.prototype.applyPixelRatio=function(n){var r=this.pixelRatio;return r==1?n:n.map(function(i){return i*r})},t.prototype.appendFlatPointCoordinates=function(n,r){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,s=this.coordinates,a=s.length,l=0,c=n.length;ll&&(this.instructions.push([Pn.CUSTOM,l,u,n,i,u0]),this.hitDetectionInstructions.push([Pn.CUSTOM,l,u,n,o||i,u0]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([Pn.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([Pn.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},t.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[Pn.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Pn.BEGIN_GEOMETRY,r,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},t.prototype.reverseHitDetectionInstructions=function(){var n=this.hitDetectionInstructions;n.reverse();var r,i=n.length,o,s,a=-1;for(r=0;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},t.prototype.createFill=function(n){var r=n.fillStyle,i=[Pn.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},t.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},t.prototype.createStroke=function(n){return[Pn.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(n,r){var i=n.fillStyle;(typeof i!="string"||n.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,n)),n.currentFillStyle=i)},t.prototype.updateStrokeStyle=function(n,r){var i=n.strokeStyle,o=n.lineCap,s=n.lineDash,a=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||s!=n.currentLineDash&&!lS(n.currentLineDash,s)||n.currentLineDashOffset!=a||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=s,n.currentLineDashOffset=a,n.currentLineJoin=l,n.currentLineWidth=c,n.currentMiterLimit=u)},t.prototype.endGeometry=function(n){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[Pn.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=IBe(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;jA(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t})(Y4e),u2t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),f2t=(function(e){u2t(t,e);function t(n,r,i,o){var s=e.call(this,n,r,i,o)||this;return s.hitDetectionImage_=null,s.image_=null,s.imagePixelRatio_=void 0,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s.declutterMode_=void 0,s.declutterImageWithText_=void 0,s}return t.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Pn.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Pn.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},t.prototype.drawMultiPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Pn.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Pn.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},t.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,e.prototype.finish.call(this)},t.prototype.setImageStyle=function(n,r){var i=n.getAnchor(),o=n.getSize(),s=n.getOrigin();this.imagePixelRatio_=n.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n.getHitDetectionImage(),this.image_=n.getImage(this.pixelRatio),this.height_=o[1],this.opacity_=n.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=n.getRotateWithView(),this.rotation_=n.getRotation(),this.scale_=n.getScaleArray(),this.width_=o[0],this.declutterMode_=n.getDeclutterMode(),this.declutterImageWithText_=r},t})(mD),d2t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),h2t=(function(e){d2t(t,e);function t(n,r,i,o){return e.call(this,n,r,i,o)||this}return t.prototype.drawFlatCoordinates_=function(n,r,i,o){var s=this.coordinates.length,a=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[Pn.MOVE_TO_LINE_TO,s,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},t.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Pn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,HA,GA],m1);var a=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(f0),this.endGeometry(r)}},t.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Pn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],m1);for(var a=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=a.length;fe&&(l>a&&(a=l,o=c,s=f),l=0,c=f-i)),d=h,m=y,v=b),p=w,g=S}return l+=h,l>a?[c,f]:[o,s]}var m2t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),XM={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},v2t=(function(e){m2t(t,e);function t(n,r,i,o){var s=e.call(this,n,r,i,o)||this;return s.labels_=null,s.text_="",s.textOffsetX_=0,s.textOffsetY_=0,s.textRotateWithView_=void 0,s.textRotation_=0,s.textFillState_=null,s.fillStates={},s.textStrokeState_=null,s.strokeStates={},s.textState_={},s.textStates={},s.textKey_="",s.fillKey_="",s.strokeKey_="",s.declutterImageWithText_=void 0,s}return t.prototype.finish=function(){var n=e.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},t.prototype.drawText=function(n,r){var i=this.textFillState_,o=this.textStrokeState_,s=this.textState_;if(!(this.text_===""||!s||!i&&!o)){var a=this.coordinates,l=a.length,c=n.getType(),u=null,f=n.getStride();if(s.placement===Jkt.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!Il(this.getBufferedMaxExtent(),n.getExtent()))return;var d=void 0;if(u=n.getFlatCoordinates(),c=="LineString")d=[u.length];else if(c=="MultiLineString")d=n.getEnds();else if(c=="Polygon")d=n.getEnds().slice(0,1);else if(c=="MultiPolygon"){var h=n.getEndss();d=[];for(var p=0,g=h.length;pI[2]}else R=w>k;var F=Math.PI,A=[],L=_+r===t;t=_,m=0,v=E,d=e[t],h=e[t+1];var $;if(L){y(),$=Math.atan2(h-g,d-p),R&&($+=$>0?-F:F);var j=(k+w)/2,V=(P+S)/2;return A[0]=[j,V,(T-o)/2,$,i],A}i=i.replace(/\n/g," ");for(var U=0,z=i.length;U0?-F:F),$!==void 0){var B=N-$;if(B+=B>F?-2*F:B<-F?2*F:0,Math.abs(B)>s)return null}$=N;for(var H=U,Q=0;U0&&e.push(` -`,""),e.push(t,""),e}var S2t=(function(){function e(t,n,r,i){this.overlaps=r,this.pixelRatio=n,this.resolution=t,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=Np(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return e.prototype.createLabel=function(t,n,r,i){var o=t+n+r+i;if(this.labels_[o])return this.labels_[o];var s=i?this.strokeStates[i]:null,a=r?this.fillStates[r]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],f=Array.isArray(t),d=l.justify?XM[l.justify]:Dwe(Array.isArray(t)?t[0]:t,l.textAlign||YA),h=i&&s.lineWidth?s.lineWidth:0,p=f?t:t.split(` -`).reduce(w2t,[]),g=Hkt(l,p),m=g.width,v=g.height,y=g.widths,b=g.heights,w=g.lineWidths,S=m+h,_=[],E=(S+2)*u[0],T=(v+h)*u[1],k={width:E<0?Math.floor(E):Math.ceil(E),height:T<0?Math.floor(T):Math.ceil(T),contextInstructions:_};if((u[0]!=1||u[1]!=1)&&_.push("scale",u),i){_.push("strokeStyle",s.strokeStyle),_.push("lineWidth",h),_.push("lineCap",s.lineCap),_.push("lineJoin",s.lineJoin),_.push("miterLimit",s.miterLimit);var P=cU?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;P.prototype.setLineDash&&(_.push("setLineDash",[s.lineDash]),_.push("lineDashOffset",s.lineDashOffset))}r&&_.push("fillStyle",a.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");for(var R=.5-d,I=d*S+R*h,F=[],A=[],L=0,$=0,j=0,V=0,U,z=0,N=p.length;zt?t-c:o,w=s+u>n?n-u:s,S=p[3]+b*d[0]+p[1],_=p[0]+w*d[1]+p[2],E=v-p[3],T=y-p[0];(g||f!==0)&&(dy[0]=E,hy[0]=E,dy[1]=T,qg[1]=T,qg[0]=E+S,Xg[0]=qg[0],Xg[1]=T+_,hy[1]=Xg[1]);var k;return f!==0?(k=fv(Np(),r,i,1,1,f,-r,-i),Xo(k,dy),Xo(k,qg),Xo(k,Xg),Xo(k,hy),gh(Math.min(dy[0],qg[0],Xg[0],hy[0]),Math.min(dy[1],qg[1],Xg[1],hy[1]),Math.max(dy[0],qg[0],Xg[0],hy[0]),Math.max(dy[1],qg[1],Xg[1],hy[1]),w_)):gh(Math.min(E,E+S),Math.min(T,T+_),Math.max(E,E+S),Math.max(T,T+_),w_),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:b,drawImageH:w,originX:c,originY:u,declutterBox:{minX:w_[0],minY:w_[1],maxX:w_[2],maxY:w_[3],value:m},canvasTransform:k,scale:d}},e.prototype.replayImageOrLabel_=function(t,n,r,i,o,s,a){var l=!!(s||a),c=i.declutterBox,u=t.canvas,f=a?a[2]*i.scale[0]/2:0,d=c.minX-f<=u.width/n&&c.maxX+f>=0&&c.minY-f<=u.height/n&&c.maxY+f>=0;return d&&(l&&this.replayTextBackground_(t,dy,qg,Xg,hy,s,a),Gkt(t,i.canvasTransform,o,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},e.prototype.fill_=function(t){if(this.alignFill_){var n=Xo(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(n[0]%r,n[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},e.prototype.setStrokeStyle_=function(t,n){t.strokeStyle=n[1],t.lineWidth=n[2],t.lineCap=n[3],t.lineJoin=n[4],t.miterLimit=n[5],t.setLineDash&&(t.lineDashOffset=n[7],t.setLineDash(n[6]))},e.prototype.drawLabelWithPointPlacement_=function(t,n,r,i){var o=this.textStates[n],s=this.createLabel(t,n,i,r),a=this.strokeStates[r],l=this.pixelRatio,c=Dwe(Array.isArray(t)?t[0]:t,o.textAlign||YA),u=XM[o.textBaseline||nj],f=a&&a.lineWidth?a.lineWidth:0,d=s.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*s.height/l+2*(.5-u)*f;return{label:s,anchorX:h,anchorY:p}},e.prototype.execute_=function(t,n,r,i,o,s,a,l){var c;this.pixelCoordinates_&&lS(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=L1(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),NOt(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,g,m,v,y,b,w,S,_,E,T,k=0,P=0,R=null,I=null,F=this.coordinateCache_,A=this.viewRotation_,L=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,$={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:A},j=this.instructions!=i||this.overlaps?0:200,V,U,z,N;uj&&(this.fill_(t),k=0),P>j&&(t.stroke(),P=0),!k&&!P&&(t.beginPath(),m=NaN,v=NaN),++u;break;case Pn.CIRCLE:d=B[1];var Q=c[d],Y=c[d+1],Z=c[d+2],pe=c[d+3],ie=Z-Q,ne=pe-Y,fe=Math.sqrt(ie*ie+ne*ne);t.moveTo(Q+fe,Y),t.arc(Q,Y,fe,0,2*Math.PI,!0),++u;break;case Pn.CLOSE_PATH:t.closePath(),++u;break;case Pn.CUSTOM:d=B[1],h=B[2];var me=B[3],se=B[4],ue=B.length==6?B[5]:void 0;$.geometry=me,$.feature=V,u in F||(F[u]=[]);var G=F[u];ue?ue(c,d,h,2,G):(G[0]=c[d],G[1]=c[d+1],G.length=2),se(G,$),++u;break;case Pn.DRAW_IMAGE:d=B[1],h=B[2],w=B[3],p=B[4],g=B[5];var ce=B[6],he=B[7],J=B[8],te=B[9],ae=B[10],we=B[11],Pe=B[12],ee=B[13],oe=B[14],Se=B[15];if(!w&&B.length>=20){S=B[19],_=B[20],E=B[21],T=B[22];var ye=this.drawLabelWithPointPlacement_(S,_,E,T);w=ye.label,B[3]=w;var be=B[23];p=(ye.anchorX-be)*this.pixelRatio,B[4]=p;var ge=B[24];g=(ye.anchorY-ge)*this.pixelRatio,B[5]=g,ce=w.height,B[6]=ce,ee=w.width,B[13]=ee}var xe=void 0;B.length>25&&(xe=B[25]);var re=void 0,Ee=void 0,ke=void 0;B.length>17?(re=B[16],Ee=B[17],ke=B[18]):(re=g1,Ee=!1,ke=!1),ae&&L?we+=A:!ae&&!L&&(we-=A);for(var je=0;d0){if(!s||h!=="Image"&&h!=="Text"||s.indexOf(_)!==-1){var R=(d[k]-3)/4,I=i-R%a,F=i-(R/a|0),A=o(_,E,I*I+F*F);if(A)return A}u.clearRect(0,0,a,a);break}}var g=Object.keys(this.executorsByZIndex_).map(Number);g.sort(aw);var m,v,y,b,w;for(m=g.length-1;m>=0;--m){var S=g[m].toString();for(y=this.executorsByZIndex_[S],v=M9.length-1;v>=0;--v)if(h=M9[v],b=y[h],b!==void 0&&(w=b.executeHitDetection(u,l,r,p,f),w))return w}},e.prototype.getClipCoords=function(t){var n=this.maxExtent_;if(!n)return null;var r=n[0],i=n[1],o=n[2],s=n[3],a=[r,i,r,s,o,s,o,i];return L1(a,0,8,2,t,a),a},e.prototype.isEmpty=function(){return XO(this.executorsByZIndex_)},e.prototype.execute=function(t,n,r,i,o,s,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(aw),this.maxExtent_&&(t.save(),this.clip(t,r));var c=s||M9,u,f,d,h,p,g;for(a&&l.reverse(),u=0,f=l.length;un)break;var a=r[s];a||(a=[],r[s]=a),a.push(((e+i)*t+(e+o))*4+3),i>0&&a.push(((e-i)*t+(e+o))*4+3),o>0&&(a.push(((e+i)*t+(e-o))*4+3),i>0&&a.push(((e-i)*t+(e-o))*4+3))}for(var l=[],i=0,c=r.length;ithis.maxCacheSize_},e.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var n in this.cache_){var r=this.cache_[n];(t++&3)===0&&!r.hasListener()&&(delete this.cache_[n],--this.cacheSize_)}}},e.prototype.get=function(t,n,r){var i=Fwe(t,n,r);return i in this.cache_?this.cache_[i]:null},e.prototype.set=function(t,n,r,i){var o=Fwe(t,n,r);this.cache_[o]=i,++this.cacheSize_},e.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},e})();function Fwe(e,t,n){var r=n?T4e(n):"null";return t+":"+e+":"+r}var ij=new E2t,T2t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Mk=null,P2t=(function(e){T2t(t,e);function t(n,r,i,o,s,a){var l=e.call(this)||this;return l.hitDetectionImage_=null,l.image_=n||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=a,l.unlisten_=null,l.imageState_=s,l.size_=i,l.src_=r,l.tainted_,l}return t.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===Qi.LOADED){Mk||(Mk=zu(1,1)),Mk.drawImage(this.image_,0,0);try{Mk.getImageData(0,0,1,1),this.tainted_=!1}catch{Mk=null,this.tainted_=!0}}return this.tainted_===!0},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Xn.CHANGE)},t.prototype.handleImageError_=function(){this.imageState_=Qi.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=Qi.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(n){return this.replaceColor_(n),this.canvas_[n]?this.canvas_[n]:this.image_},t.prototype.getPixelRatio=function(n){return this.replaceColor_(n),this.canvas_[n]?n:1},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],r=this.size_[1],i=zu(n,r);i.fillRect(0,0,n,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==Qi.IDLE){this.imageState_=Qi.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Yle(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},t.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==Qi.LOADED)){var r=document.createElement("canvas");this.canvas_[n]=r,r.width=Math.ceil(this.image_.width*n),r.height=Math.ceil(this.image_.height*n);var i=r.getContext("2d");if(i.scale(n,n),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=T4e(this.color_),i.fillRect(0,0,r.width/n,r.height/n),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,r.width,r.height),s=o.data,a=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=s.length;f0,6);var f=i.src!==void 0?Qi.IDLE:Qi.LOADED;return r.color_=i.color!==void 0?J5(i.color):null,r.iconImage_=k2t(c,u,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,f,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:tf.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return t.prototype.clone=function(){var n=this.getScale();return new t({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(n)?n.slice():n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getAnchor=function(){var n=this.normalizedAnchor_;if(!n){n=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==Hy.FRACTION||this.anchorYUnits_==Hy.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==Hy.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==Hy.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=tf.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==tf.TOP_RIGHT||this.anchorOrigin_==tf.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==tf.BOTTOM_LEFT||this.anchorOrigin_==tf.BOTTOM_RIGHT)&&(n[1]=-n[1]+r[1])}this.normalizedAnchor_=n}var i=this.getDisplacement();return[n[0]-i[0],n[1]+i[1]]},t.prototype.setAnchor=function(n){this.anchor_=n,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(n){return this.iconImage_.getImage(n)},t.prototype.getPixelRatio=function(n){return this.iconImage_.getPixelRatio(n)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var n=this.offset_;if(this.offsetOrigin_!=tf.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==tf.TOP_RIGHT||this.offsetOrigin_==tf.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==tf.BOTTOM_LEFT||this.offsetOrigin_==tf.BOTTOM_RIGHT)&&(n[1]=i[1]-r[1]-n[1])}return this.origin_=n,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(n){this.iconImage_.addEventListener(Xn.CHANGE,n)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(Xn.CHANGE,n)},t})(V4e),hp=.5;function R2t(e,t,n,r,i,o,s){var a=e[0]*hp,l=e[1]*hp,c=zu(a,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new O2t(c,hp,i,null,s),d=n.length,h=Math.floor((256*256*256-1)/d),p={},g=1;g<=d;++g){var m=n[g-1],v=m.getStyleFunction()||r;if(r){var y=v(m,o);if(y){Array.isArray(y)||(y=[y]);for(var b=g*h,w="#"+("000000"+b.toString(16)).slice(-6),S=0,_=y.length;S<_;++S){var E=y[S],T=E.getGeometryFunction()(m);if(!(!T||!Il(i,T.getExtent()))){var k=E.clone(),P=k.getFill();P&&P.setColor(w);var R=k.getStroke();R&&(R.setColor(w),R.setLineDash(null)),k.setText(void 0);var I=E.getImage();if(I&&I.getOpacity()!==0){var F=I.getImageSize();if(!F)continue;var A=zu(F[0],F[1],void 0,{alpha:!1}),L=A.canvas;A.fillStyle=w,A.fillRect(0,0,L.width,L.height),k.setImage(new A2t({img:L,imgSize:F,anchor:I.getAnchor(),anchorXUnits:Hy.PIXELS,anchorYUnits:Hy.PIXELS,offset:I.getOrigin(),opacity:1,size:I.getSize(),scale:I.getScale(),rotation:I.getRotation(),rotateWithView:I.getRotateWithView()}))}var $=k.getZIndex()||0,j=p[$];j||(j={},p[$]=j,j.Polygon=[],j.Circle=[],j.LineString=[],j.Point=[]),j[T.getType().replace("Multi","")].push(T,k)}}}}}for(var V=Object.keys(p).map(Number).sort(aw),g=0,U=V.length;gg[2];)++y,b=v*y,f.push(this.getRenderTransform(o,s,a,hp,d,h,b).slice()),m-=v}this.hitDetectionImageData_=R2t(i,f,this.renderedFeatures_,u.getStyleFunction(),c,s,a)}r(I2t(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},t.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){var a=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(g,m,v){var y=oi(g),b=f[y];if(b){if(b!==!0&&vS[0]&&T[2]>S[2]&&w.push([T[0]-_,T[1],T[2]-_,T[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==m&&FC(this.wrappedRenderedExtent_,y))return lS(this.renderedExtent_,b)||(this.hitDetectionImageData_=null,this.renderedExtent_=b),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var k=new Rwe(Wte(d,h),y,d,h),P;this.getLayer().getDeclutter()&&(P=new Rwe(Wte(d,h),y,d,h));for(var R,I,F,I=0,F=w.length;I=200&&a.status<300){var c=t.getType(),u=void 0;c=="json"||c=="text"?u=a.responseText:c=="xml"?(u=a.responseXML,u||(u=new DOMParser().parseFromString(a.responseText,"application/xml"))):c=="arraybuffer"&&(u=a.response),u?o(t.readFeatures(u,{extent:n,featureProjection:i}),t.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function jwe(e,t){return function(n,r,i,o,s){var a=this;Z2t(e,t,n,r,i,function(l,c){a.addFeatures(l),o!==void 0&&o(l)},s||lw)}}var J4e=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),py=(function(e){J4e(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.feature=r,o.features=i,o}return t})(mg),vD=(function(e){J4e(t,e);function t(n){var r=this,i=n||{};r=e.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=lw,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(mr(r.format_,7),r.loader_=jwe(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:Q2t;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new Nwe:null,r.loadedExtentsRtree_=new Nwe,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var s,a;return Array.isArray(i.features)?a=i.features:i.features&&(s=i.features,a=s.getArray()),!o&&s===void 0&&(s=new _f(a)),a!==void 0&&r.addFeaturesInternal(a),s!==void 0&&r.bindFeaturesCollection_(s),r}return t.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},t.prototype.addFeatureInternal=function(n){var r=oi(n);if(!this.addToIndex_(r,n)){this.featuresCollection_&&this.featuresCollection_.remove(n);return}this.setupChangeEvents_(r,n);var i=n.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,n)}else this.nullGeometryFeatures_[r]=n;this.dispatchEvent(new py(Cd.ADDFEATURE,n))},t.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[Fr(r,Xn.CHANGE,this.handleFeatureChange_,this),Fr(r,qO.PROPERTYCHANGE,this.handleFeatureChange_,this)]},t.prototype.addToIndex_=function(n,r){var i=!0,o=r.getId();return o!==void 0&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=r),i&&(mr(!(n in this.uidIndex_),30),this.uidIndex_[n]=r),i},t.prototype.addFeatures=function(n){this.addFeaturesInternal(n),this.changed()},t.prototype.addFeaturesInternal=function(n){for(var r=[],i=[],o=[],s=0,a=n.length;s0},t.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),e.prototype.refresh.call(this)},t.prototype.removeLoadedExtent=function(n){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(n,function(o){if(BA(o.extent,n))return i=o,!0}),i&&r.remove(i)},t.prototype.removeFeature=function(n){if(n){var r=oi(n);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(n);var i=this.removeFeatureInternal(n);i&&this.changed()}},t.prototype.removeFeatureInternal=function(n){var r=oi(n),i=this.featureChangeKeys_[r];if(i){i.forEach(uo),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new py(Cd.REMOVEFEATURE,n)),n}},t.prototype.removeFromIdIndex_=function(n){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i],r=!0;break}return r},t.prototype.setLoader=function(n){this.loader_=n},t.prototype.setUrl=function(n){mr(this.format_,7),this.url_=n,this.setLoader(jwe(n,this.format_))},t})(Z4e);function gy(e,t){return Xo(e.inversePixelTransform,t.slice(0))}var J2t=(function(){function e(t,n,r){this.decay_=t,this.minVelocity_=n,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return e.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},e.prototype.update=function(t,n){this.points_.push(t,n,Date.now())},e.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[r+2]>t;)r-=3;var i=this.points_[n+2]-this.points_[r+2];if(i<1e3/60)return!1;var o=this.points_[n]-this.points_[r],s=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(s,o),this.initialVelocity_=Math.sqrt(o*o+s*s)/i,this.initialVelocity_>this.minVelocity_},e.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},e.prototype.getAngle=function(){return this.angle_},e})(),eMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),tMt=(function(e){eMt(t,e);function t(n){var r=e.call(this)||this;return r.map_=n,r}return t.prototype.dispatchRenderEvent=function(n,r){mn()},t.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;fv(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),_le(o,i)},t.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s,a,l,c){var u,f=r.viewState;function d(L,$,j,V){return s.call(a,$,L?j:null,V)}var h=f.projection,p=jBe(n.slice(),h),g=[[0,0]];if(h.canWrapX()&&o){var m=h.getExtent(),v=so(m);g.push([-v,0],[v,0])}for(var y=r.layerStatesArray,b=y.length,w=[],S=[],_=0;_=0;--E){var T=y[E],k=T.layer;if(k.hasRenderer()&&Z5(T,f)&&l.call(c,k)){var P=k.getRenderer(),R=k.getSource();if(P&&R){var I=R.getWrapX()?p:n,F=d.bind(null,T.managed);S[0]=I[0]+g[_][0],S[1]=I[1]+g[_][1],u=P.forEachFeatureAtCoordinate(S,r,i,F,w)}if(u)return u}}if(w.length!==0){var A=1/w.length;return w.forEach(function(L,$){return L.distanceSq+=$*A}),w.sort(function(L,$){return L.distanceSq-$.distanceSq}),w.some(function(L){return u=L.callback(L.feature,L.layer,L.geometry)}),u}},t.prototype.forEachLayerAtPixel=function(n,r,i,o,s){return mn()},t.prototype.hasFeatureAtCoordinate=function(n,r,i,o,s,a){var l=this.forEachFeatureAtCoordinate(n,r,i,o,R1,this,s,a);return l!==void 0},t.prototype.getMap=function(){return this.map_},t.prototype.renderFrame=function(n){mn()},t.prototype.scheduleExpireIconCache=function(n){ij.canExpireCache()&&n.postRenderFunctions.push(nMt)},t})(wle);function nMt(e,t){ij.expire()}var rMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),iMt=(function(e){rMt(t,e);function t(n){var r=e.call(this,n)||this;r.fontChangeListenerKey_=Fr(lm,qO.PROPERTYCHANGE,n.redrawText.bind(n)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=pD+" ol-layers";var o=n.getViewport();return o.insertBefore(r.element_,o.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return t.prototype.dispatchRenderEvent=function(n,r){var i=this.getMap();if(i.hasListener(n)){var o=new E4e(n,void 0,r);i.dispatchEvent(o)}},t.prototype.disposeInternal=function(){uo(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),e.prototype.disposeInternal.call(this)},t.prototype.renderFrame=function(n){if(!n){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(n),this.dispatchRenderEvent(k0.PRECOMPOSE,n);var r=n.layerStatesArray.sort(function(h,p){return h.zIndex-p.zIndex}),i=n.viewState;this.children_.length=0;for(var o=[],s=null,a=0,l=r.length;a=0;--a)o[a].renderDeclutter(n);ikt(this.element_,this.children_),this.dispatchRenderEvent(k0.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},t.prototype.forEachLayerAtPixel=function(n,r,i,o,s){for(var a=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&Z5(f,a)&&s(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var g=o(d,p);if(g)return g}}}},t})(tMt),e6e=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Gy=(function(e){e6e(t,e);function t(n,r){var i=e.call(this,n)||this;return i.layer=r,i}return t})(mg),R9={LAYERS:"layers"},vU=(function(e){e6e(t,e);function t(n){var r=this,i=n||{},o=bo({},i);delete o.layers;var s=i.layers;return r=e.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(R9.LAYERS,r.handleLayersChanged_),s?Array.isArray(s)?s=new _f(s.slice(),{unique:!0}):mr(typeof s.getArray=="function",43):s=new _f(void 0,{unique:!0}),r.setLayers(s),r}return t.prototype.handleLayerChange_=function(){this.changed()},t.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(uo),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(Fr(n,bc.ADD,this.handleLayersAdd_,this),Fr(n,bc.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(uo);sD(this.listenerKeys_);for(var i=n.getArray(),o=0,s=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(uo(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Xn.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(uo(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(uo),this.dragListenerKeys_.length=0,this.element_=null,e.prototype.disposeInternal.call(this)},t})(_T);const Iy={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ka={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var oj=1/0,cMt=(function(){function e(t,n){this.priorityFunction_=t,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return e.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,sD(this.queuedElements_)},e.prototype.dequeue=function(){var t=this.elements_,n=this.priorities_,r=t[0];t.length==1?(t.length=0,n.length=0):(t[0]=t.pop(),n[0]=n.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},e.prototype.enqueue=function(t){mr(!(this.keyFunction_(t)in this.queuedElements_),31);var n=this.priorityFunction_(t);return n!=oj?(this.elements_.push(t),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},e.prototype.getCount=function(){return this.elements_.length},e.prototype.getLeftChildIndex_=function(t){return t*2+1},e.prototype.getRightChildIndex_=function(t){return t*2+2},e.prototype.getParentIndex_=function(t){return t-1>>1},e.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},e.prototype.isEmpty=function(){return this.elements_.length===0},e.prototype.isKeyQueued=function(t){return t in this.queuedElements_},e.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},e.prototype.siftUp_=function(t){for(var n=this.elements_,r=this.priorities_,i=n.length,o=n[t],s=r[t],a=t;t>1;){var l=this.getLeftChildIndex_(t),c=this.getRightChildIndex_(t),u=ct;){var a=this.getParentIndex_(n);if(i[a]>s)r[n]=r[a],i[n]=i[a],n=a;else break}r[n]=o,i[n]=s},e.prototype.reprioritize=function(){var t=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,s,a,l;for(a=0;a0;)s=this.dequeue()[0],a=s.getKey(),o=s.getState(),o===$n.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,s.load())},t})(cMt);function dMt(e,t,n,r,i){if(!e||!(n in e.wantedTiles)||!e.wantedTiles[n][t.getKey()])return oj;var o=e.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}const Od={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var hMt=42,tce=256;function Bwe(e,t,n){return(function(r,i,o,s,a){if(r){if(!i&&!t)return r;var l=t?0:o[0]*i,c=t?0:o[1]*i,u=a?a[0]:0,f=a?a[1]:0,d=e[0]+l/2+u,h=e[2]-l/2+u,p=e[1]+c/2+f,g=e[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>g&&(p=(g+p)/2,g=p);var m=hs(r[0],d,h),v=hs(r[1],p,g);if(s&&n&&i){var y=30*i;m+=-y*Math.log(1+Math.max(0,d-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-h)/y),v+=-y*Math.log(1+Math.max(0,p-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-g)/y)}return[m,v]}})}function pMt(e){return e}function nce(e,t,n,r){var i=so(t)/n[0],o=Yf(t)/n[1];return r?Math.min(e,Math.max(i,o)):Math.min(e,Math.min(i,o))}function rce(e,t,n){var r=Math.min(e,t),i=50;return r*=Math.log(1+i*Math.max(0,e/t-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/e-1))/i+1),hs(r,n/2,t*2)}function gMt(e,t,n,r){return(function(i,o,s,a){if(i!==void 0){var l=e[0],c=e[e.length-1],u=n?nce(l,n,s,r):l;if(a){var f=t!==void 0?t:!0;return f?rce(i,u,c):hs(i,c,u)}var d=Math.min(u,i),h=Math.floor(Sle(e,d,o));return e[h]>u&&h1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var o=0;o0},t.prototype.getInteracting=function(){return this.hints_[il.INTERACTING]>0},t.prototype.cancelAnimations=function(){this.setHint(il.ANIMATING,-this.hints_[il.ANIMATING]);for(var n,r=0,i=this.animations_.length;r=0;--i){for(var o=this.animations_[i],s=!0,a=0,l=o.length;a0?u/c.duration:1;f>=1?(c.complete=!0,f=1):s=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],g=c.targetCenter[0],m=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(g-h),y=p+d*(m-p);this.targetCenter_=[v,y]}if(c.sourceResolution&&c.targetResolution){var b=d===1?c.targetResolution:c.sourceResolution+d*(c.targetResolution-c.sourceResolution);if(c.anchor){var w=this.getViewportSize_(this.getRotation()),S=this.constraints_.resolution(b,0,w,!0);this.targetCenter_=this.calculateCenterZoom(S,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=b,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var _=d===1?P0(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var E=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(E,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=_}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(s){this.animations_[i]=null,this.setHint(il.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var T=o[0].callback;T&&W$(T,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},t.prototype.calculateCenterRotate=function(n,r){var i,o=this.getCenterInternal();return o!==void 0&&(i=[o[0]-r[0],o[1]-r[1]],Mle(i,n-this.getRotation()),fEt(i,r)),i},t.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),s=this.getResolution();if(o!==void 0&&s!==void 0){var a=r[0]-n*(r[0]-o[0])/s,l=r[1]-n*(r[1]-o[1])/s;i=[a,l]}return i},t.prototype.getViewportSize_=function(n){var r=this.viewportSize_;if(n){var i=r[0],o=r[1];return[Math.abs(i*Math.cos(n))+Math.abs(o*Math.sin(n)),Math.abs(i*Math.sin(n))+Math.abs(o*Math.cos(n))]}else return r},t.prototype.setViewportSize=function(n){this.viewportSize_=Array.isArray(n)?n.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},t.prototype.getCenter=function(){var n=this.getCenterInternal();return n&&Tte(n,this.getProjection())},t.prototype.getCenterInternal=function(){return this.get(Od.CENTER)},t.prototype.getConstraints=function(){return this.constraints_},t.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},t.prototype.getHints=function(n){return n!==void 0?(n[0]=this.hints_[0],n[1]=this.hints_[1],n):this.hints_.slice()},t.prototype.calculateExtent=function(n){var r=this.calculateExtentInternal(n);return VBe(r,this.getProjection())},t.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();mr(i,1);var o=this.getResolution();mr(o!==void 0,2);var s=this.getRotation();return mr(s!==void 0,3),_te(i,o,s,r)},t.prototype.getMaxResolution=function(){return this.maxResolution_},t.prototype.getMinResolution=function(){return this.minResolution_},t.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},t.prototype.setMaxZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({maxZoom:n}))},t.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},t.prototype.setMinZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({minZoom:n}))},t.prototype.setConstrainResolution=function(n){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:n}))},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolution=function(){return this.get(Od.RESOLUTION)},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(h1(n,this.getProjection()),r)},t.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=so(n)/i[0],s=Yf(n)/i[1];return Math.max(o,s)},t.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/Math.log(r);return(function(a){var l=i/Math.pow(r,a*s);return l})},t.prototype.getRotation=function(){return this.get(Od.ROTATION)},t.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/r;return(function(a){var l=Math.log(i/a)/r/s;return l})},t.prototype.getViewportSizeMinusPadding_=function(n){var r=this.getViewportSize_(n),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},t.prototype.getState=function(){var n=this.getProjection(),r=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),s=this.padding_;if(s){var a=this.getViewportSizeMinusPadding_();o=D9(o,this.getViewportSize_(),[a[0]/2+s[3],a[1]/2+s[0]],r,i)}return{center:o.slice(0),projection:n!==void 0?n:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},t.prototype.getZoom=function(){var n,r=this.getResolution();return r!==void 0&&(n=this.getZoomForResolution(r)),n},t.prototype.getZoomForResolution=function(n){var r=this.minZoom_||0,i,o;if(this.resolutions_){var s=Sle(this.resolutions_,n,1);r=s,i=this.resolutions_[s],s==this.resolutions_.length-1?o=2:o=i/this.resolutions_[s+1]}else i=this.maxResolution_,o=this.zoomFactor_;return r+Math.log(i/n)/Math.log(o)},t.prototype.getResolutionForZoom=function(n){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=hs(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,hs(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},t.prototype.fit=function(n,r){var i;if(mr(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){mr(!kle(n),25);var o=h1(n,this.getProjection());i=Ate(o)}else if(n.getType()==="Circle"){var o=h1(n.getExtent(),this.getProjection());i=Ate(o),i.rotate(this.getRotation(),X0(o))}else{var s=wEt();s?i=n.clone().transform(s,this.getProjection()):i=n}this.fitInternal(i,r)},t.prototype.rotatedExtentForGeometry=function(n){for(var r=this.getRotation(),i=Math.cos(r),o=Math.sin(-r),s=n.getFlatCoordinates(),a=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=s.length;d=0;c--){var u=l[c];if(!(u.getMap()!==this||!u.getActive()||!this.getTargetElement())){var f=u.handleEvent(n);if(!f||n.propagationStopped)break}}}},t.prototype.handlePostRender=function(){var n=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,o=i;if(n){var s=n.viewHints;if(s[il.ANIMATING]||s[il.INTERACTING]){var a=Date.now()-n.time>8;i=a?0:8,o=a?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!lS(r,this.renderedAttributions_)){rkt(this.ulElement_);for(var o=0,s=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:kT}):r.setRotation(0))}},t.prototype.render=function(n){var r=n.frameState;if(r){var i=r.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var s=this.element.classList.contains(j$);!s&&i===0?this.element.classList.add(j$):s&&i!==0&&this.element.classList.remove(j$)}this.label_.style.transform=o}this.rotation_=i}},t})(yU),RMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),IMt=(function(e){RMt(t,e);function t(n){var r=this,i=n||{};r=e.call(this,{element:document.createElement("div"),target:i.target})||this;var o=i.className!==void 0?i.className:"ol-zoom",s=i.delta!==void 0?i.delta:1,a=i.zoomInClassName!==void 0?i.zoomInClassName:o+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:o+"-out",c=i.zoomInLabel!==void 0?i.zoomInLabel:"+",u=i.zoomOutLabel!==void 0?i.zoomOutLabel:"–",f=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",d=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=a,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(Xn.CLICK,r.handleClick_.bind(r,s),!1);var p=document.createElement("button");p.className=l,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(Xn.CLICK,r.handleClick_.bind(r,-s),!1);var g=o+" "+pD+" "+ece,m=r.element;return m.className=g,m.appendChild(h),m.appendChild(p),r.duration_=i.duration!==void 0?i.duration:250,r}return t.prototype.handleClick_=function(n,r){r.preventDefault(),this.zoomByDelta_(n)},t.prototype.zoomByDelta_=function(n){var r=this.getMap(),i=r.getView();if(i){var o=i.getZoom();if(o!==void 0){var s=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:kT})):i.setZoom(s)}}},t})(yU),DMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),L9="units",hx={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},LMt=[1,2,5],Ak=25.4/.28,FMt=(function(e){DMt(t,e);function t(n){var r=this,i=n||{},o=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=e.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=o+"-inner",r.element.className=o+" "+pD,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.maxWidth_=i.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(L9,r.handleUnitsChanged_),r.setUnits(i.units||hx.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return t.prototype.getUnits=function(){return this.get(L9)},t.prototype.handleUnitsChanged_=function(){this.updateElement_()},t.prototype.setUnits=function(n){this.set(L9,n)},t.prototype.setDpi=function(n){this.dpi_=n},t.prototype.updateElement_=function(){var n=this.viewState_;if(!n){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=n.center,i=n.projection,o=this.getUnits(),s=o==hx.DEGREES?Zs.DEGREES:Zs.METERS,a=q5(i,n.resolution,r,s),l=this.minWidth_*(this.dpi_||Ak)/Ak,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||Ak)/Ak:void 0,u=l*a,f="";if(o==hx.DEGREES){var d=ph[Zs.DEGREES];u*=d,u=c){p=v,g=y,m=b;break}else if(g>=l)break;v=p,y=g,b=m,++h}var S;this.scaleBar_?S=this.createScaleBar(g,p,f):S=p.toFixed(m<0?-m:0)+" "+f,this.renderedHTML_!=S&&(this.innerElement_.innerHTML=S,this.renderedHTML_=S),this.renderedWidth_!=g&&(this.innerElement_.style.width=g+"px",this.renderedWidth_=g),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},t.prototype.createScaleBar=function(n,r,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],a=n/this.scaleBarSteps_,l="ol-scale-singlebar-odd",c=0;c
'+this.createMarker("relative",c)+(c%2===0||this.scaleBarSteps_===2?this.createStepText(c,n,!1,r,i):"")+""),c===this.scaleBarSteps_-1&&s.push(this.createStepText(c+1,n,!0,r,i)),l=l==="ol-scale-singlebar-odd"?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";var u;this.scaleBarText_?u='
'+o+"
":u="";var f='
'+u+s.join("")+"
";return f},t.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'
'},t.prototype.createStepText=function(n,r,i,o,s){var a=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=a+(n===0?"":" "+s),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'
'+l+"
"},t.prototype.getScaleForResolution=function(){var n=q5(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Zs.METERS),r=this.dpi_||Ak,i=1e3/25.4;return parseFloat(n.toString())*i*r},t.prototype.render=function(n){var r=n.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},t})(yU);function $Mt(e){var t={},n=new _f,r=t.zoom!==void 0?t.zoom:!0;r&&n.push(new IMt(t.zoomOptions));var i=t.rotate!==void 0?t.rotate:!0;i&&n.push(new AMt(t.rotateOptions));var o=t.attribution!==void 0?t.attribution:!0;return o&&n.push(new kMt(t.attributionOptions)),n}const Gte={ACTIVE:"active"};var NMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),yD=(function(e){NMt(t,e);function t(n){var r=e.call(this)||this;return r.on,r.once,r.un,n&&n.handleEvent&&(r.handleEvent=n.handleEvent),r.map_=null,r.setActive(!0),r}return t.prototype.getActive=function(){return this.get(Gte.ACTIVE)},t.prototype.getMap=function(){return this.map_},t.prototype.handleEvent=function(n){return!0},t.prototype.setActive=function(n){this.set(Gte.ACTIVE,n)},t.prototype.setMap=function(n){this.map_=n},t})(vg);function zMt(e,t,n){var r=e.getCenterInternal();if(r){var i=[r[0]+t[0],r[1]+t[1]];e.animateInternal({duration:n!==void 0?n:250,easing:lkt,center:e.getConstrainedCenter(i)})}}function oce(e,t,n,r){var i=e.getZoom();if(i!==void 0){var o=e.getConstrainedZoom(i+t),s=e.getResolutionForZoom(o);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:s,anchor:n,duration:r!==void 0?r:250,easing:kT})}}var jMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),BMt=(function(e){jMt(t,e);function t(n){var r=e.call(this)||this,i=n||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return t.prototype.handleEvent=function(n){var r=!1;if(n.type==gi.DBLCLICK){var i=n.originalEvent,o=n.map,s=n.coordinate,a=i.shiftKey?-this.delta_:this.delta_,l=o.getView();oce(l,a,s,this.duration_),i.preventDefault(),r=!0}return!r},t})(yD),UMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),MT=(function(e){UMt(t,e);function t(n){var r=this,i=n||{};return r=e.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return t.prototype.getPointerCount=function(){return this.targetPointers.length},t.prototype.handleDownEvent=function(n){return!1},t.prototype.handleDragEvent=function(n){},t.prototype.handleEvent=function(n){if(!n.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(n),this.handlingDownUpSequence){if(n.type==gi.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==gi.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==gi.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==gi.POINTERMOVE&&this.handleMoveEvent(n);return!r},t.prototype.handleMoveEvent=function(n){},t.prototype.handleUpEvent=function(n){return!1},t.prototype.stopDown=function(n){return n},t.prototype.updateTrackedPointers_=function(n){n.activePointers&&(this.targetPointers=n.activePointers)},t})(yD);function sce(e){for(var t=e.length,n=0,r=0,i=0;i0&&this.condition_(n)){var r=n.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},t})(MT),XMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),YMt=(function(e){XMt(t,e);function t(n){var r=this,i=n||{};return r=e.call(this,{stopDown:oD})||this,r.condition_=i.condition?i.condition:VMt,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return t.prototype.handleDragEvent=function(n){if(F9(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==ice){var o=r.getSize(),s=n.pixel,a=Math.atan2(o[1]/2-s[1],s[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=a-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=a}}},t.prototype.handleUpEvent=function(n){if(!F9(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},t.prototype.handleDownEvent=function(n){if(!F9(n))return!1;if(o6e(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},t})(MT),QMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),KMt=(function(e){QMt(t,e);function t(n){var r=e.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+n,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return t.prototype.disposeInternal=function(){this.setMap(null)},t.prototype.render_=function(){var n=this.startPixel_,r=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(n[0],r[0])+i,o.top=Math.min(n[1],r[1])+i,o.width=Math.abs(r[0]-n[0])+i,o.height=Math.abs(r[1]-n[1])+i},t.prototype.setMap=function(n){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=n,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},t.prototype.setPixels=function(n,r){this.startPixel_=n,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},t.prototype.createOrUpdateGeometry=function(){var n=this.startPixel_,r=this.endPixel_,i=[n,[n[0],r[1]],r,[r[0],n[1]]],o=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new Y0([o])},t.prototype.getGeometry=function(){return this.geometry_},t})(wle),l6e=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),H$={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},$9=(function(e){l6e(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return t})(mg),ZMt=(function(e){l6e(t,e);function t(n){var r=e.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new KMt(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:o6e,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return t.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],s=i[1]-r[1];return o*o+s*s>=this.minArea_},t.prototype.getGeometry=function(){return this.box_.getGeometry()},t.prototype.handleDragEvent=function(n){this.box_.setPixels(this.startPixel_,n.pixel),this.dispatchEvent(new $9(H$.BOXDRAG,n.coordinate,n))},t.prototype.handleUpEvent=function(n){this.box_.setMap(null);var r=this.boxEndCondition_(n,this.startPixel_,n.pixel);return r&&this.onBoxEnd(n),this.dispatchEvent(new $9(r?H$.BOXEND:H$.BOXCANCEL,n.coordinate,n)),!1},t.prototype.handleDownEvent=function(n){return this.condition_(n)?(this.startPixel_=n.pixel,this.box_.setMap(n.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new $9(H$.BOXSTART,n.coordinate,n)),!0):!1},t.prototype.onBoxEnd=function(n){},t})(MT),JMt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),eAt=(function(e){JMt(t,e);function t(n){var r=this,i=n||{},o=i.condition?i.condition:s6e;return r=e.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return t.prototype.onBoxEnd=function(n){var r=this.getMap(),i=r.getView(),o=this.getGeometry();if(this.out_){var s=i.rotatedExtentForGeometry(o),a=i.getResolutionForExtentInternal(s),l=i.getResolution()/a;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:kT})},t})(ZMt);const px={LEFT:37,UP:38,RIGHT:39,DOWN:40};var tAt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),nAt=(function(e){tAt(t,e);function t(n){var r=e.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return ace(o)&&a6e(o)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return t.prototype.handleEvent=function(n){var r=!1;if(n.type==Xn.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==px.DOWN||o==px.LEFT||o==px.RIGHT||o==px.UP)){var s=n.map,a=s.getView(),l=a.getResolution()*this.pixelDelta_,c=0,u=0;o==px.DOWN?u=-l:o==px.LEFT?c=-l:o==px.RIGHT?c=l:u=l;var f=[c,u];Mle(f,a.getRotation()),zMt(a,f,this.duration_),i.preventDefault(),r=!0}}return!r},t})(yD),rAt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),iAt=(function(e){rAt(t,e);function t(n){var r=e.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:a6e,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return t.prototype.handleEvent=function(n){var r=!1;if(n.type==Xn.KEYDOWN||n.type==Xn.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var s=n.map,a=o==43?this.delta_:-this.delta_,l=s.getView();oce(l,a,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},t})(yD),oAt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),N9={TRACKPAD:"trackpad",WHEEL:"wheel"},sAt=(function(e){oAt(t,e);function t(n){var r=this,i=n||{};r=e.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var o=i.condition?i.condition:i6e;return r.condition_=i.onFocusOnly?qte(r6e,o):o,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return t.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var n=this.getMap();if(n){var r=n.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},t.prototype.handleEvent=function(n){if(!this.condition_(n))return!0;var r=n.type;if(r!==Xn.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var s;if(n.type==Xn.WHEEL&&(s=o.deltaY,ROt&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=MBe),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;var a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?N9.TRACKPAD:N9.WHEEL);var l=i.getView();if(this.mode_===N9.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=s;var c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1},t.prototype.handleWheelZoom_=function(n){var r=n.getView();r.getAnimating()&&r.cancelAnimations();var i=-hs(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),oce(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},t.prototype.setMouseAnchor=function(n){this.useAnchor_=n,n||(this.lastAnchor_=null)},t})(yD),aAt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),lAt=(function(e){aAt(t,e);function t(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=oD),r=e.call(this,o)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return t.prototype.handleDragEvent=function(n){var r=0,i=this.targetPointers[0],o=this.targetPointers[1],s=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var a=s-this.lastAngle_;this.rotationDelta_+=a,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=a}this.lastAngle_=s;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==ice){var u=l.getViewport().getBoundingClientRect(),f=sce(this.targetPointers);f[0]-=u.left,f[1]-=u.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),c.adjustRotationInternal(r,this.anchor_))}},t.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},t.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},t})(MT),cAt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),uAt=(function(e){cAt(t,e);function t(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=oD),r=e.call(this,o)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return t.prototype.handleDragEvent=function(n){var r=1,i=this.targetPointers[0],o=this.targetPointers[1],s=i.clientX-o.clientX,a=i.clientY-o.clientY,l=Math.sqrt(s*s+a*a);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var c=n.map,u=c.getView();r!=1&&(this.lastScaleDelta_=r);var f=c.getViewport().getBoundingClientRect(),d=sce(this.targetPointers);d[0]-=f.left,d[1]-=f.top,this.anchor_=c.getCoordinateFromPixelInternal(d),c.render(),u.adjustResolutionInternal(r,this.anchor_)},t.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView(),o=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,o),!1}else return!0},t.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},t})(MT),fAt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),lce=(function(e){fAt(t,e);function t(n,r,i){var o=e.call(this)||this;if(i!==void 0&&r===void 0)o.setFlatCoordinates(i,n);else{var s=r||0;o.setCenterAndRadius(n,s,i)}return o}return t.prototype.clone=function(){var n=new t(this.flatCoordinates.slice(),void 0,this.layout);return n.applyProperties(this),n},t.prototype.closestPointXY=function(n,r,i,o){var s=this.flatCoordinates,a=n-s[0],l=r-s[1],c=a*a+l*l;if(c=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:Ole(n,this.intersectsCoordinate.bind(this))}return!1},t.prototype.setCenter=function(n){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],o=n.slice();o[r]=o[0]+i;for(var s=1;s=this.dragVertexDelay_?(this.downPx_=n.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&n.type===gi.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===gi.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===gi.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===gi.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===gi.DBLCLICK&&(i=!1),e.prototype.handleEvent.call(this,n)&&i},t.prototype.handleDownEvent=function(n){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=n.pixel,this.finishCoordinate_||this.startDrawing_(n.coordinate),!0):this.condition_(n)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((function(){this.handlePointerMove_(new pm(gi.POINTERMOVE,n.map,n.originalEvent,!1,n.frameState))}).bind(this),this.dragVertexDelay_),this.downPx_=n.pixel,!0):(this.lastDragTime_=void 0,!1)},t.prototype.handleUpEvent=function(n){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(n),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(n.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===Br.POINT)&&(this.atFinish_(n.pixel)?this.finishCondition_(n)&&this.finishDrawing():this.addToDrawing_(n.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&n.preventDefault(),r},t.prototype.handlePointerMove_=function(n){if(this.pointerType_=n.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=n.pixel,o=r[0]-i[0],s=r[1]-i[1],a=o*o+s*s;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(n.coordinate):this.createOrUpdateSketchPoint_(n.coordinate.slice())},t.prototype.atFinish_=function(n){var r=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],s=this.mode_;if(s===Br.POINT)r=!0;else if(s===Br.CIRCLE)r=this.sketchCoords_.length===2;else if(s===Br.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(s===Br.POLYGON){var a=this.sketchCoords_;i=a[0].length>this.minPoints_,o=[a[0][0],a[0][a[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),this.geometryFunction_(s,r,i)):a===Br.POLYGON&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),o&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(n.slice()),this.updateSketchFeatures_(),o&&this.finishDrawing()},t.prototype.removeLastPoint=function(){if(this.sketchFeature_){var n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,o=this.mode_;if(o===Br.LINE_STRING||o===Br.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var s=this.finishCoordinate_.slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===Br.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var a=this.sketchLine_.getGeometry();if(i.length>=2){var s=i[i.length-2].slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}a.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,n,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},t.prototype.finishDrawing=function(){var n=this.abortDrawing_();if(n){var r=this.sketchCoords_,i=n.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Br.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===Br.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new hU([r])):this.type_==="MultiLineString"?n.setGeometry(new Ule([r])):this.type_==="MultiPolygon"&&n.setGeometry(new Vle([r])),this.dispatchEvent(new q$(G$.DRAWEND,n)),this.features_&&this.features_.push(n),this.source_&&this.source_.addFeature(n)}},t.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var n=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),n},t.prototype.abortDrawing=function(){var n=this.abortDrawing_();n&&this.dispatchEvent(new q$(G$.DRAWABORT,n))},t.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===Br.LINE_STRING||r===Br.CIRCLE)o=this.sketchCoords_;else if(r===Br.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var s=0;s0&&this.getCount()>this.highWaterMark},e.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t){for(var n=this.oldest_;n;)t(n.value_,n.key_,this),n=n.newer},e.prototype.get=function(t,n){var r=this.entries_[t];return mr(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},e.prototype.remove=function(t){var n=this.entries_[t];return mr(n!==void 0,15),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[t],--this.count_,n.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)t[n++]=r.key_;return t},e.prototype.getValues=function(){var t=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)t[n++]=r.value_;return t},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},e.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,n){this.get(t),this.entries_[t].value_=n},e.prototype.set=function(t,n){mr(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e})();function Hwe(e,t,n,r){return r!==void 0?(r[0]=e,r[1]=t,r[2]=n,r):[e,t,n]}function bU(e,t,n){return e+"/"+t+"/"+n}function u6e(e){return bU(e[0],e[1],e[2])}function yAt(e){return e.split("/").map(Number)}function f6e(e){return(e[1]<n||n>t.getMaxZoom())return!1;var o=t.getFullTileRange(n);return o?o.containsXY(r,i):!0}var xAt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),d6e=(function(e){xAt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.expireCache=function(n){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in n)break;this.pop().release()}},t.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var n=this.peekFirstKey(),r=yAt(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(u6e(o.tileCoord)),o.release())}).bind(this))}},t})(vAt);const z9={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var wAt=[0,0,0],my=5,cce=(function(){function e(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,mr(_Ot(this.resolutions_,function(s,a){return a-s}),17);var n;if(!t.origins){for(var r=0,i=this.resolutions_.length-1;r=this.minZoom;){if(this.zoomFactor_===2?(s=Math.floor(s/2),a=Math.floor(a/2),o=b_(s,s,a,a,r)):o=this.getTileRangeForExtentAndZ(l,c,r),n(c,o))return!0;--c}return!1},e.prototype.getExtent=function(){return this.extent_},e.prototype.getMaxZoom=function(){return this.maxZoom},e.prototype.getMinZoom=function(){return this.minZoom},e.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},e.prototype.getResolution=function(t){return this.resolutions_[t]},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getTileCoordChildTileRange=function(t,n,r){if(t[0]this.maxZoom||n0?r:Math.max(s/a[0],o/a[1]),c=i+1,u=new Array(c),f=0;fi.highWaterMark&&(i.highWaterMark=n)},t.prototype.useTile=function(n,r,i,o){},t})(Z4e),TAt=(function(e){g6e(t,e);function t(n,r){var i=e.call(this,n)||this;return i.tile=r,i}return t})(mg);function PAt(e,t){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return(function(s,a,l){if(s)return e.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var c=s[0],u=t.getFullTileRange(c);mr(u,55);var f=u.getHeight()-s[2]-1;return f.toString()})})}function kAt(e,t){for(var n=e.length,r=new Array(n),i=0;i=0},t.prototype.tileUrlFunction=function(n,r,i){var o=this.getTileGrid();if(o||(o=this.getTileGridForProjection(i)),!(o.getResolutions().length<=n[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var s=o.getResolution(n[0]),a=o.getTileCoordExtent(n,this.tmpExtent_),l=xu(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=bwe(l,c,this.tmpSize),a=jA(a,s*c,a)),r!=1&&(l=L4e(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:X$,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return bo(u,this.params_),this.getRequestUrl_(n,l,a,r,i,u)}},t})(m6e);function v6e(e){return O.jsx(M.Fragment,{children:e.children})}var NAt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zAt='© OpenStreetMap contributors.',jAt=(function(e){NAt(t,e);function t(n){var r=n||{},i=r.imageSmoothing!==void 0?r.imageSmoothing:!0;r.interpolate!==void 0&&(i=r.interpolate);var o;r.attributions!==void 0?o=r.attributions:o=[zAt];var s=r.crossOrigin!==void 0?r.crossOrigin:"anonymous",a=r.url!==void 0?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return e.call(this,{attributions:o,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:s,interpolate:i,maxZoom:r.maxZoom!==void 0?r.maxZoom:19,opaque:r.opaque!==void 0?r.opaque:!0,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:a,wrapX:r.wrapX,zDirection:r.zDirection})||this}return t})(AT);const y6e=M.createContext({mapObjects:{},reportTileLoadStart:()=>{},reportTileLoadEnd:()=>{},reportTileLoadError:()=>{}}),qwe=()=>({numTilesLoading:0,numTilesLoaded:0,numTilesErrored:0}),BAt={position:"relative",top:0,left:0,width:"100%",height:"100%"};let UAt=class extends M.Component{contextValue;clickEventsKey=null;loadStartEventsKey=null;loadEndEventsKey=null;lastTileLoadProgress=null;zoomEventsKey=null;constructor(t){super(t),this.state=qwe();const{id:n,mapObjects:r}=t;r?this.contextValue={map:r[n]||void 0,mapObjects:r,reportTileLoadStart:this.reportTileLoadStart,reportTileLoadEnd:this.reportTileLoadEnd,reportTileLoadError:this.reportTileLoadError}:this.contextValue={mapObjects:{},reportTileLoadStart:this.reportTileLoadStart,reportTileLoadEnd:this.reportTileLoadEnd,reportTileLoadError:this.reportTileLoadError}}componentDidMount(){const{id:t}=this.props,n=this.contextValue.mapDiv;let r=null,i=null;if(this.props.isStale){const s=this.contextValue.mapObjects[t];s instanceof Wwe&&(r=s,r.setTarget(n),this.clickEventsKey&&r.un("click",this.clickEventsKey.listener),i=r?.getView(),this.zoomEventsKey&&i.un("change:resolution",this.zoomEventsKey.listener))}if(!r){const s=this.getMinZoom(n),a=new pp({projection:EBe,center:[0,0],minZoom:s,zoom:s});r=new Wwe({view:a,...this.getMapOptions(),target:n})}i=r?.getView(),this.contextValue.map=r,this.contextValue.mapObjects[t]=r,this.clickEventsKey=r.on("click",this.handleClick),this.loadStartEventsKey=r.on("loadstart",this.handleMapLoadStart),this.loadEndEventsKey=r.on("loadend",this.handleMapLoadEnd),this.zoomEventsKey=i.on("change:resolution",this.handleZoom),r.updateSize(),this.forceUpdate(),window.addEventListener("resize",this.handleResize);const o=this.props.onMapRef;o&&o(r)}componentDidUpdate(t){const n=this.contextValue.map,r=this.contextValue.mapDiv,i=this.getMapOptions();n.setProperties({...i}),n.setTarget(r),n.updateSize()}componentWillUnmount(){I1(this.clickEventsKey),I1(this.loadStartEventsKey),I1(this.loadEndEventsKey),window.removeEventListener("resize",this.handleResize);const t=this.props.onMapRef;t&&t(null)}render(){let t;return this.contextValue.map&&(t=O.jsx(y6e.Provider,{value:this.contextValue,children:this.props.children})),O.jsx("div",{ref:this.handleRef,style:BAt,onDragOver:this.handleDragOver,onDrop:this.handleDrop,children:t})}getMapOptions(){const t={...this.props};return delete t.children,delete t.onClick,delete t.onZoom,delete t.onDropFiles,delete t.onTileLoadProgress,t}handleClick=t=>{const n=this.props.onClick;n&&n(t)};handleDrop=t=>{if(this.props.onDropFiles){t.preventDefault();const n=[];if(t.dataTransfer.items)for(let r=0;r{this.props.onDropFiles&&t.preventDefault()};handleRef=t=>{this.contextValue.mapDiv=t};handleResize=()=>{const t=this.contextValue.mapDiv,n=this.contextValue.map;if(t&&n){n.updateSize();const r=n.getView(),i=this.getMinZoom(t);i!==r.getMinZoom()&&r.setMinZoom(i)}};getMinZoom=t=>{const n=t.clientWidth,r=Math.LOG2E*Math.log(n/256);return r>=0?r:0};handleZoom=t=>{const n=this.props.onZoom,r=this.contextValue.map;n&&n(t,r)};handleMapLoadStart=()=>{};handleMapLoadEnd=()=>{this.resetProgressState()};resetProgressState=()=>{this.setState(qwe(),this.reportProgressUpdate)};reportTileLoadStart=t=>{this.reportTileLoadInternal(t,n=>({numTilesLoading:n.numTilesLoading+1}))};reportTileLoadEnd=t=>{this.reportTileLoadInternal(t,n=>({numTilesLoaded:n.numTilesLoaded+1}))};reportTileLoadError=t=>{this.reportTileLoadInternal(t,n=>({numTilesErrored:n.numTilesErrored+1}))};reportTileLoadInternal=(t,n)=>{this.props.onTileLoadProgress&&this.setState(n,this.reportProgressUpdate)};reportProgressUpdate=()=>{const t=this.props.onTileLoadProgress;if(!t)return;const n=this.lastTileLoadProgress,r={value:this.computeProgressValue(),active:this.isProgressActive()};(!n||n.active!==r.active||n.value!==r.value)&&(t(r),this.lastTileLoadProgress=r)};isProgressActive=()=>this.state.numTilesLoading>0;computeProgressValue=()=>{const t=this.state.numTilesLoaded,n=this.state.numTilesErrored,r=this.state.numTilesLoading;return 100*Math.min(1,Math.max(0,t+n)/Math.max(1,r))}};class bD extends M.PureComponent{static contextType=y6e;context={};object=null;getMapObject(t){return this.context.mapObjects&&this.context.mapObjects[t]||null}getOptions(){const t={...this.props};return delete t.id,t}componentDidMount(){this._updateMapObject(this.addMapObject(this.context.map))}componentDidUpdate(t){this._updateMapObject(this.updateMapObject(this.context.map,this.object,t))}componentWillUnmount(){const t=this.context.map;this.removeMapObject(t,this.object),this.props.id&&delete this.context.mapObjects[this.props.id],this.object=null}_updateMapObject(t){t!=null&&this.props.id&&(t.set("objectId",this.props.id),this.context.mapObjects[this.props.id]=t),this.object=t}render(){return null}}function b6e(e,t,n){S_(e,t,n,"visible",!0),S_(e,t,n,"opacity",1),S_(e,t,n,"zIndex",void 0),S_(e,t,n,"extent",void 0),S_(e,t,n,"minResolution",void 0),S_(e,t,n,"maxResolution",void 0)}function S_(e,t,n,r,i){const o=Xwe(t[r],i),s=Xwe(n[r],i);o!==s&&e.set(r,s)}function Xwe(e,t){return e===void 0?t:e}let mc;mc=()=>{};class x6e extends bD{tileLoadStartEventsKey=null;tileLoadEndEventsKey=null;tileLoadErrorEventsKey=null;addMapObject(t){const n=new Zle(this.props);n.set("id",this.props.id);const r=n.getSource();return r&&("crossOrigin"in r&&(r.crossOrigin="Anonymous"),this.registerTileLoadHandlers(r)),t.getLayers().push(n),n}updateMapObject(t,n,r){const i=n.getSource(),o=this.props.source||null;if(i===o)return n;if(o!==null&&i!==o){let s=!0;if(i instanceof Xte&&o instanceof Xte){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(VAt(f,d)){mc("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),s=!1);const g=c.getTileLoadFunction(),m=u.getTileLoadFunction();g!==m&&(c.setTileLoadFunction(m),s=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),s=!1)}else mc("--> Tile grids are not equal!")}const a=i?.getInterpolate(),l=o?.getInterpolate();a!==l&&(s=!0),s?(i&&this.unregisterTileLoadHandlers(i),this.registerTileLoadHandlers(o),n.setSource(o),mc("--> Replaced source (expect flickering!)")):mc("--> Updated source (check, is it still flickering?)")}return b6e(n,r,this.props),n}removeMapObject(t,n){const r=n.getSource();r&&this.unregisterTileLoadHandlers(r),t.getLayers().remove(n)}registerTileLoadHandlers(t){console.log("adding tile load handlers to",t),this.tileLoadStartEventsKey=t.on("tileloadstart",this.context.reportTileLoadStart),this.tileLoadEndEventsKey=t.on("tileloadend",this.context.reportTileLoadEnd),this.tileLoadErrorEventsKey=t.on("tileloaderror",this.context.reportTileLoadError)}unregisterTileLoadHandlers(t){console.log("removing tile load handlers from",t),I1(this.tileLoadStartEventsKey),I1(this.tileLoadEndEventsKey),I1(this.tileLoadErrorEventsKey)}}new AT({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new AT({url:"https://gis.ngdc.noaa.gov/arcgis/rest/services/web_mercator/gebco_2014_contours/MapServer/tile/{z}/{y}/{x}",attributions:["© GEBCO","© NOAHH and contributors"]});new jAt;new AT({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function VAt(e,t){if(e===t)return!0;if(e===null||t===null||(mc("tile grid:",e,t),mc("min zoom:",e.getMinZoom(),t.getMinZoom()),mc("max zoom:",e.getMaxZoom(),t.getMaxZoom()),e.getMinZoom()!==t.getMinZoom()||e.getMaxZoom()!==t.getMaxZoom()))return!1;const n=e.getExtent(),r=t.getExtent();mc("extent:",n,r);for(let a=0;a=e[i])return i;let o=Math.floor(n/2),s;for(let a=0;as)[r,o]=[o,Math.floor((o+i)/2)];else return o;if(r===o||o===i)return Math.abs(e[r]-t)<=Math.abs(e[i]-t)?r:i}return-1}function Vr(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function un(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function bn(e){un(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||lv(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function S6e(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function _6e(e,t){un(2,arguments);var n=bn(e),r=Vr(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var s=o.getDate();return i>=s?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function wU(e,t){un(2,arguments);var n=bn(e).getTime(),r=Vr(t);return new Date(n+r)}var WAt=36e5;function HAt(e,t){un(2,arguments);var n=Vr(t);return wU(e,n*WAt)}var GAt={};function yg(){return GAt}function KA(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=yg(),f=Vr((n=(r=(i=(o=t?.weekStartsOn)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=bn(e),h=d.getDay(),p=(h=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=bn(e),h=d.getDay(),p=(h=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function aRt(e){un(1,arguments);var t=T6e(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=QO(n);return r}var lRt=6048e5;function P6e(e){un(1,arguments);var t=bn(e),n=QO(t).getTime()-aRt(t).getTime();return Math.round(n/lRt)+1}function uw(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=yg(),f=Vr((n=(r=(i=(o=t?.weekStartsOn)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=bn(e),h=d.getUTCDay(),p=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,h),p.setUTCHours(0,0,0,0);var g=uw(p,t),m=new Date(0);m.setUTCFullYear(f,0,h),m.setUTCHours(0,0,0,0);var v=uw(m,t);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function cRt(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=yg(),f=Vr((n=(r=(i=(o=t?.firstWeekContainsDate)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=hce(e,t),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=uw(h,t);return p}var uRt=6048e5;function k6e(e,t){un(1,arguments);var n=bn(e),r=uw(n,t).getTime()-cRt(n,t).getTime();return Math.round(r/uRt)+1}function Ci(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?r:1-r;return Ci(n==="yy"?i%100:i,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Ci(r+1,2)},d:function(t,n){return Ci(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Ci(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Ci(t.getUTCHours(),n.length)},m:function(t,n){return Ci(t.getUTCMinutes(),n.length)},s:function(t,n){return Ci(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,i=t.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return Ci(o,n.length)}},__={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fRt={G:function(t,n,r){var i=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var i=t.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return vy.y(t,n)},Y:function(t,n,r,i){var o=hce(t,i),s=o>0?o:1-o;if(n==="YY"){var a=s%100;return Ci(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):Ci(s,n.length)},R:function(t,n){var r=T6e(t);return Ci(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Ci(r,n.length)},Q:function(t,n,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return Ci(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,n,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return Ci(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,n,r){var i=t.getUTCMonth();switch(n){case"M":case"MM":return vy.M(t,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(t,n,r){var i=t.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return Ci(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(t,n,r,i){var o=k6e(t,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):Ci(o,n.length)},I:function(t,n,r){var i=P6e(t);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):Ci(i,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):vy.d(t,n)},D:function(t,n,r){var i=sRt(t);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ci(i,n.length)},E:function(t,n,r){var i=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(t,n,r,i){var o=t.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Ci(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,n,r,i){var o=t.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Ci(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,n,r){var i=t.getUTCDay(),o=i===0?7:i;switch(n){case"i":return String(o);case"ii":return Ci(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(t,n,r){var i=t.getUTCHours(),o=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(t,n,r){var i=t.getUTCHours(),o;switch(i===12?o=__.noon:i===0?o=__.midnight:o=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,n,r){var i=t.getUTCHours(),o;switch(i>=17?o=__.evening:i>=12?o=__.afternoon:i>=4?o=__.morning:o=__.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return vy.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):vy.H(t,n)},K:function(t,n,r){var i=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ci(i,n.length)},k:function(t,n,r){var i=t.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ci(i,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):vy.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):vy.s(t,n)},S:function(t,n){return vy.S(t,n)},X:function(t,n,r,i){var o=i._originalDate||t,s=o.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return Zwe(s);case"XXXX":case"XX":return Wx(s);case"XXXXX":case"XXX":default:return Wx(s,":")}},x:function(t,n,r,i){var o=i._originalDate||t,s=o.getTimezoneOffset();switch(n){case"x":return Zwe(s);case"xxxx":case"xx":return Wx(s);case"xxxxx":case"xxx":default:return Wx(s,":")}},O:function(t,n,r,i){var o=i._originalDate||t,s=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Kwe(s,":");case"OOOO":default:return"GMT"+Wx(s,":")}},z:function(t,n,r,i){var o=i._originalDate||t,s=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Kwe(s,":");case"zzzz":default:return"GMT"+Wx(s,":")}},t:function(t,n,r,i){var o=i._originalDate||t,s=Math.floor(o.getTime()/1e3);return Ci(s,n.length)},T:function(t,n,r,i){var o=i._originalDate||t,s=o.getTime();return Ci(s,n.length)}};function Kwe(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;if(o===0)return n+String(i);var s=t;return n+String(i)+s+Ci(o,2)}function Zwe(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Ci(Math.abs(e)/60,2)}return Wx(e,t)}function Wx(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),o=Ci(Math.floor(i/60),2),s=Ci(i%60,2);return r+o+n+s}var Jwe=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},M6e=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},dRt=function(t,n){var r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return Jwe(t,n);var s;switch(i){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Jwe(i,n)).replace("{{time}}",M6e(o,n))},Qte={p:M6e,P:dRt},hRt=["D","DD"],pRt=["YY","YYYY"];function A6e(e){return hRt.indexOf(e)!==-1}function R6e(e){return pRt.indexOf(e)!==-1}function sj(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var gRt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},mRt=function(t,n,r){var i,o=gRt[t];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};function j9(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var vRt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yRt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bRt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xRt={date:j9({formats:vRt,defaultWidth:"full"}),time:j9({formats:yRt,defaultWidth:"full"}),dateTime:j9({formats:bRt,defaultWidth:"full"})},wRt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},SRt=function(t,n,r,i){return wRt[t]};function Rk(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{var a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[a]}var c=e.argumentCallback?e.argumentCallback(t):t;return i[c]}}var _Rt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},CRt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ORt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ERt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},TRt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},PRt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},kRt=function(t,n){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},MRt={ordinalNumber:kRt,era:Rk({values:_Rt,defaultWidth:"wide"}),quarter:Rk({values:CRt,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Rk({values:ORt,defaultWidth:"wide"}),day:Rk({values:ERt,defaultWidth:"wide"}),dayPeriod:Rk({values:TRt,defaultWidth:"wide",formattingValues:PRt,defaultFormattingWidth:"wide"})};function Ik(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?RRt(a,function(f){return f.test(s)}):ARt(a,function(f){return f.test(s)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function ARt(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function RRt(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],o=t.match(e.parsePattern);if(!o)return null;var s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;var a=t.slice(i.length);return{value:s,rest:a}}}var DRt=/^(\d+)(th|st|nd|rd)?/i,LRt=/\d+/i,FRt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},$Rt={any:[/^b/i,/^(a|c)/i]},NRt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zRt={any:[/1/i,/2/i,/3/i,/4/i]},jRt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},BRt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},URt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},VRt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},WRt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},HRt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},GRt={ordinalNumber:IRt({matchPattern:DRt,parsePattern:LRt,valueCallback:function(t){return parseInt(t,10)}}),era:Ik({matchPatterns:FRt,defaultMatchWidth:"wide",parsePatterns:$Rt,defaultParseWidth:"any"}),quarter:Ik({matchPatterns:NRt,defaultMatchWidth:"wide",parsePatterns:zRt,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ik({matchPatterns:jRt,defaultMatchWidth:"wide",parsePatterns:BRt,defaultParseWidth:"any"}),day:Ik({matchPatterns:URt,defaultMatchWidth:"wide",parsePatterns:VRt,defaultParseWidth:"any"}),dayPeriod:Ik({matchPatterns:WRt,defaultMatchWidth:"any",parsePatterns:HRt,defaultParseWidth:"any"})},pce={code:"en-US",formatDistance:mRt,formatLong:xRt,formatRelative:SRt,localize:MRt,match:GRt,options:{weekStartsOn:0,firstWeekContainsDate:1}},qRt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,XRt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YRt=/^'([^]*?)'?$/,QRt=/''/g,KRt=/[a-zA-Z]/;function ZRt(e,t,n){var r,i,o,s,a,l,c,u,f,d,h,p,g,m,v,y,b,w;un(2,arguments);var S=String(t),_=yg(),E=(r=(i=n?.locale)!==null&&i!==void 0?i:_.locale)!==null&&r!==void 0?r:pce,T=Vr((o=(s=(a=(l=n?.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:_.firstWeekContainsDate)!==null&&s!==void 0?s:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=Vr((h=(p=(g=(m=n?.weekStartsOn)!==null&&m!==void 0?m:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g:_.weekStartsOn)!==null&&p!==void 0?p:(b=_.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&h!==void 0?h:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var P=bn(e);if(!O6e(P))throw new RangeError("Invalid time value");var R=C6e(P),I=E6e(P,R),F={firstWeekContainsDate:T,weekStartsOn:k,locale:E,_originalDate:P},A=S.match(XRt).map(function(L){var $=L[0];if($==="p"||$==="P"){var j=Qte[$];return j(L,E.formatLong)}return L}).join("").match(qRt).map(function(L){if(L==="''")return"'";var $=L[0];if($==="'")return JRt(L);var j=fRt[$];if(j)return!(n!=null&&n.useAdditionalWeekYearTokens)&&R6e(L)&&sj(L,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&A6e(L)&&sj(L,t,String(e)),j(I,L,E.localize,F);if($.match(KRt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return L}).join("");return A}function JRt(e){var t=e.match(YRt);return t?t[1].replace(QRt,"'"):e}function eIt(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function tIt(e){un(1,arguments);var t=bn(e),n=t.getDate();return n}function I6e(e){un(1,arguments);var t=bn(e),n=t.getFullYear(),r=t.getMonth(),i=new Date(0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function nIt(e){un(1,arguments);var t=bn(e),n=t.getHours();return n}function rIt(e){un(1,arguments);var t=bn(e),n=t.getMilliseconds();return n}function iIt(e){un(1,arguments);var t=bn(e),n=t.getMinutes();return n}function oIt(e){un(1,arguments);var t=bn(e),n=t.getMonth();return n}function sIt(e){un(1,arguments);var t=bn(e),n=t.getSeconds();return n}function aIt(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=bn(e),f=u.getFullYear(),d=yg(),h=Vr((n=(r=(i=(o=t?.firstWeekContainsDate)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(f+1,0,h),p.setHours(0,0,0,0);var g=KA(p,t),m=new Date(0);m.setFullYear(f,0,h),m.setHours(0,0,0,0);var v=KA(m,t);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function lIt(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=yg(),f=Vr((n=(r=(i=(o=t?.firstWeekContainsDate)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=aIt(e,t),h=new Date(0);h.setFullYear(d,0,f),h.setHours(0,0,0,0);var p=KA(h,t);return p}var cIt=6048e5;function uIt(e,t){un(1,arguments);var n=bn(e),r=KA(n,t).getTime()-lIt(n,t).getTime();return Math.round(r/cIt)+1}function fIt(e){return un(1,arguments),bn(e).getFullYear()}function B9(e,t){un(2,arguments);var n=bn(e),r=bn(t);return n.getTime()>r.getTime()}function U9(e,t){un(2,arguments);var n=bn(e),r=bn(t);return n.getTime()e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,o=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function Wr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L5(e,t)}function aj(e){return aj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},aj(e)}function L6e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(L6e=function(){return!!e})()}function hIt(e,t){if(t&&(lv(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return en(e)}function Hr(e){var t=L6e();return function(){var n,r=aj(e);if(t){var i=aj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return hIt(this,n)}}function Rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pIt(e,t){for(var n=0;n0,r=n?t:1-t,i;if(r<=50)i=e||100;else{var o=r+50,s=Math.floor(o/100)*100,a=e>=o%100;i=e+s-(a?100:0)}return n?i:1-i}function z6e(e){return e%400===0||e%4===0&&e%100!==0}var bIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s){var a=i.getUTCFullYear();if(s.isTwoDigitYear){var l=N6e(s.year,a);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui),xIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s,a){var l=hce(i,a);if(s.isTwoDigitYear){var c=N6e(s.year,l);return i.setUTCFullYear(c,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),uw(i,a)}var u=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),uw(i,a)}}]),n})(ui),wIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui),CIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui),OIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui),EIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui);function TIt(e,t,n){un(2,arguments);var r=bn(e),i=Vr(t),o=k6e(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var PIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s,a){return uw(TIt(i,s,a),a)}}]),n})(ui);function kIt(e,t){un(2,arguments);var n=bn(e),r=Vr(t),i=P6e(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var MIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s){return QO(kIt(i,s))}}]),n})(ui),AIt=[31,28,31,30,31,30,31,31,30,31,30,31],RIt=[31,29,31,30,31,30,31,31,30,31,30,31],IIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=RIt[l]:o>=1&&o<=AIt[l]}},{key:"set",value:function(i,o,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),n})(ui),DIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),n})(ui);function mce(e,t,n){var r,i,o,s,a,l,c,u;un(2,arguments);var f=yg(),d=Vr((r=(i=(o=(s=n?.weekStartsOn)!==null&&s!==void 0?s:n==null||(a=n.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=bn(e),p=Vr(t),g=h.getUTCDay(),m=p%7,v=(m+7)%7,y=(v=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=mce(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n})(ui),FIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=mce(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n})(ui),$It=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=mce(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n})(ui);function NIt(e,t){un(2,arguments);var n=Vr(t);n%7===0&&(n=n-7);var r=1,i=bn(e),o=i.getUTCDay(),s=n%7,a=(s+7)%7,l=(a=1&&o<=7}},{key:"set",value:function(i,o,s){return i=NIt(i,s),i.setUTCHours(0,0,0,0),i}}]),n})(ui),jIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=12}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):!a&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n})(ui),WIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=23}},{key:"set",value:function(i,o,s){return i.setUTCHours(s,0,0,0),i}}]),n})(ui),HIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n})(ui),GIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=24}},{key:"set",value:function(i,o,s){var a=s<=24?s%24:s;return i.setUTCHours(a,0,0,0),i}}]),n})(ui),qIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCMinutes(s,0,0),i}}]),n})(ui),XIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCSeconds(s,0),i}}]),n})(ui),YIt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Rr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=Vr((p=(g=(m=(v=r?.weekStartsOn)!==null&&v!==void 0?v:r==null||(y=r.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&g!==void 0?g:(w=T.locale)===null||w===void 0||(S=w.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&p!==void 0?p:0);if(!(R>=0&&R<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(E==="")return _===""?bn(n):new Date(NaN);var I={firstWeekContainsDate:P,weekStartsOn:R,locale:k},F=[new vIt],A=E.match(nDt).map(function(ie){var ne=ie[0];if(ne in Qte){var fe=Qte[ne];return fe(ie,k.formatLong)}return ie}).join("").match(tDt),L=[],$=eSe(A),j;try{var V=function(){var ne=j.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&R6e(ne)&&sj(ne,E,e),!(r!=null&&r.useAdditionalDayOfYearTokens)&&A6e(ne)&&sj(ne,E,e);var fe=ne[0],me=eDt[fe];if(me){var se=me.incompatibleTokens;if(Array.isArray(se)){var ue=L.find(function(ce){return se.includes(ce.token)||ce.token===fe});if(ue)throw new RangeError("The format string mustn't contain `".concat(ue.fullToken,"` and `").concat(ne,"` at the same time"))}else if(me.incompatibleTokens==="*"&&L.length>0)throw new RangeError("The format string mustn't contain `".concat(ne,"` and any other token at the same time"));L.push({token:fe,fullToken:ne});var G=me.run(_,ne,k.match,I);if(!G)return{v:new Date(NaN)};F.push(G.setter),_=G.rest}else{if(fe.match(sDt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+fe+"`");if(ne==="''"?ne="'":fe==="'"&&(ne=lDt(ne)),_.indexOf(ne)===0)_=_.slice(ne.length);else return{v:new Date(NaN)}}};for($.s();!(j=$.n()).done;){var U=V();if(lv(U)==="object")return U.v}}catch(ie){$.e(ie)}finally{$.f()}if(_.length>0&&oDt.test(_))return new Date(NaN);var z=F.map(function(ie){return ie.priority}).sort(function(ie,ne){return ne-ie}).filter(function(ie,ne,fe){return fe.indexOf(ie)===ne}).map(function(ie){return F.filter(function(ne){return ne.priority===ie}).sort(function(ne,fe){return fe.subPriority-ne.subPriority})}).map(function(ie){return ie[0]}),N=bn(n);if(isNaN(N.getTime()))return new Date(NaN);var B=E6e(N,C6e(N)),H={},Q=eSe(z),Y;try{for(Q.s();!(Y=Q.n()).done;){var Z=Y.value;if(!Z.validate(B,I))return new Date(NaN);var pe=Z.set(B,H,I);Array.isArray(pe)?(B=pe[0],eIt(H,pe[1])):B=pe}}catch(ie){Q.e(ie)}finally{Q.f()}return B}function lDt(e){return e.match(rDt)[1].replace(iDt,"'")}function tSe(e){un(1,arguments);var t=bn(e);return t.setMinutes(0,0,0),t}function cDt(e,t){un(2,arguments);var n=tSe(e),r=tSe(t);return n.getTime()===r.getTime()}function uDt(e,t){un(2,arguments);var n=bn(e),r=bn(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function fDt(e,t){un(2,arguments);var n=bn(e),r=bn(t);return n.getFullYear()===r.getFullYear()}function dDt(e,t){un(2,arguments);var n=bn(e).getTime(),r=bn(t.start).getTime(),i=bn(t.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function hDt(e,t){var n;un(1,arguments);var r=Vr((n=void 0)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var i=vDt(e),o;if(i.date){var s=yDt(i.date,r);o=bDt(s.restDateString,s.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a=o.getTime(),l=0,c;if(i.time&&(l=xDt(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=wDt(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(a+l+c)}var Y$={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},pDt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,gDt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,mDt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function vDt(e){var t={},n=e.split(Y$.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Y$.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Y$.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var i=Y$.timezone.exec(r);i?(t.time=r.replace(i[1],""),t.timezone=i[1]):t.time=r}return t}function yDt(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:e.slice((r[1]||r[2]).length)}}function bDt(e,t){if(t===null)return new Date(NaN);var n=e.match(pDt);if(!n)return new Date(NaN);var r=!!n[4],i=Dk(n[1]),o=Dk(n[2])-1,s=Dk(n[3]),a=Dk(n[4]),l=Dk(n[5])-1;if(r)return EDt(t,a,l)?SDt(t,a,l):new Date(NaN);var c=new Date(0);return!CDt(t,o,s)||!ODt(t,i)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(i,s)),c)}function Dk(e){return e?parseInt(e):1}function xDt(e){var t=e.match(gDt);if(!t)return NaN;var n=V9(t[1]),r=V9(t[2]),i=V9(t[3]);return TDt(n,r,i)?n*dce+r*fce+i*1e3:NaN}function V9(e){return e&&parseFloat(e.replace(",","."))||0}function wDt(e){if(e==="Z")return 0;var t=e.match(mDt);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return PDt(r,i)?n*(r*dce+i*fce):NaN}function SDt(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var i=r.getUTCDay()||7,o=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var _Dt=[31,null,31,30,31,30,31,31,30,31,30,31];function j6e(e){return e%400===0||e%4===0&&e%100!==0}function CDt(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(_Dt[t]||(j6e(e)?29:28))}function ODt(e,t){return t>=1&&t<=(j6e(e)?366:365)}function EDt(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function TDt(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function PDt(e,t){return t>=0&&t<=59}function kDt(e,t){un(2,arguments);var n=bn(e),r=Vr(t),i=n.getFullYear(),o=n.getDate(),s=new Date(0);s.setFullYear(i,r,15),s.setHours(0,0,0,0);var a=I6e(s);return n.setMonth(r,Math.min(o,a)),n}function MDt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setDate(r),n}function ADt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setHours(r),n}function RDt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setMilliseconds(r),n}function IDt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setMinutes(r),n}function DDt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setSeconds(r),n}function LDt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}const B6e={years:1e3*60*60*24*365};function FDt(e,t){return e===t?!0:e!==null&&t!=null?e[0]===t[0]&&e[1]===t[1]:!1}function $Dt(e,t){const n=new Set,r=new Set,i={};for(const l of e)for(const c of l.timeSeriesArray){const{placeId:u,datasetId:f,variableName:d,valueDataKey:h,errorDataKey:p}=c.source;u!==null&&r.add(u);const g=`${f}.${d}.${h}`;n.add(g);let m=null;p&&(m=`${f}.${d}.${p}`,n.add(m)),c.data.forEach(v=>{const y=ET(v.time),b=`${u!==null?u:f}-${y}`,w=i[b];w?i[b]={...w,[g]:v[h]}:i[b]={placeId:u,time:y,[g]:v[h]},m!==null&&(i[b][m]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),s=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),s.push(u)}),s.sort((l,c)=>{const u=l[1],f=c[1],d=u.localeCompare(f);if(d!==0)return d;const h=l[0],p=c[0];return h.localeCompare(p)});const a={};return r.forEach(l=>{a[l]=Xle(t,l)}),{colNames:o,dataRows:s,referencedPlaces:a}}function NDt(e){let t=null;const n=e.features||[];for(const r of n){if(!r.properties)continue;const i=r.properties.time;if(typeof i!="string")continue;const s=hDt(i).getTime();if(!Number.isNaN(s))for(const a of Object.getOwnPropertyNames(r.properties)){let l=r.properties[a];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:s,countTot:1,mean:l};t===null&&(t={});const f=t[a];f?f.data.push(u):t[a]={source:{datasetId:e.id,datasetTitle:e.title,variableName:a,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return t===null?null:{placeGroup:e,timeSeries:t}}const xD=e=>e.dataState.datasets||[],zDt=e=>e.dataState.colorBars,U6e=e=>e.dataState.timeSeriesGroups,wD=e=>e.dataState.userPlaceGroups,V6e=e=>e.dataState.userServers||[],jDt=e=>e.dataState.expressionCapabilities,BDt=e=>e.dataState.statistics.loading,UDt=e=>e.dataState.statistics.records,W6e=Gt(xD,wD,(e,t)=>{const n={},r=[];return e.forEach(i=>{i.placeGroups&&i.placeGroups.forEach(o=>{n[o.id]||(n[o.id]=o,r.push(o))})}),[...r,...t]}),VDt=Gt(W6e,e=>{const t=[];return e.forEach(n=>{const r=NDt(n);r!==null&&t.push(r)}),t}),WDt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",H6e=new Image;H6e.src=WDt;const Zte="_alpha",Jte="_r";function HDt(e){let t=e;const n=t.endsWith(Zte);n&&(t=t.slice(0,t.length-Zte.length));const r=t.endsWith(Jte);return r&&(t=t.slice(0,t.length-Jte.length)),{baseName:t,isAlpha:n,isReversed:r}}function cj(e){let t=e.baseName;return e.isReversed&&(t+=Jte),e.isAlpha&&(t+=Zte),t}function GDt(e,t,n){XDt(e,t).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const s=o.createPattern(H6e,"repeat");s!==null?o.fillStyle=s:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function qDt(e,t){return new Promise((n,r)=>{const i=new Image,o=e.imageData;if(!o){n(i);return}i.onload=()=>{n(i)},i.onerror=(s,a,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function XDt(e,t){return qDt(e).then(n=>{const r=YDt(e,t,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function YDt(e,t,n){const r=document.createElement("canvas");r.width=n.width||1,r.height=n.height||1;const i=r.getContext("2d");if(i===null)return null;i.drawImage(n,0,0);let s=i.getImageData(0,0,r.width,r.height).data;if(e.isReversed){const a=new Uint8ClampedArray(s.length);for(let l=0;le.controlState.selectedDatasetId,dS=e=>e.controlState.selectedVariableName,vce=e=>e.controlState.selectedDataset2Id,yce=e=>e.controlState.selectedVariable2Name,bce=e=>e.controlState.selectedPlaceGroupIds,hS=e=>e.controlState.selectedPlaceId,SD=e=>e.controlState.selectedTime,QDt=e=>e.controlState.selectedServerId,KDt=e=>e.controlState.activities,SU=e=>e.controlState.timeAnimationActive,_D=e=>e.controlState.imageSmoothingEnabled,G6e=e=>e.controlState.userBaseMaps,q6e=e=>e.controlState.userOverlays,ZDt=e=>e.controlState.layerVisibilities.datasetBoundary,JDt=e=>e.controlState.layerVisibilities.datasetVariable,eLt=e=>e.controlState.layerVisibilities.datasetVariable2,tLt=e=>e.controlState.layerVisibilities.datasetRgb,nLt=e=>e.controlState.layerVisibilities.datasetRgb2,rLt=e=>e.controlState.layerVisibilities.datasetPlaces,X6e=e=>e.controlState.layerVisibilities.userPlaces,_U=e=>e.controlState.layerVisibilities,Y6e=e=>e.controlState.infoCardElementStates,Ov=e=>e.controlState.mapProjection,iLt=e=>e.controlState.timeChunkSize,oLt=e=>e.controlState.userPlacesFormatName,sLt=e=>e.controlState.userPlacesFormatOptions.csv,aLt=e=>e.controlState.userPlacesFormatOptions.geojson,lLt=e=>e.controlState.userPlacesFormatOptions.wkt,pS=e=>e.controlState.userColorBars,cLt=e=>On.instance.branding.allowUserVariables,uLt=e=>e.controlState.zoomLevel,fLt=e=>e.controlState.datasetZLevel,dLt=()=>"variable",hLt=()=>"variable2",pLt=()=>"rgb",gLt=()=>"rgb2",mLt=()=>13,vLt=()=>12,yLt=()=>11,bLt=()=>10,Co=Gt(xD,RT,dO),Ev=Gt(xD,vce,dO),Q6e=e=>e&&(e.title||e.id)?e.title:null,xce=Gt(Co,Q6e),K6e=Gt(Ev,Q6e),xLt=Gt(Co,e=>e&&e.variables||[]),wLt=Gt(Co,e=>e?Jle(e)[1]:[]),SLt=e=>e&&e.resolutions?e.resolutions:[],Z6e=Gt(Co,SLt),_Lt=e=>e&&e.spatialUnits?e.spatialUnits:null,CLt=Gt(Co,_Lt),OLt=Gt(Z6e,CLt,fLt,Ov,Ikt),J6e=(e,t)=>!e||!t?null:jte(e,t),nc=Gt(Co,dS,J6e),Tv=Gt(Ev,yce,J6e),eUe=e=>e&&(e.title||e.name),ELt=Gt(nc,eUe),TLt=Gt(Tv,eUe),tUe=e=>e&&e.units||"-",PLt=Gt(nc,tUe),kLt=Gt(Tv,tUe),nUe=e=>e&&e.colorBarName||"viridis",CU=Gt(nc,nUe),OU=Gt(Tv,nUe),rUe=e=>e?[e.colorBarMin,e.colorBarMax]:[0,1],iUe=Gt(nc,rUe),oUe=Gt(Tv,rUe),sUe=e=>(e&&e.colorBarNorm)==="log"?"log":"lin",aUe=Gt(nc,sUe),lUe=Gt(Tv,sUe),EU=Gt(pS,zDt,(e,t)=>{const n={title:N4e,description:"User-defined color bars.",names:e.map(i=>i.id)},r={};return e.forEach(({id:i,imageData:o})=>{o&&(r[i]=o)}),t?{...t,groups:[n,...t.groups],images:{...t.images,...r}}:{groups:[n],images:r,customColorMaps:{}}}),cUe=(e,t,n)=>{const r=HDt(e),{baseName:i}=r,o=t.images[i],s=n.find(a=>a.id===i);if(s){const a=s.type,l=j4e(s.code);return{...r,imageData:o,type:a,colorRecords:l}}else{const a=t.customColorMaps[i];if(a){const l=a.type,c=a.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},wce=Gt(CU,EU,pS,cUe),uUe=Gt(OU,EU,pS,cUe),fUe=(e,t,n)=>{const{baseName:r}=e,i=n.find(o=>o.id===r);if(i){const o=j4e(i.code);if(o)return JSON.stringify({name:t,type:i.type,colors:o.map(s=>[s.value,s.color])})}return null},MLt=Gt(wce,CU,pS,fUe),ALt=Gt(uUe,OU,pS,fUe),dUe=e=>!e||typeof e.opacity!="number"?1:e.opacity,hUe=Gt(nc,dUe),pUe=Gt(Tv,dUe),RLt=Gt(Co,e=>e!==null?$4e(e):null),ILt=Gt(Co,e=>e!==null&&e.rgbSchema||null),DLt=Gt(Ev,e=>e!==null&&e.rgbSchema||null),gUe=Gt(Co,e=>e&&e.placeGroups||[]),CD=Gt(gUe,wD,(e,t)=>e.concat(t));function mUe(e,t){const n=[];return t!==null&&t.length>0&&e.forEach(r=>{t.indexOf(r.id)>-1&&n.push(r)}),n}const LLt=Gt(wD,bce,X6e,(e,t)=>{const n={},r=new Set(t||[]);return e.forEach(i=>{n[i.id]=r.has(i.id)}),n}),vUe=Gt(gUe,bce,mUe),IT=Gt(CD,bce,mUe),FLt=Gt(IT,e=>e.map(t=>t.title||t.id).join(", ")),OD=Gt(IT,e=>{const t=e.map(n=>OT(n)?n.features:[]);return[].concat(...t)}),Sce=Gt(OD,hS,(e,t)=>e.find(n=>n.id===t)||null),$Lt=Gt(Sce,e=>e?.geometry||null),ED=Gt(IT,hS,(e,t)=>e.length===0||t===null?null:XTt(e,t)),NLt=Gt(RT,dS,Sce,(e,t,n)=>{if(e&&t){if(!n)return`${e}-${t}-all`;if(n.geometry.type==="Polygon"||n.geometry.type==="MultiPolygon")return`${e}-${t}-${n.id}`}return null}),yUe=Gt(U6e,RT,dS,hS,(e,t,n,r)=>{if(!t||!n||!r)return!1;for(const i of e)for(const o of i.timeSeriesArray){const s=o.source;if(s.datasetId===t&&s.variableName===n&&s.placeId===r)return!1}return!0}),zLt=Gt(U6e,CD,(e,t)=>{const n={};return qle(t,(r,i)=>{for(const o of e)if(o.timeSeriesArray.find(s=>s.source.placeId===i.id)){n[i.id]=pU(r,i);break}}),n}),bUe=Gt(RT,dS,hS,(e,t,n)=>!!(e&&t&&n)),jLt=Gt(UDt,CD,(e,t)=>{const n=[];return e.forEach(r=>{const i=r.source.placeInfo.place.id;qle(t,(o,s)=>{if(s.id===i){const a=pU(o,s);n.push({...r,source:{...r.source,placeInfo:a}})}})}),n}),BLt=Gt(IT,e=>{const t=[];return qle(e,(n,r)=>{t.push(pU(n,r).label)}),t}),ULt=Gt(nc,iLt,(e,t)=>{if(e&&e.timeChunkSize){const n=e.timeChunkSize;return n*Math.ceil(t/n)}return t}),xUe=e=>e&&F4e(e)||null,DT=Gt(Co,xUe),VLt=Gt(Ev,xUe),wUe=e=>e&&e.attributions||null,_ce=Gt(Co,wUe),WLt=Gt(Ev,wUe),SUe=e=>e===null||e.coordinates.length===0?null:e.coordinates,ene=Gt(DT,SUe),HLt=Gt(DT,SUe),_Ue=(e,t)=>e===null||t===null?-1:w6e(t,e),CUe=Gt(SD,ene,_Ue),GLt=Gt(SD,HLt,_Ue),OUe=(e,t,n)=>e===null?null:n&&t>-1?n.labels[t]:new Date(e).toISOString(),gS=Gt(SD,CUe,DT,OUe),qLt=Gt(SD,GLt,VLt,OUe);function XLt(e,t){if(e!==iD){const n=typeof t=="number"?t+1:20;return new cce({tileSize:[256,256],origin:[-180,90],extent:[-180,-90,180,90],resolutions:Array.from({length:n},(r,i)=>180/256/Math.pow(2,i))})}}function YLt(e,t,n,r,i,o,s,a,l){return new AT({url:e,projection:t,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:s,maxZoom:l,crossOrigin:"Anonymous"})}function QLt(e){if(e)return(t,n)=>{t instanceof Qle&&(e.getView().getInteracting()?e.once("moveend",function(){t.getImage().src=n}):t.getImage().src=n)}}const KLt=jkt(QLt,{serializer:e=>{const t=e[0];if(t){const n=t.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function ZLt(){const e=Qs.map;return KLt(e)}function EUe(e,t,n,r,i,o,s,a,l,c,u,f,d=10){a!==null&&(o=[...o,["time",a]]);const h=Cv(t,o);typeof i=="number"&&(i+=3);const p=XLt(c,i),g=YLt(h,c,p,u,l,f,ZLt(),r,i),m=c===aS?n:UBe(n,"EPSG:4326",c);return O.jsx(x6e,{id:e,source:g,extent:m,zIndex:d,opacity:s})}const JLt=Gt(Co,Ov,ZDt,(e,t,n)=>{if(!e||!n)return null;let r=e.geometry;if(!r)if(e.bbox){const[s,a,l,c]=e.bbox;r={type:"Polygon",coordinates:[[[s,a],[l,a],[l,c],[s,c],[s,a]]]}}else return console.warn(`Dataset ${e.id} has no bbox!`),null;const i=new vD({features:new fS({dataProjection:aS,featureProjection:t}).readFeatures({type:"Feature",geometry:r})}),o=new Op({stroke:new jp({color:"orange",width:3,lineDash:[2,4]})});return O.jsx(xU,{id:`${e.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),Vo=Gt(V6e,QDt,(e,t)=>{if(e.length===0)throw new Error("internal error: no servers configured");const n=e.find(r=>r.id===t);if(!n)throw new Error(`internal error: server with ID "${t}" not found`);return n}),TUe=(e,t,n,r,i,o,s,a,l,c,u,f,d,h,p,g)=>{if(!t||!i||!u)return null;const m=[["crs",p],["vmin",`${s[0]}`],["vmax",`${s[1]}`],["cmap",l||o]];return a==="log"&&m.push(["norm",a]),EUe(f,kUe(e.url,t,i),t.bbox,i.tileLevelMin,i.tileLevelMax,m,c,n,h,p,r,g,d)},eFt=Gt(Vo,Co,gS,_ce,nc,CU,iUe,aUe,MLt,hUe,JDt,dLt,mLt,SU,Ov,_D,TUe),tFt=Gt(Vo,Ev,qLt,WLt,Tv,OU,oUe,lUe,ALt,pUe,eLt,hLt,vLt,SU,Ov,_D,TUe),PUe=(e,t,n,r,i,o,s,a,l,c,u)=>{if(!t||!n||!r)return null;const f=[["crs",l]];return EUe(i,kUe(e.url,t,"rgb"),t.bbox,n.tileLevelMin,n.tileLevelMax,f,1,s,a,l,c,u,o)},nFt=Gt(Vo,Co,ILt,tLt,pLt,yLt,gS,SU,Ov,_ce,_D,PUe),rFt=Gt(Vo,Ev,DLt,nLt,gLt,bLt,gS,SU,Ov,_ce,_D,PUe);function kUe(e,t,n){return`${e}/tiles/${PT(t)}/${hD(n)}/{z}/{y}/{x}`}function iFt(){return xle()}function oFt(){return new gD({fill:AUe(),stroke:MUe(),radius:6})}function MUe(){return new jp({color:[200,0,0,.75],width:1.25})}function AUe(){return new cw({color:[255,0,0,iFt()]})}function sFt(){return new Op({image:oFt(),stroke:MUe(),fill:AUe()})}const aFt=Gt(vUe,Ov,rLt,(e,t,n)=>{if(!n||e.length===0)return null;const r=[];return e.forEach((i,o)=>{OT(i)&&r.push(O.jsx(xU,{id:`placeGroup.${i.id}`,style:sFt(),zIndex:100,source:new vD({features:new fS({dataProjection:aS,featureProjection:t}).readFeatures(i)})},o))}),O.jsx(v6e,{children:r})}),lFt=Gt(Y6e,e=>{const t=[];return Object.getOwnPropertyNames(e).forEach(n=>{e[n].visible&&t.push(n)}),t}),cFt=Gt(Y6e,e=>{const t={};return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=e[n].viewMode||"text"}),t}),uFt=Gt(KDt,e=>Object.keys(e).map(t=>e[t])),fFt=e=>CBe("baseMaps"),dFt=e=>CBe("overlays"),RUe=Gt(G6e,fFt,(e,t)=>[...e,...t.length?t:OBe]),IUe=Gt(q6e,dFt,(e,t)=>[...e,...t.length?t:bOt]),DUe=(e,t,n)=>e.filter(r=>t[r.id]).map(r=>hFt(r,n)),hFt=(e,t)=>{let n=e.attribution;n&&(n.startsWith("http://")||n.startsWith("https://"))&&(n=`© ${e.title}`);let r;if(e.wms){const{layerName:i,styleName:o}=e.wms;r=new $At({url:e.url,params:{...o?{STYLES:o}:{},LAYERS:i},attributions:n,attributionsCollapsible:!0})}else r=new AT({url:e.url,attributions:n,attributionsCollapsible:!0});return O.jsx(x6e,{id:e.id,source:r,zIndex:t},e.id)},pFt=Gt(RUe,_U,()=>0,DUe),gFt=Gt(IUe,_U,()=>20,DUe),mFt=Gt(Co,Ev,nc,Tv,RUe,IUe,_U,(e,t,n,r,i,o,s)=>{const a={datasetRgb:{id:"datasetRgb",title:"Dataset RGB",subTitle:e?e.title:void 0,visible:s.datasetRgb,disabled:!(e&&e.rgbSchema)},datasetRgb2:{id:"datasetRgb2",title:"Dataset RGB",subTitle:t?t.title:void 0,visible:s.datasetRgb2,disabled:!(t&&t.rgbSchema),pinned:!0},datasetVariable:{id:"datasetVariable",title:"Dataset Variable",subTitle:e&&n?`${e.title} / ${n.title||n.name}`:void 0,visible:s.datasetVariable,disabled:!(e&&n)},datasetVariable2:{id:"datasetVariable2",title:"Dataset Variable",subTitle:t&&r?`${t.title} / ${r.title||r.name}`:void 0,visible:s.datasetVariable2,disabled:!(t&&r),pinned:!0},datasetBoundary:{id:"datasetBoundary",title:"Dataset Boundary",subTitle:e?e.title:void 0,visible:s.datasetBoundary,disabled:!e},datasetPlaces:{id:"datasetPlaces",title:"Dataset Places",visible:s.datasetPlaces},userPlaces:{id:"userPlaces",title:"User Places",visible:s.userPlaces}};return i.forEach(l=>{a[l.id]=nSe(l,"baseMaps",s[l.id])}),o.forEach(l=>{a[l.id]=nSe(l,"overlays",s[l.id])}),a});function nSe(e,t,n){return{id:e.id,title:e.title,exclusive:e.exclusive,type:t,visible:n}}function J2(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var W9={exports:{}};var rSe;function vFt(){return rSe||(rSe=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,i,o){function s(c,u){if(!i[c]){if(!r[c]){var f=typeof J2=="function"&&J2;if(!u&&f)return f(c,!0);if(a)return a(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[c]={exports:{}};r[c][0].call(h.exports,function(p){var g=r[c][1][p];return s(g||p)},h,h.exports,n,r,i,o)}return i[c].exports}for(var a=typeof J2=="function"&&J2,l=0;l>2,h=(3&c)<<4|u>>4,p=1>6:64,g=2>4,u=(15&d)<<4|(h=a.indexOf(l.charAt(g++)))>>2,f=(3&h)<<6|(p=a.indexOf(l.charAt(g++))),y[m++]=c,h!==64&&(y[m++]=u),p!==64&&(y[m++]=f);return y}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,f,d,h,p){this.compressedSize=u,this.uncompressedSize=f,this.crc32=d,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,d){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var o=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var o=n("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?(function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u[g])];return-1^c})(0|l,a,a.length,0):(function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u.charCodeAt(g))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=o?"uint8array":"array";function u(f,d){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=d,this.meta={}}i.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(d){f.push({data:d,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function o(h,p){var g,m="";for(g=0;g>>=8;return m}function s(h,p,g,m,v,y){var b,w,S=h.file,_=h.compression,E=y!==c.utf8encode,T=a.transformTo("string",y(S.name)),k=a.transformTo("string",c.utf8encode(S.name)),P=S.comment,R=a.transformTo("string",y(P)),I=a.transformTo("string",c.utf8encode(P)),F=k.length!==S.name.length,A=I.length!==P.length,L="",$="",j="",V=S.dir,U=S.date,z={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(z.crc32=h.crc32,z.compressedSize=h.compressedSize,z.uncompressedSize=h.uncompressedSize);var N=0;p&&(N|=8),E||!F&&!A||(N|=2048);var B=0,H=0;V&&(B|=16),v==="UNIX"?(H=798,B|=(function(Y,Z){var pe=Y;return Y||(pe=Z?16893:33204),(65535&pe)<<16})(S.unixPermissions,V)):(H=20,B|=(function(Y){return 63&(Y||0)})(S.dosPermissions)),b=U.getUTCHours(),b<<=6,b|=U.getUTCMinutes(),b<<=5,b|=U.getUTCSeconds()/2,w=U.getUTCFullYear()-1980,w<<=4,w|=U.getUTCMonth()+1,w<<=5,w|=U.getUTCDate(),F&&($=o(1,1)+o(u(T),4)+k,L+="up"+o($.length,2)+$),A&&(j=o(1,1)+o(u(R),4)+I,L+="uc"+o(j.length,2)+j);var Q="";return Q+=` -\0`,Q+=o(N,2),Q+=_.magic,Q+=o(b,2),Q+=o(w,2),Q+=o(z.crc32,4),Q+=o(z.compressedSize,4),Q+=o(z.uncompressedSize,4),Q+=o(T.length,2),Q+=o(L.length,2),{fileRecord:f.LOCAL_FILE_HEADER+Q+T+L,dirRecord:f.CENTRAL_FILE_HEADER+o(H,2)+Q+o(R.length,2)+"\0\0\0\0"+o(B,4)+o(m,4)+T+L+R}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function d(h,p,g,m){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=m,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,g=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-m-1))/g:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var g=s(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,g=s(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:(function(m){return f.DATA_DESCRIPTOR+o(m.crc32,4)+o(m.compressedSize,4)+o(m.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||s.uint8array?d==="nodebuffer"?new c(f):s.uint8array?new u(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var o=n("./GenericWorker"),s=n("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),s=n("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l "+s:s}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,g){return new u.Promise(function(m,v){var y=[],b=p._internalType,w=p._outputType,S=p._mimeType;p.on("data",function(_,E){y.push(_),g&&g(E)}).on("error",function(_){y=[],v(_)}).on("end",function(){try{var _=(function(E,T,k){switch(E){case"blob":return o.newBlob(o.transformTo("arraybuffer",T),k);case"base64":return l.encode(T);default:return o.transformTo(E,T)}})(w,(function(E,T){var k,P=0,R=null,I=0;for(k=0;k"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var o=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return s.nodebuffer?a.newBufferFrom(h,"utf-8"):(function(p){var g,m,v,y,b,w=p.length,S=0;for(y=0;y>>6:(m<65536?g[b++]=224|m>>>12:(g[b++]=240|m>>>18,g[b++]=128|m>>>12&63),g[b++]=128|m>>>6&63),g[b++]=128|63&m);return g})(h)},i.utf8decode=function(h){return s.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):(function(p){var g,m,v,y,b=p.length,w=new Array(2*b);for(g=m=0;g>10&1023,w[m++]=56320|1023&v)}return w.length!==m&&(w.subarray?w=w.subarray(0,m):w.length=m),o.applyFromCharCode(w)})(h=o.transformTo(s.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(s.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var m=(function(y,b){var w;for((b=b||y.length)>y.length&&(b=y.length),w=b-1;0<=w&&(192&y[w])==128;)w--;return w<0||w===0?b:w+c[y[w]]>b?w:b})(p),v=p;m!==p.length&&(s.uint8array?(v=p.subarray(0,m),this.leftOver=p.subarray(m,p.length)):(v=p.slice(0,m),this.leftOver=p.slice(m,p.length))),this.push({data:i.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var o=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(g){return g}function u(g,m){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,g,m,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?d[m++]=224|h>>>12:(d[m++]=240|h>>>18,d[m++]=128|h>>>12&63),d[m++]=128|h>>>6&63),d[m++]=128|63&h);return d},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,p=d.length;h>10&1023,y[p++]=56320|1023&g)}return u(y,p)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(n,r,i){r.exports=function(o,s,a,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,c){var u=o,f=c+l;s^=-1;for(var d=c;d>>8^u[255&(s^a[d])];return-1^s}},{}],46:[function(n,r,i){var o,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,d=4,h=0,p=-2,g=-1,m=4,v=2,y=8,b=9,w=286,S=30,_=19,E=2*w+1,T=15,k=3,P=258,R=P+k+1,I=42,F=113,A=1,L=2,$=3,j=4;function V(G,ce){return G.msg=u[ce],ce}function U(G){return(G<<1)-(4G.avail_out&&(he=G.avail_out),he!==0&&(s.arraySet(G.output,ce.pending_buf,ce.pending_out,he,G.next_out),G.next_out+=he,ce.pending_out+=he,G.total_out+=he,G.avail_out-=he,ce.pending-=he,ce.pending===0&&(ce.pending_out=0))}function B(G,ce){a._tr_flush_block(G,0<=G.block_start?G.block_start:-1,G.strstart-G.block_start,ce),G.block_start=G.strstart,N(G.strm)}function H(G,ce){G.pending_buf[G.pending++]=ce}function Q(G,ce){G.pending_buf[G.pending++]=ce>>>8&255,G.pending_buf[G.pending++]=255&ce}function Y(G,ce){var he,J,te=G.max_chain_length,ae=G.strstart,we=G.prev_length,Pe=G.nice_match,ee=G.strstart>G.w_size-R?G.strstart-(G.w_size-R):0,oe=G.window,Se=G.w_mask,ye=G.prev,be=G.strstart+P,ge=oe[ae+we-1],xe=oe[ae+we];G.prev_length>=G.good_match&&(te>>=2),Pe>G.lookahead&&(Pe=G.lookahead);do if(oe[(he=ce)+we]===xe&&oe[he+we-1]===ge&&oe[he]===oe[ae]&&oe[++he]===oe[ae+1]){ae+=2,he++;do;while(oe[++ae]===oe[++he]&&oe[++ae]===oe[++he]&&oe[++ae]===oe[++he]&&oe[++ae]===oe[++he]&&oe[++ae]===oe[++he]&&oe[++ae]===oe[++he]&&oe[++ae]===oe[++he]&&oe[++ae]===oe[++he]&&aeee&&--te!=0);return we<=G.lookahead?we:G.lookahead}function Z(G){var ce,he,J,te,ae,we,Pe,ee,oe,Se,ye=G.w_size;do{if(te=G.window_size-G.lookahead-G.strstart,G.strstart>=ye+(ye-R)){for(s.arraySet(G.window,G.window,ye,ye,0),G.match_start-=ye,G.strstart-=ye,G.block_start-=ye,ce=he=G.hash_size;J=G.head[--ce],G.head[ce]=ye<=J?J-ye:0,--he;);for(ce=he=ye;J=G.prev[--ce],G.prev[ce]=ye<=J?J-ye:0,--he;);te+=ye}if(G.strm.avail_in===0)break;if(we=G.strm,Pe=G.window,ee=G.strstart+G.lookahead,oe=te,Se=void 0,Se=we.avail_in,oe=k)for(ae=G.strstart-G.insert,G.ins_h=G.window[ae],G.ins_h=(G.ins_h<=k&&(G.ins_h=(G.ins_h<=k)if(J=a._tr_tally(G,G.strstart-G.match_start,G.match_length-k),G.lookahead-=G.match_length,G.match_length<=G.max_lazy_match&&G.lookahead>=k){for(G.match_length--;G.strstart++,G.ins_h=(G.ins_h<=k&&(G.ins_h=(G.ins_h<=k&&G.match_length<=G.prev_length){for(te=G.strstart+G.lookahead-k,J=a._tr_tally(G,G.strstart-1-G.prev_match,G.prev_length-k),G.lookahead-=G.prev_length-1,G.prev_length-=2;++G.strstart<=te&&(G.ins_h=(G.ins_h<G.pending_buf_size-5&&(he=G.pending_buf_size-5);;){if(G.lookahead<=1){if(Z(G),G.lookahead===0&&ce===f)return A;if(G.lookahead===0)break}G.strstart+=G.lookahead,G.lookahead=0;var J=G.block_start+he;if((G.strstart===0||G.strstart>=J)&&(G.lookahead=G.strstart-J,G.strstart=J,B(G,!1),G.strm.avail_out===0)||G.strstart-G.block_start>=G.w_size-R&&(B(G,!1),G.strm.avail_out===0))return A}return G.insert=0,ce===d?(B(G,!0),G.strm.avail_out===0?$:j):(G.strstart>G.block_start&&(B(G,!1),G.strm.avail_out),A)}),new ne(4,4,8,4,pe),new ne(4,5,16,8,pe),new ne(4,6,32,32,pe),new ne(4,4,16,16,ie),new ne(8,16,32,32,ie),new ne(8,16,128,128,ie),new ne(8,32,128,256,ie),new ne(32,128,258,1024,ie),new ne(32,258,258,4096,ie)],i.deflateInit=function(G,ce){return ue(G,ce,y,15,8,0)},i.deflateInit2=ue,i.deflateReset=se,i.deflateResetKeep=me,i.deflateSetHeader=function(G,ce){return G&&G.state?G.state.wrap!==2?p:(G.state.gzhead=ce,h):p},i.deflate=function(G,ce){var he,J,te,ae;if(!G||!G.state||5>8&255),H(J,J.gzhead.time>>16&255),H(J,J.gzhead.time>>24&255),H(J,J.level===9?2:2<=J.strategy||J.level<2?4:0),H(J,255&J.gzhead.os),J.gzhead.extra&&J.gzhead.extra.length&&(H(J,255&J.gzhead.extra.length),H(J,J.gzhead.extra.length>>8&255)),J.gzhead.hcrc&&(G.adler=c(G.adler,J.pending_buf,J.pending,0)),J.gzindex=0,J.status=69):(H(J,0),H(J,0),H(J,0),H(J,0),H(J,0),H(J,J.level===9?2:2<=J.strategy||J.level<2?4:0),H(J,3),J.status=F);else{var we=y+(J.w_bits-8<<4)<<8;we|=(2<=J.strategy||J.level<2?0:J.level<6?1:J.level===6?2:3)<<6,J.strstart!==0&&(we|=32),we+=31-we%31,J.status=F,Q(J,we),J.strstart!==0&&(Q(J,G.adler>>>16),Q(J,65535&G.adler)),G.adler=1}if(J.status===69)if(J.gzhead.extra){for(te=J.pending;J.gzindex<(65535&J.gzhead.extra.length)&&(J.pending!==J.pending_buf_size||(J.gzhead.hcrc&&J.pending>te&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),N(G),te=J.pending,J.pending!==J.pending_buf_size));)H(J,255&J.gzhead.extra[J.gzindex]),J.gzindex++;J.gzhead.hcrc&&J.pending>te&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),J.gzindex===J.gzhead.extra.length&&(J.gzindex=0,J.status=73)}else J.status=73;if(J.status===73)if(J.gzhead.name){te=J.pending;do{if(J.pending===J.pending_buf_size&&(J.gzhead.hcrc&&J.pending>te&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),N(G),te=J.pending,J.pending===J.pending_buf_size)){ae=1;break}ae=J.gzindexte&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),ae===0&&(J.gzindex=0,J.status=91)}else J.status=91;if(J.status===91)if(J.gzhead.comment){te=J.pending;do{if(J.pending===J.pending_buf_size&&(J.gzhead.hcrc&&J.pending>te&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),N(G),te=J.pending,J.pending===J.pending_buf_size)){ae=1;break}ae=J.gzindexte&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),ae===0&&(J.status=103)}else J.status=103;if(J.status===103&&(J.gzhead.hcrc?(J.pending+2>J.pending_buf_size&&N(G),J.pending+2<=J.pending_buf_size&&(H(J,255&G.adler),H(J,G.adler>>8&255),G.adler=0,J.status=F)):J.status=F),J.pending!==0){if(N(G),G.avail_out===0)return J.last_flush=-1,h}else if(G.avail_in===0&&U(ce)<=U(he)&&ce!==d)return V(G,-5);if(J.status===666&&G.avail_in!==0)return V(G,-5);if(G.avail_in!==0||J.lookahead!==0||ce!==f&&J.status!==666){var Pe=J.strategy===2?(function(ee,oe){for(var Se;;){if(ee.lookahead===0&&(Z(ee),ee.lookahead===0)){if(oe===f)return A;break}if(ee.match_length=0,Se=a._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++,Se&&(B(ee,!1),ee.strm.avail_out===0))return A}return ee.insert=0,oe===d?(B(ee,!0),ee.strm.avail_out===0?$:j):ee.last_lit&&(B(ee,!1),ee.strm.avail_out===0)?A:L})(J,ce):J.strategy===3?(function(ee,oe){for(var Se,ye,be,ge,xe=ee.window;;){if(ee.lookahead<=P){if(Z(ee),ee.lookahead<=P&&oe===f)return A;if(ee.lookahead===0)break}if(ee.match_length=0,ee.lookahead>=k&&0ee.lookahead&&(ee.match_length=ee.lookahead)}if(ee.match_length>=k?(Se=a._tr_tally(ee,1,ee.match_length-k),ee.lookahead-=ee.match_length,ee.strstart+=ee.match_length,ee.match_length=0):(Se=a._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++),Se&&(B(ee,!1),ee.strm.avail_out===0))return A}return ee.insert=0,oe===d?(B(ee,!0),ee.strm.avail_out===0?$:j):ee.last_lit&&(B(ee,!1),ee.strm.avail_out===0)?A:L})(J,ce):o[J.level].func(J,ce);if(Pe!==$&&Pe!==j||(J.status=666),Pe===A||Pe===$)return G.avail_out===0&&(J.last_flush=-1),h;if(Pe===L&&(ce===1?a._tr_align(J):ce!==5&&(a._tr_stored_block(J,0,0,!1),ce===3&&(z(J.head),J.lookahead===0&&(J.strstart=0,J.block_start=0,J.insert=0))),N(G),G.avail_out===0))return J.last_flush=-1,h}return ce!==d?h:J.wrap<=0?1:(J.wrap===2?(H(J,255&G.adler),H(J,G.adler>>8&255),H(J,G.adler>>16&255),H(J,G.adler>>24&255),H(J,255&G.total_in),H(J,G.total_in>>8&255),H(J,G.total_in>>16&255),H(J,G.total_in>>24&255)):(Q(J,G.adler>>>16),Q(J,65535&G.adler)),N(G),0=he.w_size&&(ae===0&&(z(he.head),he.strstart=0,he.block_start=0,he.insert=0),oe=new s.Buf8(he.w_size),s.arraySet(oe,ce,Se-he.w_size,he.w_size,0),ce=oe,Se=he.w_size),we=G.avail_in,Pe=G.next_in,ee=G.input,G.avail_in=Se,G.next_in=0,G.input=ce,Z(he);he.lookahead>=k;){for(J=he.strstart,te=he.lookahead-(k-1);he.ins_h=(he.ins_h<>>=k=T>>>24,b-=k,(k=T>>>16&255)===0)L[u++]=65535&T;else{if(!(16&k)){if((64&k)==0){T=w[(65535&T)+(y&(1<>>=k,b-=k),b<15&&(y+=A[l++]<>>=k=T>>>24,b-=k,!(16&(k=T>>>16&255))){if((64&k)==0){T=S[(65535&T)+(y&(1<>>=k,b-=k,(k=u-f)>3,y&=(1<<(b-=P<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(I){var F;return I&&I.state?(F=I.state,I.total_in=I.total_out=F.total=0,I.msg="",F.wrap&&(I.adler=1&F.wrap),F.mode=p,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(g),F.distcode=F.distdyn=new o.Buf32(m),F.sane=1,F.back=-1,d):h}function w(I){var F;return I&&I.state?((F=I.state).wsize=0,F.whave=0,F.wnext=0,b(I)):h}function S(I,F){var A,L;return I&&I.state?(L=I.state,F<0?(A=0,F=-F):(A=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=j.wsize?(o.arraySet(j.window,F,A-j.wsize,j.wsize,0),j.wnext=0,j.whave=j.wsize):(L<($=j.wsize-j.wnext)&&($=L),o.arraySet(j.window,F,A-L,$,j.wnext),(L-=$)?(o.arraySet(j.window,F,A-L,L,0),j.wnext=L,j.whave=j.wsize):(j.wnext+=$,j.wnext===j.wsize&&(j.wnext=0),j.whave>>8&255,A.check=a(A.check,ae,2,0),B=N=0,A.mode=2;break}if(A.flags=0,A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&N)<<8)+(N>>8))%31){I.msg="incorrect header check",A.mode=30;break}if((15&N)!=8){I.msg="unknown compression method",A.mode=30;break}if(B-=4,G=8+(15&(N>>>=4)),A.wbits===0)A.wbits=G;else if(G>A.wbits){I.msg="invalid window size",A.mode=30;break}A.dmax=1<>8&1),512&A.flags&&(ae[0]=255&N,ae[1]=N>>>8&255,A.check=a(A.check,ae,2,0)),B=N=0,A.mode=3;case 3:for(;B<32;){if(U===0)break e;U--,N+=L[j++]<>>8&255,ae[2]=N>>>16&255,ae[3]=N>>>24&255,A.check=a(A.check,ae,4,0)),B=N=0,A.mode=4;case 4:for(;B<16;){if(U===0)break e;U--,N+=L[j++]<>8),512&A.flags&&(ae[0]=255&N,ae[1]=N>>>8&255,A.check=a(A.check,ae,2,0)),B=N=0,A.mode=5;case 5:if(1024&A.flags){for(;B<16;){if(U===0)break e;U--,N+=L[j++]<>>8&255,A.check=a(A.check,ae,2,0)),B=N=0}else A.head&&(A.head.extra=null);A.mode=6;case 6:if(1024&A.flags&&(U<(Y=A.length)&&(Y=U),Y&&(A.head&&(G=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Array(A.head.extra_len)),o.arraySet(A.head.extra,L,j,Y,G)),512&A.flags&&(A.check=a(A.check,L,Y,j)),U-=Y,j+=Y,A.length-=Y),A.length))break e;A.length=0,A.mode=7;case 7:if(2048&A.flags){if(U===0)break e;for(Y=0;G=L[j+Y++],A.head&&G&&A.length<65536&&(A.head.name+=String.fromCharCode(G)),G&&Y>9&1,A.head.done=!0),I.adler=A.check=0,A.mode=12;break;case 10:for(;B<32;){if(U===0)break e;U--,N+=L[j++]<>>=7&B,B-=7&B,A.mode=27;break}for(;B<3;){if(U===0)break e;U--,N+=L[j++]<>>=1)){case 0:A.mode=14;break;case 1:if(P(A),A.mode=20,F!==6)break;N>>>=2,B-=2;break e;case 2:A.mode=17;break;case 3:I.msg="invalid block type",A.mode=30}N>>>=2,B-=2;break;case 14:for(N>>>=7&B,B-=7&B;B<32;){if(U===0)break e;U--,N+=L[j++]<>>16^65535)){I.msg="invalid stored block lengths",A.mode=30;break}if(A.length=65535&N,B=N=0,A.mode=15,F===6)break e;case 15:A.mode=16;case 16:if(Y=A.length){if(U>>=5,B-=5,A.ndist=1+(31&N),N>>>=5,B-=5,A.ncode=4+(15&N),N>>>=4,B-=4,286>>=3,B-=3}for(;A.have<19;)A.lens[we[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,he={bits:A.lenbits},ce=c(0,A.lens,0,19,A.lencode,0,A.work,he),A.lenbits=he.bits,ce){I.msg="invalid code lengths set",A.mode=30;break}A.have=0,A.mode=19;case 19:for(;A.have>>16&255,fe=65535&te,!((ie=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>>=ie,B-=ie,A.lens[A.have++]=fe;else{if(fe===16){for(J=ie+2;B>>=ie,B-=ie,A.have===0){I.msg="invalid bit length repeat",A.mode=30;break}G=A.lens[A.have-1],Y=3+(3&N),N>>>=2,B-=2}else if(fe===17){for(J=ie+3;B>>=ie)),N>>>=3,B-=3}else{for(J=ie+7;B>>=ie)),N>>>=7,B-=7}if(A.have+Y>A.nlen+A.ndist){I.msg="invalid bit length repeat",A.mode=30;break}for(;Y--;)A.lens[A.have++]=G}}if(A.mode===30)break;if(A.lens[256]===0){I.msg="invalid code -- missing end-of-block",A.mode=30;break}if(A.lenbits=9,he={bits:A.lenbits},ce=c(u,A.lens,0,A.nlen,A.lencode,0,A.work,he),A.lenbits=he.bits,ce){I.msg="invalid literal/lengths set",A.mode=30;break}if(A.distbits=6,A.distcode=A.distdyn,he={bits:A.distbits},ce=c(f,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,he),A.distbits=he.bits,ce){I.msg="invalid distances set",A.mode=30;break}if(A.mode=20,F===6)break e;case 20:A.mode=21;case 21:if(6<=U&&258<=z){I.next_out=V,I.avail_out=z,I.next_in=j,I.avail_in=U,A.hold=N,A.bits=B,l(I,Q),V=I.next_out,$=I.output,z=I.avail_out,j=I.next_in,L=I.input,U=I.avail_in,N=A.hold,B=A.bits,A.mode===12&&(A.back=-1);break}for(A.back=0;ne=(te=A.lencode[N&(1<>>16&255,fe=65535&te,!((ie=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>me)])>>>16&255,fe=65535&te,!(me+(ie=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>>=me,B-=me,A.back+=me}if(N>>>=ie,B-=ie,A.back+=ie,A.length=fe,ne===0){A.mode=26;break}if(32&ne){A.back=-1,A.mode=12;break}if(64&ne){I.msg="invalid literal/length code",A.mode=30;break}A.extra=15&ne,A.mode=22;case 22:if(A.extra){for(J=A.extra;B>>=A.extra,B-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=23;case 23:for(;ne=(te=A.distcode[N&(1<>>16&255,fe=65535&te,!((ie=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>me)])>>>16&255,fe=65535&te,!(me+(ie=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>>=me,B-=me,A.back+=me}if(N>>>=ie,B-=ie,A.back+=ie,64&ne){I.msg="invalid distance code",A.mode=30;break}A.offset=fe,A.extra=15&ne,A.mode=24;case 24:if(A.extra){for(J=A.extra;B>>=A.extra,B-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){I.msg="invalid distance too far back",A.mode=30;break}A.mode=25;case 25:if(z===0)break e;if(Y=Q-z,A.offset>Y){if((Y=A.offset-Y)>A.whave&&A.sane){I.msg="invalid distance too far back",A.mode=30;break}Z=Y>A.wnext?(Y-=A.wnext,A.wsize-Y):A.wnext-Y,Y>A.length&&(Y=A.length),pe=A.window}else pe=$,Z=V-A.offset,Y=A.length;for(zE?(k=Z[pe+m[F]],B[H+m[F]]):(k=96,0),y=1<>V)+(b-=y)]=T<<24|k<<16|P|0,b!==0;);for(y=1<>=1;if(y!==0?(N&=y-1,N+=y):N=0,F++,--Q[I]==0){if(I===L)break;I=f[d+m[F]]}if($>>7)]}function H(te,ae){te.pending_buf[te.pending++]=255&ae,te.pending_buf[te.pending++]=ae>>>8&255}function Q(te,ae,we){te.bi_valid>v-we?(te.bi_buf|=ae<>v-te.bi_valid,te.bi_valid+=we-v):(te.bi_buf|=ae<>>=1,we<<=1,0<--ae;);return we>>>1}function pe(te,ae,we){var Pe,ee,oe=new Array(m+1),Se=0;for(Pe=1;Pe<=m;Pe++)oe[Pe]=Se=Se+we[Pe-1]<<1;for(ee=0;ee<=ae;ee++){var ye=te[2*ee+1];ye!==0&&(te[2*ee]=Z(oe[ye]++,ye))}}function ie(te){var ae;for(ae=0;ae>1;1<=we;we--)me(te,oe,we);for(ee=be;we=te.heap[1],te.heap[1]=te.heap[te.heap_len--],me(te,oe,1),Pe=te.heap[1],te.heap[--te.heap_max]=we,te.heap[--te.heap_max]=Pe,oe[2*ee]=oe[2*we]+oe[2*Pe],te.depth[ee]=(te.depth[we]>=te.depth[Pe]?te.depth[we]:te.depth[Pe])+1,oe[2*we+1]=oe[2*Pe+1]=ee,te.heap[1]=ee++,me(te,oe,1),2<=te.heap_len;);te.heap[--te.heap_max]=te.heap[1],(function(xe,re){var Ee,ke,je,De,ze,Je,mt=re.dyn_tree,Me=re.max_code,st=re.stat_desc.static_tree,Fe=re.stat_desc.has_stree,ht=re.stat_desc.extra_bits,gt=re.stat_desc.extra_base,St=re.stat_desc.max_length,on=0;for(De=0;De<=m;De++)xe.bl_count[De]=0;for(mt[2*xe.heap[xe.heap_max]+1]=0,Ee=xe.heap_max+1;Ee>=7;ee>>=1)if(1&ge&&ye.dyn_ltree[2*be]!==0)return s;if(ye.dyn_ltree[18]!==0||ye.dyn_ltree[20]!==0||ye.dyn_ltree[26]!==0)return a;for(be=32;be>>3,(oe=te.static_len+3+7>>>3)<=ee&&(ee=oe)):ee=oe=we+5,we+4<=ee&&ae!==-1?J(te,ae,we,Pe):te.strategy===4||oe===ee?(Q(te,2+(Pe?1:0),3),se(te,R,I)):(Q(te,4+(Pe?1:0),3),(function(ye,be,ge,xe){var re;for(Q(ye,be-257,5),Q(ye,ge-1,5),Q(ye,xe-4,4),re=0;re>>8&255,te.pending_buf[te.d_buf+2*te.last_lit+1]=255&ae,te.pending_buf[te.l_buf+te.last_lit]=255&we,te.last_lit++,ae===0?te.dyn_ltree[2*we]++:(te.matches++,ae--,te.dyn_ltree[2*(A[we]+f+1)]++,te.dyn_dtree[2*B(ae)]++),te.last_lit===te.lit_bufsize-1},i._tr_align=function(te){Q(te,2,3),Y(te,b,R),(function(ae){ae.bi_valid===16?(H(ae,ae.bi_buf),ae.bi_buf=0,ae.bi_valid=0):8<=ae.bi_valid&&(ae.pending_buf[ae.pending++]=255&ae.bi_buf,ae.bi_buf>>=8,ae.bi_valid-=8)})(te)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(o){(function(s,a){if(!s.setImmediate){var l,c,u,f,d=1,h={},p=!1,g=s.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(s);m=m&&m.setTimeout?m:s,l={}.toString.call(s.process)==="[object process]"?function(w){process.nextTick(function(){y(w)})}:(function(){if(s.postMessage&&!s.importScripts){var w=!0,S=s.onmessage;return s.onmessage=function(){w=!1},s.postMessage("","*"),s.onmessage=S,w}})()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",b,!1):s.attachEvent("onmessage",b),function(w){s.postMessage(f+w,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(w){y(w.data)},function(w){u.port2.postMessage(w)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(w){var S=g.createElement("script");S.onreadystatechange=function(){y(w),S.onreadystatechange=null,c.removeChild(S),S=null},c.appendChild(S)}):function(w){setTimeout(y,0,w)},m.setImmediate=function(w){typeof w!="function"&&(w=new Function(""+w));for(var S=new Array(arguments.length-1),_=0;_"u"?o===void 0?this:o:self)}).call(this,typeof Rs<"u"?Rs:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(W9)),W9.exports}var yFt=vFt();const bFt=Vn(yFt);var Rz={exports:{}},xFt=Rz.exports,iSe;function wFt(){return iSe||(iSe=1,(function(e,t){(function(n,r){r()})(xFt,function(){function n(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,f){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){l(d.response,u,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Rs=="object"&&Rs.global===Rs?Rs:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,f){var d=s.URL||s.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?r(c,u,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,f){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,f),u);else if(i(c))r(c,u,f);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,u,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,f);var h=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent);if((g||h&&p||a)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var b=m.result;b=g?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=b:location=b,d=null},m.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,y=v.createObjectURL(c);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(Rz)),Rz.exports}var LUe=wFt(),SFt={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},_Ft=Array.prototype.slice;function uj(e){var t=e.length;return t?t===1?[e[0]]:t===2?[e[0],e[1]]:t===3?[e[0],e[1],e[2]]:_Ft.call(e,0):[]}function CFt(e){var t={};for(var n in e)SFt[n]||(t[n]=e[n]);return t}function OFt(e){return typeof e=="function"&&e.isMemoized}function EFt(e,t){return e===t||e!==e&&t!==t}function oSe(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}var TFt=(function(){function e(t){this.keys=[],this.values=[],this.options=t;var n=typeof t.isMatchingKey=="function";n?this.getKeyIndex=this._getKeyIndexFromMatchingKey:t.maxSize>1?this.getKeyIndex=this._getKeyIndexForMany:this.getKeyIndex=this._getKeyIndexForSingle,this.canTransformKey=typeof t.transformKey=="function",this.shouldCloneArguments=this.canTransformKey||n,this.shouldUpdateOnAdd=typeof t.onCacheAdd=="function",this.shouldUpdateOnChange=typeof t.onCacheChange=="function",this.shouldUpdateOnHit=typeof t.onCacheHit=="function"}return Object.defineProperty(e.prototype,"size",{get:function(){return this.keys.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return{keys:uj(this.keys),size:this.size,values:uj(this.values)}},enumerable:!1,configurable:!0}),e.prototype._getKeyIndexFromMatchingKey=function(t){var n=this.options,r=n.isMatchingKey,i=n.maxSize,o=this.keys,s=o.length;if(!s)return-1;if(r(o[0],t))return 0;if(i>1){for(var a=1;a1){for(var l=0;l1){for(var s=0;s=l&&(i.length=o.length=l)},e.prototype.updateAsyncCache=function(t){var n=this,r=this.options,i=r.onCacheChange,o=r.onCacheHit,s=this.keys[0],a=this.values[0];this.values[0]=a.then(function(l){return n.shouldUpdateOnHit&&o(n,n.options,t),n.shouldUpdateOnChange&&i(n,n.options,t),l},function(l){var c=n.getKeyIndex(s);throw c!==-1&&(n.keys.splice(c,1),n.values.splice(c,1)),l})},e})();function TU(e,t){if(t===void 0&&(t={}),OFt(e))return TU(e.fn,oSe(e.options,t));if(typeof e!="function")throw new TypeError("You must pass a function to `memoize`.");var n=t.isEqual,r=n===void 0?EFt:n,i=t.isMatchingKey,o=t.isPromise,s=o===void 0?!1:o,a=t.maxSize,l=a===void 0?1:a,c=t.onCacheAdd,u=t.onCacheChange,f=t.onCacheHit,d=t.transformKey,h=oSe({isEqual:r,isMatchingKey:i,isPromise:s,maxSize:l,onCacheAdd:c,onCacheChange:u,onCacheHit:f,transformKey:d},CFt(t)),p=new TFt(h),g=p.keys,m=p.values,v=p.canTransformKey,y=p.shouldCloneArguments,b=p.shouldUpdateOnAdd,w=p.shouldUpdateOnChange,S=p.shouldUpdateOnHit,_=function(){var E=y?uj(arguments):arguments;v&&(E=d(E));var T=g.length?p.getKeyIndex(E):-1;if(T!==-1)S&&f(p,h,_),T&&(p.orderByLru(g[T],m[T],T),w&&u(p,h,_));else{var k=e.apply(this,arguments),P=y?E:uj(arguments);p.orderByLru(P,k,g.length),s&&p.updateAsyncCache(_),b&&c(p,h,_),w&&u(p,h,_)}return m[0]};return _.cache=p,_.fn=e,_.isMemoized=!0,_.options=h,_}const sSe=e=>{let t;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const d=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(h=>h(t,d))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,i,a);return a},PFt=(e=>e?sSe(e):sSe),kFt=e=>e;function MFt(e,t=kFt){const n=Te.useSyncExternalStore(e.subscribe,Te.useCallback(()=>t(e.getState()),[e,t]),Te.useCallback(()=>t(e.getInitialState()),[e,t]));return Te.useDebugValue(n),n}const aSe=e=>{const t=PFt(e),n=r=>MFt(t,r);return Object.assign(n,t),n},AFt=(e=>e?aSe(e):aSe);var RFt=Object.defineProperty,IFt=(e,t,n)=>t in e?RFt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DFt=(e,t,n)=>IFt(e,t+"",n);const bs=AFt(()=>({configuration:{},extensions:[],contributionsResult:{},contributionsRecord:{},lastCallbackInputValues:{}}));function Bp(e){return typeof e=="object"&&e!==null}function TD(e){return typeof e=="string"}function PU(e,t){t=KO(t);let n=e;for(const r of t)if(Bp(n))n=n[r];else return;return n}function tne(e,t,n){return FUe(e,KO(t),n)}function FUe(e,t,n){if(t.length===1){const r=t[0];if(Bp(e)){const i=e[r];if(n===i)return e;const o=Array.isArray(e)?[...e]:{...e};return o[r]=n,o}else if(e===void 0){const i=typeof r=="number"?[]:{};return i[r]=n,i}}else if(t.length>1&&Bp(e)){const r=t[0],i=e[r];if(Bp(i)||i===void 0){const o=FUe(i,t.slice(1),n);if(i!==o){const s=Array.isArray(e)?[...e]:{...e};return s[r]=o,s}}}return e}function KO(e){if(Array.isArray(e))return e;if(!e||e==="")return[];if(typeof e=="number")return[e];{const t=e.split(".");for(let n=0;ntypeof t=="number"?t.toString():t).join("."):typeof e=="number"?e.toString():""}function LFt(e,t){if(e===t)return!0;const n=KO(e),r=KO(t);return n.length===r.length&&n.every((i,o)=>i===r[o])}function FFt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const $Ft="http://localhost:8888",NFt="chartlets";async function Oce(e,...t){try{return{status:"ok",data:await e(...t)}}catch(n){return n instanceof Iz?{status:"failed",error:n.apiError}:{status:"failed",error:{message:`${n.message||n}`}}}}async function Ece(e,t,n){const r=await fetch(e,t),i=await r.json();if(typeof i=="object"){if(i.error)throw new Iz(i.error);if(!r.ok)throw new Iz({status:r.status,message:r.statusText});if(FFt(i,"result"))return n?n(i.result):i.result}throw new Iz({message:`unexpected response from ${e}`})}let Iz=class extends Error{constructor(t){super(t.message),DFt(this,"apiError"),this.apiError=t}};function Tce(e,t){const n=t?.serverUrl||$Ft,r=t?.endpointName||NFt;return`${n}/${r}/${e}`}function fj(e){return typeof e=="function"}function $Ue(e){return!!e.id&&!e.id.startsWith("@")}function NUe(e){return e.id==="@app"}function zUe(e){return e.id==="@container"}function M0(e){return Bp(e)&&TD(e.type)&&e.constructor.name==="Object"&&!e.$$typeof}function jUe(e){return M0(e)&&Array.isArray(e.children)}function Pce(e,t,n){return e.map(r=>zFt(r,t,n))}const nne={};function zFt(e,t,n){let r;const{id:i,property:o}=e;return $Ue(e)&&t.component?r=BUe(t.component,i,o):zUe(e)&&t.container?r=jFt(t.container,o):NUe(e)&&n&&(r=BFt(n,o)),(r===void 0||r===nne)&&(r=null),r}function BUe(e,t,n){if(e.id===t)return PU(e,n);if(jUe(e))for(let r=0;r{const o=e[n][r],s=YFt(o.container,i.filter(zUe)),a=qFt(o.component,i.filter($Ue));(s!==o.container||a!==o.component)&&(e={...e,[n]:UUe(e[n],r,{...o,container:s,component:a})})}),e}function qFt(e,t){let n=e;return n&&t.forEach(r=>{n=WUe(n,r)}),n}function WUe(e,t){if(M0(e)&&e.id===t.id){const n=KO(t.property),r=t.value;if(n.length===0)return M0(r)?r:e;const i=PU(e,n);if(n[n.length-1]==="children"&&!Array.isArray(r)&&r!==null&&r!==void 0)return tne(e,n,[r]);if(i!==r)return tne(e,n,r)}else if(jUe(e)){const n=e;let r=n;for(let i=0;i{n.stateChanges.forEach(r=>{NUe(r)&&t.set(Cce(r.property),r.value)})})}function YFt(e,t){return t.forEach(n=>{(!e||PU(e,n.property)!==n.value)&&(e=tne(e,n.property,n.value))}),e}function HUe(e){var t;const{configuration:n}=bs.getState(),r=(t=n.logging)==null?void 0:t.enabled,i=KFt();r&&console.info(`chartlets: invokeCallbacks (${i})-->`,e),UFt(e,n.api).then(o=>{o.data?(r&&console.info(`chartlets: invokeCallbacks <--(${i})`,o.data),VUe(o.data)):console.error("callback failed:",o.error,"for call requests:",e)})}let QFt=0;function KFt(){return QFt++}function ZFt(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;ns!==void 0);if(!(!o||!o.length))return HUe(o),o}function e$t(e,t,n){const{lastCallbackInputValues:r}=bs.getState();return e.map(i=>t$t(i,r,t,n))}const t$t=(e,t,n,r)=>{const i=e.contribPoint,o=e.contribIndex,s=e.callbackIndex,a=n[i][o],l=a.callbacks[s],c=Pce(l.inputs,a,r),u=`${i}-${o}-${s}`,f=t[u];if(!ZFt(f,c))return bs.setState({lastCallbackInputValues:{...t,[u]:c}}),{...e,inputValues:c}},n$t=TU(r$t);function r$t(e){const t=[];return Object.getOwnPropertyNames(e).forEach(n=>{const r=e[n];t.push(...i$t(n,r))}),t}const i$t=TU(o$t);function o$t(e,t){const n=[];return t.forEach((r,i)=>{n.push(...s$t(e,i,r.callbacks))}),n}const s$t=TU(a$t);function a$t(e,t,n){const r=[];return(n||[]).forEach((i,o)=>{(i.inputs||[]).forEach((s,a)=>{!s.noTrigger&&s.id==="@app"&&s.property&&r.push({contribPoint:e,contribIndex:t,callbackIndex:o,inputIndex:a,property:Cce(s.property)})})}),r}function l$t(e){const t=e.get("themeMode"),n=bs.getState().themeMode;(t==="dark"||t==="light"||t==="system")&&t!==n&&bs.setState({themeMode:t})}var c$t=Object.defineProperty,u$t=(e,t,n)=>t in e?c$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f$t=(e,t,n)=>u$t(e,t+"",n);let d$t=class{constructor(){f$t(this,"components",new Map)}register(t,n){const r=this.components.get(t);return this.components.set(t,n),()=>{typeof r=="function"?this.components.set(t,r):this.components.delete(t)}}lookup(t){return this.components.get(t)}clear(){this.components.clear()}get types(){return Array.from(this.components.keys())}};const GUe=new d$t;function qUe(e){const{type:t}=e,n=GUe.lookup(t);return typeof n=="function"?O.jsx(n,{...e}):null}function kU({nodes:e,onChange:t}){return!e||e.length===0?null:O.jsx(O.Fragment,{children:e.map((n,r)=>{if(M0(n)){const i=n.id||r;return O.jsx(qUe,{...n,onChange:t},i)}else{if(typeof n=="string")return n;n&&console.warn("chartlets: invalid child node encountered:",n)}})})}const h$t={Date:!0,RegExp:!0,String:!0,Number:!0};function XUe(e,t,n={cyclesFix:!0},r=[]){let i=[];const o=Array.isArray(e);for(const a in e){const l=e[a],c=o?+a:a;if(!(a in t)){i.push({type:"REMOVE",path:[c],oldValue:e[a]});continue}const u=t[a],f=typeof l=="object"&&typeof u=="object"&&Array.isArray(l)===Array.isArray(u);l&&u&&f&&!h$t[Object.getPrototypeOf(l)?.constructor?.name]&&(!n.cyclesFix||!r.includes(l))?i.push.apply(i,XUe(l,u,n,n.cyclesFix?r.concat([l]):[]).map(d=>(d.path.unshift(c),d))):l!==u&&!(Number.isNaN(l)&&Number.isNaN(u))&&!(f&&(isNaN(l)?l+""==u+"":+l==+u))&&i.push({path:[c],type:"CHANGE",value:u,oldValue:l})}const s=Array.isArray(t);for(const a in t)a in e||i.push({type:"CREATE",path:[s?+a:a],value:t[a]});return i}function p$t(e,t,n){if(bs.getState().extensions.length===0)return;VUe([{contribPoint:e,contribIndex:t,stateChanges:[{id:n.id,property:n.property,value:n.value}]}]);const r=g$t(e,t,n);r&&r.length>0&&HUe(r)}function g$t(e,t,n){const{configuration:r,contributionsRecord:i}=bs.getState(),{hostStore:o}=r,s=i[e][t],a=[];return(s.callbacks||[]).forEach((l,c)=>{if(l.inputs&&l.inputs.length){const u=l.inputs,f=u.findIndex(d=>!d.noTrigger&&d.id&&!d.id.startsWith("@")&&d.id===n.id&&LFt(d.property,n.property));f>=0&&a.push({contribPoint:e,contribIndex:t,callbackIndex:c,inputIndex:f,inputValues:Pce(u,s,o)})}}),a}const m$t=e=>e.contributionsRecord,v$t=e=>e.themeMode,YUe=bs,QUe=()=>YUe(m$t),y$t=()=>YUe(v$t);function KUe(e,t){const n={};return Object.getOwnPropertyNames(e).forEach(r=>{n[r]=t(e[r],r)}),n}async function b$t(e){return Oce(x$t,e)}async function x$t(e){return Ece(Tce("contributions",e),void 0,w$t)}function w$t(e){return{...e,contributions:KUe(e.contributions,t=>t.map(n=>({...n,layout:n.layout?ZUe(n.layout):void 0,callbacks:S$t(n.callbacks)})))}}function S$t(e){return e?e.map(ZUe):[]}function ZUe(e){return{...e,inputs:e.inputs?lSe(e.inputs):[],outputs:e.outputs?lSe(e.outputs):[]}}function lSe(e){return e?e.map(_$t):[]}function _$t(e){return{...e,property:KO(e.property)}}function C$t(e){return!!e&&typeof e=="object"&&typeof e.then=="function"}const H9="color:light-dark(lightblue, lightblue)",G9="font-weight:bold",q9="color:light-dark(darkgrey, lightgray)";let Q$;function O$t(e){Q$&&(Q$(),Q$=void 0),(!e||e.enabled)&&(Q$=bs.subscribe(E$t))}function E$t(e,t){const n=XUe(t,e),r=n.length;console.groupCollapsed(`chartlets: state changed (${r} difference${r===1?"":"s"})`),n.forEach(T$t),console.debug("chartlets: change details:",{prev:t,next:e,delta:n}),console.groupEnd()}function T$t(e,t){const n=`%c${t+1} %c${e.type} %c${e.path.join(".")}`;e.type==="CREATE"?console.debug("chartlets:",n,H9,G9,q9,{value:e.value}):e.type==="CHANGE"?console.debug("chartlets:",n,H9,G9,q9,{value:e.value,oldValue:e.oldValue}):e.type==="REMOVE"&&console.debug("chartlets:",n,H9,G9,q9,{oldValue:e.oldValue})}function P$t(e){e=e||{},e.logging&&O$t(e.logging),e.hostStore&&e.hostStore.subscribe(JFt),bs.setState({configuration:{...e}}),e.plugins&&e.plugins.forEach(rne)}function rne(e){return C$t(e)?e.then(rne):fj(e)?rne(e()):Bp(e)&&e.components?(e.components.forEach(([t,n])=>{GUe.register(t,n)}),Promise.resolve(e)):Promise.resolve(void 0)}function k$t(e){e&&P$t(e);const{configuration:t}=bs.getState();bs.setState({contributionsResult:{status:"pending"}}),b$t(t.api).then(M$t)}function M$t(e){let t={contributionsResult:e};if(e.data){const{extensions:n,contributions:r}=e.data;t={...t,extensions:n,contributionsRecord:KUe(r,i=>i.map(A$t))}}bs.setState(t)}function A$t(e){return{...e,container:{...e.initialState},componentResult:{}}}async function R$t(e,t,n,r){return Oce(I$t,e,t,n,r)}async function I$t(e,t,n,r){return Ece(Tce(`layout/${e}/${t}`,r),{body:JSON.stringify({inputValues:n}),method:"post"})}function D$t(e,t,n,r=!0){const{configuration:i,contributionsRecord:o}=bs.getState(),s=o[e][t];if(s.container===n)return;const a=!!s.componentResult.status;if(!r||a)X9(e,t,{container:n});else if(!a){X9(e,t,{container:n,componentResult:{status:"pending"}});const l=L$t(e,t);R$t(e,t,l,i.api).then(c=>{X9(e,t,{componentResult:c,component:c.data})})}}function L$t(e,t){const{configuration:n,contributionsRecord:r}=bs.getState(),{hostStore:i}=n,o=r[e][t],s=o.layout.inputs;return s&&s.length>0?Pce(s,o,i):[]}function X9(e,t,n){const{contributionsRecord:r}=bs.getState(),i=r[e],o=i[t],s=n.container?{...n,container:{...o.container,...n.container}}:n;bs.setState({contributionsRecord:{...r,[e]:UUe(i,t,s)}})}const JUe=M.createContext(void 0);function Kn(){const e=M.useContext(JUe);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` -`));return e}const eVe=M.createContext(void 0),tn=()=>{const e=M.useContext(eVe);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},F$t=parseInt(M.version,10),Er=e=>{if(F$t>=19){const t=n=>e(n,n.ref??null);return t.displayName=e.displayName??e.name,t}return M.forwardRef(e)};var dj=Symbol("NOT_FOUND");function $$t(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function N$t(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function z$t(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var cSe=e=>Array.isArray(e)?e:[e];function j$t(e){const t=Array.isArray(e[0])?e[0]:e;return z$t(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function B$t(e,t){const n=[],{length:r}=e;for(let i=0;it(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return dj}function i(a,l){r(a)===dj&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var W$t=(e,t)=>e===t;function H$t(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let o=0;oo(h.value,u));d&&(u=d.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var G$t=class{constructor(e){this.value=e}deref(){return this.value}},q$t=typeof WeakRef<"u"?WeakRef:G$t,X$t=0,uSe=1;function K$(){return{s:X$t,v:void 0,o:null,p:null}}function nVe(e,t={}){let n=K$();const{resultEqualityCheck:r}=t;let i,o=0;function s(){let a=n;const{length:l}=arguments;for(let f=0,d=l;f{n=K$(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function rVe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,s=0,a,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),$$t(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:f,memoizeOptions:d=[],argsMemoize:h=nVe,argsMemoizeOptions:p=[]}=u,g=cSe(d),m=cSe(p),v=j$t(i),y=f(function(){return o++,c.apply(null,arguments)},...g),b=h(function(){s++;const S=B$t(v,arguments);return a=y.apply(null,S),a},...m);return Object.assign(b,{resultFunc:c,memoizedResultFunc:y,dependencies:v,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var iVe=rVe(nVe),Y$t=Object.assign((e,t=iVe)=>{N$t(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((s,a,l)=>(s[n[l]]=a,s),{}))},{withTypes:()=>Y$t});const Q$t=Object.is;function oVe(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const i in e)if(n+=1,!Q$t(e[i],t[i])||!(i in t))return!1;for(const i in t)r+=1;return n===r}var Y9={exports:{}},Q9={};var fSe;function K$t(){if(fSe)return Q9;fSe=1;var e=hg();function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(f,d){var h=d(),p=r({inst:{value:h,getSnapshot:d}}),g=p[0].inst,m=p[1];return o(function(){g.value=h,g.getSnapshot=d,l(g)&&m({inst:g})},[f,h,d]),i(function(){return l(g)&&m({inst:g}),f(function(){l(g)&&m({inst:g})})},[f]),s(h),h}function l(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function c(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Q9.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Q9}var dSe;function Z$t(){return dSe||(dSe=1,Y9.exports=K$t()),Y9.exports}var kce=Z$t();function sVe(e){return e.acceptsApiRef}function hSe(e,t){return sVe(t)?t(e):t(e.current.state)}function K9(e,t,n,r){return sVe(t)?t(e,n):t(e.current.state,r)}const aVe=Object.is,Mce=oVe,J$t=(e,t)=>e===t?!0:e.length===t.length&&e.every((n,r)=>n===t[r]),eNt=(e,t)=>{let n=Object.is;return t instanceof Array?n=J$t:t instanceof Object&&(n=Mce),n(e,t)},lVe=()=>({state:null,equals:null,selector:null,args:void 0}),hj=[],cVe=()=>null,ut=(e,t,n=aVe)=>{const r=ad(lVe),i=r.current.selector!==null,[o,s]=M.useState(i?null:hSe(e,t));r.current.state=o,r.current.equals=n,r.current.selector=t;const a=M.useCallback(()=>(r.current.subscription||(r.current.subscription=e.current.store.subscribe(()=>{const c=hSe(e,r.current.selector);r.current.equals(r.current.state,c)||(r.current.state=c,s(c))})),null),hj),l=M.useCallback(()=>()=>{r.current.subscription&&(r.current.subscription(),r.current.subscription=void 0)},hj);return kce.useSyncExternalStore(l,a,cVe),o},ZA=(e,t,n=void 0,r=aVe)=>{const i=ad(lVe),o=i.current.selector!==null,[s,a]=M.useState(o?null:K9(e,t,n,e.current.instanceId));i.current.state=s,i.current.equals=r,i.current.selector=t;const l=i.current.args;if(i.current.args=n,o&&!eNt(l,n)){const f=K9(e,i.current.selector,i.current.args,e.current.instanceId);i.current.equals(i.current.state,f)||(i.current.state=f,a(f))}const c=M.useCallback(()=>(i.current.subscription||(i.current.subscription=e.current.store.subscribe(()=>{const f=K9(e,i.current.selector,i.current.args,e.current.instanceId);i.current.equals(i.current.state,f)||(i.current.state=f,a(f))})),null),hj),u=M.useCallback(()=>()=>{i.current.subscription&&(i.current.subscription(),i.current.subscription=void 0)},hj);return kce.useSyncExternalStore(u,c,cVe),s},tNt=rVe({memoize:tVe,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),pSe=new WeakMap;function Qd(e){return"current"in e&&"instanceId"in e.current}const Kd={id:"default"},xn=(e,t,n,r,i,o,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&r&&i&&o)a=(l,c)=>{const u=Qd(l),f=c??(u?l.current.instanceId:Kd),d=u?l.current.state:l,h=e(d,f),p=t(d,f),g=n(d,f),m=r(d,f),v=i(d,f);return o(h,p,g,m,v)};else if(e&&t&&n&&r&&i)a=(l,c)=>{const u=Qd(l),f=c??(u?l.current.instanceId:Kd),d=u?l.current.state:l,h=e(d,f),p=t(d,f),g=n(d,f),m=r(d,f);return i(h,p,g,m)};else if(e&&t&&n&&r)a=(l,c)=>{const u=Qd(l),f=c??(u?l.current.instanceId:Kd),d=u?l.current.state:l,h=e(d,f),p=t(d,f),g=n(d,f);return r(h,p,g)};else if(e&&t&&n)a=(l,c)=>{const u=Qd(l),f=c??(u?l.current.instanceId:Kd),d=u?l.current.state:l,h=e(d,f),p=t(d,f);return n(h,p)};else if(e&&t)a=(l,c)=>{const u=Qd(l),f=c??(u?l.current.instanceId:Kd),d=u?l.current.state:l,h=e(d,f);return t(h)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},PD=(e,t,n,r,i,o,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&r&&i&&o)a=(l,c,u)=>{const f=Qd(l),d=u??(f?l.current.instanceId:Kd),h=f?l.current.state:l,p=e(h,c,d),g=t(h,c,d),m=n(h,c,d),v=r(h,c,d),y=i(h,c,d);return o(p,g,m,v,y,c)};else if(e&&t&&n&&r&&i)a=(l,c,u)=>{const f=Qd(l),d=u??(f?l.current.instanceId:Kd),h=f?l.current.state:l,p=e(h,c,d),g=t(h,c,d),m=n(h,c,d),v=r(h,c,d);return i(p,g,m,v,c)};else if(e&&t&&n&&r)a=(l,c,u)=>{const f=Qd(l),d=u??(f?l.current.instanceId:Kd),h=f?l.current.state:l,p=e(h,c,d),g=t(h,c,d),m=n(h,c,d);return r(p,g,m,c)};else if(e&&t&&n)a=(l,c,u)=>{const f=Qd(l),d=u??(f?l.current.instanceId:Kd),h=f?l.current.state:l,p=e(h,c,d),g=t(h,c,d);return n(p,g,c)};else if(e&&t)a=(l,c,u)=>{const f=Qd(l),d=u??(f?l.current.instanceId:Kd),h=f?l.current.state:l,p=e(h,c,d);return t(p,c)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},zr=(...e)=>{const t=(n,r)=>{const i=Qd(n),o=i?n.current.instanceId:r??Kd,s=i?n.current.state:n,a=pSe.get(o),l=a??new Map,c=l?.get(e);if(l&&c)return c(s,o);const u=tNt(...e);return a||pSe.set(o,l),l.set(e,u),u(s,o)};return t.acceptsApiRef=!0,t},Is=e=>e.dimensions,MU=xn(Is,e=>e.columnsTotalWidth),Ace=e=>e.dimensions.rowHeight,nNt=e=>e.dimensions.contentSize.height,rNt=e=>e.dimensions.hasScrollX,iNt=e=>e.dimensions.hasScrollY,uVe=e=>e.dimensions.columnsTotalWidthe.dimensions.headerHeight,sNt=e=>e.dimensions.groupHeaderHeight,fVe=e=>e.dimensions.hasScrollY?e.dimensions.scrollbarSize:0,aNt=e=>{const t=e.dimensions.hasScrollX?e.dimensions.scrollbarSize:0,n=e.dimensions.viewportOuterSize.height-e.dimensions.minimumSize.height>0;return!(t===0&&!n)};function Pv(e){return M.memo(e,oVe)}const lNt={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",columnsManagementDeleteIconLabel:"Clear",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuAriaLabel:e=>`${e} column menu`,columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"};function hr(e){return pt("MuiDataGrid",e)}const ve=dt("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","autosizing","booleanCell","cell--editable","cell--editing","cell--flex","cell--textCenter","cell--textLeft","cell--textRight","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--pinnedLeft","cell--pinnedRight","cell--selectionMode","cell","cellCheckbox","cellEmpty","cellSkeleton","cellOffsetLeft","checkboxInput","columnHeader","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader--pinnedLeft","columnHeader--pinnedRight","columnHeader--last","columnHeader--lastUnpinned","columnHeader--siblingFocused","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","container--top","container--bottom","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filler","filler--borderBottom","filler--pinnedLeft","filler--pinnedRight","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","main--hasPinnedRight","main--hasSkeletonLoadingOverlay","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","root--noToolbar","row","row--editable","row--editing","row--firstVisible","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea--up","scrollArea--down","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--header","scrollbarFiller--borderTop","scrollbarFiller--borderBottom","scrollbarFiller--pinnedRight","selectedRowCount","sortButton","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),gSe=1e3;class cNt{constructor(t=gSe){this.timeouts=new Map,this.cleanupTimeout=gSe,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const i=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,i)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class uNt{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}var Lf=(function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e})(Lf||{});class fNt{}function dNt(e){let t=0;return function(r,i,o,s){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new uNt:new cNt);const[a]=M.useState(new fNt),l=M.useRef(null),c=M.useRef(null);c.current=o;const u=M.useRef(null);if(!l.current&&c.current){const f=(d,h,p)=>{h&&!h.defaultMuiPrevented&&c.current?.(d,h,p)};l.current=r.current.subscribeEvent(i,f,s),t+=1,u.current={cleanupToken:t},e.registry.register(a,()=>{l.current?.(),l.current=null,u.current=null},u.current)}else!c.current&&l.current&&(l.current(),l.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));M.useEffect(()=>{if(!l.current&&c.current){const f=(d,h,p)=>{h&&!h.defaultMuiPrevented&&c.current?.(d,h,p)};l.current=r.current.subscribeEvent(i,f,s)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{l.current?.(),l.current=null}},[r,i,s])}}const hNt={registry:null},Ft=dNt(hNt),pNt={isFirst:!0};function ii(e,t,n){Ft(e,t,n,pNt)}const gNt=.7,mNt=1.3,vNt={compact:gNt,comfortable:mNt,standard:1},NC=e=>e.density,LT=xn(NC,e=>vNt[e]),yNt=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],bNt=e=>{const{classes:t}=e;return Xe({root:["editInputCell"]},hr,t)},xNt=Oe(wT,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>X({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),wNt=Er((e,t)=>{const n=tn(),{id:r,value:i,field:o,colDef:s,hasFocus:a,debounceMs:l=200,isProcessingProps:c,onValueChange:u}=e,f=it(e,yNt),d=Kn(),h=M.useRef(null),[p,g]=M.useState(i),m=bNt(n),v=M.useCallback(async b=>{const w=b.target.value;u&&await u(b,w);const S=d.current.getColumn(o);let _=w;S.valueParser&&(_=S.valueParser(w,d.current.getRow(r),S,d)),g(_),d.current.setEditCellValue({id:r,field:o,value:_,debounceMs:l,unstable_skipValueParser:!0},b)},[d,l,o,r,u]),y=d.current.unstable_getEditCellMeta(r,o);return M.useEffect(()=>{y?.changeReason!=="debouncedSetEditCellValue"&&g(i)},[y,i]),ar(()=>{a&&h.current.focus()},[a]),O.jsx(xNt,X({inputRef:h,className:m.root,ownerState:n,fullWidth:!0,type:s.type==="number"?s.type:"text",value:p??"",onChange:v,endAdornment:c?O.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},f,{ref:t}))}),SNt=e=>O.jsx(wNt,X({},e)),cd=e=>e.rows,kD=xn(cd,e=>e.totalRowCount),_Nt=xn(cd,e=>e.loading),CNt=xn(cd,e=>e.totalTopLevelRowCount),Cf=xn(cd,e=>e.dataRowIdToModelLookup),mSe=xn(cd,e=>e.dataRowIdToIdLookup),ds=xn(cd,e=>e.tree),ONt=xn(cd,e=>e.groupsToFetch),ENt=xn(cd,e=>e.groupingName),vSe=xn(cd,e=>e.treeDepths),mS=zr(cd,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:(t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,r)=>r-n)[0]??0)+1}),eM=xn(cd,e=>e.dataRowIds),TNt=xn(cd,e=>e?.additionalRowGroups),FT=zr(TNt,e=>{const t=e?.pinnedRows;return{bottom:t?.bottom?.map(n=>({id:n.id,model:n.model??{}}))??[],top:t?.top?.map(n=>({id:n.id,model:n.model??{}}))??[]}}),dVe=xn(FT,e=>(e?.top?.length||0)+(e?.bottom?.length||0)),hVe=(e,t)=>t&&e.length>1?[e[0]]:e,ySe=(e,t)=>n=>X({},n,{sorting:X({},n.sorting,{sortModel:hVe(e,t)})}),PNt=e=>e==="desc",kNt=(e,t)=>{const n=t.current.getColumn(e.field);if(!n||e.sort===null)return null;let r;return n.getSortComparator?r=n.getSortComparator(e.sort):r=PNt(e.sort)?(...o)=>-1*n.sortComparator(...o):n.sortComparator,r?{getSortCellParams:o=>({id:o,field:n.field,rowNode:ds(t)[o],value:t.current.getCellValue(o,n.field),api:t.current}),comparator:r}:null},MNt=(e,t,n)=>e.reduce((r,i,o)=>{if(r!==0)return r;const s=t.params[o],a=n.params[o];return r=i.comparator(s.value,a.value,s,a),r},0),ANt=(e,t)=>{const n=e.map(r=>kNt(r,t)).filter(r=>!!r);return n.length===0?null:r=>r.map(i=>({node:i,params:n.map(o=>o.getSortCellParams(i.id))})).sort((i,o)=>MNt(n,i,o)).map(i=>i.node.id)},bSe=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},Rce=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,RNt=new Intl.Collator,INt=(e,t)=>{const n=Rce(e,t);return n!==null?n:typeof e=="string"?RNt.compare(e.toString(),t.toString()):e-t},pVe=(e,t)=>{const n=Rce(e,t);return n!==null?n:Number(e)-Number(t)},gVe=(e,t)=>{const n=Rce(e,t);return n!==null?n:e>t?1:e{const S=Z9(w.target.value);p(S),m(!0),d.start(y.filterDebounceMs,()=>{const _=X({},t,{value:r==="number"&&!Number.isNaN(Number(S))?Number(S):S,fromInput:v});n(_),m(!1)})},[d,y.filterDebounceMs,t,r,v,n]);return M.useEffect(()=>{(t.fromInput!==v||t.value==null)&&p(Z9(t.value))},[v,t]),O.jsx(y.slots.baseTextField,X({id:v,label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),value:h??"",onChange:b,variant:u,type:r||"text",InputProps:X({},g||l?{endAdornment:g?O.jsx(y.slots.loadIcon,{fontSize:"small",color:"action"}):l}:{},{disabled:a},c,{inputProps:X({tabIndex:s},c?.inputProps)}),InputLabelProps:{shrink:!0},inputRef:o},f,y.slotProps?.baseTextField))}function Z9(e){if(!(e==null||e===""))return String(e)}function LNt(e){return typeof e=="number"&&!Number.isNaN(e)}function FNt(e){return typeof e=="function"}function Ice(e){return typeof e=="object"&&e!==null}function $Nt(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}function pj(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const Mu=(e,t,n)=>Math.max(t,Math.min(n,e));function xSe(e,t){return Array.from({length:t-e}).map((n,r)=>e+r)}function A0(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const i=e.length;if(i!==t.length)return!1;for(let o=0;o{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function zNt(e){const t=NNt(e);return(n,r)=>n+(r-n)*t()}function mVe(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const e1=(e,t)=>n=>{e&&t(n)},jNt=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],BNt=["key"];function vVe(e){const{item:t,applyValue:n,type:r,apiRef:i,focusElementRef:o,color:s,error:a,helperText:l,size:c,variant:u="standard"}=e,f=it(e,jNt),d={color:s,error:a,helperText:l,size:c,variant:u},[h,p]=M.useState(t.value||[]),g=ur(),m=tn();M.useEffect(()=>{const y=t.value??[];p(y.map(String))},[t.value]);const v=M.useCallback((y,b)=>{p(b.map(String)),n(X({},t,{value:[...b.map(w=>r==="number"?Number(w):w)]}))},[n,t,r]);return O.jsx(Gje,X({multiple:!0,freeSolo:!0,options:[],filterOptions:(y,b)=>{const{inputValue:w}=b;return w==null||w===""?[]:[w]},id:g,value:h,onChange:v,renderTags:(y,b)=>y.map((w,S)=>{const _=b({index:S}),{key:E}=_,T=it(_,BNt);return O.jsx(m.slots.baseChip,X({variant:"outlined",size:"small",label:w},T),E)}),renderInput:y=>O.jsx(m.slots.baseTextField,X({},y,{label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:X({},y.InputLabelProps,{shrink:!0}),inputRef:o,type:r||"text"},d,m.slotProps?.baseTextField))},f))}var eg=(function(e){return e.Cell="cell",e.Row="row",e})(eg||{}),ni=(function(e){return e.Edit="edit",e.View="view",e})(ni||{}),qi=(function(e){return e.Edit="edit",e.View="view",e})(qi||{}),Dl=(function(e){return e.And="and",e.Or="or",e})(Dl||{}),cm=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e})(cm||{}),Nd=(function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(Nd||{}),Dy=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e})(Dy||{}),Zh=(function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(Zh||{});function yVe(e){return e.field!==void 0}const bVe={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},JA=()=>({items:[],logicOperator:Dl.And,quickFilterValues:[],quickFilterLogicOperator:Dl.And});function xVe(e){return{current:e.current.getPublicApi()}}let qy=(function(e){return e.LEFT="left",e.RIGHT="right",e})({});const gj={left:[],right:[]},wVe=e=>e.isRtl,Up=e=>e.columns,Gm=xn(Up,e=>e.orderedFields),kv=xn(Up,e=>e.lookup),Ff=zr(Gm,kv,(e,t)=>e.map(n=>t[n])),Of=xn(Up,e=>e.columnVisibilityModel),Mo=zr(Ff,Of,(e,t)=>e.filter(n=>t[n.field]!==!1)),$T=zr(Mo,e=>e.map(t=>t.field)),SVe=e=>e.pinnedColumns;zr(SVe,Gm,wVe,(e,t,n)=>_Ve(e,t,n));const NT=zr(Up,SVe,$T,wVe,(e,t,n,r)=>{const i=_Ve(t,n,r);return{left:i.left.map(s=>e.lookup[s]),right:i.right.map(s=>e.lookup[s])}});function _Ve(e,t,n){if(!Array.isArray(e.left)&&!Array.isArray(e.right)||e.left?.length===0&&e.right?.length===0)return gj;const r=(a,l)=>Array.isArray(a)?a.filter(c=>l.includes(c)):[],i=r(e.left,t),o=t.filter(a=>!i.includes(a)),s=r(e.right,o);return n?{left:s,right:i}:{left:i,right:s}}const Pb=zr(Mo,e=>{const t=[];let n=0;for(let r=0;re.filter(t=>t.filterable)),UNt=zr(Ff,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),VNt=zr(Ff,e=>e.some(t=>t.colSpan!==void 0));let Lk;function WNt(){if(Lk!==void 0)return Lk;try{Lk=new Function("return true")()}catch{Lk=!1}return Lk}const ine=(e,t)=>{const n=X({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const r=kv(t)[n.field];n.operator=r&&r.filterOperators[0].value}return n},Dce=(e,t,n)=>{const r=e.items.length>1;let i;r&&t?i=[e.items[0]]:i=e.items;const o=r&&i.some(a=>a.id==null);return i.some(a=>a.operator==null)||o?X({},e,{items:i.map(a=>ine(a,n))}):e.items!==i?X({},e,{items:i}):e},wSe=(e,t,n)=>r=>X({},r,{filterModel:Dce(e,t,n)}),eR=e=>typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,OVe=(e,t)=>{if(!e.field||!e.operator)return null;const n=t.current.getColumn(e.field);if(!n)return null;let r;if(n.valueParser){const u=n.valueParser;r=Array.isArray(e.value)?e.value?.map(f=>u(f,void 0,n,t)):u(e.value,void 0,n,t)}else r=e.value;const{ignoreDiacritics:i}=t.current.rootProps;i&&(r=eR(r));const o=X({},e,{value:r}),s=n.filterOperators;if(!s?.length)throw new Error(`MUI X: No filter operators found for column '${n.field}'.`);const a=s.find(u=>u.value===o.operator);if(!a)throw new Error(`MUI X: No filter operator found for column '${n.field}' and operator value '${o.operator}'.`);const l=xVe(t),c=a.getApplyFilterFn(o,n);return typeof c!="function"?null:{item:o,fn:u=>{let f=t.current.getRowValue(u,n);return i&&(f=eR(f)),c(f,u,n,l)}}};let SSe=1;const HNt=(e,t,n)=>{const{items:r}=e,i=r.map(a=>OVe(a,t)).filter(a=>!!a);if(i.length===0)return null;if(n||!WNt())return(a,l)=>{const c={};for(let u=0;un;){if(r-n>600){var o=r-n+1,s=t-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),u=Math.max(n,Math.floor(t-s*l/o+c)),f=Math.min(r,Math.floor(t+(o-s)*l/o+c));jje(e,t,u,f,i)}var d=e[t],h=n,p=r;for(Sk(e,n,t),i(e[r],d)>0&&Sk(e,n,r);h0;)p--}i(e[n],d)===0?Sk(e,n,p):(p++,Sk(e,p,r)),p<=t&&(n=p+1),t<=p&&(r=p-1)}}function Sk(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function zTt(e,t){return et?1:0}let Bje=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!P$(t,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(t,n){const r=t[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const s=this._chooseSplitIndex(r,o,i),a=hC(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,d_(r,this.toBBox),d_(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=hC([t,n]),this.data.height=t.height+1,this.data.leaf=!1,d_(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const l=B2(t,0,a,this.toBBox),c=B2(t,a,r,this.toBBox),u=WTt(l,c),f=i9(l)+i9(c);u=n;c--){const u=t.children[c];U2(a,t.leaf?o(u):u),l+=T$(a)}return l}_adjustParentBBoxes(t,n,r){for(let i=r;i>=0;i--)U2(n[i],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():d_(t[n],this.toBBox)}};function jTt(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r=e.minX&&t.maxY>=e.minY}function hC(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S1e(e,t,n,r,i){const o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=r)continue;const s=t+Math.ceil((n-t)/r/2)*r;NTt(e,s,t,n,i),o.push(t,s,s,n)}}var HTt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),_1e={RENDER_ORDER:"renderOrder"},GTt=(function(e){HTt(t,e);function t(n){var r=this,i=n||{},o=bo({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,r=e.call(this,o)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return t.prototype.getDeclutter=function(){return this.declutter_},t.prototype.getFeatures=function(n){return e.prototype.getFeatures.call(this,n)},t.prototype.getRenderBuffer=function(){return this.renderBuffer_},t.prototype.getRenderOrder=function(){return this.get(_1e.RENDER_ORDER)},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},t.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},t.prototype.renderDeclutter=function(n){n.declutterTree||(n.declutterTree=new Bje(9)),this.getRenderer().renderDeclutter(n)},t.prototype.setRenderOrder=function(n){this.set(_1e.RENDER_ORDER,n)},t.prototype.setStyle=function(n){this.style_=n!==void 0?n:LTt,this.styleFunction_=n===null?void 0:DTt(this.style_),this.changed()},t})(X6),Pn={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},k$=[Pn.FILL],s0=[Pn.STROKE],a1=[Pn.BEGIN_PATH],C1e=[Pn.CLOSE_PATH],Uje=(function(){function e(){}return e.prototype.drawCustom=function(t,n,r,i){},e.prototype.drawGeometry=function(t){},e.prototype.setStyle=function(t){},e.prototype.drawCircle=function(t,n){},e.prototype.drawFeature=function(t,n){},e.prototype.drawGeometryCollection=function(t,n){},e.prototype.drawLineString=function(t,n){},e.prototype.drawMultiLineString=function(t,n){},e.prototype.drawMultiPoint=function(t,n){},e.prototype.drawMultiPolygon=function(t,n){},e.prototype.drawPoint=function(t,n){},e.prototype.drawPolygon=function(t,n){},e.prototype.drawText=function(t,n){},e.prototype.setFillStrokeStyle=function(t,n){},e.prototype.setImageStyle=function(t,n){},e.prototype.setTextStyle=function(t,n){},e})(),qTt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),oD=(function(e){qTt(t,e);function t(n,r,i,o){var s=e.call(this)||this;return s.tolerance=n,s.maxExtent=r,s.pixelRatio=o,s.maxLineWidth=0,s.resolution=i,s.beginGeometryInstruction1_=null,s.beginGeometryInstruction2_=null,s.bufferedMaxExtent_=null,s.instructions=[],s.coordinates=[],s.tmpCoordinate_=[],s.hitDetectionInstructions=[],s.state={},s}return t.prototype.applyPixelRatio=function(n){var r=this.pixelRatio;return r==1?n:n.map(function(i){return i*r})},t.prototype.appendFlatPointCoordinates=function(n,r){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,s=this.coordinates,a=s.length,l=0,c=n.length;ll&&(this.instructions.push([Pn.CUSTOM,l,u,n,i,o0]),this.hitDetectionInstructions.push([Pn.CUSTOM,l,u,n,o||i,o0]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([Pn.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([Pn.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},t.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[Pn.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Pn.BEGIN_GEOMETRY,r,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},t.prototype.reverseHitDetectionInstructions=function(){var n=this.hitDetectionInstructions;n.reverse();var r,i=n.length,o,s,a=-1;for(r=0;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},t.prototype.createFill=function(n){var r=n.fillStyle,i=[Pn.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},t.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},t.prototype.createStroke=function(n){return[Pn.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(n,r){var i=n.fillStyle;(typeof i!="string"||n.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,n)),n.currentFillStyle=i)},t.prototype.updateStrokeStyle=function(n,r){var i=n.strokeStyle,o=n.lineCap,s=n.lineDash,a=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||s!=n.currentLineDash&&!eS(n.currentLineDash,s)||n.currentLineDashOffset!=a||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=s,n.currentLineDashOffset=a,n.currentLineJoin=l,n.currentLineWidth=c,n.currentMiterLimit=u)},t.prototype.endGeometry=function(n){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[Pn.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=E5e(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;kA(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t})(Uje),XTt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),YTt=(function(e){XTt(t,e);function t(n,r,i,o){var s=e.call(this,n,r,i,o)||this;return s.hitDetectionImage_=null,s.image_=null,s.imagePixelRatio_=void 0,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s.declutterMode_=void 0,s.declutterImageWithText_=void 0,s}return t.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Pn.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Pn.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},t.prototype.drawMultiPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Pn.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Pn.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},t.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,e.prototype.finish.call(this)},t.prototype.setImageStyle=function(n,r){var i=n.getAnchor(),o=n.getSize(),s=n.getOrigin();this.imagePixelRatio_=n.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n.getHitDetectionImage(),this.image_=n.getImage(this.pixelRatio),this.height_=o[1],this.opacity_=n.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=n.getRotateWithView(),this.rotation_=n.getRotation(),this.scale_=n.getScaleArray(),this.width_=o[0],this.declutterMode_=n.getDeclutterMode(),this.declutterImageWithText_=r},t})(oD),QTt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),KTt=(function(e){QTt(t,e);function t(n,r,i,o){return e.call(this,n,r,i,o)||this}return t.prototype.drawFlatCoordinates_=function(n,r,i,o){var s=this.coordinates.length,a=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[Pn.MOVE_TO_LINE_TO,s,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},t.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Pn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,DA,LA],a1);var a=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(s0),this.endGeometry(r)}},t.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Pn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],a1);for(var a=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=a.length;fe&&(l>a&&(a=l,o=c,s=f),l=0,c=f-i)),d=h,m=y,v=b),p=w,g=S}return l+=h,l>a?[c,f]:[o,s]}var ePt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),FM={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},tPt=(function(e){ePt(t,e);function t(n,r,i,o){var s=e.call(this,n,r,i,o)||this;return s.labels_=null,s.text_="",s.textOffsetX_=0,s.textOffsetY_=0,s.textRotateWithView_=void 0,s.textRotation_=0,s.textFillState_=null,s.fillStates={},s.textStrokeState_=null,s.strokeStates={},s.textState_={},s.textStates={},s.textKey_="",s.fillKey_="",s.strokeKey_="",s.declutterImageWithText_=void 0,s}return t.prototype.finish=function(){var n=e.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},t.prototype.drawText=function(n,r){var i=this.textFillState_,o=this.textStrokeState_,s=this.textState_;if(!(this.text_===""||!s||!i&&!o)){var a=this.coordinates,l=a.length,c=n.getType(),u=null,f=n.getStride();if(s.placement===$Tt.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!Rl(this.getBufferedMaxExtent(),n.getExtent()))return;var d=void 0;if(u=n.getFlatCoordinates(),c=="LineString")d=[u.length];else if(c=="MultiLineString")d=n.getEnds();else if(c=="Polygon")d=n.getEnds().slice(0,1);else if(c=="MultiPolygon"){var h=n.getEndss();d=[];for(var p=0,g=h.length;pR[2]}else I=w>k;var F=Math.PI,A=[],L=_+r===t;t=_,m=0,v=E,d=e[t],h=e[t+1];var $;if(L){y(),$=Math.atan2(h-g,d-p),I&&($+=$>0?-F:F);var j=(k+w)/2,V=(P+S)/2;return A[0]=[j,V,(T-o)/2,$,i],A}i=i.replace(/\n/g," ");for(var U=0,z=i.length;U0?-F:F),$!==void 0){var B=N-$;if(B+=B>F?-2*F:B<-F?2*F:0,Math.abs(B)>s)return null}$=N;for(var H=U,Q=0;U0&&e.push(` +`,""),e.push(t,""),e}var sPt=(function(){function e(t,n,r,i){this.overlaps=r,this.pixelRatio=n,this.resolution=t,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=$p(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return e.prototype.createLabel=function(t,n,r,i){var o=t+n+r+i;if(this.labels_[o])return this.labels_[o];var s=i?this.strokeStates[i]:null,a=r?this.fillStates[r]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],f=Array.isArray(t),d=l.justify?FM[l.justify]:P1e(Array.isArray(t)?t[0]:t,l.textAlign||NA),h=i&&s.lineWidth?s.lineWidth:0,p=f?t:t.split(` +`).reduce(oPt,[]),g=kTt(l,p),m=g.width,v=g.height,y=g.widths,b=g.heights,w=g.lineWidths,S=m+h,_=[],E=(S+2)*u[0],T=(v+h)*u[1],k={width:E<0?Math.floor(E):Math.ceil(E),height:T<0?Math.floor(T):Math.ceil(T),contextInstructions:_};if((u[0]!=1||u[1]!=1)&&_.push("scale",u),i){_.push("strokeStyle",s.strokeStyle),_.push("lineWidth",h),_.push("lineCap",s.lineCap),_.push("lineJoin",s.lineJoin),_.push("miterLimit",s.miterLimit);var P=U6?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;P.prototype.setLineDash&&(_.push("setLineDash",[s.lineDash]),_.push("lineDashOffset",s.lineDashOffset))}r&&_.push("fillStyle",a.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");for(var I=.5-d,R=d*S+I*h,F=[],A=[],L=0,$=0,j=0,V=0,U,z=0,N=p.length;zt?t-c:o,w=s+u>n?n-u:s,S=p[3]+b*d[0]+p[1],_=p[0]+w*d[1]+p[2],E=v-p[3],T=y-p[0];(g||f!==0)&&(ly[0]=E,cy[0]=E,ly[1]=T,Wg[1]=T,Wg[0]=E+S,Hg[0]=Wg[0],Hg[1]=T+_,cy[1]=Hg[1]);var k;return f!==0?(k=av($p(),r,i,1,1,f,-r,-i),Ko(k,ly),Ko(k,Wg),Ko(k,Hg),Ko(k,cy),ph(Math.min(ly[0],Wg[0],Hg[0],cy[0]),Math.min(ly[1],Wg[1],Hg[1],cy[1]),Math.max(ly[0],Wg[0],Hg[0],cy[0]),Math.max(ly[1],Wg[1],Hg[1],cy[1]),h_)):ph(Math.min(E,E+S),Math.min(T,T+_),Math.max(E,E+S),Math.max(T,T+_),h_),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:b,drawImageH:w,originX:c,originY:u,declutterBox:{minX:h_[0],minY:h_[1],maxX:h_[2],maxY:h_[3],value:m},canvasTransform:k,scale:d}},e.prototype.replayImageOrLabel_=function(t,n,r,i,o,s,a){var l=!!(s||a),c=i.declutterBox,u=t.canvas,f=a?a[2]*i.scale[0]/2:0,d=c.minX-f<=u.width/n&&c.maxX+f>=0&&c.minY-f<=u.height/n&&c.maxY+f>=0;return d&&(l&&this.replayTextBackground_(t,ly,Wg,Hg,cy,s,a),MTt(t,i.canvasTransform,o,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},e.prototype.fill_=function(t){if(this.alignFill_){var n=Ko(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(n[0]%r,n[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},e.prototype.setStrokeStyle_=function(t,n){t.strokeStyle=n[1],t.lineWidth=n[2],t.lineCap=n[3],t.lineJoin=n[4],t.miterLimit=n[5],t.setLineDash&&(t.lineDashOffset=n[7],t.setLineDash(n[6]))},e.prototype.drawLabelWithPointPlacement_=function(t,n,r,i){var o=this.textStates[n],s=this.createLabel(t,n,i,r),a=this.strokeStates[r],l=this.pixelRatio,c=P1e(Array.isArray(t)?t[0]:t,o.textAlign||NA),u=FM[o.textBaseline||I5],f=a&&a.lineWidth?a.lineWidth:0,d=s.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*s.height/l+2*(.5-u)*f;return{label:s,anchorX:h,anchorY:p}},e.prototype.execute_=function(t,n,r,i,o,s,a,l){var c;this.pixelCoordinates_&&eS(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=E1(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),w_t(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,g,m,v,y,b,w,S,_,E,T,k=0,P=0,I=null,R=null,F=this.coordinateCache_,A=this.viewRotation_,L=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,$={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:A},j=this.instructions!=i||this.overlaps?0:200,V,U,z,N;uj&&(this.fill_(t),k=0),P>j&&(t.stroke(),P=0),!k&&!P&&(t.beginPath(),m=NaN,v=NaN),++u;break;case Pn.CIRCLE:d=B[1];var Q=c[d],Y=c[d+1],Z=c[d+2],ge=c[d+3],ne=Z-Q,ie=ge-Y,fe=Math.sqrt(ne*ne+ie*ie);t.moveTo(Q+fe,Y),t.arc(Q,Y,fe,0,2*Math.PI,!0),++u;break;case Pn.CLOSE_PATH:t.closePath(),++u;break;case Pn.CUSTOM:d=B[1],h=B[2];var ve=B[3],se=B[4],ue=B.length==6?B[5]:void 0;$.geometry=ve,$.feature=V,u in F||(F[u]=[]);var G=F[u];ue?ue(c,d,h,2,G):(G[0]=c[d],G[1]=c[d+1],G.length=2),se(G,$),++u;break;case Pn.DRAW_IMAGE:d=B[1],h=B[2],w=B[3],p=B[4],g=B[5];var ce=B[6],pe=B[7],J=B[8],te=B[9],ae=B[10],we=B[11],Pe=B[12],ee=B[13],re=B[14],Se=B[15];if(!w&&B.length>=20){S=B[19],_=B[20],E=B[21],T=B[22];var he=this.drawLabelWithPointPlacement_(S,_,E,T);w=he.label,B[3]=w;var xe=B[23];p=(he.anchorX-xe)*this.pixelRatio,B[4]=p;var me=B[24];g=(he.anchorY-me)*this.pixelRatio,B[5]=g,ce=w.height,B[6]=ce,ee=w.width,B[13]=ee}var be=void 0;B.length>25&&(be=B[25]);var oe=void 0,Ee=void 0,ke=void 0;B.length>17?(oe=B[16],Ee=B[17],ke=B[18]):(oe=s1,Ee=!1,ke=!1),ae&&L?we+=A:!ae&&!L&&(we-=A);for(var ze=0;d0){if(!s||h!=="Image"&&h!=="Text"||s.indexOf(_)!==-1){var I=(d[k]-3)/4,R=i-I%a,F=i-(I/a|0),A=o(_,E,R*R+F*F);if(A)return A}u.clearRect(0,0,a,a);break}}var g=Object.keys(this.executorsByZIndex_).map(Number);g.sort(J1);var m,v,y,b,w;for(m=g.length-1;m>=0;--m){var S=g[m].toString();for(y=this.executorsByZIndex_[S],v=s9.length-1;v>=0;--v)if(h=s9[v],b=y[h],b!==void 0&&(w=b.executeHitDetection(u,l,r,p,f),w))return w}},e.prototype.getClipCoords=function(t){var n=this.maxExtent_;if(!n)return null;var r=n[0],i=n[1],o=n[2],s=n[3],a=[r,i,r,s,o,s,o,i];return E1(a,0,8,2,t,a),a},e.prototype.isEmpty=function(){return zO(this.executorsByZIndex_)},e.prototype.execute=function(t,n,r,i,o,s,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(J1),this.maxExtent_&&(t.save(),this.clip(t,r));var c=s||s9,u,f,d,h,p,g;for(a&&l.reverse(),u=0,f=l.length;un)break;var a=r[s];a||(a=[],r[s]=a),a.push(((e+i)*t+(e+o))*4+3),i>0&&a.push(((e-i)*t+(e+o))*4+3),o>0&&(a.push(((e+i)*t+(e-o))*4+3),i>0&&a.push(((e-i)*t+(e-o))*4+3))}for(var l=[],i=0,c=r.length;ithis.maxCacheSize_},e.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var n in this.cache_){var r=this.cache_[n];(t++&3)===0&&!r.hasListener()&&(delete this.cache_[n],--this.cacheSize_)}}},e.prototype.get=function(t,n,r){var i=M1e(t,n,r);return i in this.cache_?this.cache_[i]:null},e.prototype.set=function(t,n,r,i){var o=M1e(t,n,r);this.cache_[o]=i,++this.cacheSize_},e.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},e})();function M1e(e,t,n){var r=n?xje(n):"null";return t+":"+e+":"+r}var L5=new uPt,fPt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),_k=null,dPt=(function(e){fPt(t,e);function t(n,r,i,o,s,a){var l=e.call(this)||this;return l.hitDetectionImage_=null,l.image_=n||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=a,l.unlisten_=null,l.imageState_=s,l.size_=i,l.src_=r,l.tainted_,l}return t.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===Ki.LOADED){_k||(_k=zu(1,1)),_k.drawImage(this.image_,0,0);try{_k.getImageData(0,0,1,1),this.tainted_=!1}catch{_k=null,this.tainted_=!0}}return this.tainted_===!0},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(qn.CHANGE)},t.prototype.handleImageError_=function(){this.imageState_=Ki.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=Ki.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(n){return this.replaceColor_(n),this.canvas_[n]?this.canvas_[n]:this.image_},t.prototype.getPixelRatio=function(n){return this.replaceColor_(n),this.canvas_[n]?n:1},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],r=this.size_[1],i=zu(n,r);i.fillRect(0,0,n,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==Ki.IDLE){this.imageState_=Ki.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Vae(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},t.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==Ki.LOADED)){var r=document.createElement("canvas");this.canvas_[n]=r,r.width=Math.ceil(this.image_.width*n),r.height=Math.ceil(this.image_.height*n);var i=r.getContext("2d");if(i.scale(n,n),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=xje(this.color_),i.fillRect(0,0,r.width/n,r.height/n),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,r.width,r.height),s=o.data,a=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=s.length;f0,6);var f=i.src!==void 0?Ki.IDLE:Ki.LOADED;return r.color_=i.color!==void 0?M5(i.color):null,r.iconImage_=hPt(c,u,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,f,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:tf.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return t.prototype.clone=function(){var n=this.getScale();return new t({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(n)?n.slice():n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getAnchor=function(){var n=this.normalizedAnchor_;if(!n){n=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==By.FRACTION||this.anchorYUnits_==By.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==By.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==By.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=tf.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==tf.TOP_RIGHT||this.anchorOrigin_==tf.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==tf.BOTTOM_LEFT||this.anchorOrigin_==tf.BOTTOM_RIGHT)&&(n[1]=-n[1]+r[1])}this.normalizedAnchor_=n}var i=this.getDisplacement();return[n[0]-i[0],n[1]+i[1]]},t.prototype.setAnchor=function(n){this.anchor_=n,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(n){return this.iconImage_.getImage(n)},t.prototype.getPixelRatio=function(n){return this.iconImage_.getPixelRatio(n)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var n=this.offset_;if(this.offsetOrigin_!=tf.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==tf.TOP_RIGHT||this.offsetOrigin_==tf.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==tf.BOTTOM_LEFT||this.offsetOrigin_==tf.BOTTOM_RIGHT)&&(n[1]=i[1]-r[1]-n[1])}return this.origin_=n,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(n){this.iconImage_.addEventListener(qn.CHANGE,n)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(qn.CHANGE,n)},t})(Fje),dp=.5;function mPt(e,t,n,r,i,o,s){var a=e[0]*dp,l=e[1]*dp,c=zu(a,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new cPt(c,dp,i,null,s),d=n.length,h=Math.floor((256*256*256-1)/d),p={},g=1;g<=d;++g){var m=n[g-1],v=m.getStyleFunction()||r;if(r){var y=v(m,o);if(y){Array.isArray(y)||(y=[y]);for(var b=g*h,w="#"+("000000"+b.toString(16)).slice(-6),S=0,_=y.length;S<_;++S){var E=y[S],T=E.getGeometryFunction()(m);if(!(!T||!Rl(i,T.getExtent()))){var k=E.clone(),P=k.getFill();P&&P.setColor(w);var I=k.getStroke();I&&(I.setColor(w),I.setLineDash(null)),k.setText(void 0);var R=E.getImage();if(R&&R.getOpacity()!==0){var F=R.getImageSize();if(!F)continue;var A=zu(F[0],F[1],void 0,{alpha:!1}),L=A.canvas;A.fillStyle=w,A.fillRect(0,0,L.width,L.height),k.setImage(new gPt({img:L,imgSize:F,anchor:R.getAnchor(),anchorXUnits:By.PIXELS,anchorYUnits:By.PIXELS,offset:R.getOrigin(),opacity:1,size:R.getSize(),scale:R.getScale(),rotation:R.getRotation(),rotateWithView:R.getRotateWithView()}))}var $=k.getZIndex()||0,j=p[$];j||(j={},p[$]=j,j.Polygon=[],j.Circle=[],j.LineString=[],j.Point=[]),j[T.getType().replace("Multi","")].push(T,k)}}}}}for(var V=Object.keys(p).map(Number).sort(J1),g=0,U=V.length;gg[2];)++y,b=v*y,f.push(this.getRenderTransform(o,s,a,dp,d,h,b).slice()),m-=v}this.hitDetectionImageData_=mPt(i,f,this.renderedFeatures_,u.getStyleFunction(),c,s,a)}r(vPt(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},t.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){var a=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(g,m,v){var y=oi(g),b=f[y];if(b){if(b!==!0&&vS[0]&&T[2]>S[2]&&w.push([T[0]-_,T[1],T[2]-_,T[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==m&&TC(this.wrappedRenderedExtent_,y))return eS(this.renderedExtent_,b)||(this.hitDetectionImageData_=null,this.renderedExtent_=b),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var k=new E1e(jee(d,h),y,d,h),P;this.getLayer().getDeclutter()&&(P=new E1e(jee(d,h),y,d,h));for(var I,R,F,R=0,F=w.length;R=200&&a.status<300){var c=t.getType(),u=void 0;c=="json"||c=="text"?u=a.responseText:c=="xml"?(u=a.responseXML,u||(u=new DOMParser().parseFromString(a.responseText,"application/xml"))):c=="arraybuffer"&&(u=a.response),u?o(t.readFeatures(u,{extent:n,featureProjection:i}),t.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function D1e(e,t){return function(n,r,i,o,s){var a=this;FPt(e,t,n,r,i,function(l,c){a.addFeatures(l),o!==void 0&&o(l)},s||ew)}}var Gje=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),uy=(function(e){Gje(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.feature=r,o.features=i,o}return t})(pg),sD=(function(e){Gje(t,e);function t(n){var r=this,i=n||{};r=e.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=ew,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(vr(r.format_,7),r.loader_=D1e(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:DPt;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new R1e:null,r.loadedExtentsRtree_=new R1e,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var s,a;return Array.isArray(i.features)?a=i.features:i.features&&(s=i.features,a=s.getArray()),!o&&s===void 0&&(s=new Sf(a)),a!==void 0&&r.addFeaturesInternal(a),s!==void 0&&r.bindFeaturesCollection_(s),r}return t.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},t.prototype.addFeatureInternal=function(n){var r=oi(n);if(!this.addToIndex_(r,n)){this.featuresCollection_&&this.featuresCollection_.remove(n);return}this.setupChangeEvents_(r,n);var i=n.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,n)}else this.nullGeometryFeatures_[r]=n;this.dispatchEvent(new uy(Sd.ADDFEATURE,n))},t.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[$r(r,qn.CHANGE,this.handleFeatureChange_,this),$r(r,NO.PROPERTYCHANGE,this.handleFeatureChange_,this)]},t.prototype.addToIndex_=function(n,r){var i=!0,o=r.getId();return o!==void 0&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=r),i&&(vr(!(n in this.uidIndex_),30),this.uidIndex_[n]=r),i},t.prototype.addFeatures=function(n){this.addFeaturesInternal(n),this.changed()},t.prototype.addFeaturesInternal=function(n){for(var r=[],i=[],o=[],s=0,a=n.length;s0},t.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),e.prototype.refresh.call(this)},t.prototype.removeLoadedExtent=function(n){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(n,function(o){if(MA(o.extent,n))return i=o,!0}),i&&r.remove(i)},t.prototype.removeFeature=function(n){if(n){var r=oi(n);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(n);var i=this.removeFeatureInternal(n);i&&this.changed()}},t.prototype.removeFeatureInternal=function(n){var r=oi(n),i=this.featureChangeKeys_[r];if(i){i.forEach(uo),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new uy(Sd.REMOVEFEATURE,n)),n}},t.prototype.removeFromIdIndex_=function(n){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i],r=!0;break}return r},t.prototype.setLoader=function(n){this.loader_=n},t.prototype.setUrl=function(n){vr(this.format_,7),this.url_=n,this.setLoader(D1e(n,this.format_))},t})(Hje);function fy(e,t){return Ko(e.inversePixelTransform,t.slice(0))}var $Pt=(function(){function e(t,n,r){this.decay_=t,this.minVelocity_=n,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return e.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},e.prototype.update=function(t,n){this.points_.push(t,n,Date.now())},e.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[r+2]>t;)r-=3;var i=this.points_[n+2]-this.points_[r+2];if(i<1e3/60)return!1;var o=this.points_[n]-this.points_[r],s=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(s,o),this.initialVelocity_=Math.sqrt(o*o+s*s)/i,this.initialVelocity_>this.minVelocity_},e.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},e.prototype.getAngle=function(){return this.angle_},e})(),NPt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zPt=(function(e){NPt(t,e);function t(n){var r=e.call(this)||this;return r.map_=n,r}return t.prototype.dispatchRenderEvent=function(n,r){vn()},t.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;av(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),vae(o,i)},t.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s,a,l,c){var u,f=r.viewState;function d(L,$,j,V){return s.call(a,$,L?j:null,V)}var h=f.projection,p=I5e(n.slice(),h),g=[[0,0]];if(h.canWrapX()&&o){var m=h.getExtent(),v=so(m);g.push([-v,0],[v,0])}for(var y=r.layerStatesArray,b=y.length,w=[],S=[],_=0;_=0;--E){var T=y[E],k=T.layer;if(k.hasRenderer()&&k5(T,f)&&l.call(c,k)){var P=k.getRenderer(),I=k.getSource();if(P&&I){var R=I.getWrapX()?p:n,F=d.bind(null,T.managed);S[0]=R[0]+g[_][0],S[1]=R[1]+g[_][1],u=P.forEachFeatureAtCoordinate(S,r,i,F,w)}if(u)return u}}if(w.length!==0){var A=1/w.length;return w.forEach(function(L,$){return L.distanceSq+=$*A}),w.sort(function(L,$){return L.distanceSq-$.distanceSq}),w.some(function(L){return u=L.callback(L.feature,L.layer,L.geometry)}),u}},t.prototype.forEachLayerAtPixel=function(n,r,i,o,s){return vn()},t.prototype.hasFeatureAtCoordinate=function(n,r,i,o,s,a){var l=this.forEachFeatureAtCoordinate(n,r,i,o,C1,this,s,a);return l!==void 0},t.prototype.getMap=function(){return this.map_},t.prototype.renderFrame=function(n){vn()},t.prototype.scheduleExpireIconCache=function(n){L5.canExpireCache()&&n.postRenderFunctions.push(jPt)},t})(gae);function jPt(e,t){L5.expire()}var BPt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),UPt=(function(e){BPt(t,e);function t(n){var r=e.call(this,n)||this;r.fontChangeListenerKey_=$r(om,NO.PROPERTYCHANGE,n.redrawText.bind(n)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=rD+" ol-layers";var o=n.getViewport();return o.insertBefore(r.element_,o.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return t.prototype.dispatchRenderEvent=function(n,r){var i=this.getMap();if(i.hasListener(n)){var o=new bje(n,void 0,r);i.dispatchEvent(o)}},t.prototype.disposeInternal=function(){uo(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),e.prototype.disposeInternal.call(this)},t.prototype.renderFrame=function(n){if(!n){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(n),this.dispatchRenderEvent(_0.PRECOMPOSE,n);var r=n.layerStatesArray.sort(function(h,p){return h.zIndex-p.zIndex}),i=n.viewState;this.children_.length=0;for(var o=[],s=null,a=0,l=r.length;a=0;--a)o[a].renderDeclutter(n);BEt(this.element_,this.children_),this.dispatchRenderEvent(_0.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},t.prototype.forEachLayerAtPixel=function(n,r,i,o,s){for(var a=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&k5(f,a)&&s(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var g=o(d,p);if(g)return g}}}},t})(zPt),qje=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Uy=(function(e){qje(t,e);function t(n,r){var i=e.call(this,n)||this;return i.layer=r,i}return t})(pg),l9={LAYERS:"layers"},K6=(function(e){qje(t,e);function t(n){var r=this,i=n||{},o=bo({},i);delete o.layers;var s=i.layers;return r=e.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(l9.LAYERS,r.handleLayersChanged_),s?Array.isArray(s)?s=new Sf(s.slice(),{unique:!0}):vr(typeof s.getArray=="function",43):s=new Sf(void 0,{unique:!0}),r.setLayers(s),r}return t.prototype.handleLayerChange_=function(){this.changed()},t.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(uo),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push($r(n,mc.ADD,this.handleLayersAdd_,this),$r(n,mc.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(uo);YI(this.listenerKeys_);for(var i=n.getArray(),o=0,s=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(uo(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(qn.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(uo(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(uo),this.dragListenerKeys_.length=0,this.element_=null,e.prototype.disposeInternal.call(this)},t})(gT);const ky={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ka={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var F5=1/0,qPt=(function(){function e(t,n){this.priorityFunction_=t,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return e.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,YI(this.queuedElements_)},e.prototype.dequeue=function(){var t=this.elements_,n=this.priorities_,r=t[0];t.length==1?(t.length=0,n.length=0):(t[0]=t.pop(),n[0]=n.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},e.prototype.enqueue=function(t){vr(!(this.keyFunction_(t)in this.queuedElements_),31);var n=this.priorityFunction_(t);return n!=F5?(this.elements_.push(t),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},e.prototype.getCount=function(){return this.elements_.length},e.prototype.getLeftChildIndex_=function(t){return t*2+1},e.prototype.getRightChildIndex_=function(t){return t*2+2},e.prototype.getParentIndex_=function(t){return t-1>>1},e.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},e.prototype.isEmpty=function(){return this.elements_.length===0},e.prototype.isKeyQueued=function(t){return t in this.queuedElements_},e.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},e.prototype.siftUp_=function(t){for(var n=this.elements_,r=this.priorities_,i=n.length,o=n[t],s=r[t],a=t;t>1;){var l=this.getLeftChildIndex_(t),c=this.getRightChildIndex_(t),u=ct;){var a=this.getParentIndex_(n);if(i[a]>s)r[n]=r[a],i[n]=i[a],n=a;else break}r[n]=o,i[n]=s},e.prototype.reprioritize=function(){var t=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,s,a,l;for(a=0;a0;)s=this.dequeue()[0],a=s.getKey(),o=s.getState(),o===$n.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,s.load())},t})(qPt);function QPt(e,t,n,r,i){if(!e||!(n in e.wantedTiles)||!e.wantedTiles[n][t.getKey()])return F5;var o=e.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}const _d={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var KPt=42,Xae=256;function L1e(e,t,n){return(function(r,i,o,s,a){if(r){if(!i&&!t)return r;var l=t?0:o[0]*i,c=t?0:o[1]*i,u=a?a[0]:0,f=a?a[1]:0,d=e[0]+l/2+u,h=e[2]-l/2+u,p=e[1]+c/2+f,g=e[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>g&&(p=(g+p)/2,g=p);var m=gs(r[0],d,h),v=gs(r[1],p,g);if(s&&n&&i){var y=30*i;m+=-y*Math.log(1+Math.max(0,d-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-h)/y),v+=-y*Math.log(1+Math.max(0,p-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-g)/y)}return[m,v]}})}function ZPt(e){return e}function Yae(e,t,n,r){var i=so(t)/n[0],o=Xf(t)/n[1];return r?Math.min(e,Math.max(i,o)):Math.min(e,Math.min(i,o))}function Qae(e,t,n){var r=Math.min(e,t),i=50;return r*=Math.log(1+i*Math.max(0,e/t-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/e-1))/i+1),gs(r,n/2,t*2)}function JPt(e,t,n,r){return(function(i,o,s,a){if(i!==void 0){var l=e[0],c=e[e.length-1],u=n?Yae(l,n,s,r):l;if(a){var f=t!==void 0?t:!0;return f?Qae(i,u,c):gs(i,c,u)}var d=Math.min(u,i),h=Math.floor(mae(e,d,o));return e[h]>u&&h1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var o=0;o0},t.prototype.getInteracting=function(){return this.hints_[il.INTERACTING]>0},t.prototype.cancelAnimations=function(){this.setHint(il.ANIMATING,-this.hints_[il.ANIMATING]);for(var n,r=0,i=this.animations_.length;r=0;--i){for(var o=this.animations_[i],s=!0,a=0,l=o.length;a0?u/c.duration:1;f>=1?(c.complete=!0,f=1):s=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],g=c.targetCenter[0],m=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(g-h),y=p+d*(m-p);this.targetCenter_=[v,y]}if(c.sourceResolution&&c.targetResolution){var b=d===1?c.targetResolution:c.sourceResolution+d*(c.targetResolution-c.sourceResolution);if(c.anchor){var w=this.getViewportSize_(this.getRotation()),S=this.constraints_.resolution(b,0,w,!0);this.targetCenter_=this.calculateCenterZoom(S,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=b,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var _=d===1?S0(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var E=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(E,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=_}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(s){this.animations_[i]=null,this.setHint(il.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var T=o[0].callback;T&&M$(T,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},t.prototype.calculateCenterRotate=function(n,r){var i,o=this.getCenterInternal();return o!==void 0&&(i=[o[0]-r[0],o[1]-r[1]],Cae(i,n-this.getRotation()),X_t(i,r)),i},t.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),s=this.getResolution();if(o!==void 0&&s!==void 0){var a=r[0]-n*(r[0]-o[0])/s,l=r[1]-n*(r[1]-o[1])/s;i=[a,l]}return i},t.prototype.getViewportSize_=function(n){var r=this.viewportSize_;if(n){var i=r[0],o=r[1];return[Math.abs(i*Math.cos(n))+Math.abs(o*Math.sin(n)),Math.abs(i*Math.sin(n))+Math.abs(o*Math.cos(n))]}else return r},t.prototype.setViewportSize=function(n){this.viewportSize_=Array.isArray(n)?n.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},t.prototype.getCenter=function(){var n=this.getCenterInternal();return n&&_ee(n,this.getProjection())},t.prototype.getCenterInternal=function(){return this.get(_d.CENTER)},t.prototype.getConstraints=function(){return this.constraints_},t.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},t.prototype.getHints=function(n){return n!==void 0?(n[0]=this.hints_[0],n[1]=this.hints_[1],n):this.hints_.slice()},t.prototype.calculateExtent=function(n){var r=this.calculateExtentInternal(n);return F5e(r,this.getProjection())},t.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();vr(i,1);var o=this.getResolution();vr(o!==void 0,2);var s=this.getRotation();return vr(s!==void 0,3),bee(i,o,s,r)},t.prototype.getMaxResolution=function(){return this.maxResolution_},t.prototype.getMinResolution=function(){return this.minResolution_},t.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},t.prototype.setMaxZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({maxZoom:n}))},t.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},t.prototype.setMinZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({minZoom:n}))},t.prototype.setConstrainResolution=function(n){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:n}))},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolution=function(){return this.get(_d.RESOLUTION)},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(i1(n,this.getProjection()),r)},t.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=so(n)/i[0],s=Xf(n)/i[1];return Math.max(o,s)},t.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/Math.log(r);return(function(a){var l=i/Math.pow(r,a*s);return l})},t.prototype.getRotation=function(){return this.get(_d.ROTATION)},t.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/r;return(function(a){var l=Math.log(i/a)/r/s;return l})},t.prototype.getViewportSizeMinusPadding_=function(n){var r=this.getViewportSize_(n),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},t.prototype.getState=function(){var n=this.getProjection(),r=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),s=this.padding_;if(s){var a=this.getViewportSizeMinusPadding_();o=u9(o,this.getViewportSize_(),[a[0]/2+s[3],a[1]/2+s[0]],r,i)}return{center:o.slice(0),projection:n!==void 0?n:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},t.prototype.getZoom=function(){var n,r=this.getResolution();return r!==void 0&&(n=this.getZoomForResolution(r)),n},t.prototype.getZoomForResolution=function(n){var r=this.minZoom_||0,i,o;if(this.resolutions_){var s=mae(this.resolutions_,n,1);r=s,i=this.resolutions_[s],s==this.resolutions_.length-1?o=2:o=i/this.resolutions_[s+1]}else i=this.maxResolution_,o=this.zoomFactor_;return r+Math.log(i/n)/Math.log(o)},t.prototype.getResolutionForZoom=function(n){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=gs(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,gs(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},t.prototype.fit=function(n,r){var i;if(vr(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){vr(!_ae(n),25);var o=i1(n,this.getProjection());i=Tee(o)}else if(n.getType()==="Circle"){var o=i1(n.getExtent(),this.getProjection());i=Tee(o),i.rotate(this.getRotation(),U0(o))}else{var s=iCt();s?i=n.clone().transform(s,this.getProjection()):i=n}this.fitInternal(i,r)},t.prototype.rotatedExtentForGeometry=function(n){for(var r=this.getRotation(),i=Math.cos(r),o=Math.sin(-r),s=n.getFlatCoordinates(),a=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=s.length;d=0;c--){var u=l[c];if(!(u.getMap()!==this||!u.getActive()||!this.getTargetElement())){var f=u.handleEvent(n);if(!f||n.propagationStopped)break}}}},t.prototype.handlePostRender=function(){var n=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,o=i;if(n){var s=n.viewHints;if(s[il.ANIMATING]||s[il.INTERACTING]){var a=Date.now()-n.time>8;i=a?0:8,o=a?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!eS(r,this.renderedAttributions_)){jEt(this.ulElement_);for(var o=0,s=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:wT}):r.setRotation(0))}},t.prototype.render=function(n){var r=n.frameState;if(r){var i=r.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var s=this.element.classList.contains(E$);!s&&i===0?this.element.classList.add(E$):s&&i!==0&&this.element.classList.remove(E$)}this.label_.style.transform=o}this.rotation_=i}},t})(Z6),mkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),vkt=(function(e){mkt(t,e);function t(n){var r=this,i=n||{};r=e.call(this,{element:document.createElement("div"),target:i.target})||this;var o=i.className!==void 0?i.className:"ol-zoom",s=i.delta!==void 0?i.delta:1,a=i.zoomInClassName!==void 0?i.zoomInClassName:o+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:o+"-out",c=i.zoomInLabel!==void 0?i.zoomInLabel:"+",u=i.zoomOutLabel!==void 0?i.zoomOutLabel:"–",f=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",d=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=a,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(qn.CLICK,r.handleClick_.bind(r,s),!1);var p=document.createElement("button");p.className=l,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(qn.CLICK,r.handleClick_.bind(r,-s),!1);var g=o+" "+rD+" "+qae,m=r.element;return m.className=g,m.appendChild(h),m.appendChild(p),r.duration_=i.duration!==void 0?i.duration:250,r}return t.prototype.handleClick_=function(n,r){r.preventDefault(),this.zoomByDelta_(n)},t.prototype.zoomByDelta_=function(n){var r=this.getMap(),i=r.getView();if(i){var o=i.getZoom();if(o!==void 0){var s=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:wT})):i.setZoom(s)}}},t})(Z6),ykt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),f9="units",cx={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},bkt=[1,2,5],Ck=25.4/.28,xkt=(function(e){ykt(t,e);function t(n){var r=this,i=n||{},o=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=e.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=o+"-inner",r.element.className=o+" "+rD,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.maxWidth_=i.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(f9,r.handleUnitsChanged_),r.setUnits(i.units||cx.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return t.prototype.getUnits=function(){return this.get(f9)},t.prototype.handleUnitsChanged_=function(){this.updateElement_()},t.prototype.setUnits=function(n){this.set(f9,n)},t.prototype.setDpi=function(n){this.dpi_=n},t.prototype.updateElement_=function(){var n=this.viewState_;if(!n){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=n.center,i=n.projection,o=this.getUnits(),s=o==cx.DEGREES?Zs.DEGREES:Zs.METERS,a=C5(i,n.resolution,r,s),l=this.minWidth_*(this.dpi_||Ck)/Ck,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||Ck)/Ck:void 0,u=l*a,f="";if(o==cx.DEGREES){var d=hh[Zs.DEGREES];u*=d,u=c){p=v,g=y,m=b;break}else if(g>=l)break;v=p,y=g,b=m,++h}var S;this.scaleBar_?S=this.createScaleBar(g,p,f):S=p.toFixed(m<0?-m:0)+" "+f,this.renderedHTML_!=S&&(this.innerElement_.innerHTML=S,this.renderedHTML_=S),this.renderedWidth_!=g&&(this.innerElement_.style.width=g+"px",this.renderedWidth_=g),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},t.prototype.createScaleBar=function(n,r,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],a=n/this.scaleBarSteps_,l="ol-scale-singlebar-odd",c=0;c
'+this.createMarker("relative",c)+(c%2===0||this.scaleBarSteps_===2?this.createStepText(c,n,!1,r,i):"")+""),c===this.scaleBarSteps_-1&&s.push(this.createStepText(c+1,n,!0,r,i)),l=l==="ol-scale-singlebar-odd"?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";var u;this.scaleBarText_?u='
'+o+"
":u="";var f='
'+u+s.join("")+"
";return f},t.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'
'},t.prototype.createStepText=function(n,r,i,o,s){var a=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=a+(n===0?"":" "+s),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'
'+l+"
"},t.prototype.getScaleForResolution=function(){var n=C5(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Zs.METERS),r=this.dpi_||Ck,i=1e3/25.4;return parseFloat(n.toString())*i*r},t.prototype.render=function(n){var r=n.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},t})(Z6);function wkt(e){var t={},n=new Sf,r=t.zoom!==void 0?t.zoom:!0;r&&n.push(new vkt(t.zoomOptions));var i=t.rotate!==void 0?t.rotate:!0;i&&n.push(new gkt(t.rotateOptions));var o=t.attribution!==void 0?t.attribution:!0;return o&&n.push(new hkt(t.attributionOptions)),n}const Uee={ACTIVE:"active"};var Skt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),aD=(function(e){Skt(t,e);function t(n){var r=e.call(this)||this;return r.on,r.once,r.un,n&&n.handleEvent&&(r.handleEvent=n.handleEvent),r.map_=null,r.setActive(!0),r}return t.prototype.getActive=function(){return this.get(Uee.ACTIVE)},t.prototype.getMap=function(){return this.map_},t.prototype.handleEvent=function(n){return!0},t.prototype.setActive=function(n){this.set(Uee.ACTIVE,n)},t.prototype.setMap=function(n){this.map_=n},t})(gg);function _kt(e,t,n){var r=e.getCenterInternal();if(r){var i=[r[0]+t[0],r[1]+t[1]];e.animateInternal({duration:n!==void 0?n:250,easing:HEt,center:e.getConstrainedCenter(i)})}}function Zae(e,t,n,r){var i=e.getZoom();if(i!==void 0){var o=e.getConstrainedZoom(i+t),s=e.getResolutionForZoom(o);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:s,anchor:n,duration:r!==void 0?r:250,easing:wT})}}var Ckt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Okt=(function(e){Ckt(t,e);function t(n){var r=e.call(this)||this,i=n||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return t.prototype.handleEvent=function(n){var r=!1;if(n.type==gi.DBLCLICK){var i=n.originalEvent,o=n.map,s=n.coordinate,a=i.shiftKey?-this.delta_:this.delta_,l=o.getView();Zae(l,a,s,this.duration_),i.preventDefault(),r=!0}return!r},t})(aD),Ekt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ST=(function(e){Ekt(t,e);function t(n){var r=this,i=n||{};return r=e.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return t.prototype.getPointerCount=function(){return this.targetPointers.length},t.prototype.handleDownEvent=function(n){return!1},t.prototype.handleDragEvent=function(n){},t.prototype.handleEvent=function(n){if(!n.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(n),this.handlingDownUpSequence){if(n.type==gi.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==gi.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==gi.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==gi.POINTERMOVE&&this.handleMoveEvent(n);return!r},t.prototype.handleMoveEvent=function(n){},t.prototype.handleUpEvent=function(n){return!1},t.prototype.stopDown=function(n){return n},t.prototype.updateTrackedPointers_=function(n){n.activePointers&&(this.targetPointers=n.activePointers)},t})(aD);function Jae(e){for(var t=e.length,n=0,r=0,i=0;i0&&this.condition_(n)){var r=n.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},t})(ST),Rkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ikt=(function(e){Rkt(t,e);function t(n){var r=this,i=n||{};return r=e.call(this,{stopDown:XI})||this,r.condition_=i.condition?i.condition:Tkt,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return t.prototype.handleDragEvent=function(n){if(d9(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==Kae){var o=r.getSize(),s=n.pixel,a=Math.atan2(o[1]/2-s[1],s[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=a-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=a}}},t.prototype.handleUpEvent=function(n){if(!d9(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},t.prototype.handleDownEvent=function(n){if(!d9(n))return!1;if(Zje(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},t})(ST),Dkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Lkt=(function(e){Dkt(t,e);function t(n){var r=e.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+n,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return t.prototype.disposeInternal=function(){this.setMap(null)},t.prototype.render_=function(){var n=this.startPixel_,r=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(n[0],r[0])+i,o.top=Math.min(n[1],r[1])+i,o.width=Math.abs(r[0]-n[0])+i,o.height=Math.abs(r[1]-n[1])+i},t.prototype.setMap=function(n){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=n,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},t.prototype.setPixels=function(n,r){this.startPixel_=n,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},t.prototype.createOrUpdateGeometry=function(){var n=this.startPixel_,r=this.endPixel_,i=[n,[n[0],r[1]],r,[r[0],n[1]]],o=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new V0([o])},t.prototype.getGeometry=function(){return this.geometry_},t})(gae),tBe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),A$={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},h9=(function(e){tBe(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return t})(pg),Fkt=(function(e){tBe(t,e);function t(n){var r=e.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new Lkt(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:Zje,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return t.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],s=i[1]-r[1];return o*o+s*s>=this.minArea_},t.prototype.getGeometry=function(){return this.box_.getGeometry()},t.prototype.handleDragEvent=function(n){this.box_.setPixels(this.startPixel_,n.pixel),this.dispatchEvent(new h9(A$.BOXDRAG,n.coordinate,n))},t.prototype.handleUpEvent=function(n){this.box_.setMap(null);var r=this.boxEndCondition_(n,this.startPixel_,n.pixel);return r&&this.onBoxEnd(n),this.dispatchEvent(new h9(r?A$.BOXEND:A$.BOXCANCEL,n.coordinate,n)),!1},t.prototype.handleDownEvent=function(n){return this.condition_(n)?(this.startPixel_=n.pixel,this.box_.setMap(n.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new h9(A$.BOXSTART,n.coordinate,n)),!0):!1},t.prototype.onBoxEnd=function(n){},t})(ST),$kt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Nkt=(function(e){$kt(t,e);function t(n){var r=this,i=n||{},o=i.condition?i.condition:Jje;return r=e.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return t.prototype.onBoxEnd=function(n){var r=this.getMap(),i=r.getView(),o=this.getGeometry();if(this.out_){var s=i.rotatedExtentForGeometry(o),a=i.getResolutionForExtentInternal(s),l=i.getResolution()/a;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:wT})},t})(Fkt);const ux={LEFT:37,UP:38,RIGHT:39,DOWN:40};var zkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),jkt=(function(e){zkt(t,e);function t(n){var r=e.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return ele(o)&&eBe(o)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return t.prototype.handleEvent=function(n){var r=!1;if(n.type==qn.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==ux.DOWN||o==ux.LEFT||o==ux.RIGHT||o==ux.UP)){var s=n.map,a=s.getView(),l=a.getResolution()*this.pixelDelta_,c=0,u=0;o==ux.DOWN?u=-l:o==ux.LEFT?c=-l:o==ux.RIGHT?c=l:u=l;var f=[c,u];Cae(f,a.getRotation()),_kt(a,f,this.duration_),i.preventDefault(),r=!0}}return!r},t})(aD),Bkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ukt=(function(e){Bkt(t,e);function t(n){var r=e.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:eBe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return t.prototype.handleEvent=function(n){var r=!1;if(n.type==qn.KEYDOWN||n.type==qn.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var s=n.map,a=o==43?this.delta_:-this.delta_,l=s.getView();Zae(l,a,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},t})(aD),Vkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),p9={TRACKPAD:"trackpad",WHEEL:"wheel"},Wkt=(function(e){Vkt(t,e);function t(n){var r=this,i=n||{};r=e.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var o=i.condition?i.condition:Kje;return r.condition_=i.onFocusOnly?Vee(Qje,o):o,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return t.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var n=this.getMap();if(n){var r=n.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},t.prototype.handleEvent=function(n){if(!this.condition_(n))return!0;var r=n.type;if(r!==qn.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var s;if(n.type==qn.WHEEL&&(s=o.deltaY,g_t&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=_5e),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;var a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?p9.TRACKPAD:p9.WHEEL);var l=i.getView();if(this.mode_===p9.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=s;var c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1},t.prototype.handleWheelZoom_=function(n){var r=n.getView();r.getAnimating()&&r.cancelAnimations();var i=-gs(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Zae(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},t.prototype.setMouseAnchor=function(n){this.useAnchor_=n,n||(this.lastAnchor_=null)},t})(aD),Hkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Gkt=(function(e){Hkt(t,e);function t(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=XI),r=e.call(this,o)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return t.prototype.handleDragEvent=function(n){var r=0,i=this.targetPointers[0],o=this.targetPointers[1],s=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var a=s-this.lastAngle_;this.rotationDelta_+=a,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=a}this.lastAngle_=s;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==Kae){var u=l.getViewport().getBoundingClientRect(),f=Jae(this.targetPointers);f[0]-=u.left,f[1]-=u.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),c.adjustRotationInternal(r,this.anchor_))}},t.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},t.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},t})(ST),qkt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Xkt=(function(e){qkt(t,e);function t(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=XI),r=e.call(this,o)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return t.prototype.handleDragEvent=function(n){var r=1,i=this.targetPointers[0],o=this.targetPointers[1],s=i.clientX-o.clientX,a=i.clientY-o.clientY,l=Math.sqrt(s*s+a*a);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var c=n.map,u=c.getView();r!=1&&(this.lastScaleDelta_=r);var f=c.getViewport().getBoundingClientRect(),d=Jae(this.targetPointers);d[0]-=f.left,d[1]-=f.top,this.anchor_=c.getCoordinateFromPixelInternal(d),c.render(),u.adjustResolutionInternal(r,this.anchor_)},t.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView(),o=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,o),!1}else return!0},t.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},t})(ST),Ykt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),tle=(function(e){Ykt(t,e);function t(n,r,i){var o=e.call(this)||this;if(i!==void 0&&r===void 0)o.setFlatCoordinates(i,n);else{var s=r||0;o.setCenterAndRadius(n,s,i)}return o}return t.prototype.clone=function(){var n=new t(this.flatCoordinates.slice(),void 0,this.layout);return n.applyProperties(this),n},t.prototype.closestPointXY=function(n,r,i,o){var s=this.flatCoordinates,a=n-s[0],l=r-s[1],c=a*a+l*l;if(c=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:bae(n,this.intersectsCoordinate.bind(this))}return!1},t.prototype.setCenter=function(n){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],o=n.slice();o[r]=o[0]+i;for(var s=1;s=this.dragVertexDelay_?(this.downPx_=n.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&n.type===gi.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===gi.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===gi.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===gi.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===gi.DBLCLICK&&(i=!1),e.prototype.handleEvent.call(this,n)&&i},t.prototype.handleDownEvent=function(n){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=n.pixel,this.finishCoordinate_||this.startDrawing_(n.coordinate),!0):this.condition_(n)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((function(){this.handlePointerMove_(new fm(gi.POINTERMOVE,n.map,n.originalEvent,!1,n.frameState))}).bind(this),this.dragVertexDelay_),this.downPx_=n.pixel,!0):(this.lastDragTime_=void 0,!1)},t.prototype.handleUpEvent=function(n){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(n),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(n.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===Ur.POINT)&&(this.atFinish_(n.pixel)?this.finishCondition_(n)&&this.finishDrawing():this.addToDrawing_(n.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&n.preventDefault(),r},t.prototype.handlePointerMove_=function(n){if(this.pointerType_=n.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=n.pixel,o=r[0]-i[0],s=r[1]-i[1],a=o*o+s*s;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(n.coordinate):this.createOrUpdateSketchPoint_(n.coordinate.slice())},t.prototype.atFinish_=function(n){var r=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],s=this.mode_;if(s===Ur.POINT)r=!0;else if(s===Ur.CIRCLE)r=this.sketchCoords_.length===2;else if(s===Ur.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(s===Ur.POLYGON){var a=this.sketchCoords_;i=a[0].length>this.minPoints_,o=[a[0][0],a[0][a[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),this.geometryFunction_(s,r,i)):a===Ur.POLYGON&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),o&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(n.slice()),this.updateSketchFeatures_(),o&&this.finishDrawing()},t.prototype.removeLastPoint=function(){if(this.sketchFeature_){var n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,o=this.mode_;if(o===Ur.LINE_STRING||o===Ur.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var s=this.finishCoordinate_.slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===Ur.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var a=this.sketchLine_.getGeometry();if(i.length>=2){var s=i[i.length-2].slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}a.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,n,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},t.prototype.finishDrawing=function(){var n=this.abortDrawing_();if(n){var r=this.sketchCoords_,i=n.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Ur.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===Ur.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new G6([r])):this.type_==="MultiLineString"?n.setGeometry(new Fae([r])):this.type_==="MultiPolygon"&&n.setGeometry(new $ae([r])),this.dispatchEvent(new I$(R$.DRAWEND,n)),this.features_&&this.features_.push(n),this.source_&&this.source_.addFeature(n)}},t.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var n=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),n},t.prototype.abortDrawing=function(){var n=this.abortDrawing_();n&&this.dispatchEvent(new I$(R$.DRAWABORT,n))},t.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===Ur.LINE_STRING||r===Ur.CIRCLE)o=this.sketchCoords_;else if(r===Ur.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var s=0;s0&&this.getCount()>this.highWaterMark},e.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t){for(var n=this.oldest_;n;)t(n.value_,n.key_,this),n=n.newer},e.prototype.get=function(t,n){var r=this.entries_[t];return vr(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},e.prototype.remove=function(t){var n=this.entries_[t];return vr(n!==void 0,15),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[t],--this.count_,n.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)t[n++]=r.key_;return t},e.prototype.getValues=function(){var t=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)t[n++]=r.value_;return t},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},e.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,n){this.get(t),this.entries_[t].value_=n},e.prototype.set=function(t,n){vr(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e})();function z1e(e,t,n,r){return r!==void 0?(r[0]=e,r[1]=t,r[2]=n,r):[e,t,n]}function J6(e,t,n){return e+"/"+t+"/"+n}function rBe(e){return J6(e[0],e[1],e[2])}function n2t(e){return e.split("/").map(Number)}function iBe(e){return(e[1]<n||n>t.getMaxZoom())return!1;var o=t.getFullTileRange(n);return o?o.containsXY(r,i):!0}var i2t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),oBe=(function(e){i2t(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.expireCache=function(n){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in n)break;this.pop().release()}},t.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var n=this.peekFirstKey(),r=n2t(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(rBe(o.tileCoord)),o.release())}).bind(this))}},t})(t2t);const g9={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var o2t=[0,0,0],dy=5,nle=(function(){function e(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,vr(s_t(this.resolutions_,function(s,a){return a-s}),17);var n;if(!t.origins){for(var r=0,i=this.resolutions_.length-1;r=this.minZoom;){if(this.zoomFactor_===2?(s=Math.floor(s/2),a=Math.floor(a/2),o=f_(s,s,a,a,r)):o=this.getTileRangeForExtentAndZ(l,c,r),n(c,o))return!0;--c}return!1},e.prototype.getExtent=function(){return this.extent_},e.prototype.getMaxZoom=function(){return this.maxZoom},e.prototype.getMinZoom=function(){return this.minZoom},e.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},e.prototype.getResolution=function(t){return this.resolutions_[t]},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getTileCoordChildTileRange=function(t,n,r){if(t[0]this.maxZoom||n0?r:Math.max(s/a[0],o/a[1]),c=i+1,u=new Array(c),f=0;fi.highWaterMark&&(i.highWaterMark=n)},t.prototype.useTile=function(n,r,i,o){},t})(Hje),f2t=(function(e){lBe(t,e);function t(n,r){var i=e.call(this,n)||this;return i.tile=r,i}return t})(pg);function d2t(e,t){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return(function(s,a,l){if(s)return e.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var c=s[0],u=t.getFullTileRange(c);vr(u,55);var f=u.getHeight()-s[2]-1;return f.toString()})})}function h2t(e,t){for(var n=e.length,r=new Array(n),i=0;i=0},t.prototype.tileUrlFunction=function(n,r,i){var o=this.getTileGrid();if(o||(o=this.getTileGridForProjection(i)),!(o.getResolutions().length<=n[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var s=o.getResolution(n[0]),a=o.getTileCoordExtent(n,this.tmpExtent_),l=bu(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=h1e(l,c,this.tmpSize),a=kA(a,s*c,a)),r!=1&&(l=Pje(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:D$,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return bo(u,this.params_),this.getRequestUrl_(n,l,a,r,i,u)}},t})(cBe);function uBe(e){return O.jsx(M.Fragment,{children:e.children})}var S2t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),_2t='© OpenStreetMap contributors.',C2t=(function(e){S2t(t,e);function t(n){var r=n||{},i=r.imageSmoothing!==void 0?r.imageSmoothing:!0;r.interpolate!==void 0&&(i=r.interpolate);var o;r.attributions!==void 0?o=r.attributions:o=[_2t];var s=r.crossOrigin!==void 0?r.crossOrigin:"anonymous",a=r.url!==void 0?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return e.call(this,{attributions:o,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:s,interpolate:i,maxZoom:r.maxZoom!==void 0?r.maxZoom:19,opaque:r.opaque!==void 0?r.opaque:!0,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:a,wrapX:r.wrapX,zDirection:r.zDirection})||this}return t})(_T);const fBe=M.createContext({mapObjects:{},reportTileLoadStart:()=>{},reportTileLoadEnd:()=>{},reportTileLoadError:()=>{}}),B1e=()=>({numTilesLoading:0,numTilesLoaded:0,numTilesErrored:0}),O2t={position:"relative",top:0,left:0,width:"100%",height:"100%"};let E2t=class extends M.Component{contextValue;clickEventsKey=null;loadStartEventsKey=null;loadEndEventsKey=null;lastTileLoadProgress=null;zoomEventsKey=null;viewChangeKey=null;constructor(t){super(t),this.state=B1e();const{id:n,mapObjects:r}=t;r?this.contextValue={map:r[n]||void 0,mapObjects:r,reportTileLoadStart:this.reportTileLoadStart,reportTileLoadEnd:this.reportTileLoadEnd,reportTileLoadError:this.reportTileLoadError}:this.contextValue={mapObjects:{},reportTileLoadStart:this.reportTileLoadStart,reportTileLoadEnd:this.reportTileLoadEnd,reportTileLoadError:this.reportTileLoadError}}componentDidMount(){const{id:t}=this.props,n=this.contextValue.mapDiv;let r=null,i=null;if(this.props.isStale){const s=this.contextValue.mapObjects[t];s instanceof N1e&&(r=s,r.setTarget(n),this.clickEventsKey&&r.un("click",this.clickEventsKey.listener),i=r?.getView(),this.zoomEventsKey&&i.un("change:resolution",this.zoomEventsKey.listener))}if(!r){const s=this.getMinZoom(n),a=new hp({projection:b5e,center:[0,0],minZoom:s,zoom:s});r=new N1e({view:a,...this.getMapOptions(),target:n})}i=r?.getView(),this.contextValue.map=r,this.contextValue.mapObjects[t]=r,this.clickEventsKey=r.on("click",this.handleClick),this.loadStartEventsKey=r.on("loadstart",this.handleMapLoadStart),this.loadEndEventsKey=r.on("loadend",this.handleMapLoadEnd),this.zoomEventsKey=i.on("change:resolution",this.handleZoom),this.viewChangeKey=r.on("change:view",()=>{const s=r?.getView();this.bindViewListeners(s)}),r.updateSize(),this.forceUpdate(),window.addEventListener("resize",this.handleResize);const o=this.props.onMapRef;o&&o(r)}bindViewListeners(t){this.zoomEventsKey&&(ap(this.zoomEventsKey),this.zoomEventsKey=null),t&&(this.zoomEventsKey=t.on("change:resolution",this.handleZoom))}componentDidUpdate(t){const n=this.contextValue.map,r=this.contextValue.mapDiv,i=this.getMapOptions();n.setProperties({...i}),n.setTarget(r),n.updateSize()}componentWillUnmount(){ap(this.clickEventsKey),ap(this.loadStartEventsKey),ap(this.loadEndEventsKey),ap(this.zoomEventsKey),ap(this.viewChangeKey),window.removeEventListener("resize",this.handleResize);const t=this.props.onMapRef;t&&t(null)}render(){let t;return this.contextValue.map&&(t=O.jsx(fBe.Provider,{value:this.contextValue,children:this.props.children})),O.jsx("div",{ref:this.handleRef,style:O2t,onDragOver:this.handleDragOver,onDrop:this.handleDrop,children:t})}getMapOptions(){const t={...this.props};return delete t.children,delete t.onClick,delete t.onZoom,delete t.onDropFiles,delete t.onTileLoadProgress,t}handleClick=t=>{const n=this.props.onClick;n&&n(t)};handleDrop=t=>{if(this.props.onDropFiles){t.preventDefault();const n=[];if(t.dataTransfer.items)for(let r=0;r{this.props.onDropFiles&&t.preventDefault()};handleRef=t=>{this.contextValue.mapDiv=t};handleResize=()=>{const t=this.contextValue.mapDiv,n=this.contextValue.map;if(t&&n){n.updateSize();const r=n.getView(),i=this.getMinZoom(t);i!==r.getMinZoom()&&r.setMinZoom(i)}};getMinZoom=t=>{const n=t.clientWidth,r=Math.LOG2E*Math.log(n/256);return r>=0?r:0};handleZoom=t=>{const n=this.props.onZoom,r=this.contextValue.map;n&&n(t,r)};handleMapLoadStart=()=>{};handleMapLoadEnd=()=>{this.resetProgressState()};resetProgressState=()=>{this.setState(B1e(),this.reportProgressUpdate)};reportTileLoadStart=t=>{this.reportTileLoadInternal(t,n=>({numTilesLoading:n.numTilesLoading+1}))};reportTileLoadEnd=t=>{this.reportTileLoadInternal(t,n=>({numTilesLoaded:n.numTilesLoaded+1}))};reportTileLoadError=t=>{this.reportTileLoadInternal(t,n=>({numTilesErrored:n.numTilesErrored+1}))};reportTileLoadInternal=(t,n)=>{this.props.onTileLoadProgress&&this.setState(n,this.reportProgressUpdate)};reportProgressUpdate=()=>{const t=this.props.onTileLoadProgress;if(!t)return;const n=this.lastTileLoadProgress,r={value:this.computeProgressValue(),active:this.isProgressActive()};(!n||n.active!==r.active||n.value!==r.value)&&(t(r),this.lastTileLoadProgress=r)};isProgressActive=()=>this.state.numTilesLoading>0;computeProgressValue=()=>{const t=this.state.numTilesLoaded,n=this.state.numTilesErrored,r=this.state.numTilesLoading;return 100*Math.min(1,Math.max(0,t+n)/Math.max(1,r))}};class lD extends M.PureComponent{static contextType=fBe;context={};object=null;getMapObject(t){return this.context.mapObjects&&this.context.mapObjects[t]||null}getOptions(){const t={...this.props};return delete t.id,t}componentDidMount(){this._updateMapObject(this.addMapObject(this.context.map))}componentDidUpdate(t){this._updateMapObject(this.updateMapObject(this.context.map,this.object,t))}componentWillUnmount(){const t=this.context.map;this.removeMapObject(t,this.object),this.props.id&&delete this.context.mapObjects[this.props.id],this.object=null}_updateMapObject(t){t!=null&&this.props.id&&(t.set("objectId",this.props.id),this.context.mapObjects[this.props.id]=t),this.object=t}render(){return null}}function dBe(e,t,n){p_(e,t,n,"visible",!0),p_(e,t,n,"opacity",1),p_(e,t,n,"zIndex",void 0),p_(e,t,n,"extent",void 0),p_(e,t,n,"minResolution",void 0),p_(e,t,n,"maxResolution",void 0)}function p_(e,t,n,r,i){const o=U1e(t[r],i),s=U1e(n[r],i);o!==s&&e.set(r,s)}function U1e(e,t){return e===void 0?t:e}let hc;hc=()=>{};let hBe=class extends lD{tileLoadStartEventsKey=null;tileLoadEndEventsKey=null;tileLoadErrorEventsKey=null;addMapObject(t){const n=new Y6(this.props);n.set("id",this.props.id);const r=n.getSource();return r&&("crossOrigin"in r&&(r.crossOrigin="Anonymous"),this.registerTileLoadHandlers(r)),t.getLayers().push(n),n}updateMapObject(t,n,r){const i=n.getSource(),o=this.props.source||null;if(i===o)return n;if(o!==null&&i!==o){let s=!0;if(i instanceof Wee&&o instanceof Wee){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(T2t(f,d)){hc("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),s=!1);const g=c.getTileLoadFunction(),m=u.getTileLoadFunction();g!==m&&(c.setTileLoadFunction(m),s=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),s=!1)}else hc("--> Tile grids are not equal!")}const a=i?.getInterpolate(),l=o?.getInterpolate();a!==l&&(s=!0),s?(i&&this.unregisterTileLoadHandlers(i),this.registerTileLoadHandlers(o),n.setSource(o),hc("--> Replaced source (expect flickering!)")):hc("--> Updated source (check, is it still flickering?)")}return dBe(n,r,this.props),n}removeMapObject(t,n){const r=n.getSource();r&&this.unregisterTileLoadHandlers(r),t.getLayers().remove(n)}registerTileLoadHandlers(t){console.log("adding tile load handlers to",t),this.tileLoadStartEventsKey=t.on("tileloadstart",this.context.reportTileLoadStart),this.tileLoadEndEventsKey=t.on("tileloadend",this.context.reportTileLoadEnd),this.tileLoadErrorEventsKey=t.on("tileloaderror",this.context.reportTileLoadError)}unregisterTileLoadHandlers(t){console.log("removing tile load handlers from",t),ap(this.tileLoadStartEventsKey),ap(this.tileLoadEndEventsKey),ap(this.tileLoadErrorEventsKey)}};new _T({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new _T({url:"https://gis.ngdc.noaa.gov/arcgis/rest/services/web_mercator/gebco_2014_contours/MapServer/tile/{z}/{y}/{x}",attributions:["© GEBCO","© NOAHH and contributors"]});new C2t;new _T({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function T2t(e,t){if(e===t)return!0;if(e===null||t===null||(hc("tile grid:",e,t),hc("min zoom:",e.getMinZoom(),t.getMinZoom()),hc("max zoom:",e.getMaxZoom(),t.getMaxZoom()),e.getMinZoom()!==t.getMinZoom()||e.getMaxZoom()!==t.getMaxZoom()))return!1;const n=e.getExtent(),r=t.getExtent();hc("extent:",n,r);for(let a=0;a=e[i])return i;let o=Math.floor(n/2),s;for(let a=0;as)[r,o]=[o,Math.floor((o+i)/2)];else return o;if(r===o||o===i)return Math.abs(e[r]-t)<=Math.abs(e[i]-t)?r:i}return-1}function Vr(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function un(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function bn(e){un(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||iv(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function gBe(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function mBe(e,t){un(2,arguments);var n=bn(e),r=Vr(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var s=o.getDate();return i>=s?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function tU(e,t){un(2,arguments);var n=bn(e).getTime(),r=Vr(t);return new Date(n+r)}var P2t=36e5;function k2t(e,t){un(2,arguments);var n=Vr(t);return tU(e,n*P2t)}var M2t={};function mg(){return M2t}function jA(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=mg(),f=Vr((n=(r=(i=(o=t?.weekStartsOn)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=bn(e),h=d.getDay(),p=(h=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=bn(e),h=d.getDay(),p=(h=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function H2t(e){un(1,arguments);var t=xBe(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=BO(n);return r}var G2t=6048e5;function wBe(e){un(1,arguments);var t=bn(e),n=BO(t).getTime()-H2t(t).getTime();return Math.round(n/G2t)+1}function nw(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=mg(),f=Vr((n=(r=(i=(o=t?.weekStartsOn)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=bn(e),h=d.getUTCDay(),p=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,h),p.setUTCHours(0,0,0,0);var g=nw(p,t),m=new Date(0);m.setUTCFullYear(f,0,h),m.setUTCHours(0,0,0,0);var v=nw(m,t);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function q2t(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=mg(),f=Vr((n=(r=(i=(o=t?.firstWeekContainsDate)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=sle(e,t),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=nw(h,t);return p}var X2t=6048e5;function SBe(e,t){un(1,arguments);var n=bn(e),r=nw(n,t).getTime()-q2t(n,t).getTime();return Math.round(r/X2t)+1}function _i(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?r:1-r;return _i(n==="yy"?i%100:i,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):_i(r+1,2)},d:function(t,n){return _i(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return _i(t.getUTCHours()%12||12,n.length)},H:function(t,n){return _i(t.getUTCHours(),n.length)},m:function(t,n){return _i(t.getUTCMinutes(),n.length)},s:function(t,n){return _i(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,i=t.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return _i(o,n.length)}},g_={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Y2t={G:function(t,n,r){var i=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});default:return r.era(i,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var i=t.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return hy.y(t,n)},Y:function(t,n,r,i){var o=sle(t,i),s=o>0?o:1-o;if(n==="YY"){var a=s%100;return _i(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):_i(s,n.length)},R:function(t,n){var r=xBe(t);return _i(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return _i(r,n.length)},Q:function(t,n,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return _i(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,n,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return _i(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,n,r){var i=t.getUTCMonth();switch(n){case"M":case"MM":return hy.M(t,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(t,n,r){var i=t.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return _i(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(t,n,r,i){var o=SBe(t,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):_i(o,n.length)},I:function(t,n,r){var i=wBe(t);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):_i(i,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):hy.d(t,n)},D:function(t,n,r){var i=W2t(t);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):_i(i,n.length)},E:function(t,n,r){var i=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(t,n,r,i){var o=t.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return _i(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,n,r,i){var o=t.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return _i(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,n,r){var i=t.getUTCDay(),o=i===0?7:i;switch(n){case"i":return String(o);case"ii":return _i(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(t,n,r){var i=t.getUTCHours(),o=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(t,n,r){var i=t.getUTCHours(),o;switch(i===12?o=g_.noon:i===0?o=g_.midnight:o=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,n,r){var i=t.getUTCHours(),o;switch(i>=17?o=g_.evening:i>=12?o=g_.afternoon:i>=4?o=g_.morning:o=g_.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return hy.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):hy.H(t,n)},K:function(t,n,r){var i=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):_i(i,n.length)},k:function(t,n,r){var i=t.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):_i(i,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):hy.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):hy.s(t,n)},S:function(t,n){return hy.S(t,n)},X:function(t,n,r,i){var o=i._originalDate||t,s=o.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return G1e(s);case"XXXX":case"XX":return Lx(s);default:return Lx(s,":")}},x:function(t,n,r,i){var o=i._originalDate||t,s=o.getTimezoneOffset();switch(n){case"x":return G1e(s);case"xxxx":case"xx":return Lx(s);default:return Lx(s,":")}},O:function(t,n,r,i){var o=i._originalDate||t,s=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+H1e(s,":");default:return"GMT"+Lx(s,":")}},z:function(t,n,r,i){var o=i._originalDate||t,s=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+H1e(s,":");default:return"GMT"+Lx(s,":")}},t:function(t,n,r,i){var o=i._originalDate||t,s=Math.floor(o.getTime()/1e3);return _i(s,n.length)},T:function(t,n,r,i){var o=i._originalDate||t,s=o.getTime();return _i(s,n.length)}};function H1e(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;if(o===0)return n+String(i);var s=t;return n+String(i)+s+_i(o,2)}function G1e(e,t){if(e%60===0){var n=e>0?"-":"+";return n+_i(Math.abs(e)/60,2)}return Lx(e,t)}function Lx(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),o=_i(Math.floor(i/60),2),s=_i(i%60,2);return r+o+n+s}var q1e=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});default:return n.date({width:"full"})}},_Be=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});default:return n.time({width:"full"})}},Q2t=function(t,n){var r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return q1e(t,n);var s;switch(i){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",q1e(i,n)).replace("{{time}}",_Be(o,n))},Gee={p:_Be,P:Q2t},K2t=["D","DD"],Z2t=["YY","YYYY"];function CBe(e){return K2t.indexOf(e)!==-1}function OBe(e){return Z2t.indexOf(e)!==-1}function $5(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var J2t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},eMt=function(t,n,r){var i,o=J2t[t];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};function m9(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var tMt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nMt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rMt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iMt={date:m9({formats:tMt,defaultWidth:"full"}),time:m9({formats:nMt,defaultWidth:"full"}),dateTime:m9({formats:rMt,defaultWidth:"full"})},oMt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sMt=function(t,n,r,i){return oMt[t]};function Ok(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{var a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[a]}var c=e.argumentCallback?e.argumentCallback(t):t;return i[c]}}var aMt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lMt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cMt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},uMt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},fMt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},dMt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hMt=function(t,n){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},pMt={ordinalNumber:hMt,era:Ok({values:aMt,defaultWidth:"wide"}),quarter:Ok({values:lMt,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Ok({values:cMt,defaultWidth:"wide"}),day:Ok({values:uMt,defaultWidth:"wide"}),dayPeriod:Ok({values:fMt,defaultWidth:"wide",formattingValues:dMt,defaultFormattingWidth:"wide"})};function Ek(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?mMt(a,function(f){return f.test(s)}):gMt(a,function(f){return f.test(s)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function gMt(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function mMt(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],o=t.match(e.parsePattern);if(!o)return null;var s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;var a=t.slice(i.length);return{value:s,rest:a}}}var yMt=/^(\d+)(th|st|nd|rd)?/i,bMt=/\d+/i,xMt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},wMt={any:[/^b/i,/^(a|c)/i]},SMt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_Mt={any:[/1/i,/2/i,/3/i,/4/i]},CMt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},OMt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},EMt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},TMt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},PMt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kMt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},MMt={ordinalNumber:vMt({matchPattern:yMt,parsePattern:bMt,valueCallback:function(t){return parseInt(t,10)}}),era:Ek({matchPatterns:xMt,defaultMatchWidth:"wide",parsePatterns:wMt,defaultParseWidth:"any"}),quarter:Ek({matchPatterns:SMt,defaultMatchWidth:"wide",parsePatterns:_Mt,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ek({matchPatterns:CMt,defaultMatchWidth:"wide",parsePatterns:OMt,defaultParseWidth:"any"}),day:Ek({matchPatterns:EMt,defaultMatchWidth:"wide",parsePatterns:TMt,defaultParseWidth:"any"}),dayPeriod:Ek({matchPatterns:PMt,defaultMatchWidth:"any",parsePatterns:kMt,defaultParseWidth:"any"})},ale={code:"en-US",formatDistance:eMt,formatLong:iMt,formatRelative:sMt,localize:pMt,match:MMt,options:{weekStartsOn:0,firstWeekContainsDate:1}},AMt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,RMt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IMt=/^'([^]*?)'?$/,DMt=/''/g,LMt=/[a-zA-Z]/;function FMt(e,t,n){var r,i,o,s,a,l,c,u,f,d,h,p,g,m,v,y,b,w;un(2,arguments);var S=String(t),_=mg(),E=(r=(i=n?.locale)!==null&&i!==void 0?i:_.locale)!==null&&r!==void 0?r:ale,T=Vr((o=(s=(a=(l=n?.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:_.firstWeekContainsDate)!==null&&s!==void 0?s:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=Vr((h=(p=(g=(m=n?.weekStartsOn)!==null&&m!==void 0?m:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g:_.weekStartsOn)!==null&&p!==void 0?p:(b=_.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&h!==void 0?h:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var P=bn(e);if(!yBe(P))throw new RangeError("Invalid time value");var I=vBe(P),R=bBe(P,I),F={firstWeekContainsDate:T,weekStartsOn:k,locale:E,_originalDate:P},A=S.match(RMt).map(function(L){var $=L[0];if($==="p"||$==="P"){var j=Gee[$];return j(L,E.formatLong)}return L}).join("").match(AMt).map(function(L){if(L==="''")return"'";var $=L[0];if($==="'")return $Mt(L);var j=Y2t[$];if(j)return!(n!=null&&n.useAdditionalWeekYearTokens)&&OBe(L)&&$5(L,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&CBe(L)&&$5(L,t,String(e)),j(R,L,E.localize,F);if($.match(LMt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return L}).join("");return A}function $Mt(e){var t=e.match(IMt);return t?t[1].replace(DMt,"'"):e}function NMt(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function zMt(e){un(1,arguments);var t=bn(e),n=t.getDate();return n}function EBe(e){un(1,arguments);var t=bn(e),n=t.getFullYear(),r=t.getMonth(),i=new Date(0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function jMt(e){un(1,arguments);var t=bn(e),n=t.getHours();return n}function BMt(e){un(1,arguments);var t=bn(e),n=t.getMilliseconds();return n}function UMt(e){un(1,arguments);var t=bn(e),n=t.getMinutes();return n}function VMt(e){un(1,arguments);var t=bn(e),n=t.getMonth();return n}function WMt(e){un(1,arguments);var t=bn(e),n=t.getSeconds();return n}function HMt(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=bn(e),f=u.getFullYear(),d=mg(),h=Vr((n=(r=(i=(o=t?.firstWeekContainsDate)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(f+1,0,h),p.setHours(0,0,0,0);var g=jA(p,t),m=new Date(0);m.setFullYear(f,0,h),m.setHours(0,0,0,0);var v=jA(m,t);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function GMt(e,t){var n,r,i,o,s,a,l,c;un(1,arguments);var u=mg(),f=Vr((n=(r=(i=(o=t?.firstWeekContainsDate)!==null&&o!==void 0?o:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=HMt(e,t),h=new Date(0);h.setFullYear(d,0,f),h.setHours(0,0,0,0);var p=jA(h,t);return p}var qMt=6048e5;function XMt(e,t){un(1,arguments);var n=bn(e),r=jA(n,t).getTime()-GMt(n,t).getTime();return Math.round(r/qMt)+1}function YMt(e){return un(1,arguments),bn(e).getFullYear()}function v9(e,t){un(2,arguments);var n=bn(e),r=bn(t);return n.getTime()>r.getTime()}function y9(e,t){un(2,arguments);var n=bn(e),r=bn(t);return n.getTime()e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,o=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function Wr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d5(e,t)}function N5(e){return N5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},N5(e)}function PBe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PBe=function(){return!!e})()}function KMt(e,t){if(t&&(iv(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tn(e)}function Hr(e){var t=PBe();return function(){var n,r=N5(e);if(t){var i=N5(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return KMt(this,n)}}function Ir(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZMt(e,t){for(var n=0;n0,r=n?t:1-t,i;if(r<=50)i=e||100;else{var o=r+50,s=Math.floor(o/100)*100,a=e>=o%100;i=e+s-(a?100:0)}return n?i:1-i}function RBe(e){return e%400===0||e%4===0&&e%100!==0}var rAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s){var a=i.getUTCFullYear();if(s.isTwoDigitYear){var l=ABe(s.year,a);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui),iAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s,a){var l=sle(i,a);if(s.isTwoDigitYear){var c=ABe(s.year,l);return i.setUTCFullYear(c,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),nw(i,a)}var u=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),nw(i,a)}}]),n})(ui),oAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui),lAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui),cAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui),uAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n})(ui);function fAt(e,t,n){un(2,arguments);var r=bn(e),i=Vr(t),o=SBe(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var dAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s,a){return nw(fAt(i,s,a),a)}}]),n})(ui);function hAt(e,t){un(2,arguments);var n=bn(e),r=Vr(t),i=wBe(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var pAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s){return BO(hAt(i,s))}}]),n})(ui),gAt=[31,28,31,30,31,30,31,31,30,31,30,31],mAt=[31,29,31,30,31,30,31,31,30,31,30,31],vAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=mAt[l]:o>=1&&o<=gAt[l]}},{key:"set",value:function(i,o,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),n})(ui),yAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),n})(ui);function cle(e,t,n){var r,i,o,s,a,l,c,u;un(2,arguments);var f=mg(),d=Vr((r=(i=(o=(s=n?.weekStartsOn)!==null&&s!==void 0?s:n==null||(a=n.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=bn(e),p=Vr(t),g=h.getUTCDay(),m=p%7,v=(m+7)%7,y=(v=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=cle(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n})(ui),xAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=cle(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n})(ui),wAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=cle(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n})(ui);function SAt(e,t){un(2,arguments);var n=Vr(t);n%7===0&&(n=n-7);var r=1,i=bn(e),o=i.getUTCDay(),s=n%7,a=(s+7)%7,l=(a=1&&o<=7}},{key:"set",value:function(i,o,s){return i=SAt(i,s),i.setUTCHours(0,0,0,0),i}}]),n})(ui),CAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=12}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):!a&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n})(ui),PAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=23}},{key:"set",value:function(i,o,s){return i.setUTCHours(s,0,0,0),i}}]),n})(ui),kAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n})(ui),MAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=24}},{key:"set",value:function(i,o,s){var a=s<=24?s%24:s;return i.setUTCHours(a,0,0,0),i}}]),n})(ui),AAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCMinutes(s,0,0),i}}]),n})(ui),RAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCSeconds(s,0),i}}]),n})(ui),IAt=(function(e){Wr(n,e);var t=Hr(n);function n(){var r;Ir(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=Vr((p=(g=(m=(v=r?.weekStartsOn)!==null&&v!==void 0?v:r==null||(y=r.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&g!==void 0?g:(w=T.locale)===null||w===void 0||(S=w.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&p!==void 0?p:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(E==="")return _===""?bn(n):new Date(NaN);var R={firstWeekContainsDate:P,weekStartsOn:I,locale:k},F=[new tAt],A=E.match(jAt).map(function(ne){var ie=ne[0];if(ie in Gee){var fe=Gee[ie];return fe(ne,k.formatLong)}return ne}).join("").match(zAt),L=[],$=X1e(A),j;try{var V=function(){var ie=j.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&OBe(ie)&&$5(ie,E,e),!(r!=null&&r.useAdditionalDayOfYearTokens)&&CBe(ie)&&$5(ie,E,e);var fe=ie[0],ve=NAt[fe];if(ve){var se=ve.incompatibleTokens;if(Array.isArray(se)){var ue=L.find(function(ce){return se.includes(ce.token)||ce.token===fe});if(ue)throw new RangeError("The format string mustn't contain `".concat(ue.fullToken,"` and `").concat(ie,"` at the same time"))}else if(ve.incompatibleTokens==="*"&&L.length>0)throw new RangeError("The format string mustn't contain `".concat(ie,"` and any other token at the same time"));L.push({token:fe,fullToken:ie});var G=ve.run(_,ie,k.match,R);if(!G)return{v:new Date(NaN)};F.push(G.setter),_=G.rest}else{if(fe.match(WAt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+fe+"`");if(ie==="''"?ie="'":fe==="'"&&(ie=GAt(ie)),_.indexOf(ie)===0)_=_.slice(ie.length);else return{v:new Date(NaN)}}};for($.s();!(j=$.n()).done;){var U=V();if(iv(U)==="object")return U.v}}catch(ne){$.e(ne)}finally{$.f()}if(_.length>0&&VAt.test(_))return new Date(NaN);var z=F.map(function(ne){return ne.priority}).sort(function(ne,ie){return ie-ne}).filter(function(ne,ie,fe){return fe.indexOf(ne)===ie}).map(function(ne){return F.filter(function(ie){return ie.priority===ne}).sort(function(ie,fe){return fe.subPriority-ie.subPriority})}).map(function(ne){return ne[0]}),N=bn(n);if(isNaN(N.getTime()))return new Date(NaN);var B=bBe(N,vBe(N)),H={},Q=X1e(z),Y;try{for(Q.s();!(Y=Q.n()).done;){var Z=Y.value;if(!Z.validate(B,R))return new Date(NaN);var ge=Z.set(B,H,R);Array.isArray(ge)?(B=ge[0],NMt(H,ge[1])):B=ge}}catch(ne){Q.e(ne)}finally{Q.f()}return B}function GAt(e){return e.match(BAt)[1].replace(UAt,"'")}function Y1e(e){un(1,arguments);var t=bn(e);return t.setMinutes(0,0,0),t}function qAt(e,t){un(2,arguments);var n=Y1e(e),r=Y1e(t);return n.getTime()===r.getTime()}function XAt(e,t){un(2,arguments);var n=bn(e),r=bn(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function YAt(e,t){un(2,arguments);var n=bn(e),r=bn(t);return n.getFullYear()===r.getFullYear()}function QAt(e,t){un(2,arguments);var n=bn(e).getTime(),r=bn(t.start).getTime(),i=bn(t.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function KAt(e,t){var n;un(1,arguments);var r=Vr((n=void 0)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var i=tRt(e),o;if(i.date){var s=nRt(i.date,r);o=rRt(s.restDateString,s.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a=o.getTime(),l=0,c;if(i.time&&(l=iRt(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=oRt(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(a+l+c)}var L$={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ZAt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,JAt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,eRt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function tRt(e){var t={},n=e.split(L$.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],L$.timeZoneDelimiter.test(t.date)&&(t.date=e.split(L$.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var i=L$.timezone.exec(r);i?(t.time=r.replace(i[1],""),t.timezone=i[1]):t.time=r}return t}function nRt(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:e.slice((r[1]||r[2]).length)}}function rRt(e,t){if(t===null)return new Date(NaN);var n=e.match(ZAt);if(!n)return new Date(NaN);var r=!!n[4],i=Tk(n[1]),o=Tk(n[2])-1,s=Tk(n[3]),a=Tk(n[4]),l=Tk(n[5])-1;if(r)return uRt(t,a,l)?sRt(t,a,l):new Date(NaN);var c=new Date(0);return!lRt(t,o,s)||!cRt(t,i)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(i,s)),c)}function Tk(e){return e?parseInt(e):1}function iRt(e){var t=e.match(JAt);if(!t)return NaN;var n=b9(t[1]),r=b9(t[2]),i=b9(t[3]);return fRt(n,r,i)?n*ole+r*ile+i*1e3:NaN}function b9(e){return e&&parseFloat(e.replace(",","."))||0}function oRt(e){if(e==="Z")return 0;var t=e.match(eRt);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return dRt(r,i)?n*(r*ole+i*ile):NaN}function sRt(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var i=r.getUTCDay()||7,o=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var aRt=[31,null,31,30,31,30,31,31,30,31,30,31];function IBe(e){return e%400===0||e%4===0&&e%100!==0}function lRt(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(aRt[t]||(IBe(e)?29:28))}function cRt(e,t){return t>=1&&t<=(IBe(e)?366:365)}function uRt(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function fRt(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function dRt(e,t){return t>=0&&t<=59}function hRt(e,t){un(2,arguments);var n=bn(e),r=Vr(t),i=n.getFullYear(),o=n.getDate(),s=new Date(0);s.setFullYear(i,r,15),s.setHours(0,0,0,0);var a=EBe(s);return n.setMonth(r,Math.min(o,a)),n}function pRt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setDate(r),n}function gRt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setHours(r),n}function mRt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setMilliseconds(r),n}function vRt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setMinutes(r),n}function yRt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return n.setSeconds(r),n}function bRt(e,t){un(2,arguments);var n=bn(e),r=Vr(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}const DBe={years:1e3*60*60*24*365};function xRt(e,t){return e===t?!0:e!==null&&t!=null?e[0]===t[0]&&e[1]===t[1]:!1}function wRt(e,t){const n=new Set,r=new Set,i={};for(const l of e)for(const c of l.timeSeriesArray){const{placeId:u,datasetId:f,variableName:d,valueDataKey:h,errorDataKey:p}=c.source;u!==null&&r.add(u);const g=`${f}.${d}.${h}`;n.add(g);let m=null;p&&(m=`${f}.${d}.${p}`,n.add(m)),c.data.forEach(v=>{const y=yT(v.time),b=`${u!==null?u:f}-${y}`,w=i[b];w?i[b]={...w,[g]:v[h]}:i[b]={placeId:u,time:y,[g]:v[h]},m!==null&&(i[b][m]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),s=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),s.push(u)}),s.sort((l,c)=>{const u=l[1],f=c[1],d=u.localeCompare(f);if(d!==0)return d;const h=l[0],p=c[0];return h.localeCompare(p)});const a={};return r.forEach(l=>{a[l]=Uae(t,l)}),{colNames:o,dataRows:s,referencedPlaces:a}}function SRt(e){let t=null;const n=e.features||[];for(const r of n){if(!r.properties)continue;const i=r.properties.time;if(typeof i!="string")continue;const s=KAt(i).getTime();if(!Number.isNaN(s))for(const a of Object.getOwnPropertyNames(r.properties)){let l=r.properties[a];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:s,countTot:1,mean:l};t===null&&(t={});const f=t[a];f?f.data.push(u):t[a]={source:{datasetId:e.id,datasetTitle:e.title,variableName:a,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return t===null?null:{placeGroup:e,timeSeries:t}}const cD=e=>e.dataState.datasets||[],_Rt=e=>e.dataState.colorBars,LBe=e=>e.dataState.timeSeriesGroups,uD=e=>e.dataState.userPlaceGroups,FBe=e=>e.dataState.userServers||[],CRt=e=>e.dataState.expressionCapabilities,ORt=e=>e.dataState.statistics.loading,ERt=e=>e.dataState.statistics.records,$Be=qt(cD,uD,(e,t)=>{const n={},r=[];return e.forEach(i=>{i.placeGroups&&i.placeGroups.forEach(o=>{n[o.id]||(n[o.id]=o,r.push(o))})}),[...r,...t]}),TRt=qt($Be,e=>{const t=[];return e.forEach(n=>{const r=SRt(n);r!==null&&t.push(r)}),t}),PRt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",NBe=new Image;NBe.src=PRt;const Xee="_alpha",Yee="_r";function kRt(e){let t=e;const n=t.endsWith(Xee);n&&(t=t.slice(0,t.length-Xee.length));const r=t.endsWith(Yee);return r&&(t=t.slice(0,t.length-Yee.length)),{baseName:t,isAlpha:n,isReversed:r}}function j5(e){let t=e.baseName;return e.isReversed&&(t+=Yee),e.isAlpha&&(t+=Xee),t}function MRt(e,t,n){RRt(e,t).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const s=o.createPattern(NBe,"repeat");s!==null?o.fillStyle=s:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function ARt(e,t){return new Promise((n,r)=>{const i=new Image,o=e.imageData;if(!o){n(i);return}i.onload=()=>{n(i)},i.onerror=(s,a,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function RRt(e,t){return ARt(e).then(n=>{const r=IRt(e,t,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function IRt(e,t,n){const r=document.createElement("canvas");r.width=n.width||1,r.height=n.height||1;const i=r.getContext("2d");if(i===null)return null;i.drawImage(n,0,0);let s=i.getImageData(0,0,r.width,r.height).data;if(e.isReversed){const a=new Uint8ClampedArray(s.length);for(let l=0;le.controlState.selectedDatasetId,iS=e=>e.controlState.selectedVariableName,ule=e=>e.controlState.selectedDataset2Id,fle=e=>e.controlState.selectedVariable2Name,dle=e=>e.controlState.selectedPlaceGroupIds,oS=e=>e.controlState.selectedPlaceId,fD=e=>e.controlState.selectedTime,DRt=e=>e.controlState.selectedServerId,LRt=e=>e.controlState.activities,nU=e=>e.controlState.timeAnimationActive,dD=e=>e.controlState.imageSmoothingEnabled,zBe=e=>e.controlState.userBaseMaps,jBe=e=>e.controlState.userOverlays,FRt=e=>e.controlState.layerVisibilities.datasetBoundary,$Rt=e=>e.controlState.layerVisibilities.datasetVariable,NRt=e=>e.controlState.layerVisibilities.datasetVariable2,zRt=e=>e.controlState.layerVisibilities.datasetRgb,jRt=e=>e.controlState.layerVisibilities.datasetRgb2,BRt=e=>e.controlState.layerVisibilities.datasetPlaces,BBe=e=>e.controlState.layerVisibilities.userPlaces,rU=e=>e.controlState.layerVisibilities,UBe=e=>e.controlState.infoCardElementStates,wv=e=>e.controlState.mapProjection,URt=e=>e.controlState.timeChunkSize,VRt=e=>e.controlState.userPlacesFormatName,WRt=e=>e.controlState.userPlacesFormatOptions.csv,HRt=e=>e.controlState.userPlacesFormatOptions.geojson,GRt=e=>e.controlState.userPlacesFormatOptions.wkt,sS=e=>e.controlState.userColorBars,qRt=e=>On.instance.branding.allowUserVariables,XRt=e=>e.controlState.zoomLevel,YRt=e=>e.controlState.datasetZLevel,QRt=()=>"variable",KRt=()=>"variable2",ZRt=()=>"rgb",JRt=()=>"rgb2",eIt=()=>13,tIt=()=>12,nIt=()=>11,rIt=()=>10,Co=qt(cD,CT,rO),Sv=qt(cD,ule,rO),VBe=e=>e&&(e.title||e.id)?e.title:null,WBe=qt(Co,VBe),HBe=qt(Sv,VBe),iIt=qt(Co,e=>e&&e.variables||[]),oIt=qt(Co,e=>e?Gae(e)[1]:[]),sIt=e=>e&&e.resolutions?e.resolutions:[],GBe=qt(Co,sIt),aIt=e=>e&&e.spatialUnits?e.spatialUnits:null,lIt=qt(Co,aIt),cIt=qt(GBe,lIt,YRt,wv,vTt),qBe=(e,t)=>!e||!t?null:Fee(e,t),ec=qt(Co,iS,qBe),_v=qt(Sv,fle,qBe),XBe=e=>e&&(e.title||e.name),uIt=qt(ec,XBe),fIt=qt(_v,XBe),YBe=e=>e&&e.units||"-",dIt=qt(ec,YBe),hIt=qt(_v,YBe),QBe=e=>e&&e.colorBarName||"viridis",iU=qt(ec,QBe),oU=qt(_v,QBe),KBe=e=>e?[e.colorBarMin,e.colorBarMax]:[0,1],ZBe=qt(ec,KBe),JBe=qt(_v,KBe),e4e=e=>(e&&e.colorBarNorm)==="log"?"log":"lin",t4e=qt(ec,e4e),n4e=qt(_v,e4e),sU=qt(sS,_Rt,(e,t)=>{const n={title:Aje,description:"User-defined color bars.",names:e.map(i=>i.id)},r={};return e.forEach(({id:i,imageData:o})=>{o&&(r[i]=o)}),t?{...t,groups:[n,...t.groups],images:{...t.images,...r}}:{groups:[n],images:r,customColorMaps:{}}}),r4e=(e,t,n)=>{const r=kRt(e),{baseName:i}=r,o=t.images[i],s=n.find(a=>a.id===i);if(s){const a=s.type,l=Ije(s.code);return{...r,imageData:o,type:a,colorRecords:l}}else{const a=t.customColorMaps[i];if(a){const l=a.type,c=a.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},hle=qt(iU,sU,sS,r4e),i4e=qt(oU,sU,sS,r4e),o4e=(e,t,n)=>{const{baseName:r}=e,i=n.find(o=>o.id===r);if(i){const o=Ije(i.code);if(o)return JSON.stringify({name:t,type:i.type,colors:o.map(s=>[s.value,s.color])})}return null},pIt=qt(hle,iU,sS,o4e),gIt=qt(i4e,oU,sS,o4e),s4e=e=>!e||typeof e.opacity!="number"?1:e.opacity,a4e=qt(ec,s4e),l4e=qt(_v,s4e),mIt=qt(Co,e=>e!==null?Mje(e):null),vIt=qt(Co,e=>e!==null&&e.rgbSchema||null),yIt=qt(Sv,e=>e!==null&&e.rgbSchema||null),c4e=qt(Co,e=>e&&e.placeGroups||[]),hD=qt(c4e,uD,(e,t)=>e.concat(t));function u4e(e,t){const n=[];return t!==null&&t.length>0&&e.forEach(r=>{t.indexOf(r.id)>-1&&n.push(r)}),n}const bIt=qt(uD,dle,BBe,(e,t)=>{const n={},r=new Set(t||[]);return e.forEach(i=>{n[i.id]=r.has(i.id)}),n}),f4e=qt(c4e,dle,u4e),OT=qt(hD,dle,u4e),xIt=qt(OT,e=>e.map(t=>t.title||t.id).join(", ")),pD=qt(OT,e=>{const t=e.map(n=>vT(n)?n.features:[]);return[].concat(...t)}),ple=qt(pD,oS,(e,t)=>e.find(n=>n.id===t)||null),wIt=qt(ple,e=>e?.geometry||null),gD=qt(OT,oS,(e,t)=>e.length===0||t===null?null:AOt(e,t)),SIt=qt(CT,iS,ple,(e,t,n)=>{if(e&&t){if(!n)return`${e}-${t}-all`;if(n.geometry.type==="Polygon"||n.geometry.type==="MultiPolygon")return`${e}-${t}-${n.id}`}return null}),d4e=qt(LBe,CT,iS,oS,(e,t,n,r)=>{if(!t||!n||!r)return!1;for(const i of e)for(const o of i.timeSeriesArray){const s=o.source;if(s.datasetId===t&&s.variableName===n&&s.placeId===r)return!1}return!0}),_It=qt(LBe,hD,(e,t)=>{const n={};return Bae(t,(r,i)=>{for(const o of e)if(o.timeSeriesArray.find(s=>s.source.placeId===i.id)){n[i.id]=q6(r,i);break}}),n}),h4e=qt(CT,iS,oS,(e,t,n)=>!!(e&&t&&n)),CIt=qt(ERt,hD,(e,t)=>{const n=[];return e.forEach(r=>{const i=r.source.placeInfo.place.id;Bae(t,(o,s)=>{if(s.id===i){const a=q6(o,s);n.push({...r,source:{...r.source,placeInfo:a}})}})}),n}),OIt=qt(OT,e=>{const t=[];return Bae(e,(n,r)=>{t.push(q6(n,r).label)}),t}),EIt=qt(ec,URt,(e,t)=>{if(e&&e.timeChunkSize){const n=e.timeChunkSize;return n*Math.ceil(t/n)}return t}),p4e=e=>e&&kje(e)||null,ET=qt(Co,p4e),TIt=qt(Sv,p4e),g4e=e=>e&&e.attributions||null,gle=qt(Co,g4e),PIt=qt(Sv,g4e),m4e=e=>e===null||e.coordinates.length===0?null:e.coordinates,Qee=qt(ET,m4e),kIt=qt(ET,m4e),v4e=(e,t)=>e===null||t===null?-1:pBe(t,e),y4e=qt(fD,Qee,v4e),MIt=qt(fD,kIt,v4e),b4e=(e,t,n)=>e===null?null:n&&t>-1?n.labels[t]:new Date(e).toISOString(),aS=qt(fD,y4e,ET,b4e),AIt=qt(fD,MIt,TIt,b4e);function RIt(e,t){if(e!==qI){const n=typeof t=="number"?t+1:20;return new nle({tileSize:[256,256],origin:[-180,90],extent:[-180,-90,180,90],resolutions:Array.from({length:n},(r,i)=>180/256/Math.pow(2,i))})}}function IIt(e,t,n,r,i,o,s,a,l){return new _T({url:e,projection:t,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:s,maxZoom:l,crossOrigin:"Anonymous"})}function DIt(e){if(e)return(t,n)=>{t instanceof Wae&&(e.getView().getInteracting()?e.once("moveend",function(){t.getImage().src=n}):t.getImage().src=n)}}const LIt=CTt(DIt,{serializer:e=>{const t=e[0];if(t){const n=t.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function FIt(){const e=Qs.map;return LIt(e)}function x4e(e,t,n,r,i,o,s,a,l,c,u,f,d=10){a!==null&&(o=[...o,["time",a]]);const h=xv(t,o);typeof i=="number"&&(i+=3);const p=RIt(c,i),g=IIt(h,c,p,u,l,f,FIt(),r,i),m=c===Jw?n:L5e(n,"EPSG:4326",c);return O.jsx(hBe,{id:e,source:g,extent:m,zIndex:d,opacity:s})}const $It=qt(Co,wv,FRt,(e,t,n)=>{if(!e||!n)return null;let r=e.geometry;if(!r)if(e.bbox){const[s,a,l,c]=e.bbox;r={type:"Polygon",coordinates:[[[s,a],[l,a],[l,c],[s,c],[s,a]]]}}else return console.warn(`Dataset ${e.id} has no bbox!`),null;const i=new sD({features:new rS({dataProjection:Jw,featureProjection:t}).readFeatures({type:"Feature",geometry:r})}),o=new Cp({stroke:new zp({color:"orange",width:3,lineDash:[2,4]})});return O.jsx(eU,{id:`${e.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),Go=qt(FBe,DRt,(e,t)=>{if(e.length===0)throw new Error("internal error: no servers configured");const n=e.find(r=>r.id===t);if(!n)throw new Error(`internal error: server with ID "${t}" not found`);return n}),w4e=(e,t,n,r,i,o,s,a,l,c,u,f,d,h,p,g)=>{if(!t||!i||!u)return null;const m=[["crs",p],["vmin",`${s[0]}`],["vmax",`${s[1]}`],["cmap",l||o]];return a==="log"&&m.push(["norm",a]),x4e(f,_4e(e.url,t,i),t.bbox,i.tileLevelMin,i.tileLevelMax,m,c,n,h,p,r,g,d)},NIt=qt(Go,Co,aS,gle,ec,iU,ZBe,t4e,pIt,a4e,$Rt,QRt,eIt,nU,wv,dD,w4e),zIt=qt(Go,Sv,AIt,PIt,_v,oU,JBe,n4e,gIt,l4e,NRt,KRt,tIt,nU,wv,dD,w4e),S4e=(e,t,n,r,i,o,s,a,l,c,u)=>{if(!t||!n||!r)return null;const f=[["crs",l]];return x4e(i,_4e(e.url,t,"rgb"),t.bbox,n.tileLevelMin,n.tileLevelMax,f,1,s,a,l,c,u,o)},jIt=qt(Go,Co,vIt,zRt,ZRt,nIt,aS,nU,wv,gle,dD,S4e),BIt=qt(Go,Sv,yIt,jRt,JRt,rIt,aS,nU,wv,gle,dD,S4e);function _4e(e,t,n){return`${e}/tiles/${xT(t)}/${nD(n)}/{z}/{y}/{x}`}function UIt(){return pae()}function VIt(){return new iD({fill:O4e(),stroke:C4e(),radius:6})}function C4e(){return new zp({color:[200,0,0,.75],width:1.25})}function O4e(){return new tw({color:[255,0,0,UIt()]})}function WIt(){return new Cp({image:VIt(),stroke:C4e(),fill:O4e()})}const HIt=qt(f4e,wv,BRt,(e,t,n)=>{if(!n||e.length===0)return null;const r=[];return e.forEach((i,o)=>{vT(i)&&r.push(O.jsx(eU,{id:`placeGroup.${i.id}`,style:WIt(),zIndex:100,source:new sD({features:new rS({dataProjection:Jw,featureProjection:t}).readFeatures(i)})},o))}),O.jsx(uBe,{children:r})}),GIt=qt(UBe,e=>{const t=[];return Object.getOwnPropertyNames(e).forEach(n=>{e[n].visible&&t.push(n)}),t}),qIt=qt(UBe,e=>{const t={};return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=e[n].viewMode||"text"}),t}),XIt=qt(LRt,e=>Object.keys(e).map(t=>e[t])),YIt=e=>v5e("baseMaps"),QIt=e=>v5e("overlays"),E4e=qt(zBe,YIt,(e,t)=>[...e,...t.length?t:y5e]),T4e=qt(jBe,QIt,(e,t)=>[...e,...t.length?t:n_t]),P4e=(e,t,n)=>e.filter(r=>t[r.id]).map(r=>KIt(r,n)),KIt=(e,t)=>{let n=e.attribution;n&&(n.startsWith("http://")||n.startsWith("https://"))&&(n=`© ${e.title}`);let r;if(e.wms){const{layerName:i,styleName:o}=e.wms;r=new w2t({url:e.url,params:{...o?{STYLES:o}:{},LAYERS:i},attributions:n,attributionsCollapsible:!0})}else r=new _T({url:e.url,attributions:n,attributionsCollapsible:!0});return O.jsx(hBe,{id:e.id,source:r,zIndex:t},e.id)},ZIt=qt(E4e,rU,()=>0,P4e),JIt=qt(T4e,rU,()=>20,P4e),eDt=qt(Co,Sv,ec,_v,E4e,T4e,rU,(e,t,n,r,i,o,s)=>{const a={datasetRgb:{id:"datasetRgb",title:"Dataset RGB",subTitle:e?e.title:void 0,visible:s.datasetRgb,disabled:!(e&&e.rgbSchema)},datasetRgb2:{id:"datasetRgb2",title:"Dataset RGB",subTitle:t?t.title:void 0,visible:s.datasetRgb2,disabled:!(t&&t.rgbSchema),pinned:!0},datasetVariable:{id:"datasetVariable",title:"Dataset Variable",subTitle:e&&n?`${e.title} / ${n.title||n.name}`:void 0,visible:s.datasetVariable,disabled:!(e&&n)},datasetVariable2:{id:"datasetVariable2",title:"Dataset Variable",subTitle:t&&r?`${t.title} / ${r.title||r.name}`:void 0,visible:s.datasetVariable2,disabled:!(t&&r),pinned:!0},datasetBoundary:{id:"datasetBoundary",title:"Dataset Boundary",subTitle:e?e.title:void 0,visible:s.datasetBoundary,disabled:!e},datasetPlaces:{id:"datasetPlaces",title:"Dataset Places",visible:s.datasetPlaces},userPlaces:{id:"userPlaces",title:"User Places",visible:s.userPlaces}};return i.forEach(l=>{a[l.id]=Q1e(l,"baseMaps",s[l.id])}),o.forEach(l=>{a[l.id]=Q1e(l,"overlays",s[l.id])}),a});function Q1e(e,t,n){return{id:e.id,title:e.title,exclusive:e.exclusive,type:t,visible:n}}function V2(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var x9={exports:{}};var K1e;function tDt(){return K1e||(K1e=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,i,o){function s(c,u){if(!i[c]){if(!r[c]){var f=typeof V2=="function"&&V2;if(!u&&f)return f(c,!0);if(a)return a(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[c]={exports:{}};r[c][0].call(h.exports,function(p){var g=r[c][1][p];return s(g||p)},h,h.exports,n,r,i,o)}return i[c].exports}for(var a=typeof V2=="function"&&V2,l=0;l>2,h=(3&c)<<4|u>>4,p=1>6:64,g=2>4,u=(15&d)<<4|(h=a.indexOf(l.charAt(g++)))>>2,f=(3&h)<<6|(p=a.indexOf(l.charAt(g++))),y[m++]=c,h!==64&&(y[m++]=u),p!==64&&(y[m++]=f);return y}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,f,d,h,p){this.compressedSize=u,this.uncompressedSize=f,this.crc32=d,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,d){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var o=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var o=n("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?(function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u[g])];return-1^c})(0|l,a,a.length,0):(function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u.charCodeAt(g))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=o?"uint8array":"array";function u(f,d){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=d,this.meta={}}i.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(d){f.push({data:d,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function o(h,p){var g,m="";for(g=0;g>>=8;return m}function s(h,p,g,m,v,y){var b,w,S=h.file,_=h.compression,E=y!==c.utf8encode,T=a.transformTo("string",y(S.name)),k=a.transformTo("string",c.utf8encode(S.name)),P=S.comment,I=a.transformTo("string",y(P)),R=a.transformTo("string",c.utf8encode(P)),F=k.length!==S.name.length,A=R.length!==P.length,L="",$="",j="",V=S.dir,U=S.date,z={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(z.crc32=h.crc32,z.compressedSize=h.compressedSize,z.uncompressedSize=h.uncompressedSize);var N=0;p&&(N|=8),E||!F&&!A||(N|=2048);var B=0,H=0;V&&(B|=16),v==="UNIX"?(H=798,B|=(function(Y,Z){var ge=Y;return Y||(ge=Z?16893:33204),(65535&ge)<<16})(S.unixPermissions,V)):(H=20,B|=(function(Y){return 63&(Y||0)})(S.dosPermissions)),b=U.getUTCHours(),b<<=6,b|=U.getUTCMinutes(),b<<=5,b|=U.getUTCSeconds()/2,w=U.getUTCFullYear()-1980,w<<=4,w|=U.getUTCMonth()+1,w<<=5,w|=U.getUTCDate(),F&&($=o(1,1)+o(u(T),4)+k,L+="up"+o($.length,2)+$),A&&(j=o(1,1)+o(u(I),4)+R,L+="uc"+o(j.length,2)+j);var Q="";return Q+=` +\0`,Q+=o(N,2),Q+=_.magic,Q+=o(b,2),Q+=o(w,2),Q+=o(z.crc32,4),Q+=o(z.compressedSize,4),Q+=o(z.uncompressedSize,4),Q+=o(T.length,2),Q+=o(L.length,2),{fileRecord:f.LOCAL_FILE_HEADER+Q+T+L,dirRecord:f.CENTRAL_FILE_HEADER+o(H,2)+Q+o(I.length,2)+"\0\0\0\0"+o(B,4)+o(m,4)+T+L+I}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function d(h,p,g,m){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=m,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,g=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-m-1))/g:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var g=s(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,g=s(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:(function(m){return f.DATA_DESCRIPTOR+o(m.crc32,4)+o(m.compressedSize,4)+o(m.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||s.uint8array?d==="nodebuffer"?new c(f):s.uint8array?new u(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var o=n("./GenericWorker"),s=n("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),s=n("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l "+s:s}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,g){return new u.Promise(function(m,v){var y=[],b=p._internalType,w=p._outputType,S=p._mimeType;p.on("data",function(_,E){y.push(_),g&&g(E)}).on("error",function(_){y=[],v(_)}).on("end",function(){try{var _=(function(E,T,k){switch(E){case"blob":return o.newBlob(o.transformTo("arraybuffer",T),k);case"base64":return l.encode(T);default:return o.transformTo(E,T)}})(w,(function(E,T){var k,P=0,I=null,R=0;for(k=0;k"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var o=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return s.nodebuffer?a.newBufferFrom(h,"utf-8"):(function(p){var g,m,v,y,b,w=p.length,S=0;for(y=0;y>>6:(m<65536?g[b++]=224|m>>>12:(g[b++]=240|m>>>18,g[b++]=128|m>>>12&63),g[b++]=128|m>>>6&63),g[b++]=128|63&m);return g})(h)},i.utf8decode=function(h){return s.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):(function(p){var g,m,v,y,b=p.length,w=new Array(2*b);for(g=m=0;g>10&1023,w[m++]=56320|1023&v)}return w.length!==m&&(w.subarray?w=w.subarray(0,m):w.length=m),o.applyFromCharCode(w)})(h=o.transformTo(s.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(s.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var m=(function(y,b){var w;for((b=b||y.length)>y.length&&(b=y.length),w=b-1;0<=w&&(192&y[w])==128;)w--;return w<0||w===0?b:w+c[y[w]]>b?w:b})(p),v=p;m!==p.length&&(s.uint8array?(v=p.subarray(0,m),this.leftOver=p.subarray(m,p.length)):(v=p.slice(0,m),this.leftOver=p.slice(m,p.length))),this.push({data:i.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var o=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(g){return g}function u(g,m){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,g,m,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?d[m++]=224|h>>>12:(d[m++]=240|h>>>18,d[m++]=128|h>>>12&63),d[m++]=128|h>>>6&63),d[m++]=128|63&h);return d},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,p=d.length;h>10&1023,y[p++]=56320|1023&g)}return u(y,p)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(n,r,i){r.exports=function(o,s,a,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,c){var u=o,f=c+l;s^=-1;for(var d=c;d>>8^u[255&(s^a[d])];return-1^s}},{}],46:[function(n,r,i){var o,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,d=4,h=0,p=-2,g=-1,m=4,v=2,y=8,b=9,w=286,S=30,_=19,E=2*w+1,T=15,k=3,P=258,I=P+k+1,R=42,F=113,A=1,L=2,$=3,j=4;function V(G,ce){return G.msg=u[ce],ce}function U(G){return(G<<1)-(4G.avail_out&&(pe=G.avail_out),pe!==0&&(s.arraySet(G.output,ce.pending_buf,ce.pending_out,pe,G.next_out),G.next_out+=pe,ce.pending_out+=pe,G.total_out+=pe,G.avail_out-=pe,ce.pending-=pe,ce.pending===0&&(ce.pending_out=0))}function B(G,ce){a._tr_flush_block(G,0<=G.block_start?G.block_start:-1,G.strstart-G.block_start,ce),G.block_start=G.strstart,N(G.strm)}function H(G,ce){G.pending_buf[G.pending++]=ce}function Q(G,ce){G.pending_buf[G.pending++]=ce>>>8&255,G.pending_buf[G.pending++]=255&ce}function Y(G,ce){var pe,J,te=G.max_chain_length,ae=G.strstart,we=G.prev_length,Pe=G.nice_match,ee=G.strstart>G.w_size-I?G.strstart-(G.w_size-I):0,re=G.window,Se=G.w_mask,he=G.prev,xe=G.strstart+P,me=re[ae+we-1],be=re[ae+we];G.prev_length>=G.good_match&&(te>>=2),Pe>G.lookahead&&(Pe=G.lookahead);do if(re[(pe=ce)+we]===be&&re[pe+we-1]===me&&re[pe]===re[ae]&&re[++pe]===re[ae+1]){ae+=2,pe++;do;while(re[++ae]===re[++pe]&&re[++ae]===re[++pe]&&re[++ae]===re[++pe]&&re[++ae]===re[++pe]&&re[++ae]===re[++pe]&&re[++ae]===re[++pe]&&re[++ae]===re[++pe]&&re[++ae]===re[++pe]&&aeee&&--te!=0);return we<=G.lookahead?we:G.lookahead}function Z(G){var ce,pe,J,te,ae,we,Pe,ee,re,Se,he=G.w_size;do{if(te=G.window_size-G.lookahead-G.strstart,G.strstart>=he+(he-I)){for(s.arraySet(G.window,G.window,he,he,0),G.match_start-=he,G.strstart-=he,G.block_start-=he,ce=pe=G.hash_size;J=G.head[--ce],G.head[ce]=he<=J?J-he:0,--pe;);for(ce=pe=he;J=G.prev[--ce],G.prev[ce]=he<=J?J-he:0,--pe;);te+=he}if(G.strm.avail_in===0)break;if(we=G.strm,Pe=G.window,ee=G.strstart+G.lookahead,re=te,Se=void 0,Se=we.avail_in,re=k)for(ae=G.strstart-G.insert,G.ins_h=G.window[ae],G.ins_h=(G.ins_h<=k&&(G.ins_h=(G.ins_h<=k)if(J=a._tr_tally(G,G.strstart-G.match_start,G.match_length-k),G.lookahead-=G.match_length,G.match_length<=G.max_lazy_match&&G.lookahead>=k){for(G.match_length--;G.strstart++,G.ins_h=(G.ins_h<=k&&(G.ins_h=(G.ins_h<=k&&G.match_length<=G.prev_length){for(te=G.strstart+G.lookahead-k,J=a._tr_tally(G,G.strstart-1-G.prev_match,G.prev_length-k),G.lookahead-=G.prev_length-1,G.prev_length-=2;++G.strstart<=te&&(G.ins_h=(G.ins_h<G.pending_buf_size-5&&(pe=G.pending_buf_size-5);;){if(G.lookahead<=1){if(Z(G),G.lookahead===0&&ce===f)return A;if(G.lookahead===0)break}G.strstart+=G.lookahead,G.lookahead=0;var J=G.block_start+pe;if((G.strstart===0||G.strstart>=J)&&(G.lookahead=G.strstart-J,G.strstart=J,B(G,!1),G.strm.avail_out===0)||G.strstart-G.block_start>=G.w_size-I&&(B(G,!1),G.strm.avail_out===0))return A}return G.insert=0,ce===d?(B(G,!0),G.strm.avail_out===0?$:j):(G.strstart>G.block_start&&(B(G,!1),G.strm.avail_out),A)}),new ie(4,4,8,4,ge),new ie(4,5,16,8,ge),new ie(4,6,32,32,ge),new ie(4,4,16,16,ne),new ie(8,16,32,32,ne),new ie(8,16,128,128,ne),new ie(8,32,128,256,ne),new ie(32,128,258,1024,ne),new ie(32,258,258,4096,ne)],i.deflateInit=function(G,ce){return ue(G,ce,y,15,8,0)},i.deflateInit2=ue,i.deflateReset=se,i.deflateResetKeep=ve,i.deflateSetHeader=function(G,ce){return G&&G.state?G.state.wrap!==2?p:(G.state.gzhead=ce,h):p},i.deflate=function(G,ce){var pe,J,te,ae;if(!G||!G.state||5>8&255),H(J,J.gzhead.time>>16&255),H(J,J.gzhead.time>>24&255),H(J,J.level===9?2:2<=J.strategy||J.level<2?4:0),H(J,255&J.gzhead.os),J.gzhead.extra&&J.gzhead.extra.length&&(H(J,255&J.gzhead.extra.length),H(J,J.gzhead.extra.length>>8&255)),J.gzhead.hcrc&&(G.adler=c(G.adler,J.pending_buf,J.pending,0)),J.gzindex=0,J.status=69):(H(J,0),H(J,0),H(J,0),H(J,0),H(J,0),H(J,J.level===9?2:2<=J.strategy||J.level<2?4:0),H(J,3),J.status=F);else{var we=y+(J.w_bits-8<<4)<<8;we|=(2<=J.strategy||J.level<2?0:J.level<6?1:J.level===6?2:3)<<6,J.strstart!==0&&(we|=32),we+=31-we%31,J.status=F,Q(J,we),J.strstart!==0&&(Q(J,G.adler>>>16),Q(J,65535&G.adler)),G.adler=1}if(J.status===69)if(J.gzhead.extra){for(te=J.pending;J.gzindex<(65535&J.gzhead.extra.length)&&(J.pending!==J.pending_buf_size||(J.gzhead.hcrc&&J.pending>te&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),N(G),te=J.pending,J.pending!==J.pending_buf_size));)H(J,255&J.gzhead.extra[J.gzindex]),J.gzindex++;J.gzhead.hcrc&&J.pending>te&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),J.gzindex===J.gzhead.extra.length&&(J.gzindex=0,J.status=73)}else J.status=73;if(J.status===73)if(J.gzhead.name){te=J.pending;do{if(J.pending===J.pending_buf_size&&(J.gzhead.hcrc&&J.pending>te&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),N(G),te=J.pending,J.pending===J.pending_buf_size)){ae=1;break}ae=J.gzindexte&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),ae===0&&(J.gzindex=0,J.status=91)}else J.status=91;if(J.status===91)if(J.gzhead.comment){te=J.pending;do{if(J.pending===J.pending_buf_size&&(J.gzhead.hcrc&&J.pending>te&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),N(G),te=J.pending,J.pending===J.pending_buf_size)){ae=1;break}ae=J.gzindexte&&(G.adler=c(G.adler,J.pending_buf,J.pending-te,te)),ae===0&&(J.status=103)}else J.status=103;if(J.status===103&&(J.gzhead.hcrc?(J.pending+2>J.pending_buf_size&&N(G),J.pending+2<=J.pending_buf_size&&(H(J,255&G.adler),H(J,G.adler>>8&255),G.adler=0,J.status=F)):J.status=F),J.pending!==0){if(N(G),G.avail_out===0)return J.last_flush=-1,h}else if(G.avail_in===0&&U(ce)<=U(pe)&&ce!==d)return V(G,-5);if(J.status===666&&G.avail_in!==0)return V(G,-5);if(G.avail_in!==0||J.lookahead!==0||ce!==f&&J.status!==666){var Pe=J.strategy===2?(function(ee,re){for(var Se;;){if(ee.lookahead===0&&(Z(ee),ee.lookahead===0)){if(re===f)return A;break}if(ee.match_length=0,Se=a._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++,Se&&(B(ee,!1),ee.strm.avail_out===0))return A}return ee.insert=0,re===d?(B(ee,!0),ee.strm.avail_out===0?$:j):ee.last_lit&&(B(ee,!1),ee.strm.avail_out===0)?A:L})(J,ce):J.strategy===3?(function(ee,re){for(var Se,he,xe,me,be=ee.window;;){if(ee.lookahead<=P){if(Z(ee),ee.lookahead<=P&&re===f)return A;if(ee.lookahead===0)break}if(ee.match_length=0,ee.lookahead>=k&&0ee.lookahead&&(ee.match_length=ee.lookahead)}if(ee.match_length>=k?(Se=a._tr_tally(ee,1,ee.match_length-k),ee.lookahead-=ee.match_length,ee.strstart+=ee.match_length,ee.match_length=0):(Se=a._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++),Se&&(B(ee,!1),ee.strm.avail_out===0))return A}return ee.insert=0,re===d?(B(ee,!0),ee.strm.avail_out===0?$:j):ee.last_lit&&(B(ee,!1),ee.strm.avail_out===0)?A:L})(J,ce):o[J.level].func(J,ce);if(Pe!==$&&Pe!==j||(J.status=666),Pe===A||Pe===$)return G.avail_out===0&&(J.last_flush=-1),h;if(Pe===L&&(ce===1?a._tr_align(J):ce!==5&&(a._tr_stored_block(J,0,0,!1),ce===3&&(z(J.head),J.lookahead===0&&(J.strstart=0,J.block_start=0,J.insert=0))),N(G),G.avail_out===0))return J.last_flush=-1,h}return ce!==d?h:J.wrap<=0?1:(J.wrap===2?(H(J,255&G.adler),H(J,G.adler>>8&255),H(J,G.adler>>16&255),H(J,G.adler>>24&255),H(J,255&G.total_in),H(J,G.total_in>>8&255),H(J,G.total_in>>16&255),H(J,G.total_in>>24&255)):(Q(J,G.adler>>>16),Q(J,65535&G.adler)),N(G),0=pe.w_size&&(ae===0&&(z(pe.head),pe.strstart=0,pe.block_start=0,pe.insert=0),re=new s.Buf8(pe.w_size),s.arraySet(re,ce,Se-pe.w_size,pe.w_size,0),ce=re,Se=pe.w_size),we=G.avail_in,Pe=G.next_in,ee=G.input,G.avail_in=Se,G.next_in=0,G.input=ce,Z(pe);pe.lookahead>=k;){for(J=pe.strstart,te=pe.lookahead-(k-1);pe.ins_h=(pe.ins_h<>>=k=T>>>24,b-=k,(k=T>>>16&255)===0)L[u++]=65535&T;else{if(!(16&k)){if((64&k)==0){T=w[(65535&T)+(y&(1<>>=k,b-=k),b<15&&(y+=A[l++]<>>=k=T>>>24,b-=k,!(16&(k=T>>>16&255))){if((64&k)==0){T=S[(65535&T)+(y&(1<>>=k,b-=k,(k=u-f)>3,y&=(1<<(b-=P<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(R){var F;return R&&R.state?(F=R.state,R.total_in=R.total_out=F.total=0,R.msg="",F.wrap&&(R.adler=1&F.wrap),F.mode=p,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(g),F.distcode=F.distdyn=new o.Buf32(m),F.sane=1,F.back=-1,d):h}function w(R){var F;return R&&R.state?((F=R.state).wsize=0,F.whave=0,F.wnext=0,b(R)):h}function S(R,F){var A,L;return R&&R.state?(L=R.state,F<0?(A=0,F=-F):(A=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=j.wsize?(o.arraySet(j.window,F,A-j.wsize,j.wsize,0),j.wnext=0,j.whave=j.wsize):(L<($=j.wsize-j.wnext)&&($=L),o.arraySet(j.window,F,A-L,$,j.wnext),(L-=$)?(o.arraySet(j.window,F,A-L,L,0),j.wnext=L,j.whave=j.wsize):(j.wnext+=$,j.wnext===j.wsize&&(j.wnext=0),j.whave>>8&255,A.check=a(A.check,ae,2,0),B=N=0,A.mode=2;break}if(A.flags=0,A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&N)<<8)+(N>>8))%31){R.msg="incorrect header check",A.mode=30;break}if((15&N)!=8){R.msg="unknown compression method",A.mode=30;break}if(B-=4,G=8+(15&(N>>>=4)),A.wbits===0)A.wbits=G;else if(G>A.wbits){R.msg="invalid window size",A.mode=30;break}A.dmax=1<>8&1),512&A.flags&&(ae[0]=255&N,ae[1]=N>>>8&255,A.check=a(A.check,ae,2,0)),B=N=0,A.mode=3;case 3:for(;B<32;){if(U===0)break e;U--,N+=L[j++]<>>8&255,ae[2]=N>>>16&255,ae[3]=N>>>24&255,A.check=a(A.check,ae,4,0)),B=N=0,A.mode=4;case 4:for(;B<16;){if(U===0)break e;U--,N+=L[j++]<>8),512&A.flags&&(ae[0]=255&N,ae[1]=N>>>8&255,A.check=a(A.check,ae,2,0)),B=N=0,A.mode=5;case 5:if(1024&A.flags){for(;B<16;){if(U===0)break e;U--,N+=L[j++]<>>8&255,A.check=a(A.check,ae,2,0)),B=N=0}else A.head&&(A.head.extra=null);A.mode=6;case 6:if(1024&A.flags&&(U<(Y=A.length)&&(Y=U),Y&&(A.head&&(G=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Array(A.head.extra_len)),o.arraySet(A.head.extra,L,j,Y,G)),512&A.flags&&(A.check=a(A.check,L,Y,j)),U-=Y,j+=Y,A.length-=Y),A.length))break e;A.length=0,A.mode=7;case 7:if(2048&A.flags){if(U===0)break e;for(Y=0;G=L[j+Y++],A.head&&G&&A.length<65536&&(A.head.name+=String.fromCharCode(G)),G&&Y>9&1,A.head.done=!0),R.adler=A.check=0,A.mode=12;break;case 10:for(;B<32;){if(U===0)break e;U--,N+=L[j++]<>>=7&B,B-=7&B,A.mode=27;break}for(;B<3;){if(U===0)break e;U--,N+=L[j++]<>>=1)){case 0:A.mode=14;break;case 1:if(P(A),A.mode=20,F!==6)break;N>>>=2,B-=2;break e;case 2:A.mode=17;break;case 3:R.msg="invalid block type",A.mode=30}N>>>=2,B-=2;break;case 14:for(N>>>=7&B,B-=7&B;B<32;){if(U===0)break e;U--,N+=L[j++]<>>16^65535)){R.msg="invalid stored block lengths",A.mode=30;break}if(A.length=65535&N,B=N=0,A.mode=15,F===6)break e;case 15:A.mode=16;case 16:if(Y=A.length){if(U>>=5,B-=5,A.ndist=1+(31&N),N>>>=5,B-=5,A.ncode=4+(15&N),N>>>=4,B-=4,286>>=3,B-=3}for(;A.have<19;)A.lens[we[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,pe={bits:A.lenbits},ce=c(0,A.lens,0,19,A.lencode,0,A.work,pe),A.lenbits=pe.bits,ce){R.msg="invalid code lengths set",A.mode=30;break}A.have=0,A.mode=19;case 19:for(;A.have>>16&255,fe=65535&te,!((ne=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>>=ne,B-=ne,A.lens[A.have++]=fe;else{if(fe===16){for(J=ne+2;B>>=ne,B-=ne,A.have===0){R.msg="invalid bit length repeat",A.mode=30;break}G=A.lens[A.have-1],Y=3+(3&N),N>>>=2,B-=2}else if(fe===17){for(J=ne+3;B>>=ne)),N>>>=3,B-=3}else{for(J=ne+7;B>>=ne)),N>>>=7,B-=7}if(A.have+Y>A.nlen+A.ndist){R.msg="invalid bit length repeat",A.mode=30;break}for(;Y--;)A.lens[A.have++]=G}}if(A.mode===30)break;if(A.lens[256]===0){R.msg="invalid code -- missing end-of-block",A.mode=30;break}if(A.lenbits=9,pe={bits:A.lenbits},ce=c(u,A.lens,0,A.nlen,A.lencode,0,A.work,pe),A.lenbits=pe.bits,ce){R.msg="invalid literal/lengths set",A.mode=30;break}if(A.distbits=6,A.distcode=A.distdyn,pe={bits:A.distbits},ce=c(f,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,pe),A.distbits=pe.bits,ce){R.msg="invalid distances set",A.mode=30;break}if(A.mode=20,F===6)break e;case 20:A.mode=21;case 21:if(6<=U&&258<=z){R.next_out=V,R.avail_out=z,R.next_in=j,R.avail_in=U,A.hold=N,A.bits=B,l(R,Q),V=R.next_out,$=R.output,z=R.avail_out,j=R.next_in,L=R.input,U=R.avail_in,N=A.hold,B=A.bits,A.mode===12&&(A.back=-1);break}for(A.back=0;ie=(te=A.lencode[N&(1<>>16&255,fe=65535&te,!((ne=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>ve)])>>>16&255,fe=65535&te,!(ve+(ne=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>>=ve,B-=ve,A.back+=ve}if(N>>>=ne,B-=ne,A.back+=ne,A.length=fe,ie===0){A.mode=26;break}if(32&ie){A.back=-1,A.mode=12;break}if(64&ie){R.msg="invalid literal/length code",A.mode=30;break}A.extra=15&ie,A.mode=22;case 22:if(A.extra){for(J=A.extra;B>>=A.extra,B-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=23;case 23:for(;ie=(te=A.distcode[N&(1<>>16&255,fe=65535&te,!((ne=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>ve)])>>>16&255,fe=65535&te,!(ve+(ne=te>>>24)<=B);){if(U===0)break e;U--,N+=L[j++]<>>=ve,B-=ve,A.back+=ve}if(N>>>=ne,B-=ne,A.back+=ne,64&ie){R.msg="invalid distance code",A.mode=30;break}A.offset=fe,A.extra=15&ie,A.mode=24;case 24:if(A.extra){for(J=A.extra;B>>=A.extra,B-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){R.msg="invalid distance too far back",A.mode=30;break}A.mode=25;case 25:if(z===0)break e;if(Y=Q-z,A.offset>Y){if((Y=A.offset-Y)>A.whave&&A.sane){R.msg="invalid distance too far back",A.mode=30;break}Z=Y>A.wnext?(Y-=A.wnext,A.wsize-Y):A.wnext-Y,Y>A.length&&(Y=A.length),ge=A.window}else ge=$,Z=V-A.offset,Y=A.length;for(zE?(k=Z[ge+m[F]],B[H+m[F]]):(k=96,0),y=1<>V)+(b-=y)]=T<<24|k<<16|P|0,b!==0;);for(y=1<>=1;if(y!==0?(N&=y-1,N+=y):N=0,F++,--Q[R]==0){if(R===L)break;R=f[d+m[F]]}if($>>7)]}function H(te,ae){te.pending_buf[te.pending++]=255&ae,te.pending_buf[te.pending++]=ae>>>8&255}function Q(te,ae,we){te.bi_valid>v-we?(te.bi_buf|=ae<>v-te.bi_valid,te.bi_valid+=we-v):(te.bi_buf|=ae<>>=1,we<<=1,0<--ae;);return we>>>1}function ge(te,ae,we){var Pe,ee,re=new Array(m+1),Se=0;for(Pe=1;Pe<=m;Pe++)re[Pe]=Se=Se+we[Pe-1]<<1;for(ee=0;ee<=ae;ee++){var he=te[2*ee+1];he!==0&&(te[2*ee]=Z(re[he]++,he))}}function ne(te){var ae;for(ae=0;ae>1;1<=we;we--)ve(te,re,we);for(ee=xe;we=te.heap[1],te.heap[1]=te.heap[te.heap_len--],ve(te,re,1),Pe=te.heap[1],te.heap[--te.heap_max]=we,te.heap[--te.heap_max]=Pe,re[2*ee]=re[2*we]+re[2*Pe],te.depth[ee]=(te.depth[we]>=te.depth[Pe]?te.depth[we]:te.depth[Pe])+1,re[2*we+1]=re[2*Pe+1]=ee,te.heap[1]=ee++,ve(te,re,1),2<=te.heap_len;);te.heap[--te.heap_max]=te.heap[1],(function(be,oe){var Ee,ke,ze,De,Ve,Ze,mt=oe.dyn_tree,Me=oe.max_code,ct=oe.stat_desc.static_tree,Fe=oe.stat_desc.has_stree,ht=oe.stat_desc.extra_bits,gt=oe.stat_desc.extra_base,St=oe.stat_desc.max_length,on=0;for(De=0;De<=m;De++)be.bl_count[De]=0;for(mt[2*be.heap[be.heap_max]+1]=0,Ee=be.heap_max+1;Ee>=7;ee>>=1)if(1&me&&he.dyn_ltree[2*xe]!==0)return s;if(he.dyn_ltree[18]!==0||he.dyn_ltree[20]!==0||he.dyn_ltree[26]!==0)return a;for(xe=32;xe>>3,(re=te.static_len+3+7>>>3)<=ee&&(ee=re)):ee=re=we+5,we+4<=ee&&ae!==-1?J(te,ae,we,Pe):te.strategy===4||re===ee?(Q(te,2+(Pe?1:0),3),se(te,I,R)):(Q(te,4+(Pe?1:0),3),(function(he,xe,me,be){var oe;for(Q(he,xe-257,5),Q(he,me-1,5),Q(he,be-4,4),oe=0;oe>>8&255,te.pending_buf[te.d_buf+2*te.last_lit+1]=255&ae,te.pending_buf[te.l_buf+te.last_lit]=255&we,te.last_lit++,ae===0?te.dyn_ltree[2*we]++:(te.matches++,ae--,te.dyn_ltree[2*(A[we]+f+1)]++,te.dyn_dtree[2*B(ae)]++),te.last_lit===te.lit_bufsize-1},i._tr_align=function(te){Q(te,2,3),Y(te,b,I),(function(ae){ae.bi_valid===16?(H(ae,ae.bi_buf),ae.bi_buf=0,ae.bi_valid=0):8<=ae.bi_valid&&(ae.pending_buf[ae.pending++]=255&ae.bi_buf,ae.bi_buf>>=8,ae.bi_valid-=8)})(te)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(o){(function(s,a){if(!s.setImmediate){var l,c,u,f,d=1,h={},p=!1,g=s.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(s);m=m&&m.setTimeout?m:s,l={}.toString.call(s.process)==="[object process]"?function(w){process.nextTick(function(){y(w)})}:(function(){if(s.postMessage&&!s.importScripts){var w=!0,S=s.onmessage;return s.onmessage=function(){w=!1},s.postMessage("","*"),s.onmessage=S,w}})()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",b,!1):s.attachEvent("onmessage",b),function(w){s.postMessage(f+w,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(w){y(w.data)},function(w){u.port2.postMessage(w)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(w){var S=g.createElement("script");S.onreadystatechange=function(){y(w),S.onreadystatechange=null,c.removeChild(S),S=null},c.appendChild(S)}):function(w){setTimeout(y,0,w)},m.setImmediate=function(w){typeof w!="function"&&(w=new Function(""+w));for(var S=new Array(arguments.length-1),_=0;_"u"?o===void 0?this:o:self)}).call(this,typeof Rs<"u"?Rs:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(x9)),x9.exports}var nDt=tDt();const rDt=Yn(nDt);var fz={exports:{}},iDt=fz.exports,Z1e;function oDt(){return Z1e||(Z1e=1,(function(e,t){(function(n,r){r()})(iDt,function(){function n(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,f){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){l(d.response,u,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Rs=="object"&&Rs.global===Rs?Rs:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,f){var d=s.URL||s.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?r(c,u,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,f){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,f),u);else if(i(c))r(c,u,f);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,u,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,f);var h=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent);if((g||h&&p||a)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var b=m.result;b=g?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=b:location=b,d=null},m.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,y=v.createObjectURL(c);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(fz)),fz.exports}var k4e=oDt(),sDt={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},aDt=Array.prototype.slice;function B5(e){var t=e.length;return t?t===1?[e[0]]:t===2?[e[0],e[1]]:t===3?[e[0],e[1],e[2]]:aDt.call(e,0):[]}function lDt(e){var t={};for(var n in e)sDt[n]||(t[n]=e[n]);return t}function cDt(e){return typeof e=="function"&&e.isMemoized}function uDt(e,t){return e===t||e!==e&&t!==t}function J1e(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}var fDt=(function(){function e(t){this.keys=[],this.values=[],this.options=t;var n=typeof t.isMatchingKey=="function";n?this.getKeyIndex=this._getKeyIndexFromMatchingKey:t.maxSize>1?this.getKeyIndex=this._getKeyIndexForMany:this.getKeyIndex=this._getKeyIndexForSingle,this.canTransformKey=typeof t.transformKey=="function",this.shouldCloneArguments=this.canTransformKey||n,this.shouldUpdateOnAdd=typeof t.onCacheAdd=="function",this.shouldUpdateOnChange=typeof t.onCacheChange=="function",this.shouldUpdateOnHit=typeof t.onCacheHit=="function"}return Object.defineProperty(e.prototype,"size",{get:function(){return this.keys.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return{keys:B5(this.keys),size:this.size,values:B5(this.values)}},enumerable:!1,configurable:!0}),e.prototype._getKeyIndexFromMatchingKey=function(t){var n=this.options,r=n.isMatchingKey,i=n.maxSize,o=this.keys,s=o.length;if(!s)return-1;if(r(o[0],t))return 0;if(i>1){for(var a=1;a1){for(var l=0;l1){for(var s=0;s=l&&(i.length=o.length=l)},e.prototype.updateAsyncCache=function(t){var n=this,r=this.options,i=r.onCacheChange,o=r.onCacheHit,s=this.keys[0],a=this.values[0];this.values[0]=a.then(function(l){return n.shouldUpdateOnHit&&o(n,n.options,t),n.shouldUpdateOnChange&&i(n,n.options,t),l},function(l){var c=n.getKeyIndex(s);throw c!==-1&&(n.keys.splice(c,1),n.values.splice(c,1)),l})},e})();function aU(e,t){if(t===void 0&&(t={}),cDt(e))return aU(e.fn,J1e(e.options,t));if(typeof e!="function")throw new TypeError("You must pass a function to `memoize`.");var n=t.isEqual,r=n===void 0?uDt:n,i=t.isMatchingKey,o=t.isPromise,s=o===void 0?!1:o,a=t.maxSize,l=a===void 0?1:a,c=t.onCacheAdd,u=t.onCacheChange,f=t.onCacheHit,d=t.transformKey,h=J1e({isEqual:r,isMatchingKey:i,isPromise:s,maxSize:l,onCacheAdd:c,onCacheChange:u,onCacheHit:f,transformKey:d},lDt(t)),p=new fDt(h),g=p.keys,m=p.values,v=p.canTransformKey,y=p.shouldCloneArguments,b=p.shouldUpdateOnAdd,w=p.shouldUpdateOnChange,S=p.shouldUpdateOnHit,_=function(){var E=y?B5(arguments):arguments;v&&(E=d(E));var T=g.length?p.getKeyIndex(E):-1;if(T!==-1)S&&f(p,h,_),T&&(p.orderByLru(g[T],m[T],T),w&&u(p,h,_));else{var k=e.apply(this,arguments),P=y?E:B5(arguments);p.orderByLru(P,k,g.length),s&&p.updateAsyncCache(_),b&&c(p,h,_),w&&u(p,h,_)}return m[0]};return _.cache=p,_.fn=e,_.isMemoized=!0,_.options=h,_}const ewe=e=>{let t;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const d=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(h=>h(t,d))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,i,a);return a},dDt=(e=>e?ewe(e):ewe),hDt=e=>e;function pDt(e,t=hDt){const n=Te.useSyncExternalStore(e.subscribe,Te.useCallback(()=>t(e.getState()),[e,t]),Te.useCallback(()=>t(e.getInitialState()),[e,t]));return Te.useDebugValue(n),n}const twe=e=>{const t=dDt(e),n=r=>pDt(t,r);return Object.assign(n,t),n},gDt=(e=>e?twe(e):twe),xs=gDt(()=>({configuration:{},extensions:[],contributionsResult:{},contributionsRecord:{},lastCallbackInputValues:{}}));function jp(e){return typeof e=="object"&&e!==null}function mD(e){return typeof e=="string"}function lU(e,t){t=UO(t);let n=e;for(const r of t)if(jp(n))n=n[r];else return;return n}function Kee(e,t,n){return M4e(e,UO(t),n)}function M4e(e,t,n){if(t.length===1){const r=t[0];if(jp(e)){const i=e[r];if(n===i)return e;const o=Array.isArray(e)?[...e]:{...e};return o[r]=n,o}else if(e===void 0){const i=typeof r=="number"?[]:{};return i[r]=n,i}}else if(t.length>1&&jp(e)){const r=t[0],i=e[r];if(jp(i)||i===void 0){const o=M4e(i,t.slice(1),n);if(i!==o){const s=Array.isArray(e)?[...e]:{...e};return s[r]=o,s}}}return e}function UO(e){if(Array.isArray(e))return e;if(!e||e==="")return[];if(typeof e=="number")return[e];{const t=e.split(".");for(let n=0;ntypeof t=="number"?t.toString():t).join("."):typeof e=="number"?e.toString():""}function mDt(e,t){if(e===t)return!0;const n=UO(e),r=UO(t);return n.length===r.length&&n.every((i,o)=>i===r[o])}function vDt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const yDt="http://localhost:8888",bDt="chartlets";async function vle(e,...t){try{return{status:"ok",data:await e(...t)}}catch(n){return n instanceof dz?{status:"failed",error:n.apiError}:{status:"failed",error:{message:`${n.message||n}`}}}}async function yle(e,t,n){const r=await fetch(e,t),i=await r.json();if(typeof i=="object"){if(i.error)throw new dz(i.error);if(!r.ok)throw new dz({status:r.status,message:r.statusText});if(vDt(i,"result"))return n?n(i.result):i.result}throw new dz({message:`unexpected response from ${e}`})}let dz=class extends Error{apiError;constructor(t){super(t.message),this.apiError=t}};function ble(e,t){const n=t?.serverUrl||yDt,r=t?.endpointName||bDt;return`${n}/${r}/${e}`}function U5(e){return typeof e=="function"}function A4e(e){return!!e.id&&!e.id.startsWith("@")}function R4e(e){return e.id==="@app"}function I4e(e){return e.id==="@container"}function C0(e){return jp(e)&&mD(e.type)&&e.constructor.name==="Object"&&!e.$$typeof}function D4e(e){return C0(e)&&Array.isArray(e.children)}function xle(e,t,n){return e.map(r=>xDt(r,t,n))}const Zee={};function xDt(e,t,n){let r;const{id:i,property:o}=e;return A4e(e)&&t.component?r=L4e(t.component,i,o):I4e(e)&&t.container?r=wDt(t.container,o):R4e(e)&&n&&(r=SDt(n,o)),(r===void 0||r===Zee)&&(r=null),r}function L4e(e,t,n){if(e.id===t)return lU(e,n);if(D4e(e))for(let r=0;r{const o=e[n][r],s=MDt(o.container,i.filter(I4e)),a=PDt(o.component,i.filter(A4e));(s!==o.container||a!==o.component)&&(e={...e,[n]:F4e(e[n],r,{...o,container:s,component:a})})}),e}function PDt(e,t){let n=e;return n&&t.forEach(r=>{n=N4e(n,r)}),n}function N4e(e,t){if(C0(e)&&e.id===t.id){const n=UO(t.property),r=t.value;if(n.length===0)return C0(r)?r:e;const i=lU(e,n);if(n[n.length-1]==="children"&&!Array.isArray(r)&&r!==null&&r!==void 0)return Kee(e,n,[r]);if(i!==r)return Kee(e,n,r)}else if(D4e(e)){const n=e;let r=n;for(let i=0;i{n.stateChanges.forEach(r=>{R4e(r)&&t.set(mle(r.property),r.value)})})}function MDt(e,t){return t.forEach(n=>{(!e||lU(e,n.property)!==n.value)&&(e=Kee(e,n.property,n.value))}),e}function z4e(e){const{configuration:t}=xs.getState(),n=t.logging?.enabled,r=RDt();n&&console.info(`chartlets: invokeCallbacks (${r})-->`,e),_Dt(e,t.api).then(i=>{i.data?(n&&console.info(`chartlets: invokeCallbacks <--(${r})`,i.data),$4e(i.data)):console.error("callback failed:",i.error,"for call requests:",e)})}let ADt=0;function RDt(){return ADt++}function IDt(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;ns!==void 0);if(!(!o||!o.length))return z4e(o),o}function LDt(e,t,n){const{lastCallbackInputValues:r}=xs.getState();return e.map(i=>FDt(i,r,t,n))}const FDt=(e,t,n,r)=>{const i=e.contribPoint,o=e.contribIndex,s=e.callbackIndex,a=n[i][o],l=a.callbacks[s],c=xle(l.inputs,a,r),u=`${i}-${o}-${s}`,f=t[u];if(!IDt(f,c))return xs.setState({lastCallbackInputValues:{...t,[u]:c}}),{...e,inputValues:c}},$Dt=aU(NDt);function NDt(e){const t=[];return Object.getOwnPropertyNames(e).forEach(n=>{const r=e[n];t.push(...zDt(n,r))}),t}const zDt=aU(jDt);function jDt(e,t){const n=[];return t.forEach((r,i)=>{n.push(...BDt(e,i,r.callbacks))}),n}const BDt=aU(UDt);function UDt(e,t,n){const r=[];return(n||[]).forEach((i,o)=>{(i.inputs||[]).forEach((s,a)=>{!s.noTrigger&&s.id==="@app"&&s.property&&r.push({contribPoint:e,contribIndex:t,callbackIndex:o,inputIndex:a,property:mle(s.property)})})}),r}function VDt(e){const t=e.get("themeMode"),n=xs.getState().themeMode;(t==="dark"||t==="light"||t==="system")&&t!==n&&xs.setState({themeMode:t})}let WDt=class{components=new Map;register(t,n){const r=this.components.get(t);return this.components.set(t,n),()=>{typeof r=="function"?this.components.set(t,r):this.components.delete(t)}}lookup(t){return this.components.get(t)}clear(){this.components.clear()}get types(){return Array.from(this.components.keys())}};const j4e=new WDt;function B4e(e){const{type:t}=e,n=j4e.lookup(t);return typeof n=="function"?O.jsx(n,{...e}):null}function vD({nodes:e,onChange:t}){return!e||e.length===0?null:O.jsx(O.Fragment,{children:e.map((n,r)=>{if(C0(n)){const i=n.id||r;return O.jsx(B4e,{...n,onChange:t},i)}else{if(typeof n=="string")return n;n&&console.warn("chartlets: invalid child node encountered:",n)}})})}const HDt={Date:!0,RegExp:!0,String:!0,Number:!0};function U4e(e,t,n={cyclesFix:!0},r=[]){let i=[];const o=Array.isArray(e);for(const a in e){const l=e[a],c=o?+a:a;if(!(a in t)){i.push({type:"REMOVE",path:[c],oldValue:e[a]});continue}const u=t[a],f=typeof l=="object"&&typeof u=="object"&&Array.isArray(l)===Array.isArray(u);l&&u&&f&&!HDt[Object.getPrototypeOf(l)?.constructor?.name]&&(!n.cyclesFix||!r.includes(l))?i.push.apply(i,U4e(l,u,n,n.cyclesFix?r.concat([l]):[]).map(d=>(d.path.unshift(c),d))):l!==u&&!(Number.isNaN(l)&&Number.isNaN(u))&&!(f&&(isNaN(l)?l+""==u+"":+l==+u))&&i.push({path:[c],type:"CHANGE",value:u,oldValue:l})}const s=Array.isArray(t);for(const a in t)a in e||i.push({type:"CREATE",path:[s?+a:a],value:t[a]});return i}function GDt(e,t,n){if(xs.getState().extensions.length===0)return;$4e([{contribPoint:e,contribIndex:t,stateChanges:[{id:n.id,property:n.property,value:n.value}]}]);const r=qDt(e,t,n);r&&r.length>0&&z4e(r)}function qDt(e,t,n){const{configuration:r,contributionsRecord:i}=xs.getState(),{hostStore:o}=r,s=i[e][t],a=[];return(s.callbacks||[]).forEach((l,c)=>{if(l.inputs&&l.inputs.length){const u=l.inputs,f=u.findIndex(d=>!d.noTrigger&&d.id&&!d.id.startsWith("@")&&d.id===n.id&&mDt(d.property,n.property));f>=0&&a.push({contribPoint:e,contribIndex:t,callbackIndex:c,inputIndex:f,inputValues:xle(u,s,o)})}}),a}const XDt=e=>e.contributionsRecord,YDt=e=>e.themeMode,V4e=xs,W4e=()=>V4e(XDt),QDt=()=>V4e(YDt);function H4e(e,t){const n={};return Object.getOwnPropertyNames(e).forEach(r=>{n[r]=t(e[r],r)}),n}async function KDt(e){return vle(ZDt,e)}async function ZDt(e){return yle(ble("contributions",e),void 0,JDt)}function JDt(e){return{...e,contributions:H4e(e.contributions,t=>t.map(n=>({...n,layout:n.layout?G4e(n.layout):void 0,callbacks:eLt(n.callbacks)})))}}function eLt(e){return e?e.map(G4e):[]}function G4e(e){return{...e,inputs:e.inputs?nwe(e.inputs):[],outputs:e.outputs?nwe(e.outputs):[]}}function nwe(e){return e?e.map(tLt):[]}function tLt(e){return{...e,property:UO(e.property)}}function nLt(e){return!!e&&typeof e=="object"&&typeof e.then=="function"}const w9="color:light-dark(lightblue, lightblue)",S9="font-weight:bold",_9="color:light-dark(darkgrey, lightgray)";let F$;function rLt(e){F$&&(F$(),F$=void 0),(!e||e.enabled)&&(F$=xs.subscribe(iLt))}function iLt(e,t){const n=U4e(t,e),r=n.length;console.groupCollapsed(`chartlets: state changed (${r} difference${r===1?"":"s"})`),n.forEach(oLt),console.debug("chartlets: change details:",{prev:t,next:e,delta:n}),console.groupEnd()}function oLt(e,t){const n=`%c${t+1} %c${e.type} %c${e.path.join(".")}`;e.type==="CREATE"?console.debug("chartlets:",n,w9,S9,_9,{value:e.value}):e.type==="CHANGE"?console.debug("chartlets:",n,w9,S9,_9,{value:e.value,oldValue:e.oldValue}):e.type==="REMOVE"&&console.debug("chartlets:",n,w9,S9,_9,{oldValue:e.oldValue})}function sLt(e){e=e||{},e.logging&&rLt(e.logging),e.hostStore&&e.hostStore.subscribe(DDt),xs.setState({configuration:{...e}}),e.plugins&&e.plugins.forEach(Jee)}function Jee(e){return nLt(e)?e.then(Jee):U5(e)?Jee(e()):jp(e)&&e.components?(e.components.forEach(([t,n])=>{j4e.register(t,n)}),Promise.resolve(e)):Promise.resolve(void 0)}function aLt(e){e&&sLt(e);const{configuration:t}=xs.getState();xs.setState({contributionsResult:{status:"pending"}}),KDt(t.api).then(lLt)}function lLt(e){let t={contributionsResult:e};if(e.data){const{extensions:n,contributions:r}=e.data;t={...t,extensions:n,contributionsRecord:H4e(r,i=>i.map(cLt))}}xs.setState(t)}function cLt(e){return{...e,container:{...e.initialState},componentResult:{}}}async function uLt(e,t,n,r){return vle(fLt,e,t,n,r)}async function fLt(e,t,n,r){return yle(ble(`layout/${e}/${t}`,r),{body:JSON.stringify({inputValues:n}),method:"post"})}function dLt(e,t,n,r=!0){const{configuration:i,contributionsRecord:o}=xs.getState(),s=o[e][t];if(s.container===n)return;const a=!!s.componentResult.status;if(!r||a)C9(e,t,{container:n});else if(!a){C9(e,t,{container:n,componentResult:{status:"pending"}});const l=hLt(e,t);uLt(e,t,l,i.api).then(c=>{C9(e,t,{componentResult:c,component:c.data})})}}function hLt(e,t){const{configuration:n,contributionsRecord:r}=xs.getState(),{hostStore:i}=n,o=r[e][t],s=o.layout.inputs;return s&&s.length>0?xle(s,o,i):[]}function C9(e,t,n){const{contributionsRecord:r}=xs.getState(),i=r[e],o=i[t],s=n.container?{...n,container:{...o.container,...n.container}}:n;xs.setState({contributionsRecord:{...r,[e]:F4e(i,t,s)}})}const q4e=M.createContext(void 0);function Kn(){const e=M.useContext(q4e);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` +`));return e}const X4e=M.createContext(void 0),nn=()=>{const e=M.useContext(X4e);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},pLt=parseInt(M.version,10),Tr=e=>{if(pLt>=19){const t=n=>e(n,n.ref??null);return t.displayName=e.displayName??e.name,t}return M.forwardRef(e)};var V5=Symbol("NOT_FOUND");function gLt(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function mLt(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function vLt(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var rwe=e=>Array.isArray(e)?e:[e];function yLt(e){const t=Array.isArray(e[0])?e[0]:e;return vLt(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function bLt(e,t){const n=[],{length:r}=e;for(let i=0;it(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return V5}function i(a,l){r(a)===V5&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var SLt=(e,t)=>e===t;function _Lt(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let o=0;oo(h.value,u));d&&(u=d.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var CLt=class{constructor(e){this.value=e}deref(){return this.value}},OLt=typeof WeakRef<"u"?WeakRef:CLt,ELt=0,iwe=1;function $$(){return{s:ELt,v:void 0,o:null,p:null}}function Q4e(e,t={}){let n=$$();const{resultEqualityCheck:r}=t;let i,o=0;function s(){let a=n;const{length:l}=arguments;for(let f=0,d=l;f{n=$$(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function K4e(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,s=0,a,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),gLt(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:f,memoizeOptions:d=[],argsMemoize:h=Q4e,argsMemoizeOptions:p=[]}=u,g=rwe(d),m=rwe(p),v=yLt(i),y=f(function(){return o++,c.apply(null,arguments)},...g),b=h(function(){s++;const S=bLt(v,arguments);return a=y.apply(null,S),a},...m);return Object.assign(b,{resultFunc:c,memoizedResultFunc:y,dependencies:v,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var Z4e=K4e(Q4e),TLt=Object.assign((e,t=Z4e)=>{mLt(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((s,a,l)=>(s[n[l]]=a,s),{}))},{withTypes:()=>TLt});const PLt=Object.is;function J4e(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const i in e)if(n+=1,!PLt(e[i],t[i])||!(i in t))return!1;for(const i in t)r+=1;return n===r}var O9={exports:{}},E9={};var owe;function kLt(){if(owe)return E9;owe=1;var e=fg();function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(f,d){var h=d(),p=r({inst:{value:h,getSnapshot:d}}),g=p[0].inst,m=p[1];return o(function(){g.value=h,g.getSnapshot=d,l(g)&&m({inst:g})},[f,h,d]),i(function(){return l(g)&&m({inst:g}),f(function(){l(g)&&m({inst:g})})},[f]),s(h),h}function l(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function c(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return E9.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,E9}var swe;function MLt(){return swe||(swe=1,O9.exports=kLt()),O9.exports}var wle=MLt();function e6e(e){return e.acceptsApiRef}function awe(e,t){return e6e(t)?t(e):t(e.current.state)}function T9(e,t,n,r){return e6e(t)?t(e,n):t(e.current.state,r)}const t6e=Object.is,Sle=J4e,ALt=(e,t)=>e===t?!0:e.length===t.length&&e.every((n,r)=>n===t[r]),RLt=(e,t)=>{let n=Object.is;return t instanceof Array?n=ALt:t instanceof Object&&(n=Sle),n(e,t)},n6e=()=>({state:null,equals:null,selector:null,args:void 0}),W5=[],r6e=()=>null,ut=(e,t,n=t6e)=>{const r=od(n6e),i=r.current.selector!==null,[o,s]=M.useState(i?null:awe(e,t));r.current.state=o,r.current.equals=n,r.current.selector=t;const a=M.useCallback(()=>(r.current.subscription||(r.current.subscription=e.current.store.subscribe(()=>{const c=awe(e,r.current.selector);r.current.equals(r.current.state,c)||(r.current.state=c,s(c))})),null),W5),l=M.useCallback(()=>()=>{r.current.subscription&&(r.current.subscription(),r.current.subscription=void 0)},W5);return wle.useSyncExternalStore(l,a,r6e),o},BA=(e,t,n=void 0,r=t6e)=>{const i=od(n6e),o=i.current.selector!==null,[s,a]=M.useState(o?null:T9(e,t,n,e.current.instanceId));i.current.state=s,i.current.equals=r,i.current.selector=t;const l=i.current.args;if(i.current.args=n,o&&!RLt(l,n)){const f=T9(e,i.current.selector,i.current.args,e.current.instanceId);i.current.equals(i.current.state,f)||(i.current.state=f,a(f))}const c=M.useCallback(()=>(i.current.subscription||(i.current.subscription=e.current.store.subscribe(()=>{const f=T9(e,i.current.selector,i.current.args,e.current.instanceId);i.current.equals(i.current.state,f)||(i.current.state=f,a(f))})),null),W5),u=M.useCallback(()=>()=>{i.current.subscription&&(i.current.subscription(),i.current.subscription=void 0)},W5);return wle.useSyncExternalStore(u,c,r6e),s},ILt=K4e({memoize:Y4e,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),lwe=new WeakMap;function qd(e){return"current"in e&&"instanceId"in e.current}const Xd={id:"default"},xn=(e,t,n,r,i,o,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&r&&i&&o)a=(l,c)=>{const u=qd(l),f=c??(u?l.current.instanceId:Xd),d=u?l.current.state:l,h=e(d,f),p=t(d,f),g=n(d,f),m=r(d,f),v=i(d,f);return o(h,p,g,m,v)};else if(e&&t&&n&&r&&i)a=(l,c)=>{const u=qd(l),f=c??(u?l.current.instanceId:Xd),d=u?l.current.state:l,h=e(d,f),p=t(d,f),g=n(d,f),m=r(d,f);return i(h,p,g,m)};else if(e&&t&&n&&r)a=(l,c)=>{const u=qd(l),f=c??(u?l.current.instanceId:Xd),d=u?l.current.state:l,h=e(d,f),p=t(d,f),g=n(d,f);return r(h,p,g)};else if(e&&t&&n)a=(l,c)=>{const u=qd(l),f=c??(u?l.current.instanceId:Xd),d=u?l.current.state:l,h=e(d,f),p=t(d,f);return n(h,p)};else if(e&&t)a=(l,c)=>{const u=qd(l),f=c??(u?l.current.instanceId:Xd),d=u?l.current.state:l,h=e(d,f);return t(h)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},yD=(e,t,n,r,i,o,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&r&&i&&o)a=(l,c,u)=>{const f=qd(l),d=u??(f?l.current.instanceId:Xd),h=f?l.current.state:l,p=e(h,c,d),g=t(h,c,d),m=n(h,c,d),v=r(h,c,d),y=i(h,c,d);return o(p,g,m,v,y,c)};else if(e&&t&&n&&r&&i)a=(l,c,u)=>{const f=qd(l),d=u??(f?l.current.instanceId:Xd),h=f?l.current.state:l,p=e(h,c,d),g=t(h,c,d),m=n(h,c,d),v=r(h,c,d);return i(p,g,m,v,c)};else if(e&&t&&n&&r)a=(l,c,u)=>{const f=qd(l),d=u??(f?l.current.instanceId:Xd),h=f?l.current.state:l,p=e(h,c,d),g=t(h,c,d),m=n(h,c,d);return r(p,g,m,c)};else if(e&&t&&n)a=(l,c,u)=>{const f=qd(l),d=u??(f?l.current.instanceId:Xd),h=f?l.current.state:l,p=e(h,c,d),g=t(h,c,d);return n(p,g,c)};else if(e&&t)a=(l,c,u)=>{const f=qd(l),d=u??(f?l.current.instanceId:Xd),h=f?l.current.state:l,p=e(h,c,d);return t(p,c)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},jr=(...e)=>{const t=(n,r)=>{const i=qd(n),o=i?n.current.instanceId:r??Xd,s=i?n.current.state:n,a=lwe.get(o),l=a??new Map,c=l?.get(e);if(l&&c)return c(s,o);const u=ILt(...e);return a||lwe.set(o,l),l.set(e,u),u(s,o)};return t.acceptsApiRef=!0,t},Is=e=>e.dimensions,cU=xn(Is,e=>e.columnsTotalWidth),_le=e=>e.dimensions.rowHeight,DLt=e=>e.dimensions.contentSize.height,LLt=e=>e.dimensions.hasScrollX,FLt=e=>e.dimensions.hasScrollY,i6e=e=>e.dimensions.columnsTotalWidthe.dimensions.headerHeight,NLt=e=>e.dimensions.groupHeaderHeight,o6e=e=>e.dimensions.hasScrollY?e.dimensions.scrollbarSize:0,zLt=e=>{const t=e.dimensions.hasScrollX?e.dimensions.scrollbarSize:0,n=e.dimensions.viewportOuterSize.height-e.dimensions.minimumSize.height>0;return!(t===0&&!n)};function Cv(e){return M.memo(e,J4e)}const jLt={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",columnsManagementDeleteIconLabel:"Clear",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuAriaLabel:e=>`${e} column menu`,columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"};function pr(e){return pt("MuiDataGrid",e)}const ye=dt("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","autosizing","booleanCell","cell--editable","cell--editing","cell--flex","cell--textCenter","cell--textLeft","cell--textRight","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--pinnedLeft","cell--pinnedRight","cell--selectionMode","cell","cellCheckbox","cellEmpty","cellSkeleton","cellOffsetLeft","checkboxInput","columnHeader","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader--pinnedLeft","columnHeader--pinnedRight","columnHeader--last","columnHeader--lastUnpinned","columnHeader--siblingFocused","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","container--top","container--bottom","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filler","filler--borderBottom","filler--pinnedLeft","filler--pinnedRight","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","main--hasPinnedRight","main--hasSkeletonLoadingOverlay","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","root--noToolbar","row","row--editable","row--editing","row--firstVisible","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea--up","scrollArea--down","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--header","scrollbarFiller--borderTop","scrollbarFiller--borderBottom","scrollbarFiller--pinnedRight","selectedRowCount","sortButton","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),cwe=1e3;class BLt{constructor(t=cwe){this.timeouts=new Map,this.cleanupTimeout=cwe,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const i=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,i)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class ULt{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}var Lf=(function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e})(Lf||{});class VLt{}function WLt(e){let t=0;return function(r,i,o,s){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new ULt:new BLt);const[a]=M.useState(new VLt),l=M.useRef(null),c=M.useRef(null);c.current=o;const u=M.useRef(null);if(!l.current&&c.current){const f=(d,h,p)=>{h&&!h.defaultMuiPrevented&&c.current?.(d,h,p)};l.current=r.current.subscribeEvent(i,f,s),t+=1,u.current={cleanupToken:t},e.registry.register(a,()=>{l.current?.(),l.current=null,u.current=null},u.current)}else!c.current&&l.current&&(l.current(),l.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));M.useEffect(()=>{if(!l.current&&c.current){const f=(d,h,p)=>{h&&!h.defaultMuiPrevented&&c.current?.(d,h,p)};l.current=r.current.subscribeEvent(i,f,s)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{l.current?.(),l.current=null}},[r,i,s])}}const HLt={registry:null},Ft=WLt(HLt),GLt={isFirst:!0};function ii(e,t,n){Ft(e,t,n,GLt)}const qLt=.7,XLt=1.3,YLt={compact:qLt,comfortable:XLt,standard:1},kC=e=>e.density,TT=xn(kC,e=>YLt[e]),QLt=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],KLt=e=>{const{classes:t}=e;return Xe({root:["editInputCell"]},pr,t)},ZLt=Oe(hT,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>X({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),JLt=Tr((e,t)=>{const n=nn(),{id:r,value:i,field:o,colDef:s,hasFocus:a,debounceMs:l=200,isProcessingProps:c,onValueChange:u}=e,f=st(e,QLt),d=Kn(),h=M.useRef(null),[p,g]=M.useState(i),m=KLt(n),v=M.useCallback(async b=>{const w=b.target.value;u&&await u(b,w);const S=d.current.getColumn(o);let _=w;S.valueParser&&(_=S.valueParser(w,d.current.getRow(r),S,d)),g(_),d.current.setEditCellValue({id:r,field:o,value:_,debounceMs:l,unstable_skipValueParser:!0},b)},[d,l,o,r,u]),y=d.current.unstable_getEditCellMeta(r,o);return M.useEffect(()=>{y?.changeReason!=="debouncedSetEditCellValue"&&g(i)},[y,i]),lr(()=>{a&&h.current.focus()},[a]),O.jsx(ZLt,X({inputRef:h,className:m.root,ownerState:n,fullWidth:!0,type:s.type==="number"?s.type:"text",value:p??"",onChange:v,endAdornment:c?O.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},f,{ref:t}))}),eFt=e=>O.jsx(JLt,X({},e)),ad=e=>e.rows,bD=xn(ad,e=>e.totalRowCount),tFt=xn(ad,e=>e.loading),nFt=xn(ad,e=>e.totalTopLevelRowCount),_f=xn(ad,e=>e.dataRowIdToModelLookup),uwe=xn(ad,e=>e.dataRowIdToIdLookup),ps=xn(ad,e=>e.tree),rFt=xn(ad,e=>e.groupsToFetch),iFt=xn(ad,e=>e.groupingName),fwe=xn(ad,e=>e.treeDepths),lS=jr(ad,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:(t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,r)=>r-n)[0]??0)+1}),W2=xn(ad,e=>e.dataRowIds),oFt=xn(ad,e=>e?.additionalRowGroups),PT=jr(oFt,e=>{const t=e?.pinnedRows;return{bottom:t?.bottom?.map(n=>({id:n.id,model:n.model??{}}))??[],top:t?.top?.map(n=>({id:n.id,model:n.model??{}}))??[]}}),s6e=xn(PT,e=>(e?.top?.length||0)+(e?.bottom?.length||0)),a6e=(e,t)=>t&&e.length>1?[e[0]]:e,dwe=(e,t)=>n=>X({},n,{sorting:X({},n.sorting,{sortModel:a6e(e,t)})}),sFt=e=>e==="desc",aFt=(e,t)=>{const n=t.current.getColumn(e.field);if(!n||e.sort===null)return null;let r;return n.getSortComparator?r=n.getSortComparator(e.sort):r=sFt(e.sort)?(...o)=>-1*n.sortComparator(...o):n.sortComparator,r?{getSortCellParams:o=>({id:o,field:n.field,rowNode:ps(t)[o],value:t.current.getCellValue(o,n.field),api:t.current}),comparator:r}:null},lFt=(e,t,n)=>e.reduce((r,i,o)=>{if(r!==0)return r;const s=t.params[o],a=n.params[o];return r=i.comparator(s.value,a.value,s,a),r},0),cFt=(e,t)=>{const n=e.map(r=>aFt(r,t)).filter(r=>!!r);return n.length===0?null:r=>r.map(i=>({node:i,params:n.map(o=>o.getSortCellParams(i.id))})).sort((i,o)=>lFt(n,i,o)).map(i=>i.node.id)},hwe=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},Cle=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,uFt=new Intl.Collator,fFt=(e,t)=>{const n=Cle(e,t);return n!==null?n:typeof e=="string"?uFt.compare(e.toString(),t.toString()):e-t},l6e=(e,t)=>{const n=Cle(e,t);return n!==null?n:Number(e)-Number(t)},c6e=(e,t)=>{const n=Cle(e,t);return n!==null?n:e>t?1:e{const S=P9(w.target.value);p(S),m(!0),d.start(y.filterDebounceMs,()=>{const _=X({},t,{value:r==="number"&&!Number.isNaN(Number(S))?Number(S):S,fromInput:v});n(_),m(!1)})},[d,y.filterDebounceMs,t,r,v,n]);return M.useEffect(()=>{(t.fromInput!==v||t.value==null)&&p(P9(t.value))},[v,t]),O.jsx(y.slots.baseTextField,X({id:v,label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),value:h??"",onChange:b,variant:u,type:r||"text",InputProps:X({},g||l?{endAdornment:g?O.jsx(y.slots.loadIcon,{fontSize:"small",color:"action"}):l}:{},{disabled:a},c,{inputProps:X({tabIndex:s},c?.inputProps)}),InputLabelProps:{shrink:!0},inputRef:o},f,y.slotProps?.baseTextField))}function P9(e){if(!(e==null||e===""))return String(e)}function hFt(e){return typeof e=="number"&&!Number.isNaN(e)}function pFt(e){return typeof e=="function"}function Ole(e){return typeof e=="object"&&e!==null}function gFt(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}function H5(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const Mu=(e,t,n)=>Math.max(t,Math.min(n,e));function pwe(e,t){return Array.from({length:t-e}).map((n,r)=>e+r)}function O0(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const i=e.length;if(i!==t.length)return!1;for(let o=0;o{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function vFt(e){const t=mFt(e);return(n,r)=>n+(r-n)*t()}function u6e(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const Hx=(e,t)=>n=>{e&&t(n)},yFt=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],bFt=["key"];function f6e(e){const{item:t,applyValue:n,type:r,apiRef:i,focusElementRef:o,color:s,error:a,helperText:l,size:c,variant:u="standard"}=e,f=st(e,yFt),d={color:s,error:a,helperText:l,size:c,variant:u},[h,p]=M.useState(t.value||[]),g=fr(),m=nn();M.useEffect(()=>{const y=t.value??[];p(y.map(String))},[t.value]);const v=M.useCallback((y,b)=>{p(b.map(String)),n(X({},t,{value:[...b.map(w=>r==="number"?Number(w):w)]}))},[n,t,r]);return O.jsx(zze,X({multiple:!0,freeSolo:!0,options:[],filterOptions:(y,b)=>{const{inputValue:w}=b;return w==null||w===""?[]:[w]},id:g,value:h,onChange:v,renderTags:(y,b)=>y.map((w,S)=>{const _=b({index:S}),{key:E}=_,T=st(_,bFt);return O.jsx(m.slots.baseChip,X({variant:"outlined",size:"small",label:w},T),E)}),renderInput:y=>O.jsx(m.slots.baseTextField,X({},y,{label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:X({},y.InputLabelProps,{shrink:!0}),inputRef:o,type:r||"text"},d,m.slotProps?.baseTextField))},f))}var Jp=(function(e){return e.Cell="cell",e.Row="row",e})(Jp||{}),ni=(function(e){return e.Edit="edit",e.View="view",e})(ni||{}),qi=(function(e){return e.Edit="edit",e.View="view",e})(qi||{}),Il=(function(e){return e.And="and",e.Or="or",e})(Il||{}),sm=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e})(sm||{}),Ld=(function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(Ld||{}),My=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e})(My||{}),Yh=(function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(Yh||{});function d6e(e){return e.field!==void 0}const h6e={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},UA=()=>({items:[],logicOperator:Il.And,quickFilterValues:[],quickFilterLogicOperator:Il.And});function p6e(e){return{current:e.current.getPublicApi()}}let Vy=(function(e){return e.LEFT="left",e.RIGHT="right",e})({});const G5={left:[],right:[]},g6e=e=>e.isRtl,Bp=e=>e.columns,Um=xn(Bp,e=>e.orderedFields),Ov=xn(Bp,e=>e.lookup),Ff=jr(Um,Ov,(e,t)=>e.map(n=>t[n])),Cf=xn(Bp,e=>e.columnVisibilityModel),Mo=jr(Ff,Cf,(e,t)=>e.filter(n=>t[n.field]!==!1)),kT=jr(Mo,e=>e.map(t=>t.field)),m6e=e=>e.pinnedColumns;jr(m6e,Um,g6e,(e,t,n)=>v6e(e,t,n));const MT=jr(Bp,m6e,kT,g6e,(e,t,n,r)=>{const i=v6e(t,n,r);return{left:i.left.map(s=>e.lookup[s]),right:i.right.map(s=>e.lookup[s])}});function v6e(e,t,n){if(!Array.isArray(e.left)&&!Array.isArray(e.right)||e.left?.length===0&&e.right?.length===0)return G5;const r=(a,l)=>Array.isArray(a)?a.filter(c=>l.includes(c)):[],i=r(e.left,t),o=t.filter(a=>!i.includes(a)),s=r(e.right,o);return n?{left:s,right:i}:{left:i,right:s}}const Cb=jr(Mo,e=>{const t=[];let n=0;for(let r=0;re.filter(t=>t.filterable)),xFt=jr(Ff,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),wFt=jr(Ff,e=>e.some(t=>t.colSpan!==void 0));let Pk;function SFt(){if(Pk!==void 0)return Pk;try{Pk=new Function("return true")()}catch{Pk=!1}return Pk}const ete=(e,t)=>{const n=X({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const r=Ov(t)[n.field];n.operator=r&&r.filterOperators[0].value}return n},Ele=(e,t,n)=>{const r=e.items.length>1;let i;r&&t?i=[e.items[0]]:i=e.items;const o=r&&i.some(a=>a.id==null);return i.some(a=>a.operator==null)||o?X({},e,{items:i.map(a=>ete(a,n))}):e.items!==i?X({},e,{items:i}):e},gwe=(e,t,n)=>r=>X({},r,{filterModel:Ele(e,t,n)}),VA=e=>typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,b6e=(e,t)=>{if(!e.field||!e.operator)return null;const n=t.current.getColumn(e.field);if(!n)return null;let r;if(n.valueParser){const u=n.valueParser;r=Array.isArray(e.value)?e.value?.map(f=>u(f,void 0,n,t)):u(e.value,void 0,n,t)}else r=e.value;const{ignoreDiacritics:i}=t.current.rootProps;i&&(r=VA(r));const o=X({},e,{value:r}),s=n.filterOperators;if(!s?.length)throw new Error(`MUI X: No filter operators found for column '${n.field}'.`);const a=s.find(u=>u.value===o.operator);if(!a)throw new Error(`MUI X: No filter operator found for column '${n.field}' and operator value '${o.operator}'.`);const l=p6e(t),c=a.getApplyFilterFn(o,n);return typeof c!="function"?null:{item:o,fn:u=>{let f=t.current.getRowValue(u,n);return i&&(f=VA(f)),c(f,u,n,l)}}};let mwe=1;const _Ft=(e,t,n)=>{const{items:r}=e,i=r.map(a=>b6e(a,t)).filter(a=>!!a);if(i.length===0)return null;if(n||!SFt())return(a,l)=>{const c={};for(let u=0;u`const shouldApply${l} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(a.item.field)});`).join(` `)} @@ -279,50 +279,49 @@ ${i.map((a,l)=>` ${JSON.stringify(String(a.item.id))}: !shouldApply${l} ? false `)} }; -return result$$;`.replaceAll("$$",String(SSe)));return SSe+=1,(a,l)=>o(i,a,l)},EVe=e=>e.quickFilterExcludeHiddenColumns??!0,GNt=(e,t)=>{const n=e.quickFilterValues?.filter(Boolean)??[];if(n.length===0)return null;const r=EVe(e)?$T(t):Gm(t),i=[],{ignoreDiacritics:o}=t.current.rootProps,s=xVe(t);return r.forEach(a=>{const l=t.current.getColumn(a),c=l?.getApplyQuickFilterFn;c&&i.push({column:l,appliers:n.map(u=>{const f=o?eR(u):u;return{fn:c(f,l,s)}})})}),function(l,c){const u={};e:for(let f=0;f{const r=HNt(e,t,n),i=GNt(e,t);return function(s,a,l){l.passingFilterItems=r?.(s,a)??null,l.passingQuickFilterValues=i?.(s,a)??null}},_Se=e=>e!=null,XNt=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(r=>OVe(r,t)!==null)),e.cleanedFilterItems),YNt=(e,t,n,r,i)=>{const o=XNt(i,r,n.items),s=e.filter(_Se),a=t.filter(_Se);if(s.length>0){const l=u=>s.some(f=>f[u.id]);if((n.logicOperator??JA().logicOperator)===Dl.And){if(!o.every(l))return!1}else if(!o.some(l))return!1}if(a.length>0&&n.quickFilterValues!=null){const l=u=>a.some(f=>f[u]);if((n.quickFilterLogicOperator??JA().quickFilterLogicOperator)===Dl.And){if(!n.quickFilterValues.every(l))return!1}else if(!n.quickFilterValues.some(l))return!1}return!0},QNt=e=>{if(!e)return null;const t=new RegExp(pj(e),"i");return(n,r,i,o)=>{let s=o.current.getRowFormattedValue(r,i);return o.current.ignoreDiacritics&&(s=eR(s)),s!=null?t.test(s.toString()):!1}},CSe=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),i=new RegExp(pj(r),"i");return o=>{if(o==null)return t;const s=i.test(String(o));return t?!s:s}},OSe=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),i=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>{if(o==null)return t;const s=i.compare(r,o.toString())===0;return t?!s:s}},ESe=e=>()=>t=>{const n=t===""||t==null;return e?!n:n},KNt=(e=!1)=>[{value:"contains",getApplyFilterFn:CSe(e,!1),InputComponent:mf},{value:"doesNotContain",getApplyFilterFn:CSe(e,!0),InputComponent:mf},{value:"equals",getApplyFilterFn:OSe(e,!1),InputComponent:mf},{value:"doesNotEqual",getApplyFilterFn:OSe(e,!0),InputComponent:mf},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${pj(n)}.*$`,"i");return i=>i!=null?r.test(i.toString()):!1},InputComponent:mf},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${pj(n)}$`,"i");return i=>i!=null?r.test(i.toString()):!1},InputComponent:mf},{value:"isEmpty",getApplyFilterFn:ESe(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:ESe(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(i=>i.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return i=>i!=null?n.some(o=>r.compare(o,i.toString()||"")===0):!1},InputComponent:vVe}],lh={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:INt,type:"string",align:"left",filterOperators:KNt(),renderEditCell:SNt,getApplyQuickFilterFn:QNt},ZNt=["open","target","onClose","children","position","className","onExited"],JNt=e=>{const{classes:t}=e;return Xe({root:["menu"]},hr,t)},e3t=Oe(Sb,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${ve.menuList}`]:{outline:0}})),t3t={"bottom-start":"top left","bottom-end":"top right"};function Lce(e){const{open:t,target:n,onClose:r,children:i,position:o,className:s,onExited:a}=e,l=it(e,ZNt),c=Kn(),u=tn(),f=JNt(u),d=M.useRef(null);ar(()=>{t?d.current=document.activeElement instanceof HTMLElement?document.activeElement:null:(d.current?.focus?.(),d.current=null)},[t]),M.useEffect(()=>{const g=t?"menuOpen":"menuClose";c.current.publishEvent(g,{target:n})},[c,t,n]);const h=g=>m=>{g&&g(),a&&a(m)},p=g=>{g.target&&(n===g.target||n?.contains(g.target))||r(g)};return O.jsx(e3t,X({as:u.slots.basePopper,className:Re(f.root,s),ownerState:u,open:t,anchorEl:n,transition:!0,placement:o},l,u.slotProps?.basePopper,{children:({TransitionProps:g,placement:m})=>O.jsx(ole,{onClickAway:p,mouseEvent:"onMouseDown",children:O.jsx(ow,X({},g,{style:{transformOrigin:t3t[m]},onExited:h(g?.onExited),children:O.jsx(fa,{children:i})}))})}))}const n3t=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],r3t=e=>typeof e.getActions=="function";function i3t(e){const{colDef:t,id:n,hasFocus:r,tabIndex:i,position:o="bottom-end",focusElementRef:s}=e,a=it(e,n3t),[l,c]=M.useState(-1),[u,f]=M.useState(!1),d=Kn(),h=M.useRef(null),p=M.useRef(null),g=M.useRef(!1),m=M.useRef({}),v=bi(),y=ur(),b=ur(),w=tn();if(!r3t(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const S=t.getActions(d.current.getRowParams(n)),_=S.filter($=>!$.props.showInMenu),E=S.filter($=>$.props.showInMenu),T=_.length+(E.length?1:0);M.useLayoutEffect(()=>{r||Object.entries(m.current).forEach(([$,j])=>{j?.stop({},()=>{delete m.current[$]})})},[r]),M.useEffect(()=>{if(l<0||!h.current||l>=h.current.children.length)return;h.current.children[l].focus({preventScroll:!0})},[l]),M.useEffect(()=>{r||(c(-1),g.current=!1)},[r]),M.useImperativeHandle(s,()=>({focus(){if(!g.current){const $=S.findIndex(j=>!j.props.disabled);c($)}}}),[S]),M.useEffect(()=>{l>=T&&c(T-1)},[l,T]);const k=()=>{f(!0),c(T-1),g.current=!0},P=()=>{f(!1)},R=$=>{$.stopPropagation(),$.preventDefault(),u?P():k()},I=$=>j=>{m.current[$]=j},F=($,j)=>V=>{c($),g.current=!0,j&&j(V)},A=$=>{if(T<=1)return;const j=(U,z)=>{if(U<0||U>S.length)return U;const B=(z==="left"?-1:1)*(v?-1:1);return S[U+B]?.props.disabled?j(U+B,z):U+B};let V=l;$.key==="ArrowRight"?V=j(l,"right"):$.key==="ArrowLeft"&&(V=j(l,"left")),!(V<0||V>=T)&&V!==l&&($.preventDefault(),$.stopPropagation(),c(V))},L=$=>{$.key==="Tab"&&$.preventDefault(),["Tab","Escape"].includes($.key)&&P()};return O.jsxs("div",X({role:"menu",ref:h,tabIndex:-1,className:ve.actionsCell,onKeyDown:A},a,{children:[_.map(($,j)=>M.cloneElement($,{key:j,touchRippleRef:I(j),onClick:F(j,$.props.onClick),tabIndex:l===j?i:-1})),E.length>0&&b&&O.jsx(w.slots.baseIconButton,X({ref:p,id:b,"aria-label":d.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?y:void 0,role:"menuitem",size:"small",onClick:R,touchRippleRef:I(b),tabIndex:l===_.length?i:-1},w.slotProps?.baseIconButton,{children:O.jsx(w.slots.moreActionsIcon,{fontSize:"small"})})),E.length>0&&O.jsx(Lce,{open:u,target:p.current,position:o,onClose:P,children:O.jsx(nS,{id:y,className:ve.menuList,onKeyDown:L,"aria-labelledby":b,variant:"menu",autoFocusItem:!0,children:E.map(($,j)=>M.cloneElement($,{key:j,closeMenu:P}))})})]}))}const o3t=e=>O.jsx(i3t,X({},e)),AU="actions",s3t=X({},lh,{sortable:!1,filterable:!1,aggregable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:o3t,getApplyQuickFilterFn:void 0}),Ca="auto-generated-group-node-root",ZO=Symbol("mui.id_autogenerated"),a3t=()=>({type:"group",id:Ca,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function l3t(e,t,n="A row was provided without id in the rows prop:"){if(e==null)throw new Error(["MUI X: The Data Grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join(` -`))}const RU=(e,t,n)=>{const r=t?t(e):e.id;return l3t(r,e,n),r},Dz=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const i={type:"full",rows:[]},o={},s={};for(let a=0;a{const n=e[Ca];return Math.max(t,n.children.length+(n.footerId==null?0:1))},PVe=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:i,previousGroupsToFetch:o})=>{const s=e.current.caches.rows,{tree:a,treeDepths:l,dataRowIds:c,groupingName:u,groupsToFetch:f=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:i,updates:s.updates,dataRowIdToIdLookup:s.dataRowIdToIdLookup,dataRowIdToModelLookup:s.dataRowIdToModelLookup,previousGroupsToFetch:o}),d=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:a,treeDepths:l,dataRowIdToIdLookup:s.dataRowIdToIdLookup,dataRowIds:c,dataRowIdToModelLookup:s.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},X({},d,{totalRowCount:Math.max(t,d.dataRowIds.length),totalTopLevelRowCount:TVe({tree:d.tree,rowCountProp:t}),groupingName:u,loading:n,groupsToFetch:f})},JO=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,Fce=(e,t,n)=>{const r=e[t];if(r.type!=="group")return[];const i=[];for(let o=0;o{if(e.updates.type==="full")throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const i=new Map;n.forEach(u=>{const f=RU(u,t,"A row was provided without id when calling updateRows():");i.has(f)?i.set(f,X({},i.get(f),u)):i.set(f,u)});const o={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:X({},e.updates.idToActionLookup),groupKeys:r},s=X({},e.dataRowIdToModelLookup),a=X({},e.dataRowIdToIdLookup),l={insert:{},modify:{},remove:{}};i.forEach((u,f)=>{const d=o.idToActionLookup[f];if(u._action==="delete"){if(d==="remove"||!s[f])return;d!=null&&(l[d][f]=!0),o.actions.remove.push(f),delete s[f],delete a[f];return}const h=s[f];if(h){d==="remove"?(l.remove[f]=!0,o.actions.modify.push(f)):d==null&&o.actions.modify.push(f),s[f]=X({},h,u);return}d==="remove"?(l.remove[f]=!0,o.actions.insert.push(f)):d==null&&o.actions.insert.push(f),s[f]=u,a[f]=f});const c=Object.keys(l);for(let u=0;u0&&(o.actions[f]=o.actions[f].filter(h=>!d[h]))}return{dataRowIdToModelLookup:s,dataRowIdToIdLookup:a,updates:o,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},kVe="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function PSe(e,t,n){const r=[];return t.forEach(i=>{const o=RU(i,n,"A row was provided without id when calling updateRows():");if(e.current.getRowNode(o)?.type==="pinnedRow"){const a=e.current.caches.pinnedRows,l=a.idLookup[o];l&&(a.idLookup[o]=X({},l,i))}else r.push(i)}),r}const MVe=(e,t,n)=>typeof e=="number"&&e>0?e:t,c3t="__tree_data_group__",AVe="__row_group_by_columns_group__",IU="__detail_panel_toggle__";let or=(function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e})({});const u3t=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"],f3t=e=>{const{classes:t}=e;return Xe({root:["booleanCell"]},hr,t)};function d3t(e){const{value:t,rowNode:n}=e,r=it(e,u3t),i=Kn(),o=tn(),s={classes:o.classes},a=f3t(s),c=ut(i,mS)>0&&n.type==="group"&&o.treeData===!1,u=M.useMemo(()=>t?o.slots.booleanCellTrueIcon:o.slots.booleanCellFalseIcon,[o.slots.booleanCellFalseIcon,o.slots.booleanCellTrueIcon,t]);return c&&t===void 0?null:O.jsx(u,X({fontSize:"small",className:a.root,titleAccess:i.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},r))}const h3t=M.memo(d3t),p3t=e=>e.field!==AVe&&JO(e.rowNode)?"":O.jsx(h3t,X({},e)),g3t=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],m3t=e=>{const{classes:t}=e;return Xe({root:["editBooleanCell"]},hr,t)};function v3t(e){const{id:t,value:n,field:r,className:i,hasFocus:o,onValueChange:s}=e,a=it(e,g3t),l=Kn(),c=M.useRef(null),u=ur(),[f,d]=M.useState(n),h=tn(),p={classes:h.classes},g=m3t(p),m=M.useCallback(async v=>{const y=v.target.checked;s&&await s(v,y),d(y),await l.current.setEditCellValue({id:t,field:r,value:y},v)},[l,r,t,s]);return M.useEffect(()=>{d(n)},[n]),ar(()=>{o&&c.current.focus()},[o]),O.jsx("label",X({htmlFor:u,className:Re(g.root,i)},a,{children:O.jsx(h.slots.baseCheckbox,X({id:u,inputRef:c,checked:!!f,onChange:m,size:"small"},h.slotProps?.baseCheckbox))}))}const y3t=e=>O.jsx(v3t,X({},e)),b3t=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],Lz=e=>{if(String(e).toLowerCase()==="true")return!0;if(String(e).toLowerCase()==="false")return!1},x3t=Oe("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function w3t(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:i,clearButton:o,tabIndex:s,label:a,variant:l="standard"}=e,c=it(e,b3t),[u,f]=M.useState(Lz(t.value)),d=tn(),h=ur(),p=ur(),g=d.slotProps?.baseSelect||{},m=g.native??!1,v=d.slotProps?.baseSelectOption||{},y=M.useCallback(w=>{const S=Lz(w.target.value);f(S),n(X({},t,{value:S}))},[n,t]);M.useEffect(()=>{f(Lz(t.value))},[t.value]);const b=a??r.current.getLocaleText("filterPanelInputLabel");return O.jsxs(x3t,{children:[O.jsxs(d.slots.baseFormControl,{fullWidth:!0,children:[O.jsx(d.slots.baseInputLabel,X({},d.slotProps?.baseInputLabel,{id:h,shrink:!0,variant:l,children:b})),O.jsxs(d.slots.baseSelect,X({labelId:h,id:p,label:b,value:u===void 0?"":String(u),onChange:y,variant:l,notched:l==="outlined"?!0:void 0,native:m,displayEmpty:!0,inputProps:{ref:i,tabIndex:s}},c,g,{children:[O.jsx(d.slots.baseSelectOption,X({},v,{native:m,value:"",children:r.current.getLocaleText("filterValueAny")})),O.jsx(d.slots.baseSelectOption,X({},v,{native:m,value:"true",children:r.current.getLocaleText("filterValueTrue")})),O.jsx(d.slots.baseSelectOption,X({},v,{native:m,value:"false",children:r.current.getLocaleText("filterValueFalse")}))]}))]}),o]})}const S3t=()=>[{value:"is",getApplyFilterFn:e=>{const t=Lz(e.value);return t===void 0?null:n=>!!n===t},InputComponent:w3t}],_3t=(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),C3t=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},RVe=X({},lh,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:p3t,renderEditCell:y3t,sortComparator:pVe,valueFormatter:_3t,filterOperators:S3t(),getApplyQuickFilterFn:void 0,aggregable:!1,pastedValueParser:e=>C3t(e)}),IVe=e=>e.sorting,zT=xn(IVe,e=>e.sortedRows),$ce=zr(zT,Cf,ds,(e,t,n)=>e.reduce((r,i)=>{const o=t[i];if(o)r.push({id:i,model:o});else{const s=n[i];s&&JO(s)&&r.push({id:i,model:{[ZO]:i}})}return r},[])),zd=xn(IVe,e=>e.sortModel),O3t=zr(zd,e=>e.reduce((n,r,i)=>(n[r.field]={sortDirection:r.sort,sortIndex:e.length>1?i+1:void 0},n),{}));zr(zT,e=>e.reduce((t,n,r)=>(t[n]=r,t),Object.create(null)));const DU=e=>e.filter,Hs=xn(DU,e=>e.filterModel),E3t=xn(Hs,e=>e.quickFilterValues),T3t=e=>e.visibleRowsLookup,jT=xn(DU,e=>e.filteredRowsLookup);xn(DU,e=>e.filteredChildrenCountLookup);xn(DU,e=>e.filteredDescendantCountLookup);const kb=zr(T3t,$ce,mS,Hs,E3t,(e,t,n,r,i)=>n<2&&!r.items.length&&!i?.length?t:t.filter(o=>e[o.id]!==!1)),hO=zr(kb,e=>e.map(t=>t.id)),DVe=zr(jT,$ce,(e,t)=>t.filter(n=>e[n.id]!==!1)),LVe=zr(DVe,e=>e.map(t=>t.id));zr(hO,ds,(e,t)=>{const n={};let r=0;return e.reduce((i,o)=>{const s=t[o];return n[s.depth]||(n[s.depth]=0),s.depth>r&&(n[s.depth]=0),r=s.depth,n[s.depth]+=1,i[o]=n[s.depth],i},{})});const FVe=zr(kb,ds,mS,(e,t,n)=>n<2?e:e.filter(r=>t[r.id]?.depth===0)),Nce=xn(kb,e=>e.length),zce=xn(FVe,e=>e.length),P3t=xn(DVe,e=>e.length);xn(P3t,zce,(e,t)=>e-t);const $Ve=zr(Hs,kv,(e,t)=>e.items?.filter(n=>{if(!n.field)return!1;const r=t[n.field];if(!r?.filterOperators||r?.filterOperators?.length===0)return!1;const i=r.filterOperators.find(o=>o.value===n.operator);return i?!i.InputComponent||n.value!=null&&n.value?.toString()!=="":!1})),k3t=zr($Ve,e=>e.reduce((n,r)=>(n[r.field]?n[r.field].push(r):n[r.field]=[r],n),{})),hu=e=>e.rowSelection,M3t=xn(hu,e=>e.length),A3t=zr(hu,Cf,(e,t)=>new Map(e.map(n=>[n,t[n]]))),R0=zr(hu,e=>e.reduce((t,n)=>(t[n]=n,t),{}));function NVe(e,t){const n=ds(e),r=zT(e),i=jT(e),o=n[t];if(!o||o.type!=="group")return[];const s=[],a=r.findIndex(l=>l===t)+1;for(let l=a;lo.depth;l+=1){const c=r[l];i[c]!==!1&&e.current.isRowSelectable(c)&&s.push(c)}return s}function R3t(e,t){return xn(ds,zT,jT,R0,(n,r,i,o)=>{const s=n[e];if(!s||s.type!=="group")return{isIndeterminate:!1,isChecked:o[e]===e};if(o[e]===e)return{isIndeterminate:!1,isChecked:!0};let a=0,l=0;const c=r.findIndex(u=>u===e)+1;for(let u=c;us.depth;u+=1){const f=r[u];i[f]!==!1&&(a+=1,o[f]!==void 0&&(l+=1))}return{isIndeterminate:l>0&&(l0:o[e]===e}})}function jce(e){return e.signature===Lf.DataGrid?e.checkboxSelection&&e.disableMultipleRowSelection!==!0:!e.disableMultipleRowSelection}const I3t=(e,t)=>{const n=[];let r=t;for(;r!=null&&r!==Ca;){const i=e[r];if(!i)return n;n.push(r),r=i.parent}return n},D3t=(e,t,n)=>{const r=e[n];if(!r)return[];const i=r.parent;return i==null?[]:e[i].children.filter(s=>s!==n&&t[s]!==!1)},Fk=(e,t,n,r,i,o,s=new Set(hu(e.current.state)))=>{const a=jT(e),l=new Set([]);if(!(!r&&!i||a[n]===!1)&&(r&&t[n]?.type==="group"&&NVe(e,n).forEach(f=>{o(f),l.add(f)}),i)){const c=f=>{if(!s.has(f)&&!l.has(f))return!1;const d=t[f];return d?d.type!=="group"?!0:d.children.every(c):!1},u=f=>{const d=D3t(t,a,f);if(d.length===0||d.every(c)){const p=t[f]?.parent;p!=null&&p!==Ca&&e.current.isRowSelectable(p)&&(o(p),l.add(p),u(p))}};u(n)}},kSe=(e,t,n,r,i,o)=>{const s=R0(e);!i&&!r||(i&&I3t(t,n).forEach(l=>{s[l]===l&&o(l)}),r&&t[n]?.type==="group"&&NVe(e,n).forEach(c=>{o(c)}))},L3t=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],F3t=e=>{const{classes:t}=e;return Xe({root:["checkboxInput"]},hr,t)},$3t=Er(function(t,n){const{field:r,id:i,rowNode:o,hasFocus:s,tabIndex:a}=t,l=it(t,L3t),c=Kn(),u=tn(),f={classes:u.classes},d=F3t(f),h=M.useRef(null),p=M.useRef(null),g=zn(h,n),m=T=>{const k={value:T.target.checked,id:i};c.current.publishEvent("rowSelectionCheckboxChange",k,T)};M.useLayoutEffect(()=>{if(a===0){const T=c.current.getCellElement(i,r);T&&(T.tabIndex=-1)}},[c,a,i,r]),M.useEffect(()=>{s?h.current?.querySelector("input")?.focus({preventScroll:!0}):p.current&&p.current.stop({})},[s]);const v=M.useCallback(T=>{T.key===" "&&T.stopPropagation()},[]),y=c.current.isRowSelectable(i),b=R3t(i,u.rowSelectionPropagation?.parents??!1),{isIndeterminate:w,isChecked:S}=ut(c,b,Mce);if(o.type==="footer"||o.type==="pinnedRow")return null;const _=u.indeterminateCheckboxAction==="select"?S&&!w:S,E=c.current.getLocaleText(_?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return O.jsx(u.slots.baseCheckbox,X({tabIndex:a,checked:_,onChange:m,className:d.root,inputProps:{"aria-label":E,name:"select_row"},onKeyDown:v,indeterminate:w,disabled:!y,touchRippleRef:p},u.slotProps?.baseCheckbox,l,{ref:g}))}),N3t=$3t,LU=e=>e.focus,vc=xn(LU,e=>e.cell),z3t=xn(LU,e=>e.columnHeader);xn(LU,e=>e.columnHeaderFilter);const mj=xn(LU,e=>e.columnGroupHeader),FU=e=>e.tabIndex,Bce=xn(FU,e=>e.cell),zVe=xn(FU,e=>e.columnHeader);xn(FU,e=>e.columnHeaderFilter);const j3t=xn(FU,e=>e.columnGroupHeader);function qn(e,t,n){const r=M.useRef(!0);ar(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}function Ns(e,t){const n=M.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}const jVe=(e,t,n,r,i)=>{const o=Ns(e,"useNativeEventListener");ii(e,"rootMount",()=>{const s=typeof t=="function"?t():t.current;if(!(!s||!n||!r))return o.debug(`Binding native ${n} event`),s.addEventListener(n,r,i),()=>{o.debug(`Clearing native ${n} event`),s.removeEventListener(n,r,i)}})},MD=e=>{const t=M.useRef(!0);t.current&&(t.current=!1,e())},B3t=()=>{},U3t=(e,t)=>{const n=M.useRef(!1);ar(()=>n.current||!e?B3t:(n.current=!0,t()),[n.current||e])},V3t=100,W3t=e=>e?0:100,BVe=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):e===-1?n+2:0,UVe=e=>({page:0,pageSize:e?0:100}),H3t=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),VVe=(e,t)=>{if(t===Lf.DataGrid&&e>V3t)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` -`))},G3t=-1,AD=e=>e.pagination,WVe=xn(AD,e=>e.enabled&&e.paginationMode==="client"),tl=xn(AD,e=>e.paginationModel),zC=xn(AD,e=>e.rowCount),tM=xn(AD,e=>e.meta),q3t=xn(tl,e=>e.page),HVe=xn(tl,e=>e.pageSize),GVe=xn(tl,zC,(e,t)=>BVe(t,e.pageSize,e.page)),Uce=zr(WVe,tl,ds,mS,kb,FVe,(e,t,n,r,i,o)=>{if(!e)return null;const s=o.length,a=Math.min(t.pageSize*t.page,s-1),l=t.pageSize===G3t?s-1:Math.min(a+t.pageSize-1,s-1);if(a===-1||l===-1)return null;if(r<2)return{firstRowIndex:a,lastRowIndex:l};const c=o[a],u=l-a+1,f=i.findIndex(p=>p.id===c.id);let d=f,h=0;for(;d0)&&(d+=1),g===0&&(h+=1))}return{firstRowIndex:f,lastRowIndex:d-1}}),X3t=zr(kb,Uce,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),qVe=zr(hO,Uce,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),RD=zr(WVe,Uce,X3t,kb,(e,t,n,r)=>e?{rows:n,range:t,rowToIndexMap:n.reduce((i,o,s)=>(i.set(o.model,s),i),new Map)}:{rows:r,range:r.length===0?null:{firstRowIndex:0,lastRowIndex:r.length-1},rowToIndexMap:r.reduce((i,o,s)=>(i.set(o.model,s),i),new Map)}),Y3t=["field","colDef"],Q3t=e=>{const{classes:t}=e;return Xe({root:["checkboxInput"]},hr,t)},K3t=Er(function(t,n){const r=it(t,Y3t),[,i]=M.useState(!1),o=Kn(),s=tn(),a={classes:s.classes},l=Q3t(a),c=ut(o,zVe),u=ut(o,hu),f=ut(o,hO),d=ut(o,qVe),h=M.useMemo(()=>typeof s.isRowSelectable!="function"?u:u.filter(T=>s.keepNonExistentRowsSelected?!0:o.current.getRow(T)?s.isRowSelectable(o.current.getRowParams(T)):!1),[o,s.isRowSelectable,u,s.keepNonExistentRowsSelected]),p=M.useMemo(()=>(!s.pagination||!s.checkboxSelectionVisibleOnly||s.paginationMode==="server"?f:d).reduce((k,P)=>(k[P]=!0,k),{}),[s.pagination,s.paginationMode,s.checkboxSelectionVisibleOnly,d,f]),g=M.useMemo(()=>h.filter(T=>p[T]).length,[h,p]),m=g>0&&g0,y=T=>{const k={value:T.target.checked};o.current.publishEvent("headerSelectionCheckboxChange",k)},b=c!==null&&c.field===t.field?0:-1;M.useLayoutEffect(()=>{const T=o.current.getColumnHeaderElement(t.field);b===0&&T&&(T.tabIndex=-1)},[b,o,t.field]);const w=M.useCallback(T=>{T.key===" "&&o.current.publishEvent("headerSelectionCheckboxChange",{value:!v})},[o,v]),S=M.useCallback(()=>{i(T=>!T)},[]);M.useEffect(()=>o.current.subscribeEvent("rowSelectionChange",S),[o,S]);const _=s.indeterminateCheckboxAction==="select"?v&&!m:v,E=o.current.getLocaleText(_?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return O.jsx(s.slots.baseCheckbox,X({indeterminate:m,checked:_,onChange:y,className:l.root,inputProps:{"aria-label":E,name:"select_all_rows"},tabIndex:b,onKeyDown:w,disabled:!jce(s)},s.slotProps?.baseCheckbox,r,{ref:n}))}),ID=(e,t)=>ZO in t?t[ZO]:e.props.getRowId?e.props.getRowId(t):t.id,df="__check__",BT=X({},RVe,{type:"custom",field:df,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,display:"flex",valueGetter:(e,t,n,r)=>{const i=R0(r),o=ID(r.current.state,t);return i[o]!==void 0},renderHeader:e=>O.jsx(K3t,X({},e)),renderCell:e=>O.jsx(N3t,X({},e))}),Z3t=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function MSe(e,t){if(e==null)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":t==="date"?n.toISOString().substring(0,10):t==="datetime-local"?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function C_(e){const{item:t,applyValue:n,type:r,apiRef:i,focusElementRef:o,InputProps:s,clearButton:a,tabIndex:l,disabled:c}=e,u=it(e,Z3t),f=jl(),[d,h]=M.useState(()=>MSe(t.value,r)),[p,g]=M.useState(!1),m=ur(),v=tn(),y=M.useCallback(b=>{f.clear();const w=b.target.value;h(w),g(!0),f.start(v.filterDebounceMs,()=>{const S=new Date(w);n(X({},t,{value:Number.isNaN(S.getTime())?void 0:S})),g(!1)})},[n,t,v.filterDebounceMs,f]);return M.useEffect(()=>{const b=MSe(t.value,r);h(b)},[t.value,r]),O.jsx(v.slots.baseTextField,X({fullWidth:!0,id:m,label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),value:d,onChange:y,variant:"standard",type:r||"text",InputLabelProps:{shrink:!0},inputRef:o,InputProps:X({},p||a?{endAdornment:p?O.jsx(v.slots.loadIcon,{fontSize:"small",color:"action"}):a}:{},{disabled:c},s,{inputProps:X({max:r==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:l},s?.inputProps)})},u,v.slotProps?.baseTextField))}function O_(e,t,n,r){if(!e.value)return null;const i=new Date(e.value);n?i.setSeconds(0,0):(i.setMinutes(i.getMinutes()+i.getTimezoneOffset()),i.setHours(0,0,0,0));const o=i.getTime();return s=>{if(!s)return!1;if(r)return t(s.getTime(),o);const a=new Date(s);return n?a.setSeconds(0,0):a.setHours(0,0,0,0),t(a.getTime(),o)}}const XVe=e=>[{value:"is",getApplyFilterFn:t=>O_(t,(n,r)=>n===r,e),InputComponent:C_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>O_(t,(n,r)=>n!==r,e),InputComponent:C_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>O_(t,(n,r)=>n>r,e),InputComponent:C_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>O_(t,(n,r)=>n>=r,e),InputComponent:C_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>O_(t,(n,r)=>nO_(t,(n,r)=>n<=r,e),InputComponent:C_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>t=>t!=null,requiresFilterValue:!1}],J3t=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],ezt=Oe(wT)({fontSize:"inherit"}),tzt=e=>{const{classes:t}=e;return Xe({root:["editInputCell"]},hr,t)};function nzt(e){const{id:t,value:n,field:r,colDef:i,hasFocus:o,inputProps:s,onValueChange:a}=e,l=it(e,J3t),c=i.type==="dateTime",u=Kn(),f=M.useRef(null),d=M.useMemo(()=>{let w;n==null?w=null:n instanceof Date?w=n:w=new Date((n??"").toString());let S;return w==null||Number.isNaN(w.getTime())?S="":S=new Date(w.getTime()-w.getTimezoneOffset()*60*1e3).toISOString().substr(0,c?16:10),{parsed:w,formatted:S}},[n,c]),[h,p]=M.useState(d),m={classes:tn().classes},v=tzt(m),y=M.useCallback(w=>{if(w==="")return null;const[S,_]=w.split("T"),[E,T,k]=S.split("-"),P=new Date;if(P.setFullYear(Number(E),Number(T)-1,Number(k)),P.setHours(0,0,0,0),_){const[R,I]=_.split(":");P.setHours(Number(R),Number(I),0,0)}return P},[]),b=M.useCallback(async w=>{const S=w.target.value,_=y(S);a&&await a(w,_),p({parsed:_,formatted:S}),u.current.setEditCellValue({id:t,field:r,value:_},w)},[u,r,t,a,y]);return M.useEffect(()=>{p(w=>d.parsed!==w.parsed&&d.parsed?.getTime()!==w.parsed?.getTime()?d:w)},[d]),ar(()=>{o&&f.current.focus()},[o]),O.jsx(ezt,X({inputRef:f,fullWidth:!0,className:v.root,type:c?"datetime-local":"date",inputProps:X({max:c?"9999-12-31T23:59":"9999-12-31"},s),value:h.formatted,onChange:b},l))}const YVe=e=>O.jsx(nzt,X({},e));function QVe({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join(` -`))}const rzt=(e,t,n,r)=>{if(!e)return"";const i=ID(r.current.state,t);return QVe({value:e,columnType:"date",rowId:i,field:n.field}),e.toLocaleDateString()},izt=(e,t,n,r)=>{if(!e)return"";const i=ID(r.current.state,t);return QVe({value:e,columnType:"dateTime",rowId:i,field:n.field}),e.toLocaleString()},ozt=X({},lh,{type:"date",sortComparator:gVe,valueFormatter:rzt,filterOperators:XVe(),renderEditCell:YVe,pastedValueParser:e=>new Date(e)}),szt=X({},lh,{type:"dateTime",sortComparator:gVe,valueFormatter:izt,filterOperators:XVe(!0),renderEditCell:YVe,pastedValueParser:e=>new Date(e)}),Xy=e=>e==null?null:Number(e),azt=e=>e==null||Number.isNaN(e)||e===""?null:t=>Xy(t)===Xy(e),lzt=()=>[{value:"=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>Xy(t)===e.value,InputComponent:mf,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>Xy(t)!==e.value,InputComponent:mf,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Xy(t)>e.value,InputComponent:mf,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Xy(t)>=e.value,InputComponent:mf,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Xy(t)e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Xy(t)<=e.value,InputComponent:mf,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:vVe,InputComponentProps:{type:"number"}}],czt=X({},lh,{type:"number",align:"right",headerAlign:"right",sortComparator:pVe,valueParser:e=>e===""?null:Number(e),valueFormatter:e=>LNt(e)?e.toLocaleString():e||"",filterOperators:lzt(),getApplyQuickFilterFn:azt});function eE(e){return e?.type==="singleSelect"}function fw(e,t){if(e)return typeof e.valueOptions=="function"?e.valueOptions(X({field:e.field},t)):e.valueOptions}function vj(e,t,n){if(t===void 0)return;const r=t.find(i=>{const o=n(i);return String(o)===String(e)});return n(r)}const uzt=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],fzt=["MenuProps"];function dzt(e){return!!e.key}function hzt(e){const t=tn(),{id:n,value:r,field:i,row:o,colDef:s,hasFocus:a,error:l,onValueChange:c,initialOpen:u=t.editMode===eg.Cell}=e,f=it(e,uzt),d=Kn(),h=M.useRef(null),p=M.useRef(null),[g,m]=M.useState(u),y=(t.slotProps?.baseSelect||{}).native??!1,b=t.slotProps?.baseSelect||{},{MenuProps:w}=b,S=it(b,fzt);if(ar(()=>{a&&p.current?.focus()},[a]),!eE(s))return null;const _=fw(s,{id:n,row:o});if(!_)return null;const E=s.getOptionValue,T=s.getOptionLabel,k=async I=>{if(!eE(s)||!_)return;m(!1);const F=I.target,A=vj(F.value,_,E);c&&await c(I,A),await d.current.setEditCellValue({id:n,field:i,value:A},I)},P=(I,F)=>{if(t.editMode===eg.Row){m(!1);return}if(F==="backdropClick"||I.key==="Escape"){const A=d.current.getCellParams(n,i);d.current.publishEvent("cellEditStop",X({},A,{reason:I.key==="Escape"?Nd.escapeKeyDown:Nd.cellFocusOut}))}},R=I=>{dzt(I)&&I.key==="Enter"||m(!0)};return!_||!s?null:O.jsx(t.slots.baseSelect,X({ref:h,inputRef:p,value:r,onChange:k,open:g,onOpen:R,MenuProps:X({onClose:P},w),error:l,native:y,fullWidth:!0},f,S,{children:_.map(I=>{const F=E(I);return M.createElement(t.slots.baseSelectOption,X({},t.slotProps?.baseSelectOption||{},{native:y,key:F,value:F}),T(I))})}))}const pzt=e=>O.jsx(hzt,X({},e)),gzt=["item","applyValue","type","apiRef","focusElementRef","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],mzt=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:r,isSelectNative:i,baseSelectOptionProps:o})=>["",...fw(e)||[]].map(a=>{const l=r(a);let c=n(a);return c===""&&(c=" "),M.createElement(t,X({},o,{native:i,key:l,value:l}),c)}),vzt=Oe("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function ASe(e){const{item:t,applyValue:n,type:r,apiRef:i,focusElementRef:o,placeholder:s,tabIndex:a,label:l,variant:c="standard",clearButton:u}=e,f=it(e,gzt),d=t.value??"",h=ur(),p=ur(),g=tn(),m=g.slotProps?.baseSelect?.native??!1;let v=null;if(t.field){const E=i.current.getColumn(t.field);eE(E)&&(v=E)}const y=v?.getOptionValue,b=v?.getOptionLabel,w=M.useMemo(()=>fw(v),[v]),S=M.useCallback(E=>{let T=E.target.value;T=vj(T,w,y),n(X({},t,{value:T}))},[w,y,n,t]);if(!eE(v))return null;const _=l??i.current.getLocaleText("filterPanelInputLabel");return O.jsxs(vzt,{children:[O.jsxs(g.slots.baseFormControl,{fullWidth:!0,children:[O.jsx(g.slots.baseInputLabel,X({},g.slotProps?.baseInputLabel,{id:p,htmlFor:h,shrink:!0,variant:c,children:_})),O.jsx(g.slots.baseSelect,X({id:h,label:_,labelId:p,value:d,onChange:S,variant:c,type:r||"text",inputProps:{tabIndex:a,ref:o,placeholder:s??i.current.getLocaleText("filterPanelInputPlaceholder")},native:m,notched:c==="outlined"?!0:void 0},f,g.slotProps?.baseSelect,{children:mzt({column:v,OptionComponent:g.slots.baseSelectOption,getOptionLabel:b,getOptionValue:y,isSelectNative:m,baseSelectOptionProps:g.slotProps?.baseSelectOption})}))]}),u]})}const yzt=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],bzt=["key"],xzt=Dje();function wzt(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:i,color:o,error:s,helperText:a,size:l,variant:c="standard"}=e,u=it(e,yzt),f={color:o,error:s,helperText:a,size:l,variant:c},d=ur(),h=tn();let p=null;if(t.field){const S=r.current.getColumn(t.field);eE(S)&&(p=S)}const g=p?.getOptionValue,m=p?.getOptionLabel,v=M.useCallback((S,_)=>g(S)===g(_),[g]),y=M.useMemo(()=>fw(p)||[],[p]),b=M.useMemo(()=>Array.isArray(t.value)?t.value.reduce((S,_)=>{const E=y.find(T=>g(T)===_);return E!=null&&S.push(E),S},[]):[],[g,t.value,y]),w=M.useCallback((S,_)=>{n(X({},t,{value:_.map(g)}))},[n,t,g]);return O.jsx(Gje,X({multiple:!0,options:y,isOptionEqualToValue:v,filterOptions:xzt,id:d,value:b,onChange:w,getOptionLabel:m,renderTags:(S,_)=>S.map((E,T)=>{const k=_({index:T}),{key:P}=k,R=it(k,bzt);return O.jsx(h.slots.baseChip,X({variant:"outlined",size:"small",label:m(E)},R),P)}),renderInput:S=>O.jsx(h.slots.baseTextField,X({},S,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:X({},S.InputLabelProps,{shrink:!0}),inputRef:i,type:"singleSelect"},f,h.slotProps?.baseTextField))},u))}const E_=e=>e==null||!Ice(e)?e:e.value,Szt=()=>[{value:"is",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>E_(t)===E_(e.value),InputComponent:ASe},{value:"not",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>E_(t)!==E_(e.value),InputComponent:ASe},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(E_);return n=>t.includes(E_(n))},InputComponent:wzt}],_zt=e=>typeof e[0]=="object",Czt=e=>Ice(e)?e.value:e,Ozt=e=>Ice(e)?e.label:String(e),Ezt=X({},lh,{type:"singleSelect",getOptionLabel:Ozt,getOptionValue:Czt,valueFormatter(e,t,n,r){const i=ID(r.current.state,t);if(!eE(n))return"";const o=fw(n,{id:i,row:t});if(e==null)return"";if(!o)return e;if(!_zt(o))return n.getOptionLabel(e);const s=o.find(a=>n.getOptionValue(a)===e);return s?n.getOptionLabel(s):""},renderEditCell:pzt,filterOperators:Szt(),pastedValueParser:(e,t,n)=>{const r=n,i=fw(r)||[],o=r.getOptionValue;if(i.find(a=>o(a)===e))return e}}),Tzt="string",Pzt=()=>({string:lh,number:czt,date:ozt,dateTime:szt,boolean:RVe,singleSelect:Ezt,[AU]:s3t,custom:lh}),Vce=e=>e.headerFiltering,kzt=xn(Vce,e=>e?.enabled??!1),Mzt=xn(Vce,e=>e.editing),Azt=xn(Vce,e=>e.menuOpen),$U=e=>e.columnGrouping,KVe=zr($U,e=>e?.unwrappedGroupingModel??{}),ZVe=zr($U,e=>e?.lookup??{}),Rzt=zr($U,e=>e?.headerStructure??[]),DD=xn($U,e=>e?.maxDepth??0),JVe=["maxWidth","minWidth","width","flex"],J9=Pzt();function Izt({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(s=>s.field)),i={all:{},frozenFields:[],freeze:s=>{const a=i.all[s];a&&a.frozen!==!0&&(i.all[s].frozen=!0,i.frozenFields.push(s))}};function o(){if(i.frozenFields.length===r.size)return;const s={min:{},max:{}};let a=e,l=t,c=0;i.frozenFields.forEach(u=>{a-=i.all[u].computedWidth,l-=i.all[u].flex});for(let u=0;uf.maxWidth&&(c+=f.maxWidth-h,h=f.maxWidth,s.max[f.field]=!0),i.all[f.field]={frozen:!1,computedWidth:h,flex:f.flex}}c<0?Object.keys(s.max).forEach(u=>{i.freeze(u)}):c>0?Object.keys(s.min).forEach(u=>{i.freeze(u)}):n.forEach(({field:u})=>{i.freeze(u)}),o()}return o(),i.all}const one=(e,t)=>{const n={};let r=0,i=0;const o=[];e.orderedFields.forEach(l=>{let c=e.lookup[l],u=0,f=!1;e.columnVisibilityModel[l]!==!1&&(c.flex&&c.flex>0?(r+=c.flex,f=!0):u=Mu(c.width||lh.width,c.minWidth||lh.minWidth,c.maxWidth||lh.maxWidth),i+=u),c.computedWidth!==u&&(c=X({},c,{computedWidth:u})),f&&o.push(c),n[l]=c});const s=t===void 0?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),a=Math.max(s-i,0);if(r>0&&s>0){const l=Izt({initialFreeSpace:a,totalFlexUnits:r,flexColumns:o});Object.keys(l).forEach(c=>{n[c].computedWidth=l[c].computedWidth})}return X({},e,{lookup:n})},Dzt=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,i=Object.keys(r);if(i.length===0&&n.length===0)return e;const o={},s=[];for(let u=0;u!o[u])],l=X({},e.lookup);for(let u=0;u{d[h]=p===-1?1/0:p}),l[f]=d}return X({},e,{orderedFields:a,lookup:l})};function RSe(e){let t=J9[Tzt];return e&&J9[e]&&(t=J9[e]),t}const OC=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=Of(e),keepOnlyColumnsToUpsert:i=!1})=>{const o=!e.current.state.columns;let s;if(o)s={orderedFields:[],lookup:{},columnVisibilityModel:r};else{const u=Up(e.current.state);s={orderedFields:i?[]:[...u.orderedFields],lookup:X({},u.lookup),columnVisibilityModel:r}}let a={};i&&!o&&(a=Object.keys(s.lookup).reduce((u,f)=>X({},u,{[f]:!1}),{})),t.forEach(u=>{const{field:f}=u;a[f]=!0;let d=s.lookup[f];d==null?(d=X({},RSe(u.type),{field:f,hasBeenResized:!1}),s.orderedFields.push(f)):i&&s.orderedFields.push(f),d&&d.type!==u.type&&(d=X({},RSe(u.type),{field:f}));let h=d.hasBeenResized;JVe.forEach(p=>{u[p]!==void 0&&(h=!0,u[p]===-1&&(u[p]=1/0))}),s.lookup[f]=nw(d,X({},u,{hasBeenResized:h}))}),i&&!o&&Object.keys(s.lookup).forEach(u=>{a[u]||delete s.lookup[u]});const l=e.current.unstable_applyPipeProcessors("hydrateColumns",s),c=Dzt(l,n);return one(c,e.current.getRootDimensions?.()??void 0)};function Lzt({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:r,visibleRows:i}){let o=e,s=!1;for(;!s;){s=!0;for(let a=n;ae.rowsMeta,yj=1,e8e=1.5,Fzt=e=>{const{scrollDirection:t,classes:n}=e,r={root:["scrollArea",`scrollArea--${t}`]};return Xe(r,hr,n)},$zt=Qn("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${ve["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${ve["scrollArea--right"]}`]:t["scrollArea--right"]},{[`&.${ve["scrollArea--up"]}`]:t["scrollArea--up"]},{[`&.${ve["scrollArea--down"]}`]:t["scrollArea--down"]},t.scrollArea]})(()=>({position:"absolute",zIndex:101,[`&.${ve["scrollArea--left"]}`]:{top:0,left:0,width:20,bottom:0},[`&.${ve["scrollArea--right"]}`]:{top:0,right:0,width:20,bottom:0},[`&.${ve["scrollArea--up"]}`]:{top:0,left:0,right:0,height:20},[`&.${ve["scrollArea--down"]}`]:{bottom:0,left:0,right:0,height:20}})),Nzt=PD(Is,(e,t)=>t==="left"?e.leftPinnedWidth:t==="right"?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function zzt(e){const t=Kn(),[n,r]=M.useState("none");return Ft(t,"columnHeaderDragStart",()=>r("horizontal")),Ft(t,"columnHeaderDragEnd",()=>r("none")),Ft(t,"rowDragStart",()=>r("vertical")),Ft(t,"rowDragEnd",()=>r("none")),n==="none"?null:n==="horizontal"?O.jsx(jzt,X({},e)):O.jsx(Bzt,X({},e))}function jzt(e){const{scrollDirection:t,scrollPosition:n}=e,r=M.useRef(null),i=Kn(),o=jl(),s=ut(i,LT),a=ut(i,MU),l=ZA(i,Nzt,t),c=()=>{const g=Is(i.current.state);if(t==="left")return n.current.left>0;if(t==="right"){const m=a-g.viewportInnerSize.width;return n.current.left{let m;if(g.preventDefault(),t==="left")m=g.clientX-r.current.getBoundingClientRect().right;else if(t==="right")m=Math.max(1,g.clientX-r.current.getBoundingClientRect().left);else throw new Error("MUI X: Wrong drag direction");m=(m-yj)*e8e+yj,o.start(0,()=>{i.current.scroll({left:n.current.left+m,top:n.current.top})})});return O.jsx(t8e,X({},e,{ref:r,getCanScrollMore:c,style:h,handleDragOver:p}))}function Bzt(e){const{scrollDirection:t,scrollPosition:n}=e,r=M.useRef(null),i=Kn(),o=jl(),s=ut(i,UT),a=()=>{const d=Is(i.current.state);if(t==="up")return n.current.top>0;if(t==="down"){const p=(s.currentPageTotalHeight||0)-d.viewportInnerSize.height-d.scrollbarSize;return n.current.top{let h;if(d.preventDefault(),t==="up")h=d.clientY-r.current.getBoundingClientRect().bottom;else if(t==="down")h=Math.max(1,d.clientY-r.current.getBoundingClientRect().top);else throw new Error("MUI X: Wrong drag direction");h=(h-yj)*e8e+yj,o.start(0,()=>{i.current.scroll({left:n.current.left,top:n.current.top+h})})});return O.jsx(t8e,X({},e,{ref:r,getCanScrollMore:a,style:u,handleDragOver:f}))}const t8e=Er(function(t,n){const{scrollDirection:r,getCanScrollMore:i,style:o,handleDragOver:s}=t,a=Kn(),[l,c]=M.useState(i),u=tn(),f=X({},u,{scrollDirection:r}),d=Fzt(f);return Ft(a,"scrollPositionChange",()=>{c(i)}),l?O.jsx($zt,{ref:n,className:d.root,ownerState:f,onDragOver:s,style:o}):null}),Z$=Pv(zzt);var $k={},e7={exports:{}},t7={exports:{}},ISe;function Uzt(){return ISe||(ISe=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(t7)),t7.exports}var DSe;function Vzt(){return DSe||(DSe=1,(function(e){var t=Uzt().default;function n(r,i){if(typeof WeakMap=="function")var o=new WeakMap,s=new WeakMap;return(e.exports=n=function(l,c){if(!c&&l&&l.__esModule)return l;var u,f,d={__proto__:null,default:l};if(l===null||t(l)!="object"&&typeof l!="function")return d;if(u=c?s:o){if(u.has(l))return u.get(l);u.set(l,d)}for(var h in l)h!=="default"&&{}.hasOwnProperty.call(l,h)&&((f=(u=Object.defineProperty)&&Object.getOwnPropertyDescriptor(l,h))&&(f.get||f.set)?u(d,h,f):d[h]=l[h]);return d},e.exports.__esModule=!0,e.exports.default=e.exports)(r,i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(e7)),e7.exports}var LSe;function Wzt(){if(LSe)return $k;LSe=1;var e=Vzt().default;Object.defineProperty($k,"__esModule",{value:!0}),$k.default=void 0;var t=e(hg());return $k.default=parseInt(t.version,10),$k}var Hzt=Wzt();const Gzt=Vn(Hzt),n8e=M.createContext(void 0);function ud(){const e=M.useContext(n8e);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` -`));return e}const I0=(e,t)=>RD(e),Wce=(e,t)=>ut(e,RD),qzt=typeof navigator<"u"?navigator.userAgent.toLowerCase():"empty",Xzt=qzt.includes("firefox"),zU=e=>e.virtualization;xn(zU,e=>e.enabled);const r8e=xn(zU,e=>e.enabledForColumns),Yzt=xn(zU,e=>e.enabledForRows),LD=xn(zU,e=>e.renderContext),Qzt=zr(e=>e.virtualization.renderContext.firstColumnIndex,e=>e.virtualization.renderContext.lastColumnIndex,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t})),sne={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},Kzt=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return X({},e,{virtualization:{enabled:!n,enabledForColumns:!n,enabledForRows:!n&&!r,renderContext:sne}})};function Zzt(e,t){const n=o=>{e.current.setState(s=>X({},s,{virtualization:X({},s.virtualization,{enabled:o,enabledForColumns:o,enabledForRows:o&&!t.autoHeight})}))};qn(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:o=>{e.current.setState(s=>X({},s,{virtualization:X({},s.virtualization,{enabledForColumns:o})}))}},"public"),M.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization,t.autoHeight])}const Hce=e=>e.rowSpanning,i8e=xn(Hce,e=>e.hiddenCells),Jzt=xn(Hce,e=>e.spannedCells),e5t=xn(Hce,e=>e.hiddenCellOriginMap),tE=e=>e.listViewColumn,t5t=iVe(vc,LD,RD,Mo,Cf,(e,t,n,r,i)=>{if(!e)return!1;const o=i[e.id];if(!o)return!1;const s=n.rowToIndexMap.get(o),a=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(c=>c.field===e.field);return!(s!==void 0&&a!==-1&&s>=t.firstRowIndex&&s<=t.lastRowIndex)}),o8e=zr(t5t,Mo,RD,Cf,vc,(e,t,n,r,i)=>{if(!e)return null;const o=r[i.id];if(!o)return null;const s=n.rowToIndexMap.get(o);if(s===void 0)return null;const a=t.findIndex(l=>l.field===i.field);return a===-1?null:X({},i,{rowIndex:s,columnIndex:a})});function jC(e,t){return Math.round(e*10**t)/10**t}const bj=typeof window<"u"&&/jsdom|HappyDOM/.test(window.navigator.userAgent),n7=50;var Yo=(function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e})(Yo||{});const FSe={top:0,left:0},n5t=Object.freeze(new Map),r5t=(e,t,n,r,i)=>({direction:Yo.NONE,buffer:a8e(e,Yo.NONE,t,n,r,i)}),i5t=()=>{const e=ud(),t=tn(),{unstable_listView:n}=t,r=ut(e,()=>n?[tE(e.current.state)]:Mo(e)),i=ut(e,Yzt)&&!bj,o=ut(e,r8e)&&!bj,s=ut(e,FT),a=NT(e),l=n?gj:a,c=s.bottom.length>0,[u,f]=M.useState(n5t),d=bi(),h=ut(e,R0),p=Wce(e),g=e.current.mainElementRef,m=e.current.virtualScrollerRef,v=e.current.virtualScrollbarVerticalRef,y=e.current.virtualScrollbarHorizontalRef,b=ut(e,VNt),w=M.useRef(!1),S=ut(e,Ace),_=ut(e,nNt),E=ut(e,MU),T=ut(e,o5t),k=ut(e,fVe),P=ut(e,uVe),R=M.useRef(null),I=M.useCallback(se=>{if(g.current=se,!se)return;const ue=se.getBoundingClientRect();let G={width:jC(ue.width,1),height:jC(ue.height,1)};if((!R.current||G.width!==R.current.width&&G.height!==R.current.height)&&(R.current=G,e.current.publishEvent("resize",G)),typeof ResizeObserver>"u")return;const ce=new ResizeObserver(he=>{const J=he[0];if(!J)return;const te={width:jC(J.contentRect.width,1),height:jC(J.contentRect.height,1)};te.width===G.width&&te.height===G.height||(e.current.publishEvent("resize",te),G=te)});if(ce.observe(se),Gzt>=19)return()=>{g.current=null,ce.disconnect()}},[e,g]),F=M.useRef(t.initialState?.scroll??FSe),A=M.useRef(!1),L=M.useRef(FSe),$=M.useRef(sne),j=ut(e,LD),V=ut(e,o8e),U=jl(),z=M.useRef(void 0),N=ad(()=>r5t(d,t.rowBufferPx,t.columnBufferPx,S*15,n7*6)).current,B=M.useCallback(se=>{if(jSe(se,e.current.state.virtualization.renderContext))return;const ue=se.firstRowIndex!==$.current.firstRowIndex||se.lastRowIndex!==$.current.lastRowIndex;e.current.setState(ce=>X({},ce,{virtualization:X({},ce.virtualization,{renderContext:se})})),Is(e.current.state).isReady&&ue&&($.current=se,e.current.publishEvent("renderedRowsIntervalChange",se)),L.current=F.current},[e]),H=ft(()=>{const se=m.current;if(!se)return;const ue=Is(e.current.state),G=Math.ceil(ue.minimumSize.height-ue.viewportOuterSize.height),ce=Math.ceil(ue.minimumSize.width-ue.viewportInnerSize.width),he={top:Mu(se.scrollTop,0,G),left:d?Mu(se.scrollLeft,-ce,0):Mu(se.scrollLeft,0,ce)},J=he.left-F.current.left,te=he.top-F.current.top,ae=J!==0||te!==0;F.current=he;const we=ae?l5t(J,te):Yo.NONE,Pe=Math.abs(F.current.top-L.current.top),ee=Math.abs(F.current.left-L.current.left),oe=Pe>=S||ee>=n7,Se=N.direction!==we;if(!(oe||Se))return j;if(Se)switch(we){case Yo.NONE:case Yo.LEFT:case Yo.RIGHT:z.current=void 0;break;default:z.current=j;break}N.direction=we,N.buffer=a8e(d,we,t.rowBufferPx,t.columnBufferPx,S*15,n7*6);const be=$Se(e,t,i,o),ge=NSe(be,F.current,N);return jSe(ge,j)||(F6.flushSync(()=>{B(ge)}),U.start(1e3,H)),ge}),Q=()=>{if(!Is(e.current.state).isReady&&(i||o))return;const se=$Se(e,t,i,o),ue=NSe(se,F.current,N);z.current=void 0,B(ue)},Y=ft(()=>{if(A.current){A.current=!1;return}const se=H();e.current.publishEvent("scrollPositionChange",{top:F.current.top,left:F.current.left,renderContext:se})}),Z=ft(se=>{e.current.publishEvent("virtualScrollerWheel",{},se)}),pe=ft(se=>{e.current.publishEvent("virtualScrollerTouchMove",{},se)}),ie=(se={})=>{if(!se.rows&&!p.range)return[];const ue=ds(e);let G=j;se.renderContext&&(G=se.renderContext,G.firstColumnIndex=j.firstColumnIndex,G.lastColumnIndex=j.lastColumnIndex);const ce=!c&&se.position===void 0||c&&se.position==="bottom",he=se.position!==void 0;let J;switch(se.position){case"top":J=0;break;case"bottom":J=s.top.length+p.rows.length;break;case void 0:J=s.top.length;break}const te=se.rows??p.rows,ae=G.firstRowIndex,we=Math.min(G.lastRowIndex,te.length),Pe=se.rows?xSe(0,se.rows.length):xSe(ae,we);let ee=-1;!he&&V&&(V.rowIndexwe&&(Pe.push(V.rowIndex),ee=V.rowIndex));const oe=[],Se=t.slotProps?.row,ye=Pb(e);return Pe.forEach(be=>{const{id:ge,model:xe}=te[be];if(!ue[ge])return;const re=(p?.range?.firstRowIndex||0)+J+be;if(b){const on=l.left.length,Dn=r.length-l.right.length;e.current.calculateColSpan({rowId:ge,minFirstColumn:on,maxLastColumn:Dn,columns:r}),l.left.length>0&&e.current.calculateColSpan({rowId:ge,minFirstColumn:0,maxLastColumn:l.left.length,columns:r}),l.right.length>0&&e.current.calculateColSpan({rowId:ge,minFirstColumn:r.length-l.right.length,maxLastColumn:r.length,columns:r})}const Ee=e.current.rowHasAutoHeight(ge)?"auto":e.current.unstable_getRowHeight(ge);let ke;h[ge]==null?ke=!1:ke=e.current.isRowSelectable(ge);let je=!1;se.position===void 0&&(je=be===0);let De=!1;const ze=be===te.length-1;if(ce)if(he)De=ze;else{const on=p.rows.length-1;be===on&&(De=!0)}let Je=G;z.current&&be>=z.current.firstRowIndex&&be({overflowX:!T||n?"hidden":void 0,overflowY:t.autoHeight?"hidden":void 0}),[T,t.autoHeight,n]),fe=M.useMemo(()=>{const se={width:T?E:"auto",flexBasis:_,flexShrink:0};return se.flexBasis===0&&(se.flexBasis=kVe),se},[E,_,T]),me=M.useCallback(se=>{se&&e.current.publishEvent("virtualScrollerContentSizeChange",{columnsTotalWidth:E,contentHeight:_})},[e,E,_]);return ar(()=>{w.current&&e.current.updateRenderContext?.()},[e,o,i]),ar(()=>{n&&(m.current.scrollLeft=0)},[n,m]),U3t(j!==sne,()=>{if(e.current.publishEvent("scrollPositionChange",{top:F.current.top,left:F.current.left,renderContext:j}),w.current=!0,t.initialState?.scroll&&m.current){const se=m.current,{top:ue,left:G}=t.initialState.scroll,ce={top:!(ue>0),left:!(G>0)};if(!ce.left&&E&&(se.scrollLeft=G,A.current=!0,ce.left=!0),!ce.top&&_&&(se.scrollTop=ue,A.current=!0,ce.top=!0),!ce.top||!ce.left){const he=e.current.subscribeEvent("virtualScrollerContentSizeChange",J=>{!ce.left&&J.columnsTotalWidth&&(se.scrollLeft=G,A.current=!0,ce.left=!0),!ce.top&&J.contentHeight&&(se.scrollTop=ue,A.current=!0,ce.top=!0),ce.left&&ce.top&&he()});return he}}}),e.current.register("private",{updateRenderContext:Q}),ii(e,"sortedRowsSet",Q),ii(e,"paginationModelChange",Q),ii(e,"columnsChange",Q),{renderContext:j,setPanels:f,getRows:ie,getContainerProps:()=>({ref:I}),getScrollerProps:()=>({ref:m,onScroll:Y,onWheel:Z,onTouchMove:pe,style:ne,role:"presentation",tabIndex:Xzt?-1:void 0}),getContentProps:()=>({style:fe,role:"presentation",ref:me}),getRenderZoneProps:()=>({role:"rowgroup"}),getScrollbarVerticalProps:()=>({ref:v,scrollPosition:F}),getScrollbarHorizontalProps:()=>({ref:y,scrollPosition:F}),getScrollAreaProps:()=>({scrollPosition:F})}};function o5t(e){return e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width}function $Se(e,t,n,r){const i=Is(e.current.state),o=I0(e),s=t.unstable_listView?[tE(e.current.state)]:Mo(e),a=e5t(e),l=e.current.state.rows.dataRowIds.at(-1),c=s.at(-1);return{enabledForRows:n,enabledForColumns:r,apiRef:e,autoHeight:t.autoHeight,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx,leftPinnedWidth:i.leftPinnedWidth,columnsTotalWidth:i.columnsTotalWidth,viewportInnerWidth:i.viewportInnerSize.width,viewportInnerHeight:i.viewportInnerSize.height,lastRowHeight:l!==void 0?e.current.unstable_getRowHeight(l):0,lastColumnWidth:c?.computedWidth??0,rowsMeta:UT(e.current.state),columnPositions:Pb(e),rows:o.rows,range:o.range,pinnedColumns:NT(e),visibleColumns:s,hiddenCellsOriginMap:a,listView:t.unstable_listView??!1,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function NSe(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.visibleColumns.length},{top:i,left:o}=t,s=Math.abs(o)+e.leftPinnedWidth;if(e.enabledForRows){let l=Math.min(zSe(e,i,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const c=e.hiddenCellsOriginMap[l];if(c){const f=Math.min(...Object.values(c));l=Math.min(l,f)}const u=e.autoHeight?l+e.rows.length:zSe(e,i+e.viewportInnerHeight);r.firstRowIndex=l,r.lastRowIndex=u}if(e.listView)return X({},r,{lastColumnIndex:1});if(e.enabledForColumns){let l=0,c=e.columnPositions.length,u=!1;const[f,d]=ane({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let h=f;h=e.range.lastRowIndex);const o=Mu(r-(e.range?.firstRowIndex||0),0,e.rowsMeta.positions.length);return i||e.rowsMeta.positions[o]>=t?Q0(t,e.rowsMeta.positions,n):a5t(t,e.rowsMeta.positions,o,n)}function s5t(e,t,n){const[r,i]=ane({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[o,s]=ane({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns.left.length,maxLastIndex:e.visibleColumns.length-e.pinnedColumns.right.length,bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),a=Lzt({firstColumnToRender:o,apiRef:e.apiRef,firstRowToRender:r,lastRowToRender:i,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:i,firstColumnIndex:a,lastColumnIndex:s}}function Q0(e,t,n=void 0,r=0,i=t.length){if(t.length<=0)return-1;if(r>=i)return r;const o=r+Math.floor((i-r)/2),s=t[o];let a;if(n?.atStart){const l=(o===t.length-1?n.lastPosition:t[o+1])-s;a=e-l=Math.abs(e)?t>0?Yo.DOWN:Yo.UP:e>0?Yo.RIGHT:Yo.LEFT}function a8e(e,t,n,r,i,o){if(e)switch(t){case Yo.LEFT:t=Yo.RIGHT;break;case Yo.RIGHT:t=Yo.LEFT;break}switch(t){case Yo.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case Yo.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:o};case Yo.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:o,columnBefore:0};case Yo.UP:return{rowAfter:0,rowBefore:i,columnAfter:0,columnBefore:0};case Yo.DOWN:return{rowAfter:i,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}const c5t=()=>{const e=Kn(),t=tn(),n=ut(e,kD),r=ut(e,Nce),i=ut(e,dVe),o=n===0&&i===0,s=ut(e,_Nt),a=!s&&o,l=!s&&n>0&&r===0;let c=null,u=null;return a&&(c="noRowsOverlay"),l&&(c="noResultsOverlay"),s&&(c="loadingOverlay",u=t.slotProps?.loadingOverlay?.[o?"noRowsVariant":"variant"]||null),{overlayType:c,loadingOverlayVariant:u}},u5t=Qn("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e,loadingOverlayVariant:t})=>t!=="skeleton"?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,width:0,height:0,zIndex:e==="loadingOverlay"?5:4}:{}),f5t=Qn("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),d5t=e=>{const{classes:t}=e;return Xe({root:["overlayWrapper"],inner:["overlayWrapperInner"]},hr,t)};function h5t(e){const t=Kn(),n=tn(),r=ut(t,Is);let i=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);i===0&&(i=kVe);const o=d5t(X({},e,{classes:n.classes}));return O.jsx(u5t,X({className:Re(o.root)},e,{children:O.jsx(f5t,X({className:Re(o.inner),style:{height:i,width:r.viewportOuterSize.width}},e))}))}function p5t(e){const{overlayType:t}=e,n=tn();if(!t)return null;const r=n.slots?.[t],i=n.slotProps?.[t];return O.jsx(h5t,X({},e,{children:O.jsx(r,X({},i))}))}const Fz=e=>e.columnMenu;function g5t(){const e=ud(),t=tn(),n=ut(e,Mo),r=ut(e,k3t),i=ut(e,O3t),o=ut(e,zVe),s=ut(e,()=>Bce(e)===null),a=ut(e,j3t),l=ut(e,z3t),c=ut(e,mj),u=ut(e,DD),f=ut(e,Fz),d=ut(e,Of),h=ut(e,Rzt),p=!(a===null&&o===null&&s),g=e.current.columnHeadersContainerRef;return O.jsx(t.slots.columnHeaders,X({ref:g,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:i,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:d,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:p},t.slotProps?.columnHeaders))}const m5t=Pv(g5t),l8e=M.createContext(void 0),Gce=()=>{const e=M.useContext(l8e);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` -`));return e},v5t=Qn("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),y5t=Qn("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],n.loadingOverlayVariant==="skeleton"&&t["main--hasSkeletonLoadingOverlay"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),b5t=Er((e,t)=>{const{ownerState:n}=e,r=tn(),o=Gce().hooks.useGridAriaAttributes();return O.jsxs(y5t,X({ownerState:n,className:e.className,tabIndex:-1},o,r.slotProps?.main,{ref:t,children:[O.jsx(v5t,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),x5t=()=>Xe({root:["topContainer"]},hr,{}),w5t=Qn("div")({position:"sticky",zIndex:40,top:0});function S5t(e){const t=x5t();return O.jsx(w5t,X({},e,{className:Re(t.root,ve["container--top"]),role:"presentation"}))}const _5t=()=>Xe({root:["bottomContainer"]},hr,{}),C5t=Qn("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function O5t(e){const t=_5t();return O.jsx(C5t,X({},e,{className:Re(t.root,ve["container--bottom"]),role:"presentation"}))}const E5t=(e,t)=>{const{classes:n}=e;return Xe({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},hr,n)},T5t=Qn("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),P5t=Er(function(t,n){const r=tn(),i=!r.autoHeight&&t.style?.minHeight==="auto",o=E5t(r,i),s={classes:r.classes,overflowedContent:i};return O.jsx(T5t,X({},t,{ownerState:s,className:Re(o.root,t.className),ref:n}))}),k5t=Qn("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),c8e=Qn("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:"var(--DataGrid-pinnedBackground)"}),M5t=Qn(c8e)({left:0,borderRight:"1px solid var(--rowBorderColor)"}),A5t=Qn(c8e)({right:0,borderLeft:"1px solid var(--rowBorderColor)"}),R5t=Qn("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});function I5t({rowsLength:e}){const t=Kn(),{viewportOuterSize:n,minimumSize:r,hasScrollX:i,hasScrollY:o,scrollbarSize:s,leftPinnedWidth:a,rightPinnedWidth:l}=ut(t,Is),c=i?s:0,u=n.height-r.height>0;return c===0&&!u?null:O.jsxs(k5t,{className:ve.filler,role:"presentation",style:{height:c,"--rowBorderColor":e===0?"transparent":"var(--DataGrid-rowBorderColor)"},children:[a>0&&O.jsx(M5t,{className:ve["filler--pinnedLeft"],style:{width:a}}),O.jsx(R5t,{}),l>0&&O.jsx(A5t,{className:ve["filler--pinnedRight"],style:{width:l+(o?s:0)}})]})}const D5t=Pv(I5t),L5t=["className"],F5t=e=>{const{classes:t}=e;return Xe({root:["virtualScrollerRenderZone"]},hr,t)},$5t=Qn("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),N5t=Er(function(t,n){const{className:r}=t,i=it(t,L5t),o=Kn(),s=tn(),a=F5t(s),l=ut(o,()=>{const c=LD(o);return UT(o.current.state).positions[c.firstRowIndex]??0});return O.jsx($5t,X({className:Re(a.root,r),ownerState:s,style:{transform:`translate3d(0, ${l}px, 0)`}},i,{ref:n}))}),z5t={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},Ts=e=>e.editRows,u8e=PD(Ts,(e,{rowId:t,editMode:n})=>n===eg.Row&&!!e[t]),j5t=PD(Ts,(e,{rowId:t,field:n})=>e[t]?.[n]??null),tR=e=>e.preferencePanel,B5t=PD(tR,(e,t)=>!!(e.open&&e.labelId===t));var dw=(function(e){return e.filters="filters",e.columns="columns",e})(dw||{});const U5t=(e,t)=>{const{classes:n}=e,r={root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]};return Xe(r,hr,n)},f8e=Qn("div")({position:"absolute",display:"inline-block",zIndex:60,"&:hover":{zIndex:70},"--size":"calc(max(var(--DataGrid-scrollbarSize), 14px))"}),V5t=Qn(f8e)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-topContainerHeight) - var(--DataGrid-bottomContainerHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-topContainerHeight)",right:"0px"}),W5t=Qn(f8e)({width:"100%",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:"0px"}),BSe=Er(function(t,n){const r=ud(),i=tn(),o=M.useRef(!1),s=M.useRef(0),a=M.useRef(null),l=M.useRef(null),c=U5t(i,t.position),u=ut(r,Is),f=t.position==="vertical"?"height":"width",d=t.position==="vertical"?"scrollTop":"scrollLeft",h=t.position==="vertical"?"top":"left",p=t.position==="vertical"?u.hasScrollX:u.hasScrollY,g=u.minimumSize[f]+(p?u.scrollbarSize:0),v=(t.position==="vertical"?u.viewportInnerSize.height:u.viewportOuterSize.width)*(g/u.viewportOuterSize[f]),y=ft(()=>{const S=a.current,_=t.scrollPosition.current;if(!S||_[h]===s.current)return;if(s.current=_[h],o.current){o.current=!1;return}o.current=!0;const E=_[h]/g;S[d]=E*v}),b=ft(()=>{const S=r.current.virtualScrollerRef.current,_=a.current;if(!_)return;if(o.current){o.current=!1;return}o.current=!0;const E=_[d]/v;S[d]=E*g});Uae(()=>{const S=r.current.virtualScrollerRef.current,_=a.current,E={passive:!0};return S.addEventListener("scroll",y,E),_.addEventListener("scroll",b,E),()=>{S.removeEventListener("scroll",y,E),_.removeEventListener("scroll",b,E)}}),M.useEffect(()=>{l.current.style.setProperty(f,`${v}px`)},[v,f]);const w=t.position==="vertical"?V5t:W5t;return O.jsx(w,{ref:zn(n,a),className:c.root,style:t.position==="vertical"&&i.unstable_listView?{height:"100%",top:0}:void 0,tabIndex:-1,"aria-hidden":"true",onFocus:S=>{S.target.blur()},children:O.jsx("div",{ref:l,className:c.content})})}),H5t=e=>{const{classes:t,hasScrollX:n,hasPinnedRight:r,loadingOverlayVariant:i}=e;return Xe({root:["main",r&&"main--hasPinnedRight",i==="skeleton"&&"main--hasSkeletonLoadingOverlay"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},hr,t)},G5t=Qn("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),q5t=e=>e.dimensions.rightPinnedWidth>0;function X5t(e){const t=Kn(),n=tn(),r=ut(t,iNt),i=ut(t,rNt),o=ut(t,q5t),s=ut(t,aNt),a=c5t(),l={classes:n.classes,hasScrollX:i,hasPinnedRight:o,loadingOverlayVariant:a.loadingOverlayVariant},c=H5t(l),u=i5t(),{getContainerProps:f,getScrollerProps:d,getContentProps:h,getRenderZoneProps:p,getScrollbarVerticalProps:g,getScrollbarHorizontalProps:m,getRows:v,getScrollAreaProps:y}=u,b=v();return O.jsxs(b5t,X({className:c.root},f(),{ownerState:l,children:[O.jsx(Z$,X({scrollDirection:"left"},y())),O.jsx(Z$,X({scrollDirection:"right"},y())),O.jsx(Z$,X({scrollDirection:"up"},y())),O.jsx(Z$,X({scrollDirection:"down"},y())),O.jsxs(G5t,X({className:c.scroller},d(),{ownerState:l,children:[O.jsxs(S5t,{children:[!n.unstable_listView&&O.jsx(m5t,{}),O.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:u})]}),O.jsx(p5t,X({},a)),O.jsx(P5t,X({},h(),{children:O.jsxs(N5t,X({},p(),{children:[b,O.jsx(n.slots.detailPanels,{virtualScroller:u})]}))})),s&&O.jsx(D5t,{rowsLength:b.length}),O.jsx(O5t,{children:O.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:u})})]})),i&&!n.unstable_listView&&O.jsx(BSe,X({position:"horizontal"},m())),r&&O.jsx(BSe,X({position:"vertical"},g())),e.children]}))}function Y5t(){const e=tn();return e.hideFooter?null:O.jsx(e.slots.footer,X({},e.slotProps?.footer))}let r7;function qce(){return r7===void 0&&document.createElement("div").focus({get preventScroll(){return r7=!0,!1}}),r7}function Q5t({defaultSlots:e,slots:t}){const n=t;if(!n||Object.keys(n).length===0)return e;const r=X({},e);return Object.keys(n).forEach(i=>{const o=i;n[o]!==void 0&&(r[o]=n[o])}),r}function K5t(e){if(e.slotProps?.root)return e;const t=Object.keys(e);if(!t.some(i=>i.startsWith("aria-")||i.startsWith("data-")))return e;const n={},r=e.forwardedProps??{};for(let i=0;iK5t(e),[e])}const J5t=e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null},ejt=e=>e===AVe||J5t(e)!==null,d8e=(e,t)=>{if(e)if(t){if(e===or.LEFT)return"right";if(e===or.RIGHT)return"left"}else{if(e===or.LEFT)return"left";if(e===or.RIGHT)return"right"}};function jU(e,t,n,r){const i=d8e(n,t);return!i||r===void 0||(e[i]=r),e}const tjt=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],njt=["changeReason","unstable_updateValueOnRender"];or.LEFT+"",qy.LEFT,or.RIGHT+"",qy.RIGHT,or.NONE+"",or.VIRTUAL+"";const rjt=e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:i,isEditable:o,isSelected:s,isSelectionMode:a,classes:l}=e,c={root:["cell",`cell--text${Ve(t)}`,s&&"selected",o&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",i===or.LEFT&&"cell--pinnedLeft",i===or.RIGHT&&"cell--pinnedRight",a&&!o&&"cell--selectionMode"]};return Xe(c,hr,l)},ijt=Er(function(t,n){const{column:r,row:i,rowId:o,rowNode:s,align:a,colIndex:l,width:c,className:u,style:f,colSpan:d,disableDragEvents:h,isNotVisible:p,pinnedOffset:g,pinnedPosition:m,showRightBorder:v,showLeftBorder:y,onClick:b,onDoubleClick:w,onMouseDown:S,onMouseUp:_,onMouseOver:E,onKeyDown:T,onKeyUp:k,onDragEnter:P,onDragOver:R}=t,I=it(t,tjt),F=ud(),A=tn(),L=bi(),$=r.field,j=ZA(F,j5t,{rowId:o,field:$}),U=Gce().hooks.useCellAggregationResult(o,$),z=j?ni.Edit:ni.View,N=F.current.getCellParamsForRow(o,$,i,{colDef:r,cellMode:z,rowNode:s,tabIndex:ut(F,()=>{const ke=Bce(F);return ke&&ke.field===$&&ke.id===o?0:-1}),hasFocus:ut(F,()=>{const ke=vc(F);return ke?.id===o&&ke.field===$})});N.api=F.current,U&&(N.value=U.value,N.formattedValue=r.valueFormatter?r.valueFormatter(N.value,i,r,F):N.value);const B=ut(F,()=>F.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:o,field:$})),H=ut(F,i8e),Q=ut(F,Jzt),{hasFocus:Y,isEditable:Z=!1,value:pe}=N,ie=r.type==="actions"&&r.getActions?.(F.current.getRowParams(o)).some(ke=>!ke.props.disabled),ne=(z==="view"||!Z)&&!ie?N.tabIndex:-1,{classes:fe,getCellClassName:me}=A,ue=[ut(F,()=>F.current.unstable_applyPipeProcessors("cellClassName",[],{id:o,field:$}).filter(Boolean).join(" "))];r.cellClassName&&ue.push(typeof r.cellClassName=="function"?r.cellClassName(N):r.cellClassName),r.display==="flex"&&ue.push(ve["cell--flex"]),me&&ue.push(me(N));const G=N.formattedValue??pe,ce=M.useRef(null),he=zn(n,ce),J=M.useRef(null),te=A.cellSelection??!1,ae={align:a,showLeftBorder:y,showRightBorder:v,isEditable:Z,classes:A.classes,pinnedPosition:m,isSelected:B,isSelectionMode:te},we=rjt(ae),Pe=M.useCallback(ke=>je=>{const De=F.current.getCellParams(o,$||"");F.current.publishEvent(ke,De,je),_&&_(je)},[F,$,_,o]),ee=M.useCallback(ke=>je=>{const De=F.current.getCellParams(o,$||"");F.current.publishEvent(ke,De,je),S&&S(je)},[F,$,S,o]),oe=M.useCallback((ke,je)=>De=>{if(!F.current.getRow(o))return;const ze=F.current.getCellParams(o,$||"");F.current.publishEvent(ke,ze,De),je&&je(De)},[F,$,o]),Se=H[o]?.[$]??!1,ye=Q[o]?.[$]??1,be=M.useMemo(()=>{if(p)return{padding:0,opacity:0,width:0,height:0,border:0};const ke=jU(X({"--width":`${c}px`},f),L,m,g),je=m===or.LEFT,De=m===or.RIGHT;return ye>1&&(ke.height=`calc(var(--height) * ${ye})`,ke.zIndex=10,(je||De)&&(ke.zIndex=40)),ke},[c,p,f,g,m,L,ye]);if(M.useEffect(()=>{if(!Y||z===ni.Edit)return;const ke=ci(F.current.rootElementRef.current);if(ce.current&&!ce.current.contains(ke.activeElement)){const je=ce.current.querySelector('[tabindex="0"]'),De=J.current||je||ce.current;if(qce())De.focus({preventScroll:!0});else{const ze=F.current.getScrollPosition();De.focus(),F.current.scroll(ze)}}},[Y,z,F]),Se)return O.jsx("div",{"data-colindex":l,role:"presentation",style:X({width:"var(--width)"},be)});let ge=I.onFocus,xe,re;if(j===null&&r.renderCell&&(xe=r.renderCell(N)),j!==null&&r.renderEditCell){const ke=F.current.getRowWithUpdatedValues(o,r.field),je=it(j,njt),De=r.valueFormatter?r.valueFormatter(j.value,ke,r,F):N.formattedValue,ze=X({},N,{row:ke,formattedValue:De},je);xe=r.renderEditCell(ze),ue.push(ve["cell--editing"]),ue.push(fe?.["cell--editing"])}if(xe===void 0){const ke=G?.toString();xe=ke,re=ke}M.isValidElement(xe)&&ie&&(xe=M.cloneElement(xe,{focusElementRef:J}));const Ee=h?null:{onDragEnter:oe("cellDragEnter",P),onDragOver:oe("cellDragOver",R)};return O.jsx("div",X({className:Re(we.root,ue,u),role:"gridcell","data-field":$,"data-colindex":l,"aria-colindex":l+1,"aria-colspan":d,"aria-rowspan":ye,style:be,title:re,tabIndex:ne,onClick:oe("cellClick",b),onDoubleClick:oe("cellDoubleClick",w),onMouseOver:oe("cellMouseOver",E),onMouseDown:ee("cellMouseDown"),onMouseUp:Pe("cellMouseUp"),onKeyDown:oe("cellKeyDown",T),onKeyUp:oe("cellKeyUp",k)},Ee,I,{onFocus:ge,ref:he,children:xe}))}),ojt=Pv(ijt),sjt=["field","type","align","width","height","empty","style","className"],USe="1.3em",ajt="1.2em",VSe=[40,80],ljt={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},cjt=e=>{const{align:t,classes:n,empty:r}=e,i={root:["cell","cellSkeleton",`cell--text${t?Ve(t):"Left"}`,r&&"cellEmpty"]};return Xe(i,hr,n)},ujt=zNt(12345);function fjt(e){const{field:t,type:n,align:r,width:i,height:o,empty:s=!1,style:a,className:l}=e,c=it(e,sjt),f={classes:tn().classes,align:r,empty:s},d=cjt(f),h=M.useMemo(()=>{if(n==="boolean"||n==="actions")return{variant:"circular",width:USe,height:USe};const[g,m]=n?ljt[n]??VSe:VSe;return{variant:"text",width:`${Math.round(ujt(g,m))}%`,height:ajt}},[n]);return O.jsx("div",X({"data-field":t,className:Re(d.root,l),style:X({height:o,maxWidth:i,minWidth:i},a)},c,{children:!s&&O.jsx(XSt,X({},h))}))}const djt=Pv(fjt);function hjt(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?hh(Bt(e.palette.divider,1),.88):dh(Bt(e.palette.divider,1),.68)}const pjt=10,J$=-5,T_=1,WSe={width:3,rx:1.5,x:10.5},gjt="/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */",mjt=e=>e.dimensions.hasScrollX&&(!e.dimensions.hasScrollY||e.dimensions.scrollbarSize===0),vjt=Oe("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${ve.autoHeight}`]:t.autoHeight},{[`&.${ve.autosizing}`]:t.autosizing},{[`&.${ve["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${ve["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${ve["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${ve["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${ve["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${ve.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${ve.actionsCell}`]:t.actionsCell},{[`& .${ve.booleanCell}`]:t.booleanCell},{[`& .${ve.cell}`]:t.cell},{[`& .${ve["cell--editable"]}`]:t["cell--editable"]},{[`& .${ve["cell--editing"]}`]:t["cell--editing"]},{[`& .${ve["cell--flex"]}`]:t["cell--flex"]},{[`& .${ve["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${ve["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${ve["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${ve["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${ve["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${ve["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${ve["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${ve["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${ve["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${ve["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${ve["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${ve["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${ve.cellCheckbox}`]:t.cellCheckbox},{[`& .${ve.cellEmpty}`]:t.cellEmpty},{[`& .${ve.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${ve.cellSkeleton}`]:t.cellSkeleton},{[`& .${ve.checkboxInput}`]:t.checkboxInput},{[`& .${ve.columnHeader}`]:t.columnHeader},{[`& .${ve["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${ve["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${ve["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${ve["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${ve["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${ve["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${ve["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${ve["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${ve["columnHeader--lastUnpinned"]}`]:t["columnHeader--lastUnpinned"]},{[`& .${ve["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${ve["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${ve["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${ve["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${ve["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${ve["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${ve["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${ve["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${ve["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${ve.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${ve.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${ve.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${ve.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${ve.columnSeparator}`]:t.columnSeparator},{[`& .${ve["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${ve["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${ve["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${ve["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${ve["container--bottom"]}`]:t["container--bottom"]},{[`& .${ve["container--top"]}`]:t["container--top"]},{[`& .${ve.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${ve["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${ve.editBooleanCell}`]:t.editBooleanCell},{[`& .${ve.filterIcon}`]:t.filterIcon},{[`& .${ve["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${ve["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${ve["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${ve.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${ve.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${ve.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${ve.headerFilterRow}`]:t.headerFilterRow},{[`& .${ve.iconSeparator}`]:t.iconSeparator},{[`& .${ve.menuIcon}`]:t.menuIcon},{[`& .${ve.menuIconButton}`]:t.menuIconButton},{[`& .${ve.menuList}`]:t.menuList},{[`& .${ve.menuOpen}`]:t.menuOpen},{[`& .${ve.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${ve.pinnedRows}`]:t.pinnedRows},{[`& .${ve["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${ve["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${ve.row}`]:t.row},{[`& .${ve["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${ve["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${ve["row--dragging"]}`]:t["row--dragging"]},{[`& .${ve["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${ve["row--editable"]}`]:t["row--editable"]},{[`& .${ve["row--editing"]}`]:t["row--editing"]},{[`& .${ve["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${ve["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${ve.rowReorderCell}`]:t.rowReorderCell},{[`& .${ve["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${ve.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${ve.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${ve.rowSkeleton}`]:t.rowSkeleton},{[`& .${ve.scrollbar}`]:t.scrollbar},{[`& .${ve["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${ve["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${ve.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${ve["scrollbarFiller--borderBottom"]}`]:t["scrollbarFiller--borderBottom"]},{[`& .${ve["scrollbarFiller--borderTop"]}`]:t["scrollbarFiller--borderTop"]},{[`& .${ve["scrollbarFiller--header"]}`]:t["scrollbarFiller--header"]},{[`& .${ve["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${ve.sortIcon}`]:t.sortIcon},{[`& .${ve.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${ve.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${ve.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${ve.withBorderColor}`]:t.withBorderColor}]})(({theme:e})=>{const t=ud(),n=ut(t,mjt),r=hjt(e),i=e.shape.borderRadius,o=e.vars?e.vars.palette.background.default:e.mixins.MuiDataGrid?.containerBackground??e.palette.background.default,s=e.mixins.MuiDataGrid?.pinnedBackground??o,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:Bt(e.palette.background.default,e.palette.action.disabledOpacity),l=(e.vars||e).palette.action.hoverOpacity,c=(e.vars||e).palette.action.hover,u=(e.vars||e).palette.action.selectedOpacity,f=e.vars?`calc(${l} + ${u})`:l+u,d=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${u})`:Bt(e.palette.primary.main,u),h=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${f})`:Bt(e.palette.primary.main,f),p=e.vars?xjt:yjt,g=T=>({[`& .${ve["cell--pinnedLeft"]}, & .${ve["cell--pinnedRight"]}`]:{backgroundColor:T,"&.Mui-selected":{backgroundColor:p(T,d,u),"&:hover":{backgroundColor:p(T,d,f)}}}}),m=p(s,c,l),v=g(m),y=p(s,d,u),b=g(y),w=p(s,h,f),S=g(w),_={backgroundColor:d,"&:hover":{backgroundColor:h,"@media (hover: none)":{backgroundColor:d}}};return X({"--unstable_DataGrid-radius":typeof i=="number"?`${i}px`:i,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":a,"--DataGrid-containerBackground":o,"--DataGrid-pinnedBackground":s,"--DataGrid-rowBorderColor":r,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:r,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",transform:"translate(0, 0)",[`.${ve.main} > *:first-child${gjt}`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${ve.autoHeight}`]:{height:"auto"},[`&.${ve.autosizing}`]:{[`& .${ve.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${ve.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${ve.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${ve.groupingCriteriaCell}`]:{width:"unset"},[`& .${ve.treeDataGroupingCell}`]:{width:"unset"}},[`& .${ve.columnHeader}, & .${ve.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${ve.columnHeader}:focus-within, & .${ve.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:Bt(e.palette.primary.main,.5)} ${T_}px`,outlineOffset:T_*-1},[`& .${ve.columnHeader}:focus, & .${ve.cell}:focus`]:{outline:`solid ${e.palette.primary.main} ${T_}px`,outlineOffset:T_*-1},[`& .${ve.columnHeader}:focus, - & .${ve["columnHeader--withLeftBorder"]}, - & .${ve["columnHeader--withRightBorder"]}, - & .${ve["columnHeader--siblingFocused"]}, - & .${ve["virtualScroller--hasScrollX"]} .${ve["columnHeader--lastUnpinned"]}, - & .${ve["virtualScroller--hasScrollX"]} .${ve["columnHeader--last"]} - `]:{[`& .${ve.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${ve["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${ve["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${ve["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${ve["root--noToolbar"]} [aria-rowindex="1"] .${ve["columnHeader--last"]}`]:{borderTopRightRadius:n?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${ve.columnHeaderCheckbox}, & .${ve.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${ve.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${ve["virtualScroller--hasScrollX"]} .${ve["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${ve["columnHeader--sorted"]} .${ve.iconButtonContainer}, & .${ve["columnHeader--filtered"]} .${ve.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${ve.columnHeader}:not(.${ve["columnHeader--sorted"]}) .${ve.sortButton}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${ve.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:e.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${ve.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${ve["columnHeader--filledGroup"]} .${ve.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${ve.sortIcon}, & .${ve.filterIcon}`]:{fontSize:"inherit"},[`& .${ve["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${ve["columnHeader--alignCenter"]} .${ve.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${ve["columnHeader--alignRight"]} .${ve.columnHeaderDraggableContainer}, & .${ve["columnHeader--alignRight"]} .${ve.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${ve["columnHeader--alignCenter"]} .${ve.menuIcon}`]:{marginLeft:"auto"},[`& .${ve["columnHeader--alignRight"]} .${ve.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${ve["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${ve["columnHeader--pinnedLeft"]}, & .${ve["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:40,background:"var(--DataGrid-pinnedBackground)"},[`& .${ve.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:30,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:pjt,color:r},[`& .${ve.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)"},"@media (hover: hover)":{[`& .${ve.columnHeader}:hover`]:{[`& .${ve.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${ve.iconButtonContainer}`]:{visibility:"visible",width:"auto"}},[`& .${ve.columnHeader}:not(.${ve["columnHeader--sorted"]}):hover .${ve.sortButton}`]:{opacity:.5}},"@media (hover: none)":{[`& .${ve.columnHeader} .${ve.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${ve.columnHeader}:focus, - & .${ve["columnHeader--siblingFocused"]}`]:{[`.${ve["columnSeparator--resizable"]}`]:{color:(e.vars||e).palette.primary.main}}},[`& .${ve["columnSeparator--sideLeft"]}`]:{left:J$},[`& .${ve["columnSeparator--sideRight"]}`]:{right:J$},[`& .${ve["columnHeader--withRightBorder"]} .${ve["columnSeparator--sideLeft"]}`]:{left:J$-.5},[`& .${ve["columnHeader--withRightBorder"]} .${ve["columnSeparator--sideRight"]}`]:{right:J$-.5},[`& .${ve["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${ve["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.primary.main},"@media (hover: none)":{[`& .${ve.iconSeparator} rect`]:WSe},"@media (hover: hover)":{"&:hover":{color:(e.vars||e).palette.primary.main,[`& .${ve.iconSeparator} rect`]:WSe}},"& svg":{pointerEvents:"none"}},[`& .${ve.iconSeparator}`]:{color:"inherit",transition:e.transitions.create(["color","width"],{duration:e.transitions.duration.shortest})},[`& .${ve.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${ve.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${ve.headerFilterRow}`]:{[`& .${ve.columnHeader}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${ve["row--borderBottom"]} .${ve.columnHeader}, - & .${ve["row--borderBottom"]} .${ve.filler}, - & .${ve["row--borderBottom"]} .${ve.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${ve["row--borderBottom"]} .${ve.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${ve.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${ve["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ve.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":_},[`& .${ve["container--top"]}, & .${ve["container--bottom"]}`]:{"[role=row]":{background:"var(--DataGrid-containerBackground)"}},[`& .${ve.cell}`]:{flex:"0 0 auto",height:"var(--height)",width:"var(--width)",lineHeight:"calc(var(--height) - 1px)",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&.Mui-selected":_},[`& .${ve["virtualScrollerContent--overflowed"]} .${ve["row--lastVisible"]} .${ve.cell}`]:{borderTopColor:"transparent"},[`& .${ve["pinnedRows--top"]} :first-of-type`]:{[`& .${ve.cell}, .${ve.scrollbarFiller}`]:{borderTop:"none"}},[`&.${ve["root--disableUserSelection"]}`]:{userSelect:"none"},[`& .${ve["row--dynamicHeight"]} > .${ve.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${ve.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${ve.cell}.${ve["cell--selectionMode"]}`]:{cursor:"default"},[`& .${ve.cell}.${ve["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`${T_}px solid ${(e.vars||e).palette.primary.main}`,outlineOffset:T_*-1}},[`& .${ve["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${ve["row--editing"]} .${ve.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${ve.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${ve.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${ve.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${ve.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${ve.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${ve["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${ve.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${ve.withBorderColor}`]:{borderColor:r},[`& .${ve["cell--withLeftBorder"]}, & .${ve["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${ve["cell--withRightBorder"]}, & .${ve["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${ve["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${ve["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${ve["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${ve["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${ve["cell--pinnedLeft"]}, & .${ve["cell--pinnedRight"]}`]:{position:"sticky",zIndex:30,background:"var(--DataGrid-pinnedBackground)","&.Mui-selected":{backgroundColor:y}},[`& .${ve.virtualScrollerContent} .${ve.row}`]:{"&:hover":v,"&.Mui-selected":b,"&.Mui-selected:hover":S},[`& .${ve.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${ve.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${ve.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${ve.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${ve["columnHeader--dragging"]}, & .${ve["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${ve["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${ve.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${ve.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${ve.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${ve.treeDataGroupingCellLoadingContainer}, .${ve.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${ve.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${ve.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`.${ve.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",[`&.${ve["scrollbarFiller--borderTop"]}`]:{borderTop:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${ve["scrollbarFiller--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${ve["scrollbarFiller--pinnedRight"]}`]:{backgroundColor:"var(--DataGrid-pinnedBackground)",position:"sticky",right:0}},[`& .${ve.filler}`]:{flex:"1 0 auto"},[`& .${ve["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${ve["main--hasSkeletonLoadingOverlay"]}`]:{[`& .${ve.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${ve["scrollbar--vertical"]}, & .${ve.pinnedRows}, & .${ve.virtualScroller} > .${ve.filler}`]:{display:"none"}}})});function yjt(e,t,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=Zp(e),s=Zp(t),a=[i(o.values[0],s.values[0]),i(o.values[1],s.values[1]),i(o.values[2],s.values[2])];return YI({type:"rgb",values:a})}const bjt=e=>`rgb(from ${e} r g b / 1)`;function xjt(e,t,n){return`color-mix(in srgb,${e}, ${bjt(t)} calc(${n} * 100%))`}const wjt=()=>()=>{},Sjt=()=>!1,_jt=()=>!0,Cjt=()=>kce.useSyncExternalStore(wjt,Sjt,_jt);function Ojt(){const e=Kn(),t=ut(e,Ff),n=tn(),r=ut(e,tR),i=e.current.unstable_applyPipeProcessors("preferencePanel",null,r.openedPanelValue??dw.filters);return O.jsx(n.slots.panel,X({as:n.slots.basePopper,open:t.length>0&&r.open,id:r.panelId,"aria-labelledby":r.labelId},n.slotProps?.panel,n.slotProps?.basePopper,{children:i}))}function Ejt(){const e=tn();return O.jsxs(M.Fragment,{children:[O.jsx(Ojt,{}),e.slots.toolbar&&O.jsx(e.slots.toolbar,X({},e.slotProps?.toolbar))]})}const Tjt=["className","children"],Pjt=(e,t)=>{const{autoHeight:n,classes:r,showCellVerticalBorder:i}=e,o={root:["root",n&&"autoHeight",`root--density${Ve(t)}`,e.slots.toolbar===null&&"root--noToolbar","withBorderColor",i&&"withVerticalBorder"]};return Xe(o,hr,r)},kjt=Er(function(t,n){const r=tn(),{className:i,children:o}=t,s=it(t,Tjt),a=ud(),l=ut(a,NC),c=a.current.rootElementRef,u=M.useCallback(g=>{g!==null&&a.current.publishEvent("rootMount",g)},[a]),f=zn(c,n,u),d=r,h=Pjt(d,l);return Cjt()?null:O.jsxs(vjt,X({className:Re(h.root,i),ownerState:d},s,{ref:f,children:[O.jsx(Ejt,{}),O.jsx(X5t,{children:o}),O.jsx(Y5t,{})]}))}),Mjt=Pv(kjt),Ajt=["className"],Rjt=e=>{const{classes:t}=e;return Xe({root:["footerContainer","withBorderColor"]},hr,t)},Ijt=Qn("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),Djt=Er(function(t,n){const{className:r}=t,i=it(t,Ajt),o=tn(),s=Rjt(o);return O.jsx(Ijt,X({className:Re(s.root,r),ownerState:o},i,{ref:n}))}),Ljt=["className"],Fjt=e=>{const{classes:t}=e;return Xe({root:["overlay"]},hr,t)},$jt=Qn("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackground)"}),Xce=Er(function(t,n){const{className:r}=t,i=it(t,Ljt),o=tn(),s=Fjt(o);return O.jsx($jt,X({className:Re(s.root,r),ownerState:o},i,{ref:n}))}),Njt=e=>{const{classes:t,open:n}=e;return Xe({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},hr,t)},zjt=M.memo(e=>{const{colDef:t,open:n,columnMenuId:r,columnMenuButtonId:i,iconButtonRef:o}=e,s=Kn(),a=tn(),l=X({},e,{classes:a.classes}),c=Njt(l),u=M.useCallback(d=>{d.preventDefault(),d.stopPropagation(),s.current.toggleColumnMenu(t.field)},[s,t.field]),f=t.headerName??t.field;return O.jsx("div",{className:c.root,children:O.jsx(a.slots.baseTooltip,X({title:s.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},a.slotProps?.baseTooltip,{children:O.jsx(a.slots.baseIconButton,X({ref:o,tabIndex:-1,className:c.button,"aria-label":s.current.getLocaleText("columnMenuAriaLabel")(f),size:"small",onClick:u,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?r:void 0,id:i},a.slotProps?.baseIconButton,{children:O.jsx(a.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function jjt({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:i,open:o,target:s,onExited:a}){const l=Kn(),c=l.current.getColumn(i),u=ft(f=>{f&&(f.stopPropagation(),s?.contains(f.target))||l.current.hideColumnMenu()});return!s||!c?null:O.jsx(Lce,{placement:`bottom-${c.align==="right"?"start":"end"}`,open:o,target:s,onClose:u,onExited:a,children:O.jsx(n,X({colDef:c,hideMenu:u,open:o,id:e,labelledby:t},r))})}function Bjt(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function xj(e,t){return e.closest(`.${t}`)}function Mv(e){return e.replace(/["\\]/g,"\\$&")}function Ujt(e,t){return e.querySelector(`[role="columnheader"][data-field="${Mv(t)}"]`)}function h8e(e){return`.${ve.row}[data-id="${Mv(String(e))}"]`}function Vjt(e,t){return e.querySelector(h8e(t))}function Wjt(e,{id:t,field:n}){const r=h8e(t),i=`.${ve.cell}[data-field="${Mv(n)}"]`,o=`${r} ${i}`;return e.querySelector(o)}function FD(e){return e.target.nodeType===1&&!e.currentTarget.contains(e.target)}function Hjt(e){return e.getAttribute("data-field")}function Gjt(e,t){return e.querySelector(`[data-field="${Mv(t)}"]`)}function qjt(e){return e.getAttribute("data-fields").slice(2,-2).split("-|-")}function Xjt(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${Mv(t)}-|"]`)??[])}function Yjt(e,t){if(!xj(e,ve.root))throw new Error("MUI X: The root element is not found.");const r=e.getAttribute("aria-colindex");if(!r)return[];const i=Number(r)-1,o=[];return t.virtualScrollerRef?.current?(m8e(t).forEach(s=>{const a=s.getAttribute("data-id");if(!a)return;let l=i;const c=t.unstable_getCellColSpanInfo(a,i);c&&c.spannedByColSpan&&(l=c.leftVisibleCellIndex);const u=s.querySelector(`[data-colindex="${l}"]`);u&&o.push(u)}),o):[]}function HSe(e,t){return e.rootElementRef.current.querySelector(`.${ve[t]}`)}const p8e=({api:e,colIndex:t,position:n,filterFn:r})=>{if(t===null)return[];const i=[];return m8e(e).forEach(o=>{o.getAttribute("data-id")&&o.querySelectorAll(`.${ve[n==="left"?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(a=>{const l=VT(a);l!==null&&r(l)&&i.push(a)})}),i};function Qjt(e,t,n){const r=VT(t);return p8e({api:e,colIndex:r,position:n?"right":"left",filterFn:i=>n?ir})}function Kjt(e,t,n){const r=VT(t);return p8e({api:e,colIndex:r,position:n?"left":"right",filterFn:i=>n?i>r:i{if(!e.columnHeadersContainerRef?.current)return[];if(t===null)return[];const i=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${ve[n==="left"?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(o=>{const s=VT(o);s!==null&&r(s,o)&&i.push(o)}),i};function Zjt(e,t,n){const r=VT(t);return g8e({api:e,position:n?"right":"left",colIndex:r,filterFn:i=>n?ir})}function Jjt(e,t,n){const r=VT(t);return g8e({api:e,position:n?"left":"right",colIndex:r,filterFn:(i,o)=>o.classList.contains(ve["columnHeader--last"])?!1:n?i>r:i div > [data-field="${Mv(t)}"][role="columnheader"]`)}function tBt(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${Mv(t)}"][role="gridcell"]`))}function m8e(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${ve.row}`)}function VT(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const nBt=["className","aria-label"],rBt=e=>{const{classes:t}=e;return Xe({root:["columnHeaderTitle"]},hr,t)},iBt=Qn("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),oBt=Er(function(t,n){const{className:r}=t,i=it(t,nBt),o=tn(),s=rBt(o);return O.jsx(iBt,X({className:Re(s.root,r),ownerState:o},i,{ref:n}))});function sBt(e){const{label:t,description:n}=e,r=tn(),i=M.useRef(null),[o,s]=M.useState(""),a=M.useCallback(()=>{if(!n&&i?.current){const l=Bjt(i.current);s(l?t:"")}},[n,t]);return O.jsx(r.slots.baseTooltip,X({title:n||o},r.slotProps?.baseTooltip,{children:O.jsx(oBt,{onMouseOver:a,ref:i,children:t})}))}const aBt=["resizable","resizing","height","side"];var Yce=(function(e){return e.Left="left",e.Right="right",e})(Yce||{});const lBt=e=>{const{resizable:t,resizing:n,classes:r,side:i}=e,o={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",i&&`columnSeparator--side${Ve(i)}`],icon:["iconSeparator"]};return Xe(o,hr,r)};function cBt(e){const{height:t,side:n=Yce.Right}=e,r=it(e,aBt),i=tn(),o=X({},e,{side:n,classes:i.classes}),s=lBt(o),a=M.useCallback(l=>{l.preventDefault(),l.stopPropagation()},[]);return O.jsx("div",X({className:s.root,style:{minHeight:t}},r,{onClick:a,children:O.jsx(i.slots.columnResizeIcon,{className:s.icon})}))}const uBt=M.memo(cBt),fBt=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],v8e=Er(function(t,n){const{classes:r,colIndex:i,height:o,isResizing:s,sortDirection:a,tabIndex:l,separatorSide:c,isDraggable:u,headerComponent:f,description:d,width:h,columnMenuIconButton:p=null,columnMenu:g=null,columnTitleIconButtons:m=null,headerClassName:v,label:y,resizable:b,draggableContainerProps:w,columnHeaderSeparatorProps:S,style:_}=t,E=it(t,fBt),T=tn(),k=M.useRef(null),P=zn(k,n);let R="none";return a!=null&&(R=a==="asc"?"ascending":"descending"),O.jsxs("div",X({className:Re(r.root,v),style:X({},_,{height:o,width:h}),role:"columnheader",tabIndex:l,"aria-colindex":i+1,"aria-sort":R},E,{ref:P,children:[O.jsxs("div",X({className:r.draggableContainer,draggable:u,role:"presentation"},w,{children:[O.jsxs("div",{className:r.titleContainer,role:"presentation",children:[O.jsx("div",{className:r.titleContainerContent,children:f!==void 0?f:O.jsx(sBt,{label:y,description:d,columnWidth:h})}),m]}),p]})),O.jsx(uBt,X({resizable:!T.disableColumnResize&&!!b,resizing:s,height:o,side:c},S)),g]}))}),dBt=e=>{const{colDef:t,classes:n,isDragging:r,sortDirection:i,showRightBorder:o,showLeftBorder:s,filterItemsCounter:a,pinnedPosition:l,isLastUnpinned:c,isSiblingFocused:u}=e,f=i!=null,d=a!=null&&a>0,h=t.type==="number",p={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",f&&"columnHeader--sorted",d&&"columnHeader--filtered",h&&"columnHeader--numeric","withBorderColor",o&&"columnHeader--withRightBorder",s&&"columnHeader--withLeftBorder",l===or.LEFT&&"columnHeader--pinnedLeft",l===or.RIGHT&&"columnHeader--pinnedRight",c&&"columnHeader--lastUnpinned",u&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Xe(p,hr,n)};function hBt(e){const{colDef:t,columnMenuOpen:n,colIndex:r,headerHeight:i,isResizing:o,isLast:s,sortDirection:a,sortIndex:l,filterItemsCounter:c,hasFocus:u,tabIndex:f,disableReorder:d,separatorSide:h,showLeftBorder:p,showRightBorder:g,pinnedPosition:m,pinnedOffset:v}=e,y=ud(),b=tn(),w=bi(),S=M.useRef(null),_=ur(),E=ur(),T=M.useRef(null),[k,P]=M.useState(n),R=M.useMemo(()=>!b.disableColumnReorder&&!d&&!t.disableReorder,[b.disableColumnReorder,d,t.disableReorder]);let I;t.renderHeader&&(I=t.renderHeader(y.current.getColumnHeaderParams(t.field)));const F=X({},e,{classes:b.classes,showRightBorder:g,showLeftBorder:p}),A=dBt(F),L=M.useCallback(ie=>ne=>{FD(ne)||y.current.publishEvent(ie,y.current.getColumnHeaderParams(t.field),ne)},[y,t.field]),$=M.useMemo(()=>({onClick:L("columnHeaderClick"),onContextMenu:L("columnHeaderContextMenu"),onDoubleClick:L("columnHeaderDoubleClick"),onMouseOver:L("columnHeaderOver"),onMouseOut:L("columnHeaderOut"),onMouseEnter:L("columnHeaderEnter"),onMouseLeave:L("columnHeaderLeave"),onKeyDown:L("columnHeaderKeyDown"),onFocus:L("columnHeaderFocus"),onBlur:L("columnHeaderBlur")}),[L]),j=M.useMemo(()=>R?{onDragStart:L("columnHeaderDragStart"),onDragEnter:L("columnHeaderDragEnter"),onDragOver:L("columnHeaderDragOver"),onDragEnd:L("columnHeaderDragEnd")}:{},[R,L]),V=M.useMemo(()=>({onMouseDown:L("columnSeparatorMouseDown"),onDoubleClick:L("columnSeparatorDoubleClick")}),[L]);M.useEffect(()=>{k||P(n)},[k,n]);const U=M.useCallback(()=>{P(!1)},[]),z=!b.disableColumnMenu&&!t.disableColumnMenu&&O.jsx(zjt,{colDef:t,columnMenuId:_,columnMenuButtonId:E,open:k,iconButtonRef:T}),N=O.jsx(jjt,{columnMenuId:_,columnMenuButtonId:E,field:t.field,open:n,target:T.current,ContentComponent:b.slots.columnMenu,contentComponentProps:b.slotProps?.columnMenu,onExited:U}),B=t.sortingOrder??b.sortingOrder,H=(t.sortable||a!=null)&&!t.hideSortIcons&&!b.disableColumnSorting,Q=O.jsxs(M.Fragment,{children:[!b.disableColumnFilter&&O.jsx(b.slots.columnHeaderFilterIconButton,X({field:t.field,counter:c},b.slotProps?.columnHeaderFilterIconButton)),H&&O.jsx(b.slots.columnHeaderSortIcon,X({field:t.field,direction:a,index:l,sortingOrder:B,disabled:!t.sortable},b.slotProps?.columnHeaderSortIcon))]});M.useLayoutEffect(()=>{const ie=y.current.state.columnMenu;if(u&&!ie.open){const fe=S.current.querySelector('[tabindex="0"]')||S.current;if(!fe)return;if(qce())fe.focus({preventScroll:!0});else{const me=y.current.getScrollPosition();fe.focus(),y.current.scroll(me)}}},[y,u]);const Y=typeof t.headerClassName=="function"?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,Z=t.headerName??t.field,pe=M.useMemo(()=>jU(X({},e.style),w,m,v),[m,v,e.style,w]);return O.jsx(v8e,X({ref:S,classes:A,columnMenuOpen:n,colIndex:r,height:i,isResizing:o,sortDirection:a,hasFocus:u,tabIndex:f,separatorSide:h,isDraggable:R,headerComponent:I,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:z,columnTitleIconButtons:Q,headerClassName:Re(Y,s&&ve["columnHeader--last"]),label:Z,resizable:!b.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:N,draggableContainerProps:j,columnHeaderSeparatorProps:V,style:pe},$))}const pBt=Pv(hBt),gBt=["className"],mBt=e=>{const{classes:t}=e;return Xe({root:["iconButtonContainer"]},hr,t)},vBt=Qn("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),y8e=Er(function(t,n){const{className:r}=t,i=it(t,gBt),o=tn(),s=mBt(o);return O.jsx(vBt,X({className:Re(s.root,r),ownerState:o},i,{ref:n}))}),yBt=["direction","index","sortingOrder","disabled","className"],bBt=e=>{const{classes:t}=e;return Xe({root:["sortButton"],icon:["sortIcon"]},hr,t)};function xBt(e,t,n,r){let i;const o={};return t==="asc"?i=e.columnSortedAscendingIcon:t==="desc"?i=e.columnSortedDescendingIcon:(i=e.columnUnsortedIcon,o.sortingOrder=r),i?O.jsx(i,X({fontSize:"small",className:n},o)):null}function wBt(e){const{direction:t,index:n,sortingOrder:r,disabled:i,className:o}=e,s=it(e,yBt),a=Kn(),l=tn(),c=X({},e,{classes:l.classes}),u=bBt(c),f=xBt(l.slots,t,u.icon,r);if(!f)return null;const d=O.jsx(l.slots.baseIconButton,X({tabIndex:-1,"aria-label":a.current.getLocaleText("columnHeaderSortIconLabel"),title:a.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:i,className:Re(u.root,o)},l.slotProps?.baseIconButton,s,{children:f}));return O.jsxs(y8e,{children:[n!=null&&O.jsx(l.slots.baseBadge,{badgeContent:n,color:"default",overlap:"circular",children:d}),n==null&&d]})}const SBt=M.memo(wBt),_Bt=e=>{const{classes:t}=e;return Xe({icon:["filterIcon"]},hr,t)};function CBt(e){return e.counter?O.jsx(OBt,X({},e)):null}function OBt(e){const{counter:t,field:n,onClick:r}=e,i=Kn(),o=tn(),s=X({},e,{classes:o.classes}),a=_Bt(s),l=ur(),c=ZA(i,B5t,l),u=ur(),f=M.useCallback(h=>{h.preventDefault(),h.stopPropagation();const{open:p,openedPanelValue:g}=tR(i.current.state);p&&g===dw.filters?i.current.hideFilterPanel():i.current.showFilterPanel(void 0,u,l),r&&r(i.current.getColumnHeaderParams(n),h)},[i,n,r,u,l]);if(!t)return null;const d=O.jsx(o.slots.baseIconButton,X({id:l,onClick:f,color:"default","aria-label":i.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?u:void 0},o.slotProps?.baseIconButton,{children:O.jsx(o.slots.columnFilteredIcon,{className:a.icon,fontSize:"small"})}));return O.jsx(o.slots.baseTooltip,X({title:i.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},o.slotProps?.baseTooltip,{children:O.jsxs(y8e,{children:[t>1&&O.jsx(o.slots.baseBadge,{badgeContent:t,color:"default",children:d}),t===1&&d]})}))}const GSe=ot(O.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),qSe=ot(O.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),XSe=ot(O.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),YSe=ot(O.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),EBt=ot(O.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),QSe=ot(O.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt"),TBt=ot(O.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");ot(O.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");ot(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");const PBt=ot(O.jsx("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),kBt=ot(O.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"}),"Separator"),MBt=ot(O.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),ABt=ot(O.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),RBt=ot(O.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),IBt=ot(O.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"TripleDotsVertical"),i7=ot(O.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),KSe=ot(O.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),DBt=ot(O.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),LBt=ot(O.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Load"),ZSe=ot(O.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"Drag"),FBt=ot(O.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),$Bt=ot(O.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),NBt=ot(O.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert"),zBt=ot(O.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),jBt=ot(O.jsx("g",{children:O.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),BBt=ot(O.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");ot(O.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");const UBt=ot(O.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");function b8e(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const wj=e=>e.indexOf("Arrow")===0||e.indexOf("Page")===0||e===" "||e==="Home"||e==="End",VBt=e=>!!e.key,x8e=e=>e==="Tab"||e==="Escape";function w8e(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="V"&&!e.shiftKey&&!e.altKey}function WBt(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="C"&&!e.shiftKey&&!e.altKey}const HBt=["hideMenu","colDef","id","labelledby","className","children","open"],GBt=Oe(nS)(()=>({minWidth:248})),qBt=Er(function(t,n){const{hideMenu:r,id:i,labelledby:o,className:s,children:a,open:l}=t,c=it(t,HBt),u=M.useCallback(f=>{f.key==="Tab"&&f.preventDefault(),x8e(f.key)&&r(f)},[r]);return O.jsx(GBt,X({id:i,className:Re(ve.menuList,s),"aria-labelledby":o,onKeyDown:u,autoFocus:l},c,{ref:n,children:a}))}),XBt=["displayOrder"],YBt=e=>{const t=ud(),n=tn(),{defaultSlots:r,defaultSlotProps:i,slots:o={},slotProps:s={},hideMenu:a,colDef:l,addDividers:c=!0}=e,u=M.useMemo(()=>X({},r,o),[r,o]),f=M.useMemo(()=>{if(!s||Object.keys(s).length===0)return i;const p=X({},s);return Object.entries(i).forEach(([g,m])=>{p[g]=X({},m,s[g]||{})}),p},[i,s]),d=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),h=M.useMemo(()=>{const p=Object.keys(r);return Object.keys(o).filter(g=>!p.includes(g))},[o,r]);return M.useMemo(()=>{const m=Array.from(new Set([...d,...h])).filter(v=>u[v]!=null).sort((v,y)=>{const b=f[v],w=f[y],S=Number.isFinite(b?.displayOrder)?b.displayOrder:100,_=Number.isFinite(w?.displayOrder)?w.displayOrder:100;return S-_});return m.reduce((v,y,b)=>{let w={colDef:l,onClick:a};const S=f[y];if(S){const _=it(S,XBt);w=X({},w,_)}return c&&b!==m.length-1?[...v,[u[y],w],[n.slots.baseDivider,{}]]:[...v,[u[y],w]]},[])},[c,l,d,a,u,f,h,n.slots.baseDivider])};function QBt(e){const{colDef:t,onClick:n}=e,r=Kn(),i=tn(),a=Mo(r).filter(c=>c.disableColumnMenu!==!0).length===1,l=M.useCallback(c=>{a||(r.current.setColumnVisibility(t.field,!1),n(c))},[r,t.field,n,a]);return i.disableColumnSelector||t.hideable===!1?null:O.jsxs(tr,{onClick:l,disabled:a,children:[O.jsx(rl,{children:O.jsx(i.slots.columnMenuHideIcon,{fontSize:"small"})}),O.jsx(Yi,{children:r.current.getLocaleText("columnMenuHideColumn")})]})}function KBt(e){const{onClick:t}=e,n=Kn(),r=tn(),i=M.useCallback(o=>{t(o),n.current.showPreferences(dw.columns)},[n,t]);return r.disableColumnSelector?null:O.jsxs(tr,{onClick:i,children:[O.jsx(rl,{children:O.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),O.jsx(Yi,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}function ZBt(e){return O.jsxs(M.Fragment,{children:[O.jsx(QBt,X({},e)),O.jsx(KBt,X({},e))]})}function JBt(e){const{colDef:t,onClick:n}=e,r=Kn(),i=tn(),o=M.useCallback(s=>{n(s),r.current.showFilterPanel(t.field)},[r,t.field,n]);return i.disableColumnFilter||!t.filterable?null:O.jsxs(tr,{onClick:o,children:[O.jsx(rl,{children:O.jsx(i.slots.columnMenuFilterIcon,{fontSize:"small"})}),O.jsx(Yi,{children:r.current.getLocaleText("columnMenuFilter")})]})}function e4t(e){const{colDef:t,onClick:n}=e,r=Kn(),i=ut(r,zd),o=tn(),s=M.useMemo(()=>t?i.find(f=>f.field===t.field)?.sort:null,[t,i]),a=t.sortingOrder??o.sortingOrder,l=M.useCallback(u=>{n(u);const f=u.currentTarget.getAttribute("data-value")||null;r.current.sortColumn(t.field,f===s?null:f)},[r,t,n,s]);if(o.disableColumnSorting||!t||!t.sortable||!a.some(u=>!!u))return null;const c=u=>{const f=r.current.getLocaleText(u);return typeof f=="function"?f(t):f};return O.jsxs(M.Fragment,{children:[a.includes("asc")&&s!=="asc"?O.jsxs(tr,{onClick:l,"data-value":"asc",children:[O.jsx(rl,{children:O.jsx(o.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),O.jsx(Yi,{children:c("columnMenuSortAsc")})]}):null,a.includes("desc")&&s!=="desc"?O.jsxs(tr,{onClick:l,"data-value":"desc",children:[O.jsx(rl,{children:O.jsx(o.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),O.jsx(Yi,{children:c("columnMenuSortDesc")})]}):null,a.includes(null)&&s!=null?O.jsxs(tr,{onClick:l,children:[O.jsx(rl,{}),O.jsx(Yi,{children:r.current.getLocaleText("columnMenuUnsort")})]}):null]})}const t4t=["defaultSlots","defaultSlotProps","slots","slotProps"],n4t={columnMenuSortItem:e4t,columnMenuFilterItem:JBt,columnMenuColumnsItem:ZBt},r4t={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},i4t=Er(function(t,n){const{defaultSlots:r,defaultSlotProps:i,slots:o,slotProps:s}=t,a=it(t,t4t),l=YBt(X({},a,{defaultSlots:r,defaultSlotProps:i,slots:o,slotProps:s}));return O.jsx(qBt,X({},a,{ref:n,children:l.map(([c,u],f)=>O.jsx(c,X({},u),f))}))}),o4t=Er(function(t,n){return O.jsx(i4t,X({},t,{ref:n,defaultSlots:n4t,defaultSlotProps:r4t}))}),s4t=["className","slotProps"],a4t=e=>{const{classes:t}=e;return Xe({root:["panelWrapper"]},hr,t)},l4t=Oe("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),c4t=()=>!0,S8e=Er(function(t,n){const{className:r,slotProps:i={}}=t,o=it(t,s4t),s=tn(),a=a4t(s);return O.jsx(sle,X({open:!0,disableEnforceFocus:!0,isEnabled:c4t},i.TrapFocus,{children:O.jsx(l4t,X({tabIndex:-1,className:Re(a.root,r),ownerState:s},o,{ref:n}))}))});function u4t(e){const t=tn();return O.jsx(S8e,X({},e,{children:O.jsx(t.slots.columnsManagement,X({},t.slotProps?.columnsManagement))}))}const f4t=["children","className","classes"],d4t=dt("MuiDataGrid",["panel","paper"]),h4t=Oe(Sb,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),p4t=Oe(fa,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex",maxWidth:`calc(100vw - ${e.spacing(.5)})`,overflow:"auto"})),g4t=Er((e,t)=>{const{children:n,className:r}=e,i=it(e,f4t),o=Kn(),s=tn(),a=d4t,[l,c]=M.useState(!1),u=M.useCallback(()=>{o.current.hidePreferences()},[o]),f=M.useCallback(g=>{g.key==="Escape"&&o.current.hidePreferences()},[o]),d=M.useMemo(()=>[{name:"flip",enabled:!0,options:{rootBoundary:"document"}},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{c(!0)},effect:()=>()=>{c(!1)}}],[]),[h,p]=M.useState(null);return M.useEffect(()=>{const g=o.current.rootElementRef?.current?.querySelector('[data-id="gridPanelAnchor"]');g&&p(g)},[o]),h?O.jsx(h4t,X({placement:"bottom-start",className:Re(a.panel,r),ownerState:s,anchorEl:h,modifiers:d},i,{ref:t,children:O.jsx(ole,{mouseEvent:"onPointerUp",touchEvent:!1,onClickAway:u,children:O.jsx(p4t,{className:a.paper,ownerState:s,elevation:8,onKeyDown:f,children:l&&n})})})):null}),m4t=["className"],v4t=e=>{const{classes:t}=e;return Xe({root:["panelContent"]},hr,t)},y4t=Qn("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function b4t(e){const{className:t}=e,n=it(e,m4t),r=tn(),i=v4t(r);return O.jsx(y4t,X({className:Re(i.root,t),ownerState:r},n))}const x4t=["className"],w4t=e=>{const{classes:t}=e;return Xe({root:["panelFooter"]},hr,t)},S4t=Qn("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function _4t(e){const{className:t}=e,n=it(e,x4t),r=tn(),i=w4t(r);return O.jsx(S4t,X({className:Re(i.root,t),ownerState:r},n))}const C4t=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],O4t=["InputComponentProps"],E4t=e=>{const{classes:t}=e;return Xe({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},hr,t)},T4t=Oe("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),P4t=Oe("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),k4t=Oe("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),M4t=Oe("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),A4t=Oe("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:150}),R4t=Oe("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),I4t=e=>{switch(e){case Dl.And:return"filterPanelOperatorAnd";case Dl.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}},Nk=e=>e.headerName||e.field,JSe=new Intl.Collator,e_e=Er(function(t,n){const{item:r,hasMultipleFilters:i,deleteFilter:o,applyFilterChanges:s,showMultiFilterOperators:a,disableMultiFilterOperator:l,applyMultiFilterOperatorChanges:c,focusElementRef:u,logicOperators:f=[Dl.And,Dl.Or],columnsSort:d,filterColumns:h,deleteIconProps:p={},logicOperatorInputProps:g={},operatorInputProps:m={},columnInputProps:v={},valueInputProps:y={},readOnly:b}=t,w=it(t,C4t),S=Kn(),_=ut(S,kv),E=ut(S,CVe),T=ut(S,Hs),k=ur(),P=ur(),R=ur(),I=ur(),F=tn(),A=E4t(F),L=M.useRef(null),$=M.useRef(null),j=T.logicOperator??Dl.And,V=i&&f.length>0,U=F.slotProps?.baseFormControl||{},N=(F.slotProps?.baseSelect||{}).native??!1,B=F.slotProps?.baseInputLabel||{},H=F.slotProps?.baseSelectOption||{},{InputComponentProps:Q}=y,Y=it(y,O4t),{filteredColumns:Z,selectedField:pe}=M.useMemo(()=>{let ce=r.field;const he=_[r.field].filterable===!1?_[r.field]:null;if(he)return{filteredColumns:[he],selectedField:ce};if(h===void 0||typeof h!="function")return{filteredColumns:E,selectedField:ce};const J=h({field:r.field,columns:E,currentFilters:T?.items||[]});return{filteredColumns:E.filter(te=>{const ae=J.includes(te.field);return te.field===r.field&&!ae&&(ce=void 0),ae}),selectedField:ce}},[h,T?.items,E,r.field,_]),ie=M.useMemo(()=>{switch(d){case"asc":return Z.sort((ce,he)=>JSe.compare(Nk(ce),Nk(he)));case"desc":return Z.sort((ce,he)=>-JSe.compare(Nk(ce),Nk(he)));default:return Z}},[Z,d]),ne=r.field?S.current.getColumn(r.field):null,fe=M.useMemo(()=>!r.operator||!ne?null:ne.filterOperators?.find(ce=>ce.value===r.operator),[r,ne]),me=M.useCallback(ce=>{const he=ce.target.value,J=S.current.getColumn(he);if(J.field===ne.field)return;const te=J.filterOperators.find(Pe=>Pe.value===r.operator)||J.filterOperators[0];let we=!te.InputComponent||te.InputComponent!==fe?.InputComponent||J.type!==ne.type?void 0:r.value;if(J.type==="singleSelect"&&we!==void 0){const Pe=J,ee=fw(Pe);Array.isArray(we)?we=we.filter(oe=>vj(oe,ee,Pe?.getOptionValue)!==void 0):vj(r.value,ee,Pe?.getOptionValue)===void 0&&(we=void 0)}s(X({},r,{field:he,operator:te.value,value:we}))},[S,s,r,ne,fe]),se=M.useCallback(ce=>{const he=ce.target.value,J=ne?.filterOperators.find(ae=>ae.value===he),te=!J?.InputComponent||J?.InputComponent!==fe?.InputComponent;s(X({},r,{operator:he,value:te?void 0:r.value}))},[s,r,ne,fe]),ue=M.useCallback(ce=>{const he=ce.target.value===Dl.And.toString()?Dl.And:Dl.Or;c(he)},[c]),G=()=>{o(r)};return M.useImperativeHandle(u,()=>({focus:()=>{fe?.InputComponent?L?.current?.focus():$.current.focus()}}),[fe]),O.jsxs(T4t,X({className:A.root,"data-id":r.id,ownerState:F},w,{ref:n,children:[O.jsx(P4t,X({variant:"standard",as:F.slots.baseFormControl},U,p,{className:Re(A.deleteIcon,U.className,p.className),ownerState:F,children:O.jsx(F.slots.baseIconButton,X({"aria-label":S.current.getLocaleText("filterPanelDeleteIconLabel"),title:S.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:G,size:"small",disabled:b},F.slotProps?.baseIconButton,{children:O.jsx(F.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),O.jsx(k4t,X({variant:"standard",as:F.slots.baseFormControl},U,g,{sx:[V?{display:"flex"}:{display:"none"},a?{visibility:"visible"}:{visibility:"hidden"},U.sx,g.sx],className:Re(A.logicOperatorInput,U.className,g.className),ownerState:F,children:O.jsx(F.slots.baseSelect,X({inputProps:{"aria-label":S.current.getLocaleText("filterPanelLogicOperator")},value:j??"",onChange:ue,disabled:!!l||f.length===1,native:N},F.slotProps?.baseSelect,{children:f.map(ce=>M.createElement(F.slots.baseSelectOption,X({},H,{native:N,key:ce.toString(),value:ce.toString()}),S.current.getLocaleText(I4t(ce))))}))})),O.jsxs(M4t,X({variant:"standard",as:F.slots.baseFormControl},U,v,{className:Re(A.columnInput,U.className,v.className),ownerState:F,children:[O.jsx(F.slots.baseInputLabel,X({},B,{htmlFor:k,id:P,children:S.current.getLocaleText("filterPanelColumns")})),O.jsx(F.slots.baseSelect,X({labelId:P,id:k,label:S.current.getLocaleText("filterPanelColumns"),value:pe??"",onChange:me,native:N,disabled:b},F.slotProps?.baseSelect,{children:ie.map(ce=>M.createElement(F.slots.baseSelectOption,X({},H,{native:N,key:ce.field,value:ce.field}),Nk(ce)))}))]})),O.jsxs(A4t,X({variant:"standard",as:F.slots.baseFormControl},U,m,{className:Re(A.operatorInput,U.className,m.className),ownerState:F,children:[O.jsx(F.slots.baseInputLabel,X({},B,{htmlFor:R,id:I,children:S.current.getLocaleText("filterPanelOperator")})),O.jsx(F.slots.baseSelect,X({labelId:I,label:S.current.getLocaleText("filterPanelOperator"),id:R,value:r.operator,onChange:se,native:N,inputRef:$,disabled:b},F.slotProps?.baseSelect,{children:ne?.filterOperators?.map(ce=>M.createElement(F.slots.baseSelectOption,X({},H,{native:N,key:ce.value,value:ce.value}),ce.label||S.current.getLocaleText(`filterOperator${Ve(ce.value)}`)))}))]})),O.jsx(R4t,X({variant:"standard",as:F.slots.baseFormControl},U,Y,{className:Re(A.valueInput,U.className,Y.className),ownerState:F,children:fe?.InputComponent?O.jsx(fe.InputComponent,X({apiRef:S,item:r,applyValue:s,focusElementRef:L,disabled:b},fe.InputComponentProps,Q),r.field):null}))]}))}),D4t=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],t_e=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),L4t=Er(function(t,n){const r=Kn(),i=tn(),o=ut(r,Hs),s=ut(r,CVe),a=ut(r,UNt),l=M.useRef(null),c=M.useRef(null),{logicOperators:u=[Dl.And,Dl.Or],columnsSort:f,filterFormProps:d,getColumnForNewFilter:h,disableAddFilterButton:p=!1,disableRemoveAllButton:g=!1}=t,m=it(t,D4t),v=r.current.upsertFilterItem,y=M.useCallback(I=>{r.current.setFilterLogicOperator(I)},[r]),b=M.useCallback(()=>{let I;if(h&&typeof h=="function"){const F=h({currentFilters:o?.items||[],columns:s});if(F===null)return null;I=s.find(({field:A})=>A===F)}else I=s.find(F=>F.filterOperators?.length);return I?t_e(I):null},[o?.items,s,h]),w=M.useCallback(()=>{if(h===void 0||typeof h!="function")return b();const I=o.items.length?o.items:[b()].filter(Boolean),F=h({currentFilters:I,columns:s});if(F===null)return null;const A=s.find(({field:L})=>L===F);return A?t_e(A):null},[o.items,s,h,b]),S=M.useMemo(()=>o.items.length?o.items:(c.current||(c.current=b()),c.current?[c.current]:[]),[o.items,b]),_=S.length>1,{readOnlyFilters:E,validFilters:T}=M.useMemo(()=>S.reduce((I,F)=>(a[F.field]?I.validFilters.push(F):I.readOnlyFilters.push(F),I),{readOnlyFilters:[],validFilters:[]}),[S,a]),k=M.useCallback(()=>{const I=w();I&&r.current.upsertFilterItems([...S,I])},[r,w,S]),P=M.useCallback(I=>{const F=T.length===1;r.current.deleteFilterItem(I),F&&r.current.hideFilterPanel()},[r,T.length]),R=M.useCallback(()=>T.length===1&&T[0].value===void 0?(r.current.deleteFilterItem(T[0]),r.current.hideFilterPanel()):r.current.setFilterModel(X({},o,{items:E}),"removeAllFilterItems"),[r,E,o,T]);return M.useEffect(()=>{u.length>0&&o.logicOperator&&!u.includes(o.logicOperator)&&y(u[0])},[u,y,o.logicOperator]),M.useEffect(()=>{T.length>0&&l.current.focus()},[T.length]),O.jsxs(S8e,X({},m,{ref:n,children:[O.jsxs(b4t,{children:[E.map((I,F)=>O.jsx(e_e,X({item:I,applyFilterChanges:v,deleteFilter:P,hasMultipleFilters:_,showMultiFilterOperators:F>0,disableMultiFilterOperator:F!==1,applyMultiFilterOperatorChanges:y,focusElementRef:null,readOnly:!0,logicOperators:u,columnsSort:f},d),I.id==null?F:I.id)),T.map((I,F)=>O.jsx(e_e,X({item:I,applyFilterChanges:v,deleteFilter:P,hasMultipleFilters:_,showMultiFilterOperators:E.length+F>0,disableMultiFilterOperator:E.length+F!==1,applyMultiFilterOperatorChanges:y,focusElementRef:F===T.length-1?l:null,logicOperators:u,columnsSort:f},d),I.id==null?F+E.length:I.id))]}),!i.disableMultipleColumnsFiltering&&!(p&&g)?O.jsxs(_4t,{children:[p?O.jsx("span",{}):O.jsx(i.slots.baseButton,X({onClick:k,startIcon:O.jsx(i.slots.filterPanelAddIcon,{})},i.slotProps?.baseButton,{children:r.current.getLocaleText("filterPanelAddFilter")})),!g&&T.length>0?O.jsx(i.slots.baseButton,X({onClick:R,startIcon:O.jsx(i.slots.filterPanelRemoveAllIcon,{})},i.slotProps?.baseButton,{children:r.current.getLocaleText("filterPanelRemoveAll")})):null]}):null]}))}),F4t=(e,t)=>{const n=new Set(Object.keys(e).filter(o=>e[o]===!1)),r=new Set(Object.keys(t).filter(o=>t[o]===!1));if(n.size!==r.size)return!1;let i=!0;return n.forEach(o=>{r.has(o)||(i=!1)}),i},$4t=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,N4t=e=>{const{classes:t}=e;return Xe({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},hr,t)},n_e=new Intl.Collator;function z4t(e){const t=Kn(),n=M.useRef(null),r=ut(t,Ff),i=ad(()=>Of(t)).current,o=ut(t,Of),s=tn(),[a,l]=M.useState(""),c=N4t(s),{sort:u,searchPredicate:f=$4t,autoFocusSearchField:d=!0,disableShowHideToggle:h=!1,disableResetButton:p=!1,toggleAllMode:g="all",getTogglableColumns:m,searchInputProps:v}=e,y=M.useMemo(()=>F4t(o,i),[o,i]),b=M.useMemo(()=>{switch(u){case"asc":return[...r].sort((L,$)=>n_e.compare(L.headerName||L.field,$.headerName||$.field));case"desc":return[...r].sort((L,$)=>-n_e.compare(L.headerName||L.field,$.headerName||$.field));default:return r}},[r,u]),w=L=>{const{name:$}=L.target;t.current.setColumnVisibility($,o[$]===!1)},S=M.useMemo(()=>{const L=m?m(b):null,$=L?b.filter(({field:j})=>L.includes(j)):b;return a?$.filter(j=>f(j,a.toLowerCase())):$},[b,a,f,m]),_=M.useCallback(L=>{const $=Of(t),j=X({},$),V=m?m(r):null;return(g==="filteredOnly"?S:r).forEach(U=>{U.hideable&&(V==null||V.includes(U.field))&&(L?delete j[U.field]:j[U.field]=!1)}),t.current.setColumnVisibilityModel(j)},[t,r,m,g,S]),E=M.useCallback(L=>{l(L.target.value)},[]),T=M.useMemo(()=>S.filter(L=>L.hideable),[S]),k=M.useMemo(()=>T.every(L=>o[L.field]==null||o[L.field]!==!1),[o,T]),P=M.useMemo(()=>T.every(L=>o[L.field]===!1),[o,T]),R=M.useRef(null);M.useEffect(()=>{d?n.current.focus():R.current&&typeof R.current.focus=="function"&&R.current.focus()},[d]);let I=!1;const F=L=>I===!1&&L.hideable!==!1?(I=!0,!0):!1,A=M.useCallback(()=>{l(""),n.current.focus()},[]);return O.jsxs(M.Fragment,{children:[O.jsx(B4t,{className:c.header,ownerState:s,children:O.jsx(U4t,X({as:s.slots.baseTextField,ownerState:s,placeholder:t.current.getLocaleText("columnsManagementSearchTitle"),inputRef:n,className:c.searchInput,value:a,onChange:E,variant:"outlined",size:"small",type:"search",InputProps:{startAdornment:O.jsx(s.slots.baseInputAdornment,{position:"start",children:O.jsx(s.slots.quickFilterIcon,{})}),endAdornment:O.jsx(s.slots.baseIconButton,X({"aria-label":t.current.getLocaleText("columnsManagementDeleteIconLabel"),size:"small",sx:[a?{visibility:"visible"}:{visibility:"hidden"}],tabIndex:-1,onClick:A},s.slotProps?.baseIconButton,{children:O.jsx(s.slots.quickFilterClearIcon,{fontSize:"small"})}))},inputProps:{"aria-label":t.current.getLocaleText("columnsManagementSearchTitle")},autoComplete:"off",fullWidth:!0},s.slotProps?.baseTextField,v))}),O.jsxs(j4t,{className:c.root,ownerState:s,children:[S.map(L=>O.jsx(sh,{className:c.row,control:O.jsx(s.slots.baseCheckbox,X({disabled:L.hideable===!1,checked:o[L.field]!==!1,onClick:w,name:L.field,sx:{p:.5},inputRef:F(L)?R:void 0},s.slotProps?.baseCheckbox)),label:L.headerName||L.field},L.field)),S.length===0&&O.jsx(W4t,{ownerState:s,children:t.current.getLocaleText("columnsManagementNoColumns")})]}),(!h||!p)&&S.length>0?O.jsxs(V4t,{ownerState:s,className:c.footer,children:[h?O.jsx("span",{}):O.jsx(sh,{control:O.jsx(s.slots.baseCheckbox,X({disabled:T.length===0,checked:k,indeterminate:!k&&!P,onClick:()=>_(!k),name:t.current.getLocaleText("columnsManagementShowHideAllText"),sx:{p:.5}},s.slotProps?.baseCheckbox)),label:t.current.getLocaleText("columnsManagementShowHideAllText")}),p?null:O.jsx(s.slots.baseButton,X({onClick:()=>t.current.setColumnVisibilityModel(i),disabled:y},s.slotProps?.baseButton,{children:t.current.getLocaleText("columnsManagementReset")}))]}):null]})}const j4t=Oe("div",{name:"MuiDataGrid",slot:"ColumnsManagement",overridesResolver:(e,t)=>t.columnsManagement})(({theme:e})=>({padding:e.spacing(0,3,1.5),display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,alignItems:"flex-start"})),B4t=Oe("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader",overridesResolver:(e,t)=>t.columnsManagementHeader})(({theme:e})=>({padding:e.spacing(1.5,3)})),U4t=Oe(Ri,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput",overridesResolver:(e,t)=>t.columnsManagementSearchInput})(({theme:e})=>({[`& .${Xs.root}`]:{padding:e.spacing(0,1.5,0,1.5)},[`& .${Xs.input}::-webkit-search-decoration, +return result$$;`.replaceAll("$$",String(mwe)));return mwe+=1,(a,l)=>o(i,a,l)},x6e=e=>e.quickFilterExcludeHiddenColumns??!0,CFt=(e,t)=>{const n=e.quickFilterValues?.filter(Boolean)??[];if(n.length===0)return null;const r=x6e(e)?kT(t):Um(t),i=[],{ignoreDiacritics:o}=t.current.rootProps,s=p6e(t);return r.forEach(a=>{const l=t.current.getColumn(a),c=l?.getApplyQuickFilterFn;c&&i.push({column:l,appliers:n.map(u=>{const f=o?VA(u):u;return{fn:c(f,l,s)}})})}),function(l,c){const u={};e:for(let f=0;f{const r=_Ft(e,t,n),i=CFt(e,t);return function(s,a,l){l.passingFilterItems=r?.(s,a)??null,l.passingQuickFilterValues=i?.(s,a)??null}},vwe=e=>e!=null,EFt=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(r=>b6e(r,t)!==null)),e.cleanedFilterItems),TFt=(e,t,n,r,i)=>{const o=EFt(i,r,n.items),s=e.filter(vwe),a=t.filter(vwe);if(s.length>0){const l=u=>s.some(f=>f[u.id]);if((n.logicOperator??UA().logicOperator)===Il.And){if(!o.every(l))return!1}else if(!o.some(l))return!1}if(a.length>0&&n.quickFilterValues!=null){const l=u=>a.some(f=>f[u]);if((n.quickFilterLogicOperator??UA().quickFilterLogicOperator)===Il.And){if(!n.quickFilterValues.every(l))return!1}else if(!n.quickFilterValues.some(l))return!1}return!0},PFt=e=>{if(!e)return null;const t=new RegExp(H5(e),"i");return(n,r,i,o)=>{let s=o.current.getRowFormattedValue(r,i);return o.current.ignoreDiacritics&&(s=VA(s)),s!=null?t.test(s.toString()):!1}},ywe=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),i=new RegExp(H5(r),"i");return o=>{if(o==null)return t;const s=i.test(String(o));return t?!s:s}},bwe=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),i=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>{if(o==null)return t;const s=i.compare(r,o.toString())===0;return t?!s:s}},xwe=e=>()=>t=>{const n=t===""||t==null;return e?!n:n},kFt=(e=!1)=>[{value:"contains",getApplyFilterFn:ywe(e,!1),InputComponent:gf},{value:"doesNotContain",getApplyFilterFn:ywe(e,!0),InputComponent:gf},{value:"equals",getApplyFilterFn:bwe(e,!1),InputComponent:gf},{value:"doesNotEqual",getApplyFilterFn:bwe(e,!0),InputComponent:gf},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${H5(n)}.*$`,"i");return i=>i!=null?r.test(i.toString()):!1},InputComponent:gf},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${H5(n)}$`,"i");return i=>i!=null?r.test(i.toString()):!1},InputComponent:gf},{value:"isEmpty",getApplyFilterFn:xwe(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:xwe(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(i=>i.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return i=>i!=null?n.some(o=>r.compare(o,i.toString()||"")===0):!1},InputComponent:f6e}],ah={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:fFt,type:"string",align:"left",filterOperators:kFt(),renderEditCell:eFt,getApplyQuickFilterFn:PFt},MFt=["open","target","onClose","children","position","className","onExited"],AFt=e=>{const{classes:t}=e;return Xe({root:["menu"]},pr,t)},RFt=Oe(yb,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${ye.menuList}`]:{outline:0}})),IFt={"bottom-start":"top left","bottom-end":"top right"};function Tle(e){const{open:t,target:n,onClose:r,children:i,position:o,className:s,onExited:a}=e,l=st(e,MFt),c=Kn(),u=nn(),f=AFt(u),d=M.useRef(null);lr(()=>{t?d.current=document.activeElement instanceof HTMLElement?document.activeElement:null:(d.current?.focus?.(),d.current=null)},[t]),M.useEffect(()=>{const g=t?"menuOpen":"menuClose";c.current.publishEvent(g,{target:n})},[c,t,n]);const h=g=>m=>{g&&g(),a&&a(m)},p=g=>{g.target&&(n===g.target||n?.contains(g.target))||r(g)};return O.jsx(RFt,X({as:u.slots.basePopper,className:Re(f.root,s),ownerState:u,open:t,anchorEl:n,transition:!0,placement:o},l,u.slotProps?.basePopper,{children:({TransitionProps:g,placement:m})=>O.jsx(Jse,{onClickAway:p,mouseEvent:"onMouseDown",children:O.jsx(K1,X({},g,{style:{transformOrigin:IFt[m]},onExited:h(g?.onExited),children:O.jsx(fa,{children:i})}))})}))}const DFt=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],LFt=e=>typeof e.getActions=="function";function FFt(e){const{colDef:t,id:n,hasFocus:r,tabIndex:i,position:o="bottom-end",focusElementRef:s}=e,a=st(e,DFt),[l,c]=M.useState(-1),[u,f]=M.useState(!1),d=Kn(),h=M.useRef(null),p=M.useRef(null),g=M.useRef(!1),m=M.useRef({}),v=yi(),y=fr(),b=fr(),w=nn();if(!LFt(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const S=t.getActions(d.current.getRowParams(n)),_=S.filter($=>!$.props.showInMenu),E=S.filter($=>$.props.showInMenu),T=_.length+(E.length?1:0);M.useLayoutEffect(()=>{r||Object.entries(m.current).forEach(([$,j])=>{j?.stop({},()=>{delete m.current[$]})})},[r]),M.useEffect(()=>{if(l<0||!h.current||l>=h.current.children.length)return;h.current.children[l].focus({preventScroll:!0})},[l]),M.useEffect(()=>{r||(c(-1),g.current=!1)},[r]),M.useImperativeHandle(s,()=>({focus(){if(!g.current){const $=S.findIndex(j=>!j.props.disabled);c($)}}}),[S]),M.useEffect(()=>{l>=T&&c(T-1)},[l,T]);const k=()=>{f(!0),c(T-1),g.current=!0},P=()=>{f(!1)},I=$=>{$.stopPropagation(),$.preventDefault(),u?P():k()},R=$=>j=>{m.current[$]=j},F=($,j)=>V=>{c($),g.current=!0,j&&j(V)},A=$=>{if(T<=1)return;const j=(U,z)=>{if(U<0||U>S.length)return U;const B=(z==="left"?-1:1)*(v?-1:1);return S[U+B]?.props.disabled?j(U+B,z):U+B};let V=l;$.key==="ArrowRight"?V=j(l,"right"):$.key==="ArrowLeft"&&(V=j(l,"left")),!(V<0||V>=T)&&V!==l&&($.preventDefault(),$.stopPropagation(),c(V))},L=$=>{$.key==="Tab"&&$.preventDefault(),["Tab","Escape"].includes($.key)&&P()};return O.jsxs("div",X({role:"menu",ref:h,tabIndex:-1,className:ye.actionsCell,onKeyDown:A},a,{children:[_.map(($,j)=>M.cloneElement($,{key:j,touchRippleRef:R(j),onClick:F(j,$.props.onClick),tabIndex:l===j?i:-1})),E.length>0&&b&&O.jsx(w.slots.baseIconButton,X({ref:p,id:b,"aria-label":d.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?y:void 0,role:"menuitem",size:"small",onClick:I,touchRippleRef:R(b),tabIndex:l===_.length?i:-1},w.slotProps?.baseIconButton,{children:O.jsx(w.slots.moreActionsIcon,{fontSize:"small"})})),E.length>0&&O.jsx(Tle,{open:u,target:p.current,position:o,onClose:P,children:O.jsx(Xw,{id:y,className:ye.menuList,onKeyDown:L,"aria-labelledby":b,variant:"menu",autoFocusItem:!0,children:E.map(($,j)=>M.cloneElement($,{key:j,closeMenu:P}))})})]}))}const $Ft=e=>O.jsx(FFt,X({},e)),uU="actions",NFt=X({},ah,{sortable:!1,filterable:!1,aggregable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:$Ft,getApplyQuickFilterFn:void 0}),_a="auto-generated-group-node-root",VO=Symbol("mui.id_autogenerated"),zFt=()=>({type:"group",id:_a,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function jFt(e,t,n="A row was provided without id in the rows prop:"){if(e==null)throw new Error(["MUI X: The Data Grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join(` +`))}const fU=(e,t,n)=>{const r=t?t(e):e.id;return jFt(r,e,n),r},hz=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const i={type:"full",rows:[]},o={},s={};for(let a=0;a{const n=e[_a];return Math.max(t,n.children.length+(n.footerId==null?0:1))},S6e=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:i,previousGroupsToFetch:o})=>{const s=e.current.caches.rows,{tree:a,treeDepths:l,dataRowIds:c,groupingName:u,groupsToFetch:f=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:i,updates:s.updates,dataRowIdToIdLookup:s.dataRowIdToIdLookup,dataRowIdToModelLookup:s.dataRowIdToModelLookup,previousGroupsToFetch:o}),d=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:a,treeDepths:l,dataRowIdToIdLookup:s.dataRowIdToIdLookup,dataRowIds:c,dataRowIdToModelLookup:s.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},X({},d,{totalRowCount:Math.max(t,d.dataRowIds.length),totalTopLevelRowCount:w6e({tree:d.tree,rowCountProp:t}),groupingName:u,loading:n,groupsToFetch:f})},WO=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,Ple=(e,t,n)=>{const r=e[t];if(r.type!=="group")return[];const i=[];for(let o=0;o{if(e.updates.type==="full")throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const i=new Map;n.forEach(u=>{const f=fU(u,t,"A row was provided without id when calling updateRows():");i.has(f)?i.set(f,X({},i.get(f),u)):i.set(f,u)});const o={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:X({},e.updates.idToActionLookup),groupKeys:r},s=X({},e.dataRowIdToModelLookup),a=X({},e.dataRowIdToIdLookup),l={insert:{},modify:{},remove:{}};i.forEach((u,f)=>{const d=o.idToActionLookup[f];if(u._action==="delete"){if(d==="remove"||!s[f])return;d!=null&&(l[d][f]=!0),o.actions.remove.push(f),delete s[f],delete a[f];return}const h=s[f];if(h){d==="remove"?(l.remove[f]=!0,o.actions.modify.push(f)):d==null&&o.actions.modify.push(f),s[f]=X({},h,u);return}d==="remove"?(l.remove[f]=!0,o.actions.insert.push(f)):d==null&&o.actions.insert.push(f),s[f]=u,a[f]=f});const c=Object.keys(l);for(let u=0;u0&&(o.actions[f]=o.actions[f].filter(h=>!d[h]))}return{dataRowIdToModelLookup:s,dataRowIdToIdLookup:a,updates:o,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},_6e="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function Swe(e,t,n){const r=[];return t.forEach(i=>{const o=fU(i,n,"A row was provided without id when calling updateRows():");if(e.current.getRowNode(o)?.type==="pinnedRow"){const a=e.current.caches.pinnedRows,l=a.idLookup[o];l&&(a.idLookup[o]=X({},l,i))}else r.push(i)}),r}const C6e=(e,t,n)=>typeof e=="number"&&e>0?e:t,BFt="__tree_data_group__",O6e="__row_group_by_columns_group__",dU="__detail_panel_toggle__";let or=(function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e})({});const UFt=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"],VFt=e=>{const{classes:t}=e;return Xe({root:["booleanCell"]},pr,t)};function WFt(e){const{value:t,rowNode:n}=e,r=st(e,UFt),i=Kn(),o=nn(),s={classes:o.classes},a=VFt(s),c=ut(i,lS)>0&&n.type==="group"&&o.treeData===!1,u=M.useMemo(()=>t?o.slots.booleanCellTrueIcon:o.slots.booleanCellFalseIcon,[o.slots.booleanCellFalseIcon,o.slots.booleanCellTrueIcon,t]);return c&&t===void 0?null:O.jsx(u,X({fontSize:"small",className:a.root,titleAccess:i.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},r))}const HFt=M.memo(WFt),GFt=e=>e.field!==O6e&&WO(e.rowNode)?"":O.jsx(HFt,X({},e)),qFt=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],XFt=e=>{const{classes:t}=e;return Xe({root:["editBooleanCell"]},pr,t)};function YFt(e){const{id:t,value:n,field:r,className:i,hasFocus:o,onValueChange:s}=e,a=st(e,qFt),l=Kn(),c=M.useRef(null),u=fr(),[f,d]=M.useState(n),h=nn(),p={classes:h.classes},g=XFt(p),m=M.useCallback(async v=>{const y=v.target.checked;s&&await s(v,y),d(y),await l.current.setEditCellValue({id:t,field:r,value:y},v)},[l,r,t,s]);return M.useEffect(()=>{d(n)},[n]),lr(()=>{o&&c.current.focus()},[o]),O.jsx("label",X({htmlFor:u,className:Re(g.root,i)},a,{children:O.jsx(h.slots.baseCheckbox,X({id:u,inputRef:c,checked:!!f,onChange:m,size:"small"},h.slotProps?.baseCheckbox))}))}const QFt=e=>O.jsx(YFt,X({},e)),KFt=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],pz=e=>{if(String(e).toLowerCase()==="true")return!0;if(String(e).toLowerCase()==="false")return!1},ZFt=Oe("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function JFt(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:i,clearButton:o,tabIndex:s,label:a,variant:l="standard"}=e,c=st(e,KFt),[u,f]=M.useState(pz(t.value)),d=nn(),h=fr(),p=fr(),g=d.slotProps?.baseSelect||{},m=g.native??!1,v=d.slotProps?.baseSelectOption||{},y=M.useCallback(w=>{const S=pz(w.target.value);f(S),n(X({},t,{value:S}))},[n,t]);M.useEffect(()=>{f(pz(t.value))},[t.value]);const b=a??r.current.getLocaleText("filterPanelInputLabel");return O.jsxs(ZFt,{children:[O.jsxs(d.slots.baseFormControl,{fullWidth:!0,children:[O.jsx(d.slots.baseInputLabel,X({},d.slotProps?.baseInputLabel,{id:h,shrink:!0,variant:l,children:b})),O.jsxs(d.slots.baseSelect,X({labelId:h,id:p,label:b,value:u===void 0?"":String(u),onChange:y,variant:l,notched:l==="outlined"?!0:void 0,native:m,displayEmpty:!0,inputProps:{ref:i,tabIndex:s}},c,g,{children:[O.jsx(d.slots.baseSelectOption,X({},v,{native:m,value:"",children:r.current.getLocaleText("filterValueAny")})),O.jsx(d.slots.baseSelectOption,X({},v,{native:m,value:"true",children:r.current.getLocaleText("filterValueTrue")})),O.jsx(d.slots.baseSelectOption,X({},v,{native:m,value:"false",children:r.current.getLocaleText("filterValueFalse")}))]}))]}),o]})}const e$t=()=>[{value:"is",getApplyFilterFn:e=>{const t=pz(e.value);return t===void 0?null:n=>!!n===t},InputComponent:JFt}],t$t=(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),n$t=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},E6e=X({},ah,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:GFt,renderEditCell:QFt,sortComparator:l6e,valueFormatter:t$t,filterOperators:e$t(),getApplyQuickFilterFn:void 0,aggregable:!1,pastedValueParser:e=>n$t(e)}),T6e=e=>e.sorting,AT=xn(T6e,e=>e.sortedRows),kle=jr(AT,_f,ps,(e,t,n)=>e.reduce((r,i)=>{const o=t[i];if(o)r.push({id:i,model:o});else{const s=n[i];s&&WO(s)&&r.push({id:i,model:{[VO]:i}})}return r},[])),Fd=xn(T6e,e=>e.sortModel),r$t=jr(Fd,e=>e.reduce((n,r,i)=>(n[r.field]={sortDirection:r.sort,sortIndex:e.length>1?i+1:void 0},n),{}));jr(AT,e=>e.reduce((t,n,r)=>(t[n]=r,t),Object.create(null)));const hU=e=>e.filter,Hs=xn(hU,e=>e.filterModel),i$t=xn(Hs,e=>e.quickFilterValues),o$t=e=>e.visibleRowsLookup,RT=xn(hU,e=>e.filteredRowsLookup);xn(hU,e=>e.filteredChildrenCountLookup);xn(hU,e=>e.filteredDescendantCountLookup);const Ob=jr(o$t,kle,lS,Hs,i$t,(e,t,n,r,i)=>n<2&&!r.items.length&&!i?.length?t:t.filter(o=>e[o.id]!==!1)),iO=jr(Ob,e=>e.map(t=>t.id)),P6e=jr(RT,kle,(e,t)=>t.filter(n=>e[n.id]!==!1)),k6e=jr(P6e,e=>e.map(t=>t.id));jr(iO,ps,(e,t)=>{const n={};let r=0;return e.reduce((i,o)=>{const s=t[o];return n[s.depth]||(n[s.depth]=0),s.depth>r&&(n[s.depth]=0),r=s.depth,n[s.depth]+=1,i[o]=n[s.depth],i},{})});const M6e=jr(Ob,ps,lS,(e,t,n)=>n<2?e:e.filter(r=>t[r.id]?.depth===0)),Mle=xn(Ob,e=>e.length),Ale=xn(M6e,e=>e.length),s$t=xn(P6e,e=>e.length);xn(s$t,Ale,(e,t)=>e-t);const A6e=jr(Hs,Ov,(e,t)=>e.items?.filter(n=>{if(!n.field)return!1;const r=t[n.field];if(!r?.filterOperators||r?.filterOperators?.length===0)return!1;const i=r.filterOperators.find(o=>o.value===n.operator);return i?!i.InputComponent||n.value!=null&&n.value?.toString()!=="":!1})),a$t=jr(A6e,e=>e.reduce((n,r)=>(n[r.field]?n[r.field].push(r):n[r.field]=[r],n),{})),du=e=>e.rowSelection,l$t=xn(du,e=>e.length),c$t=jr(du,_f,(e,t)=>new Map(e.map(n=>[n,t[n]]))),E0=jr(du,e=>e.reduce((t,n)=>(t[n]=n,t),{}));function R6e(e,t){const n=ps(e),r=AT(e),i=RT(e),o=n[t];if(!o||o.type!=="group")return[];const s=[],a=r.findIndex(l=>l===t)+1;for(let l=a;lo.depth;l+=1){const c=r[l];i[c]!==!1&&e.current.isRowSelectable(c)&&s.push(c)}return s}function u$t(e,t){return xn(ps,AT,RT,E0,(n,r,i,o)=>{const s=n[e];if(!s||s.type!=="group")return{isIndeterminate:!1,isChecked:o[e]===e};if(o[e]===e)return{isIndeterminate:!1,isChecked:!0};let a=0,l=0;const c=r.findIndex(u=>u===e)+1;for(let u=c;us.depth;u+=1){const f=r[u];i[f]!==!1&&(a+=1,o[f]!==void 0&&(l+=1))}return{isIndeterminate:l>0&&(l0:o[e]===e}})}function Rle(e){return e.signature===Lf.DataGrid?e.checkboxSelection&&e.disableMultipleRowSelection!==!0:!e.disableMultipleRowSelection}const f$t=(e,t)=>{const n=[];let r=t;for(;r!=null&&r!==_a;){const i=e[r];if(!i)return n;n.push(r),r=i.parent}return n},d$t=(e,t,n)=>{const r=e[n];if(!r)return[];const i=r.parent;return i==null?[]:e[i].children.filter(s=>s!==n&&t[s]!==!1)},kk=(e,t,n,r,i,o,s=new Set(du(e.current.state)))=>{const a=RT(e),l=new Set([]);if(!(!r&&!i||a[n]===!1)&&(r&&t[n]?.type==="group"&&R6e(e,n).forEach(f=>{o(f),l.add(f)}),i)){const c=f=>{if(!s.has(f)&&!l.has(f))return!1;const d=t[f];return d?d.type!=="group"?!0:d.children.every(c):!1},u=f=>{const d=d$t(t,a,f);if(d.length===0||d.every(c)){const p=t[f]?.parent;p!=null&&p!==_a&&e.current.isRowSelectable(p)&&(o(p),l.add(p),u(p))}};u(n)}},_we=(e,t,n,r,i,o)=>{const s=E0(e);!i&&!r||(i&&f$t(t,n).forEach(l=>{s[l]===l&&o(l)}),r&&t[n]?.type==="group"&&R6e(e,n).forEach(c=>{o(c)}))},h$t=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],p$t=e=>{const{classes:t}=e;return Xe({root:["checkboxInput"]},pr,t)},g$t=Tr(function(t,n){const{field:r,id:i,rowNode:o,hasFocus:s,tabIndex:a}=t,l=st(t,h$t),c=Kn(),u=nn(),f={classes:u.classes},d=p$t(f),h=M.useRef(null),p=M.useRef(null),g=zn(h,n),m=T=>{const k={value:T.target.checked,id:i};c.current.publishEvent("rowSelectionCheckboxChange",k,T)};M.useLayoutEffect(()=>{if(a===0){const T=c.current.getCellElement(i,r);T&&(T.tabIndex=-1)}},[c,a,i,r]),M.useEffect(()=>{s?h.current?.querySelector("input")?.focus({preventScroll:!0}):p.current&&p.current.stop({})},[s]);const v=M.useCallback(T=>{T.key===" "&&T.stopPropagation()},[]),y=c.current.isRowSelectable(i),b=u$t(i,u.rowSelectionPropagation?.parents??!1),{isIndeterminate:w,isChecked:S}=ut(c,b,Sle);if(o.type==="footer"||o.type==="pinnedRow")return null;const _=u.indeterminateCheckboxAction==="select"?S&&!w:S,E=c.current.getLocaleText(_?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return O.jsx(u.slots.baseCheckbox,X({tabIndex:a,checked:_,onChange:m,className:d.root,inputProps:{"aria-label":E,name:"select_row"},onKeyDown:v,indeterminate:w,disabled:!y,touchRippleRef:p},u.slotProps?.baseCheckbox,l,{ref:g}))}),m$t=g$t,pU=e=>e.focus,pc=xn(pU,e=>e.cell),v$t=xn(pU,e=>e.columnHeader);xn(pU,e=>e.columnHeaderFilter);const q5=xn(pU,e=>e.columnGroupHeader),gU=e=>e.tabIndex,Ile=xn(gU,e=>e.cell),I6e=xn(gU,e=>e.columnHeader);xn(gU,e=>e.columnHeaderFilter);const y$t=xn(gU,e=>e.columnGroupHeader);function Gn(e,t,n){const r=M.useRef(!0);lr(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}function Ns(e,t){const n=M.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}const D6e=(e,t,n,r,i)=>{const o=Ns(e,"useNativeEventListener");ii(e,"rootMount",()=>{const s=typeof t=="function"?t():t.current;if(!(!s||!n||!r))return o.debug(`Binding native ${n} event`),s.addEventListener(n,r,i),()=>{o.debug(`Clearing native ${n} event`),s.removeEventListener(n,r,i)}})},xD=e=>{const t=M.useRef(!0);t.current&&(t.current=!1,e())},b$t=()=>{},x$t=(e,t)=>{const n=M.useRef(!1);lr(()=>n.current||!e?b$t:(n.current=!0,t()),[n.current||e])},w$t=100,S$t=e=>e?0:100,L6e=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):e===-1?n+2:0,F6e=e=>({page:0,pageSize:e?0:100}),_$t=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),$6e=(e,t)=>{if(t===Lf.DataGrid&&e>w$t)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` +`))},C$t=-1,wD=e=>e.pagination,N6e=xn(wD,e=>e.enabled&&e.paginationMode==="client"),tl=xn(wD,e=>e.paginationModel),MC=xn(wD,e=>e.rowCount),H2=xn(wD,e=>e.meta),O$t=xn(tl,e=>e.page),z6e=xn(tl,e=>e.pageSize),j6e=xn(tl,MC,(e,t)=>L6e(t,e.pageSize,e.page)),Dle=jr(N6e,tl,ps,lS,Ob,M6e,(e,t,n,r,i,o)=>{if(!e)return null;const s=o.length,a=Math.min(t.pageSize*t.page,s-1),l=t.pageSize===C$t?s-1:Math.min(a+t.pageSize-1,s-1);if(a===-1||l===-1)return null;if(r<2)return{firstRowIndex:a,lastRowIndex:l};const c=o[a],u=l-a+1,f=i.findIndex(p=>p.id===c.id);let d=f,h=0;for(;d0)&&(d+=1),g===0&&(h+=1))}return{firstRowIndex:f,lastRowIndex:d-1}}),E$t=jr(Ob,Dle,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),B6e=jr(iO,Dle,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),SD=jr(N6e,Dle,E$t,Ob,(e,t,n,r)=>e?{rows:n,range:t,rowToIndexMap:n.reduce((i,o,s)=>(i.set(o.model,s),i),new Map)}:{rows:r,range:r.length===0?null:{firstRowIndex:0,lastRowIndex:r.length-1},rowToIndexMap:r.reduce((i,o,s)=>(i.set(o.model,s),i),new Map)}),T$t=["field","colDef"],P$t=e=>{const{classes:t}=e;return Xe({root:["checkboxInput"]},pr,t)},k$t=Tr(function(t,n){const r=st(t,T$t),[,i]=M.useState(!1),o=Kn(),s=nn(),a={classes:s.classes},l=P$t(a),c=ut(o,I6e),u=ut(o,du),f=ut(o,iO),d=ut(o,B6e),h=M.useMemo(()=>typeof s.isRowSelectable!="function"?u:u.filter(T=>s.keepNonExistentRowsSelected?!0:o.current.getRow(T)?s.isRowSelectable(o.current.getRowParams(T)):!1),[o,s.isRowSelectable,u,s.keepNonExistentRowsSelected]),p=M.useMemo(()=>(!s.pagination||!s.checkboxSelectionVisibleOnly||s.paginationMode==="server"?f:d).reduce((k,P)=>(k[P]=!0,k),{}),[s.pagination,s.paginationMode,s.checkboxSelectionVisibleOnly,d,f]),g=M.useMemo(()=>h.filter(T=>p[T]).length,[h,p]),m=g>0&&g0,y=T=>{const k={value:T.target.checked};o.current.publishEvent("headerSelectionCheckboxChange",k)},b=c!==null&&c.field===t.field?0:-1;M.useLayoutEffect(()=>{const T=o.current.getColumnHeaderElement(t.field);b===0&&T&&(T.tabIndex=-1)},[b,o,t.field]);const w=M.useCallback(T=>{T.key===" "&&o.current.publishEvent("headerSelectionCheckboxChange",{value:!v})},[o,v]),S=M.useCallback(()=>{i(T=>!T)},[]);M.useEffect(()=>o.current.subscribeEvent("rowSelectionChange",S),[o,S]);const _=s.indeterminateCheckboxAction==="select"?v&&!m:v,E=o.current.getLocaleText(_?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return O.jsx(s.slots.baseCheckbox,X({indeterminate:m,checked:_,onChange:y,className:l.root,inputProps:{"aria-label":E,name:"select_all_rows"},tabIndex:b,onKeyDown:w,disabled:!Rle(s)},s.slotProps?.baseCheckbox,r,{ref:n}))}),_D=(e,t)=>VO in t?t[VO]:e.props.getRowId?e.props.getRowId(t):t.id,ff="__check__",IT=X({},E6e,{type:"custom",field:ff,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,display:"flex",valueGetter:(e,t,n,r)=>{const i=E0(r),o=_D(r.current.state,t);return i[o]!==void 0},renderHeader:e=>O.jsx(k$t,X({},e)),renderCell:e=>O.jsx(m$t,X({},e))}),M$t=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function Cwe(e,t){if(e==null)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":t==="date"?n.toISOString().substring(0,10):t==="datetime-local"?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function m_(e){const{item:t,applyValue:n,type:r,apiRef:i,focusElementRef:o,InputProps:s,clearButton:a,tabIndex:l,disabled:c}=e,u=st(e,M$t),f=zl(),[d,h]=M.useState(()=>Cwe(t.value,r)),[p,g]=M.useState(!1),m=fr(),v=nn(),y=M.useCallback(b=>{f.clear();const w=b.target.value;h(w),g(!0),f.start(v.filterDebounceMs,()=>{const S=new Date(w);n(X({},t,{value:Number.isNaN(S.getTime())?void 0:S})),g(!1)})},[n,t,v.filterDebounceMs,f]);return M.useEffect(()=>{const b=Cwe(t.value,r);h(b)},[t.value,r]),O.jsx(v.slots.baseTextField,X({fullWidth:!0,id:m,label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),value:d,onChange:y,variant:"standard",type:r||"text",InputLabelProps:{shrink:!0},inputRef:o,InputProps:X({},p||a?{endAdornment:p?O.jsx(v.slots.loadIcon,{fontSize:"small",color:"action"}):a}:{},{disabled:c},s,{inputProps:X({max:r==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:l},s?.inputProps)})},u,v.slotProps?.baseTextField))}function v_(e,t,n,r){if(!e.value)return null;const i=new Date(e.value);n?i.setSeconds(0,0):(i.setMinutes(i.getMinutes()+i.getTimezoneOffset()),i.setHours(0,0,0,0));const o=i.getTime();return s=>{if(!s)return!1;if(r)return t(s.getTime(),o);const a=new Date(s);return n?a.setSeconds(0,0):a.setHours(0,0,0,0),t(a.getTime(),o)}}const U6e=e=>[{value:"is",getApplyFilterFn:t=>v_(t,(n,r)=>n===r,e),InputComponent:m_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>v_(t,(n,r)=>n!==r,e),InputComponent:m_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>v_(t,(n,r)=>n>r,e),InputComponent:m_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>v_(t,(n,r)=>n>=r,e),InputComponent:m_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>v_(t,(n,r)=>nv_(t,(n,r)=>n<=r,e),InputComponent:m_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>t=>t!=null,requiresFilterValue:!1}],A$t=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],R$t=Oe(hT)({fontSize:"inherit"}),I$t=e=>{const{classes:t}=e;return Xe({root:["editInputCell"]},pr,t)};function D$t(e){const{id:t,value:n,field:r,colDef:i,hasFocus:o,inputProps:s,onValueChange:a}=e,l=st(e,A$t),c=i.type==="dateTime",u=Kn(),f=M.useRef(null),d=M.useMemo(()=>{let w;n==null?w=null:n instanceof Date?w=n:w=new Date((n??"").toString());let S;return w==null||Number.isNaN(w.getTime())?S="":S=new Date(w.getTime()-w.getTimezoneOffset()*60*1e3).toISOString().substr(0,c?16:10),{parsed:w,formatted:S}},[n,c]),[h,p]=M.useState(d),m={classes:nn().classes},v=I$t(m),y=M.useCallback(w=>{if(w==="")return null;const[S,_]=w.split("T"),[E,T,k]=S.split("-"),P=new Date;if(P.setFullYear(Number(E),Number(T)-1,Number(k)),P.setHours(0,0,0,0),_){const[I,R]=_.split(":");P.setHours(Number(I),Number(R),0,0)}return P},[]),b=M.useCallback(async w=>{const S=w.target.value,_=y(S);a&&await a(w,_),p({parsed:_,formatted:S}),u.current.setEditCellValue({id:t,field:r,value:_},w)},[u,r,t,a,y]);return M.useEffect(()=>{p(w=>d.parsed!==w.parsed&&d.parsed?.getTime()!==w.parsed?.getTime()?d:w)},[d]),lr(()=>{o&&f.current.focus()},[o]),O.jsx(R$t,X({inputRef:f,fullWidth:!0,className:v.root,type:c?"datetime-local":"date",inputProps:X({max:c?"9999-12-31T23:59":"9999-12-31"},s),value:h.formatted,onChange:b},l))}const V6e=e=>O.jsx(D$t,X({},e));function W6e({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join(` +`))}const L$t=(e,t,n,r)=>{if(!e)return"";const i=_D(r.current.state,t);return W6e({value:e,columnType:"date",rowId:i,field:n.field}),e.toLocaleDateString()},F$t=(e,t,n,r)=>{if(!e)return"";const i=_D(r.current.state,t);return W6e({value:e,columnType:"dateTime",rowId:i,field:n.field}),e.toLocaleString()},$$t=X({},ah,{type:"date",sortComparator:c6e,valueFormatter:L$t,filterOperators:U6e(),renderEditCell:V6e,pastedValueParser:e=>new Date(e)}),N$t=X({},ah,{type:"dateTime",sortComparator:c6e,valueFormatter:F$t,filterOperators:U6e(!0),renderEditCell:V6e,pastedValueParser:e=>new Date(e)}),Wy=e=>e==null?null:Number(e),z$t=e=>e==null||Number.isNaN(e)||e===""?null:t=>Wy(t)===Wy(e),j$t=()=>[{value:"=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>Wy(t)===e.value,InputComponent:gf,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>Wy(t)!==e.value,InputComponent:gf,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Wy(t)>e.value,InputComponent:gf,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Wy(t)>=e.value,InputComponent:gf,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Wy(t)e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Wy(t)<=e.value,InputComponent:gf,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:f6e,InputComponentProps:{type:"number"}}],B$t=X({},ah,{type:"number",align:"right",headerAlign:"right",sortComparator:l6e,valueParser:e=>e===""?null:Number(e),valueFormatter:e=>hFt(e)?e.toLocaleString():e||"",filterOperators:j$t(),getApplyQuickFilterFn:z$t});function HO(e){return e?.type==="singleSelect"}function rw(e,t){if(e)return typeof e.valueOptions=="function"?e.valueOptions(X({field:e.field},t)):e.valueOptions}function X5(e,t,n){if(t===void 0)return;const r=t.find(i=>{const o=n(i);return String(o)===String(e)});return n(r)}const U$t=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],V$t=["MenuProps"];function W$t(e){return!!e.key}function H$t(e){const t=nn(),{id:n,value:r,field:i,row:o,colDef:s,hasFocus:a,error:l,onValueChange:c,initialOpen:u=t.editMode===Jp.Cell}=e,f=st(e,U$t),d=Kn(),h=M.useRef(null),p=M.useRef(null),[g,m]=M.useState(u),y=(t.slotProps?.baseSelect||{}).native??!1,b=t.slotProps?.baseSelect||{},{MenuProps:w}=b,S=st(b,V$t);if(lr(()=>{a&&p.current?.focus()},[a]),!HO(s))return null;const _=rw(s,{id:n,row:o});if(!_)return null;const E=s.getOptionValue,T=s.getOptionLabel,k=async R=>{if(!HO(s)||!_)return;m(!1);const F=R.target,A=X5(F.value,_,E);c&&await c(R,A),await d.current.setEditCellValue({id:n,field:i,value:A},R)},P=(R,F)=>{if(t.editMode===Jp.Row){m(!1);return}if(F==="backdropClick"||R.key==="Escape"){const A=d.current.getCellParams(n,i);d.current.publishEvent("cellEditStop",X({},A,{reason:R.key==="Escape"?Ld.escapeKeyDown:Ld.cellFocusOut}))}},I=R=>{W$t(R)&&R.key==="Enter"||m(!0)};return!_||!s?null:O.jsx(t.slots.baseSelect,X({ref:h,inputRef:p,value:r,onChange:k,open:g,onOpen:I,MenuProps:X({onClose:P},w),error:l,native:y,fullWidth:!0},f,S,{children:_.map(R=>{const F=E(R);return M.createElement(t.slots.baseSelectOption,X({},t.slotProps?.baseSelectOption||{},{native:y,key:F,value:F}),T(R))})}))}const G$t=e=>O.jsx(H$t,X({},e)),q$t=["item","applyValue","type","apiRef","focusElementRef","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],X$t=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:r,isSelectNative:i,baseSelectOptionProps:o})=>["",...rw(e)||[]].map(a=>{const l=r(a);let c=n(a);return c===""&&(c=" "),M.createElement(t,X({},o,{native:i,key:l,value:l}),c)}),Y$t=Oe("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function Owe(e){const{item:t,applyValue:n,type:r,apiRef:i,focusElementRef:o,placeholder:s,tabIndex:a,label:l,variant:c="standard",clearButton:u}=e,f=st(e,q$t),d=t.value??"",h=fr(),p=fr(),g=nn(),m=g.slotProps?.baseSelect?.native??!1;let v=null;if(t.field){const E=i.current.getColumn(t.field);HO(E)&&(v=E)}const y=v?.getOptionValue,b=v?.getOptionLabel,w=M.useMemo(()=>rw(v),[v]),S=M.useCallback(E=>{let T=E.target.value;T=X5(T,w,y),n(X({},t,{value:T}))},[w,y,n,t]);if(!HO(v))return null;const _=l??i.current.getLocaleText("filterPanelInputLabel");return O.jsxs(Y$t,{children:[O.jsxs(g.slots.baseFormControl,{fullWidth:!0,children:[O.jsx(g.slots.baseInputLabel,X({},g.slotProps?.baseInputLabel,{id:p,htmlFor:h,shrink:!0,variant:c,children:_})),O.jsx(g.slots.baseSelect,X({id:h,label:_,labelId:p,value:d,onChange:S,variant:c,type:r||"text",inputProps:{tabIndex:a,ref:o,placeholder:s??i.current.getLocaleText("filterPanelInputPlaceholder")},native:m,notched:c==="outlined"?!0:void 0},f,g.slotProps?.baseSelect,{children:X$t({column:v,OptionComponent:g.slots.baseSelectOption,getOptionLabel:b,getOptionValue:y,isSelectNative:m,baseSelectOptionProps:g.slotProps?.baseSelectOption})}))]}),u]})}const Q$t=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],K$t=["key"],Z$t=Tze();function J$t(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:i,color:o,error:s,helperText:a,size:l,variant:c="standard"}=e,u=st(e,Q$t),f={color:o,error:s,helperText:a,size:l,variant:c},d=fr(),h=nn();let p=null;if(t.field){const S=r.current.getColumn(t.field);HO(S)&&(p=S)}const g=p?.getOptionValue,m=p?.getOptionLabel,v=M.useCallback((S,_)=>g(S)===g(_),[g]),y=M.useMemo(()=>rw(p)||[],[p]),b=M.useMemo(()=>Array.isArray(t.value)?t.value.reduce((S,_)=>{const E=y.find(T=>g(T)===_);return E!=null&&S.push(E),S},[]):[],[g,t.value,y]),w=M.useCallback((S,_)=>{n(X({},t,{value:_.map(g)}))},[n,t,g]);return O.jsx(zze,X({multiple:!0,options:y,isOptionEqualToValue:v,filterOptions:Z$t,id:d,value:b,onChange:w,getOptionLabel:m,renderTags:(S,_)=>S.map((E,T)=>{const k=_({index:T}),{key:P}=k,I=st(k,K$t);return O.jsx(h.slots.baseChip,X({variant:"outlined",size:"small",label:m(E)},I),P)}),renderInput:S=>O.jsx(h.slots.baseTextField,X({},S,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:X({},S.InputLabelProps,{shrink:!0}),inputRef:i,type:"singleSelect"},f,h.slotProps?.baseTextField))},u))}const y_=e=>e==null||!Ole(e)?e:e.value,eNt=()=>[{value:"is",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>y_(t)===y_(e.value),InputComponent:Owe},{value:"not",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>y_(t)!==y_(e.value),InputComponent:Owe},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(y_);return n=>t.includes(y_(n))},InputComponent:J$t}],tNt=e=>typeof e[0]=="object",nNt=e=>Ole(e)?e.value:e,rNt=e=>Ole(e)?e.label:String(e),iNt=X({},ah,{type:"singleSelect",getOptionLabel:rNt,getOptionValue:nNt,valueFormatter(e,t,n,r){const i=_D(r.current.state,t);if(!HO(n))return"";const o=rw(n,{id:i,row:t});if(e==null)return"";if(!o)return e;if(!tNt(o))return n.getOptionLabel(e);const s=o.find(a=>n.getOptionValue(a)===e);return s?n.getOptionLabel(s):""},renderEditCell:G$t,filterOperators:eNt(),pastedValueParser:(e,t,n)=>{const r=n,i=rw(r)||[],o=r.getOptionValue;if(i.find(a=>o(a)===e))return e}}),oNt="string",sNt=()=>({string:ah,number:B$t,date:$$t,dateTime:N$t,boolean:E6e,singleSelect:iNt,[uU]:NFt,custom:ah}),Lle=e=>e.headerFiltering,aNt=xn(Lle,e=>e?.enabled??!1),lNt=xn(Lle,e=>e.editing),cNt=xn(Lle,e=>e.menuOpen),mU=e=>e.columnGrouping,H6e=jr(mU,e=>e?.unwrappedGroupingModel??{}),G6e=jr(mU,e=>e?.lookup??{}),uNt=jr(mU,e=>e?.headerStructure??[]),CD=xn(mU,e=>e?.maxDepth??0),q6e=["maxWidth","minWidth","width","flex"],k9=sNt();function fNt({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(s=>s.field)),i={all:{},frozenFields:[],freeze:s=>{const a=i.all[s];a&&a.frozen!==!0&&(i.all[s].frozen=!0,i.frozenFields.push(s))}};function o(){if(i.frozenFields.length===r.size)return;const s={min:{},max:{}};let a=e,l=t,c=0;i.frozenFields.forEach(u=>{a-=i.all[u].computedWidth,l-=i.all[u].flex});for(let u=0;uf.maxWidth&&(c+=f.maxWidth-h,h=f.maxWidth,s.max[f.field]=!0),i.all[f.field]={frozen:!1,computedWidth:h,flex:f.flex}}c<0?Object.keys(s.max).forEach(u=>{i.freeze(u)}):c>0?Object.keys(s.min).forEach(u=>{i.freeze(u)}):n.forEach(({field:u})=>{i.freeze(u)}),o()}return o(),i.all}const tte=(e,t)=>{const n={};let r=0,i=0;const o=[];e.orderedFields.forEach(l=>{let c=e.lookup[l],u=0,f=!1;e.columnVisibilityModel[l]!==!1&&(c.flex&&c.flex>0?(r+=c.flex,f=!0):u=Mu(c.width||ah.width,c.minWidth||ah.minWidth,c.maxWidth||ah.maxWidth),i+=u),c.computedWidth!==u&&(c=X({},c,{computedWidth:u})),f&&o.push(c),n[l]=c});const s=t===void 0?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),a=Math.max(s-i,0);if(r>0&&s>0){const l=fNt({initialFreeSpace:a,totalFlexUnits:r,flexColumns:o});Object.keys(l).forEach(c=>{n[c].computedWidth=l[c].computedWidth})}return X({},e,{lookup:n})},dNt=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,i=Object.keys(r);if(i.length===0&&n.length===0)return e;const o={},s=[];for(let u=0;u!o[u])],l=X({},e.lookup);for(let u=0;u{d[h]=p===-1?1/0:p}),l[f]=d}return X({},e,{orderedFields:a,lookup:l})};function Ewe(e){let t=k9[oNt];return e&&k9[e]&&(t=k9[e]),t}const gC=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=Cf(e),keepOnlyColumnsToUpsert:i=!1})=>{const o=!e.current.state.columns;let s;if(o)s={orderedFields:[],lookup:{},columnVisibilityModel:r};else{const u=Bp(e.current.state);s={orderedFields:i?[]:[...u.orderedFields],lookup:X({},u.lookup),columnVisibilityModel:r}}let a={};i&&!o&&(a=Object.keys(s.lookup).reduce((u,f)=>X({},u,{[f]:!1}),{})),t.forEach(u=>{const{field:f}=u;a[f]=!0;let d=s.lookup[f];d==null?(d=X({},Ewe(u.type),{field:f,hasBeenResized:!1}),s.orderedFields.push(f)):i&&s.orderedFields.push(f),d&&d.type!==u.type&&(d=X({},Ewe(u.type),{field:f}));let h=d.hasBeenResized;q6e.forEach(p=>{u[p]!==void 0&&(h=!0,u[p]===-1&&(u[p]=1/0))}),s.lookup[f]=X1(d,X({},u,{hasBeenResized:h}))}),i&&!o&&Object.keys(s.lookup).forEach(u=>{a[u]||delete s.lookup[u]});const l=e.current.unstable_applyPipeProcessors("hydrateColumns",s),c=dNt(l,n);return tte(c,e.current.getRootDimensions?.()??void 0)};function hNt({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:r,visibleRows:i}){let o=e,s=!1;for(;!s;){s=!0;for(let a=n;ae.rowsMeta,Y5=1,X6e=1.5,pNt=e=>{const{scrollDirection:t,classes:n}=e,r={root:["scrollArea",`scrollArea--${t}`]};return Xe(r,pr,n)},gNt=Qn("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${ye["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${ye["scrollArea--right"]}`]:t["scrollArea--right"]},{[`&.${ye["scrollArea--up"]}`]:t["scrollArea--up"]},{[`&.${ye["scrollArea--down"]}`]:t["scrollArea--down"]},t.scrollArea]})(()=>({position:"absolute",zIndex:101,[`&.${ye["scrollArea--left"]}`]:{top:0,left:0,width:20,bottom:0},[`&.${ye["scrollArea--right"]}`]:{top:0,right:0,width:20,bottom:0},[`&.${ye["scrollArea--up"]}`]:{top:0,left:0,right:0,height:20},[`&.${ye["scrollArea--down"]}`]:{bottom:0,left:0,right:0,height:20}})),mNt=yD(Is,(e,t)=>t==="left"?e.leftPinnedWidth:t==="right"?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function vNt(e){const t=Kn(),[n,r]=M.useState("none");return Ft(t,"columnHeaderDragStart",()=>r("horizontal")),Ft(t,"columnHeaderDragEnd",()=>r("none")),Ft(t,"rowDragStart",()=>r("vertical")),Ft(t,"rowDragEnd",()=>r("none")),n==="none"?null:n==="horizontal"?O.jsx(yNt,X({},e)):O.jsx(bNt,X({},e))}function yNt(e){const{scrollDirection:t,scrollPosition:n}=e,r=M.useRef(null),i=Kn(),o=zl(),s=ut(i,TT),a=ut(i,cU),l=BA(i,mNt,t),c=()=>{const g=Is(i.current.state);if(t==="left")return n.current.left>0;if(t==="right"){const m=a-g.viewportInnerSize.width;return n.current.left{let m;if(g.preventDefault(),t==="left")m=g.clientX-r.current.getBoundingClientRect().right;else if(t==="right")m=Math.max(1,g.clientX-r.current.getBoundingClientRect().left);else throw new Error("MUI X: Wrong drag direction");m=(m-Y5)*X6e+Y5,o.start(0,()=>{i.current.scroll({left:n.current.left+m,top:n.current.top})})});return O.jsx(Y6e,X({},e,{ref:r,getCanScrollMore:c,style:h,handleDragOver:p}))}function bNt(e){const{scrollDirection:t,scrollPosition:n}=e,r=M.useRef(null),i=Kn(),o=zl(),s=ut(i,DT),a=()=>{const d=Is(i.current.state);if(t==="up")return n.current.top>0;if(t==="down"){const p=(s.currentPageTotalHeight||0)-d.viewportInnerSize.height-d.scrollbarSize;return n.current.top{let h;if(d.preventDefault(),t==="up")h=d.clientY-r.current.getBoundingClientRect().bottom;else if(t==="down")h=Math.max(1,d.clientY-r.current.getBoundingClientRect().top);else throw new Error("MUI X: Wrong drag direction");h=(h-Y5)*X6e+Y5,o.start(0,()=>{i.current.scroll({left:n.current.left,top:n.current.top+h})})});return O.jsx(Y6e,X({},e,{ref:r,getCanScrollMore:a,style:u,handleDragOver:f}))}const Y6e=Tr(function(t,n){const{scrollDirection:r,getCanScrollMore:i,style:o,handleDragOver:s}=t,a=Kn(),[l,c]=M.useState(i),u=nn(),f=X({},u,{scrollDirection:r}),d=pNt(f);return Ft(a,"scrollPositionChange",()=>{c(i)}),l?O.jsx(gNt,{ref:n,className:d.root,ownerState:f,onDragOver:s,style:o}):null}),N$=Cv(vNt);var Mk={},M9={exports:{}},A9={exports:{}},Twe;function xNt(){return Twe||(Twe=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(A9)),A9.exports}var Pwe;function wNt(){return Pwe||(Pwe=1,(function(e){var t=xNt().default;function n(r,i){if(typeof WeakMap=="function")var o=new WeakMap,s=new WeakMap;return(e.exports=n=function(l,c){if(!c&&l&&l.__esModule)return l;var u,f,d={__proto__:null,default:l};if(l===null||t(l)!="object"&&typeof l!="function")return d;if(u=c?s:o){if(u.has(l))return u.get(l);u.set(l,d)}for(var h in l)h!=="default"&&{}.hasOwnProperty.call(l,h)&&((f=(u=Object.defineProperty)&&Object.getOwnPropertyDescriptor(l,h))&&(f.get||f.set)?u(d,h,f):d[h]=l[h]);return d},e.exports.__esModule=!0,e.exports.default=e.exports)(r,i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(M9)),M9.exports}var kwe;function SNt(){if(kwe)return Mk;kwe=1;var e=wNt().default;Object.defineProperty(Mk,"__esModule",{value:!0}),Mk.default=void 0;var t=e(fg());return Mk.default=parseInt(t.version,10),Mk}var _Nt=SNt();const CNt=Yn(_Nt),Q6e=M.createContext(void 0);function ld(){const e=M.useContext(Q6e);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` +`));return e}const T0=(e,t)=>SD(e),Fle=(e,t)=>ut(e,SD),ONt=typeof navigator<"u"?navigator.userAgent.toLowerCase():"empty",ENt=ONt.includes("firefox"),yU=e=>e.virtualization;xn(yU,e=>e.enabled);const K6e=xn(yU,e=>e.enabledForColumns),TNt=xn(yU,e=>e.enabledForRows),OD=xn(yU,e=>e.renderContext),PNt=jr(e=>e.virtualization.renderContext.firstColumnIndex,e=>e.virtualization.renderContext.lastColumnIndex,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t})),nte={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},kNt=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return X({},e,{virtualization:{enabled:!n,enabledForColumns:!n,enabledForRows:!n&&!r,renderContext:nte}})};function MNt(e,t){const n=o=>{e.current.setState(s=>X({},s,{virtualization:X({},s.virtualization,{enabled:o,enabledForColumns:o,enabledForRows:o&&!t.autoHeight})}))};Gn(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:o=>{e.current.setState(s=>X({},s,{virtualization:X({},s.virtualization,{enabledForColumns:o})}))}},"public"),M.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization,t.autoHeight])}const $le=e=>e.rowSpanning,Z6e=xn($le,e=>e.hiddenCells),ANt=xn($le,e=>e.spannedCells),RNt=xn($le,e=>e.hiddenCellOriginMap),GO=e=>e.listViewColumn,INt=Z4e(pc,OD,SD,Mo,_f,(e,t,n,r,i)=>{if(!e)return!1;const o=i[e.id];if(!o)return!1;const s=n.rowToIndexMap.get(o),a=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(c=>c.field===e.field);return!(s!==void 0&&a!==-1&&s>=t.firstRowIndex&&s<=t.lastRowIndex)}),J6e=jr(INt,Mo,SD,_f,pc,(e,t,n,r,i)=>{if(!e)return null;const o=r[i.id];if(!o)return null;const s=n.rowToIndexMap.get(o);if(s===void 0)return null;const a=t.findIndex(l=>l.field===i.field);return a===-1?null:X({},i,{rowIndex:s,columnIndex:a})});function AC(e,t){return Math.round(e*10**t)/10**t}const Q5=typeof window<"u"&&/jsdom|HappyDOM/.test(window.navigator.userAgent),R9=50;var Zo=(function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e})(Zo||{});const Mwe={top:0,left:0},DNt=Object.freeze(new Map),LNt=(e,t,n,r,i)=>({direction:Zo.NONE,buffer:tUe(e,Zo.NONE,t,n,r,i)}),FNt=()=>{const e=ld(),t=nn(),{unstable_listView:n}=t,r=ut(e,()=>n?[GO(e.current.state)]:Mo(e)),i=ut(e,TNt)&&!Q5,o=ut(e,K6e)&&!Q5,s=ut(e,PT),a=MT(e),l=n?G5:a,c=s.bottom.length>0,[u,f]=M.useState(DNt),d=yi(),h=ut(e,E0),p=Fle(e),g=e.current.mainElementRef,m=e.current.virtualScrollerRef,v=e.current.virtualScrollbarVerticalRef,y=e.current.virtualScrollbarHorizontalRef,b=ut(e,wFt),w=M.useRef(!1),S=ut(e,_le),_=ut(e,DLt),E=ut(e,cU),T=ut(e,$Nt),k=ut(e,o6e),P=ut(e,i6e),I=M.useRef(null),R=M.useCallback(se=>{if(g.current=se,!se)return;const ue=se.getBoundingClientRect();let G={width:AC(ue.width,1),height:AC(ue.height,1)};if((!I.current||G.width!==I.current.width&&G.height!==I.current.height)&&(I.current=G,e.current.publishEvent("resize",G)),typeof ResizeObserver>"u")return;const ce=new ResizeObserver(pe=>{const J=pe[0];if(!J)return;const te={width:AC(J.contentRect.width,1),height:AC(J.contentRect.height,1)};te.width===G.width&&te.height===G.height||(e.current.publishEvent("resize",te),G=te)});if(ce.observe(se),CNt>=19)return()=>{g.current=null,ce.disconnect()}},[e,g]),F=M.useRef(t.initialState?.scroll??Mwe),A=M.useRef(!1),L=M.useRef(Mwe),$=M.useRef(nte),j=ut(e,OD),V=ut(e,J6e),U=zl(),z=M.useRef(void 0),N=od(()=>LNt(d,t.rowBufferPx,t.columnBufferPx,S*15,R9*6)).current,B=M.useCallback(se=>{if(Dwe(se,e.current.state.virtualization.renderContext))return;const ue=se.firstRowIndex!==$.current.firstRowIndex||se.lastRowIndex!==$.current.lastRowIndex;e.current.setState(ce=>X({},ce,{virtualization:X({},ce.virtualization,{renderContext:se})})),Is(e.current.state).isReady&&ue&&($.current=se,e.current.publishEvent("renderedRowsIntervalChange",se)),L.current=F.current},[e]),H=ft(()=>{const se=m.current;if(!se)return;const ue=Is(e.current.state),G=Math.ceil(ue.minimumSize.height-ue.viewportOuterSize.height),ce=Math.ceil(ue.minimumSize.width-ue.viewportInnerSize.width),pe={top:Mu(se.scrollTop,0,G),left:d?Mu(se.scrollLeft,-ce,0):Mu(se.scrollLeft,0,ce)},J=pe.left-F.current.left,te=pe.top-F.current.top,ae=J!==0||te!==0;F.current=pe;const we=ae?jNt(J,te):Zo.NONE,Pe=Math.abs(F.current.top-L.current.top),ee=Math.abs(F.current.left-L.current.left),re=Pe>=S||ee>=R9,Se=N.direction!==we;if(!(re||Se))return j;if(Se)switch(we){case Zo.NONE:case Zo.LEFT:case Zo.RIGHT:z.current=void 0;break;default:z.current=j;break}N.direction=we,N.buffer=tUe(d,we,t.rowBufferPx,t.columnBufferPx,S*15,R9*6);const xe=Awe(e,t,i,o),me=Rwe(xe,F.current,N);return Dwe(me,j)||(p6.flushSync(()=>{B(me)}),U.start(1e3,H)),me}),Q=()=>{if(!Is(e.current.state).isReady&&(i||o))return;const se=Awe(e,t,i,o),ue=Rwe(se,F.current,N);z.current=void 0,B(ue)},Y=ft(()=>{if(A.current){A.current=!1;return}const se=H();e.current.publishEvent("scrollPositionChange",{top:F.current.top,left:F.current.left,renderContext:se})}),Z=ft(se=>{e.current.publishEvent("virtualScrollerWheel",{},se)}),ge=ft(se=>{e.current.publishEvent("virtualScrollerTouchMove",{},se)}),ne=(se={})=>{if(!se.rows&&!p.range)return[];const ue=ps(e);let G=j;se.renderContext&&(G=se.renderContext,G.firstColumnIndex=j.firstColumnIndex,G.lastColumnIndex=j.lastColumnIndex);const ce=!c&&se.position===void 0||c&&se.position==="bottom",pe=se.position!==void 0;let J;switch(se.position){case"top":J=0;break;case"bottom":J=s.top.length+p.rows.length;break;case void 0:J=s.top.length;break}const te=se.rows??p.rows,ae=G.firstRowIndex,we=Math.min(G.lastRowIndex,te.length),Pe=se.rows?pwe(0,se.rows.length):pwe(ae,we);let ee=-1;!pe&&V&&(V.rowIndexwe&&(Pe.push(V.rowIndex),ee=V.rowIndex));const re=[],Se=t.slotProps?.row,he=Cb(e);return Pe.forEach(xe=>{const{id:me,model:be}=te[xe];if(!ue[me])return;const oe=(p?.range?.firstRowIndex||0)+J+xe;if(b){const on=l.left.length,Ln=r.length-l.right.length;e.current.calculateColSpan({rowId:me,minFirstColumn:on,maxLastColumn:Ln,columns:r}),l.left.length>0&&e.current.calculateColSpan({rowId:me,minFirstColumn:0,maxLastColumn:l.left.length,columns:r}),l.right.length>0&&e.current.calculateColSpan({rowId:me,minFirstColumn:r.length-l.right.length,maxLastColumn:r.length,columns:r})}const Ee=e.current.rowHasAutoHeight(me)?"auto":e.current.unstable_getRowHeight(me);let ke;h[me]==null?ke=!1:ke=e.current.isRowSelectable(me);let ze=!1;se.position===void 0&&(ze=xe===0);let De=!1;const Ve=xe===te.length-1;if(ce)if(pe)De=Ve;else{const on=p.rows.length-1;xe===on&&(De=!0)}let Ze=G;z.current&&xe>=z.current.firstRowIndex&&xe({overflowX:!T||n?"hidden":void 0,overflowY:t.autoHeight?"hidden":void 0}),[T,t.autoHeight,n]),fe=M.useMemo(()=>{const se={width:T?E:"auto",flexBasis:_,flexShrink:0};return se.flexBasis===0&&(se.flexBasis=_6e),se},[E,_,T]),ve=M.useCallback(se=>{se&&e.current.publishEvent("virtualScrollerContentSizeChange",{columnsTotalWidth:E,contentHeight:_})},[e,E,_]);return lr(()=>{w.current&&e.current.updateRenderContext?.()},[e,o,i]),lr(()=>{n&&(m.current.scrollLeft=0)},[n,m]),x$t(j!==nte,()=>{if(e.current.publishEvent("scrollPositionChange",{top:F.current.top,left:F.current.left,renderContext:j}),w.current=!0,t.initialState?.scroll&&m.current){const se=m.current,{top:ue,left:G}=t.initialState.scroll,ce={top:!(ue>0),left:!(G>0)};if(!ce.left&&E&&(se.scrollLeft=G,A.current=!0,ce.left=!0),!ce.top&&_&&(se.scrollTop=ue,A.current=!0,ce.top=!0),!ce.top||!ce.left){const pe=e.current.subscribeEvent("virtualScrollerContentSizeChange",J=>{!ce.left&&J.columnsTotalWidth&&(se.scrollLeft=G,A.current=!0,ce.left=!0),!ce.top&&J.contentHeight&&(se.scrollTop=ue,A.current=!0,ce.top=!0),ce.left&&ce.top&&pe()});return pe}}}),e.current.register("private",{updateRenderContext:Q}),ii(e,"sortedRowsSet",Q),ii(e,"paginationModelChange",Q),ii(e,"columnsChange",Q),{renderContext:j,setPanels:f,getRows:ne,getContainerProps:()=>({ref:R}),getScrollerProps:()=>({ref:m,onScroll:Y,onWheel:Z,onTouchMove:ge,style:ie,role:"presentation",tabIndex:ENt?-1:void 0}),getContentProps:()=>({style:fe,role:"presentation",ref:ve}),getRenderZoneProps:()=>({role:"rowgroup"}),getScrollbarVerticalProps:()=>({ref:v,scrollPosition:F}),getScrollbarHorizontalProps:()=>({ref:y,scrollPosition:F}),getScrollAreaProps:()=>({scrollPosition:F})}};function $Nt(e){return e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width}function Awe(e,t,n,r){const i=Is(e.current.state),o=T0(e),s=t.unstable_listView?[GO(e.current.state)]:Mo(e),a=RNt(e),l=e.current.state.rows.dataRowIds.at(-1),c=s.at(-1);return{enabledForRows:n,enabledForColumns:r,apiRef:e,autoHeight:t.autoHeight,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx,leftPinnedWidth:i.leftPinnedWidth,columnsTotalWidth:i.columnsTotalWidth,viewportInnerWidth:i.viewportInnerSize.width,viewportInnerHeight:i.viewportInnerSize.height,lastRowHeight:l!==void 0?e.current.unstable_getRowHeight(l):0,lastColumnWidth:c?.computedWidth??0,rowsMeta:DT(e.current.state),columnPositions:Cb(e),rows:o.rows,range:o.range,pinnedColumns:MT(e),visibleColumns:s,hiddenCellsOriginMap:a,listView:t.unstable_listView??!1,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function Rwe(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.visibleColumns.length},{top:i,left:o}=t,s=Math.abs(o)+e.leftPinnedWidth;if(e.enabledForRows){let l=Math.min(Iwe(e,i,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const c=e.hiddenCellsOriginMap[l];if(c){const f=Math.min(...Object.values(c));l=Math.min(l,f)}const u=e.autoHeight?l+e.rows.length:Iwe(e,i+e.viewportInnerHeight);r.firstRowIndex=l,r.lastRowIndex=u}if(e.listView)return X({},r,{lastColumnIndex:1});if(e.enabledForColumns){let l=0,c=e.columnPositions.length,u=!1;const[f,d]=rte({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let h=f;h=e.range.lastRowIndex);const o=Mu(r-(e.range?.firstRowIndex||0),0,e.rowsMeta.positions.length);return i||e.rowsMeta.positions[o]>=t?W0(t,e.rowsMeta.positions,n):zNt(t,e.rowsMeta.positions,o,n)}function NNt(e,t,n){const[r,i]=rte({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[o,s]=rte({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns.left.length,maxLastIndex:e.visibleColumns.length-e.pinnedColumns.right.length,bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),a=hNt({firstColumnToRender:o,apiRef:e.apiRef,firstRowToRender:r,lastRowToRender:i,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:i,firstColumnIndex:a,lastColumnIndex:s}}function W0(e,t,n=void 0,r=0,i=t.length){if(t.length<=0)return-1;if(r>=i)return r;const o=r+Math.floor((i-r)/2),s=t[o];let a;if(n?.atStart){const l=(o===t.length-1?n.lastPosition:t[o+1])-s;a=e-l=Math.abs(e)?t>0?Zo.DOWN:Zo.UP:e>0?Zo.RIGHT:Zo.LEFT}function tUe(e,t,n,r,i,o){if(e)switch(t){case Zo.LEFT:t=Zo.RIGHT;break;case Zo.RIGHT:t=Zo.LEFT;break}switch(t){case Zo.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case Zo.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:o};case Zo.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:o,columnBefore:0};case Zo.UP:return{rowAfter:0,rowBefore:i,columnAfter:0,columnBefore:0};case Zo.DOWN:return{rowAfter:i,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}const BNt=()=>{const e=Kn(),t=nn(),n=ut(e,bD),r=ut(e,Mle),i=ut(e,s6e),o=n===0&&i===0,s=ut(e,tFt),a=!s&&o,l=!s&&n>0&&r===0;let c=null,u=null;return a&&(c="noRowsOverlay"),l&&(c="noResultsOverlay"),s&&(c="loadingOverlay",u=t.slotProps?.loadingOverlay?.[o?"noRowsVariant":"variant"]||null),{overlayType:c,loadingOverlayVariant:u}},UNt=Qn("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e,loadingOverlayVariant:t})=>t!=="skeleton"?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,width:0,height:0,zIndex:e==="loadingOverlay"?5:4}:{}),VNt=Qn("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),WNt=e=>{const{classes:t}=e;return Xe({root:["overlayWrapper"],inner:["overlayWrapperInner"]},pr,t)};function HNt(e){const t=Kn(),n=nn(),r=ut(t,Is);let i=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);i===0&&(i=_6e);const o=WNt(X({},e,{classes:n.classes}));return O.jsx(UNt,X({className:Re(o.root)},e,{children:O.jsx(VNt,X({className:Re(o.inner),style:{height:i,width:r.viewportOuterSize.width}},e))}))}function GNt(e){const{overlayType:t}=e,n=nn();if(!t)return null;const r=n.slots?.[t],i=n.slotProps?.[t];return O.jsx(HNt,X({},e,{children:O.jsx(r,X({},i))}))}const gz=e=>e.columnMenu;function qNt(){const e=ld(),t=nn(),n=ut(e,Mo),r=ut(e,a$t),i=ut(e,r$t),o=ut(e,I6e),s=ut(e,()=>Ile(e)===null),a=ut(e,y$t),l=ut(e,v$t),c=ut(e,q5),u=ut(e,CD),f=ut(e,gz),d=ut(e,Cf),h=ut(e,uNt),p=!(a===null&&o===null&&s),g=e.current.columnHeadersContainerRef;return O.jsx(t.slots.columnHeaders,X({ref:g,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:i,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:d,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:p},t.slotProps?.columnHeaders))}const XNt=Cv(qNt),nUe=M.createContext(void 0),Nle=()=>{const e=M.useContext(nUe);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` +`));return e},YNt=Qn("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),QNt=Qn("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],n.loadingOverlayVariant==="skeleton"&&t["main--hasSkeletonLoadingOverlay"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),KNt=Tr((e,t)=>{const{ownerState:n}=e,r=nn(),o=Nle().hooks.useGridAriaAttributes();return O.jsxs(QNt,X({ownerState:n,className:e.className,tabIndex:-1},o,r.slotProps?.main,{ref:t,children:[O.jsx(YNt,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),ZNt=()=>Xe({root:["topContainer"]},pr,{}),JNt=Qn("div")({position:"sticky",zIndex:40,top:0});function e3t(e){const t=ZNt();return O.jsx(JNt,X({},e,{className:Re(t.root,ye["container--top"]),role:"presentation"}))}const t3t=()=>Xe({root:["bottomContainer"]},pr,{}),n3t=Qn("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function r3t(e){const t=t3t();return O.jsx(n3t,X({},e,{className:Re(t.root,ye["container--bottom"]),role:"presentation"}))}const i3t=(e,t)=>{const{classes:n}=e;return Xe({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},pr,n)},o3t=Qn("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),s3t=Tr(function(t,n){const r=nn(),i=!r.autoHeight&&t.style?.minHeight==="auto",o=i3t(r,i),s={classes:r.classes,overflowedContent:i};return O.jsx(o3t,X({},t,{ownerState:s,className:Re(o.root,t.className),ref:n}))}),a3t=Qn("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),rUe=Qn("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:"var(--DataGrid-pinnedBackground)"}),l3t=Qn(rUe)({left:0,borderRight:"1px solid var(--rowBorderColor)"}),c3t=Qn(rUe)({right:0,borderLeft:"1px solid var(--rowBorderColor)"}),u3t=Qn("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});function f3t({rowsLength:e}){const t=Kn(),{viewportOuterSize:n,minimumSize:r,hasScrollX:i,hasScrollY:o,scrollbarSize:s,leftPinnedWidth:a,rightPinnedWidth:l}=ut(t,Is),c=i?s:0,u=n.height-r.height>0;return c===0&&!u?null:O.jsxs(a3t,{className:ye.filler,role:"presentation",style:{height:c,"--rowBorderColor":e===0?"transparent":"var(--DataGrid-rowBorderColor)"},children:[a>0&&O.jsx(l3t,{className:ye["filler--pinnedLeft"],style:{width:a}}),O.jsx(u3t,{}),l>0&&O.jsx(c3t,{className:ye["filler--pinnedRight"],style:{width:l+(o?s:0)}})]})}const d3t=Cv(f3t),h3t=["className"],p3t=e=>{const{classes:t}=e;return Xe({root:["virtualScrollerRenderZone"]},pr,t)},g3t=Qn("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),m3t=Tr(function(t,n){const{className:r}=t,i=st(t,h3t),o=Kn(),s=nn(),a=p3t(s),l=ut(o,()=>{const c=OD(o);return DT(o.current.state).positions[c.firstRowIndex]??0});return O.jsx(g3t,X({className:Re(a.root,r),ownerState:s,style:{transform:`translate3d(0, ${l}px, 0)`}},i,{ref:n}))}),v3t={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},Ps=e=>e.editRows,iUe=yD(Ps,(e,{rowId:t,editMode:n})=>n===Jp.Row&&!!e[t]),y3t=yD(Ps,(e,{rowId:t,field:n})=>e[t]?.[n]??null),WA=e=>e.preferencePanel,b3t=yD(WA,(e,t)=>!!(e.open&&e.labelId===t));var iw=(function(e){return e.filters="filters",e.columns="columns",e})(iw||{});const x3t=(e,t)=>{const{classes:n}=e,r={root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]};return Xe(r,pr,n)},oUe=Qn("div")({position:"absolute",display:"inline-block",zIndex:60,"&:hover":{zIndex:70},"--size":"calc(max(var(--DataGrid-scrollbarSize), 14px))"}),w3t=Qn(oUe)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-topContainerHeight) - var(--DataGrid-bottomContainerHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-topContainerHeight)",right:"0px"}),S3t=Qn(oUe)({width:"100%",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:"0px"}),Lwe=Tr(function(t,n){const r=ld(),i=nn(),o=M.useRef(!1),s=M.useRef(0),a=M.useRef(null),l=M.useRef(null),c=x3t(i,t.position),u=ut(r,Is),f=t.position==="vertical"?"height":"width",d=t.position==="vertical"?"scrollTop":"scrollLeft",h=t.position==="vertical"?"top":"left",p=t.position==="vertical"?u.hasScrollX:u.hasScrollY,g=u.minimumSize[f]+(p?u.scrollbarSize:0),v=(t.position==="vertical"?u.viewportInnerSize.height:u.viewportOuterSize.width)*(g/u.viewportOuterSize[f]),y=ft(()=>{const S=a.current,_=t.scrollPosition.current;if(!S||_[h]===s.current)return;if(s.current=_[h],o.current){o.current=!1;return}o.current=!0;const E=_[h]/g;S[d]=E*v}),b=ft(()=>{const S=r.current.virtualScrollerRef.current,_=a.current;if(!_)return;if(o.current){o.current=!1;return}o.current=!0;const E=_[d]/v;S[d]=E*g});Ise(()=>{const S=r.current.virtualScrollerRef.current,_=a.current,E={passive:!0};return S.addEventListener("scroll",y,E),_.addEventListener("scroll",b,E),()=>{S.removeEventListener("scroll",y,E),_.removeEventListener("scroll",b,E)}}),M.useEffect(()=>{l.current.style.setProperty(f,`${v}px`)},[v,f]);const w=t.position==="vertical"?w3t:S3t;return O.jsx(w,{ref:zn(n,a),className:c.root,style:t.position==="vertical"&&i.unstable_listView?{height:"100%",top:0}:void 0,tabIndex:-1,"aria-hidden":"true",onFocus:S=>{S.target.blur()},children:O.jsx("div",{ref:l,className:c.content})})}),_3t=e=>{const{classes:t,hasScrollX:n,hasPinnedRight:r,loadingOverlayVariant:i}=e;return Xe({root:["main",r&&"main--hasPinnedRight",i==="skeleton"&&"main--hasSkeletonLoadingOverlay"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},pr,t)},C3t=Qn("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),O3t=e=>e.dimensions.rightPinnedWidth>0;function E3t(e){const t=Kn(),n=nn(),r=ut(t,FLt),i=ut(t,LLt),o=ut(t,O3t),s=ut(t,zLt),a=BNt(),l={classes:n.classes,hasScrollX:i,hasPinnedRight:o,loadingOverlayVariant:a.loadingOverlayVariant},c=_3t(l),u=FNt(),{getContainerProps:f,getScrollerProps:d,getContentProps:h,getRenderZoneProps:p,getScrollbarVerticalProps:g,getScrollbarHorizontalProps:m,getRows:v,getScrollAreaProps:y}=u,b=v();return O.jsxs(KNt,X({className:c.root},f(),{ownerState:l,children:[O.jsx(N$,X({scrollDirection:"left"},y())),O.jsx(N$,X({scrollDirection:"right"},y())),O.jsx(N$,X({scrollDirection:"up"},y())),O.jsx(N$,X({scrollDirection:"down"},y())),O.jsxs(C3t,X({className:c.scroller},d(),{ownerState:l,children:[O.jsxs(e3t,{children:[!n.unstable_listView&&O.jsx(XNt,{}),O.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:u})]}),O.jsx(GNt,X({},a)),O.jsx(s3t,X({},h(),{children:O.jsxs(m3t,X({},p(),{children:[b,O.jsx(n.slots.detailPanels,{virtualScroller:u})]}))})),s&&O.jsx(d3t,{rowsLength:b.length}),O.jsx(r3t,{children:O.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:u})})]})),i&&!n.unstable_listView&&O.jsx(Lwe,X({position:"horizontal"},m())),r&&O.jsx(Lwe,X({position:"vertical"},g())),e.children]}))}function T3t(){const e=nn();return e.hideFooter?null:O.jsx(e.slots.footer,X({},e.slotProps?.footer))}let I9;function zle(){return I9===void 0&&document.createElement("div").focus({get preventScroll(){return I9=!0,!1}}),I9}function P3t({defaultSlots:e,slots:t}){const n=t;if(!n||Object.keys(n).length===0)return e;const r=X({},e);return Object.keys(n).forEach(i=>{const o=i;n[o]!==void 0&&(r[o]=n[o])}),r}function k3t(e){if(e.slotProps?.root)return e;const t=Object.keys(e);if(!t.some(i=>i.startsWith("aria-")||i.startsWith("data-")))return e;const n={},r=e.forwardedProps??{};for(let i=0;ik3t(e),[e])}const A3t=e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null},R3t=e=>e===O6e||A3t(e)!==null,sUe=(e,t)=>{if(e)if(t){if(e===or.LEFT)return"right";if(e===or.RIGHT)return"left"}else{if(e===or.LEFT)return"left";if(e===or.RIGHT)return"right"}};function bU(e,t,n,r){const i=sUe(n,t);return!i||r===void 0||(e[i]=r),e}const I3t=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],D3t=["changeReason","unstable_updateValueOnRender"];or.LEFT+"",Vy.LEFT,or.RIGHT+"",Vy.RIGHT,or.NONE+"",or.VIRTUAL+"";const L3t=e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:i,isEditable:o,isSelected:s,isSelectionMode:a,classes:l}=e,c={root:["cell",`cell--text${Ue(t)}`,s&&"selected",o&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",i===or.LEFT&&"cell--pinnedLeft",i===or.RIGHT&&"cell--pinnedRight",a&&!o&&"cell--selectionMode"]};return Xe(c,pr,l)},F3t=Tr(function(t,n){const{column:r,row:i,rowId:o,rowNode:s,align:a,colIndex:l,width:c,className:u,style:f,colSpan:d,disableDragEvents:h,isNotVisible:p,pinnedOffset:g,pinnedPosition:m,showRightBorder:v,showLeftBorder:y,onClick:b,onDoubleClick:w,onMouseDown:S,onMouseUp:_,onMouseOver:E,onKeyDown:T,onKeyUp:k,onDragEnter:P,onDragOver:I}=t,R=st(t,I3t),F=ld(),A=nn(),L=yi(),$=r.field,j=BA(F,y3t,{rowId:o,field:$}),U=Nle().hooks.useCellAggregationResult(o,$),z=j?ni.Edit:ni.View,N=F.current.getCellParamsForRow(o,$,i,{colDef:r,cellMode:z,rowNode:s,tabIndex:ut(F,()=>{const ke=Ile(F);return ke&&ke.field===$&&ke.id===o?0:-1}),hasFocus:ut(F,()=>{const ke=pc(F);return ke?.id===o&&ke.field===$})});N.api=F.current,U&&(N.value=U.value,N.formattedValue=r.valueFormatter?r.valueFormatter(N.value,i,r,F):N.value);const B=ut(F,()=>F.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:o,field:$})),H=ut(F,Z6e),Q=ut(F,ANt),{hasFocus:Y,isEditable:Z=!1,value:ge}=N,ne=r.type==="actions"&&r.getActions?.(F.current.getRowParams(o)).some(ke=>!ke.props.disabled),ie=(z==="view"||!Z)&&!ne?N.tabIndex:-1,{classes:fe,getCellClassName:ve}=A,ue=[ut(F,()=>F.current.unstable_applyPipeProcessors("cellClassName",[],{id:o,field:$}).filter(Boolean).join(" "))];r.cellClassName&&ue.push(typeof r.cellClassName=="function"?r.cellClassName(N):r.cellClassName),r.display==="flex"&&ue.push(ye["cell--flex"]),ve&&ue.push(ve(N));const G=N.formattedValue??ge,ce=M.useRef(null),pe=zn(n,ce),J=M.useRef(null),te=A.cellSelection??!1,ae={align:a,showLeftBorder:y,showRightBorder:v,isEditable:Z,classes:A.classes,pinnedPosition:m,isSelected:B,isSelectionMode:te},we=L3t(ae),Pe=M.useCallback(ke=>ze=>{const De=F.current.getCellParams(o,$||"");F.current.publishEvent(ke,De,ze),_&&_(ze)},[F,$,_,o]),ee=M.useCallback(ke=>ze=>{const De=F.current.getCellParams(o,$||"");F.current.publishEvent(ke,De,ze),S&&S(ze)},[F,$,S,o]),re=M.useCallback((ke,ze)=>De=>{if(!F.current.getRow(o))return;const Ve=F.current.getCellParams(o,$||"");F.current.publishEvent(ke,Ve,De),ze&&ze(De)},[F,$,o]),Se=H[o]?.[$]??!1,he=Q[o]?.[$]??1,xe=M.useMemo(()=>{if(p)return{padding:0,opacity:0,width:0,height:0,border:0};const ke=bU(X({"--width":`${c}px`},f),L,m,g),ze=m===or.LEFT,De=m===or.RIGHT;return he>1&&(ke.height=`calc(var(--height) * ${he})`,ke.zIndex=10,(ze||De)&&(ke.zIndex=40)),ke},[c,p,f,g,m,L,he]);if(M.useEffect(()=>{if(!Y||z===ni.Edit)return;const ke=ci(F.current.rootElementRef.current);if(ce.current&&!ce.current.contains(ke.activeElement)){const ze=ce.current.querySelector('[tabindex="0"]'),De=J.current||ze||ce.current;if(zle())De.focus({preventScroll:!0});else{const Ve=F.current.getScrollPosition();De.focus(),F.current.scroll(Ve)}}},[Y,z,F]),Se)return O.jsx("div",{"data-colindex":l,role:"presentation",style:X({width:"var(--width)"},xe)});let me=R.onFocus,be,oe;if(j===null&&r.renderCell&&(be=r.renderCell(N)),j!==null&&r.renderEditCell){const ke=F.current.getRowWithUpdatedValues(o,r.field),ze=st(j,D3t),De=r.valueFormatter?r.valueFormatter(j.value,ke,r,F):N.formattedValue,Ve=X({},N,{row:ke,formattedValue:De},ze);be=r.renderEditCell(Ve),ue.push(ye["cell--editing"]),ue.push(fe?.["cell--editing"])}if(be===void 0){const ke=G?.toString();be=ke,oe=ke}M.isValidElement(be)&&ne&&(be=M.cloneElement(be,{focusElementRef:J}));const Ee=h?null:{onDragEnter:re("cellDragEnter",P),onDragOver:re("cellDragOver",I)};return O.jsx("div",X({className:Re(we.root,ue,u),role:"gridcell","data-field":$,"data-colindex":l,"aria-colindex":l+1,"aria-colspan":d,"aria-rowspan":he,style:xe,title:oe,tabIndex:ie,onClick:re("cellClick",b),onDoubleClick:re("cellDoubleClick",w),onMouseOver:re("cellMouseOver",E),onMouseDown:ee("cellMouseDown"),onMouseUp:Pe("cellMouseUp"),onKeyDown:re("cellKeyDown",T),onKeyUp:re("cellKeyUp",k)},Ee,R,{onFocus:me,ref:pe,children:be}))}),$3t=Cv(F3t),N3t=["field","type","align","width","height","empty","style","className"],Fwe="1.3em",z3t="1.2em",$we=[40,80],j3t={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},B3t=e=>{const{align:t,classes:n,empty:r}=e,i={root:["cell","cellSkeleton",`cell--text${t?Ue(t):"Left"}`,r&&"cellEmpty"]};return Xe(i,pr,n)},U3t=vFt(12345);function V3t(e){const{field:t,type:n,align:r,width:i,height:o,empty:s=!1,style:a,className:l}=e,c=st(e,N3t),f={classes:nn().classes,align:r,empty:s},d=B3t(f),h=M.useMemo(()=>{if(n==="boolean"||n==="actions")return{variant:"circular",width:Fwe,height:Fwe};const[g,m]=n?j3t[n]??$we:$we;return{variant:"text",width:`${Math.round(U3t(g,m))}%`,height:z3t}},[n]);return O.jsx("div",X({"data-field":t,className:Re(d.root,l),style:X({height:o,maxWidth:i,minWidth:i},a)},c,{children:!s&&O.jsx(R1t,X({},h))}))}const W3t=Cv(V3t);function H3t(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?dh(Vt(e.palette.divider,1),.88):fh(Vt(e.palette.divider,1),.68)}const G3t=10,z$=-5,b_=1,Nwe={width:3,rx:1.5,x:10.5},q3t="/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */",X3t=e=>e.dimensions.hasScrollX&&(!e.dimensions.hasScrollY||e.dimensions.scrollbarSize===0),Y3t=Oe("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${ye.autoHeight}`]:t.autoHeight},{[`&.${ye.autosizing}`]:t.autosizing},{[`&.${ye["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${ye["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${ye["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${ye["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${ye["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${ye.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${ye.actionsCell}`]:t.actionsCell},{[`& .${ye.booleanCell}`]:t.booleanCell},{[`& .${ye.cell}`]:t.cell},{[`& .${ye["cell--editable"]}`]:t["cell--editable"]},{[`& .${ye["cell--editing"]}`]:t["cell--editing"]},{[`& .${ye["cell--flex"]}`]:t["cell--flex"]},{[`& .${ye["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${ye["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${ye["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${ye["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${ye["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${ye["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${ye["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${ye["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${ye["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${ye["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${ye["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${ye["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${ye.cellCheckbox}`]:t.cellCheckbox},{[`& .${ye.cellEmpty}`]:t.cellEmpty},{[`& .${ye.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${ye.cellSkeleton}`]:t.cellSkeleton},{[`& .${ye.checkboxInput}`]:t.checkboxInput},{[`& .${ye.columnHeader}`]:t.columnHeader},{[`& .${ye["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${ye["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${ye["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${ye["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${ye["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${ye["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${ye["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${ye["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${ye["columnHeader--lastUnpinned"]}`]:t["columnHeader--lastUnpinned"]},{[`& .${ye["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${ye["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${ye["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${ye["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${ye["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${ye["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${ye["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${ye["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${ye["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${ye.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${ye.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${ye.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${ye.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${ye.columnSeparator}`]:t.columnSeparator},{[`& .${ye["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${ye["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${ye["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${ye["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${ye["container--bottom"]}`]:t["container--bottom"]},{[`& .${ye["container--top"]}`]:t["container--top"]},{[`& .${ye.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${ye["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${ye.editBooleanCell}`]:t.editBooleanCell},{[`& .${ye.filterIcon}`]:t.filterIcon},{[`& .${ye["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${ye["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${ye["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${ye.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${ye.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${ye.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${ye.headerFilterRow}`]:t.headerFilterRow},{[`& .${ye.iconSeparator}`]:t.iconSeparator},{[`& .${ye.menuIcon}`]:t.menuIcon},{[`& .${ye.menuIconButton}`]:t.menuIconButton},{[`& .${ye.menuList}`]:t.menuList},{[`& .${ye.menuOpen}`]:t.menuOpen},{[`& .${ye.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${ye.pinnedRows}`]:t.pinnedRows},{[`& .${ye["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${ye["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${ye.row}`]:t.row},{[`& .${ye["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${ye["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${ye["row--dragging"]}`]:t["row--dragging"]},{[`& .${ye["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${ye["row--editable"]}`]:t["row--editable"]},{[`& .${ye["row--editing"]}`]:t["row--editing"]},{[`& .${ye["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${ye["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${ye.rowReorderCell}`]:t.rowReorderCell},{[`& .${ye["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${ye.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${ye.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${ye.rowSkeleton}`]:t.rowSkeleton},{[`& .${ye.scrollbar}`]:t.scrollbar},{[`& .${ye["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${ye["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${ye.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${ye["scrollbarFiller--borderBottom"]}`]:t["scrollbarFiller--borderBottom"]},{[`& .${ye["scrollbarFiller--borderTop"]}`]:t["scrollbarFiller--borderTop"]},{[`& .${ye["scrollbarFiller--header"]}`]:t["scrollbarFiller--header"]},{[`& .${ye["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${ye.sortIcon}`]:t.sortIcon},{[`& .${ye.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${ye.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${ye.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${ye.withBorderColor}`]:t.withBorderColor}]})(({theme:e})=>{const t=ld(),n=ut(t,X3t),r=H3t(e),i=e.shape.borderRadius,o=e.vars?e.vars.palette.background.default:e.mixins.MuiDataGrid?.containerBackground??e.palette.background.default,s=e.mixins.MuiDataGrid?.pinnedBackground??o,a=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:Vt(e.palette.background.default,e.palette.action.disabledOpacity),l=(e.vars||e).palette.action.hoverOpacity,c=(e.vars||e).palette.action.hover,u=(e.vars||e).palette.action.selectedOpacity,f=e.vars?`calc(${l} + ${u})`:l+u,d=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${u})`:Vt(e.palette.primary.main,u),h=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${f})`:Vt(e.palette.primary.main,f),p=e.vars?Z3t:Q3t,g=T=>({[`& .${ye["cell--pinnedLeft"]}, & .${ye["cell--pinnedRight"]}`]:{backgroundColor:T,"&.Mui-selected":{backgroundColor:p(T,d,u),"&:hover":{backgroundColor:p(T,d,f)}}}}),m=p(s,c,l),v=g(m),y=p(s,d,u),b=g(y),w=p(s,h,f),S=g(w),_={backgroundColor:d,"&:hover":{backgroundColor:h,"@media (hover: none)":{backgroundColor:d}}};return X({"--unstable_DataGrid-radius":typeof i=="number"?`${i}px`:i,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":a,"--DataGrid-containerBackground":o,"--DataGrid-pinnedBackground":s,"--DataGrid-rowBorderColor":r,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:r,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",transform:"translate(0, 0)",[`.${ye.main} > *:first-child${q3t}`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${ye.autoHeight}`]:{height:"auto"},[`&.${ye.autosizing}`]:{[`& .${ye.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${ye.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${ye.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${ye.groupingCriteriaCell}`]:{width:"unset"},[`& .${ye.treeDataGroupingCell}`]:{width:"unset"}},[`& .${ye.columnHeader}, & .${ye.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${ye.columnHeader}:focus-within, & .${ye.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:Vt(e.palette.primary.main,.5)} ${b_}px`,outlineOffset:b_*-1},[`& .${ye.columnHeader}:focus, & .${ye.cell}:focus`]:{outline:`solid ${e.palette.primary.main} ${b_}px`,outlineOffset:b_*-1},[`& .${ye.columnHeader}:focus, + & .${ye["columnHeader--withLeftBorder"]}, + & .${ye["columnHeader--withRightBorder"]}, + & .${ye["columnHeader--siblingFocused"]}, + & .${ye["virtualScroller--hasScrollX"]} .${ye["columnHeader--lastUnpinned"]}, + & .${ye["virtualScroller--hasScrollX"]} .${ye["columnHeader--last"]} + `]:{[`& .${ye.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${ye["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${ye["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${ye["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${ye["root--noToolbar"]} [aria-rowindex="1"] .${ye["columnHeader--last"]}`]:{borderTopRightRadius:n?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${ye.columnHeaderCheckbox}, & .${ye.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${ye.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${ye["virtualScroller--hasScrollX"]} .${ye["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${ye["columnHeader--sorted"]} .${ye.iconButtonContainer}, & .${ye["columnHeader--filtered"]} .${ye.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${ye.columnHeader}:not(.${ye["columnHeader--sorted"]}) .${ye.sortButton}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${ye.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:e.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${ye.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${ye["columnHeader--filledGroup"]} .${ye.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${ye.sortIcon}, & .${ye.filterIcon}`]:{fontSize:"inherit"},[`& .${ye["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${ye["columnHeader--alignCenter"]} .${ye.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${ye["columnHeader--alignRight"]} .${ye.columnHeaderDraggableContainer}, & .${ye["columnHeader--alignRight"]} .${ye.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${ye["columnHeader--alignCenter"]} .${ye.menuIcon}`]:{marginLeft:"auto"},[`& .${ye["columnHeader--alignRight"]} .${ye.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${ye["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${ye["columnHeader--pinnedLeft"]}, & .${ye["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:40,background:"var(--DataGrid-pinnedBackground)"},[`& .${ye.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:30,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:G3t,color:r},[`& .${ye.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)"},"@media (hover: hover)":{[`& .${ye.columnHeader}:hover`]:{[`& .${ye.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${ye.iconButtonContainer}`]:{visibility:"visible",width:"auto"}},[`& .${ye.columnHeader}:not(.${ye["columnHeader--sorted"]}):hover .${ye.sortButton}`]:{opacity:.5}},"@media (hover: none)":{[`& .${ye.columnHeader} .${ye.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${ye.columnHeader}:focus, + & .${ye["columnHeader--siblingFocused"]}`]:{[`.${ye["columnSeparator--resizable"]}`]:{color:(e.vars||e).palette.primary.main}}},[`& .${ye["columnSeparator--sideLeft"]}`]:{left:z$},[`& .${ye["columnSeparator--sideRight"]}`]:{right:z$},[`& .${ye["columnHeader--withRightBorder"]} .${ye["columnSeparator--sideLeft"]}`]:{left:z$-.5},[`& .${ye["columnHeader--withRightBorder"]} .${ye["columnSeparator--sideRight"]}`]:{right:z$-.5},[`& .${ye["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${ye["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.primary.main},"@media (hover: none)":{[`& .${ye.iconSeparator} rect`]:Nwe},"@media (hover: hover)":{"&:hover":{color:(e.vars||e).palette.primary.main,[`& .${ye.iconSeparator} rect`]:Nwe}},"& svg":{pointerEvents:"none"}},[`& .${ye.iconSeparator}`]:{color:"inherit",transition:e.transitions.create(["color","width"],{duration:e.transitions.duration.shortest})},[`& .${ye.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${ye.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${ye.headerFilterRow}`]:{[`& .${ye.columnHeader}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${ye["row--borderBottom"]} .${ye.columnHeader}, + & .${ye["row--borderBottom"]} .${ye.filler}, + & .${ye["row--borderBottom"]} .${ye.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${ye["row--borderBottom"]} .${ye.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${ye.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${ye["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ye.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":_},[`& .${ye["container--top"]}, & .${ye["container--bottom"]}`]:{"[role=row]":{background:"var(--DataGrid-containerBackground)"}},[`& .${ye.cell}`]:{flex:"0 0 auto",height:"var(--height)",width:"var(--width)",lineHeight:"calc(var(--height) - 1px)",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&.Mui-selected":_},[`& .${ye["virtualScrollerContent--overflowed"]} .${ye["row--lastVisible"]} .${ye.cell}`]:{borderTopColor:"transparent"},[`& .${ye["pinnedRows--top"]} :first-of-type`]:{[`& .${ye.cell}, .${ye.scrollbarFiller}`]:{borderTop:"none"}},[`&.${ye["root--disableUserSelection"]}`]:{userSelect:"none"},[`& .${ye["row--dynamicHeight"]} > .${ye.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${ye.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${ye.cell}.${ye["cell--selectionMode"]}`]:{cursor:"default"},[`& .${ye.cell}.${ye["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`${b_}px solid ${(e.vars||e).palette.primary.main}`,outlineOffset:b_*-1}},[`& .${ye["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${ye["row--editing"]} .${ye.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${ye.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${ye.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${ye.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${ye.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${ye.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${ye["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${ye.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${ye.withBorderColor}`]:{borderColor:r},[`& .${ye["cell--withLeftBorder"]}, & .${ye["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${ye["cell--withRightBorder"]}, & .${ye["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${ye["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${ye["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${ye["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${ye["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${ye["cell--pinnedLeft"]}, & .${ye["cell--pinnedRight"]}`]:{position:"sticky",zIndex:30,background:"var(--DataGrid-pinnedBackground)","&.Mui-selected":{backgroundColor:y}},[`& .${ye.virtualScrollerContent} .${ye.row}`]:{"&:hover":v,"&.Mui-selected":b,"&.Mui-selected:hover":S},[`& .${ye.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${ye.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${ye.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${ye.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${ye["columnHeader--dragging"]}, & .${ye["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${ye["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${ye.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${ye.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${ye.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${ye.treeDataGroupingCellLoadingContainer}, .${ye.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${ye.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${ye.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`.${ye.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",[`&.${ye["scrollbarFiller--borderTop"]}`]:{borderTop:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${ye["scrollbarFiller--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`&.${ye["scrollbarFiller--pinnedRight"]}`]:{backgroundColor:"var(--DataGrid-pinnedBackground)",position:"sticky",right:0}},[`& .${ye.filler}`]:{flex:"1 0 auto"},[`& .${ye["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${ye["main--hasSkeletonLoadingOverlay"]}`]:{[`& .${ye.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${ye["scrollbar--vertical"]}, & .${ye.pinnedRows}, & .${ye.virtualScroller} > .${ye.filler}`]:{display:"none"}}})});function Q3t(e,t,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=Kp(e),s=Kp(t),a=[i(o.values[0],s.values[0]),i(o.values[1],s.values[1]),i(o.values[2],s.values[2])];return NI({type:"rgb",values:a})}const K3t=e=>`rgb(from ${e} r g b / 1)`;function Z3t(e,t,n){return`color-mix(in srgb,${e}, ${K3t(t)} calc(${n} * 100%))`}const J3t=()=>()=>{},ezt=()=>!1,tzt=()=>!0,nzt=()=>wle.useSyncExternalStore(J3t,ezt,tzt);function rzt(){const e=Kn(),t=ut(e,Ff),n=nn(),r=ut(e,WA),i=e.current.unstable_applyPipeProcessors("preferencePanel",null,r.openedPanelValue??iw.filters);return O.jsx(n.slots.panel,X({as:n.slots.basePopper,open:t.length>0&&r.open,id:r.panelId,"aria-labelledby":r.labelId},n.slotProps?.panel,n.slotProps?.basePopper,{children:i}))}function izt(){const e=nn();return O.jsxs(M.Fragment,{children:[O.jsx(rzt,{}),e.slots.toolbar&&O.jsx(e.slots.toolbar,X({},e.slotProps?.toolbar))]})}const ozt=["className","children"],szt=(e,t)=>{const{autoHeight:n,classes:r,showCellVerticalBorder:i}=e,o={root:["root",n&&"autoHeight",`root--density${Ue(t)}`,e.slots.toolbar===null&&"root--noToolbar","withBorderColor",i&&"withVerticalBorder"]};return Xe(o,pr,r)},azt=Tr(function(t,n){const r=nn(),{className:i,children:o}=t,s=st(t,ozt),a=ld(),l=ut(a,kC),c=a.current.rootElementRef,u=M.useCallback(g=>{g!==null&&a.current.publishEvent("rootMount",g)},[a]),f=zn(c,n,u),d=r,h=szt(d,l);return nzt()?null:O.jsxs(Y3t,X({className:Re(h.root,i),ownerState:d},s,{ref:f,children:[O.jsx(izt,{}),O.jsx(E3t,{children:o}),O.jsx(T3t,{})]}))}),lzt=Cv(azt),czt=["className"],uzt=e=>{const{classes:t}=e;return Xe({root:["footerContainer","withBorderColor"]},pr,t)},fzt=Qn("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),dzt=Tr(function(t,n){const{className:r}=t,i=st(t,czt),o=nn(),s=uzt(o);return O.jsx(fzt,X({className:Re(s.root,r),ownerState:o},i,{ref:n}))}),hzt=["className"],pzt=e=>{const{classes:t}=e;return Xe({root:["overlay"]},pr,t)},gzt=Qn("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackground)"}),jle=Tr(function(t,n){const{className:r}=t,i=st(t,hzt),o=nn(),s=pzt(o);return O.jsx(gzt,X({className:Re(s.root,r),ownerState:o},i,{ref:n}))}),mzt=e=>{const{classes:t,open:n}=e;return Xe({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},pr,t)},vzt=M.memo(e=>{const{colDef:t,open:n,columnMenuId:r,columnMenuButtonId:i,iconButtonRef:o}=e,s=Kn(),a=nn(),l=X({},e,{classes:a.classes}),c=mzt(l),u=M.useCallback(d=>{d.preventDefault(),d.stopPropagation(),s.current.toggleColumnMenu(t.field)},[s,t.field]),f=t.headerName??t.field;return O.jsx("div",{className:c.root,children:O.jsx(a.slots.baseTooltip,X({title:s.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},a.slotProps?.baseTooltip,{children:O.jsx(a.slots.baseIconButton,X({ref:o,tabIndex:-1,className:c.button,"aria-label":s.current.getLocaleText("columnMenuAriaLabel")(f),size:"small",onClick:u,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?r:void 0,id:i},a.slotProps?.baseIconButton,{children:O.jsx(a.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function yzt({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:i,open:o,target:s,onExited:a}){const l=Kn(),c=l.current.getColumn(i),u=ft(f=>{f&&(f.stopPropagation(),s?.contains(f.target))||l.current.hideColumnMenu()});return!s||!c?null:O.jsx(Tle,{placement:`bottom-${c.align==="right"?"start":"end"}`,open:o,target:s,onClose:u,onExited:a,children:O.jsx(n,X({colDef:c,hideMenu:u,open:o,id:e,labelledby:t},r))})}function bzt(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function K5(e,t){return e.closest(`.${t}`)}function Ev(e){return e.replace(/["\\]/g,"\\$&")}function xzt(e,t){return e.querySelector(`[role="columnheader"][data-field="${Ev(t)}"]`)}function aUe(e){return`.${ye.row}[data-id="${Ev(String(e))}"]`}function wzt(e,t){return e.querySelector(aUe(t))}function Szt(e,{id:t,field:n}){const r=aUe(t),i=`.${ye.cell}[data-field="${Ev(n)}"]`,o=`${r} ${i}`;return e.querySelector(o)}function ED(e){return e.target.nodeType===1&&!e.currentTarget.contains(e.target)}function _zt(e){return e.getAttribute("data-field")}function Czt(e,t){return e.querySelector(`[data-field="${Ev(t)}"]`)}function Ozt(e){return e.getAttribute("data-fields").slice(2,-2).split("-|-")}function Ezt(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${Ev(t)}-|"]`)??[])}function Tzt(e,t){if(!K5(e,ye.root))throw new Error("MUI X: The root element is not found.");const r=e.getAttribute("aria-colindex");if(!r)return[];const i=Number(r)-1,o=[];return t.virtualScrollerRef?.current?(uUe(t).forEach(s=>{const a=s.getAttribute("data-id");if(!a)return;let l=i;const c=t.unstable_getCellColSpanInfo(a,i);c&&c.spannedByColSpan&&(l=c.leftVisibleCellIndex);const u=s.querySelector(`[data-colindex="${l}"]`);u&&o.push(u)}),o):[]}function zwe(e,t){return e.rootElementRef.current.querySelector(`.${ye[t]}`)}const lUe=({api:e,colIndex:t,position:n,filterFn:r})=>{if(t===null)return[];const i=[];return uUe(e).forEach(o=>{o.getAttribute("data-id")&&o.querySelectorAll(`.${ye[n==="left"?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(a=>{const l=LT(a);l!==null&&r(l)&&i.push(a)})}),i};function Pzt(e,t,n){const r=LT(t);return lUe({api:e,colIndex:r,position:n?"right":"left",filterFn:i=>n?ir})}function kzt(e,t,n){const r=LT(t);return lUe({api:e,colIndex:r,position:n?"left":"right",filterFn:i=>n?i>r:i{if(!e.columnHeadersContainerRef?.current)return[];if(t===null)return[];const i=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${ye[n==="left"?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(o=>{const s=LT(o);s!==null&&r(s,o)&&i.push(o)}),i};function Mzt(e,t,n){const r=LT(t);return cUe({api:e,position:n?"right":"left",colIndex:r,filterFn:i=>n?ir})}function Azt(e,t,n){const r=LT(t);return cUe({api:e,position:n?"left":"right",colIndex:r,filterFn:(i,o)=>o.classList.contains(ye["columnHeader--last"])?!1:n?i>r:i div > [data-field="${Ev(t)}"][role="columnheader"]`)}function Izt(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${Ev(t)}"][role="gridcell"]`))}function uUe(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${ye.row}`)}function LT(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const Dzt=["className","aria-label"],Lzt=e=>{const{classes:t}=e;return Xe({root:["columnHeaderTitle"]},pr,t)},Fzt=Qn("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),$zt=Tr(function(t,n){const{className:r}=t,i=st(t,Dzt),o=nn(),s=Lzt(o);return O.jsx(Fzt,X({className:Re(s.root,r),ownerState:o},i,{ref:n}))});function Nzt(e){const{label:t,description:n}=e,r=nn(),i=M.useRef(null),[o,s]=M.useState(""),a=M.useCallback(()=>{if(!n&&i?.current){const l=bzt(i.current);s(l?t:"")}},[n,t]);return O.jsx(r.slots.baseTooltip,X({title:n||o},r.slotProps?.baseTooltip,{children:O.jsx($zt,{onMouseOver:a,ref:i,children:t})}))}const zzt=["resizable","resizing","height","side"];var Ble=(function(e){return e.Left="left",e.Right="right",e})(Ble||{});const jzt=e=>{const{resizable:t,resizing:n,classes:r,side:i}=e,o={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",i&&`columnSeparator--side${Ue(i)}`],icon:["iconSeparator"]};return Xe(o,pr,r)};function Bzt(e){const{height:t,side:n=Ble.Right}=e,r=st(e,zzt),i=nn(),o=X({},e,{side:n,classes:i.classes}),s=jzt(o),a=M.useCallback(l=>{l.preventDefault(),l.stopPropagation()},[]);return O.jsx("div",X({className:s.root,style:{minHeight:t}},r,{onClick:a,children:O.jsx(i.slots.columnResizeIcon,{className:s.icon})}))}const Uzt=M.memo(Bzt),Vzt=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],fUe=Tr(function(t,n){const{classes:r,colIndex:i,height:o,isResizing:s,sortDirection:a,tabIndex:l,separatorSide:c,isDraggable:u,headerComponent:f,description:d,width:h,columnMenuIconButton:p=null,columnMenu:g=null,columnTitleIconButtons:m=null,headerClassName:v,label:y,resizable:b,draggableContainerProps:w,columnHeaderSeparatorProps:S,style:_}=t,E=st(t,Vzt),T=nn(),k=M.useRef(null),P=zn(k,n);let I="none";return a!=null&&(I=a==="asc"?"ascending":"descending"),O.jsxs("div",X({className:Re(r.root,v),style:X({},_,{height:o,width:h}),role:"columnheader",tabIndex:l,"aria-colindex":i+1,"aria-sort":I},E,{ref:P,children:[O.jsxs("div",X({className:r.draggableContainer,draggable:u,role:"presentation"},w,{children:[O.jsxs("div",{className:r.titleContainer,role:"presentation",children:[O.jsx("div",{className:r.titleContainerContent,children:f!==void 0?f:O.jsx(Nzt,{label:y,description:d,columnWidth:h})}),m]}),p]})),O.jsx(Uzt,X({resizable:!T.disableColumnResize&&!!b,resizing:s,height:o,side:c},S)),g]}))}),Wzt=e=>{const{colDef:t,classes:n,isDragging:r,sortDirection:i,showRightBorder:o,showLeftBorder:s,filterItemsCounter:a,pinnedPosition:l,isLastUnpinned:c,isSiblingFocused:u}=e,f=i!=null,d=a!=null&&a>0,h=t.type==="number",p={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",f&&"columnHeader--sorted",d&&"columnHeader--filtered",h&&"columnHeader--numeric","withBorderColor",o&&"columnHeader--withRightBorder",s&&"columnHeader--withLeftBorder",l===or.LEFT&&"columnHeader--pinnedLeft",l===or.RIGHT&&"columnHeader--pinnedRight",c&&"columnHeader--lastUnpinned",u&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Xe(p,pr,n)};function Hzt(e){const{colDef:t,columnMenuOpen:n,colIndex:r,headerHeight:i,isResizing:o,isLast:s,sortDirection:a,sortIndex:l,filterItemsCounter:c,hasFocus:u,tabIndex:f,disableReorder:d,separatorSide:h,showLeftBorder:p,showRightBorder:g,pinnedPosition:m,pinnedOffset:v}=e,y=ld(),b=nn(),w=yi(),S=M.useRef(null),_=fr(),E=fr(),T=M.useRef(null),[k,P]=M.useState(n),I=M.useMemo(()=>!b.disableColumnReorder&&!d&&!t.disableReorder,[b.disableColumnReorder,d,t.disableReorder]);let R;t.renderHeader&&(R=t.renderHeader(y.current.getColumnHeaderParams(t.field)));const F=X({},e,{classes:b.classes,showRightBorder:g,showLeftBorder:p}),A=Wzt(F),L=M.useCallback(ne=>ie=>{ED(ie)||y.current.publishEvent(ne,y.current.getColumnHeaderParams(t.field),ie)},[y,t.field]),$=M.useMemo(()=>({onClick:L("columnHeaderClick"),onContextMenu:L("columnHeaderContextMenu"),onDoubleClick:L("columnHeaderDoubleClick"),onMouseOver:L("columnHeaderOver"),onMouseOut:L("columnHeaderOut"),onMouseEnter:L("columnHeaderEnter"),onMouseLeave:L("columnHeaderLeave"),onKeyDown:L("columnHeaderKeyDown"),onFocus:L("columnHeaderFocus"),onBlur:L("columnHeaderBlur")}),[L]),j=M.useMemo(()=>I?{onDragStart:L("columnHeaderDragStart"),onDragEnter:L("columnHeaderDragEnter"),onDragOver:L("columnHeaderDragOver"),onDragEnd:L("columnHeaderDragEnd")}:{},[I,L]),V=M.useMemo(()=>({onMouseDown:L("columnSeparatorMouseDown"),onDoubleClick:L("columnSeparatorDoubleClick")}),[L]);M.useEffect(()=>{k||P(n)},[k,n]);const U=M.useCallback(()=>{P(!1)},[]),z=!b.disableColumnMenu&&!t.disableColumnMenu&&O.jsx(vzt,{colDef:t,columnMenuId:_,columnMenuButtonId:E,open:k,iconButtonRef:T}),N=O.jsx(yzt,{columnMenuId:_,columnMenuButtonId:E,field:t.field,open:n,target:T.current,ContentComponent:b.slots.columnMenu,contentComponentProps:b.slotProps?.columnMenu,onExited:U}),B=t.sortingOrder??b.sortingOrder,H=(t.sortable||a!=null)&&!t.hideSortIcons&&!b.disableColumnSorting,Q=O.jsxs(M.Fragment,{children:[!b.disableColumnFilter&&O.jsx(b.slots.columnHeaderFilterIconButton,X({field:t.field,counter:c},b.slotProps?.columnHeaderFilterIconButton)),H&&O.jsx(b.slots.columnHeaderSortIcon,X({field:t.field,direction:a,index:l,sortingOrder:B,disabled:!t.sortable},b.slotProps?.columnHeaderSortIcon))]});M.useLayoutEffect(()=>{const ne=y.current.state.columnMenu;if(u&&!ne.open){const fe=S.current.querySelector('[tabindex="0"]')||S.current;if(!fe)return;if(zle())fe.focus({preventScroll:!0});else{const ve=y.current.getScrollPosition();fe.focus(),y.current.scroll(ve)}}},[y,u]);const Y=typeof t.headerClassName=="function"?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,Z=t.headerName??t.field,ge=M.useMemo(()=>bU(X({},e.style),w,m,v),[m,v,e.style,w]);return O.jsx(fUe,X({ref:S,classes:A,columnMenuOpen:n,colIndex:r,height:i,isResizing:o,sortDirection:a,hasFocus:u,tabIndex:f,separatorSide:h,isDraggable:I,headerComponent:R,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:z,columnTitleIconButtons:Q,headerClassName:Re(Y,s&&ye["columnHeader--last"]),label:Z,resizable:!b.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:N,draggableContainerProps:j,columnHeaderSeparatorProps:V,style:ge},$))}const Gzt=Cv(Hzt),qzt=["className"],Xzt=e=>{const{classes:t}=e;return Xe({root:["iconButtonContainer"]},pr,t)},Yzt=Qn("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),dUe=Tr(function(t,n){const{className:r}=t,i=st(t,qzt),o=nn(),s=Xzt(o);return O.jsx(Yzt,X({className:Re(s.root,r),ownerState:o},i,{ref:n}))}),Qzt=["direction","index","sortingOrder","disabled","className"],Kzt=e=>{const{classes:t}=e;return Xe({root:["sortButton"],icon:["sortIcon"]},pr,t)};function Zzt(e,t,n,r){let i;const o={};return t==="asc"?i=e.columnSortedAscendingIcon:t==="desc"?i=e.columnSortedDescendingIcon:(i=e.columnUnsortedIcon,o.sortingOrder=r),i?O.jsx(i,X({fontSize:"small",className:n},o)):null}function Jzt(e){const{direction:t,index:n,sortingOrder:r,disabled:i,className:o}=e,s=st(e,Qzt),a=Kn(),l=nn(),c=X({},e,{classes:l.classes}),u=Kzt(c),f=Zzt(l.slots,t,u.icon,r);if(!f)return null;const d=O.jsx(l.slots.baseIconButton,X({tabIndex:-1,"aria-label":a.current.getLocaleText("columnHeaderSortIconLabel"),title:a.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:i,className:Re(u.root,o)},l.slotProps?.baseIconButton,s,{children:f}));return O.jsxs(dUe,{children:[n!=null&&O.jsx(l.slots.baseBadge,{badgeContent:n,color:"default",overlap:"circular",children:d}),n==null&&d]})}const e5t=M.memo(Jzt),t5t=e=>{const{classes:t}=e;return Xe({icon:["filterIcon"]},pr,t)};function n5t(e){return e.counter?O.jsx(r5t,X({},e)):null}function r5t(e){const{counter:t,field:n,onClick:r}=e,i=Kn(),o=nn(),s=X({},e,{classes:o.classes}),a=t5t(s),l=fr(),c=BA(i,b3t,l),u=fr(),f=M.useCallback(h=>{h.preventDefault(),h.stopPropagation();const{open:p,openedPanelValue:g}=WA(i.current.state);p&&g===iw.filters?i.current.hideFilterPanel():i.current.showFilterPanel(void 0,u,l),r&&r(i.current.getColumnHeaderParams(n),h)},[i,n,r,u,l]);if(!t)return null;const d=O.jsx(o.slots.baseIconButton,X({id:l,onClick:f,color:"default","aria-label":i.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?u:void 0},o.slotProps?.baseIconButton,{children:O.jsx(o.slots.columnFilteredIcon,{className:a.icon,fontSize:"small"})}));return O.jsx(o.slots.baseTooltip,X({title:i.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},o.slotProps?.baseTooltip,{children:O.jsxs(dUe,{children:[t>1&&O.jsx(o.slots.baseBadge,{badgeContent:t,color:"default",children:d}),t===1&&d]})}))}const jwe=at(O.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),Bwe=at(O.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),Uwe=at(O.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),Vwe=at(O.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),i5t=at(O.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),Wwe=at(O.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt"),o5t=at(O.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");at(O.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");at(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");const s5t=at(O.jsx("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),a5t=at(O.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"}),"Separator"),l5t=at(O.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),c5t=at(O.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),u5t=at(O.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),f5t=at(O.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"TripleDotsVertical"),D9=at(O.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Hwe=at(O.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),d5t=at(O.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),h5t=at(O.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Load"),Gwe=at(O.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"Drag"),p5t=at(O.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),g5t=at(O.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),m5t=at(O.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert"),v5t=at(O.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),y5t=at(O.jsx("g",{children:O.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),b5t=at(O.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");at(O.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");const x5t=at(O.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");function hUe(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const Z5=e=>e.indexOf("Arrow")===0||e.indexOf("Page")===0||e===" "||e==="Home"||e==="End",w5t=e=>!!e.key,pUe=e=>e==="Tab"||e==="Escape";function gUe(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="V"&&!e.shiftKey&&!e.altKey}function S5t(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="C"&&!e.shiftKey&&!e.altKey}const _5t=["hideMenu","colDef","id","labelledby","className","children","open"],C5t=Oe(Xw)(()=>({minWidth:248})),O5t=Tr(function(t,n){const{hideMenu:r,id:i,labelledby:o,className:s,children:a,open:l}=t,c=st(t,_5t),u=M.useCallback(f=>{f.key==="Tab"&&f.preventDefault(),pUe(f.key)&&r(f)},[r]);return O.jsx(C5t,X({id:i,className:Re(ye.menuList,s),"aria-labelledby":o,onKeyDown:u,autoFocus:l},c,{ref:n,children:a}))}),E5t=["displayOrder"],T5t=e=>{const t=ld(),n=nn(),{defaultSlots:r,defaultSlotProps:i,slots:o={},slotProps:s={},hideMenu:a,colDef:l,addDividers:c=!0}=e,u=M.useMemo(()=>X({},r,o),[r,o]),f=M.useMemo(()=>{if(!s||Object.keys(s).length===0)return i;const p=X({},s);return Object.entries(i).forEach(([g,m])=>{p[g]=X({},m,s[g]||{})}),p},[i,s]),d=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),h=M.useMemo(()=>{const p=Object.keys(r);return Object.keys(o).filter(g=>!p.includes(g))},[o,r]);return M.useMemo(()=>{const m=Array.from(new Set([...d,...h])).filter(v=>u[v]!=null).sort((v,y)=>{const b=f[v],w=f[y],S=Number.isFinite(b?.displayOrder)?b.displayOrder:100,_=Number.isFinite(w?.displayOrder)?w.displayOrder:100;return S-_});return m.reduce((v,y,b)=>{let w={colDef:l,onClick:a};const S=f[y];if(S){const _=st(S,E5t);w=X({},w,_)}return c&&b!==m.length-1?[...v,[u[y],w],[n.slots.baseDivider,{}]]:[...v,[u[y],w]]},[])},[c,l,d,a,u,f,h,n.slots.baseDivider])};function P5t(e){const{colDef:t,onClick:n}=e,r=Kn(),i=nn(),a=Mo(r).filter(c=>c.disableColumnMenu!==!0).length===1,l=M.useCallback(c=>{a||(r.current.setColumnVisibility(t.field,!1),n(c))},[r,t.field,n,a]);return i.disableColumnSelector||t.hideable===!1?null:O.jsxs(nr,{onClick:l,disabled:a,children:[O.jsx(rl,{children:O.jsx(i.slots.columnMenuHideIcon,{fontSize:"small"})}),O.jsx(Qi,{children:r.current.getLocaleText("columnMenuHideColumn")})]})}function k5t(e){const{onClick:t}=e,n=Kn(),r=nn(),i=M.useCallback(o=>{t(o),n.current.showPreferences(iw.columns)},[n,t]);return r.disableColumnSelector?null:O.jsxs(nr,{onClick:i,children:[O.jsx(rl,{children:O.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),O.jsx(Qi,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}function M5t(e){return O.jsxs(M.Fragment,{children:[O.jsx(P5t,X({},e)),O.jsx(k5t,X({},e))]})}function A5t(e){const{colDef:t,onClick:n}=e,r=Kn(),i=nn(),o=M.useCallback(s=>{n(s),r.current.showFilterPanel(t.field)},[r,t.field,n]);return i.disableColumnFilter||!t.filterable?null:O.jsxs(nr,{onClick:o,children:[O.jsx(rl,{children:O.jsx(i.slots.columnMenuFilterIcon,{fontSize:"small"})}),O.jsx(Qi,{children:r.current.getLocaleText("columnMenuFilter")})]})}function R5t(e){const{colDef:t,onClick:n}=e,r=Kn(),i=ut(r,Fd),o=nn(),s=M.useMemo(()=>t?i.find(f=>f.field===t.field)?.sort:null,[t,i]),a=t.sortingOrder??o.sortingOrder,l=M.useCallback(u=>{n(u);const f=u.currentTarget.getAttribute("data-value")||null;r.current.sortColumn(t.field,f===s?null:f)},[r,t,n,s]);if(o.disableColumnSorting||!t||!t.sortable||!a.some(u=>!!u))return null;const c=u=>{const f=r.current.getLocaleText(u);return typeof f=="function"?f(t):f};return O.jsxs(M.Fragment,{children:[a.includes("asc")&&s!=="asc"?O.jsxs(nr,{onClick:l,"data-value":"asc",children:[O.jsx(rl,{children:O.jsx(o.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),O.jsx(Qi,{children:c("columnMenuSortAsc")})]}):null,a.includes("desc")&&s!=="desc"?O.jsxs(nr,{onClick:l,"data-value":"desc",children:[O.jsx(rl,{children:O.jsx(o.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),O.jsx(Qi,{children:c("columnMenuSortDesc")})]}):null,a.includes(null)&&s!=null?O.jsxs(nr,{onClick:l,children:[O.jsx(rl,{}),O.jsx(Qi,{children:r.current.getLocaleText("columnMenuUnsort")})]}):null]})}const I5t=["defaultSlots","defaultSlotProps","slots","slotProps"],D5t={columnMenuSortItem:R5t,columnMenuFilterItem:A5t,columnMenuColumnsItem:M5t},L5t={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},F5t=Tr(function(t,n){const{defaultSlots:r,defaultSlotProps:i,slots:o,slotProps:s}=t,a=st(t,I5t),l=T5t(X({},a,{defaultSlots:r,defaultSlotProps:i,slots:o,slotProps:s}));return O.jsx(O5t,X({},a,{ref:n,children:l.map(([c,u],f)=>O.jsx(c,X({},u),f))}))}),$5t=Tr(function(t,n){return O.jsx(F5t,X({},t,{ref:n,defaultSlots:D5t,defaultSlotProps:L5t}))}),N5t=["className","slotProps"],z5t=e=>{const{classes:t}=e;return Xe({root:["panelWrapper"]},pr,t)},j5t=Oe("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),B5t=()=>!0,mUe=Tr(function(t,n){const{className:r,slotProps:i={}}=t,o=st(t,N5t),s=nn(),a=z5t(s);return O.jsx(eae,X({open:!0,disableEnforceFocus:!0,isEnabled:B5t},i.TrapFocus,{children:O.jsx(j5t,X({tabIndex:-1,className:Re(a.root,r),ownerState:s},o,{ref:n}))}))});function U5t(e){const t=nn();return O.jsx(mUe,X({},e,{children:O.jsx(t.slots.columnsManagement,X({},t.slotProps?.columnsManagement))}))}const V5t=["children","className","classes"],W5t=dt("MuiDataGrid",["panel","paper"]),H5t=Oe(yb,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),G5t=Oe(fa,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex",maxWidth:`calc(100vw - ${e.spacing(.5)})`,overflow:"auto"})),q5t=Tr((e,t)=>{const{children:n,className:r}=e,i=st(e,V5t),o=Kn(),s=nn(),a=W5t,[l,c]=M.useState(!1),u=M.useCallback(()=>{o.current.hidePreferences()},[o]),f=M.useCallback(g=>{g.key==="Escape"&&o.current.hidePreferences()},[o]),d=M.useMemo(()=>[{name:"flip",enabled:!0,options:{rootBoundary:"document"}},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{c(!0)},effect:()=>()=>{c(!1)}}],[]),[h,p]=M.useState(null);return M.useEffect(()=>{const g=o.current.rootElementRef?.current?.querySelector('[data-id="gridPanelAnchor"]');g&&p(g)},[o]),h?O.jsx(H5t,X({placement:"bottom-start",className:Re(a.panel,r),ownerState:s,anchorEl:h,modifiers:d},i,{ref:t,children:O.jsx(Jse,{mouseEvent:"onPointerUp",touchEvent:!1,onClickAway:u,children:O.jsx(G5t,{className:a.paper,ownerState:s,elevation:8,onKeyDown:f,children:l&&n})})})):null}),X5t=["className"],Y5t=e=>{const{classes:t}=e;return Xe({root:["panelContent"]},pr,t)},Q5t=Qn("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function K5t(e){const{className:t}=e,n=st(e,X5t),r=nn(),i=Y5t(r);return O.jsx(Q5t,X({className:Re(i.root,t),ownerState:r},n))}const Z5t=["className"],J5t=e=>{const{classes:t}=e;return Xe({root:["panelFooter"]},pr,t)},ejt=Qn("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function tjt(e){const{className:t}=e,n=st(e,Z5t),r=nn(),i=J5t(r);return O.jsx(ejt,X({className:Re(i.root,t),ownerState:r},n))}const njt=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],rjt=["InputComponentProps"],ijt=e=>{const{classes:t}=e;return Xe({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},pr,t)},ojt=Oe("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),sjt=Oe("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),ajt=Oe("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),ljt=Oe("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),cjt=Oe("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:150}),ujt=Oe("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),fjt=e=>{switch(e){case Il.And:return"filterPanelOperatorAnd";case Il.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}},Ak=e=>e.headerName||e.field,qwe=new Intl.Collator,Xwe=Tr(function(t,n){const{item:r,hasMultipleFilters:i,deleteFilter:o,applyFilterChanges:s,showMultiFilterOperators:a,disableMultiFilterOperator:l,applyMultiFilterOperatorChanges:c,focusElementRef:u,logicOperators:f=[Il.And,Il.Or],columnsSort:d,filterColumns:h,deleteIconProps:p={},logicOperatorInputProps:g={},operatorInputProps:m={},columnInputProps:v={},valueInputProps:y={},readOnly:b}=t,w=st(t,njt),S=Kn(),_=ut(S,Ov),E=ut(S,y6e),T=ut(S,Hs),k=fr(),P=fr(),I=fr(),R=fr(),F=nn(),A=ijt(F),L=M.useRef(null),$=M.useRef(null),j=T.logicOperator??Il.And,V=i&&f.length>0,U=F.slotProps?.baseFormControl||{},N=(F.slotProps?.baseSelect||{}).native??!1,B=F.slotProps?.baseInputLabel||{},H=F.slotProps?.baseSelectOption||{},{InputComponentProps:Q}=y,Y=st(y,rjt),{filteredColumns:Z,selectedField:ge}=M.useMemo(()=>{let ce=r.field;const pe=_[r.field].filterable===!1?_[r.field]:null;if(pe)return{filteredColumns:[pe],selectedField:ce};if(h===void 0||typeof h!="function")return{filteredColumns:E,selectedField:ce};const J=h({field:r.field,columns:E,currentFilters:T?.items||[]});return{filteredColumns:E.filter(te=>{const ae=J.includes(te.field);return te.field===r.field&&!ae&&(ce=void 0),ae}),selectedField:ce}},[h,T?.items,E,r.field,_]),ne=M.useMemo(()=>{switch(d){case"asc":return Z.sort((ce,pe)=>qwe.compare(Ak(ce),Ak(pe)));case"desc":return Z.sort((ce,pe)=>-qwe.compare(Ak(ce),Ak(pe)));default:return Z}},[Z,d]),ie=r.field?S.current.getColumn(r.field):null,fe=M.useMemo(()=>!r.operator||!ie?null:ie.filterOperators?.find(ce=>ce.value===r.operator),[r,ie]),ve=M.useCallback(ce=>{const pe=ce.target.value,J=S.current.getColumn(pe);if(J.field===ie.field)return;const te=J.filterOperators.find(Pe=>Pe.value===r.operator)||J.filterOperators[0];let we=!te.InputComponent||te.InputComponent!==fe?.InputComponent||J.type!==ie.type?void 0:r.value;if(J.type==="singleSelect"&&we!==void 0){const Pe=J,ee=rw(Pe);Array.isArray(we)?we=we.filter(re=>X5(re,ee,Pe?.getOptionValue)!==void 0):X5(r.value,ee,Pe?.getOptionValue)===void 0&&(we=void 0)}s(X({},r,{field:pe,operator:te.value,value:we}))},[S,s,r,ie,fe]),se=M.useCallback(ce=>{const pe=ce.target.value,J=ie?.filterOperators.find(ae=>ae.value===pe),te=!J?.InputComponent||J?.InputComponent!==fe?.InputComponent;s(X({},r,{operator:pe,value:te?void 0:r.value}))},[s,r,ie,fe]),ue=M.useCallback(ce=>{const pe=ce.target.value===Il.And.toString()?Il.And:Il.Or;c(pe)},[c]),G=()=>{o(r)};return M.useImperativeHandle(u,()=>({focus:()=>{fe?.InputComponent?L?.current?.focus():$.current.focus()}}),[fe]),O.jsxs(ojt,X({className:A.root,"data-id":r.id,ownerState:F},w,{ref:n,children:[O.jsx(sjt,X({variant:"standard",as:F.slots.baseFormControl},U,p,{className:Re(A.deleteIcon,U.className,p.className),ownerState:F,children:O.jsx(F.slots.baseIconButton,X({"aria-label":S.current.getLocaleText("filterPanelDeleteIconLabel"),title:S.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:G,size:"small",disabled:b},F.slotProps?.baseIconButton,{children:O.jsx(F.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),O.jsx(ajt,X({variant:"standard",as:F.slots.baseFormControl},U,g,{sx:[V?{display:"flex"}:{display:"none"},a?{visibility:"visible"}:{visibility:"hidden"},U.sx,g.sx],className:Re(A.logicOperatorInput,U.className,g.className),ownerState:F,children:O.jsx(F.slots.baseSelect,X({inputProps:{"aria-label":S.current.getLocaleText("filterPanelLogicOperator")},value:j??"",onChange:ue,disabled:!!l||f.length===1,native:N},F.slotProps?.baseSelect,{children:f.map(ce=>M.createElement(F.slots.baseSelectOption,X({},H,{native:N,key:ce.toString(),value:ce.toString()}),S.current.getLocaleText(fjt(ce))))}))})),O.jsxs(ljt,X({variant:"standard",as:F.slots.baseFormControl},U,v,{className:Re(A.columnInput,U.className,v.className),ownerState:F,children:[O.jsx(F.slots.baseInputLabel,X({},B,{htmlFor:k,id:P,children:S.current.getLocaleText("filterPanelColumns")})),O.jsx(F.slots.baseSelect,X({labelId:P,id:k,label:S.current.getLocaleText("filterPanelColumns"),value:ge??"",onChange:ve,native:N,disabled:b},F.slotProps?.baseSelect,{children:ne.map(ce=>M.createElement(F.slots.baseSelectOption,X({},H,{native:N,key:ce.field,value:ce.field}),Ak(ce)))}))]})),O.jsxs(cjt,X({variant:"standard",as:F.slots.baseFormControl},U,m,{className:Re(A.operatorInput,U.className,m.className),ownerState:F,children:[O.jsx(F.slots.baseInputLabel,X({},B,{htmlFor:I,id:R,children:S.current.getLocaleText("filterPanelOperator")})),O.jsx(F.slots.baseSelect,X({labelId:R,label:S.current.getLocaleText("filterPanelOperator"),id:I,value:r.operator,onChange:se,native:N,inputRef:$,disabled:b},F.slotProps?.baseSelect,{children:ie?.filterOperators?.map(ce=>M.createElement(F.slots.baseSelectOption,X({},H,{native:N,key:ce.value,value:ce.value}),ce.label||S.current.getLocaleText(`filterOperator${Ue(ce.value)}`)))}))]})),O.jsx(ujt,X({variant:"standard",as:F.slots.baseFormControl},U,Y,{className:Re(A.valueInput,U.className,Y.className),ownerState:F,children:fe?.InputComponent?O.jsx(fe.InputComponent,X({apiRef:S,item:r,applyValue:s,focusElementRef:L,disabled:b},fe.InputComponentProps,Q),r.field):null}))]}))}),djt=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],Ywe=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),hjt=Tr(function(t,n){const r=Kn(),i=nn(),o=ut(r,Hs),s=ut(r,y6e),a=ut(r,xFt),l=M.useRef(null),c=M.useRef(null),{logicOperators:u=[Il.And,Il.Or],columnsSort:f,filterFormProps:d,getColumnForNewFilter:h,disableAddFilterButton:p=!1,disableRemoveAllButton:g=!1}=t,m=st(t,djt),v=r.current.upsertFilterItem,y=M.useCallback(R=>{r.current.setFilterLogicOperator(R)},[r]),b=M.useCallback(()=>{let R;if(h&&typeof h=="function"){const F=h({currentFilters:o?.items||[],columns:s});if(F===null)return null;R=s.find(({field:A})=>A===F)}else R=s.find(F=>F.filterOperators?.length);return R?Ywe(R):null},[o?.items,s,h]),w=M.useCallback(()=>{if(h===void 0||typeof h!="function")return b();const R=o.items.length?o.items:[b()].filter(Boolean),F=h({currentFilters:R,columns:s});if(F===null)return null;const A=s.find(({field:L})=>L===F);return A?Ywe(A):null},[o.items,s,h,b]),S=M.useMemo(()=>o.items.length?o.items:(c.current||(c.current=b()),c.current?[c.current]:[]),[o.items,b]),_=S.length>1,{readOnlyFilters:E,validFilters:T}=M.useMemo(()=>S.reduce((R,F)=>(a[F.field]?R.validFilters.push(F):R.readOnlyFilters.push(F),R),{readOnlyFilters:[],validFilters:[]}),[S,a]),k=M.useCallback(()=>{const R=w();R&&r.current.upsertFilterItems([...S,R])},[r,w,S]),P=M.useCallback(R=>{const F=T.length===1;r.current.deleteFilterItem(R),F&&r.current.hideFilterPanel()},[r,T.length]),I=M.useCallback(()=>T.length===1&&T[0].value===void 0?(r.current.deleteFilterItem(T[0]),r.current.hideFilterPanel()):r.current.setFilterModel(X({},o,{items:E}),"removeAllFilterItems"),[r,E,o,T]);return M.useEffect(()=>{u.length>0&&o.logicOperator&&!u.includes(o.logicOperator)&&y(u[0])},[u,y,o.logicOperator]),M.useEffect(()=>{T.length>0&&l.current.focus()},[T.length]),O.jsxs(mUe,X({},m,{ref:n,children:[O.jsxs(K5t,{children:[E.map((R,F)=>O.jsx(Xwe,X({item:R,applyFilterChanges:v,deleteFilter:P,hasMultipleFilters:_,showMultiFilterOperators:F>0,disableMultiFilterOperator:F!==1,applyMultiFilterOperatorChanges:y,focusElementRef:null,readOnly:!0,logicOperators:u,columnsSort:f},d),R.id==null?F:R.id)),T.map((R,F)=>O.jsx(Xwe,X({item:R,applyFilterChanges:v,deleteFilter:P,hasMultipleFilters:_,showMultiFilterOperators:E.length+F>0,disableMultiFilterOperator:E.length+F!==1,applyMultiFilterOperatorChanges:y,focusElementRef:F===T.length-1?l:null,logicOperators:u,columnsSort:f},d),R.id==null?F+E.length:R.id))]}),!i.disableMultipleColumnsFiltering&&!(p&&g)?O.jsxs(tjt,{children:[p?O.jsx("span",{}):O.jsx(i.slots.baseButton,X({onClick:k,startIcon:O.jsx(i.slots.filterPanelAddIcon,{})},i.slotProps?.baseButton,{children:r.current.getLocaleText("filterPanelAddFilter")})),!g&&T.length>0?O.jsx(i.slots.baseButton,X({onClick:I,startIcon:O.jsx(i.slots.filterPanelRemoveAllIcon,{})},i.slotProps?.baseButton,{children:r.current.getLocaleText("filterPanelRemoveAll")})):null]}):null]}))}),pjt=(e,t)=>{const n=new Set(Object.keys(e).filter(o=>e[o]===!1)),r=new Set(Object.keys(t).filter(o=>t[o]===!1));if(n.size!==r.size)return!1;let i=!0;return n.forEach(o=>{r.has(o)||(i=!1)}),i},gjt=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,mjt=e=>{const{classes:t}=e;return Xe({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},pr,t)},Qwe=new Intl.Collator;function vjt(e){const t=Kn(),n=M.useRef(null),r=ut(t,Ff),i=od(()=>Cf(t)).current,o=ut(t,Cf),s=nn(),[a,l]=M.useState(""),c=mjt(s),{sort:u,searchPredicate:f=gjt,autoFocusSearchField:d=!0,disableShowHideToggle:h=!1,disableResetButton:p=!1,toggleAllMode:g="all",getTogglableColumns:m,searchInputProps:v}=e,y=M.useMemo(()=>pjt(o,i),[o,i]),b=M.useMemo(()=>{switch(u){case"asc":return[...r].sort((L,$)=>Qwe.compare(L.headerName||L.field,$.headerName||$.field));case"desc":return[...r].sort((L,$)=>-Qwe.compare(L.headerName||L.field,$.headerName||$.field));default:return r}},[r,u]),w=L=>{const{name:$}=L.target;t.current.setColumnVisibility($,o[$]===!1)},S=M.useMemo(()=>{const L=m?m(b):null,$=L?b.filter(({field:j})=>L.includes(j)):b;return a?$.filter(j=>f(j,a.toLowerCase())):$},[b,a,f,m]),_=M.useCallback(L=>{const $=Cf(t),j=X({},$),V=m?m(r):null;return(g==="filteredOnly"?S:r).forEach(U=>{U.hideable&&(V==null||V.includes(U.field))&&(L?delete j[U.field]:j[U.field]=!1)}),t.current.setColumnVisibilityModel(j)},[t,r,m,g,S]),E=M.useCallback(L=>{l(L.target.value)},[]),T=M.useMemo(()=>S.filter(L=>L.hideable),[S]),k=M.useMemo(()=>T.every(L=>o[L.field]==null||o[L.field]!==!1),[o,T]),P=M.useMemo(()=>T.every(L=>o[L.field]===!1),[o,T]),I=M.useRef(null);M.useEffect(()=>{d?n.current.focus():I.current&&typeof I.current.focus=="function"&&I.current.focus()},[d]);let R=!1;const F=L=>R===!1&&L.hideable!==!1?(R=!0,!0):!1,A=M.useCallback(()=>{l(""),n.current.focus()},[]);return O.jsxs(M.Fragment,{children:[O.jsx(bjt,{className:c.header,ownerState:s,children:O.jsx(xjt,X({as:s.slots.baseTextField,ownerState:s,placeholder:t.current.getLocaleText("columnsManagementSearchTitle"),inputRef:n,className:c.searchInput,value:a,onChange:E,variant:"outlined",size:"small",type:"search",InputProps:{startAdornment:O.jsx(s.slots.baseInputAdornment,{position:"start",children:O.jsx(s.slots.quickFilterIcon,{})}),endAdornment:O.jsx(s.slots.baseIconButton,X({"aria-label":t.current.getLocaleText("columnsManagementDeleteIconLabel"),size:"small",sx:[a?{visibility:"visible"}:{visibility:"hidden"}],tabIndex:-1,onClick:A},s.slotProps?.baseIconButton,{children:O.jsx(s.slots.quickFilterClearIcon,{fontSize:"small"})}))},inputProps:{"aria-label":t.current.getLocaleText("columnsManagementSearchTitle")},autoComplete:"off",fullWidth:!0},s.slotProps?.baseTextField,v))}),O.jsxs(yjt,{className:c.root,ownerState:s,children:[S.map(L=>O.jsx(oh,{className:c.row,control:O.jsx(s.slots.baseCheckbox,X({disabled:L.hideable===!1,checked:o[L.field]!==!1,onClick:w,name:L.field,sx:{p:.5},inputRef:F(L)?I:void 0},s.slotProps?.baseCheckbox)),label:L.headerName||L.field},L.field)),S.length===0&&O.jsx(Sjt,{ownerState:s,children:t.current.getLocaleText("columnsManagementNoColumns")})]}),(!h||!p)&&S.length>0?O.jsxs(wjt,{ownerState:s,className:c.footer,children:[h?O.jsx("span",{}):O.jsx(oh,{control:O.jsx(s.slots.baseCheckbox,X({disabled:T.length===0,checked:k,indeterminate:!k&&!P,onClick:()=>_(!k),name:t.current.getLocaleText("columnsManagementShowHideAllText"),sx:{p:.5}},s.slotProps?.baseCheckbox)),label:t.current.getLocaleText("columnsManagementShowHideAllText")}),p?null:O.jsx(s.slots.baseButton,X({onClick:()=>t.current.setColumnVisibilityModel(i),disabled:y},s.slotProps?.baseButton,{children:t.current.getLocaleText("columnsManagementReset")}))]}):null]})}const yjt=Oe("div",{name:"MuiDataGrid",slot:"ColumnsManagement",overridesResolver:(e,t)=>t.columnsManagement})(({theme:e})=>({padding:e.spacing(0,3,1.5),display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,alignItems:"flex-start"})),bjt=Oe("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader",overridesResolver:(e,t)=>t.columnsManagementHeader})(({theme:e})=>({padding:e.spacing(1.5,3)})),xjt=Oe(Ii,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput",overridesResolver:(e,t)=>t.columnsManagementSearchInput})(({theme:e})=>({[`& .${Xs.root}`]:{padding:e.spacing(0,1.5,0,1.5)},[`& .${Xs.input}::-webkit-search-decoration, & .${Xs.input}::-webkit-search-cancel-button, & .${Xs.input}::-webkit-search-results-button, - & .${Xs.input}::-webkit-search-results-decoration`]:{display:"none"}})),V4t=Oe("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter",overridesResolver:(e,t)=>t.columnsManagementFooter})(({theme:e})=>({padding:e.spacing(.5,1,.5,3),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${e.palette.divider}`})),W4t=Oe("div")(({theme:e})=>({padding:e.spacing(.5,0),color:e.palette.grey[500]})),H4t=Er(function(t,n){const{children:r,slotProps:i={}}=t,o=i.button||{},s=i.tooltip||{},a=Kn(),l=tn(),c=ur(),u=ur(),[f,d]=M.useState(!1),h=M.useRef(null),p=zn(n,h),g=y=>{d(b=>!b),o.onClick?.(y)},m=()=>d(!1),v=y=>{y.key==="Tab"&&y.preventDefault(),x8e(y.key)&&m()};return r==null?null:O.jsxs(M.Fragment,{children:[O.jsx(l.slots.baseTooltip,X({title:a.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},l.slotProps?.baseTooltip,s,{children:O.jsx(l.slots.baseButton,X({size:"small",startIcon:O.jsx(l.slots.exportIcon,{}),"aria-expanded":f,"aria-label":a.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":f?u:void 0,id:c},l.slotProps?.baseButton,o,{onClick:g,ref:p,children:a.current.getLocaleText("toolbarExport")}))})),O.jsx(Lce,{open:f,target:h.current,onClose:m,position:"bottom-start",children:O.jsx(nS,{id:u,className:ve.menuList,"aria-labelledby":c,onKeyDown:v,autoFocusItem:f,children:M.Children.map(r,y=>M.isValidElement(y)?M.cloneElement(y,{hideMenu:m}):y)})})]})}),G4t=["hideMenu","options"],q4t=["hideMenu","options"],X4t=["csvOptions","printOptions","excelOptions"];function Y4t(e){const t=Kn(),{hideMenu:n,options:r}=e,i=it(e,G4t);return O.jsx(tr,X({onClick:()=>{t.current.exportDataAsCsv(r),n?.()}},i,{children:t.current.getLocaleText("toolbarExportCSV")}))}function Q4t(e){const t=Kn(),{hideMenu:n,options:r}=e,i=it(e,q4t);return O.jsx(tr,X({onClick:()=>{t.current.exportDataAsPrint(r),n?.()}},i,{children:t.current.getLocaleText("toolbarExportPrint")}))}Er(function(t,n){const r=t,{csvOptions:i={},printOptions:o={},excelOptions:s}=r,a=it(r,X4t),c=Kn().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:s,csvOptions:i,printOptions:o}).sort((u,f)=>u.componentName>f.componentName?1:-1);return c.length===0?null:O.jsx(H4t,X({},a,{ref:n,children:c.map((u,f)=>M.cloneElement(u.component,{key:f}))}))});const K4t=["className","selectedRowCount"],Z4t=e=>{const{classes:t}=e;return Xe({root:["selectedRowCount"]},hr,t)},J4t=Qn("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),e6t=Er(function(t,n){const{className:r,selectedRowCount:i}=t,o=it(t,K4t),s=Kn(),a=tn(),l=Z4t(a),c=s.current.getLocaleText("footerRowSelected")(i);return O.jsx(J4t,X({className:Re(l.root,r),ownerState:a},o,{ref:n,children:c}))}),t6t=Er(function(t,n){const r=Kn(),i=tn(),o=ut(r,CNt),s=ut(r,M3t),a=ut(r,zce),l=!i.hideFooterSelectedRowCount&&s>0?O.jsx(e6t,{selectedRowCount:s}):O.jsx("div",{}),c=!i.hideFooterRowCount&&!i.pagination?O.jsx(i.slots.footerRowCount,X({},i.slotProps?.footerRowCount,{rowCount:o,visibleRowCount:a})):null,u=i.pagination&&!i.hideFooterPagination&&i.slots.pagination&&O.jsx(i.slots.pagination,X({},i.slotProps?.pagination));return O.jsxs(Djt,X({},t,{ref:n,children:[l,c,u]}))}),YM=(e,t,n,r,i,o)=>{let s;switch(e){case or.LEFT:s=r[n];break;case or.RIGHT:s=i-r[n]-t+o;break;default:s=void 0;break}return s},Sj=(e,t,n,r,i)=>{const o=t===n-1;return e===or.LEFT&&o?!0:r?e===or.LEFT?!0:e===or.RIGHT?!o:!o||i:!1},_j=(e,t)=>e===or.RIGHT&&t===0,zk={root:ve.scrollbarFiller,header:ve["scrollbarFiller--header"],borderTop:ve["scrollbarFiller--borderTop"],borderBottom:ve["scrollbarFiller--borderBottom"],pinnedRight:ve["scrollbarFiller--pinnedRight"]};function Qce({header:e,borderTop:t=!0,borderBottom:n,pinnedRight:r}){return O.jsx("div",{role:"presentation",className:Re(zk.root,e&&zk.header,t&&zk.borderTop,n&&zk.borderBottom,r&&zk.pinnedRight)})}const n6t=Qn("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay",overridesResolver:(e,t)=>t.skeletonLoadingOverlay})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),r6t=e=>{const{classes:t}=e;return Xe({root:["skeletonLoadingOverlay"]},hr,t)},r_e=e=>parseInt(e.getAttribute("data-colindex"),10),i6t=Er(function(t,n){const r=tn(),{slots:i}=r,o=bi(),s=r6t({classes:r.classes}),a=M.useRef(null),l=zn(a,n),c=Kn(),u=ut(c,Is),f=u?.viewportInnerSize.height??0,d=Math.ceil(f/u.rowHeight),h=ut(c,MU),p=ut(c,Pb),g=M.useMemo(()=>p.filter(_=>_<=h).length,[h,p]),m=ut(c,Mo),v=M.useMemo(()=>m.slice(0,g),[m,g]),y=ut(c,NT),b=M.useCallback(_=>{if(y.left.findIndex(E=>E.field===_)!==-1)return or.LEFT;if(y.right.findIndex(E=>E.field===_)!==-1)return or.RIGHT},[y.left,y.right]),w=M.useMemo(()=>{const _=[];for(let E=0;Efe.field===P.field):k-y.left.length,j=u.hasScrollY?u.scrollbarSize:0,V=jU({},o,R,YM(R,P.computedWidth,k,p,u.columnsTotalWidth,j)),U=u.columnsTotalWidth0},`skeleton-scrollbar-filler-${E}`))}_.push(O.jsx("div",{className:Re(ve.row,ve.rowSkeleton,E===0&&ve["row--firstVisible"]),children:T},`skeleton-row-${E}`))}return _},[i,v,y,d,r.showCellVerticalBorder,u,p,b,o]);return Ft(c,"columnResize",_=>{const{colDef:E,width:T}=_,k=a.current?.querySelectorAll(`[data-field="${Mv(E.field)}"]`);if(!k)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const P=v.findIndex($=>$.field===E.field),R=b(E.field),I=R===or.LEFT,F=R===or.RIGHT,A=getComputedStyle(k[0]).getPropertyValue("--width"),L=parseInt(A,10)-T;k&&k.forEach($=>{$.style.setProperty("--width",`${T}px`)}),I&&a.current?.querySelectorAll(`.${ve["cell--pinnedLeft"]}`)?.forEach(j=>{r_e(j)>P&&(j.style.left=`${parseInt(getComputedStyle(j).left,10)-L}px`)}),F&&a.current?.querySelectorAll(`.${ve["cell--pinnedRight"]}`)?.forEach(j=>{r_e(j)({maxHeight:"calc(100% + 1px)",flexGrow:1,[`& .${A1.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${A1.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),u6t=(e,t)=>({from:n,to:r,count:i,page:o})=>e({from:n,to:r,count:i,page:o,estimated:t}),f6t=({from:e,to:t,count:n,estimated:r})=>r?`${e}–${t} of ${n!==-1?n:`more than ${r>t?r:t}`}`:`${e}–${t} of ${n!==-1?n:`more than ${t}`}`,d6t=Er(function(t,n){const r=Kn(),i=tn(),o=ut(r,tl),s=ut(r,zC),a=ut(r,GVe),{paginationMode:l,loading:c,estimatedRowCount:u}=i,f=M.useMemo(()=>s===-1&&l==="server"&&c?{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}:{},[c,l,s]),d=M.useMemo(()=>Math.max(0,a-1),[a]),h=M.useMemo(()=>s===-1||o.page<=d?o.page:d,[d,o.page,s]),p=M.useCallback(w=>{const S=Number(w.target.value);r.current.setPageSize(S)},[r]),g=M.useCallback((w,S)=>{r.current.setPage(S)},[r]),v=(w=>{for(let S=0;S{const{classes:t}=e;return Xe({root:["rowCount"]},hr,t)},g6t=Qn("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),m6t=Er(function(t,n){const{className:r,rowCount:i,visibleRowCount:o}=t,s=it(t,h6t),a=Kn(),l=tn(),c=p6t(l);if(i===0)return null;const u=ot?!!v6t(e):!1),w6t=Er(function(t,n){const{selected:r,rowId:i,row:o,index:s,style:a,rowHeight:l,className:c,visibleColumns:u,pinnedColumns:f,offsetLeft:d,columnsTotalWidth:h,firstColumnIndex:p,lastColumnIndex:g,focusedColumnIndex:m,isFirstVisible:v,isLastVisible:y,isNotVisible:b,showBottomBorder:w,scrollbarWidth:S,gridHasFiller:_,onClick:E,onDoubleClick:T,onMouseEnter:k,onMouseLeave:P,onMouseOut:R,onMouseOver:I}=t,F=it(t,b6t),A=ud(),L=Gce(),$=M.useRef(null),j=tn(),V=Wce(A),U=ut(A,zd),z=ut(A,mS),N=ut(A,Pb),B=j.rowReordering,H=ZA(A,x6t,B),Q=zn($,n),Y=A.current.getRowNode(i),Z=ZA(A,u8e,{rowId:i,editMode:j.editMode}),pe=j.editMode===eg.Row,ie=m!==void 0,ne=ie&&m>=f.left.length&&m=g,me=y6t(j.classes,{root:["row",r&&"selected",pe&&"row--editable",Z&&"row--editing",v&&"row--firstVisible",y&&"row--lastVisible",w&&"row--borderBottom",l==="auto"&&"row--dynamicHeight"]}),se=L.hooks.useGridRowAriaAttributes();M.useLayoutEffect(()=>{if(V.range){const xe=A.current.getRowIndexRelativeToVisibleRows(i);xe!==void 0&&A.current.unstable_setLastMeasuredRowIndex(xe)}if($.current&&l==="auto")return A.current.observeRowHeight($.current,i)},[A,V.range,l,i]);const ue=M.useCallback((xe,re)=>Ee=>{FD(Ee)||A.current.getRow(i)&&(A.current.publishEvent(xe,A.current.getRowParams(i),Ee),re&&re(Ee))},[A,i]),G=M.useCallback(xe=>{const Ee=xj(xe.target,ve.cell)?.getAttribute("data-field");Ee&&(Ee===BT.field||Ee===IU||Ee==="__reorder__"||A.current.getCellMode(i,Ee)===ni.Edit||A.current.getColumn(Ee)?.type===AU)||ue("rowClick",E)(xe)},[A,E,ue,i]),{slots:ce,slotProps:he,disableColumnReorder:J}=j,te=ut(A,()=>X({},A.current.getRowHeightEntry(i)),Mce),ae=M.useMemo(()=>{if(b)return{opacity:0,width:0,height:0};const xe=X({},a,{maxHeight:l==="auto"?"none":l,minHeight:l,"--height":typeof l=="number"?`${l}px`:l});if(te.spacingTop){const re=j.rowSpacingType==="border"?"borderTopWidth":"marginTop";xe[re]=te.spacingTop}if(te.spacingBottom){const re=j.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let Ee=xe[re];typeof Ee!="number"&&(Ee=parseInt(Ee||"0",10)),Ee+=te.spacingBottom,xe[re]=Ee}return xe},[b,l,a,te,j.rowSpacingType]),we=A.current.unstable_applyPipeProcessors("rowClassName",[],i),Pe=se(Y,s);if(typeof j.getRowClassName=="function"){const xe=s-(V.range?.firstRowIndex||0),re=X({},A.current.getRowParams(i),{isFirstVisible:xe===0,isLastVisible:xe===V.rows.length-1,indexRelativeToCurrentPage:xe});we.push(j.getRowClassName(re))}const ee=(xe,re,Ee,ke,je=or.NONE)=>{const De=A.current.unstable_getCellColSpanInfo(i,Ee);if(De?.spannedByColSpan)return null;const ze=De?.cellProps.width??xe.computedWidth,Je=De?.cellProps.colSpan??1,mt=YM(je,xe.computedWidth,Ee,N,h,S);if(Y.type==="skeletonRow")return O.jsx(ce.skeletonCell,{type:xe.type,width:ze,height:l,field:xe.field,align:xe.align},xe.field);const Me=xe.field==="__reorder__",st=!(J||xe.disableReorder),Fe=H&&!U.length&&z<=1,ht=!(st||Me&&Fe),gt=je===or.VIRTUAL,St=_j(je,re),on=Sj(je,re,ke,j.showCellVerticalBorder,_);return O.jsx(ce.cell,X({column:xe,width:ze,rowId:i,align:xe.align||"left",colIndex:Ee,colSpan:Je,disableDragEvents:ht,isNotVisible:gt,pinnedOffset:mt,pinnedPosition:je,showLeftBorder:St,showRightBorder:on,row:o,rowNode:Y},he?.cell),xe.field)},oe=f.left.map((xe,re)=>ee(xe,re,re,f.left.length,or.LEFT)),Se=f.right.map((xe,re)=>{const Ee=u.length-f.right.length+re;return ee(xe,re,Ee,f.right.length,or.RIGHT)}),ye=u.length-f.left.length-f.right.length,be=[];ne&&be.push(ee(u[m],m-f.left.length,m,ye,or.VIRTUAL));for(let xe=p;xe0,borderTop:!v})]}))}),S6t=Pv(w6t),_6t=()=>{const e=ud(),t=tn(),n=ut(e,Mo),r=ut(e,Nce),i=ut(e,DD),o=ut(e,dVe);return{role:"grid","aria-colcount":n.length,"aria-rowcount":i+1+o+r,"aria-multiselectable":jce(t)}},C6t=()=>{const e=ud(),t=ut(e,R0),n=ut(e,DD);return M.useCallback((r,i)=>{const o={},s=i+n+2;return o["aria-rowindex"]=s,e.current.isRowSelectable(r.id)&&(o["aria-selected"]=t[r.id]!==void 0),o},[e,t,n])};function O6t({privateApiRef:e,configuration:t,props:n,children:r}){const i=M.useRef(e.current.getPublicApi());return O.jsx(l8e.Provider,{value:t,children:O.jsx(eVe.Provider,{value:n,children:O.jsx(n8e.Provider,{value:e,children:O.jsx(JUe.Provider,{value:i,children:r})})})})}const E6t=e=>{const t=M.useRef(null),n=M.useRef(null),r=M.useRef(null),i=M.useRef(null),o=M.useRef(null),s=M.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:r,virtualScrollbarVerticalRef:i,virtualScrollbarHorizontalRef:o,columnHeadersContainerRef:s})},T6t=e=>{const t=bi();e.current.state.isRtl===void 0&&(e.current.state.isRtl=t);const n=M.useRef(!0);M.useEffect(()=>{n.current?n.current=!1:e.current.setState(r=>X({},r,{isRtl:t}))},[e,t])},P6t=$Nt()&&window.localStorage.getItem("DEBUG")!=null,nM=()=>{},k6t={debug:nM,info:nM,warn:nM,error:nM},i_e=["debug","info","warn","error"];function o_e(e,t,n=console){const r=i_e.indexOf(t);if(r===-1)throw new Error(`MUI X: Log level ${t} not recognized.`);return i_e.reduce((o,s,a)=>(a>=r?o[s]=(...l)=>{const[c,...u]=l;n[s](`MUI X: ${e} - ${c}`,...u)}:o[s]=nM,o),{})}const M6t=(e,t)=>{const n=M.useCallback(r=>P6t?o_e(r,"debug",t.logger):t.logLevel?o_e(r,t.logLevel.toString(),t.logger):k6t,[t.logLevel,t.logger]);qn(e,{getLogger:n},"private")};class A6t{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let i=this.events[t];i||(i={highPriority:new Map,regular:new Map},this.events[t]=i),r.isFirst?i.highPriority.set(n,!0):i.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const i=Array.from(r.highPriority.keys()),o=Array.from(r.regular.keys());for(let s=i.length-1;s>=0;s-=1){const a=i[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(r=>r(n))},this.value=t,this.listeners=new Set}}const _8e=Symbol("mui.api_private"),R6t=e=>e.isPropagationStopped!==void 0;let s_e=0;function I6t(e){const t=e.current?.[_8e];if(t)return t;const n={},r={state:n,store:Kce.create(n),instanceId:{id:s_e}};return s_e+=1,r.getPublicApi=()=>e.current,r.register=(i,o)=>{Object.keys(o).forEach(s=>{const a=o[s],l=r[s];if(l?.spying===!0?l.target=a:r[s]=a,i==="public"){const c=e.current,u=c[s];u?.spying===!0?u.target=a:c[s]=a}})},r.register("private",{caches:{},eventManager:new A6t}),r}function D6t(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[_8e]:e.current}}function L6t(e,t){const n=M.useRef(null),r=M.useRef(null);r.current||(r.current=I6t(n)),n.current||(n.current=D6t(r));const i=M.useCallback((...s)=>{const[a,l,c={}]=s;if(c.defaultMuiPrevented=!1,R6t(c)&&c.isPropagationStopped())return;const u=t.signature===Lf.DataGridPro||t.signature===Lf.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(a,l,c,u)},[r,t.signature]),o=M.useCallback((s,a,l)=>{r.current.eventManager.on(s,a,l);const c=r.current;return()=>{c.eventManager.removeListener(s,a)}},[r]);return qn(r,{subscribeEvent:o,publishEvent:i},"public"),e&&!e.current?.state&&(e.current=n.current),M.useImperativeHandle(e,()=>n.current,[n]),M.useEffect(()=>{const s=r.current;return()=>{s.publishEvent("unmount")}},[r]),r}const F6t=(e,t)=>{const n=M.useCallback(r=>{if(t.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return t.localeText[r]},[t.localeText]);e.current.register("public",{getLocaleText:n})},$6t=e=>{const t=M.useRef({}),n=M.useRef(!1),r=M.useCallback(u=>{n.current||!u||(n.current=!0,Object.values(u.appliers).forEach(f=>{f()}),n.current=!1)},[]),i=M.useCallback((u,f,d)=>{t.current[u]||(t.current[u]={processors:new Map,processorsAsArray:[],appliers:{}});const h=t.current[u];return h.processors.get(f)!==d&&(h.processors.set(f,d),h.processorsAsArray=Array.from(t.current[u].processors.values()).filter(g=>g!==null),r(h)),()=>{t.current[u].processors.set(f,null),t.current[u].processorsAsArray=Array.from(t.current[u].processors.values()).filter(g=>g!==null)}},[r]),o=M.useCallback((u,f,d)=>(t.current[u]||(t.current[u]={processors:new Map,processorsAsArray:[],appliers:{}}),t.current[u].appliers[f]=d,()=>{const h=t.current[u].appliers,p=it(h,[f].map(tw));t.current[u].appliers=p}),[]),s=M.useCallback(u=>{r(t.current[u])},[r]),a=M.useCallback((...u)=>{const[f,d,h]=u;if(!t.current[f])return d;const p=t.current[f].processorsAsArray;let g=d;for(let m=0;m{const i=M.useRef(null),o=M.useRef(`mui-${Math.round(Math.random()*1e9)}`),s=M.useCallback(()=>{i.current=e.current.registerPipeProcessor(t,o.current,n)},[e,n,t]);MD(()=>{r&&s()});const a=M.useRef(!0);M.useEffect(()=>(a.current?a.current=!1:r&&s(),()=>{i.current&&(i.current(),i.current=null)}),[s,r])},Zce=(e,t,n)=>{const r=M.useRef(null),i=M.useRef(`mui-${Math.round(Math.random()*1e9)}`),o=M.useCallback(()=>{r.current=e.current.registerPipeApplier(t,i.current,n)},[e,n,t]);MD(()=>{o()});const s=M.useRef(!0);M.useEffect(()=>(s.current?s.current=!1:o(),()=>{r.current&&(r.current(),r.current=null)}),[o])},Cj=(e,t,n,r)=>{const i=M.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);MD(()=>{i()});const o=M.useRef(!0);M.useEffect(()=>{o.current?o.current=!1:i()},[i])},hw="none",a_e={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},N6t=e=>{const t=M.useRef(new Map),n=M.useRef({}),r=M.useCallback((l,c,u)=>{const f=()=>{const p=n.current[c],g=it(p,[l].map(tw));n.current[c]=g};n.current[c]||(n.current[c]={});const d=n.current[c],h=d[l];return d[l]=u,!h||h===u||l===e.current.getActiveStrategy(a_e[c])&&e.current.publishEvent("activeStrategyProcessorChange",c),f},[e]),i=M.useCallback((l,c)=>{const u=e.current.getActiveStrategy(a_e[l]);if(u==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const f=n.current[l];if(!f||!f[u])throw new Error(`No processor found for processor "${l}" on strategy "${u}"`);const d=f[u];return d(c)},[e]),o=M.useCallback(l=>Array.from(t.current.entries()).find(([,f])=>f.group!==l?!1:f.isAvailable())?.[0]??hw,[]),s=M.useCallback((l,c,u)=>{t.current.set(c,{group:l,isAvailable:u}),e.current.publishEvent("strategyAvailabilityChange")},[e]);qn(e,{registerStrategyProcessor:r,applyStrategyProcessor:i,getActiveStrategy:o,setStrategyAvailability:s},"private")},z6t=e=>{const t=M.useRef({}),n=M.useCallback(l=>{t.current[l.stateId]=l},[]),r=M.useCallback((l,c)=>{let u;if(FNt(l)?u=l(e.current.state):u=l,e.current.state===u)return!1;let f=!1;const d=[];if(Object.keys(t.current).forEach(h=>{const p=t.current[h],g=p.stateSelector(e.current.state,e.current.instanceId),m=p.stateSelector(u,e.current.instanceId);m!==g&&(d.push({stateId:p.stateId,hasPropChanged:m!==p.propModel}),p.propModel!==void 0&&m!==p.propModel&&(f=!0))}),d.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${d[0].stateId}, therefore, you're not allowed to update ${d.map(h=>h.stateId).join(", ")} in the same transaction.`);if(f||(e.current.state=u,e.current.publishEvent("stateChange",u),e.current.store.update(u)),d.length===1){const{stateId:h,hasPropChanged:p}=d[0],g=t.current[h],m=g.stateSelector(u,e.current.instanceId);g.propOnChange&&p&&g.propOnChange(m,{reason:c,api:e.current}),f||e.current.publishEvent(g.changeEvent,m,{reason:c})}return!f},[e]),i=M.useCallback((l,c,u)=>e.current.setState(f=>X({},f,{[l]:c(f[l])}),u),[e]),o=M.useCallback(()=>{},[]),s={setState:r,forceUpdate:o},a={updateControlState:i,registerControlState:n};qn(e,s,"public"),qn(e,a,"private")},j6t=(e,t)=>X({},e,{props:{getRowId:t.getRowId}}),B6t=(e,t)=>{M.useEffect(()=>{e.current.setState(n=>X({},n,{props:{getRowId:t.getRowId}}))},[e,t.getRowId])},U6t=(e,t)=>{const n=L6t(e,t);return E6t(n),B6t(n,t),T6t(n),M6t(n,t),z6t(n),$6t(n),N6t(n),F6t(n,t),n.current.register("private",{rootProps:t}),n},_s=(e,t,n)=>{const r=M.useRef(!1);r.current||(t.current.state=e(t.current.state,n,t),r.current=!0)};function lne(e,t){if(e==null)return"";const n=typeof e=="string"?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const r=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@"," ","\r"].includes(r[0])?`"'${r}"`:[t.delimiter,` -`,"\r",'"'].some(i=>n.includes(i))?`"${r}"`:r}return n}const C8e=(e,t)=>{const{csvOptions:n,ignoreValueFormatter:r}=t;let i;if(r){const o=e.colDef.type;o==="number"?i=String(e.value):o==="date"||o==="dateTime"?i=e.value?.toISOString():typeof e.value?.toString=="function"?i=e.value.toString():i=e.value}else i=e.formattedValue;return lne(i,n)};class cne{constructor(t){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.csvOptions):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const V6t=({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:i})=>{const o=new cne({csvOptions:r});return t.forEach(s=>{const a=n(e,s.field);o.addValue(C8e(a,{ignoreValueFormatter:i,csvOptions:r}))}),o.getRowString()};function W6t(e){const{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:i,apiRef:o}=e,s=n.reduce((f,d)=>`${f}${V6t({id:d,columns:t,getCellParams:o.current.getCellParams,ignoreValueFormatter:i,csvOptions:r})}\r -`,"").trim();if(!r.includeHeaders)return s;const a=t.filter(f=>f.field!==BT.field),l=[];if(r.includeColumnGroupsHeaders){const f=o.current.getAllGroupDetails();let d=0;const h=a.reduce((p,g)=>{const m=o.current.getColumnGroupPath(g.field);return p[g.field]=m,d=Math.max(d,m.length),p},{});for(let p=0;p{const v=(h[m.field]||[])[p],y=f[v];g.addValue(y?y.headerName||y.groupId:"")})}}const c=new cne({csvOptions:r,sanitizeCellValue:lne});return a.forEach(f=>{c.addValue(f.headerName||f.field)}),l.push(c),`${`${l.map(f=>f.getRowString()).join(`\r + & .${Xs.input}::-webkit-search-results-decoration`]:{display:"none"}})),wjt=Oe("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter",overridesResolver:(e,t)=>t.columnsManagementFooter})(({theme:e})=>({padding:e.spacing(.5,1,.5,3),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${e.palette.divider}`})),Sjt=Oe("div")(({theme:e})=>({padding:e.spacing(.5,0),color:e.palette.grey[500]})),_jt=Tr(function(t,n){const{children:r,slotProps:i={}}=t,o=i.button||{},s=i.tooltip||{},a=Kn(),l=nn(),c=fr(),u=fr(),[f,d]=M.useState(!1),h=M.useRef(null),p=zn(n,h),g=y=>{d(b=>!b),o.onClick?.(y)},m=()=>d(!1),v=y=>{y.key==="Tab"&&y.preventDefault(),pUe(y.key)&&m()};return r==null?null:O.jsxs(M.Fragment,{children:[O.jsx(l.slots.baseTooltip,X({title:a.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},l.slotProps?.baseTooltip,s,{children:O.jsx(l.slots.baseButton,X({size:"small",startIcon:O.jsx(l.slots.exportIcon,{}),"aria-expanded":f,"aria-label":a.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":f?u:void 0,id:c},l.slotProps?.baseButton,o,{onClick:g,ref:p,children:a.current.getLocaleText("toolbarExport")}))})),O.jsx(Tle,{open:f,target:h.current,onClose:m,position:"bottom-start",children:O.jsx(Xw,{id:u,className:ye.menuList,"aria-labelledby":c,onKeyDown:v,autoFocusItem:f,children:M.Children.map(r,y=>M.isValidElement(y)?M.cloneElement(y,{hideMenu:m}):y)})})]})}),Cjt=["hideMenu","options"],Ojt=["hideMenu","options"],Ejt=["csvOptions","printOptions","excelOptions"];function Tjt(e){const t=Kn(),{hideMenu:n,options:r}=e,i=st(e,Cjt);return O.jsx(nr,X({onClick:()=>{t.current.exportDataAsCsv(r),n?.()}},i,{children:t.current.getLocaleText("toolbarExportCSV")}))}function Pjt(e){const t=Kn(),{hideMenu:n,options:r}=e,i=st(e,Ojt);return O.jsx(nr,X({onClick:()=>{t.current.exportDataAsPrint(r),n?.()}},i,{children:t.current.getLocaleText("toolbarExportPrint")}))}Tr(function(t,n){const r=t,{csvOptions:i={},printOptions:o={},excelOptions:s}=r,a=st(r,Ejt),c=Kn().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:s,csvOptions:i,printOptions:o}).sort((u,f)=>u.componentName>f.componentName?1:-1);return c.length===0?null:O.jsx(_jt,X({},a,{ref:n,children:c.map((u,f)=>M.cloneElement(u.component,{key:f}))}))});const kjt=["className","selectedRowCount"],Mjt=e=>{const{classes:t}=e;return Xe({root:["selectedRowCount"]},pr,t)},Ajt=Qn("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),Rjt=Tr(function(t,n){const{className:r,selectedRowCount:i}=t,o=st(t,kjt),s=Kn(),a=nn(),l=Mjt(a),c=s.current.getLocaleText("footerRowSelected")(i);return O.jsx(Ajt,X({className:Re(l.root,r),ownerState:a},o,{ref:n,children:c}))}),Ijt=Tr(function(t,n){const r=Kn(),i=nn(),o=ut(r,nFt),s=ut(r,l$t),a=ut(r,Ale),l=!i.hideFooterSelectedRowCount&&s>0?O.jsx(Rjt,{selectedRowCount:s}):O.jsx("div",{}),c=!i.hideFooterRowCount&&!i.pagination?O.jsx(i.slots.footerRowCount,X({},i.slotProps?.footerRowCount,{rowCount:o,visibleRowCount:a})):null,u=i.pagination&&!i.hideFooterPagination&&i.slots.pagination&&O.jsx(i.slots.pagination,X({},i.slotProps?.pagination));return O.jsxs(dzt,X({},t,{ref:n,children:[l,c,u]}))}),$M=(e,t,n,r,i,o)=>{let s;switch(e){case or.LEFT:s=r[n];break;case or.RIGHT:s=i-r[n]-t+o;break;default:s=void 0;break}return s},J5=(e,t,n,r,i)=>{const o=t===n-1;return e===or.LEFT&&o?!0:r?e===or.LEFT?!0:e===or.RIGHT?!o:!o||i:!1},ej=(e,t)=>e===or.RIGHT&&t===0,Rk={root:ye.scrollbarFiller,header:ye["scrollbarFiller--header"],borderTop:ye["scrollbarFiller--borderTop"],borderBottom:ye["scrollbarFiller--borderBottom"],pinnedRight:ye["scrollbarFiller--pinnedRight"]};function Ule({header:e,borderTop:t=!0,borderBottom:n,pinnedRight:r}){return O.jsx("div",{role:"presentation",className:Re(Rk.root,e&&Rk.header,t&&Rk.borderTop,n&&Rk.borderBottom,r&&Rk.pinnedRight)})}const Djt=Qn("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay",overridesResolver:(e,t)=>t.skeletonLoadingOverlay})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),Ljt=e=>{const{classes:t}=e;return Xe({root:["skeletonLoadingOverlay"]},pr,t)},Kwe=e=>parseInt(e.getAttribute("data-colindex"),10),Fjt=Tr(function(t,n){const r=nn(),{slots:i}=r,o=yi(),s=Ljt({classes:r.classes}),a=M.useRef(null),l=zn(a,n),c=Kn(),u=ut(c,Is),f=u?.viewportInnerSize.height??0,d=Math.ceil(f/u.rowHeight),h=ut(c,cU),p=ut(c,Cb),g=M.useMemo(()=>p.filter(_=>_<=h).length,[h,p]),m=ut(c,Mo),v=M.useMemo(()=>m.slice(0,g),[m,g]),y=ut(c,MT),b=M.useCallback(_=>{if(y.left.findIndex(E=>E.field===_)!==-1)return or.LEFT;if(y.right.findIndex(E=>E.field===_)!==-1)return or.RIGHT},[y.left,y.right]),w=M.useMemo(()=>{const _=[];for(let E=0;Efe.field===P.field):k-y.left.length,j=u.hasScrollY?u.scrollbarSize:0,V=bU({},o,I,$M(I,P.computedWidth,k,p,u.columnsTotalWidth,j)),U=u.columnsTotalWidth0},`skeleton-scrollbar-filler-${E}`))}_.push(O.jsx("div",{className:Re(ye.row,ye.rowSkeleton,E===0&&ye["row--firstVisible"]),children:T},`skeleton-row-${E}`))}return _},[i,v,y,d,r.showCellVerticalBorder,u,p,b,o]);return Ft(c,"columnResize",_=>{const{colDef:E,width:T}=_,k=a.current?.querySelectorAll(`[data-field="${Ev(E.field)}"]`);if(!k)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const P=v.findIndex($=>$.field===E.field),I=b(E.field),R=I===or.LEFT,F=I===or.RIGHT,A=getComputedStyle(k[0]).getPropertyValue("--width"),L=parseInt(A,10)-T;k&&k.forEach($=>{$.style.setProperty("--width",`${T}px`)}),R&&a.current?.querySelectorAll(`.${ye["cell--pinnedLeft"]}`)?.forEach(j=>{Kwe(j)>P&&(j.style.left=`${parseInt(getComputedStyle(j).left,10)-L}px`)}),F&&a.current?.querySelectorAll(`.${ye["cell--pinnedRight"]}`)?.forEach(j=>{Kwe(j)({maxHeight:"calc(100% + 1px)",flexGrow:1,[`& .${_1.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${_1.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),Ujt=(e,t)=>({from:n,to:r,count:i,page:o})=>e({from:n,to:r,count:i,page:o,estimated:t}),Vjt=({from:e,to:t,count:n,estimated:r})=>r?`${e}–${t} of ${n!==-1?n:`more than ${r>t?r:t}`}`:`${e}–${t} of ${n!==-1?n:`more than ${t}`}`,Wjt=Tr(function(t,n){const r=Kn(),i=nn(),o=ut(r,tl),s=ut(r,MC),a=ut(r,j6e),{paginationMode:l,loading:c,estimatedRowCount:u}=i,f=M.useMemo(()=>s===-1&&l==="server"&&c?{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}:{},[c,l,s]),d=M.useMemo(()=>Math.max(0,a-1),[a]),h=M.useMemo(()=>s===-1||o.page<=d?o.page:d,[d,o.page,s]),p=M.useCallback(w=>{const S=Number(w.target.value);r.current.setPageSize(S)},[r]),g=M.useCallback((w,S)=>{r.current.setPage(S)},[r]),v=(w=>{for(let S=0;S{const{classes:t}=e;return Xe({root:["rowCount"]},pr,t)},qjt=Qn("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),Xjt=Tr(function(t,n){const{className:r,rowCount:i,visibleRowCount:o}=t,s=st(t,Hjt),a=Kn(),l=nn(),c=Gjt(l);if(i===0)return null;const u=ot?!!Yjt(e):!1),Jjt=Tr(function(t,n){const{selected:r,rowId:i,row:o,index:s,style:a,rowHeight:l,className:c,visibleColumns:u,pinnedColumns:f,offsetLeft:d,columnsTotalWidth:h,firstColumnIndex:p,lastColumnIndex:g,focusedColumnIndex:m,isFirstVisible:v,isLastVisible:y,isNotVisible:b,showBottomBorder:w,scrollbarWidth:S,gridHasFiller:_,onClick:E,onDoubleClick:T,onMouseEnter:k,onMouseLeave:P,onMouseOut:I,onMouseOver:R}=t,F=st(t,Kjt),A=ld(),L=Nle(),$=M.useRef(null),j=nn(),V=Fle(A),U=ut(A,Fd),z=ut(A,lS),N=ut(A,Cb),B=j.rowReordering,H=BA(A,Zjt,B),Q=zn($,n),Y=A.current.getRowNode(i),Z=BA(A,iUe,{rowId:i,editMode:j.editMode}),ge=j.editMode===Jp.Row,ne=m!==void 0,ie=ne&&m>=f.left.length&&m=g,ve=Qjt(j.classes,{root:["row",r&&"selected",ge&&"row--editable",Z&&"row--editing",v&&"row--firstVisible",y&&"row--lastVisible",w&&"row--borderBottom",l==="auto"&&"row--dynamicHeight"]}),se=L.hooks.useGridRowAriaAttributes();M.useLayoutEffect(()=>{if(V.range){const be=A.current.getRowIndexRelativeToVisibleRows(i);be!==void 0&&A.current.unstable_setLastMeasuredRowIndex(be)}if($.current&&l==="auto")return A.current.observeRowHeight($.current,i)},[A,V.range,l,i]);const ue=M.useCallback((be,oe)=>Ee=>{ED(Ee)||A.current.getRow(i)&&(A.current.publishEvent(be,A.current.getRowParams(i),Ee),oe&&oe(Ee))},[A,i]),G=M.useCallback(be=>{const Ee=K5(be.target,ye.cell)?.getAttribute("data-field");Ee&&(Ee===IT.field||Ee===dU||Ee==="__reorder__"||A.current.getCellMode(i,Ee)===ni.Edit||A.current.getColumn(Ee)?.type===uU)||ue("rowClick",E)(be)},[A,E,ue,i]),{slots:ce,slotProps:pe,disableColumnReorder:J}=j,te=ut(A,()=>X({},A.current.getRowHeightEntry(i)),Sle),ae=M.useMemo(()=>{if(b)return{opacity:0,width:0,height:0};const be=X({},a,{maxHeight:l==="auto"?"none":l,minHeight:l,"--height":typeof l=="number"?`${l}px`:l});if(te.spacingTop){const oe=j.rowSpacingType==="border"?"borderTopWidth":"marginTop";be[oe]=te.spacingTop}if(te.spacingBottom){const oe=j.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let Ee=be[oe];typeof Ee!="number"&&(Ee=parseInt(Ee||"0",10)),Ee+=te.spacingBottom,be[oe]=Ee}return be},[b,l,a,te,j.rowSpacingType]),we=A.current.unstable_applyPipeProcessors("rowClassName",[],i),Pe=se(Y,s);if(typeof j.getRowClassName=="function"){const be=s-(V.range?.firstRowIndex||0),oe=X({},A.current.getRowParams(i),{isFirstVisible:be===0,isLastVisible:be===V.rows.length-1,indexRelativeToCurrentPage:be});we.push(j.getRowClassName(oe))}const ee=(be,oe,Ee,ke,ze=or.NONE)=>{const De=A.current.unstable_getCellColSpanInfo(i,Ee);if(De?.spannedByColSpan)return null;const Ve=De?.cellProps.width??be.computedWidth,Ze=De?.cellProps.colSpan??1,mt=$M(ze,be.computedWidth,Ee,N,h,S);if(Y.type==="skeletonRow")return O.jsx(ce.skeletonCell,{type:be.type,width:Ve,height:l,field:be.field,align:be.align},be.field);const Me=be.field==="__reorder__",ct=!(J||be.disableReorder),Fe=H&&!U.length&&z<=1,ht=!(ct||Me&&Fe),gt=ze===or.VIRTUAL,St=ej(ze,oe),on=J5(ze,oe,ke,j.showCellVerticalBorder,_);return O.jsx(ce.cell,X({column:be,width:Ve,rowId:i,align:be.align||"left",colIndex:Ee,colSpan:Ze,disableDragEvents:ht,isNotVisible:gt,pinnedOffset:mt,pinnedPosition:ze,showLeftBorder:St,showRightBorder:on,row:o,rowNode:Y},pe?.cell),be.field)},re=f.left.map((be,oe)=>ee(be,oe,oe,f.left.length,or.LEFT)),Se=f.right.map((be,oe)=>{const Ee=u.length-f.right.length+oe;return ee(be,oe,Ee,f.right.length,or.RIGHT)}),he=u.length-f.left.length-f.right.length,xe=[];ie&&xe.push(ee(u[m],m-f.left.length,m,he,or.VIRTUAL));for(let be=p;be0,borderTop:!v})]}))}),eBt=Cv(Jjt),tBt=()=>{const e=ld(),t=nn(),n=ut(e,Mo),r=ut(e,Mle),i=ut(e,CD),o=ut(e,s6e);return{role:"grid","aria-colcount":n.length,"aria-rowcount":i+1+o+r,"aria-multiselectable":Rle(t)}},nBt=()=>{const e=ld(),t=ut(e,E0),n=ut(e,CD);return M.useCallback((r,i)=>{const o={},s=i+n+2;return o["aria-rowindex"]=s,e.current.isRowSelectable(r.id)&&(o["aria-selected"]=t[r.id]!==void 0),o},[e,t,n])};function rBt({privateApiRef:e,configuration:t,props:n,children:r}){const i=M.useRef(e.current.getPublicApi());return O.jsx(nUe.Provider,{value:t,children:O.jsx(X4e.Provider,{value:n,children:O.jsx(Q6e.Provider,{value:e,children:O.jsx(q4e.Provider,{value:i,children:r})})})})}const iBt=e=>{const t=M.useRef(null),n=M.useRef(null),r=M.useRef(null),i=M.useRef(null),o=M.useRef(null),s=M.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:r,virtualScrollbarVerticalRef:i,virtualScrollbarHorizontalRef:o,columnHeadersContainerRef:s})},oBt=e=>{const t=yi();e.current.state.isRtl===void 0&&(e.current.state.isRtl=t);const n=M.useRef(!0);M.useEffect(()=>{n.current?n.current=!1:e.current.setState(r=>X({},r,{isRtl:t}))},[e,t])},sBt=gFt()&&window.localStorage.getItem("DEBUG")!=null,G2=()=>{},aBt={debug:G2,info:G2,warn:G2,error:G2},Zwe=["debug","info","warn","error"];function Jwe(e,t,n=console){const r=Zwe.indexOf(t);if(r===-1)throw new Error(`MUI X: Log level ${t} not recognized.`);return Zwe.reduce((o,s,a)=>(a>=r?o[s]=(...l)=>{const[c,...u]=l;n[s](`MUI X: ${e} - ${c}`,...u)}:o[s]=G2,o),{})}const lBt=(e,t)=>{const n=M.useCallback(r=>sBt?Jwe(r,"debug",t.logger):t.logLevel?Jwe(r,t.logLevel.toString(),t.logger):aBt,[t.logLevel,t.logger]);Gn(e,{getLogger:n},"private")};class cBt{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let i=this.events[t];i||(i={highPriority:new Map,regular:new Map},this.events[t]=i),r.isFirst?i.highPriority.set(n,!0):i.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const i=Array.from(r.highPriority.keys()),o=Array.from(r.regular.keys());for(let s=i.length-1;s>=0;s-=1){const a=i[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(r=>r(n))},this.value=t,this.listeners=new Set}}const vUe=Symbol("mui.api_private"),uBt=e=>e.isPropagationStopped!==void 0;let eSe=0;function fBt(e){const t=e.current?.[vUe];if(t)return t;const n={},r={state:n,store:Vle.create(n),instanceId:{id:eSe}};return eSe+=1,r.getPublicApi=()=>e.current,r.register=(i,o)=>{Object.keys(o).forEach(s=>{const a=o[s],l=r[s];if(l?.spying===!0?l.target=a:r[s]=a,i==="public"){const c=e.current,u=c[s];u?.spying===!0?u.target=a:c[s]=a}})},r.register("private",{caches:{},eventManager:new cBt}),r}function dBt(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[vUe]:e.current}}function hBt(e,t){const n=M.useRef(null),r=M.useRef(null);r.current||(r.current=fBt(n)),n.current||(n.current=dBt(r));const i=M.useCallback((...s)=>{const[a,l,c={}]=s;if(c.defaultMuiPrevented=!1,uBt(c)&&c.isPropagationStopped())return;const u=t.signature===Lf.DataGridPro||t.signature===Lf.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(a,l,c,u)},[r,t.signature]),o=M.useCallback((s,a,l)=>{r.current.eventManager.on(s,a,l);const c=r.current;return()=>{c.eventManager.removeListener(s,a)}},[r]);return Gn(r,{subscribeEvent:o,publishEvent:i},"public"),e&&!e.current?.state&&(e.current=n.current),M.useImperativeHandle(e,()=>n.current,[n]),M.useEffect(()=>{const s=r.current;return()=>{s.publishEvent("unmount")}},[r]),r}const pBt=(e,t)=>{const n=M.useCallback(r=>{if(t.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return t.localeText[r]},[t.localeText]);e.current.register("public",{getLocaleText:n})},gBt=e=>{const t=M.useRef({}),n=M.useRef(!1),r=M.useCallback(u=>{n.current||!u||(n.current=!0,Object.values(u.appliers).forEach(f=>{f()}),n.current=!1)},[]),i=M.useCallback((u,f,d)=>{t.current[u]||(t.current[u]={processors:new Map,processorsAsArray:[],appliers:{}});const h=t.current[u];return h.processors.get(f)!==d&&(h.processors.set(f,d),h.processorsAsArray=Array.from(t.current[u].processors.values()).filter(g=>g!==null),r(h)),()=>{t.current[u].processors.set(f,null),t.current[u].processorsAsArray=Array.from(t.current[u].processors.values()).filter(g=>g!==null)}},[r]),o=M.useCallback((u,f,d)=>(t.current[u]||(t.current[u]={processors:new Map,processorsAsArray:[],appliers:{}}),t.current[u].appliers[f]=d,()=>{const h=t.current[u].appliers,p=st(h,[f].map(q1));t.current[u].appliers=p}),[]),s=M.useCallback(u=>{r(t.current[u])},[r]),a=M.useCallback((...u)=>{const[f,d,h]=u;if(!t.current[f])return d;const p=t.current[f].processorsAsArray;let g=d;for(let m=0;m{const i=M.useRef(null),o=M.useRef(`mui-${Math.round(Math.random()*1e9)}`),s=M.useCallback(()=>{i.current=e.current.registerPipeProcessor(t,o.current,n)},[e,n,t]);xD(()=>{r&&s()});const a=M.useRef(!0);M.useEffect(()=>(a.current?a.current=!1:r&&s(),()=>{i.current&&(i.current(),i.current=null)}),[s,r])},Wle=(e,t,n)=>{const r=M.useRef(null),i=M.useRef(`mui-${Math.round(Math.random()*1e9)}`),o=M.useCallback(()=>{r.current=e.current.registerPipeApplier(t,i.current,n)},[e,n,t]);xD(()=>{o()});const s=M.useRef(!0);M.useEffect(()=>(s.current?s.current=!1:o(),()=>{r.current&&(r.current(),r.current=null)}),[o])},tj=(e,t,n,r)=>{const i=M.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);xD(()=>{i()});const o=M.useRef(!0);M.useEffect(()=>{o.current?o.current=!1:i()},[i])},ow="none",tSe={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},mBt=e=>{const t=M.useRef(new Map),n=M.useRef({}),r=M.useCallback((l,c,u)=>{const f=()=>{const p=n.current[c],g=st(p,[l].map(q1));n.current[c]=g};n.current[c]||(n.current[c]={});const d=n.current[c],h=d[l];return d[l]=u,!h||h===u||l===e.current.getActiveStrategy(tSe[c])&&e.current.publishEvent("activeStrategyProcessorChange",c),f},[e]),i=M.useCallback((l,c)=>{const u=e.current.getActiveStrategy(tSe[l]);if(u==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const f=n.current[l];if(!f||!f[u])throw new Error(`No processor found for processor "${l}" on strategy "${u}"`);const d=f[u];return d(c)},[e]),o=M.useCallback(l=>Array.from(t.current.entries()).find(([,f])=>f.group!==l?!1:f.isAvailable())?.[0]??ow,[]),s=M.useCallback((l,c,u)=>{t.current.set(c,{group:l,isAvailable:u}),e.current.publishEvent("strategyAvailabilityChange")},[e]);Gn(e,{registerStrategyProcessor:r,applyStrategyProcessor:i,getActiveStrategy:o,setStrategyAvailability:s},"private")},vBt=e=>{const t=M.useRef({}),n=M.useCallback(l=>{t.current[l.stateId]=l},[]),r=M.useCallback((l,c)=>{let u;if(pFt(l)?u=l(e.current.state):u=l,e.current.state===u)return!1;let f=!1;const d=[];if(Object.keys(t.current).forEach(h=>{const p=t.current[h],g=p.stateSelector(e.current.state,e.current.instanceId),m=p.stateSelector(u,e.current.instanceId);m!==g&&(d.push({stateId:p.stateId,hasPropChanged:m!==p.propModel}),p.propModel!==void 0&&m!==p.propModel&&(f=!0))}),d.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${d[0].stateId}, therefore, you're not allowed to update ${d.map(h=>h.stateId).join(", ")} in the same transaction.`);if(f||(e.current.state=u,e.current.publishEvent("stateChange",u),e.current.store.update(u)),d.length===1){const{stateId:h,hasPropChanged:p}=d[0],g=t.current[h],m=g.stateSelector(u,e.current.instanceId);g.propOnChange&&p&&g.propOnChange(m,{reason:c,api:e.current}),f||e.current.publishEvent(g.changeEvent,m,{reason:c})}return!f},[e]),i=M.useCallback((l,c,u)=>e.current.setState(f=>X({},f,{[l]:c(f[l])}),u),[e]),o=M.useCallback(()=>{},[]),s={setState:r,forceUpdate:o},a={updateControlState:i,registerControlState:n};Gn(e,s,"public"),Gn(e,a,"private")},yBt=(e,t)=>X({},e,{props:{getRowId:t.getRowId}}),bBt=(e,t)=>{M.useEffect(()=>{e.current.setState(n=>X({},n,{props:{getRowId:t.getRowId}}))},[e,t.getRowId])},xBt=(e,t)=>{const n=hBt(e,t);return iBt(n),bBt(n,t),oBt(n),lBt(n,t),vBt(n),gBt(n),mBt(n),pBt(n,t),n.current.register("private",{rootProps:t}),n},Cs=(e,t,n)=>{const r=M.useRef(!1);r.current||(t.current.state=e(t.current.state,n,t),r.current=!0)};function ite(e,t){if(e==null)return"";const n=typeof e=="string"?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const r=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@"," ","\r"].includes(r[0])?`"'${r}"`:[t.delimiter,` +`,"\r",'"'].some(i=>n.includes(i))?`"${r}"`:r}return n}const yUe=(e,t)=>{const{csvOptions:n,ignoreValueFormatter:r}=t;let i;if(r){const o=e.colDef.type;o==="number"?i=String(e.value):o==="date"||o==="dateTime"?i=e.value?.toISOString():typeof e.value?.toString=="function"?i=e.value.toString():i=e.value}else i=e.formattedValue;return ite(i,n)};class ote{constructor(t){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.csvOptions):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const wBt=({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:i})=>{const o=new ote({csvOptions:r});return t.forEach(s=>{const a=n(e,s.field);o.addValue(yUe(a,{ignoreValueFormatter:i,csvOptions:r}))}),o.getRowString()};function SBt(e){const{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:i,apiRef:o}=e,s=n.reduce((f,d)=>`${f}${wBt({id:d,columns:t,getCellParams:o.current.getCellParams,ignoreValueFormatter:i,csvOptions:r})}\r +`,"").trim();if(!r.includeHeaders)return s;const a=t.filter(f=>f.field!==IT.field),l=[];if(r.includeColumnGroupsHeaders){const f=o.current.getAllGroupDetails();let d=0;const h=a.reduce((p,g)=>{const m=o.current.getColumnGroupPath(g.field);return p[g.field]=m,d=Math.max(d,m.length),p},{});for(let p=0;p{const v=(h[m.field]||[])[p],y=f[v];g.addValue(y?y.headerName||y.groupId:"")})}}const c=new ote({csvOptions:r,sanitizeCellValue:ite});return a.forEach(f=>{c.addValue(f.headerName||f.field)}),l.push(c),`${`${l.map(f=>f.getRowString()).join(`\r `)}\r -`}${s}`.trim()}function l_e(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function H6t(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{l_e(e)}):l_e(e)}function G6t(e){return!!(window.getSelection()?.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const q6t=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,r=(typeof n=="object"?n?.clipboardExport:n)||!1,i=t.clipboardCopyCellDelimiter,o=M.useCallback(s=>{if(!WBt(s)||G6t(s.target))return;let a="";if(e.current.getSelectedRows().size>0)a=e.current.getDataAsCsv({includeHeaders:!1,delimiter:i,shouldAppendQuotes:!1,escapeFormulas:!1});else{const c=vc(e);if(c){const u=e.current.getCellParams(c.id,c.field);a=C8e(u,{csvOptions:{delimiter:i,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:r})}}a=e.current.unstable_applyPipeProcessors("clipboardCopy",a),a&&(H6t(a),e.current.publishEvent("clipboardCopy",a))},[e,r,i]);jVe(e,()=>e.current.rootElementRef.current,"keydown",o),ii(e,"clipboardCopy",t.onClipboardCopy)},X6t=e=>X({},e,{columnMenu:{open:!1}}),Y6t=e=>{const t=Ns(e,"useGridColumnMenu"),n=M.useCallback(s=>{const a=Fz(e.current.state),l={open:!0,field:s};(l.open!==a.open||l.field!==a.field)&&(e.current.setState(u=>u.columnMenu.open&&u.columnMenu.field===s?u:(t.debug("Opening Column Menu"),X({},u,{columnMenu:{open:!0,field:s}}))),e.current.hidePreferences())},[e,t]),r=M.useCallback(()=>{const s=Fz(e.current.state);if(s.field){const c=kv(e),u=Of(e),f=Gm(e);let d=s.field;if(c[d]||(d=f[0]),u[d]===!1){const h=f.filter(g=>g===d?!0:u[g]!==!1),p=h.indexOf(d);d=h[p+1]||h[p-1]}e.current.setColumnHeaderFocus(d)}const a={open:!1,field:void 0};(a.open!==s.open||a.field!==s.field)&&e.current.setState(c=>(t.debug("Hiding Column Menu"),X({},c,{columnMenu:a})))},[e,t]),i=M.useCallback(s=>{t.debug("Toggle Column Menu");const a=Fz(e.current.state);!a.open||a.field!==s?n(s):r()},[e,t,n,r]);qn(e,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:i},"public"),Ft(e,"columnResizeStart",r),Ft(e,"virtualScrollerWheel",e.current.hideColumnMenu),Ft(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},Q6t=(e,t,n)=>{const r=OC({apiRef:n,columnsToUpsert:t.columns,initialState:t.initialState?.columns,columnVisibilityModel:t.columnVisibilityModel??t.initialState?.columns?.columnVisibilityModel??{},keepOnlyColumnsToUpsert:!0});return X({},e,{columns:r,pinnedColumns:e.pinnedColumns??gj})};function K6t(e,t){const n=Ns(e,"useGridColumns"),r=M.useRef(t.columns);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:Of,changeEvent:"columnVisibilityModelChange"});const i=M.useCallback(P=>{n.debug("Updating columns state."),e.current.setState(c_e(P)),e.current.publishEvent("columnsChange",P.orderedFields)},[n,e]),o=M.useCallback(P=>kv(e)[P],[e]),s=M.useCallback(()=>Ff(e),[e]),a=M.useCallback(()=>Mo(e),[e]),l=M.useCallback((P,R=!0)=>(R?Mo(e):Ff(e)).findIndex(F=>F.field===P),[e]),c=M.useCallback(P=>{const R=l(P);return Pb(e)[R]},[e,l]),u=M.useCallback(P=>{Of(e)!==P&&(e.current.setState(I=>X({},I,{columns:OC({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:P,keepOnlyColumnsToUpsert:!1})})),e.current.updateRenderContext?.(),e.current.forceUpdate())},[e]),f=M.useCallback(P=>{const R=OC({apiRef:e,columnsToUpsert:P,initialState:void 0,keepOnlyColumnsToUpsert:!1});i(R)},[e,i]),d=M.useCallback((P,R)=>{const I=Of(e),F=I[P]??!0;if(R!==F){const A=X({},I,{[P]:R});e.current.setColumnVisibilityModel(A)}},[e]),h=M.useCallback(P=>Gm(e).findIndex(I=>I===P),[e]),p=M.useCallback((P,R)=>{const I=Gm(e),F=h(P);if(F===R)return;n.debug(`Moving column ${P} to index ${R}`);const A=[...I],L=A.splice(F,1)[0];A.splice(R,0,L),i(X({},Up(e.current.state),{orderedFields:A}));const $={column:e.current.getColumn(P),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(P),oldIndex:F};e.current.publishEvent("columnIndexChange",$)},[e,n,i,h]),g=M.useCallback((P,R)=>{n.debug(`Updating column ${P} width to ${R}`);const I=Up(e.current.state),F=I.lookup[P],A=X({},F,{width:R,hasBeenResized:!0});i(one(X({},I,{lookup:X({},I.lookup,{[P]:A})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(P),colDef:A,width:R})},[e,n,i]),m={getColumn:o,getAllColumns:s,getColumnIndex:l,getColumnPosition:c,getVisibleColumns:a,getColumnIndexRelativeToVisibleColumns:h,updateColumns:f,setColumnVisibilityModel:u,setColumnVisibility:d,setColumnWidth:g},v={setColumnIndex:p};qn(e,m,"public"),qn(e,v,t.signature===Lf.DataGrid?"private":"public");const y=M.useCallback((P,R)=>{const I={},F=Of(e);(!R.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys(t.initialState?.columns?.columnVisibilityModel??{}).length>0||Object.keys(F).length>0)&&(I.columnVisibilityModel=F),I.orderedFields=Gm(e);const L=Ff(e),$={};return L.forEach(j=>{if(j.hasBeenResized){const V={};JVe.forEach(U=>{let z=j[U];z===1/0&&(z=-1),V[U]=z}),$[j.field]=V}}),Object.keys($).length>0&&(I.dimensions=$),X({},P,{columns:I})},[e,t.columnVisibilityModel,t.initialState?.columns]),b=M.useCallback((P,R)=>{const I=R.stateToRestore.columns?.columnVisibilityModel,F=R.stateToRestore.columns;if(I==null&&F==null)return P;const A=OC({apiRef:e,columnsToUpsert:[],initialState:F,columnVisibilityModel:I,keepOnlyColumnsToUpsert:!1});return e.current.setState(c_e(A)),F!=null&&e.current.publishEvent("columnsChange",A.orderedFields),P},[e]),w=M.useCallback((P,R)=>{if(R===dw.columns){const I=t.slots.columnsPanel;return O.jsx(I,X({},t.slotProps?.columnsPanel))}return P},[t.slots.columnsPanel,t.slotProps?.columnsPanel]),S=M.useCallback(P=>t.disableColumnSelector?P:[...P,"columnMenuColumnsItem"],[t.disableColumnSelector]);fo(e,"columnMenu",S),fo(e,"exportState",y),fo(e,"restoreState",b),fo(e,"preferencePanel",w);const _=M.useRef(null);Ft(e,"viewportInnerSizeChange",P=>{if(_.current!==P.width){if(_.current=P.width,!Mo(e).some(I=>I.flex&&I.flex>0))return;i(one(Up(e.current.state),e.current.getRootDimensions()))}});const T=M.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const P=OC({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});i(P)},[e,n,i]);Zce(e,"hydrateColumns",T);const k=M.useRef(!0);M.useEffect(()=>{if(k.current){k.current=!1;return}if(n.info(`GridColumns have changed, new length ${t.columns.length}`),r.current===t.columns)return;const P=OC({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});r.current=t.columns,i(P)},[n,e,i,t.columns]),M.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}function c_e(e){return t=>X({},t,{columns:e})}const Z6t=(e,t)=>X({},e,{density:t.initialState?.density??t.density??"standard"}),J6t=(e,t)=>{const n=Ns(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:NC,changeEvent:"densityChange"});const i={setDensity:ft(a=>{NC(e.current.state)!==a&&(n.debug(`Set grid density to ${a}`),e.current.setState(c=>X({},c,{density:a})))})};qn(e,i,"public");const o=M.useCallback((a,l)=>{const c=NC(e.current.state);return!l.exportOnlyDirtyModels||t.density!=null||t.initialState?.density!=null?X({},a,{density:c}):a},[e,t.density,t.initialState?.density]),s=M.useCallback((a,l)=>{const c=l.stateToRestore?.density?l.stateToRestore.density:NC(e.current.state);return e.current.setState(u=>X({},u,{density:c})),a},[e]);fo(e,"exportState",o),fo(e,"restoreState",s),M.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])};function eUt(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const i=URL.createObjectURL(e),o=document.createElement("a");o.href=i,o.download=r,o.click(),setTimeout(()=>{URL.revokeObjectURL(i)});return}throw new Error("MUI X: exportAs not supported.")}const O8e=({apiRef:e,options:t})=>{const n=Ff(e);return t.fields?t.fields.reduce((i,o)=>{const s=n.find(a=>a.field===o);return s&&i.push(s),i},[]):(t.allColumns?n:Mo(e)).filter(i=>!i.disableExport)},E8e=({apiRef:e})=>{const t=LVe(e),n=ds(e),r=e.current.getSelectedRows(),i=t.filter(l=>n[l].type!=="footer"),o=FT(e),s=o?.top?.map(l=>l.id)||[],a=o?.bottom?.map(l=>l.id)||[];return i.unshift(...s),i.push(...a),r.size>0?i.filter(l=>r.has(l)):i},tUt=(e,t)=>{const n=Ns(e,"useGridCsvExport"),r=t.ignoreValueFormatterDuringExport,i=(typeof r=="object"?r?.csvExport:r)||!1,o=M.useCallback((c={})=>{n.debug("Get data as CSV");const u=O8e({apiRef:e,options:c}),d=(c.getRowsToExport??E8e)({apiRef:e});return W6t({columns:u,rowIds:d,csvOptions:{delimiter:c.delimiter||",",shouldAppendQuotes:c.shouldAppendQuotes??!0,includeHeaders:c.includeHeaders??!0,includeColumnGroupsHeaders:c.includeColumnGroupsHeaders??!0,escapeFormulas:c.escapeFormulas??!0},ignoreValueFormatter:i,apiRef:e})},[n,e,i]),s=M.useCallback(c=>{n.debug("Export data as CSV");const u=o(c),f=new Blob([c?.utf8WithBom?new Uint8Array([239,187,191]):"",u],{type:"text/csv"});eUt(f,"csv",c?.fileName)},[n,o]);qn(e,{getDataAsCsv:o,exportDataAsCsv:s},"public");const l=M.useCallback((c,u)=>u.csvOptions?.disableToolbarButton?c:[...c,{component:O.jsx(Y4t,{options:u.csvOptions}),componentName:"csvExport"}],[]);fo(e,"exportMenu",l)},$z=(e,t,n)=>{let r=e.paginationModel;const i=e.rowCount,o=n?.pageSize??r.pageSize,s=n?.page??r.page,a=BVe(i,o,s);n&&(n?.page!==r.page||n?.pageSize!==r.pageSize)&&(r=n);const l=o===-1?0:H3t(r.page,a);return l!==r.page&&(r=X({},r,{page:l})),VVe(r.pageSize,t),r},nUt=(e,t)=>{const n=Ns(e,"useGridPaginationModel"),r=ut(e,LT),i=M.useRef(Hs(e)),o=Math.floor(t.rowHeight*r);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:tl,changeEvent:"paginationModelChange"});const s=M.useCallback(y=>{const b=tl(e);y!==b.page&&(n.debug(`Setting page to ${y}`),e.current.setPaginationModel({page:y,pageSize:b.pageSize}))},[e,n]),a=M.useCallback(y=>{const b=tl(e);y!==b.pageSize&&(n.debug(`Setting page size to ${y}`),e.current.setPaginationModel({pageSize:y,page:b.page}))},[e,n]),l=M.useCallback(y=>{const b=tl(e);y!==b&&(n.debug("Setting 'paginationModel' to",y),e.current.setState(w=>X({},w,{pagination:X({},w.pagination,{paginationModel:$z(w.pagination,t.signature,y)})}),"setPaginationModel"))},[e,n,t.signature]);qn(e,{setPage:s,setPageSize:a,setPaginationModel:l},"public");const u=M.useCallback((y,b)=>{const w=tl(e);return!b.exportOnlyDirtyModels||t.paginationModel!=null||t.initialState?.pagination?.paginationModel!=null||w.page!==0&&w.pageSize!==W3t(t.autoPageSize)?X({},y,{pagination:X({},y.pagination,{paginationModel:w})}):y},[e,t.paginationModel,t.initialState?.pagination?.paginationModel,t.autoPageSize]),f=M.useCallback((y,b)=>{const w=b.stateToRestore.pagination?.paginationModel?X({},UVe(t.autoPageSize),b.stateToRestore.pagination?.paginationModel):tl(e);return e.current.setState(S=>X({},S,{pagination:X({},S.pagination,{paginationModel:$z(S.pagination,t.signature,w)})}),"stateRestorePreProcessing"),y},[e,t.autoPageSize,t.signature]);fo(e,"exportState",u),fo(e,"restoreState",f);const d=()=>{const y=tl(e);e.current.virtualScrollerRef?.current&&e.current.scrollToIndexes({rowIndex:y.page*y.pageSize})},h=M.useCallback(()=>{if(!t.autoPageSize)return;const y=e.current.getRootDimensions(),b=Math.max(1,Math.floor(y.viewportInnerSize.height/o));e.current.setPageSize(b)},[e,t.autoPageSize,o]),p=M.useCallback(y=>{if(y==null)return;const b=tl(e);if(b.page===0)return;const w=GVe(e);b.page>w-1&&e.current.setPage(Math.max(0,w-1))},[e]),g=M.useCallback(()=>{tl(e).page!==0&&e.current.setPage(0),e.current.getScrollPosition().top!==0&&e.current.scroll({top:0})},[e]),m=M.useCallback(y=>{const b=X({},y,{items:$Ve(e)});A0(b,i.current)||(i.current=b,g())},[e,g]);Ft(e,"viewportInnerSizeChange",h),Ft(e,"paginationModelChange",d),Ft(e,"rowCountChange",p),Ft(e,"sortModelChange",e1(t.resetPageOnSortFilter,g)),Ft(e,"filterModelChange",e1(t.resetPageOnSortFilter,m));const v=M.useRef(!0);M.useEffect(()=>{if(v.current){v.current=!1;return}t.pagination&&e.current.setState(y=>X({},y,{pagination:X({},y.pagination,{paginationModel:$z(y.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.signature,t.pagination]),M.useEffect(()=>{e.current.setState(y=>{const b=t.pagination===!0;return y.pagination.paginationMode===t.paginationMode||y.pagination.enabled===b?y:X({},y,{pagination:X({},y.pagination,{paginationMode:t.paginationMode,enabled:t.pagination===!0})})})},[e,t.paginationMode,t.pagination]),M.useEffect(h,[h])};function rUt(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function iUt(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}const oUt=(e,t)=>{const n=e.current.rootElementRef.current!==null,r=Ns(e,"useGridPrintExport"),i=M.useRef(null),o=M.useRef(null),s=M.useRef({}),a=M.useRef([]),l=M.useRef(null);M.useEffect(()=>{i.current=ci(e.current.rootElementRef.current)},[e,n]);const c=M.useCallback((m,v,y)=>new Promise(b=>{const w=O8e({apiRef:e,options:{fields:m,allColumns:v}}).map(E=>E.field),S=Ff(e),_={};S.forEach(E=>{_[E.field]=w.includes(E.field)}),y&&(_[BT.field]=!0),e.current.setColumnVisibilityModel(_),b()}),[e]),u=M.useCallback(m=>{const y=m({apiRef:e}).reduce((b,w)=>{const S=e.current.getRow(w);return S[ZO]||b.push(S),b},[]);e.current.setRows(y)},[e]),f=M.useCallback((m,v)=>{const y=X({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},v),b=m.contentDocument;if(!b)return;const w=UT(e.current.state),S=e.current.rootElementRef.current,_=S.cloneNode(!0),E=_.querySelector(`.${ve.main}`);E.style.overflow="visible",_.style.contain="size";let T=S.querySelector(`.${ve.toolbarContainer}`)?.offsetHeight||0,k=S.querySelector(`.${ve.footerContainer}`)?.offsetHeight||0;const P=_.querySelector(`.${ve.footerContainer}`);y.hideToolbar&&(_.querySelector(`.${ve.toolbarContainer}`)?.remove(),T=0),y.hideFooter&&P&&(P.remove(),k=0);const R=w.currentPageTotalHeight+NU(e,t)+T+k;_.style.height=`${R}px`,_.style.boxSizing="content-box",!y.hideFooter&&P&&(P.style.position="absolute",P.style.width="100%",P.style.top=`${R-k}px`);const I=document.createElement("div");I.appendChild(_),b.body.style.marginTop="0px",b.body.innerHTML=I.innerHTML;const F=typeof y.pageStyle=="function"?y.pageStyle():y.pageStyle;if(typeof F=="string"){const L=b.createElement("style");L.appendChild(b.createTextNode(F)),b.head.appendChild(L)}y.bodyClassName&&b.body.classList.add(...y.bodyClassName.split(" "));const A=[];if(y.copyStyles){const L=S.getRootNode(),j=(L.constructor.name==="ShadowRoot"?L:i.current).querySelectorAll("style, link[rel='stylesheet']");for(let V=0;V{z.addEventListener("load",()=>N())})),b.head.appendChild(z)}}}Promise.all(A).then(()=>{m.contentWindow.print()})},[e,i,t]),d=M.useCallback(m=>{i.current.body.removeChild(m),e.current.restoreState(o.current||{}),o.current?.columns?.columnVisibilityModel||e.current.setColumnVisibilityModel(s.current),e.current.setState(v=>X({},v,{virtualization:l.current})),e.current.setRows(a.current),o.current=null,s.current={},a.current=[]},[e]),p={exportDataAsPrint:M.useCallback(async m=>{if(r.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(o.current=e.current.exportState(),s.current=Of(e),a.current=e.current.getSortedRows().filter(y=>!y[ZO]),t.pagination){const b={page:0,pageSize:Nce(e)};e.current.setState(w=>X({},w,{pagination:X({},w.pagination,{paginationModel:$z(w.pagination,"DataGridPro",b)})}))}l.current=e.current.state.virtualization,e.current.unstable_setVirtualization(!1),await c(m?.fields,m?.allColumns,m?.includeCheckboxes),u(m?.getRowsToExport??E8e),await rUt();const v=iUt(m?.fileName);v.onload=()=>{f(v,m),v.contentWindow.matchMedia("print").addEventListener("change",b=>{b.matches===!1&&d(v)})},i.current.body.appendChild(v)},[t,r,e,f,d,c,u])};qn(e,p,"public");const g=M.useCallback((m,v)=>v.printOptions?.disableToolbarButton?m:[...m,{component:O.jsx(Q4t,{options:v.printOptions}),componentName:"printExport"}],[]);fo(e,"exportMenu",g)},sUt=(e,t,n)=>{const r=t.filterModel??t.initialState?.filter?.filterModel??JA();return X({},e,{filter:X({filterModel:Dce(r,t.disableMultipleColumnsFiltering,n)},bVe),visibleRowsLookup:{}})},aUt=e=>e.filteredRowsLookup;function u_e(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function lUt(){return tVe(Object.values)}const cUt=(e,t)=>{const n=Ns(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Hs,changeEvent:"filterModelChange"});const r=M.useCallback(()=>{e.current.setState(k=>{const P=Hs(k,e.current.instanceId),R=e.current.getFilterState(P),I=X({},k,{filter:X({},k.filter,R)}),F=u_e(e,I);return X({},I,{visibleRowsLookup:F})}),e.current.publishEvent("filteredRowsSet")},[e]),i=M.useCallback((k,P)=>P==null||P.filterable===!1||t.disableColumnFilter?k:[...k,"columnMenuFilterItem"],[t.disableColumnFilter]),o=M.useCallback(()=>{r(),e.current.forceUpdate()},[e,r]),s=M.useCallback(k=>{const P=Hs(e),R=[...P.items],I=R.findIndex(F=>F.id===k.id);I===-1?R.push(k):R[I]=k,e.current.setFilterModel(X({},P,{items:R}),"upsertFilterItem")},[e]),a=M.useCallback(k=>{const P=Hs(e),R=[...P.items];k.forEach(I=>{const F=R.findIndex(A=>A.id===I.id);F===-1?R.push(I):R[F]=I}),e.current.setFilterModel(X({},P,{items:R}),"upsertFilterItems")},[e]),l=M.useCallback(k=>{const P=Hs(e),R=P.items.filter(I=>I.id!==k.id);R.length!==P.items.length&&e.current.setFilterModel(X({},P,{items:R}),"deleteFilterItem")},[e]),c=M.useCallback((k,P,R)=>{if(n.debug("Displaying filter panel"),k){const I=Hs(e),F=I.items.filter(j=>{if(j.value!==void 0)return!(Array.isArray(j.value)&&j.value.length===0);const U=e.current.getColumn(j.field).filterOperators?.find(N=>N.value===j.operator);return!(typeof U?.requiresFilterValue>"u"?!0:U?.requiresFilterValue)});let A;const L=F.find(j=>j.field===k),$=e.current.getColumn(k);L?A=F:t.disableMultipleColumnsFiltering?A=[ine({field:k,operator:$.filterOperators[0].value},e)]:A=[...F,ine({field:k,operator:$.filterOperators[0].value},e)],e.current.setFilterModel(X({},I,{items:A}))}e.current.showPreferences(dw.filters,P,R)},[e,n,t.disableMultipleColumnsFiltering]),u=M.useCallback(()=>{n.debug("Hiding filter panel"),e.current.hidePreferences()},[e,n]),f=M.useCallback(k=>{const P=Hs(e);P.logicOperator!==k&&e.current.setFilterModel(X({},P,{logicOperator:k}),"changeLogicOperator")},[e]),d=M.useCallback(k=>{const P=Hs(e);A0(P.quickFilterValues,k)||e.current.setFilterModel(X({},P,{quickFilterValues:[...k]}))},[e]),h=M.useCallback((k,P)=>{Hs(e)!==k&&(n.debug("Setting filter model"),e.current.updateControlState("filter",wSe(k,t.disableMultipleColumnsFiltering,e),P),e.current.unstable_applyFilters())},[e,n,t.disableMultipleColumnsFiltering]),p=M.useCallback(k=>{const P=Dce(k,t.disableMultipleColumnsFiltering,e),R=t.filterMode==="client"?qNt(P,e,t.disableEval):null,I=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:R,filterModel:P??JA()});return X({},I,{filterModel:P})},[t.disableMultipleColumnsFiltering,t.filterMode,t.disableEval,e]),g={setFilterLogicOperator:f,unstable_applyFilters:o,deleteFilterItem:l,upsertFilterItem:s,upsertFilterItems:a,setFilterModel:h,showFilterPanel:c,hideFilterPanel:u,setQuickFilterValues:d,ignoreDiacritics:t.ignoreDiacritics,getFilterState:p};qn(e,g,"public");const m=M.useCallback((k,P)=>{const R=Hs(e);return R.items.forEach(F=>{delete F.fromInput}),!P.exportOnlyDirtyModels||t.filterModel!=null||t.initialState?.filter?.filterModel!=null||!A0(R,JA())?X({},k,{filter:{filterModel:R}}):k},[e,t.filterModel,t.initialState?.filter?.filterModel]),v=M.useCallback((k,P)=>{const R=P.stateToRestore.filter?.filterModel;return R==null?k:(e.current.updateControlState("filter",wSe(R,t.disableMultipleColumnsFiltering,e),"restoreState"),X({},k,{callbacks:[...k.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),y=M.useCallback((k,P)=>{if(P===dw.filters){const R=t.slots.filterPanel;return O.jsx(R,X({},t.slotProps?.filterPanel))}return k},[t.slots.filterPanel,t.slotProps?.filterPanel]),{getRowId:b}=t,w=ad(lUt),S=M.useCallback(k=>{if(t.filterMode!=="client"||!k.isRowMatchingFilters||!k.filterModel.items.length&&!k.filterModel.quickFilterValues?.length)return bVe;const P=Cf(e),R={},{isRowMatchingFilters:I}=k,F={},A={passingFilterItems:null,passingQuickFilterValues:null},L=w.current(e.current.state.rows.dataRowIdToModelLookup);for(let V=0;V{n.debug("onColUpdated - GridColumns changed, applying filters");const k=Hs(e),P=kv(e),R=k.items.filter(I=>I.field&&P[I.field]);R.length{k==="filtering"&&e.current.unstable_applyFilters()},[e]),T=M.useCallback(()=>{e.current.setState(k=>X({},k,{visibleRowsLookup:u_e(e,k)})),e.current.forceUpdate()},[e]);Ft(e,"rowsSet",r),Ft(e,"columnsChange",_),Ft(e,"activeStrategyProcessorChange",E),Ft(e,"rowExpansionChange",T),Ft(e,"columnVisibilityModelChange",()=>{const k=Hs(e);k.quickFilterValues&&EVe(k)&&e.current.unstable_applyFilters()}),MD(()=>{e.current.unstable_applyFilters()}),ar(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,n,t.filterModel])},uUt=e=>X({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),fUt=(e,t)=>{const n=Ns(e,"useGridFocus"),r=M.useRef(null),i=e.current.rootElementRef.current!==null,o=M.useCallback((T,k)=>{T&&e.current.getRow(T.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(T.id,T.field),k)},[e]),s=M.useCallback((T,k)=>{const P=vc(e);P?.id===T&&P?.field===k||(e.current.setState(R=>(n.debug(`Focusing on cell with id=${T} and field=${k}`),X({},R,{tabIndex:{cell:{id:T,field:k},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:T,field:k},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(T)&&(P&&o(P,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(T,k))))},[e,n,o]),a=M.useCallback((T,k={})=>{const P=vc(e);o(P,k),e.current.setState(R=>(n.debug(`Focusing on column header with colIndex=${T}`),X({},R,{tabIndex:{columnHeader:{field:T},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:T},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,o]),l=M.useCallback((T,k={})=>{const P=vc(e);o(P,k),e.current.setState(R=>(n.debug(`Focusing on column header filter with colIndex=${T}`),X({},R,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:T},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:T},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,o]),c=M.useCallback((T,k,P={})=>{const R=vc(e);R&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(R.id,R.field),P),e.current.setState(I=>X({},I,{tabIndex:{columnGroupHeader:{field:T,depth:k},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:T,depth:k},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),u=M.useCallback(()=>mj(e),[e]),f=M.useCallback((T,k,P)=>{let R=e.current.getColumnIndex(k);const I=Mo(e),F=I0(e,{pagination:t.pagination,paginationMode:t.paginationMode}),A=FT(e),L=[].concat(A.top||[],F.rows,A.bottom||[]);let $=L.findIndex(z=>z.id===T);P==="right"?R+=1:P==="left"?R-=1:$+=1,R>=I.length?($+=1,$=0&&(R=I.length-1)),$=Mu($,0,L.length-1);const j=L[$];if(!j)return;const V=e.current.unstable_getCellColSpanInfo(j.id,R);V&&V.spannedByColSpan&&(P==="left"||P==="below"?R=V.leftVisibleCellIndex:P==="right"&&(R=V.rightVisibleCellIndex)),R=Mu(R,0,I.length-1);const U=I[R];e.current.setCellFocus(j.id,U.field)},[e,t.pagination,t.paginationMode]),d=M.useCallback(({id:T,field:k})=>{e.current.setCellFocus(T,k)},[e]),h=M.useCallback((T,k)=>{k.key==="Enter"||k.key==="Tab"||k.key==="Shift"||wj(k.key)||e.current.setCellFocus(T.id,T.field)},[e]),p=M.useCallback(({field:T},k)=>{k.target===k.currentTarget&&e.current.setColumnHeaderFocus(T,k)},[e]),g=M.useCallback(({fields:T,depth:k},P)=>{if(P.target!==P.currentTarget)return;const R=mj(e);R!==null&&R.depth===k&&T.includes(R.field)||e.current.setColumnGroupHeaderFocus(T[0],k,P)},[e]),m=M.useCallback((T,k)=>{k.relatedTarget?.getAttribute("class")?.includes(ve.columnHeader)||(n.debug("Clearing focus"),e.current.setState(P=>X({},P,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),v=M.useCallback(T=>{r.current=T},[]),y=M.useCallback(T=>{const k=r.current;r.current=null;const P=vc(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:T,cell:k}))return;if(!P){k&&e.current.setCellFocus(k.id,k.field);return}k?.id===P.id&&k?.field===P.field||e.current.getCellElement(P.id,P.field)?.contains(T.target)||(k?e.current.setCellFocus(k.id,k.field):(e.current.setState(F=>X({},F,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),o(P,T)))},[e,o]),b=M.useCallback(T=>{if(T.cellMode==="view")return;const k=vc(e);(k?.id!==T.id||k?.field!==T.field)&&e.current.setCellFocus(T.id,T.field)},[e]),w=M.useCallback(()=>{const T=vc(e);if(T&&!e.current.getRow(T.id)){const k=T.id;let P=null;if(typeof k<"u"){const R=e.current.getRowElement(k),I=R?.dataset.rowindex?Number(R?.dataset.rowindex):0,F=I0(e,{pagination:t.pagination,paginationMode:t.paginationMode});P=F.rows[Mu(I,0,F.rows.length-1)]?.id??null}e.current.setState(R=>X({},R,{focus:{cell:P===null?null:{id:P,field:T.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[e,t.pagination,t.paginationMode]),S=ft(()=>{const T=vc(e);if(!T)return;const k=I0(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(k.rows.find(I=>I.id===T.id))return;const R=Mo(e);e.current.setState(I=>X({},I,{tabIndex:{cell:{id:k.rows[0].id,field:R[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),_={setCellFocus:s,setColumnHeaderFocus:a,setColumnHeaderFilterFocus:l},E={moveFocusToRelativeCell:f,setColumnGroupHeaderFocus:c,getColumnGroupHeaderFocus:u};qn(e,_,"public"),qn(e,E,"private"),M.useEffect(()=>{const T=ci(e.current.rootElementRef.current);return T.addEventListener("mouseup",y),()=>{T.removeEventListener("mouseup",y)}},[e,i,y]),Ft(e,"columnHeaderBlur",m),Ft(e,"cellDoubleClick",d),Ft(e,"cellMouseDown",v),Ft(e,"cellKeyDown",h),Ft(e,"cellModeChange",b),Ft(e,"columnHeaderFocus",p),Ft(e,"columnGroupHeaderFocus",g),Ft(e,"rowsSet",w),Ft(e,"paginationModelChange",S)},o7=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(et)return e-1;return null},s7=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e>t)return e-1}else if(!r&&e=0&&s(t.top||[]).concat(e.rows,t.bottom||[])),pUt=(e,t)=>{const n=Ns(e,"useGridKeyboardNavigation"),r=bi(),i=t.unstable_listView,o=M.useCallback(()=>hUt(e),[e]),s=t.signature!=="DataGrid"&&t.headerFilters,a=M.useCallback((v,y,b="left",w="up")=>{const S=kb(e),_=e.current.unstable_getCellColSpanInfo(y,v);_&&_.spannedByColSpan&&(b==="left"?v=_.leftVisibleCellIndex:b==="right"&&(v=_.rightVisibleCellIndex));const E=i?tE(e.current.state).field:$T(e)[v],T=dUt(e,y,E,w),k=S.findIndex(P=>P.id===T);n.debug(`Navigating to cell row ${k}, col ${v}`),e.current.scrollToIndexes({colIndex:v,rowIndex:k}),e.current.setCellFocus(T,E)},[e,n,i]),l=M.useCallback((v,y)=>{n.debug(`Navigating to header col ${v}`),e.current.scrollToIndexes({colIndex:v});const b=e.current.getVisibleColumns()[v].field;e.current.setColumnHeaderFocus(b,y)},[e,n]),c=M.useCallback((v,y)=>{n.debug(`Navigating to header filter col ${v}`),e.current.scrollToIndexes({colIndex:v});const b=e.current.getVisibleColumns()[v].field;e.current.setColumnHeaderFilterFocus(b,y)},[e,n]),u=M.useCallback((v,y,b)=>{n.debug(`Navigating to header col ${v}`),e.current.scrollToIndexes({colIndex:v});const{field:w}=e.current.getVisibleColumns()[v];e.current.setColumnGroupHeaderFocus(w,y,b)},[e,n]),f=M.useCallback(v=>o()[v]?.id,[o]),d=M.useCallback((v,y)=>{const b=y.currentTarget.querySelector(`.${ve.columnHeaderTitleContainerContent}`);if(!!b&&b.contains(y.target)&&v.field!==BT.field)return;const S=o(),_=e.current.getViewportPageSize(),E=v.field?e.current.getColumnIndex(v.field):0,T=S.length>0?0:null,k=S.length-1,P=0,R=Mo(e).length-1,I=DD(e);let F=!0;switch(y.key){case"ArrowDown":{s?c(E,y):T!==null&&a(E,f(T));break}case"ArrowRight":{const A=s7({currentColIndex:E,firstColIndex:P,lastColIndex:R,isRtl:r});A!==null&&l(A,y);break}case"ArrowLeft":{const A=o7({currentColIndex:E,firstColIndex:P,lastColIndex:R,isRtl:r});A!==null&&l(A,y);break}case"ArrowUp":{I>0&&u(E,I-1,y);break}case"PageDown":{T!==null&&k!==null&&a(E,f(Math.min(T+_,k)));break}case"Home":{l(P,y);break}case"End":{l(R,y);break}case"Enter":{(y.ctrlKey||y.metaKey)&&e.current.toggleColumnMenu(v.field);break}case" ":break;default:F=!1}F&&y.preventDefault()},[e,o,s,c,a,f,r,l,u]),h=M.useCallback((v,y)=>{const b=Mzt(e)===v.field,w=Azt(e)===v.field;if(b||w||!wj(y.key))return;const S=o(),_=e.current.getViewportPageSize(),E=v.field?e.current.getColumnIndex(v.field):0,T=0,k=S.length-1,P=0,R=Mo(e).length-1;let I=!0;switch(y.key){case"ArrowDown":{const F=f(T);F!=null&&a(E,F);break}case"ArrowRight":{const F=s7({currentColIndex:E,firstColIndex:P,lastColIndex:R,isRtl:r});F!==null&&c(F,y);break}case"ArrowLeft":{const F=o7({currentColIndex:E,firstColIndex:P,lastColIndex:R,isRtl:r});F!==null?c(F,y):e.current.setColumnHeaderFilterFocus(v.field,y);break}case"ArrowUp":{l(E,y);break}case"PageDown":{k!==null&&a(E,f(Math.min(T+_,k)));break}case"Home":{c(P,y);break}case"End":{c(R,y);break}case" ":break;default:I=!1}I&&y.preventDefault()},[e,o,c,r,l,a,f]),p=M.useCallback((v,y)=>{const b=mj(e);if(b===null)return;const{field:w,depth:S}=b,{fields:_,depth:E,maxDepth:T}=v,k=o(),P=e.current.getViewportPageSize(),R=e.current.getColumnIndex(w),I=w?e.current.getColumnIndex(w):0,F=0,A=k.length-1,L=0,$=Mo(e).length-1;let j=!0;switch(y.key){case"ArrowDown":{E===T-1?l(R,y):u(R,S+1,y);break}case"ArrowUp":{E>0&&u(R,S-1,y);break}case"ArrowRight":{const V=_.length-_.indexOf(w)-1;R+V+1<=$&&u(R+V+1,S,y);break}case"ArrowLeft":{const V=_.indexOf(w);R-V-1>=L&&u(R-V-1,S,y);break}case"PageDown":{A!==null&&a(I,f(Math.min(F+P,A)));break}case"Home":{u(L,S,y);break}case"End":{u($,S,y);break}case" ":break;default:j=!1}j&&y.preventDefault()},[e,o,l,u,a,f]),g=M.useCallback((v,y)=>{if(FD(y))return;const b=e.current.getCellParams(v.id,v.field);if(b.cellMode===ni.Edit||!wj(y.key)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:y,cell:b}))return;const S=o();if(S.length===0)return;const _=e.current.getViewportPageSize(),E=i?()=>0:e.current.getColumnIndex,T=v.field?E(v.field):0,k=S.findIndex($=>$.id===v.id),P=0,R=S.length-1,I=0,A=(i?[tE(e.current.state)]:Mo(e)).length-1;let L=!0;switch(y.key){case"ArrowDown":{kP?a(T,f(k-1)):s?c(T,y):l(T,y);break}case"ArrowRight":{const $=s7({currentColIndex:T,firstColIndex:I,lastColIndex:A,isRtl:r});$!==null&&a($,f(k),r?"left":"right");break}case"ArrowLeft":{const $=o7({currentColIndex:T,firstColIndex:I,lastColIndex:A,isRtl:r});$!==null&&a($,f(k),r?"right":"left");break}case"Tab":{y.shiftKey&&T>I?a(T-1,f(k),"left"):!y.shiftKey&&T=P?a(T,f($)):l(T,y);break}case"Home":{y.ctrlKey||y.metaKey||y.shiftKey?a(I,f(P)):a(I,f(k));break}case"End":{y.ctrlKey||y.metaKey||y.shiftKey?a(A,f(R)):a(A,f(k));break}default:L=!1}L&&y.preventDefault()},[e,o,r,a,f,s,c,l,i]),m=M.useCallback((v,{event:y})=>y.key===" "?!1:v,[]);fo(e,"canStartEditing",m),Ft(e,"columnHeaderKeyDown",d),Ft(e,"headerFilterKeyDown",h),Ft(e,"columnGroupHeaderKeyDown",p),Ft(e,"cellKeyDown",g)},gUt=(e,t)=>{const n=Ns(e,"useGridRowCount"),r=ut(e,zce),i=ut(e,zC),o=ut(e,tM),s=ut(e,tl),a=ad(()=>tl(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:zC,changeEvent:"rowCountChange"});const c={setRowCount:M.useCallback(p=>{i!==p&&(n.debug("Setting 'rowCount' to",p),e.current.setState(g=>X({},g,{pagination:X({},g.pagination,{rowCount:p})})))},[e,n,i])};qn(e,c,"public");const u=M.useCallback((p,g)=>{const m=zC(e);return!g.exportOnlyDirtyModels||t.rowCount!=null||t.initialState?.pagination?.rowCount!=null?X({},p,{pagination:X({},p.pagination,{rowCount:m})}):p},[e,t.rowCount,t.initialState?.pagination?.rowCount]),f=M.useCallback((p,g)=>{const m=g.stateToRestore.pagination?.rowCount?g.stateToRestore.pagination.rowCount:zC(e);return e.current.setState(v=>X({},v,{pagination:X({},v.pagination,{rowCount:m})})),p},[e]);fo(e,"exportState",u),fo(e,"restoreState",f);const d=M.useCallback(p=>{t.paginationMode==="client"||!a.current||p.pageSize!==a.current&&(a.current=p.pageSize,i===-1&&e.current.setPage(0))},[t.paginationMode,a,i,e]);Ft(e,"paginationModelChange",d),M.useEffect(()=>{t.paginationMode==="client"?e.current.setRowCount(r):t.rowCount!=null&&e.current.setRowCount(t.rowCount)},[e,t.paginationMode,r,t.rowCount]);const h=o.hasNextPage===!1;M.useEffect(()=>{h&&i===-1&&e.current.setRowCount(s.pageSize*s.page+r)},[e,r,h,i,s])},mUt=(e,t)=>{const n=Ns(e,"useGridPaginationMeta"),r=ut(e,tM);e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:tM,changeEvent:"paginationMetaChange"});const o={setPaginationMeta:M.useCallback(l=>{r!==l&&(n.debug("Setting 'paginationMeta' to",l),e.current.setState(c=>X({},c,{pagination:X({},c.pagination,{meta:l})})))},[e,n,r])};qn(e,o,"public");const s=M.useCallback((l,c)=>{const u=tM(e);return!c.exportOnlyDirtyModels||t.paginationMeta!=null||t.initialState?.pagination?.meta!=null?X({},l,{pagination:X({},l.pagination,{meta:u})}):l},[e,t.paginationMeta,t.initialState?.pagination?.meta]),a=M.useCallback((l,c)=>{const u=c.stateToRestore.pagination?.meta?c.stateToRestore.pagination.meta:tM(e);return e.current.setState(f=>X({},f,{pagination:X({},f.pagination,{meta:u})})),l},[e]);fo(e,"exportState",s),fo(e,"restoreState",a),M.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])},vUt=(e,t)=>{const n=X({},UVe(t.autoPageSize),t.paginationModel??t.initialState?.pagination?.paginationModel);VVe(n.pageSize,t.signature);const r=t.rowCount??t.initialState?.pagination?.rowCount??(t.paginationMode==="client"?e.rows?.totalRowCount:void 0),i=t.paginationMeta??t.initialState?.pagination?.meta??{};return X({},e,{pagination:X({},e.pagination,{paginationModel:n,rowCount:r,meta:i,enabled:t.pagination===!0,paginationMode:t.paginationMode})})},yUt=(e,t)=>{mUt(e,t),nUt(e,t),gUt(e,t)},bUt=(e,t)=>X({},e,{preferencePanel:t.initialState?.preferencePanel??{open:!1}}),xUt=(e,t)=>{const n=Ns(e,"useGridPreferencesPanel"),r=M.useCallback(()=>{e.current.setState(a=>{if(!a.preferencePanel.open)return a;n.debug("Hiding Preferences Panel");const l=tR(a);return e.current.publishEvent("preferencePanelClose",{openedPanelValue:l.openedPanelValue}),X({},a,{preferencePanel:{open:!1}})})},[e,n]),i=M.useCallback((a,l,c)=>{n.debug("Opening Preferences Panel"),e.current.setState(u=>X({},u,{preferencePanel:X({},u.preferencePanel,{open:!0,openedPanelValue:a,panelId:l,labelId:c})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:a})},[n,e]);qn(e,{showPreferences:i,hidePreferences:r},"public");const o=M.useCallback((a,l)=>{const c=tR(e.current.state);return!l.exportOnlyDirtyModels||t.initialState?.preferencePanel!=null||c.open?X({},a,{preferencePanel:c}):a},[e,t.initialState?.preferencePanel]),s=M.useCallback((a,l)=>{const c=l.stateToRestore.preferencePanel;return c!=null&&e.current.setState(u=>X({},u,{preferencePanel:c})),a},[e]);fo(e,"exportState",o),fo(e,"restoreState",s)},une=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;case"string":default:return""}},wUt=["id","field"],SUt=["id","field"],_Ut=(e,t)=>{const[n,r]=M.useState({}),i=M.useRef(n),o=M.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:a,cellModesModel:l,onCellModesModelChange:c}=t,u=L=>(...$)=>{t.editMode===eg.Cell&&L(...$)},f=M.useCallback((L,$)=>{const j=e.current.getCellParams(L,$);if(!e.current.isCellEditable(j))throw new Error(`MUI X: The cell with id=${L} and field=${$} is not editable.`)},[e]),d=M.useCallback((L,$,j)=>{if(e.current.getCellMode(L,$)!==j)throw new Error(`MUI X: The cell with id=${L} and field=${$} is not in ${j} mode.`)},[e]),h=M.useCallback((L,$)=>{if(!L.isEditable||L.cellMode===ni.Edit)return;const j=X({},L,{reason:cm.cellDoubleClick});e.current.publishEvent("cellEditStart",j,$)},[e]),p=M.useCallback((L,$)=>{if(L.cellMode===ni.View||e.current.getCellMode(L.id,L.field)===ni.View)return;const j=X({},L,{reason:Nd.cellFocusOut});e.current.publishEvent("cellEditStop",j,$)},[e]),g=M.useCallback((L,$)=>{if(L.cellMode===ni.Edit){if($.which===229)return;let j;if($.key==="Escape"?j=Nd.escapeKeyDown:$.key==="Enter"?j=Nd.enterKeyDown:$.key==="Tab"&&(j=$.shiftKey?Nd.shiftTabKeyDown:Nd.tabKeyDown,$.preventDefault()),j){const V=X({},L,{reason:j});e.current.publishEvent("cellEditStop",V,$)}}else if(L.isEditable){let j;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:$,cellParams:L,editMode:"cell"}))return;if(b8e($)?j=cm.printableKeyDown:w8e($)?j=cm.pasteKeyDown:$.key==="Enter"?j=cm.enterKeyDown:($.key==="Backspace"||$.key==="Delete")&&(j=cm.deleteKeyDown),j){const U=X({},L,{reason:j,key:$.key});e.current.publishEvent("cellEditStart",U,$)}}},[e]),m=M.useCallback(L=>{const{id:$,field:j,reason:V}=L,U={id:$,field:j};(V===cm.printableKeyDown||V===cm.deleteKeyDown||V===cm.pasteKeyDown)&&(U.deleteValue=!0),e.current.startCellEditMode(U)},[e]),v=M.useCallback(L=>{const{id:$,field:j,reason:V}=L;e.current.runPendingEditCellValueMutation($,j);let U;V===Nd.enterKeyDown?U="below":V===Nd.tabKeyDown?U="right":V===Nd.shiftTabKeyDown&&(U="left");const z=V==="escapeKeyDown";e.current.stopCellEditMode({id:$,field:j,ignoreModifications:z,cellToFocusAfter:U})},[e]),y=L=>async(...$)=>{if(L){const{id:j,field:V}=$[0];e.current.state.editRows[j][V]?.error||L(...$)}};Ft(e,"cellDoubleClick",u(h)),Ft(e,"cellFocusOut",u(p)),Ft(e,"cellKeyDown",u(g)),Ft(e,"cellEditStart",u(m)),Ft(e,"cellEditStop",u(v)),ii(e,"cellEditStart",t.onCellEditStart),ii(e,"cellEditStop",y(t.onCellEditStop));const b=M.useCallback((L,$)=>{const j=Ts(e.current.state);return j[L]&&j[L][$]?ni.Edit:ni.View},[e]),w=ft(L=>{const $=L!==t.cellModesModel;c&&$&&c(L,{api:e.current}),!(t.cellModesModel&&$)&&(r(L),i.current=L,e.current.publishEvent("cellModesModelChange",L))}),S=M.useCallback((L,$,j)=>{const V=X({},i.current);if(j!==null)V[L]=X({},V[L],{[$]:X({},j)});else{const U=V[L],z=it(U,[$].map(tw));V[L]=z,Object.keys(V[L]).length===0&&delete V[L]}w(V)},[w]),_=M.useCallback((L,$,j)=>{e.current.setState(V=>{const U=X({},V.editRows);return j!==null?U[L]=X({},U[L],{[$]:X({},j)}):(delete U[L][$],Object.keys(U[L]).length===0&&delete U[L]),X({},V,{editRows:U})}),e.current.forceUpdate()},[e]),E=M.useCallback(L=>{const{id:$,field:j}=L,V=it(L,wUt);f($,j),d($,j,ni.View),S($,j,X({mode:ni.Edit},V))},[f,d,S]),T=ft(async L=>{const{id:$,field:j,deleteValue:V,initialValue:U}=L,z=e.current.getCellValue($,j);let N=z;V?N=une(e.current.getColumn(j)):U&&(N=U);const B=e.current.getColumn(j),H=!!B.preProcessEditCellProps&&V;let Q={value:N,error:!1,isProcessingProps:H};if(_($,j,Q),e.current.setCellFocus($,j),H&&(Q=await Promise.resolve(B.preProcessEditCellProps({id:$,row:e.current.getRow($),props:Q,hasChanged:N!==z})),e.current.getCellMode($,j)===ni.Edit)){const Y=Ts(e.current.state);_($,j,X({},Q,{value:Y[$][j].value,isProcessingProps:!1}))}}),k=M.useCallback(L=>{const{id:$,field:j}=L,V=it(L,SUt);d($,j,ni.Edit),S($,j,X({mode:ni.View},V))},[d,S]),P=ft(async L=>{const{id:$,field:j,ignoreModifications:V,cellToFocusAfter:U="none"}=L;d($,j,ni.Edit),e.current.runPendingEditCellValueMutation($,j);const z=()=>{_($,j,null),S($,j,null),U!=="none"&&e.current.moveFocusToRelativeCell($,j,U)};if(V){z();return}const N=Ts(e.current.state),{error:B,isProcessingProps:H}=N[$][j];if(B||H){o.current[$][j].mode=ni.Edit,S($,j,{mode:ni.Edit});return}const Q=e.current.getRowWithUpdatedValuesFromCellEditing($,j);if(s){const Y=Z=>{o.current[$][j].mode=ni.Edit,S($,j,{mode:ni.Edit}),a&&a(Z)};try{const Z=e.current.getRow($);Promise.resolve(s(Q,Z,{rowId:$})).then(pe=>{e.current.updateRows([pe]),z()}).catch(Y)}catch(Z){Y(Z)}}else e.current.updateRows([Q]),z()}),R=M.useCallback(async L=>{const{id:$,field:j,value:V,debounceMs:U,unstable_skipValueParser:z}=L;f($,j),d($,j,ni.Edit);const N=e.current.getColumn(j),B=e.current.getRow($);let H=V;N.valueParser&&!z&&(H=N.valueParser(V,B,N,e));let Q=Ts(e.current.state),Y=X({},Q[$][j],{value:H,changeReason:U?"debouncedSetEditCellValue":"setEditCellValue"});if(N.preProcessEditCellProps){const Z=V!==Q[$][j].value;Y=X({},Y,{isProcessingProps:!0}),_($,j,Y),Y=await Promise.resolve(N.preProcessEditCellProps({id:$,row:B,props:Y,hasChanged:Z}))}return e.current.getCellMode($,j)===ni.View?!1:(Q=Ts(e.current.state),Y=X({},Y,{isProcessingProps:!1}),Y.value=N.preProcessEditCellProps?Q[$][j].value:H,_($,j,Y),Q=Ts(e.current.state),!Q[$]?.[j]?.error)},[e,f,d,_]),I=M.useCallback((L,$)=>{const j=e.current.getColumn($),V=Ts(e.current.state),U=e.current.getRow(L);if(!V[L]||!V[L][$])return e.current.getRow(L);const{value:z}=V[L][$];return j.valueSetter?j.valueSetter(z,U,j,e):X({},U,{[$]:z})},[e]),F={getCellMode:b,startCellEditMode:E,stopCellEditMode:k},A={setCellEditingEditCellValue:R,getRowWithUpdatedValuesFromCellEditing:I};qn(e,F,"public"),qn(e,A,"private"),M.useEffect(()=>{l&&w(l)},[l,w]),ar(()=>{const L=Cf(e),$=o.current;o.current=mVe(n),Object.entries(n).forEach(([j,V])=>{Object.entries(V).forEach(([U,z])=>{const N=$[j]?.[U]?.mode||ni.View,B=L[j]?e.current.getRowId(L[j]):j;z.mode===ni.Edit&&N===ni.View?T(X({id:B,field:U},z)):z.mode===ni.View&&N===ni.Edit&&P(X({id:B,field:U},z))})})},[e,n,T,P])},CUt=["id"],OUt=["id"],EUt=(e,t)=>{const[n,r]=M.useState({}),i=M.useRef(n),o=M.useRef({}),s=M.useRef({}),a=M.useRef(void 0),l=M.useRef(null),{processRowUpdate:c,onProcessRowUpdateError:u,rowModesModel:f,onRowModesModelChange:d}=t,h=z=>(...N)=>{t.editMode===eg.Row&&z(...N)},p=M.useCallback((z,N)=>{const B=e.current.getCellParams(z,N);if(!e.current.isCellEditable(B))throw new Error(`MUI X: The cell with id=${z} and field=${N} is not editable.`)},[e]),g=M.useCallback((z,N)=>{if(e.current.getRowMode(z)!==N)throw new Error(`MUI X: The row with id=${z} is not in ${N} mode.`)},[e]),m=M.useCallback(z=>{const N=Ts(e.current.state);return Object.values(N[z]).some(B=>B.error)},[e]),v=M.useCallback((z,N)=>{if(!z.isEditable||e.current.getRowMode(z.id)===qi.Edit)return;const B=e.current.getRowParams(z.id),H=X({},B,{field:z.field,reason:Dy.cellDoubleClick});e.current.publishEvent("rowEditStart",H,N)},[e]),y=M.useCallback(z=>{l.current=z},[]),b=M.useCallback((z,N)=>{z.isEditable&&e.current.getRowMode(z.id)!==qi.View&&(l.current=null,a.current=setTimeout(()=>{if(l.current?.id!==z.id){if(!e.current.getRow(z.id)||e.current.getRowMode(z.id)===qi.View||m(z.id))return;const B=e.current.getRowParams(z.id),H=X({},B,{field:z.field,reason:Zh.rowFocusOut});e.current.publishEvent("rowEditStop",H,N)}}))},[e,m]);M.useEffect(()=>()=>{clearTimeout(a.current)},[]);const w=M.useCallback((z,N)=>{if(z.cellMode===qi.Edit){if(N.which===229)return;let B;if(N.key==="Escape")B=Zh.escapeKeyDown;else if(N.key==="Enter")B=Zh.enterKeyDown;else if(N.key==="Tab"){const H=$T(e).filter(Q=>e.current.getColumn(Q).type===AU?!0:e.current.isCellEditable(e.current.getCellParams(z.id,Q)));if(N.shiftKey?z.field===H[0]&&(B=Zh.shiftTabKeyDown):z.field===H[H.length-1]&&(B=Zh.tabKeyDown),N.preventDefault(),!B){const Q=H.findIndex(Z=>Z===z.field),Y=H[N.shiftKey?Q-1:Q+1];e.current.setCellFocus(z.id,Y)}}if(B){if(B!==Zh.escapeKeyDown&&m(z.id))return;const H=X({},e.current.getRowParams(z.id),{reason:B,field:z.field});e.current.publishEvent("rowEditStop",H,N)}}else if(z.isEditable){let B;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:N,cellParams:z,editMode:"row"}))return;if(b8e(N)||w8e(N)?B=Dy.printableKeyDown:N.key==="Enter"?B=Dy.enterKeyDown:(N.key==="Backspace"||N.key==="Delete")&&(B=Dy.deleteKeyDown),B){const Q=e.current.getRowParams(z.id),Y=X({},Q,{field:z.field,reason:B});e.current.publishEvent("rowEditStart",Y,N)}}},[e,m]),S=M.useCallback(z=>{const{id:N,field:B,reason:H}=z,Q={id:N,fieldToFocus:B};(H===Dy.printableKeyDown||H===Dy.deleteKeyDown)&&(Q.deleteValue=!!B),e.current.startRowEditMode(Q)},[e]),_=M.useCallback(z=>{const{id:N,reason:B,field:H}=z;e.current.runPendingEditCellValueMutation(N);let Q;B===Zh.enterKeyDown?Q="below":B===Zh.tabKeyDown?Q="right":B===Zh.shiftTabKeyDown&&(Q="left");const Y=B==="escapeKeyDown";e.current.stopRowEditMode({id:N,ignoreModifications:Y,field:H,cellToFocusAfter:Q})},[e]);Ft(e,"cellDoubleClick",h(v)),Ft(e,"cellFocusIn",h(y)),Ft(e,"cellFocusOut",h(b)),Ft(e,"cellKeyDown",h(w)),Ft(e,"rowEditStart",h(S)),Ft(e,"rowEditStop",h(_)),ii(e,"rowEditStart",t.onRowEditStart),ii(e,"rowEditStop",t.onRowEditStop);const E=M.useCallback(z=>u8e(e,{rowId:z,editMode:t.editMode})?qi.Edit:qi.View,[e,t.editMode]),T=ft(z=>{const N=z!==t.rowModesModel;d&&N&&d(z,{api:e.current}),!(t.rowModesModel&&N)&&(r(z),i.current=z,e.current.publishEvent("rowModesModelChange",z))}),k=M.useCallback((z,N)=>{const B=X({},i.current);N!==null?B[z]=X({},N):delete B[z],T(B)},[T]),P=M.useCallback((z,N)=>{e.current.setState(B=>{const H=X({},B.editRows);return N!==null?H[z]=N:delete H[z],X({},B,{editRows:H})}),e.current.forceUpdate()},[e]),R=M.useCallback((z,N,B)=>{e.current.setState(H=>{const Q=X({},H.editRows);return B!==null?Q[z]=X({},Q[z],{[N]:X({},B)}):(delete Q[z][N],Object.keys(Q[z]).length===0&&delete Q[z]),X({},H,{editRows:Q})}),e.current.forceUpdate()},[e]),I=M.useCallback(z=>{const{id:N}=z,B=it(z,CUt);g(N,qi.View),k(N,X({mode:qi.Edit},B))},[g,k]),F=ft(z=>{const{id:N,fieldToFocus:B,deleteValue:H,initialValue:Q}=z,Y=e.current.getRow(N),Z=Ff(e),pe=Z.reduce((ie,ne)=>{const fe=ne.field;if(!e.current.getCellParams(N,fe).isEditable)return ie;const se=e.current.getColumn(fe);let ue=e.current.getCellValue(N,fe);return B===fe&&(H||Q)&&(H?ue=une(se):Q&&(ue=Q)),ie[fe]={value:ue,error:!1,isProcessingProps:se.editable&&!!se.preProcessEditCellProps&&H},ie},{});s.current[N]=Y,P(N,pe),B&&e.current.setCellFocus(N,B),Z.filter(ie=>e.current.getCellParams(N,ie.field).isEditable&&ie.editable&&!!ie.preProcessEditCellProps&&H).forEach(ie=>{const ne=ie.field,fe=e.current.getCellValue(N,ne),me=H?une(ie):Q??fe;Promise.resolve(ie.preProcessEditCellProps({id:N,row:Y,props:pe[ne],hasChanged:me!==fe})).then(se=>{if(e.current.getRowMode(N)===qi.Edit){const ue=Ts(e.current.state);R(N,ne,X({},se,{value:ue[N][ne].value,isProcessingProps:!1}))}})})}),A=M.useCallback(z=>{const{id:N}=z,B=it(z,OUt);g(N,qi.Edit),k(N,X({mode:qi.View},B))},[g,k]),L=ft(z=>{const{id:N,ignoreModifications:B,field:H,cellToFocusAfter:Q="none"}=z;e.current.runPendingEditCellValueMutation(N);const Y=()=>{Q!=="none"&&H&&e.current.moveFocusToRelativeCell(N,H,Q),P(N,null),k(N,null),delete s.current[N]};if(B){Y();return}const Z=Ts(e.current.state),pe=s.current[N];if(Object.values(Z[N]).some(fe=>fe.isProcessingProps)){o.current[N].mode=qi.Edit;return}if(m(N)){o.current[N].mode=qi.Edit,k(N,{mode:qi.Edit});return}const ne=e.current.getRowWithUpdatedValuesFromRowEditing(N);if(c){const fe=me=>{o.current[N]&&(o.current[N].mode=qi.Edit,k(N,{mode:qi.Edit})),u&&u(me)};try{Promise.resolve(c(ne,pe,{rowId:N})).then(me=>{e.current.updateRows([me]),Y()}).catch(fe)}catch(me){fe(me)}}else e.current.updateRows([ne]),Y()}),$=M.useCallback(z=>{const{id:N,field:B,value:H,debounceMs:Q,unstable_skipValueParser:Y}=z;p(N,B);const Z=e.current.getColumn(B),pe=e.current.getRow(N);let ie=H;Z.valueParser&&!Y&&(ie=Z.valueParser(H,pe,Z,e));let ne=Ts(e.current.state),fe=X({},ne[N][B],{value:ie,changeReason:Q?"debouncedSetEditCellValue":"setEditCellValue"});return Z.preProcessEditCellProps||R(N,B,fe),new Promise(me=>{const se=[];if(Z.preProcessEditCellProps){const ue=fe.value!==ne[N][B].value;fe=X({},fe,{isProcessingProps:!0}),R(N,B,fe);const G=ne[N],ce=it(G,[B].map(tw)),he=Promise.resolve(Z.preProcessEditCellProps({id:N,row:pe,props:fe,hasChanged:ue,otherFieldsProps:ce})).then(J=>{if(e.current.getRowMode(N)===qi.View){me(!1);return}ne=Ts(e.current.state),J=X({},J,{isProcessingProps:!1}),J.value=Z.preProcessEditCellProps?ne[N][B].value:ie,R(N,B,J)});se.push(he)}Object.entries(ne[N]).forEach(([ue,G])=>{if(ue===B)return;const ce=e.current.getColumn(ue);if(!ce.preProcessEditCellProps)return;G=X({},G,{isProcessingProps:!0}),R(N,ue,G),ne=Ts(e.current.state);const he=ne[N],J=it(he,[ue].map(tw)),te=Promise.resolve(ce.preProcessEditCellProps({id:N,row:pe,props:G,hasChanged:!1,otherFieldsProps:J})).then(ae=>{if(e.current.getRowMode(N)===qi.View){me(!1);return}ae=X({},ae,{isProcessingProps:!1}),R(N,ue,ae)});se.push(te)}),Promise.all(se).then(()=>{e.current.getRowMode(N)===qi.Edit?(ne=Ts(e.current.state),me(!ne[N][B].error)):me(!1)})})},[e,p,R]),j=M.useCallback(z=>{const N=Ts(e.current.state),B=e.current.getRow(z);if(!N[z])return e.current.getRow(z);let H=X({},s.current[z],B);return Object.entries(N[z]).forEach(([Q,Y])=>{const Z=e.current.getColumn(Q);Z?.valueSetter?H=Z.valueSetter(Y.value,H,Z,e):H[Q]=Y.value}),H},[e]),V={getRowMode:E,startRowEditMode:I,stopRowEditMode:A},U={setRowEditingEditCellValue:$,getRowWithUpdatedValuesFromRowEditing:j};qn(e,V,"public"),qn(e,U,"private"),M.useEffect(()=>{f&&T(f)},[f,T]),ar(()=>{const z=Cf(e),N=o.current;o.current=mVe(n);const B=new Set([...Object.keys(n),...Object.keys(N)]);Array.from(B).forEach(H=>{const Q=n[H]??{mode:qi.View},Y=N[H]?.mode||qi.View,Z=z[H]?e.current.getRowId(z[H]):H;Q.mode===qi.Edit&&Y===qi.View?F(X({id:Z},Q)):Q.mode===qi.View&&Y===qi.Edit&&L(X({id:Z},Q))})},[e,n,F,L])},TUt=e=>X({},e,{editRows:{}}),PUt=(e,t)=>{_Ut(e,t),EUt(e,t);const n=M.useRef({}),{isCellEditable:r}=t,i=M.useCallback(d=>JO(d.rowNode)||!d.colDef.editable||!d.colDef.renderEditCell?!1:r?r(d):!0,[r]),o=(d,h,p,g)=>{if(!p){g();return}if(n.current[d]||(n.current[d]={}),n.current[d][h]){const[y]=n.current[d][h];clearTimeout(y)}const m=()=>{const[y]=n.current[d][h];clearTimeout(y),g(),delete n.current[d][h]},v=setTimeout(()=>{g(),delete n.current[d][h]},p);n.current[d][h]=[v,m]};M.useEffect(()=>{const d=n.current;return()=>{Object.entries(d).forEach(([h,p])=>{Object.keys(p).forEach(g=>{const[m]=d[h][g];clearTimeout(m),delete d[h][g]})})}},[]);const s=M.useCallback((d,h)=>{if(n.current[d]){if(!h)Object.keys(n.current[d]).forEach(p=>{const[,g]=n.current[d][p];g()});else if(n.current[d][h]){const[,p]=n.current[d][h];p()}}},[]),a=M.useCallback(d=>{const{id:h,field:p,debounceMs:g}=d;return new Promise(m=>{o(h,p,g,async()=>{const v=t.editMode===eg.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(h,p)===ni.Edit){const y=await v(d);m(y)}})})},[e,t.editMode]),l=M.useCallback((d,h)=>t.editMode===eg.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(d,h):e.current.getRowWithUpdatedValuesFromRowEditing(d),[e,t.editMode]),c=M.useCallback((d,h)=>Ts(e.current.state)[d]?.[h]??null,[e]),u={isCellEditable:i,setEditCellValue:a,getRowWithUpdatedValues:l,unstable_getEditCellMeta:c},f={runPendingEditCellValueMutation:s};qn(e,u,"public"),qn(e,f,"private")},kUt=(e,t,n)=>{const r=!!t.unstable_dataSource;return n.current.caches.rows=Dz({rows:r?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),X({},e,{rows:PVe({apiRef:n,rowCountProp:t.rowCount,loadingProp:r?!0:t.loading,previousTree:null,previousTreeDepths:null})})},MUt=(e,t)=>{const n=Ns(e,"useGridRows"),r=M.useRef(Date.now()),i=M.useRef(t.rowCount),o=jl(),s=M.useCallback(L=>{const $=Cf(e)[L];if($)return $;const j=e.current.getRowNode(L);return j&&JO(j)?{[ZO]:L}:null},[e]),a=M.useCallback(L=>ID(e.current.state,L),[e]),l=M.useCallback(({cache:L,throttle:$})=>{const j=()=>{r.current=Date.now(),e.current.setState(U=>X({},U,{rows:PVe({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:ds(e),previousTreeDepths:vSe(e),previousGroupsToFetch:ONt(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(o.clear(),e.current.caches.rows=L,!$){j();return}const V=t.throttleRowsMs-(Date.now()-r.current);if(V>0){o.start(V,j);return}j()},[t.throttleRowsMs,t.rowCount,t.loading,e,o]),c=M.useCallback(L=>{n.debug(`Updating all rows, new length ${L.length}`);const $=Dz({rows:L,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),j=e.current.caches.rows;$.rowsBeforePartialUpdates=j.rowsBeforePartialUpdates,l({cache:$,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,l,e]),u=M.useCallback(L=>{if(t.signature===Lf.DataGrid&&L.length>1)throw new Error(["MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` -`));const $=PSe(e,L,t.getRowId),j=TSe({updates:$,getRowId:t.getRowId,previousCache:e.current.caches.rows});l({cache:j,throttle:!0})},[t.signature,t.getRowId,l,e]),f=M.useCallback((L,$)=>{const j=PSe(e,L,t.getRowId),V=TSe({updates:j,getRowId:t.getRowId,previousCache:e.current.caches.rows,groupKeys:$??[]});l({cache:V,throttle:!1})},[t.getRowId,l,e]),d=M.useCallback(L=>{L!==t.loading&&(n.debug(`Setting loading to ${L}`),e.current.setState($=>X({},$,{rows:X({},$.rows,{loading:L})})),e.current.caches.rows.loadingPropBeforePartialUpdates=L)},[t.loading,e,n]),h=M.useCallback(()=>{const L=eM(e),$=Cf(e);return new Map(L.map(j=>[j,$[j]??{}]))},[e]),p=M.useCallback(()=>kD(e),[e]),g=M.useCallback(()=>eM(e),[e]),m=M.useCallback(L=>{const $=e.current.getRow(L),{rowToIndexMap:j}=I0(e);return j.get($)},[e]),v=M.useCallback((L,$)=>{const j=e.current.getRowNode(L);if(!j)throw new Error(`MUI X: No row with id #${L} found.`);if(j.type!=="group")throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const V=X({},j,{childrenExpanded:$});e.current.setState(U=>X({},U,{rows:X({},U.rows,{tree:X({},U.rows.tree,{[L]:V})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",V)},[e]),y=M.useCallback(L=>ds(e)[L]??null,[e]),b=M.useCallback(({skipAutoGeneratedRows:L=!0,groupId:$,applySorting:j,applyFiltering:V})=>{const U=ds(e);let z;if(j){const N=U[$];if(!N)return[];const B=zT(e);z=[];const H=B.findIndex(Q=>Q===$)+1;for(let Q=H;QN.depth;Q+=1){const Y=B[Q];(!L||!JO(U[Y]))&&z.push(Y)}}else z=Fce(U,$,L);if(V){const N=jT(e);z=z.filter(B=>N[B]!==!1)}return z},[e]),w=M.useCallback((L,$)=>{const j=e.current.getRowNode(L);if(!j)throw new Error(`MUI X: No row with id #${L} found.`);if(j.parent!==Ca)throw new Error("MUI X: The row reordering do not support reordering of grouped rows yet.");if(j.type!=="leaf")throw new Error("MUI X: The row reordering do not support reordering of footer or grouping rows.");e.current.setState(V=>{const U=ds(V,e.current.instanceId)[Ca],z=U.children,N=z.findIndex(H=>H===L);if(N===-1||N===$)return V;n.debug(`Moving row ${L} to index ${$}`);const B=[...z];return B.splice($,0,B.splice(N,1)[0]),X({},V,{rows:X({},V.rows,{tree:X({},V.rows.tree,{[Ca]:X({},U,{children:B})})})})}),e.current.publishEvent("rowsSet")},[e,n]),S=M.useCallback((L,$)=>{if(t.signature===Lf.DataGrid&&$.length>1)throw new Error(["MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` -`));if($.length===0)return;if(mS(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const V=X({},ds(e)),U=X({},Cf(e)),z=X({},mSe(e)),N=V[Ca],B=[...N.children],H=new Set;for(let Y=0;Y<$.length;Y+=1){const Z=$[Y],pe=RU(Z,t.getRowId,"A row was provided without id when calling replaceRows()."),[ie]=B.splice(L+Y,1,pe);H.has(ie)||(delete U[ie],delete z[ie],delete V[ie]);const ne={id:pe,depth:0,parent:Ca,type:"leaf",groupingKey:null};U[pe]=Z,z[pe]=pe,V[pe]=ne,H.add(pe)}V[Ca]=X({},N,{children:B});const Q=B.filter(Y=>V[Y]?.type==="leaf");e.current.caches.rows.dataRowIdToModelLookup=U,e.current.caches.rows.dataRowIdToIdLookup=z,e.current.setState(Y=>X({},Y,{rows:X({},Y.rows,{dataRowIdToModelLookup:U,dataRowIdToIdLookup:z,dataRowIds:Q,tree:V})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),_={getRow:s,setLoading:d,getRowId:a,getRowModels:h,getRowsCount:p,getAllRowIds:g,setRows:c,updateRows:u,getRowNode:y,getRowIndexRelativeToVisibleRows:m,unstable_replaceRows:S},E={setRowIndex:w,setRowChildrenExpansion:v,getRowGroupChildren:b},T={updateServerRows:f},k=M.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let L;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?L=X({},e.current.caches.rows,{updates:{type:"full",rows:eM(e)}}):L=Dz({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),l({cache:L,throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,l]),P=ad(()=>t.unstable_dataSource),R=M.useCallback(L=>{if(t.unstable_dataSource&&t.unstable_dataSource!==P.current){P.current=t.unstable_dataSource;return}L==="rowTreeCreation"&&k()},[k,P,t.unstable_dataSource]),I=M.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==ENt(e)&&k()},[e,k]);Ft(e,"activeStrategyProcessorChange",R),Ft(e,"strategyAvailabilityChange",I);const F=M.useCallback(()=>{e.current.setState(L=>{const $=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:ds(L,e.current.instanceId),treeDepths:vSe(L,e.current.instanceId),dataRowIds:eM(L,e.current.instanceId),dataRowIdToModelLookup:Cf(L,e.current.instanceId),dataRowIdToIdLookup:mSe(L,e.current.instanceId)});return X({},L,{rows:X({},L.rows,$,{totalTopLevelRowCount:TVe({tree:$.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,t.rowCount]);Zce(e,"hydrateRows",F),qn(e,_,"public"),qn(e,E,t.signature===Lf.DataGrid?"private":"public"),qn(e,T,"private");const A=M.useRef(!0);M.useEffect(()=>{if(A.current){A.current=!1;return}let L=!1;t.rowCount!==i.current&&(L=!0,i.current=t.rowCount);const $=e.current.caches.rows.rowsBeforePartialUpdates===t.rows,j=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,V=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;$&&(j||(e.current.setState(U=>X({},U,{rows:X({},U.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),V||(e.current.setState(U=>X({},U,{rows:X({},U.rows,{totalRowCount:Math.max(t.rowCount||0,U.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,U.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate()),!L)||(n.debug(`Updating all rows, new length ${t.rows?.length}`),l({cache:Dz({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1}))},[t.rows,t.rowCount,t.getRowId,t.loading,n,l,e])},AUt=e=>{const t={[Ca]:X({},a3t(),{children:e})};for(let n=0;n{const n=X({},e),r={};for(let s=0;s!r[s])),n[Ca]=X({},i,{children:o}),{groupingName:hw,tree:n,treeDepths:{0:o.length},dataRowIds:o}},IUt=e=>e.updates.type==="full"?AUt(e.updates.rows):RUt({previousTree:e.previousTree,actions:e.updates.actions}),DUt=e=>{Cj(e,hw,"rowTreeCreation",IUt)};class a7 extends Error{}function LUt(e,t){const n=M.useCallback(p=>({field:p,colDef:e.current.getColumn(p)}),[e]),r=M.useCallback(p=>{const g=e.current.getRow(p);if(!g)throw new a7(`No row with id #${p} found`);return{id:p,columns:e.current.getAllColumns(),row:g}},[e]),i=M.useCallback((p,g,m,{cellMode:v,colDef:y,hasFocus:b,rowNode:w,tabIndex:S})=>{const _=m[g],E=y?.valueGetter?y.valueGetter(_,m,y,e):_,T={id:p,field:g,row:m,rowNode:w,colDef:y,cellMode:v,hasFocus:b,tabIndex:S,value:E,formattedValue:E,isEditable:!1,api:e.current};return y&&y.valueFormatter&&(T.formattedValue=y.valueFormatter(E,m,y,e)),T.isEditable=y&&e.current.isCellEditable(T),T},[e]),o=M.useCallback((p,g)=>{const m=e.current.getRow(p),v=e.current.getRowNode(p);if(!m||!v)throw new a7(`No row with id #${p} found`);const y=vc(e),b=Bce(e),w=e.current.getCellMode(p,g);return e.current.getCellParamsForRow(p,g,m,{colDef:t.unstable_listView&&t.unstable_listColumn?.field===g?tE(e.current.state):e.current.getColumn(g),rowNode:v,hasFocus:y!==null&&y.field===g&&y.id===p,tabIndex:b&&b.field===g&&b.id===p?0:-1,cellMode:w})},[e,t.unstable_listView,t.unstable_listColumn?.field]),s=M.useCallback((p,g)=>{const m=e.current.getColumn(g),v=e.current.getRow(p);if(!v)throw new a7(`No row with id #${p} found`);return!m||!m.valueGetter?v[g]:m.valueGetter(v[m.field],v,m,e)},[e]),a=M.useCallback((p,g)=>{const m=g.field;if(!g||!g.valueGetter)return p[m];const v=p[g.field];return g.valueGetter(v,p,g,e)},[e]),l=M.useCallback((p,g)=>{const m=a(p,g);return!g||!g.valueFormatter?m:g.valueFormatter(m,p,g,e)},[e,a]),c=M.useCallback(p=>e.current.rootElementRef.current?Ujt(e.current.rootElementRef.current,p):null,[e]),u=M.useCallback(p=>e.current.rootElementRef.current?Vjt(e.current.rootElementRef.current,p):null,[e]),f=M.useCallback((p,g)=>e.current.rootElementRef.current?Wjt(e.current.rootElementRef.current,{id:p,field:g}):null,[e]),d={getCellValue:s,getCellParams:o,getCellElement:f,getRowValue:a,getRowFormattedValue:l,getRowParams:r,getRowElement:u,getColumnHeaderParams:n,getColumnHeaderElement:c},h={getCellParamsForRow:i};qn(e,d,"public"),qn(e,h,"private")}const T8e=(e,t)=>e==null||Array.isArray(e)?e:t&&t[0]===e?t:[e],FUt=(e,t)=>X({},e,{rowSelection:t.rowSelection?T8e(t.rowSelectionModel)??[]:[]}),$Ut=(e,t)=>{const n=Ns(e,"useGridSelection"),r=M.useCallback(V=>(...U)=>{t.rowSelection&&V(...U)},[t.rowSelection]),i=t.signature!==Lf.DataGrid&&(t.rowSelectionPropagation?.parents||t.rowSelectionPropagation?.descendants),o=M.useMemo(()=>T8e(t.rowSelectionModel,hu(e.current.state)),[e,t.rowSelectionModel]),s=M.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:o,propOnChange:t.onRowSelectionModelChange,stateSelector:hu,changeEvent:"rowSelectionChange"});const{checkboxSelection:a,disableRowSelectionOnClick:l,isRowSelectable:c}=t,u=jce(t),f=ut(e,ds),d=ut(e,mS)>1,h=M.useCallback(V=>{let U=V;const z=s.current??V,N=e.current.isRowSelected(V);if(N){const B=hO(e),H=B.findIndex(Y=>Y===z),Q=B.findIndex(Y=>Y===U);if(H===Q)return;H>Q?U=B[Q+1]:U=B[Q-1]}s.current=V,e.current.selectRowRange({startId:z,endId:U},!N)},[e]),p=M.useCallback(V=>{if(t.signature===Lf.DataGrid&&!u&&Array.isArray(V)&&V.length>1)throw new Error(["MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join(` -`));hu(e.current.state)!==V&&(n.debug("Setting selection model"),e.current.setState(z=>X({},z,{rowSelection:t.rowSelection?V:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,u]),g=M.useCallback(V=>hu(e.current.state).includes(V),[e]),m=M.useCallback(V=>{if(t.rowSelection===!1||c&&!c(e.current.getRowParams(V)))return!1;const U=ds(e)[V];return!(U?.type==="footer"||U?.type==="pinnedRow")},[e,t.rowSelection,c]),v=M.useCallback(()=>A3t(e),[e]),y=M.useCallback((V,U=!0,z=!1)=>{if(e.current.isRowSelectable(V))if(s.current=V,z){n.debug(`Setting selection for row ${V}`);const N=[],B=H=>{N.push(H)};U&&(B(V),i&&Fk(e,f,V,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,B)),e.current.setRowSelectionModel(N)}else{n.debug(`Toggling selection for row ${V}`);const N=hu(e.current.state),B=new Set(N);B.delete(V);const H=Z=>{B.add(Z)},Q=Z=>{B.delete(Z)};U?(H(V),i&&Fk(e,f,V,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,H)):i&&kSe(e,f,V,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,Q),(B.size<2||u)&&e.current.setRowSelectionModel(Array.from(B))}},[e,n,i,f,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,u]),b=M.useCallback((V,U=!0,z=!1)=>{n.debug("Setting selection for several rows");const N=V.filter(Q=>e.current.isRowSelectable(Q));let B;if(z){if(U){if(B=new Set(N),i){const Y=Z=>{B.add(Z)};N.forEach(Z=>{Fk(e,f,Z,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,Y)})}}else B=new Set;const Q=R0(e);if(B.size===Object.keys(Q).length&&Array.from(B).every(Y=>Q[Y]===Y))return}else{B=new Set(Object.values(R0(e)));const Q=Z=>{B.add(Z)},Y=Z=>{B.delete(Z)};N.forEach(Z=>{U?(B.add(Z),i&&Fk(e,f,Z,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,Q)):(Y(Z),i&&kSe(e,f,Z,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,Y))})}(B.size<2||u)&&e.current.setRowSelectionModel(Array.from(B))},[n,i,u,e,f,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents]),w=M.useCallback(V=>{if(!d||!i||V.length===0)return V;const U=new Set(V),z=N=>{U.add(N)};for(const N of V)Fk(e,f,N,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,z,U);return Array.from(U)},[e,f,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,d,i]),S=M.useCallback(({startId:V,endId:U},z=!0,N=!1)=>{if(!e.current.getRow(V)||!e.current.getRow(U))return;n.debug(`Expanding selection from row ${V} to row ${U}`);const B=hO(e),H=B.indexOf(V),Q=B.indexOf(U),[Y,Z]=H>Q?[Q,H]:[H,Q],pe=B.slice(Y,Z+1);e.current.selectRows(pe,z,N)},[e,n]),_={selectRow:y,setRowSelectionModel:p,getSelectedRows:v,isRowSelected:g,isRowSelectable:m},E={selectRows:b,selectRowRange:S,getPropagatedRowSelectionModel:w};qn(e,_,"public"),qn(e,E,t.signature===Lf.DataGrid?"private":"public");const T=M.useRef(!0),k=M.useCallback((V=!1)=>{if(T.current)return;const U=hu(e.current.state),z=Cf(e),N=jT(e),B=X({},R0(e)),H=Z=>t.filterMode==="server"?!z[Z]:!z[Z]||N[Z]===!1;let Q=!1;U.forEach(Z=>{if(H(Z)){if(t.keepNonExistentRowsSelected)return;delete B[Z],Q=!0;return}if(!t.rowSelectionPropagation?.parents)return;const pe=f[Z];if(pe.type==="group"){if(pe.isAutoGenerated){delete B[Z],Q=!0;return}pe.children.every(ne=>N[ne]===!1)||(delete B[Z],Q=!0)}});const Y=d&&t.rowSelectionPropagation?.parents&&Object.keys(B).length>0;if(Q||Y&&!V){const Z=Object.values(B);Y?e.current.selectRows(Z,!0,!0):e.current.setRowSelectionModel(Z)}},[e,d,t.rowSelectionPropagation?.parents,t.keepNonExistentRowsSelected,t.filterMode,f]),P=M.useCallback((V,U)=>{const z=U.metaKey||U.ctrlKey,N=!a&&!z&&!VBt(U),B=!u||N,H=e.current.isRowSelected(V);B?e.current.selectRow(V,N?!0:!H,!0):e.current.selectRow(V,!H,!1)},[e,u,a]),R=M.useCallback((V,U)=>{if(l)return;const z=U.target.closest(`.${ve.cell}`)?.getAttribute("data-field");z===BT.field||z===IU||z&&e.current.getColumn(z)?.type===AU||ds(e)[V.id].type==="pinnedRow"||(U.shiftKey&&u?h(V.id):P(V.id,U))},[l,u,e,h,P]),I=M.useCallback((V,U)=>{u&&U.shiftKey&&window.getSelection()?.removeAllRanges()},[u]),F=M.useCallback((V,U)=>{u&&U.nativeEvent.shiftKey?h(V.id):e.current.selectRow(V.id,V.value,!u)},[e,h,u]),A=M.useCallback(V=>{const U=t.pagination&&t.checkboxSelectionVisibleOnly&&t.paginationMode==="client"?qVe(e):hO(e);e.current.selectRows(U,V.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination,t.paginationMode]),L=M.useCallback((V,U)=>{if(e.current.getCellMode(V.id,V.field)!==ni.Edit&&!FD(U)){if(wj(U.key)&&U.shiftKey){const z=vc(e);if(z&&z.id!==V.id){U.preventDefault();const N=e.current.isRowSelected(z.id);if(!u){e.current.selectRow(z.id,!N,!0);return}const B=e.current.getRowIndexRelativeToVisibleRows(z.id),H=e.current.getRowIndexRelativeToVisibleRows(V.id);let Q,Y;B>H?N?(Q=H,Y=B-1):(Q=H,Y=B):N?(Q=B+1,Y=H):(Q=B,Y=H);const pe=I0(e).rows.slice(Q,Y+1).map(ie=>ie.id);e.current.selectRows(pe,!N);return}}if(U.key===" "&&U.shiftKey){U.preventDefault(),P(V.id,U);return}String.fromCharCode(U.keyCode)==="A"&&(U.ctrlKey||U.metaKey)&&(U.preventDefault(),b(e.current.getAllRowIds(),!0))}},[e,P,b,u]),$=ft(()=>{if(!t.rowSelection){e.current.setRowSelectionModel([]);return}if(o===void 0)return;if(!i||!d||o.length===0){e.current.setRowSelectionModel(o);return}const V=e.current.getPropagatedRowSelectionModel(o);if(V.length!==o.length||!V.every(U=>o.includes(U))){e.current.setRowSelectionModel(V);return}e.current.setRowSelectionModel(o)});Ft(e,"sortedRowsSet",r(()=>k(!0))),Ft(e,"filteredRowsSet",r(()=>k())),Ft(e,"rowClick",r(R)),Ft(e,"rowSelectionCheckboxChange",r(F)),Ft(e,"headerSelectionCheckboxChange",A),Ft(e,"cellMouseDown",r(I)),Ft(e,"cellKeyDown",r(L)),M.useEffect(()=>{$()},[e,o,t.rowSelection,$]);const j=o!=null;M.useEffect(()=>{if(j||!t.rowSelection)return;const V=hu(e.current.state);if(m){const U=V.filter(z=>m(z));U.length{if(!t.rowSelection||j)return;const V=hu(e.current.state);!u&&V.length>1&&e.current.setRowSelectionModel([])},[e,u,a,j,t.rowSelection]),M.useEffect(()=>{r(k)},[k,r]),M.useEffect(()=>{T.current&&(T.current=!1)},[])},NUt=e=>{const{classes:t}=e;return M.useMemo(()=>Xe({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},hr,t),[t])},zUt=(e,t)=>{const n={classes:t.classes},r=NUt(n),i=M.useCallback(o=>{const s=X({},BT,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),a=t.checkboxSelection,l=o.lookup[df]!=null;return a&&!l?(o.lookup[df]=s,o.orderedFields=[df,...o.orderedFields]):!a&&l?(delete o.lookup[df],o.orderedFields=o.orderedFields.filter(c=>c!==df)):a&&l&&(o.lookup[df]=X({},s,o.lookup[df]),t.columns.some(c=>c.field===df)||(o.orderedFields=[df,...o.orderedFields.filter(c=>c!==df)])),o},[e,r,t.columns,t.checkboxSelection]);fo(e,"hydrateColumns",i)},jUt=(e,t)=>{const n=t.sortModel??t.initialState?.sorting?.sortModel??[];return X({},e,{sorting:{sortModel:hVe(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},BUt=(e,t)=>{const n=Ns(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:zd,changeEvent:"sortModelChange"});const r=M.useCallback((S,_)=>{const E=zd(e),T=E.findIndex(P=>P.field===S);let k=[...E];return T>-1?_?.sort==null?k.splice(T,1):k.splice(T,1,_):k=[...E,_],k},[e]),i=M.useCallback((S,_)=>{const T=zd(e).find(k=>k.field===S.field);if(T){const k=_===void 0?bSe(S.sortingOrder??t.sortingOrder,T.sort):_;return k===void 0?void 0:X({},T,{sort:k})}return{field:S.field,sort:_===void 0?bSe(S.sortingOrder??t.sortingOrder):_}},[e,t.sortingOrder]),o=M.useCallback((S,_)=>_==null||_.sortable===!1||t.disableColumnSorting?S:(_.sortingOrder||t.sortingOrder).some(T=>!!T)?[...S,"columnMenuSortItem"]:S,[t.sortingOrder,t.disableColumnSorting]),s=M.useCallback(()=>{e.current.setState(S=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),X({},S,{sorting:X({},S.sorting,{sortedRows:Fce(ds(e),Ca,!1)})});const _=zd(S,e.current.instanceId),E=ANt(_,e),T=e.current.applyStrategyProcessor("sorting",{sortRowList:E});return X({},S,{sorting:X({},S.sorting,{sortedRows:T})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,n,t.sortingMode]),a=M.useCallback(S=>{zd(e)!==S&&(n.debug("Setting sort model"),e.current.setState(ySe(S,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),l=M.useCallback((S,_,E)=>{const T=e.current.getColumn(S),k=i(T,_);let P;!E||t.disableMultipleColumnsSorting?P=k?.sort==null?[]:[k]:P=r(T.field,k),e.current.setSortModel(P)},[e,r,i,t.disableMultipleColumnsSorting]),c=M.useCallback(()=>zd(e),[e]),u=M.useCallback(()=>$ce(e).map(_=>_.model),[e]),f=M.useCallback(()=>zT(e),[e]),d=M.useCallback(S=>e.current.getSortedRowIds()[S],[e]);qn(e,{getSortModel:c,getSortedRows:u,getSortedRowIds:f,getRowIdFromRowIndex:d,setSortModel:a,sortColumn:l,applySorting:s},"public");const p=M.useCallback((S,_)=>{const E=zd(e);return!_.exportOnlyDirtyModels||t.sortModel!=null||t.initialState?.sorting?.sortModel!=null||E.length>0?X({},S,{sorting:{sortModel:E}}):S},[e,t.sortModel,t.initialState?.sorting?.sortModel]),g=M.useCallback((S,_)=>{const E=_.stateToRestore.sorting?.sortModel;return E==null?S:(e.current.setState(ySe(E,t.disableMultipleColumnsSorting)),X({},S,{callbacks:[...S.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),m=M.useCallback(S=>{const _=ds(e),E=_[Ca],T=S.sortRowList?S.sortRowList(E.children.map(k=>_[k])):[...E.children];return E.footerId!=null&&T.push(E.footerId),T},[e]);fo(e,"exportState",p),fo(e,"restoreState",g),Cj(e,hw,"sorting",m);const v=M.useCallback(({field:S,colDef:_},E)=>{if(!_.sortable||t.disableColumnSorting)return;const T=E.shiftKey||E.metaKey||E.ctrlKey;l(S,void 0,T)},[l,t.disableColumnSorting]),y=M.useCallback(({field:S,colDef:_},E)=>{!_.sortable||t.disableColumnSorting||E.key==="Enter"&&!E.ctrlKey&&!E.metaKey&&l(S,void 0,E.shiftKey)},[l,t.disableColumnSorting]),b=M.useCallback(()=>{const S=zd(e),_=kv(e);if(S.length>0){const E=S.filter(T=>_[T.field]);E.length{S==="sorting"&&e.current.applySorting()},[e]);fo(e,"columnMenu",o),Ft(e,"columnHeaderClick",v),Ft(e,"columnHeaderKeyDown",y),Ft(e,"rowsSet",e.current.applySorting),Ft(e,"columnsChange",b),Ft(e,"activeStrategyProcessorChange",w),MD(()=>{e.current.applySorting()}),ar(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function f_e(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:i}=e,o=i+r;if(r>t)return i;if(o-t>n)return o-t;if(i{const n=bi(),r=Ns(e,"useGridScroll"),i=e.current.columnHeadersContainerRef,o=e.current.virtualScrollerRef,s=ut(e,kb),a=M.useCallback(f=>{const d=Is(e.current.state),h=kD(e),p=t.unstable_listView?[tE(e.current.state)]:Mo(e);if(!(f.rowIndex==null)&&h===0||p.length===0)return!1;r.debug(`Scrolling to cell at row ${f.rowIndex}, col: ${f.colIndex} `);let m={};if(f.colIndex!==void 0){const v=Pb(e);let y;if(typeof f.rowIndex<"u"){const b=s[f.rowIndex]?.id,w=e.current.unstable_getCellColSpanInfo(b,f.colIndex);w&&!w.spannedByColSpan&&(y=w.cellProps.width)}typeof y>"u"&&(y=p[f.colIndex].computedWidth),m.left=f_e({containerSize:d.viewportOuterSize.width,scrollPosition:Math.abs(o.current.scrollLeft),elementSize:y,elementOffset:v[f.colIndex]})}if(f.rowIndex!==void 0){const v=UT(e.current.state),y=q3t(e),b=HVe(e),w=t.pagination?f.rowIndex-y*b:f.rowIndex,S=v.positions[w+1]?v.positions[w+1]-v.positions[w]:v.currentPageTotalHeight-v.positions[w];m.top=f_e({containerSize:d.viewportInnerSize.height,scrollPosition:o.current.scrollTop,elementSize:S,elementOffset:v.positions[w]})}return m=e.current.unstable_applyPipeProcessors("scrollToIndexes",m,f),typeof m.left!==void 0||typeof m.top!==void 0?(e.current.scroll(m),!0):!1},[r,e,o,t.pagination,s,t.unstable_listView]),l=M.useCallback(f=>{if(o.current&&f.left!==void 0&&i.current){const d=n?-1:1;i.current.scrollLeft=f.left,o.current.scrollLeft=d*f.left,r.debug(`Scrolling left: ${f.left}`)}o.current&&f.top!==void 0&&(o.current.scrollTop=f.top,r.debug(`Scrolling top: ${f.top}`)),r.debug("Scrolling, updating container, and viewport")},[o,n,i,r]),c=M.useCallback(()=>o?.current?{top:o.current.scrollTop,left:o.current.scrollLeft}:{top:0,left:0},[o]);qn(e,{scroll:l,scrollToIndexes:a,getScrollPosition:c},"public")};function VUt(e,t){ii(e,"columnHeaderClick",t.onColumnHeaderClick),ii(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),ii(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),ii(e,"columnHeaderOver",t.onColumnHeaderOver),ii(e,"columnHeaderOut",t.onColumnHeaderOut),ii(e,"columnHeaderEnter",t.onColumnHeaderEnter),ii(e,"columnHeaderLeave",t.onColumnHeaderLeave),ii(e,"cellClick",t.onCellClick),ii(e,"cellDoubleClick",t.onCellDoubleClick),ii(e,"cellKeyDown",t.onCellKeyDown),ii(e,"preferencePanelClose",t.onPreferencePanelClose),ii(e,"preferencePanelOpen",t.onPreferencePanelOpen),ii(e,"menuOpen",t.onMenuOpen),ii(e,"menuClose",t.onMenuClose),ii(e,"rowDoubleClick",t.onRowDoubleClick),ii(e,"rowClick",t.onRowClick),ii(e,"stateChange",t.onStateChange)}function WUt(e,t=166){let n,r;const i=()=>{n=void 0,e(...r)};function o(...s){r=s,n===void 0&&(n=setTimeout(i,t))}return o.clear=()=>{clearTimeout(n),n=void 0},o}const fne={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:" ",columnBufferPx:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:eg.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,indeterminateCheckboxAction:"deselect",keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resetPageOnSortFilter:!1,resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rowPositionsDebounceMs:166,rows:[],rowSelection:!0,rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,unstable_rowSpanning:!1,virtualizeColumnsWithAutoRowHeight:!1},EC={width:0,height:0},HUt={isReady:!1,root:EC,viewportOuterSize:EC,viewportInnerSize:EC,contentSize:EC,minimumSize:EC,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0},GUt=(e,t,n)=>{const r=HUt,i=LT(n);return X({},e,{dimensions:X({},r,k8e(t,n,i,NT(n)))})},P8e=xn(Mo,Pb,(e,t)=>{const n=e.length;return n===0?0:jC(t[n-1]+e[n-1].computedWidth,1)});function qUt(e,t){const n=Ns(e,"useResizeContainer"),r=M.useRef(!1),i=M.useRef(EC),o=ut(e,NT),s=ut(e,LT),a=ut(e,P8e),l=M.useRef(!0),{rowHeight:c,headerHeight:u,groupHeaderHeight:f,headerFilterHeight:d,headersTotalHeight:h,leftPinnedWidth:p,rightPinnedWidth:g}=k8e(t,e,s,o),m=M.useRef(void 0),v=M.useCallback(()=>Is(e.current.state),[e]),y=M.useCallback(I=>{e.current.setState(F=>X({},F,{dimensions:I})),e.current.rootElementRef.current&&d_e(e.current.rootElementRef.current,Is(e.current.state))},[e]),b=M.useCallback(()=>{const I=e.current.mainElementRef.current;if(!I)return;const F=$c(I).getComputedStyle(I),A={width:parseFloat(F.width)||0,height:parseFloat(F.height)||0};(!m.current||!p_e(m.current,A))&&(e.current.publishEvent("resize",A),m.current=A)},[e]),w=M.useCallback(()=>{const I=Is(e.current.state);if(!I.isReady)return 0;const F=I0(e);if(t.getRowHeight){const L=LD(e),$=L.lastRowIndex-L.firstRowIndex;return Math.min($-1,F.rows.length)}const A=Math.floor(I.viewportInnerSize.height/c);return Math.min(A,F.rows.length)},[e,t.getRowHeight,c]),S=M.useCallback(()=>{if(l.current)return;const I=XUt(e.current.mainElementRef.current,t.scrollbarSize),F=UT(e.current.state),A=h+F.pinnedTopRowsTotalHeight,L=F.pinnedBottomRowsTotalHeight,j={width:a-p-g,height:jC(F.currentPageTotalHeight,1)};let V,U,z=!1,N=!1;if(t.autoHeight)N=!1,z=Math.round(a)>Math.round(i.current.width),V={width:i.current.width,height:A+L+j.height},U={width:Math.max(0,V.width-(N?I:0)),height:Math.max(0,V.height-(z?I:0))};else{V={width:i.current.width,height:i.current.height},U={width:Math.max(0,V.width-p-g),height:Math.max(0,V.height-A-L)};const Z=j,pe=U,ie=Z.width>pe.width,ne=Z.height>pe.height;(ie||ne)&&(N=ne,z=Z.width+(N?I:0)>pe.width,z&&(N=Z.height+I>pe.height)),N&&(U.width-=I),z&&(U.height-=I)}const B=Math.max(V.width,a+(N?I:0)),H={width:a,height:A+j.height+L},Q={isReady:!0,root:i.current,viewportOuterSize:V,viewportInnerSize:U,contentSize:j,minimumSize:H,hasScrollX:z,hasScrollY:N,scrollbarSize:I,headerHeight:u,groupHeaderHeight:f,headerFilterHeight:d,rowWidth:B,rowHeight:c,columnsTotalWidth:a,leftPinnedWidth:p,rightPinnedWidth:g,headersTotalHeight:h,topContainerHeight:A,bottomContainerHeight:L},Y=e.current.state.dimensions;A0(Y,Q)||(y(Q),p_e(Q.viewportInnerSize,Y.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",Q.viewportInnerSize),e.current.updateRenderContext?.())},[e,y,t.scrollbarSize,t.autoHeight,c,u,f,d,a,h,p,g]),_=ft(S),E=M.useMemo(()=>t.resizeThrottleMs>0?WUt(()=>{_(),e.current.publishEvent("debouncedResize",i.current)},t.resizeThrottleMs):void 0,[e,t.resizeThrottleMs,_]);M.useEffect(()=>E?.clear,[E]);const T={resize:b,getRootDimensions:v},k={updateDimensions:S,getViewportPageSize:w};ar(S,[S]),qn(e,T,"public"),qn(e,k,"private");const P=M.useCallback(I=>{d_e(I,Is(e.current.state))},[e]),R=M.useCallback(I=>{if(i.current=I,I.height===0&&!r.current&&!t.autoHeight&&!bj&&(n.error(["The parent DOM element of the Data Grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` -`)),r.current=!0),I.width===0&&!r.current&&!bj&&(n.error(["The parent DOM element of the Data Grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` -`)),r.current=!0),l.current||!E){l.current=!1,S();return}E()},[S,t.autoHeight,E,n]);ii(e,"rootMount",P),ii(e,"resize",R),ii(e,"debouncedResize",t.onResize)}function d_e(e,t){const n=(r,i)=>e.style.setProperty(r,i);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}function k8e(e,t,n,r){const i=MVe(e.rowHeight,fne.rowHeight);return{rowHeight:Math.floor(i*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:P8e(t),headersTotalHeight:NU(t,e),leftPinnedWidth:r.left.reduce((o,s)=>o+s.computedWidth,0),rightPinnedWidth:r.right.reduce((o,s)=>o+s.computedWidth,0)}}const h_e=new WeakMap;function XUt(e,t){if(t!==void 0)return t;if(e===null)return 0;const n=h_e.get(e);if(n!==void 0)return n;const i=ci(e).createElement("div");i.style.width="99px",i.style.height="99px",i.style.position="absolute",i.style.overflow="scroll",i.className="scrollDiv",e.appendChild(i);const o=i.offsetWidth-i.clientWidth;return e.removeChild(i),h_e.set(e,o),o}function p_e(e,t){return e.width===t.width&&e.height===t.height}const YUt=typeof globalThis.ResizeObserver<"u"?globalThis.ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},QUt=(e,t,n)=>{n.current.caches.rowsMeta={heights:new Map};const r=Ace(n.current.state),i=kD(n),o=AD(n.current.state),s=Math.min(o.enabled?o.paginationModel.pageSize:i,i);return X({},e,{rowsMeta:{currentPageTotalHeight:s*r,positions:Array.from({length:s},(a,l)=>l*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},KUt=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:i}=t,o=e.current.caches.rowsMeta.heights,s=M.useRef(-1),a=M.useRef(!1),l=M.useRef(!1),c=ut(e,LT),u=Wce(e),f=ut(e,FT),d=ut(e,Ace),h=P=>{let R=o.get(P);return R===void 0&&(R={content:d,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},o.set(P,R)),R},p=M.useCallback(P=>{const R=Is(e.current.state).rowHeight,I=e.current.getRowHeightEntry(P.id);if(!n)I.content=R,I.needsFirstMeasurement=!1;else{const F=n(X({},P,{densityFactor:c}));if(F==="auto"){if(I.needsFirstMeasurement){const A=i?i(X({},P,{densityFactor:c})):R;I.content=A??R}a.current=!0,I.autoHeight=!0}else I.content=MVe(F,R),I.needsFirstMeasurement=!1,I.autoHeight=!1}if(r){const F=e.current.getRowIndexRelativeToVisibleRows(P.id),A=r(X({},P,{isFirstVisible:F===0,isLastVisible:F===u.rows.length-1,indexRelativeToCurrentPage:F}));I.spacingTop=A.top??0,I.spacingBottom=A.bottom??0}else I.spacingTop=0,I.spacingBottom=0;return e.current.unstable_applyPipeProcessors("rowHeight",I,P),I},[e,u.rows,n,i,d,r,c]),g=M.useCallback(()=>{a.current=!1;const P=f.top.reduce(($,j)=>{const V=p(j);return $+V.content+V.spacingTop+V.spacingBottom+V.detail},0),R=f.bottom.reduce(($,j)=>{const V=p(j);return $+V.content+V.spacingTop+V.spacingBottom+V.detail},0),I=[],F=u.rows.reduce(($,j)=>{I.push($);const V=p(j),U=V.content+V.spacingTop+V.spacingBottom+V.detail;return $+U},0);a.current||(s.current=1/0);const A=P!==e.current.state.rowsMeta.pinnedTopRowsTotalHeight||R!==e.current.state.rowsMeta.pinnedBottomRowsTotalHeight||F!==e.current.state.rowsMeta.currentPageTotalHeight,L={currentPageTotalHeight:F,positions:I,pinnedTopRowsTotalHeight:P,pinnedBottomRowsTotalHeight:R};e.current.setState($=>X({},$,{rowsMeta:L})),A&&e.current.updateDimensions(),l.current=!0},[e,f,u.rows,p]),m=P=>o.get(P)?.content??d,v=(P,R)=>{const I=e.current.getRowHeightEntry(P),F=I.content!==R;I.needsFirstMeasurement=!1,I.content=R,l.current&&=!F},y=P=>o.get(P)?.autoHeight??!1,b=()=>s.current,w=P=>{a.current&&P>s.current&&(s.current=P)},S=()=>{o.clear(),g()},_=ad(()=>new YUt(P=>{for(let R=0;R0?I.borderBoxSize[0].blockSize:I.contentRect.height,A=I.target.__mui_id;if(o8e(e)?.id===A&&F===0)return;e.current.unstable_storeRowHeightMeasurement(A,F)}l.current||requestAnimationFrame(()=>{e.current.requestPipeProcessorsApplication("rowHeight")})})).current,E=(P,R)=>(P.__mui_id=R,_.observe(P),()=>_.unobserve(P));Zce(e,"rowHeight",g),ar(()=>{g()},[g]);const T={unstable_getRowHeight:m,unstable_setLastMeasuredRowIndex:w,unstable_storeRowHeightMeasurement:v,resetRowHeights:S},k={hydrateRowsMeta:g,observeRowHeight:E,rowHasAutoHeight:y,getRowHeightEntry:h,getLastMeasuredRowIndex:b};qn(e,T,"public"),qn(e,k,"private")},ZUt=e=>{const t=M.useCallback((i={})=>e.current.unstable_applyPipeProcessors("exportState",{},i),[e]),n=M.useCallback(i=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:i}).callbacks.forEach(s=>{s()}),e.current.forceUpdate()},[e]);qn(e,{exportState:t,restoreState:n},"public")},JUt=e=>{const t=M.useRef({}),n=(a,l)=>t.current[a]?.[l],r=()=>{t.current={}},i=M.useCallback(({rowId:a,minFirstColumn:l,maxLastColumn:c,columns:u})=>{for(let f=l;f1&&(f+=d.colSpan-1)}},[e]),o={unstable_getCellColSpanInfo:n},s={resetColSpan:r,calculateColSpan:i};qn(e,o,"public"),qn(e,s,"private"),Ft(e,"columnOrderChange",r)};function eVt(e){const{apiRef:t,lookup:n,columnIndex:r,rowId:i,minFirstColumnIndex:o,maxLastColumnIndex:s,columns:a}=e,l=a.length,c=a[r],u=t.current.getRow(i),f=t.current.getRowValue(u,c),d=typeof c.colSpan=="function"?c.colSpan(f,u,c,t):c.colSpan;if(!d||d===1)return l7(n,i,r,{spannedByColSpan:!1,cellProps:{colSpan:1,width:c.computedWidth}}),{colSpan:1};let h=c.computedWidth;for(let p=1;p=o&&g{if(yVe(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(` -`));n[e.field]=t;return}const{groupId:r,children:i}=e;i.forEach(o=>{M8e(o,[...t,r],n)})},dne=e=>{if(!e)return{};const t={};return e.forEach(n=>{M8e(n,[],t)}),t},hne=(e,t,n)=>{const r=l=>t[l]??[],i=[],o=Math.max(...e.map(l=>r(l).length)),s=(l,c,u)=>A0(r(l).slice(0,u+1),r(c).slice(0,u+1)),a=(l,c)=>!!(n?.left&&n.left.includes(l)&&!n.left.includes(c)||n?.right&&!n.right.includes(l)&&n.right.includes(c));for(let l=0;l{const d=r(f)[l]??null;if(u.length===0)return[{columnFields:[f],groupId:d}];const h=u[u.length-1],p=h.columnFields[h.columnFields.length-1];return h.groupId!==d||!s(p,f,l)||a(p,f)?[...u,{columnFields:[f],groupId:d}]:[...u.slice(0,u.length-1),{columnFields:[...h.columnFields,f],groupId:d}]},[]);i.push(c)}return i},tVt=["groupId","children"],Jce=e=>{let t={};return e.forEach(n=>{if(yVe(n))return;const{groupId:r,children:i}=n,o=it(n,tVt);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const s=X({},o,{groupId:r}),a=Jce(i);if(a[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=X({},t,a,{[r]:s})}),X({},t)},nVt=(e,t,n)=>{if(!t.columnGroupingModel)return e;const r=Gm(n),i=$T(n),o=Jce(t.columnGroupingModel??[]),s=dne(t.columnGroupingModel??[]),a=hne(r,s,n.current.state.pinnedColumns??{}),l=i.length===0?0:Math.max(...i.map(c=>s[c]?.length??0));return X({},e,{columnGrouping:{lookup:o,unwrappedGroupingModel:s,headerStructure:a,maxDepth:l}})},rVt=(e,t)=>{const n=M.useCallback(a=>KVe(e)[a]??[],[e]),r=M.useCallback(()=>ZVe(e),[e]);qn(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const o=M.useCallback(()=>{const a=dne(t.columnGroupingModel??[]);e.current.setState(l=>{const c=l.columns?.orderedFields??[],u=l.pinnedColumns??{},f=hne(c,a,u);return X({},l,{columnGrouping:X({},l.columnGrouping,{headerStructure:f})})})},[e,t.columnGroupingModel]),s=M.useCallback(a=>{const l=e.current.getPinnedColumns?.()??{},c=Gm(e),u=$T(e),f=Jce(a??[]),d=dne(a??[]),h=hne(c,d,l),p=u.length===0?0:Math.max(...u.map(g=>d[g]?.length??0));e.current.setState(g=>X({},g,{columnGrouping:{lookup:f,unwrappedGroupingModel:d,headerStructure:h,maxDepth:p}}))},[e]);Ft(e,"columnIndexChange",o),Ft(e,"columnsChange",()=>{s(t.columnGroupingModel)}),Ft(e,"columnVisibilityModelChange",()=>{s(t.columnGroupingModel)}),M.useEffect(()=>{s(t.columnGroupingModel)},[s,t.columnGroupingModel])};function iVt(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function g_e(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;nr8e(e),r=ut(e,n);return M.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=iVt()}return t.current}}function cVt(e,t){if(e.length<4)return e;const n=e.slice();n.sort((a,l)=>a-l);const r=n[Math.floor(n.length*.25)],i=n[Math.floor(n.length*.75)-1],o=i-r,s=o<5?5:o*t;return n.filter(a=>a>r-s&&a{const a=tBt(e.current,o.field).map(p=>p.getBoundingClientRect().width??0),l=t.includeOutliers?a:cVt(a,t.outliersFactor);if(t.includeHeaders){const p=eBt(e.current,o.field);if(p){const g=p.querySelector(`.${ve.columnHeaderTitle}`),m=p.querySelector(`.${ve.columnHeaderTitleContainerContent}`),v=p.querySelector(`.${ve.iconButtonContainer}`),y=p.querySelector(`.${ve.menuIcon}`),b=g??m,w=window.getComputedStyle(p,null),S=parseInt(w.paddingLeft,10)+parseInt(w.paddingRight,10),E=b.scrollWidth+1+S+(v?.clientWidth??0)+(y?.clientWidth??0);l.push(E)}}const c=o.minWidth!==-1/0&&o.minWidth!==void 0,u=o.maxWidth!==1/0&&o.maxWidth!==void 0,f=c?o.minWidth:0,d=u?o.maxWidth:1/0,h=l.length===0?0:Math.max(...l);r[o.field]=Mu(h,f,d)}),i.classList.remove(ve.autosizing),r}const fVt=e=>X({},e,{columnResize:{resizingColumnField:""}});function dVt(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const hVt=(e,t)=>{const n=bi(),r=Ns(e,"useGridColumnResize"),i=ad(dVt).current,o=M.useRef(null),s=M.useRef(null),a=jl(),l=M.useRef(void 0),c=k=>{r.debug(`Updating width to ${k} for col ${i.colDef.field}`);const P=i.columnHeaderElement.offsetWidth,R=k-P,I=k-i.initialColWidth;if(I>0){const L=i.initialTotalWidth+I;e.current.rootElementRef?.current?.style.setProperty("--DataGrid-rowWidth",`${L}px`)}i.colDef.computedWidth=k,i.colDef.width=k,i.colDef.flex=0,i.columnHeaderElement.style.width=`${k}px`;const F=i.headerFilterElement;F&&(F.style.width=`${k}px`),i.groupHeaderElements.forEach(L=>{const $=L;let j;$.getAttribute("aria-colspan")==="1"?j=`${k}px`:j=`${$.offsetWidth+R}px`,$.style.width=j}),i.cellElements.forEach(L=>{const $=L;let j;$.getAttribute("aria-colspan")==="1"?j=`${k}px`:j=`${$.offsetWidth+R}px`,$.style.setProperty("--width",j)});const A=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);A===qy.LEFT&&(P_(i.fillerLeft,"width",R),i.leftPinnedCellsAfter.forEach(L=>{P_(L,"left",R)}),i.leftPinnedHeadersAfter.forEach(L=>{P_(L,"left",R)})),A===qy.RIGHT&&(P_(i.fillerRight,"width",R),i.rightPinnedCellsBefore.forEach(L=>{P_(L,"right",R)}),i.rightPinnedHeadersBefore.forEach(L=>{P_(L,"right",R)}))},u=k=>{if(v(),i.previousMouseClickEvent){const P=i.previousMouseClickEvent,R=P.timeStamp,I=P.clientX,F=P.clientY;if(k.timeStamp-R<300&&k.clientX===I&&k.clientY===F){i.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,k);return}}if(i.colDef){e.current.setColumnWidth(i.colDef.field,i.colDef.width),r.debug(`Updating col ${i.colDef.field} with new width: ${i.colDef.width}`);const P=Up(e.current.state);i.groupHeaderElements.forEach(R=>{const I=qjt(R),F=R,L=`${I.reduce(($,j)=>P.columnVisibilityModel[j]!==!1?$+P.lookup[j].computedWidth:$,0)}px`;F.style.width=L})}a.start(0,()=>{e.current.publishEvent("columnResizeStop",null,k)})},f=(k,P,R)=>{const I=e.current.rootElementRef.current;i.initialColWidth=k.computedWidth,i.initialTotalWidth=e.current.getRootDimensions().rowWidth,i.colDef=k,i.columnHeaderElement=Gjt(e.current.columnHeadersContainerRef.current,k.field);const F=I.querySelector(`.${ve.headerFilterRow} [data-field="${Mv(k.field)}"]`);F&&(i.headerFilterElement=F),i.groupHeaderElements=Xjt(e.current.columnHeadersContainerRef?.current,k.field),i.cellElements=Yjt(i.columnHeaderElement,e.current),i.fillerLeft=HSe(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),i.fillerRight=HSe(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const A=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);i.leftPinnedCellsAfter=A!==qy.LEFT?[]:Qjt(e.current,i.columnHeaderElement,n),i.rightPinnedCellsBefore=A!==qy.RIGHT?[]:Kjt(e.current,i.columnHeaderElement,n),i.leftPinnedHeadersAfter=A!==qy.LEFT?[]:Zjt(e.current,i.columnHeaderElement,n),i.rightPinnedHeadersBefore=A!==qy.RIGHT?[]:Jjt(e.current,i.columnHeaderElement,n),s.current=aVt(P,n),o.current=oVt(R,i.columnHeaderElement.getBoundingClientRect(),s.current)},d=ft(u),h=ft(k=>{if(k.buttons===0){d(k);return}let P=m_e(o.current,k.clientX,i.columnHeaderElement.getBoundingClientRect(),s.current);P=Mu(P,i.colDef.minWidth,i.colDef.maxWidth),c(P);const R={element:i.columnHeaderElement,colDef:i.colDef,width:P};e.current.publishEvent("columnResize",R,k)}),p=ft(k=>{g_e(k,l.current)&&u(k)}),g=ft(k=>{const P=g_e(k,l.current);if(!P)return;if(k.type==="mousemove"&&k.buttons===0){p(k);return}let R=m_e(o.current,P.x,i.columnHeaderElement.getBoundingClientRect(),s.current);R=Mu(R,i.colDef.minWidth,i.colDef.maxWidth),c(R);const I={element:i.columnHeaderElement,colDef:i.colDef,width:R};e.current.publishEvent("columnResize",I,k)}),m=ft(k=>{const P=xj(k.target,ve["columnSeparator--resizable"]);if(!P)return;const R=k.changedTouches[0];R!=null&&(l.current=R.identifier);const I=xj(k.target,ve.columnHeader),F=Hjt(I),A=e.current.getColumn(F);r.debug(`Start Resize on col ${A.field}`),e.current.publishEvent("columnResizeStart",{field:F},k),f(A,P,R.clientX);const L=ci(k.currentTarget);L.addEventListener("touchmove",g),L.addEventListener("touchend",p)}),v=M.useCallback(()=>{const k=ci(e.current.rootElementRef.current);k.body.style.removeProperty("cursor"),k.removeEventListener("mousemove",h),k.removeEventListener("mouseup",d),k.removeEventListener("touchmove",g),k.removeEventListener("touchend",p),setTimeout(()=>{k.removeEventListener("click",v_e,!0)},100),i.columnHeaderElement&&(i.columnHeaderElement.style.pointerEvents="unset")},[e,i,h,d,g,p]),y=M.useCallback(({field:k})=>{e.current.setState(P=>X({},P,{columnResize:X({},P.columnResize,{resizingColumnField:k})})),e.current.forceUpdate()},[e]),b=M.useCallback(()=>{e.current.setState(k=>X({},k,{columnResize:X({},k.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),w=ft(({colDef:k},P)=>{if(P.button!==0||!P.currentTarget.classList.contains(ve["columnSeparator--resizable"]))return;P.preventDefault(),r.debug(`Start Resize on col ${k.field}`),e.current.publishEvent("columnResizeStart",{field:k.field},P),f(k,P.currentTarget,P.clientX);const R=ci(e.current.rootElementRef.current);R.body.style.cursor="col-resize",i.previousMouseClickEvent=P.nativeEvent,R.addEventListener("mousemove",h),R.addEventListener("mouseup",d),R.addEventListener("click",v_e,!0)}),S=ft((k,P)=>{if(t.disableAutosize||P.button!==0)return;const R=e.current.state.columns.lookup[k.field];R.resizable!==!1&&e.current.autosizeColumns(X({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[R.field]}))}),_=lVt(e),E=M.useRef(!1),T=M.useCallback(async k=>{if(!e.current.rootElementRef?.current||E.current)return;E.current=!0;const R=Up(e.current.state),I=X({},z5t,k,{columns:k?.columns??R.orderedFields});I.columns=I.columns.filter(A=>R.columnVisibilityModel[A]!==!1);const F=I.columns.map(A=>e.current.state.columns.lookup[A]);try{!t.disableVirtualization&&I.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await _());const A=uVt(e,I,F),L=F.map($=>X({},$,{width:A[$.field],computedWidth:A[$.field],flex:0}));if(I.expand){const j=R.orderedFields.map(N=>R.lookup[N]).filter(N=>R.columnVisibilityModel[N.field]!==!1).reduce((N,B)=>N+(A[B.field]??B.computedWidth??B.width),0),z=e.current.getRootDimensions().viewportInnerSize.width-j;if(z>0){const N=z/(L.length||1);L.forEach(B=>{B.width+=N,B.computedWidth+=N})}}e.current.updateColumns(L),L.forEach(($,j)=>{if($.width!==F[j].width){const V=$.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement($.field),colDef:$,width:V})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),E.current=!1}},[e,_,t.disableVirtualization]);M.useEffect(()=>v,[v]),Uae(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),jVe(e,()=>e.current.columnHeadersContainerRef?.current,"touchstart",m,{passive:!0}),qn(e,{autosizeColumns:T},"public"),Ft(e,"columnResizeStop",b),Ft(e,"columnResizeStart",y),Ft(e,"columnSeparatorMouseDown",w),Ft(e,"columnSeparatorDoubleClick",S),ii(e,"columnResize",t.onColumnResize),ii(e,"columnWidthChange",t.onColumnWidthChange)};function P_(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function pVt(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex{if(!e)return null;let r=e[t.field];const i=t.rowSpanValueGetter??t.valueGetter;return i&&(r=i(r,e,t,n)),r},BC={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},Oj={firstRowIndex:0,lastRowIndex:0},gVt=new Set([df,"__reorder__",IU]),b_e=20,A8e=(e,t,n,r,i,o,s)=>{const a=o?{}:X({},e.current.state.rowSpanning.spannedCells),l=o?{}:X({},e.current.state.rowSpanning.hiddenCells),c=o?{}:X({},e.current.state.rowSpanning.hiddenCellOriginMap);return o&&(s=Oj),t.forEach(u=>{if(!gVt.has(u.field)){for(let f=i.firstRowIndex;f=r.firstRowIndex&&w&&c7(w.model,u,e)===h;){const S=n[b+1];l[S.id]?l[S.id][u.field]=!0:l[S.id]={[u.field]:!0},v.push(f),m+=1,p=w.id,g=b,b-=1,w=n[b]}}v.forEach(b=>{c[b]?c[b][u.field]=g:c[b]={[u.field]:g}});let y=f+1;for(;y<=r.lastRowIndex&&n[y]&&c7(n[y].model,u,e)===h;){const b=n[y];l[b.id]?l[b.id][u.field]=!0:l[b.id]={[u.field]:!0},c[y]?c[y][u.field]=g:c[y]={[u.field]:g},y+=1,m+=1}m>0&&(a[p]?a[p][u.field]=m+1:a[p]={[u.field]:m+1})}s={firstRowIndex:Math.min(s.firstRowIndex,i.firstRowIndex),lastRowIndex:Math.max(s.lastRowIndex,i.lastRowIndex)}}}),{spannedCells:a,hiddenCells:l,hiddenCellOriginMap:c,processedRange:s}},R8e=(e,t)=>{const n=eM(t).length;if(e.pagination){const r=HVe(t);let i=b_e;return r>0&&(i=r-1),{firstRowIndex:0,lastRowIndex:Math.min(i,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(b_e,n)}},mVt=(e,t,n)=>{if(!t.unstable_rowSpanning)return X({},e,{rowSpanning:BC});const r=e.rows.dataRowIds||[],i=e.columns.orderedFields||[],o=e.rows.dataRowIdToModelLookup,s=e.columns.lookup,a=!!e.filter.filterModel.items.length||!!e.filter.filterModel.quickFilterValues?.length;if(!r.length||!i.length||!o||!s||a)return X({},e,{rowSpanning:BC});const l=R8e(t,n),c=r.map(p=>({id:p,model:o[p]})),u=i.map(p=>s[p]),{spannedCells:f,hiddenCells:d,hiddenCellOriginMap:h}=A8e(n,u,c,l,l,!0,Oj);return X({},e,{rowSpanning:{spannedCells:f,hiddenCells:d,hiddenCellOriginMap:h}})},vVt=(e,t)=>{const n=ad(()=>e.current.state.rowSpanning!==BC?R8e(t,e):Oj),r=M.useCallback((o,s=!1)=>{const{range:a,rows:l}=I0(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(a===null||!y_e(o))return;s&&(n.current=Oj);const c=pVt({firstRowIndex:o.firstRowIndex,lastRowIndex:Math.min(o.lastRowIndex,a.lastRowIndex+1)},n.current);if(c===null)return;const u=Mo(e),{spannedCells:f,hiddenCells:d,hiddenCellOriginMap:h,processedRange:p}=A8e(e,u,l,a,c,s,n.current);n.current=p;const g=Object.keys(f).length,m=Object.keys(d).length,v=Object.keys(e.current.state.rowSpanning.spannedCells).length,y=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(s||g!==v||m!==y)||g===0&&v===0||e.current.setState(S=>X({},S,{rowSpanning:{spannedCells:f,hiddenCells:d,hiddenCellOriginMap:h}}))},[e,n,t.pagination,t.paginationMode]),i=M.useCallback(()=>{const o=LD(e);y_e(o)&&r(o,!0)},[e,r]);Ft(e,"renderedRowsIntervalChange",e1(t.unstable_rowSpanning,r)),Ft(e,"sortedRowsSet",e1(t.unstable_rowSpanning,i)),Ft(e,"paginationModelChange",e1(t.unstable_rowSpanning,i)),Ft(e,"filteredRowsSet",e1(t.unstable_rowSpanning,i)),Ft(e,"columnsChange",e1(t.unstable_rowSpanning,i)),M.useEffect(()=>{t.unstable_rowSpanning?e.current.state.rowSpanning===BC&&i():e.current.state.rowSpanning!==BC&&e.current.setState(o=>X({},o,{rowSpanning:BC}))},[e,i,t.unstable_rowSpanning])},yVt=(e,t,n)=>X({},e,{listViewColumn:t.unstable_listColumn?X({},t.unstable_listColumn,{computedWidth:pne(n)}):void 0});function bVt(e,t){const n=()=>{e.current.setState(o=>o.listViewColumn?X({},o,{listViewColumn:X({},o.listViewColumn,{computedWidth:pne(e)})}):o)},r=M.useRef(null);Ft(e,"viewportInnerSizeChange",o=>{r.current!==o.width&&(r.current=o.width,n())}),Ft(e,"columnVisibilityModelChange",n),ar(()=>{const o=t.unstable_listColumn;o&&e.current.setState(s=>X({},s,{listViewColumn:X({},o,{computedWidth:pne(e)})}))},[e,t.unstable_listColumn]),M.useEffect(()=>{t.unstable_listView&&t.unstable_listColumn},[t.unstable_listView,t.unstable_listColumn])}function pne(e){return Is(e.current.state).viewportInnerSize.width}const xVt=(e,t)=>{const n=U6t(e,t);return zUt(n,t),DUt(n),_s(j6t,n,t),_s(FUt,n,t),_s(Q6t,n,t),_s(kUt,n,t),_s(vUt,n,t),_s(TUt,n,t),_s(uUt,n,t),_s(jUt,n,t),_s(bUt,n,t),_s(sUt,n,t),_s(mVt,n,t),_s(Z6t,n,t),_s(fVt,n,t),_s(X6t,n,t),_s(nVt,n,t),_s(Kzt,n,t),_s(GUt,n,t),_s(QUt,n,t),_s(yVt,n,t),pUt(n,t),$Ut(n,t),K6t(n,t),MUt(n,t),vVt(n,t),LUt(n,t),JUt(n),rVt(n,t),PUt(n,t),fUt(n,t),xUt(n,t),cUt(n,t),BUt(n,t),J6t(n,t),hVt(n,t),yUt(n,t),KUt(n,t),UUt(n,t),Y6t(n),tUt(n,t),oUt(n,t),q6t(n,t),qUt(n,t),VUt(n,t),ZUt(n),Zzt(n,t),bVt(n,t),n},wVt=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:i,showLeftBorder:o,showRightBorder:s,groupId:a,pinnedPosition:l}=e,c={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",s&&"columnHeader--withRightBorder",o&&"columnHeader--withLeftBorder","withBorderColor",a===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",l===or.LEFT&&"columnHeader--pinnedLeft",l===or.RIGHT&&"columnHeader--pinnedRight",i&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Xe(c,hr,t)};function SVt(e){const{groupId:t,width:n,depth:r,maxDepth:i,fields:o,height:s,colIndex:a,hasFocus:l,tabIndex:c,isLastColumn:u,pinnedPosition:f,pinnedOffset:d}=e,h=tn(),p=bi(),g=M.useRef(null),m=Kn(),v=ut(m,ZVe),y=t?v[t]:{},{headerName:b=t??"",description:w="",headerAlign:S=void 0}=y;let _;const E=t&&v[t]?.renderHeaderGroup,T=M.useMemo(()=>({groupId:t,headerName:b,description:w,depth:r,maxDepth:i,fields:o,colIndex:a,isLastColumn:u}),[t,b,w,r,i,o,a,u]);t&&E&&(_=E(T));const k=X({},e,{classes:h.classes,headerAlign:S,depth:r,isDragging:!1}),P=b??t,R=ur(),I=t===null?`empty-group-cell-${R}`:t,F=wVt(k);M.useLayoutEffect(()=>{if(l){const U=g.current.querySelector('[tabindex="0"]')||g.current;if(!U)return;if(qce())U.focus({preventScroll:!0});else{const z=m.current.getScrollPosition();U.focus(),m.current.scroll(z)}}},[m,l]);const A=M.useCallback(V=>U=>{FD(U)||m.current.publishEvent(V,T,U)},[m,T]),L=M.useMemo(()=>({onKeyDown:A("columnGroupHeaderKeyDown"),onFocus:A("columnGroupHeaderFocus"),onBlur:A("columnGroupHeaderBlur")}),[A]),$=typeof y.headerClassName=="function"?y.headerClassName(T):y.headerClassName,j=M.useMemo(()=>jU(X({},e.style),p,f,d),[f,d,e.style,p]);return O.jsx(v8e,X({ref:g,classes:F,columnMenuOpen:!1,colIndex:a,height:s,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:c,isDraggable:!1,headerComponent:_,headerClassName:$,description:w,elementId:I,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:P,"aria-colspan":o.length,"data-fields":`|-${o.join("-|-")}-|`,style:j},L))}const x_e=Oe("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),_Vt=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:o,columnHeaderFocus:s,columnGroupHeaderFocus:a,headerGroupingMaxDepth:l,columnMenuState:c,columnVisibility:u,columnGroupsHeaderStructure:f,hasOtherElementInTabSequence:d}=e,[h,p]=M.useState(""),[g,m]=M.useState(""),v=ud(),y=tn(),b=ut(v,KVe),w=ut(v,Pb),S=ut(v,Qzt),_=ut(v,NT),E=ut(v,kv),T=s8e(w,S,_.left.length),k=ut(v,MU),P=ut(v,uVe),R=ut(v,oNt),I=ut(v,sNt),F=ut(v,fVe),A=M.useCallback(Z=>m(Z.field),[]),L=M.useCallback(()=>m(""),[]),$=M.useCallback(Z=>p(Z.field),[]),j=M.useCallback(()=>p(""),[]),V=M.useMemo(()=>_.left.length?{firstColumnIndex:0,lastColumnIndex:_.left.length}:null,[_.left.length]),U=M.useMemo(()=>_.right.length?{firstColumnIndex:t.length-_.right.length,lastColumnIndex:t.length}:null,[_.right.length,t.length]);Ft(v,"columnResizeStart",A),Ft(v,"columnResizeStop",L),Ft(v,"columnHeaderDragStart",$),Ft(v,"columnHeaderDragEnd",j);const z=Z=>{const{renderContext:pe=S}=Z||{},ie=pe.firstColumnIndex,ne=pe.lastColumnIndex;return{renderedColumns:t.slice(ie,ne),firstColumnToRender:ie,lastColumnToRender:ne}},N=(Z,pe,ie,ne=!1)=>{const fe=Z?.position===or.RIGHT,me=Z?.position===void 0,se=_.right.length>0&&fe||_.right.length===0&&me,ue=T-ie;return O.jsxs(M.Fragment,{children:[me&&O.jsx("div",{role:"presentation",style:{width:ue}}),pe,me&&O.jsx("div",{role:"presentation",className:Re(ve.filler,ne&&ve["filler--borderBottom"])}),se&&O.jsx(Qce,{header:!0,pinnedRight:fe,borderBottom:ne,borderTop:!1})]})},B=(Z,pe={})=>{const{renderedColumns:ie,firstColumnToRender:ne}=z(Z),fe=[];for(let me=0;meO.jsxs(x_e,{role:"row","aria-rowindex":l+1,ownerState:y,className:ve["row--borderBottom"],children:[V&&B({position:or.LEFT,renderContext:V},{disableReorder:!0}),B({renderContext:S}),U&&B({position:or.RIGHT,renderContext:U},{disableReorder:!0,separatorSide:Yce.Left})]}),Q=({depth:Z,params:pe})=>{const ie=z(pe);if(ie.renderedColumns.length===0)return null;const{firstColumnToRender:ne,lastColumnToRender:fe}=ie,me=f[Z],se=t[ne].field,ue=b[se]?.[Z]??null,G=me.findIndex(({groupId:Se,columnFields:ye})=>Se===ue&&ye.includes(se)),ce=t[fe-1].field,he=b[ce]?.[Z]??null,J=me.findIndex(({groupId:Se,columnFields:ye})=>Se===he&&ye.includes(ce)),te=me.slice(G,J+1).map(Se=>X({},Se,{columnFields:Se.columnFields.filter(ye=>u[ye]!==!1)})).filter(Se=>Se.columnFields.length>0),ae=te[0].columnFields.indexOf(se),Pe=te[0].columnFields.slice(0,ae).reduce((Se,ye)=>{const be=E[ye];return Se+(be.computedWidth??0)},0);let ee=ne;const oe=te.map(({groupId:Se,columnFields:ye},be)=>{const ge=a!==null&&a.depth===Z&&ye.includes(a.field),xe=o!==null&&o.depth===Z&&ye.includes(o.field)?0:-1,re={width:ye.reduce((De,ze)=>De+E[ze].computedWidth,0),fields:ye,colIndex:ee},Ee=pe.position,ke=YM(Ee,re.width,ee,w,k,F);ee+=ye.length;let je=be;return Ee===or.LEFT&&(je=ee-1),O.jsx(SVt,{groupId:Se,width:re.width,fields:re.fields,colIndex:re.colIndex,depth:Z,isLastColumn:be===te.length-1,maxDepth:l,height:I,hasFocus:ge,tabIndex:xe,pinnedPosition:Ee,pinnedOffset:ke,showLeftBorder:_j(Ee,je),showRightBorder:Sj(Ee,je,te.length,y.showColumnVerticalBorder,P)},be)});return N(pe,oe,Pe)};return{renderContext:S,leftRenderContext:V,rightRenderContext:U,pinnedColumns:_,visibleColumns:t,columnPositions:w,getFillers:N,getColumnHeadersRow:H,getColumnsToRender:z,getColumnGroupHeadersRows:()=>{if(l===0)return null;const Z=[];for(let pe=0;pe({role:"rowgroup"})}},CVt=["className"],OVt=e=>{const{classes:t}=e;return Xe({root:["columnHeaders"]},hr,t)},EVt=Qn("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),TVt=Er(function(t,n){const{className:r}=t,i=it(t,CVt),o=tn(),s=OVt(o);return O.jsx(EVt,X({className:Re(s.root,r),ownerState:o},i,{role:"presentation",ref:n}))}),PVt=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],kVt=Er(function(t,n){const{visibleColumns:r,sortColumnLookup:i,filterColumnLookup:o,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:d,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:p}=t,g=it(t,PVt),{getInnerProps:m,getColumnHeadersRow:v,getColumnGroupHeadersRows:y}=_Vt({visibleColumns:r,sortColumnLookup:i,filterColumnLookup:o,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:d,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:p});return O.jsxs(TVt,X({},g,m(),{ref:n,children:[y(),v()]}))}),MVt=Pv(kVt);function AVt(e){return null}function RVt(e){return null}const IVt=Er(function(t,n){const i=Kn().current.getLocaleText("noResultsOverlayLabel");return O.jsx(Xce,X({},t,{ref:n,children:i}))}),DVt=["sortingOrder"],LVt=M.memo(function(t){const{sortingOrder:n}=t,r=it(t,DVt),i=tn(),[o]=n,s=o==="asc"?i.slots.columnSortedAscendingIcon:i.slots.columnSortedDescendingIcon;return s?O.jsx(s,X({},r)):null}),FVt=["native"];function $Vt(e){let{native:t}=e,n=it(e,FVt);return t?O.jsx("option",X({},n)):O.jsx(tr,X({},n))}const NVt={booleanCellTrueIcon:$Bt,booleanCellFalseIcon:i7,columnMenuIcon:IBt,openFilterButtonIcon:EBt,filterPanelDeleteIcon:i7,columnFilteredIcon:QSe,columnSelectorIcon:PBt,columnUnsortedIcon:LVt,columnSortedAscendingIcon:GSe,columnSortedDescendingIcon:qSe,columnResizeIcon:kBt,densityCompactIcon:MBt,densityStandardIcon:ABt,densityComfortableIcon:RBt,exportIcon:FBt,moreActionsIcon:NBt,treeDataCollapseIcon:YSe,treeDataExpandIcon:XSe,groupingCriteriaCollapseIcon:YSe,groupingCriteriaExpandIcon:XSe,detailPanelExpandIcon:KSe,detailPanelCollapseIcon:DBt,rowReorderIcon:ZSe,quickFilterIcon:TBt,quickFilterClearIcon:i7,columnMenuHideIcon:zBt,columnMenuSortAscendingIcon:GSe,columnMenuSortDescendingIcon:qSe,columnMenuFilterIcon:QSe,columnMenuManageColumnsIcon:jBt,columnMenuClearIcon:BBt,loadIcon:LBt,filterPanelAddIcon:KSe,filterPanelRemoveAllIcon:UBt,columnReorderIcon:ZSe},zVt=X({},NVt,{baseBadge:Ebt,baseCheckbox:FA,baseDivider:oa,baseTextField:Ri,baseFormControl:ld,baseSelect:Th,baseButton:ji,baseIconButton:Mn,baseInputAdornment:ule,baseTooltip:_n,basePopper:Sb,baseInputLabel:_v,baseSelectOption:$Vt,baseChip:J6}),jVt=X({},zVt,{cell:ojt,skeletonCell:djt,columnHeaderFilterIconButton:CBt,columnHeaderSortIcon:SBt,columnMenu:o4t,columnHeaders:MVt,detailPanels:AVt,footer:t6t,footerRowCount:m6t,toolbar:null,pinnedRows:RVt,loadingOverlay:a6t,noResultsOverlay:IVt,noRowsOverlay:l6t,pagination:d6t,filterPanel:L4t,columnsPanel:u4t,columnsManagement:z4t,panel:g4t,row:S6t}),BVt={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",unstable_listView:!1},UVt=jVt,VVt=e=>{const t=is(),n=Z5t(M.useMemo(()=>jae({props:e,theme:t,name:"MuiDataGrid"}),[t,e])),r=M.useMemo(()=>X({},lNt,n.localeText),[n.localeText]),i=M.useMemo(()=>Q5t({defaultSlots:UVt,slots:n.slots}),[n.slots]),o=M.useMemo(()=>Object.keys(fne).reduce((s,a)=>(s[a]=n[a]??fne[a],s),{}),[n]);return M.useMemo(()=>X({},n,o,{localeText:r,slots:i},BVt),[n,r,i,o])},WVt={hooks:{useGridAriaAttributes:_6t,useGridRowAriaAttributes:C6t,useCellAggregationResult:()=>null}},I8e=Er(function(t,n){const r=VVt(t),i=xVt(r.apiRef,r);return O.jsx(O6t,{privateApiRef:i,configuration:WVt,props:r,children:O.jsx(Mjt,X({className:r.className,style:r.style,sx:r.sx},r.forwardedProps,r.slotProps?.root,{ref:n}))})}),HVt=M.memo(I8e);I8e.propTypes={apiRef:le.shape({current:le.object.isRequired}),"aria-label":le.string,"aria-labelledby":le.string,autoHeight:le.bool,autoPageSize:le.bool,autosizeOnMount:le.bool,autosizeOptions:le.shape({columns:le.arrayOf(le.string),disableColumnVirtualization:le.bool,expand:le.bool,includeHeaders:le.bool,includeOutliers:le.bool,outliersFactor:le.number}),cellModesModel:le.object,checkboxSelection:le.bool,classes:le.object,clipboardCopyCellDelimiter:le.string,columnBufferPx:le.number,columnGroupHeaderHeight:le.number,columnGroupingModel:le.arrayOf(le.object),columnHeaderHeight:le.number,columns:le.arrayOf(le.object).isRequired,columnVisibilityModel:le.object,density:le.oneOf(["comfortable","compact","standard"]),disableAutosize:le.bool,disableColumnFilter:le.bool,disableColumnMenu:le.bool,disableColumnResize:le.bool,disableColumnSelector:le.bool,disableColumnSorting:le.bool,disableDensitySelector:le.bool,disableEval:le.bool,disableMultipleRowSelection:le.bool,disableRowSelectionOnClick:le.bool,disableVirtualization:le.bool,editMode:le.oneOf(["cell","row"]),estimatedRowCount:le.number,experimentalFeatures:le.shape({warnIfFocusStateIsNotSynced:le.bool}),filterDebounceMs:le.number,filterMode:le.oneOf(["client","server"]),filterModel:le.shape({items:le.arrayOf(le.shape({field:le.string.isRequired,id:le.oneOfType([le.number,le.string]),operator:le.string.isRequired,value:le.any})).isRequired,logicOperator:le.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:le.bool,quickFilterLogicOperator:le.oneOf(["and","or"]),quickFilterValues:le.array}),forwardedProps:le.object,getCellClassName:le.func,getDetailPanelContent:le.func,getEstimatedRowHeight:le.func,getRowClassName:le.func,getRowHeight:le.func,getRowId:le.func,getRowSpacing:le.func,hideFooter:le.bool,hideFooterPagination:le.bool,hideFooterSelectedRowCount:le.bool,ignoreDiacritics:le.bool,ignoreValueFormatterDuringExport:le.oneOfType([le.shape({clipboardExport:le.bool,csvExport:le.bool}),le.bool]),indeterminateCheckboxAction:le.oneOf(["deselect","select"]),initialState:le.object,isCellEditable:le.func,isRowSelectable:le.func,keepNonExistentRowsSelected:le.bool,loading:le.bool,localeText:le.object,logger:le.shape({debug:le.func.isRequired,error:le.func.isRequired,info:le.func.isRequired,warn:le.func.isRequired}),logLevel:le.oneOf(["debug","error","info","warn",!1]),nonce:le.string,onCellClick:le.func,onCellDoubleClick:le.func,onCellEditStart:le.func,onCellEditStop:le.func,onCellKeyDown:le.func,onCellModesModelChange:le.func,onClipboardCopy:le.func,onColumnHeaderClick:le.func,onColumnHeaderContextMenu:le.func,onColumnHeaderDoubleClick:le.func,onColumnHeaderEnter:le.func,onColumnHeaderLeave:le.func,onColumnHeaderOut:le.func,onColumnHeaderOver:le.func,onColumnOrderChange:le.func,onColumnResize:le.func,onColumnVisibilityModelChange:le.func,onColumnWidthChange:le.func,onDensityChange:le.func,onFilterModelChange:le.func,onMenuClose:le.func,onMenuOpen:le.func,onPaginationMetaChange:le.func,onPaginationModelChange:le.func,onPreferencePanelClose:le.func,onPreferencePanelOpen:le.func,onProcessRowUpdateError:le.func,onResize:le.func,onRowClick:le.func,onRowCountChange:le.func,onRowDoubleClick:le.func,onRowEditStart:le.func,onRowEditStop:le.func,onRowModesModelChange:le.func,onRowSelectionModelChange:le.func,onSortModelChange:le.func,onStateChange:le.func,pageSizeOptions:le.arrayOf(le.oneOfType([le.number,le.shape({label:le.string.isRequired,value:le.number.isRequired})]).isRequired),pagination:le.oneOf([!0]),paginationMeta:le.shape({hasNextPage:le.bool}),paginationMode:le.oneOf(["client","server"]),paginationModel:le.shape({page:le.number.isRequired,pageSize:le.number.isRequired}),processRowUpdate:le.func,resetPageOnSortFilter:le.bool,resizeThrottleMs:le.number,rowBufferPx:le.number,rowCount:le.number,rowHeight:le.number,rowModesModel:le.object,rowPositionsDebounceMs:le.number,rows:le.arrayOf(le.object),rowSelection:le.bool,rowSelectionModel:le.oneOfType([le.arrayOf(le.oneOfType([le.number,le.string]).isRequired),le.number,le.string]),rowSpacingType:le.oneOf(["border","margin"]),scrollbarSize:le.number,showCellVerticalBorder:le.bool,showColumnVerticalBorder:le.bool,slotProps:le.object,slots:le.object,sortingMode:le.oneOf(["client","server"]),sortingOrder:le.arrayOf(le.oneOf(["asc","desc"])),sortModel:le.arrayOf(le.shape({field:le.string.isRequired,sort:le.oneOf(["asc","desc"])})),sx:le.oneOfType([le.arrayOf(le.oneOfType([le.func,le.object,le.bool])),le.func,le.object]),unstable_rowSpanning:le.bool,virtualizeColumnsWithAutoRowHeight:le.bool};const D8e=({id:e,style:t,color:n,component:r,children:i,onChange:o})=>O.jsx(bt,{id:e,style:t,color:n,component:r||"div",children:O.jsx(kU,{nodes:i,onChange:o})});function BU({title:e,children:t}){return e?O.jsx(_n,{title:e,children:t}):t}function GVt({type:e,id:t,name:n,style:r,variant:i,color:o,disabled:s,text:a,startIcon:l,endIcon:c,tooltip:u,onChange:f}){return O.jsx(BU,{title:u,children:O.jsx(ji,{id:t,name:n,style:r,variant:i,color:o,disabled:s,startIcon:l&&O.jsx(HO,{children:l}),endIcon:c&&O.jsx(HO,{children:c}),onClick:d=>{t&&f({componentType:e,id:t,property:"clicked",value:!0})},children:a})})}function qVt({type:e,id:t,name:n,value:r,disabled:i,style:o,tooltip:s,label:a,onChange:l}){return O.jsx(_n,{title:s,children:O.jsx(ld,{variant:"filled",size:"small",style:o,children:O.jsx(sh,{label:a,control:O.jsx(FA,{id:t,name:n,checked:!!r,disabled:i,onChange:c=>{if(t)return l({componentType:e,id:t,property:"value",value:c.currentTarget.checked})}})})})})}const XVt=({id:e,style:t,size:n,value:r,variant:i})=>O.jsx(Eh,{id:e,style:t,size:n,value:r,variant:i}),YVt=({id:e,style:t,orientation:n,variant:r,flexItem:i,textAlign:o,children:s,onChange:a})=>O.jsx(oa,{id:e,style:t,orientation:n,variant:r,flexItem:i,textAlign:o,children:s&&s.length&&O.jsx(kU,{nodes:s,onChange:a})});function QVt({type:e,id:t,name:n,style:r,tooltip:i,color:o,icon:s,size:a,disabled:l,onChange:c}){return O.jsx(BU,{title:i,children:O.jsx(Mn,{id:t,name:n,style:r,color:o,size:a,disabled:l,onClick:u=>{t&&c({componentType:e,id:t,property:"clicked",value:!0})},children:O.jsx(HO,{children:s})})})}const KVt=({id:e,style:t,value:n,variant:r})=>O.jsx(nBe,{id:e,style:t,value:n,variant:r});function ZVt({type:e,id:t,name:n,value:r,disabled:i,style:o,label:s,row:a,tooltip:l,dense:c,children:u,onChange:f}){return O.jsx(BU,{title:l,children:O.jsxs(ld,{disabled:i,children:[O.jsx(eBe,{children:s}),O.jsx(oU,{id:t,name:n,row:a,value:r,style:o,onChange:(d,h)=>{if(t)return f({componentType:e,id:t,property:"value",value:h})},children:u&&u.map(d=>O.jsx(sh,{value:d.value,label:d.label,disabled:d.disabled,control:O.jsx(uO,{id:d.id,size:c?"small":"medium"})}))})]})})}function JVt({type:e,id:t,name:n,value:r,options:i,disabled:o,style:s,tooltip:a,label:l,multiple:c=!1,onChange:u}){const f=d=>{if(t){let h=d.target.value;!c&&typeof r=="number"&&(h=Number.parseInt(h)),u({componentType:e,id:t,property:"value",value:h})}};return O.jsx(BU,{title:a,children:O.jsxs(ld,{variant:"filled",size:"small",style:s,children:[l&&O.jsx(_v,{id:`${t}-label`,children:l}),O.jsx(Th,{labelId:`${t}-label`,id:t,name:n,value:r,disabled:o,multiple:c,onChange:f,children:Array.isArray(i)&&i.map(e8t).map(([d,h],p)=>O.jsx(tr,{value:d,children:h},p))})]})})}function e8t(e){return TD(e)?[e,e]:typeof e=="number"?[e,e.toString()]:Array.isArray(e)?e:[e.value,e.label||`${e.value}`]}function t8t({type:e,id:t,name:n,value:r,disabled:i,style:o,label:s,onChange:a}){return O.jsx(ld,{variant:"filled",size:"small",style:o,children:O.jsx(sh,{label:s,control:O.jsx(gle,{id:t,name:n,checked:!!r,disabled:i,onChange:l=>{if(t)return a({componentType:e,id:t,property:"value",value:l.currentTarget.checked})}})})})}function n8t({type:e,id:t,value:n,children:r,disabled:i,style:o,onChange:s}){return O.jsxs(bt,{sx:{width:"100%"},children:[O.jsx(bt,{sx:{borderBottom:1,borderColor:"divider"},children:O.jsx(vle,{id:t,style:o,value:n,onChange:(a,l)=>{t&&s({componentType:e,id:t,property:"value",value:l})},children:r?.map((a,l)=>{const c=M0(a)?a:void 0;return O.jsx(zA,{label:c?c.label:TD(a)?a:"",icon:c&&c.icon&&O.jsx(HO,{children:c.icon}),disabled:i||c&&c.disabled},l)})})}),r?.map((a,l)=>{const c=M0(a)?a:void 0;return n===l&&O.jsx(D8e,{type:e,onChange:s,children:c?.children??void 0},l)})]})}const r8t=({id:e,style:t,align:n,gutterBottom:r,noWrap:i,variant:o,text:s,color:a,children:l,onChange:c})=>(l=s?[s]:l,O.jsx(yn,{id:e,style:t,align:n,gutterBottom:r,noWrap:i,variant:o,color:a,children:O.jsx(kU,{nodes:l,onChange:c})})),i8t=({type:e,id:t,style:n,defaultValue:r,ariaLabel:i,color:o,disableSwap:s,getAriaValueText:a,min:l,max:c,marks:u,orientation:f,step:d,size:h,track:p,value:g,valueLabelDisplay:m,onChange:v})=>O.jsx(oS,{id:t,defaultValue:r,"aria-label":i,color:o,style:n,disableSwap:s,getAriaValueText:a,min:l,max:c,marks:u,orientation:f,step:d,size:h,track:p,value:g??0,valueLabelDisplay:m,onChange:(y,b,w)=>{t&&v({componentType:e,id:t,property:"value",value:b})},"data-testid":"slider-test-id"}),o8t=({type:e,id:t,style:n,rows:r,columns:i,ariaLabel:o,autoPageSize:s,checkboxSelection:a,density:l,disableAutosize:c,disableColumnFilter:u,disableColumnMenu:f,disableColumnResize:d,disableColumnSelector:h,disableColumnSorting:p,disableDensitySelector:g,disableMultipleRowSelection:m,disableRowSelectionOnClick:v,editMode:y,hideFooter:b,hideFooterPagination:w,hideFooterSelectedRowCount:S,initialState:_,loading:E,rowHeight:T,rowSelection:k,paginationModel:P,pageSizeOptions:R,onChange:I})=>i?O.jsx("div",{id:t,children:O.jsx(HVt,{rows:r,columns:i,"aria-label":o,autoPageSize:s,checkboxSelection:a,density:l,disableAutosize:c,disableColumnFilter:u,disableColumnMenu:f,disableColumnResize:d,disableColumnSelector:h,disableColumnSorting:p,disableDensitySelector:g,disableMultipleRowSelection:m,disableRowSelectionOnClick:v,hideFooterSelectedRowCount:S,editMode:y,hideFooter:b,hideFooterPagination:w,initialState:_,loading:E,onRowSelectionModelChange:F=>{if(t){const A=F.map(L=>r?.find($=>$.id===L));I({componentType:e,id:t,property:"value",value:A})}},paginationModel:P,pageSizeOptions:R,rowHeight:T,rowSelection:k,sx:n,"data-testid":"data-grid-test-id"})}):void 0,s8t=({id:e,type:t,style:n,open:r,title:i,titleProps:o,content:s,contentProps:a,disableEscapeKeyDown:l,fullScreen:c,fullWidth:u,maxWidth:f,scroll:d,ariaLabel:h,ariaDescribedBy:p,children:g,onChange:m})=>r?O.jsxs(Gu,{id:e,style:n,open:r,onClose:(v,y)=>{e&&m({componentType:t,id:e,property:"open",value:!1})},disableEscapeKeyDown:l,fullScreen:c,fullWidth:u,maxWidth:f,scroll:d,"aria-label":h,"aria-describedby":p,children:[i&&O.jsx(gg,{...o,children:i}),s&&O.jsx(Nc,{...a,children:O.jsx(Jje,{children:s})}),g&&O.jsx(Cb,{children:O.jsx(kU,{nodes:g,onChange:m})})]}):void 0,a8t=({type:e,id:t,style:n,rows:r,columns:i,hover:o,stickyHeader:s,onChange:a})=>{if(!i||i.length===0)return O.jsx("div",{children:"No columns provided."});if(!r||r.length===0)return O.jsx("div",{children:"No rows provided."});const l=c=>{const u=c.reduce((f,d,h)=>{var p;const g=(p=i[h])==null?void 0:p.id;return g&&(f[g]=d),f},{});t&&a({componentType:e,id:t,property:"value",value:u})};return O.jsx(mle,{component:fa,sx:n,id:t,children:O.jsxs(sU,{stickyHeader:s,children:[O.jsx(pBe,{children:O.jsx(pf,{children:i.map(c=>O.jsx(mi,{align:c.align||"inherit",size:c.size||"medium",children:c.label},c.id))})}),O.jsx(lU,{children:r.map((c,u)=>O.jsx(pf,{hover:o,onClick:()=>l(c),children:c?.map((f,d)=>O.jsx(mi,{align:i[d].align||"inherit",size:i[d].size||"medium",children:f},d))},u))})]})})};function l8t(){return{components:[["Box",D8e],["Button",GVt],["Checkbox",qVt],["CircularProgress",XVt],["DataGrid",o8t],["Dialog",s8t],["Divider",YVt],["IconButton",QVt],["LinearProgress",KVt],["RadioGroup",ZVt],["Select",JVt],["Slider",i8t],["Switch",t8t],["Table",a8t],["Tabs",n8t],["Typography",r8t]]}}const w_e={};function gne(e,t){e===void 0&&(e=w_e),t===void 0&&(t=w_e);const n=Object.keys(e),r=Object.keys(t);return e===t||n.length===r.length&&n.every(i=>e[i]===t[i])}function Ej(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}var c8t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),u8t=Object.prototype.hasOwnProperty;function mne(e,t){return u8t.call(e,t)}function vne(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Hx(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function L8e(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function bne(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&l[u-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[h]===void 0?d=l.slice(0,u).join("/"):u==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),u++,Array.isArray(c)){if(h==="-")h=c.length;else{if(n&&!yne(h))throw new No("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);yne(h)&&(h=~~h)}if(u>=f){if(n&&t.op==="add"&&h>c.length)throw new No("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var s=d8t[t.op].call(t,c,h,e);if(s.test===!1)throw new No("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(u>=f){var s=UC[t.op].call(t,c,h,e);if(s.test===!1)throw new No("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(c=c[h],n&&u0)throw new No('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new No("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new No("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&bne(e.value))throw new No("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new No("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new No("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var s={op:"_get",path:e.from,value:void 0},a=$8e([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new No("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new No("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function $8e(e,t,n){try{if(!Array.isArray(e))throw new No("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)UU(Cu(t),Cu(e),n||!0);else{n=n||Pj;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function tue(e,t,n,r,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=vne(t),s=vne(e),a=!1,l=s.length-1;l>=0;l--){var c=s[l],u=e[c];if(mne(t,c)&&!(t[c]===void 0&&u!==void 0&&Array.isArray(t)===!1)){var f=t[c];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?tue(u,f,n,r+"/"+Hx(c),i):u!==f&&(i&&n.push({op:"test",path:r+"/"+Hx(c),value:Cu(u)}),n.push({op:"replace",path:r+"/"+Hx(c),value:Cu(f)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+Hx(c),value:Cu(u)}),n.push({op:"remove",path:r+"/"+Hx(c)}),a=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!a&&o.length==s.length))for(var l=0;l0)return[w,i+h.join(`, -`+y),f].join(` -`+c)}return S})(n,"",0)},u7}var O8t=C8t();const f7=Vn(O8t);var eN={exports:{}},d7,C_e;function VU(){if(C_e)return d7;C_e=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=t-6;return d7={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},d7}var h7,O_e;function WU(){if(O_e)return h7;O_e=1;var e={};return h7=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},h7}var E_e;function $D(){return E_e||(E_e=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=VU(),o=WU();t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],c=t.safeSrc=[],u=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[d,r]],p=m=>{for(const[v,y]of h)m=m.split(`${v}*`).join(`${v}{0,${y}}`).split(`${v}+`).join(`${v}{1,${y}}`);return m},g=(m,v,y)=>{const b=p(v),w=f++;o(m,w,v),u[m]=w,l[w]=v,c[w]=b,s[w]=new RegExp(v,y?"g":void 0),a[w]=new RegExp(b,y?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),g("FULL",`^${l[u.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),g("LOOSE",`^${l[u.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),g("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[u.COERCE],!0),g("COERCERTLFULL",l[u.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(eN,eN.exports)),eN.exports}var p7,T_e;function nue(){if(T_e)return p7;T_e=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return p7=r=>r?typeof r!="object"?e:r:t,p7}var g7,P_e;function N8e(){if(P_e)return g7;P_e=1;const e=/^[0-9]+$/,t=(r,i)=>{if(typeof r=="number"&&typeof i=="number")return r===i?0:rt(i,r)},g7}var m7,k_e;function rc(){if(k_e)return m7;k_e=1;const e=WU(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=VU(),{safeRe:r,t:i}=$D(),o=nue(),{compareIdentifiers:s}=N8e();class a{constructor(c,u){if(u=o(u),c instanceof a){if(c.loose===!!u.loose&&c.includePrerelease===!!u.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=c.trim().match(u.loose?r[i.LOOSE]:r[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&hc.major?1:this.minorc.minor?1:this.patchc.patch?1:0}comparePre(c){if(c instanceof a||(c=new a(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let u=0;do{const f=this.prerelease[u],d=c.prerelease[u];if(e("prerelease compare",u,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++u)}compareBuild(c){c instanceof a||(c=new a(c,this.options));let u=0;do{const f=this.build[u],d=c.build[u];if(e("build compare",u,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++u)}inc(c,u,f){if(c.startsWith("pre")){if(!u&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(u){const d=`-${u}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!d||d[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,f),this.inc("pre",u,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,f),this.inc("pre",u,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(u){let h=[u,d];f===!1&&(h=[u]),s(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return m7=a,m7}var v7,M_e;function WT(){if(M_e)return v7;M_e=1;const e=rc();return v7=(n,r,i=!1)=>{if(n instanceof e)return n;try{return new e(n,r)}catch(o){if(!i)return null;throw o}},v7}var y7,A_e;function E8t(){if(A_e)return y7;A_e=1;const e=WT();return y7=(n,r)=>{const i=e(n,r);return i?i.version:null},y7}var b7,R_e;function T8t(){if(R_e)return b7;R_e=1;const e=WT();return b7=(n,r)=>{const i=e(n.trim().replace(/^[=v]+/,""),r);return i?i.version:null},b7}var x7,I_e;function P8t(){if(I_e)return x7;I_e=1;const e=rc();return x7=(n,r,i,o,s)=>{typeof i=="string"&&(s=o,o=i,i=void 0);try{return new e(n instanceof e?n.version:n,i).inc(r,o,s).version}catch{return null}},x7}var w7,D_e;function k8t(){if(D_e)return w7;D_e=1;const e=WT();return w7=(n,r)=>{const i=e(n,null,!0),o=e(r,null,!0),s=i.compare(o);if(s===0)return null;const a=s>0,l=a?i:o,c=a?o:i,u=!!l.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(l)===0)return c.minor&&!c.patch?"minor":"patch"}const d=u?"pre":"";return i.major!==o.major?d+"major":i.minor!==o.minor?d+"minor":i.patch!==o.patch?d+"patch":"prerelease"},w7}var S7,L_e;function M8t(){if(L_e)return S7;L_e=1;const e=rc();return S7=(n,r)=>new e(n,r).major,S7}var _7,F_e;function A8t(){if(F_e)return _7;F_e=1;const e=rc();return _7=(n,r)=>new e(n,r).minor,_7}var C7,$_e;function R8t(){if($_e)return C7;$_e=1;const e=rc();return C7=(n,r)=>new e(n,r).patch,C7}var O7,N_e;function I8t(){if(N_e)return O7;N_e=1;const e=WT();return O7=(n,r)=>{const i=e(n,r);return i&&i.prerelease.length?i.prerelease:null},O7}var E7,z_e;function kh(){if(z_e)return E7;z_e=1;const e=rc();return E7=(n,r,i)=>new e(n,i).compare(new e(r,i)),E7}var T7,j_e;function D8t(){if(j_e)return T7;j_e=1;const e=kh();return T7=(n,r,i)=>e(r,n,i),T7}var P7,B_e;function L8t(){if(B_e)return P7;B_e=1;const e=kh();return P7=(n,r)=>e(n,r,!0),P7}var k7,U_e;function rue(){if(U_e)return k7;U_e=1;const e=rc();return k7=(n,r,i)=>{const o=new e(n,i),s=new e(r,i);return o.compare(s)||o.compareBuild(s)},k7}var M7,V_e;function F8t(){if(V_e)return M7;V_e=1;const e=rue();return M7=(n,r)=>n.sort((i,o)=>e(i,o,r)),M7}var A7,W_e;function $8t(){if(W_e)return A7;W_e=1;const e=rue();return A7=(n,r)=>n.sort((i,o)=>e(o,i,r)),A7}var R7,H_e;function HU(){if(H_e)return R7;H_e=1;const e=kh();return R7=(n,r,i)=>e(n,r,i)>0,R7}var I7,G_e;function iue(){if(G_e)return I7;G_e=1;const e=kh();return I7=(n,r,i)=>e(n,r,i)<0,I7}var D7,q_e;function z8e(){if(q_e)return D7;q_e=1;const e=kh();return D7=(n,r,i)=>e(n,r,i)===0,D7}var L7,X_e;function j8e(){if(X_e)return L7;X_e=1;const e=kh();return L7=(n,r,i)=>e(n,r,i)!==0,L7}var F7,Y_e;function oue(){if(Y_e)return F7;Y_e=1;const e=kh();return F7=(n,r,i)=>e(n,r,i)>=0,F7}var $7,Q_e;function sue(){if(Q_e)return $7;Q_e=1;const e=kh();return $7=(n,r,i)=>e(n,r,i)<=0,$7}var N7,K_e;function B8e(){if(K_e)return N7;K_e=1;const e=z8e(),t=j8e(),n=HU(),r=oue(),i=iue(),o=sue();return N7=(a,l,c,u)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,u);case"!=":return t(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return i(a,c,u);case"<=":return o(a,c,u);default:throw new TypeError(`Invalid operator: ${l}`)}},N7}var z7,Z_e;function N8t(){if(Z_e)return z7;Z_e=1;const e=rc(),t=WT(),{safeRe:n,t:r}=$D();return z7=(o,s)=>{if(o instanceof e)return o;if(typeof o=="number"&&(o=String(o)),typeof o!="string")return null;s=s||{};let a=null;if(!s.rtl)a=o.match(s.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);else{const h=s.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let p;for(;(p=h.exec(o))&&(!a||a.index+a[0].length!==o.length);)(!a||p.index+p[0].length!==a.index+a[0].length)&&(a=p),h.lastIndex=p.index+p[1].length+p[2].length;h.lastIndex=-1}if(a===null)return null;const l=a[2],c=a[3]||"0",u=a[4]||"0",f=s.includePrerelease&&a[5]?`-${a[5]}`:"",d=s.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${l}.${c}.${u}${f}${d}`,s)},z7}var j7,J_e;function z8t(){if(J_e)return j7;J_e=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,r)}return this}}return j7=e,j7}var B7,eCe;function Mh(){if(eCe)return B7;eCe=1;const e=/\s+/g;class t{constructor(L,$){if($=i($),L instanceof t)return L.loose===!!$.loose&&L.includePrerelease===!!$.includePrerelease?L:new t(L.raw,$);if(L instanceof o)return this.raw=L.value,this.set=[[L]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=L.trim().replace(e," "),this.set=this.raw.split("||").map(j=>this.parseRange(j.trim())).filter(j=>j.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const j=this.set[0];if(this.set=this.set.filter(V=>!g(V[0])),this.set.length===0)this.set=[j];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&m(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let L=0;L0&&(this.formatted+="||");const $=this.set[L];for(let j=0;j<$.length;j++)j>0&&(this.formatted+=" "),this.formatted+=$[j].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(L){const j=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+L,V=r.get(j);if(V)return V;const U=this.options.loose,z=U?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];L=L.replace(z,I(this.options.includePrerelease)),s("hyphen replace",L),L=L.replace(l[c.COMPARATORTRIM],u),s("comparator trim",L),L=L.replace(l[c.TILDETRIM],f),s("tilde trim",L),L=L.replace(l[c.CARETTRIM],d),s("caret trim",L);let N=L.split(" ").map(Y=>y(Y,this.options)).join(" ").split(/\s+/).map(Y=>R(Y,this.options));U&&(N=N.filter(Y=>(s("loose invalid filter",Y,this.options),!!Y.match(l[c.COMPARATORLOOSE])))),s("range list",N);const B=new Map,H=N.map(Y=>new o(Y,this.options));for(const Y of H){if(g(Y))return[Y];B.set(Y.value,Y)}B.size>1&&B.has("")&&B.delete("");const Q=[...B.values()];return r.set(j,Q),Q}intersects(L,$){if(!(L instanceof t))throw new TypeError("a Range is required");return this.set.some(j=>v(j,$)&&L.set.some(V=>v(V,$)&&j.every(U=>V.every(z=>U.intersects(z,$)))))}test(L){if(!L)return!1;if(typeof L=="string")try{L=new a(L,this.options)}catch{return!1}for(let $=0;$A.value==="<0.0.0-0",m=A=>A.value==="",v=(A,L)=>{let $=!0;const j=A.slice();let V=j.pop();for(;$&&j.length;)$=j.every(U=>V.intersects(U,L)),V=j.pop();return $},y=(A,L)=>(A=A.replace(l[c.BUILD],""),s("comp",A,L),A=_(A,L),s("caret",A),A=w(A,L),s("tildes",A),A=T(A,L),s("xrange",A),A=P(A,L),s("stars",A),A),b=A=>!A||A.toLowerCase()==="x"||A==="*",w=(A,L)=>A.trim().split(/\s+/).map($=>S($,L)).join(" "),S=(A,L)=>{const $=L.loose?l[c.TILDELOOSE]:l[c.TILDE];return A.replace($,(j,V,U,z,N)=>{s("tilde",A,j,V,U,z,N);let B;return b(V)?B="":b(U)?B=`>=${V}.0.0 <${+V+1}.0.0-0`:b(z)?B=`>=${V}.${U}.0 <${V}.${+U+1}.0-0`:N?(s("replaceTilde pr",N),B=`>=${V}.${U}.${z}-${N} <${V}.${+U+1}.0-0`):B=`>=${V}.${U}.${z} <${V}.${+U+1}.0-0`,s("tilde return",B),B})},_=(A,L)=>A.trim().split(/\s+/).map($=>E($,L)).join(" "),E=(A,L)=>{s("caret",A,L);const $=L.loose?l[c.CARETLOOSE]:l[c.CARET],j=L.includePrerelease?"-0":"";return A.replace($,(V,U,z,N,B)=>{s("caret",A,V,U,z,N,B);let H;return b(U)?H="":b(z)?H=`>=${U}.0.0${j} <${+U+1}.0.0-0`:b(N)?U==="0"?H=`>=${U}.${z}.0${j} <${U}.${+z+1}.0-0`:H=`>=${U}.${z}.0${j} <${+U+1}.0.0-0`:B?(s("replaceCaret pr",B),U==="0"?z==="0"?H=`>=${U}.${z}.${N}-${B} <${U}.${z}.${+N+1}-0`:H=`>=${U}.${z}.${N}-${B} <${U}.${+z+1}.0-0`:H=`>=${U}.${z}.${N}-${B} <${+U+1}.0.0-0`):(s("no pr"),U==="0"?z==="0"?H=`>=${U}.${z}.${N}${j} <${U}.${z}.${+N+1}-0`:H=`>=${U}.${z}.${N}${j} <${U}.${+z+1}.0-0`:H=`>=${U}.${z}.${N} <${+U+1}.0.0-0`),s("caret return",H),H})},T=(A,L)=>(s("replaceXRanges",A,L),A.split(/\s+/).map($=>k($,L)).join(" ")),k=(A,L)=>{A=A.trim();const $=L.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return A.replace($,(j,V,U,z,N,B)=>{s("xRange",A,j,V,U,z,N,B);const H=b(U),Q=H||b(z),Y=Q||b(N),Z=Y;return V==="="&&Z&&(V=""),B=L.includePrerelease?"-0":"",H?V===">"||V==="<"?j="<0.0.0-0":j="*":V&&Z?(Q&&(z=0),N=0,V===">"?(V=">=",Q?(U=+U+1,z=0,N=0):(z=+z+1,N=0)):V==="<="&&(V="<",Q?U=+U+1:z=+z+1),V==="<"&&(B="-0"),j=`${V+U}.${z}.${N}${B}`):Q?j=`>=${U}.0.0${B} <${+U+1}.0.0-0`:Y&&(j=`>=${U}.${z}.0${B} <${U}.${+z+1}.0-0`),s("xRange return",j),j})},P=(A,L)=>(s("replaceStars",A,L),A.trim().replace(l[c.STAR],"")),R=(A,L)=>(s("replaceGTE0",A,L),A.trim().replace(l[L.includePrerelease?c.GTE0PRE:c.GTE0],"")),I=A=>(L,$,j,V,U,z,N,B,H,Q,Y,Z)=>(b(j)?$="":b(V)?$=`>=${j}.0.0${A?"-0":""}`:b(U)?$=`>=${j}.${V}.0${A?"-0":""}`:z?$=`>=${$}`:$=`>=${$}${A?"-0":""}`,b(H)?B="":b(Q)?B=`<${+H+1}.0.0-0`:b(Y)?B=`<${H}.${+Q+1}.0-0`:Z?B=`<=${H}.${Q}.${Y}-${Z}`:A?B=`<${H}.${Q}.${+Y+1}-0`:B=`<=${B}`,`${$} ${B}`.trim()),F=(A,L,$)=>{for(let j=0;j0){const V=A[j].semver;if(V.major===L.major&&V.minor===L.minor&&V.patch===L.patch)return!0}return!1}return!0};return B7}var U7,tCe;function GU(){if(tCe)return U7;tCe=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,f){if(f=n(f),u instanceof t){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return o(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||o(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||o(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}U7=t;const n=nue(),{safeRe:r,t:i}=$D(),o=B8e(),s=WU(),a=rc(),l=Mh();return U7}var V7,nCe;function qU(){if(nCe)return V7;nCe=1;const e=Mh();return V7=(n,r,i)=>{try{r=new e(r,i)}catch{return!1}return r.test(n)},V7}var W7,rCe;function j8t(){if(rCe)return W7;rCe=1;const e=Mh();return W7=(n,r)=>new e(n,r).set.map(i=>i.map(o=>o.value).join(" ").trim().split(" ")),W7}var H7,iCe;function B8t(){if(iCe)return H7;iCe=1;const e=rc(),t=Mh();return H7=(r,i,o)=>{let s=null,a=null,l=null;try{l=new t(i,o)}catch{return null}return r.forEach(c=>{l.test(c)&&(!s||a.compare(c)===-1)&&(s=c,a=new e(s,o))}),s},H7}var G7,oCe;function U8t(){if(oCe)return G7;oCe=1;const e=rc(),t=Mh();return G7=(r,i,o)=>{let s=null,a=null,l=null;try{l=new t(i,o)}catch{return null}return r.forEach(c=>{l.test(c)&&(!s||a.compare(c)===1)&&(s=c,a=new e(s,o))}),s},G7}var q7,sCe;function V8t(){if(sCe)return q7;sCe=1;const e=rc(),t=Mh(),n=HU();return q7=(i,o)=>{i=new t(i,o);let s=new e("0.0.0");if(i.test(s)||(s=new e("0.0.0-0"),i.test(s)))return s;s=null;for(let a=0;a{const f=new e(u.semver.version);switch(u.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!c||n(f,c))&&(c=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),c&&(!s||n(s,c))&&(s=c)}return s&&i.test(s)?s:null},q7}var X7,aCe;function W8t(){if(aCe)return X7;aCe=1;const e=Mh();return X7=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},X7}var Y7,lCe;function aue(){if(lCe)return Y7;lCe=1;const e=rc(),t=GU(),{ANY:n}=t,r=Mh(),i=qU(),o=HU(),s=iue(),a=sue(),l=oue();return Y7=(u,f,d,h)=>{u=new e(u,h),f=new r(f,h);let p,g,m,v,y;switch(d){case">":p=o,g=a,m=s,v=">",y=">=";break;case"<":p=s,g=l,m=o,v="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(u,f,h))return!1;for(let b=0;b{E.semver===n&&(E=new t(">=0.0.0")),S=S||E,_=_||E,p(E.semver,S.semver,h)?S=E:m(E.semver,_.semver,h)&&(_=E)}),S.operator===v||S.operator===y||(!_.operator||_.operator===v)&&g(u,_.semver))return!1;if(_.operator===y&&m(u,_.semver))return!1}return!0},Y7}var Q7,cCe;function H8t(){if(cCe)return Q7;cCe=1;const e=aue();return Q7=(n,r,i)=>e(n,r,">",i),Q7}var K7,uCe;function G8t(){if(uCe)return K7;uCe=1;const e=aue();return K7=(n,r,i)=>e(n,r,"<",i),K7}var Z7,fCe;function q8t(){if(fCe)return Z7;fCe=1;const e=Mh();return Z7=(n,r,i)=>(n=new e(n,i),r=new e(r,i),n.intersects(r,i)),Z7}var J7,dCe;function X8t(){if(dCe)return J7;dCe=1;const e=qU(),t=kh();return J7=(n,r,i)=>{const o=[];let s=null,a=null;const l=n.sort((d,h)=>t(d,h,i));for(const d of l)e(d,r,i)?(a=d,s||(s=d)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const c=[];for(const[d,h]of o)d===h?c.push(d):!h&&d===l[0]?c.push("*"):h?d===l[0]?c.push(`<=${h}`):c.push(`${d} - ${h}`):c.push(`>=${d}`);const u=c.join(" || "),f=typeof r.raw=="string"?r.raw:String(r);return u.length{if(f===d)return!0;f=new e(f,h),d=new e(d,h);let p=!1;e:for(const g of f.set){for(const m of d.set){const v=l(g,m,h);if(p=p||v!==null,v)continue e}if(p)return!1}return!0},s=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],l=(f,d,h)=>{if(f===d)return!0;if(f.length===1&&f[0].semver===n){if(d.length===1&&d[0].semver===n)return!0;h.includePrerelease?f=s:f=a}if(d.length===1&&d[0].semver===n){if(h.includePrerelease)return!0;d=a}const p=new Set;let g,m;for(const T of f)T.operator===">"||T.operator===">="?g=c(g,T,h):T.operator==="<"||T.operator==="<="?m=u(m,T,h):p.add(T.semver);if(p.size>1)return null;let v;if(g&&m){if(v=i(g.semver,m.semver,h),v>0)return null;if(v===0&&(g.operator!==">="||m.operator!=="<="))return null}for(const T of p){if(g&&!r(T,String(g),h)||m&&!r(T,String(m),h))return null;for(const k of d)if(!r(T,String(k),h))return!1;return!0}let y,b,w,S,_=m&&!h.includePrerelease&&m.semver.prerelease.length?m.semver:!1,E=g&&!h.includePrerelease&&g.semver.prerelease.length?g.semver:!1;_&&_.prerelease.length===1&&m.operator==="<"&&_.prerelease[0]===0&&(_=!1);for(const T of d){if(S=S||T.operator===">"||T.operator===">=",w=w||T.operator==="<"||T.operator==="<=",g){if(E&&T.semver.prerelease&&T.semver.prerelease.length&&T.semver.major===E.major&&T.semver.minor===E.minor&&T.semver.patch===E.patch&&(E=!1),T.operator===">"||T.operator===">="){if(y=c(g,T,h),y===T&&y!==g)return!1}else if(g.operator===">="&&!r(g.semver,String(T),h))return!1}if(m){if(_&&T.semver.prerelease&&T.semver.prerelease.length&&T.semver.major===_.major&&T.semver.minor===_.minor&&T.semver.patch===_.patch&&(_=!1),T.operator==="<"||T.operator==="<="){if(b=u(m,T,h),b===T&&b!==m)return!1}else if(m.operator==="<="&&!r(m.semver,String(T),h))return!1}if(!T.operator&&(m||g)&&v!==0)return!1}return!(g&&w&&!m&&v!==0||m&&S&&!g&&v!==0||E||_)},c=(f,d,h)=>{if(!f)return d;const p=i(f.semver,d.semver,h);return p>0?f:p<0||d.operator===">"&&f.operator===">="?d:f},u=(f,d,h)=>{if(!f)return d;const p=i(f.semver,d.semver,h);return p<0?f:p>0||d.operator==="<"&&f.operator==="<="?d:f};return eq=o,eq}var tq,pCe;function Q8t(){if(pCe)return tq;pCe=1;const e=$D(),t=VU(),n=rc(),r=N8e(),i=WT(),o=E8t(),s=T8t(),a=P8t(),l=k8t(),c=M8t(),u=A8t(),f=R8t(),d=I8t(),h=kh(),p=D8t(),g=L8t(),m=rue(),v=F8t(),y=$8t(),b=HU(),w=iue(),S=z8e(),_=j8e(),E=oue(),T=sue(),k=B8e(),P=N8t(),R=GU(),I=Mh(),F=qU(),A=j8t(),L=B8t(),$=U8t(),j=V8t(),V=W8t(),U=aue(),z=H8t(),N=G8t(),B=q8t(),H=X8t(),Q=Y8t();return tq={parse:i,valid:o,clean:s,inc:a,diff:l,major:c,minor:u,patch:f,prerelease:d,compare:h,rcompare:p,compareLoose:g,compareBuild:m,sort:v,rsort:y,gt:b,lt:w,eq:S,neq:_,gte:E,lte:T,cmp:k,coerce:P,Comparator:R,Range:I,satisfies:F,toComparators:A,maxSatisfying:L,minSatisfying:$,minVersion:j,validRange:V,outside:U,gtr:z,ltr:N,intersects:B,simplifyRange:H,subset:Q,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers},tq}var U8e=Q8t();function Gc(e,t,n){return e.fields=t||[],e.fname=n,e}function Bo(e){return e==null?null:e.fname}function hl(e){return e==null?null:e.fields}function V8e(e){return e.length===1?K8t(e[0]):Z8t(e)}const K8t=e=>function(t){return t[e]},Z8t=e=>{const t=e.length;return function(n){for(let r=0;rs?c():s=a+1:l==="["?(a>s&&c(),i=s=a+1):l==="]"&&(i||et("Access path missing open bracket: "+e),i>0&&c(),i=0,s=a+1)}return i&&et("Access path missing closing bracket: "+e),r&&et("Access path missing closing quote: "+e),a>s&&(a++,c()),t}function Qf(e,t,n){const r=bg(e);return e=r.length===1?r[0]:e,Gc((n&&n.get||V8e)(r),[e],t||e)}const ND=Qf("id"),vl=Gc(e=>e,[],"identity"),o0=Gc(()=>0,[],"zero"),HT=Gc(()=>1,[],"one"),Kf=Gc(()=>!0,[],"true"),Ly=Gc(()=>!1,[],"false"),W8e=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]=="function"),"__proto__"]);function J8t(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const H8e=0,lue=1,cue=2,G8e=3,q8e=4;function uue(e,t,n=J8t){let r=e||H8e;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=lue&&n(t||"error","ERROR",arguments),this},warn(){return r>=cue&&n(t||"warn","WARN",arguments),this},info(){return r>=G8e&&n(t||"log","INFO",arguments),this},debug(){return r>=q8e&&n(t||"log","DEBUG",arguments),this}}}var lt=Array.isArray;function Ht(e){return e===Object(e)}const gCe=e=>e!=="__proto__";function XU(...e){return e.reduce((t,n)=>{for(const r in n)if(r==="signals")t.signals=eWt(t.signals,n.signals);else{const i=r==="legend"?{layout:1}:r==="style"?!0:null;GT(t,r,n[r],i)}return t},{})}function GT(e,t,n,r){if(!gCe(t))return;let i,o;if(Ht(n)&&!lt(n)){o=Ht(e[t])?e[t]:e[t]={};for(i in n)r&&(r===!0||r[i])?GT(o,i,n[i]):gCe(i)&&(o[i]=n[i])}else e[t]=n}function eWt(e,t){if(e==null)return t;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return t.forEach(i),e.forEach(i),r}function Mr(e){return e[e.length-1]}function ul(e){return e==null||e===""?null:+e}const X8e=e=>t=>e*Math.exp(t),Y8e=e=>t=>Math.log(e*t),Q8e=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),K8e=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,kj=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function YU(e,t,n,r){const i=n(e[0]),o=n(Mr(e)),s=(o-i)*t;return[r(i-s),r(o-s)]}function Z8e(e,t){return YU(e,t,ul,vl)}function J8e(e,t){var n=Math.sign(e[0]);return YU(e,t,Y8e(n),X8e(n))}function eWe(e,t,n){return YU(e,t,kj(n),kj(1/n))}function tWe(e,t,n){return YU(e,t,Q8e(n),K8e(n))}function QU(e,t,n,r,i){const o=r(e[0]),s=r(Mr(e)),a=t!=null?r(t):(o+s)/2;return[i(a+(o-a)*n),i(a+(s-a)*n)]}function fue(e,t,n){return QU(e,t,n,ul,vl)}function due(e,t,n){const r=Math.sign(e[0]);return QU(e,t,n,Y8e(r),X8e(r))}function Mj(e,t,n,r){return QU(e,t,n,kj(r),kj(1/r))}function hue(e,t,n,r){return QU(e,t,n,Q8e(r),K8e(r))}function nWe(e){return 1+~~(new Date(e).getMonth()/3)}function rWe(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Vt(e){return e!=null?lt(e)?e:[e]:[]}function iWe(e,t,n){let r=e[0],i=e[1],o;return i=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-o),r+o]}function ir(e){return typeof e=="function"}const tWt="descending";function pue(e,t,n){n=n||{},t=Vt(t)||[];const r=[],i=[],o={},s=n.comparator||nWt;return Vt(e).forEach((a,l)=>{a!=null&&(r.push(t[l]===tWt?-1:1),i.push(a=ir(a)?a:Qf(a,null,n)),(hl(a)||[]).forEach(c=>o[c]=1))}),i.length===0?null:Gc(s(i,r),Object.keys(o))}const zD=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),nWt=(e,t)=>e.length===1?rWt(e[0],t[0]):iWt(e,t,e.length),rWt=(e,t)=>function(n,r){return zD(e(n),e(r))*t},iWt=(e,t,n)=>(t.push(0),function(r,i){let o,s=0,a=-1;for(;s===0&&++ae}function gue(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}function nr(e){for(let t,n,r=1,i=arguments.length;rs&&(s=i))}else{for(i=t(e[n]);ns&&(s=i))}return[o,s]}function oWe(e,t){const n=e.length;let r=-1,i,o,s,a,l;if(t==null){for(;++r=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s{i.set(o,e[o])}),i}function sWe(e,t,n,r,i,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],l=Mr(e),c;lo&&(s=i,i=o,o=s),n=n===void 0||n,r=r===void 0||r,(n?i<=e:ia.replace(/\\(.)/g,"$1")):Vt(e));const r=e&&e.length,i=n&&n.get||V8e,o=a=>i(t?[a]:bg(a));let s;if(!r)s=function(){return""};else if(r===1){const a=o(e[0]);s=function(l){return""+a(l)}}else{const a=e.map(o);s=function(l){let c=""+a[0](l),u=0;for(;++u{t={},n={},r=0},o=(s,a)=>(++r>e&&(n=t,t={},r=1),t[s]=a);return i(),{clear:i,has:s=>Yt(t,s)||Yt(n,s),get:s=>Yt(t,s)?t[s]:Yt(n,s)?o(s,n[s]):void 0,set:(s,a)=>Yt(t,s)?t[s]=a:o(s,a)}}function uWe(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const s=r||new t.constructor(i+o);let a=0,l=0,c=0;for(;a0?n[l++]:t[a++];for(;a=0;)n+=e;return n}function fWe(e,t,n,r){const i=n||" ",o=e+"",s=t-o.length;return s<=0?o:r==="left"?rM(i,s)+o:r==="center"?rM(i,~~(s/2))+o+rM(i,Math.ceil(s/2)):o+rM(i,s)}function jD(e){return e&&Mr(e)-e[0]||0}function Tt(e){return lt(e)?`[${e.map(t=>t===null?"null":Tt(t))}]`:Ht(e)||Kt(e)?JSON.stringify(e).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):e}function yue(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const sWt=e=>Qr(e)||D0(e)?e:Date.parse(e);function bue(e,t){return t=t||sWt,e==null||e===""?null:t(e)}function xue(e){return e==null||e===""?null:e+""}function vh(e){const t={},n=e.length;for(let r=0;r9999?"+"+pc(e,6):pc(e,4)}function cWt(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":lWt(e.getUTCFullYear())+"-"+pc(e.getUTCMonth()+1,2)+"-"+pc(e.getUTCDate(),2)+(i?"T"+pc(t,2)+":"+pc(n,2)+":"+pc(r,2)+"."+pc(i,3)+"Z":r?"T"+pc(t,2)+":"+pc(n,2)+":"+pc(r,2)+"Z":n||t?"T"+pc(t,2)+":"+pc(n,2)+"Z":"")}function uWt(e){var t=new RegExp('["'+e+` -\r]`),n=e.charCodeAt(0);function r(f,d){var h,p,g=i(f,function(m,v){if(h)return h(m,v-1);p=m,h=d?aWt(m,d):hWe(m)});return g.columns=p||[],g}function i(f,d){var h=[],p=f.length,g=0,m=0,v,y=p<=0,b=!1;f.charCodeAt(p-1)===jk&&--p,f.charCodeAt(p-1)===iq&&--p;function w(){if(y)return nq;if(b)return b=!1,mCe;var _,E=g,T;if(f.charCodeAt(E)===rq){for(;g++=p?y=!0:(T=f.charCodeAt(g++))===jk?b=!0:T===iq&&(b=!0,f.charCodeAt(g)===jk&&++g),f.slice(E+1,_-1).replace(/""/g,'"')}for(;g{nSe(e)}):nSe(e)}function CBt(e){return!!(window.getSelection()?.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const OBt=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,r=(typeof n=="object"?n?.clipboardExport:n)||!1,i=t.clipboardCopyCellDelimiter,o=M.useCallback(s=>{if(!S5t(s)||CBt(s.target))return;let a="";if(e.current.getSelectedRows().size>0)a=e.current.getDataAsCsv({includeHeaders:!1,delimiter:i,shouldAppendQuotes:!1,escapeFormulas:!1});else{const c=pc(e);if(c){const u=e.current.getCellParams(c.id,c.field);a=yUe(u,{csvOptions:{delimiter:i,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:r})}}a=e.current.unstable_applyPipeProcessors("clipboardCopy",a),a&&(_Bt(a),e.current.publishEvent("clipboardCopy",a))},[e,r,i]);D6e(e,()=>e.current.rootElementRef.current,"keydown",o),ii(e,"clipboardCopy",t.onClipboardCopy)},EBt=e=>X({},e,{columnMenu:{open:!1}}),TBt=e=>{const t=Ns(e,"useGridColumnMenu"),n=M.useCallback(s=>{const a=gz(e.current.state),l={open:!0,field:s};(l.open!==a.open||l.field!==a.field)&&(e.current.setState(u=>u.columnMenu.open&&u.columnMenu.field===s?u:(t.debug("Opening Column Menu"),X({},u,{columnMenu:{open:!0,field:s}}))),e.current.hidePreferences())},[e,t]),r=M.useCallback(()=>{const s=gz(e.current.state);if(s.field){const c=Ov(e),u=Cf(e),f=Um(e);let d=s.field;if(c[d]||(d=f[0]),u[d]===!1){const h=f.filter(g=>g===d?!0:u[g]!==!1),p=h.indexOf(d);d=h[p+1]||h[p-1]}e.current.setColumnHeaderFocus(d)}const a={open:!1,field:void 0};(a.open!==s.open||a.field!==s.field)&&e.current.setState(c=>(t.debug("Hiding Column Menu"),X({},c,{columnMenu:a})))},[e,t]),i=M.useCallback(s=>{t.debug("Toggle Column Menu");const a=gz(e.current.state);!a.open||a.field!==s?n(s):r()},[e,t,n,r]);Gn(e,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:i},"public"),Ft(e,"columnResizeStart",r),Ft(e,"virtualScrollerWheel",e.current.hideColumnMenu),Ft(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},PBt=(e,t,n)=>{const r=gC({apiRef:n,columnsToUpsert:t.columns,initialState:t.initialState?.columns,columnVisibilityModel:t.columnVisibilityModel??t.initialState?.columns?.columnVisibilityModel??{},keepOnlyColumnsToUpsert:!0});return X({},e,{columns:r,pinnedColumns:e.pinnedColumns??G5})};function kBt(e,t){const n=Ns(e,"useGridColumns"),r=M.useRef(t.columns);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:Cf,changeEvent:"columnVisibilityModelChange"});const i=M.useCallback(P=>{n.debug("Updating columns state."),e.current.setState(rSe(P)),e.current.publishEvent("columnsChange",P.orderedFields)},[n,e]),o=M.useCallback(P=>Ov(e)[P],[e]),s=M.useCallback(()=>Ff(e),[e]),a=M.useCallback(()=>Mo(e),[e]),l=M.useCallback((P,I=!0)=>(I?Mo(e):Ff(e)).findIndex(F=>F.field===P),[e]),c=M.useCallback(P=>{const I=l(P);return Cb(e)[I]},[e,l]),u=M.useCallback(P=>{Cf(e)!==P&&(e.current.setState(R=>X({},R,{columns:gC({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:P,keepOnlyColumnsToUpsert:!1})})),e.current.updateRenderContext?.(),e.current.forceUpdate())},[e]),f=M.useCallback(P=>{const I=gC({apiRef:e,columnsToUpsert:P,initialState:void 0,keepOnlyColumnsToUpsert:!1});i(I)},[e,i]),d=M.useCallback((P,I)=>{const R=Cf(e),F=R[P]??!0;if(I!==F){const A=X({},R,{[P]:I});e.current.setColumnVisibilityModel(A)}},[e]),h=M.useCallback(P=>Um(e).findIndex(R=>R===P),[e]),p=M.useCallback((P,I)=>{const R=Um(e),F=h(P);if(F===I)return;n.debug(`Moving column ${P} to index ${I}`);const A=[...R],L=A.splice(F,1)[0];A.splice(I,0,L),i(X({},Bp(e.current.state),{orderedFields:A}));const $={column:e.current.getColumn(P),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(P),oldIndex:F};e.current.publishEvent("columnIndexChange",$)},[e,n,i,h]),g=M.useCallback((P,I)=>{n.debug(`Updating column ${P} width to ${I}`);const R=Bp(e.current.state),F=R.lookup[P],A=X({},F,{width:I,hasBeenResized:!0});i(tte(X({},R,{lookup:X({},R.lookup,{[P]:A})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(P),colDef:A,width:I})},[e,n,i]),m={getColumn:o,getAllColumns:s,getColumnIndex:l,getColumnPosition:c,getVisibleColumns:a,getColumnIndexRelativeToVisibleColumns:h,updateColumns:f,setColumnVisibilityModel:u,setColumnVisibility:d,setColumnWidth:g},v={setColumnIndex:p};Gn(e,m,"public"),Gn(e,v,t.signature===Lf.DataGrid?"private":"public");const y=M.useCallback((P,I)=>{const R={},F=Cf(e);(!I.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys(t.initialState?.columns?.columnVisibilityModel??{}).length>0||Object.keys(F).length>0)&&(R.columnVisibilityModel=F),R.orderedFields=Um(e);const L=Ff(e),$={};return L.forEach(j=>{if(j.hasBeenResized){const V={};q6e.forEach(U=>{let z=j[U];z===1/0&&(z=-1),V[U]=z}),$[j.field]=V}}),Object.keys($).length>0&&(R.dimensions=$),X({},P,{columns:R})},[e,t.columnVisibilityModel,t.initialState?.columns]),b=M.useCallback((P,I)=>{const R=I.stateToRestore.columns?.columnVisibilityModel,F=I.stateToRestore.columns;if(R==null&&F==null)return P;const A=gC({apiRef:e,columnsToUpsert:[],initialState:F,columnVisibilityModel:R,keepOnlyColumnsToUpsert:!1});return e.current.setState(rSe(A)),F!=null&&e.current.publishEvent("columnsChange",A.orderedFields),P},[e]),w=M.useCallback((P,I)=>{if(I===iw.columns){const R=t.slots.columnsPanel;return O.jsx(R,X({},t.slotProps?.columnsPanel))}return P},[t.slots.columnsPanel,t.slotProps?.columnsPanel]),S=M.useCallback(P=>t.disableColumnSelector?P:[...P,"columnMenuColumnsItem"],[t.disableColumnSelector]);fo(e,"columnMenu",S),fo(e,"exportState",y),fo(e,"restoreState",b),fo(e,"preferencePanel",w);const _=M.useRef(null);Ft(e,"viewportInnerSizeChange",P=>{if(_.current!==P.width){if(_.current=P.width,!Mo(e).some(R=>R.flex&&R.flex>0))return;i(tte(Bp(e.current.state),e.current.getRootDimensions()))}});const T=M.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const P=gC({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});i(P)},[e,n,i]);Wle(e,"hydrateColumns",T);const k=M.useRef(!0);M.useEffect(()=>{if(k.current){k.current=!1;return}if(n.info(`GridColumns have changed, new length ${t.columns.length}`),r.current===t.columns)return;const P=gC({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});r.current=t.columns,i(P)},[n,e,i,t.columns]),M.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}function rSe(e){return t=>X({},t,{columns:e})}const MBt=(e,t)=>X({},e,{density:t.initialState?.density??t.density??"standard"}),ABt=(e,t)=>{const n=Ns(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:kC,changeEvent:"densityChange"});const i={setDensity:ft(a=>{kC(e.current.state)!==a&&(n.debug(`Set grid density to ${a}`),e.current.setState(c=>X({},c,{density:a})))})};Gn(e,i,"public");const o=M.useCallback((a,l)=>{const c=kC(e.current.state);return!l.exportOnlyDirtyModels||t.density!=null||t.initialState?.density!=null?X({},a,{density:c}):a},[e,t.density,t.initialState?.density]),s=M.useCallback((a,l)=>{const c=l.stateToRestore?.density?l.stateToRestore.density:kC(e.current.state);return e.current.setState(u=>X({},u,{density:c})),a},[e]);fo(e,"exportState",o),fo(e,"restoreState",s),M.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])};function RBt(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const i=URL.createObjectURL(e),o=document.createElement("a");o.href=i,o.download=r,o.click(),setTimeout(()=>{URL.revokeObjectURL(i)});return}throw new Error("MUI X: exportAs not supported.")}const bUe=({apiRef:e,options:t})=>{const n=Ff(e);return t.fields?t.fields.reduce((i,o)=>{const s=n.find(a=>a.field===o);return s&&i.push(s),i},[]):(t.allColumns?n:Mo(e)).filter(i=>!i.disableExport)},xUe=({apiRef:e})=>{const t=k6e(e),n=ps(e),r=e.current.getSelectedRows(),i=t.filter(l=>n[l].type!=="footer"),o=PT(e),s=o?.top?.map(l=>l.id)||[],a=o?.bottom?.map(l=>l.id)||[];return i.unshift(...s),i.push(...a),r.size>0?i.filter(l=>r.has(l)):i},IBt=(e,t)=>{const n=Ns(e,"useGridCsvExport"),r=t.ignoreValueFormatterDuringExport,i=(typeof r=="object"?r?.csvExport:r)||!1,o=M.useCallback((c={})=>{n.debug("Get data as CSV");const u=bUe({apiRef:e,options:c}),d=(c.getRowsToExport??xUe)({apiRef:e});return SBt({columns:u,rowIds:d,csvOptions:{delimiter:c.delimiter||",",shouldAppendQuotes:c.shouldAppendQuotes??!0,includeHeaders:c.includeHeaders??!0,includeColumnGroupsHeaders:c.includeColumnGroupsHeaders??!0,escapeFormulas:c.escapeFormulas??!0},ignoreValueFormatter:i,apiRef:e})},[n,e,i]),s=M.useCallback(c=>{n.debug("Export data as CSV");const u=o(c),f=new Blob([c?.utf8WithBom?new Uint8Array([239,187,191]):"",u],{type:"text/csv"});RBt(f,"csv",c?.fileName)},[n,o]);Gn(e,{getDataAsCsv:o,exportDataAsCsv:s},"public");const l=M.useCallback((c,u)=>u.csvOptions?.disableToolbarButton?c:[...c,{component:O.jsx(Tjt,{options:u.csvOptions}),componentName:"csvExport"}],[]);fo(e,"exportMenu",l)},mz=(e,t,n)=>{let r=e.paginationModel;const i=e.rowCount,o=n?.pageSize??r.pageSize,s=n?.page??r.page,a=L6e(i,o,s);n&&(n?.page!==r.page||n?.pageSize!==r.pageSize)&&(r=n);const l=o===-1?0:_$t(r.page,a);return l!==r.page&&(r=X({},r,{page:l})),$6e(r.pageSize,t),r},DBt=(e,t)=>{const n=Ns(e,"useGridPaginationModel"),r=ut(e,TT),i=M.useRef(Hs(e)),o=Math.floor(t.rowHeight*r);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:tl,changeEvent:"paginationModelChange"});const s=M.useCallback(y=>{const b=tl(e);y!==b.page&&(n.debug(`Setting page to ${y}`),e.current.setPaginationModel({page:y,pageSize:b.pageSize}))},[e,n]),a=M.useCallback(y=>{const b=tl(e);y!==b.pageSize&&(n.debug(`Setting page size to ${y}`),e.current.setPaginationModel({pageSize:y,page:b.page}))},[e,n]),l=M.useCallback(y=>{const b=tl(e);y!==b&&(n.debug("Setting 'paginationModel' to",y),e.current.setState(w=>X({},w,{pagination:X({},w.pagination,{paginationModel:mz(w.pagination,t.signature,y)})}),"setPaginationModel"))},[e,n,t.signature]);Gn(e,{setPage:s,setPageSize:a,setPaginationModel:l},"public");const u=M.useCallback((y,b)=>{const w=tl(e);return!b.exportOnlyDirtyModels||t.paginationModel!=null||t.initialState?.pagination?.paginationModel!=null||w.page!==0&&w.pageSize!==S$t(t.autoPageSize)?X({},y,{pagination:X({},y.pagination,{paginationModel:w})}):y},[e,t.paginationModel,t.initialState?.pagination?.paginationModel,t.autoPageSize]),f=M.useCallback((y,b)=>{const w=b.stateToRestore.pagination?.paginationModel?X({},F6e(t.autoPageSize),b.stateToRestore.pagination?.paginationModel):tl(e);return e.current.setState(S=>X({},S,{pagination:X({},S.pagination,{paginationModel:mz(S.pagination,t.signature,w)})}),"stateRestorePreProcessing"),y},[e,t.autoPageSize,t.signature]);fo(e,"exportState",u),fo(e,"restoreState",f);const d=()=>{const y=tl(e);e.current.virtualScrollerRef?.current&&e.current.scrollToIndexes({rowIndex:y.page*y.pageSize})},h=M.useCallback(()=>{if(!t.autoPageSize)return;const y=e.current.getRootDimensions(),b=Math.max(1,Math.floor(y.viewportInnerSize.height/o));e.current.setPageSize(b)},[e,t.autoPageSize,o]),p=M.useCallback(y=>{if(y==null)return;const b=tl(e);if(b.page===0)return;const w=j6e(e);b.page>w-1&&e.current.setPage(Math.max(0,w-1))},[e]),g=M.useCallback(()=>{tl(e).page!==0&&e.current.setPage(0),e.current.getScrollPosition().top!==0&&e.current.scroll({top:0})},[e]),m=M.useCallback(y=>{const b=X({},y,{items:A6e(e)});O0(b,i.current)||(i.current=b,g())},[e,g]);Ft(e,"viewportInnerSizeChange",h),Ft(e,"paginationModelChange",d),Ft(e,"rowCountChange",p),Ft(e,"sortModelChange",Hx(t.resetPageOnSortFilter,g)),Ft(e,"filterModelChange",Hx(t.resetPageOnSortFilter,m));const v=M.useRef(!0);M.useEffect(()=>{if(v.current){v.current=!1;return}t.pagination&&e.current.setState(y=>X({},y,{pagination:X({},y.pagination,{paginationModel:mz(y.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.signature,t.pagination]),M.useEffect(()=>{e.current.setState(y=>{const b=t.pagination===!0;return y.pagination.paginationMode===t.paginationMode||y.pagination.enabled===b?y:X({},y,{pagination:X({},y.pagination,{paginationMode:t.paginationMode,enabled:t.pagination===!0})})})},[e,t.paginationMode,t.pagination]),M.useEffect(h,[h])};function LBt(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function FBt(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}const $Bt=(e,t)=>{const n=e.current.rootElementRef.current!==null,r=Ns(e,"useGridPrintExport"),i=M.useRef(null),o=M.useRef(null),s=M.useRef({}),a=M.useRef([]),l=M.useRef(null);M.useEffect(()=>{i.current=ci(e.current.rootElementRef.current)},[e,n]);const c=M.useCallback((m,v,y)=>new Promise(b=>{const w=bUe({apiRef:e,options:{fields:m,allColumns:v}}).map(E=>E.field),S=Ff(e),_={};S.forEach(E=>{_[E.field]=w.includes(E.field)}),y&&(_[IT.field]=!0),e.current.setColumnVisibilityModel(_),b()}),[e]),u=M.useCallback(m=>{const y=m({apiRef:e}).reduce((b,w)=>{const S=e.current.getRow(w);return S[VO]||b.push(S),b},[]);e.current.setRows(y)},[e]),f=M.useCallback((m,v)=>{const y=X({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},v),b=m.contentDocument;if(!b)return;const w=DT(e.current.state),S=e.current.rootElementRef.current,_=S.cloneNode(!0),E=_.querySelector(`.${ye.main}`);E.style.overflow="visible",_.style.contain="size";let T=S.querySelector(`.${ye.toolbarContainer}`)?.offsetHeight||0,k=S.querySelector(`.${ye.footerContainer}`)?.offsetHeight||0;const P=_.querySelector(`.${ye.footerContainer}`);y.hideToolbar&&(_.querySelector(`.${ye.toolbarContainer}`)?.remove(),T=0),y.hideFooter&&P&&(P.remove(),k=0);const I=w.currentPageTotalHeight+vU(e,t)+T+k;_.style.height=`${I}px`,_.style.boxSizing="content-box",!y.hideFooter&&P&&(P.style.position="absolute",P.style.width="100%",P.style.top=`${I-k}px`);const R=document.createElement("div");R.appendChild(_),b.body.style.marginTop="0px",b.body.innerHTML=R.innerHTML;const F=typeof y.pageStyle=="function"?y.pageStyle():y.pageStyle;if(typeof F=="string"){const L=b.createElement("style");L.appendChild(b.createTextNode(F)),b.head.appendChild(L)}y.bodyClassName&&b.body.classList.add(...y.bodyClassName.split(" "));const A=[];if(y.copyStyles){const L=S.getRootNode(),j=(L.constructor.name==="ShadowRoot"?L:i.current).querySelectorAll("style, link[rel='stylesheet']");for(let V=0;V{z.addEventListener("load",()=>N())})),b.head.appendChild(z)}}}Promise.all(A).then(()=>{m.contentWindow.print()})},[e,i,t]),d=M.useCallback(m=>{i.current.body.removeChild(m),e.current.restoreState(o.current||{}),o.current?.columns?.columnVisibilityModel||e.current.setColumnVisibilityModel(s.current),e.current.setState(v=>X({},v,{virtualization:l.current})),e.current.setRows(a.current),o.current=null,s.current={},a.current=[]},[e]),p={exportDataAsPrint:M.useCallback(async m=>{if(r.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(o.current=e.current.exportState(),s.current=Cf(e),a.current=e.current.getSortedRows().filter(y=>!y[VO]),t.pagination){const b={page:0,pageSize:Mle(e)};e.current.setState(w=>X({},w,{pagination:X({},w.pagination,{paginationModel:mz(w.pagination,"DataGridPro",b)})}))}l.current=e.current.state.virtualization,e.current.unstable_setVirtualization(!1),await c(m?.fields,m?.allColumns,m?.includeCheckboxes),u(m?.getRowsToExport??xUe),await LBt();const v=FBt(m?.fileName);v.onload=()=>{f(v,m),v.contentWindow.matchMedia("print").addEventListener("change",b=>{b.matches===!1&&d(v)})},i.current.body.appendChild(v)},[t,r,e,f,d,c,u])};Gn(e,p,"public");const g=M.useCallback((m,v)=>v.printOptions?.disableToolbarButton?m:[...m,{component:O.jsx(Pjt,{options:v.printOptions}),componentName:"printExport"}],[]);fo(e,"exportMenu",g)},NBt=(e,t,n)=>{const r=t.filterModel??t.initialState?.filter?.filterModel??UA();return X({},e,{filter:X({filterModel:Ele(r,t.disableMultipleColumnsFiltering,n)},h6e),visibleRowsLookup:{}})},zBt=e=>e.filteredRowsLookup;function iSe(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function jBt(){return Y4e(Object.values)}const BBt=(e,t)=>{const n=Ns(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Hs,changeEvent:"filterModelChange"});const r=M.useCallback(()=>{e.current.setState(k=>{const P=Hs(k,e.current.instanceId),I=e.current.getFilterState(P),R=X({},k,{filter:X({},k.filter,I)}),F=iSe(e,R);return X({},R,{visibleRowsLookup:F})}),e.current.publishEvent("filteredRowsSet")},[e]),i=M.useCallback((k,P)=>P==null||P.filterable===!1||t.disableColumnFilter?k:[...k,"columnMenuFilterItem"],[t.disableColumnFilter]),o=M.useCallback(()=>{r(),e.current.forceUpdate()},[e,r]),s=M.useCallback(k=>{const P=Hs(e),I=[...P.items],R=I.findIndex(F=>F.id===k.id);R===-1?I.push(k):I[R]=k,e.current.setFilterModel(X({},P,{items:I}),"upsertFilterItem")},[e]),a=M.useCallback(k=>{const P=Hs(e),I=[...P.items];k.forEach(R=>{const F=I.findIndex(A=>A.id===R.id);F===-1?I.push(R):I[F]=R}),e.current.setFilterModel(X({},P,{items:I}),"upsertFilterItems")},[e]),l=M.useCallback(k=>{const P=Hs(e),I=P.items.filter(R=>R.id!==k.id);I.length!==P.items.length&&e.current.setFilterModel(X({},P,{items:I}),"deleteFilterItem")},[e]),c=M.useCallback((k,P,I)=>{if(n.debug("Displaying filter panel"),k){const R=Hs(e),F=R.items.filter(j=>{if(j.value!==void 0)return!(Array.isArray(j.value)&&j.value.length===0);const U=e.current.getColumn(j.field).filterOperators?.find(N=>N.value===j.operator);return!(typeof U?.requiresFilterValue>"u"?!0:U?.requiresFilterValue)});let A;const L=F.find(j=>j.field===k),$=e.current.getColumn(k);L?A=F:t.disableMultipleColumnsFiltering?A=[ete({field:k,operator:$.filterOperators[0].value},e)]:A=[...F,ete({field:k,operator:$.filterOperators[0].value},e)],e.current.setFilterModel(X({},R,{items:A}))}e.current.showPreferences(iw.filters,P,I)},[e,n,t.disableMultipleColumnsFiltering]),u=M.useCallback(()=>{n.debug("Hiding filter panel"),e.current.hidePreferences()},[e,n]),f=M.useCallback(k=>{const P=Hs(e);P.logicOperator!==k&&e.current.setFilterModel(X({},P,{logicOperator:k}),"changeLogicOperator")},[e]),d=M.useCallback(k=>{const P=Hs(e);O0(P.quickFilterValues,k)||e.current.setFilterModel(X({},P,{quickFilterValues:[...k]}))},[e]),h=M.useCallback((k,P)=>{Hs(e)!==k&&(n.debug("Setting filter model"),e.current.updateControlState("filter",gwe(k,t.disableMultipleColumnsFiltering,e),P),e.current.unstable_applyFilters())},[e,n,t.disableMultipleColumnsFiltering]),p=M.useCallback(k=>{const P=Ele(k,t.disableMultipleColumnsFiltering,e),I=t.filterMode==="client"?OFt(P,e,t.disableEval):null,R=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:I,filterModel:P??UA()});return X({},R,{filterModel:P})},[t.disableMultipleColumnsFiltering,t.filterMode,t.disableEval,e]),g={setFilterLogicOperator:f,unstable_applyFilters:o,deleteFilterItem:l,upsertFilterItem:s,upsertFilterItems:a,setFilterModel:h,showFilterPanel:c,hideFilterPanel:u,setQuickFilterValues:d,ignoreDiacritics:t.ignoreDiacritics,getFilterState:p};Gn(e,g,"public");const m=M.useCallback((k,P)=>{const I=Hs(e);return I.items.forEach(F=>{delete F.fromInput}),!P.exportOnlyDirtyModels||t.filterModel!=null||t.initialState?.filter?.filterModel!=null||!O0(I,UA())?X({},k,{filter:{filterModel:I}}):k},[e,t.filterModel,t.initialState?.filter?.filterModel]),v=M.useCallback((k,P)=>{const I=P.stateToRestore.filter?.filterModel;return I==null?k:(e.current.updateControlState("filter",gwe(I,t.disableMultipleColumnsFiltering,e),"restoreState"),X({},k,{callbacks:[...k.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),y=M.useCallback((k,P)=>{if(P===iw.filters){const I=t.slots.filterPanel;return O.jsx(I,X({},t.slotProps?.filterPanel))}return k},[t.slots.filterPanel,t.slotProps?.filterPanel]),{getRowId:b}=t,w=od(jBt),S=M.useCallback(k=>{if(t.filterMode!=="client"||!k.isRowMatchingFilters||!k.filterModel.items.length&&!k.filterModel.quickFilterValues?.length)return h6e;const P=_f(e),I={},{isRowMatchingFilters:R}=k,F={},A={passingFilterItems:null,passingQuickFilterValues:null},L=w.current(e.current.state.rows.dataRowIdToModelLookup);for(let V=0;V{n.debug("onColUpdated - GridColumns changed, applying filters");const k=Hs(e),P=Ov(e),I=k.items.filter(R=>R.field&&P[R.field]);I.length{k==="filtering"&&e.current.unstable_applyFilters()},[e]),T=M.useCallback(()=>{e.current.setState(k=>X({},k,{visibleRowsLookup:iSe(e,k)})),e.current.forceUpdate()},[e]);Ft(e,"rowsSet",r),Ft(e,"columnsChange",_),Ft(e,"activeStrategyProcessorChange",E),Ft(e,"rowExpansionChange",T),Ft(e,"columnVisibilityModelChange",()=>{const k=Hs(e);k.quickFilterValues&&x6e(k)&&e.current.unstable_applyFilters()}),xD(()=>{e.current.unstable_applyFilters()}),lr(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,n,t.filterModel])},UBt=e=>X({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),VBt=(e,t)=>{const n=Ns(e,"useGridFocus"),r=M.useRef(null),i=e.current.rootElementRef.current!==null,o=M.useCallback((T,k)=>{T&&e.current.getRow(T.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(T.id,T.field),k)},[e]),s=M.useCallback((T,k)=>{const P=pc(e);P?.id===T&&P?.field===k||(e.current.setState(I=>(n.debug(`Focusing on cell with id=${T} and field=${k}`),X({},I,{tabIndex:{cell:{id:T,field:k},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:T,field:k},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(T)&&(P&&o(P,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(T,k))))},[e,n,o]),a=M.useCallback((T,k={})=>{const P=pc(e);o(P,k),e.current.setState(I=>(n.debug(`Focusing on column header with colIndex=${T}`),X({},I,{tabIndex:{columnHeader:{field:T},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:T},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,o]),l=M.useCallback((T,k={})=>{const P=pc(e);o(P,k),e.current.setState(I=>(n.debug(`Focusing on column header filter with colIndex=${T}`),X({},I,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:T},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:T},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,o]),c=M.useCallback((T,k,P={})=>{const I=pc(e);I&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(I.id,I.field),P),e.current.setState(R=>X({},R,{tabIndex:{columnGroupHeader:{field:T,depth:k},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:T,depth:k},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),u=M.useCallback(()=>q5(e),[e]),f=M.useCallback((T,k,P)=>{let I=e.current.getColumnIndex(k);const R=Mo(e),F=T0(e,{pagination:t.pagination,paginationMode:t.paginationMode}),A=PT(e),L=[].concat(A.top||[],F.rows,A.bottom||[]);let $=L.findIndex(z=>z.id===T);P==="right"?I+=1:P==="left"?I-=1:$+=1,I>=R.length?($+=1,$=0&&(I=R.length-1)),$=Mu($,0,L.length-1);const j=L[$];if(!j)return;const V=e.current.unstable_getCellColSpanInfo(j.id,I);V&&V.spannedByColSpan&&(P==="left"||P==="below"?I=V.leftVisibleCellIndex:P==="right"&&(I=V.rightVisibleCellIndex)),I=Mu(I,0,R.length-1);const U=R[I];e.current.setCellFocus(j.id,U.field)},[e,t.pagination,t.paginationMode]),d=M.useCallback(({id:T,field:k})=>{e.current.setCellFocus(T,k)},[e]),h=M.useCallback((T,k)=>{k.key==="Enter"||k.key==="Tab"||k.key==="Shift"||Z5(k.key)||e.current.setCellFocus(T.id,T.field)},[e]),p=M.useCallback(({field:T},k)=>{k.target===k.currentTarget&&e.current.setColumnHeaderFocus(T,k)},[e]),g=M.useCallback(({fields:T,depth:k},P)=>{if(P.target!==P.currentTarget)return;const I=q5(e);I!==null&&I.depth===k&&T.includes(I.field)||e.current.setColumnGroupHeaderFocus(T[0],k,P)},[e]),m=M.useCallback((T,k)=>{k.relatedTarget?.getAttribute("class")?.includes(ye.columnHeader)||(n.debug("Clearing focus"),e.current.setState(P=>X({},P,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),v=M.useCallback(T=>{r.current=T},[]),y=M.useCallback(T=>{const k=r.current;r.current=null;const P=pc(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:T,cell:k}))return;if(!P){k&&e.current.setCellFocus(k.id,k.field);return}k?.id===P.id&&k?.field===P.field||e.current.getCellElement(P.id,P.field)?.contains(T.target)||(k?e.current.setCellFocus(k.id,k.field):(e.current.setState(F=>X({},F,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),o(P,T)))},[e,o]),b=M.useCallback(T=>{if(T.cellMode==="view")return;const k=pc(e);(k?.id!==T.id||k?.field!==T.field)&&e.current.setCellFocus(T.id,T.field)},[e]),w=M.useCallback(()=>{const T=pc(e);if(T&&!e.current.getRow(T.id)){const k=T.id;let P=null;if(typeof k<"u"){const I=e.current.getRowElement(k),R=I?.dataset.rowindex?Number(I?.dataset.rowindex):0,F=T0(e,{pagination:t.pagination,paginationMode:t.paginationMode});P=F.rows[Mu(R,0,F.rows.length-1)]?.id??null}e.current.setState(I=>X({},I,{focus:{cell:P===null?null:{id:P,field:T.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[e,t.pagination,t.paginationMode]),S=ft(()=>{const T=pc(e);if(!T)return;const k=T0(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(k.rows.find(R=>R.id===T.id))return;const I=Mo(e);e.current.setState(R=>X({},R,{tabIndex:{cell:{id:k.rows[0].id,field:I[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),_={setCellFocus:s,setColumnHeaderFocus:a,setColumnHeaderFilterFocus:l},E={moveFocusToRelativeCell:f,setColumnGroupHeaderFocus:c,getColumnGroupHeaderFocus:u};Gn(e,_,"public"),Gn(e,E,"private"),M.useEffect(()=>{const T=ci(e.current.rootElementRef.current);return T.addEventListener("mouseup",y),()=>{T.removeEventListener("mouseup",y)}},[e,i,y]),Ft(e,"columnHeaderBlur",m),Ft(e,"cellDoubleClick",d),Ft(e,"cellMouseDown",v),Ft(e,"cellKeyDown",h),Ft(e,"cellModeChange",b),Ft(e,"columnHeaderFocus",p),Ft(e,"columnGroupHeaderFocus",g),Ft(e,"rowsSet",w),Ft(e,"paginationModelChange",S)},L9=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(et)return e-1;return null},F9=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e>t)return e-1}else if(!r&&e=0&&s(t.top||[]).concat(e.rows,t.bottom||[])),GBt=(e,t)=>{const n=Ns(e,"useGridKeyboardNavigation"),r=yi(),i=t.unstable_listView,o=M.useCallback(()=>HBt(e),[e]),s=t.signature!=="DataGrid"&&t.headerFilters,a=M.useCallback((v,y,b="left",w="up")=>{const S=Ob(e),_=e.current.unstable_getCellColSpanInfo(y,v);_&&_.spannedByColSpan&&(b==="left"?v=_.leftVisibleCellIndex:b==="right"&&(v=_.rightVisibleCellIndex));const E=i?GO(e.current.state).field:kT(e)[v],T=WBt(e,y,E,w),k=S.findIndex(P=>P.id===T);n.debug(`Navigating to cell row ${k}, col ${v}`),e.current.scrollToIndexes({colIndex:v,rowIndex:k}),e.current.setCellFocus(T,E)},[e,n,i]),l=M.useCallback((v,y)=>{n.debug(`Navigating to header col ${v}`),e.current.scrollToIndexes({colIndex:v});const b=e.current.getVisibleColumns()[v].field;e.current.setColumnHeaderFocus(b,y)},[e,n]),c=M.useCallback((v,y)=>{n.debug(`Navigating to header filter col ${v}`),e.current.scrollToIndexes({colIndex:v});const b=e.current.getVisibleColumns()[v].field;e.current.setColumnHeaderFilterFocus(b,y)},[e,n]),u=M.useCallback((v,y,b)=>{n.debug(`Navigating to header col ${v}`),e.current.scrollToIndexes({colIndex:v});const{field:w}=e.current.getVisibleColumns()[v];e.current.setColumnGroupHeaderFocus(w,y,b)},[e,n]),f=M.useCallback(v=>o()[v]?.id,[o]),d=M.useCallback((v,y)=>{const b=y.currentTarget.querySelector(`.${ye.columnHeaderTitleContainerContent}`);if(!!b&&b.contains(y.target)&&v.field!==IT.field)return;const S=o(),_=e.current.getViewportPageSize(),E=v.field?e.current.getColumnIndex(v.field):0,T=S.length>0?0:null,k=S.length-1,P=0,I=Mo(e).length-1,R=CD(e);let F=!0;switch(y.key){case"ArrowDown":{s?c(E,y):T!==null&&a(E,f(T));break}case"ArrowRight":{const A=F9({currentColIndex:E,firstColIndex:P,lastColIndex:I,isRtl:r});A!==null&&l(A,y);break}case"ArrowLeft":{const A=L9({currentColIndex:E,firstColIndex:P,lastColIndex:I,isRtl:r});A!==null&&l(A,y);break}case"ArrowUp":{R>0&&u(E,R-1,y);break}case"PageDown":{T!==null&&k!==null&&a(E,f(Math.min(T+_,k)));break}case"Home":{l(P,y);break}case"End":{l(I,y);break}case"Enter":{(y.ctrlKey||y.metaKey)&&e.current.toggleColumnMenu(v.field);break}case" ":break;default:F=!1}F&&y.preventDefault()},[e,o,s,c,a,f,r,l,u]),h=M.useCallback((v,y)=>{const b=lNt(e)===v.field,w=cNt(e)===v.field;if(b||w||!Z5(y.key))return;const S=o(),_=e.current.getViewportPageSize(),E=v.field?e.current.getColumnIndex(v.field):0,T=0,k=S.length-1,P=0,I=Mo(e).length-1;let R=!0;switch(y.key){case"ArrowDown":{const F=f(T);F!=null&&a(E,F);break}case"ArrowRight":{const F=F9({currentColIndex:E,firstColIndex:P,lastColIndex:I,isRtl:r});F!==null&&c(F,y);break}case"ArrowLeft":{const F=L9({currentColIndex:E,firstColIndex:P,lastColIndex:I,isRtl:r});F!==null?c(F,y):e.current.setColumnHeaderFilterFocus(v.field,y);break}case"ArrowUp":{l(E,y);break}case"PageDown":{k!==null&&a(E,f(Math.min(T+_,k)));break}case"Home":{c(P,y);break}case"End":{c(I,y);break}case" ":break;default:R=!1}R&&y.preventDefault()},[e,o,c,r,l,a,f]),p=M.useCallback((v,y)=>{const b=q5(e);if(b===null)return;const{field:w,depth:S}=b,{fields:_,depth:E,maxDepth:T}=v,k=o(),P=e.current.getViewportPageSize(),I=e.current.getColumnIndex(w),R=w?e.current.getColumnIndex(w):0,F=0,A=k.length-1,L=0,$=Mo(e).length-1;let j=!0;switch(y.key){case"ArrowDown":{E===T-1?l(I,y):u(I,S+1,y);break}case"ArrowUp":{E>0&&u(I,S-1,y);break}case"ArrowRight":{const V=_.length-_.indexOf(w)-1;I+V+1<=$&&u(I+V+1,S,y);break}case"ArrowLeft":{const V=_.indexOf(w);I-V-1>=L&&u(I-V-1,S,y);break}case"PageDown":{A!==null&&a(R,f(Math.min(F+P,A)));break}case"Home":{u(L,S,y);break}case"End":{u($,S,y);break}case" ":break;default:j=!1}j&&y.preventDefault()},[e,o,l,u,a,f]),g=M.useCallback((v,y)=>{if(ED(y))return;const b=e.current.getCellParams(v.id,v.field);if(b.cellMode===ni.Edit||!Z5(y.key)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:y,cell:b}))return;const S=o();if(S.length===0)return;const _=e.current.getViewportPageSize(),E=i?()=>0:e.current.getColumnIndex,T=v.field?E(v.field):0,k=S.findIndex($=>$.id===v.id),P=0,I=S.length-1,R=0,A=(i?[GO(e.current.state)]:Mo(e)).length-1;let L=!0;switch(y.key){case"ArrowDown":{kP?a(T,f(k-1)):s?c(T,y):l(T,y);break}case"ArrowRight":{const $=F9({currentColIndex:T,firstColIndex:R,lastColIndex:A,isRtl:r});$!==null&&a($,f(k),r?"left":"right");break}case"ArrowLeft":{const $=L9({currentColIndex:T,firstColIndex:R,lastColIndex:A,isRtl:r});$!==null&&a($,f(k),r?"right":"left");break}case"Tab":{y.shiftKey&&T>R?a(T-1,f(k),"left"):!y.shiftKey&&T=P?a(T,f($)):l(T,y);break}case"Home":{y.ctrlKey||y.metaKey||y.shiftKey?a(R,f(P)):a(R,f(k));break}case"End":{y.ctrlKey||y.metaKey||y.shiftKey?a(A,f(I)):a(A,f(k));break}default:L=!1}L&&y.preventDefault()},[e,o,r,a,f,s,c,l,i]),m=M.useCallback((v,{event:y})=>y.key===" "?!1:v,[]);fo(e,"canStartEditing",m),Ft(e,"columnHeaderKeyDown",d),Ft(e,"headerFilterKeyDown",h),Ft(e,"columnGroupHeaderKeyDown",p),Ft(e,"cellKeyDown",g)},qBt=(e,t)=>{const n=Ns(e,"useGridRowCount"),r=ut(e,Ale),i=ut(e,MC),o=ut(e,H2),s=ut(e,tl),a=od(()=>tl(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:MC,changeEvent:"rowCountChange"});const c={setRowCount:M.useCallback(p=>{i!==p&&(n.debug("Setting 'rowCount' to",p),e.current.setState(g=>X({},g,{pagination:X({},g.pagination,{rowCount:p})})))},[e,n,i])};Gn(e,c,"public");const u=M.useCallback((p,g)=>{const m=MC(e);return!g.exportOnlyDirtyModels||t.rowCount!=null||t.initialState?.pagination?.rowCount!=null?X({},p,{pagination:X({},p.pagination,{rowCount:m})}):p},[e,t.rowCount,t.initialState?.pagination?.rowCount]),f=M.useCallback((p,g)=>{const m=g.stateToRestore.pagination?.rowCount?g.stateToRestore.pagination.rowCount:MC(e);return e.current.setState(v=>X({},v,{pagination:X({},v.pagination,{rowCount:m})})),p},[e]);fo(e,"exportState",u),fo(e,"restoreState",f);const d=M.useCallback(p=>{t.paginationMode==="client"||!a.current||p.pageSize!==a.current&&(a.current=p.pageSize,i===-1&&e.current.setPage(0))},[t.paginationMode,a,i,e]);Ft(e,"paginationModelChange",d),M.useEffect(()=>{t.paginationMode==="client"?e.current.setRowCount(r):t.rowCount!=null&&e.current.setRowCount(t.rowCount)},[e,t.paginationMode,r,t.rowCount]);const h=o.hasNextPage===!1;M.useEffect(()=>{h&&i===-1&&e.current.setRowCount(s.pageSize*s.page+r)},[e,r,h,i,s])},XBt=(e,t)=>{const n=Ns(e,"useGridPaginationMeta"),r=ut(e,H2);e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:H2,changeEvent:"paginationMetaChange"});const o={setPaginationMeta:M.useCallback(l=>{r!==l&&(n.debug("Setting 'paginationMeta' to",l),e.current.setState(c=>X({},c,{pagination:X({},c.pagination,{meta:l})})))},[e,n,r])};Gn(e,o,"public");const s=M.useCallback((l,c)=>{const u=H2(e);return!c.exportOnlyDirtyModels||t.paginationMeta!=null||t.initialState?.pagination?.meta!=null?X({},l,{pagination:X({},l.pagination,{meta:u})}):l},[e,t.paginationMeta,t.initialState?.pagination?.meta]),a=M.useCallback((l,c)=>{const u=c.stateToRestore.pagination?.meta?c.stateToRestore.pagination.meta:H2(e);return e.current.setState(f=>X({},f,{pagination:X({},f.pagination,{meta:u})})),l},[e]);fo(e,"exportState",s),fo(e,"restoreState",a),M.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])},YBt=(e,t)=>{const n=X({},F6e(t.autoPageSize),t.paginationModel??t.initialState?.pagination?.paginationModel);$6e(n.pageSize,t.signature);const r=t.rowCount??t.initialState?.pagination?.rowCount??(t.paginationMode==="client"?e.rows?.totalRowCount:void 0),i=t.paginationMeta??t.initialState?.pagination?.meta??{};return X({},e,{pagination:X({},e.pagination,{paginationModel:n,rowCount:r,meta:i,enabled:t.pagination===!0,paginationMode:t.paginationMode})})},QBt=(e,t)=>{XBt(e,t),DBt(e,t),qBt(e,t)},KBt=(e,t)=>X({},e,{preferencePanel:t.initialState?.preferencePanel??{open:!1}}),ZBt=(e,t)=>{const n=Ns(e,"useGridPreferencesPanel"),r=M.useCallback(()=>{e.current.setState(a=>{if(!a.preferencePanel.open)return a;n.debug("Hiding Preferences Panel");const l=WA(a);return e.current.publishEvent("preferencePanelClose",{openedPanelValue:l.openedPanelValue}),X({},a,{preferencePanel:{open:!1}})})},[e,n]),i=M.useCallback((a,l,c)=>{n.debug("Opening Preferences Panel"),e.current.setState(u=>X({},u,{preferencePanel:X({},u.preferencePanel,{open:!0,openedPanelValue:a,panelId:l,labelId:c})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:a})},[n,e]);Gn(e,{showPreferences:i,hidePreferences:r},"public");const o=M.useCallback((a,l)=>{const c=WA(e.current.state);return!l.exportOnlyDirtyModels||t.initialState?.preferencePanel!=null||c.open?X({},a,{preferencePanel:c}):a},[e,t.initialState?.preferencePanel]),s=M.useCallback((a,l)=>{const c=l.stateToRestore.preferencePanel;return c!=null&&e.current.setState(u=>X({},u,{preferencePanel:c})),a},[e]);fo(e,"exportState",o),fo(e,"restoreState",s)},ste=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;default:return""}},JBt=["id","field"],e4t=["id","field"],t4t=(e,t)=>{const[n,r]=M.useState({}),i=M.useRef(n),o=M.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:a,cellModesModel:l,onCellModesModelChange:c}=t,u=L=>(...$)=>{t.editMode===Jp.Cell&&L(...$)},f=M.useCallback((L,$)=>{const j=e.current.getCellParams(L,$);if(!e.current.isCellEditable(j))throw new Error(`MUI X: The cell with id=${L} and field=${$} is not editable.`)},[e]),d=M.useCallback((L,$,j)=>{if(e.current.getCellMode(L,$)!==j)throw new Error(`MUI X: The cell with id=${L} and field=${$} is not in ${j} mode.`)},[e]),h=M.useCallback((L,$)=>{if(!L.isEditable||L.cellMode===ni.Edit)return;const j=X({},L,{reason:sm.cellDoubleClick});e.current.publishEvent("cellEditStart",j,$)},[e]),p=M.useCallback((L,$)=>{if(L.cellMode===ni.View||e.current.getCellMode(L.id,L.field)===ni.View)return;const j=X({},L,{reason:Ld.cellFocusOut});e.current.publishEvent("cellEditStop",j,$)},[e]),g=M.useCallback((L,$)=>{if(L.cellMode===ni.Edit){if($.which===229)return;let j;if($.key==="Escape"?j=Ld.escapeKeyDown:$.key==="Enter"?j=Ld.enterKeyDown:$.key==="Tab"&&(j=$.shiftKey?Ld.shiftTabKeyDown:Ld.tabKeyDown,$.preventDefault()),j){const V=X({},L,{reason:j});e.current.publishEvent("cellEditStop",V,$)}}else if(L.isEditable){let j;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:$,cellParams:L,editMode:"cell"}))return;if(hUe($)?j=sm.printableKeyDown:gUe($)?j=sm.pasteKeyDown:$.key==="Enter"?j=sm.enterKeyDown:($.key==="Backspace"||$.key==="Delete")&&(j=sm.deleteKeyDown),j){const U=X({},L,{reason:j,key:$.key});e.current.publishEvent("cellEditStart",U,$)}}},[e]),m=M.useCallback(L=>{const{id:$,field:j,reason:V}=L,U={id:$,field:j};(V===sm.printableKeyDown||V===sm.deleteKeyDown||V===sm.pasteKeyDown)&&(U.deleteValue=!0),e.current.startCellEditMode(U)},[e]),v=M.useCallback(L=>{const{id:$,field:j,reason:V}=L;e.current.runPendingEditCellValueMutation($,j);let U;V===Ld.enterKeyDown?U="below":V===Ld.tabKeyDown?U="right":V===Ld.shiftTabKeyDown&&(U="left");const z=V==="escapeKeyDown";e.current.stopCellEditMode({id:$,field:j,ignoreModifications:z,cellToFocusAfter:U})},[e]),y=L=>async(...$)=>{if(L){const{id:j,field:V}=$[0];e.current.state.editRows[j][V]?.error||L(...$)}};Ft(e,"cellDoubleClick",u(h)),Ft(e,"cellFocusOut",u(p)),Ft(e,"cellKeyDown",u(g)),Ft(e,"cellEditStart",u(m)),Ft(e,"cellEditStop",u(v)),ii(e,"cellEditStart",t.onCellEditStart),ii(e,"cellEditStop",y(t.onCellEditStop));const b=M.useCallback((L,$)=>{const j=Ps(e.current.state);return j[L]&&j[L][$]?ni.Edit:ni.View},[e]),w=ft(L=>{const $=L!==t.cellModesModel;c&&$&&c(L,{api:e.current}),!(t.cellModesModel&&$)&&(r(L),i.current=L,e.current.publishEvent("cellModesModelChange",L))}),S=M.useCallback((L,$,j)=>{const V=X({},i.current);if(j!==null)V[L]=X({},V[L],{[$]:X({},j)});else{const U=V[L],z=st(U,[$].map(q1));V[L]=z,Object.keys(V[L]).length===0&&delete V[L]}w(V)},[w]),_=M.useCallback((L,$,j)=>{e.current.setState(V=>{const U=X({},V.editRows);return j!==null?U[L]=X({},U[L],{[$]:X({},j)}):(delete U[L][$],Object.keys(U[L]).length===0&&delete U[L]),X({},V,{editRows:U})}),e.current.forceUpdate()},[e]),E=M.useCallback(L=>{const{id:$,field:j}=L,V=st(L,JBt);f($,j),d($,j,ni.View),S($,j,X({mode:ni.Edit},V))},[f,d,S]),T=ft(async L=>{const{id:$,field:j,deleteValue:V,initialValue:U}=L,z=e.current.getCellValue($,j);let N=z;V?N=ste(e.current.getColumn(j)):U&&(N=U);const B=e.current.getColumn(j),H=!!B.preProcessEditCellProps&&V;let Q={value:N,error:!1,isProcessingProps:H};if(_($,j,Q),e.current.setCellFocus($,j),H&&(Q=await Promise.resolve(B.preProcessEditCellProps({id:$,row:e.current.getRow($),props:Q,hasChanged:N!==z})),e.current.getCellMode($,j)===ni.Edit)){const Y=Ps(e.current.state);_($,j,X({},Q,{value:Y[$][j].value,isProcessingProps:!1}))}}),k=M.useCallback(L=>{const{id:$,field:j}=L,V=st(L,e4t);d($,j,ni.Edit),S($,j,X({mode:ni.View},V))},[d,S]),P=ft(async L=>{const{id:$,field:j,ignoreModifications:V,cellToFocusAfter:U="none"}=L;d($,j,ni.Edit),e.current.runPendingEditCellValueMutation($,j);const z=()=>{_($,j,null),S($,j,null),U!=="none"&&e.current.moveFocusToRelativeCell($,j,U)};if(V){z();return}const N=Ps(e.current.state),{error:B,isProcessingProps:H}=N[$][j];if(B||H){o.current[$][j].mode=ni.Edit,S($,j,{mode:ni.Edit});return}const Q=e.current.getRowWithUpdatedValuesFromCellEditing($,j);if(s){const Y=Z=>{o.current[$][j].mode=ni.Edit,S($,j,{mode:ni.Edit}),a&&a(Z)};try{const Z=e.current.getRow($);Promise.resolve(s(Q,Z,{rowId:$})).then(ge=>{e.current.updateRows([ge]),z()}).catch(Y)}catch(Z){Y(Z)}}else e.current.updateRows([Q]),z()}),I=M.useCallback(async L=>{const{id:$,field:j,value:V,debounceMs:U,unstable_skipValueParser:z}=L;f($,j),d($,j,ni.Edit);const N=e.current.getColumn(j),B=e.current.getRow($);let H=V;N.valueParser&&!z&&(H=N.valueParser(V,B,N,e));let Q=Ps(e.current.state),Y=X({},Q[$][j],{value:H,changeReason:U?"debouncedSetEditCellValue":"setEditCellValue"});if(N.preProcessEditCellProps){const Z=V!==Q[$][j].value;Y=X({},Y,{isProcessingProps:!0}),_($,j,Y),Y=await Promise.resolve(N.preProcessEditCellProps({id:$,row:B,props:Y,hasChanged:Z}))}return e.current.getCellMode($,j)===ni.View?!1:(Q=Ps(e.current.state),Y=X({},Y,{isProcessingProps:!1}),Y.value=N.preProcessEditCellProps?Q[$][j].value:H,_($,j,Y),Q=Ps(e.current.state),!Q[$]?.[j]?.error)},[e,f,d,_]),R=M.useCallback((L,$)=>{const j=e.current.getColumn($),V=Ps(e.current.state),U=e.current.getRow(L);if(!V[L]||!V[L][$])return e.current.getRow(L);const{value:z}=V[L][$];return j.valueSetter?j.valueSetter(z,U,j,e):X({},U,{[$]:z})},[e]),F={getCellMode:b,startCellEditMode:E,stopCellEditMode:k},A={setCellEditingEditCellValue:I,getRowWithUpdatedValuesFromCellEditing:R};Gn(e,F,"public"),Gn(e,A,"private"),M.useEffect(()=>{l&&w(l)},[l,w]),lr(()=>{const L=_f(e),$=o.current;o.current=u6e(n),Object.entries(n).forEach(([j,V])=>{Object.entries(V).forEach(([U,z])=>{const N=$[j]?.[U]?.mode||ni.View,B=L[j]?e.current.getRowId(L[j]):j;z.mode===ni.Edit&&N===ni.View?T(X({id:B,field:U},z)):z.mode===ni.View&&N===ni.Edit&&P(X({id:B,field:U},z))})})},[e,n,T,P])},n4t=["id"],r4t=["id"],i4t=(e,t)=>{const[n,r]=M.useState({}),i=M.useRef(n),o=M.useRef({}),s=M.useRef({}),a=M.useRef(void 0),l=M.useRef(null),{processRowUpdate:c,onProcessRowUpdateError:u,rowModesModel:f,onRowModesModelChange:d}=t,h=z=>(...N)=>{t.editMode===Jp.Row&&z(...N)},p=M.useCallback((z,N)=>{const B=e.current.getCellParams(z,N);if(!e.current.isCellEditable(B))throw new Error(`MUI X: The cell with id=${z} and field=${N} is not editable.`)},[e]),g=M.useCallback((z,N)=>{if(e.current.getRowMode(z)!==N)throw new Error(`MUI X: The row with id=${z} is not in ${N} mode.`)},[e]),m=M.useCallback(z=>{const N=Ps(e.current.state);return Object.values(N[z]).some(B=>B.error)},[e]),v=M.useCallback((z,N)=>{if(!z.isEditable||e.current.getRowMode(z.id)===qi.Edit)return;const B=e.current.getRowParams(z.id),H=X({},B,{field:z.field,reason:My.cellDoubleClick});e.current.publishEvent("rowEditStart",H,N)},[e]),y=M.useCallback(z=>{l.current=z},[]),b=M.useCallback((z,N)=>{z.isEditable&&e.current.getRowMode(z.id)!==qi.View&&(l.current=null,a.current=setTimeout(()=>{if(l.current?.id!==z.id){if(!e.current.getRow(z.id)||e.current.getRowMode(z.id)===qi.View||m(z.id))return;const B=e.current.getRowParams(z.id),H=X({},B,{field:z.field,reason:Yh.rowFocusOut});e.current.publishEvent("rowEditStop",H,N)}}))},[e,m]);M.useEffect(()=>()=>{clearTimeout(a.current)},[]);const w=M.useCallback((z,N)=>{if(z.cellMode===qi.Edit){if(N.which===229)return;let B;if(N.key==="Escape")B=Yh.escapeKeyDown;else if(N.key==="Enter")B=Yh.enterKeyDown;else if(N.key==="Tab"){const H=kT(e).filter(Q=>e.current.getColumn(Q).type===uU?!0:e.current.isCellEditable(e.current.getCellParams(z.id,Q)));if(N.shiftKey?z.field===H[0]&&(B=Yh.shiftTabKeyDown):z.field===H[H.length-1]&&(B=Yh.tabKeyDown),N.preventDefault(),!B){const Q=H.findIndex(Z=>Z===z.field),Y=H[N.shiftKey?Q-1:Q+1];e.current.setCellFocus(z.id,Y)}}if(B){if(B!==Yh.escapeKeyDown&&m(z.id))return;const H=X({},e.current.getRowParams(z.id),{reason:B,field:z.field});e.current.publishEvent("rowEditStop",H,N)}}else if(z.isEditable){let B;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:N,cellParams:z,editMode:"row"}))return;if(hUe(N)||gUe(N)?B=My.printableKeyDown:N.key==="Enter"?B=My.enterKeyDown:(N.key==="Backspace"||N.key==="Delete")&&(B=My.deleteKeyDown),B){const Q=e.current.getRowParams(z.id),Y=X({},Q,{field:z.field,reason:B});e.current.publishEvent("rowEditStart",Y,N)}}},[e,m]),S=M.useCallback(z=>{const{id:N,field:B,reason:H}=z,Q={id:N,fieldToFocus:B};(H===My.printableKeyDown||H===My.deleteKeyDown)&&(Q.deleteValue=!!B),e.current.startRowEditMode(Q)},[e]),_=M.useCallback(z=>{const{id:N,reason:B,field:H}=z;e.current.runPendingEditCellValueMutation(N);let Q;B===Yh.enterKeyDown?Q="below":B===Yh.tabKeyDown?Q="right":B===Yh.shiftTabKeyDown&&(Q="left");const Y=B==="escapeKeyDown";e.current.stopRowEditMode({id:N,ignoreModifications:Y,field:H,cellToFocusAfter:Q})},[e]);Ft(e,"cellDoubleClick",h(v)),Ft(e,"cellFocusIn",h(y)),Ft(e,"cellFocusOut",h(b)),Ft(e,"cellKeyDown",h(w)),Ft(e,"rowEditStart",h(S)),Ft(e,"rowEditStop",h(_)),ii(e,"rowEditStart",t.onRowEditStart),ii(e,"rowEditStop",t.onRowEditStop);const E=M.useCallback(z=>iUe(e,{rowId:z,editMode:t.editMode})?qi.Edit:qi.View,[e,t.editMode]),T=ft(z=>{const N=z!==t.rowModesModel;d&&N&&d(z,{api:e.current}),!(t.rowModesModel&&N)&&(r(z),i.current=z,e.current.publishEvent("rowModesModelChange",z))}),k=M.useCallback((z,N)=>{const B=X({},i.current);N!==null?B[z]=X({},N):delete B[z],T(B)},[T]),P=M.useCallback((z,N)=>{e.current.setState(B=>{const H=X({},B.editRows);return N!==null?H[z]=N:delete H[z],X({},B,{editRows:H})}),e.current.forceUpdate()},[e]),I=M.useCallback((z,N,B)=>{e.current.setState(H=>{const Q=X({},H.editRows);return B!==null?Q[z]=X({},Q[z],{[N]:X({},B)}):(delete Q[z][N],Object.keys(Q[z]).length===0&&delete Q[z]),X({},H,{editRows:Q})}),e.current.forceUpdate()},[e]),R=M.useCallback(z=>{const{id:N}=z,B=st(z,n4t);g(N,qi.View),k(N,X({mode:qi.Edit},B))},[g,k]),F=ft(z=>{const{id:N,fieldToFocus:B,deleteValue:H,initialValue:Q}=z,Y=e.current.getRow(N),Z=Ff(e),ge=Z.reduce((ne,ie)=>{const fe=ie.field;if(!e.current.getCellParams(N,fe).isEditable)return ne;const se=e.current.getColumn(fe);let ue=e.current.getCellValue(N,fe);return B===fe&&(H||Q)&&(H?ue=ste(se):Q&&(ue=Q)),ne[fe]={value:ue,error:!1,isProcessingProps:se.editable&&!!se.preProcessEditCellProps&&H},ne},{});s.current[N]=Y,P(N,ge),B&&e.current.setCellFocus(N,B),Z.filter(ne=>e.current.getCellParams(N,ne.field).isEditable&&ne.editable&&!!ne.preProcessEditCellProps&&H).forEach(ne=>{const ie=ne.field,fe=e.current.getCellValue(N,ie),ve=H?ste(ne):Q??fe;Promise.resolve(ne.preProcessEditCellProps({id:N,row:Y,props:ge[ie],hasChanged:ve!==fe})).then(se=>{if(e.current.getRowMode(N)===qi.Edit){const ue=Ps(e.current.state);I(N,ie,X({},se,{value:ue[N][ie].value,isProcessingProps:!1}))}})})}),A=M.useCallback(z=>{const{id:N}=z,B=st(z,r4t);g(N,qi.Edit),k(N,X({mode:qi.View},B))},[g,k]),L=ft(z=>{const{id:N,ignoreModifications:B,field:H,cellToFocusAfter:Q="none"}=z;e.current.runPendingEditCellValueMutation(N);const Y=()=>{Q!=="none"&&H&&e.current.moveFocusToRelativeCell(N,H,Q),P(N,null),k(N,null),delete s.current[N]};if(B){Y();return}const Z=Ps(e.current.state),ge=s.current[N];if(Object.values(Z[N]).some(fe=>fe.isProcessingProps)){o.current[N].mode=qi.Edit;return}if(m(N)){o.current[N].mode=qi.Edit,k(N,{mode:qi.Edit});return}const ie=e.current.getRowWithUpdatedValuesFromRowEditing(N);if(c){const fe=ve=>{o.current[N]&&(o.current[N].mode=qi.Edit,k(N,{mode:qi.Edit})),u&&u(ve)};try{Promise.resolve(c(ie,ge,{rowId:N})).then(ve=>{e.current.updateRows([ve]),Y()}).catch(fe)}catch(ve){fe(ve)}}else e.current.updateRows([ie]),Y()}),$=M.useCallback(z=>{const{id:N,field:B,value:H,debounceMs:Q,unstable_skipValueParser:Y}=z;p(N,B);const Z=e.current.getColumn(B),ge=e.current.getRow(N);let ne=H;Z.valueParser&&!Y&&(ne=Z.valueParser(H,ge,Z,e));let ie=Ps(e.current.state),fe=X({},ie[N][B],{value:ne,changeReason:Q?"debouncedSetEditCellValue":"setEditCellValue"});return Z.preProcessEditCellProps||I(N,B,fe),new Promise(ve=>{const se=[];if(Z.preProcessEditCellProps){const ue=fe.value!==ie[N][B].value;fe=X({},fe,{isProcessingProps:!0}),I(N,B,fe);const G=ie[N],ce=st(G,[B].map(q1)),pe=Promise.resolve(Z.preProcessEditCellProps({id:N,row:ge,props:fe,hasChanged:ue,otherFieldsProps:ce})).then(J=>{if(e.current.getRowMode(N)===qi.View){ve(!1);return}ie=Ps(e.current.state),J=X({},J,{isProcessingProps:!1}),J.value=Z.preProcessEditCellProps?ie[N][B].value:ne,I(N,B,J)});se.push(pe)}Object.entries(ie[N]).forEach(([ue,G])=>{if(ue===B)return;const ce=e.current.getColumn(ue);if(!ce.preProcessEditCellProps)return;G=X({},G,{isProcessingProps:!0}),I(N,ue,G),ie=Ps(e.current.state);const pe=ie[N],J=st(pe,[ue].map(q1)),te=Promise.resolve(ce.preProcessEditCellProps({id:N,row:ge,props:G,hasChanged:!1,otherFieldsProps:J})).then(ae=>{if(e.current.getRowMode(N)===qi.View){ve(!1);return}ae=X({},ae,{isProcessingProps:!1}),I(N,ue,ae)});se.push(te)}),Promise.all(se).then(()=>{e.current.getRowMode(N)===qi.Edit?(ie=Ps(e.current.state),ve(!ie[N][B].error)):ve(!1)})})},[e,p,I]),j=M.useCallback(z=>{const N=Ps(e.current.state),B=e.current.getRow(z);if(!N[z])return e.current.getRow(z);let H=X({},s.current[z],B);return Object.entries(N[z]).forEach(([Q,Y])=>{const Z=e.current.getColumn(Q);Z?.valueSetter?H=Z.valueSetter(Y.value,H,Z,e):H[Q]=Y.value}),H},[e]),V={getRowMode:E,startRowEditMode:R,stopRowEditMode:A},U={setRowEditingEditCellValue:$,getRowWithUpdatedValuesFromRowEditing:j};Gn(e,V,"public"),Gn(e,U,"private"),M.useEffect(()=>{f&&T(f)},[f,T]),lr(()=>{const z=_f(e),N=o.current;o.current=u6e(n);const B=new Set([...Object.keys(n),...Object.keys(N)]);Array.from(B).forEach(H=>{const Q=n[H]??{mode:qi.View},Y=N[H]?.mode||qi.View,Z=z[H]?e.current.getRowId(z[H]):H;Q.mode===qi.Edit&&Y===qi.View?F(X({id:Z},Q)):Q.mode===qi.View&&Y===qi.Edit&&L(X({id:Z},Q))})},[e,n,F,L])},o4t=e=>X({},e,{editRows:{}}),s4t=(e,t)=>{t4t(e,t),i4t(e,t);const n=M.useRef({}),{isCellEditable:r}=t,i=M.useCallback(d=>WO(d.rowNode)||!d.colDef.editable||!d.colDef.renderEditCell?!1:r?r(d):!0,[r]),o=(d,h,p,g)=>{if(!p){g();return}if(n.current[d]||(n.current[d]={}),n.current[d][h]){const[y]=n.current[d][h];clearTimeout(y)}const m=()=>{const[y]=n.current[d][h];clearTimeout(y),g(),delete n.current[d][h]},v=setTimeout(()=>{g(),delete n.current[d][h]},p);n.current[d][h]=[v,m]};M.useEffect(()=>{const d=n.current;return()=>{Object.entries(d).forEach(([h,p])=>{Object.keys(p).forEach(g=>{const[m]=d[h][g];clearTimeout(m),delete d[h][g]})})}},[]);const s=M.useCallback((d,h)=>{if(n.current[d]){if(!h)Object.keys(n.current[d]).forEach(p=>{const[,g]=n.current[d][p];g()});else if(n.current[d][h]){const[,p]=n.current[d][h];p()}}},[]),a=M.useCallback(d=>{const{id:h,field:p,debounceMs:g}=d;return new Promise(m=>{o(h,p,g,async()=>{const v=t.editMode===Jp.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(h,p)===ni.Edit){const y=await v(d);m(y)}})})},[e,t.editMode]),l=M.useCallback((d,h)=>t.editMode===Jp.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(d,h):e.current.getRowWithUpdatedValuesFromRowEditing(d),[e,t.editMode]),c=M.useCallback((d,h)=>Ps(e.current.state)[d]?.[h]??null,[e]),u={isCellEditable:i,setEditCellValue:a,getRowWithUpdatedValues:l,unstable_getEditCellMeta:c},f={runPendingEditCellValueMutation:s};Gn(e,u,"public"),Gn(e,f,"private")},a4t=(e,t,n)=>{const r=!!t.unstable_dataSource;return n.current.caches.rows=hz({rows:r?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),X({},e,{rows:S6e({apiRef:n,rowCountProp:t.rowCount,loadingProp:r?!0:t.loading,previousTree:null,previousTreeDepths:null})})},l4t=(e,t)=>{const n=Ns(e,"useGridRows"),r=M.useRef(Date.now()),i=M.useRef(t.rowCount),o=zl(),s=M.useCallback(L=>{const $=_f(e)[L];if($)return $;const j=e.current.getRowNode(L);return j&&WO(j)?{[VO]:L}:null},[e]),a=M.useCallback(L=>_D(e.current.state,L),[e]),l=M.useCallback(({cache:L,throttle:$})=>{const j=()=>{r.current=Date.now(),e.current.setState(U=>X({},U,{rows:S6e({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:ps(e),previousTreeDepths:fwe(e),previousGroupsToFetch:rFt(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(o.clear(),e.current.caches.rows=L,!$){j();return}const V=t.throttleRowsMs-(Date.now()-r.current);if(V>0){o.start(V,j);return}j()},[t.throttleRowsMs,t.rowCount,t.loading,e,o]),c=M.useCallback(L=>{n.debug(`Updating all rows, new length ${L.length}`);const $=hz({rows:L,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),j=e.current.caches.rows;$.rowsBeforePartialUpdates=j.rowsBeforePartialUpdates,l({cache:$,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,l,e]),u=M.useCallback(L=>{if(t.signature===Lf.DataGrid&&L.length>1)throw new Error(["MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` +`));const $=Swe(e,L,t.getRowId),j=wwe({updates:$,getRowId:t.getRowId,previousCache:e.current.caches.rows});l({cache:j,throttle:!0})},[t.signature,t.getRowId,l,e]),f=M.useCallback((L,$)=>{const j=Swe(e,L,t.getRowId),V=wwe({updates:j,getRowId:t.getRowId,previousCache:e.current.caches.rows,groupKeys:$??[]});l({cache:V,throttle:!1})},[t.getRowId,l,e]),d=M.useCallback(L=>{L!==t.loading&&(n.debug(`Setting loading to ${L}`),e.current.setState($=>X({},$,{rows:X({},$.rows,{loading:L})})),e.current.caches.rows.loadingPropBeforePartialUpdates=L)},[t.loading,e,n]),h=M.useCallback(()=>{const L=W2(e),$=_f(e);return new Map(L.map(j=>[j,$[j]??{}]))},[e]),p=M.useCallback(()=>bD(e),[e]),g=M.useCallback(()=>W2(e),[e]),m=M.useCallback(L=>{const $=e.current.getRow(L),{rowToIndexMap:j}=T0(e);return j.get($)},[e]),v=M.useCallback((L,$)=>{const j=e.current.getRowNode(L);if(!j)throw new Error(`MUI X: No row with id #${L} found.`);if(j.type!=="group")throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const V=X({},j,{childrenExpanded:$});e.current.setState(U=>X({},U,{rows:X({},U.rows,{tree:X({},U.rows.tree,{[L]:V})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",V)},[e]),y=M.useCallback(L=>ps(e)[L]??null,[e]),b=M.useCallback(({skipAutoGeneratedRows:L=!0,groupId:$,applySorting:j,applyFiltering:V})=>{const U=ps(e);let z;if(j){const N=U[$];if(!N)return[];const B=AT(e);z=[];const H=B.findIndex(Q=>Q===$)+1;for(let Q=H;QN.depth;Q+=1){const Y=B[Q];(!L||!WO(U[Y]))&&z.push(Y)}}else z=Ple(U,$,L);if(V){const N=RT(e);z=z.filter(B=>N[B]!==!1)}return z},[e]),w=M.useCallback((L,$)=>{const j=e.current.getRowNode(L);if(!j)throw new Error(`MUI X: No row with id #${L} found.`);if(j.parent!==_a)throw new Error("MUI X: The row reordering do not support reordering of grouped rows yet.");if(j.type!=="leaf")throw new Error("MUI X: The row reordering do not support reordering of footer or grouping rows.");e.current.setState(V=>{const U=ps(V,e.current.instanceId)[_a],z=U.children,N=z.findIndex(H=>H===L);if(N===-1||N===$)return V;n.debug(`Moving row ${L} to index ${$}`);const B=[...z];return B.splice($,0,B.splice(N,1)[0]),X({},V,{rows:X({},V.rows,{tree:X({},V.rows.tree,{[_a]:X({},U,{children:B})})})})}),e.current.publishEvent("rowsSet")},[e,n]),S=M.useCallback((L,$)=>{if(t.signature===Lf.DataGrid&&$.length>1)throw new Error(["MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` +`));if($.length===0)return;if(lS(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const V=X({},ps(e)),U=X({},_f(e)),z=X({},uwe(e)),N=V[_a],B=[...N.children],H=new Set;for(let Y=0;Y<$.length;Y+=1){const Z=$[Y],ge=fU(Z,t.getRowId,"A row was provided without id when calling replaceRows()."),[ne]=B.splice(L+Y,1,ge);H.has(ne)||(delete U[ne],delete z[ne],delete V[ne]);const ie={id:ge,depth:0,parent:_a,type:"leaf",groupingKey:null};U[ge]=Z,z[ge]=ge,V[ge]=ie,H.add(ge)}V[_a]=X({},N,{children:B});const Q=B.filter(Y=>V[Y]?.type==="leaf");e.current.caches.rows.dataRowIdToModelLookup=U,e.current.caches.rows.dataRowIdToIdLookup=z,e.current.setState(Y=>X({},Y,{rows:X({},Y.rows,{dataRowIdToModelLookup:U,dataRowIdToIdLookup:z,dataRowIds:Q,tree:V})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),_={getRow:s,setLoading:d,getRowId:a,getRowModels:h,getRowsCount:p,getAllRowIds:g,setRows:c,updateRows:u,getRowNode:y,getRowIndexRelativeToVisibleRows:m,unstable_replaceRows:S},E={setRowIndex:w,setRowChildrenExpansion:v,getRowGroupChildren:b},T={updateServerRows:f},k=M.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let L;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?L=X({},e.current.caches.rows,{updates:{type:"full",rows:W2(e)}}):L=hz({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),l({cache:L,throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,l]),P=od(()=>t.unstable_dataSource),I=M.useCallback(L=>{if(t.unstable_dataSource&&t.unstable_dataSource!==P.current){P.current=t.unstable_dataSource;return}L==="rowTreeCreation"&&k()},[k,P,t.unstable_dataSource]),R=M.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==iFt(e)&&k()},[e,k]);Ft(e,"activeStrategyProcessorChange",I),Ft(e,"strategyAvailabilityChange",R);const F=M.useCallback(()=>{e.current.setState(L=>{const $=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:ps(L,e.current.instanceId),treeDepths:fwe(L,e.current.instanceId),dataRowIds:W2(L,e.current.instanceId),dataRowIdToModelLookup:_f(L,e.current.instanceId),dataRowIdToIdLookup:uwe(L,e.current.instanceId)});return X({},L,{rows:X({},L.rows,$,{totalTopLevelRowCount:w6e({tree:$.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,t.rowCount]);Wle(e,"hydrateRows",F),Gn(e,_,"public"),Gn(e,E,t.signature===Lf.DataGrid?"private":"public"),Gn(e,T,"private");const A=M.useRef(!0);M.useEffect(()=>{if(A.current){A.current=!1;return}let L=!1;t.rowCount!==i.current&&(L=!0,i.current=t.rowCount);const $=e.current.caches.rows.rowsBeforePartialUpdates===t.rows,j=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,V=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;$&&(j||(e.current.setState(U=>X({},U,{rows:X({},U.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),V||(e.current.setState(U=>X({},U,{rows:X({},U.rows,{totalRowCount:Math.max(t.rowCount||0,U.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,U.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate()),!L)||(n.debug(`Updating all rows, new length ${t.rows?.length}`),l({cache:hz({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1}))},[t.rows,t.rowCount,t.getRowId,t.loading,n,l,e])},c4t=e=>{const t={[_a]:X({},zFt(),{children:e})};for(let n=0;n{const n=X({},e),r={};for(let s=0;s!r[s])),n[_a]=X({},i,{children:o}),{groupingName:ow,tree:n,treeDepths:{0:o.length},dataRowIds:o}},f4t=e=>e.updates.type==="full"?c4t(e.updates.rows):u4t({previousTree:e.previousTree,actions:e.updates.actions}),d4t=e=>{tj(e,ow,"rowTreeCreation",f4t)};class $9 extends Error{}function h4t(e,t){const n=M.useCallback(p=>({field:p,colDef:e.current.getColumn(p)}),[e]),r=M.useCallback(p=>{const g=e.current.getRow(p);if(!g)throw new $9(`No row with id #${p} found`);return{id:p,columns:e.current.getAllColumns(),row:g}},[e]),i=M.useCallback((p,g,m,{cellMode:v,colDef:y,hasFocus:b,rowNode:w,tabIndex:S})=>{const _=m[g],E=y?.valueGetter?y.valueGetter(_,m,y,e):_,T={id:p,field:g,row:m,rowNode:w,colDef:y,cellMode:v,hasFocus:b,tabIndex:S,value:E,formattedValue:E,isEditable:!1,api:e.current};return y&&y.valueFormatter&&(T.formattedValue=y.valueFormatter(E,m,y,e)),T.isEditable=y&&e.current.isCellEditable(T),T},[e]),o=M.useCallback((p,g)=>{const m=e.current.getRow(p),v=e.current.getRowNode(p);if(!m||!v)throw new $9(`No row with id #${p} found`);const y=pc(e),b=Ile(e),w=e.current.getCellMode(p,g);return e.current.getCellParamsForRow(p,g,m,{colDef:t.unstable_listView&&t.unstable_listColumn?.field===g?GO(e.current.state):e.current.getColumn(g),rowNode:v,hasFocus:y!==null&&y.field===g&&y.id===p,tabIndex:b&&b.field===g&&b.id===p?0:-1,cellMode:w})},[e,t.unstable_listView,t.unstable_listColumn?.field]),s=M.useCallback((p,g)=>{const m=e.current.getColumn(g),v=e.current.getRow(p);if(!v)throw new $9(`No row with id #${p} found`);return!m||!m.valueGetter?v[g]:m.valueGetter(v[m.field],v,m,e)},[e]),a=M.useCallback((p,g)=>{const m=g.field;if(!g||!g.valueGetter)return p[m];const v=p[g.field];return g.valueGetter(v,p,g,e)},[e]),l=M.useCallback((p,g)=>{const m=a(p,g);return!g||!g.valueFormatter?m:g.valueFormatter(m,p,g,e)},[e,a]),c=M.useCallback(p=>e.current.rootElementRef.current?xzt(e.current.rootElementRef.current,p):null,[e]),u=M.useCallback(p=>e.current.rootElementRef.current?wzt(e.current.rootElementRef.current,p):null,[e]),f=M.useCallback((p,g)=>e.current.rootElementRef.current?Szt(e.current.rootElementRef.current,{id:p,field:g}):null,[e]),d={getCellValue:s,getCellParams:o,getCellElement:f,getRowValue:a,getRowFormattedValue:l,getRowParams:r,getRowElement:u,getColumnHeaderParams:n,getColumnHeaderElement:c},h={getCellParamsForRow:i};Gn(e,d,"public"),Gn(e,h,"private")}const wUe=(e,t)=>e==null||Array.isArray(e)?e:t&&t[0]===e?t:[e],p4t=(e,t)=>X({},e,{rowSelection:t.rowSelection?wUe(t.rowSelectionModel)??[]:[]}),g4t=(e,t)=>{const n=Ns(e,"useGridSelection"),r=M.useCallback(V=>(...U)=>{t.rowSelection&&V(...U)},[t.rowSelection]),i=t.signature!==Lf.DataGrid&&(t.rowSelectionPropagation?.parents||t.rowSelectionPropagation?.descendants),o=M.useMemo(()=>wUe(t.rowSelectionModel,du(e.current.state)),[e,t.rowSelectionModel]),s=M.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:o,propOnChange:t.onRowSelectionModelChange,stateSelector:du,changeEvent:"rowSelectionChange"});const{checkboxSelection:a,disableRowSelectionOnClick:l,isRowSelectable:c}=t,u=Rle(t),f=ut(e,ps),d=ut(e,lS)>1,h=M.useCallback(V=>{let U=V;const z=s.current??V,N=e.current.isRowSelected(V);if(N){const B=iO(e),H=B.findIndex(Y=>Y===z),Q=B.findIndex(Y=>Y===U);if(H===Q)return;H>Q?U=B[Q+1]:U=B[Q-1]}s.current=V,e.current.selectRowRange({startId:z,endId:U},!N)},[e]),p=M.useCallback(V=>{if(t.signature===Lf.DataGrid&&!u&&Array.isArray(V)&&V.length>1)throw new Error(["MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join(` +`));du(e.current.state)!==V&&(n.debug("Setting selection model"),e.current.setState(z=>X({},z,{rowSelection:t.rowSelection?V:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,u]),g=M.useCallback(V=>du(e.current.state).includes(V),[e]),m=M.useCallback(V=>{if(t.rowSelection===!1||c&&!c(e.current.getRowParams(V)))return!1;const U=ps(e)[V];return!(U?.type==="footer"||U?.type==="pinnedRow")},[e,t.rowSelection,c]),v=M.useCallback(()=>c$t(e),[e]),y=M.useCallback((V,U=!0,z=!1)=>{if(e.current.isRowSelectable(V))if(s.current=V,z){n.debug(`Setting selection for row ${V}`);const N=[],B=H=>{N.push(H)};U&&(B(V),i&&kk(e,f,V,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,B)),e.current.setRowSelectionModel(N)}else{n.debug(`Toggling selection for row ${V}`);const N=du(e.current.state),B=new Set(N);B.delete(V);const H=Z=>{B.add(Z)},Q=Z=>{B.delete(Z)};U?(H(V),i&&kk(e,f,V,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,H)):i&&_we(e,f,V,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,Q),(B.size<2||u)&&e.current.setRowSelectionModel(Array.from(B))}},[e,n,i,f,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,u]),b=M.useCallback((V,U=!0,z=!1)=>{n.debug("Setting selection for several rows");const N=V.filter(Q=>e.current.isRowSelectable(Q));let B;if(z){if(U){if(B=new Set(N),i){const Y=Z=>{B.add(Z)};N.forEach(Z=>{kk(e,f,Z,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,Y)})}}else B=new Set;const Q=E0(e);if(B.size===Object.keys(Q).length&&Array.from(B).every(Y=>Q[Y]===Y))return}else{B=new Set(Object.values(E0(e)));const Q=Z=>{B.add(Z)},Y=Z=>{B.delete(Z)};N.forEach(Z=>{U?(B.add(Z),i&&kk(e,f,Z,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,Q)):(Y(Z),i&&_we(e,f,Z,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,Y))})}(B.size<2||u)&&e.current.setRowSelectionModel(Array.from(B))},[n,i,u,e,f,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents]),w=M.useCallback(V=>{if(!d||!i||V.length===0)return V;const U=new Set(V),z=N=>{U.add(N)};for(const N of V)kk(e,f,N,t.rowSelectionPropagation?.descendants??!1,t.rowSelectionPropagation?.parents??!1,z,U);return Array.from(U)},[e,f,t.rowSelectionPropagation?.descendants,t.rowSelectionPropagation?.parents,d,i]),S=M.useCallback(({startId:V,endId:U},z=!0,N=!1)=>{if(!e.current.getRow(V)||!e.current.getRow(U))return;n.debug(`Expanding selection from row ${V} to row ${U}`);const B=iO(e),H=B.indexOf(V),Q=B.indexOf(U),[Y,Z]=H>Q?[Q,H]:[H,Q],ge=B.slice(Y,Z+1);e.current.selectRows(ge,z,N)},[e,n]),_={selectRow:y,setRowSelectionModel:p,getSelectedRows:v,isRowSelected:g,isRowSelectable:m},E={selectRows:b,selectRowRange:S,getPropagatedRowSelectionModel:w};Gn(e,_,"public"),Gn(e,E,t.signature===Lf.DataGrid?"private":"public");const T=M.useRef(!0),k=M.useCallback((V=!1)=>{if(T.current)return;const U=du(e.current.state),z=_f(e),N=RT(e),B=X({},E0(e)),H=Z=>t.filterMode==="server"?!z[Z]:!z[Z]||N[Z]===!1;let Q=!1;U.forEach(Z=>{if(H(Z)){if(t.keepNonExistentRowsSelected)return;delete B[Z],Q=!0;return}if(!t.rowSelectionPropagation?.parents)return;const ge=f[Z];if(ge.type==="group"){if(ge.isAutoGenerated){delete B[Z],Q=!0;return}ge.children.every(ie=>N[ie]===!1)||(delete B[Z],Q=!0)}});const Y=d&&t.rowSelectionPropagation?.parents&&Object.keys(B).length>0;if(Q||Y&&!V){const Z=Object.values(B);Y?e.current.selectRows(Z,!0,!0):e.current.setRowSelectionModel(Z)}},[e,d,t.rowSelectionPropagation?.parents,t.keepNonExistentRowsSelected,t.filterMode,f]),P=M.useCallback((V,U)=>{const z=U.metaKey||U.ctrlKey,N=!a&&!z&&!w5t(U),B=!u||N,H=e.current.isRowSelected(V);B?e.current.selectRow(V,N?!0:!H,!0):e.current.selectRow(V,!H,!1)},[e,u,a]),I=M.useCallback((V,U)=>{if(l)return;const z=U.target.closest(`.${ye.cell}`)?.getAttribute("data-field");z===IT.field||z===dU||z&&e.current.getColumn(z)?.type===uU||ps(e)[V.id].type==="pinnedRow"||(U.shiftKey&&u?h(V.id):P(V.id,U))},[l,u,e,h,P]),R=M.useCallback((V,U)=>{u&&U.shiftKey&&window.getSelection()?.removeAllRanges()},[u]),F=M.useCallback((V,U)=>{u&&U.nativeEvent.shiftKey?h(V.id):e.current.selectRow(V.id,V.value,!u)},[e,h,u]),A=M.useCallback(V=>{const U=t.pagination&&t.checkboxSelectionVisibleOnly&&t.paginationMode==="client"?B6e(e):iO(e);e.current.selectRows(U,V.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination,t.paginationMode]),L=M.useCallback((V,U)=>{if(e.current.getCellMode(V.id,V.field)!==ni.Edit&&!ED(U)){if(Z5(U.key)&&U.shiftKey){const z=pc(e);if(z&&z.id!==V.id){U.preventDefault();const N=e.current.isRowSelected(z.id);if(!u){e.current.selectRow(z.id,!N,!0);return}const B=e.current.getRowIndexRelativeToVisibleRows(z.id),H=e.current.getRowIndexRelativeToVisibleRows(V.id);let Q,Y;B>H?N?(Q=H,Y=B-1):(Q=H,Y=B):N?(Q=B+1,Y=H):(Q=B,Y=H);const ge=T0(e).rows.slice(Q,Y+1).map(ne=>ne.id);e.current.selectRows(ge,!N);return}}if(U.key===" "&&U.shiftKey){U.preventDefault(),P(V.id,U);return}String.fromCharCode(U.keyCode)==="A"&&(U.ctrlKey||U.metaKey)&&(U.preventDefault(),b(e.current.getAllRowIds(),!0))}},[e,P,b,u]),$=ft(()=>{if(!t.rowSelection){e.current.setRowSelectionModel([]);return}if(o===void 0)return;if(!i||!d||o.length===0){e.current.setRowSelectionModel(o);return}const V=e.current.getPropagatedRowSelectionModel(o);if(V.length!==o.length||!V.every(U=>o.includes(U))){e.current.setRowSelectionModel(V);return}e.current.setRowSelectionModel(o)});Ft(e,"sortedRowsSet",r(()=>k(!0))),Ft(e,"filteredRowsSet",r(()=>k())),Ft(e,"rowClick",r(I)),Ft(e,"rowSelectionCheckboxChange",r(F)),Ft(e,"headerSelectionCheckboxChange",A),Ft(e,"cellMouseDown",r(R)),Ft(e,"cellKeyDown",r(L)),M.useEffect(()=>{$()},[e,o,t.rowSelection,$]);const j=o!=null;M.useEffect(()=>{if(j||!t.rowSelection)return;const V=du(e.current.state);if(m){const U=V.filter(z=>m(z));U.length{if(!t.rowSelection||j)return;const V=du(e.current.state);!u&&V.length>1&&e.current.setRowSelectionModel([])},[e,u,a,j,t.rowSelection]),M.useEffect(()=>{r(k)},[k,r]),M.useEffect(()=>{T.current&&(T.current=!1)},[])},m4t=e=>{const{classes:t}=e;return M.useMemo(()=>Xe({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},pr,t),[t])},v4t=(e,t)=>{const n={classes:t.classes},r=m4t(n),i=M.useCallback(o=>{const s=X({},IT,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),a=t.checkboxSelection,l=o.lookup[ff]!=null;return a&&!l?(o.lookup[ff]=s,o.orderedFields=[ff,...o.orderedFields]):!a&&l?(delete o.lookup[ff],o.orderedFields=o.orderedFields.filter(c=>c!==ff)):a&&l&&(o.lookup[ff]=X({},s,o.lookup[ff]),t.columns.some(c=>c.field===ff)||(o.orderedFields=[ff,...o.orderedFields.filter(c=>c!==ff)])),o},[e,r,t.columns,t.checkboxSelection]);fo(e,"hydrateColumns",i)},y4t=(e,t)=>{const n=t.sortModel??t.initialState?.sorting?.sortModel??[];return X({},e,{sorting:{sortModel:a6e(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},b4t=(e,t)=>{const n=Ns(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:Fd,changeEvent:"sortModelChange"});const r=M.useCallback((S,_)=>{const E=Fd(e),T=E.findIndex(P=>P.field===S);let k=[...E];return T>-1?_?.sort==null?k.splice(T,1):k.splice(T,1,_):k=[...E,_],k},[e]),i=M.useCallback((S,_)=>{const T=Fd(e).find(k=>k.field===S.field);if(T){const k=_===void 0?hwe(S.sortingOrder??t.sortingOrder,T.sort):_;return k===void 0?void 0:X({},T,{sort:k})}return{field:S.field,sort:_===void 0?hwe(S.sortingOrder??t.sortingOrder):_}},[e,t.sortingOrder]),o=M.useCallback((S,_)=>_==null||_.sortable===!1||t.disableColumnSorting?S:(_.sortingOrder||t.sortingOrder).some(T=>!!T)?[...S,"columnMenuSortItem"]:S,[t.sortingOrder,t.disableColumnSorting]),s=M.useCallback(()=>{e.current.setState(S=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),X({},S,{sorting:X({},S.sorting,{sortedRows:Ple(ps(e),_a,!1)})});const _=Fd(S,e.current.instanceId),E=cFt(_,e),T=e.current.applyStrategyProcessor("sorting",{sortRowList:E});return X({},S,{sorting:X({},S.sorting,{sortedRows:T})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,n,t.sortingMode]),a=M.useCallback(S=>{Fd(e)!==S&&(n.debug("Setting sort model"),e.current.setState(dwe(S,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),l=M.useCallback((S,_,E)=>{const T=e.current.getColumn(S),k=i(T,_);let P;!E||t.disableMultipleColumnsSorting?P=k?.sort==null?[]:[k]:P=r(T.field,k),e.current.setSortModel(P)},[e,r,i,t.disableMultipleColumnsSorting]),c=M.useCallback(()=>Fd(e),[e]),u=M.useCallback(()=>kle(e).map(_=>_.model),[e]),f=M.useCallback(()=>AT(e),[e]),d=M.useCallback(S=>e.current.getSortedRowIds()[S],[e]);Gn(e,{getSortModel:c,getSortedRows:u,getSortedRowIds:f,getRowIdFromRowIndex:d,setSortModel:a,sortColumn:l,applySorting:s},"public");const p=M.useCallback((S,_)=>{const E=Fd(e);return!_.exportOnlyDirtyModels||t.sortModel!=null||t.initialState?.sorting?.sortModel!=null||E.length>0?X({},S,{sorting:{sortModel:E}}):S},[e,t.sortModel,t.initialState?.sorting?.sortModel]),g=M.useCallback((S,_)=>{const E=_.stateToRestore.sorting?.sortModel;return E==null?S:(e.current.setState(dwe(E,t.disableMultipleColumnsSorting)),X({},S,{callbacks:[...S.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),m=M.useCallback(S=>{const _=ps(e),E=_[_a],T=S.sortRowList?S.sortRowList(E.children.map(k=>_[k])):[...E.children];return E.footerId!=null&&T.push(E.footerId),T},[e]);fo(e,"exportState",p),fo(e,"restoreState",g),tj(e,ow,"sorting",m);const v=M.useCallback(({field:S,colDef:_},E)=>{if(!_.sortable||t.disableColumnSorting)return;const T=E.shiftKey||E.metaKey||E.ctrlKey;l(S,void 0,T)},[l,t.disableColumnSorting]),y=M.useCallback(({field:S,colDef:_},E)=>{!_.sortable||t.disableColumnSorting||E.key==="Enter"&&!E.ctrlKey&&!E.metaKey&&l(S,void 0,E.shiftKey)},[l,t.disableColumnSorting]),b=M.useCallback(()=>{const S=Fd(e),_=Ov(e);if(S.length>0){const E=S.filter(T=>_[T.field]);E.length{S==="sorting"&&e.current.applySorting()},[e]);fo(e,"columnMenu",o),Ft(e,"columnHeaderClick",v),Ft(e,"columnHeaderKeyDown",y),Ft(e,"rowsSet",e.current.applySorting),Ft(e,"columnsChange",b),Ft(e,"activeStrategyProcessorChange",w),xD(()=>{e.current.applySorting()}),lr(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function oSe(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:i}=e,o=i+r;if(r>t)return i;if(o-t>n)return o-t;if(i{const n=yi(),r=Ns(e,"useGridScroll"),i=e.current.columnHeadersContainerRef,o=e.current.virtualScrollerRef,s=ut(e,Ob),a=M.useCallback(f=>{const d=Is(e.current.state),h=bD(e),p=t.unstable_listView?[GO(e.current.state)]:Mo(e);if(!(f.rowIndex==null)&&h===0||p.length===0)return!1;r.debug(`Scrolling to cell at row ${f.rowIndex}, col: ${f.colIndex} `);let m={};if(f.colIndex!==void 0){const v=Cb(e);let y;if(typeof f.rowIndex<"u"){const b=s[f.rowIndex]?.id,w=e.current.unstable_getCellColSpanInfo(b,f.colIndex);w&&!w.spannedByColSpan&&(y=w.cellProps.width)}typeof y>"u"&&(y=p[f.colIndex].computedWidth),m.left=oSe({containerSize:d.viewportOuterSize.width,scrollPosition:Math.abs(o.current.scrollLeft),elementSize:y,elementOffset:v[f.colIndex]})}if(f.rowIndex!==void 0){const v=DT(e.current.state),y=O$t(e),b=z6e(e),w=t.pagination?f.rowIndex-y*b:f.rowIndex,S=v.positions[w+1]?v.positions[w+1]-v.positions[w]:v.currentPageTotalHeight-v.positions[w];m.top=oSe({containerSize:d.viewportInnerSize.height,scrollPosition:o.current.scrollTop,elementSize:S,elementOffset:v.positions[w]})}return m=e.current.unstable_applyPipeProcessors("scrollToIndexes",m,f),typeof m.left!==void 0||typeof m.top!==void 0?(e.current.scroll(m),!0):!1},[r,e,o,t.pagination,s,t.unstable_listView]),l=M.useCallback(f=>{if(o.current&&f.left!==void 0&&i.current){const d=n?-1:1;i.current.scrollLeft=f.left,o.current.scrollLeft=d*f.left,r.debug(`Scrolling left: ${f.left}`)}o.current&&f.top!==void 0&&(o.current.scrollTop=f.top,r.debug(`Scrolling top: ${f.top}`)),r.debug("Scrolling, updating container, and viewport")},[o,n,i,r]),c=M.useCallback(()=>o?.current?{top:o.current.scrollTop,left:o.current.scrollLeft}:{top:0,left:0},[o]);Gn(e,{scroll:l,scrollToIndexes:a,getScrollPosition:c},"public")};function w4t(e,t){ii(e,"columnHeaderClick",t.onColumnHeaderClick),ii(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),ii(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),ii(e,"columnHeaderOver",t.onColumnHeaderOver),ii(e,"columnHeaderOut",t.onColumnHeaderOut),ii(e,"columnHeaderEnter",t.onColumnHeaderEnter),ii(e,"columnHeaderLeave",t.onColumnHeaderLeave),ii(e,"cellClick",t.onCellClick),ii(e,"cellDoubleClick",t.onCellDoubleClick),ii(e,"cellKeyDown",t.onCellKeyDown),ii(e,"preferencePanelClose",t.onPreferencePanelClose),ii(e,"preferencePanelOpen",t.onPreferencePanelOpen),ii(e,"menuOpen",t.onMenuOpen),ii(e,"menuClose",t.onMenuClose),ii(e,"rowDoubleClick",t.onRowDoubleClick),ii(e,"rowClick",t.onRowClick),ii(e,"stateChange",t.onStateChange)}function S4t(e,t=166){let n,r;const i=()=>{n=void 0,e(...r)};function o(...s){r=s,n===void 0&&(n=setTimeout(i,t))}return o.clear=()=>{clearTimeout(n),n=void 0},o}const ate={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:" ",columnBufferPx:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:Jp.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,indeterminateCheckboxAction:"deselect",keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resetPageOnSortFilter:!1,resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rowPositionsDebounceMs:166,rows:[],rowSelection:!0,rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,unstable_rowSpanning:!1,virtualizeColumnsWithAutoRowHeight:!1},mC={width:0,height:0},_4t={isReady:!1,root:mC,viewportOuterSize:mC,viewportInnerSize:mC,contentSize:mC,minimumSize:mC,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0},C4t=(e,t,n)=>{const r=_4t,i=TT(n);return X({},e,{dimensions:X({},r,_Ue(t,n,i,MT(n)))})},SUe=xn(Mo,Cb,(e,t)=>{const n=e.length;return n===0?0:AC(t[n-1]+e[n-1].computedWidth,1)});function O4t(e,t){const n=Ns(e,"useResizeContainer"),r=M.useRef(!1),i=M.useRef(mC),o=ut(e,MT),s=ut(e,TT),a=ut(e,SUe),l=M.useRef(!0),{rowHeight:c,headerHeight:u,groupHeaderHeight:f,headerFilterHeight:d,headersTotalHeight:h,leftPinnedWidth:p,rightPinnedWidth:g}=_Ue(t,e,s,o),m=M.useRef(void 0),v=M.useCallback(()=>Is(e.current.state),[e]),y=M.useCallback(R=>{e.current.setState(F=>X({},F,{dimensions:R})),e.current.rootElementRef.current&&sSe(e.current.rootElementRef.current,Is(e.current.state))},[e]),b=M.useCallback(()=>{const R=e.current.mainElementRef.current;if(!R)return;const F=Lc(R).getComputedStyle(R),A={width:parseFloat(F.width)||0,height:parseFloat(F.height)||0};(!m.current||!lSe(m.current,A))&&(e.current.publishEvent("resize",A),m.current=A)},[e]),w=M.useCallback(()=>{const R=Is(e.current.state);if(!R.isReady)return 0;const F=T0(e);if(t.getRowHeight){const L=OD(e),$=L.lastRowIndex-L.firstRowIndex;return Math.min($-1,F.rows.length)}const A=Math.floor(R.viewportInnerSize.height/c);return Math.min(A,F.rows.length)},[e,t.getRowHeight,c]),S=M.useCallback(()=>{if(l.current)return;const R=E4t(e.current.mainElementRef.current,t.scrollbarSize),F=DT(e.current.state),A=h+F.pinnedTopRowsTotalHeight,L=F.pinnedBottomRowsTotalHeight,j={width:a-p-g,height:AC(F.currentPageTotalHeight,1)};let V,U,z=!1,N=!1;if(t.autoHeight)N=!1,z=Math.round(a)>Math.round(i.current.width),V={width:i.current.width,height:A+L+j.height},U={width:Math.max(0,V.width-(N?R:0)),height:Math.max(0,V.height-(z?R:0))};else{V={width:i.current.width,height:i.current.height},U={width:Math.max(0,V.width-p-g),height:Math.max(0,V.height-A-L)};const Z=j,ge=U,ne=Z.width>ge.width,ie=Z.height>ge.height;(ne||ie)&&(N=ie,z=Z.width+(N?R:0)>ge.width,z&&(N=Z.height+R>ge.height)),N&&(U.width-=R),z&&(U.height-=R)}const B=Math.max(V.width,a+(N?R:0)),H={width:a,height:A+j.height+L},Q={isReady:!0,root:i.current,viewportOuterSize:V,viewportInnerSize:U,contentSize:j,minimumSize:H,hasScrollX:z,hasScrollY:N,scrollbarSize:R,headerHeight:u,groupHeaderHeight:f,headerFilterHeight:d,rowWidth:B,rowHeight:c,columnsTotalWidth:a,leftPinnedWidth:p,rightPinnedWidth:g,headersTotalHeight:h,topContainerHeight:A,bottomContainerHeight:L},Y=e.current.state.dimensions;O0(Y,Q)||(y(Q),lSe(Q.viewportInnerSize,Y.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",Q.viewportInnerSize),e.current.updateRenderContext?.())},[e,y,t.scrollbarSize,t.autoHeight,c,u,f,d,a,h,p,g]),_=ft(S),E=M.useMemo(()=>t.resizeThrottleMs>0?S4t(()=>{_(),e.current.publishEvent("debouncedResize",i.current)},t.resizeThrottleMs):void 0,[e,t.resizeThrottleMs,_]);M.useEffect(()=>E?.clear,[E]);const T={resize:b,getRootDimensions:v},k={updateDimensions:S,getViewportPageSize:w};lr(S,[S]),Gn(e,T,"public"),Gn(e,k,"private");const P=M.useCallback(R=>{sSe(R,Is(e.current.state))},[e]),I=M.useCallback(R=>{if(i.current=R,R.height===0&&!r.current&&!t.autoHeight&&!Q5&&(n.error(["The parent DOM element of the Data Grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` +`)),r.current=!0),R.width===0&&!r.current&&!Q5&&(n.error(["The parent DOM element of the Data Grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` +`)),r.current=!0),l.current||!E){l.current=!1,S();return}E()},[S,t.autoHeight,E,n]);ii(e,"rootMount",P),ii(e,"resize",I),ii(e,"debouncedResize",t.onResize)}function sSe(e,t){const n=(r,i)=>e.style.setProperty(r,i);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}function _Ue(e,t,n,r){const i=C6e(e.rowHeight,ate.rowHeight);return{rowHeight:Math.floor(i*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:SUe(t),headersTotalHeight:vU(t,e),leftPinnedWidth:r.left.reduce((o,s)=>o+s.computedWidth,0),rightPinnedWidth:r.right.reduce((o,s)=>o+s.computedWidth,0)}}const aSe=new WeakMap;function E4t(e,t){if(t!==void 0)return t;if(e===null)return 0;const n=aSe.get(e);if(n!==void 0)return n;const i=ci(e).createElement("div");i.style.width="99px",i.style.height="99px",i.style.position="absolute",i.style.overflow="scroll",i.className="scrollDiv",e.appendChild(i);const o=i.offsetWidth-i.clientWidth;return e.removeChild(i),aSe.set(e,o),o}function lSe(e,t){return e.width===t.width&&e.height===t.height}const T4t=typeof globalThis.ResizeObserver<"u"?globalThis.ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},P4t=(e,t,n)=>{n.current.caches.rowsMeta={heights:new Map};const r=_le(n.current.state),i=bD(n),o=wD(n.current.state),s=Math.min(o.enabled?o.paginationModel.pageSize:i,i);return X({},e,{rowsMeta:{currentPageTotalHeight:s*r,positions:Array.from({length:s},(a,l)=>l*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},k4t=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:i}=t,o=e.current.caches.rowsMeta.heights,s=M.useRef(-1),a=M.useRef(!1),l=M.useRef(!1),c=ut(e,TT),u=Fle(e),f=ut(e,PT),d=ut(e,_le),h=P=>{let I=o.get(P);return I===void 0&&(I={content:d,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},o.set(P,I)),I},p=M.useCallback(P=>{const I=Is(e.current.state).rowHeight,R=e.current.getRowHeightEntry(P.id);if(!n)R.content=I,R.needsFirstMeasurement=!1;else{const F=n(X({},P,{densityFactor:c}));if(F==="auto"){if(R.needsFirstMeasurement){const A=i?i(X({},P,{densityFactor:c})):I;R.content=A??I}a.current=!0,R.autoHeight=!0}else R.content=C6e(F,I),R.needsFirstMeasurement=!1,R.autoHeight=!1}if(r){const F=e.current.getRowIndexRelativeToVisibleRows(P.id),A=r(X({},P,{isFirstVisible:F===0,isLastVisible:F===u.rows.length-1,indexRelativeToCurrentPage:F}));R.spacingTop=A.top??0,R.spacingBottom=A.bottom??0}else R.spacingTop=0,R.spacingBottom=0;return e.current.unstable_applyPipeProcessors("rowHeight",R,P),R},[e,u.rows,n,i,d,r,c]),g=M.useCallback(()=>{a.current=!1;const P=f.top.reduce(($,j)=>{const V=p(j);return $+V.content+V.spacingTop+V.spacingBottom+V.detail},0),I=f.bottom.reduce(($,j)=>{const V=p(j);return $+V.content+V.spacingTop+V.spacingBottom+V.detail},0),R=[],F=u.rows.reduce(($,j)=>{R.push($);const V=p(j),U=V.content+V.spacingTop+V.spacingBottom+V.detail;return $+U},0);a.current||(s.current=1/0);const A=P!==e.current.state.rowsMeta.pinnedTopRowsTotalHeight||I!==e.current.state.rowsMeta.pinnedBottomRowsTotalHeight||F!==e.current.state.rowsMeta.currentPageTotalHeight,L={currentPageTotalHeight:F,positions:R,pinnedTopRowsTotalHeight:P,pinnedBottomRowsTotalHeight:I};e.current.setState($=>X({},$,{rowsMeta:L})),A&&e.current.updateDimensions(),l.current=!0},[e,f,u.rows,p]),m=P=>o.get(P)?.content??d,v=(P,I)=>{const R=e.current.getRowHeightEntry(P),F=R.content!==I;R.needsFirstMeasurement=!1,R.content=I,l.current&&=!F},y=P=>o.get(P)?.autoHeight??!1,b=()=>s.current,w=P=>{a.current&&P>s.current&&(s.current=P)},S=()=>{o.clear(),g()},_=od(()=>new T4t(P=>{for(let I=0;I0?R.borderBoxSize[0].blockSize:R.contentRect.height,A=R.target.__mui_id;if(J6e(e)?.id===A&&F===0)return;e.current.unstable_storeRowHeightMeasurement(A,F)}l.current||requestAnimationFrame(()=>{e.current.requestPipeProcessorsApplication("rowHeight")})})).current,E=(P,I)=>(P.__mui_id=I,_.observe(P),()=>_.unobserve(P));Wle(e,"rowHeight",g),lr(()=>{g()},[g]);const T={unstable_getRowHeight:m,unstable_setLastMeasuredRowIndex:w,unstable_storeRowHeightMeasurement:v,resetRowHeights:S},k={hydrateRowsMeta:g,observeRowHeight:E,rowHasAutoHeight:y,getRowHeightEntry:h,getLastMeasuredRowIndex:b};Gn(e,T,"public"),Gn(e,k,"private")},M4t=e=>{const t=M.useCallback((i={})=>e.current.unstable_applyPipeProcessors("exportState",{},i),[e]),n=M.useCallback(i=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:i}).callbacks.forEach(s=>{s()}),e.current.forceUpdate()},[e]);Gn(e,{exportState:t,restoreState:n},"public")},A4t=e=>{const t=M.useRef({}),n=(a,l)=>t.current[a]?.[l],r=()=>{t.current={}},i=M.useCallback(({rowId:a,minFirstColumn:l,maxLastColumn:c,columns:u})=>{for(let f=l;f1&&(f+=d.colSpan-1)}},[e]),o={unstable_getCellColSpanInfo:n},s={resetColSpan:r,calculateColSpan:i};Gn(e,o,"public"),Gn(e,s,"private"),Ft(e,"columnOrderChange",r)};function R4t(e){const{apiRef:t,lookup:n,columnIndex:r,rowId:i,minFirstColumnIndex:o,maxLastColumnIndex:s,columns:a}=e,l=a.length,c=a[r],u=t.current.getRow(i),f=t.current.getRowValue(u,c),d=typeof c.colSpan=="function"?c.colSpan(f,u,c,t):c.colSpan;if(!d||d===1)return N9(n,i,r,{spannedByColSpan:!1,cellProps:{colSpan:1,width:c.computedWidth}}),{colSpan:1};let h=c.computedWidth;for(let p=1;p=o&&g{if(d6e(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(` +`));n[e.field]=t;return}const{groupId:r,children:i}=e;i.forEach(o=>{CUe(o,[...t,r],n)})},lte=e=>{if(!e)return{};const t={};return e.forEach(n=>{CUe(n,[],t)}),t},cte=(e,t,n)=>{const r=l=>t[l]??[],i=[],o=Math.max(...e.map(l=>r(l).length)),s=(l,c,u)=>O0(r(l).slice(0,u+1),r(c).slice(0,u+1)),a=(l,c)=>!!(n?.left&&n.left.includes(l)&&!n.left.includes(c)||n?.right&&!n.right.includes(l)&&n.right.includes(c));for(let l=0;l{const d=r(f)[l]??null;if(u.length===0)return[{columnFields:[f],groupId:d}];const h=u[u.length-1],p=h.columnFields[h.columnFields.length-1];return h.groupId!==d||!s(p,f,l)||a(p,f)?[...u,{columnFields:[f],groupId:d}]:[...u.slice(0,u.length-1),{columnFields:[...h.columnFields,f],groupId:d}]},[]);i.push(c)}return i},I4t=["groupId","children"],Hle=e=>{let t={};return e.forEach(n=>{if(d6e(n))return;const{groupId:r,children:i}=n,o=st(n,I4t);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const s=X({},o,{groupId:r}),a=Hle(i);if(a[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=X({},t,a,{[r]:s})}),X({},t)},D4t=(e,t,n)=>{if(!t.columnGroupingModel)return e;const r=Um(n),i=kT(n),o=Hle(t.columnGroupingModel??[]),s=lte(t.columnGroupingModel??[]),a=cte(r,s,n.current.state.pinnedColumns??{}),l=i.length===0?0:Math.max(...i.map(c=>s[c]?.length??0));return X({},e,{columnGrouping:{lookup:o,unwrappedGroupingModel:s,headerStructure:a,maxDepth:l}})},L4t=(e,t)=>{const n=M.useCallback(a=>H6e(e)[a]??[],[e]),r=M.useCallback(()=>G6e(e),[e]);Gn(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const o=M.useCallback(()=>{const a=lte(t.columnGroupingModel??[]);e.current.setState(l=>{const c=l.columns?.orderedFields??[],u=l.pinnedColumns??{},f=cte(c,a,u);return X({},l,{columnGrouping:X({},l.columnGrouping,{headerStructure:f})})})},[e,t.columnGroupingModel]),s=M.useCallback(a=>{const l=e.current.getPinnedColumns?.()??{},c=Um(e),u=kT(e),f=Hle(a??[]),d=lte(a??[]),h=cte(c,d,l),p=u.length===0?0:Math.max(...u.map(g=>d[g]?.length??0));e.current.setState(g=>X({},g,{columnGrouping:{lookup:f,unwrappedGroupingModel:d,headerStructure:h,maxDepth:p}}))},[e]);Ft(e,"columnIndexChange",o),Ft(e,"columnsChange",()=>{s(t.columnGroupingModel)}),Ft(e,"columnVisibilityModelChange",()=>{s(t.columnGroupingModel)}),M.useEffect(()=>{s(t.columnGroupingModel)},[s,t.columnGroupingModel])};function F4t(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function cSe(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;nK6e(e),r=ut(e,n);return M.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=F4t()}return t.current}}function B4t(e,t){if(e.length<4)return e;const n=e.slice();n.sort((a,l)=>a-l);const r=n[Math.floor(n.length*.25)],i=n[Math.floor(n.length*.75)-1],o=i-r,s=o<5?5:o*t;return n.filter(a=>a>r-s&&a{const a=Izt(e.current,o.field).map(p=>p.getBoundingClientRect().width??0),l=t.includeOutliers?a:B4t(a,t.outliersFactor);if(t.includeHeaders){const p=Rzt(e.current,o.field);if(p){const g=p.querySelector(`.${ye.columnHeaderTitle}`),m=p.querySelector(`.${ye.columnHeaderTitleContainerContent}`),v=p.querySelector(`.${ye.iconButtonContainer}`),y=p.querySelector(`.${ye.menuIcon}`),b=g??m,w=window.getComputedStyle(p,null),S=parseInt(w.paddingLeft,10)+parseInt(w.paddingRight,10),E=b.scrollWidth+1+S+(v?.clientWidth??0)+(y?.clientWidth??0);l.push(E)}}const c=o.minWidth!==-1/0&&o.minWidth!==void 0,u=o.maxWidth!==1/0&&o.maxWidth!==void 0,f=c?o.minWidth:0,d=u?o.maxWidth:1/0,h=l.length===0?0:Math.max(...l);r[o.field]=Mu(h,f,d)}),i.classList.remove(ye.autosizing),r}const V4t=e=>X({},e,{columnResize:{resizingColumnField:""}});function W4t(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const H4t=(e,t)=>{const n=yi(),r=Ns(e,"useGridColumnResize"),i=od(W4t).current,o=M.useRef(null),s=M.useRef(null),a=zl(),l=M.useRef(void 0),c=k=>{r.debug(`Updating width to ${k} for col ${i.colDef.field}`);const P=i.columnHeaderElement.offsetWidth,I=k-P,R=k-i.initialColWidth;if(R>0){const L=i.initialTotalWidth+R;e.current.rootElementRef?.current?.style.setProperty("--DataGrid-rowWidth",`${L}px`)}i.colDef.computedWidth=k,i.colDef.width=k,i.colDef.flex=0,i.columnHeaderElement.style.width=`${k}px`;const F=i.headerFilterElement;F&&(F.style.width=`${k}px`),i.groupHeaderElements.forEach(L=>{const $=L;let j;$.getAttribute("aria-colspan")==="1"?j=`${k}px`:j=`${$.offsetWidth+I}px`,$.style.width=j}),i.cellElements.forEach(L=>{const $=L;let j;$.getAttribute("aria-colspan")==="1"?j=`${k}px`:j=`${$.offsetWidth+I}px`,$.style.setProperty("--width",j)});const A=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);A===Vy.LEFT&&(x_(i.fillerLeft,"width",I),i.leftPinnedCellsAfter.forEach(L=>{x_(L,"left",I)}),i.leftPinnedHeadersAfter.forEach(L=>{x_(L,"left",I)})),A===Vy.RIGHT&&(x_(i.fillerRight,"width",I),i.rightPinnedCellsBefore.forEach(L=>{x_(L,"right",I)}),i.rightPinnedHeadersBefore.forEach(L=>{x_(L,"right",I)}))},u=k=>{if(v(),i.previousMouseClickEvent){const P=i.previousMouseClickEvent,I=P.timeStamp,R=P.clientX,F=P.clientY;if(k.timeStamp-I<300&&k.clientX===R&&k.clientY===F){i.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,k);return}}if(i.colDef){e.current.setColumnWidth(i.colDef.field,i.colDef.width),r.debug(`Updating col ${i.colDef.field} with new width: ${i.colDef.width}`);const P=Bp(e.current.state);i.groupHeaderElements.forEach(I=>{const R=Ozt(I),F=I,L=`${R.reduce(($,j)=>P.columnVisibilityModel[j]!==!1?$+P.lookup[j].computedWidth:$,0)}px`;F.style.width=L})}a.start(0,()=>{e.current.publishEvent("columnResizeStop",null,k)})},f=(k,P,I)=>{const R=e.current.rootElementRef.current;i.initialColWidth=k.computedWidth,i.initialTotalWidth=e.current.getRootDimensions().rowWidth,i.colDef=k,i.columnHeaderElement=Czt(e.current.columnHeadersContainerRef.current,k.field);const F=R.querySelector(`.${ye.headerFilterRow} [data-field="${Ev(k.field)}"]`);F&&(i.headerFilterElement=F),i.groupHeaderElements=Ezt(e.current.columnHeadersContainerRef?.current,k.field),i.cellElements=Tzt(i.columnHeaderElement,e.current),i.fillerLeft=zwe(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),i.fillerRight=zwe(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const A=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);i.leftPinnedCellsAfter=A!==Vy.LEFT?[]:Pzt(e.current,i.columnHeaderElement,n),i.rightPinnedCellsBefore=A!==Vy.RIGHT?[]:kzt(e.current,i.columnHeaderElement,n),i.leftPinnedHeadersAfter=A!==Vy.LEFT?[]:Mzt(e.current,i.columnHeaderElement,n),i.rightPinnedHeadersBefore=A!==Vy.RIGHT?[]:Azt(e.current,i.columnHeaderElement,n),s.current=z4t(P,n),o.current=$4t(I,i.columnHeaderElement.getBoundingClientRect(),s.current)},d=ft(u),h=ft(k=>{if(k.buttons===0){d(k);return}let P=uSe(o.current,k.clientX,i.columnHeaderElement.getBoundingClientRect(),s.current);P=Mu(P,i.colDef.minWidth,i.colDef.maxWidth),c(P);const I={element:i.columnHeaderElement,colDef:i.colDef,width:P};e.current.publishEvent("columnResize",I,k)}),p=ft(k=>{cSe(k,l.current)&&u(k)}),g=ft(k=>{const P=cSe(k,l.current);if(!P)return;if(k.type==="mousemove"&&k.buttons===0){p(k);return}let I=uSe(o.current,P.x,i.columnHeaderElement.getBoundingClientRect(),s.current);I=Mu(I,i.colDef.minWidth,i.colDef.maxWidth),c(I);const R={element:i.columnHeaderElement,colDef:i.colDef,width:I};e.current.publishEvent("columnResize",R,k)}),m=ft(k=>{const P=K5(k.target,ye["columnSeparator--resizable"]);if(!P)return;const I=k.changedTouches[0];I!=null&&(l.current=I.identifier);const R=K5(k.target,ye.columnHeader),F=_zt(R),A=e.current.getColumn(F);r.debug(`Start Resize on col ${A.field}`),e.current.publishEvent("columnResizeStart",{field:F},k),f(A,P,I.clientX);const L=ci(k.currentTarget);L.addEventListener("touchmove",g),L.addEventListener("touchend",p)}),v=M.useCallback(()=>{const k=ci(e.current.rootElementRef.current);k.body.style.removeProperty("cursor"),k.removeEventListener("mousemove",h),k.removeEventListener("mouseup",d),k.removeEventListener("touchmove",g),k.removeEventListener("touchend",p),setTimeout(()=>{k.removeEventListener("click",fSe,!0)},100),i.columnHeaderElement&&(i.columnHeaderElement.style.pointerEvents="unset")},[e,i,h,d,g,p]),y=M.useCallback(({field:k})=>{e.current.setState(P=>X({},P,{columnResize:X({},P.columnResize,{resizingColumnField:k})})),e.current.forceUpdate()},[e]),b=M.useCallback(()=>{e.current.setState(k=>X({},k,{columnResize:X({},k.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),w=ft(({colDef:k},P)=>{if(P.button!==0||!P.currentTarget.classList.contains(ye["columnSeparator--resizable"]))return;P.preventDefault(),r.debug(`Start Resize on col ${k.field}`),e.current.publishEvent("columnResizeStart",{field:k.field},P),f(k,P.currentTarget,P.clientX);const I=ci(e.current.rootElementRef.current);I.body.style.cursor="col-resize",i.previousMouseClickEvent=P.nativeEvent,I.addEventListener("mousemove",h),I.addEventListener("mouseup",d),I.addEventListener("click",fSe,!0)}),S=ft((k,P)=>{if(t.disableAutosize||P.button!==0)return;const I=e.current.state.columns.lookup[k.field];I.resizable!==!1&&e.current.autosizeColumns(X({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[I.field]}))}),_=j4t(e),E=M.useRef(!1),T=M.useCallback(async k=>{if(!e.current.rootElementRef?.current||E.current)return;E.current=!0;const I=Bp(e.current.state),R=X({},v3t,k,{columns:k?.columns??I.orderedFields});R.columns=R.columns.filter(A=>I.columnVisibilityModel[A]!==!1);const F=R.columns.map(A=>e.current.state.columns.lookup[A]);try{!t.disableVirtualization&&R.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await _());const A=U4t(e,R,F),L=F.map($=>X({},$,{width:A[$.field],computedWidth:A[$.field],flex:0}));if(R.expand){const j=I.orderedFields.map(N=>I.lookup[N]).filter(N=>I.columnVisibilityModel[N.field]!==!1).reduce((N,B)=>N+(A[B.field]??B.computedWidth??B.width),0),z=e.current.getRootDimensions().viewportInnerSize.width-j;if(z>0){const N=z/(L.length||1);L.forEach(B=>{B.width+=N,B.computedWidth+=N})}}e.current.updateColumns(L),L.forEach(($,j)=>{if($.width!==F[j].width){const V=$.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement($.field),colDef:$,width:V})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),E.current=!1}},[e,_,t.disableVirtualization]);M.useEffect(()=>v,[v]),Ise(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),D6e(e,()=>e.current.columnHeadersContainerRef?.current,"touchstart",m,{passive:!0}),Gn(e,{autosizeColumns:T},"public"),Ft(e,"columnResizeStop",b),Ft(e,"columnResizeStart",y),Ft(e,"columnSeparatorMouseDown",w),Ft(e,"columnSeparatorDoubleClick",S),ii(e,"columnResize",t.onColumnResize),ii(e,"columnWidthChange",t.onColumnWidthChange)};function x_(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function G4t(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex{if(!e)return null;let r=e[t.field];const i=t.rowSpanValueGetter??t.valueGetter;return i&&(r=i(r,e,t,n)),r},RC={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},nj={firstRowIndex:0,lastRowIndex:0},q4t=new Set([ff,"__reorder__",dU]),hSe=20,OUe=(e,t,n,r,i,o,s)=>{const a=o?{}:X({},e.current.state.rowSpanning.spannedCells),l=o?{}:X({},e.current.state.rowSpanning.hiddenCells),c=o?{}:X({},e.current.state.rowSpanning.hiddenCellOriginMap);return o&&(s=nj),t.forEach(u=>{if(!q4t.has(u.field)){for(let f=i.firstRowIndex;f=r.firstRowIndex&&w&&z9(w.model,u,e)===h;){const S=n[b+1];l[S.id]?l[S.id][u.field]=!0:l[S.id]={[u.field]:!0},v.push(f),m+=1,p=w.id,g=b,b-=1,w=n[b]}}v.forEach(b=>{c[b]?c[b][u.field]=g:c[b]={[u.field]:g}});let y=f+1;for(;y<=r.lastRowIndex&&n[y]&&z9(n[y].model,u,e)===h;){const b=n[y];l[b.id]?l[b.id][u.field]=!0:l[b.id]={[u.field]:!0},c[y]?c[y][u.field]=g:c[y]={[u.field]:g},y+=1,m+=1}m>0&&(a[p]?a[p][u.field]=m+1:a[p]={[u.field]:m+1})}s={firstRowIndex:Math.min(s.firstRowIndex,i.firstRowIndex),lastRowIndex:Math.max(s.lastRowIndex,i.lastRowIndex)}}}),{spannedCells:a,hiddenCells:l,hiddenCellOriginMap:c,processedRange:s}},EUe=(e,t)=>{const n=W2(t).length;if(e.pagination){const r=z6e(t);let i=hSe;return r>0&&(i=r-1),{firstRowIndex:0,lastRowIndex:Math.min(i,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(hSe,n)}},X4t=(e,t,n)=>{if(!t.unstable_rowSpanning)return X({},e,{rowSpanning:RC});const r=e.rows.dataRowIds||[],i=e.columns.orderedFields||[],o=e.rows.dataRowIdToModelLookup,s=e.columns.lookup,a=!!e.filter.filterModel.items.length||!!e.filter.filterModel.quickFilterValues?.length;if(!r.length||!i.length||!o||!s||a)return X({},e,{rowSpanning:RC});const l=EUe(t,n),c=r.map(p=>({id:p,model:o[p]})),u=i.map(p=>s[p]),{spannedCells:f,hiddenCells:d,hiddenCellOriginMap:h}=OUe(n,u,c,l,l,!0,nj);return X({},e,{rowSpanning:{spannedCells:f,hiddenCells:d,hiddenCellOriginMap:h}})},Y4t=(e,t)=>{const n=od(()=>e.current.state.rowSpanning!==RC?EUe(t,e):nj),r=M.useCallback((o,s=!1)=>{const{range:a,rows:l}=T0(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(a===null||!dSe(o))return;s&&(n.current=nj);const c=G4t({firstRowIndex:o.firstRowIndex,lastRowIndex:Math.min(o.lastRowIndex,a.lastRowIndex+1)},n.current);if(c===null)return;const u=Mo(e),{spannedCells:f,hiddenCells:d,hiddenCellOriginMap:h,processedRange:p}=OUe(e,u,l,a,c,s,n.current);n.current=p;const g=Object.keys(f).length,m=Object.keys(d).length,v=Object.keys(e.current.state.rowSpanning.spannedCells).length,y=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(s||g!==v||m!==y)||g===0&&v===0||e.current.setState(S=>X({},S,{rowSpanning:{spannedCells:f,hiddenCells:d,hiddenCellOriginMap:h}}))},[e,n,t.pagination,t.paginationMode]),i=M.useCallback(()=>{const o=OD(e);dSe(o)&&r(o,!0)},[e,r]);Ft(e,"renderedRowsIntervalChange",Hx(t.unstable_rowSpanning,r)),Ft(e,"sortedRowsSet",Hx(t.unstable_rowSpanning,i)),Ft(e,"paginationModelChange",Hx(t.unstable_rowSpanning,i)),Ft(e,"filteredRowsSet",Hx(t.unstable_rowSpanning,i)),Ft(e,"columnsChange",Hx(t.unstable_rowSpanning,i)),M.useEffect(()=>{t.unstable_rowSpanning?e.current.state.rowSpanning===RC&&i():e.current.state.rowSpanning!==RC&&e.current.setState(o=>X({},o,{rowSpanning:RC}))},[e,i,t.unstable_rowSpanning])},Q4t=(e,t,n)=>X({},e,{listViewColumn:t.unstable_listColumn?X({},t.unstable_listColumn,{computedWidth:ute(n)}):void 0});function K4t(e,t){const n=()=>{e.current.setState(o=>o.listViewColumn?X({},o,{listViewColumn:X({},o.listViewColumn,{computedWidth:ute(e)})}):o)},r=M.useRef(null);Ft(e,"viewportInnerSizeChange",o=>{r.current!==o.width&&(r.current=o.width,n())}),Ft(e,"columnVisibilityModelChange",n),lr(()=>{const o=t.unstable_listColumn;o&&e.current.setState(s=>X({},s,{listViewColumn:X({},o,{computedWidth:ute(e)})}))},[e,t.unstable_listColumn]),M.useEffect(()=>{t.unstable_listView&&t.unstable_listColumn},[t.unstable_listView,t.unstable_listColumn])}function ute(e){return Is(e.current.state).viewportInnerSize.width}const Z4t=(e,t)=>{const n=xBt(e,t);return v4t(n,t),d4t(n),Cs(yBt,n,t),Cs(p4t,n,t),Cs(PBt,n,t),Cs(a4t,n,t),Cs(YBt,n,t),Cs(o4t,n,t),Cs(UBt,n,t),Cs(y4t,n,t),Cs(KBt,n,t),Cs(NBt,n,t),Cs(X4t,n,t),Cs(MBt,n,t),Cs(V4t,n,t),Cs(EBt,n,t),Cs(D4t,n,t),Cs(kNt,n,t),Cs(C4t,n,t),Cs(P4t,n,t),Cs(Q4t,n,t),GBt(n,t),g4t(n,t),kBt(n,t),l4t(n,t),Y4t(n,t),h4t(n,t),A4t(n),L4t(n,t),s4t(n,t),VBt(n,t),ZBt(n,t),BBt(n,t),b4t(n,t),ABt(n,t),H4t(n,t),QBt(n,t),k4t(n,t),x4t(n,t),TBt(n),IBt(n,t),$Bt(n,t),OBt(n,t),O4t(n,t),w4t(n,t),M4t(n),MNt(n,t),K4t(n,t),n},J4t=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:i,showLeftBorder:o,showRightBorder:s,groupId:a,pinnedPosition:l}=e,c={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",s&&"columnHeader--withRightBorder",o&&"columnHeader--withLeftBorder","withBorderColor",a===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",l===or.LEFT&&"columnHeader--pinnedLeft",l===or.RIGHT&&"columnHeader--pinnedRight",i&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Xe(c,pr,t)};function e6t(e){const{groupId:t,width:n,depth:r,maxDepth:i,fields:o,height:s,colIndex:a,hasFocus:l,tabIndex:c,isLastColumn:u,pinnedPosition:f,pinnedOffset:d}=e,h=nn(),p=yi(),g=M.useRef(null),m=Kn(),v=ut(m,G6e),y=t?v[t]:{},{headerName:b=t??"",description:w="",headerAlign:S=void 0}=y;let _;const E=t&&v[t]?.renderHeaderGroup,T=M.useMemo(()=>({groupId:t,headerName:b,description:w,depth:r,maxDepth:i,fields:o,colIndex:a,isLastColumn:u}),[t,b,w,r,i,o,a,u]);t&&E&&(_=E(T));const k=X({},e,{classes:h.classes,headerAlign:S,depth:r,isDragging:!1}),P=b??t,I=fr(),R=t===null?`empty-group-cell-${I}`:t,F=J4t(k);M.useLayoutEffect(()=>{if(l){const U=g.current.querySelector('[tabindex="0"]')||g.current;if(!U)return;if(zle())U.focus({preventScroll:!0});else{const z=m.current.getScrollPosition();U.focus(),m.current.scroll(z)}}},[m,l]);const A=M.useCallback(V=>U=>{ED(U)||m.current.publishEvent(V,T,U)},[m,T]),L=M.useMemo(()=>({onKeyDown:A("columnGroupHeaderKeyDown"),onFocus:A("columnGroupHeaderFocus"),onBlur:A("columnGroupHeaderBlur")}),[A]),$=typeof y.headerClassName=="function"?y.headerClassName(T):y.headerClassName,j=M.useMemo(()=>bU(X({},e.style),p,f,d),[f,d,e.style,p]);return O.jsx(fUe,X({ref:g,classes:F,columnMenuOpen:!1,colIndex:a,height:s,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:c,isDraggable:!1,headerComponent:_,headerClassName:$,description:w,elementId:R,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:P,"aria-colspan":o.length,"data-fields":`|-${o.join("-|-")}-|`,style:j},L))}const pSe=Oe("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),t6t=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:o,columnHeaderFocus:s,columnGroupHeaderFocus:a,headerGroupingMaxDepth:l,columnMenuState:c,columnVisibility:u,columnGroupsHeaderStructure:f,hasOtherElementInTabSequence:d}=e,[h,p]=M.useState(""),[g,m]=M.useState(""),v=ld(),y=nn(),b=ut(v,H6e),w=ut(v,Cb),S=ut(v,PNt),_=ut(v,MT),E=ut(v,Ov),T=eUe(w,S,_.left.length),k=ut(v,cU),P=ut(v,i6e),I=ut(v,$Lt),R=ut(v,NLt),F=ut(v,o6e),A=M.useCallback(Z=>m(Z.field),[]),L=M.useCallback(()=>m(""),[]),$=M.useCallback(Z=>p(Z.field),[]),j=M.useCallback(()=>p(""),[]),V=M.useMemo(()=>_.left.length?{firstColumnIndex:0,lastColumnIndex:_.left.length}:null,[_.left.length]),U=M.useMemo(()=>_.right.length?{firstColumnIndex:t.length-_.right.length,lastColumnIndex:t.length}:null,[_.right.length,t.length]);Ft(v,"columnResizeStart",A),Ft(v,"columnResizeStop",L),Ft(v,"columnHeaderDragStart",$),Ft(v,"columnHeaderDragEnd",j);const z=Z=>{const{renderContext:ge=S}=Z||{},ne=ge.firstColumnIndex,ie=ge.lastColumnIndex;return{renderedColumns:t.slice(ne,ie),firstColumnToRender:ne,lastColumnToRender:ie}},N=(Z,ge,ne,ie=!1)=>{const fe=Z?.position===or.RIGHT,ve=Z?.position===void 0,se=_.right.length>0&&fe||_.right.length===0&&ve,ue=T-ne;return O.jsxs(M.Fragment,{children:[ve&&O.jsx("div",{role:"presentation",style:{width:ue}}),ge,ve&&O.jsx("div",{role:"presentation",className:Re(ye.filler,ie&&ye["filler--borderBottom"])}),se&&O.jsx(Ule,{header:!0,pinnedRight:fe,borderBottom:ie,borderTop:!1})]})},B=(Z,ge={})=>{const{renderedColumns:ne,firstColumnToRender:ie}=z(Z),fe=[];for(let ve=0;veO.jsxs(pSe,{role:"row","aria-rowindex":l+1,ownerState:y,className:ye["row--borderBottom"],children:[V&&B({position:or.LEFT,renderContext:V},{disableReorder:!0}),B({renderContext:S}),U&&B({position:or.RIGHT,renderContext:U},{disableReorder:!0,separatorSide:Ble.Left})]}),Q=({depth:Z,params:ge})=>{const ne=z(ge);if(ne.renderedColumns.length===0)return null;const{firstColumnToRender:ie,lastColumnToRender:fe}=ne,ve=f[Z],se=t[ie].field,ue=b[se]?.[Z]??null,G=ve.findIndex(({groupId:Se,columnFields:he})=>Se===ue&&he.includes(se)),ce=t[fe-1].field,pe=b[ce]?.[Z]??null,J=ve.findIndex(({groupId:Se,columnFields:he})=>Se===pe&&he.includes(ce)),te=ve.slice(G,J+1).map(Se=>X({},Se,{columnFields:Se.columnFields.filter(he=>u[he]!==!1)})).filter(Se=>Se.columnFields.length>0),ae=te[0].columnFields.indexOf(se),Pe=te[0].columnFields.slice(0,ae).reduce((Se,he)=>{const xe=E[he];return Se+(xe.computedWidth??0)},0);let ee=ie;const re=te.map(({groupId:Se,columnFields:he},xe)=>{const me=a!==null&&a.depth===Z&&he.includes(a.field),be=o!==null&&o.depth===Z&&he.includes(o.field)?0:-1,oe={width:he.reduce((De,Ve)=>De+E[Ve].computedWidth,0),fields:he,colIndex:ee},Ee=ge.position,ke=$M(Ee,oe.width,ee,w,k,F);ee+=he.length;let ze=xe;return Ee===or.LEFT&&(ze=ee-1),O.jsx(e6t,{groupId:Se,width:oe.width,fields:oe.fields,colIndex:oe.colIndex,depth:Z,isLastColumn:xe===te.length-1,maxDepth:l,height:R,hasFocus:me,tabIndex:be,pinnedPosition:Ee,pinnedOffset:ke,showLeftBorder:ej(Ee,ze),showRightBorder:J5(Ee,ze,te.length,y.showColumnVerticalBorder,P)},xe)});return N(ge,re,Pe)};return{renderContext:S,leftRenderContext:V,rightRenderContext:U,pinnedColumns:_,visibleColumns:t,columnPositions:w,getFillers:N,getColumnHeadersRow:H,getColumnsToRender:z,getColumnGroupHeadersRows:()=>{if(l===0)return null;const Z=[];for(let ge=0;ge({role:"rowgroup"})}},n6t=["className"],r6t=e=>{const{classes:t}=e;return Xe({root:["columnHeaders"]},pr,t)},i6t=Qn("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),o6t=Tr(function(t,n){const{className:r}=t,i=st(t,n6t),o=nn(),s=r6t(o);return O.jsx(i6t,X({className:Re(s.root,r),ownerState:o},i,{role:"presentation",ref:n}))}),s6t=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],a6t=Tr(function(t,n){const{visibleColumns:r,sortColumnLookup:i,filterColumnLookup:o,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:d,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:p}=t,g=st(t,s6t),{getInnerProps:m,getColumnHeadersRow:v,getColumnGroupHeadersRows:y}=t6t({visibleColumns:r,sortColumnLookup:i,filterColumnLookup:o,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:a,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:f,columnVisibility:d,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:p});return O.jsxs(o6t,X({},g,m(),{ref:n,children:[y(),v()]}))}),l6t=Cv(a6t);function c6t(e){return null}function u6t(e){return null}const f6t=Tr(function(t,n){const i=Kn().current.getLocaleText("noResultsOverlayLabel");return O.jsx(jle,X({},t,{ref:n,children:i}))}),d6t=["sortingOrder"],h6t=M.memo(function(t){const{sortingOrder:n}=t,r=st(t,d6t),i=nn(),[o]=n,s=o==="asc"?i.slots.columnSortedAscendingIcon:i.slots.columnSortedDescendingIcon;return s?O.jsx(s,X({},r)):null}),p6t=["native"];function g6t(e){let{native:t}=e,n=st(e,p6t);return t?O.jsx("option",X({},n)):O.jsx(nr,X({},n))}const m6t={booleanCellTrueIcon:g5t,booleanCellFalseIcon:D9,columnMenuIcon:f5t,openFilterButtonIcon:i5t,filterPanelDeleteIcon:D9,columnFilteredIcon:Wwe,columnSelectorIcon:s5t,columnUnsortedIcon:h6t,columnSortedAscendingIcon:jwe,columnSortedDescendingIcon:Bwe,columnResizeIcon:a5t,densityCompactIcon:l5t,densityStandardIcon:c5t,densityComfortableIcon:u5t,exportIcon:p5t,moreActionsIcon:m5t,treeDataCollapseIcon:Vwe,treeDataExpandIcon:Uwe,groupingCriteriaCollapseIcon:Vwe,groupingCriteriaExpandIcon:Uwe,detailPanelExpandIcon:Hwe,detailPanelCollapseIcon:d5t,rowReorderIcon:Gwe,quickFilterIcon:o5t,quickFilterClearIcon:D9,columnMenuHideIcon:v5t,columnMenuSortAscendingIcon:jwe,columnMenuSortDescendingIcon:Bwe,columnMenuFilterIcon:Wwe,columnMenuManageColumnsIcon:y5t,columnMenuClearIcon:b5t,loadIcon:h5t,filterPanelAddIcon:Hwe,filterPanelRemoveAllIcon:x5t,columnReorderIcon:Gwe},v6t=X({},m6t,{baseBadge:uyt,baseCheckbox:OA,baseDivider:sa,baseTextField:Ii,baseFormControl:sd,baseSelect:Oh,baseButton:zi,baseIconButton:Mn,baseInputAdornment:oae,baseTooltip:_n,basePopper:yb,baseInputLabel:bv,baseSelectOption:g6t,baseChip:A6}),y6t=X({},v6t,{cell:$3t,skeletonCell:W3t,columnHeaderFilterIconButton:n5t,columnHeaderSortIcon:e5t,columnMenu:$5t,columnHeaders:l6t,detailPanels:c6t,footer:Ijt,footerRowCount:Xjt,toolbar:null,pinnedRows:u6t,loadingOverlay:zjt,noResultsOverlay:f6t,noRowsOverlay:jjt,pagination:Wjt,filterPanel:hjt,columnsPanel:U5t,columnsManagement:vjt,panel:q5t,row:eBt}),b6t={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",unstable_listView:!1},x6t=y6t,w6t=e=>{const t=as(),n=M3t(M.useMemo(()=>Ase({props:e,theme:t,name:"MuiDataGrid"}),[t,e])),r=M.useMemo(()=>X({},jLt,n.localeText),[n.localeText]),i=M.useMemo(()=>P3t({defaultSlots:x6t,slots:n.slots}),[n.slots]),o=M.useMemo(()=>Object.keys(ate).reduce((s,a)=>(s[a]=n[a]??ate[a],s),{}),[n]);return M.useMemo(()=>X({},n,o,{localeText:r,slots:i},b6t),[n,r,i,o])},S6t={hooks:{useGridAriaAttributes:tBt,useGridRowAriaAttributes:nBt,useCellAggregationResult:()=>null}},TUe=Tr(function(t,n){const r=w6t(t),i=Z4t(r.apiRef,r);return O.jsx(rBt,{privateApiRef:i,configuration:S6t,props:r,children:O.jsx(lzt,X({className:r.className,style:r.style,sx:r.sx},r.forwardedProps,r.slotProps?.root,{ref:n}))})}),_6t=M.memo(TUe);TUe.propTypes={apiRef:le.shape({current:le.object.isRequired}),"aria-label":le.string,"aria-labelledby":le.string,autoHeight:le.bool,autoPageSize:le.bool,autosizeOnMount:le.bool,autosizeOptions:le.shape({columns:le.arrayOf(le.string),disableColumnVirtualization:le.bool,expand:le.bool,includeHeaders:le.bool,includeOutliers:le.bool,outliersFactor:le.number}),cellModesModel:le.object,checkboxSelection:le.bool,classes:le.object,clipboardCopyCellDelimiter:le.string,columnBufferPx:le.number,columnGroupHeaderHeight:le.number,columnGroupingModel:le.arrayOf(le.object),columnHeaderHeight:le.number,columns:le.arrayOf(le.object).isRequired,columnVisibilityModel:le.object,density:le.oneOf(["comfortable","compact","standard"]),disableAutosize:le.bool,disableColumnFilter:le.bool,disableColumnMenu:le.bool,disableColumnResize:le.bool,disableColumnSelector:le.bool,disableColumnSorting:le.bool,disableDensitySelector:le.bool,disableEval:le.bool,disableMultipleRowSelection:le.bool,disableRowSelectionOnClick:le.bool,disableVirtualization:le.bool,editMode:le.oneOf(["cell","row"]),estimatedRowCount:le.number,experimentalFeatures:le.shape({warnIfFocusStateIsNotSynced:le.bool}),filterDebounceMs:le.number,filterMode:le.oneOf(["client","server"]),filterModel:le.shape({items:le.arrayOf(le.shape({field:le.string.isRequired,id:le.oneOfType([le.number,le.string]),operator:le.string.isRequired,value:le.any})).isRequired,logicOperator:le.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:le.bool,quickFilterLogicOperator:le.oneOf(["and","or"]),quickFilterValues:le.array}),forwardedProps:le.object,getCellClassName:le.func,getDetailPanelContent:le.func,getEstimatedRowHeight:le.func,getRowClassName:le.func,getRowHeight:le.func,getRowId:le.func,getRowSpacing:le.func,hideFooter:le.bool,hideFooterPagination:le.bool,hideFooterSelectedRowCount:le.bool,ignoreDiacritics:le.bool,ignoreValueFormatterDuringExport:le.oneOfType([le.shape({clipboardExport:le.bool,csvExport:le.bool}),le.bool]),indeterminateCheckboxAction:le.oneOf(["deselect","select"]),initialState:le.object,isCellEditable:le.func,isRowSelectable:le.func,keepNonExistentRowsSelected:le.bool,loading:le.bool,localeText:le.object,logger:le.shape({debug:le.func.isRequired,error:le.func.isRequired,info:le.func.isRequired,warn:le.func.isRequired}),logLevel:le.oneOf(["debug","error","info","warn",!1]),nonce:le.string,onCellClick:le.func,onCellDoubleClick:le.func,onCellEditStart:le.func,onCellEditStop:le.func,onCellKeyDown:le.func,onCellModesModelChange:le.func,onClipboardCopy:le.func,onColumnHeaderClick:le.func,onColumnHeaderContextMenu:le.func,onColumnHeaderDoubleClick:le.func,onColumnHeaderEnter:le.func,onColumnHeaderLeave:le.func,onColumnHeaderOut:le.func,onColumnHeaderOver:le.func,onColumnOrderChange:le.func,onColumnResize:le.func,onColumnVisibilityModelChange:le.func,onColumnWidthChange:le.func,onDensityChange:le.func,onFilterModelChange:le.func,onMenuClose:le.func,onMenuOpen:le.func,onPaginationMetaChange:le.func,onPaginationModelChange:le.func,onPreferencePanelClose:le.func,onPreferencePanelOpen:le.func,onProcessRowUpdateError:le.func,onResize:le.func,onRowClick:le.func,onRowCountChange:le.func,onRowDoubleClick:le.func,onRowEditStart:le.func,onRowEditStop:le.func,onRowModesModelChange:le.func,onRowSelectionModelChange:le.func,onSortModelChange:le.func,onStateChange:le.func,pageSizeOptions:le.arrayOf(le.oneOfType([le.number,le.shape({label:le.string.isRequired,value:le.number.isRequired})]).isRequired),pagination:le.oneOf([!0]),paginationMeta:le.shape({hasNextPage:le.bool}),paginationMode:le.oneOf(["client","server"]),paginationModel:le.shape({page:le.number.isRequired,pageSize:le.number.isRequired}),processRowUpdate:le.func,resetPageOnSortFilter:le.bool,resizeThrottleMs:le.number,rowBufferPx:le.number,rowCount:le.number,rowHeight:le.number,rowModesModel:le.object,rowPositionsDebounceMs:le.number,rows:le.arrayOf(le.object),rowSelection:le.bool,rowSelectionModel:le.oneOfType([le.arrayOf(le.oneOfType([le.number,le.string]).isRequired),le.number,le.string]),rowSpacingType:le.oneOf(["border","margin"]),scrollbarSize:le.number,showCellVerticalBorder:le.bool,showColumnVerticalBorder:le.bool,slotProps:le.object,slots:le.object,sortingMode:le.oneOf(["client","server"]),sortingOrder:le.arrayOf(le.oneOf(["asc","desc"])),sortModel:le.arrayOf(le.shape({field:le.string.isRequired,sort:le.oneOf(["asc","desc"])})),sx:le.oneOfType([le.arrayOf(le.oneOfType([le.func,le.object,le.bool])),le.func,le.object]),unstable_rowSpanning:le.bool,virtualizeColumnsWithAutoRowHeight:le.bool};const HA=({iconName:e})=>e?O.jsx(iae,{sx:{fontFamily:"Material Icons",textTransform:"none",lineHeight:1},children:e}):null,C6t=({id:e,style:t,label:n,icon:r,expanded:i,disabled:o,children:s,onChange:a})=>O.jsx("div",{children:O.jsxs(Use,{id:e,style:t,expanded:i,disabled:o,onChange:(l,c)=>{e&&a?.({componentType:"Accordion",id:e,property:"expanded",value:c})},children:[O.jsx(Wse,{expandIcon:r?O.jsx(HA,{iconName:r}):void 0,children:n?O.jsx(mn,{component:"span",children:n}):null}),s&&O.jsx(Vse,{children:O.jsx(vD,{nodes:s,onChange:a})})]})}),PUe=({id:e,style:t,color:n,component:r,children:i,onChange:o})=>O.jsx(bt,{id:e,style:t,color:n,component:r||"div",children:O.jsx(vD,{nodes:i,onChange:o})});function xU({title:e,children:t}){return e?O.jsx(_n,{title:e,children:t}):t}function O6t({type:e,id:t,name:n,style:r,variant:i,color:o,disabled:s,text:a,startIcon:l,endIcon:c,tooltip:u,onChange:f}){return O.jsx(xU,{title:u,children:O.jsx(zi,{id:t,name:n,style:r,variant:i,color:o,disabled:s,startIcon:l&&O.jsx(HA,{iconName:l}),endIcon:c&&O.jsx(HA,{iconName:c}),onClick:d=>{t&&f({componentType:e,id:t,property:"clicked",value:!0})},children:a})})}function E6t({type:e,id:t,name:n,value:r,disabled:i,style:o,tooltip:s,label:a,onChange:l}){return O.jsx(_n,{title:s,children:O.jsx(sd,{variant:"filled",size:"small",style:o,children:O.jsx(oh,{label:a,control:O.jsx(OA,{id:t,name:n,checked:!!r,disabled:i,onChange:c=>{if(t)return l({componentType:e,id:t,property:"value",value:c.currentTarget.checked})}})})})})}const T6t=({id:e,style:t,size:n,value:r,variant:i})=>O.jsx(Ch,{id:e,style:t,size:n,value:r,variant:i}),P6t=({id:e,style:t,orientation:n,variant:r,flexItem:i,textAlign:o,children:s,onChange:a})=>O.jsx(sa,{id:e,style:t,orientation:n,variant:r,flexItem:i,textAlign:o,children:s&&s.length&&O.jsx(vD,{nodes:s,onChange:a})});function k6t({type:e,id:t,name:n,style:r,tooltip:i,color:o,icon:s,size:a,disabled:l,onChange:c}){return O.jsx(xU,{title:i,children:O.jsx(Mn,{id:t,name:n,style:r,color:o,size:a,disabled:l,onClick:u=>{t&&c({componentType:e,id:t,property:"clicked",value:!0})},children:O.jsx(HA,{iconName:s})})})}const M6t=({id:e,style:t,value:n,variant:r})=>O.jsx(Yze,{id:e,style:t,value:n,variant:r});function A6t({type:e,id:t,name:n,value:r,disabled:i,style:o,label:s,row:a,tooltip:l,dense:c,children:u,onChange:f}){return O.jsx(xU,{title:l,children:O.jsxs(sd,{disabled:i,children:[O.jsx(qze,{children:s}),O.jsx($6,{id:t,name:n,row:a,value:r,style:o,onChange:(d,h)=>{if(t)return f({componentType:e,id:t,property:"value",value:h})},children:u&&u.map(d=>O.jsx(oh,{value:d.value,label:d.label,disabled:d.disabled,control:O.jsx(tO,{id:d.id,size:c?"small":"medium"})}))})]})})}function R6t({type:e,id:t,name:n,value:r,options:i,disabled:o,style:s,tooltip:a,label:l,multiple:c=!1,onChange:u}){const f=d=>{if(t){let h=d.target.value;!c&&typeof r=="number"&&(h=Number.parseInt(h)),u({componentType:e,id:t,property:"value",value:h})}};return O.jsx(xU,{title:a,children:O.jsxs(sd,{variant:"filled",size:"small",style:s,children:[l&&O.jsx(bv,{id:`${t}-label`,children:l}),O.jsx(Oh,{labelId:`${t}-label`,id:t,name:n,value:r,disabled:o,multiple:c,onChange:f,children:Array.isArray(i)&&i.map(I6t).map(([d,h],p)=>O.jsx(nr,{value:d,children:h},p))})]})})}function I6t(e){return mD(e)?[e,e]:typeof e=="number"?[e,e.toString()]:Array.isArray(e)?e:[e.value,e.label||`${e.value}`]}function D6t({type:e,id:t,name:n,value:r,disabled:i,style:o,label:s,onChange:a}){return O.jsx(sd,{variant:"filled",size:"small",style:o,children:O.jsx(oh,{label:s,control:O.jsx(uae,{id:t,name:n,checked:!!r,disabled:i,onChange:l=>{if(t)return a({componentType:e,id:t,property:"value",value:l.currentTarget.checked})}})})})}function L6t({type:e,id:t,value:n,children:r,disabled:i,style:o,onChange:s}){return O.jsxs(bt,{sx:{width:"100%"},style:o,children:[O.jsx(bt,{sx:{borderBottom:1,borderColor:"divider"},children:O.jsx(dae,{id:t,value:n,onChange:(a,l)=>{t&&s({componentType:e,id:t,property:"value",value:l})},children:r?.map((a,l)=>{const c=C0(a)?a:void 0;return O.jsx(PA,{style:c?.style,label:c?c.label:mD(a)?a:"",icon:c&&c.icon&&O.jsx(HA,{iconName:c.icon}),iconPosition:c?.iconPosition,disabled:i||c&&c.disabled},l)})})}),r?.map((a,l)=>{const c=C0(a)?a:void 0;return n===l&&O.jsx(PUe,{type:e,onChange:s,children:c?.children},l)})]})}const F6t=({id:e,style:t,align:n,gutterBottom:r,noWrap:i,variant:o,text:s,color:a,children:l,onChange:c})=>(l=s?[s]:l,O.jsx(mn,{id:e,style:t,align:n,gutterBottom:r,noWrap:i,variant:o,color:a,children:O.jsx(vD,{nodes:l,onChange:c})})),$6t=({type:e,id:t,style:n,defaultValue:r,ariaLabel:i,color:o,disableSwap:s,getAriaValueText:a,min:l,max:c,marks:u,orientation:f,step:d,size:h,track:p,value:g,valueLabelDisplay:m,onChange:v})=>O.jsx(Kw,{id:t,defaultValue:r,"aria-label":i,color:o,style:n,disableSwap:s,getAriaValueText:a,min:l,max:c,marks:u,orientation:f,step:d,size:h,track:p,value:g??0,valueLabelDisplay:m,onChange:(y,b,w)=>{t&&v({componentType:e,id:t,property:"value",value:b})},"data-testid":"slider-test-id"}),N6t=({type:e,id:t,style:n,rows:r,columns:i,ariaLabel:o,autoPageSize:s,checkboxSelection:a,density:l,disableAutosize:c,disableColumnFilter:u,disableColumnMenu:f,disableColumnResize:d,disableColumnSelector:h,disableColumnSorting:p,disableDensitySelector:g,disableMultipleRowSelection:m,disableRowSelectionOnClick:v,editMode:y,hideFooter:b,hideFooterPagination:w,hideFooterSelectedRowCount:S,initialState:_,loading:E,rowHeight:T,rowSelection:k,paginationModel:P,pageSizeOptions:I,onChange:R})=>i?O.jsx("div",{id:t,children:O.jsx(_6t,{rows:r,columns:i,"aria-label":o,autoPageSize:s,checkboxSelection:a,density:l,disableAutosize:c,disableColumnFilter:u,disableColumnMenu:f,disableColumnResize:d,disableColumnSelector:h,disableColumnSorting:p,disableDensitySelector:g,disableMultipleRowSelection:m,disableRowSelectionOnClick:v,hideFooterSelectedRowCount:S,editMode:y,hideFooter:b,hideFooterPagination:w,initialState:_,loading:E,onRowSelectionModelChange:F=>{if(t){const A=F.map(L=>r?.find($=>$.id===L));R({componentType:e,id:t,property:"value",value:A})}},paginationModel:P,pageSizeOptions:I,rowHeight:T,rowSelection:k,sx:n,"data-testid":"data-grid-test-id"})}):void 0,z6t=({id:e,type:t,style:n,open:r,title:i,titleProps:o,content:s,contentProps:a,disableEscapeKeyDown:l,fullScreen:c,fullWidth:u,maxWidth:f,scroll:d,ariaLabel:h,ariaDescribedBy:p,children:g,onChange:m})=>r?O.jsxs(Gu,{id:e,style:n,open:r,onClose:(v,y)=>{e&&m({componentType:t,id:e,property:"open",value:!1})},disableEscapeKeyDown:l,fullScreen:c,fullWidth:u,maxWidth:f,scroll:d,"aria-label":h,"aria-describedby":p,children:[i&&O.jsx(hg,{...o,children:i}),s&&O.jsx(Fc,{...a,children:O.jsx(Gze,{children:s})}),g&&O.jsx(xb,{children:O.jsx(vD,{nodes:g,onChange:m})})]}):void 0,j6t=({type:e,id:t,style:n,rows:r,columns:i,hover:o,stickyHeader:s,onChange:a})=>{if(!i||i.length===0)return O.jsx("div",{children:"No columns provided."});if(!r||r.length===0)return O.jsx("div",{children:"No rows provided."});const l=c=>{const u=c.reduce((f,d,h)=>{const p=i[h]?.id;return p&&(f[p]=d),f},{});t&&a({componentType:e,id:t,property:"value",value:u})};return O.jsx(fae,{component:fa,sx:n,id:t,children:O.jsxs(N6,{stickyHeader:s,children:[O.jsx(a5e,{children:O.jsx(hf,{children:i.map(c=>O.jsx(mi,{align:c.align||"inherit",size:c.size||"medium",children:c.label},c.id))})}),O.jsx(j6,{children:r.map((c,u)=>O.jsx(hf,{hover:o,onClick:()=>l(c),children:c?.map((f,d)=>O.jsx(mi,{align:i[d].align||"inherit",size:i[d].size||"medium",children:f},d))},u))})]})})};function B6t(){return{components:[["Accordion",C6t],["Box",PUe],["Button",O6t],["Checkbox",E6t],["CircularProgress",T6t],["DataGrid",N6t],["Dialog",z6t],["Divider",P6t],["IconButton",k6t],["LinearProgress",M6t],["RadioGroup",A6t],["Select",R6t],["Slider",$6t],["Switch",D6t],["Table",j6t],["Tabs",L6t],["Typography",F6t]]}}const U6t=/("(?:[^\\"]|\\.)*")|[:,]/g;function j9(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),r=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:i}=t;return(function o(s,a,l){s&&typeof s.toJSON=="function"&&(s=s.toJSON());const c=JSON.stringify(s,i);if(c===void 0)return c;const u=r-a.length-l;if(c.length<=u){const f=c.replace(U6t,(d,h)=>h||`${d} `);if(f.length<=u)return f}if(i!=null&&(s=JSON.parse(c),i=void 0),typeof s=="object"&&s!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(s)){p="[",g="]";const{length:m}=s;for(;h0)return[p,n+d.join(`, +${f}`),g].join(` +${a}`)}return c})(e,"",0)}function Hc(e,t,n){return e.fields=t||[],e.fname=n,e}function Bo(e){return e==null?null:e.fname}function dl(e){return e==null?null:e.fields}function kUe(e){return e.length===1?V6t(e[0]):W6t(e)}const V6t=e=>function(t){return t[e]},W6t=e=>{const t=e.length;return function(n){for(let r=0;rs?c():s=a+1:l==="["?(a>s&&c(),i=s=a+1):l==="]"&&(i||et("Access path missing open bracket: "+e),i>0&&c(),i=0,s=a+1)}return i&&et("Access path missing closing bracket: "+e),r&&et("Access path missing closing quote: "+e),a>s&&(a++,c()),t}function Yf(e,t,n){const r=vg(e);return e=r.length===1?r[0]:e,Hc((n&&n.get||kUe)(r),[e],t||e)}const TD=Yf("id"),ml=Hc(e=>e,[],"identity"),t0=Hc(()=>0,[],"zero"),FT=Hc(()=>1,[],"one"),Qf=Hc(()=>!0,[],"true"),Ay=Hc(()=>!1,[],"false"),Gle=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]=="function"),"__proto__"]);function H6t(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const MUe=0,qle=1,Xle=2,AUe=3,RUe=4;function wU(e,t,n=H6t){let r=e||MUe;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=qle&&n(t||"error","ERROR",arguments),this},warn(){return r>=Xle&&n(t||"warn","WARN",arguments),this},info(){return r>=AUe&&n(t||"log","INFO",arguments),this},debug(){return r>=RUe&&n(t||"log","DEBUG",arguments),this}}}var it=Array.isArray;function Bt(e){return e===Object(e)}const gSe=e=>e!=="__proto__";function $T(...e){return e.reduce((t,n)=>{for(const r in n)if(r==="signals")t.signals=G6t(t.signals,n.signals);else{const i=r==="legend"?{layout:1}:r==="style"?!0:null;NT(t,r,n[r],i)}return t},{})}function NT(e,t,n,r){if(!gSe(t))return;let i,o;if(Bt(n)&&!it(n)){o=Bt(e[t])?e[t]:e[t]={};for(i in n)r&&(r===!0||r[i])?NT(o,i,n[i]):gSe(i)&&(o[i]=n[i])}else e[t]=n}function G6t(e,t){if(e==null)return t;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return t.forEach(i),e.forEach(i),r}function Ar(e){return e[e.length-1]}function cl(e){return e==null||e===""?null:+e}const IUe=e=>t=>e*Math.exp(t),DUe=e=>t=>Math.log(e*t),LUe=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),FUe=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,rj=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function SU(e,t,n,r){const i=n(e[0]),o=n(Ar(e)),s=(o-i)*t;return[r(i-s),r(o-s)]}function $Ue(e,t){return SU(e,t,cl,ml)}function NUe(e,t){var n=Math.sign(e[0]);return SU(e,t,DUe(n),IUe(n))}function zUe(e,t,n){return SU(e,t,rj(n),rj(1/n))}function jUe(e,t,n){return SU(e,t,LUe(n),FUe(n))}function _U(e,t,n,r,i){const o=r(e[0]),s=r(Ar(e)),a=t!=null?r(t):(o+s)/2;return[i(a+(o-a)*n),i(a+(s-a)*n)]}function Yle(e,t,n){return _U(e,t,n,cl,ml)}function Qle(e,t,n){const r=Math.sign(e[0]);return _U(e,t,n,DUe(r),IUe(r))}function ij(e,t,n,r){return _U(e,t,n,rj(r),rj(1/r))}function Kle(e,t,n,r){return _U(e,t,n,LUe(r),FUe(r))}function BUe(e){return 1+~~(new Date(e).getMonth()/3)}function UUe(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Ht(e){return e!=null?it(e)?e:[e]:[]}function VUe(e,t,n){let r=e[0],i=e[1],o;return i=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-o),r+o]}function Jn(e){return typeof e=="function"}const q6t="descending";function Zle(e,t,n){n=n||{},t=Ht(t)||[];const r=[],i=[],o={},s=n.comparator||X6t;return Ht(e).forEach((a,l)=>{a!=null&&(r.push(t[l]===q6t?-1:1),i.push(a=Jn(a)?a:Yf(a,null,n)),(dl(a)||[]).forEach(c=>o[c]=1))}),i.length===0?null:Hc(s(i,r),Object.keys(o))}const zT=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),X6t=(e,t)=>e.length===1?Y6t(e[0],t[0]):Q6t(e,t,e.length),Y6t=(e,t)=>function(n,r){return zT(e(n),e(r))*t},Q6t=(e,t,n)=>(t.push(0),function(r,i){let o,s=0,a=-1;for(;s===0&&++ae}function Jle(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}function rr(e){for(let t,n,r=1,i=arguments.length;rs&&(s=i))}else{for(i=t(e[n]);ns&&(s=i))}return[o,s]}function WUe(e,t){const n=e.length;let r=-1,i,o,s,a,l;if(t==null){for(;++r=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s{i.set(o,e[o])}),i}function HUe(e,t,n,r,i,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],l=Ar(e),c;lo&&(s=i,i=o,o=s),n=n===void 0||n,r=r===void 0||r,(n?i<=e:ia.replace(/\\(.)/g,"$1")):Ht(e));const r=e&&e.length,i=n&&n.get||kUe,o=a=>i(t?[a]:vg(a));let s;if(!r)s=function(){return""};else if(r===1){const a=o(e[0]);s=function(l){return""+a(l)}}else{const a=e.map(o);s=function(l){let c=""+a[0](l),u=0;for(;++u{t={},n={},r=0},o=(s,a)=>(++r>e&&(n=t,t={},r=1),t[s]=a);return i(),{clear:i,has:s=>Qt(t,s)||Qt(n,s),get:s=>Qt(t,s)?t[s]:Qt(n,s)?o(s,n[s]):void 0,set:(s,a)=>Qt(t,s)?t[s]=a:o(s,a)}}function YUe(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const s=r||new t.constructor(i+o);let a=0,l=0,c=0;for(;a0?n[l++]:t[a++];for(;a=0;)n+=e;return n}function QUe(e,t,n,r){const i=n||" ",o=e+"",s=t-o.length;return s<=0?o:r==="left"?q2(i,s)+o:r==="center"?q2(i,~~(s/2))+o+q2(i,Math.ceil(s/2)):o+q2(i,s)}function PD(e){return e&&Ar(e)-e[0]||0}function Tt(e){return it(e)?`[${e.map(t=>t===null?"null":Tt(t))}]`:Bt(e)||Ut(e)?JSON.stringify(e).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):e}function nce(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const Z6t=e=>Qr(e)||P0(e)?e:Date.parse(e);function rce(e,t){return t=t||Z6t,e==null||e===""?null:t(e)}function ice(e){return e==null||e===""?null:e+""}function mh(e){const t={},n=e.length;for(let r=0;r9999?"+"+fc(e,6):fc(e,4)}function tUt(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":eUt(e.getUTCFullYear())+"-"+fc(e.getUTCMonth()+1,2)+"-"+fc(e.getUTCDate(),2)+(i?"T"+fc(t,2)+":"+fc(n,2)+":"+fc(r,2)+"."+fc(i,3)+"Z":r?"T"+fc(t,2)+":"+fc(n,2)+":"+fc(r,2)+"Z":n||t?"T"+fc(t,2)+":"+fc(n,2)+"Z":"")}function nUt(e){var t=new RegExp('["'+e+` +\r]`),n=e.charCodeAt(0);function r(f,d){var h,p,g=i(f,function(m,v){if(h)return h(m,v-1);p=m,h=d?J6t(m,d):ZUe(m)});return g.columns=p||[],g}function i(f,d){var h=[],p=f.length,g=0,m=0,v,y=p<=0,b=!1;f.charCodeAt(p-1)===Ik&&--p,f.charCodeAt(p-1)===V9&&--p;function w(){if(y)return B9;if(b)return b=!1,mSe;var _,E=g,T;if(f.charCodeAt(E)===U9){for(;g++=p?y=!0:(T=f.charCodeAt(g++))===Ik?b=!0:T===V9&&(b=!0,f.charCodeAt(g)===Ik&&++g),f.slice(E+1,_-1).replace(/""/g,'"')}for(;g1)r=yWt(e,t,n);else for(i=0,r=new Array(o=e.arcs.length);it?1:e>=t?0:NaN}function bWt(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function XT(e){let t,n,r;e.length!==2?(t=Vp,n=(a,l)=>Vp(e(a),l),r=(a,l)=>e(a)-l):(t=e===Vp||e===bWt?e:xWt,n=e,r=e);function i(a,l,c=0,u=a.length){if(c>>1;n(a[f],l)<0?c=f+1:u=f}while(c>>1;n(a[f],l)<=0?c=f+1:u=f}while(cc&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function xWt(){return 0}function gWe(e){return e===null?NaN:+e}function*wWt(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const mWe=XT(Vp),dv=mWe.right,SWt=mWe.left;XT(gWe).center;function _Wt(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function CWt(e,t){const n=_Wt(e,t);return n&&Math.sqrt(n)}class Hl{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}class bCe extends Map{constructor(t,n=bWe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(wne(this,t))}has(t){return super.has(wne(this,t))}set(t,n){return super.set(vWe(this,t),n)}delete(t){return super.delete(yWe(this,t))}}class Aj extends Set{constructor(t,n=bWe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const r of t)this.add(r)}has(t){return super.has(wne(this,t))}add(t){return super.add(vWe(this,t))}delete(t){return super.delete(yWe(this,t))}}function wne({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function vWe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function yWe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function bWe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function OWt(e,t){return Array.from(t,n=>e[n])}function EWt(e=Vp){if(e===Vp)return xWe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function xWe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const TWt=Math.sqrt(50),PWt=Math.sqrt(10),kWt=Math.sqrt(2);function Rj(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=TWt?10:o>=PWt?5:o>=kWt?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/ct&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*ct&&--l),l0))return[];if(e===t)return[e];const r=t=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function Cne(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function wWe(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?xWe:EWt(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(t-c*f/l+d)),p=Math.min(r,Math.floor(t+(l-c)*f/l+d));wWe(e,t,h,p,i)}const o=e[t];let s=n,a=r;for(Bk(e,n,t),i(e[r],o)>0&&Bk(e,n,r);s0;)--a}i(e[n],o)===0?Bk(e,n,a):(++a,Bk(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Bk(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ij(e,t,n){if(e=Float64Array.from(wWt(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Cne(e);if(t>=1)return N1(e);var r,i=(r-1)*t,o=Math.floor(i),s=N1(wWe(e,o).subarray(0,o+1)),a=Cne(e.subarray(o+1));return s+(a-s)*(i-o)}}function SWe(e,t,n=gWe){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function MWt(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function _We(e,t){return Ij(e,.5,t)}function*AWt(e){for(const t of e)yield*t}function CWe(e){return Array.from(AWt(e))}function Tc(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Dj(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function nE(e){return e=Dj(Math.abs(e)),e?e[1]:NaN}function FWt(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function $Wt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var NWt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pw(e){if(!(t=NWt.exec(e)))throw new Error("invalid format: "+e);var t;return new wue({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}pw.prototype=wue.prototype;function wue(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}wue.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function zWt(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var EWe;function jWt(e,t){var n=Dj(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(EWe=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Dj(e,Math.max(0,t+o-1))[0]}function xCe(e,t){var n=Dj(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const wCe={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:LWt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>xCe(e*100,t),r:xCe,s:jWt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function SCe(e){return e}var _Ce=Array.prototype.map,CCe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function TWe(e){var t=e.grouping===void 0||e.thousands===void 0?SCe:FWt(_Ce.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?SCe:$Wt(_Ce.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f){f=pw(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,v=f.width,y=f.comma,b=f.precision,w=f.trim,S=f.type;S==="n"?(y=!0,S="g"):wCe[S]||(b===void 0&&(b=12),w=!0,S="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=g==="$"?r:/[%p]/.test(S)?s:"",T=wCe[S],k=/[defgprs%]/.test(S);b=b===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function P(R){var I=_,F=E,A,L,$;if(S==="c")F=T(R)+F,R="";else{R=+R;var j=R<0||1/R<0;if(R=isNaN(R)?l:T(Math.abs(R),b),w&&(R=zWt(R)),j&&+R==0&&p!=="+"&&(j=!1),I=(j?p==="("?p:a:p==="-"||p==="("?"":p)+I,F=(S==="s"?CCe[8+EWe/3]:"")+F+(j&&p==="("?")":""),k){for(A=-1,L=R.length;++A$||$>57){F=($===46?i+R.slice(A+1):R.slice(A))+F,R=R.slice(0,A);break}}}y&&!m&&(R=t(R,1/0));var V=I.length+R.length+F.length,U=V>1)+I+R+F+U.slice(V);break;default:R=U+I+R+F;break}return o(R)}return P.toString=function(){return f+""},P}function u(f,d){var h=c((f=pw(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(nE(d)/3)))*3,g=Math.pow(10,-p),m=CCe[8+p/3];return function(v){return h(g*v)+m}}return{format:c,formatPrefix:u}}var nN,KU,Sue;BWt({thousands:",",grouping:[3],currency:["$",""]});function BWt(e){return nN=TWe(e),KU=nN.format,Sue=nN.formatPrefix,nN}function PWe(e){return Math.max(0,-nE(Math.abs(e)))}function kWe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(nE(t)/3)))*3-nE(Math.abs(e)))}function MWe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,nE(t)-nE(e))+1}const oq=new Date,sq=new Date;function zs(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),t(o,a),e(o);while(czs(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(oq.setTime(+o),sq.setTime(+s),e(oq),e(sq),Math.floor(n(oq,sq))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const rE=zs(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rE.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?zs(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rE);rE.range;const Im=1e3,Ef=Im*60,Dm=Ef*60,hv=Dm*24,_ue=hv*7,OCe=hv*30,aq=hv*365,Lm=zs(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Im)},(e,t)=>(t-e)/Im,e=>e.getUTCSeconds());Lm.range;const ZU=zs(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Im)},(e,t)=>{e.setTime(+e+t*Ef)},(e,t)=>(t-e)/Ef,e=>e.getMinutes());ZU.range;const JU=zs(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ef)},(e,t)=>(t-e)/Ef,e=>e.getUTCMinutes());JU.range;const eV=zs(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Im-e.getMinutes()*Ef)},(e,t)=>{e.setTime(+e+t*Dm)},(e,t)=>(t-e)/Dm,e=>e.getHours());eV.range;const tV=zs(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dm)},(e,t)=>(t-e)/Dm,e=>e.getUTCHours());tV.range;const qm=zs(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ef)/hv,e=>e.getDate()-1);qm.range;const L0=zs(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/hv,e=>e.getUTCDate()-1);L0.range;const AWe=zs(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/hv,e=>Math.floor(e/hv));AWe.range;function yS(e){return zs(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ef)/_ue)}const YT=yS(0),Lj=yS(1),UWt=yS(2),VWt=yS(3),iE=yS(4),WWt=yS(5),HWt=yS(6);YT.range;Lj.range;UWt.range;VWt.range;iE.range;WWt.range;HWt.range;function bS(e){return zs(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/_ue)}const QT=bS(0),Fj=bS(1),GWt=bS(2),qWt=bS(3),oE=bS(4),XWt=bS(5),YWt=bS(6);QT.range;Fj.range;GWt.range;qWt.range;oE.range;XWt.range;YWt.range;const rR=zs(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());rR.range;const iR=zs(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());iR.range;const ng=zs(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ng.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zs(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ng.range;const rg=zs(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());rg.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zs(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});rg.range;function RWe(e,t,n,r,i,o){const s=[[Lm,1,Im],[Lm,5,5*Im],[Lm,15,15*Im],[Lm,30,30*Im],[o,1,Ef],[o,5,5*Ef],[o,15,15*Ef],[o,30,30*Ef],[i,1,Dm],[i,3,3*Dm],[i,6,6*Dm],[i,12,12*Dm],[r,1,hv],[r,2,2*hv],[n,1,_ue],[t,1,OCe],[t,3,3*OCe],[e,1,aq]];function a(c,u,f){const d=um).right(s,d);if(h===s.length)return e.every(K0(c/aq,u/aq,f));if(h===0)return rE.every(Math.max(K0(c,u,f),1));const[p,g]=s[d/s[h-1][2](e[t]=1+n,e),{});function Oue(e){const t=Vt(e).slice(),n={};return t.length||et("Missing time unit."),t.forEach(i=>{Yt(lq,i)?n[i]=1:et(`Invalid time unit: ${i}.`)}),(n[Ds]||n[ll]?1:0)+(n[zc]||n[pl]||n[jc]?1:0)+(n[ig]?1:0)>1&&et(`Incompatible time units: ${e}`),t.sort((i,o)=>lq[i]-lq[o]),t}const eHt={[$a]:"%Y ",[zc]:"Q%q ",[pl]:"%b ",[jc]:"%d ",[Ds]:"W%U ",[ll]:"%a ",[ig]:"%j ",[ju]:"%H:00",[Bu]:"00:%M",[Zf]:":%S",[yh]:".%L",[`${$a}-${pl}`]:"%Y-%m ",[`${$a}-${pl}-${jc}`]:"%Y-%m-%d ",[`${ju}-${Bu}`]:"%H:%M"};function IWe(e,t){const n=nr({},eHt,t),r=Oue(e),i=r.length;let o="",s=0,a,l;for(s=0;ss;--a)if(l=r.slice(s,a).join("-"),n[l]!=null){o+=n[l],s=a;break}return o.trim()}const t1=new Date;function Eue(e){return t1.setFullYear(e),t1.setMonth(0),t1.setDate(1),t1.setHours(0,0,0,0),t1}function DWe(e){return FWe(new Date(e))}function LWe(e){return One(new Date(e))}function FWe(e){return qm.count(Eue(e.getFullYear())-1,e)}function One(e){return YT.count(Eue(e.getFullYear())-1,e)}function Ene(e){return Eue(e).getDay()}function tHt(e,t,n,r,i,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,r,i,o,s);return a.setFullYear(e),a}return new Date(e,t,n,r,i,o,s)}function $We(e){return zWe(new Date(e))}function NWe(e){return Tne(new Date(e))}function zWe(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return L0.count(t-1,e)}function Tne(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return QT.count(t-1,e)}function Pne(e){return t1.setTime(Date.UTC(e,0,1)),t1.getUTCDay()}function nHt(e,t,n,r,i,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,r,i,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,r,i,o,s))}function jWe(e,t,n,r,i){const o=t||1,s=Mr(e),a=(v,y,b)=>(b=b||v,rHt(n[b],r[b],v===s&&o,y)),l=new Date,c=vh(e),u=c[$a]?a($a):yl(2012),f=c[pl]?a(pl):c[zc]?a(zc):o0,d=c[Ds]&&c[ll]?a(ll,1,Ds+ll):c[Ds]?a(Ds,1):c[ll]?a(ll,1):c[jc]?a(jc,1):c[ig]?a(ig,1):HT,h=c[ju]?a(ju):o0,p=c[Bu]?a(Bu):o0,g=c[Zf]?a(Zf):o0,m=c[yh]?a(yh):o0;return function(v){l.setTime(+v);const y=u(l);return i(y,f(l),d(l,y),h(l),p(l),g(l),m(l))}}function rHt(e,t,n,r){const i=n<=1?e:r?(o,s)=>r+n*Math.floor((e(o,s)-r)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(i(o,s),s):i}function sE(e,t,n){return t+e*7-(n+6)%7}const iHt={[$a]:e=>e.getFullYear(),[zc]:e=>Math.floor(e.getMonth()/3),[pl]:e=>e.getMonth(),[jc]:e=>e.getDate(),[ju]:e=>e.getHours(),[Bu]:e=>e.getMinutes(),[Zf]:e=>e.getSeconds(),[yh]:e=>e.getMilliseconds(),[ig]:e=>FWe(e),[Ds]:e=>One(e),[Ds+ll]:(e,t)=>sE(One(e),e.getDay(),Ene(t)),[ll]:(e,t)=>sE(1,e.getDay(),Ene(t))},oHt={[zc]:e=>3*e,[Ds]:(e,t)=>sE(e,0,Ene(t))};function BWe(e,t){return jWe(e,t||1,iHt,oHt,tHt)}const sHt={[$a]:e=>e.getUTCFullYear(),[zc]:e=>Math.floor(e.getUTCMonth()/3),[pl]:e=>e.getUTCMonth(),[jc]:e=>e.getUTCDate(),[ju]:e=>e.getUTCHours(),[Bu]:e=>e.getUTCMinutes(),[Zf]:e=>e.getUTCSeconds(),[yh]:e=>e.getUTCMilliseconds(),[ig]:e=>zWe(e),[Ds]:e=>Tne(e),[ll]:(e,t)=>sE(1,e.getUTCDay(),Pne(t)),[Ds+ll]:(e,t)=>sE(Tne(e),e.getUTCDay(),Pne(t))},aHt={[zc]:e=>3*e,[Ds]:(e,t)=>sE(e,0,Pne(t))};function UWe(e,t){return jWe(e,t||1,sHt,aHt,nHt)}const lHt={[$a]:ng,[zc]:rR.every(3),[pl]:rR,[Ds]:YT,[jc]:qm,[ll]:qm,[ig]:qm,[ju]:eV,[Bu]:ZU,[Zf]:Lm,[yh]:rE},cHt={[$a]:rg,[zc]:iR.every(3),[pl]:iR,[Ds]:QT,[jc]:L0,[ll]:L0,[ig]:L0,[ju]:tV,[Bu]:JU,[Zf]:Lm,[yh]:rE};function KT(e){return lHt[e]}function ZT(e){return cHt[e]}function VWe(e,t,n){return e?e.offset(t,n):void 0}function WWe(e,t,n){return VWe(KT(e),t,n)}function HWe(e,t,n){return VWe(ZT(e),t,n)}function GWe(e,t,n,r){return e?e.range(t,n,r):void 0}function qWe(e,t,n,r){return GWe(KT(e),t,n,r)}function XWe(e,t,n,r){return GWe(ZT(e),t,n,r)}const iM=1e3,oM=iM*60,sM=oM*60,nV=sM*24,uHt=nV*7,ECe=nV*30,kne=nV*365,YWe=[$a,pl,jc,ju,Bu,Zf,yh],aM=YWe.slice(0,-1),lM=aM.slice(0,-1),cM=lM.slice(0,-1),fHt=cM.slice(0,-1),dHt=[$a,Ds],TCe=[$a,pl],QWe=[$a],Uk=[[aM,1,iM],[aM,5,5*iM],[aM,15,15*iM],[aM,30,30*iM],[lM,1,oM],[lM,5,5*oM],[lM,15,15*oM],[lM,30,30*oM],[cM,1,sM],[cM,3,3*sM],[cM,6,6*sM],[cM,12,12*sM],[fHt,1,nV],[dHt,1,uHt],[TCe,1,ECe],[TCe,3,3*ECe],[QWe,1,kne]];function KWe(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(jD(t))/n;let i=XT(a=>a[2]).right(Uk,r),o,s;return i===Uk.length?(o=QWe,s=K0(t[0]/kne,t[1]/kne,n)):i?(i=Uk[r/Uk[i-1][2]53)return null;"w"in se||(se.w=1),"Z"in se?(G=uq(Vk(se.y,0,1)),ce=G.getUTCDay(),G=ce>4||ce===0?Fj.ceil(G):Fj(G),G=L0.offset(G,(se.V-1)*7),se.y=G.getUTCFullYear(),se.m=G.getUTCMonth(),se.d=G.getUTCDate()+(se.w+6)%7):(G=cq(Vk(se.y,0,1)),ce=G.getDay(),G=ce>4||ce===0?Lj.ceil(G):Lj(G),G=qm.offset(G,(se.V-1)*7),se.y=G.getFullYear(),se.m=G.getMonth(),se.d=G.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),ce="Z"in se?uq(Vk(se.y,0,1)).getUTCDay():cq(Vk(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(ce+5)%7:se.w+se.U*7-(ce+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,uq(se)):cq(se)}}function T(ne,fe,me,se){for(var ue=0,G=fe.length,ce=me.length,he,J;ue=ce)return-1;if(he=fe.charCodeAt(ue++),he===37){if(he=fe.charAt(ue++),J=S[he in PCe?fe.charAt(ue++):he],!J||(se=J(ne,me,se))<0)return-1}else if(he!=me.charCodeAt(se++))return-1}return se}function k(ne,fe,me){var se=c.exec(fe.slice(me));return se?(ne.p=u.get(se[0].toLowerCase()),me+se[0].length):-1}function P(ne,fe,me){var se=h.exec(fe.slice(me));return se?(ne.w=p.get(se[0].toLowerCase()),me+se[0].length):-1}function R(ne,fe,me){var se=f.exec(fe.slice(me));return se?(ne.w=d.get(se[0].toLowerCase()),me+se[0].length):-1}function I(ne,fe,me){var se=v.exec(fe.slice(me));return se?(ne.m=y.get(se[0].toLowerCase()),me+se[0].length):-1}function F(ne,fe,me){var se=g.exec(fe.slice(me));return se?(ne.m=m.get(se[0].toLowerCase()),me+se[0].length):-1}function A(ne,fe,me){return T(ne,t,fe,me)}function L(ne,fe,me){return T(ne,n,fe,me)}function $(ne,fe,me){return T(ne,r,fe,me)}function j(ne){return s[ne.getDay()]}function V(ne){return o[ne.getDay()]}function U(ne){return l[ne.getMonth()]}function z(ne){return a[ne.getMonth()]}function N(ne){return i[+(ne.getHours()>=12)]}function B(ne){return 1+~~(ne.getMonth()/3)}function H(ne){return s[ne.getUTCDay()]}function Q(ne){return o[ne.getUTCDay()]}function Y(ne){return l[ne.getUTCMonth()]}function Z(ne){return a[ne.getUTCMonth()]}function pe(ne){return i[+(ne.getUTCHours()>=12)]}function ie(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var fe=_(ne+="",b);return fe.toString=function(){return ne},fe},parse:function(ne){var fe=E(ne+="",!1);return fe.toString=function(){return ne},fe},utcFormat:function(ne){var fe=_(ne+="",w);return fe.toString=function(){return ne},fe},utcParse:function(ne){var fe=E(ne+="",!0);return fe.toString=function(){return ne},fe}}}var PCe={"-":"",_:" ",0:"0"},da=/^\s*\d+/,hHt=/^%/,pHt=/[\\^$*+?|[\]().{}]/g;function Kr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function mHt(e,t,n){var r=da.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vHt(e,t,n){var r=da.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function yHt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bHt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xHt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function kCe(e,t,n){var r=da.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function MCe(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function wHt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function SHt(e,t,n){var r=da.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function _Ht(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ACe(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function CHt(e,t,n){var r=da.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function RCe(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function OHt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function EHt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function THt(e,t,n){var r=da.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function PHt(e,t,n){var r=da.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function kHt(e,t,n){var r=hHt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function MHt(e,t,n){var r=da.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function AHt(e,t,n){var r=da.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ICe(e,t){return Kr(e.getDate(),t,2)}function RHt(e,t){return Kr(e.getHours(),t,2)}function IHt(e,t){return Kr(e.getHours()%12||12,t,2)}function DHt(e,t){return Kr(1+qm.count(ng(e),e),t,3)}function JWe(e,t){return Kr(e.getMilliseconds(),t,3)}function LHt(e,t){return JWe(e,t)+"000"}function FHt(e,t){return Kr(e.getMonth()+1,t,2)}function $Ht(e,t){return Kr(e.getMinutes(),t,2)}function NHt(e,t){return Kr(e.getSeconds(),t,2)}function zHt(e){var t=e.getDay();return t===0?7:t}function jHt(e,t){return Kr(YT.count(ng(e)-1,e),t,2)}function eHe(e){var t=e.getDay();return t>=4||t===0?iE(e):iE.ceil(e)}function BHt(e,t){return e=eHe(e),Kr(iE.count(ng(e),e)+(ng(e).getDay()===4),t,2)}function UHt(e){return e.getDay()}function VHt(e,t){return Kr(Lj.count(ng(e)-1,e),t,2)}function WHt(e,t){return Kr(e.getFullYear()%100,t,2)}function HHt(e,t){return e=eHe(e),Kr(e.getFullYear()%100,t,2)}function GHt(e,t){return Kr(e.getFullYear()%1e4,t,4)}function qHt(e,t){var n=e.getDay();return e=n>=4||n===0?iE(e):iE.ceil(e),Kr(e.getFullYear()%1e4,t,4)}function XHt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Kr(t/60|0,"0",2)+Kr(t%60,"0",2)}function DCe(e,t){return Kr(e.getUTCDate(),t,2)}function YHt(e,t){return Kr(e.getUTCHours(),t,2)}function QHt(e,t){return Kr(e.getUTCHours()%12||12,t,2)}function KHt(e,t){return Kr(1+L0.count(rg(e),e),t,3)}function tHe(e,t){return Kr(e.getUTCMilliseconds(),t,3)}function ZHt(e,t){return tHe(e,t)+"000"}function JHt(e,t){return Kr(e.getUTCMonth()+1,t,2)}function eGt(e,t){return Kr(e.getUTCMinutes(),t,2)}function tGt(e,t){return Kr(e.getUTCSeconds(),t,2)}function nGt(e){var t=e.getUTCDay();return t===0?7:t}function rGt(e,t){return Kr(QT.count(rg(e)-1,e),t,2)}function nHe(e){var t=e.getUTCDay();return t>=4||t===0?oE(e):oE.ceil(e)}function iGt(e,t){return e=nHe(e),Kr(oE.count(rg(e),e)+(rg(e).getUTCDay()===4),t,2)}function oGt(e){return e.getUTCDay()}function sGt(e,t){return Kr(Fj.count(rg(e)-1,e),t,2)}function aGt(e,t){return Kr(e.getUTCFullYear()%100,t,2)}function lGt(e,t){return e=nHe(e),Kr(e.getUTCFullYear()%100,t,2)}function cGt(e,t){return Kr(e.getUTCFullYear()%1e4,t,4)}function uGt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?oE(e):oE.ceil(e),Kr(e.getUTCFullYear()%1e4,t,4)}function fGt(){return"+0000"}function LCe(){return"%"}function FCe(e){return+e}function $Ce(e){return Math.floor(+e/1e3)}var k_,Tue,rHe,Pue,iHe;dGt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function dGt(e){return k_=ZWe(e),Tue=k_.format,rHe=k_.parse,Pue=k_.utcFormat,iHe=k_.utcParse,k_}function uM(e){const t={};return n=>t[n]||(t[n]=e(n))}function hGt(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=pGt(r,i);const s=oi;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+s}}function pGt(e,t){let n=e.lastIndexOf("e"),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function oHe(e){const t=uM(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(r){const i=pw(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return hGt(t(i),t(".1f")(1)[1])}else return t(i)},formatSpan(r,i,o,s){s=pw(s??",f");const a=K0(r,i,o),l=Math.max(Math.abs(r),Math.abs(i));let c;if(s.precision==null)switch(s.type){case"s":return isNaN(c=kWe(a,l))||(s.precision=c),n(s,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=MWe(a,l))||(s.precision=c-(s.type==="e"));break}case"f":case"%":{isNaN(c=PWe(a))||(s.precision=c-(s.type==="%")*2);break}}return t(s)}}}let Mne;sHe();function sHe(){return Mne=oHe({format:KU,formatPrefix:Sue})}function aHe(e){return oHe(TWe(e))}function $j(e){return arguments.length?Mne=aHe(e):Mne}function NCe(e,t,n){n=n||{},Ht(n)||et(`Invalid time multi-format specifier: ${n}`);const r=t(Zf),i=t(Bu),o=t(ju),s=t(jc),a=t(Ds),l=t(pl),c=t(zc),u=t($a),f=e(n[yh]||".%L"),d=e(n[Zf]||":%S"),h=e(n[Bu]||"%I:%M"),p=e(n[ju]||"%I %p"),g=e(n[jc]||n[ll]||"%a %d"),m=e(n[Ds]||"%b %d"),v=e(n[pl]||"%B"),y=e(n[zc]||"%B"),b=e(n[$a]||"%Y");return w=>(r(w)Kt(r)?t(r):NCe(t,KT,r),utcFormat:r=>Kt(r)?n(r):NCe(n,ZT,r),timeParse:uM(e.parse),utcParse:uM(e.utcParse)}}let Ane;cHe();function cHe(){return Ane=lHe({format:Tue,parse:rHe,utcFormat:Pue,utcParse:iHe})}function uHe(e){return lHe(ZWe(e))}function oR(e){return arguments.length?Ane=uHe(e):Ane}const Rne=(e,t)=>nr({},e,t);function fHe(e,t){const n=e?aHe(e):$j(),r=t?uHe(t):oR();return Rne(n,r)}function kue(e,t){const n=arguments.length;return n&&n!==2&&et("defaultLocale expects either zero or two arguments."),n?Rne($j(e),oR(t)):Rne($j(),oR())}function gGt(){return sHe(),cHe(),kue()}const mGt=/^(data:|([A-Za-z]+:)?\/\/)/,vGt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,yGt=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,zCe="file://";function bGt(e){return t=>({options:t||{},sanitize:wGt,load:xGt,fileAccess:!1,file:SGt(),http:CGt})}async function xGt(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t?.http)}async function wGt(e,t){t=nr({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,s;const a=vGt.test(e.replace(yGt,""));(e==null||typeof e!="string"||!a)&&et("Sanitize failure, invalid URI: "+Tt(e));const l=mGt.test(e);return(s=t.baseURL)&&!l&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(i=e.startsWith(zCe))||t.mode==="file"||t.mode!=="http"&&!l&&n,i?e=e.slice(zCe.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function SGt(e){return _Gt}async function _Gt(){et("No file system access.")}async function CGt(e,t){const n=nr({},this.options.http,t),r=t&&t.response,i=await fetch(e,n);return i.ok?ir(i[r])?i[r]():i.text():et(i.status+""+i.statusText)}const OGt=e=>e!=null&&e===e,EGt=e=>e==="true"||e==="false"||e===!0||e===!1,TGt=e=>!Number.isNaN(Date.parse(e)),dHe=e=>!Number.isNaN(+e)&&!(e instanceof Date),PGt=e=>dHe(e)&&Number.isInteger(+e),Ine={boolean:yue,integer:ul,number:ul,date:bue,string:xue,unknown:vl},rN=[EGt,PGt,dHe,TGt],kGt=["boolean","integer","number","date"];function hHe(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=rN.length,i=rN.map((o,s)=>s+1);for(let o=0,s=0,a,l;oo===0?s:o,0)-1]}function pHe(e,t){return t.reduce((n,r)=>(n[r]=hHe(e,r),n),{})}function jCe(e){const t=function(n,r){const i={delimiter:e};return Mue(n,r?nr(r,i):i)};return t.responseType="text",t}function Mue(e,t){return t.header&&(e=t.header.map(Tt).join(t.delimiter)+` -`+e),uWt(t.delimiter).parse(e+"")}Mue.responseType="text";function MGt(e){return typeof Buffer=="function"&&ir(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Aue(e,t){const n=t&&t.property?Qf(t.property):vl;return Ht(e)&&!MGt(e)?AGt(n(e),t):n(JSON.parse(e))}Aue.responseType="json";function AGt(e,t){return!lt(e)&&aWe(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const RGt={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function gHe(e,t){let n,r,i,o;return e=Aue(e,t),t&&t.feature?(n=pWt,i=t.feature):t&&t.mesh?(n=mWt,i=t.mesh,o=RGt[t.filter]):et("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):et("Invalid TopoJSON object: "+i),r&&r.features||[r]}gHe.responseType="json";const Nz={dsv:Mue,csv:jCe(","),tsv:jCe(" "),json:Aue,topojson:gHe};function Rue(e,t){return arguments.length>1?(Nz[e]=t,this):Yt(Nz,e)?Nz[e]:null}function mHe(e){const t=Rue(e);return t&&t.responseType||"text"}function vHe(e,t,n,r){t=t||{};const i=Rue(t.type||"json");return i||et("Unknown data format type: "+t.type),e=i(e,t),t.parse&&IGt(e,t.parse,n,r),Yt(e,"columns")&&delete e.columns,e}function IGt(e,t,n,r){if(!e.length)return;const i=oR();n=n||i.timeParse,r=r||i.utcParse;let o=e.columns||Object.keys(e[0]),s,a,l,c,u,f;t==="auto"&&(t=pHe(e,o)),o=Object.keys(t);const d=o.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?r:n)(m);if(!Ine[p])throw Error("Illegal format pattern: "+h+":"+p);return Ine[p]});for(l=0,u=e.length,f=o.length;l{const o=t(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=t(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function zz(e,t){try{await t(e)}catch(n){e.error(n)}}const yHe=Symbol("vega_id");let DGt=1;function oV(e){return!!(e&&Sn(e))}function Sn(e){return e[yHe]}function bHe(e,t){return e[yHe]=t,e}function li(e){const t=e===Object(e)?e:{data:e};return Sn(t)?t:bHe(t,DGt++)}function Iue(e){return sV(e,li({}))}function sV(e,t){for(const n in e)t[n]=e[n];return t}function xHe(e,t){return bHe(t,Sn(e))}function xS(e,t){return e?t?(n,r)=>e(n,r)||Sn(t(n))-Sn(t(r)):(n,r)=>e(n,r)||Sn(n)-Sn(r):null}function wHe(e){return e&&e.constructor===wS}function wS(){const e=[],t=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:wS,insert(a){const l=Vt(a),c=l.length;for(let u=0;u{p(y)&&(c[Sn(y)]=-1)});for(f=0,d=e.length;f0&&(v(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f{p(y)&&c[Sn(y)]>0&&v(y,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||r.length?l.filter(y=>c[Sn(y)]>0):l.slice();else for(m in u)a.mod.push(u[m]);return(o||o==null&&(t.length||r.length))&&a.clean(!0),a}}}const jz="_:mod:_";function aV(){Object.defineProperty(this,jz,{writable:!0,value:{}})}aV.prototype={set(e,t,n,r){const i=this,o=i[e],s=i[jz];return t!=null&&t>=0?(o[t]!==n||r)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||r)&&(i[e]=n,s[e]=lt(n)?1+n.length:-1),i},modified(e,t){const n=this[jz];if(arguments.length){if(lt(e)){for(let r=0;r=0?t+1{h instanceof Bi?(h!==this&&(t&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in e)if(a=e[s],s===FGt)Vt(a).forEach(f=>{f instanceof Bi?f!==this&&(f.targets().add(this),o.push(f)):et("Pulse parameters must be operator instances.")}),this.source=a;else if(lt(a))for(r.set(s,-1,Array(l=a.length)),c=0;c{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Fy();return this.targets().add(Fy(null,null,gue(e,n=>{const r=n.dataflow;t.receive(n),r&&r.run&&r.run()}))),t},between(e,t){let n=!1;return e.targets().add(Fy(null,null,()=>n=!0)),t.targets().add(Fy(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Kf,this._targets=null}};function VGt(e,t,n,r){const i=this,o=Fy(n,r),s=function(c){c.dataflow=i;try{o.receive(c)}catch(u){i.error(u)}finally{i.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=Vt(e);const l=a.length;for(let c=0;ct=r);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const YGt={skip:!0};function QGt(e,t,n,r,i){return(e instanceof Bi?ZGt:KGt)(this,e,t,n,r,i),this}function KGt(e,t,n,r,i,o){const s=nr({},o,YGt);let a,l;ir(n)||(n=yl(n)),r===void 0?a=c=>e.touch(n(c)):ir(r)?(l=new Bi(null,r,i,!1),a=c=>{l.evaluate(c);const u=n(c),f=l.value;wHe(f)?e.pulse(u,f,o):e.update(u,f,s)}):a=c=>e.update(n(c),r,s),t.apply(a)}function ZGt(e,t,n,r,i,o){if(r===void 0)t.targets().add(n);else{const s=o||{},a=new Bi(null,JGt(n,r),i,!1);a.modified(s.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function JGt(e,t){return t=ir(t)?t:yl(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}function e9t(e){e.rank=++this._rank}function t9t(e){const t=[e];let n,r,i;for(;t.length;)if(this.rank(n=t.pop()),r=n._targets)for(i=r.length;--i>=0;)t.push(n=r[i]),n===e&&et("Cycle detected in dataflow graph.")}const Nj={},ip=1,Qy=2,gm=4,n9t=ip|Qy,UCe=ip|gm,M_=ip|Qy|gm,VCe=8,Gk=16,WCe=32,HCe=64;function F0(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function fq(e,t){const n=[];return Yy(e,t,r=>n.push(r)),n}function GCe(e,t){const n={};return e.visit(t,r=>{n[Sn(r)]=1}),r=>n[Sn(r)]?null:r}function iN(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}F0.prototype={StopPropagation:Nj,ADD:ip,REM:Qy,MOD:gm,ADD_REM:n9t,ADD_MOD:UCe,ALL:M_,REFLOW:VCe,SOURCE:Gk,NO_SOURCE:WCe,NO_FIELDS:HCe,fork(e){return new F0(this.dataflow).init(this,e)},clone(){const e=this.fork(M_);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(M_|Gk)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new F0(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&HCe)&&(n.fields=e.fields),t&ip?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Qy?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&gm?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&WCe?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||M_;return t&ip&&this.add.length||t&Qy&&this.rem.length||t&gm&&this.mod.length},reflow(e){if(e)return this.fork(M_).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(gm,GCe(this,ip))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return lt(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?lt(e)?e.some(r=>n[r]):n[e]:!!n:!1},filter(e,t){const n=this;return e&ip&&(n.addF=iN(n.addF,t)),e&Qy&&(n.remF=iN(n.remF,t)),e&gm&&(n.modF=iN(n.modF,t)),e&Gk&&(n.srcF=iN(n.srcF,t)),n},materialize(e){e=e||M_;const t=this;return e&ip&&t.addF&&(t.add=fq(t.add,t.addF),t.addF=null),e&Qy&&t.remF&&(t.rem=fq(t.rem,t.remF),t.remF=null),e&gm&&t.modF&&(t.mod=fq(t.mod,t.modF),t.modF=null),e&Gk&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(e&Gk)return Yy(n.source,n.srcF,r),n;e&ip&&Yy(n.add,n.addF,r),e&Qy&&Yy(n.rem,n.remF,r),e&gm&&Yy(n.mod,n.modF,r);const i=n.source;if(e&VCe&&i){const o=n.add.length+n.mod.length;o===i.length||(o?Yy(i,GCe(n,UCe),r):Yy(i,n.srcF,r))}return n}};function Due(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}Rt(Due,F0,{fork(e){const t=new F0(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?lt(e)?e.some(r=>n[r]):n[e]:0},filter(){et("MultiPulse does not support filtering.")},materialize(){et("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;or._enqueue(u,!0)),r._touched=iV(ND);let s=0,a,l,c;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,e)),l.then?l=await l:l.async&&(i.push(l.async),l=Nj),l!==Nj&&a._targets&&a._targets.forEach(u=>r._enqueue(u)),++s}}catch(u){r._heap.clear(),c=u}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),c&&(r._postrun=[],r.error(c)),r._postrun.length){const u=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;fr.runAsync(null,()=>{u.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function i9t(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running}function o9t(e,t,n){return this._pulse?SHe(this):(this.evaluate(e,t,n),this)}function s9t(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(r){this.error(r)}}function SHe(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function a9t(e,t){const n=e.stampi.pulse),t):this._input[e.id]||c9t(this._pulse,n&&n.pulse)}function c9t(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Nj&&(e.source=t.source),e)}const Lue={skip:!1,force:!1};function u9t(e,t){const n=t||Lue;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function f9t(e,t,n){const r=n||Lue;return(e.set(t)||r.force)&&this.touch(e,r),this}function d9t(e,t,n){this.touch(e,n||Lue);const r=new F0(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this}function h9t(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),_He(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,p9t(t,0,e)):r=n,r}}}function _He(e,t,n,r){let i,o;const s=e[n];for(;n>t;){if(o=n-1>>1,i=e[o],r(s,i)<0){e[n]=i,n=o;continue}break}return e[n]=s}function p9t(e,t,n){const r=t,i=e.length,o=e[t];let s=(t<<1)+1,a;for(;s=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,_He(e,r,t,n)}function pO(){this.logger(uue()),this.logLevel(lue),this._clock=0,this._rank=0,this._locale=kue();try{this._loader=rV()}catch{}this._touched=iV(ND),this._input={},this._pulse=null,this._heap=h9t((e,t)=>e.qrank-t.qrank),this._postrun=[]}function qk(e){return function(){return this._log[e].apply(this,arguments)}}pO.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:qk("error"),warn:qk("warn"),info:qk("info"),debug:qk("debug"),logLevel:qk("level"),cleanThreshold:1e4,add:jGt,connect:BGt,rank:e9t,rerank:t9t,pulse:d9t,touch:u9t,update:f9t,changeset:wS,ingest:HGt,parse:WGt,preload:qGt,request:GGt,events:VGt,on:QGt,evaluate:r9t,run:o9t,runAsync:i9t,runAfter:s9t,_enqueue:a9t,_getPulse:l9t};function Ze(e,t){Bi.call(this,e,null,t)}Rt(Ze,Bi,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const aE={};function CHe(e){const t=OHe(e);return t&&t.Definition||null}function OHe(e){return e=e&&e.toLowerCase(),Yt(aE,e)?aE[e]:null}function*EHe(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)r=t(r,++n,e),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function Fue(e,t,n){const r=Float64Array.from(EHe(e,n));return r.sort(Vp),t.map(i=>SWe(r,i))}function $ue(e,t){return Fue(e,[.25,.5,.75],t)}function Nue(e,t){const n=e.length,r=CWt(e,t),i=$ue(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function THe(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,l,c,u,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(u=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=i.length;f=c&&h/u<=t&&(a=u)}u=Math.log(a);const p=u>=0?0:~~(-u/r)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(u=Math.floor(o/a+g)*a,o=od);const i=e.length,o=new Float64Array(i);let s=0,a=1,l=r(e[0]),c=l,u=l+t,f;for(;a=u){for(c=(l+c)/2;s>1);si;)e[s--]=e[r]}r=i,i=o}return e}function v9t(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function y9t(e,t){t==null&&(t=e,e=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*Jf())},pdf(s){return s===Math.floor(s)&&s>=n&&s=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(e).max(t)}const MHe=Math.sqrt(2*Math.PI),b9t=Math.SQRT2;let Xk=NaN;function cV(e,t){e=e||0,t=t??1;let n=0,r=0,i,o;if(Xk===Xk)n=Xk,Xk=NaN;else{do n=Jf()*2-1,r=Jf()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,Xk=r*o}return e+n*t}function zue(e,t,n){n=n??1;const r=(e-(t||0))/n;return Math.exp(-.5*r*r)/(n*MHe)}function uV(e,t,n){t=t||0,n=n??1;const r=(e-t)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function fV(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*b9t*x9t(2*e-1)}function x9t(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function jue(e,t){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>cV(n,r),pdf:o=>zue(o,n,r),cdf:o=>uV(o,n,r),icdf:o=>fV(o,n,r)};return i.mean(e).stdev(t)}function Bue(e,t){const n=jue();let r=0;const i={data(o){return arguments.length?(e=o,r=o?o.length:0,i.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=Nue(e)),i):t},sample(){return e[~~(Jf()*r)]+t*n.sample()},pdf(o){let s=0,a=0;for(;aUue(n,r),pdf:o=>Vue(o,n,r),cdf:o=>Wue(o,n,r),icdf:o=>Hue(o,n,r)};return i.mean(e).stdev(t)}function RHe(e,t){let n=0,r;function i(s){const a=[];let l=0,c;for(c=0;c=t&&e<=n?1/(n-t):0}function Xue(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function Yue(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function IHe(e,t){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>Gue(n,r),pdf:o=>que(o,n,r),cdf:o=>Xue(o,n,r),icdf:o=>Yue(o,n,r)};return t==null&&(t=e??1,e=0),i.min(e).max(t)}function Que(e,t,n){let r=0,i=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function BD(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function dV(e,t,n,r){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&e.sort((h,p)=>t(h)-t(p));const i=e.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,c=0,u,f,d;for(d of e)o[a]=u=+t(d),s[a]=f=+n(d),++a,l+=(u-l)/a,c+=(f-c)/a;for(a=0;a=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function JT(e,t,n,r,i){let o=0,s=0;return UD(e,t,n,(a,l)=>{const c=l-i(a),u=l-r;o+=c*c,s+=u*u}),1-o/s}function Kue(e,t,n){let r=0,i=0,o=0,s=0,a=0;UD(e,t,n,(u,f)=>{++a,r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=BD(r,i,o,s),c=u=>l[0]+l[1]*u;return{coef:l,predict:c,rSquared:JT(e,t,n,i,c)}}function DHe(e,t,n){let r=0,i=0,o=0,s=0,a=0;UD(e,t,n,(u,f)=>{++a,u=Math.log(u),r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=BD(r,i,o,s),c=u=>l[0]+l[1]*Math.log(u);return{coef:l,predict:c,rSquared:JT(e,t,n,i,c)}}function LHe(e,t,n){const[r,i,o,s]=dV(e,t,n);let a=0,l=0,c=0,u=0,f=0,d,h,p;UD(e,t,n,(y,b)=>{d=r[f++],h=Math.log(b),p=d*b,a+=(b*h-a)/f,l+=(p-l)/f,c+=(p*h-c)/f,u+=(d*p-u)/f});const[g,m]=BD(l/s,a/s,c/s,u/s),v=y=>Math.exp(g+m*(y-o));return{coef:[Math.exp(g-m*o),m],predict:v,rSquared:JT(e,t,n,s,v)}}function FHe(e,t,n){let r=0,i=0,o=0,s=0,a=0,l=0;UD(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const c=BD(r,i,o,s),u=f=>c[0]*Math.pow(f,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:JT(e,t,n,a,u)}}function Zue(e,t,n){const[r,i,o,s]=dV(e,t,n),a=r.length;let l=0,c=0,u=0,f=0,d=0,h,p,g,m;for(h=0;h(E=E-o,b*E*E+w*E+S+s);return{coef:[S-w*o+b*o*o+s,w-2*b*o,b],predict:_,rSquared:JT(e,t,n,s,_)}}function $He(e,t,n,r){if(r===0)return Que(e,t,n);if(r===1)return Kue(e,t,n);if(r===2)return Zue(e,t,n);const[i,o,s,a]=dV(e,t,n),l=i.length,c=[],u=[],f=r+1;let d,h,p,g,m;for(d=0;d{b-=s;let w=a+v[0]+v[1]*b+v[2]*b*b;for(d=3;d=0;--o)for(a=t[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function S9t(e){const t=e.length-1,n=[];let r,i,o,s,a;for(r=0;rMath.abs(e[r][s])&&(s=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(a=0,o=i+1;oi[b]-v?y:b;let S=0,_=0,E=0,T=0,k=0;const P=1/Math.abs(i[w]-v||1);for(let F=y;F<=b;++F){const A=i[F],L=o[F],$=_9t(Math.abs(v-A)*P)*d[F],j=A*$;S+=$,_+=j,E+=L*$,T+=L*j,k+=A*j}const[R,I]=BD(_/S,E/S,T/S,k/S);u[m]=R+I*v,f[m]=Math.abs(o[m]-u[m]),C9t(i,m+1,p)}if(h===qCe)break;const g=_We(f);if(Math.abs(g)=1?XCe:(y=1-v*v)*y}return O9t(i,u,s,a)}function _9t(e){return(e=1-e*e*e)*e*e}function C9t(e,t,n){const r=e[t];let i=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}function O9t(e,t,n,r){const i=e.length,o=[];let s=0,a=0,l=[],c;for(;s[g,e(g)],o=t[0],s=t[1],a=s-o,l=a/r,c=[i(o)],u=[];if(n===r){for(let g=1;g0;)u.push(i(o+g/n*a))}let f=c[0],d=u[u.length-1];const h=1/a,p=T9t(f[1],u);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&P9t(f,g,d,h,p)>E9t?u.push(g):(f=d,c.push(d),u.pop()),d=u[u.length-1]}return c}function T9t(e,t){let n=e,r=e;const i=t.length;for(let o=0;or&&(r=s)}return 1/(r-n)}function P9t(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),s=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-s)}function k9t(e){return t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r{},M9t={init:dq,add:dq,rem:dq,idx:0},sR={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},VD=Object.keys(sR).filter(e=>e!=="__count__");function A9t(e,t){return(n,r)=>nr({name:e,aggregate_param:r,out:n||e},M9t,t)}[...VD,"__count__"].forEach(e=>{sR[e]=A9t(e,sR[e])});function jHe(e,t,n){return sR[e](n,t)}function BHe(e,t){return e.idx-t.idx}function R9t(e){const t={};e.forEach(r=>t[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{t[i]||n(t[i]=sR[i]())})};return e.forEach(n),Object.values(t).sort(BHe)}function I9t(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function D9t(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function L9t(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function F9t(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function UHe(e,t){const n=t||vl,r=R9t(e),i=e.slice().sort(BHe);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=I9t,o.prototype.add=D9t,o.prototype.rem=L9t,o.prototype.set=F9t,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function Jue(e){this._key=e?Qf(e):Sn,this.reset()}const za=Jue.prototype;za.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};za.add=function(e){this._add.push(e)};za.rem=function(e){this._rem.push(e)};za.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),s={};let a,l,c;for(a=0;a=0;)o=e(t[r])+"",Yt(n,o)||(n[o]=1,++i);return i};za.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=oWe(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};za.argmin=function(e){return this.extent(e)[0]||{}};za.argmax=function(e){return this.extent(e)[1]||{}};za.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};za.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};za.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=$ue(this.values(),e),this._get=e),this._q};za.q1=function(e){return this.quartile(e)[0]};za.q2=function(e){return this.quartile(e)[1]};za.q3=function(e){return this.quartile(e)[2]};za.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=PHe(this.values(),1e3,.05,e),this._get=e),this._ci};za.ci0=function(e){return this.ci(e)[0]};za.ci1=function(e){return this.ci(e)[1]};function Z0(e){Ze.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Z0.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:VD},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};Rt(Z0,Ze,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,c,u,f;for(l in a)for(u=a[l].tuple,c=0;c{const b=Bo(y);return i(y),n.push(b),b}),this.cellkey=e.key?e.key:Dne(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.aggregate_params||[null],l=e.as||[],c=o.length,u={};let f,d,h,p,g,m,v;for(c!==s.length&&et("Unmatched number of fields and aggregate ops."),v=0;vUHe(y,y.field)),Object.create(null)},cellkey:Dne(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=r(u);u[a]=f,u[l]=f==null?null:i+o*(1+(f-i)/o)}:u=>u[a]=r(u)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=THe(e),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=e.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(c){let u=ul(t(c));return u==null?null:uo?1/0:(u=Math.max(i,Math.min(u,o-r)),i+r*Math.floor($9t+(u-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=Gc(l,hl(t),e.name||"bin_"+Bo(t))}});function VHe(e,t,n){const r=e;let i=t||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,c)=>(a&&(i=i.filter(u=>!s[r(u)]),s={},a=0),c&&l&&i.sort(l),o.length&&(i=l?uWe(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function tfe(e){Ze.call(this,[],e)}tfe.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};Rt(tfe,Ze,{transform(e,t){const n=t.fork(t.ALL),r=VHe(Sn,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(xS(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function WHe(e){Bi.call(this,null,N9t,e)}Rt(WHe,Bi);function N9t(e){return this.value&&!e.modified()?this.value:pue(e.fields,e.orders)}function nfe(e){Ze.call(this,null,e)}nfe.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function z9t(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}Rt(nfe,Ze,{transform(e,t){const n=f=>d=>{for(var h=z9t(a(d),e.case,o)||[],p,g=0,m=h.length;gi[f]=1+(i[f]||0)),u=n(f=>i[f]-=1);return r?t.visit(t.SOURCE,c):(t.visit(t.ADD,c),t.visit(t.REM,u)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,c;for(a in n)l=r[a],c=n[a]||0,!l&&c?(r[a]=l=li({}),l[i]=a,l[o]=c,s.add.push(l)):c===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==c&&(l[o]=c,s.mod.push(l));return s.modifies(t)}});function rfe(e){Ze.call(this,null,e)}rfe.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};Rt(rfe,Ze,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=j9t(a,i,o,e.filter||Kf)):n.mod=a,n.source=this.value,n.modifies(r)}});function j9t(e,t,n,r){for(var i=[],o={},s=e.length,a=0,l,c;aHHe(o,t))):typeof r[i]===QCe&&r[i](e[i]);return r}function ife(e){Ze.call(this,null,e)}const GHe=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],V9t={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:GHe},{name:"weights",type:"number",array:!0}]};ife.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:GHe.concat(V9t)},{name:"as",type:"string",array:!0,default:["value","density"]}]};Rt(ife,Ze,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=HHe(e.distribution,W9t(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&et("Invalid density method: "+s),!e.extent&&!r.data&&et("Missing density extent parameter."),s=r[s];const a=e.as||["value","density"],l=e.extent||tg(r.data()),c=hV(s,l,i,o).map(u=>{const f={};return f[a[0]]=u[0],f[a[1]]=u[1],li(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function W9t(e){return()=>e.materialize(e.SOURCE).source}function qHe(e,t){return e?e.map((n,r)=>t[r]||Bo(n)):null}function ofe(e,t,n){const r=[],i=f=>f(l);let o,s,a,l,c,u;if(t==null)r.push(e.map(n));else for(o={},s=0,a=e.length;sjD(tg(e,t))/30;Rt(sfe,Ze,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,r=ofe(t.source,e.groupby,vl),i=e.smooth||!1,o=e.field,s=e.step||H9t(n,o),a=xS((p,g)=>o(p)-o(g)),l=e.as||XHe,c=r.length;let u=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:u,stop:f,step:s},t.reflow(!0).modifies(l)}});function YHe(e){Bi.call(this,null,G9t,e),this.modified(!0)}Rt(YHe,Bi);function G9t(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Gc(n=>t(n,e),hl(t),Bo(t))}function afe(e){Ze.call(this,[void 0,void 0],e)}afe.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};Rt(afe,Ze,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),t.visit(i?t.SOURCE:t.ADD,a=>{const l=ul(r(a));l!=null&&(ls&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Bo(r);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function lfe(e,t){Bi.call(this,e),this.parent=t,this.count=0}Rt(lfe,Bi,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function pV(e){Ze.call(this,{},e),this._keys=qT();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let r=0,i=t.active;rr&&r.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(l,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,l=>{const c=Sn(l),u=o.get(c);u!==void 0&&(o.delete(c),a(u).rem(l))}),t.visit(t.ADD,l=>{const c=r(l);o.set(Sn(l),c),a(c).add(l)}),s||t.modified(r.fields)?t.visit(t.MOD,l=>{const c=Sn(l),u=o.get(c),f=r(l);u===f?a(f).mod(l):(o.set(c,f),a(u).rem(l),a(f).add(l))}):t.changed(t.MOD)&&t.visit(t.MOD,l=>{a(o.get(Sn(l))).mod(l)}),s&&t.visit(t.REFLOW,l=>{const c=Sn(l),u=o.get(c),f=r(l);u!==f&&(o.set(c,f),a(u).rem(l),a(f).add(l))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function QHe(e){Bi.call(this,null,q9t,e)}Rt(QHe,Bi);function q9t(e){return this.value&&!e.modified()?this.value:lt(e.name)?Vt(e.name).map(t=>Qf(t)):Qf(e.name,e.as)}function cfe(e){Ze.call(this,qT(),e)}cfe.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};Rt(cfe,Ze,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,s=i.rem,a=i.mod,l=e.expr;let c=!0;t.visit(t.REM,f=>{const d=Sn(f);r.has(d)?r.delete(d):s.push(f)}),t.visit(t.ADD,f=>{l(f,e)?o.push(f):r.set(Sn(f),1)});function u(f){const d=Sn(f),h=l(f,e),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):c&&h&&!p&&a.push(f)}return t.visit(t.MOD,u),e.modified()&&(c=!1,t.visit(t.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function ufe(e){Ze.call(this,[],e)}ufe.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};Rt(ufe,Ze,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=qHe(r,e.as||[]),o=e.index||null,s=i.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const l=r.map(p=>p(a)),c=l.reduce((p,g)=>Math.max(p,g.length),0);let u=0,f,d,h;for(;u{for(let u=0,f;us[r]=n(s,e))}});function KHe(e){Ze.call(this,[],e)}Rt(KHe,Ze,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i=this.value,o=e.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=li(r(e))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const oN={value:"value",median:_We,mean:MWt,min:Cne,max:N1},X9t=[];function hfe(e){Ze.call(this,[],e)}hfe.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function Y9t(e){var t=e.method||oN.value,n;if(oN[t]==null)et("Unrecognized imputation method: "+t);else return t===oN.value?(n=e.value!==void 0?e.value:0,()=>n):oN[t]}function Q9t(e){const t=e.field;return n=>n?t(n):NaN}Rt(hfe,Ze,{transform(e,t){var n=t.fork(t.ALL),r=Y9t(e),i=Q9t(e),o=Bo(e.field),s=Bo(e.key),a=(e.groupby||[]).map(Bo),l=K9t(t.source,e.groupby,e.key,e.keyvals),c=[],u=this.value,f=l.domain.length,d,h,p,g,m,v,y,b,w,S;for(m=0,b=l.length;mv(m),o=[],s=r?r.slice():[],a={},l={},c,u,f,d,h,p,g,m;for(s.forEach((v,y)=>a[v]=y+1),d=0,g=e.length;dn.add(o))):(i=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{nr(o,i[n.cellkey(o)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const p=Bue(h,s)[a],g=e.counts?h.length:1,m=u||tg(h);hV(p,m,f,d).forEach(v=>{const y={};for(let b=0;b(this._pending=Vt(i.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(r=>hq(this,t,Vt(r.data)))}});function J9t(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function hq(e,t,n){n.forEach(li);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function mfe(e){Ze.call(this,{},e)}mfe.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};Rt(mfe,Ze,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let l=s?t.SOURCE:t.ADD,c=t,u=e.as,f,d,h;return i?(d=i.length,a>1&&!u&&et('Multi-field lookup requires explicit "as" parameter.'),u&&u.length!==a*d&&et('The "as" parameter has too few output field names.'),u=u||i.map(Bo),f=function(p){for(var g=0,m=0,v,y;gt.modified(p.fields)),l|=h?t.MOD:0),t.visit(l,f),c.modifies(u)}});function eGe(e){Bi.call(this,null,e7t,e)}Rt(eGe,Bi);function e7t(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r=1/0,i=-1/0,o,s;for(o=0;oi&&(i=s[1]);return[r,i]}function tGe(e){Bi.call(this,null,t7t,e)}Rt(tGe,Bi);function t7t(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function nGe(e){Ze.call(this,null,e)}Rt(nGe,Ze,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function vfe(e){Z0.call(this,e)}vfe.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:VD,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};Rt(vfe,Z0,{_transform:Z0.prototype.transform,transform(e,t){return this._transform(n7t(e,t),t)}});function n7t(e,t){const n=e.field,r=e.value,i=(e.op==="count"?"__count__":e.op)||"sum",o=hl(n).concat(hl(r)),s=i7t(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>i),fields:s.map(a=>r7t(a,n,r,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function r7t(e,t,n,r){return Gc(i=>t(i)===e?n(i):NaN,r,e+"")}function i7t(e,t,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=e(o);r[s]||(r[s]=1,i.push(s))}),i.sort(zD),t?i.slice(0,t):i}function rGe(e){pV.call(this,e)}Rt(rGe,pV,{transform(e,t){const n=e.subflow,r=e.field,i=o=>this.subflow(Sn(o),n,t,o);return(e.modified("field")||r&&t.modified(hl(r)))&&et("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(li(a)))}),t.visit(t.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>i(o).mod(o)),t.visit(t.ADD,o=>i(o).add(o)),t.visit(t.REM,o=>i(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function yfe(e){Ze.call(this,null,e)}yfe.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};Rt(yfe,Ze,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=qHe(e.fields,e.as||[]),o=r?(a,l)=>o7t(a,l,r,i):sV;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const l=Sn(a);n.rem.push(s[l]),s[l]=null}),t.visit(t.ADD,a=>{const l=o(a,li({}));s[Sn(a)]=l,n.add.push(l)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[Sn(a)]))}),n}});function o7t(e,t,n,r){for(let i=0,o=n.length;i{const d=Fue(f,c);for(let h=0;h{const o=Sn(i);n.rem.push(r[o]),r[o]=null}),t.visit(t.ADD,i=>{const o=Iue(i);r[Sn(i)]=o,n.add.push(o)}),t.visit(t.MOD,i=>{const o=r[Sn(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function xfe(e){Ze.call(this,[],e),this.count=0}xfe.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};Rt(xfe,Ze,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((u,f)=>(u[Sn(f)]=1,u),{});let s=this.value,a=this.count,l=0;function c(u){let f,d;s.length=l&&(f=s[d],o[Sn(f)]&&n.rem.push(f),s[d]=u)),++a}if(t.rem.length&&(t.visit(t.REM,u=>{const f=Sn(u);o[f]&&(o[f]=-1,n.rem.push(u)),--a}),s=s.filter(u=>o[Sn(u)]!==-1)),(t.rem.length||r)&&s.length{o[Sn(u)]||c(u)}),l=-1),r&&s.length>i){const u=s.length-i;for(let f=0;f{o[Sn(u)]&&n.mod.push(u)}),t.add.length&&t.visit(t.ADD,c),(t.add.length||l<0)&&(n.add=s.filter(u=>!o[Sn(u)])),this.count=a,this.value=n.source=s,n}});function wfe(e){Ze.call(this,null,e)}wfe.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};Rt(wfe,Ze,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Tc(e.start,e.stop,e.step||1).map(i=>{const o={};return o[r]=i,li(o)}),n.add=t.add.concat(this.value),n}});function sGe(e){Ze.call(this,null,e),this.modified(!0)}Rt(sGe,Ze,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function Sfe(e){Ze.call(this,null,e)}const aGe=["unit0","unit1"];Sfe.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Cue,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:aGe}]};Rt(Sfe,Ze,{transform(e,t){const n=e.field,r=e.interval!==!1,i=e.timezone==="utc",o=this._floor(e,t),s=(i?ZT:KT)(o.unit).offset,a=e.as||aGe,l=a[0],c=a[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(hl(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,v;g==null?(p[l]=null,r&&(p[c]=null)):(p[l]=m=v=o(g),r&&(p[c]=v=s(m,u)),md&&(d=v))}),o.start=f,o.stop=d,t.modifies(r?a:l)},_floor(e,t){const n=e.timezone==="utc",{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:KWe({extent:e.extent||tg(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Oue(r),s=this.value||{},a=(n?UWe:BWe)(o,i);return a.unit=Mr(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function lGe(e){Ze.call(this,qT(),e)}Rt(lGe,Ze,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>i.delete(r(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}});function cGe(e){Ze.call(this,null,e)}Rt(cGe,Ze,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(xS(e.sort)):t.source).map(e.field))}});function a7t(e,t,n,r){const i=aR[e](t,n);return{init:i.init||o0,update:function(o,s){s[r]=i.next(o)}}}const aR={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=aR.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e0||et("ntile num must be greater than zero.");const n=aR.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(t*r(i))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||et("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return r!=null?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=l7t(e,i,r.index))<0?(n=i.length,t=null):t=e(i[n])}}}};function l7t(e,t,n){for(let r=t.length;nl[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],v=r[g],y=i[g]||null,b=Bo(m),w=zHe(p,b,o[g]);if(h(m),s.push(w),Yt(aR,p))a.push(a7t(p,m,v,w));else{if(m==null&&p!=="count"&&et("Null aggregate field specified."),p==="count"){u.push(w);return}d=!1;let S=c[b];S||(S=c[b]=[],S.field=m,f.push(S)),S.push(jHe(p,y,w))}}),(u.length||f.length)&&(this.cell=u7t(f,u,d)),this.inputs=Object.keys(l)}const fGe=uGe.prototype;fGe.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};fGe.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let s;if(n){for(s=e.p0;sUHe(l,l.field));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),s=0;sthis.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new uGe(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),r1?0:e<-1?J0:Math.acos(e)}function ZCe(e){return e>=1?zj:e<=-1?-zj:Math.asin(e)}const Lne=Math.PI,Fne=2*Lne,Gx=1e-6,v7t=Fne-Gx;function dGe(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return dGe;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;iGx)if(!(Math.abs(f*l-c*u)>Gx)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+c*c,m=h*h+p*p,v=Math.sqrt(g),y=Math.sqrt(d),b=o*Math.tan((Lne-Math.acos((g+d-m)/(2*v*y)))/2),w=b/y,S=b/v;Math.abs(w-1)>Gx&&this._append`L${t+w*u},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=t+S*l},${this._y1=n+S*c}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=t+a,u=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Gx||Math.abs(this._y1-u)>Gx)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%Fne+Fne),d>v7t?this._append`A${r},${r},0,1,${f},${t-a},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>Gx&&this._append`A${r},${r},0,${+(d>=Lne)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function gV(){return new Cfe}gV.prototype=Cfe.prototype;function mV(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Cfe(t)}function b7t(e){return e.innerRadius}function x7t(e){return e.outerRadius}function w7t(e){return e.startAngle}function S7t(e){return e.endAngle}function _7t(e){return e&&e.padAngle}function C7t(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,f=a-o,d=f*l-u*c;if(!(d*dA*A+L*L&&(T=P,k=R),{cx:T,cy:k,x01:-u,y01:-f,x11:T*(i/S-1),y11:k*(i/S-1)}}function O7t(){var e=b7t,t=x7t,n=Dr(0),r=null,i=w7t,o=S7t,s=_7t,a=null,l=mV(c);function c(){var u,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-zj,g=o.apply(this,arguments)-zj,m=KCe(g-p),v=g>p;if(a||(a=u=l()),hZa))a.moveTo(0,0);else if(m>WD-Za)a.moveTo(h*mm(p),h*gc(p)),a.arc(0,0,h,p,g,!v),d>Za&&(a.moveTo(d*mm(g),d*gc(g)),a.arc(0,0,d,g,p,v));else{var y=p,b=g,w=p,S=g,_=m,E=m,T=s.apply(this,arguments)/2,k=T>Za&&(r?+r.apply(this,arguments):Ma(d*d+h*h)),P=pq(KCe(h-d)/2,+n.apply(this,arguments)),R=P,I=P,F,A;if(k>Za){var L=ZCe(k/d*gc(T)),$=ZCe(k/h*gc(T));(_-=L*2)>Za?(L*=v?1:-1,w+=L,S-=L):(_=0,w=S=(p+g)/2),(E-=$*2)>Za?($*=v?1:-1,y+=$,b-=$):(E=0,y=b=(p+g)/2)}var j=h*mm(y),V=h*gc(y),U=d*mm(S),z=d*gc(S);if(P>Za){var N=h*mm(b),B=h*gc(b),H=d*mm(w),Q=d*gc(w),Y;if(mZa?I>Za?(F=sN(H,Q,j,V,h,I,v),A=sN(N,B,U,z,h,I,v),a.moveTo(F.cx+F.x01,F.cy+F.y01),IZa)||!(_>Za)?a.lineTo(U,z):R>Za?(F=sN(U,z,N,B,d,-R,v),A=sN(j,V,H,Q,d,-R,v),a.lineTo(F.cx+F.x01,F.cy+F.y01),R=h;--p)a.point(b[p],w[p]);a.lineEnd(),a.areaEnd()}v&&(b[d]=+e(m,d,f),w[d]=+t(m,d,f),a.point(r?+r(m,d,f):b[d],n?+n(m,d,f):w[d]))}if(y)return a=null,y+""||null}function u(){return Efe().defined(i).curve(s).context(o)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:Dr(+f),r=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Dr(+f),c):e},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Dr(+f),c):r},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:Dr(+f),n=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Dr(+f),c):t},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Dr(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Dr(!!f),c):i},c.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),c):s},c.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),c):o},c}class mGe{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function E7t(e){return new mGe(e,!0)}function T7t(e){return new mGe(e,!1)}const Tfe={draw(e,t){const n=Ma(t/J0);e.moveTo(n,0),e.arc(0,0,n,0,WD)}},P7t={draw(e,t){const n=Ma(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},vGe=Ma(1/3),k7t=vGe*2,M7t={draw(e,t){const n=Ma(t/k7t),r=n*vGe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},A7t={draw(e,t){const n=Ma(t),r=-n/2;e.rect(r,r,n,n)}},R7t=.8908130915292852,yGe=gc(J0/10)/gc(7*J0/10),I7t=gc(WD/10)*yGe,D7t=-mm(WD/10)*yGe,L7t={draw(e,t){const n=Ma(t*R7t),r=I7t*n,i=D7t*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const s=WD*o/5,a=mm(s),l=gc(s);e.lineTo(l*n,-a*n),e.lineTo(a*r-l*i,l*r+a*i)}e.closePath()}},gq=Ma(3),F7t={draw(e,t){const n=-Ma(t/(gq*3));e.moveTo(0,n*2),e.lineTo(-gq*n,-n),e.lineTo(gq*n,-n),e.closePath()}},nf=-.5,rf=Ma(3)/2,$ne=1/Ma(12),$7t=($ne/2+1)*3,N7t={draw(e,t){const n=Ma(t/$7t),r=n/2,i=n*$ne,o=r,s=n*$ne+n,a=-o,l=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,l),e.lineTo(nf*r-rf*i,rf*r+nf*i),e.lineTo(nf*o-rf*s,rf*o+nf*s),e.lineTo(nf*a-rf*l,rf*a+nf*l),e.lineTo(nf*r+rf*i,nf*i-rf*r),e.lineTo(nf*o+rf*s,nf*s-rf*o),e.lineTo(nf*a+rf*l,nf*l-rf*a),e.closePath()}};function bGe(e,t){let n=null,r=mV(i);e=typeof e=="function"?e:Dr(e||Tfe),t=typeof t=="function"?t:Dr(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Dr(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Dr(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function eb(){}function jj(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function vV(e){this._context=e}vV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:jj(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:jj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xGe(e){return new vV(e)}function wGe(e){this._context=e}wGe.prototype={areaStart:eb,areaEnd:eb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:jj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SGe(e){return new wGe(e)}function _Ge(e){this._context=e}_Ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:jj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CGe(e){return new _Ge(e)}function OGe(e,t){this._basis=new vV(e),this._beta=t}OGe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,s=t[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(r+l*o),this._beta*t[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const z7t=(function e(t){function n(r){return t===1?new vV(r):new OGe(r,t)}return n.beta=function(r){return e(+r)},n})(.85);function Bj(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Pfe(e,t){this._context=e,this._k=(1-t)/6}Pfe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Bj(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Bj(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const j7t=(function e(t){function n(r){return new Pfe(r,t)}return n.tension=function(r){return e(+r)},n})(0);function kfe(e,t){this._context=e,this._k=(1-t)/6}kfe.prototype={areaStart:eb,areaEnd:eb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Bj(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const B7t=(function e(t){function n(r){return new kfe(r,t)}return n.tension=function(r){return e(+r)},n})(0);function Mfe(e,t){this._context=e,this._k=(1-t)/6}Mfe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Bj(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const U7t=(function e(t){function n(r){return new Mfe(r,t)}return n.tension=function(r){return e(+r)},n})(0);function Afe(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Za){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Za){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}function EGe(e,t){this._context=e,this._alpha=t}EGe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Afe(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const V7t=(function e(t){function n(r){return t?new EGe(r,t):new Pfe(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);function TGe(e,t){this._context=e,this._alpha=t}TGe.prototype={areaStart:eb,areaEnd:eb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Afe(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const W7t=(function e(t){function n(r){return t?new TGe(r,t):new kfe(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);function PGe(e,t){this._context=e,this._alpha=t}PGe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Afe(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const H7t=(function e(t){function n(r){return t?new PGe(r,t):new Mfe(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);function kGe(e){this._context=e}kGe.prototype={areaStart:eb,areaEnd:eb,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function MGe(e){return new kGe(e)}function JCe(e){return e<0?-1:1}function eOe(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(JCe(o)+JCe(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function tOe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function mq(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function Uj(e){this._context=e}Uj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:mq(this,this._t0,tOe(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,mq(this,tOe(this,n=eOe(this,e,t)),n);break;default:mq(this,this._t0,n=eOe(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function AGe(e){this._context=new RGe(e)}(AGe.prototype=Object.create(Uj.prototype)).point=function(e,t){Uj.prototype.point.call(this,t,e)};function RGe(e){this._context=e}RGe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function IGe(e){return new Uj(e)}function DGe(e){return new AGe(e)}function LGe(e){this._context=e}LGe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=nOe(e),i=nOe(t),o=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function $Ge(e){return new yV(e,.5)}function NGe(e){return new yV(e,0)}function zGe(e){return new yV(e,1)}function lE(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,a=o.length;n=0;)n[t]=t;return n}function G7t(e,t){return e[t]}function q7t(e){const t=[];return t.key=e,t}function X7t(){var e=Dr([]),t=Nne,n=lE,r=G7t;function i(o){var s=Array.from(e.apply(this,arguments),q7t),a,l=s.length,c=-1,u;for(const f of o)for(a=0,++c;a0){for(var n,r,i=0,o=e[0].length,s;i0){for(var n=0,r=e[t[0]],i,o=r.length;n0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;rtypeof Image<"u"?Image:null;function fd(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Av(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Vj=Symbol("implicit");function GD(){var e=new bCe,t=[],n=[],r=Vj;function i(o){let s=e.get(o);if(s===void 0){if(r!==Vj)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new bCe;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return GD(t,n).unknown(r)},fd.apply(i,arguments),i}function lR(){var e=GD().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete e.unknown;function f(){var d=t().length,h=i>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?aN(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?aN(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=eqt.exec(e))?new Js(t[1],t[2],t[3],1):(t=tqt.exec(e))?new Js(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nqt.exec(e))?aN(t[1],t[2],t[3],t[4]):(t=rqt.exec(e))?aN(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iqt.exec(e))?cOe(t[1],t[2]/100,t[3]/100,1):(t=oqt.exec(e))?cOe(t[1],t[2]/100,t[3]/100,t[4]):rOe.hasOwnProperty(e)?sOe(rOe[e]):e==="transparent"?new Js(NaN,NaN,NaN,0):null}function sOe(e){return new Js(e>>16&255,e>>8&255,e&255,1)}function aN(e,t,n,r){return r<=0&&(e=t=n=NaN),new Js(e,t,n,r)}function Rfe(e){return e instanceof Mb||(e=uR(e)),e?(e=e.rgb(),new Js(e.r,e.g,e.b,e.opacity)):new Js}function tb(e,t,n,r){return arguments.length===1?Rfe(e):new Js(e,t,n,r??1)}function Js(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}eP(Js,tb,qD(Mb,{brighter(e){return e=e==null?cE:Math.pow(cE,e),new Js(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gw:Math.pow(gw,e),new Js(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Js(z1(this.r),z1(this.g),z1(this.b),Wj(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:aOe,formatHex:aOe,formatHex8:lqt,formatRgb:lOe,toString:lOe}));function aOe(){return`#${v1(this.r)}${v1(this.g)}${v1(this.b)}`}function lqt(){return`#${v1(this.r)}${v1(this.g)}${v1(this.b)}${v1((isNaN(this.opacity)?1:this.opacity)*255)}`}function lOe(){const e=Wj(this.opacity);return`${e===1?"rgb(":"rgba("}${z1(this.r)}, ${z1(this.g)}, ${z1(this.b)}${e===1?")":`, ${e})`}`}function Wj(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function z1(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function v1(e){return e=z1(e),(e<16?"0":"")+e.toString(16)}function cOe(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Zd(e,t,n,r)}function BGe(e){if(e instanceof Zd)return new Zd(e.h,e.s,e.l,e.opacity);if(e instanceof Mb||(e=uR(e)),!e)return new Zd;if(e instanceof Zd)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n0&&l<1?0:s,new Zd(s,a,l,e.opacity)}function Hj(e,t,n,r){return arguments.length===1?BGe(e):new Zd(e,t,n,r??1)}function Zd(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}eP(Zd,Hj,qD(Mb,{brighter(e){return e=e==null?cE:Math.pow(cE,e),new Zd(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gw:Math.pow(gw,e),new Zd(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Js(vq(e>=240?e-240:e+120,i,r),vq(e,i,r),vq(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Zd(uOe(this.h),lN(this.s),lN(this.l),Wj(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wj(this.opacity);return`${e===1?"hsl(":"hsla("}${uOe(this.h)}, ${lN(this.s)*100}%, ${lN(this.l)*100}%${e===1?")":`, ${e})`}`}}));function uOe(e){return e=(e||0)%360,e<0?e+360:e}function lN(e){return Math.max(0,Math.min(1,e||0))}function vq(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const UGe=Math.PI/180,VGe=180/Math.PI,Gj=18,WGe=.96422,HGe=1,GGe=.82521,qGe=4/29,mO=6/29,XGe=3*mO*mO,cqt=mO*mO*mO;function YGe(e){if(e instanceof Hp)return new Hp(e.l,e.a,e.b,e.opacity);if(e instanceof Fm)return QGe(e);e instanceof Js||(e=Rfe(e));var t=wq(e.r),n=wq(e.g),r=wq(e.b),i=yq((.2225045*t+.7168786*n+.0606169*r)/HGe),o,s;return t===n&&n===r?o=s=i:(o=yq((.4360747*t+.3850649*n+.1430804*r)/WGe),s=yq((.0139322*t+.0971045*n+.7141733*r)/GGe)),new Hp(116*i-16,500*(o-i),200*(i-s),e.opacity)}function qj(e,t,n,r){return arguments.length===1?YGe(e):new Hp(e,t,n,r??1)}function Hp(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}eP(Hp,qj,qD(Mb,{brighter(e){return new Hp(this.l+Gj*(e??1),this.a,this.b,this.opacity)},darker(e){return new Hp(this.l-Gj*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=WGe*bq(t),e=HGe*bq(e),n=GGe*bq(n),new Js(xq(3.1338561*t-1.6168667*e-.4906146*n),xq(-.9787684*t+1.9161415*e+.033454*n),xq(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function yq(e){return e>cqt?Math.pow(e,1/3):e/XGe+qGe}function bq(e){return e>mO?e*e*e:XGe*(e-qGe)}function xq(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function wq(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function uqt(e){if(e instanceof Fm)return new Fm(e.h,e.c,e.l,e.opacity);if(e instanceof Hp||(e=YGe(e)),e.a===0&&e.b===0)return new Fm(NaN,0=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r()=>e;function t9e(e,t){return function(n){return e+n*t}}function dqt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function wV(e,t){var n=t-e;return n?t9e(e,n>180||n<-180?n-360*Math.round(n/360):n):xV(isNaN(e)?t:e)}function hqt(e){return(e=+e)==1?ea:function(t,n){return n-t?dqt(t,n,e):xV(isNaN(t)?n:t)}}function ea(e,t){var n=t-e;return n?t9e(e,n):xV(isNaN(e)?t:e)}const jne=(function e(t){var n=hqt(t);function r(i,o){var s=n((i=tb(i)).r,(o=tb(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=ea(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r})(1);function n9e(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Hd(r,i)})),n=Sq.lastIndex;return n180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Hd(c,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(c,u,f,d){c!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Hd(c,u)}):u&&f.push(i(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:Hd(c,f)},{i:g-2,x:Hd(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function jqt(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i2?Bqt:jqt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(e.map(r),t,n)))(r(s(d)))}return f.invert=function(d){return s(i((c||(c=a(t,e.map(r),Hd)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Yj),u()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=XD,u()},f.clamp=function(d){return arguments.length?(s=d?!0:Bl,u()):s!==Bl},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function $fe(){return SV()(Bl,Bl)}function Nfe(e,t,n,r){var i=K0(e,t,n),o;switch(r=pw(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=kWe(i,s))&&(r.precision=o),Sue(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=MWe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=PWe(i))&&(r.precision=o-(r.type==="%")*2);break}}return KU(r)}function Rb(e){var t=e.domain;return e.ticks=function(n){var r=t();return Sne(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Nfe(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a0;){if(c=_ne(s,a,n),c===l)return r[i]=s,r[o]=a,t(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return e},e}function dR(){var e=$fe();return e.copy=function(){return YD(e,dR())},fd.apply(e,arguments),Rb(e)}function zfe(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Yj),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return zfe(e).unknown(t)},e=arguments.length?Array.from(e,Yj):[0,1],Rb(n)}function h9e(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return oMath.pow(e,t)}function Gqt(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function bOe(e){return(t,n)=>-e(-t,n)}function jfe(e){const t=e(vOe,yOe),n=t.domain;let r=10,i,o;function s(){return i=Gqt(r),o=Hqt(r),n()[0]<0?(i=bOe(i),o=bOe(o),e(Uqt,Vqt)):e(vOe,yOe),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;d<=h;++d)for(p=1;pu)break;v.push(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(gu)break;v.push(g)}v.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=pw(l)).precision==null&&(l.trim=!0),l=KU(l)),a===1/0)return l;const c=Math.max(1,r*a/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(h9e(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function Bfe(){const e=jfe(SV()).domain([1,10]);return e.copy=()=>YD(e,Bfe()).base(e.base()),fd.apply(e,arguments),e}function xOe(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function wOe(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ufe(e){var t=1,n=e(xOe(t),wOe(t));return n.constant=function(r){return arguments.length?e(xOe(t=+r),wOe(t)):t},Rb(n)}function Vfe(){var e=Ufe(SV());return e.copy=function(){return YD(e,Vfe()).constant(e.constant())},fd.apply(e,arguments)}function SOe(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function qqt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Xqt(e){return e<0?-e*e:e*e}function Wfe(e){var t=e(Bl,Bl),n=1;function r(){return n===1?e(Bl,Bl):n===.5?e(qqt,Xqt):e(SOe(n),SOe(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Rb(t)}function _V(){var e=Wfe(SV());return e.copy=function(){return YD(e,_V()).exponent(e.exponent())},fd.apply(e,arguments),e}function p9e(){return _V.apply(null,arguments).exponent(.5)}function _Oe(e){return Math.sign(e)*e*e}function Yqt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function g9e(){var e=$fe(),t=[0,1],n=!1,r;function i(o){var s=Yqt(e(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return e.invert(_Oe(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Yj)).map(_Oe)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return g9e(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},fd.apply(i,arguments),Rb(i)}function Hfe(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s0?n[a-1]:e[0],a=n?[r[n-1],t]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return Gfe().domain([e,t]).range(i).unknown(o)},fd.apply(Rb(s),arguments)}function qfe(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[dv(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return qfe().domain(e).range(t).unknown(n)},fd.apply(i,arguments)}function Qqt(e){return new Date(e)}function Kqt(e){return e instanceof Date?+e:+new Date(+e)}function Xfe(e,t,n,r,i,o,s,a,l,c){var u=$fe(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),w=c("%Y");function S(_){return(l(_)<_?h:a(_)<_?p:s(_)<_?g:o(_)<_?m:r(_)<_?i(_)<_?v:y:n(_)<_?b:w)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?d(Array.from(_,Kqt)):d().map(Qqt)},u.ticks=function(_){var E=d();return e(E[0],E[E.length-1],_??10)},u.tickFormat=function(_,E){return E==null?S:c(E)},u.nice=function(_){var E=d();return(!_||typeof _.range!="function")&&(_=t(E[0],E[E.length-1],_??10)),_?d(h9e(E,_)):u},u.copy=function(){return YD(u,Xfe(e,t,n,r,i,o,s,a,l,c))},u}function m9e(){return fd.apply(Xfe(ZWt,JWt,ng,rR,YT,qm,eV,ZU,Lm,Tue).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function v9e(){return fd.apply(Xfe(QWt,KWt,rg,iR,QT,L0,tV,JU,Lm,Pue).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function CV(){var e=0,t=1,n,r,i,o,s=Bl,a=!1,l;function c(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(f){return arguments.length?(a=!!f,c):a},c.interpolator=function(f){return arguments.length?(s=f,c):s};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),c):[s(0),s(1)]}}return c.range=u(Ab),c.rangeRound=u(XD),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),c}}function Ib(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function OV(){var e=Rb(CV()(Bl));return e.copy=function(){return Ib(e,OV())},Av.apply(e,arguments)}function Yfe(){var e=jfe(CV()).domain([1,10]);return e.copy=function(){return Ib(e,Yfe()).base(e.base())},Av.apply(e,arguments)}function Qfe(){var e=Ufe(CV());return e.copy=function(){return Ib(e,Qfe()).constant(e.constant())},Av.apply(e,arguments)}function EV(){var e=Wfe(CV());return e.copy=function(){return Ib(e,EV()).exponent(e.exponent())},Av.apply(e,arguments)}function y9e(){return EV.apply(null,arguments).exponent(.5)}function b9e(){var e=[],t=Bl;function n(r){if(r!=null&&!isNaN(r=+r))return t((dv(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Vp),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>Ij(e,o/r))},n.copy=function(){return b9e(t).domain(e)},Av.apply(n,arguments)}function TV(){var e=0,t=.5,n=1,r=1,i,o,s,a,l,c=Bl,u,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-o)*(r*g0?r:1:0}const lXt="identity",uE="linear",pv="log",QD="pow",KD="sqrt",kV="symlog",mw="time",vw="utc",Gp="sequential",tP="diverging",fE="quantile",MV="quantize",AV="threshold",tde="ordinal",Wne="point",w9e="band",nde="bin-ordinal",js="continuous",ZD="discrete",JD="discretizing",dd="interpolating",rde="temporal";function cXt(e){return function(t){let n=t[0],r=t[1],i;return r=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=e.invertExtent(n[o]),i=e.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function ide(){const e=GD().unknown(void 0),t=e.domain,n=e.range;let r=[0,1],i,o,s=!1,a=0,l=0,c=.5;delete e.unknown;function u(){const f=t().length,d=r[1]g+i*v);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),u()):t()},e.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},e.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,u()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(f){return arguments.length?(s=!!f,u()):s},e.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,u()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),u()):a},e.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},e.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]r[1-d])))return v=Math.max(0,dv(h,g)-1),y=g===m?v:dv(h,m)-1,g-h[v]>o+1e-10&&++v,d&&(b=v,v=p-y,y=p-b),v>y?void 0:t().slice(v,y+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return ide().domain(t()).range(r).round(s).paddingInner(a).paddingOuter(l).align(c)},u()}function S9e(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return S9e(t())},e}function fXt(){return S9e(ide().paddingInner(1))}var dXt=Array.prototype.map;function hXt(e){return dXt.call(e,ul)}const pXt=Array.prototype.slice;function _9e(){let e=[],t=[];function n(r){return r==null||r!==r?void 0:t[(dv(e,r)-1)%t.length]}return n.domain=function(r){return arguments.length?(e=hXt(r),n):e.slice()},n.range=function(r){return arguments.length?(t=pXt.call(r),n):t.slice()},n.tickFormat=function(r,i){return Nfe(e[0],Mr(e),r??10,i)},n.copy=function(){return _9e().domain(n.domain()).range(n.range())},n}const Qj=new Map,C9e=Symbol("vega_scale");function O9e(e){return e[C9e]=!0,e}function COe(e){return e&&e[C9e]===!0}function gXt(e,t,n){const r=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?cXt(o):o.invertExtent?uXt(o):void 0),o.type=e,O9e(o)};return r.metadata=vh(Vt(n)),r}function Zr(e,t,n){return arguments.length>1?(Qj.set(e,gXt(e,t,n)),this):E9e(e)?Qj.get(e):void 0}Zr(lXt,zfe);Zr(uE,dR,js);Zr(pv,Bfe,[js,pv]);Zr(QD,_V,js);Zr(KD,p9e,js);Zr(kV,Vfe,js);Zr(mw,m9e,[js,rde]);Zr(vw,v9e,[js,rde]);Zr(Gp,OV,[js,dd]);Zr(`${Gp}-${uE}`,OV,[js,dd]);Zr(`${Gp}-${pv}`,Yfe,[js,dd,pv]);Zr(`${Gp}-${QD}`,EV,[js,dd]);Zr(`${Gp}-${KD}`,y9e,[js,dd]);Zr(`${Gp}-${kV}`,Qfe,[js,dd]);Zr(`${tP}-${uE}`,Kfe,[js,dd]);Zr(`${tP}-${pv}`,Zfe,[js,dd,pv]);Zr(`${tP}-${QD}`,PV,[js,dd]);Zr(`${tP}-${KD}`,x9e,[js,dd]);Zr(`${tP}-${kV}`,Jfe,[js,dd]);Zr(fE,Hfe,[JD,fE]);Zr(MV,Gfe,JD);Zr(AV,qfe,JD);Zr(nde,_9e,[ZD,JD]);Zr(tde,GD,ZD);Zr(w9e,ide,ZD);Zr(Wne,fXt,ZD);function E9e(e){return Qj.has(e)}function SS(e,t){const n=Qj.get(e);return n&&n.metadata[t]}function ode(e){return SS(e,js)}function dE(e){return SS(e,ZD)}function Hne(e){return SS(e,JD)}function T9e(e){return SS(e,pv)}function mXt(e){return SS(e,rde)}function P9e(e){return SS(e,dd)}function k9e(e){return SS(e,fE)}const vXt=["clamp","base","constant","exponent"];function M9e(e,t){const n=t[0],r=Mr(t)-n;return function(i){return e(n+i*r)}}function RV(e,t,n){return Ffe(sde(t||"rgb",n),e)}function A9e(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[a]?s[a](e[a]()):0),s)}function sde(e,t){const n=$qt[yXt(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function yXt(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const bXt={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},xXt={accent:Jqt,category10:Zqt,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:eXt,observable10:tXt,paired:nXt,pastel1:rXt,pastel2:iXt,set1:oXt,set2:sXt,set3:aXt,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function I9e(e){if(lt(e))return e;const t=e.length/6|0,n=new Array(t);for(let r=0;rRV(I9e(e)));function ade(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(OOe[e]=t,this):OOe[e]}const Bz="symbol",wXt="discrete",SXt="gradient",_Xt=e=>lt(e)?e.map(t=>String(t)):String(e),CXt=(e,t)=>e[1]-t[1],OXt=(e,t)=>t[1]-e[1];function lde(e,t,n){let r;return Qr(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(jD(e.domain())/n||1)+1))),Ht(t)&&(r=t.step,t=t.interval),Kt(t)&&(t=e.type===mw?KT(t):e.type==vw?ZT(t):et("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function L9e(e,t,n){let r=e.range(),i=r[0],o=Mr(r),s=CXt;if(i>o&&(r=o,o=i,i=r,s=OXt),i=Math.floor(i),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Mr(t)];for(;t.length>n&&t.length>=3;)t=t.filter((l,c)=>!(c%2));t.length<3&&(t=a)}return t}function cde(e,t){return e.bins?L9e(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function F9e(e,t,n,r,i,o){const s=t.type;let a=_Xt;if(s===mw||i===mw)a=e.timeFormat(r);else if(s===vw||i===vw)a=e.utcFormat(r);else if(T9e(s)){const l=e.formatFloat(r);if(o||t.bins)a=l;else{const c=$9e(t,n,!1);a=u=>c(u)?l(u):""}}else if(t.tickFormat){const l=t.domain();a=e.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=e.format(r));return a}function $9e(e,t,n){const r=cde(e,t),i=e.base(),o=Math.log(i),s=Math.max(1,i*t/r.length),a=l=>{let c=l/Math.pow(i,Math.round(Math.log(l)/o));return c*i1?r[1]-r[0]:r[0],s;for(s=1;sGne[e.type]||e.bins;function j9e(e,t,n,r,i,o,s){const a=N9e[t.type]&&o!==mw&&o!==vw?EXt(e,t,i):F9e(e,t,n,i,o,s);return r===Bz&&kXt(t)?MXt(a):r===wXt?AXt(a):RXt(a)}const MXt=e=>(t,n,r)=>{const i=EOe(r[n+1],EOe(r.max,1/0)),o=TOe(t,e),s=TOe(i,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},EOe=(e,t)=>e??t,AXt=e=>(t,n)=>n?e(t):null,RXt=e=>t=>e(t),TOe=(e,t)=>Number.isFinite(e)?t(e):null;function IXt(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+Mr(t),o=i-r;if(e.type===AV){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function DXt(e,t,n,r){const i=r||t.type;return Kt(n)&&mXt(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===mw?e.timeFormat("%A, %d %B %Y, %X"):!n&&i===vw?e.utcFormat("%A, %d %B %Y, %X UTC"):j9e(e,t,5,null,n,r,!0)}function B9e(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=DXt(e,t,n.format,n.formatType);if(Hne(t.type)){const o=z9e(t).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(dE(t.type)){const o=t.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${i(o[0])} to ${i(Mr(o))}`}}let U9e=0;function LXt(){U9e=0}const Kj="p_";function ude(e){return e&&e.gradient}function V9e(e,t,n){const r=e.gradient;let i=e.id,o=r==="radial"?Kj:"";return i||(i=e.id="gradient_"+U9e++,r==="radial"?(e.x1=qh(e.x1,.5),e.y1=qh(e.y1,.5),e.r1=qh(e.r1,0),e.x2=qh(e.x2,.5),e.y2=qh(e.y2,.5),e.r2=qh(e.r2,.5),o=Kj):(e.x1=qh(e.x1,0),e.y1=qh(e.y1,0),e.x2=qh(e.x2,1),e.y2=qh(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function qh(e,t){return e??t}function W9e(e,t){var n=[],r;return r={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(i,o){return n.push({offset:i,color:o}),r}}}const POe={basis:{curve:xGe},"basis-closed":{curve:SGe},"basis-open":{curve:CGe},bundle:{curve:z7t,tension:"beta",value:.85},cardinal:{curve:j7t,tension:"tension",value:0},"cardinal-open":{curve:U7t,tension:"tension",value:0},"cardinal-closed":{curve:B7t,tension:"tension",value:0},"catmull-rom":{curve:V7t,tension:"alpha",value:.5},"catmull-rom-closed":{curve:W7t,tension:"alpha",value:.5},"catmull-rom-open":{curve:H7t,tension:"alpha",value:.5},linear:{curve:HD},"linear-closed":{curve:MGe},monotone:{horizontal:DGe,vertical:IGe},natural:{curve:FGe},step:{curve:$Ge},"step-after":{curve:zGe},"step-before":{curve:NGe}};function fde(e,t,n){var r=Yt(POe,e)&&POe[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const FXt={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},$Xt=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,NXt=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,zXt=/^((\s+,?\s*)|(,\s*))/,jXt=/^[01]/;function hE(e){const t=[];return(e.match($Xt)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=FXt[o],a=BXt(o,s,r.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,v=f/n,y=-f/r,b=d/r,w=m*a+v*l,S=y*a+b*l,_=m*e+v*t,E=y*e+b*t;let k=1/((_-w)*(_-w)+(E-S)*(E-S))-.25;k<0&&(k=0);let P=Math.sqrt(k);o==i&&(P=-P);const R=.5*(w+_)-P*(E-S),I=.5*(S+E)+P*(_-w),F=Math.atan2(S-I,w-R);let L=Math.atan2(E-I,_-R)-F;L<0&&o===1?L+=vp:L>0&&o===0&&(L-=vp);const $=Math.ceil(Math.abs(L/(n1+.001))),j=[];for(let V=0;V<$;++V){const U=F+V*L/$,z=F+(V+1)*L/$;j[V]=[R,I,U,z,n,r,f,d]}return _q[c]=j}function WXt(e){const t=H9e.call(e);if(Cq[t])return Cq[t];var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7];const u=c*s,f=-l*a,d=l*s,h=c*a,p=Math.cos(i),g=Math.sin(i),m=Math.cos(o),v=Math.sin(o),y=.5*(o-i),b=Math.sin(y*.5),w=8/3*b*b/Math.sin(y),S=n+p-w*g,_=r+g+w*p,E=n+m,T=r+v,k=E+w*v,P=T-w*m;return Cq[t]=[u*S+f*_,d*S+h*_,u*k+f*P,d*k+h*P,u*E+f*T,d*E+h*T]}const of=["l",0,0,0,0,0,0,0];function HXt(e,t,n){const r=of[0]=e[0];if(r==="a"||r==="A")of[1]=t*e[1],of[2]=n*e[2],of[3]=e[3],of[4]=e[4],of[5]=e[5],of[6]=t*e[6],of[7]=n*e[7];else if(r==="h"||r==="H")of[1]=t*e[1];else if(r==="v"||r==="V")of[1]=n*e[1];else for(var i=1,o=e.length;i+e}function uN(e,t,n){return Math.max(t,Math.min(e,n))}function q9e(){var e=qXt,t=XXt,n=YXt,r=QXt,i=Yg(0),o=i,s=i,a=i,l=null;function c(u,f,d){var h,p=f??+e.call(this,u),g=d??+t.call(this,u),m=+n.call(this,u),v=+r.call(this,u),y=Math.min(m,v)/2,b=uN(+i.call(this,u),0,y),w=uN(+o.call(this,u),0,y),S=uN(+s.call(this,u),0,y),_=uN(+a.call(this,u),0,y);if(l||(l=h=gV()),b<=0&&w<=0&&S<=0&&_<=0)l.rect(p,g,m,v);else{var E=p+m,T=g+v;l.moveTo(p+b,g),l.lineTo(E-w,g),l.bezierCurveTo(E-yy*w,g,E,g+yy*w,E,g+w),l.lineTo(E,T-_),l.bezierCurveTo(E,T-yy*_,E-yy*_,T,E-_,T),l.lineTo(p+S,T),l.bezierCurveTo(p+yy*S,T,p,T-yy*S,p,T-S),l.lineTo(p,g+b),l.bezierCurveTo(p,g+yy*b,p+yy*b,g,p+b,g),l.closePath()}if(h)return l=null,h+""||null}return c.x=function(u){return arguments.length?(e=Yg(u),c):e},c.y=function(u){return arguments.length?(t=Yg(u),c):t},c.width=function(u){return arguments.length?(n=Yg(u),c):n},c.height=function(u){return arguments.length?(r=Yg(u),c):r},c.cornerRadius=function(u,f,d,h){return arguments.length?(i=Yg(u),o=f!=null?Yg(f):i,a=d!=null?Yg(d):i,s=h!=null?Yg(h):o,c):i},c.context=function(u){return arguments.length?(l=u??null,c):l},c}function X9e(){var e,t,n,r,i=null,o,s,a,l;function c(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var v=Math.hypot(g,m),y=(g/=v)*l,b=(m/=v)*l,w=Math.atan2(m,g);i.moveTo(s-y,a-b),i.lineTo(f-g*p,d-m*p),i.arc(f,d,p,w-Math.PI,w),i.lineTo(s+y,a+b),i.arc(s,a,l,w,w+Math.PI)}else i.arc(f,d,p,0,vp);i.closePath()}else o=1;s=f,a=d,l=p}function u(f){var d,h=f.length,p,g=!1,m;for(i==null&&(i=m=gV()),d=0;d<=h;++d)!(de.x||0,nL=e=>e.y||0,KXt=e=>e.width||0,ZXt=e=>e.height||0,JXt=e=>(e.x||0)+(e.width||0),eYt=e=>(e.y||0)+(e.height||0),tYt=e=>e.startAngle||0,nYt=e=>e.endAngle||0,rYt=e=>e.padAngle||0,iYt=e=>e.innerRadius||0,oYt=e=>e.outerRadius||0,sYt=e=>e.cornerRadius||0,aYt=e=>eL(e.cornerRadiusTopLeft,e.cornerRadius)||0,lYt=e=>eL(e.cornerRadiusTopRight,e.cornerRadius)||0,cYt=e=>eL(e.cornerRadiusBottomRight,e.cornerRadius)||0,uYt=e=>eL(e.cornerRadiusBottomLeft,e.cornerRadius)||0,fYt=e=>eL(e.size,64),dYt=e=>e.size||1,IV=e=>e.defined!==!1,hYt=e=>G9e(e.shape||"circle"),pYt=O7t().startAngle(tYt).endAngle(nYt).padAngle(rYt).innerRadius(iYt).outerRadius(oYt).cornerRadius(sYt),gYt=WC().x(tL).y1(nL).y0(eYt).defined(IV),mYt=WC().y(nL).x1(tL).x0(JXt).defined(IV),vYt=Efe().x(tL).y(nL).defined(IV),yYt=q9e().x(tL).y(nL).width(KXt).height(ZXt).cornerRadius(aYt,lYt,cYt,uYt),bYt=bGe().type(hYt).size(fYt),xYt=X9e().x(tL).y(nL).defined(IV).size(dYt);function dde(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function wYt(e,t){return pYt.context(e)(t)}function SYt(e,t){const n=t[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?mYt:gYt).curve(fde(r,n.orient,n.tension)).context(e)(t)}function _Yt(e,t){const n=t[0],r=n.interpolate||"linear";return vYt.curve(fde(r,n.orient,n.tension)).context(e)(t)}function nP(e,t,n,r){return yYt.context(e)(t,n,r)}function CYt(e,t){return(t.mark.shape||t.shape).context(e)(t)}function OYt(e,t){return bYt.context(e)(t)}function EYt(e,t){return xYt.context(e)(t)}var Y9e=1;function TYt(){Y9e=1}function hde(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+Y9e++),s=i.clipping[o]||(i.clipping[o]={id:o});return ir(r)?s.path=r(null):dde(n)?s.path=nP(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function xs(e){this.clear(),e&&this.union(e)}xs.prototype={clone(){return new xs(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(e),l=Math.sin(e),c=t-t*a+n*l,u=n-t*l-n*a;return[a*r-l*i+c,l*r+a*i+u,a*r-l*s+c,l*r+a*s+u,a*o-l*i+c,l*o+a*i+u,a*o-l*s+c,l*o+a*s+u]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function DV(e){this.mark=e,this.bounds=this.bounds||new xs}function LV(e){DV.call(this,e),this.items=this.items||[]}Rt(LV,DV);class Q9e{constructor(t){this._pending=0,this._loader=t||rV()}pending(){return this._pending}sanitizeURL(t){const n=this;return ROe(n),n._loader.sanitize(t,{context:"href"}).then(r=>(Yk(n),r)).catch(()=>(Yk(n),null))}loadImage(t){const n=this,r=Z7t();return ROe(n),n._loader.sanitize(t,{context:"image"}).then(i=>{const o=i.href;if(!o||!r)throw{url:o};const s=new r,a=Yt(i,"crossOrigin")?i.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>Yk(n),s.onerror=()=>Yk(n),s.src=o,s}).catch(i=>(Yk(n),{complete:!1,width:0,height:0,src:i&&i.url||""}))}ready(){const t=this;return new Promise(n=>{function r(i){t.pending()?setTimeout(()=>{r(!0)},10):n(i)}r(!1)})}}function ROe(e){e._pending+=1}function Yk(e){e._pending-=1}function Rv(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const r=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(r+(n?PYt(t,r):0))}return e}function PYt(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const kYt=vp-1e-8;let FV,Uz,Vz,y1,qne,Wz,Xne,Yne;const d0=(e,t)=>FV.add(e,t),Hz=(e,t)=>d0(Uz=e,Vz=t),IOe=e=>d0(e,FV.y1),DOe=e=>d0(FV.x1,e),r1=(e,t)=>qne*e+Xne*t,i1=(e,t)=>Wz*e+Yne*t,Eq=(e,t)=>d0(r1(e,t),i1(e,t)),Tq=(e,t)=>Hz(r1(e,t),i1(e,t));function rL(e,t){return FV=e,t?(y1=t*nb,qne=Yne=Math.cos(y1),Wz=Math.sin(y1),Xne=-Wz):(qne=Yne=1,y1=Wz=Xne=0),MYt}const MYt={beginPath(){},closePath(){},moveTo:Tq,lineTo:Tq,rect(e,t,n,r){y1?(Eq(e+n,t),Eq(e+n,t+r),Eq(e,t+r),Tq(e,t)):(d0(e+n,t+r),Hz(e,t))},quadraticCurveTo(e,t,n,r){const i=r1(e,t),o=i1(e,t),s=r1(n,r),a=i1(n,r);LOe(Uz,i,s,IOe),LOe(Vz,o,a,DOe),Hz(s,a)},bezierCurveTo(e,t,n,r,i,o){const s=r1(e,t),a=i1(e,t),l=r1(n,r),c=i1(n,r),u=r1(i,o),f=i1(i,o);FOe(Uz,s,l,u,IOe),FOe(Vz,a,c,f,DOe),Hz(u,f)},arc(e,t,n,r,i,o){if(r+=y1,i+=y1,Uz=n*Math.cos(i)+e,Vz=n*Math.sin(i)+t,Math.abs(i-r)>kYt)d0(e-n,t-n),d0(e+n,t+n);else{const s=c=>d0(n*Math.cos(c)+e,n*Math.sin(c)+t);let a,l;if(s(r),s(i),i!==r)if(r=r%vp,r<0&&(r+=vp),i=i%vp,i<0&&(i+=vp),ii;++l,a-=n1)s(a);else for(a=r-r%n1+n1,l=0;l<4&&aUXt?(u=s*s+a*o,u>=0&&(u=Math.sqrt(u),l=(-s+u)/o,c=(-s-u)/o)):l=.5*a/s,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=J9e(e,t,t.fill),!0):!1}var RYt=[];function gE(e,t,n){var r=(r=t.strokeWidth)!=null?r:1;return r<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=J9e(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||RYt),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function IYt(e,t){return e.zindex-t.zindex||e.index-t.index}function mde(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],r,i,o;for(i=0,o=t.length;i=0;)if(r=t(n[i]))return r;if(n===o){for(n=e.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=t(n[i])))return r}return null}function vde(e){return function(t,n,r){bh(n,i=>{(!r||r.intersects(i.bounds))&&e7e(e,t,i,i)})}}function DYt(e){return function(t,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&e7e(e,t,n.items[0],n.items)}}function e7e(e,t,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(e(t,r)||(pE(t,n),n.fill&&Zj(t,n,i)&&t.fill(),n.stroke&&gE(t,n,i)&&t.stroke()))}function $V(e){return e=e||Kf,function(t,n,r,i,o,s){return r*=t.pixelRatio,i*=t.pixelRatio,Jj(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&e(t,a,r,i,o,s))return a})}}function iL(e,t){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=t??s.fill,l=s.stroke&&n.isPointInStroke,c,u;return l&&(c=s.strokeWidth,u=s.strokeCap,n.lineWidth=c??1,n.lineCap=u??"butt"),e(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function yde(e){return $V(iL(e))}function B1(e,t){return"translate("+e+","+t+")"}function bde(e){return"rotate("+e+")"}function LYt(e,t){return"scale("+e+","+t+")"}function t7e(e){return B1(e.x||0,e.y||0)}function FYt(e){return B1(e.x||0,e.y||0)+(e.angle?" "+bde(e.angle):"")}function $Yt(e){return B1(e.x||0,e.y||0)+(e.angle?" "+bde(e.angle):"")+(e.scaleX||e.scaleY?" "+LYt(e.scaleX||1,e.scaleY||1):"")}function xde(e,t,n){function r(s,a){s("transform",FYt(a)),s("d",t(null,a))}function i(s,a){return t(rL(s,a.angle),a),Rv(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,c=a.y||0,u=a.angle||0;s.translate(l,c),u&&s.rotate(u*=nb),s.beginPath(),t(s,a),u&&s.rotate(-u),s.translate(-l,-c)}return{type:e,tag:"path",nested:!1,attr:r,bound:i,draw:vde(o),pick:yde(o),isect:n||pde(o)}}var NYt=xde("arc",wYt);function zYt(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],r=e[0].orient==="horizontal"?"y":"x",i=e.length,o=1/0,s,a;--i>=0;)e[i].defined!==!1&&(a=Math.abs(e[i][r]-n),a=0;)if(e[r].defined!==!1&&(i=e[r].x-t[0],o=e[r].y-t[1],s=i*i+o*o,s=0;)if(e[n].defined!==!1&&(r=e[n].x-t[0],i=e[n].y-t[1],o=r*r+i*i,r=e[n].size||1,o.5&&t<1.5?.5-Math.abs(t-1):0}function WYt(e,t){e("transform",t7e(t))}function i7e(e,t){const n=r7e(t);e("d",nP(null,t,n,n))}function HYt(e,t){e("class","background"),e("aria-hidden",!0),i7e(e,t)}function GYt(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?i7e(e,t):e("d","")}function qYt(e,t,n){const r=t.clip?hde(n,t,t):null;e("clip-path",r)}function XYt(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let i=0;i{const o=i.x||0,s=i.y||0,a=i.strokeForeground,l=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&l&&(pR(e,i,o,s),pE(e,i),i.fill&&Zj(e,i,l)&&e.fill(),i.stroke&&!a&&gE(e,i,l)&&e.stroke()),e.save(),e.translate(o,s),i.clip&&n7e(e,i),n&&n.translate(-o,-s),bh(i,c=>{(c.marktype==="group"||r==null||r.includes(c.marktype))&&this.draw(e,c,n,r)}),n&&n.translate(o,s),e.restore(),a&&i.stroke&&l&&(pR(e,i,o,s),pE(e,i),gE(e,i,l)&&e.stroke())})}function JYt(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const s=n*e.pixelRatio,a=r*e.pixelRatio;return Jj(t,l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(i,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(ih||op))return;if(e.save(),e.translate(u,f),u=i-u,f=o-f,g&&dde(l)&&!KYt(e,l,s,a))return e.restore(),null;const m=l.strokeForeground,v=t.interactive!==!1;return v&&m&&l.stroke&&QYt(e,l,s,a)?(e.restore(),l):(c=Jj(l,y=>eQt(y,u,f)?this.pick(y,n,r,u,f):null),!c&&v&&(l.fill||!m&&l.stroke)&&YYt(e,l,s,a)&&(c=l),e.restore(),c||null)})}function eQt(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var tQt={type:"group",tag:"g",nested:!1,attr:WYt,bound:XYt,draw:ZYt,pick:JYt,isect:K9e,content:qYt,background:HYt,foreground:GYt},gR={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Sde(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(r=>{e.image=r,e.image.url=e.url})),n}function _de(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function Cde(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function NV(e,t){return e==="center"?t/2:e==="right"?t:0}function zV(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function nQt(e,t,n){const r=Sde(t,n),i=_de(t,r),o=Cde(t,r),s=(t.x||0)-NV(t.align,i),a=(t.y||0)-zV(t.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";e("href",l,gR["xmlns:xlink"],"xlink:href"),e("transform",B1(s,a)),e("width",i),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function rQt(e,t){const n=t.image,r=_de(t,n),i=Cde(t,n),o=(t.x||0)-NV(t.align,r),s=(t.y||0)-zV(t.baseline,i);return e.set(o,s,o+r,s+i)}function iQt(e,t,n){bh(t,r=>{if(n&&!n.intersects(r.bounds))return;const i=Sde(r,this);let o=_de(r,i),s=Cde(r,i);if(o===0||s===0)return;let a=(r.x||0)-NV(r.align,o),l=(r.y||0)-zV(r.baseline,s),c,u,f,d;r.aspect!==!1&&(u=i.width/i.height,f=r.width/r.height,u===u&&f===f&&u!==f&&(f{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&o7e(e,r,i)&&(pE(e,r),e.stroke())}})}function mQt(e,t,n,r){return e.isPointInStroke?o7e(e,t,1)&&e.isPointInStroke(n,r):!1}var vQt={type:"rule",tag:"line",nested:!1,attr:hQt,bound:pQt,draw:gQt,pick:$V(mQt),isect:Z9e},yQt=xde("shape",CYt),bQt=xde("symbol",OYt,gde);const jOe=cWe();var Au={height:wg,measureWidth:Ode,estimateWidth:eB,width:eB,canvas:s7e};s7e(!0);function s7e(e){Au.width=e&&N0?Ode:eB}function eB(e,t){return a7e(ib(e,t),wg(e))}function a7e(e,t){return~~(.8*e.length*t)}function Ode(e,t){return wg(e)<=0||!(t=ib(e,t))?0:l7e(t,jV(e))}function l7e(e,t){const n=`(${t}) ${e}`;let r=jOe.get(n);return r===void 0&&(N0.font=t,r=N0.measureText(e).width,jOe.set(n,r)),r}function wg(e){return e.fontSize!=null?+e.fontSize||0:11}function rb(e){return e.lineHeight!=null?e.lineHeight:wg(e)+2}function xQt(e){return lt(e)?e.length>1?e:e[0]:e}function oL(e){return xQt(e.lineBreak&&e.text&&!lt(e.text)?e.text.split(e.lineBreak):e.text)}function Ede(e){const t=oL(e);return(lt(t)?t.length-1:0)*rb(e)}function ib(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?SQt(e,n):n}function wQt(e){if(Au.width===Ode){const t=jV(e);return n=>l7e(n,t)}else if(Au.width===eB){const t=wg(e);return n=>a7e(n,t)}else return t=>Au.width(e,t)}function SQt(e,t){var n=+e.limit,r=wQt(e);if(r(t)>>1,r(t.slice(l))>n?s=l+1:a=l;return i+t.slice(s)}else{for(;s>>1),r(t.slice(0,l))Math.max(d,Au.width(t,h)),0)):f=Au.width(t,u),i==="center"?l-=f/2:i==="right"&&(l-=f),e.set(l+=s,c+=a,l+f,c+r),t.angle&&!n)e.rotate(t.angle*nb,s,a);else if(n===2)return e.rotatedPoints(t.angle*nb,s,a);return e}function OQt(e,t,n){bh(t,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,c,u,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(e.font=jV(r),e.textAlign=r.align||"left",o=BV(r),s=o.x1,a=o.y1,r.angle&&(e.save(),e.translate(s,a),e.rotate(r.angle*nb),s=a=0),s+=r.dx||0,a+=(r.dy||0)+Tde(r),u=oL(r),pE(e,r),lt(u))for(c=rb(r),l=0;lt;)e.removeChild(n[--r]);return e}function p7e(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function UV(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function AQt(e,t,n,r){var i=e&&e.mark,o,s;if(i&&(o=Uu[i.marktype]).tip){for(s=UV(t,n),s[0]-=r[0],s[1]-=r[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(i.items,s)}return e}let Mde=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||rV(),this._tooltip=n||RQt}initialize(t,n,r){return this._el=t,this._obj=r||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,r){for(let i=t?t.length:0;--i>=0;)if(t[i].type===n&&(!r||t[i].handler===r))return i;return-1}handlers(t){const n=this._handlers,r=[];if(t)r.push(...n[this.eventName(t)]);else for(const i in n)r.push(...n[i]);return r}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,r){this._loader.sanitize(r,{context:"href"}).then(i=>{const o=new MouseEvent(t.type,t),s=h0(null,"a");for(const a in i)s.setAttribute(a,i[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(t,n,r){if(n&&n.tooltip!=null){n=AQt(n,t,this.canvas(),this._origin);const i=r&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,i)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const r=n.getBoundingClientRect(),i=this._origin,o=t.bounds,s=o.width(),a=o.height();let l=o.x1+i[0]+r.left,c=o.y1+i[1]+r.top;for(;t.mark&&(t=t.mark.group);)l+=t.x||0,c+=t.y||0;return{x:l,y:c,width:s,height:a,left:l,top:c,right:l+s,bottom:c+a}}};function RQt(e,t,n,r){e.element().setAttribute("title",r||"")}class aL{constructor(t){this._el=null,this._bgcolor=null,this._loader=new Q9e(t)}initialize(t,n,r,i,o){return this._el=t,this.resize(n,r,i,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,r,i){return this._width=t,this._height=n,this._origin=r||[0,0],this._scale=i||1,this}dirty(){}render(t,n){const r=this;return r._call=function(){r._render(t,n)},r._call(),r._call=null,r}_render(){}renderAsync(t,n){const r=this.render(t,n);return this._ready?this._ready.then(()=>r):Promise.resolve(r)}_load(t,n){var r=this,i=r._loader[t](n);if(!r._ready){const o=r._call;r._ready=r._loader.ready().then(s=>{s&&o(),r._ready=null})}return i}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const IQt="keydown",DQt="keypress",LQt="keyup",g7e="dragenter",qz="dragleave",m7e="dragover",Zne="pointerdown",FQt="pointerup",tB="pointermove",Xz="pointerout",v7e="pointerover",Jne="mousedown",$Qt="mouseup",y7e="mousemove",nB="mouseout",b7e="mouseover",rB="click",NQt="dblclick",zQt="wheel",x7e="mousewheel",iB="touchstart",oB="touchmove",sB="touchend",jQt=[IQt,DQt,LQt,g7e,qz,m7e,Zne,FQt,tB,Xz,v7e,Jne,$Qt,y7e,nB,b7e,rB,NQt,zQt,x7e,iB,oB,sB],ere=tB,ZM=nB,tre=rB;class lL extends Mde{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=jQt,this.pointermove=WOe([tB,y7e],[v7e,b7e],[Xz,nB]),this.dragover=WOe([m7e],[g7e],[qz]),this.pointerout=HOe([Xz,nB]),this.dragleave=HOe([qz])}initialize(t,n,r){return this._canvas=t&&kde(t,"canvas"),[rB,Jne,Zne,tB,Xz,qz].forEach(i=>VOe(this,i)),super.initialize(t,n,r)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(x7e,t)}pointerdown(t){this._down=this._active,this.fire(Zne,t)}mousedown(t){this._down=this._active,this.fire(Jne,t)}click(t){this._down===this._active&&(this.fire(rB,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(iB,t,!0)}touchmove(t){this.fire(oB,t,!0)}touchend(t){this.fire(sB,t,!0),this._touch=null}fire(t,n,r){const i=r?this._touch:this._active,o=this._handlers[t];if(n.vegaType=t,t===tre&&i&&i.href?this.handleHref(n,i,i.href):(t===ere||t===ZM)&&this.handleTooltip(n,i,t!==ZM),o)for(let s=0,a=o.length;s=0&&i.splice(o,1),this}pickEvent(t){const n=UV(t,this._canvas),r=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-r[0],n[1]-r[1])}pick(t,n,r,i,o){const s=this.context();return Uu[t.marktype].pick.call(this,s,t,n,r,i,o)}}const BQt=e=>e===iB||e===oB||e===sB?[iB,oB,sB]:[e];function VOe(e,t){BQt(t).forEach(n=>UQt(e,n))}function UQt(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?r=>e[t](r):r=>e.fire(t,r)))}function fM(e,t,n){t.forEach(r=>e.fire(r,n))}function WOe(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?fM(this,e,r):((!i||!i.exit)&&fM(this,n,r),this._active=o,fM(this,t,r),fM(this,e,r))}}function HOe(e){return function(t){fM(this,e,t),this._active=null}}function VQt(){return typeof window<"u"&&window.devicePixelRatio||1}function WQt(e,t,n,r,i,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),l=s?VQt():i;e.width=t*l,e.height=n*l;for(const c in o)a[c]=o[c];return s&&l!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),e}class aB extends aL{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new xs,this._tempb=new xs}initialize(t,n,r,i,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:$0(1,1,this._options.type),t&&this._canvas&&(vf(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,r,i,o)}resize(t,n,r,i){if(super.resize(t,n,r,i),this._canvas)WQt(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||et("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let r=t.mark.group;for(;r;)n.translate(r.x||0,r.y||0),r=r.mark.group;this._dirty.union(n)}_render(t,n){const r=this.context(),i=this._origin,o=this._width,s=this._height,a=this._dirty,l=HQt(i,o,s);r.save();const c=this._redraw||a.empty()?(this._redraw=!1,l.expand(1)):GQt(r,l.intersect(a),i);return this.clear(-i[0],-i[1],o,s),this.draw(r,t,c,n),r.restore(),a.clear(),this}draw(t,n,r,i){if(n.marktype!=="group"&&i!=null&&!i.includes(n.marktype))return;const o=Uu[n.marktype];n.clip&&VYt(t,n),o.draw.call(this,t,n,r,i),n.clip&&t.restore()}clear(t,n,r,i){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(t,n,r,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(t,n,r,i))}}const HQt=(e,t,n)=>new xs().set(0,0,t,n).translate(-e[0],-e[1]);function GQt(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class w7e extends Mde{constructor(t,n){super(t,n);const r=this;r._hrefHandler=Pq(r,(i,o)=>{o&&o.href&&r.handleHref(i,o,o.href)}),r._tooltipHandler=Pq(r,(i,o)=>{r.handleTooltip(i,o,i.type!==ZM)})}initialize(t,n,r){let i=this._svg;return i&&(i.removeEventListener(tre,this._hrefHandler),i.removeEventListener(ere,this._tooltipHandler),i.removeEventListener(ZM,this._tooltipHandler)),this._svg=i=t&&kde(t,"svg"),i&&(i.addEventListener(tre,this._hrefHandler),i.addEventListener(ere,this._tooltipHandler),i.addEventListener(ZM,this._tooltipHandler)),super.initialize(t,n,r)}canvas(){return this._svg}on(t,n){const r=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[r],t,n)<0){const s={type:t,handler:n,listener:Pq(this,n)};(i[r]||(i[r]=[])).push(s),this._svg&&this._svg.addEventListener(r,s.listener)}return this}off(t,n){const r=this.eventName(t),i=this._handlers[r],o=this._handlerIndex(i,t,n);return o>=0&&(this._svg&&this._svg.removeEventListener(r,i[o].listener),i.splice(o,1)),this}}const Pq=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)},S7e="aria-hidden",Ade="aria-label",Rde="role",Ide="aria-roledescription",_7e="graphics-object",Dde="graphics-symbol",C7e=(e,t,n)=>({[Rde]:e,[Ide]:t,[Ade]:n||void 0}),qQt=vh(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),GOe={axis:{desc:"axis",caption:QQt},legend:{desc:"legend",caption:KQt},"title-text":{desc:"title",caption:e=>`Title text '${XOe(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${XOe(e)}'`}},qOe={ariaRole:Rde,ariaRoleDescription:Ide,description:Ade};function O7e(e,t){const n=t.aria===!1;if(e(S7e,n||void 0),n||t.description==null)for(const r in qOe)e(qOe[r],void 0);else{const r=t.mark.marktype;e(Ade,t.description),e(Rde,t.ariaRole||(r==="group"?_7e:Dde)),e(Ide,t.ariaRoleDescription||`${r} mark`)}}function E7e(e){return e.aria===!1?{[S7e]:!0}:qQt[e.role]?null:GOe[e.role]?YQt(e,GOe[e.role]):XQt(e)}function XQt(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(r=>r.description!=null&&r.aria!==!1);return C7e(n?_7e:Dde,`${t} mark container`,e.description)}function YQt(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return C7e(t.role||Dde,t.desc,n.description||r(n))}catch{return null}}function XOe(e){return Vt(e.text).join(" ")}function QQt(e){const t=e.datum,n=e.orient,r=t.title?T7e(e):null,i=e.context,o=i.scales[t.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${dE(a)?"discrete":a} scale with ${B9e(s,o,e)}`}function KQt(e){const t=e.datum,n=t.title?T7e(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),s=e.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return JQt(r)+(n?` titled '${n}'`:"")+` for ${ZQt(o)} with ${B9e(l,a,e)}`}function T7e(e){try{return Vt(Mr(e.items).items[0].text).join(" ")}catch{return null}}function ZQt(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Mr(e)}function JQt(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const P7e=e=>(e+"").replace(/&/g,"&").replace(//g,">"),eKt=e=>P7e(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function Lde(){let e="",t="",n="";const r=[],i=()=>t=n="",o=l=>{t&&(e+=`${t}>${n}`,i()),r.push(l)},s=(l,c)=>(c!=null&&(t+=` ${l}="${eKt(c)}"`),a),a={open(l,...c){o(l),t="<"+l;for(const u of c)for(const f in u)s(f,u[f]);return a},close(){const l=r.pop();return t?e+=t+(n?`>${n}`:"/>"):e+=``,i(),a},attr:s,text:l=>(n+=P7e(l),a),toString:()=>e};return a}const k7e=e=>M7e(Lde(),e)+"";function M7e(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let i=0;i{u.dirty=n})),!i.zdirty){if(r.exit){s.nested&&i.items.length?(c=i.items[0],c._svg&&this._update(s,c._svg,c)):r._svg&&(c=r._svg.parentNode,c&&c.removeChild(r._svg)),r._svg=null;continue}r=s.nested?i.items[0]:r,r._update!==n&&(!r._svg||!r._svg.ownerSVGElement?(this._dirtyAll=!1,QOe(r,n)):this._update(s,r._svg,r),r._update=n)}return!this._dirtyAll}mark(t,n,r,i){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Uu[s],l=n.interactive===!1?"none":null,c=a.tag==="g",u=KOe(n,t,r,"g",o);if(s!=="group"&&i!=null&&!i.includes(s))return vf(u,0),n._svg;u.setAttribute("class",p7e(n));const f=E7e(n);for(const g in f)kl(u,g,f[g]);c||kl(u,"pointer-events",l),kl(u,"clip-path",n.clip?hde(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),v=KOe(g,u,d,a.tag,o);m&&(this._update(a,v,g),c&&rKt(this,v,g,i)),d=v,++h};return a.nested?n.items.length&&p(n.items[0]):bh(n,p),vf(u,h),u}_update(t,n,r){$m=n,nl=n.__values__,O7e(JM,r),t.attr(JM,r,this);const i=oKt[t.type];i&&i.call(this,t,n,r),$m&&this.style($m,r)}style(t,n){if(n!=null){for(const r in lB){let i=r==="font"?sL(n):n[r];if(i===nl[r])continue;const o=lB[r];i==null?t.removeAttribute(o):(ude(i)&&(i=V9e(i,this._defs.gradient,R7e())),t.setAttribute(o,i+"")),nl[r]=i}for(const r in cB)Yz(t,cB[r],n[r])}}defs(){const t=this._svg,n=this._defs;let r=n.el,i=0;for(const o in n.gradient)r||(n.el=r=As(t,Qk+1,"defs",ks)),i=tKt(r,n.gradient[o],i);for(const o in n.clipping)r||(n.el=r=As(t,Qk+1,"defs",ks)),i=nKt(r,n.clipping[o],i);r&&(i===0?(t.removeChild(r),n.el=null):vf(r,i))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function QOe(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function tKt(e,t,n){let r,i,o;if(t.gradient==="radial"){let s=As(e,n++,"pattern",ks);p0(s,{id:Kj+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=As(s,0,"rect",ks),p0(s,{width:1,height:1,fill:`url(${R7e()}#${t.id})`}),e=As(e,n++,"radialGradient",ks),p0(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=As(e,n++,"linearGradient",ks),p0(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r{i=e.mark(t,s,i,r),++o}),vf(t,1+o)}function KOe(e,t,n,r,i){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=h0(s,r,ks),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},r==="g"))){const a=h0(s,"path",ks);o.appendChild(a),a.__data__=e;const l=h0(s,"g",ks);o.appendChild(l),l.__data__=e;const c=h0(s,"path",ks);o.appendChild(c),c.__data__=e,c.__values__={fill:"default"}}return(o.ownerSVGElement!==i||iKt(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function iKt(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let $m=null,nl=null;const oKt={group(e,t,n){const r=$m=t.childNodes[2];nl=r.__values__,e.foreground(JM,n,this),nl=t.__values__,$m=t.childNodes[1],e.content(JM,n,this);const i=$m=t.childNodes[0];e.background(JM,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==nl.events&&(kl(r,"pointer-events",o),kl(i,"pointer-events",o),nl.events=o),n.strokeForeground&&n.stroke){const s=n.fill;kl(r,"display",null),this.style(i,n),kl(i,"stroke",null),s&&(n.fill=null),nl=r.__values__,this.style(r,n),s&&(n.fill=s),$m=null}else kl(r,"display","none")},image(e,t,n){n.smooth===!1?(Yz(t,"image-rendering","optimizeSpeed"),Yz(t,"image-rendering","pixelated")):Yz(t,"image-rendering",null)},text(e,t,n){const r=oL(n);let i,o,s,a;lt(r)?(o=r.map(l=>ib(n,l)),i=o.join(` -`),i!==nl.text&&(vf(t,0),s=t.ownerDocument,a=rb(n),o.forEach((l,c)=>{const u=h0(s,"tspan",ks);u.__data__=n,u.textContent=l,c&&(u.setAttribute("x",0),u.setAttribute("dy",a)),t.appendChild(u)}),nl.text=i)):(o=ib(n,r),o!==nl.text&&(t.textContent=o,nl.text=o)),kl(t,"font-family",sL(n)),kl(t,"font-size",wg(n)+"px"),kl(t,"font-style",n.fontStyle),kl(t,"font-variant",n.fontVariant),kl(t,"font-weight",n.fontWeight)}};function JM(e,t,n){t!==nl[e]&&(n?sKt($m,e,t,n):kl($m,e,t),nl[e]=t)}function Yz(e,t,n){n!==nl[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),nl[t]=n)}function p0(e,t){for(const n in t)kl(e,n,t[n])}function kl(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function sKt(e,t,n,r){n!=null?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}function R7e(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class I7e extends aL{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=Lde();n.open("svg",nr({},gR,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const r=this._bgcolor;return r&&r!=="transparent"&&r!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:r}).close(),n.open("g",A7e,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const r=Uu[n.marktype],i=r.tag,o=[O7e,r.attr];t.open("g",{class:p7e(n),"clip-path":n.clip?hde(this,n,n.group):null},E7e(n),{"pointer-events":i!=="g"&&n.interactive===!1?"none":null});const s=a=>{const l=this.href(a);if(l&&t.open("a",l),t.open(i,this.attr(n,a,o,i!=="g"?i:null)),i==="text"){const c=oL(a);if(lt(c)){const u={x:0,dy:rb(a)};for(let f=0;fthis.mark(t,d)),t.close(),c&&f?(u&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,r.foreground,"bgrect")).close(),u&&(a.fill=u)):t.open("path",this.attr(n,a,r.foreground,"bgfore")).close()}t.close(),l&&t.close()};return r.nested?n.items&&n.items.length&&s(n.items[0]):bh(n,s),t.close()}href(t){const n=t.href;let r;if(n){if(r=this._hrefs&&this._hrefs[n])return r;this.sanitizeURL(n).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[n]=i})}return null}attr(t,n,r,i){const o={},s=(a,l,c,u)=>{o[u||a]=l};return Array.isArray(r)?r.forEach(a=>a(s,n,this)):r(s,n,this),i&&aKt(o,n,t,i,this._defs),o}defs(t){const n=this._defs.gradient,r=this._defs.clipping;if(Object.keys(n).length+Object.keys(r).length!==0){t.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(t.open("pattern",{id:Kj+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):t.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let l=0;l!jd.svgMarkTypes.includes(o));this._svgRenderer.render(t,jd.svgMarkTypes),this._canvasRenderer.render(t,i)}resize(t,n,r,i){return super.resize(t,n,r,i),this._svgRenderer.resize(t,n,r,i),this._canvasRenderer.resize(t,n,r,i),this}background(t){return jd.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class D7e extends lL{constructor(t,n){super(t,n)}initialize(t,n,r){const i=As(As(t,0,"div"),jd.svgOnTop?0:1,"div");return super.initialize(i,n,r)}}const L7e="canvas",F7e="hybrid",$7e="png",N7e="svg",z7e="none",g0={Canvas:L7e,PNG:$7e,SVG:N7e,Hybrid:F7e,None:z7e},yw={};yw[L7e]=yw[$7e]={renderer:aB,headless:aB,handler:lL};yw[N7e]={renderer:Fde,headless:I7e,handler:w7e};yw[F7e]={renderer:nre,headless:nre,handler:D7e};yw[z7e]={};function VV(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(yw[e]=t,this):yw[e]}function j7e(e,t,n){const r=[],i=new xs().union(t),o=e.marktype;return o?B7e(e,i,n,r):o==="group"?U7e(e,i,n,r):et("Intersect scene must be mark node or group item.")}function B7e(e,t,n,r){if(cKt(e,t,n)){const i=e.items,o=e.marktype,s=i.length;let a=0;if(o==="group")for(;a=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!$de(e[i],t[i],i))return!1;return typeof e==typeof t}function dKt(){TYt(),LXt()}const mE="top",Jd="left",eh="right",ob="bottom",hKt="top-left",pKt="top-right",gKt="bottom-left",mKt="bottom-right",Nde="start",rre="middle",Ml="end",vKt="x",yKt="y",WV="group",zde="axis",jde="title",bKt="frame",xKt="scope",Bde="legend",G7e="row-header",q7e="row-footer",X7e="row-title",Y7e="column-header",Q7e="column-footer",K7e="column-title",wKt="padding",SKt="symbol",Z7e="fit",J7e="fit-x",eqe="fit-y",_Kt="pad",Ude="none",fN="all",ire="each",Vde="flush",m0="column",v0="row";function tqe(e){Ze.call(this,null,e)}Rt(tqe,Ze,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=Uu[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=dN(r,s),r.items.forEach(c=>{c.bounds.clear().union(a)});else if(i===WV||e.modified())switch(t.visit(t.MOD,c=>n.dirty(c)),a.clear(),r.items.forEach(c=>a.union(dN(c,s))),r.role){case zde:case Bde:case jde:t.reflow()}else l=t.changed(t.REM),t.visit(t.ADD,c=>{a.union(dN(c,s))}),t.visit(t.MOD,c=>{l=l||a.alignsWith(c.bounds),n.dirty(c),a.union(dN(c,s))}),l&&(a.clear(),r.items.forEach(c=>a.union(c.bounds)));return W7e(r),t.modifies("bounds")}});function dN(e,t,n){return t(e.bounds.clear(),e,n)}const ZOe=":vega_identifier:";function Wde(e){Ze.call(this,0,e)}Wde.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};Rt(Wde,Ze,{transform(e,t){const n=CKt(t.dataflow),r=e.as;let i=n.value;return t.visit(t.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),t}});function CKt(e){return e._signals[ZOe]||(e._signals[ZOe]=e.add(0))}function nqe(e){Ze.call(this,null,e)}Rt(nqe,Ze,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,OKt(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===WV?LV:DV;return t.visit(t.ADD,i=>r.call(i,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function OKt(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function rqe(e){Ze.call(this,null,e)}const JOe={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((r,i)=>!i||!iqe(n.bounds,r.bounds,t)?(n=r,1):r.opacity=0)}},iqe=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),eEe=(e,t)=>{for(var n=1,r=e.length,i=e[0].bounds,o;n{const t=e.bounds;return t.width()>1&&t.height()>1},TKt=(e,t,n)=>{var r=e.range(),i=new xs;return t===mE||t===ob?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},tEe=e=>(e.forEach(t=>t.opacity=1),e),nEe=(e,t)=>e.reflow(t.modified()).modifies("opacity");Rt(rqe,Ze,{transform(e,t){const n=JOe[e.method]||JOe.parity,r=e.separation||0;let i=t.materialize(t.SOURCE).source,o,s;if(!i||!i.length)return;if(!e.method)return e.modified("method")&&(tEe(i),t=nEe(t,e)),t;if(i=i.filter(EKt),!i.length)return;if(e.sort&&(i=i.slice().sort(e.sort)),o=tEe(i),t=nEe(t,e),o.length>=3&&eEe(o,r)){do o=n(o,r);while(o.length>=3&&eEe(o,r));o.length<3&&!Mr(i).opacity&&(o.length>1&&(Mr(o).opacity=0),Mr(i).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=TKt(e.boundScale,e.boundOrient,+e.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),t}});function oqe(e){Ze.call(this,null,e)}Rt(oqe,Ze,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,r=>n.dirty(r)),t.fields&&t.fields.zindex){const r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});const Ja=new xs;function GC(e,t,n){return e[t]===n?0:(e[t]=n,1)}function PKt(e){var t=e.items[0].orient;return t===Jd||t===eh}function kKt(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function MKt(e,t,n,r){var i=t.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=kKt(o),c=i.range,u=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,m=i.bounds,v=p&&Ede(p),y=0,b=0,w,S;switch(Ja.clear().union(m),m.clear(),(w=l[0])>-1&&m.union(i.items[w].bounds),(w=l[1])>-1&&m.union(i.items[w].bounds),a){case mE:y=f||0,b=-u,S=Math.max(d,Math.min(h,-m.y1)),m.add(0,-S).add(c,0),p&&hN(e,p,S,g,v,0,-1,m);break;case Jd:y=-u,b=f||0,S=Math.max(d,Math.min(h,-m.x1)),m.add(-S,0).add(0,c),p&&hN(e,p,S,g,v,1,-1,m);break;case eh:y=n+u,b=f||0,S=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(S,c),p&&hN(e,p,S,g,v,1,1,m);break;case ob:y=f||0,b=r+u,S=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(c,S),p&&hN(e,p,S,g,0,0,1,m);break;default:y=i.x,b=i.y}return Rv(m.translate(y,b),i),GC(i,"x",y+s)|GC(i,"y",b+s)&&(i.bounds=Ja,e.dirty(i),i.bounds=m,e.dirty(i)),i.mark.bounds.clear().union(m)}function hN(e,t,n,r,i,o,s,a){const l=t.bounds;if(t.auto){const c=s*(n+i+r);let u=0,f=0;e.dirty(t),o?u=(t.x||0)-(t.x=c):f=(t.y||0)-(t.y=c),t.mark.bounds.clear().union(l.translate(-u,-f)),e.dirty(t)}a.union(l)}const rEe=(e,t)=>Math.floor(Math.min(e,t)),iEe=(e,t)=>Math.ceil(Math.max(e,t));function AKt(e){var t=e.items,n=t.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(E=0;E0&&(b[E]+=A/2);if(a&&vo(n.center,v0)&&u!==1)for(E=0;E0&&(w[E]+=L/2);for(E=0;Ei&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),g+=o,y=0,w=t.length;y=0&&(E=n[b])==null;b-=d);a?(T=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),k=g):(T=g,k=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),S.union(_.bounds.translate(T-(_.x||0),k-(_.y||0))),_.x=T,_.y=k,e.dirty(_),m=s(m,S[c])}return m}function sEe(e,t,n,r,i,o){if(t){e.dirty(t);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function $Kt(e,t){const n=e[t]||{};return(r,i)=>n[r]!=null?n[r]:e[r]!=null?e[r]:i}function NKt(e,t){let n=-1/0;return e.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:t}function zKt(e,t,n,r,i,o,s){const a=$Kt(n,t),l=NKt(e,a("offset",0)),c=a("anchor",Nde),u=c===Ml?1:c===rre?.5:0,f={align:ire,bounds:a("bounds",Vde),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case Jd:f.anchor={x:Math.floor(r.x1)-l,column:Ml,y:u*(s||r.height()+2*r.y1),row:c};break;case eh:f.anchor={x:Math.ceil(r.x2)+l,y:u*(s||r.height()+2*r.y1),row:c};break;case mE:f.anchor={y:Math.floor(i.y1)-l,row:Ml,x:u*(o||i.width()+2*i.x1),column:c};break;case ob:f.anchor={y:Math.ceil(i.y2)+l,x:u*(o||i.width()+2*i.x1),column:c};break;case hKt:f.anchor={x:l,y:l};break;case pKt:f.anchor={x:o-l,y:l,column:Ml};break;case gKt:f.anchor={x:l,y:s-l,row:Ml};break;case mKt:f.anchor={x:o-l,y:s-l,column:Ml,row:Ml};break}return f}function jKt(e,t){var n=t.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,c;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),UKt(e,n,n.items[0].items[0]),o=BKt(n,o),l=2*n.padding,c=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),c=Math.ceil(o.height()+c)),r.type===SKt&&VKt(n.items[0].items[0].items[0].items),i!==Ude&&(n.x=s=0,n.y=a=0),n.width=l,n.height=c,Rv(o.set(s,a,s+l,a+c),n),n.mark.bounds.clear().union(o),n}function BKt(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function UKt(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(!t.datum.title)(i||o)&&Kk(e,n,i,o);else{var s=t.items[1].items[0],a=s.anchor,l=t.titlePadding||0,c=r-s.x,u=r-s.y;switch(s.orient){case Jd:i+=Math.ceil(s.bounds.width())+l;break;case eh:case ob:break;default:o+=s.bounds.height()+l}switch((i||o)&&Kk(e,n,i,o),s.orient){case Jd:u+=R_(t,n,s,a,1,1);break;case eh:c+=R_(t,n,s,Ml,0,0)+l,u+=R_(t,n,s,a,1,1);break;case ob:c+=R_(t,n,s,a,0,0),u+=R_(t,n,s,Ml,-1,0,1)+l;break;default:c+=R_(t,n,s,a,0,0)}(c||u)&&Kk(e,s,c,u),(c=Math.round(s.bounds.x1-r))<0&&(Kk(e,n,-c,0),Kk(e,s,-c,0))}}function R_(e,t,n,r,i,o,s){const a=e.datum.type!=="symbol",l=n.datum.vgrad,c=a&&(o||!l)&&!s?t.items[0]:t,u=c.bounds[i?"y2":"x2"]-e.padding,f=l&&o?u:0,d=l&&o?0:u,h=i<=0?0:Ede(n);return Math.round(r===Nde?f:r===Ml?d-h:.5*(u-h))}function Kk(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function VKt(e){const t=e.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function WKt(e,t,n,r,i){var o=t.items[0],s=o.frame,a=o.orient,l=o.anchor,c=o.offset,u=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Jd||a===eh?r:n,p=0,g=0,m=0,v=0,y=0,b;if(s!==WV?a===Jd?(p=i.y2,h=i.y1):a===eh?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===Jd&&(p=r,h=0),b=l===Nde?p:l===Ml?h:(p+h)/2,d&&d.text){switch(a){case mE:case ob:y=f.bounds.height()+u;break;case Jd:v=f.bounds.width()+u;break;case eh:v=-f.bounds.width()-u;break}Ja.clear().union(d.bounds),Ja.translate(v-(d.x||0),y-(d.y||0)),GC(d,"x",v)|GC(d,"y",y)&&(e.dirty(d),d.bounds.clear().union(Ja),d.mark.bounds.clear().union(Ja),e.dirty(d)),Ja.clear().union(d.bounds)}else Ja.clear();switch(Ja.union(f.bounds),a){case mE:g=b,m=i.y1-Ja.height()-c;break;case Jd:g=i.x1-Ja.width()-c,m=b;break;case eh:g=i.x2+Ja.width()+c,m=b;break;case ob:g=b,m=i.y2+c;break;default:g=o.x,m=o.y}return GC(o,"x",g)|GC(o,"y",m)&&(Ja.translate(g,m),e.dirty(o),o.bounds.clear().union(Ja),t.bounds.clear().union(Ja),e.dirty(o)),o.bounds}function aqe(e){Ze.call(this,null,e)}Rt(aqe,Ze,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(r=>{e.layout&&DKt(n,r,e.layout),GKt(n,r,e)}),HKt(e.mark.group)?t.reflow():t}});function HKt(e){return e&&e.mark.role!=="legend-entry"}function GKt(e,t,n){var r=t.items,i=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new xs().set(0,0,i,o),a=s.clone(),l=s.clone(),c=[],u,f,d,h,p,g;for(p=0,g=r.length;p{d=v.orient||eh,d!==Ude&&(m[d]||(m[d]=[])).push(v)});for(const v in m){const y=m[v];sqe(e,y,zKt(y,v,n.legends,a,l,i,o))}c.forEach(v=>{const y=v.bounds;if(y.equals(v._bounds)||(v.bounds=v._bounds,e.dirty(v),v.bounds=y,e.dirty(v)),n.autosize&&(n.autosize.type===Z7e||n.autosize.type===J7e||n.autosize.type===eqe))switch(v.orient){case Jd:case eh:s.add(y.x1,0).add(y.x2,0);break;case mE:case ob:s.add(0,y.y1).add(0,y.y2)}else s.union(y)})}s.union(a).union(l),u&&s.union(WKt(e,u,i,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),qKt(e,t,s,n)}function qKt(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,l=Math.max(0,t.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-u));if(i.contains===wKt){const p=e.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===Ude?(c=0,f=0,l=s,u=a):o===Z7e?(l=Math.max(0,s-c-d),u=Math.max(0,a-f-h)):o===J7e?(l=Math.max(0,s-c-d),a=u+f+h):o===eqe?(s=l+c+d,u=Math.max(0,a-f-h)):o===_Kt&&(s=l+c+d,a=u+f+h),e._resizeView(s,a,l,u,[c,f],i.resize)}const XKt=Object.freeze(Object.defineProperty({__proto__:null,bound:tqe,identifier:Wde,mark:nqe,overlap:rqe,render:oqe,viewlayout:aqe},Symbol.toStringTag,{value:"Module"}));function lqe(e){Ze.call(this,null,e)}Rt(lqe,Ze,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=lde(o,s,e.minstep),l=e.format||F9e(n,o,a,e.formatSpecifier,e.formatType,!!e.values),c=e.values?L9e(o,e.values,a):cde(o,a);return i&&(r.rem=i),i=c.map((u,f)=>li({index:f/(c.length-1||1),value:u,label:l(u)})),e.extra&&i.length&&i.push(li({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function cqe(e){Ze.call(this,null,e)}function YKt(){return li({})}function QKt(e){const t=qT().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}Rt(cqe,Ze,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||YKt,o=e.key||Sn,s=this.value;return lt(r.encode)&&(r.encode=null),s&&(e.modified("key")||t.modified(o))&&et("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=QKt(o)),t.visit(t.ADD,a=>{const l=o(a);let c=s.get(l);c?c.exit?(s.empty--,r.add.push(c)):r.mod.push(c):(c=i(a),s.set(l,c),r.add.push(c)),c.datum=a,c.exit=!1}),t.visit(t.MOD,a=>{const l=o(a),c=s.get(l);c&&(c.datum=a,r.mod.push(c))}),t.visit(t.REM,a=>{const l=o(a),c=s.get(l);a===c.datum&&!c.exit&&(r.rem.push(c),c.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function uqe(e){Ze.call(this,null,e)}Rt(uqe,Ze,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(lt(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=i.update||Ly,l=i.enter||Ly,c=i.exit||Ly,u=(o&&!s?i[o]:a)||Ly;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{l(f,e),a(f,e)}),n.modifies(l.output),n.modifies(a.output),u!==Ly&&u!==a&&(t.visit(t.ADD,f=>{u(f,e)}),n.modifies(u.output))),t.changed(t.REM)&&c!==Ly&&(t.visit(t.REM,f=>{c(f,e)}),n.modifies(c.output)),s||u!==Ly){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=l(d,e)||r;(u(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):t.visit(f,d=>{(u(d,e)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:t.StopPropagation}});function fqe(e){Ze.call(this,[],e)}Rt(fqe,Ze,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.type||Bz,s=e.scale,a=+e.limit,l=lde(s,e.count==null?5:e.count,e.minstep),c=!!e.values||o===Bz,u=e.format||j9e(n,s,l,o,e.formatSpecifier,e.formatType,c),f=e.values||z9e(s,l),d,h,p,g,m;return i&&(r.rem=i),o===Bz?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),m=!0):i=f,ir(p=e.size)?(!e.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((v,y)=>Math.max(v,p(y,e)),0)):p=yl(g=p||8),i=i.map((v,y)=>li({index:y,label:u(v,y,i),value:v,offset:g,size:p(v,e)})),m&&(m=f[i.length],i.push(li({index:i.length,label:`…${f.length-i.length} entries`,value:m,offset:g,size:p(m,e)})))):o===SXt?(d=s.domain(),h=R9e(s,d[0],Mr(d)),f.length<3&&!e.values&&d[0]!==Mr(d)&&(f=[d[0],Mr(d)]),i=f.map((v,y)=>li({index:y,label:u(v,y,f),value:v,perc:h(v)}))):(p=f.length-1,h=IXt(s),i=f.map((v,y)=>li({index:y,label:u(v,y,f),value:v,perc:y?h(v):0,perc2:y===p?1:h(f[y+1])}))),r.source=i,r.add=i,this.value=i,r}});const KKt=e=>e.source.x,ZKt=e=>e.source.y,JKt=e=>e.target.x,eZt=e=>e.target.y;function Hde(e){Ze.call(this,{},e)}Hde.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};Rt(Hde,Ze,{transform(e,t){var n=e.sourceX||KKt,r=e.sourceY||ZKt,i=e.targetX||JKt,o=e.targetY||eZt,s=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",c=aEe.get(l+"-"+a)||aEe.get(l);return c||et("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,u=>{u[s]=c(n(u),r(u),i(u),o(u))}),t.reflow(e.modified()).modifies(s)}});const dqe=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,tZt=(e,t,n,r)=>dqe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),hqe=(e,t,n,r)=>{var i=n-e,o=r-t,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},nZt=(e,t,n,r)=>hqe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),pqe=(e,t,n,r)=>{const i=n-e,o=r-t,s=.2*(i+o),a=.2*(o-i);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},rZt=(e,t,n,r)=>pqe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),iZt=(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,oZt=(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,sZt=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+(l?1:0)+" "+t*s+","+t*a+"L"+r*s+","+r*a},aZt=(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},lZt=(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},cZt=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=(t+r)/2;return"M"+t*i+","+t*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},aEe=qT({line:dqe,"line-radial":tZt,arc:hqe,"arc-radial":nZt,curve:pqe,"curve-radial":rZt,"orthogonal-horizontal":iZt,"orthogonal-vertical":oZt,"orthogonal-radial":sZt,"diagonal-horizontal":aZt,"diagonal-vertical":lZt,"diagonal-radial":cZt});function Gde(e){Ze.call(this,null,e)}Gde.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};Rt(Gde,Ze,{transform(e,t){var n=e.as||["startAngle","endAngle"],r=n[0],i=n[1],o=e.field||HT,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,l=t.source,c=l.map(o),u=c.length,f=s,d=(a-s)/OWe(c),h=Tc(u),p,g,m;for(e.sort&&h.sort((v,y)=>c[v]-c[y]),p=0;p-1)return r;var i=t.domain,o=e.type,s=t.zero||t.zero===void 0&&fZt(e),a,l;if(!i)return 0;if((s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[a]=t.domainMax),t.domainMid!=null)){l=t.domainMid;const c=l>i[a]?a+1:li+(o<0?-1:o>0?1:0),0));r!==t.length&&n.warn("Log scale domain includes zero: "+Tt(t))}return t}function yZt(e,t,n){let r=t.bins;if(r&&!lt(r)){const i=e.domain(),o=i[0],s=Mr(i),a=r.step;let l=r.start==null?o:r.start,c=r.stop==null?s:r.stop;a||et("Scale bins parameter missing step property."),ls&&(c=a*Math.floor(s/a)),r=Tc(l,c+a/2,a)}return r?e.bins=r:e.bins&&delete e.bins,e.type===nde&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function bZt(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(t.rangeStep!=null)o=xZt(r,t,n);else if(t.scheme&&(o=wZt(r,t,n),ir(o))){if(e.interpolator)return e.interpolator(o);et(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&P9e(r))return e.interpolator(RV(ore(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(sde(t.interpolate,t.interpolateGamma)):ir(e.round)?e.round(i):ir(e.rangeRound)&&e.interpolate(i?XD:Ab),o&&e.range(ore(o,t.reverse))}function xZt(e,t,n){e!==w9e&&e!==Wne&&et("Only band and point scales support rangeStep.");var r=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,i=e===Wne?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*ede(n,i,r)]}function wZt(e,t,n){var r=t.schemeExtent,i,o;return lt(t.scheme)?o=RV(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),o=ade(i),o||et(`Unrecognized scheme name: ${t.scheme}`)),n=e===AV?n+1:e===nde?n-1:e===fE||e===MV?+t.schemeCount||uZt:n,P9e(e)?lEe(o,r,t.reverse):ir(o)?A9e(lEe(o,r),n):e===tde?o:o.slice(0,n)}function lEe(e,t,n){return ir(e)&&(t||n)?M9e(e,ore(t||[0,1],n)):e}function ore(e,t){return t?e.slice().reverse():e}function yqe(e){Ze.call(this,null,e)}Rt(yqe,Ze,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(xS(e.sort)),this.modified(n),t}});const cEe="zero",bqe="center",xqe="normalize",wqe=["y0","y1"];function qde(e){Ze.call(this,null,e)}qde.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:cEe,values:[cEe,bqe,xqe]},{name:"as",type:"string",array:!0,length:2,default:wqe}]};Rt(qde,Ze,{transform(e,t){var n=e.as||wqe,r=n[0],i=n[1],o=xS(e.sort),s=e.field||HT,a=e.offset===bqe?SZt:e.offset===xqe?_Zt:CZt,l,c,u,f;for(l=OZt(t.source,e.groupby,o,s),c=0,u=l.length,f=l.max;cg(u),s,a,l,c,u,f,d,h,p;if(t==null)i.push(e.slice());else for(s={},a=0,l=e.length;ap&&(p=h),n&&d.sort(n)}return i.max=p,i}const EZt=Object.freeze(Object.defineProperty({__proto__:null,axisticks:lqe,datajoin:cqe,encode:uqe,legendentries:fqe,linkpath:Hde,pie:Gde,scale:mqe,sortitems:yqe,stack:qde},Symbol.toStringTag,{value:"Module"}));var En=1e-6,uB=1e-12,gr=Math.PI,jo=gr/2,fB=gr/4,Yl=gr*2,Qo=180/gr,cr=gr/180,kr=Math.abs,rP=Math.atan,ed=Math.atan2,kn=Math.cos,gN=Math.ceil,Sqe=Math.exp,sre=Math.hypot,dB=Math.log,Mq=Math.pow,Cn=Math.sin,Tf=Math.sign||function(e){return e>0?1:e<0?-1:0},Ql=Math.sqrt,Xde=Math.tan;function _qe(e){return e>1?0:e<-1?gr:Math.acos(e)}function Bc(e){return e>1?jo:e<-1?-jo:Math.asin(e)}function Aa(){}function hB(e,t){e&&fEe.hasOwnProperty(e.type)&&fEe[e.type](e,t)}var uEe={Feature:function(e,t){hB(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=kn(t),s=Cn(t),a=ure*s,l=cre*o+a*kn(i),c=a*r*Cn(i);pB.add(ed(c,l)),lre=e,cre=o,ure=s}function MZt(e){return gB=new Hl,Tm(e,og),gB*2}function mB(e){return[ed(e[1],e[0]),Bc(e[2])]}function bw(e){var t=e[0],n=e[1],r=kn(n);return[r*kn(t),r*Cn(t),Cn(n)]}function mN(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function vE(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Aq(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function vN(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function vB(e){var t=Ql(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var To,xc,$o,yu,qx,Tqe,Pqe,vO,eA,Ky,gv,wm={point:fre,lineStart:hEe,lineEnd:pEe,polygonStart:function(){wm.point=Mqe,wm.lineStart=AZt,wm.lineEnd=RZt,eA=new Hl,og.polygonStart()},polygonEnd:function(){og.polygonEnd(),wm.point=fre,wm.lineStart=hEe,wm.lineEnd=pEe,pB<0?(To=-($o=180),xc=-(yu=90)):eA>En?yu=90:eA<-En&&(xc=-90),gv[0]=To,gv[1]=$o},sphere:function(){To=-($o=180),xc=-(yu=90)}};function fre(e,t){Ky.push(gv=[To=e,$o=e]),tyu&&(yu=t)}function kqe(e,t){var n=bw([e*cr,t*cr]);if(vO){var r=vE(vO,n),i=[r[1],-r[0],0],o=vE(i,r);vB(o),o=mB(o);var s=e-qx,a=s>0?1:-1,l=o[0]*Qo*a,c,u=kr(s)>180;u^(a*qxyu&&(yu=c)):(l=(l+360)%360-180,u^(a*qxyu&&(yu=t))),u?epu(To,$o)&&($o=e):pu(e,$o)>pu(To,$o)&&(To=e):$o>=To?(e$o&&($o=e)):e>qx?pu(To,e)>pu(To,$o)&&($o=e):pu(e,$o)>pu(To,$o)&&(To=e)}else Ky.push(gv=[To=e,$o=e]);tyu&&(yu=t),vO=n,qx=e}function hEe(){wm.point=kqe}function pEe(){gv[0]=To,gv[1]=$o,wm.point=fre,vO=null}function Mqe(e,t){if(vO){var n=e-qx;eA.add(kr(n)>180?n+(n>0?360:-360):n)}else Tqe=e,Pqe=t;og.point(e,t),kqe(e,t)}function AZt(){og.lineStart()}function RZt(){Mqe(Tqe,Pqe),og.lineEnd(),kr(eA)>En&&(To=-($o=180)),gv[0]=To,gv[1]=$o,vO=null}function pu(e,t){return(t-=e)<0?t+360:t}function IZt(e,t){return e[0]-t[0]}function gEe(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tpu(r[0],r[1])&&(r[1]=i[1]),pu(i[0],r[1])>pu(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,t=0,r=o[n];t<=n;r=i,++t)i=o[t],(a=pu(r[1],i[0]))>s&&(s=a,To=i[0],$o=r[1])}return Ky=gv=null,To===1/0||xc===1/0?[[NaN,NaN],[NaN,NaN]]:[[To,xc],[$o,yu]]}var dM,yB,bB,xB,wB,SB,_B,CB,dre,hre,pre,Aqe,Rqe,Ll,Fl,$l,th={sphere:Aa,point:Yde,lineStart:mEe,lineEnd:vEe,polygonStart:function(){th.lineStart=$Zt,th.lineEnd=NZt},polygonEnd:function(){th.lineStart=mEe,th.lineEnd=vEe}};function Yde(e,t){e*=cr,t*=cr;var n=kn(t);cL(n*kn(e),n*Cn(e),Cn(t))}function cL(e,t,n){++dM,bB+=(e-bB)/dM,xB+=(t-xB)/dM,wB+=(n-wB)/dM}function mEe(){th.point=LZt}function LZt(e,t){e*=cr,t*=cr;var n=kn(t);Ll=n*kn(e),Fl=n*Cn(e),$l=Cn(t),th.point=FZt,cL(Ll,Fl,$l)}function FZt(e,t){e*=cr,t*=cr;var n=kn(t),r=n*kn(e),i=n*Cn(e),o=Cn(t),s=ed(Ql((s=Fl*o-$l*i)*s+(s=$l*r-Ll*o)*s+(s=Ll*i-Fl*r)*s),Ll*r+Fl*i+$l*o);yB+=s,SB+=s*(Ll+(Ll=r)),_B+=s*(Fl+(Fl=i)),CB+=s*($l+($l=o)),cL(Ll,Fl,$l)}function vEe(){th.point=Yde}function $Zt(){th.point=zZt}function NZt(){Iqe(Aqe,Rqe),th.point=Yde}function zZt(e,t){Aqe=e,Rqe=t,e*=cr,t*=cr,th.point=Iqe;var n=kn(t);Ll=n*kn(e),Fl=n*Cn(e),$l=Cn(t),cL(Ll,Fl,$l)}function Iqe(e,t){e*=cr,t*=cr;var n=kn(t),r=n*kn(e),i=n*Cn(e),o=Cn(t),s=Fl*o-$l*i,a=$l*r-Ll*o,l=Ll*i-Fl*r,c=sre(s,a,l),u=Bc(c),f=c&&-u/c;dre.add(f*s),hre.add(f*a),pre.add(f*l),yB+=u,SB+=u*(Ll+(Ll=r)),_B+=u*(Fl+(Fl=i)),CB+=u*($l+($l=o)),cL(Ll,Fl,$l)}function jZt(e){dM=yB=bB=xB=wB=SB=_B=CB=0,dre=new Hl,hre=new Hl,pre=new Hl,Tm(e,th);var t=+dre,n=+hre,r=+pre,i=sre(t,n,r);return igr&&(e-=Math.round(e/Yl)*Yl),[e,t]}mre.invert=mre;function Dqe(e,t,n){return(e%=Yl)?t||n?gre(bEe(e),xEe(t,n)):bEe(e):t||n?xEe(t,n):mre}function yEe(e){return function(t,n){return t+=e,kr(t)>gr&&(t-=Math.round(t/Yl)*Yl),[t,n]}}function bEe(e){var t=yEe(e);return t.invert=yEe(-e),t}function xEe(e,t){var n=kn(e),r=Cn(e),i=kn(t),o=Cn(t);function s(a,l){var c=kn(l),u=kn(a)*c,f=Cn(a)*c,d=Cn(l),h=d*n+u*r;return[ed(f*i-h*o,u*n-d*r),Bc(h*i+f*o)]}return s.invert=function(a,l){var c=kn(l),u=kn(a)*c,f=Cn(a)*c,d=Cn(l),h=d*i-f*o;return[ed(f*i+d*o,u*n+h*r),Bc(h*n-u*r)]},s}function BZt(e){e=Dqe(e[0]*cr,e[1]*cr,e.length>2?e[2]*cr:0);function t(n){return n=e(n[0]*cr,n[1]*cr),n[0]*=Qo,n[1]*=Qo,n}return t.invert=function(n){return n=e.invert(n[0]*cr,n[1]*cr),n[0]*=Qo,n[1]*=Qo,n},t}function UZt(e,t,n,r,i,o){if(n){var s=kn(t),a=Cn(t),l=r*n;i==null?(i=t+r*Yl,o=t-l/2):(i=wEe(s,i),o=wEe(s,o),(r>0?io)&&(i+=r*Yl));for(var c,u=i;r>0?u>o:u1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Qz(e,t){return kr(e[0]-t[0])=0;--a)i.point((f=u[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function SEe(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n=0?1:-1,P=k*T,R=P>gr,I=m*_;if(l.add(ed(I*k*Cn(P),v*E+I*kn(P))),s+=R?T+k*Yl:T,R^p>=n^w>=n){var F=vE(bw(h),bw(b));vB(F);var A=vE(o,F);vB(A);var L=(R^T>=0?-1:1)*Bc(A[2]);(r>L||r===L&&(F[0]||F[1]))&&(a+=R^T>=0?1:-1)}}return(s<-En||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_1&&w&2&&S.push(S.pop().concat(S.shift())),u.push(S.filter(WZt))}}return d}}function WZt(e){return e.length>1}function HZt(e,t){return((e=e.x)[0]<0?e[1]-jo-En:jo-e[1])-((t=t.x)[0]<0?t[1]-jo-En:jo-t[1])}const _Ee=$qe(function(){return!0},GZt,XZt,[-gr,-jo]);function GZt(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?gr:-gr,l=kr(o-t);kr(l-gr)0?jo:-jo),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&l>=gr&&(kr(t-r)En?rP((Cn(t)*(o=kn(r))*Cn(n)-Cn(r)*(i=kn(t))*Cn(e))/(i*o*s)):(t+r)/2}function XZt(e,t,n,r){var i;if(e==null)i=n*jo,r.point(-gr,i),r.point(0,i),r.point(gr,i),r.point(gr,0),r.point(gr,-i),r.point(0,-i),r.point(-gr,-i),r.point(-gr,0),r.point(-gr,i);else if(kr(e[0]-t[0])>En){var o=e[0]0,i=kr(t)>En;function o(u,f,d,h){UZt(h,e,n,d,u,f)}function s(u,f){return kn(u)*kn(f)>t}function a(u){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,v){var y=[m,v],b,w=s(m,v),S=r?w?0:c(m,v):w?c(m+(m<0?gr:-gr),v):0;if(!f&&(p=h=w)&&u.lineStart(),w!==h&&(b=l(f,y),(!b||Qz(f,b)||Qz(y,b))&&(y[2]=1)),w!==h)g=0,w?(u.lineStart(),b=l(y,f),u.point(b[0],b[1])):(b=l(f,y),u.point(b[0],b[1],2),u.lineEnd()),f=b;else if(i&&f&&r^w){var _;!(S&d)&&(_=l(y,f,!0))&&(g=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}w&&(!f||!Qz(f,y))&&u.point(y[0],y[1]),f=y,h=w,d=S},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(u,f,d){var h=bw(u),p=bw(f),g=[1,0,0],m=vE(h,p),v=mN(m,m),y=m[0],b=v-y*y;if(!b)return!d&&u;var w=t*v/b,S=-t*y/b,_=vE(g,m),E=vN(g,w),T=vN(m,S);Aq(E,T);var k=_,P=mN(E,k),R=mN(k,k),I=P*P-R*(mN(E,E)-1);if(!(I<0)){var F=Ql(I),A=vN(k,(-P-F)/R);if(Aq(A,E),A=mB(A),!d)return A;var L=u[0],$=f[0],j=u[1],V=f[1],U;$0^A[1]<(kr(A[0]-L)gr^(L<=A[0]&&A[0]<=$)){var H=vN(k,(-P+F)/R);return Aq(H,E),[A,mB(H)]}}}function c(u,f){var d=r?e:gr-e,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return $qe(s,a,o,r?[0,-e]:[-gr,e-gr])}function QZt(e,t,n,r,i,o){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,f=1,d=l-s,h=c-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p0&&(e[0]=s+u*d,e[1]=a+u*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var hM=1e9,bN=-hM;function Nqe(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=s(c,f))!==(p=s(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(c,u){return kr(c[0]-e)0?0:3:kr(c[0]-n)0?2:1:kr(c[1]-t)0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var f=s(c,1),d=s(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=Lqe(),d,h,p,g,m,v,y,b,w,S,_,E={point:T,lineStart:I,lineEnd:F,polygonStart:P,polygonEnd:R};function T(L,$){i(L,$)&&u.point(L,$)}function k(){for(var L=0,$=0,j=h.length;$r&&(Q-B)*(r-H)>(Y-H)*(e-B)&&++L:Y<=r&&(Q-B)*(r-H)<(Y-H)*(e-B)&&--L;return L}function P(){u=f,d=[],h=[],_=!0}function R(){var L=k(),$=_&&L,j=(d=CWe(d)).length;($||j)&&(c.polygonStart(),$&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),j&&Fqe(d,a,L,o,c),c.polygonEnd()),u=c,d=h=p=null}function I(){E.point=A,h&&h.push(p=[]),S=!0,w=!1,y=b=NaN}function F(){d&&(A(g,m),v&&w&&f.rejoin(),d.push(f.result())),E.point=T,w&&u.lineEnd()}function A(L,$){var j=i(L,$);if(h&&p.push([L,$]),S)g=L,m=$,v=j,S=!1,j&&(u.lineStart(),u.point(L,$));else if(j&&w)u.point(L,$);else{var V=[y=Math.max(bN,Math.min(hM,y)),b=Math.max(bN,Math.min(hM,b))],U=[L=Math.max(bN,Math.min(hM,L)),$=Math.max(bN,Math.min(hM,$))];QZt(V,U,e,t,n,r)?(w||(u.lineStart(),u.point(V[0],V[1])),u.point(U[0],U[1]),j||u.lineEnd(),_=!1):j&&(u.lineStart(),u.point(L,$),_=!1)}y=L,b=$,w=j}return E}}function CEe(e,t,n){var r=Tc(e,t-En,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function OEe(e,t,n){var r=Tc(e,t-En,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function KZt(){var e,t,n,r,i,o,s,a,l=10,c=l,u=90,f=360,d,h,p,g,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return Tc(gN(r/u)*u,n,u).map(p).concat(Tc(gN(a/f)*f,s,f).map(g)).concat(Tc(gN(t/l)*l,e,l).filter(function(b){return kr(b%u)>En}).map(d)).concat(Tc(gN(o/c)*c,i,c).filter(function(b){return kr(b%f)>En}).map(h))}return v.lines=function(){return y().map(function(b){return{type:"LineString",coordinates:b}})},v.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},v.extent=function(b){return arguments.length?v.extentMajor(b).extentMinor(b):v.extentMinor()},v.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],a=+b[0][1],s=+b[1][1],r>n&&(b=r,r=n,n=b),a>s&&(b=a,a=s,s=b),v.precision(m)):[[r,a],[n,s]]},v.extentMinor=function(b){return arguments.length?(t=+b[0][0],e=+b[1][0],o=+b[0][1],i=+b[1][1],t>e&&(b=t,t=e,e=b),o>i&&(b=o,o=i,i=b),v.precision(m)):[[t,o],[e,i]]},v.step=function(b){return arguments.length?v.stepMajor(b).stepMinor(b):v.stepMinor()},v.stepMajor=function(b){return arguments.length?(u=+b[0],f=+b[1],v):[u,f]},v.stepMinor=function(b){return arguments.length?(l=+b[0],c=+b[1],v):[l,c]},v.precision=function(b){return arguments.length?(m=+b,d=CEe(o,i,90),h=OEe(t,e,m),p=CEe(a,s,90),g=OEe(r,n,m),v):m},v.extentMajor([[-180,-90+En],[180,90-En]]).extentMinor([[-180,-80-En],[180,80+En]])}const mR=e=>e;var Iq=new Hl,vre=new Hl,zqe,jqe,yre,bre,Pm={point:Aa,lineStart:Aa,lineEnd:Aa,polygonStart:function(){Pm.lineStart=ZZt,Pm.lineEnd=eJt},polygonEnd:function(){Pm.lineStart=Pm.lineEnd=Pm.point=Aa,Iq.add(kr(vre)),vre=new Hl},result:function(){var e=Iq/2;return Iq=new Hl,e}};function ZZt(){Pm.point=JZt}function JZt(e,t){Pm.point=Bqe,zqe=yre=e,jqe=bre=t}function Bqe(e,t){vre.add(bre*e-yre*t),yre=e,bre=t}function eJt(){Bqe(zqe,jqe)}var yE=1/0,OB=yE,vR=-yE,EB=vR,TB={point:tJt,lineStart:Aa,lineEnd:Aa,polygonStart:Aa,polygonEnd:Aa,result:function(){var e=[[yE,OB],[vR,EB]];return vR=EB=-(OB=yE=1/0),e}};function tJt(e,t){evR&&(vR=e),tEB&&(EB=t)}var xre=0,wre=0,pM=0,PB=0,kB=0,qC=0,Sre=0,_re=0,gM=0,Uqe,Vqe,yp,bp,xf={point:xw,lineStart:EEe,lineEnd:TEe,polygonStart:function(){xf.lineStart=iJt,xf.lineEnd=oJt},polygonEnd:function(){xf.point=xw,xf.lineStart=EEe,xf.lineEnd=TEe},result:function(){var e=gM?[Sre/gM,_re/gM]:qC?[PB/qC,kB/qC]:pM?[xre/pM,wre/pM]:[NaN,NaN];return xre=wre=pM=PB=kB=qC=Sre=_re=gM=0,e}};function xw(e,t){xre+=e,wre+=t,++pM}function EEe(){xf.point=nJt}function nJt(e,t){xf.point=rJt,xw(yp=e,bp=t)}function rJt(e,t){var n=e-yp,r=t-bp,i=Ql(n*n+r*r);PB+=i*(yp+e)/2,kB+=i*(bp+t)/2,qC+=i,xw(yp=e,bp=t)}function TEe(){xf.point=xw}function iJt(){xf.point=sJt}function oJt(){Wqe(Uqe,Vqe)}function sJt(e,t){xf.point=Wqe,xw(Uqe=yp=e,Vqe=bp=t)}function Wqe(e,t){var n=e-yp,r=t-bp,i=Ql(n*n+r*r);PB+=i*(yp+e)/2,kB+=i*(bp+t)/2,qC+=i,i=bp*e-yp*t,Sre+=i*(yp+e),_re+=i*(bp+t),gM+=i*3,xw(yp=e,bp=t)}function Hqe(e){this._context=e}Hqe.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Yl);break}}},result:Aa};var Cre=new Hl,Dq,Gqe,qqe,mM,vM,yR={point:Aa,lineStart:function(){yR.point=aJt},lineEnd:function(){Dq&&Xqe(Gqe,qqe),yR.point=Aa},polygonStart:function(){Dq=!0},polygonEnd:function(){Dq=null},result:function(){var e=+Cre;return Cre=new Hl,e}};function aJt(e,t){yR.point=Xqe,Gqe=mM=e,qqe=vM=t}function Xqe(e,t){mM-=e,vM-=t,Cre.add(Ql(mM*mM+vM*vM)),mM=e,vM=t}let PEe,MB,kEe,MEe;class AEe{constructor(t){this._append=t==null?Yqe:lJt(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==kEe||this._append!==MB){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,kEe=r,MB=this._append,MEe=this._,this._=i}this._+=MEe;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Yqe(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Yqe;if(t!==PEe){const n=10**t;PEe=t,MB=function(i){let o=1;this._+=i[0];for(const s=i.length;o=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(o=new AEe(n)),s},s.projection(e).digits(n).context(t)}function HV(e){return function(t){var n=new Ore;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Ore(){}Ore.prototype={constructor:Ore,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Qde(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Tm(n,e.stream(TB)),t(TB.result()),r!=null&&e.clipExtent(r),e}function GV(e,t,n){return Qde(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function Kde(e,t,n){return GV(e,[[0,0],t],n)}function Zde(e,t,n){return Qde(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function Jde(e,t,n){return Qde(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var REe=16,cJt=kn(30*cr);function IEe(e,t){return+t?fJt(e,t):uJt(e)}function uJt(e){return HV({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function fJt(e,t){function n(r,i,o,s,a,l,c,u,f,d,h,p,g,m){var v=c-r,y=u-i,b=v*v+y*y;if(b>4*t&&g--){var w=s+d,S=a+h,_=l+p,E=Ql(w*w+S*S+_*_),T=Bc(_/=E),k=kr(kr(_)-1)t||kr((v*F+y*A)/b-.5)>.3||s*d+a*h+l*p2?L[2]%360*cr:0,F()):[a*Qo,l*Qo,c*Qo]},R.angle=function(L){return arguments.length?(f=L%360*cr,F()):f*Qo},R.reflectX=function(L){return arguments.length?(d=L?-1:1,F()):d<0},R.reflectY=function(L){return arguments.length?(h=L?-1:1,F()):h<0},R.precision=function(L){return arguments.length?(_=IEe(E,S=L*L),A()):Ql(S)},R.fitExtent=function(L,$){return GV(R,L,$)},R.fitSize=function(L,$){return Kde(R,L,$)},R.fitWidth=function(L,$){return Zde(R,L,$)},R.fitHeight=function(L,$){return Jde(R,L,$)};function F(){var L=DEe(n,0,0,d,h,f).apply(null,t(o,s)),$=DEe(n,r-L[0],i-L[1],d,h,f);return u=Dqe(a,l,c),E=gre(t,$),T=gre(u,E),_=IEe(E,S),A()}function A(){return k=P=null,R}return function(){return t=e.apply(this,arguments),R.invert=t.invert&&I,F()}}function ehe(e){var t=0,n=gr/3,r=Kqe(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*cr,n=o[1]*cr):[t*Qo,n*Qo]},i}function gJt(e){var t=kn(e);function n(r,i){return[r*t,Cn(i)/t]}return n.invert=function(r,i){return[r/t,Bc(i*t)]},n}function mJt(e,t){var n=Cn(e),r=(n+Cn(t))/2;if(kr(r)=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},u.stream=function(d){return e&&t===d?e:e=vJt([n.stream(t=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(c),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+En,g+.12*h+En],[p-.214*h-En,g+.234*h-En]]).stream(c),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+En,g+.166*h+En],[p-.115*h-En,g+.234*h-En]]).stream(c),f()},u.fitExtent=function(d,h){return GV(u,d,h)},u.fitSize=function(d,h){return Kde(u,d,h)},u.fitWidth=function(d,h){return Zde(u,d,h)},u.fitHeight=function(d,h){return Jde(u,d,h)};function f(){return e=t=null,u}return u.scale(1070)}function Jqe(e){return function(t,n){var r=kn(t),i=kn(n),o=e(r*i);return o===1/0?[2,0]:[o*i*Cn(t),o*Cn(n)]}}function uL(e){return function(t,n){var r=Ql(t*t+n*n),i=e(r),o=Cn(i),s=kn(i);return[ed(t*o,r*s),Bc(r&&n*o/r)]}}var eXe=Jqe(function(e){return Ql(2/(1+e))});eXe.invert=uL(function(e){return 2*Bc(e/2)});function bJt(){return Sg(eXe).scale(124.75).clipAngle(180-.001)}var tXe=Jqe(function(e){return(e=_qe(e))&&e/Cn(e)});tXe.invert=uL(function(e){return e});function xJt(){return Sg(tXe).scale(79.4188).clipAngle(180-.001)}function qV(e,t){return[e,dB(Xde((jo+t)/2))]}qV.invert=function(e,t){return[e,2*rP(Sqe(t))-jo]};function wJt(){return nXe(qV).scale(961/Yl)}function nXe(e){var t=Sg(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,l,c;t.scale=function(f){return arguments.length?(r(f),u()):r()},t.translate=function(f){return arguments.length?(i(f),u()):i()},t.center=function(f){return arguments.length?(n(f),u()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=l=c=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var f=gr*r(),d=t(BZt(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===qV?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),c]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,c)]])}return u()}function xN(e){return Xde((jo+e)/2)}function SJt(e,t){var n=kn(e),r=e===t?Cn(e):dB(n/kn(t))/dB(xN(t)/xN(e)),i=n*Mq(xN(e),r)/r;if(!r)return qV;function o(s,a){i>0?a<-jo+En&&(a=-jo+En):a>jo-En&&(a=jo-En);var l=i/Mq(xN(a),r);return[l*Cn(r*s),i-l*kn(r*s)]}return o.invert=function(s,a){var l=i-a,c=Tf(r)*Ql(s*s+l*l),u=ed(s,kr(l))*Tf(l);return l*r<0&&(u-=gr*Tf(s)*Tf(l)),[u/r,2*rP(Mq(i/c,1/r))-jo]},o}function _Jt(){return ehe(SJt).scale(109.5).parallels([30,30])}function RB(e,t){return[e,t]}RB.invert=RB;function CJt(){return Sg(RB).scale(152.63)}function OJt(e,t){var n=kn(e),r=e===t?Cn(e):(n-kn(t))/(t-e),i=n/r+e;if(kr(r)En&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function AJt(){return Sg(oXe).scale(175.295)}function sXe(e,t){return[kn(t)*Cn(e),Cn(t)]}sXe.invert=uL(Bc);function RJt(){return Sg(sXe).scale(249.5).clipAngle(90+En)}function aXe(e,t){var n=kn(t),r=1+kn(e)*n;return[n*Cn(e)/r,Cn(t)/r]}aXe.invert=uL(function(e){return 2*rP(e)});function IJt(){return Sg(aXe).scale(250).clipAngle(142)}function lXe(e,t){return[dB(Xde((jo+t)/2)),-e]}lXe.invert=function(e,t){return[-t,2*rP(Sqe(e))-jo]};function DJt(){var e=nXe(lXe),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var LJt=Math.abs,Ere=Math.cos,DB=Math.sin,FJt=1e-6,cXe=Math.PI,Tre=cXe/2,LEe=$Jt(2);function FEe(e){return e>1?Tre:e<-1?-Tre:Math.asin(e)}function $Jt(e){return e>0?Math.sqrt(e):0}function NJt(e,t){var n=e*DB(t),r=30,i;do t-=i=(t+DB(t)-n)/(1+Ere(t));while(LJt(i)>FJt&&--r>0);return t/2}function zJt(e,t,n){function r(i,o){return[e*i*Ere(o=NJt(n,o)),t*DB(o)]}return r.invert=function(i,o){return o=FEe(o/t),[i/(e*Ere(o)),FEe((2*o+DB(2*o))/n)]},r}var jJt=zJt(LEe/Tre,LEe,cXe);function BJt(){return Sg(jJt).scale(169.529)}const UJt=Qqe(),Pre=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function VJt(e,t){return function n(){const r=t();return r.type=e,r.path=Qqe().projection(r),r.copy=r.copy||function(){const i=n();return Pre.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},O9e(r)}}function the(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(LB[e]=VJt(e,t),this):LB[e]||null}function uXe(e){return e&&e.path||UJt}const LB={albers:Zqe,albersusa:yJt,azimuthalequalarea:bJt,azimuthalequidistant:xJt,conicconformal:_Jt,conicequalarea:AB,conicequidistant:EJt,equalEarth:PJt,equirectangular:CJt,gnomonic:kJt,identity:MJt,mercator:wJt,mollweide:BJt,naturalEarth1:AJt,orthographic:RJt,stereographic:IJt,transversemercator:DJt};for(const e in LB)the(e,LB[e]);function WJt(){}const Qg=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function fXe(){var e=1,t=1,n=a;function r(l,c){return c.map(u=>i(l,u))}function i(l,c){var u=[],f=[];return o(l,c,d=>{n(d,l,c),HJt(d)>0?u.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=u.length,g;h=c,Qg[m<<1].forEach(b);++h=c,Qg[g|m<<1].forEach(b);for(Qg[m<<0].forEach(b);++p=c,v=l[p*e]>=c,Qg[m<<1|v<<2].forEach(b);++h=c,y=v,v=l[p*e+h+1]>=c,Qg[g|m<<1|v<<2|y<<3].forEach(b);Qg[m|v<<3].forEach(b)}for(h=-1,v=l[p*e]>=c,Qg[v<<2].forEach(b);++h=c,Qg[v<<2|y<<3].forEach(b);Qg[v<<3].forEach(b);function b(w){var S=[w[0][0]+h,w[0][1]+p],_=[w[1][0]+h,w[1][1]+p],E=s(S),T=s(_),k,P;(k=d[E])?(P=f[T])?(delete d[k.end],delete f[P.start],k===P?(k.ring.push(_),u(k.ring)):f[k.start]=d[P.end]={start:k.start,end:P.end,ring:k.ring.concat(P.ring)}):(delete d[k.end],k.ring.push(_),d[k.end=T]=k):(k=f[T])?(P=d[E])?(delete f[k.start],delete d[P.end],k===P?(k.ring.push(_),u(k.ring)):f[P.start]=d[k.end]={start:P.start,end:k.end,ring:P.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(S),f[k.start=E]=k):f[E]=d[T]={start:E,end:T,ring:[S,_]}}}function s(l){return l[0]*2+l[1]*(e+1)*4}function a(l,c,u){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,v=c[g*e+p];d>0&&d0&&h=0&&u>=0||et("invalid size"),e=c,t=u,r},r.smooth=function(l){return arguments.length?(n=l?a:WJt,r):n===a},r}function HJt(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++tr!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=-i)}return i}function XJt(e,t,n){var r;return YJt(e,t,n)&&QJt(e[r=+(e[0]===t[0])],n[r],t[r])}function YJt(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function QJt(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function dXe(e,t,n){return function(r){var i=tg(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=t?K0(o,s,e):a/(e+1);return Tc(o+l,s,l)}}function nhe(e){Ze.call(this,null,e)}nhe.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};Rt(nhe,Ze,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||vl,o=fXe().smooth(e.smooth!==!1),s=e.thresholds||KJt(r,i,e),a=e.as===null?null:e.as||"contour",l=[];return r.forEach(c=>{const u=i(c),f=o.size([u.width,u.height])(u.values,lt(s)?s:s(u.values));ZJt(f,u,c,e),f.forEach(d=>{l.push(sV(c,li(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function KJt(e,t,n){const r=dXe(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(e.map(i=>N1(t(i).values)))}function ZJt(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(ir(i)&&(i=i(n,r)),ir(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(Qr(i)?i:i[0])||1,a=(Qr(i)?i:i[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;e.forEach(hXe(t,s,a,l,c))}function hXe(e,t,n,r,i){const o=e.x1||0,s=e.y1||0,a=t*n<0;function l(f){f.forEach(c)}function c(f){a&&f.reverse(),f.forEach(u)}function u(f){f[0]=(f[0]-o)*t+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function $Ee(e,t,n){const r=e>=0?e:Nue(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function Lq(e){return ir(e)?e:yl(+e)}function pXe(){var e=l=>l[0],t=l=>l[1],n=HT,r=[-1,-1],i=960,o=500,s=2;function a(l,c){const u=$Ee(r[0],l,e)>>s,f=$Ee(r[1],l,t)>>s,d=u?u+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),m=new Float32Array(p*g),v=new Float32Array(p*g);let y=m;l.forEach(w=>{const S=d+(+e(w)>>s),_=h+(+t(w)>>s);S>=0&&S=0&&_0&&f>0?(I_(p,g,m,v,u),D_(p,g,v,m,f),I_(p,g,m,v,u),D_(p,g,v,m,f),I_(p,g,m,v,u),D_(p,g,v,m,f)):u>0?(I_(p,g,m,v,u),I_(p,g,v,m,u),I_(p,g,m,v,u),y=v):f>0&&(D_(p,g,m,v,f),D_(p,g,v,m,f),D_(p,g,m,v,f),y=v);const b=c?Math.pow(2,-2*s):1/OWe(y);for(let w=0,S=p*g;w>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(e=Lq(l),a):e},a.y=function(l){return arguments.length?(t=Lq(l),a):t},a.weight=function(l){return arguments.length?(n=Lq(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var c=+l[0],u=+l[1];return c>=0&&u>=0||et("invalid size"),i=c,o=u,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||et("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<=i&&(a>=o&&(l-=n[a-o+s*e]),r[a-i+s*e]=l/Math.min(a+1,e-1+o-a,o))}function D_(e,t,n,r,i){const o=(i<<1)+1;for(let s=0;s=i&&(a>=o&&(l-=n[s+(a-o)*e]),r[s+(a-i)*e]=l/Math.min(a+1,t-1+o-a,o))}function rhe(e){Ze.call(this,null,e)}rhe.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const JJt=["x","y","weight","size","cellSize","bandwidth"];function gXe(e,t){return JJt.forEach(n=>t[n]!=null?e[n](t[n]):0),e}Rt(rhe,Ze,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=een(r,e.groupby),o=(e.groupby||[]).map(Bo),s=gXe(pXe(),e),a=e.as||"grid",l=[];function c(u,f){for(let d=0;dli(c({[a]:s(u,e.counts)},u.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function een(e,t){var n=[],r=u=>u(a),i,o,s,a,l,c;if(t==null)n.push(e);else for(i={},o=0,s=e.length;on.push(a(u))),o&&s&&(t.visit(l,u=>{var f=o(u),d=s(u);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:kre,geometry:{type:ten,coordinates:r}})),this.value={type:ohe,features:n}}});function ahe(e){Ze.call(this,null,e)}ahe.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};Rt(ahe,Ze,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||vl,o=e.as||"path",s=n.SOURCE;!r||e.modified()?(this.value=r=uXe(e.projection),n.materialize().reflow()):s=i===vl||t.modified(i.fields)?n.ADD_MOD:n.ADD;const a=nen(r,e.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function nen(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function lhe(e){Ze.call(this,null,e)}lhe.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};Rt(lhe,Ze,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],l;function c(u){const f=n([r(u),i(u)]);f?(u[s]=f[0],u[a]=f[1]):(u[s]=void 0,u[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,c):(l=t.modified(r.fields)||t.modified(i.fields),t.visit(l?t.ADD_MOD:t.ADD,c)),t.modifies(o)}});function che(e){Ze.call(this,null,e)}che.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};Rt(che,Ze,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return(!r||e.modified())&&(this.value=r=ren(uXe(e.projection),e.field||Qf("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function ren(e,t,n){const r=n==null?i=>e(t(i)):i=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(i));return e.pointRadius(o),s};return r.context=i=>(e.context(i),r),r}function uhe(e){Ze.call(this,[],e),this.generator=KZt()}uhe.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};Rt(uhe,Ze,{transform(e,t){var n=this.value,r=this.generator,i;if(!n.length||e.modified())for(const o in e)ir(r[o])&&r[o](e[o]);return i=r(),n.length?t.mod.push(xHe(n[0],i)):t.add.push(li(i)),n[0]=i,t}});function fhe(e){Ze.call(this,null,e)}fhe.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};Rt(fhe,Ze,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r=e.resolve==="shared",i=e.field||vl,o=oen(e.opacity,e),s=ien(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:r?N1(n.map(c=>N1(i(c).values))):0};return n.forEach(c=>{const u=i(c),f=nr({},c,l);r||(f.$max=N1(u.values||[])),c[a]=sen(u,f,s.dep?s:yl(s(f)),o.dep?o:yl(o(f)))}),t.reflow(!0).modifies(a)}});function ien(e,t){let n;return ir(e)?(n=r=>tb(e(r,t)),n.dep=mXe(e)):n=yl(tb(e||"#888")),n}function oen(e,t){let n;return ir(e)?(n=r=>e(r,t),n.dep=mXe(e)):e?n=yl(e):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function mXe(e){if(!ir(e))return!1;const t=vh(hl(e));return t.$x||t.$y||t.$value||t.$max}function sen(e,t,n,r){const i=e.width,o=e.height,s=e.x1||0,a=e.y1||0,l=e.x2||i,c=e.y2||o,u=e.values,f=u?m=>u[m]:o0,d=$0(l-s,c-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,c-a),g=p.data;for(let m=a,v=0;m{e[r]!=null&&NEe(n,r,e[r])})):Pre.forEach(r=>{e.modified(r)&&NEe(n,r,e[r])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&aen(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function aen(e,t){const n=cen(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function len(e){const t=the((e||"mercator").toLowerCase());return t||et("Unrecognized projection type: "+e),t()}function NEe(e,t,n){ir(e[t])&&e[t](n)}function cen(e){return e=Vt(e),e.length===1?e[0]:{type:ohe,features:e.reduce((t,n)=>t.concat(uen(n)),[])}}function uen(e){return e.type===ohe?e.features:Vt(e).filter(t=>t!=null).map(t=>t.type===kre?t:{type:kre,geometry:t})}const fen=Object.freeze(Object.defineProperty({__proto__:null,contour:ihe,geojson:she,geopath:ahe,geopoint:lhe,geoshape:che,graticule:uhe,heatmap:fhe,isocontour:nhe,kde2d:rhe,projection:vXe},Symbol.toStringTag,{value:"Module"}));function den(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,s=n.length,a,l=0,c=0;for(o=0;o=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d,i=o,!(o=o[v=m<<1|g]))return i[v]=s,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return s.next=o,i?i[v]=s:e._root=s,e;do i=i?i[v]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d;while((v=m<<1|g)===(y=(p>=d)<<1|h>=f));return i[y]=o,i[v]=s,e}function pen(e){var t,n,r=e.length,i,o,s=new Array(r),a=new Array(r),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=i),of&&(f=o));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;ne||e>=i||r>t||t>=o;)switch(c=(tu||(a=p.y0)>f||(l=p.x1)=v)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var y=e-+this._x.call(null,h.data),b=t-+this._y.call(null,h.data),w=y*y+b*b;if(w=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+c)/2))?a=h:c=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(r=t,v=m)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[v]=n:this._root=n),this):(this._root=o,this)}function xen(e){for(var t=0,n=e.length;td.index){var R=h-T.x-T.vx,I=p-T.y-T.vy,F=R*R+I*I;Fh+P||_p+P||Ec.r&&(c.r=c[u].r)}function l(){if(t){var c,u=t.length,f;for(n=new Array(u),c=0;c[t(S,_,s),S])),w;for(m=0,a=new Array(v);m{}};function bXe(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Kz.prototype=bXe.prototype={constructor:Kz,on:function(e,t){var n=this._,r=Len(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&e._call.call(void 0,t),e=e._next;--bE}function UEe(){ww=($B=bR.now())+XV,bE=yM=0;try{Nen()}finally{bE=0,jen(),ww=0}}function zen(){var e=bR.now(),t=e-$B;t>xXe&&(XV-=t,$B=e)}function jen(){for(var e,t=FB,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:FB=n);bM=e,Mre(r)}function Mre(e){if(!bE){yM&&(yM=clearTimeout(yM));var t=e-ww;t>24?(e<1/0&&(yM=setTimeout(UEe,e-bR.now()-XV)),Zk&&(Zk=clearInterval(Zk))):(Zk||($B=bR.now(),Zk=setInterval(zen,xXe)),bE=1,wXe(UEe))}}function Ben(e,t,n){var r=new NB,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?phe():+a,r._restart(function l(c){c+=i,r._restart(l,i+=s,a),o(c)},s,a)},r.restart(e,t,n),r)}const Uen=1664525,Ven=1013904223,VEe=4294967296;function Wen(){let e=1;return()=>(e=(Uen*e+Ven)%VEe)/VEe}function Hen(e){return e.x}function Gen(e){return e.y}var qen=10,Xen=Math.PI*(3-Math.sqrt(5));function Yen(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=SXe(f),c=bXe("tick","end"),u=Wen();e==null&&(e=[]);function f(){d(),c.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,v){var y=0,b=e.length,w,S,_,E,T;for(v==null?v=1/0:v*=v,y=0;y1?(c.on(g,m),t):c.on(g)}}}function Qen(){var e,t,n,r,i=Ul(-30),o,s=1,a=1/0,l=.81;function c(h){var p,g=e.length,m=dhe(e,Hen,Gen).visitAfter(f);for(r=h,p=0;p=a)return;(h.data!==t||h.next)&&(v===0&&(v=y0(n),w+=v*v),y===0&&(y=y0(n),w+=y*y),w=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,l=0,c=a.length,u;le.touch(t).run()}function ttn(e,t){const n=Yen(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),CXe(n,t,!0).on("end",()=>o=!0)}function CXe(e,t,n,r){var i=Vt(t.forces),o,s,a,l;for(o=0,s=Are.length;ot(r,n):t)}const otn=Object.freeze(Object.defineProperty({__proto__:null,force:ghe},Symbol.toStringTag,{value:"Module"}));function stn(e,t){return e.parent===t.parent?1:2}function atn(e){return e.reduce(ltn,0)/e.length}function ltn(e,t){return e+t.x}function ctn(e){return 1+e.reduce(utn,0)}function utn(e,t){return Math.max(e,t.y)}function ftn(e){for(var t;t=e.children;)e=t[0];return e}function dtn(e){for(var t;t=e.children;)e=t[t.length-1];return e}function htn(){var e=stn,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=atn(h),d.y=ctn(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var l=ftn(o),c=dtn(o),u=l.x-e(l,c)/2,f=c.x+e(c,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function ptn(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function gtn(){return this.eachAfter(ptn)}function mtn(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function vtn(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function ytn(e,t){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=r[i].value;t.value=n})}function wtn(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Stn(e){for(var t=this,n=_tn(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function _tn(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function Ctn(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Otn(){return Array.from(this)}function Etn(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Ttn(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ptn(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i=0;--a)i.push(o=s[a]=new xE(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(OXe)}function ktn(){return mhe(this).eachBefore(Rtn)}function Mtn(e){return e.children}function Atn(e){return Array.isArray(e)?e[1]:null}function Rtn(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function OXe(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function xE(e){this.data=e,this.depth=this.height=0,this.parent=null}xE.prototype=mhe.prototype={constructor:xE,count:gtn,each:mtn,eachAfter:ytn,eachBefore:vtn,find:btn,sum:xtn,sort:wtn,path:Stn,ancestors:Ctn,descendants:Otn,leaves:Etn,links:Ttn,copy:ktn,[Symbol.iterator]:Ptn};function Zz(e){return e==null?null:EXe(e)}function EXe(e){if(typeof e!="function")throw new Error;return e}function o1(){return 0}function TC(e){return function(){return e}}const Itn=1664525,Dtn=1013904223,HEe=4294967296;function Ltn(){let e=1;return()=>(e=(Itn*e+Dtn)%HEe)/HEe}function Ftn(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $tn(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function Ntn(e,t){for(var n=0,r=(e=$tn(Array.from(e),t)).length,i=[],o,s;n0&&n*n>r*r+i*i}function Fq(e,t){for(var n=0;n1e-6?(R+Math.sqrt(R*R-4*P*I))/(2*P):I/R);return{x:r+_+E*F,y:i+T+k*F,r:F}}function GEe(e,t,n){var r=e.x-t.x,i,o,s=e.y-t.y,a,l,c=r*r+s*s;c?(o=t.r+n.r,o*=o,l=e.r+n.r,l*=l,o>l?(i=(c+l-o)/(2*c),a=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-a*s,n.y=e.y-i*s+a*r):(i=(c+o-l)/(2*c),a=Math.sqrt(Math.max(0,o/c-i*i)),n.x=t.x+i*r-a*s,n.y=t.y+i*s+a*r)):(n.x=t.x+n.r,n.y=t.y)}function qEe(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function XEe(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function SN(e){this._=e,this.next=null,this.previous=null}function Utn(e,t){if(!(o=(e=Ftn(e)).length))return 0;var n,r,i,o,s,a,l,c,u,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;GEe(r,n,i=e[2]),n=new SN(n),r=new SN(r),i=new SN(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lYtn(n(w,S,i))),y=v.map(JEe),b=new Set(v).add("");for(const w of y)b.has(w)||(b.add(w),v.push(w),y.push(JEe(w)),o.push(Nq));s=(w,S)=>v[S],a=(w,S)=>y[S]}for(u=0,l=o.length;u=0&&(h=o[v],h.data===Nq);--v)h.data=null}if(f.parent=Gtn,f.eachBefore(function(v){v.depth=v.parent.depth+1,--l}).eachBefore(OXe),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=Zz(i),r):e},r.parentId=function(i){return arguments.length?(t=Zz(i),r):t},r.path=function(i){return arguments.length?(n=Zz(i),r):n},r}function Ytn(e){e=`${e}`;let t=e.length;return Rre(e,t-1)&&!Rre(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function JEe(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Rre(e,t););return e.slice(0,t)}function Rre(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function Qtn(e,t){return e.parent===t.parent?1:2}function zq(e){var t=e.children;return t?t[0]:e.t}function jq(e){var t=e.children;return t?t[t.length-1]:e.t}function Ktn(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Ztn(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function Jtn(e,t,n){return e.a.parent===t.parent?e.a:n}function Jz(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Jz.prototype=Object.create(xE.prototype);function enn(e){for(var t=new Jz(e,0),n,r=[t],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new Jz(o[s],s)),i.parent=n;return(t.parent=new Jz(null,0)).children=[t],t}function tnn(){var e=Qtn,t=1,n=1,r=null;function i(c){var u=enn(c);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var f=c,d=c,h=c;c.eachBefore(function(y){y.xd.x&&(d=y),y.depth>h.depth&&(h=y)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),v=n/(h.depth||1);c.eachBefore(function(y){y.x=(y.x+g)*m,y.y=y.depth*v})}return c}function o(c){var u=c.children,f=c.parent.children,d=c.i?f[c.i-1]:null;if(u){Ztn(c);var h=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-h):c.z=h}else d&&(c.z=d.z+e(c._,d._));c.parent.A=a(c,d,c.parent.A||f[0])}function s(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function a(c,u,f){if(u){for(var d=c,h=c,p=u,g=d.parent.children[0],m=d.m,v=h.m,y=p.m,b=g.m,w;p=jq(p),d=zq(d),p&&d;)g=zq(g),h=jq(h),h.a=c,w=p.z+y-d.z-m+e(p._,d._),w>0&&(Ktn(Jtn(p,c,f),c,w),m+=w,v+=w),y+=p.m,m+=d.m,b+=g.m,v+=h.m;p&&!jq(h)&&(h.t=p,h.m+=y-v),d&&!zq(g)&&(g.t=d,g.m+=m-b,f=c)}return f}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function YV(e,t,n,r,i){for(var o=e.children,s,a=-1,l=o.length,c=e.value&&(i-n)/e.value;++ay&&(y=c),_=m*m*S,b=Math.max(y/_,_/v),b>w){m-=c;break}w=b}s.push(l={value:m,dice:h1?r:1)},n})(MXe);function nnn(){var e=RXe,t=!1,n=1,r=1,i=[0],o=o1,s=o1,a=o1,l=o1,c=o1;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],t&&d.eachBefore(kXe),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,v=d.y1-h;m=d-1){var y=o[f];y.x0=p,y.y0=g,y.x1=m,y.y1=v;return}for(var b=c[f],w=h/2+b,S=f+1,_=d-1;S<_;){var E=S+_>>>1;c[E]v-g){var P=h?(p*k+m*T)/h:m;u(f,S,T,p,g,P,v),u(S,d,k,P,g,m,v)}else{var R=h?(g*k+v*T)/h:v;u(f,S,T,p,g,m,R),u(S,d,k,p,R,m,v)}}}function inn(e,t,n,r,i){(e.depth&1?YV:fL)(e,t,n,r,i)}const onn=(function e(t){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===t)for(var l,c,u,f,d=-1,h,p=l.length,g=r.value;++d1?r:1)},n})(MXe);function Ire(e,t,n){const r={};return e.each(i=>{const o=i.data;n(o)&&(r[t(o)]=i)}),e.lookup=r,e}function vhe(e){Ze.call(this,null,e)}vhe.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const snn=e=>e.values;Rt(vhe,Ze,{transform(e,t){t.source||et("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each(s=>{s.children&&oV(s.data)&&i.rem.push(s.data)}),this.value=o=mhe({values:Vt(e.keys).reduce((s,a)=>(s.key(a),s),ann()).entries(i.source)},snn),n&&o.each(s=>{s.children&&(s=li(s.data),i.add.push(s),i.source.push(s))}),Ire(o,Sn,Sn)),i.source.root=o,i}});function ann(){const e=[],t={entries:i=>r(n(i,0),0),key:i=>(e.push(i),t)};function n(i,o){if(o>=e.length)return i;const s=i.length,a=e[o++],l={},c={};let u=-1,f,d,h;for(;++ue.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return t}function Iv(e){Ze.call(this,null,e)}const lnn=(e,t)=>e.parent===t.parent?1:2;Rt(Iv,Ze,{transform(e,t){(!t.source||!t.source.root)&&et(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(xS(e.sort,s=>s.data)),cnn(n,this.params,e),n.separation&&n.separation(e.separation!==!1?lnn:HT);try{this.value=n(i)}catch(s){et(s)}return i.each(s=>unn(s,r,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function cnn(e,t,n){for(let r,i=0,o=t.length;io[Sn(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[Sn(a)]&&o[Sn(l)]&&i.add.push(li({source:l,target:a}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[Sn(s)]=1),n.forEach(s=>{(o[Sn(s.source)]||o[Sn(s.target)])&&i.mod.push(s)})),i}});const tTe={binary:rnn,dice:fL,slice:YV,slicedice:inn,squarify:RXe,resquarify:onn},$re=["x0","y0","x1","y1","depth","children"];function _he(e){Iv.call(this,e)}_he.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:$re.length,default:$re}]};Rt(_he,Iv,{layout(){const e=nnn();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Yt(tTe,t)?e.tile(tTe[t]):et("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:$re});const fnn=Object.freeze(Object.defineProperty({__proto__:null,nest:vhe,pack:yhe,partition:bhe,stratify:xhe,tree:whe,treelinks:She,treemap:_he},Symbol.toStringTag,{value:"Module"})),Bq=4278190080;function dnn(e,t){const n=e.bitmap();return(t||[]).forEach(r=>n.set(e(r.boundary[0]),e(r.boundary[3]))),[n,void 0]}function hnn(e,t,n,r,i){const o=e.width,s=e.height,a=r||i,l=$0(o,s).getContext("2d"),c=$0(o,s).getContext("2d"),u=a&&$0(o,s).getContext("2d");n.forEach(T=>e5(l,T,!1)),e5(c,t,!1),a&&e5(u,t,!0);const f=Uq(l,o,s),d=Uq(c,o,s),h=a&&Uq(u,o,s),p=e.bitmap(),g=a&&e.bitmap();let m,v,y,b,w,S,_,E;for(v=0;v{i.items.forEach(o=>e5(e,o.items,n))}):Uu[r].draw(e,{items:n?t.map(pnn):t})}function pnn(e){const t=sV(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Kg=5,Ol=31,xR=32,Zy=new Uint32Array(xR+1),Gd=new Uint32Array(xR+1);Gd[0]=0;Zy[0]=~Gd[0];for(let e=1;e<=xR;++e)Gd[e]=Gd[e-1]<<1|1,Zy[e]=~Gd[e];function gnn(e,t){const n=new Uint32Array(~~((e*t+xR)/xR));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>Kg]&1<<(a&Ol)},set:(o,s)=>{const a=s*e+o;r(a>>>Kg,1<<(a&Ol))},clear:(o,s)=>{const a=s*e+o;i(a>>>Kg,~(1<<(a&Ol)))},getRange:(o,s,a,l)=>{let c=l,u,f,d,h;for(;c>=s;--c)if(u=c*e+o,f=c*e+a,d=u>>>Kg,h=f>>>Kg,d===h){if(n[d]&Zy[u&Ol]&Gd[(f&Ol)+1])return!0}else{if(n[d]&Zy[u&Ol]||n[h]&Gd[(f&Ol)+1])return!0;for(let p=d+1;p{let c,u,f,d,h;for(;s<=l;++s)if(c=s*e+o,u=s*e+a,f=c>>>Kg,d=u>>>Kg,f===d)r(f,Zy[c&Ol]&Gd[(u&Ol)+1]);else for(r(f,Zy[c&Ol]),r(d,Gd[(u&Ol)+1]),h=f+1;h{let c,u,f,d,h;for(;s<=l;++s)if(c=s*e+o,u=s*e+a,f=c>>>Kg,d=u>>>Kg,f===d)i(f,Gd[c&Ol]|Zy[(u&Ol)+1]);else for(i(f,Gd[c&Ol]),i(d,Zy[(u&Ol)+1]),h=f+1;ho<0||s<0||l>=t||a>=e}}function mnn(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>gnn(i,o),s.ratio=r,s.padding=n,s.width=e,s.height=t,s}function vnn(e,t,n,r){const i=e.width,o=e.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,c=s.datum.fontSize,u=Au.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,v,y;for(let b=0;b=f&&(f=y,s.x=m,s.y=v);return m=u/2,v=c/2,d=s.x-m,h=s.x+m,p=s.y-v,g=s.y+v,s.align="center",d<0&&h<=i?s.align="left":0<=d&&ii||t-(s=r/2)<0||t+s>o}function b0(e,t,n,r,i,o,s,a){const l=i*o/(r*2),c=e(t-l),u=e(t+l),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(c,f,u,d)||s.getRange(c,f,u,d)||a&&a.getRange(c,f,u,d)}function ynn(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1];function l(c,u,f,d,h){const p=e.invert(c),g=e.invert(u);let m=f,v=o,y;if(!zB(p,g,d,h,i,o)&&!b0(e,p,g,h,d,m,s,a)&&!b0(e,p,g,h,d,h,s,null)){for(;v-m>=1;)y=(m+v)/2,b0(e,p,g,h,d,y,s,a)?v=y:m=y;if(m>f)return[p,g,m,!0]}}return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=Au.width(c.datum,c.datum.text);let p=n?d:0,g=!1,m=!1,v=0,y,b,w,S,_,E,T,k,P,R,I,F,A,L,$,j,V;for(let U=0;Ub&&(V=y,y=b,b=V),w>S&&(V=w,w=S,S=V),P=e(y),I=e(b),R=~~((P+I)/2),F=e(w),L=e(S),A=~~((F+L)/2),T=R;T>=P;--T)for(k=A;k>=F;--k)j=l(T,k,p,h,d),j&&([c.x,c.y,p,g]=j);for(T=R;T<=I;++T)for(k=A;k<=L;++k)j=l(T,k,p,h,d),j&&([c.x,c.y,p,g]=j);!g&&!n&&($=Math.abs(b-y+S-w),_=(y+b)/2,E=(w+S)/2,$>=v&&!zB(_,E,h,d,i,o)&&!b0(e,_,E,d,h,d,s,null)&&(v=$,c.x=_,c.y=E,m=!0))}return g||m?(_=h/2,E=d/2,s.setRange(e(c.x-_),e(c.y-E),e(c.x+_),e(c.y+E)),c.align="center",c.baseline="middle",!0):!1}}const bnn=[-1,-1,1,1],xnn=[-1,1,-1,1];function wnn(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=e.bitmap();return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=Au.width(c.datum,c.datum.text),p=[];let g=n?d:0,m=!1,v=!1,y=0,b,w,S,_,E,T,k,P,R,I,F,A;for(let L=0;L=1;)F=(R+I)/2,b0(e,E,T,d,h,F,s,a)?I=F:R=F;R>g&&(c.x=E,c.y=T,g=R,m=!0)}}!m&&!n&&(A=Math.abs(w-b+_-S),E=(b+w)/2,T=(S+_)/2,A>=y&&!zB(E,T,h,d,i,o)&&!b0(e,E,T,d,h,d,s,null)&&(y=A,c.x=E,c.y=T,v=!0))}return m||v?(E=h/2,T=d/2,s.setRange(e(c.x-E),e(c.y-T),e(c.x+E),e(c.y+T)),c.align="center",c.baseline="middle",!0):!1}}const Snn=["right","center","left"],_nn=["bottom","middle","top"];function Cnn(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=r.length;return function(c){const u=c.boundary,f=c.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>i||u[3]>o)return!1;let d=c.textWidth??0,h,p,g,m,v,y,b,w,S,_,E,T,k,P,R;for(let I=0;I>>2&3)-1,g=h===0&&p===0||r[I]<0,m=h&&p?Math.SQRT1_2:1,v=r[I]<0?-1:1,y=u[1+h]+r[I]*h*m,E=u[4+p]+v*f*p/2+r[I]*p*m,w=E-f/2,S=E+f/2,T=e(y),P=e(w),R=e(S),!d)if(nTe(T,T,P,R,s,a,y,y,w,S,u,g))d=Au.width(c.datum,c.datum.text);else continue;if(_=y+v*d*h/2,y=_-d/2,b=_+d/2,T=e(y),k=e(b),nTe(T,k,P,R,s,a,y,b,w,S,u,g))return c.x=h?h*v<0?b:y:_,c.y=p?p*v<0?S:w:E,c.align=Snn[h*v+1],c.baseline=_nn[p*v+1],s.setRange(T,P,k,R),!0}return!1}}function nTe(e,t,n,r,i,o,s,a,l,c,u,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const Vq=0,Wq=4,Hq=8,Gq=0,qq=1,Xq=2,Onn={"top-left":Vq+Gq,top:Vq+qq,"top-right":Vq+Xq,left:Wq+Gq,middle:Wq+qq,right:Wq+Xq,"bottom-left":Hq+Gq,bottom:Hq+qq,"bottom-right":Hq+Xq},Enn={naive:vnn,"reduced-search":ynn,floodfill:wnn};function Tnn(e,t,n,r,i,o,s,a,l,c,u){if(!e.length)return e;const f=Math.max(r.length,i.length),d=Pnn(r,f),h=knn(i,f),p=Mnn(e[0].datum),g=p==="group"&&e[0].datum.items[l].marktype,m=g==="area",v=Ann(p,g,a,l),y=c===null||c===1/0,b=m&&u==="naive";let w=-1,S=-1;const _=e.map(P=>{const R=y?Au.width(P,P.text):void 0;return w=Math.max(w,R),S=Math.max(S,P.fontSize),{datum:P,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(P),textWidth:R}});c=c===null||c===1/0?Math.max(w,S)+Math.max(...r):c;const E=mnn(t[0],t[1],c);let T;if(!b){n&&_.sort((I,F)=>n(I.datum,F.datum));let P=!1;for(let I=0;II.datum);T=o.length||R?hnn(E,R||[],o,P,m):dnn(E,s&&_)}const k=m?Enn[u](E,T,s,l):Cnn(E,T,h,d);return _.forEach(P=>P.opacity=+k(P)),_}function Pnn(e,t){const n=new Float64Array(t),r=e.length;for(let i=0;i[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>i(o.datum):t==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const Nre=["x","y","opacity","align","baseline"],IXe=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Che(e){Ze.call(this,null,e)}Che.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:IXe},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:Nre.length,default:Nre}]};Rt(Che,Ze,{transform(e,t){function n(o){const s=e[o];return ir(s)&&t.modified(s.fields)}const r=e.modified();if(!(r||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&et("Size parameter should be specified as a [width, height] array.");const i=e.as||Nre;return Tnn(t.materialize(t.SOURCE).source||[],e.size,e.sort,Vt(e.offset==null?1:e.offset),Vt(e.anchor||IXe),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),t.reflow(r).modifies(i)}});const Rnn=Object.freeze(Object.defineProperty({__proto__:null,label:Che},Symbol.toStringTag,{value:"Module"}));function DXe(e,t){var n=[],r=function(u){return u(a)},i,o,s,a,l,c;if(t==null)n.push(e);else for(i={},o=0,s=e.length;o{NHe(c,e.x,e.y,e.bandwidth||.3).forEach(u=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function Ehe(e){Ze.call(this,null,e)}Ehe.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(zre)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};Rt(Ehe,Ze,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=DXe(r,e.groupby),o=(e.groupby||[]).map(Bo),s=e.method||"linear",a=e.order==null?3:e.order,l=Inn(s,a),c=e.as||[Bo(e.x),Bo(e.y)],u=zre[s],f=[];let d=e.extent;Yt(zre,s)||et("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=u(h,e.x,e.y,a);if(e.params){f.push(li({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||tg(h,e.x),v=y=>{const b={};for(let w=0;wv([y,g.predict(y)])):hV(g.predict,m,25,200).forEach(v)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const Dnn=Object.freeze(Object.defineProperty({__proto__:null,loess:Ohe,regression:Ehe},Symbol.toStringTag,{value:"Module"})),Xm=11102230246251565e-32,qa=134217729,Lnn=(3+8*Xm)*Xm;function Yq(e,t,n,r,i){let o,s,a,l,c=t[0],u=r[0],f=0,d=0;u>c==u>-c?(o=c,c=t[++f]):(o=u,u=r[++d]);let h=0;if(fc==u>-c?(s=c+o,a=o-(s-c),c=t[++f]):(s=u+o,a=o-(s-u),u=r[++d]),o=s,a!==0&&(i[h++]=a);fc==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=t[++f]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f=A||-F>=A||(f=e-k,a=e-(k+f)+(f-i),f=n-P,c=n-(P+f)+(f-i),f=t-R,l=t-(R+f)+(f-o),f=r-I,u=r-(I+f)+(f-o),a===0&&l===0&&c===0&&u===0)||(A=znn*s+Lnn*Math.abs(F),F+=k*u+I*a-(R*c+P*l),F>=A||-F>=A))return F;w=a*I,d=qa*a,h=d-(d-a),p=a-h,d=qa*I,g=d-(d-I),m=I-g,S=p*m-(w-h*g-p*g-h*m),_=l*P,d=qa*l,h=d-(d-l),p=l-h,d=qa*P,g=d-(d-P),m=P-g,E=p*m-(_-h*g-p*g-h*m),v=S-E,f=S-v,El[0]=S-(v+f)+(f-E),y=w+v,f=y-w,b=w-(y-f)+(v-f),v=b-_,f=b-v,El[1]=b-(v+f)+(f-_),T=y+v,f=T-y,El[2]=y-(T-f)+(v-f),El[3]=T;const L=Yq(4,L_,4,El,rTe);w=k*u,d=qa*k,h=d-(d-k),p=k-h,d=qa*u,g=d-(d-u),m=u-g,S=p*m-(w-h*g-p*g-h*m),_=R*c,d=qa*R,h=d-(d-R),p=R-h,d=qa*c,g=d-(d-c),m=c-g,E=p*m-(_-h*g-p*g-h*m),v=S-E,f=S-v,El[0]=S-(v+f)+(f-E),y=w+v,f=y-w,b=w-(y-f)+(v-f),v=b-_,f=b-v,El[1]=b-(v+f)+(f-_),T=y+v,f=T-y,El[2]=y-(T-f)+(v-f),El[3]=T;const $=Yq(L,rTe,4,El,iTe);w=a*u,d=qa*a,h=d-(d-a),p=a-h,d=qa*u,g=d-(d-u),m=u-g,S=p*m-(w-h*g-p*g-h*m),_=l*c,d=qa*l,h=d-(d-l),p=l-h,d=qa*c,g=d-(d-c),m=c-g,E=p*m-(_-h*g-p*g-h*m),v=S-E,f=S-v,El[0]=S-(v+f)+(f-E),y=w+v,f=y-w,b=w-(y-f)+(v-f),v=b-_,f=b-v,El[1]=b-(v+f)+(f-_),T=y+v,f=T-y,El[2]=y-(T-f)+(v-f),El[3]=T;const j=Yq($,iTe,4,El,oTe);return oTe[j-1]}function _N(e,t,n,r,i,o){const s=(t-o)*(n-i),a=(e-i)*(r-o),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=$nn*c?l:-jnn(e,t,n,r,i,o,c)}const sTe=Math.pow(2,-52),CN=new Uint32Array(512);class jB{static from(t,n=Hnn,r=Gnn){const i=t.length,o=new Float64Array(i*2);for(let s=0;s>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1;let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let k=0;kc&&(c=P),R>u&&(u=R),this._ids[k]=k}const f=(a+c)/2,d=(l+u)/2;let h,p,g;for(let k=0,P=1/0;k0&&(p=k,P=R)}let y=t[2*p],b=t[2*p+1],w=1/0;for(let k=0;kI&&(k[P++]=F,I=A)}this.hull=k.subarray(0,P),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(_N(m,v,y,b,S,_)<0){const k=p,P=y,R=b;p=g,y=S,b=_,g=k,S=P,_=R}const E=Wnn(m,v,y,b,S,_);this._cx=E.x,this._cy=E.y;for(let k=0;k0&&Math.abs(F-P)<=sTe&&Math.abs(A-R)<=sTe||(P=F,R=A,I===h||I===p||I===g))continue;let L=0;for(let z=0,N=this._hashKey(F,A);z=0;)if($=j,$===L){$=-1;break}if($===-1)continue;let V=this._addTriangle($,I,r[$],-1,-1,i[$]);i[I]=this._legalize(V+2),i[$]=V,T++;let U=r[$];for(;j=r[U],_N(F,A,t[2*U],t[2*U+1],t[2*j],t[2*j+1])<0;)V=this._addTriangle(U,I,j,i[I],-1,i[U]),i[I]=this._legalize(V+2),r[U]=U,T--,U=j;if($===L)for(;j=n[$],_N(F,A,t[2*j],t[2*j+1],t[2*$],t[2*$+1])<0;)V=this._addTriangle(j,I,$,-1,i[$],i[j]),this._legalize(V+2),i[j]=V,r[$]=$,T--,$=j;this._hullStart=n[I]=$,r[$]=n[U]=I,r[I]=U,o[this._hashKey(F,A)]=I,o[this._hashKey(t[2*$],t[2*$+1])]=$}this.hull=new Uint32Array(T);for(let k=0,P=this._hullStart;k0?3-n:1+n)/4}function Qq(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function Unn(e,t,n,r,i,o,s,a){const l=e-s,c=t-a,u=n-s,f=r-a,d=i-s,h=o-a,p=l*l+c*c,g=u*u+f*f,m=d*d+h*h;return l*(f*m-g*h)-c*(u*m-g*d)+p*(u*h-f*d)<0}function Vnn(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,c=o-t,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=(c*u-a*f)*d,p=(s*f-l*u)*d;return h*h+p*p}function Wnn(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,c=o-t,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=e+(c*u-a*f)*d,p=t+(s*f-l*u)*d;return{x:h,y:p}}function XC(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=e[i],s=t[o];let a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;Jk(e,i,o),t[e[n]]>t[e[r]]&&Jk(e,n,r),t[e[o]]>t[e[r]]&&Jk(e,o,r),t[e[n]]>t[e[o]]&&Jk(e,n,o);const a=e[o],l=t[a];for(;;){do o++;while(t[e[o]]l);if(s=s-n?(XC(e,t,o,r),XC(e,t,n,s-1)):(XC(e,t,n,s-1),XC(e,t,o,r))}}function Jk(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Hnn(e){return e[0]}function Gnn(e){return e[1]}const aTe=1e-6;class b1{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>aTe||Math.abs(this._y1-o)>aTe)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class jre{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let qnn=class{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,v=r.length,y,b;g1;)o-=2;for(let s=2;s0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function Znn(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class The{static from(t,n=Ynn,r=Qnn,i){return new The("length"in t?Jnn(t,n,r,i):Float64Array.from(ern(t,n,r,i)))}constructor(t){this._delaunator=new jB(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Knn(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new qnn(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:c}=this;if(i[t]===-1||!c.length)return(t+1)%(c.length>>1);let u=t,f=F_(n-c[t*2],2)+F_(r-c[t*2+1],2);const d=i[t];let h=d;do{let p=l[h];const g=F_(n-c[p*2],2)+F_(r-c[p*2+1],2);if(g>5)*e[1]),m=null,v=c.length,y=-1,b=[],w=c.map(_=>({text:t(_),font:n(_),style:i(_),weight:o(_),rotate:s(_),size:~~(r(_)+1e-14),padding:a(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,E)=>E.size-_.size);++y>1,S.y=e[1]*(u()+.5)>>1,srn(p,S,w,y),S.hasText&&h(g,S,m)&&(b.push(S),m?lrn(m,S):m=[{x:S.x+S.x0,y:S.y+S.y0},{x:S.x+S.x1,y:S.y+S.y1}],S.x-=e[0]>>1,S.y-=e[1]>>1)}return b};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(SM<<5)/g,p.height=t5/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var v=g.x,y=g.y,b=Math.hypot(e[0],e[1]),w=l(e),S=u()<.5?1:-1,_=-S,E,T,k;(E=w(_+=S))&&(T=~~E[0],k=~~E[1],!(Math.min(Math.abs(T),Math.abs(k))>=b));)if(g.x=v+T,g.y=y+k,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!arn(g,p,e[0]))&&(!m||crn(g,m))){for(var P=g.sprite,R=g.width>>5,I=e[0]>>5,F=g.x-(R<<4),A=F&127,L=32-A,$=g.y1-g.y0,j=(g.y+g.y0)*I+(F>>5),V,U=0;U<$;U++){V=0;for(var z=0;z<=R;z++)p[j+z]|=V<>>A:0);j+=I}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(c=p,f):c},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=gx(p),f):n},f.fontStyle=function(p){return arguments.length?(i=gx(p),f):i},f.fontWeight=function(p){return arguments.length?(o=gx(p),f):o},f.rotate=function(p){return arguments.length?(s=gx(p),f):s},f.text=function(p){return arguments.length?(t=gx(p),f):t},f.spiral=function(p){return arguments.length?(l=drn[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=gx(p),f):r},f.padding=function(p){return arguments.length?(a=gx(p),f):a},f.random=function(p){return arguments.length?(u=p,f):u},f}function srn(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,(SM<<5)/o,t5/o);var s=0,a=0,l=0,c=n.length,u,f,d,h,p;for(--r;++r>5<<5,d=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else u=u+31>>5<<5;if(d>l&&(l=d),s+u>=SM<<5&&(s=0,a+=l,l=0),a+d>=t5)break;i.translate((s+(u>>1))/o,(a+(d>>1))/o),t.rotate&&i.rotate(t.rotate*Kq),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=d,t.xoff=s,t.yoff=a,t.x1=u>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=u}for(var S=i.getImageData(0,0,(SM<<5)/o,t5/o).data,_=[];--r>=0;)if(t=n[r],!!t.hasText){for(u=t.width,f=u>>5,d=t.y1-t.y0,h=0;h>5),P=S[(a+p)*(SM<<5)+(s+h)<<2]?1<<31-h%32:0;_[k]|=P,E|=P}E?T=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+T,t.sprite=_.slice(0,(t.y1-t.y0)*f)}}}function arn(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,o=e.x-(i<<4),s=o&127,a=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(o>>5),u,f=0;f>>s:0))&t[c+d])return!0;c+=n}return!1}function lrn(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function crn(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const c=o.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Jf).layout(),u=o.size(),f=u[0]>>1,d=u[1]>>1,h=c.length;for(let p=0,g,m;pnew Uint8Array(e),mrn=e=>new Uint16Array(e),oA=e=>new Uint32Array(e);function vrn(){let e=8,t=[],n=oA(0),r=ON(0,e),i=ON(0,e);return{data:()=>t,seen:()=>n=yrn(n,t.length),add(o){for(let s=0,a=t.length,l=o.length,c;st.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>e)&&(e=Math.max(s,e),r=ON(o,e,r),i=ON(o,e))}}}function yrn(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function ON(e,t,n){const r=(t<257?grn:t<65537?mrn:oA)(e);return n&&r.set(n),r}function lTe(e,t,n){const r=1<0)for(m=0;me,size:()=>n}}function brn(e,t){return e.sort.call(t,(n,r)=>{const i=e[n],o=e[r];return io?1:0}),OWt(e,t)}function xrn(e,t,n,r,i,o,s,a,l){let c=0,u=0,f;for(f=0;ct.modified(r.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,c;for(;a{const o=i.remove(t,n);for(const s in r)r[s].reindex(o)})},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,s=r.length;let a=0,l,c;for(n.filters=0,c=0;ch)for(m=h,v=Math.min(f,p);mp)for(m=Math.max(f,p),v=d;mf)for(p=f,g=Math.min(c,d);pd)for(p=Math.max(c,d),g=u;pa[u]&n?null:s[u];return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,u=>{const f=a[u]&n;return!f&&f^l[u]&n?s[u]:null}),o.filter(o.REM,u=>{const f=a[u]&n;return f&&!(f^(f^l[u]&n))?s[u]:null})):(o.filter(o.ADD,c),o.filter(o.REM,u=>(a[u]&n)===i?s[u]:null)),o.filter(o.SOURCE,u=>c(u._index))}});const wrn=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:Mhe,resolvefilter:Ahe},Symbol.toStringTag,{value:"Module"})),Srn="RawCode",Sw="Literal",_rn="Property",Crn="Identifier",Orn="ArrayExpression",Ern="BinaryExpression",$Xe="CallExpression",Trn="ConditionalExpression",Prn="LogicalExpression",krn="MemberExpression",Mrn="ObjectExpression",Arn="UnaryExpression";function Ah(e){this.type=e}Ah.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=Rrn(this),n=0,r=t.length;n";_g[_w]="Identifier";_g[Db]="Keyword";_g[KV]="Null";_g[_S]="Numeric";_g[yc]="Punctuator";_g[pL]="String";_g[Irn]="RegularExpression";var Drn="ArrayExpression",Lrn="BinaryExpression",Frn="CallExpression",$rn="ConditionalExpression",NXe="Identifier",Nrn="Literal",zrn="LogicalExpression",jrn="MemberExpression",Brn="ObjectExpression",Urn="Property",Vrn="UnaryExpression",ta="Unexpected token %0",Wrn="Unexpected number",Hrn="Unexpected string",Grn="Unexpected identifier",qrn="Unexpected reserved word",Xrn="Unexpected end of input",Bre="Invalid regular expression",Zq="Invalid regular expression: missing /",zXe="Octal literals are not allowed in strict mode.",Yrn="Duplicate data property in object literal not allowed in strict mode",Ra="ILLEGAL",wR="Disabled.",Qrn=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Krn=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function ZV(e,t){if(!e)throw new Error("ASSERT: "+t)}function Sm(e){return e>=48&&e<=57}function Rhe(e){return"0123456789abcdefABCDEF".includes(e)}function sA(e){return"01234567".includes(e)}function Zrn(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function SR(e){return e===10||e===13||e===8232||e===8233}function gL(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Qrn.test(String.fromCharCode(e))}function BB(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Krn.test(String.fromCharCode(e))}const Jrn={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function jXe(){for(;nt1114111||e!=="}")&&Xr({},ta,Ra),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function BXe(){var e,t;for(e=dn.charCodeAt(nt++),t=String.fromCharCode(e),e===92&&(dn.charCodeAt(nt)!==117&&Xr({},ta,Ra),++nt,e=Ure("u"),(!e||e==="\\"||!gL(e.charCodeAt(0)))&&Xr({},ta,Ra),t=e);nt>>=")return nt+=4,{type:yc,value:s,start:e,end:nt};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return nt+=3,{type:yc,value:o,start:e,end:nt};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".includes(r)||i==="=>")return nt+=2,{type:yc,value:i,start:e,end:nt};if(i==="//"&&Xr({},ta,Ra),"<>=!+-*%&|^/".includes(r))return++nt,{type:yc,value:r,start:e,end:nt};Xr({},ta,Ra)}function rin(e){let t="";for(;nt{if(parseInt(i,16)<=1114111)return"x";Xr({},Bre)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Xr({},Bre)}try{return new RegExp(e,t)}catch{return null}}function ain(){var e,t,n,r,i;for(e=dn[nt],ZV(e==="/","Regular expression literal must start with a slash"),t=dn[nt++],n=!1,r=!1;nt=0&&Xr({},Bre,n),{value:n,literal:t}}function cin(){var e,t,n,r;return Ei=null,jXe(),e=nt,t=ain(),n=lin(),r=sin(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:nt}}function uin(e){return e.type===_w||e.type===Db||e.type===QV||e.type===KV}function UXe(){if(jXe(),nt>=gl)return{type:hL,start:nt,end:nt};const e=dn.charCodeAt(nt);return gL(e)?nin():e===40||e===41||e===59?Jq():e===39||e===34?oin():e===46?Sm(dn.charCodeAt(nt+1))?uTe():Jq():Sm(e)?uTe():Jq()}function Ec(){const e=Ei;return nt=e.end,Ei=UXe(),nt=e.end,e}function VXe(){const e=nt;Ei=UXe(),nt=e}function fin(e){const t=new Ah(Drn);return t.elements=e,t}function fTe(e,t,n){const r=new Ah(e==="||"||e==="&&"?zrn:Lrn);return r.operator=e,r.left=t,r.right=n,r}function din(e,t){const n=new Ah(Frn);return n.callee=e,n.arguments=t,n}function hin(e,t,n){const r=new Ah($rn);return r.test=e,r.consequent=t,r.alternate=n,r}function Ihe(e){const t=new Ah(NXe);return t.name=e,t}function _M(e){const t=new Ah(Nrn);return t.value=e.value,t.raw=dn.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function dTe(e,t,n){const r=new Ah(jrn);return r.computed=e==="[",r.object=t,r.property=n,r.computed||(n.member=!0),r}function pin(e){const t=new Ah(Brn);return t.properties=e,t}function hTe(e,t,n){const r=new Ah(Urn);return r.key=t,r.value=n,r.kind=e,r}function gin(e,t){const n=new Ah(Vrn);return n.operator=e,n.argument=t,n.prefix=!0,n}function Xr(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(o,s)=>(ZV(s":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function Tin(){var e,t,n,r,i,o,s,a,l,c;if(e=Ei,l=n5(),r=Ei,i=mTe(r),i===0)return l;for(r.prec=i,Ec(),t=[e,Ei],s=n5(),o=[l,r,s];(i=mTe(Ei))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),t.pop(),n=fTe(a,l,s),o.push(n);r=Ec(),r.prec=i,o.push(r),t.push(Ei),n=n5(),o.push(n)}for(c=o.length-1,n=o[c],t.pop();c>1;)t.pop(),n=fTe(o[c-1].value,o[c-2],n),c-=2;return n}function Cw(){var e,t,n;return e=Tin(),ao("?")&&(Ec(),t=Cw(),ml(":"),n=Cw(),e=hin(e,t,n)),e}function Dhe(){const e=Cw();if(ao(","))throw new Error(wR);return e}function Lhe(e){dn=e,nt=0,gl=dn.length,Ei=null,VXe();const t=Dhe();if(Ei.type!==hL)throw new Error("Unexpect token after expression.");return t}var WXe={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function HXe(e){function t(s,a,l,c){let u=e(a[0]);return l&&(u=l+"("+u+")",l.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+s+(c<0?"":c===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,l){return c=>t(s,c,a,l)}const r="new Date",i="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&et("Missing arguments to clamp function."),s.length>3&&et("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),btoa:"btoa",atob:"atob",regexp:o,test:n("test",o),if:function(s){s.length<3&&et("Missing arguments to if function."),s.length>3&&et("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function Pin(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function GXe(e){e=e||{};const t=e.allowed?vh(e.allowed):{},n=e.forbidden?vh(e.forbidden):{},r=e.constants||WXe,i=(e.functions||HXe)(f),o=e.globalvar,s=e.fieldvar,a=ir(o)?o:p=>`${o}["${p}"]`;[...Object.getOwnPropertyNames(Object.prototype).filter(p=>typeof Object.prototype[p]=="function")];let l={},c={},u=0;function f(p){if(Kt(p))return p;const g=d[p.type];return g==null&&et("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:Yt(n,g)?et("Illegal identifier: "+g):Yt(r,g)?r[g]:Yt(t,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(u+=1);const v=f(p.property);return m===s&&(c[Pin(v)]=1),g&&(u-=1),m+(g?"."+v:"["+v+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&et("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,v=Yt(i,g)&&i[g];return v||et("Unrecognized function: "+g),ir(v)?v(m):v+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>{for(const g of p.properties){const m=g.key.name;W8e.has(m)&&et("Illegal property: "+m)}return"{"+p.properties.map(f).join(",")+"}"},Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},g}return h.functions=i,h.constants=r,h}const vTe=Symbol("vega_selection_getter");function qXe(e){return(!e.getter||!e.getter[vTe])&&(e.getter=Qf(e.field),e.getter[vTe]=!0),e.getter}const Fhe="intersect",yTe="union",kin="vlMulti",Min="vlPoint",bTe="or",Ain="and",cp="_vgsid_",_R=Qf(cp),Rin="E",Iin="R",Din="R-E",Lin="R-LE",Fin="R-RE",$in="E-LT",Nin="E-LTE",zin="E-GT",jin="E-GTE",Bin="E-VALID",Uin="E-ONE",UB="index:unit";function xTe(e,t){for(var n=t.fields,r=t.values,i=n.length,o=0,s,a;o=r[o])return!1}else if(a.type===Nin){if(s>r[o])return!1}else if(a.type===zin){if(s<=r[o])return!1}else if(a.type===jin){if(snr(t.fields?{values:t.fields.map(r=>qXe(r)(n.datum))}:{[cp]:_R(n.datum)},t))}function Xin(e,t,n,r){for(var i=this.context.data[e],o=i?i.values.value:[],s={},a={},l={},c,u,f,d,h,p,g,m,v,y,b=o.length,w=0,S,_;w(E[u[k].field]=T,E),{})))}else h=cp,p=_R(c),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[cp]:p}));if(t=t||yTe,s[cp]?s[cp]=tX[`${cp}_${t}`](...Object.values(s[cp])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map(T=>s[E][T]).reduce((T,k)=>T===void 0?k:tX[`${l[E]}_${t}`](T,k))}),o=Object.keys(a),n&&o.length){const E=r?Min:kin;s[E]=t===yTe?{[bTe]:o.reduce((T,k)=>(T.push(...a[k]),T),[])}:{[Ain]:o.map(T=>({[bTe]:a[T]}))}}return s}var tX={[`${cp}_union`]:DWt,[`${cp}_intersect`]:RWt,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;nt.includes(n)):t},R_union:function(e,t){var n=ul(t[0]),r=ul(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};const Yin=":",Qin="@";function $he(e,t,n,r){t[0].type!==Sw&&et("First argument to selection functions must be a string literal.");const i=t[0].value,o=t.length>=2&&Mr(t).value,s="unit",a=Qin+s,l=Yin+i;o===Fhe&&!Yt(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),Yt(r,l)||(r[l]=n.getData(i).tuplesRef())}function YXe(e){const t=this.context.data[e];return t?t.values.value:[]}function Kin(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i&&i.count}function Zin(e,t){const n=this.context.dataflow,r=this.context.data[e],i=r.input;return n.pulse(i,n.changeset().remove(Kf).insert(t)),1}function Jin(e,t,n){if(e){const r=this.context.dataflow,i=e.mark.source;r.pulse(i,r.changeset().encode(e,t))}return n!==void 0?n:e}const mL=e=>function(t,n){const r=this.context.dataflow.locale();return t===null?"null":r[e](n)(t)},eon=mL("format"),QXe=mL("timeFormat"),ton=mL("utcFormat"),non=mL("timeParse"),ron=mL("utcParse"),EN=new Date(2e3,0,1);function e8(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(EN.setYear(2e3),EN.setMonth(e),EN.setDate(t),QXe.call(this,EN,n))}function ion(e){return e8.call(this,e,1,"%B")}function oon(e){return e8.call(this,e,1,"%b")}function son(e){return e8.call(this,0,2+e,"%A")}function aon(e){return e8.call(this,0,2+e,"%a")}const lon=":",con="@",Vre="%",KXe="$";function Nhe(e,t,n,r){t[0].type!==Sw&&et("First argument to data functions must be a string literal.");const i=t[0].value,o=lon+i;if(!Yt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function uon(e,t,n,r){t[0].type!==Sw&&et("First argument to indata must be a string literal."),t[1].type!==Sw&&et("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,s=con+o;Yt(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function Gl(e,t,n,r){if(t[0].type===Sw)wTe(n,r,t[0].value);else for(e in n.scales)wTe(n,r,e)}function wTe(e,t,n){const r=Vre+n;if(!Yt(t,r))try{t[r]=e.scaleRef(n)}catch{}}function Cg(e,t){if(Kt(e)){const n=t.scales[e];return n&&COe(n.value)?n.value:void 0}else if(ir(e))return COe(e)?e:void 0}function fon(e,t,n){t.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Gl,n._range=Gl,n._scale=Gl;const r=i=>"_["+(i.type===Sw?Tt(Vre+i.value):Tt(Vre)+"+"+e(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${e(i[1])})`}}function zhe(e,t){return function(n,r,i){if(n){const o=Cg(n,(i||this).context);return o&&o.path[e](r)}else return t(r)}}const don=zhe("area",MZt),hon=zhe("bounds",DZt),pon=zhe("centroid",jZt);function gon(e,t){const n=Cg(e,(t||this).context);return n&&n.scale()}function mon(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function jhe(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(r){e.warn(r)}return n[n.length-1]}function von(){return jhe(this.context.dataflow,"warn",arguments)}function yon(){return jhe(this.context.dataflow,"info",arguments)}function bon(){return jhe(this.context.dataflow,"debug",arguments)}function nX(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Wre(e){const t=tb(e),n=nX(t.r),r=nX(t.g),i=nX(t.b);return .2126*n+.7152*r+.0722*i}function xon(e,t){const n=Wre(e),r=Wre(t),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function won(){const e=[].slice.call(arguments);return e.unshift({}),nr(...e)}function ZXe(e,t){return e===t||e!==e&&t!==t?!0:lt(e)?lt(t)&&e.length===t.length?Son(e,t):!1:Ht(e)&&Ht(t)?JXe(e,t):!1}function Son(e,t){for(let n=0,r=e.length;nJXe(e,t)}function _on(e,t,n,r,i,o){const s=this.context.dataflow,a=this.context.data[e],l=a.input,c=s.stamp();let u=a.changes,f,d;if(s._trigger===!1||!(l.value.length||t||r))return 0;if((!u||u.stamp{a.modified=!0,s.pulse(l,u).run()},!0,1)),n&&(f=n===!0?Kf:lt(n)||oV(n)?n:STe(n),u.remove(f)),t&&u.insert(t),r&&(f=STe(r),l.value.some(f)?u.remove(f):u.insert(r)),i)for(d in o)u.modify(i,d,o[d]);return 1}function Con(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function Oon(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const _Te={};function Eon(e,t){const n=_Te[t]||(_Te[t]=Qf(t));return lt(e)?e.map(n):n(e)}function t8(e){return lt(e)||ArrayBuffer.isView(e)?e:null}function Bhe(e){return t8(e)||(Kt(e)?e:null)}function Ton(e,...t){return t8(e).join(...t)}function Pon(e,...t){return Bhe(e).indexOf(...t)}function kon(e,...t){return Bhe(e).lastIndexOf(...t)}function Mon(e,...t){return Bhe(e).slice(...t)}function Aon(e,t,n){return ir(n)&&et("Function argument passed to replace."),!Kt(t)&&!mue(t)&&et("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function Ron(e){return t8(e).slice().reverse()}function Ion(e){return t8(e).slice().sort(zD)}function Don(e,t,n){return ede(e||0,t||0,n||0)}function Lon(e,t){const n=Cg(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function Fon(e,t){const n=Cg(e,(t||this).context);return n?n.copy():void 0}function $on(e,t){const n=Cg(e,(t||this).context);return n?n.domain():[]}function Non(e,t,n){const r=Cg(e,(n||this).context);return r?lt(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}function zon(e,t){const n=Cg(e,(t||this).context);return n&&n.range?n.range():[]}function jon(e,t,n){const r=Cg(e,(n||this).context);return r?r(t):void 0}function Bon(e,t,n,r,i){e=Cg(e,(i||this).context);const o=W9e(t,n);let s=e.domain(),a=s[0],l=Mr(s),c=vl;return l-a?c=R9e(e,a,l):e=(e.interpolator?Zr("sequential")().interpolator(e.interpolator()):Zr("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,l=1]),e.ticks&&(s=e.ticks(+r||15),a!==s[0]&&s.unshift(a),l!==Mr(s)&&s.push(l)),s.forEach(u=>o.stop(c(u),e(u))),o}function Uon(e,t,n){const r=Cg(e,(n||this).context);return function(i){return r?r.path.context(i)(t):""}}function Von(e){let t=null;return function(n){return n?hR(n,t=t||hE(e)):e}}const eYe=e=>e.data;function tYe(e,t){const n=YXe.call(t,e);return n.root&&n.root.lookup||{}}function Won(e,t,n){const r=tYe(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(eYe):void 0}function Hon(e,t){const n=tYe(e,this)[t];return n?n.ancestors().map(eYe):void 0}const nYe=()=>typeof window<"u"&&window||null;function Gon(){const e=nYe();return e?e.screen:{}}function qon(){const e=nYe();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Xon(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function rYe(e,t,n){if(!e)return[];const[r,i]=e,o=new xs().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return j7e(s,o,Yon(t))}function Yon(e){let t=null;if(e){const n=Vt(e.marktype),r=Vt(e.markname);t=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return t}function Qon(e,t,n,r=5){e=Vt(e);const i=e[e.length-1];return i===void 0||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e}function Kon(e){return Vt(e).reduce((t,[n,r],i)=>t+=i==0?`M ${n},${r} `:i===e.length-1?" Z":`L ${n},${r} `,"")}function Zon(e,t,n){const{x:r,y:i,mark:o}=n,s=new xs().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,c]of t)ls.x2&&(s.x2=l),cs.y2&&(s.y2=c);return s.translate(r,i),rYe([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(l=>Jon(l.x,l.y,t))}function Jon(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=a>t&&e<(s-l)*(t-c)/(a-c)+l&&r++}return r&1}const CR={random(){return Jf()},cumulativeNormal:uV,cumulativeLogNormal:Wue,cumulativeUniform:Xue,densityNormal:zue,densityLogNormal:Vue,densityUniform:que,quantileNormal:fV,quantileLogNormal:Hue,quantileUniform:Yue,sampleNormal:cV,sampleLogNormal:Uue,sampleUniform:Gue,isArray:lt,isBoolean:vS,isDate:D0,isDefined(e){return e!==void 0},isNumber:Qr,isObject:Ht,isRegExp:mue,isString:Kt,isTuple:oV,isValid(e){return e!=null&&e===e},toBoolean:yue,toDate(e){return bue(e)},toNumber:ul,toString:xue,indexof:Pon,join:Ton,lastindexof:kon,replace:Aon,reverse:Ron,sort:Ion,slice:Mon,flush:sWe,lerp:lWe,merge:won,pad:fWe,peek:Mr,pluck:Eon,span:jD,inrange:VC,truncate:dWe,rgb:tb,lab:qj,hcl:Xj,hsl:Hj,luminance:Wre,contrast:xon,sequence:Tc,format:eon,utcFormat:ton,utcParse:ron,utcOffset:HWe,utcSequence:XWe,timeFormat:QXe,timeParse:non,timeOffset:WWe,timeSequence:qWe,timeUnitSpecifier:IWe,monthFormat:ion,monthAbbrevFormat:oon,dayFormat:son,dayAbbrevFormat:aon,quarter:nWe,utcquarter:rWe,week:LWe,utcweek:NWe,dayofyear:DWe,utcdayofyear:$We,warn:von,info:yon,debug:bon,extent(e){return tg(e)},inScope:mon,intersect:rYe,clampRange:iWe,pinchDistance:Con,pinchAngle:Oon,screen:Gon,containerSize:Xon,windowSize:qon,bandspace:Don,setdata:Zin,pathShape:Von,panLinear:Z8e,panLog:J8e,panPow:eWe,panSymlog:tWe,zoomLinear:fue,zoomLog:due,zoomPow:Mj,zoomSymlog:hue,encode:Jin,modify:_on,lassoAppend:Qon,lassoPath:Kon,intersectLasso:Zon},esn=["view","item","group","xy","x","y"],tsn="event.vega.",iYe="this.",Uhe={},oYe={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Tt(KXe+e)}]`,functions:nsn,constants:WXe,visitors:Uhe},Hre=GXe(oYe);function nsn(e){const t=HXe(e);esn.forEach(n=>t[n]=tsn+n);for(const n in CR)t[n]=iYe+n;return nr(t,fon(e,CR,Uhe)),t}function os(e,t,n){return arguments.length===1?CR[e]:(CR[e]=t,n&&(Uhe[e]=n),Hre&&(Hre.functions[e]=iYe+e),this)}os("bandwidth",Lon,Gl);os("copy",Fon,Gl);os("domain",$on,Gl);os("range",zon,Gl);os("invert",Non,Gl);os("scale",jon,Gl);os("gradient",Bon,Gl);os("geoArea",don,Gl);os("geoBounds",hon,Gl);os("geoCentroid",pon,Gl);os("geoShape",Uon,Gl);os("geoScale",gon,Gl);os("indata",Kin,uon);os("data",YXe,Nhe);os("treePath",Won,Nhe);os("treeAncestors",Hon,Nhe);os("vlSelectionTest",Vin,$he);os("vlSelectionIdTest",Gin,$he);os("vlSelectionResolve",Xin,$he);os("vlSelectionTuples",qin);function sg(e,t){const n={};let r;try{e=Kt(e)?e:Tt(e)+"",r=Lhe(e)}catch{et("Expression parse error: "+e)}r.visit(o=>{if(o.type!==$Xe)return;const s=o.callee.name,a=oYe.visitors[s];a&&a(s,o.arguments,t,n)});const i=Hre(r);return i.globals.forEach(o=>{const s=KXe+o;!Yt(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:nr({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function rsn(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(r=>t.parseOperator(r)),n.forEach(r=>t.parseOperatorParameters(r)),(e.streams||[]).forEach(r=>t.parseStream(r)),(e.updates||[]).forEach(r=>t.parseUpdate(r)),t.resolve()}const isn=vh(["rule"]),CTe=vh(["group","image","rect"]);function osn(e,t){let n="";return isn[t]||(e.x2&&(e.x?(CTe[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(CTe[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function Vhe(e){return(e+"").toLowerCase()}function ssn(e){return Vhe(e)==="operator"}function asn(e){return Vhe(e)==="collect"}function e2(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}function lsn(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} +`)}function c(f){return f.map(u).join(e)}function u(f){return f==null?"":f instanceof Date?tUt(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:s,formatBody:a,formatRows:l,formatRow:c,formatValue:u}}function rUt(e){return e}function iUt(e){if(e==null)return rUt;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var c=2,u=a.length,f=new Array(u);for(f[0]=(t+=a[0])*r+o,f[1]=(n+=a[1])*i+s;c1)r=uUt(e,t,n);else for(i=0,r=new Array(o=e.arcs.length);it?1:e>=t?0:NaN}function fUt(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function BT(e){let t,n,r;e.length!==2?(t=Up,n=(a,l)=>Up(e(a),l),r=(a,l)=>e(a)-l):(t=e===Up||e===fUt?e:dUt,n=e,r=e);function i(a,l,c=0,u=a.length){if(c>>1;n(a[f],l)<0?c=f+1:u=f}while(c>>1;n(a[f],l)<=0?c=f+1:u=f}while(cc&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function dUt(){return 0}function eVe(e){return e===null?NaN:+e}function*hUt(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const tVe=BT(Up),lv=tVe.right,pUt=tVe.left;BT(eVe).center;function gUt(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function mUt(e,t){const n=gUt(e,t);return n&&Math.sqrt(n)}class Wl{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}class bSe extends Map{constructor(t,n=iVe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(fte(this,t))}has(t){return super.has(fte(this,t))}set(t,n){return super.set(nVe(this,t),n)}delete(t){return super.delete(rVe(this,t))}}class oj extends Set{constructor(t,n=iVe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const r of t)this.add(r)}has(t){return super.has(fte(this,t))}add(t){return super.add(nVe(this,t))}delete(t){return super.delete(rVe(this,t))}}function fte({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function nVe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function rVe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function iVe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function vUt(e,t){return Array.from(t,n=>e[n])}function yUt(e=Up){if(e===Up)return oVe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function oVe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const bUt=Math.sqrt(50),xUt=Math.sqrt(10),wUt=Math.sqrt(2);function sj(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=bUt?10:o>=xUt?5:o>=wUt?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/ct&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*ct&&--l),l0))return[];if(e===t)return[e];const r=t=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function pte(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function sVe(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?oVe:yUt(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(t-c*f/l+d)),p=Math.min(r,Math.floor(t+(l-c)*f/l+d));sVe(e,t,h,p,i)}const o=e[t];let s=n,a=r;for(Dk(e,n,t),i(e[r],o)>0&&Dk(e,n,r);s0;)--a}i(e[n],o)===0?Dk(e,n,a):(++a,Dk(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Dk(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function aj(e,t,n){if(e=Float64Array.from(hUt(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return pte(e);if(t>=1)return P1(e);var r,i=(r-1)*t,o=Math.floor(i),s=P1(sVe(e,o).subarray(0,o+1)),a=pte(e.subarray(o+1));return s+(a-s)*(i-o)}}function aVe(e,t,n=eVe){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function SUt(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function lVe(e,t){return aj(e,.5,t)}function*_Ut(e){for(const t of e)yield*t}function cVe(e){return Array.from(_Ut(e))}function Oc(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lj(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function qO(e){return e=lj(Math.abs(e)),e?e[1]:NaN}function PUt(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function kUt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var MUt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sw(e){if(!(t=MUt.exec(e)))throw new Error("invalid format: "+e);var t;return new oce({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}sw.prototype=oce.prototype;function oce(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}oce.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function AUt(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var cj;function RUt(e,t){var n=lj(e,t);if(!n)return cj=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(cj=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+lj(e,Math.max(0,t+o-1))[0]}function xSe(e,t){var n=lj(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const wSe={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:TUt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>xSe(e*100,t),r:xSe,s:RUt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function SSe(e){return e}var _Se=Array.prototype.map,CSe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fVe(e){var t=e.grouping===void 0||e.thousands===void 0?SSe:PUt(_Se.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?SSe:kUt(_Se.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f,d){f=sw(f);var h=f.fill,p=f.align,g=f.sign,m=f.symbol,v=f.zero,y=f.width,b=f.comma,w=f.precision,S=f.trim,_=f.type;_==="n"?(b=!0,_="g"):wSe[_]||(w===void 0&&(w=12),S=!0,_="g"),(v||h==="0"&&p==="=")&&(v=!0,h="0",p="=");var E=(d&&d.prefix!==void 0?d.prefix:"")+(m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),T=(m==="$"?r:/[%p]/.test(_)?s:"")+(d&&d.suffix!==void 0?d.suffix:""),k=wSe[_],P=/[defgprs%]/.test(_);w=w===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function I(R){var F=E,A=T,L,$,j;if(_==="c")A=k(R)+A,R="";else{R=+R;var V=R<0||1/R<0;if(R=isNaN(R)?l:k(Math.abs(R),w),S&&(R=AUt(R)),V&&+R==0&&g!=="+"&&(V=!1),F=(V?g==="("?g:a:g==="-"||g==="("?"":g)+F,A=(_==="s"&&!isNaN(R)&&cj!==void 0?CSe[8+cj/3]:"")+A+(V&&g==="("?")":""),P){for(L=-1,$=R.length;++L<$;)if(j=R.charCodeAt(L),48>j||j>57){A=(j===46?i+R.slice(L+1):R.slice(L))+A,R=R.slice(0,L);break}}}b&&!v&&(R=t(R,1/0));var U=F.length+R.length+A.length,z=U>1)+F+R+A+z.slice(U);break;default:R=z+F+R+A;break}return o(R)}return I.toString=function(){return f+""},I}function u(f,d){var h=Math.max(-8,Math.min(8,Math.floor(qO(d)/3)))*3,p=Math.pow(10,-h),g=c((f=sw(f),f.type="f",f),{suffix:CSe[8+h/3]});return function(m){return g(p*m)}}return{format:c,formatPrefix:u}}var B$,CU,sce;IUt({thousands:",",grouping:[3],currency:["$",""]});function IUt(e){return B$=fVe(e),CU=B$.format,sce=B$.formatPrefix,B$}function dVe(e){return Math.max(0,-qO(Math.abs(e)))}function hVe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(qO(t)/3)))*3-qO(Math.abs(e)))}function pVe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,qO(t)-qO(e))+1}const W9=new Date,H9=new Date;function zs(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),t(o,a),e(o);while(czs(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(W9.setTime(+o),H9.setTime(+s),e(W9),e(H9),Math.floor(n(W9,H9))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const XO=zs(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);XO.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?zs(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):XO);XO.range;const Mm=1e3,Of=Mm*60,Am=Of*60,cv=Am*24,ace=cv*7,OSe=cv*30,G9=cv*365,Rm=zs(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Mm)},(e,t)=>(t-e)/Mm,e=>e.getUTCSeconds());Rm.range;const OU=zs(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Mm)},(e,t)=>{e.setTime(+e+t*Of)},(e,t)=>(t-e)/Of,e=>e.getMinutes());OU.range;const EU=zs(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Of)},(e,t)=>(t-e)/Of,e=>e.getUTCMinutes());EU.range;const TU=zs(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Mm-e.getMinutes()*Of)},(e,t)=>{e.setTime(+e+t*Am)},(e,t)=>(t-e)/Am,e=>e.getHours());TU.range;const PU=zs(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Am)},(e,t)=>(t-e)/Am,e=>e.getUTCHours());PU.range;const Vm=zs(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Of)/cv,e=>e.getDate()-1);Vm.range;const k0=zs(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/cv,e=>e.getUTCDate()-1);k0.range;const gVe=zs(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/cv,e=>Math.floor(e/cv));gVe.range;function uS(e){return zs(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Of)/ace)}const UT=uS(0),uj=uS(1),DUt=uS(2),LUt=uS(3),YO=uS(4),FUt=uS(5),$Ut=uS(6);UT.range;uj.range;DUt.range;LUt.range;YO.range;FUt.range;$Ut.range;function fS(e){return zs(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/ace)}const VT=fS(0),fj=fS(1),NUt=fS(2),zUt=fS(3),QO=fS(4),jUt=fS(5),BUt=fS(6);VT.range;fj.range;NUt.range;zUt.range;QO.range;jUt.range;BUt.range;const GA=zs(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());GA.range;const qA=zs(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());qA.range;const tg=zs(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());tg.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zs(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});tg.range;const ng=zs(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ng.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zs(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ng.range;function mVe(e,t,n,r,i,o){const s=[[Rm,1,Mm],[Rm,5,5*Mm],[Rm,15,15*Mm],[Rm,30,30*Mm],[o,1,Of],[o,5,5*Of],[o,15,15*Of],[o,30,30*Of],[i,1,Am],[i,3,3*Am],[i,6,6*Am],[i,12,12*Am],[r,1,cv],[r,2,2*cv],[n,1,ace],[t,1,OSe],[t,3,3*OSe],[e,1,G9]];function a(c,u,f){const d=um).right(s,d);if(h===s.length)return e.every(H0(c/G9,u/G9,f));if(h===0)return XO.every(Math.max(H0(c,u,f),1));const[p,g]=s[d/s[h-1][2](e[t]=1+n,e),{});function cce(e){const t=Ht(e).slice(),n={};return t.length||et("Missing time unit."),t.forEach(i=>{Qt(q9,i)?n[i]=1:et(`Invalid time unit: ${i}.`)}),(n[Ds]||n[ll]?1:0)+(n[$c]||n[hl]||n[Nc]?1:0)+(n[rg]?1:0)>1&&et(`Incompatible time units: ${e}`),t.sort((i,o)=>q9[i]-q9[o]),t}const GUt={[La]:"%Y ",[$c]:"Q%q ",[hl]:"%b ",[Nc]:"%d ",[Ds]:"W%U ",[ll]:"%a ",[rg]:"%j ",[ju]:"%H:00",[Bu]:"00:%M",[Kf]:":%S",[vh]:".%L",[`${La}-${hl}`]:"%Y-%m ",[`${La}-${hl}-${Nc}`]:"%Y-%m-%d ",[`${ju}-${Bu}`]:"%H:%M"};function vVe(e,t){const n=rr({},GUt,t),r=cce(e),i=r.length;let o="",s=0,a,l;for(s=0;ss;--a)if(l=r.slice(s,a).join("-"),n[l]!=null){o+=n[l],s=a;break}return o.trim()}const Gx=new Date;function uce(e){return Gx.setFullYear(e),Gx.setMonth(0),Gx.setDate(1),Gx.setHours(0,0,0,0),Gx}function yVe(e){return xVe(new Date(e))}function bVe(e){return gte(new Date(e))}function xVe(e){return Vm.count(uce(e.getFullYear())-1,e)}function gte(e){return UT.count(uce(e.getFullYear())-1,e)}function mte(e){return uce(e).getDay()}function qUt(e,t,n,r,i,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,r,i,o,s);return a.setFullYear(e),a}return new Date(e,t,n,r,i,o,s)}function wVe(e){return _Ve(new Date(e))}function SVe(e){return vte(new Date(e))}function _Ve(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return k0.count(t-1,e)}function vte(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return VT.count(t-1,e)}function yte(e){return Gx.setTime(Date.UTC(e,0,1)),Gx.getUTCDay()}function XUt(e,t,n,r,i,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,r,i,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,r,i,o,s))}function CVe(e,t,n,r,i){const o=t||1,s=Ar(e),a=(v,y,b)=>(b=b||v,YUt(n[b],r[b],v===s&&o,y)),l=new Date,c=mh(e),u=c[La]?a(La):vl(2012),f=c[hl]?a(hl):c[$c]?a($c):t0,d=c[Ds]&&c[ll]?a(ll,1,Ds+ll):c[Ds]?a(Ds,1):c[ll]?a(ll,1):c[Nc]?a(Nc,1):c[rg]?a(rg,1):FT,h=c[ju]?a(ju):t0,p=c[Bu]?a(Bu):t0,g=c[Kf]?a(Kf):t0,m=c[vh]?a(vh):t0;return function(v){l.setTime(+v);const y=u(l);return i(y,f(l),d(l,y),h(l),p(l),g(l),m(l))}}function YUt(e,t,n,r){const i=n<=1?e:r?(o,s)=>r+n*Math.floor((e(o,s)-r)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(i(o,s),s):i}function KO(e,t,n){return t+e*7-(n+6)%7}const QUt={[La]:e=>e.getFullYear(),[$c]:e=>Math.floor(e.getMonth()/3),[hl]:e=>e.getMonth(),[Nc]:e=>e.getDate(),[ju]:e=>e.getHours(),[Bu]:e=>e.getMinutes(),[Kf]:e=>e.getSeconds(),[vh]:e=>e.getMilliseconds(),[rg]:e=>xVe(e),[Ds]:e=>gte(e),[Ds+ll]:(e,t)=>KO(gte(e),e.getDay(),mte(t)),[ll]:(e,t)=>KO(1,e.getDay(),mte(t))},KUt={[$c]:e=>3*e,[Ds]:(e,t)=>KO(e,0,mte(t))};function OVe(e,t){return CVe(e,t||1,QUt,KUt,qUt)}const ZUt={[La]:e=>e.getUTCFullYear(),[$c]:e=>Math.floor(e.getUTCMonth()/3),[hl]:e=>e.getUTCMonth(),[Nc]:e=>e.getUTCDate(),[ju]:e=>e.getUTCHours(),[Bu]:e=>e.getUTCMinutes(),[Kf]:e=>e.getUTCSeconds(),[vh]:e=>e.getUTCMilliseconds(),[rg]:e=>_Ve(e),[Ds]:e=>vte(e),[ll]:(e,t)=>KO(1,e.getUTCDay(),yte(t)),[Ds+ll]:(e,t)=>KO(vte(e),e.getUTCDay(),yte(t))},JUt={[$c]:e=>3*e,[Ds]:(e,t)=>KO(e,0,yte(t))};function EVe(e,t){return CVe(e,t||1,ZUt,JUt,XUt)}const eVt={[La]:tg,[$c]:GA.every(3),[hl]:GA,[Ds]:UT,[Nc]:Vm,[ll]:Vm,[rg]:Vm,[ju]:TU,[Bu]:OU,[Kf]:Rm,[vh]:XO},tVt={[La]:ng,[$c]:qA.every(3),[hl]:qA,[Ds]:VT,[Nc]:k0,[ll]:k0,[rg]:k0,[ju]:PU,[Bu]:EU,[Kf]:Rm,[vh]:XO};function WT(e){return eVt[e]}function HT(e){return tVt[e]}function TVe(e,t,n){return e?e.offset(t,n):void 0}function PVe(e,t,n){return TVe(WT(e),t,n)}function kVe(e,t,n){return TVe(HT(e),t,n)}function MVe(e,t,n,r){return e?e.range(t,n,r):void 0}function AVe(e,t,n,r){return MVe(WT(e),t,n,r)}function RVe(e,t,n,r){return MVe(HT(e),t,n,r)}const X2=1e3,Y2=X2*60,Q2=Y2*60,kU=Q2*24,nVt=kU*7,ESe=kU*30,bte=kU*365,IVe=[La,hl,Nc,ju,Bu,Kf,vh],K2=IVe.slice(0,-1),Z2=K2.slice(0,-1),J2=Z2.slice(0,-1),rVt=J2.slice(0,-1),iVt=[La,Ds],TSe=[La,hl],DVe=[La],Lk=[[K2,1,X2],[K2,5,5*X2],[K2,15,15*X2],[K2,30,30*X2],[Z2,1,Y2],[Z2,5,5*Y2],[Z2,15,15*Y2],[Z2,30,30*Y2],[J2,1,Q2],[J2,3,3*Q2],[J2,6,6*Q2],[J2,12,12*Q2],[rVt,1,kU],[iVt,1,nVt],[TSe,1,ESe],[TSe,3,3*ESe],[DVe,1,bte]];function LVe(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(PD(t))/n;let i=BT(a=>a[2]).right(Lk,r),o,s;return i===Lk.length?(o=DVe,s=H0(t[0]/bte,t[1]/bte,n)):i?(i=Lk[r/Lk[i-1][2]53)return null;"w"in se||(se.w=1),"Z"in se?(G=Y9(Fk(se.y,0,1)),ce=G.getUTCDay(),G=ce>4||ce===0?fj.ceil(G):fj(G),G=k0.offset(G,(se.V-1)*7),se.y=G.getUTCFullYear(),se.m=G.getUTCMonth(),se.d=G.getUTCDate()+(se.w+6)%7):(G=X9(Fk(se.y,0,1)),ce=G.getDay(),G=ce>4||ce===0?uj.ceil(G):uj(G),G=Vm.offset(G,(se.V-1)*7),se.y=G.getFullYear(),se.m=G.getMonth(),se.d=G.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),ce="Z"in se?Y9(Fk(se.y,0,1)).getUTCDay():X9(Fk(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(ce+5)%7:se.w+se.U*7-(ce+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,Y9(se)):X9(se)}}function T(ie,fe,ve,se){for(var ue=0,G=fe.length,ce=ve.length,pe,J;ue=ce)return-1;if(pe=fe.charCodeAt(ue++),pe===37){if(pe=fe.charAt(ue++),J=S[pe in PSe?fe.charAt(ue++):pe],!J||(se=J(ie,ve,se))<0)return-1}else if(pe!=ve.charCodeAt(se++))return-1}return se}function k(ie,fe,ve){var se=c.exec(fe.slice(ve));return se?(ie.p=u.get(se[0].toLowerCase()),ve+se[0].length):-1}function P(ie,fe,ve){var se=h.exec(fe.slice(ve));return se?(ie.w=p.get(se[0].toLowerCase()),ve+se[0].length):-1}function I(ie,fe,ve){var se=f.exec(fe.slice(ve));return se?(ie.w=d.get(se[0].toLowerCase()),ve+se[0].length):-1}function R(ie,fe,ve){var se=v.exec(fe.slice(ve));return se?(ie.m=y.get(se[0].toLowerCase()),ve+se[0].length):-1}function F(ie,fe,ve){var se=g.exec(fe.slice(ve));return se?(ie.m=m.get(se[0].toLowerCase()),ve+se[0].length):-1}function A(ie,fe,ve){return T(ie,t,fe,ve)}function L(ie,fe,ve){return T(ie,n,fe,ve)}function $(ie,fe,ve){return T(ie,r,fe,ve)}function j(ie){return s[ie.getDay()]}function V(ie){return o[ie.getDay()]}function U(ie){return l[ie.getMonth()]}function z(ie){return a[ie.getMonth()]}function N(ie){return i[+(ie.getHours()>=12)]}function B(ie){return 1+~~(ie.getMonth()/3)}function H(ie){return s[ie.getUTCDay()]}function Q(ie){return o[ie.getUTCDay()]}function Y(ie){return l[ie.getUTCMonth()]}function Z(ie){return a[ie.getUTCMonth()]}function ge(ie){return i[+(ie.getUTCHours()>=12)]}function ne(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var fe=_(ie+="",b);return fe.toString=function(){return ie},fe},parse:function(ie){var fe=E(ie+="",!1);return fe.toString=function(){return ie},fe},utcFormat:function(ie){var fe=_(ie+="",w);return fe.toString=function(){return ie},fe},utcParse:function(ie){var fe=E(ie+="",!0);return fe.toString=function(){return ie},fe}}}var PSe={"-":"",_:" ",0:"0"},da=/^\s*\d+/,oVt=/^%/,sVt=/[\\^$*+?|[\]().{}]/g;function Kr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function lVt(e,t,n){var r=da.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function cVt(e,t,n){var r=da.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function uVt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function fVt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function dVt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function kSe(e,t,n){var r=da.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function MSe(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function hVt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function pVt(e,t,n){var r=da.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function gVt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ASe(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function mVt(e,t,n){var r=da.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function RSe(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function vVt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yVt(e,t,n){var r=da.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function bVt(e,t,n){var r=da.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function xVt(e,t,n){var r=da.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function wVt(e,t,n){var r=oVt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function SVt(e,t,n){var r=da.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function _Vt(e,t,n){var r=da.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ISe(e,t){return Kr(e.getDate(),t,2)}function CVt(e,t){return Kr(e.getHours(),t,2)}function OVt(e,t){return Kr(e.getHours()%12||12,t,2)}function EVt(e,t){return Kr(1+Vm.count(tg(e),e),t,3)}function $Ve(e,t){return Kr(e.getMilliseconds(),t,3)}function TVt(e,t){return $Ve(e,t)+"000"}function PVt(e,t){return Kr(e.getMonth()+1,t,2)}function kVt(e,t){return Kr(e.getMinutes(),t,2)}function MVt(e,t){return Kr(e.getSeconds(),t,2)}function AVt(e){var t=e.getDay();return t===0?7:t}function RVt(e,t){return Kr(UT.count(tg(e)-1,e),t,2)}function NVe(e){var t=e.getDay();return t>=4||t===0?YO(e):YO.ceil(e)}function IVt(e,t){return e=NVe(e),Kr(YO.count(tg(e),e)+(tg(e).getDay()===4),t,2)}function DVt(e){return e.getDay()}function LVt(e,t){return Kr(uj.count(tg(e)-1,e),t,2)}function FVt(e,t){return Kr(e.getFullYear()%100,t,2)}function $Vt(e,t){return e=NVe(e),Kr(e.getFullYear()%100,t,2)}function NVt(e,t){return Kr(e.getFullYear()%1e4,t,4)}function zVt(e,t){var n=e.getDay();return e=n>=4||n===0?YO(e):YO.ceil(e),Kr(e.getFullYear()%1e4,t,4)}function jVt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Kr(t/60|0,"0",2)+Kr(t%60,"0",2)}function DSe(e,t){return Kr(e.getUTCDate(),t,2)}function BVt(e,t){return Kr(e.getUTCHours(),t,2)}function UVt(e,t){return Kr(e.getUTCHours()%12||12,t,2)}function VVt(e,t){return Kr(1+k0.count(ng(e),e),t,3)}function zVe(e,t){return Kr(e.getUTCMilliseconds(),t,3)}function WVt(e,t){return zVe(e,t)+"000"}function HVt(e,t){return Kr(e.getUTCMonth()+1,t,2)}function GVt(e,t){return Kr(e.getUTCMinutes(),t,2)}function qVt(e,t){return Kr(e.getUTCSeconds(),t,2)}function XVt(e){var t=e.getUTCDay();return t===0?7:t}function YVt(e,t){return Kr(VT.count(ng(e)-1,e),t,2)}function jVe(e){var t=e.getUTCDay();return t>=4||t===0?QO(e):QO.ceil(e)}function QVt(e,t){return e=jVe(e),Kr(QO.count(ng(e),e)+(ng(e).getUTCDay()===4),t,2)}function KVt(e){return e.getUTCDay()}function ZVt(e,t){return Kr(fj.count(ng(e)-1,e),t,2)}function JVt(e,t){return Kr(e.getUTCFullYear()%100,t,2)}function e8t(e,t){return e=jVe(e),Kr(e.getUTCFullYear()%100,t,2)}function t8t(e,t){return Kr(e.getUTCFullYear()%1e4,t,4)}function n8t(e,t){var n=e.getUTCDay();return e=n>=4||n===0?QO(e):QO.ceil(e),Kr(e.getUTCFullYear()%1e4,t,4)}function r8t(){return"+0000"}function LSe(){return"%"}function FSe(e){return+e}function $Se(e){return Math.floor(+e/1e3)}var w_,fce,BVe,dce,UVe;i8t({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function i8t(e){return w_=FVe(e),fce=w_.format,BVe=w_.parse,dce=w_.utcFormat,UVe=w_.utcParse,w_}function eM(e){const t={};return n=>t[n]||(t[n]=e(n))}function o8t(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=s8t(r,i);const s=oi;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+s}}function s8t(e,t){let n=e.lastIndexOf("e"),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function VVe(e){const t=eM(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(r){const i=sw(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return o8t(t(i),t(".1f")(1)[1])}else return t(i)},formatSpan(r,i,o,s){s=sw(s??",f");const a=H0(r,i,o),l=Math.max(Math.abs(r),Math.abs(i));let c;if(s.precision==null)switch(s.type){case"s":return isNaN(c=hVe(a,l))||(s.precision=c),n(s,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=pVe(a,l))||(s.precision=c-(s.type==="e"));break}case"f":case"%":{isNaN(c=dVe(a))||(s.precision=c-(s.type==="%")*2);break}}return t(s)}}}let xte;WVe();function WVe(){return xte=VVe({format:CU,formatPrefix:sce})}function HVe(e){return VVe(fVe(e))}function dj(e){return arguments.length?xte=HVe(e):xte}function NSe(e,t,n){n=n||{},Bt(n)||et(`Invalid time multi-format specifier: ${n}`);const r=t(Kf),i=t(Bu),o=t(ju),s=t(Nc),a=t(Ds),l=t(hl),c=t($c),u=t(La),f=e(n[vh]||".%L"),d=e(n[Kf]||":%S"),h=e(n[Bu]||"%I:%M"),p=e(n[ju]||"%I %p"),g=e(n[Nc]||n[ll]||"%a %d"),m=e(n[Ds]||"%b %d"),v=e(n[hl]||"%B"),y=e(n[$c]||"%B"),b=e(n[La]||"%Y");return w=>(r(w)Ut(r)?t(r):NSe(t,WT,r),utcFormat:r=>Ut(r)?n(r):NSe(n,HT,r),timeParse:eM(e.parse),utcParse:eM(e.utcParse)}}let wte;qVe();function qVe(){return wte=GVe({format:fce,parse:BVe,utcFormat:dce,utcParse:UVe})}function XVe(e){return GVe(FVe(e))}function XA(e){return arguments.length?wte=XVe(e):wte}const Ste=(e,t)=>rr({},e,t);function YVe(e,t){const n=e?HVe(e):dj(),r=t?XVe(t):XA();return Ste(n,r)}function hce(e,t){const n=arguments.length;return n&&n!==2&&et("defaultLocale expects either zero or two arguments."),n?Ste(dj(e),XA(t)):Ste(dj(),XA())}function a8t(){return WVe(),qVe(),hce()}const l8t=/^(data:|([A-Za-z]+:)?\/\/)/,c8t=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,u8t=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,zSe="file://";function f8t(e){return t=>({options:t||{},sanitize:h8t,load:d8t,fileAccess:!1,file:p8t(),http:m8t})}async function d8t(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t?.http)}async function h8t(e,t){t=rr({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,s;const a=c8t.test(e.replace(u8t,""));(e==null||typeof e!="string"||!a)&&et("Sanitize failure, invalid URI: "+Tt(e));const l=l8t.test(e);return(s=t.baseURL)&&!l&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(i=e.startsWith(zSe))||t.mode==="file"||t.mode!=="http"&&!l&&n,i?e=e.slice(zSe.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function p8t(e){return g8t}async function g8t(){et("No file system access.")}async function m8t(e,t){const n=rr({},this.options.http,t),r=t&&t.response,i=await fetch(e,n);return i.ok?Jn(i[r])?i[r]():i.text():et(i.status+""+i.statusText)}const v8t=e=>e!=null&&e===e,y8t=e=>e==="true"||e==="false"||e===!0||e===!1,b8t=e=>!Number.isNaN(Date.parse(e)),QVe=e=>!Number.isNaN(+e)&&!(e instanceof Date),x8t=e=>QVe(e)&&Number.isInteger(+e),_te={boolean:nce,integer:cl,number:cl,date:rce,string:ice,unknown:ml},U$=[y8t,x8t,QVe,b8t],w8t=["boolean","integer","number","date"];function KVe(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=U$.length,i=U$.map((o,s)=>s+1);for(let o=0,s=0,a,l;oo===0?s:o,0)-1]}function ZVe(e,t){return t.reduce((n,r)=>(n[r]=KVe(e,r),n),{})}function jSe(e){const t=function(n,r){const i={delimiter:e};return pce(n,r?rr(r,i):i)};return t.responseType="text",t}function pce(e,t){return t.header&&(e=t.header.map(Tt).join(t.delimiter)+` +`+e),nUt(t.delimiter).parse(e+"")}pce.responseType="text";function S8t(e){return typeof Buffer=="function"&&Jn(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function gce(e,t){const n=t&&t.property?Yf(t.property):ml;return Bt(e)&&!S8t(e)?_8t(n(e),t):n(JSON.parse(e))}gce.responseType="json";function _8t(e,t){return!it(e)&&GUe(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const C8t={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function JVe(e,t){let n,r,i,o;return e=gce(e,t),t&&t.feature?(n=sUt,i=t.feature):t&&t.mesh?(n=lUt,i=t.mesh,o=C8t[t.filter]):et("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):et("Invalid TopoJSON object: "+i),r&&r.features||[r]}JVe.responseType="json";const vz={dsv:pce,csv:jSe(","),tsv:jSe(" "),json:gce,topojson:JVe};function mce(e,t){return arguments.length>1?(vz[e]=t,this):Qt(vz,e)?vz[e]:null}function e8e(e){const t=mce(e);return t&&t.responseType||"text"}function t8e(e,t,n,r){t=t||{};const i=mce(t.type||"json");return i||et("Unknown data format type: "+t.type),e=i(e,t),t.parse&&O8t(e,t.parse,n,r),Qt(e,"columns")&&delete e.columns,e}function O8t(e,t,n,r){if(!e.length)return;const i=XA();n=n||i.timeParse,r=r||i.utcParse;let o=e.columns||Object.keys(e[0]),s,a,l,c,u,f;t==="auto"&&(t=ZVe(e,o)),o=Object.keys(t);const d=o.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?r:n)(m);if(!_te[p])throw Error("Illegal format pattern: "+h+":"+p);return _te[p]});for(l=0,u=e.length,f=o.length;l{const o=t(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=t(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function yz(e,t){try{await t(e)}catch(n){e.error(n)}}const n8e=Symbol("vega_id");let E8t=1;function RU(e){return!!(e&&Sn(e))}function Sn(e){return e[n8e]}function r8e(e,t){return e[n8e]=t,e}function li(e){const t=e===Object(e)?e:{data:e};return Sn(t)?t:r8e(t,E8t++)}function vce(e){return IU(e,li({}))}function IU(e,t){for(const n in e)t[n]=e[n];return t}function i8e(e,t){return r8e(t,Sn(e))}function dS(e,t){return e?t?(n,r)=>e(n,r)||Sn(t(n))-Sn(t(r)):(n,r)=>e(n,r)||Sn(n)-Sn(r):null}function o8e(e){return e&&e.constructor===hS}function hS(){const e=[],t=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:hS,insert(a){const l=Ht(a),c=l.length;for(let u=0;u{p(y)&&(c[Sn(y)]=-1)});for(f=0,d=e.length;f0&&(v(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f{p(y)&&c[Sn(y)]>0&&v(y,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||r.length?l.filter(y=>c[Sn(y)]>0):l.slice();else for(m in u)a.mod.push(u[m]);return(o||o==null&&(t.length||r.length))&&a.clean(!0),a}}}const bz="_:mod:_";function DU(){Object.defineProperty(this,bz,{writable:!0,value:{}})}DU.prototype={set(e,t,n,r){const i=this,o=i[e],s=i[bz];return t!=null&&t>=0?(o[t]!==n||r)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||r)&&(i[e]=n,s[e]=it(n)?1+n.length:-1),i},modified(e,t){const n=this[bz];if(arguments.length){if(it(e)){for(let r=0;r=0?t+1{h instanceof ji?(h!==this&&(t&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in e)if(a=e[s],s===P8t)Ht(a).forEach(f=>{f instanceof ji?f!==this&&(f.targets().add(this),o.push(f)):et("Pulse parameters must be operator instances.")}),this.source=a;else if(it(a))for(r.set(s,-1,Array(l=a.length)),c=0;c{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Ry();return this.targets().add(Ry(null,null,Jle(e,n=>{const r=n.dataflow;t.receive(n),r&&r.run&&r.run()}))),t},between(e,t){let n=!1;return e.targets().add(Ry(null,null,()=>n=!0)),t.targets().add(Ry(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Qf,this._targets=null}};function L8t(e,t,n,r){const i=this,o=Ry(n,r),s=function(c){c.dataflow=i;try{o.receive(c)}catch(u){i.error(u)}finally{i.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=Ht(e);const l=a.length;for(let c=0;ct=r);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const B8t={skip:!0};function U8t(e,t,n,r,i){return(e instanceof ji?W8t:V8t)(this,e,t,n,r,i),this}function V8t(e,t,n,r,i,o){const s=rr({},o,B8t);let a,l;Jn(n)||(n=vl(n)),r===void 0?a=c=>e.touch(n(c)):Jn(r)?(l=new ji(null,r,i,!1),a=c=>{l.evaluate(c);const u=n(c),f=l.value;o8e(f)?e.pulse(u,f,o):e.update(u,f,s)}):a=c=>e.update(n(c),r,s),t.apply(a)}function W8t(e,t,n,r,i,o){if(r===void 0)t.targets().add(n);else{const s=o||{},a=new ji(null,H8t(n,r),i,!1);a.modified(s.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function H8t(e,t){return t=Jn(t)?t:vl(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}function G8t(e){e.rank=++this._rank}function q8t(e){const t=[e];let n,r,i;for(;t.length;)if(this.rank(n=t.pop()),r=n._targets)for(i=r.length;--i>=0;)t.push(n=r[i]),n===e&&et("Cycle detected in dataflow graph.")}const hj={},np=1,Gy=2,dm=4,X8t=np|Gy,USe=np|dm,S_=np|Gy|dm,VSe=8,zk=16,WSe=32,HSe=64;function M0(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Q9(e,t){const n=[];return Hy(e,t,r=>n.push(r)),n}function GSe(e,t){const n={};return e.visit(t,r=>{n[Sn(r)]=1}),r=>n[Sn(r)]?null:r}function V$(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}M0.prototype={StopPropagation:hj,ADD:np,REM:Gy,MOD:dm,ADD_REM:X8t,ADD_MOD:USe,ALL:S_,REFLOW:VSe,SOURCE:zk,NO_SOURCE:WSe,NO_FIELDS:HSe,fork(e){return new M0(this.dataflow).init(this,e)},clone(){const e=this.fork(S_);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(S_|zk)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new M0(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&HSe)&&(n.fields=e.fields),t&np?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Gy?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&dm?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&WSe?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||S_;return t&np&&this.add.length||t&Gy&&this.rem.length||t&dm&&this.mod.length},reflow(e){if(e)return this.fork(S_).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(dm,GSe(this,np))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return it(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?it(e)?e.some(r=>n[r]):n[e]:!!n:!1},filter(e,t){const n=this;return e&np&&(n.addF=V$(n.addF,t)),e&Gy&&(n.remF=V$(n.remF,t)),e&dm&&(n.modF=V$(n.modF,t)),e&zk&&(n.srcF=V$(n.srcF,t)),n},materialize(e){e=e||S_;const t=this;return e&np&&t.addF&&(t.add=Q9(t.add,t.addF),t.addF=null),e&Gy&&t.remF&&(t.rem=Q9(t.rem,t.remF),t.remF=null),e&dm&&t.modF&&(t.mod=Q9(t.mod,t.modF),t.modF=null),e&zk&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(e&zk)return Hy(n.source,n.srcF,r),n;e&np&&Hy(n.add,n.addF,r),e&Gy&&Hy(n.rem,n.remF,r),e&dm&&Hy(n.mod,n.modF,r);const i=n.source;if(e&VSe&&i){const o=n.add.length+n.mod.length;o===i.length||(o?Hy(i,GSe(n,USe),r):Hy(i,n.srcF,r))}return n}};function yce(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}Rt(yce,M0,{fork(e){const t=new M0(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?it(e)?e.some(r=>n[r]):n[e]:0},filter(){et("MultiPulse does not support filtering.")},materialize(){et("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;or._enqueue(u,!0)),r._touched=AU(TD);let s=0,a,l,c;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,e)),l.then?l=await l:l.async&&(i.push(l.async),l=hj),l!==hj&&a._targets&&a._targets.forEach(u=>r._enqueue(u)),++s}}catch(u){r._heap.clear(),c=u}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),c&&(r._postrun=[],r.error(c)),r._postrun.length){const u=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;fr.runAsync(null,()=>{u.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function Q8t(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running}function K8t(e,t,n){return this._pulse?s8e(this):(this.evaluate(e,t,n),this)}function Z8t(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(r){this.error(r)}}function s8e(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function J8t(e,t){const n=e.stampi.pulse),t):this._input[e.id]||tWt(this._pulse,n&&n.pulse)}function tWt(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==hj&&(e.source=t.source),e)}const bce={skip:!1,force:!1};function nWt(e,t){const n=t||bce;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function rWt(e,t,n){const r=n||bce;return(e.set(t)||r.force)&&this.touch(e,r),this}function iWt(e,t,n){this.touch(e,n||bce);const r=new M0(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this}function oWt(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),a8e(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,sWt(t,0,e)):r=n,r}}}function a8e(e,t,n,r){let i,o;const s=e[n];for(;n>t;){if(o=n-1>>1,i=e[o],r(s,i)<0){e[n]=i,n=o;continue}break}return e[n]=s}function sWt(e,t,n){const r=t,i=e.length,o=e[t];let s=(t<<1)+1,a;for(;s=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,a8e(e,r,t,n)}function oO(){this.logger(wU()),this.logLevel(qle),this._clock=0,this._rank=0,this._locale=hce();try{this._loader=MU()}catch{}this._touched=AU(TD),this._input={},this._pulse=null,this._heap=oWt((e,t)=>e.qrank-t.qrank),this._postrun=[]}function jk(e){return function(){return this._log[e].apply(this,arguments)}}oO.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:jk("error"),warn:jk("warn"),info:jk("info"),debug:jk("debug"),logLevel:jk("level"),cleanThreshold:1e4,add:R8t,connect:I8t,rank:G8t,rerank:q8t,pulse:iWt,touch:nWt,update:rWt,changeset:hS,ingest:$8t,parse:F8t,preload:z8t,request:N8t,events:L8t,on:U8t,evaluate:Y8t,run:K8t,runAsync:Q8t,runAfter:Z8t,_enqueue:J8t,_getPulse:eWt};function Je(e,t){ji.call(this,e,null,t)}Rt(Je,ji,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const ZO={};function l8e(e){const t=c8e(e);return t&&t.Definition||null}function c8e(e){return e=e&&e.toLowerCase(),Qt(ZO,e)?ZO[e]:null}function*u8e(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)r=t(r,++n,e),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function xce(e,t,n){const r=Float64Array.from(u8e(e,n));return r.sort(Up),t.map(i=>aVe(r,i))}function wce(e,t){return xce(e,[.25,.5,.75],t)}function Sce(e,t){const n=e.length,r=mUt(e,t),i=wce(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function f8e(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,l,c,u,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(u=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=i.length;f=c&&h/u<=t&&(a=u)}u=Math.log(a);const p=u>=0?0:~~(-u/r)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(u=Math.floor(o/a+g)*a,o=od);const i=e.length,o=new Float64Array(i);let s=0,a=1,l=r(e[0]),c=l,u=l+t,f;for(;a=u){for(c=(l+c)/2;s>1);si;)e[s--]=e[r]}r=i,i=o}return e}function cWt(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function uWt(e,t){t==null&&(t=e,e=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*Zf())},pdf(s){return s===Math.floor(s)&&s>=n&&s=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(e).max(t)}const p8e=Math.sqrt(2*Math.PI),fWt=Math.SQRT2;let Bk=NaN;function FU(e,t){e=e||0,t=t??1;let n=0,r=0,i,o;if(Bk===Bk)n=Bk,Bk=NaN;else{do n=Zf()*2-1,r=Zf()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,Bk=r*o}return e+n*t}function _ce(e,t,n){n=n??1;const r=(e-(t||0))/n;return Math.exp(-.5*r*r)/(n*p8e)}function $U(e,t,n){t=t||0,n=n??1;const r=(e-t)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function NU(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*fWt*dWt(2*e-1)}function dWt(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function Cce(e,t){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>FU(n,r),pdf:o=>_ce(o,n,r),cdf:o=>$U(o,n,r),icdf:o=>NU(o,n,r)};return i.mean(e).stdev(t)}function Oce(e,t){const n=Cce();let r=0;const i={data(o){return arguments.length?(e=o,r=o?o.length:0,i.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=Sce(e)),i):t},sample(){return e[~~(Zf()*r)]+t*n.sample()},pdf(o){let s=0,a=0;for(;aEce(n,r),pdf:o=>Tce(o,n,r),cdf:o=>Pce(o,n,r),icdf:o=>kce(o,n,r)};return i.mean(e).stdev(t)}function m8e(e,t){let n=0,r;function i(s){const a=[];let l=0,c;for(c=0;c=t&&e<=n?1/(n-t):0}function Rce(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function Ice(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function v8e(e,t){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>Mce(n,r),pdf:o=>Ace(o,n,r),cdf:o=>Rce(o,n,r),icdf:o=>Ice(o,n,r)};return t==null&&(t=e??1,e=0),i.min(e).max(t)}function Dce(e,t,n){let r=0,i=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function kD(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function zU(e,t,n,r){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&e.sort((h,p)=>t(h)-t(p));const i=e.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,c=0,u,f,d;for(d of e)o[a]=u=+t(d),s[a]=f=+n(d),++a,l+=(u-l)/a,c+=(f-c)/a;for(a=0;a=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function GT(e,t,n,r,i){let o=0,s=0;return MD(e,t,n,(a,l)=>{const c=l-i(a),u=l-r;o+=c*c,s+=u*u}),1-o/s}function Lce(e,t,n){let r=0,i=0,o=0,s=0,a=0;MD(e,t,n,(u,f)=>{++a,r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=kD(r,i,o,s),c=u=>l[0]+l[1]*u;return{coef:l,predict:c,rSquared:GT(e,t,n,i,c)}}function y8e(e,t,n){let r=0,i=0,o=0,s=0,a=0;MD(e,t,n,(u,f)=>{++a,u=Math.log(u),r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=kD(r,i,o,s),c=u=>l[0]+l[1]*Math.log(u);return{coef:l,predict:c,rSquared:GT(e,t,n,i,c)}}function b8e(e,t,n){const[r,i,o,s]=zU(e,t,n);let a=0,l=0,c=0,u=0,f=0,d,h,p;MD(e,t,n,(y,b)=>{d=r[f++],h=Math.log(b),p=d*b,a+=(b*h-a)/f,l+=(p-l)/f,c+=(p*h-c)/f,u+=(d*p-u)/f});const[g,m]=kD(l/s,a/s,c/s,u/s),v=y=>Math.exp(g+m*(y-o));return{coef:[Math.exp(g-m*o),m],predict:v,rSquared:GT(e,t,n,s,v)}}function x8e(e,t,n){let r=0,i=0,o=0,s=0,a=0,l=0;MD(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const c=kD(r,i,o,s),u=f=>c[0]*Math.pow(f,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:GT(e,t,n,a,u)}}function Fce(e,t,n){const[r,i,o,s]=zU(e,t,n),a=r.length;let l=0,c=0,u=0,f=0,d=0,h,p,g,m;for(h=0;h(E=E-o,b*E*E+w*E+S+s);return{coef:[S-w*o+b*o*o+s,w-2*b*o,b],predict:_,rSquared:GT(e,t,n,s,_)}}function w8e(e,t,n,r){if(r===0)return Dce(e,t,n);if(r===1)return Lce(e,t,n);if(r===2)return Fce(e,t,n);const[i,o,s,a]=zU(e,t,n),l=i.length,c=[],u=[],f=r+1;let d,h,p,g,m;for(d=0;d{b-=s;let w=a+v[0]+v[1]*b+v[2]*b*b;for(d=3;d=0;--o)for(a=t[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function pWt(e){const t=e.length-1,n=[];let r,i,o,s,a;for(r=0;rMath.abs(e[r][s])&&(s=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(a=0,o=i+1;oi[b]-v?y:b;let S=0,_=0,E=0,T=0,k=0;const P=1/Math.abs(i[w]-v||1);for(let F=y;F<=b;++F){const A=i[F],L=o[F],$=gWt(Math.abs(v-A)*P)*d[F],j=A*$;S+=$,_+=j,E+=L*$,T+=L*j,k+=A*j}const[I,R]=kD(_/S,E/S,T/S,k/S);u[m]=I+R*v,f[m]=Math.abs(o[m]-u[m]),mWt(i,m+1,p)}if(h===qSe)break;const g=lVe(f);if(Math.abs(g)=1?XSe:(y=1-v*v)*y}return vWt(i,u,s,a)}function gWt(e){return(e=1-e*e*e)*e*e}function mWt(e,t,n){const r=e[t];let i=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}function vWt(e,t,n,r){const i=e.length,o=[];let s=0,a=0,l=[],c;for(;s[g,e(g)],o=t[0],s=t[1],a=s-o,l=a/r,c=[i(o)],u=[];if(n===r){for(let g=1;g0;)u.push(i(o+g/n*a))}let f=c[0],d=u[u.length-1];const h=1/a,p=bWt(f[1],u);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&xWt(f,g,d,h,p)>yWt?u.push(g):(f=d,c.push(d),u.pop()),d=u[u.length-1]}return c}function bWt(e,t){let n=e,r=e;const i=t.length;for(let o=0;or&&(r=s)}return 1/(r-n)}function xWt(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),s=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-s)}function wWt(e){return t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r{},SWt={init:K9,add:K9,rem:K9,idx:0},YA={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},AD=Object.keys(YA).filter(e=>e!=="__count__");function _Wt(e,t){return(n,r)=>rr({name:e,aggregate_param:r,out:n||e},SWt,t)}[...AD,"__count__"].forEach(e=>{YA[e]=_Wt(e,YA[e])});function C8e(e,t,n){return YA[e](n,t)}function O8e(e,t){return e.idx-t.idx}function CWt(e){const t={};e.forEach(r=>t[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{t[i]||n(t[i]=YA[i]())})};return e.forEach(n),Object.values(t).sort(O8e)}function OWt(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function EWt(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function TWt(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function PWt(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function E8e(e,t){const n=t||ml,r=CWt(e),i=e.slice().sort(O8e);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=OWt,o.prototype.add=EWt,o.prototype.rem=TWt,o.prototype.set=PWt,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function $ce(e){this._key=e?Yf(e):Sn,this.reset()}const Na=$ce.prototype;Na.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Na.add=function(e){this._add.push(e)};Na.rem=function(e){this._rem.push(e)};Na.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),s={};let a,l,c;for(a=0;a=0;)o=e(t[r])+"",Qt(n,o)||(n[o]=1,++i);return i};Na.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=WUe(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Na.argmin=function(e){return this.extent(e)[0]||{}};Na.argmax=function(e){return this.extent(e)[1]||{}};Na.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Na.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Na.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=wce(this.values(),e),this._get=e),this._q};Na.q1=function(e){return this.quartile(e)[0]};Na.q2=function(e){return this.quartile(e)[1]};Na.q3=function(e){return this.quartile(e)[2]};Na.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=d8e(this.values(),1e3,.05,e),this._get=e),this._ci};Na.ci0=function(e){return this.ci(e)[0]};Na.ci1=function(e){return this.ci(e)[1]};function G0(e){Je.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}G0.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:AD},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};Rt(G0,Je,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,c,u,f;for(l in a)for(u=a[l].tuple,c=0;c{const b=Bo(y);return i(y),n.push(b),b}),this.cellkey=e.key?e.key:Cte(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.aggregate_params||[null],l=e.as||[],c=o.length,u={};let f,d,h,p,g,m,v;for(c!==s.length&&et("Unmatched number of fields and aggregate ops."),v=0;vE8e(y,y.field)),Object.create(null)},cellkey:Cte(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=r(u);u[a]=f,u[l]=f==null?null:i+o*(1+(f-i)/o)}:u=>u[a]=r(u)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=f8e(e),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=e.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(c){let u=cl(t(c));return u==null?null:uo?1/0:(u=Math.max(i,Math.min(u,o-r)),i+r*Math.floor(kWt+(u-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=Hc(l,dl(t),e.name||"bin_"+Bo(t))}});function T8e(e,t,n){const r=e;let i=t||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,c)=>(a&&(i=i.filter(u=>!s[r(u)]),s={},a=0),c&&l&&i.sort(l),o.length&&(i=l?YUe(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function zce(e){Je.call(this,[],e)}zce.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};Rt(zce,Je,{transform(e,t){const n=t.fork(t.ALL),r=T8e(Sn,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(dS(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function P8e(e){ji.call(this,null,MWt,e)}Rt(P8e,ji);function MWt(e){return this.value&&!e.modified()?this.value:Zle(e.fields,e.orders)}function jce(e){Je.call(this,null,e)}jce.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function AWt(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}Rt(jce,Je,{transform(e,t){const n=f=>d=>{for(var h=AWt(a(d),e.case,o)||[],p,g=0,m=h.length;gi[f]=1+(i[f]||0)),u=n(f=>i[f]-=1);return r?t.visit(t.SOURCE,c):(t.visit(t.ADD,c),t.visit(t.REM,u)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,c;for(a in n)l=r[a],c=n[a]||0,!l&&c?(r[a]=l=li({}),l[i]=a,l[o]=c,s.add.push(l)):c===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==c&&(l[o]=c,s.mod.push(l));return s.modifies(t)}});function Bce(e){Je.call(this,null,e)}Bce.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};Rt(Bce,Je,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=RWt(a,i,o,e.filter||Qf)):n.mod=a,n.source=this.value,n.modifies(r)}});function RWt(e,t,n,r){for(var i=[],o={},s=e.length,a=0,l,c;ak8e(o,t))):typeof r[i]===QSe&&r[i](e[i]);return r}function Uce(e){Je.call(this,null,e)}const M8e=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],LWt={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:M8e},{name:"weights",type:"number",array:!0}]};Uce.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:M8e.concat(LWt)},{name:"as",type:"string",array:!0,default:["value","density"]}]};Rt(Uce,Je,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=k8e(e.distribution,FWt(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&et("Invalid density method: "+s),!e.extent&&!r.data&&et("Missing density extent parameter."),s=r[s];const a=e.as||["value","density"],l=e.extent||eg(r.data()),c=jU(s,l,i,o).map(u=>{const f={};return f[a[0]]=u[0],f[a[1]]=u[1],li(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function FWt(e){return()=>e.materialize(e.SOURCE).source}function A8e(e,t){return e?e.map((n,r)=>t[r]||Bo(n)):null}function Vce(e,t,n){const r=[],i=f=>f(l);let o,s,a,l,c,u;if(t==null)r.push(e.map(n));else for(o={},s=0,a=e.length;sPD(eg(e,t))/30;Rt(Wce,Je,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,r=Vce(t.source,e.groupby,ml),i=e.smooth||!1,o=e.field,s=e.step||$Wt(n,o),a=dS((p,g)=>o(p)-o(g)),l=e.as||R8e,c=r.length;let u=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:u,stop:f,step:s},t.reflow(!0).modifies(l)}});function I8e(e){ji.call(this,null,NWt,e),this.modified(!0)}Rt(I8e,ji);function NWt(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Hc(n=>t(n,e),dl(t),Bo(t))}function Hce(e){Je.call(this,[void 0,void 0],e)}Hce.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};Rt(Hce,Je,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),t.visit(i?t.SOURCE:t.ADD,a=>{const l=cl(r(a));l!=null&&(ls&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Bo(r);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function Gce(e,t){ji.call(this,e),this.parent=t,this.count=0}Rt(Gce,ji,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function BU(e){Je.call(this,{},e),this._keys=jT();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let r=0,i=t.active;rr&&r.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(l,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,l=>{const c=Sn(l),u=o.get(c);u!==void 0&&(o.delete(c),a(u).rem(l))}),t.visit(t.ADD,l=>{const c=r(l);o.set(Sn(l),c),a(c).add(l)}),s||t.modified(r.fields)?t.visit(t.MOD,l=>{const c=Sn(l),u=o.get(c),f=r(l);u===f?a(f).mod(l):(o.set(c,f),a(u).rem(l),a(f).add(l))}):t.changed(t.MOD)&&t.visit(t.MOD,l=>{a(o.get(Sn(l))).mod(l)}),s&&t.visit(t.REFLOW,l=>{const c=Sn(l),u=o.get(c),f=r(l);u!==f&&(o.set(c,f),a(u).rem(l),a(f).add(l))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function D8e(e){ji.call(this,null,zWt,e)}Rt(D8e,ji);function zWt(e){return this.value&&!e.modified()?this.value:it(e.name)?Ht(e.name).map(t=>Yf(t)):Yf(e.name,e.as)}function qce(e){Je.call(this,jT(),e)}qce.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};Rt(qce,Je,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,s=i.rem,a=i.mod,l=e.expr;let c=!0;t.visit(t.REM,f=>{const d=Sn(f);r.has(d)?r.delete(d):s.push(f)}),t.visit(t.ADD,f=>{l(f,e)?o.push(f):r.set(Sn(f),1)});function u(f){const d=Sn(f),h=l(f,e),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):c&&h&&!p&&a.push(f)}return t.visit(t.MOD,u),e.modified()&&(c=!1,t.visit(t.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function Xce(e){Je.call(this,[],e)}Xce.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};Rt(Xce,Je,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=A8e(r,e.as||[]),o=e.index||null,s=i.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const l=r.map(p=>p(a)),c=l.reduce((p,g)=>Math.max(p,g.length),0);let u=0,f,d,h;for(;u{for(let u=0,f;us[r]=n(s,e))}});function L8e(e){Je.call(this,[],e)}Rt(L8e,Je,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i=this.value,o=e.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=li(r(e))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const W$={value:"value",median:lVe,mean:SUt,min:pte,max:P1},jWt=[];function Kce(e){Je.call(this,[],e)}Kce.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function BWt(e){var t=e.method||W$.value,n;if(W$[t]==null)et("Unrecognized imputation method: "+t);else return t===W$.value?(n=e.value!==void 0?e.value:0,()=>n):W$[t]}function UWt(e){const t=e.field;return n=>n?t(n):NaN}Rt(Kce,Je,{transform(e,t){var n=t.fork(t.ALL),r=BWt(e),i=UWt(e),o=Bo(e.field),s=Bo(e.key),a=(e.groupby||[]).map(Bo),l=VWt(t.source,e.groupby,e.key,e.keyvals),c=[],u=this.value,f=l.domain.length,d,h,p,g,m,v,y,b,w,S;for(m=0,b=l.length;mv(m),o=[],s=r?r.slice():[],a={},l={},c,u,f,d,h,p,g,m;for(s.forEach((v,y)=>a[v]=y+1),d=0,g=e.length;dn.add(o))):(i=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{rr(o,i[n.cellkey(o)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const p=Oce(h,s)[a],g=e.counts?h.length:1,m=u||eg(h);jU(p,m,f,d).forEach(v=>{const y={};for(let b=0;b(this._pending=Ht(i.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(r=>Z9(this,t,Ht(r.data)))}});function HWt(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Z9(e,t,n){n.forEach(li);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function eue(e){Je.call(this,{},e)}eue.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};Rt(eue,Je,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let l=s?t.SOURCE:t.ADD,c=t,u=e.as,f,d,h;return i?(d=i.length,a>1&&!u&&et('Multi-field lookup requires explicit "as" parameter.'),u&&u.length!==a*d&&et('The "as" parameter has too few output field names.'),u=u||i.map(Bo),f=function(p){for(var g=0,m=0,v,y;gt.modified(p.fields)),l|=h?t.MOD:0),t.visit(l,f),c.modifies(u)}});function N8e(e){ji.call(this,null,GWt,e)}Rt(N8e,ji);function GWt(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r=1/0,i=-1/0,o,s;for(o=0;oi&&(i=s[1]);return[r,i]}function z8e(e){ji.call(this,null,qWt,e)}Rt(z8e,ji);function qWt(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function j8e(e){Je.call(this,null,e)}Rt(j8e,Je,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function tue(e){G0.call(this,e)}tue.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:AD,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};Rt(tue,G0,{_transform:G0.prototype.transform,transform(e,t){return this._transform(XWt(e,t),t)}});function XWt(e,t){const n=e.field,r=e.value,i=(e.op==="count"?"__count__":e.op)||"sum",o=dl(n).concat(dl(r)),s=QWt(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>i),fields:s.map(a=>YWt(a,n,r,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function YWt(e,t,n,r){return Hc(i=>t(i)===e?n(i):NaN,r,e+"")}function QWt(e,t,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=e(o);r[s]||(r[s]=1,i.push(s))}),i.sort(zT),t?i.slice(0,t):i}function B8e(e){BU.call(this,e)}Rt(B8e,BU,{transform(e,t){const n=e.subflow,r=e.field,i=o=>this.subflow(Sn(o),n,t,o);return(e.modified("field")||r&&t.modified(dl(r)))&&et("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(li(a)))}),t.visit(t.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>i(o).mod(o)),t.visit(t.ADD,o=>i(o).add(o)),t.visit(t.REM,o=>i(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function nue(e){Je.call(this,null,e)}nue.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};Rt(nue,Je,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=A8e(e.fields,e.as||[]),o=r?(a,l)=>KWt(a,l,r,i):IU;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const l=Sn(a);n.rem.push(s[l]),s[l]=null}),t.visit(t.ADD,a=>{const l=o(a,li({}));s[Sn(a)]=l,n.add.push(l)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[Sn(a)]))}),n}});function KWt(e,t,n,r){for(let i=0,o=n.length;i{const d=xce(f,c);for(let h=0;h{const o=Sn(i);n.rem.push(r[o]),r[o]=null}),t.visit(t.ADD,i=>{const o=vce(i);r[Sn(i)]=o,n.add.push(o)}),t.visit(t.MOD,i=>{const o=r[Sn(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function iue(e){Je.call(this,[],e),this.count=0}iue.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};Rt(iue,Je,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((u,f)=>(u[Sn(f)]=1,u),{});let s=this.value,a=this.count,l=0;function c(u){let f,d;s.length=l&&(f=s[d],o[Sn(f)]&&n.rem.push(f),s[d]=u)),++a}if(t.rem.length&&(t.visit(t.REM,u=>{const f=Sn(u);o[f]&&(o[f]=-1,n.rem.push(u)),--a}),s=s.filter(u=>o[Sn(u)]!==-1)),(t.rem.length||r)&&s.length{o[Sn(u)]||c(u)}),l=-1),r&&s.length>i){const u=s.length-i;for(let f=0;f{o[Sn(u)]&&n.mod.push(u)}),t.add.length&&t.visit(t.ADD,c),(t.add.length||l<0)&&(n.add=s.filter(u=>!o[Sn(u)])),this.count=a,this.value=n.source=s,n}});function oue(e){Je.call(this,null,e)}oue.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};Rt(oue,Je,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Oc(e.start,e.stop,e.step||1).map(i=>{const o={};return o[r]=i,li(o)}),n.add=t.add.concat(this.value),n}});function W8e(e){Je.call(this,null,e),this.modified(!0)}Rt(W8e,Je,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function sue(e){Je.call(this,null,e)}const H8e=["unit0","unit1"];sue.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:lce,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:H8e}]};Rt(sue,Je,{transform(e,t){const n=e.field,r=e.interval!==!1,i=e.timezone==="utc",o=this._floor(e,t),s=(i?HT:WT)(o.unit).offset,a=e.as||H8e,l=a[0],c=a[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(dl(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,v;g==null?(p[l]=null,r&&(p[c]=null)):(p[l]=m=v=o(g),r&&(p[c]=v=s(m,u)),md&&(d=v))}),o.start=f,o.stop=d,t.modifies(r?a:l)},_floor(e,t){const n=e.timezone==="utc",{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:LVe({extent:e.extent||eg(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=cce(r),s=this.value||{},a=(n?EVe:OVe)(o,i);return a.unit=Ar(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function G8e(e){Je.call(this,jT(),e)}Rt(G8e,Je,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>i.delete(r(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}});function q8e(e){Je.call(this,null,e)}Rt(q8e,Je,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(dS(e.sort)):t.source).map(e.field))}});function JWt(e,t,n,r){const i=QA[e](t,n);return{init:i.init||t0,update:function(o,s){s[r]=i.next(o)}}}const QA={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=QA.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e0||et("ntile num must be greater than zero.");const n=QA.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(t*r(i))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||et("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return r!=null?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=eHt(e,i,r.index))<0?(n=i.length,t=null):t=e(i[n])}}}};function eHt(e,t,n){for(let r=t.length;nl[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],v=r[g],y=i[g]||null,b=Bo(m),w=_8e(p,b,o[g]);if(h(m),s.push(w),Qt(QA,p))a.push(JWt(p,m,v,w));else{if(m==null&&p!=="count"&&et("Null aggregate field specified."),p==="count"){u.push(w);return}d=!1;let S=c[b];S||(S=c[b]=[],S.field=m,f.push(S)),S.push(C8e(p,y,w))}}),(u.length||f.length)&&(this.cell=nHt(f,u,d)),this.inputs=Object.keys(l)}const Y8e=X8e.prototype;Y8e.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};Y8e.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let s;if(n){for(s=e.p0;sE8e(l,l.field));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),s=0;sthis.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new X8e(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),r1?0:e<-1?q0:Math.acos(e)}function ZSe(e){return e>=1?pj:e<=-1?-pj:Math.asin(e)}const Ote=Math.PI,Ete=2*Ote,Fx=1e-6,cHt=Ete-Fx;function Q8e(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Q8e;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;iFx)if(!(Math.abs(f*l-c*u)>Fx)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+c*c,m=h*h+p*p,v=Math.sqrt(g),y=Math.sqrt(d),b=o*Math.tan((Ote-Math.acos((g+d-m)/(2*v*y)))/2),w=b/y,S=b/v;Math.abs(w-1)>Fx&&this._append`L${t+w*u},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=t+S*l},${this._y1=n+S*c}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=t+a,u=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Fx||Math.abs(this._y1-u)>Fx)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%Ete+Ete),d>cHt?this._append`A${r},${r},0,1,${f},${t-a},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>Fx&&this._append`A${r},${r},0,${+(d>=Ote)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function UU(){return new lue}UU.prototype=lue.prototype;function VU(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new lue(t)}function fHt(e){return e.innerRadius}function dHt(e){return e.outerRadius}function hHt(e){return e.startAngle}function pHt(e){return e.endAngle}function gHt(e){return e&&e.padAngle}function mHt(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,f=a-o,d=f*l-u*c;if(!(d*dA*A+L*L&&(T=P,k=I),{cx:T,cy:k,x01:-u,y01:-f,x11:T*(i/S-1),y11:k*(i/S-1)}}function vHt(){var e=fHt,t=dHt,n=Lr(0),r=null,i=hHt,o=pHt,s=gHt,a=null,l=VU(c);function c(){var u,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-pj,g=o.apply(this,arguments)-pj,m=KSe(g-p),v=g>p;if(a||(a=u=l()),hZa))a.moveTo(0,0);else if(m>RD-Za)a.moveTo(h*hm(p),h*dc(p)),a.arc(0,0,h,p,g,!v),d>Za&&(a.moveTo(d*hm(g),d*dc(g)),a.arc(0,0,d,g,p,v));else{var y=p,b=g,w=p,S=g,_=m,E=m,T=s.apply(this,arguments)/2,k=T>Za&&(r?+r.apply(this,arguments):ka(d*d+h*h)),P=J9(KSe(h-d)/2,+n.apply(this,arguments)),I=P,R=P,F,A;if(k>Za){var L=ZSe(k/d*dc(T)),$=ZSe(k/h*dc(T));(_-=L*2)>Za?(L*=v?1:-1,w+=L,S-=L):(_=0,w=S=(p+g)/2),(E-=$*2)>Za?($*=v?1:-1,y+=$,b-=$):(E=0,y=b=(p+g)/2)}var j=h*hm(y),V=h*dc(y),U=d*hm(S),z=d*dc(S);if(P>Za){var N=h*hm(b),B=h*dc(b),H=d*hm(w),Q=d*dc(w),Y;if(mZa?R>Za?(F=H$(H,Q,j,V,h,R,v),A=H$(N,B,U,z,h,R,v),a.moveTo(F.cx+F.x01,F.cy+F.y01),RZa)||!(_>Za)?a.lineTo(U,z):I>Za?(F=H$(U,z,N,B,d,-I,v),A=H$(j,V,H,Q,d,-I,v),a.lineTo(F.cx+F.x01,F.cy+F.y01),I=h;--p)a.point(b[p],w[p]);a.lineEnd(),a.areaEnd()}v&&(b[d]=+e(m,d,f),w[d]=+t(m,d,f),a.point(r?+r(m,d,f):b[d],n?+n(m,d,f):w[d]))}if(y)return a=null,y+""||null}function u(){return uue().defined(i).curve(s).context(o)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:Lr(+f),r=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Lr(+f),c):e},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Lr(+f),c):r},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:Lr(+f),n=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Lr(+f),c):t},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Lr(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Lr(!!f),c):i},c.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),c):s},c.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),c):o},c}class eWe{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function yHt(e){return new eWe(e,!0)}function bHt(e){return new eWe(e,!1)}const fue={draw(e,t){const n=ka(t/q0);e.moveTo(n,0),e.arc(0,0,n,0,RD)}},xHt={draw(e,t){const n=ka(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},tWe=ka(1/3),wHt=tWe*2,SHt={draw(e,t){const n=ka(t/wHt),r=n*tWe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},_Ht={draw(e,t){const n=ka(t),r=-n/2;e.rect(r,r,n,n)}},CHt=.8908130915292852,nWe=dc(q0/10)/dc(7*q0/10),OHt=dc(RD/10)*nWe,EHt=-hm(RD/10)*nWe,THt={draw(e,t){const n=ka(t*CHt),r=OHt*n,i=EHt*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const s=RD*o/5,a=hm(s),l=dc(s);e.lineTo(l*n,-a*n),e.lineTo(a*r-l*i,l*r+a*i)}e.closePath()}},e7=ka(3),PHt={draw(e,t){const n=-ka(t/(e7*3));e.moveTo(0,n*2),e.lineTo(-e7*n,-n),e.lineTo(e7*n,-n),e.closePath()}},nf=-.5,rf=ka(3)/2,Tte=1/ka(12),kHt=(Tte/2+1)*3,MHt={draw(e,t){const n=ka(t/kHt),r=n/2,i=n*Tte,o=r,s=n*Tte+n,a=-o,l=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,l),e.lineTo(nf*r-rf*i,rf*r+nf*i),e.lineTo(nf*o-rf*s,rf*o+nf*s),e.lineTo(nf*a-rf*l,rf*a+nf*l),e.lineTo(nf*r+rf*i,nf*i-rf*r),e.lineTo(nf*o+rf*s,nf*s-rf*o),e.lineTo(nf*a+rf*l,nf*l-rf*a),e.closePath()}};function rWe(e,t){let n=null,r=VU(i);e=typeof e=="function"?e:Lr(e||fue),t=typeof t=="function"?t:Lr(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Lr(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Lr(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function X0(){}function gj(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function WU(e){this._context=e}WU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:gj(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:gj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function iWe(e){return new WU(e)}function oWe(e){this._context=e}oWe.prototype={areaStart:X0,areaEnd:X0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:gj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sWe(e){return new oWe(e)}function aWe(e){this._context=e}aWe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:gj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lWe(e){return new aWe(e)}function cWe(e,t){this._basis=new WU(e),this._beta=t}cWe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,s=t[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(r+l*o),this._beta*t[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const AHt=(function e(t){function n(r){return t===1?new WU(r):new cWe(r,t)}return n.beta=function(r){return e(+r)},n})(.85);function mj(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function due(e,t){this._context=e,this._k=(1-t)/6}due.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:mj(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:mj(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const RHt=(function e(t){function n(r){return new due(r,t)}return n.tension=function(r){return e(+r)},n})(0);function hue(e,t){this._context=e,this._k=(1-t)/6}hue.prototype={areaStart:X0,areaEnd:X0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:mj(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const IHt=(function e(t){function n(r){return new hue(r,t)}return n.tension=function(r){return e(+r)},n})(0);function pue(e,t){this._context=e,this._k=(1-t)/6}pue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mj(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const DHt=(function e(t){function n(r){return new pue(r,t)}return n.tension=function(r){return e(+r)},n})(0);function gue(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Za){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Za){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}function uWe(e,t){this._context=e,this._alpha=t}uWe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:gue(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const LHt=(function e(t){function n(r){return t?new uWe(r,t):new due(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);function fWe(e,t){this._context=e,this._alpha=t}fWe.prototype={areaStart:X0,areaEnd:X0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:gue(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const FHt=(function e(t){function n(r){return t?new fWe(r,t):new hue(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);function dWe(e,t){this._context=e,this._alpha=t}dWe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:gue(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $Ht=(function e(t){function n(r){return t?new dWe(r,t):new pue(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);function hWe(e){this._context=e}hWe.prototype={areaStart:X0,areaEnd:X0,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function pWe(e){return new hWe(e)}function JSe(e){return e<0?-1:1}function e_e(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(JSe(o)+JSe(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function t_e(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function t7(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function vj(e){this._context=e}vj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:t7(this,this._t0,t_e(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,t7(this,t_e(this,n=e_e(this,e,t)),n);break;default:t7(this,this._t0,n=e_e(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function gWe(e){this._context=new mWe(e)}(gWe.prototype=Object.create(vj.prototype)).point=function(e,t){vj.prototype.point.call(this,t,e)};function mWe(e){this._context=e}mWe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function vWe(e){return new vj(e)}function yWe(e){return new gWe(e)}function bWe(e){this._context=e}bWe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=n_e(e),i=n_e(t),o=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function wWe(e){return new HU(e,.5)}function SWe(e){return new HU(e,0)}function _We(e){return new HU(e,1)}function JO(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,a=o.length;n=0;)n[t]=t;return n}function NHt(e,t){return e[t]}function zHt(e){const t=[];return t.key=e,t}function jHt(){var e=Lr([]),t=Pte,n=JO,r=NHt;function i(o){var s=Array.from(e.apply(this,arguments),zHt),a,l=s.length,c=-1,u;for(const f of o)for(a=0,++c;a0){for(var n,r,i=0,o=e[0].length,s;i0){for(var n=0,r=e[t[0]],i,o=r.length;n0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;rtypeof Image<"u"?Image:null;function cd(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Tv(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const yj=Symbol("implicit");function DD(){var e=new bSe,t=[],n=[],r=yj;function i(o){let s=e.get(o);if(s===void 0){if(r!==yj)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new bSe;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return DD(t,n).unknown(r)},cd.apply(i,arguments),i}function KA(){var e=DD().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete e.unknown;function f(){var d=t().length,h=i>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?G$(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?G$(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=GHt.exec(e))?new Js(t[1],t[2],t[3],1):(t=qHt.exec(e))?new Js(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=XHt.exec(e))?G$(t[1],t[2],t[3],t[4]):(t=YHt.exec(e))?G$(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=QHt.exec(e))?c_e(t[1],t[2]/100,t[3]/100,1):(t=KHt.exec(e))?c_e(t[1],t[2]/100,t[3]/100,t[4]):r_e.hasOwnProperty(e)?s_e(r_e[e]):e==="transparent"?new Js(NaN,NaN,NaN,0):null}function s_e(e){return new Js(e>>16&255,e>>8&255,e&255,1)}function G$(e,t,n,r){return r<=0&&(e=t=n=NaN),new Js(e,t,n,r)}function mue(e){return e instanceof Eb||(e=JA(e)),e?(e=e.rgb(),new Js(e.r,e.g,e.b,e.opacity)):new Js}function Y0(e,t,n,r){return arguments.length===1?mue(e):new Js(e,t,n,r??1)}function Js(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}qT(Js,Y0,LD(Eb,{brighter(e){return e=e==null?eE:Math.pow(eE,e),new Js(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?aw:Math.pow(aw,e),new Js(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Js(k1(this.r),k1(this.g),k1(this.b),bj(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:a_e,formatHex:a_e,formatHex8:eGt,formatRgb:l_e,toString:l_e}));function a_e(){return`#${l1(this.r)}${l1(this.g)}${l1(this.b)}`}function eGt(){return`#${l1(this.r)}${l1(this.g)}${l1(this.b)}${l1((isNaN(this.opacity)?1:this.opacity)*255)}`}function l_e(){const e=bj(this.opacity);return`${e===1?"rgb(":"rgba("}${k1(this.r)}, ${k1(this.g)}, ${k1(this.b)}${e===1?")":`, ${e})`}`}function bj(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function k1(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function l1(e){return e=k1(e),(e<16?"0":"")+e.toString(16)}function c_e(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Yd(e,t,n,r)}function OWe(e){if(e instanceof Yd)return new Yd(e.h,e.s,e.l,e.opacity);if(e instanceof Eb||(e=JA(e)),!e)return new Yd;if(e instanceof Yd)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n0&&l<1?0:s,new Yd(s,a,l,e.opacity)}function xj(e,t,n,r){return arguments.length===1?OWe(e):new Yd(e,t,n,r??1)}function Yd(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qT(Yd,xj,LD(Eb,{brighter(e){return e=e==null?eE:Math.pow(eE,e),new Yd(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?aw:Math.pow(aw,e),new Yd(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Js(n7(e>=240?e-240:e+120,i,r),n7(e,i,r),n7(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Yd(u_e(this.h),q$(this.s),q$(this.l),bj(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=bj(this.opacity);return`${e===1?"hsl(":"hsla("}${u_e(this.h)}, ${q$(this.s)*100}%, ${q$(this.l)*100}%${e===1?")":`, ${e})`}`}}));function u_e(e){return e=(e||0)%360,e<0?e+360:e}function q$(e){return Math.max(0,Math.min(1,e||0))}function n7(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const EWe=Math.PI/180,TWe=180/Math.PI,wj=18,PWe=.96422,kWe=1,MWe=.82521,AWe=4/29,aO=6/29,RWe=3*aO*aO,tGt=aO*aO*aO;function IWe(e){if(e instanceof Wp)return new Wp(e.l,e.a,e.b,e.opacity);if(e instanceof Im)return DWe(e);e instanceof Js||(e=mue(e));var t=s7(e.r),n=s7(e.g),r=s7(e.b),i=r7((.2225045*t+.7168786*n+.0606169*r)/kWe),o,s;return t===n&&n===r?o=s=i:(o=r7((.4360747*t+.3850649*n+.1430804*r)/PWe),s=r7((.0139322*t+.0971045*n+.7141733*r)/MWe)),new Wp(116*i-16,500*(o-i),200*(i-s),e.opacity)}function Sj(e,t,n,r){return arguments.length===1?IWe(e):new Wp(e,t,n,r??1)}function Wp(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}qT(Wp,Sj,LD(Eb,{brighter(e){return new Wp(this.l+wj*(e??1),this.a,this.b,this.opacity)},darker(e){return new Wp(this.l-wj*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=PWe*i7(t),e=kWe*i7(e),n=MWe*i7(n),new Js(o7(3.1338561*t-1.6168667*e-.4906146*n),o7(-.9787684*t+1.9161415*e+.033454*n),o7(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function r7(e){return e>tGt?Math.pow(e,1/3):e/RWe+AWe}function i7(e){return e>aO?e*e*e:RWe*(e-AWe)}function o7(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function s7(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function nGt(e){if(e instanceof Im)return new Im(e.h,e.c,e.l,e.opacity);if(e instanceof Wp||(e=IWe(e)),e.a===0&&e.b===0)return new Im(NaN,0=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r()=>e;function zWe(e,t){return function(n){return e+n*t}}function iGt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function XU(e,t){var n=t-e;return n?zWe(e,n>180||n<-180?n-360*Math.round(n/360):n):qU(isNaN(e)?t:e)}function oGt(e){return(e=+e)==1?ea:function(t,n){return n-t?iGt(t,n,e):qU(isNaN(t)?n:t)}}function ea(e,t){var n=t-e;return n?zWe(e,n):qU(isNaN(e)?t:e)}const Mte=(function e(t){var n=oGt(t);function r(i,o){var s=n((i=Y0(i)).r,(o=Y0(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=ea(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r})(1);function jWe(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Ud(r,i)})),n=a7.lastIndex;return n180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ud(c,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(c,u,f,d){c!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ud(c,u)}):u&&f.push(i(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:Ud(c,f)},{i:g-2,x:Ud(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function RGt(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i2?IGt:RGt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(e.map(r),t,n)))(r(s(d)))}return f.invert=function(d){return s(i((c||(c=a(t,e.map(r),Ud)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Cj),u()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=FD,u()},f.clamp=function(d){return arguments.length?(s=d?!0:jl,u()):s!==jl},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function wue(){return YU()(jl,jl)}function Sue(e,t,n,r){var i=H0(e,t,n),o;switch(r=sw(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=hVe(i,s))&&(r.precision=o),sce(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=pVe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=dVe(i))&&(r.precision=o-(r.type==="%")*2);break}}return CU(r)}function Pb(e){var t=e.domain;return e.ticks=function(n){var r=t();return dte(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Sue(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a0;){if(c=hte(s,a,n),c===l)return r[i]=s,r[o]=a,t(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return e},e}function tR(){var e=wue();return e.copy=function(){return $D(e,tR())},cd.apply(e,arguments),Pb(e)}function _ue(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Cj),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return _ue(e).unknown(t)},e=arguments.length?Array.from(e,Cj):[0,1],Pb(n)}function KWe(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return oMath.pow(e,t)}function NGt(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function b_e(e){return(t,n)=>-e(-t,n)}function Cue(e){const t=e(v_e,y_e),n=t.domain;let r=10,i,o;function s(){return i=NGt(r),o=$Gt(r),n()[0]<0?(i=b_e(i),o=b_e(o),e(DGt,LGt)):e(v_e,y_e),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;d<=h;++d)for(p=1;pu)break;v.push(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(gu)break;v.push(g)}v.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=sw(l)).precision==null&&(l.trim=!0),l=CU(l)),a===1/0)return l;const c=Math.max(1,r*a/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(KWe(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function Oue(){const e=Cue(YU()).domain([1,10]);return e.copy=()=>$D(e,Oue()).base(e.base()),cd.apply(e,arguments),e}function x_e(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function w_e(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Eue(e){var t=1,n=e(x_e(t),w_e(t));return n.constant=function(r){return arguments.length?e(x_e(t=+r),w_e(t)):t},Pb(n)}function Tue(){var e=Eue(YU());return e.copy=function(){return $D(e,Tue()).constant(e.constant())},cd.apply(e,arguments)}function S_e(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function zGt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jGt(e){return e<0?-e*e:e*e}function Pue(e){var t=e(jl,jl),n=1;function r(){return n===1?e(jl,jl):n===.5?e(zGt,jGt):e(S_e(n),S_e(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Pb(t)}function QU(){var e=Pue(YU());return e.copy=function(){return $D(e,QU()).exponent(e.exponent())},cd.apply(e,arguments),e}function ZWe(){return QU.apply(null,arguments).exponent(.5)}function __e(e){return Math.sign(e)*e*e}function BGt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function JWe(){var e=wue(),t=[0,1],n=!1,r;function i(o){var s=BGt(e(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return e.invert(__e(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Cj)).map(__e)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return JWe(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},cd.apply(i,arguments),Pb(i)}function kue(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s0?n[a-1]:e[0],a=n?[r[n-1],t]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return Mue().domain([e,t]).range(i).unknown(o)},cd.apply(Pb(s),arguments)}function Aue(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[lv(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Aue().domain(e).range(t).unknown(n)},cd.apply(i,arguments)}function UGt(e){return new Date(e)}function VGt(e){return e instanceof Date?+e:+new Date(+e)}function Rue(e,t,n,r,i,o,s,a,l,c){var u=wue(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),w=c("%Y");function S(_){return(l(_)<_?h:a(_)<_?p:s(_)<_?g:o(_)<_?m:r(_)<_?i(_)<_?v:y:n(_)<_?b:w)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?d(Array.from(_,VGt)):d().map(UGt)},u.ticks=function(_){var E=d();return e(E[0],E[E.length-1],_??10)},u.tickFormat=function(_,E){return E==null?S:c(E)},u.nice=function(_){var E=d();return(!_||typeof _.range!="function")&&(_=t(E[0],E[E.length-1],_??10)),_?d(KWe(E,_)):u},u.copy=function(){return $D(u,Rue(e,t,n,r,i,o,s,a,l,c))},u}function eHe(){return cd.apply(Rue(WUt,HUt,tg,GA,UT,Vm,TU,OU,Rm,fce).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function tHe(){return cd.apply(Rue(UUt,VUt,ng,qA,VT,k0,PU,EU,Rm,dce).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function KU(){var e=0,t=1,n,r,i,o,s=jl,a=!1,l;function c(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(f){return arguments.length?(a=!!f,c):a},c.interpolator=function(f){return arguments.length?(s=f,c):s};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),c):[s(0),s(1)]}}return c.range=u(Tb),c.rangeRound=u(FD),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),c}}function kb(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function ZU(){var e=Pb(KU()(jl));return e.copy=function(){return kb(e,ZU())},Tv.apply(e,arguments)}function Iue(){var e=Cue(KU()).domain([1,10]);return e.copy=function(){return kb(e,Iue()).base(e.base())},Tv.apply(e,arguments)}function Due(){var e=Eue(KU());return e.copy=function(){return kb(e,Due()).constant(e.constant())},Tv.apply(e,arguments)}function JU(){var e=Pue(KU());return e.copy=function(){return kb(e,JU()).exponent(e.exponent())},Tv.apply(e,arguments)}function nHe(){return JU.apply(null,arguments).exponent(.5)}function rHe(){var e=[],t=jl;function n(r){if(r!=null&&!isNaN(r=+r))return t((lv(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Up),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>aj(e,o/r))},n.copy=function(){return rHe(t).domain(e)},Tv.apply(n,arguments)}function eV(){var e=0,t=.5,n=1,r=1,i,o,s,a,l,c=jl,u,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-o)*(r*g0?r:1:0}const e9t="identity",tE="linear",uv="log",ND="pow",zD="sqrt",nV="symlog",lw="time",cw="utc",Hp="sequential",XT="diverging",nE="quantile",rV="quantize",iV="threshold",zue="ordinal",Dte="point",oHe="band",jue="bin-ordinal",js="continuous",jD="discrete",BD="discretizing",ud="interpolating",Bue="temporal";function t9t(e){return function(t){let n=t[0],r=t[1],i;return r=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=e.invertExtent(n[o]),i=e.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function Uue(){const e=DD().unknown(void 0),t=e.domain,n=e.range;let r=[0,1],i,o,s=!1,a=0,l=0,c=.5;delete e.unknown;function u(){const f=t().length,d=r[1]g+i*v);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),u()):t()},e.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},e.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,u()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(f){return arguments.length?(s=!!f,u()):s},e.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,u()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),u()):a},e.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},e.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]r[1-d])))return v=Math.max(0,lv(h,g)-1),y=g===m?v:lv(h,m)-1,g-h[v]>o+1e-10&&++v,d&&(b=v,v=p-y,y=p-b),v>y?void 0:t().slice(v,y+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Uue().domain(t()).range(r).round(s).paddingInner(a).paddingOuter(l).align(c)},u()}function sHe(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return sHe(t())},e}function r9t(){return sHe(Uue().paddingInner(1))}var i9t=Array.prototype.map;function o9t(e){return i9t.call(e,cl)}const s9t=Array.prototype.slice;function aHe(){let e=[],t=[];function n(r){return r==null||r!==r?void 0:t[(lv(e,r)-1)%t.length]}return n.domain=function(r){return arguments.length?(e=o9t(r),n):e.slice()},n.range=function(r){return arguments.length?(t=s9t.call(r),n):t.slice()},n.tickFormat=function(r,i){return Sue(e[0],Ar(e),r??10,i)},n.copy=function(){return aHe().domain(n.domain()).range(n.range())},n}const Oj=new Map,lHe=Symbol("vega_scale");function cHe(e){return e[lHe]=!0,e}function C_e(e){return e&&e[lHe]===!0}function a9t(e,t,n){const r=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?t9t(o):o.invertExtent?n9t(o):void 0),o.type=e,cHe(o)};return r.metadata=mh(Ht(n)),r}function Zr(e,t,n){return arguments.length>1?(Oj.set(e,a9t(e,t,n)),this):uHe(e)?Oj.get(e):void 0}Zr(e9t,_ue);Zr(tE,tR,js);Zr(uv,Oue,[js,uv]);Zr(ND,QU,js);Zr(zD,ZWe,js);Zr(nV,Tue,js);Zr(lw,eHe,[js,Bue]);Zr(cw,tHe,[js,Bue]);Zr(Hp,ZU,[js,ud]);Zr(`${Hp}-${tE}`,ZU,[js,ud]);Zr(`${Hp}-${uv}`,Iue,[js,ud,uv]);Zr(`${Hp}-${ND}`,JU,[js,ud]);Zr(`${Hp}-${zD}`,nHe,[js,ud]);Zr(`${Hp}-${nV}`,Due,[js,ud]);Zr(`${XT}-${tE}`,Lue,[js,ud]);Zr(`${XT}-${uv}`,Fue,[js,ud,uv]);Zr(`${XT}-${ND}`,tV,[js,ud]);Zr(`${XT}-${zD}`,iHe,[js,ud]);Zr(`${XT}-${nV}`,$ue,[js,ud]);Zr(nE,kue,[BD,nE]);Zr(rV,Mue,BD);Zr(iV,Aue,BD);Zr(jue,aHe,[jD,BD]);Zr(zue,DD,jD);Zr(oHe,Uue,jD);Zr(Dte,r9t,jD);function uHe(e){return Oj.has(e)}function pS(e,t){const n=Oj.get(e);return n&&n.metadata[t]}function Vue(e){return pS(e,js)}function rE(e){return pS(e,jD)}function Lte(e){return pS(e,BD)}function fHe(e){return pS(e,uv)}function l9t(e){return pS(e,Bue)}function dHe(e){return pS(e,ud)}function hHe(e){return pS(e,nE)}const c9t=["clamp","base","constant","exponent"];function pHe(e,t){const n=t[0],r=Ar(t)-n;return function(i){return e(n+i*r)}}function oV(e,t,n){return xue(Wue(t||"rgb",n),e)}function gHe(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[a]?s[a](e[a]()):0),s)}function Wue(e,t){const n=kGt[u9t(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function u9t(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const f9t={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},d9t={accent:HGt,category10:WGt,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:GGt,observable10:qGt,paired:XGt,pastel1:YGt,pastel2:QGt,set1:KGt,set2:ZGt,set3:JGt,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function vHe(e){if(it(e))return e;const t=e.length/6|0,n=new Array(t);for(let r=0;roV(vHe(e)));function Hue(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(O_e[e]=t,this):O_e[e]}const xz="symbol",h9t="discrete",p9t="gradient",g9t=e=>it(e)?e.map(t=>String(t)):String(e),m9t=(e,t)=>e[1]-t[1],v9t=(e,t)=>t[1]-e[1];function Gue(e,t,n){let r;return Qr(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(PD(e.domain())/n||1)+1))),Bt(t)&&(r=t.step,t=t.interval),Ut(t)&&(t=e.type===lw?WT(t):e.type==cw?HT(t):et("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function bHe(e,t,n){let r=e.range(),i=r[0],o=Ar(r),s=m9t;if(i>o&&(r=o,o=i,i=r,s=v9t),i=Math.floor(i),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ar(t)];for(;t.length>n&&t.length>=3;)t=t.filter((l,c)=>!(c%2));t.length<3&&(t=a)}return t}function que(e,t){return e.bins?bHe(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function xHe(e,t,n,r,i,o){const s=t.type;let a=g9t;if(s===lw||i===lw)a=e.timeFormat(r);else if(s===cw||i===cw)a=e.utcFormat(r);else if(fHe(s)){const l=e.formatFloat(r);if(o||t.bins)a=l;else{const c=wHe(t,n,!1);a=u=>c(u)?l(u):""}}else if(t.tickFormat){const l=t.domain();a=e.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=e.format(r));return a}function wHe(e,t,n){const r=que(e,t),i=e.base(),o=Math.log(i),s=Math.max(1,i*t/r.length),a=l=>{let c=l/Math.pow(i,Math.round(Math.log(l)/o));return c*i1?r[1]-r[0]:r[0],s;for(s=1;sFte[e.type]||e.bins;function CHe(e,t,n,r,i,o,s){const a=SHe[t.type]&&o!==lw&&o!==cw?y9t(e,t,i):xHe(e,t,n,i,o,s);return r===xz&&w9t(t)?S9t(a):r===h9t?_9t(a):C9t(a)}const S9t=e=>(t,n,r)=>{const i=E_e(r[n+1],E_e(r.max,1/0)),o=T_e(t,e),s=T_e(i,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},E_e=(e,t)=>e??t,_9t=e=>(t,n)=>n?e(t):null,C9t=e=>t=>e(t),T_e=(e,t)=>Number.isFinite(e)?t(e):null;function O9t(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+Ar(t),o=i-r;if(e.type===iV){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function E9t(e,t,n,r){const i=r||t.type;return Ut(n)&&l9t(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===lw?e.timeFormat("%A, %d %B %Y, %X"):!n&&i===cw?e.utcFormat("%A, %d %B %Y, %X UTC"):CHe(e,t,5,null,n,r,!0)}function OHe(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=E9t(e,t,n.format,n.formatType);if(Lte(t.type)){const o=_He(t).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(rE(t.type)){const o=t.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${i(o[0])} to ${i(Ar(o))}`}}let EHe=0;function T9t(){EHe=0}const Ej="p_";function Xue(e){return e&&e.gradient}function THe(e,t,n){const r=e.gradient;let i=e.id,o=r==="radial"?Ej:"";return i||(i=e.id="gradient_"+EHe++,r==="radial"?(e.x1=Wh(e.x1,.5),e.y1=Wh(e.y1,.5),e.r1=Wh(e.r1,0),e.x2=Wh(e.x2,.5),e.y2=Wh(e.y2,.5),e.r2=Wh(e.r2,.5),o=Ej):(e.x1=Wh(e.x1,0),e.y1=Wh(e.y1,0),e.x2=Wh(e.x2,1),e.y2=Wh(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function Wh(e,t){return e??t}function PHe(e,t){var n=[],r;return r={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(i,o){return n.push({offset:i,color:o}),r}}}const P_e={basis:{curve:iWe},"basis-closed":{curve:sWe},"basis-open":{curve:lWe},bundle:{curve:AHt,tension:"beta",value:.85},cardinal:{curve:RHt,tension:"tension",value:0},"cardinal-open":{curve:DHt,tension:"tension",value:0},"cardinal-closed":{curve:IHt,tension:"tension",value:0},"catmull-rom":{curve:LHt,tension:"alpha",value:.5},"catmull-rom-closed":{curve:FHt,tension:"alpha",value:.5},"catmull-rom-open":{curve:$Ht,tension:"alpha",value:.5},linear:{curve:ID},"linear-closed":{curve:pWe},monotone:{horizontal:yWe,vertical:vWe},natural:{curve:xWe},step:{curve:wWe},"step-after":{curve:_We},"step-before":{curve:SWe}};function Yue(e,t,n){var r=Qt(P_e,e)&&P_e[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const P9t={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},k9t=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,M9t=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,A9t=/^((\s+,?\s*)|(,\s*))/,R9t=/^[01]/;function iE(e){const t=[];return(e.match(k9t)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=P9t[o],a=I9t(o,s,r.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,v=f/n,y=-f/r,b=d/r,w=m*a+v*l,S=y*a+b*l,_=m*e+v*t,E=y*e+b*t;let k=1/((_-w)*(_-w)+(E-S)*(E-S))-.25;k<0&&(k=0);let P=Math.sqrt(k);o==i&&(P=-P);const I=.5*(w+_)-P*(E-S),R=.5*(S+E)+P*(_-w),F=Math.atan2(S-R,w-I);let L=Math.atan2(E-R,_-I)-F;L<0&&o===1?L+=mp:L>0&&o===0&&(L-=mp);const $=Math.ceil(Math.abs(L/(qx+.001))),j=[];for(let V=0;V<$;++V){const U=F+V*L/$,z=F+(V+1)*L/$;j[V]=[I,R,U,z,n,r,f,d]}return l7[c]=j}function F9t(e){const t=kHe.call(e);if(c7[t])return c7[t];var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7];const u=c*s,f=-l*a,d=l*s,h=c*a,p=Math.cos(i),g=Math.sin(i),m=Math.cos(o),v=Math.sin(o),y=.5*(o-i),b=Math.sin(y*.5),w=8/3*b*b/Math.sin(y),S=n+p-w*g,_=r+g+w*p,E=n+m,T=r+v,k=E+w*v,P=T-w*m;return c7[t]=[u*S+f*_,d*S+h*_,u*k+f*P,d*k+h*P,u*E+f*T,d*E+h*T]}const of=["l",0,0,0,0,0,0,0];function $9t(e,t,n){const r=of[0]=e[0];if(r==="a"||r==="A")of[1]=t*e[1],of[2]=n*e[2],of[3]=e[3],of[4]=e[4],of[5]=e[5],of[6]=t*e[6],of[7]=n*e[7];else if(r==="h"||r==="H")of[1]=t*e[1];else if(r==="v"||r==="V")of[1]=n*e[1];else for(var i=1,o=e.length;i+e}function Y$(e,t,n){return Math.max(t,Math.min(e,n))}function AHe(){var e=z9t,t=j9t,n=B9t,r=U9t,i=Gg(0),o=i,s=i,a=i,l=null;function c(u,f,d){var h,p=f??+e.call(this,u),g=d??+t.call(this,u),m=+n.call(this,u),v=+r.call(this,u),y=Math.min(m,v)/2,b=Y$(+i.call(this,u),0,y),w=Y$(+o.call(this,u),0,y),S=Y$(+s.call(this,u),0,y),_=Y$(+a.call(this,u),0,y);if(l||(l=h=UU()),b<=0&&w<=0&&S<=0&&_<=0)l.rect(p,g,m,v);else{var E=p+m,T=g+v;l.moveTo(p+b,g),l.lineTo(E-w,g),l.bezierCurveTo(E-py*w,g,E,g+py*w,E,g+w),l.lineTo(E,T-_),l.bezierCurveTo(E,T-py*_,E-py*_,T,E-_,T),l.lineTo(p+S,T),l.bezierCurveTo(p+py*S,T,p,T-py*S,p,T-S),l.lineTo(p,g+b),l.bezierCurveTo(p,g+py*b,p+py*b,g,p+b,g),l.closePath()}if(h)return l=null,h+""||null}return c.x=function(u){return arguments.length?(e=Gg(u),c):e},c.y=function(u){return arguments.length?(t=Gg(u),c):t},c.width=function(u){return arguments.length?(n=Gg(u),c):n},c.height=function(u){return arguments.length?(r=Gg(u),c):r},c.cornerRadius=function(u,f,d,h){return arguments.length?(i=Gg(u),o=f!=null?Gg(f):i,a=d!=null?Gg(d):i,s=h!=null?Gg(h):o,c):i},c.context=function(u){return arguments.length?(l=u??null,c):l},c}function RHe(){var e,t,n,r,i=null,o,s,a,l;function c(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var v=Math.hypot(g,m),y=(g/=v)*l,b=(m/=v)*l,w=Math.atan2(m,g);i.moveTo(s-y,a-b),i.lineTo(f-g*p,d-m*p),i.arc(f,d,p,w-Math.PI,w),i.lineTo(s+y,a+b),i.arc(s,a,l,w,w+Math.PI)}else i.arc(f,d,p,0,mp);i.closePath()}else o=1;s=f,a=d,l=p}function u(f){var d,h=f.length,p,g=!1,m;for(i==null&&(i=m=UU()),d=0;d<=h;++d)!(de.x||0,WD=e=>e.y||0,V9t=e=>e.width||0,W9t=e=>e.height||0,H9t=e=>(e.x||0)+(e.width||0),G9t=e=>(e.y||0)+(e.height||0),q9t=e=>e.startAngle||0,X9t=e=>e.endAngle||0,Y9t=e=>e.padAngle||0,Q9t=e=>e.innerRadius||0,K9t=e=>e.outerRadius||0,Z9t=e=>e.cornerRadius||0,J9t=e=>UD(e.cornerRadiusTopLeft,e.cornerRadius)||0,e7t=e=>UD(e.cornerRadiusTopRight,e.cornerRadius)||0,t7t=e=>UD(e.cornerRadiusBottomRight,e.cornerRadius)||0,n7t=e=>UD(e.cornerRadiusBottomLeft,e.cornerRadius)||0,r7t=e=>UD(e.size,64),i7t=e=>e.size||1,sV=e=>e.defined!==!1,o7t=e=>MHe(e.shape||"circle"),s7t=vHt().startAngle(q9t).endAngle(X9t).padAngle(Y9t).innerRadius(Q9t).outerRadius(K9t).cornerRadius(Z9t),a7t=DC().x(VD).y1(WD).y0(G9t).defined(sV),l7t=DC().y(WD).x1(VD).x0(H9t).defined(sV),c7t=uue().x(VD).y(WD).defined(sV),u7t=AHe().x(VD).y(WD).width(V9t).height(W9t).cornerRadius(J9t,e7t,t7t,n7t),f7t=rWe().type(o7t).size(r7t),d7t=RHe().x(VD).y(WD).defined(sV).size(i7t);function Que(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function h7t(e,t){return s7t.context(e)(t)}function p7t(e,t){const n=t[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?l7t:a7t).curve(Yue(r,n.orient,n.tension)).context(e)(t)}function g7t(e,t){const n=t[0],r=n.interpolate||"linear";return c7t.curve(Yue(r,n.orient,n.tension)).context(e)(t)}function YT(e,t,n,r){return u7t.context(e)(t,n,r)}function m7t(e,t){return(t.mark.shape||t.shape).context(e)(t)}function v7t(e,t){return f7t.context(e)(t)}function y7t(e,t){return d7t.context(e)(t)}var IHe=1;function b7t(){IHe=1}function Kue(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+IHe++),s=i.clipping[o]||(i.clipping[o]={id:o});return Jn(r)?s.path=r(null):Que(n)?s.path=YT(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function ws(e){this.clear(),e&&this.union(e)}ws.prototype={clone(){return new ws(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(e),l=Math.sin(e),c=t-t*a+n*l,u=n-t*l-n*a;return[a*r-l*i+c,l*r+a*i+u,a*r-l*s+c,l*r+a*s+u,a*o-l*i+c,l*o+a*i+u,a*o-l*s+c,l*o+a*s+u]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function aV(e){this.mark=e,this.bounds=this.bounds||new ws}function lV(e){aV.call(this,e),this.items=this.items||[]}Rt(lV,aV);class DHe{constructor(t){this._pending=0,this._loader=t||MU()}pending(){return this._pending}sanitizeURL(t){const n=this;return R_e(n),n._loader.sanitize(t,{context:"href"}).then(r=>(Uk(n),r)).catch(()=>(Uk(n),null))}loadImage(t){const n=this,r=WHt();return R_e(n),n._loader.sanitize(t,{context:"image"}).then(i=>{const o=i.href;if(!o||!r)throw{url:o};const s=new r,a=Qt(i,"crossOrigin")?i.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>Uk(n),s.onerror=()=>Uk(n),s.src=o,s}).catch(i=>(Uk(n),{complete:!1,width:0,height:0,src:i&&i.url||""}))}ready(){const t=this;return new Promise(n=>{function r(i){t.pending()?setTimeout(()=>{r(!0)},10):n(i)}r(!1)})}}function R_e(e){e._pending+=1}function Uk(e){e._pending-=1}function Pv(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const r=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(r+(n?x7t(t,r):0))}return e}function x7t(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const w7t=mp-1e-8;let cV,wz,Sz,c1,$te,_z,Nte,zte;const a0=(e,t)=>cV.add(e,t),Cz=(e,t)=>a0(wz=e,Sz=t),I_e=e=>a0(e,cV.y1),D_e=e=>a0(cV.x1,e),Xx=(e,t)=>$te*e+Nte*t,Yx=(e,t)=>_z*e+zte*t,f7=(e,t)=>a0(Xx(e,t),Yx(e,t)),d7=(e,t)=>Cz(Xx(e,t),Yx(e,t));function HD(e,t){return cV=e,t?(c1=t*Q0,$te=zte=Math.cos(c1),_z=Math.sin(c1),Nte=-_z):($te=zte=1,c1=_z=Nte=0),S7t}const S7t={beginPath(){},closePath(){},moveTo:d7,lineTo:d7,rect(e,t,n,r){c1?(f7(e+n,t),f7(e+n,t+r),f7(e,t+r),d7(e,t)):(a0(e+n,t+r),Cz(e,t))},quadraticCurveTo(e,t,n,r){const i=Xx(e,t),o=Yx(e,t),s=Xx(n,r),a=Yx(n,r);L_e(wz,i,s,I_e),L_e(Sz,o,a,D_e),Cz(s,a)},bezierCurveTo(e,t,n,r,i,o){const s=Xx(e,t),a=Yx(e,t),l=Xx(n,r),c=Yx(n,r),u=Xx(i,o),f=Yx(i,o);F_e(wz,s,l,u,I_e),F_e(Sz,a,c,f,D_e),Cz(u,f)},arc(e,t,n,r,i,o){if(r+=c1,i+=c1,wz=n*Math.cos(i)+e,Sz=n*Math.sin(i)+t,Math.abs(i-r)>w7t)a0(e-n,t-n),a0(e+n,t+n);else{const s=c=>a0(n*Math.cos(c)+e,n*Math.sin(c)+t);let a,l;if(s(r),s(i),i!==r)if(r=r%mp,r<0&&(r+=mp),i=i%mp,i<0&&(i+=mp),ii;++l,a-=qx)s(a);else for(a=r-r%qx+qx,l=0;l<4&&aD9t?(u=s*s+a*o,u>=0&&(u=Math.sqrt(u),l=(-s+u)/o,c=(-s-u)/o)):l=.5*a/s,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=$He(e,t,t.fill),!0):!1}var C7t=[];function sE(e,t,n){var r=(r=t.strokeWidth)!=null?r:1;return r<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=$He(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||C7t),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function O7t(e,t){return e.zindex-t.zindex||e.index-t.index}function efe(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],r,i,o;for(i=0,o=t.length;i=0;)if(r=t(n[i]))return r;if(n===o){for(n=e.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=t(n[i])))return r}return null}function tfe(e){return function(t,n,r){yh(n,i=>{(!r||r.intersects(i.bounds))&&NHe(e,t,i,i)})}}function E7t(e){return function(t,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&NHe(e,t,n.items[0],n.items)}}function NHe(e,t,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(e(t,r)||(oE(t,n),n.fill&&Tj(t,n,i)&&t.fill(),n.stroke&&sE(t,n,i)&&t.stroke()))}function uV(e){return e=e||Qf,function(t,n,r,i,o,s){return r*=t.pixelRatio,i*=t.pixelRatio,Pj(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&e(t,a,r,i,o,s))return a})}}function GD(e,t){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=t??s.fill,l=s.stroke&&n.isPointInStroke,c,u;return l&&(c=s.strokeWidth,u=s.strokeCap,n.lineWidth=c??1,n.lineCap=u??"butt"),e(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function nfe(e){return uV(GD(e))}function A1(e,t){return"translate("+e+","+t+")"}function rfe(e){return"rotate("+e+")"}function T7t(e,t){return"scale("+e+","+t+")"}function zHe(e){return A1(e.x||0,e.y||0)}function P7t(e){return A1(e.x||0,e.y||0)+(e.angle?" "+rfe(e.angle):"")}function k7t(e){return A1(e.x||0,e.y||0)+(e.angle?" "+rfe(e.angle):"")+(e.scaleX||e.scaleY?" "+T7t(e.scaleX||1,e.scaleY||1):"")}function ife(e,t,n){function r(s,a){s("transform",P7t(a)),s("d",t(null,a))}function i(s,a){return t(HD(s,a.angle),a),Pv(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,c=a.y||0,u=a.angle||0;s.translate(l,c),u&&s.rotate(u*=Q0),s.beginPath(),t(s,a),u&&s.rotate(-u),s.translate(-l,-c)}return{type:e,tag:"path",nested:!1,attr:r,bound:i,draw:tfe(o),pick:nfe(o),isect:n||Zue(o)}}var M7t=ife("arc",h7t);function A7t(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],r=e[0].orient==="horizontal"?"y":"x",i=e.length,o=1/0,s,a;--i>=0;)e[i].defined!==!1&&(a=Math.abs(e[i][r]-n),a=0;)if(e[r].defined!==!1&&(i=e[r].x-t[0],o=e[r].y-t[1],s=i*i+o*o,s=0;)if(e[n].defined!==!1&&(r=e[n].x-t[0],i=e[n].y-t[1],o=r*r+i*i,r=e[n].size||1,o.5&&t<1.5?.5-Math.abs(t-1):0}function F7t(e,t){e("transform",zHe(t))}function UHe(e,t){const n=BHe(t);e("d",YT(null,t,n,n))}function $7t(e,t){e("class","background"),e("aria-hidden",!0),UHe(e,t)}function N7t(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?UHe(e,t):e("d","")}function z7t(e,t,n){const r=t.clip?Kue(n,t,t):null;e("clip-path",r)}function j7t(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let i=0;i{const o=i.x||0,s=i.y||0,a=i.strokeForeground,l=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&l&&(rR(e,i,o,s),oE(e,i),i.fill&&Tj(e,i,l)&&e.fill(),i.stroke&&!a&&sE(e,i,l)&&e.stroke()),e.save(),e.translate(o,s),i.clip&&jHe(e,i),n&&n.translate(-o,-s),yh(i,c=>{(c.marktype==="group"||r==null||r.includes(c.marktype))&&this.draw(e,c,n,r)}),n&&n.translate(o,s),e.restore(),a&&i.stroke&&l&&(rR(e,i,o,s),oE(e,i),sE(e,i,l)&&e.stroke())})}function H7t(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const s=n*e.pixelRatio,a=r*e.pixelRatio;return Pj(t,l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(i,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(ih||op))return;if(e.save(),e.translate(u,f),u=i-u,f=o-f,g&&Que(l)&&!V7t(e,l,s,a))return e.restore(),null;const m=l.strokeForeground,v=t.interactive!==!1;return v&&m&&l.stroke&&U7t(e,l,s,a)?(e.restore(),l):(c=Pj(l,y=>G7t(y,u,f)?this.pick(y,n,r,u,f):null),!c&&v&&(l.fill||!m&&l.stroke)&&B7t(e,l,s,a)&&(c=l),e.restore(),c||null)})}function G7t(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var q7t={type:"group",tag:"g",nested:!1,attr:F7t,bound:j7t,draw:W7t,pick:H7t,isect:LHe,content:z7t,background:$7t,foreground:N7t},iR={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function sfe(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(r=>{e.image=r,e.image.url=e.url})),n}function afe(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function lfe(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function fV(e,t){return e==="center"?t/2:e==="right"?t:0}function dV(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function X7t(e,t,n){const r=sfe(t,n),i=afe(t,r),o=lfe(t,r),s=(t.x||0)-fV(t.align,i),a=(t.y||0)-dV(t.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";e("href",l,iR["xmlns:xlink"],"xlink:href"),e("transform",A1(s,a)),e("width",i),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function Y7t(e,t){const n=t.image,r=afe(t,n),i=lfe(t,n),o=(t.x||0)-fV(t.align,r),s=(t.y||0)-dV(t.baseline,i);return e.set(o,s,o+r,s+i)}function Q7t(e,t,n){yh(t,r=>{if(n&&!n.intersects(r.bounds))return;const i=sfe(r,this);let o=afe(r,i),s=lfe(r,i);if(o===0||s===0)return;let a=(r.x||0)-fV(r.align,o),l=(r.y||0)-dV(r.baseline,s),c,u,f,d;r.aspect!==!1&&(u=i.width/i.height,f=r.width/r.height,u===u&&f===f&&u!==f&&(f{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&VHe(e,r,i)&&(oE(e,r),e.stroke())}})}function lqt(e,t,n,r){return e.isPointInStroke?VHe(e,t,1)&&e.isPointInStroke(n,r):!1}var cqt={type:"rule",tag:"line",nested:!1,attr:oqt,bound:sqt,draw:aqt,pick:uV(lqt),isect:FHe},uqt=ife("shape",m7t),fqt=ife("symbol",v7t,Jue);const j_e=XUe();var Au={height:bg,measureWidth:cfe,estimateWidth:kj,width:kj,canvas:WHe};WHe(!0);function WHe(e){Au.width=e&&R0?cfe:kj}function kj(e,t){return HHe(Z0(e,t),bg(e))}function HHe(e,t){return~~(.8*e.length*t)}function cfe(e,t){return bg(e)<=0||!(t=Z0(e,t))?0:GHe(t,hV(e))}function GHe(e,t){const n=`(${t}) ${e}`;let r=j_e.get(n);return r===void 0&&(R0.font=t,r=R0.measureText(e).width,j_e.set(n,r)),r}function bg(e){return e.fontSize!=null?+e.fontSize||0:11}function K0(e){return e.lineHeight!=null?e.lineHeight:bg(e)+2}function dqt(e){return it(e)?e.length>1?e:e[0]:e}function qD(e){return dqt(e.lineBreak&&e.text&&!it(e.text)?e.text.split(e.lineBreak):e.text)}function ufe(e){const t=qD(e);return(it(t)?t.length-1:0)*K0(e)}function Z0(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?pqt(e,n):n}function hqt(e){if(Au.width===cfe){const t=hV(e);return n=>GHe(n,t)}else if(Au.width===kj){const t=bg(e);return n=>HHe(n,t)}else return t=>Au.width(e,t)}function pqt(e,t){var n=+e.limit,r=hqt(e);if(r(t)>>1,r(t.slice(l))>n?s=l+1:a=l;return i+t.slice(s)}else{for(;s>>1),r(t.slice(0,l))Math.max(d,Au.width(t,h)),0)):f=Au.width(t,u),i==="center"?l-=f/2:i==="right"&&(l-=f),e.set(l+=s,c+=a,l+f,c+r),t.angle&&!n)e.rotate(t.angle*Q0,s,a);else if(n===2)return e.rotatedPoints(t.angle*Q0,s,a);return e}function vqt(e,t,n){yh(t,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,c,u,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(e.font=hV(r),e.textAlign=r.align||"left",o=pV(r),s=o.x1,a=o.y1,r.angle&&(e.save(),e.translate(s,a),e.rotate(r.angle*Q0),s=a=0),s+=r.dx||0,a+=(r.dy||0)+ffe(r),u=qD(r),oE(e,r),it(u))for(c=K0(r),l=0;lt;)e.removeChild(n[--r]);return e}function ZHe(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function gV(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function _qt(e,t,n,r){var i=e&&e.mark,o,s;if(i&&(o=Uu[i.marktype]).tip){for(s=gV(t,n),s[0]-=r[0],s[1]-=r[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(i.items,s)}return e}let pfe=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||MU(),this._tooltip=n||Cqt}initialize(t,n,r){return this._el=t,this._obj=r||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,r){for(let i=t?t.length:0;--i>=0;)if(t[i].type===n&&(!r||t[i].handler===r))return i;return-1}handlers(t){const n=this._handlers,r=[];if(t)r.push(...n[this.eventName(t)]);else for(const i in n)r.push(...n[i]);return r}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,r){this._loader.sanitize(r,{context:"href"}).then(i=>{const o=new MouseEvent(t.type,t),s=l0(null,"a");for(const a in i)s.setAttribute(a,i[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(t,n,r){if(n&&n.tooltip!=null){n=_qt(n,t,this.canvas(),this._origin);const i=r&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,i)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const r=n.getBoundingClientRect(),i=this._origin,o=t.bounds,s=o.width(),a=o.height();let l=o.x1+i[0]+r.left,c=o.y1+i[1]+r.top;for(;t.mark&&(t=t.mark.group);)l+=t.x||0,c+=t.y||0;return{x:l,y:c,width:s,height:a,left:l,top:c,right:l+s,bottom:c+a}}};function Cqt(e,t,n,r){e.element().setAttribute("title",r||"")}class YD{constructor(t){this._el=null,this._bgcolor=null,this._loader=new DHe(t)}initialize(t,n,r,i,o){return this._el=t,this.resize(n,r,i,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,r,i){return this._width=t,this._height=n,this._origin=r||[0,0],this._scale=i||1,this}dirty(){}render(t,n){const r=this;return r._call=function(){r._render(t,n)},r._call(),r._call=null,r}_render(){}renderAsync(t,n){const r=this.render(t,n);return this._ready?this._ready.then(()=>r):Promise.resolve(r)}_load(t,n){var r=this,i=r._loader[t](n);if(!r._ready){const o=r._call;r._ready=r._loader.ready().then(s=>{s&&o(),r._ready=null})}return i}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const Oqt="keydown",Eqt="keypress",Tqt="keyup",JHe="dragenter",Ez="dragleave",eGe="dragover",Ute="pointerdown",Pqt="pointerup",Mj="pointermove",Tz="pointerout",tGe="pointerover",Vte="mousedown",kqt="mouseup",nGe="mousemove",Aj="mouseout",rGe="mouseover",Rj="click",Mqt="dblclick",Aqt="wheel",iGe="mousewheel",Ij="touchstart",Dj="touchmove",Lj="touchend",Rqt=[Oqt,Eqt,Tqt,JHe,Ez,eGe,Ute,Pqt,Mj,Tz,tGe,Vte,kqt,nGe,Aj,rGe,Rj,Mqt,Aqt,iGe,Ij,Dj,Lj],Wte=Mj,jM=Aj,Hte=Rj;class QD extends pfe{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=Rqt,this.pointermove=W_e([Mj,nGe],[tGe,rGe],[Tz,Aj]),this.dragover=W_e([eGe],[JHe],[Ez]),this.pointerout=H_e([Tz,Aj]),this.dragleave=H_e([Ez])}initialize(t,n,r){return this._canvas=t&&hfe(t,"canvas"),[Rj,Vte,Ute,Mj,Tz,Ez].forEach(i=>V_e(this,i)),super.initialize(t,n,r)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(iGe,t)}pointerdown(t){this._down=this._active,this.fire(Ute,t)}mousedown(t){this._down=this._active,this.fire(Vte,t)}click(t){this._down===this._active&&(this.fire(Rj,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Ij,t,!0)}touchmove(t){this.fire(Dj,t,!0)}touchend(t){this.fire(Lj,t,!0),this._touch=null}fire(t,n,r){const i=r?this._touch:this._active,o=this._handlers[t];if(n.vegaType=t,t===Hte&&i&&i.href?this.handleHref(n,i,i.href):(t===Wte||t===jM)&&this.handleTooltip(n,i,t!==jM),o)for(let s=0,a=o.length;s=0&&i.splice(o,1),this}pickEvent(t){const n=gV(t,this._canvas),r=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-r[0],n[1]-r[1])}pick(t,n,r,i,o){const s=this.context();return Uu[t.marktype].pick.call(this,s,t,n,r,i,o)}}const Iqt=e=>e===Ij||e===Dj||e===Lj?[Ij,Dj,Lj]:[e];function V_e(e,t){Iqt(t).forEach(n=>Dqt(e,n))}function Dqt(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?r=>e[t](r):r=>e.fire(t,r)))}function tM(e,t,n){t.forEach(r=>e.fire(r,n))}function W_e(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?tM(this,e,r):((!i||!i.exit)&&tM(this,n,r),this._active=o,tM(this,t,r),tM(this,e,r))}}function H_e(e){return function(t){tM(this,e,t),this._active=null}}function Lqt(){return typeof window<"u"&&window.devicePixelRatio||1}function Fqt(e,t,n,r,i,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),l=s?Lqt():i;e.width=t*l,e.height=n*l;for(const c in o)a[c]=o[c];return s&&l!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),e}class Fj extends YD{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new ws,this._tempb=new ws}initialize(t,n,r,i,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:A0(1,1,this._options.type),t&&this._canvas&&(mf(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,r,i,o)}resize(t,n,r,i){if(super.resize(t,n,r,i),this._canvas)Fqt(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||et("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let r=t.mark.group;for(;r;)n.translate(r.x||0,r.y||0),r=r.mark.group;this._dirty.union(n)}_render(t,n){const r=this.context(),i=this._origin,o=this._width,s=this._height,a=this._dirty,l=$qt(i,o,s);r.save();const c=this._redraw||a.empty()?(this._redraw=!1,l.expand(1)):Nqt(r,l.intersect(a),i);return this.clear(-i[0],-i[1],o,s),this.draw(r,t,c,n),r.restore(),a.clear(),this}draw(t,n,r,i){if(n.marktype!=="group"&&i!=null&&!i.includes(n.marktype))return;const o=Uu[n.marktype];n.clip&&L7t(t,n),o.draw.call(this,t,n,r,i),n.clip&&t.restore()}clear(t,n,r,i){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(t,n,r,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(t,n,r,i))}}const $qt=(e,t,n)=>new ws().set(0,0,t,n).translate(-e[0],-e[1]);function Nqt(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class oGe extends pfe{constructor(t,n){super(t,n);const r=this;r._hrefHandler=h7(r,(i,o)=>{o&&o.href&&r.handleHref(i,o,o.href)}),r._tooltipHandler=h7(r,(i,o)=>{r.handleTooltip(i,o,i.type!==jM)})}initialize(t,n,r){let i=this._svg;return i&&(i.removeEventListener(Hte,this._hrefHandler),i.removeEventListener(Wte,this._tooltipHandler),i.removeEventListener(jM,this._tooltipHandler)),this._svg=i=t&&hfe(t,"svg"),i&&(i.addEventListener(Hte,this._hrefHandler),i.addEventListener(Wte,this._tooltipHandler),i.addEventListener(jM,this._tooltipHandler)),super.initialize(t,n,r)}canvas(){return this._svg}on(t,n){const r=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[r],t,n)<0){const s={type:t,handler:n,listener:h7(this,n)};(i[r]||(i[r]=[])).push(s),this._svg&&this._svg.addEventListener(r,s.listener)}return this}off(t,n){const r=this.eventName(t),i=this._handlers[r],o=this._handlerIndex(i,t,n);return o>=0&&(this._svg&&this._svg.removeEventListener(r,i[o].listener),i.splice(o,1)),this}}const h7=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)},sGe="aria-hidden",gfe="aria-label",mfe="role",vfe="aria-roledescription",aGe="graphics-object",yfe="graphics-symbol",lGe=(e,t,n)=>({[mfe]:e,[vfe]:t,[gfe]:n||void 0}),zqt=mh(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),G_e={axis:{desc:"axis",caption:Uqt},legend:{desc:"legend",caption:Vqt},"title-text":{desc:"title",caption:e=>`Title text '${X_e(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${X_e(e)}'`}},q_e={ariaRole:mfe,ariaRoleDescription:vfe,description:gfe};function cGe(e,t){const n=t.aria===!1;if(e(sGe,n||void 0),n||t.description==null)for(const r in q_e)e(q_e[r],void 0);else{const r=t.mark.marktype;e(gfe,t.description),e(mfe,t.ariaRole||(r==="group"?aGe:yfe)),e(vfe,t.ariaRoleDescription||`${r} mark`)}}function uGe(e){return e.aria===!1?{[sGe]:!0}:zqt[e.role]?null:G_e[e.role]?Bqt(e,G_e[e.role]):jqt(e)}function jqt(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(r=>r.description!=null&&r.aria!==!1);return lGe(n?aGe:yfe,`${t} mark container`,e.description)}function Bqt(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return lGe(t.role||yfe,t.desc,n.description||r(n))}catch{return null}}function X_e(e){return Ht(e.text).join(" ")}function Uqt(e){const t=e.datum,n=e.orient,r=t.title?fGe(e):null,i=e.context,o=i.scales[t.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${rE(a)?"discrete":a} scale with ${OHe(s,o,e)}`}function Vqt(e){const t=e.datum,n=t.title?fGe(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),s=e.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return Hqt(r)+(n?` titled '${n}'`:"")+` for ${Wqt(o)} with ${OHe(l,a,e)}`}function fGe(e){try{return Ht(Ar(e.items).items[0].text).join(" ")}catch{return null}}function Wqt(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ar(e)}function Hqt(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const dGe=e=>(e+"").replace(/&/g,"&").replace(//g,">"),Gqt=e=>dGe(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function bfe(){let e="",t="",n="";const r=[],i=()=>t=n="",o=l=>{t&&(e+=`${t}>${n}`,i()),r.push(l)},s=(l,c)=>(c!=null&&(t+=` ${l}="${Gqt(c)}"`),a),a={open(l,...c){o(l),t="<"+l;for(const u of c)for(const f in u)s(f,u[f]);return a},close(){const l=r.pop();return t?e+=t+(n?`>${n}`:"/>"):e+=``,i(),a},attr:s,text:l=>(n+=dGe(l),a),toString:()=>e};return a}const hGe=e=>pGe(bfe(),e)+"";function pGe(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let i=0;i{u.dirty=n})),!i.zdirty){if(r.exit){s.nested&&i.items.length?(c=i.items[0],c._svg&&this._update(s,c._svg,c)):r._svg&&(c=r._svg.parentNode,c&&c.removeChild(r._svg)),r._svg=null;continue}r=s.nested?i.items[0]:r,r._update!==n&&(!r._svg||!r._svg.ownerSVGElement?(this._dirtyAll=!1,Q_e(r,n)):this._update(s,r._svg,r),r._update=n)}return!this._dirtyAll}mark(t,n,r,i){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Uu[s],l=n.interactive===!1?"none":null,c=a.tag==="g",u=K_e(n,t,r,"g",o);if(s!=="group"&&i!=null&&!i.includes(s))return mf(u,0),n._svg;u.setAttribute("class",ZHe(n));const f=uGe(n);for(const g in f)Pl(u,g,f[g]);c||Pl(u,"pointer-events",l),Pl(u,"clip-path",n.clip?Kue(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),v=K_e(g,u,d,a.tag,o);m&&(this._update(a,v,g),c&&Yqt(this,v,g,i)),d=v,++h};return a.nested?n.items.length&&p(n.items[0]):yh(n,p),mf(u,h),u}_update(t,n,r){Dm=n,nl=n.__values__,cGe(BM,r),t.attr(BM,r,this);const i=Kqt[t.type];i&&i.call(this,t,n,r),Dm&&this.style(Dm,r)}style(t,n){if(n!=null){for(const r in $j){let i=r==="font"?XD(n):n[r];if(i===nl[r])continue;const o=$j[r];i==null?t.removeAttribute(o):(Xue(i)&&(i=THe(i,this._defs.gradient,mGe())),t.setAttribute(o,i+"")),nl[r]=i}for(const r in Nj)Pz(t,Nj[r],n[r])}}defs(){const t=this._svg,n=this._defs;let r=n.el,i=0;for(const o in n.gradient)r||(n.el=r=As(t,Vk+1,"defs",Ms)),i=qqt(r,n.gradient[o],i);for(const o in n.clipping)r||(n.el=r=As(t,Vk+1,"defs",Ms)),i=Xqt(r,n.clipping[o],i);r&&(i===0?(t.removeChild(r),n.el=null):mf(r,i))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function Q_e(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function qqt(e,t,n){let r,i,o;if(t.gradient==="radial"){let s=As(e,n++,"pattern",Ms);c0(s,{id:Ej+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=As(s,0,"rect",Ms),c0(s,{width:1,height:1,fill:`url(${mGe()}#${t.id})`}),e=As(e,n++,"radialGradient",Ms),c0(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=As(e,n++,"linearGradient",Ms),c0(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r{i=e.mark(t,s,i,r),++o}),mf(t,1+o)}function K_e(e,t,n,r,i){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=l0(s,r,Ms),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},r==="g"))){const a=l0(s,"path",Ms);o.appendChild(a),a.__data__=e;const l=l0(s,"g",Ms);o.appendChild(l),l.__data__=e;const c=l0(s,"path",Ms);o.appendChild(c),c.__data__=e,c.__values__={fill:"default"}}return(o.ownerSVGElement!==i||Qqt(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function Qqt(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Dm=null,nl=null;const Kqt={group(e,t,n){const r=Dm=t.childNodes[2];nl=r.__values__,e.foreground(BM,n,this),nl=t.__values__,Dm=t.childNodes[1],e.content(BM,n,this);const i=Dm=t.childNodes[0];e.background(BM,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==nl.events&&(Pl(r,"pointer-events",o),Pl(i,"pointer-events",o),nl.events=o),n.strokeForeground&&n.stroke){const s=n.fill;Pl(r,"display",null),this.style(i,n),Pl(i,"stroke",null),s&&(n.fill=null),nl=r.__values__,this.style(r,n),s&&(n.fill=s),Dm=null}else Pl(r,"display","none")},image(e,t,n){n.smooth===!1?(Pz(t,"image-rendering","optimizeSpeed"),Pz(t,"image-rendering","pixelated")):Pz(t,"image-rendering",null)},text(e,t,n){const r=qD(n);let i,o,s,a;it(r)?(o=r.map(l=>Z0(n,l)),i=o.join(` +`),i!==nl.text&&(mf(t,0),s=t.ownerDocument,a=K0(n),o.forEach((l,c)=>{const u=l0(s,"tspan",Ms);u.__data__=n,u.textContent=l,c&&(u.setAttribute("x",0),u.setAttribute("dy",a)),t.appendChild(u)}),nl.text=i)):(o=Z0(n,r),o!==nl.text&&(t.textContent=o,nl.text=o)),Pl(t,"font-family",XD(n)),Pl(t,"font-size",bg(n)+"px"),Pl(t,"font-style",n.fontStyle),Pl(t,"font-variant",n.fontVariant),Pl(t,"font-weight",n.fontWeight)}};function BM(e,t,n){t!==nl[e]&&(n?Zqt(Dm,e,t,n):Pl(Dm,e,t),nl[e]=t)}function Pz(e,t,n){n!==nl[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),nl[t]=n)}function c0(e,t){for(const n in t)Pl(e,n,t[n])}function Pl(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function Zqt(e,t,n,r){n!=null?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}function mGe(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class vGe extends YD{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=bfe();n.open("svg",rr({},iR,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const r=this._bgcolor;return r&&r!=="transparent"&&r!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:r}).close(),n.open("g",gGe,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const r=Uu[n.marktype],i=r.tag,o=[cGe,r.attr];t.open("g",{class:ZHe(n),"clip-path":n.clip?Kue(this,n,n.group):null},uGe(n),{"pointer-events":i!=="g"&&n.interactive===!1?"none":null});const s=a=>{const l=this.href(a);if(l&&t.open("a",l),t.open(i,this.attr(n,a,o,i!=="g"?i:null)),i==="text"){const c=qD(a);if(it(c)){const u={x:0,dy:K0(a)};for(let f=0;fthis.mark(t,d)),t.close(),c&&f?(u&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,r.foreground,"bgrect")).close(),u&&(a.fill=u)):t.open("path",this.attr(n,a,r.foreground,"bgfore")).close()}t.close(),l&&t.close()};return r.nested?n.items&&n.items.length&&s(n.items[0]):yh(n,s),t.close()}href(t){const n=t.href;let r;if(n){if(r=this._hrefs&&this._hrefs[n])return r;this.sanitizeURL(n).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[n]=i})}return null}attr(t,n,r,i){const o={},s=(a,l,c,u)=>{o[u||a]=l};return Array.isArray(r)?r.forEach(a=>a(s,n,this)):r(s,n,this),i&&Jqt(o,n,t,i,this._defs),o}defs(t){const n=this._defs.gradient,r=this._defs.clipping;if(Object.keys(n).length+Object.keys(r).length!==0){t.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(t.open("pattern",{id:Ej+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):t.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let l=0;l!$d.svgMarkTypes.includes(o));this._svgRenderer.render(t,$d.svgMarkTypes),this._canvasRenderer.render(t,i)}resize(t,n,r,i){return super.resize(t,n,r,i),this._svgRenderer.resize(t,n,r,i),this._canvasRenderer.resize(t,n,r,i),this}background(t){return $d.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class yGe extends QD{constructor(t,n){super(t,n)}initialize(t,n,r){const i=As(As(t,0,"div"),$d.svgOnTop?0:1,"div");return super.initialize(i,n,r)}}const bGe="canvas",xGe="hybrid",wGe="png",SGe="svg",_Ge="none",u0={Canvas:bGe,PNG:wGe,SVG:SGe,Hybrid:xGe,None:_Ge},uw={};uw[bGe]=uw[wGe]={renderer:Fj,headless:Fj,handler:QD};uw[SGe]={renderer:xfe,headless:vGe,handler:oGe};uw[xGe]={renderer:Gte,headless:Gte,handler:yGe};uw[_Ge]={};function mV(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(uw[e]=t,this):uw[e]}function CGe(e,t,n){const r=[],i=new ws().union(t),o=e.marktype;return o?OGe(e,i,n,r):o==="group"?EGe(e,i,n,r):et("Intersect scene must be mark node or group item.")}function OGe(e,t,n,r){if(tXt(e,t,n)){const i=e.items,o=e.marktype,s=i.length;let a=0;if(o==="group")for(;a=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!wfe(e[i],t[i],i))return!1;return typeof e==typeof t}function iXt(){b7t(),T9t()}const aE="top",Qd="left",Zd="right",J0="bottom",oXt="top-left",sXt="top-right",aXt="bottom-left",lXt="bottom-right",Sfe="start",qte="middle",kl="end",cXt="x",uXt="y",vV="group",_fe="axis",Cfe="title",fXt="frame",dXt="scope",Ofe="legend",MGe="row-header",AGe="row-footer",RGe="row-title",IGe="column-header",DGe="column-footer",LGe="column-title",hXt="padding",pXt="symbol",FGe="fit",$Ge="fit-x",NGe="fit-y",gXt="pad",Efe="none",Q$="all",Xte="each",Tfe="flush",f0="column",d0="row";function zGe(e){Je.call(this,null,e)}Rt(zGe,Je,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=Uu[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=K$(r,s),r.items.forEach(c=>{c.bounds.clear().union(a)});else if(i===vV||e.modified())switch(t.visit(t.MOD,c=>n.dirty(c)),a.clear(),r.items.forEach(c=>a.union(K$(c,s))),r.role){case _fe:case Ofe:case Cfe:t.reflow()}else l=t.changed(t.REM),t.visit(t.ADD,c=>{a.union(K$(c,s))}),t.visit(t.MOD,c=>{l=l||a.alignsWith(c.bounds),n.dirty(c),a.union(K$(c,s))}),l&&(a.clear(),r.items.forEach(c=>a.union(c.bounds)));return PGe(r),t.modifies("bounds")}});function K$(e,t,n){return t(e.bounds.clear(),e,n)}const Z_e=":vega_identifier:";function Pfe(e){Je.call(this,0,e)}Pfe.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};Rt(Pfe,Je,{transform(e,t){const n=mXt(t.dataflow),r=e.as;let i=n.value;return t.visit(t.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),t}});function mXt(e){return e._signals[Z_e]||(e._signals[Z_e]=e.add(0))}function jGe(e){Je.call(this,null,e)}Rt(jGe,Je,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,vXt(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===vV?lV:aV;return t.visit(t.ADD,i=>r.call(i,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function vXt(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function BGe(e){Je.call(this,null,e)}const J_e={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((r,i)=>!i||!UGe(n.bounds,r.bounds,t)?(n=r,1):r.opacity=0)}},UGe=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),eCe=(e,t)=>{for(var n=1,r=e.length,i=e[0].bounds,o;n{const t=e.bounds;return t.width()>1&&t.height()>1},bXt=(e,t,n)=>{var r=e.range(),i=new ws;return t===aE||t===J0?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},tCe=e=>(e.forEach(t=>t.opacity=1),e),nCe=(e,t)=>e.reflow(t.modified()).modifies("opacity");Rt(BGe,Je,{transform(e,t){const n=J_e[e.method]||J_e.parity,r=e.separation||0;let i=t.materialize(t.SOURCE).source,o,s;if(!i||!i.length)return;if(!e.method)return e.modified("method")&&(tCe(i),t=nCe(t,e)),t;if(i=i.filter(yXt),!i.length)return;if(e.sort&&(i=i.slice().sort(e.sort)),o=tCe(i),t=nCe(t,e),o.length>=3&&eCe(o,r)){do o=n(o,r);while(o.length>=3&&eCe(o,r));o.length<3&&!Ar(i).opacity&&(o.length>1&&(Ar(o).opacity=0),Ar(i).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=bXt(e.boundScale,e.boundOrient,+e.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),t}});function VGe(e){Je.call(this,null,e)}Rt(VGe,Je,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,r=>n.dirty(r)),t.fields&&t.fields.zindex){const r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});const Ja=new ws;function FC(e,t,n){return e[t]===n?0:(e[t]=n,1)}function xXt(e){var t=e.items[0].orient;return t===Qd||t===Zd}function wXt(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function SXt(e,t,n,r){var i=t.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=wXt(o),c=i.range,u=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,m=i.bounds,v=p&&ufe(p),y=0,b=0,w,S;switch(Ja.clear().union(m),m.clear(),(w=l[0])>-1&&m.union(i.items[w].bounds),(w=l[1])>-1&&m.union(i.items[w].bounds),a){case aE:y=f||0,b=-u,S=Math.max(d,Math.min(h,-m.y1)),m.add(0,-S).add(c,0),p&&Z$(e,p,S,g,v,0,-1,m);break;case Qd:y=-u,b=f||0,S=Math.max(d,Math.min(h,-m.x1)),m.add(-S,0).add(0,c),p&&Z$(e,p,S,g,v,1,-1,m);break;case Zd:y=n+u,b=f||0,S=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(S,c),p&&Z$(e,p,S,g,v,1,1,m);break;case J0:y=f||0,b=r+u,S=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(c,S),p&&Z$(e,p,S,g,0,0,1,m);break;default:y=i.x,b=i.y}return Pv(m.translate(y,b),i),FC(i,"x",y+s)|FC(i,"y",b+s)&&(i.bounds=Ja,e.dirty(i),i.bounds=m,e.dirty(i)),i.mark.bounds.clear().union(m)}function Z$(e,t,n,r,i,o,s,a){const l=t.bounds;if(t.auto){const c=s*(n+i+r);let u=0,f=0;e.dirty(t),o?u=(t.x||0)-(t.x=c):f=(t.y||0)-(t.y=c),t.mark.bounds.clear().union(l.translate(-u,-f)),e.dirty(t)}a.union(l)}const rCe=(e,t)=>Math.floor(Math.min(e,t)),iCe=(e,t)=>Math.ceil(Math.max(e,t));function _Xt(e){var t=e.items,n=t.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(E=0;E0&&(b[E]+=A/2);if(a&&mo(n.center,d0)&&u!==1)for(E=0;E0&&(w[E]+=L/2);for(E=0;Ei&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),g+=o,y=0,w=t.length;y=0&&(E=n[b])==null;b-=d);a?(T=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),k=g):(T=g,k=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),S.union(_.bounds.translate(T-(_.x||0),k-(_.y||0))),_.x=T,_.y=k,e.dirty(_),m=s(m,S[c])}return m}function sCe(e,t,n,r,i,o){if(t){e.dirty(t);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function kXt(e,t){const n=e[t]||{};return(r,i)=>n[r]!=null?n[r]:e[r]!=null?e[r]:i}function MXt(e,t){let n=-1/0;return e.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:t}function AXt(e,t,n,r,i,o,s){const a=kXt(n,t),l=MXt(e,a("offset",0)),c=a("anchor",Sfe),u=c===kl?1:c===qte?.5:0,f={align:Xte,bounds:a("bounds",Tfe),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case Qd:f.anchor={x:Math.floor(r.x1)-l,column:kl,y:u*(s||r.height()+2*r.y1),row:c};break;case Zd:f.anchor={x:Math.ceil(r.x2)+l,y:u*(s||r.height()+2*r.y1),row:c};break;case aE:f.anchor={y:Math.floor(i.y1)-l,row:kl,x:u*(o||i.width()+2*i.x1),column:c};break;case J0:f.anchor={y:Math.ceil(i.y2)+l,x:u*(o||i.width()+2*i.x1),column:c};break;case oXt:f.anchor={x:l,y:l};break;case sXt:f.anchor={x:o-l,y:l,column:kl};break;case aXt:f.anchor={x:l,y:s-l,row:kl};break;case lXt:f.anchor={x:o-l,y:s-l,column:kl,row:kl};break}return f}function RXt(e,t){var n=t.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,c;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),DXt(e,n,n.items[0].items[0]),o=IXt(n,o),l=2*n.padding,c=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),c=Math.ceil(o.height()+c)),r.type===pXt&&LXt(n.items[0].items[0].items[0].items),i!==Efe&&(n.x=s=0,n.y=a=0),n.width=l,n.height=c,Pv(o.set(s,a,s+l,a+c),n),n.mark.bounds.clear().union(o),n}function IXt(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function DXt(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(!t.datum.title)(i||o)&&Wk(e,n,i,o);else{var s=t.items[1].items[0],a=s.anchor,l=t.titlePadding||0,c=r-s.x,u=r-s.y;switch(s.orient){case Qd:i+=Math.ceil(s.bounds.width())+l;break;case Zd:case J0:break;default:o+=s.bounds.height()+l}switch((i||o)&&Wk(e,n,i,o),s.orient){case Qd:u+=C_(t,n,s,a,1,1);break;case Zd:c+=C_(t,n,s,kl,0,0)+l,u+=C_(t,n,s,a,1,1);break;case J0:c+=C_(t,n,s,a,0,0),u+=C_(t,n,s,kl,-1,0,1)+l;break;default:c+=C_(t,n,s,a,0,0)}(c||u)&&Wk(e,s,c,u),(c=Math.round(s.bounds.x1-r))<0&&(Wk(e,n,-c,0),Wk(e,s,-c,0))}}function C_(e,t,n,r,i,o,s){const a=e.datum.type!=="symbol",l=n.datum.vgrad,c=a&&(o||!l)&&!s?t.items[0]:t,u=c.bounds[i?"y2":"x2"]-e.padding,f=l&&o?u:0,d=l&&o?0:u,h=i<=0?0:ufe(n);return Math.round(r===Sfe?f:r===kl?d-h:.5*(u-h))}function Wk(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function LXt(e){const t=e.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function FXt(e,t,n,r,i){var o=t.items[0],s=o.frame,a=o.orient,l=o.anchor,c=o.offset,u=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Qd||a===Zd?r:n,p=0,g=0,m=0,v=0,y=0,b;if(s!==vV?a===Qd?(p=i.y2,h=i.y1):a===Zd?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===Qd&&(p=r,h=0),b=l===Sfe?p:l===kl?h:(p+h)/2,d&&d.text){switch(a){case aE:case J0:y=f.bounds.height()+u;break;case Qd:v=f.bounds.width()+u;break;case Zd:v=-f.bounds.width()-u;break}Ja.clear().union(d.bounds),Ja.translate(v-(d.x||0),y-(d.y||0)),FC(d,"x",v)|FC(d,"y",y)&&(e.dirty(d),d.bounds.clear().union(Ja),d.mark.bounds.clear().union(Ja),e.dirty(d)),Ja.clear().union(d.bounds)}else Ja.clear();switch(Ja.union(f.bounds),a){case aE:g=b,m=i.y1-Ja.height()-c;break;case Qd:g=i.x1-Ja.width()-c,m=b;break;case Zd:g=i.x2+Ja.width()+c,m=b;break;case J0:g=b,m=i.y2+c;break;default:g=o.x,m=o.y}return FC(o,"x",g)|FC(o,"y",m)&&(Ja.translate(g,m),e.dirty(o),o.bounds.clear().union(Ja),t.bounds.clear().union(Ja),e.dirty(o)),o.bounds}function HGe(e){Je.call(this,null,e)}Rt(HGe,Je,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(r=>{e.layout&&EXt(n,r,e.layout),NXt(n,r,e)}),$Xt(e.mark.group)?t.reflow():t}});function $Xt(e){return e&&e.mark.role!=="legend-entry"}function NXt(e,t,n){var r=t.items,i=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new ws().set(0,0,i,o),a=s.clone(),l=s.clone(),c=[],u,f,d,h,p,g;for(p=0,g=r.length;p{d=v.orient||Zd,d!==Efe&&(m[d]||(m[d]=[])).push(v)});for(const v in m){const y=m[v];WGe(e,y,AXt(y,v,n.legends,a,l,i,o))}c.forEach(v=>{const y=v.bounds;if(y.equals(v._bounds)||(v.bounds=v._bounds,e.dirty(v),v.bounds=y,e.dirty(v)),n.autosize&&(n.autosize.type===FGe||n.autosize.type===$Ge||n.autosize.type===NGe))switch(v.orient){case Qd:case Zd:s.add(y.x1,0).add(y.x2,0);break;case aE:case J0:s.add(0,y.y1).add(0,y.y2)}else s.union(y)})}s.union(a).union(l),u&&s.union(FXt(e,u,i,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),zXt(e,t,s,n)}function zXt(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,l=Math.max(0,t.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-u));if(i.contains===hXt){const p=e.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===Efe?(c=0,f=0,l=s,u=a):o===FGe?(l=Math.max(0,s-c-d),u=Math.max(0,a-f-h)):o===$Ge?(l=Math.max(0,s-c-d),a=u+f+h):o===NGe?(s=l+c+d,u=Math.max(0,a-f-h)):o===gXt&&(s=l+c+d,a=u+f+h),e._resizeView(s,a,l,u,[c,f],i.resize)}const jXt=Object.freeze(Object.defineProperty({__proto__:null,bound:zGe,identifier:Pfe,mark:jGe,overlap:BGe,render:VGe,viewlayout:HGe},Symbol.toStringTag,{value:"Module"}));function GGe(e){Je.call(this,null,e)}Rt(GGe,Je,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=Gue(o,s,e.minstep),l=e.format||xHe(n,o,a,e.formatSpecifier,e.formatType,!!e.values),c=e.values?bHe(o,e.values,a):que(o,a);return i&&(r.rem=i),i=c.map((u,f)=>li({index:f/(c.length-1||1),value:u,label:l(u)})),e.extra&&i.length&&i.push(li({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function qGe(e){Je.call(this,null,e)}function BXt(){return li({})}function UXt(e){const t=jT().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}Rt(qGe,Je,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||BXt,o=e.key||Sn,s=this.value;return it(r.encode)&&(r.encode=null),s&&(e.modified("key")||t.modified(o))&&et("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=UXt(o)),t.visit(t.ADD,a=>{const l=o(a);let c=s.get(l);c?c.exit?(s.empty--,r.add.push(c)):r.mod.push(c):(c=i(a),s.set(l,c),r.add.push(c)),c.datum=a,c.exit=!1}),t.visit(t.MOD,a=>{const l=o(a),c=s.get(l);c&&(c.datum=a,r.mod.push(c))}),t.visit(t.REM,a=>{const l=o(a),c=s.get(l);a===c.datum&&!c.exit&&(r.rem.push(c),c.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function XGe(e){Je.call(this,null,e)}Rt(XGe,Je,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(it(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=i.update||Ay,l=i.enter||Ay,c=i.exit||Ay,u=(o&&!s?i[o]:a)||Ay;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{l(f,e),a(f,e)}),n.modifies(l.output),n.modifies(a.output),u!==Ay&&u!==a&&(t.visit(t.ADD,f=>{u(f,e)}),n.modifies(u.output))),t.changed(t.REM)&&c!==Ay&&(t.visit(t.REM,f=>{c(f,e)}),n.modifies(c.output)),s||u!==Ay){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=l(d,e)||r;(u(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):t.visit(f,d=>{(u(d,e)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:t.StopPropagation}});function YGe(e){Je.call(this,[],e)}Rt(YGe,Je,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.type||xz,s=e.scale,a=+e.limit,l=Gue(s,e.count==null?5:e.count,e.minstep),c=!!e.values||o===xz,u=e.format||CHe(n,s,l,o,e.formatSpecifier,e.formatType,c),f=e.values||_He(s,l),d,h,p,g,m;return i&&(r.rem=i),o===xz?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),m=!0):i=f,Jn(p=e.size)?(!e.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((v,y)=>Math.max(v,p(y,e)),0)):p=vl(g=p||8),i=i.map((v,y)=>li({index:y,label:u(v,y,i),value:v,offset:g,size:p(v,e)})),m&&(m=f[i.length],i.push(li({index:i.length,label:`…${f.length-i.length} entries`,value:m,offset:g,size:p(m,e)})))):o===p9t?(d=s.domain(),h=mHe(s,d[0],Ar(d)),f.length<3&&!e.values&&d[0]!==Ar(d)&&(f=[d[0],Ar(d)]),i=f.map((v,y)=>li({index:y,label:u(v,y,f),value:v,perc:h(v)}))):(p=f.length-1,h=O9t(s),i=f.map((v,y)=>li({index:y,label:u(v,y,f),value:v,perc:y?h(v):0,perc2:y===p?1:h(f[y+1])}))),r.source=i,r.add=i,this.value=i,r}});const VXt=e=>e.source.x,WXt=e=>e.source.y,HXt=e=>e.target.x,GXt=e=>e.target.y;function kfe(e){Je.call(this,{},e)}kfe.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};Rt(kfe,Je,{transform(e,t){var n=e.sourceX||VXt,r=e.sourceY||WXt,i=e.targetX||HXt,o=e.targetY||GXt,s=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",c=aCe.get(l+"-"+a)||aCe.get(l);return c||et("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,u=>{u[s]=c(n(u),r(u),i(u),o(u))}),t.reflow(e.modified()).modifies(s)}});const QGe=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,qXt=(e,t,n,r)=>QGe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),KGe=(e,t,n,r)=>{var i=n-e,o=r-t,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},XXt=(e,t,n,r)=>KGe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),ZGe=(e,t,n,r)=>{const i=n-e,o=r-t,s=.2*(i+o),a=.2*(o-i);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},YXt=(e,t,n,r)=>ZGe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),QXt=(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,KXt=(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,ZXt=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+(l?1:0)+" "+t*s+","+t*a+"L"+r*s+","+r*a},JXt=(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},eYt=(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},tYt=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=(t+r)/2;return"M"+t*i+","+t*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},aCe=jT({line:QGe,"line-radial":qXt,arc:KGe,"arc-radial":XXt,curve:ZGe,"curve-radial":YXt,"orthogonal-horizontal":QXt,"orthogonal-vertical":KXt,"orthogonal-radial":ZXt,"diagonal-horizontal":JXt,"diagonal-vertical":eYt,"diagonal-radial":tYt});function Mfe(e){Je.call(this,null,e)}Mfe.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};Rt(Mfe,Je,{transform(e,t){var n=e.as||["startAngle","endAngle"],r=n[0],i=n[1],o=e.field||FT,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,l=t.source,c=l.map(o),u=c.length,f=s,d=(a-s)/uVe(c),h=Oc(u),p,g,m;for(e.sort&&h.sort((v,y)=>c[v]-c[y]),p=0;p-1)return r;var i=t.domain,o=e.type,s=t.zero||t.zero===void 0&&rYt(e),a,l;if(!i)return 0;if((s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[a]=t.domainMax),t.domainMid!=null)){l=t.domainMid;const c=l>i[a]?a+1:li+(o<0?-1:o>0?1:0),0));r!==t.length&&n.warn("Log scale domain includes zero: "+Tt(t))}return t}function uYt(e,t,n){let r=t.bins;if(r&&!it(r)){const i=e.domain(),o=i[0],s=Ar(i),a=r.step;let l=r.start==null?o:r.start,c=r.stop==null?s:r.stop;a||et("Scale bins parameter missing step property."),ls&&(c=a*Math.floor(s/a)),r=Oc(l,c+a/2,a)}return r?e.bins=r:e.bins&&delete e.bins,e.type===jue&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function fYt(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(t.rangeStep!=null)o=dYt(r,t,n);else if(t.scheme&&(o=hYt(r,t,n),Jn(o))){if(e.interpolator)return e.interpolator(o);et(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&dHe(r))return e.interpolator(oV(Yte(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Wue(t.interpolate,t.interpolateGamma)):Jn(e.round)?e.round(i):Jn(e.rangeRound)&&e.interpolate(i?FD:Tb),o&&e.range(Yte(o,t.reverse))}function dYt(e,t,n){e!==oHe&&e!==Dte&&et("Only band and point scales support rangeStep.");var r=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,i=e===Dte?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Nue(n,i,r)]}function hYt(e,t,n){var r=t.schemeExtent,i,o;return it(t.scheme)?o=oV(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),o=Hue(i),o||et(`Unrecognized scheme name: ${t.scheme}`)),n=e===iV?n+1:e===jue?n-1:e===nE||e===rV?+t.schemeCount||nYt:n,dHe(e)?lCe(o,r,t.reverse):Jn(o)?gHe(lCe(o,r),n):e===zue?o:o.slice(0,n)}function lCe(e,t,n){return Jn(e)&&(t||n)?pHe(e,Yte(t||[0,1],n)):e}function Yte(e,t){return t?e.slice().reverse():e}function n9e(e){Je.call(this,null,e)}Rt(n9e,Je,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(dS(e.sort)),this.modified(n),t}});const cCe="zero",r9e="center",i9e="normalize",o9e=["y0","y1"];function Afe(e){Je.call(this,null,e)}Afe.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:cCe,values:[cCe,r9e,i9e]},{name:"as",type:"string",array:!0,length:2,default:o9e}]};Rt(Afe,Je,{transform(e,t){var n=e.as||o9e,r=n[0],i=n[1],o=dS(e.sort),s=e.field||FT,a=e.offset===r9e?pYt:e.offset===i9e?gYt:mYt,l,c,u,f;for(l=vYt(t.source,e.groupby,o,s),c=0,u=l.length,f=l.max;cg(u),s,a,l,c,u,f,d,h,p;if(t==null)i.push(e.slice());else for(s={},a=0,l=e.length;ap&&(p=h),n&&d.sort(n)}return i.max=p,i}const yYt=Object.freeze(Object.defineProperty({__proto__:null,axisticks:GGe,datajoin:qGe,encode:XGe,legendentries:YGe,linkpath:kfe,pie:Mfe,scale:e9e,sortitems:n9e,stack:Afe},Symbol.toStringTag,{value:"Module"}));var En=1e-6,zj=1e-12,mr=Math.PI,jo=mr/2,jj=mr/4,ql=mr*2,Jo=180/mr,ur=mr/180,Mr=Math.abs,QT=Math.atan,Jf=Math.atan2,kn=Math.cos,eN=Math.ceil,s9e=Math.exp,Qte=Math.hypot,Bj=Math.log,g7=Math.pow,Cn=Math.sin,Ef=Math.sign||function(e){return e>0?1:e<0?-1:0},Xl=Math.sqrt,Rfe=Math.tan;function a9e(e){return e>1?0:e<-1?mr:Math.acos(e)}function zc(e){return e>1?jo:e<-1?-jo:Math.asin(e)}function Ma(){}function Uj(e,t){e&&fCe.hasOwnProperty(e.type)&&fCe[e.type](e,t)}var uCe={Feature:function(e,t){Uj(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=kn(t),s=Cn(t),a=ene*s,l=Jte*o+a*kn(i),c=a*r*Cn(i);Vj.add(Jf(c,l)),Zte=e,Jte=o,ene=s}function SYt(e){return Wj=new Wl,Cm(e,ig),Wj*2}function Hj(e){return[Jf(e[1],e[0]),zc(e[2])]}function fw(e){var t=e[0],n=e[1],r=kn(n);return[r*kn(t),r*Cn(t),Cn(n)]}function tN(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function lE(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function m7(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function nN(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Gj(e){var t=Xl(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var To,vc,$o,vu,$x,f9e,d9e,lO,UM,qy,fv,ym={point:tne,lineStart:hCe,lineEnd:pCe,polygonStart:function(){ym.point=p9e,ym.lineStart=_Yt,ym.lineEnd=CYt,UM=new Wl,ig.polygonStart()},polygonEnd:function(){ig.polygonEnd(),ym.point=tne,ym.lineStart=hCe,ym.lineEnd=pCe,Vj<0?(To=-($o=180),vc=-(vu=90)):UM>En?vu=90:UM<-En&&(vc=-90),fv[0]=To,fv[1]=$o},sphere:function(){To=-($o=180),vc=-(vu=90)}};function tne(e,t){qy.push(fv=[To=e,$o=e]),tvu&&(vu=t)}function h9e(e,t){var n=fw([e*ur,t*ur]);if(lO){var r=lE(lO,n),i=[r[1],-r[0],0],o=lE(i,r);Gj(o),o=Hj(o);var s=e-$x,a=s>0?1:-1,l=o[0]*Jo*a,c,u=Mr(s)>180;u^(a*$xvu&&(vu=c)):(l=(l+360)%360-180,u^(a*$xvu&&(vu=t))),u?e<$x?hu(To,e)>hu(To,$o)&&($o=e):hu(e,$o)>hu(To,$o)&&(To=e):$o>=To?(e$o&&($o=e)):e>$x?hu(To,e)>hu(To,$o)&&($o=e):hu(e,$o)>hu(To,$o)&&(To=e)}else qy.push(fv=[To=e,$o=e]);tvu&&(vu=t),lO=n,$x=e}function hCe(){ym.point=h9e}function pCe(){fv[0]=To,fv[1]=$o,ym.point=tne,lO=null}function p9e(e,t){if(lO){var n=e-$x;UM.add(Mr(n)>180?n+(n>0?360:-360):n)}else f9e=e,d9e=t;ig.point(e,t),h9e(e,t)}function _Yt(){ig.lineStart()}function CYt(){p9e(f9e,d9e),ig.lineEnd(),Mr(UM)>En&&(To=-($o=180)),fv[0]=To,fv[1]=$o,lO=null}function hu(e,t){return(t-=e)<0?t+360:t}function OYt(e,t){return e[0]-t[0]}function gCe(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:thu(r[0],r[1])&&(r[1]=i[1]),hu(i[0],r[1])>hu(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,t=0,r=o[n];t<=n;r=i,++t)i=o[t],(a=hu(r[1],i[0]))>s&&(s=a,To=i[0],$o=r[1])}return qy=fv=null,To===1/0||vc===1/0?[[NaN,NaN],[NaN,NaN]]:[[To,vc],[$o,vu]]}var nM,qj,Xj,Yj,Qj,Kj,Zj,Jj,nne,rne,ine,g9e,m9e,Dl,Ll,Fl,Jd={sphere:Ma,point:Ife,lineStart:mCe,lineEnd:vCe,polygonStart:function(){Jd.lineStart=kYt,Jd.lineEnd=MYt},polygonEnd:function(){Jd.lineStart=mCe,Jd.lineEnd=vCe}};function Ife(e,t){e*=ur,t*=ur;var n=kn(t);KD(n*kn(e),n*Cn(e),Cn(t))}function KD(e,t,n){++nM,Xj+=(e-Xj)/nM,Yj+=(t-Yj)/nM,Qj+=(n-Qj)/nM}function mCe(){Jd.point=TYt}function TYt(e,t){e*=ur,t*=ur;var n=kn(t);Dl=n*kn(e),Ll=n*Cn(e),Fl=Cn(t),Jd.point=PYt,KD(Dl,Ll,Fl)}function PYt(e,t){e*=ur,t*=ur;var n=kn(t),r=n*kn(e),i=n*Cn(e),o=Cn(t),s=Jf(Xl((s=Ll*o-Fl*i)*s+(s=Fl*r-Dl*o)*s+(s=Dl*i-Ll*r)*s),Dl*r+Ll*i+Fl*o);qj+=s,Kj+=s*(Dl+(Dl=r)),Zj+=s*(Ll+(Ll=i)),Jj+=s*(Fl+(Fl=o)),KD(Dl,Ll,Fl)}function vCe(){Jd.point=Ife}function kYt(){Jd.point=AYt}function MYt(){v9e(g9e,m9e),Jd.point=Ife}function AYt(e,t){g9e=e,m9e=t,e*=ur,t*=ur,Jd.point=v9e;var n=kn(t);Dl=n*kn(e),Ll=n*Cn(e),Fl=Cn(t),KD(Dl,Ll,Fl)}function v9e(e,t){e*=ur,t*=ur;var n=kn(t),r=n*kn(e),i=n*Cn(e),o=Cn(t),s=Ll*o-Fl*i,a=Fl*r-Dl*o,l=Dl*i-Ll*r,c=Qte(s,a,l),u=zc(c),f=c&&-u/c;nne.add(f*s),rne.add(f*a),ine.add(f*l),qj+=u,Kj+=u*(Dl+(Dl=r)),Zj+=u*(Ll+(Ll=i)),Jj+=u*(Fl+(Fl=o)),KD(Dl,Ll,Fl)}function RYt(e){nM=qj=Xj=Yj=Qj=Kj=Zj=Jj=0,nne=new Wl,rne=new Wl,ine=new Wl,Cm(e,Jd);var t=+nne,n=+rne,r=+ine,i=Qte(t,n,r);return imr&&(e-=Math.round(e/ql)*ql),[e,t]}sne.invert=sne;function y9e(e,t,n){return(e%=ql)?t||n?one(bCe(e),xCe(t,n)):bCe(e):t||n?xCe(t,n):sne}function yCe(e){return function(t,n){return t+=e,Mr(t)>mr&&(t-=Math.round(t/ql)*ql),[t,n]}}function bCe(e){var t=yCe(e);return t.invert=yCe(-e),t}function xCe(e,t){var n=kn(e),r=Cn(e),i=kn(t),o=Cn(t);function s(a,l){var c=kn(l),u=kn(a)*c,f=Cn(a)*c,d=Cn(l),h=d*n+u*r;return[Jf(f*i-h*o,u*n-d*r),zc(h*i+f*o)]}return s.invert=function(a,l){var c=kn(l),u=kn(a)*c,f=Cn(a)*c,d=Cn(l),h=d*i-f*o;return[Jf(f*i+d*o,u*n+h*r),zc(h*n-u*r)]},s}function IYt(e){e=y9e(e[0]*ur,e[1]*ur,e.length>2?e[2]*ur:0);function t(n){return n=e(n[0]*ur,n[1]*ur),n[0]*=Jo,n[1]*=Jo,n}return t.invert=function(n){return n=e.invert(n[0]*ur,n[1]*ur),n[0]*=Jo,n[1]*=Jo,n},t}function DYt(e,t,n,r,i,o){if(n){var s=kn(t),a=Cn(t),l=r*n;i==null?(i=t+r*ql,o=t-l/2):(i=wCe(s,i),o=wCe(s,o),(r>0?io)&&(i+=r*ql));for(var c,u=i;r>0?u>o:u1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function kz(e,t){return Mr(e[0]-t[0])=0;--a)i.point((f=u[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function SCe(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n=0?1:-1,P=k*T,I=P>mr,R=m*_;if(l.add(Jf(R*k*Cn(P),v*E+R*kn(P))),s+=I?T+k*ql:T,I^p>=n^w>=n){var F=lE(fw(h),fw(b));Gj(F);var A=lE(o,F);Gj(A);var L=(I^T>=0?-1:1)*zc(A[2]);(r>L||r===L&&(F[0]||F[1]))&&(a+=I^T>=0?1:-1)}}return(s<-En||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_1&&w&2&&S.push(S.pop().concat(S.shift())),u.push(S.filter(FYt))}}return d}}function FYt(e){return e.length>1}function $Yt(e,t){return((e=e.x)[0]<0?e[1]-jo-En:jo-e[1])-((t=t.x)[0]<0?t[1]-jo-En:jo-t[1])}const _Ce=w9e(function(){return!0},NYt,jYt,[-mr,-jo]);function NYt(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?mr:-mr,l=Mr(o-t);Mr(l-mr)0?jo:-jo),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&l>=mr&&(Mr(t-r)En?QT((Cn(t)*(o=kn(r))*Cn(n)-Cn(r)*(i=kn(t))*Cn(e))/(i*o*s)):(t+r)/2}function jYt(e,t,n,r){var i;if(e==null)i=n*jo,r.point(-mr,i),r.point(0,i),r.point(mr,i),r.point(mr,0),r.point(mr,-i),r.point(0,-i),r.point(-mr,-i),r.point(-mr,0),r.point(-mr,i);else if(Mr(e[0]-t[0])>En){var o=e[0]0,i=Mr(t)>En;function o(u,f,d,h){DYt(h,e,n,d,u,f)}function s(u,f){return kn(u)*kn(f)>t}function a(u){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,v){var y=[m,v],b,w=s(m,v),S=r?w?0:c(m,v):w?c(m+(m<0?mr:-mr),v):0;if(!f&&(p=h=w)&&u.lineStart(),w!==h&&(b=l(f,y),(!b||kz(f,b)||kz(y,b))&&(y[2]=1)),w!==h)g=0,w?(u.lineStart(),b=l(y,f),u.point(b[0],b[1])):(b=l(f,y),u.point(b[0],b[1],2),u.lineEnd()),f=b;else if(i&&f&&r^w){var _;!(S&d)&&(_=l(y,f,!0))&&(g=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}w&&(!f||!kz(f,y))&&u.point(y[0],y[1]),f=y,h=w,d=S},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(u,f,d){var h=fw(u),p=fw(f),g=[1,0,0],m=lE(h,p),v=tN(m,m),y=m[0],b=v-y*y;if(!b)return!d&&u;var w=t*v/b,S=-t*y/b,_=lE(g,m),E=nN(g,w),T=nN(m,S);m7(E,T);var k=_,P=tN(E,k),I=tN(k,k),R=P*P-I*(tN(E,E)-1);if(!(R<0)){var F=Xl(R),A=nN(k,(-P-F)/I);if(m7(A,E),A=Hj(A),!d)return A;var L=u[0],$=f[0],j=u[1],V=f[1],U;$0^A[1]<(Mr(A[0]-L)mr^(L<=A[0]&&A[0]<=$)){var H=nN(k,(-P+F)/I);return m7(H,E),[A,Hj(H)]}}}function c(u,f){var d=r?e:mr-e,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return w9e(s,a,o,r?[0,-e]:[-mr,e-mr])}function UYt(e,t,n,r,i,o){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,f=1,d=l-s,h=c-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p0&&(e[0]=s+u*d,e[1]=a+u*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var rM=1e9,iN=-rM;function S9e(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=s(c,f))!==(p=s(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(c,u){return Mr(c[0]-e)0?0:3:Mr(c[0]-n)0?2:1:Mr(c[1]-t)0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var f=s(c,1),d=s(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=b9e(),d,h,p,g,m,v,y,b,w,S,_,E={point:T,lineStart:R,lineEnd:F,polygonStart:P,polygonEnd:I};function T(L,$){i(L,$)&&u.point(L,$)}function k(){for(var L=0,$=0,j=h.length;$r&&(Q-B)*(r-H)>(Y-H)*(e-B)&&++L:Y<=r&&(Q-B)*(r-H)<(Y-H)*(e-B)&&--L;return L}function P(){u=f,d=[],h=[],_=!0}function I(){var L=k(),$=_&&L,j=(d=cVe(d)).length;($||j)&&(c.polygonStart(),$&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),j&&x9e(d,a,L,o,c),c.polygonEnd()),u=c,d=h=p=null}function R(){E.point=A,h&&h.push(p=[]),S=!0,w=!1,y=b=NaN}function F(){d&&(A(g,m),v&&w&&f.rejoin(),d.push(f.result())),E.point=T,w&&u.lineEnd()}function A(L,$){var j=i(L,$);if(h&&p.push([L,$]),S)g=L,m=$,v=j,S=!1,j&&(u.lineStart(),u.point(L,$));else if(j&&w)u.point(L,$);else{var V=[y=Math.max(iN,Math.min(rM,y)),b=Math.max(iN,Math.min(rM,b))],U=[L=Math.max(iN,Math.min(rM,L)),$=Math.max(iN,Math.min(rM,$))];UYt(V,U,e,t,n,r)?(w||(u.lineStart(),u.point(V[0],V[1])),u.point(U[0],U[1]),j||u.lineEnd(),_=!1):j&&(u.lineStart(),u.point(L,$),_=!1)}y=L,b=$,w=j}return E}}function CCe(e,t,n){var r=Oc(e,t-En,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function OCe(e,t,n){var r=Oc(e,t-En,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function VYt(){var e,t,n,r,i,o,s,a,l=10,c=l,u=90,f=360,d,h,p,g,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return Oc(eN(r/u)*u,n,u).map(p).concat(Oc(eN(a/f)*f,s,f).map(g)).concat(Oc(eN(t/l)*l,e,l).filter(function(b){return Mr(b%u)>En}).map(d)).concat(Oc(eN(o/c)*c,i,c).filter(function(b){return Mr(b%f)>En}).map(h))}return v.lines=function(){return y().map(function(b){return{type:"LineString",coordinates:b}})},v.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},v.extent=function(b){return arguments.length?v.extentMajor(b).extentMinor(b):v.extentMinor()},v.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],a=+b[0][1],s=+b[1][1],r>n&&(b=r,r=n,n=b),a>s&&(b=a,a=s,s=b),v.precision(m)):[[r,a],[n,s]]},v.extentMinor=function(b){return arguments.length?(t=+b[0][0],e=+b[1][0],o=+b[0][1],i=+b[1][1],t>e&&(b=t,t=e,e=b),o>i&&(b=o,o=i,i=b),v.precision(m)):[[t,o],[e,i]]},v.step=function(b){return arguments.length?v.stepMajor(b).stepMinor(b):v.stepMinor()},v.stepMajor=function(b){return arguments.length?(u=+b[0],f=+b[1],v):[u,f]},v.stepMinor=function(b){return arguments.length?(l=+b[0],c=+b[1],v):[l,c]},v.precision=function(b){return arguments.length?(m=+b,d=CCe(o,i,90),h=OCe(t,e,m),p=CCe(a,s,90),g=OCe(r,n,m),v):m},v.extentMajor([[-180,-90+En],[180,90-En]]).extentMinor([[-180,-80-En],[180,80+En]])}const oR=e=>e;var y7=new Wl,ane=new Wl,_9e,C9e,lne,cne,Om={point:Ma,lineStart:Ma,lineEnd:Ma,polygonStart:function(){Om.lineStart=WYt,Om.lineEnd=GYt},polygonEnd:function(){Om.lineStart=Om.lineEnd=Om.point=Ma,y7.add(Mr(ane)),ane=new Wl},result:function(){var e=y7/2;return y7=new Wl,e}};function WYt(){Om.point=HYt}function HYt(e,t){Om.point=O9e,_9e=lne=e,C9e=cne=t}function O9e(e,t){ane.add(cne*e-lne*t),lne=e,cne=t}function GYt(){O9e(_9e,C9e)}var cE=1/0,eB=cE,sR=-cE,tB=sR,nB={point:qYt,lineStart:Ma,lineEnd:Ma,polygonStart:Ma,polygonEnd:Ma,result:function(){var e=[[cE,eB],[sR,tB]];return sR=tB=-(eB=cE=1/0),e}};function qYt(e,t){esR&&(sR=e),ttB&&(tB=t)}var une=0,fne=0,iM=0,rB=0,iB=0,$C=0,dne=0,hne=0,oM=0,E9e,T9e,vp,yp,bf={point:dw,lineStart:ECe,lineEnd:TCe,polygonStart:function(){bf.lineStart=QYt,bf.lineEnd=KYt},polygonEnd:function(){bf.point=dw,bf.lineStart=ECe,bf.lineEnd=TCe},result:function(){var e=oM?[dne/oM,hne/oM]:$C?[rB/$C,iB/$C]:iM?[une/iM,fne/iM]:[NaN,NaN];return une=fne=iM=rB=iB=$C=dne=hne=oM=0,e}};function dw(e,t){une+=e,fne+=t,++iM}function ECe(){bf.point=XYt}function XYt(e,t){bf.point=YYt,dw(vp=e,yp=t)}function YYt(e,t){var n=e-vp,r=t-yp,i=Xl(n*n+r*r);rB+=i*(vp+e)/2,iB+=i*(yp+t)/2,$C+=i,dw(vp=e,yp=t)}function TCe(){bf.point=dw}function QYt(){bf.point=ZYt}function KYt(){P9e(E9e,T9e)}function ZYt(e,t){bf.point=P9e,dw(E9e=vp=e,T9e=yp=t)}function P9e(e,t){var n=e-vp,r=t-yp,i=Xl(n*n+r*r);rB+=i*(vp+e)/2,iB+=i*(yp+t)/2,$C+=i,i=yp*e-vp*t,dne+=i*(vp+e),hne+=i*(yp+t),oM+=i*3,dw(vp=e,yp=t)}function k9e(e){this._context=e}k9e.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,ql);break}}},result:Ma};var pne=new Wl,b7,M9e,A9e,sM,aM,aR={point:Ma,lineStart:function(){aR.point=JYt},lineEnd:function(){b7&&R9e(M9e,A9e),aR.point=Ma},polygonStart:function(){b7=!0},polygonEnd:function(){b7=null},result:function(){var e=+pne;return pne=new Wl,e}};function JYt(e,t){aR.point=R9e,M9e=sM=e,A9e=aM=t}function R9e(e,t){sM-=e,aM-=t,pne.add(Xl(sM*sM+aM*aM)),sM=e,aM=t}let PCe,oB,kCe,MCe;class ACe{constructor(t){this._append=t==null?I9e:eQt(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==kCe||this._append!==oB){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,kCe=r,oB=this._append,MCe=this._,this._=i}this._+=MCe;break}}}result(){const t=this._;return this._="",t.length?t:null}}function I9e(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return I9e;if(t!==PCe){const n=10**t;PCe=t,oB=function(i){let o=1;this._+=i[0];for(const s=i.length;o=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(o=new ACe(n)),s},s.projection(e).digits(n).context(t)}function yV(e){return function(t){var n=new gne;for(var r in e)n[r]=e[r];return n.stream=t,n}}function gne(){}gne.prototype={constructor:gne,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Dfe(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Cm(n,e.stream(nB)),t(nB.result()),r!=null&&e.clipExtent(r),e}function bV(e,t,n){return Dfe(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function Lfe(e,t,n){return bV(e,[[0,0],t],n)}function Ffe(e,t,n){return Dfe(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function $fe(e,t,n){return Dfe(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var RCe=16,tQt=kn(30*ur);function ICe(e,t){return+t?rQt(e,t):nQt(e)}function nQt(e){return yV({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function rQt(e,t){function n(r,i,o,s,a,l,c,u,f,d,h,p,g,m){var v=c-r,y=u-i,b=v*v+y*y;if(b>4*t&&g--){var w=s+d,S=a+h,_=l+p,E=Xl(w*w+S*S+_*_),T=zc(_/=E),k=Mr(Mr(_)-1)t||Mr((v*F+y*A)/b-.5)>.3||s*d+a*h+l*p2?L[2]%360*ur:0,F()):[a*Jo,l*Jo,c*Jo]},I.angle=function(L){return arguments.length?(f=L%360*ur,F()):f*Jo},I.reflectX=function(L){return arguments.length?(d=L?-1:1,F()):d<0},I.reflectY=function(L){return arguments.length?(h=L?-1:1,F()):h<0},I.precision=function(L){return arguments.length?(_=ICe(E,S=L*L),A()):Xl(S)},I.fitExtent=function(L,$){return bV(I,L,$)},I.fitSize=function(L,$){return Lfe(I,L,$)},I.fitWidth=function(L,$){return Ffe(I,L,$)},I.fitHeight=function(L,$){return $fe(I,L,$)};function F(){var L=DCe(n,0,0,d,h,f).apply(null,t(o,s)),$=DCe(n,r-L[0],i-L[1],d,h,f);return u=y9e(a,l,c),E=one(t,$),T=one(u,E),_=ICe(E,S),A()}function A(){return k=P=null,I}return function(){return t=e.apply(this,arguments),I.invert=t.invert&&R,F()}}function Nfe(e){var t=0,n=mr/3,r=L9e(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*ur,n=o[1]*ur):[t*Jo,n*Jo]},i}function aQt(e){var t=kn(e);function n(r,i){return[r*t,Cn(i)/t]}return n.invert=function(r,i){return[r/t,zc(i*t)]},n}function lQt(e,t){var n=Cn(e),r=(n+Cn(t))/2;if(Mr(r)=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},u.stream=function(d){return e&&t===d?e:e=cQt([n.stream(t=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(c),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+En,g+.12*h+En],[p-.214*h-En,g+.234*h-En]]).stream(c),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+En,g+.166*h+En],[p-.115*h-En,g+.234*h-En]]).stream(c),f()},u.fitExtent=function(d,h){return bV(u,d,h)},u.fitSize=function(d,h){return Lfe(u,d,h)},u.fitWidth=function(d,h){return Ffe(u,d,h)},u.fitHeight=function(d,h){return $fe(u,d,h)};function f(){return e=t=null,u}return u.scale(1070)}function $9e(e){return function(t,n){var r=kn(t),i=kn(n),o=e(r*i);return o===1/0?[2,0]:[o*i*Cn(t),o*Cn(n)]}}function ZD(e){return function(t,n){var r=Xl(t*t+n*n),i=e(r),o=Cn(i),s=kn(i);return[Jf(t*o,r*s),zc(r&&n*o/r)]}}var N9e=$9e(function(e){return Xl(2/(1+e))});N9e.invert=ZD(function(e){return 2*zc(e/2)});function fQt(){return xg(N9e).scale(124.75).clipAngle(180-.001)}var z9e=$9e(function(e){return(e=a9e(e))&&e/Cn(e)});z9e.invert=ZD(function(e){return e});function dQt(){return xg(z9e).scale(79.4188).clipAngle(180-.001)}function xV(e,t){return[e,Bj(Rfe((jo+t)/2))]}xV.invert=function(e,t){return[e,2*QT(s9e(t))-jo]};function hQt(){return j9e(xV).scale(961/ql)}function j9e(e){var t=xg(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,l,c;t.scale=function(f){return arguments.length?(r(f),u()):r()},t.translate=function(f){return arguments.length?(i(f),u()):i()},t.center=function(f){return arguments.length?(n(f),u()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=l=c=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var f=mr*r(),d=t(IYt(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===xV?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),c]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,c)]])}return u()}function oN(e){return Rfe((jo+e)/2)}function pQt(e,t){var n=kn(e),r=e===t?Cn(e):Bj(n/kn(t))/Bj(oN(t)/oN(e)),i=n*g7(oN(e),r)/r;if(!r)return xV;function o(s,a){i>0?a<-jo+En&&(a=-jo+En):a>jo-En&&(a=jo-En);var l=i/g7(oN(a),r);return[l*Cn(r*s),i-l*kn(r*s)]}return o.invert=function(s,a){var l=i-a,c=Ef(r)*Xl(s*s+l*l),u=Jf(s,Mr(l))*Ef(l);return l*r<0&&(u-=mr*Ef(s)*Ef(l)),[u/r,2*QT(g7(i/c,1/r))-jo]},o}function gQt(){return Nfe(pQt).scale(109.5).parallels([30,30])}function aB(e,t){return[e,t]}aB.invert=aB;function mQt(){return xg(aB).scale(152.63)}function vQt(e,t){var n=kn(e),r=e===t?Cn(e):(n-kn(t))/(t-e),i=n/r+e;if(Mr(r)En&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function _Qt(){return xg(V9e).scale(175.295)}function W9e(e,t){return[kn(t)*Cn(e),Cn(t)]}W9e.invert=ZD(zc);function CQt(){return xg(W9e).scale(249.5).clipAngle(90+En)}function H9e(e,t){var n=kn(t),r=1+kn(e)*n;return[n*Cn(e)/r,Cn(t)/r]}H9e.invert=ZD(function(e){return 2*QT(e)});function OQt(){return xg(H9e).scale(250).clipAngle(142)}function G9e(e,t){return[Bj(Rfe((jo+t)/2)),-e]}G9e.invert=function(e,t){return[-t,2*QT(s9e(e))-jo]};function EQt(){var e=j9e(G9e),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var TQt=Math.abs,mne=Math.cos,cB=Math.sin,PQt=1e-6,q9e=Math.PI,vne=q9e/2,LCe=kQt(2);function FCe(e){return e>1?vne:e<-1?-vne:Math.asin(e)}function kQt(e){return e>0?Math.sqrt(e):0}function MQt(e,t){var n=e*cB(t),r=30,i;do t-=i=(t+cB(t)-n)/(1+mne(t));while(TQt(i)>PQt&&--r>0);return t/2}function AQt(e,t,n){function r(i,o){return[e*i*mne(o=MQt(n,o)),t*cB(o)]}return r.invert=function(i,o){return o=FCe(o/t),[i/(e*mne(o)),FCe((2*o+cB(2*o))/n)]},r}var RQt=AQt(LCe/vne,LCe,q9e);function IQt(){return xg(RQt).scale(169.529)}const DQt=D9e(),yne=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function LQt(e,t){return function n(){const r=t();return r.type=e,r.path=D9e().projection(r),r.copy=r.copy||function(){const i=n();return yne.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},cHe(r)}}function zfe(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(uB[e]=LQt(e,t),this):uB[e]||null}function X9e(e){return e&&e.path||DQt}const uB={albers:F9e,albersusa:uQt,azimuthalequalarea:fQt,azimuthalequidistant:dQt,conicconformal:gQt,conicequalarea:sB,conicequidistant:yQt,equalEarth:xQt,equirectangular:mQt,gnomonic:wQt,identity:SQt,mercator:hQt,mollweide:IQt,naturalEarth1:_Qt,orthographic:CQt,stereographic:OQt,transversemercator:EQt};for(const e in uB)zfe(e,uB[e]);function FQt(){}const qg=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Y9e(){var e=1,t=1,n=a;function r(l,c){return c.map(u=>i(l,u))}function i(l,c){var u=[],f=[];return o(l,c,d=>{n(d,l,c),$Qt(d)>0?u.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=u.length,g;h=c,qg[m<<1].forEach(b);++h=c,qg[g|m<<1].forEach(b);for(qg[m<<0].forEach(b);++p=c,v=l[p*e]>=c,qg[m<<1|v<<2].forEach(b);++h=c,y=v,v=l[p*e+h+1]>=c,qg[g|m<<1|v<<2|y<<3].forEach(b);qg[m|v<<3].forEach(b)}for(h=-1,v=l[p*e]>=c,qg[v<<2].forEach(b);++h=c,qg[v<<2|y<<3].forEach(b);qg[v<<3].forEach(b);function b(w){var S=[w[0][0]+h,w[0][1]+p],_=[w[1][0]+h,w[1][1]+p],E=s(S),T=s(_),k,P;(k=d[E])?(P=f[T])?(delete d[k.end],delete f[P.start],k===P?(k.ring.push(_),u(k.ring)):f[k.start]=d[P.end]={start:k.start,end:P.end,ring:k.ring.concat(P.ring)}):(delete d[k.end],k.ring.push(_),d[k.end=T]=k):(k=f[T])?(P=d[E])?(delete f[k.start],delete d[P.end],k===P?(k.ring.push(_),u(k.ring)):f[P.start]=d[k.end]={start:P.start,end:k.end,ring:P.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(S),f[k.start=E]=k):f[E]=d[T]={start:E,end:T,ring:[S,_]}}}function s(l){return l[0]*2+l[1]*(e+1)*4}function a(l,c,u){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,v=c[g*e+p];d>0&&d0&&h=0&&u>=0||et("invalid size"),e=c,t=u,r},r.smooth=function(l){return arguments.length?(n=l?a:FQt,r):n===a},r}function $Qt(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++tr!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=-i)}return i}function jQt(e,t,n){var r;return BQt(e,t,n)&&UQt(e[r=+(e[0]===t[0])],n[r],t[r])}function BQt(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function UQt(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function Q9e(e,t,n){return function(r){var i=eg(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=t?H0(o,s,e):a/(e+1);return Oc(o+l,s,l)}}function jfe(e){Je.call(this,null,e)}jfe.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};Rt(jfe,Je,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||ml,o=Y9e().smooth(e.smooth!==!1),s=e.thresholds||VQt(r,i,e),a=e.as===null?null:e.as||"contour",l=[];return r.forEach(c=>{const u=i(c),f=o.size([u.width,u.height])(u.values,it(s)?s:s(u.values));WQt(f,u,c,e),f.forEach(d=>{l.push(IU(c,li(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function VQt(e,t,n){const r=Q9e(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(e.map(i=>P1(t(i).values)))}function WQt(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(Jn(i)&&(i=i(n,r)),Jn(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(Qr(i)?i:i[0])||1,a=(Qr(i)?i:i[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;e.forEach(K9e(t,s,a,l,c))}function K9e(e,t,n,r,i){const o=e.x1||0,s=e.y1||0,a=t*n<0;function l(f){f.forEach(c)}function c(f){a&&f.reverse(),f.forEach(u)}function u(f){f[0]=(f[0]-o)*t+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function $Ce(e,t,n){const r=e>=0?e:Sce(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function x7(e){return Jn(e)?e:vl(+e)}function Z9e(){var e=l=>l[0],t=l=>l[1],n=FT,r=[-1,-1],i=960,o=500,s=2;function a(l,c){const u=$Ce(r[0],l,e)>>s,f=$Ce(r[1],l,t)>>s,d=u?u+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),m=new Float32Array(p*g),v=new Float32Array(p*g);let y=m;l.forEach(w=>{const S=d+(+e(w)>>s),_=h+(+t(w)>>s);S>=0&&S=0&&_0&&f>0?(O_(p,g,m,v,u),E_(p,g,v,m,f),O_(p,g,m,v,u),E_(p,g,v,m,f),O_(p,g,m,v,u),E_(p,g,v,m,f)):u>0?(O_(p,g,m,v,u),O_(p,g,v,m,u),O_(p,g,m,v,u),y=v):f>0&&(E_(p,g,m,v,f),E_(p,g,v,m,f),E_(p,g,m,v,f),y=v);const b=c?Math.pow(2,-2*s):1/uVe(y);for(let w=0,S=p*g;w>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(e=x7(l),a):e},a.y=function(l){return arguments.length?(t=x7(l),a):t},a.weight=function(l){return arguments.length?(n=x7(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var c=+l[0],u=+l[1];return c>=0&&u>=0||et("invalid size"),i=c,o=u,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||et("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<=i&&(a>=o&&(l-=n[a-o+s*e]),r[a-i+s*e]=l/Math.min(a+1,e-1+o-a,o))}function E_(e,t,n,r,i){const o=(i<<1)+1;for(let s=0;s=i&&(a>=o&&(l-=n[s+(a-o)*e]),r[s+(a-i)*e]=l/Math.min(a+1,t-1+o-a,o))}function Bfe(e){Je.call(this,null,e)}Bfe.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const HQt=["x","y","weight","size","cellSize","bandwidth"];function J9e(e,t){return HQt.forEach(n=>t[n]!=null?e[n](t[n]):0),e}Rt(Bfe,Je,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=GQt(r,e.groupby),o=(e.groupby||[]).map(Bo),s=J9e(Z9e(),e),a=e.as||"grid",l=[];function c(u,f){for(let d=0;dli(c({[a]:s(u,e.counts)},u.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function GQt(e,t){var n=[],r=u=>u(a),i,o,s,a,l,c;if(t==null)n.push(e);else for(i={},o=0,s=e.length;on.push(a(u))),o&&s&&(t.visit(l,u=>{var f=o(u),d=s(u);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:bne,geometry:{type:qQt,coordinates:r}})),this.value={type:Vfe,features:n}}});function Hfe(e){Je.call(this,null,e)}Hfe.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};Rt(Hfe,Je,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||ml,o=e.as||"path",s=n.SOURCE;!r||e.modified()?(this.value=r=X9e(e.projection),n.materialize().reflow()):s=i===ml||t.modified(i.fields)?n.ADD_MOD:n.ADD;const a=XQt(r,e.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function XQt(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Gfe(e){Je.call(this,null,e)}Gfe.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};Rt(Gfe,Je,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],l;function c(u){const f=n([r(u),i(u)]);f?(u[s]=f[0],u[a]=f[1]):(u[s]=void 0,u[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,c):(l=t.modified(r.fields)||t.modified(i.fields),t.visit(l?t.ADD_MOD:t.ADD,c)),t.modifies(o)}});function qfe(e){Je.call(this,null,e)}qfe.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};Rt(qfe,Je,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return(!r||e.modified())&&(this.value=r=YQt(X9e(e.projection),e.field||Yf("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function YQt(e,t,n){const r=n==null?i=>e(t(i)):i=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(i));return e.pointRadius(o),s};return r.context=i=>(e.context(i),r),r}function Xfe(e){Je.call(this,[],e),this.generator=VYt()}Xfe.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};Rt(Xfe,Je,{transform(e,t){var n=this.value,r=this.generator,i;if(!n.length||e.modified())for(const o in e)Jn(r[o])&&r[o](e[o]);return i=r(),n.length?t.mod.push(i8e(n[0],i)):t.add.push(li(i)),n[0]=i,t}});function Yfe(e){Je.call(this,null,e)}Yfe.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};Rt(Yfe,Je,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r=e.resolve==="shared",i=e.field||ml,o=KQt(e.opacity,e),s=QQt(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:r?P1(n.map(c=>P1(i(c).values))):0};return n.forEach(c=>{const u=i(c),f=rr({},c,l);r||(f.$max=P1(u.values||[])),c[a]=ZQt(u,f,s.dep?s:vl(s(f)),o.dep?o:vl(o(f)))}),t.reflow(!0).modifies(a)}});function QQt(e,t){let n;return Jn(e)?(n=r=>Y0(e(r,t)),n.dep=e7e(e)):n=vl(Y0(e||"#888")),n}function KQt(e,t){let n;return Jn(e)?(n=r=>e(r,t),n.dep=e7e(e)):e?n=vl(e):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function e7e(e){if(!Jn(e))return!1;const t=mh(dl(e));return t.$x||t.$y||t.$value||t.$max}function ZQt(e,t,n,r){const i=e.width,o=e.height,s=e.x1||0,a=e.y1||0,l=e.x2||i,c=e.y2||o,u=e.values,f=u?m=>u[m]:t0,d=A0(l-s,c-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,c-a),g=p.data;for(let m=a,v=0;m{e[r]!=null&&NCe(n,r,e[r])})):yne.forEach(r=>{e.modified(r)&&NCe(n,r,e[r])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&JQt(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function JQt(e,t){const n=tKt(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function eKt(e){const t=zfe((e||"mercator").toLowerCase());return t||et("Unrecognized projection type: "+e),t()}function NCe(e,t,n){Jn(e[t])&&e[t](n)}function tKt(e){return e=Ht(e),e.length===1?e[0]:{type:Vfe,features:e.reduce((t,n)=>t.concat(nKt(n)),[])}}function nKt(e){return e.type===Vfe?e.features:Ht(e).filter(t=>t!=null).map(t=>t.type===bne?t:{type:bne,geometry:t})}const rKt=Object.freeze(Object.defineProperty({__proto__:null,contour:Ufe,geojson:Wfe,geopath:Hfe,geopoint:Gfe,geoshape:qfe,graticule:Xfe,heatmap:Yfe,isocontour:jfe,kde2d:Bfe,projection:t7e},Symbol.toStringTag,{value:"Module"}));function iKt(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,s=n.length,a,l=0,c=0;for(o=0;o=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d,i=o,!(o=o[v=m<<1|g]))return i[v]=s,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return s.next=o,i?i[v]=s:e._root=s,e;do i=i?i[v]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d;while((v=m<<1|g)===(y=(p>=d)<<1|h>=f));return i[y]=o,i[v]=s,e}function sKt(e){var t,n,r=e.length,i,o,s=new Array(r),a=new Array(r),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=i),of&&(f=o));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;ne||e>=i||r>t||t>=o;)switch(c=(tu||(a=p.y0)>f||(l=p.x1)=v)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var y=e-+this._x.call(null,h.data),b=t-+this._y.call(null,h.data),w=y*y+b*b;if(w=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+c)/2))?a=h:c=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(r=t,v=m)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[v]=n:this._root=n),this):(this._root=o,this)}function dKt(e){for(var t=0,n=e.length;td.index){var I=h-T.x-T.vx,R=p-T.y-T.vy,F=I*I+R*R;Fh+P||_p+P||Ec.r&&(c.r=c[u].r)}function l(){if(t){var c,u=t.length,f;for(n=new Array(u),c=0;c[t(S,_,s),S])),w;for(m=0,a=new Array(v);m{}};function r7e(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Mz.prototype=r7e.prototype={constructor:Mz,on:function(e,t){var n=this._,r=TKt(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&e._call.call(void 0,t),e=e._next;--uE}function UCe(){hw=(dB=lR.now())+wV,uE=lM=0;try{MKt()}finally{uE=0,RKt(),hw=0}}function AKt(){var e=lR.now(),t=e-dB;t>i7e&&(wV-=t,dB=e)}function RKt(){for(var e,t=fB,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:fB=n);cM=e,xne(r)}function xne(e){if(!uE){lM&&(lM=clearTimeout(lM));var t=e-hw;t>24?(e<1/0&&(lM=setTimeout(UCe,e-lR.now()-wV)),Hk&&(Hk=clearInterval(Hk))):(Hk||(dB=lR.now(),Hk=setInterval(AKt,i7e)),uE=1,o7e(UCe))}}function IKt(e,t,n){var r=new hB,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?Zfe():+a,r._restart(function l(c){c+=i,r._restart(l,i+=s,a),o(c)},s,a)},r.restart(e,t,n),r)}const DKt=1664525,LKt=1013904223,VCe=4294967296;function FKt(){let e=1;return()=>(e=(DKt*e+LKt)%VCe)/VCe}function $Kt(e){return e.x}function NKt(e){return e.y}var zKt=10,jKt=Math.PI*(3-Math.sqrt(5));function BKt(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=s7e(f),c=r7e("tick","end"),u=FKt();e==null&&(e=[]);function f(){d(),c.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,v){var y=0,b=e.length,w,S,_,E,T;for(v==null?v=1/0:v*=v,y=0;y1?(c.on(g,m),t):c.on(g)}}}function UKt(){var e,t,n,r,i=Bl(-30),o,s=1,a=1/0,l=.81;function c(h){var p,g=e.length,m=Qfe(e,$Kt,NKt).visitAfter(f);for(r=h,p=0;p=a)return;(h.data!==t||h.next)&&(v===0&&(v=h0(n),w+=v*v),y===0&&(y=h0(n),w+=y*y),w=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,l=0,c=a.length,u;le.touch(t).run()}function qKt(e,t){const n=BKt(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),l7e(n,t,!0).on("end",()=>o=!0)}function l7e(e,t,n,r){var i=Ht(t.forces),o,s,a,l;for(o=0,s=wne.length;ot(r,n):t)}const KKt=Object.freeze(Object.defineProperty({__proto__:null,force:Jfe},Symbol.toStringTag,{value:"Module"}));function ZKt(e,t){return e.parent===t.parent?1:2}function JKt(e){return e.reduce(eZt,0)/e.length}function eZt(e,t){return e+t.x}function tZt(e){return 1+e.reduce(nZt,0)}function nZt(e,t){return Math.max(e,t.y)}function rZt(e){for(var t;t=e.children;)e=t[0];return e}function iZt(e){for(var t;t=e.children;)e=t[t.length-1];return e}function oZt(){var e=ZKt,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=JKt(h),d.y=tZt(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var l=rZt(o),c=iZt(o),u=l.x-e(l,c)/2,f=c.x+e(c,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function sZt(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function aZt(){return this.eachAfter(sZt)}function lZt(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function cZt(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function uZt(e,t){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=r[i].value;t.value=n})}function hZt(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function pZt(e){for(var t=this,n=gZt(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function gZt(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function mZt(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function vZt(){return Array.from(this)}function yZt(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function bZt(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*xZt(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i=0;--a)i.push(o=s[a]=new fE(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(c7e)}function wZt(){return ede(this).eachBefore(CZt)}function SZt(e){return e.children}function _Zt(e){return Array.isArray(e)?e[1]:null}function CZt(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function c7e(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function fE(e){this.data=e,this.depth=this.height=0,this.parent=null}fE.prototype=ede.prototype={constructor:fE,count:aZt,each:lZt,eachAfter:uZt,eachBefore:cZt,find:fZt,sum:dZt,sort:hZt,path:pZt,ancestors:mZt,descendants:vZt,leaves:yZt,links:bZt,copy:wZt,[Symbol.iterator]:xZt};function Az(e){return e==null?null:u7e(e)}function u7e(e){if(typeof e!="function")throw new Error;return e}function Qx(){return 0}function vC(e){return function(){return e}}const OZt=1664525,EZt=1013904223,HCe=4294967296;function TZt(){let e=1;return()=>(e=(OZt*e+EZt)%HCe)/HCe}function PZt(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kZt(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function MZt(e,t){for(var n=0,r=(e=kZt(Array.from(e),t)).length,i=[],o,s;n0&&n*n>r*r+i*i}function w7(e,t){for(var n=0;n1e-6?(I+Math.sqrt(I*I-4*P*R))/(2*P):R/I);return{x:r+_+E*F,y:i+T+k*F,r:F}}function GCe(e,t,n){var r=e.x-t.x,i,o,s=e.y-t.y,a,l,c=r*r+s*s;c?(o=t.r+n.r,o*=o,l=e.r+n.r,l*=l,o>l?(i=(c+l-o)/(2*c),a=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-a*s,n.y=e.y-i*s+a*r):(i=(c+o-l)/(2*c),a=Math.sqrt(Math.max(0,o/c-i*i)),n.x=t.x+i*r-a*s,n.y=t.y+i*s+a*r)):(n.x=t.x+n.r,n.y=t.y)}function qCe(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function XCe(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function aN(e){this._=e,this.next=null,this.previous=null}function DZt(e,t){if(!(o=(e=PZt(e)).length))return 0;var n,r,i,o,s,a,l,c,u,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;GCe(r,n,i=e[2]),n=new aN(n),r=new aN(r),i=new aN(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lBZt(n(w,S,i))),y=v.map(JCe),b=new Set(v).add("");for(const w of y)b.has(w)||(b.add(w),v.push(w),y.push(JCe(w)),o.push(_7));s=(w,S)=>v[S],a=(w,S)=>y[S]}for(u=0,l=o.length;u=0&&(h=o[v],h.data===_7);--v)h.data=null}if(f.parent=NZt,f.eachBefore(function(v){v.depth=v.parent.depth+1,--l}).eachBefore(c7e),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=Az(i),r):e},r.parentId=function(i){return arguments.length?(t=Az(i),r):t},r.path=function(i){return arguments.length?(n=Az(i),r):n},r}function BZt(e){e=`${e}`;let t=e.length;return Sne(e,t-1)&&!Sne(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function JCe(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Sne(e,t););return e.slice(0,t)}function Sne(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function UZt(e,t){return e.parent===t.parent?1:2}function C7(e){var t=e.children;return t?t[0]:e.t}function O7(e){var t=e.children;return t?t[t.length-1]:e.t}function VZt(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function WZt(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function HZt(e,t,n){return e.a.parent===t.parent?e.a:n}function Rz(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Rz.prototype=Object.create(fE.prototype);function GZt(e){for(var t=new Rz(e,0),n,r=[t],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new Rz(o[s],s)),i.parent=n;return(t.parent=new Rz(null,0)).children=[t],t}function qZt(){var e=UZt,t=1,n=1,r=null;function i(c){var u=GZt(c);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var f=c,d=c,h=c;c.eachBefore(function(y){y.xd.x&&(d=y),y.depth>h.depth&&(h=y)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),v=n/(h.depth||1);c.eachBefore(function(y){y.x=(y.x+g)*m,y.y=y.depth*v})}return c}function o(c){var u=c.children,f=c.parent.children,d=c.i?f[c.i-1]:null;if(u){WZt(c);var h=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-h):c.z=h}else d&&(c.z=d.z+e(c._,d._));c.parent.A=a(c,d,c.parent.A||f[0])}function s(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function a(c,u,f){if(u){for(var d=c,h=c,p=u,g=d.parent.children[0],m=d.m,v=h.m,y=p.m,b=g.m,w;p=O7(p),d=C7(d),p&&d;)g=C7(g),h=O7(h),h.a=c,w=p.z+y-d.z-m+e(p._,d._),w>0&&(VZt(HZt(p,c,f),c,w),m+=w,v+=w),y+=p.m,m+=d.m,b+=g.m,v+=h.m;p&&!O7(h)&&(h.t=p,h.m+=y-v),d&&!C7(g)&&(g.t=d,g.m+=m-b,f=c)}return f}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function SV(e,t,n,r,i){for(var o=e.children,s,a=-1,l=o.length,c=e.value&&(i-n)/e.value;++ay&&(y=c),_=m*m*S,b=Math.max(y/_,_/v),b>w){m-=c;break}w=b}s.push(l={value:m,dice:h1?r:1)},n})(p7e);function XZt(){var e=m7e,t=!1,n=1,r=1,i=[0],o=Qx,s=Qx,a=Qx,l=Qx,c=Qx;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],t&&d.eachBefore(h7e),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,v=d.y1-h;m=d-1){var y=o[f];y.x0=p,y.y0=g,y.x1=m,y.y1=v;return}for(var b=c[f],w=h/2+b,S=f+1,_=d-1;S<_;){var E=S+_>>>1;c[E]v-g){var P=h?(p*k+m*T)/h:m;u(f,S,T,p,g,P,v),u(S,d,k,P,g,m,v)}else{var I=h?(g*k+v*T)/h:v;u(f,S,T,p,g,m,I),u(S,d,k,p,I,m,v)}}}function QZt(e,t,n,r,i){(e.depth&1?SV:JD)(e,t,n,r,i)}const KZt=(function e(t){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===t)for(var l,c,u,f,d=-1,h,p=l.length,g=r.value;++d1?r:1)},n})(p7e);function _ne(e,t,n){const r={};return e.each(i=>{const o=i.data;n(o)&&(r[t(o)]=i)}),e.lookup=r,e}function tde(e){Je.call(this,null,e)}tde.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const ZZt=e=>e.values;Rt(tde,Je,{transform(e,t){t.source||et("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each(s=>{s.children&&RU(s.data)&&i.rem.push(s.data)}),this.value=o=ede({values:Ht(e.keys).reduce((s,a)=>(s.key(a),s),JZt()).entries(i.source)},ZZt),n&&o.each(s=>{s.children&&(s=li(s.data),i.add.push(s),i.source.push(s))}),_ne(o,Sn,Sn)),i.source.root=o,i}});function JZt(){const e=[],t={entries:i=>r(n(i,0),0),key:i=>(e.push(i),t)};function n(i,o){if(o>=e.length)return i;const s=i.length,a=e[o++],l={},c={};let u=-1,f,d,h;for(;++ue.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return t}function kv(e){Je.call(this,null,e)}const eJt=(e,t)=>e.parent===t.parent?1:2;Rt(kv,Je,{transform(e,t){(!t.source||!t.source.root)&&et(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(dS(e.sort,s=>s.data)),tJt(n,this.params,e),n.separation&&n.separation(e.separation!==!1?eJt:FT);try{this.value=n(i)}catch(s){et(s)}return i.each(s=>nJt(s,r,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function tJt(e,t,n){for(let r,i=0,o=t.length;io[Sn(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[Sn(a)]&&o[Sn(l)]&&i.add.push(li({source:l,target:a}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[Sn(s)]=1),n.forEach(s=>{(o[Sn(s.source)]||o[Sn(s.target)])&&i.mod.push(s)})),i}});const tOe={binary:YZt,dice:JD,slice:SV,slicedice:QZt,squarify:m7e,resquarify:KZt},Tne=["x0","y0","x1","y1","depth","children"];function ade(e){kv.call(this,e)}ade.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Tne.length,default:Tne}]};Rt(ade,kv,{layout(){const e=XZt();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Qt(tOe,t)?e.tile(tOe[t]):et("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Tne});const rJt=Object.freeze(Object.defineProperty({__proto__:null,nest:tde,pack:nde,partition:rde,stratify:ide,tree:ode,treelinks:sde,treemap:ade},Symbol.toStringTag,{value:"Module"})),E7=4278190080;function iJt(e,t){const n=e.bitmap();return(t||[]).forEach(r=>n.set(e(r.boundary[0]),e(r.boundary[3]))),[n,void 0]}function oJt(e,t,n,r,i){const o=e.width,s=e.height,a=r||i,l=A0(o,s).getContext("2d"),c=A0(o,s).getContext("2d"),u=a&&A0(o,s).getContext("2d");n.forEach(T=>Iz(l,T,!1)),Iz(c,t,!1),a&&Iz(u,t,!0);const f=T7(l,o,s),d=T7(c,o,s),h=a&&T7(u,o,s),p=e.bitmap(),g=a&&e.bitmap();let m,v,y,b,w,S,_,E;for(v=0;v{i.items.forEach(o=>Iz(e,o.items,n))}):Uu[r].draw(e,{items:n?t.map(sJt):t})}function sJt(e){const t=IU(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Xg=5,Cl=31,cR=32,Xy=new Uint32Array(cR+1),Vd=new Uint32Array(cR+1);Vd[0]=0;Xy[0]=~Vd[0];for(let e=1;e<=cR;++e)Vd[e]=Vd[e-1]<<1|1,Xy[e]=~Vd[e];function aJt(e,t){const n=new Uint32Array(~~((e*t+cR)/cR));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>Xg]&1<<(a&Cl)},set:(o,s)=>{const a=s*e+o;r(a>>>Xg,1<<(a&Cl))},clear:(o,s)=>{const a=s*e+o;i(a>>>Xg,~(1<<(a&Cl)))},getRange:(o,s,a,l)=>{let c=l,u,f,d,h;for(;c>=s;--c)if(u=c*e+o,f=c*e+a,d=u>>>Xg,h=f>>>Xg,d===h){if(n[d]&Xy[u&Cl]&Vd[(f&Cl)+1])return!0}else{if(n[d]&Xy[u&Cl]||n[h]&Vd[(f&Cl)+1])return!0;for(let p=d+1;p{let c,u,f,d,h;for(;s<=l;++s)if(c=s*e+o,u=s*e+a,f=c>>>Xg,d=u>>>Xg,f===d)r(f,Xy[c&Cl]&Vd[(u&Cl)+1]);else for(r(f,Xy[c&Cl]),r(d,Vd[(u&Cl)+1]),h=f+1;h{let c,u,f,d,h;for(;s<=l;++s)if(c=s*e+o,u=s*e+a,f=c>>>Xg,d=u>>>Xg,f===d)i(f,Vd[c&Cl]|Xy[(u&Cl)+1]);else for(i(f,Vd[c&Cl]),i(d,Xy[(u&Cl)+1]),h=f+1;ho<0||s<0||l>=t||a>=e}}function lJt(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>aJt(i,o),s.ratio=r,s.padding=n,s.width=e,s.height=t,s}function cJt(e,t,n,r){const i=e.width,o=e.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,c=s.datum.fontSize,u=Au.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,v,y;for(let b=0;b=f&&(f=y,s.x=m,s.y=v);return m=u/2,v=c/2,d=s.x-m,h=s.x+m,p=s.y-v,g=s.y+v,s.align="center",d<0&&h<=i?s.align="left":0<=d&&ii||t-(s=r/2)<0||t+s>o}function p0(e,t,n,r,i,o,s,a){const l=i*o/(r*2),c=e(t-l),u=e(t+l),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(c,f,u,d)||s.getRange(c,f,u,d)||a&&a.getRange(c,f,u,d)}function uJt(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1];function l(c,u,f,d,h){const p=e.invert(c),g=e.invert(u);let m=f,v=o,y;if(!pB(p,g,d,h,i,o)&&!p0(e,p,g,h,d,m,s,a)&&!p0(e,p,g,h,d,h,s,null)){for(;v-m>=1;)y=(m+v)/2,p0(e,p,g,h,d,y,s,a)?v=y:m=y;if(m>f)return[p,g,m,!0]}}return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=Au.width(c.datum,c.datum.text);let p=n?d:0,g=!1,m=!1,v=0,y,b,w,S,_,E,T,k,P,I,R,F,A,L,$,j,V;for(let U=0;Ub&&(V=y,y=b,b=V),w>S&&(V=w,w=S,S=V),P=e(y),R=e(b),I=~~((P+R)/2),F=e(w),L=e(S),A=~~((F+L)/2),T=I;T>=P;--T)for(k=A;k>=F;--k)j=l(T,k,p,h,d),j&&([c.x,c.y,p,g]=j);for(T=I;T<=R;++T)for(k=A;k<=L;++k)j=l(T,k,p,h,d),j&&([c.x,c.y,p,g]=j);!g&&!n&&($=Math.abs(b-y+S-w),_=(y+b)/2,E=(w+S)/2,$>=v&&!pB(_,E,h,d,i,o)&&!p0(e,_,E,d,h,d,s,null)&&(v=$,c.x=_,c.y=E,m=!0))}return g||m?(_=h/2,E=d/2,s.setRange(e(c.x-_),e(c.y-E),e(c.x+_),e(c.y+E)),c.align="center",c.baseline="middle",!0):!1}}const fJt=[-1,-1,1,1],dJt=[-1,1,-1,1];function hJt(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=e.bitmap();return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=Au.width(c.datum,c.datum.text),p=[];let g=n?d:0,m=!1,v=!1,y=0,b,w,S,_,E,T,k,P,I,R,F,A;for(let L=0;L=1;)F=(I+R)/2,p0(e,E,T,d,h,F,s,a)?R=F:I=F;I>g&&(c.x=E,c.y=T,g=I,m=!0)}}!m&&!n&&(A=Math.abs(w-b+_-S),E=(b+w)/2,T=(S+_)/2,A>=y&&!pB(E,T,h,d,i,o)&&!p0(e,E,T,d,h,d,s,null)&&(y=A,c.x=E,c.y=T,v=!0))}return m||v?(E=h/2,T=d/2,s.setRange(e(c.x-E),e(c.y-T),e(c.x+E),e(c.y+T)),c.align="center",c.baseline="middle",!0):!1}}const pJt=["right","center","left"],gJt=["bottom","middle","top"];function mJt(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=r.length;return function(c){const u=c.boundary,f=c.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>i||u[3]>o)return!1;let d=c.textWidth??0,h,p,g,m,v,y,b,w,S,_,E,T,k,P,I;for(let R=0;R>>2&3)-1,g=h===0&&p===0||r[R]<0,m=h&&p?Math.SQRT1_2:1,v=r[R]<0?-1:1,y=u[1+h]+r[R]*h*m,E=u[4+p]+v*f*p/2+r[R]*p*m,w=E-f/2,S=E+f/2,T=e(y),P=e(w),I=e(S),!d)if(nOe(T,T,P,I,s,a,y,y,w,S,u,g))d=Au.width(c.datum,c.datum.text);else continue;if(_=y+v*d*h/2,y=_-d/2,b=_+d/2,T=e(y),k=e(b),nOe(T,k,P,I,s,a,y,b,w,S,u,g))return c.x=h?h*v<0?b:y:_,c.y=p?p*v<0?S:w:E,c.align=pJt[h*v+1],c.baseline=gJt[p*v+1],s.setRange(T,P,k,I),!0}return!1}}function nOe(e,t,n,r,i,o,s,a,l,c,u,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const P7=0,k7=4,M7=8,A7=0,R7=1,I7=2,vJt={"top-left":P7+A7,top:P7+R7,"top-right":P7+I7,left:k7+A7,middle:k7+R7,right:k7+I7,"bottom-left":M7+A7,bottom:M7+R7,"bottom-right":M7+I7},yJt={naive:cJt,"reduced-search":uJt,floodfill:hJt};function bJt(e,t,n,r,i,o,s,a,l,c,u){if(!e.length)return e;const f=Math.max(r.length,i.length),d=xJt(r,f),h=wJt(i,f),p=SJt(e[0].datum),g=p==="group"&&e[0].datum.items[l].marktype,m=g==="area",v=_Jt(p,g,a,l),y=c===null||c===1/0,b=m&&u==="naive";let w=-1,S=-1;const _=e.map(P=>{const I=y?Au.width(P,P.text):void 0;return w=Math.max(w,I),S=Math.max(S,P.fontSize),{datum:P,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(P),textWidth:I}});c=c===null||c===1/0?Math.max(w,S)+Math.max(...r):c;const E=lJt(t[0],t[1],c);let T;if(!b){n&&_.sort((R,F)=>n(R.datum,F.datum));let P=!1;for(let R=0;RR.datum);T=o.length||I?oJt(E,I||[],o,P,m):iJt(E,s&&_)}const k=m?yJt[u](E,T,s,l):mJt(E,T,h,d);return _.forEach(P=>P.opacity=+k(P)),_}function xJt(e,t){const n=new Float64Array(t),r=e.length;for(let i=0;i[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>i(o.datum):t==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const Pne=["x","y","opacity","align","baseline"],v7e=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function lde(e){Je.call(this,null,e)}lde.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:v7e},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:Pne.length,default:Pne}]};Rt(lde,Je,{transform(e,t){function n(o){const s=e[o];return Jn(s)&&t.modified(s.fields)}const r=e.modified();if(!(r||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&et("Size parameter should be specified as a [width, height] array.");const i=e.as||Pne;return bJt(t.materialize(t.SOURCE).source||[],e.size,e.sort,Ht(e.offset==null?1:e.offset),Ht(e.anchor||v7e),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),t.reflow(r).modifies(i)}});const CJt=Object.freeze(Object.defineProperty({__proto__:null,label:lde},Symbol.toStringTag,{value:"Module"}));function y7e(e,t){var n=[],r=function(u){return u(a)},i,o,s,a,l,c;if(t==null)n.push(e);else for(i={},o=0,s=e.length;o{S8e(c,e.x,e.y,e.bandwidth||.3).forEach(u=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function ude(e){Je.call(this,null,e)}ude.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(kne)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};Rt(ude,Je,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=y7e(r,e.groupby),o=(e.groupby||[]).map(Bo),s=e.method||"linear",a=e.order==null?3:e.order,l=OJt(s,a),c=e.as||[Bo(e.x),Bo(e.y)],u=kne[s],f=[];let d=e.extent;Qt(kne,s)||et("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=u(h,e.x,e.y,a);if(e.params){f.push(li({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||eg(h,e.x),v=y=>{const b={};for(let w=0;wv([y,g.predict(y)])):jU(g.predict,m,25,200).forEach(v)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const EJt=Object.freeze(Object.defineProperty({__proto__:null,loess:cde,regression:ude},Symbol.toStringTag,{value:"Module"})),Wm=11102230246251565e-32,qa=134217729,TJt=(3+8*Wm)*Wm;function D7(e,t,n,r,i){let o,s,a,l,c=t[0],u=r[0],f=0,d=0;u>c==u>-c?(o=c,c=t[++f]):(o=u,u=r[++d]);let h=0;if(fc==u>-c?(s=c+o,a=o-(s-c),c=t[++f]):(s=u+o,a=o-(s-u),u=r[++d]),o=s,a!==0&&(i[h++]=a);fc==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=t[++f]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f=A||-F>=A||(f=e-k,a=e-(k+f)+(f-i),f=n-P,c=n-(P+f)+(f-i),f=t-I,l=t-(I+f)+(f-o),f=r-R,u=r-(R+f)+(f-o),a===0&&l===0&&c===0&&u===0)||(A=AJt*s+TJt*Math.abs(F),F+=k*u+R*a-(I*c+P*l),F>=A||-F>=A))return F;w=a*R,d=qa*a,h=d-(d-a),p=a-h,d=qa*R,g=d-(d-R),m=R-g,S=p*m-(w-h*g-p*g-h*m),_=l*P,d=qa*l,h=d-(d-l),p=l-h,d=qa*P,g=d-(d-P),m=P-g,E=p*m-(_-h*g-p*g-h*m),v=S-E,f=S-v,Ol[0]=S-(v+f)+(f-E),y=w+v,f=y-w,b=w-(y-f)+(v-f),v=b-_,f=b-v,Ol[1]=b-(v+f)+(f-_),T=y+v,f=T-y,Ol[2]=y-(T-f)+(v-f),Ol[3]=T;const L=D7(4,T_,4,Ol,rOe);w=k*u,d=qa*k,h=d-(d-k),p=k-h,d=qa*u,g=d-(d-u),m=u-g,S=p*m-(w-h*g-p*g-h*m),_=I*c,d=qa*I,h=d-(d-I),p=I-h,d=qa*c,g=d-(d-c),m=c-g,E=p*m-(_-h*g-p*g-h*m),v=S-E,f=S-v,Ol[0]=S-(v+f)+(f-E),y=w+v,f=y-w,b=w-(y-f)+(v-f),v=b-_,f=b-v,Ol[1]=b-(v+f)+(f-_),T=y+v,f=T-y,Ol[2]=y-(T-f)+(v-f),Ol[3]=T;const $=D7(L,rOe,4,Ol,iOe);w=a*u,d=qa*a,h=d-(d-a),p=a-h,d=qa*u,g=d-(d-u),m=u-g,S=p*m-(w-h*g-p*g-h*m),_=l*c,d=qa*l,h=d-(d-l),p=l-h,d=qa*c,g=d-(d-c),m=c-g,E=p*m-(_-h*g-p*g-h*m),v=S-E,f=S-v,Ol[0]=S-(v+f)+(f-E),y=w+v,f=y-w,b=w-(y-f)+(v-f),v=b-_,f=b-v,Ol[1]=b-(v+f)+(f-_),T=y+v,f=T-y,Ol[2]=y-(T-f)+(v-f),Ol[3]=T;const j=D7($,iOe,4,Ol,oOe);return oOe[j-1]}function lN(e,t,n,r,i,o){const s=(t-o)*(n-i),a=(e-i)*(r-o),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=kJt*c?l:-RJt(e,t,n,r,i,o,c)}const sOe=Math.pow(2,-52),cN=new Uint32Array(512);class gB{static from(t,n=$Jt,r=NJt){const i=t.length,o=new Float64Array(i*2);for(let s=0;s>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.trianglesLen=0,this._cx=0,this._cy=0,this._hullStart=0,this.hull=this._triangles,this.triangles=this._triangles,this.halfedges=this._halfedges,this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1;let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let k=0;kc&&(c=P),I>u&&(u=I),this._ids[k]=k}const f=(a+c)/2,d=(l+u)/2;let h=0,p=0,g=0;for(let k=0,P=1/0;k0&&(p=k,P=I)}let y=t[2*p],b=t[2*p+1],w=1/0;for(let k=0;kR&&(k[P++]=F,R=A)}this.hull=k.subarray(0,P),this.triangles=new Uint32Array(0),this.halfedges=new Int32Array(0);return}if(lN(m,v,y,b,S,_)<0){const k=p,P=y,I=b;p=g,y=S,b=_,g=k,S=P,_=I}const E=FJt(m,v,y,b,S,_);this._cx=E.x,this._cy=E.y;for(let k=0;k0&&Math.abs(F-P)<=sOe&&Math.abs(A-I)<=sOe||(P=F,I=A,R===h||R===p||R===g))continue;let L=0;for(let z=0,N=this._hashKey(F,A);z=0;)if($=j,$===L){$=-1;break}if($===-1)continue;let V=this._addTriangle($,R,r[$],-1,-1,i[$]);i[R]=this._legalize(V+2),i[$]=V,T++;let U=r[$];for(;j=r[U],lN(F,A,t[2*U],t[2*U+1],t[2*j],t[2*j+1])<0;)V=this._addTriangle(U,R,j,i[R],-1,i[U]),i[R]=this._legalize(V+2),r[U]=U,T--,U=j;if($===L)for(;j=n[$],lN(F,A,t[2*j],t[2*j+1],t[2*$],t[2*$+1])<0;)V=this._addTriangle(j,R,$,-1,i[$],i[j]),this._legalize(V+2),i[j]=V,r[$]=$,T--,$=j;this._hullStart=n[R]=$,r[$]=n[U]=R,r[R]=U,o[this._hashKey(F,A)]=R,o[this._hashKey(t[2*$],t[2*$+1])]=$}this.hull=new Uint32Array(T);for(let k=0,P=this._hullStart;k0?3-n:1+n)/4}function L7(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function DJt(e,t,n,r,i,o,s,a){const l=e-s,c=t-a,u=n-s,f=r-a,d=i-s,h=o-a,p=l*l+c*c,g=u*u+f*f,m=d*d+h*h;return l*(f*m-g*h)-c*(u*m-g*d)+p*(u*h-f*d)<0}function LJt(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,c=o-t,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=(c*u-a*f)*d,p=(s*f-l*u)*d;return h*h+p*p}function FJt(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,c=o-t,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=e+(c*u-a*f)*d,p=t+(s*f-l*u)*d;return{x:h,y:p}}function NC(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=e[i],s=t[o];let a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;Gk(e,i,o),t[e[n]]>t[e[r]]&&Gk(e,n,r),t[e[o]]>t[e[r]]&&Gk(e,o,r),t[e[n]]>t[e[o]]&&Gk(e,n,o);const a=e[o],l=t[a];for(;;){do o++;while(t[e[o]]l);if(s=s-n?(NC(e,t,o,r),NC(e,t,n,s-1)):(NC(e,t,n,s-1),NC(e,t,o,r))}}function Gk(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function $Jt(e){return e[0]}function NJt(e){return e[1]}const aOe=1e-6;class u1{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>aOe||Math.abs(this._y1-o)>aOe)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Mne{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let zJt=class{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,v=r.length,y,b;g1;)o-=2;for(let s=2;s0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function WJt(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class fde{static from(t,n=BJt,r=UJt,i){return new fde("length"in t?HJt(t,n,r,i):Float64Array.from(GJt(t,n,r,i)))}constructor(t){this._delaunator=new gB(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&VJt(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new zJt(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:c}=this;if(i[t]===-1||!c.length)return(t+1)%(c.length>>1);let u=t,f=P_(n-c[t*2],2)+P_(r-c[t*2+1],2);const d=i[t];let h=d;do{let p=l[h];const g=P_(n-c[p*2],2)+P_(r-c[p*2+1],2);if(g>5)*e[1]),m=null,v=c.length,y=-1,b=[],w=c.map(_=>({text:t(_),font:n(_),style:i(_),weight:o(_),rotate:s(_),size:~~(r(_)+1e-14),padding:a(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,E)=>E.size-_.size);++y>1,S.y=e[1]*(u()+.5)>>1,ZJt(p,S,w,y),S.hasText&&h(g,S,m)&&(b.push(S),m?een(m,S):m=[{x:S.x+S.x0,y:S.y+S.y0},{x:S.x+S.x1,y:S.y+S.y1}],S.x-=e[0]>>1,S.y-=e[1]>>1)}return b};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(dM<<5)/g,p.height=Dz/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var v=g.x,y=g.y,b=Math.hypot(e[0],e[1]),w=l(e),S=u()<.5?1:-1,_=-S,E,T,k;(E=w(_+=S))&&(T=~~E[0],k=~~E[1],!(Math.min(Math.abs(T),Math.abs(k))>=b));)if(g.x=v+T,g.y=y+k,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!JJt(g,p,e[0]))&&(!m||ten(g,m))){for(var P=g.sprite,I=g.width>>5,R=e[0]>>5,F=g.x-(I<<4),A=F&127,L=32-A,$=g.y1-g.y0,j=(g.y+g.y0)*R+(F>>5),V,U=0;U<$;U++){V=0;for(var z=0;z<=I;z++)p[j+z]|=V<>>A:0);j+=R}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(c=p,f):c},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=fx(p),f):n},f.fontStyle=function(p){return arguments.length?(i=fx(p),f):i},f.fontWeight=function(p){return arguments.length?(o=fx(p),f):o},f.rotate=function(p){return arguments.length?(s=fx(p),f):s},f.text=function(p){return arguments.length?(t=fx(p),f):t},f.spiral=function(p){return arguments.length?(l=ien[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=fx(p),f):r},f.padding=function(p){return arguments.length?(a=fx(p),f):a},f.random=function(p){return arguments.length?(u=p,f):u},f}function ZJt(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,(dM<<5)/o,Dz/o);var s=0,a=0,l=0,c=n.length,u,f,d,h,p;for(--r;++r>5<<5,d=~~Math.max(Math.abs(y+b),Math.abs(y-b))}else u=u+31>>5<<5;if(d>l&&(l=d),s+u>=dM<<5&&(s=0,a+=l,l=0),a+d>=Dz)break;i.translate((s+(u>>1))/o,(a+(d>>1))/o),t.rotate&&i.rotate(t.rotate*F7),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=d,t.xoff=s,t.yoff=a,t.x1=u>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=u}for(var S=i.getImageData(0,0,(dM<<5)/o,Dz/o).data,_=[];--r>=0;)if(t=n[r],!!t.hasText){for(u=t.width,f=u>>5,d=t.y1-t.y0,h=0;h>5),P=S[(a+p)*(dM<<5)+(s+h)<<2]?1<<31-h%32:0;_[k]|=P,E|=P}E?T=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+T,t.sprite=_.slice(0,(t.y1-t.y0)*f)}}}function JJt(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,o=e.x-(i<<4),s=o&127,a=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(o>>5),u,f=0;f>>s:0))&t[c+d])return!0;c+=n}return!1}function een(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function ten(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const c=o.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Zf).layout(),u=o.size(),f=u[0]>>1,d=u[1]>>1,h=c.length;for(let p=0,g,m;pnew Uint8Array(e),len=e=>new Uint16Array(e),qM=e=>new Uint32Array(e);function cen(){let e=8,t=[],n=qM(0),r=uN(0,e),i=uN(0,e);return{data:()=>t,seen:()=>n=uen(n,t.length),add(o){for(let s=0,a=t.length,l=o.length,c;st.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>e)&&(e=Math.max(s,e),r=uN(o,e,r),i=uN(o,e))}}}function uen(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function uN(e,t,n){const r=(t<257?aen:t<65537?len:qM)(e);return n&&r.set(n),r}function lOe(e,t,n){const r=1<0)for(m=0;me,size:()=>n}}function fen(e,t){return e.sort.call(t,(n,r)=>{const i=e[n],o=e[r];return io?1:0}),vUt(e,t)}function den(e,t,n,r,i,o,s,a,l){let c=0,u=0,f;for(f=0;ct.modified(r.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,c;for(;a{const o=i.remove(t,n);for(const s in r)r[s].reindex(o)})},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,s=r.length;let a=0,l,c;for(n.filters=0,c=0;ch)for(m=h,v=Math.min(f,p);mp)for(m=Math.max(f,p),v=d;mf)for(p=f,g=Math.min(c,d);pd)for(p=Math.max(c,d),g=u;pa[u]&n?null:s[u];return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,u=>{const f=a[u]&n;return!f&&f^l[u]&n?s[u]:null}),o.filter(o.REM,u=>{const f=a[u]&n;return f&&!(f^(f^l[u]&n))?s[u]:null})):(o.filter(o.ADD,c),o.filter(o.REM,u=>(a[u]&n)===i?s[u]:null)),o.filter(o.SOURCE,u=>c(u._index))}});const hen=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:pde,resolvefilter:gde},Symbol.toStringTag,{value:"Module"})),pen="RawCode",pw="Literal",gen="Property",men="Identifier",ven="ArrayExpression",yen="BinaryExpression",w7e="CallExpression",ben="ConditionalExpression",xen="LogicalExpression",wen="MemberExpression",Sen="ObjectExpression",_en="UnaryExpression";function Th(e){this.type=e}Th.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=Cen(this),n=0,r=t.length;n";wg[gw]="Identifier";wg[Mb]="Keyword";wg[CV]="Null";wg[gS]="Numeric";wg[gc]="Punctuator";wg[nL]="String";wg[Oen]="RegularExpression";var Een="ArrayExpression",Ten="BinaryExpression",Pen="CallExpression",ken="ConditionalExpression",S7e="Identifier",Men="Literal",Aen="LogicalExpression",Ren="MemberExpression",Ien="ObjectExpression",Den="Property",Len="UnaryExpression",ta="Unexpected token %0",Fen="Unexpected number",$en="Unexpected string",Nen="Unexpected identifier",zen="Unexpected reserved word",jen="Unexpected end of input",Ane="Invalid regular expression",$7="Invalid regular expression: missing /",_7e="Octal literals are not allowed in strict mode.",Ben="Duplicate data property in object literal not allowed in strict mode",Aa="ILLEGAL",uR="Disabled.",Uen=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Ven=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function OV(e,t){if(!e)throw new Error("ASSERT: "+t)}function bm(e){return e>=48&&e<=57}function mde(e){return"0123456789abcdefABCDEF".includes(e)}function XM(e){return"01234567".includes(e)}function Wen(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function fR(e){return e===10||e===13||e===8232||e===8233}function rL(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Uen.test(String.fromCharCode(e))}function mB(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Ven.test(String.fromCharCode(e))}const Hen={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function C7e(){for(;nt1114111||e!=="}")&&Xr({},ta,Aa),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function O7e(){var e,t;for(e=dn.charCodeAt(nt++),t=String.fromCharCode(e),e===92&&(dn.charCodeAt(nt)!==117&&Xr({},ta,Aa),++nt,e=Rne("u"),(!e||e==="\\"||!rL(e.charCodeAt(0)))&&Xr({},ta,Aa),t=e);nt>>=")return nt+=4,{type:gc,value:s,start:e,end:nt};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return nt+=3,{type:gc,value:o,start:e,end:nt};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".includes(r)||i==="=>")return nt+=2,{type:gc,value:i,start:e,end:nt};if(i==="//"&&Xr({},ta,Aa),"<>=!+-*%&|^/".includes(r))return++nt,{type:gc,value:r,start:e,end:nt};Xr({},ta,Aa)}function Yen(e){let t="";for(;nt{if(parseInt(i,16)<=1114111)return"x";Xr({},Ane)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Xr({},Ane)}try{return new RegExp(e,t)}catch{return null}}function Jen(){var e,t,n,r,i;for(e=dn[nt],OV(e==="/","Regular expression literal must start with a slash"),t=dn[nt++],n=!1,r=!1;nt=0&&Xr({},Ane,n),{value:n,literal:t}}function ttn(){var e,t,n,r;return Oi=null,C7e(),e=nt,t=Jen(),n=etn(),r=Zen(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:nt}}function ntn(e){return e.type===gw||e.type===Mb||e.type===_V||e.type===CV}function E7e(){if(C7e(),nt>=pl)return{type:tL,start:nt,end:nt};const e=dn.charCodeAt(nt);return rL(e)?Xen():e===40||e===41||e===59?N7():e===39||e===34?Ken():e===46?bm(dn.charCodeAt(nt+1))?uOe():N7():bm(e)?uOe():N7()}function _c(){const e=Oi;return nt=e.end,Oi=E7e(),nt=e.end,e}function T7e(){const e=nt;Oi=E7e(),nt=e}function rtn(e){const t=new Th(Een);return t.elements=e,t}function fOe(e,t,n){const r=new Th(e==="||"||e==="&&"?Aen:Ten);return r.operator=e,r.left=t,r.right=n,r}function itn(e,t){const n=new Th(Pen);return n.callee=e,n.arguments=t,n}function otn(e,t,n){const r=new Th(ken);return r.test=e,r.consequent=t,r.alternate=n,r}function vde(e){const t=new Th(S7e);return t.name=e,t}function hM(e){const t=new Th(Men);return t.value=e.value,t.raw=dn.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function dOe(e,t,n){const r=new Th(Ren);return r.computed=e==="[",r.object=t,r.property=n,r.computed||(n.member=!0),r}function stn(e){const t=new Th(Ien);return t.properties=e,t}function hOe(e,t,n){const r=new Th(Den);return r.key=t,r.value=n,r.kind=e,r}function atn(e,t){const n=new Th(Len);return n.operator=e,n.argument=t,n.prefix=!0,n}function Xr(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(o,s)=>(OV(s":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function btn(){var e,t,n,r,i,o,s,a,l,c;if(e=Oi,l=Lz(),r=Oi,i=mOe(r),i===0)return l;for(r.prec=i,_c(),t=[e,Oi],s=Lz(),o=[l,r,s];(i=mOe(Oi))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),t.pop(),n=fOe(a,l,s),o.push(n);r=_c(),r.prec=i,o.push(r),t.push(Oi),n=Lz(),o.push(n)}for(c=o.length-1,n=o[c],t.pop();c>1;)t.pop(),n=fOe(o[c-1].value,o[c-2],n),c-=2;return n}function mw(){var e,t,n;return e=btn(),ao("?")&&(_c(),t=mw(),gl(":"),n=mw(),e=otn(e,t,n)),e}function yde(){const e=mw();if(ao(","))throw new Error(uR);return e}function bde(e){dn=e,nt=0,pl=dn.length,Oi=null,T7e();const t=yde();if(Oi.type!==tL)throw new Error("Unexpect token after expression.");return t}var P7e={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function k7e(e){function t(s,a,l,c){let u=e(a[0]);return l&&(u=l+"("+u+")",l.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+s+(c<0?"":c===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,l){return c=>t(s,c,a,l)}const r="new Date",i="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&et("Missing arguments to clamp function."),s.length>3&&et("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),btoa:"btoa",atob:"atob",regexp:o,test:n("test",o),if:function(s){s.length<3&&et("Missing arguments to if function."),s.length>3&&et("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function xtn(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function M7e(e){e=e||{};const t=e.allowed?mh(e.allowed):{},n=e.forbidden?mh(e.forbidden):{},r=e.constants||P7e,i=(e.functions||k7e)(f),o=e.globalvar,s=e.fieldvar,a=Jn(o)?o:p=>`${o}["${p}"]`;[...Object.getOwnPropertyNames(Object.prototype).filter(p=>typeof Object.prototype[p]=="function")];let l={},c={},u=0;function f(p){if(Ut(p))return p;const g=d[p.type];return g==null&&et("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:Qt(n,g)?et("Illegal identifier: "+g):Qt(r,g)?r[g]:Qt(t,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(u+=1);const v=f(p.property);return m===s&&(c[xtn(v)]=1),g&&(u-=1),m+(g?"."+v:"["+v+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&et("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,v=Qt(i,g)&&i[g];return v||et("Unrecognized function: "+g),Jn(v)?v(m):v+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>{for(const g of p.properties){const m=g.key.name;Gle.has(m)&&et("Illegal property: "+m)}return"{"+p.properties.map(f).join(",")+"}"},Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},g}return h.functions=i,h.constants=r,h}const vOe=Symbol("vega_selection_getter");function A7e(e){return(!e.getter||!e.getter[vOe])&&(e.getter=Yf(e.field),e.getter[vOe]=!0),e.getter}const xde="intersect",yOe="union",wtn="vlMulti",Stn="vlPoint",bOe="or",_tn="and",lp="_vgsid_",dR=Yf(lp),Ctn="E",Otn="R",Etn="R-E",Ttn="R-LE",Ptn="R-RE",ktn="E-LT",Mtn="E-LTE",Atn="E-GT",Rtn="E-GTE",Itn="E-VALID",Dtn="E-ONE",vB="index:unit";function xOe(e,t){for(var n=t.fields,r=t.values,i=n.length,o=0,s,a;o=r[o])return!1}else if(a.type===Mtn){if(s>r[o])return!1}else if(a.type===Atn){if(s<=r[o])return!1}else if(a.type===Rtn){if(srr(t.fields?{values:t.fields.map(r=>A7e(r)(n.datum))}:{[lp]:dR(n.datum)},t))}function jtn(e,t,n,r){for(var i=this.context.data[e],o=i?i.values.value:[],s={},a={},l={},c,u,f,d,h,p,g,m,v,y,b=o.length,w=0,S,_;w(E[u[k].field]=T,E),{})))}else h=lp,p=dR(c),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[lp]:p}));if(t=t||yOe,s[lp]?s[lp]=j7[`${lp}_${t}`](...Object.values(s[lp])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map(T=>s[E][T]).reduce((T,k)=>T===void 0?k:j7[`${l[E]}_${t}`](T,k))}),o=Object.keys(a),n&&o.length){const E=r?Stn:wtn;s[E]=t===yOe?{[bOe]:o.reduce((T,k)=>(T.push(...a[k]),T),[])}:{[_tn]:o.map(T=>({[bOe]:a[T]}))}}return s}var j7={[`${lp}_union`]:EUt,[`${lp}_intersect`]:CUt,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;nt.includes(n)):t},R_union:function(e,t){var n=cl(t[0]),r=cl(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};const Btn=":",Utn="@";function wde(e,t,n,r){t[0].type!==pw&&et("First argument to selection functions must be a string literal.");const i=t[0].value,o=t.length>=2&&Ar(t).value,s="unit",a=Utn+s,l=Btn+i;o===xde&&!Qt(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),Qt(r,l)||(r[l]=n.getData(i).tuplesRef())}function I7e(e){const t=this.context.data[e];return t?t.values.value:[]}function Vtn(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i&&i.count}function Wtn(e,t){const n=this.context.dataflow,r=this.context.data[e],i=r.input;return n.pulse(i,n.changeset().remove(Qf).insert(t)),1}function Htn(e,t,n){if(e){const r=this.context.dataflow,i=e.mark.source;r.pulse(i,r.changeset().encode(e,t))}return n!==void 0?n:e}const iL=e=>function(t,n){const r=this.context.dataflow.locale();return t===null?"null":r[e](n)(t)},Gtn=iL("format"),D7e=iL("timeFormat"),qtn=iL("utcFormat"),Xtn=iL("timeParse"),Ytn=iL("utcParse"),fN=new Date(2e3,0,1);function TV(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(fN.setYear(2e3),fN.setMonth(e),fN.setDate(t),D7e.call(this,fN,n))}function Qtn(e){return TV.call(this,e,1,"%B")}function Ktn(e){return TV.call(this,e,1,"%b")}function Ztn(e){return TV.call(this,0,2+e,"%A")}function Jtn(e){return TV.call(this,0,2+e,"%a")}const enn=":",tnn="@",Ine="%",L7e="$";function Sde(e,t,n,r){t[0].type!==pw&&et("First argument to data functions must be a string literal.");const i=t[0].value,o=enn+i;if(!Qt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function nnn(e,t,n,r){t[0].type!==pw&&et("First argument to indata must be a string literal."),t[1].type!==pw&&et("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,s=tnn+o;Qt(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function Hl(e,t,n,r){if(t[0].type===pw)wOe(n,r,t[0].value);else for(e in n.scales)wOe(n,r,e)}function wOe(e,t,n){const r=Ine+n;if(!Qt(t,r))try{t[r]=e.scaleRef(n)}catch{}}function Sg(e,t){if(Ut(e)){const n=t.scales[e];return n&&C_e(n.value)?n.value:void 0}else if(Jn(e))return C_e(e)?e:void 0}function rnn(e,t,n){t.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Hl,n._range=Hl,n._scale=Hl;const r=i=>"_["+(i.type===pw?Tt(Ine+i.value):Tt(Ine)+"+"+e(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${e(i[1])})`}}function _de(e,t){return function(n,r,i){if(n){const o=Sg(n,(i||this).context);return o&&o.path[e](r)}else return t(r)}}const inn=_de("area",SYt),onn=_de("bounds",EYt),snn=_de("centroid",RYt);function ann(e,t){const n=Sg(e,(t||this).context);return n&&n.scale()}function lnn(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function Cde(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(r){e.warn(r)}return n[n.length-1]}function cnn(){return Cde(this.context.dataflow,"warn",arguments)}function unn(){return Cde(this.context.dataflow,"info",arguments)}function fnn(){return Cde(this.context.dataflow,"debug",arguments)}function B7(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Dne(e){const t=Y0(e),n=B7(t.r),r=B7(t.g),i=B7(t.b);return .2126*n+.7152*r+.0722*i}function dnn(e,t){const n=Dne(e),r=Dne(t),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function hnn(){const e=[].slice.call(arguments);return e.unshift({}),rr(...e)}function F7e(e,t){return e===t||e!==e&&t!==t?!0:it(e)?it(t)&&e.length===t.length?pnn(e,t):!1:Bt(e)&&Bt(t)?$7e(e,t):!1}function pnn(e,t){for(let n=0,r=e.length;n$7e(e,t)}function gnn(e,t,n,r,i,o){const s=this.context.dataflow,a=this.context.data[e],l=a.input,c=s.stamp();let u=a.changes,f,d;if(s._trigger===!1||!(l.value.length||t||r))return 0;if((!u||u.stamp{a.modified=!0,s.pulse(l,u).run()},!0,1)),n&&(f=n===!0?Qf:it(n)||RU(n)?n:SOe(n),u.remove(f)),t&&u.insert(t),r&&(f=SOe(r),l.value.some(f)?u.remove(f):u.insert(r)),i){if(Jn(i))throw Error("modify parameter must be a data tuple, not a function");for(d in o)u.modify(i,d,o[d])}return 1}function mnn(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function vnn(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const _Oe={};function ynn(e,t){const n=_Oe[t]||(_Oe[t]=Yf(t));return it(e)?e.map(n):n(e)}function PV(e){return it(e)||ArrayBuffer.isView(e)?e:null}function Ode(e){return PV(e)||(Ut(e)?e:null)}function bnn(e,...t){return PV(e).join(...t)}function xnn(e,...t){return Ode(e).indexOf(...t)}function wnn(e,...t){return Ode(e).lastIndexOf(...t)}function Snn(e,...t){return Ode(e).slice(...t)}function _nn(e,t,n){return Jn(n)&&et("Function argument passed to replace."),!Ut(t)&&!ece(t)&&et("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function Cnn(e){return PV(e).slice().reverse()}function Onn(e){return PV(e).slice().sort(zT)}function Enn(e,t,n){return Nue(e||0,t||0,n||0)}function Tnn(e,t){const n=Sg(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function Pnn(e,t){const n=Sg(e,(t||this).context);return n?n.copy():void 0}function knn(e,t){const n=Sg(e,(t||this).context);return n?n.domain():[]}function Mnn(e,t,n){const r=Sg(e,(n||this).context);return r?it(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}function Ann(e,t){const n=Sg(e,(t||this).context);return n&&n.range?n.range():[]}function Rnn(e,t,n){const r=Sg(e,(n||this).context);return r?r(t):void 0}function Inn(e,t,n,r,i){e=Sg(e,(i||this).context);const o=PHe(t,n);let s=e.domain(),a=s[0],l=Ar(s),c=ml;return l-a?c=mHe(e,a,l):e=(e.interpolator?Zr("sequential")().interpolator(e.interpolator()):Zr("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,l=1]),e.ticks&&(s=e.ticks(+r||15),a!==s[0]&&s.unshift(a),l!==Ar(s)&&s.push(l)),s.forEach(u=>o.stop(c(u),e(u))),o}function Dnn(e,t,n){const r=Sg(e,(n||this).context);return function(i){return r?r.path.context(i)(t):""}}function Lnn(e){let t=null;return function(n){return n?nR(n,t=t||iE(e)):e}}const N7e=e=>e.data;function z7e(e,t){const n=I7e.call(t,e);return n.root&&n.root.lookup||{}}function Fnn(e,t,n){const r=z7e(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(N7e):void 0}function $nn(e,t){const n=z7e(e,this)[t];return n?n.ancestors().map(N7e):void 0}const j7e=()=>typeof window<"u"&&window||null;function Nnn(){const e=j7e();return e?e.screen:{}}function znn(){const e=j7e();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function jnn(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function B7e(e,t,n){if(!e)return[];const[r,i]=e,o=new ws().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return CGe(s,o,Bnn(t))}function Bnn(e){let t=null;if(e){const n=Ht(e.marktype),r=Ht(e.markname);t=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return t}function Unn(e,t,n,r=5){e=Ht(e);const i=e[e.length-1];return i===void 0||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e}function Vnn(e){return Ht(e).reduce((t,[n,r],i)=>t+=i==0?`M ${n},${r} `:i===e.length-1?" Z":`L ${n},${r} `,"")}function Wnn(e,t,n){const{x:r,y:i,mark:o}=n,s=new ws().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,c]of t)ls.x2&&(s.x2=l),cs.y2&&(s.y2=c);return s.translate(r,i),B7e([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(l=>Hnn(l.x,l.y,t))}function Hnn(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=a>t&&e<(s-l)*(t-c)/(a-c)+l&&r++}return r&1}const hR={random(){return Zf()},cumulativeNormal:$U,cumulativeLogNormal:Pce,cumulativeUniform:Rce,densityNormal:_ce,densityLogNormal:Tce,densityUniform:Ace,quantileNormal:NU,quantileLogNormal:kce,quantileUniform:Ice,sampleNormal:FU,sampleLogNormal:Ece,sampleUniform:Mce,isArray:it,isBoolean:cS,isDate:P0,isDefined(e){return e!==void 0},isNumber:Qr,isObject:Bt,isRegExp:ece,isString:Ut,isTuple:RU,isValid(e){return e!=null&&e===e},toBoolean:nce,toDate(e){return rce(e)},toNumber:cl,toString:ice,indexof:xnn,join:bnn,lastindexof:wnn,replace:_nn,reverse:Cnn,sort:Onn,slice:Snn,flush:HUe,lerp:qUe,merge:hnn,pad:QUe,peek:Ar,pluck:ynn,span:PD,inrange:IC,truncate:KUe,rgb:Y0,lab:Sj,hcl:_j,hsl:xj,luminance:Dne,contrast:dnn,sequence:Oc,format:Gtn,utcFormat:qtn,utcParse:Ytn,utcOffset:kVe,utcSequence:RVe,timeFormat:D7e,timeParse:Xtn,timeOffset:PVe,timeSequence:AVe,timeUnitSpecifier:vVe,monthFormat:Qtn,monthAbbrevFormat:Ktn,dayFormat:Ztn,dayAbbrevFormat:Jtn,quarter:BUe,utcquarter:UUe,week:bVe,utcweek:SVe,dayofyear:yVe,utcdayofyear:wVe,warn:cnn,info:unn,debug:fnn,extent(e){return eg(e)},inScope:lnn,intersect:B7e,clampRange:VUe,pinchDistance:mnn,pinchAngle:vnn,screen:Nnn,containerSize:jnn,windowSize:znn,bandspace:Enn,setdata:Wtn,pathShape:Lnn,panLinear:$Ue,panLog:NUe,panPow:zUe,panSymlog:jUe,zoomLinear:Yle,zoomLog:Qle,zoomPow:ij,zoomSymlog:Kle,encode:Htn,modify:gnn,lassoAppend:Unn,lassoPath:Vnn,intersectLasso:Wnn},Gnn=["view","item","group","xy","x","y"],qnn="event.vega.",U7e="this.",Ede={},V7e={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Tt(L7e+e)}]`,functions:Xnn,constants:P7e,visitors:Ede},Lne=M7e(V7e);function Xnn(e){const t=k7e(e);Gnn.forEach(n=>t[n]=qnn+n);for(const n in hR)t[n]=U7e+n;return rr(t,rnn(e,hR,Ede)),t}function ls(e,t,n){return arguments.length===1?hR[e]:(hR[e]=t,n&&(Ede[e]=n),Lne&&(Lne.functions[e]=U7e+e),this)}ls("bandwidth",Tnn,Hl);ls("copy",Pnn,Hl);ls("domain",knn,Hl);ls("range",Ann,Hl);ls("invert",Mnn,Hl);ls("scale",Rnn,Hl);ls("gradient",Inn,Hl);ls("geoArea",inn,Hl);ls("geoBounds",onn,Hl);ls("geoCentroid",snn,Hl);ls("geoShape",Dnn,Hl);ls("geoScale",ann,Hl);ls("indata",Vtn,nnn);ls("data",I7e,Sde);ls("treePath",Fnn,Sde);ls("treeAncestors",$nn,Sde);ls("vlSelectionTest",Ltn,wde);ls("vlSelectionIdTest",Ntn,wde);ls("vlSelectionResolve",jtn,wde);ls("vlSelectionTuples",ztn);function og(e,t){const n={};let r;try{e=Ut(e)?e:Tt(e)+"",r=bde(e)}catch{et("Expression parse error: "+e)}r.visit(o=>{if(o.type!==w7e)return;const s=o.callee.name,a=V7e.visitors[s];a&&a(s,o.arguments,t,n)});const i=Lne(r);return i.globals.forEach(o=>{const s=L7e+o;!Qt(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:rr({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function Ynn(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(r=>t.parseOperator(r)),n.forEach(r=>t.parseOperatorParameters(r)),(e.streams||[]).forEach(r=>t.parseStream(r)),(e.updates||[]).forEach(r=>t.parseUpdate(r)),t.resolve()}const Qnn=mh(["rule"]),COe=mh(["group","image","rect"]);function Knn(e,t){let n="";return Qnn[t]||(e.x2&&(e.x?(COe[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(COe[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function Tde(e){return(e+"").toLowerCase()}function Znn(e){return Tde(e)==="operator"}function Jnn(e){return Tde(e)==="collect"}function qk(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}function ern(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${r} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} - : v !== v && u === u ? ${r} : `}var csn={operator:(e,t)=>e2(e,["_"],t.code),parameter:(e,t)=>e2(e,["datum","_"],t.code),event:(e,t)=>e2(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return e2(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const s="o["+Tt(o)+"]";i+=`$=${r[o].code};if(${s}!==$)${s}=$,m=1;`}return i+=osn(r,n),i+="return m;",e2(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(Tt).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=(o,s)=>{const a=t[s];let l,c;return o.path?(l=`a${o.path}`,c=`b${o.path}`):((n=n||{})["f"+s]=o,l=`this.f${s}(a)`,c=`this.f${s}(b)`),lsn(l,c,-a,a)},i=Function("a","b","var u, v; return "+e.map(r).join("")+"0;");return n?i.bind(n):i}}};function usn(e){const t=this;ssn(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function fsn(e){const t=this;if(e.params){const n=t.get(e.id);n||et("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function dsn(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=lt(i)?i.map(o=>OTe(o,n,t)):OTe(i,n,t)}return t}function OTe(e,t,n){if(!e||!Ht(e))return e;for(let r=0,i=ETe.length,o;ri&&i.$tupleid?Sn:i);return t.fn[n]||(t.fn[n]=pue(r,e.$order,t.expr.codegen))}function ysn(e,t){const n=e.$encode,r={};for(const i in n){const o=n[i];r[i]=Gc(t.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function bsn(e,t){return t}function xsn(e,t){const n=e.$subflow;return function(r,i,o){const s=t.fork().parse(n),a=s.get(n.operators[0].id),l=s.signals.parent;return l&&l.set(o),a.detachSubflow=()=>t.detach(s),a}}function wsn(){return Sn}function Ssn(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,r=e.stream!=null?t.get(e.stream):void 0,i;e.source?r=t.events(e.source,e.type,n):e.merge&&(i=e.merge.map(o=>t.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),e.between&&(i=e.between.map(o=>t.get(o)),r=r.between(i[0],i[1])),e.filter&&(r=r.filter(n)),e.throttle!=null&&(r=r.throttle(+e.throttle)),e.debounce!=null&&(r=r.debounce(+e.debounce)),r==null&&et("Invalid stream definition: "+JSON.stringify(e)),e.consume&&r.consume(!0),t.stream(e,r)}function _sn(e){var t=this,n=Ht(n=e.source)?n.$ref:n,r=t.get(n),i=null,o=e.update,s=void 0;r||et("Source not defined: "+e.source),i=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(s=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,r,i,o,s)}const Csn={skip:!0};function Osn(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach(o=>{const s=t.signals[o];e.signals(o,s)&&(r[o]=s.value)})}if(e.data){var i=n.data={};Object.keys(t.data).forEach(o=>{const s=t.data[o];e.data(o,s)&&(i[o]=s.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function Esn(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach(o=>{n.update(t.signals[o],i[o],Csn)}),Object.keys(r||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Kf).insert(r[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function sYe(e,t,n,r){return new aYe(e,t,n,r)}function aYe(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||csn,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function TTe(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}aYe.prototype=TTe.prototype={fork(){const e=new TTe(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),asn(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(r.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),r.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const s=n.data[o]||(n.data[o]={});e.data[o].forEach(a=>s[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[Vhe(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:rsn,parseOperator:usn,parseOperatorParameters:fsn,parseParameters:dsn,parseStream:Ssn,parseUpdate:_sn,getState:Osn,setState:Esn};function Tsn(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),lYe(t,e.description()))}function lYe(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function Psn(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const rX="default";function ksn(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:rX,item:null}));e.on(e.events("view","pointermove"),t,(n,r)=>{const i=t.value,o=i?Kt(i)?i:i.user:rX,s=r.item&&r.item.cursor||null;return i&&o===i.user&&s==i.item?i:{user:o,item:s}}),e.add(null,function(n){let r=n.cursor,i=this.value;return Kt(r)||(i=r.item,r=r.user),Gre(e,r&&r!==rX?r:i||r),i},{cursor:t})}function Gre(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function VB(e,t){var n=e._runtime.data;return Yt(n,t)||et("Unrecognized data set: "+t),n[t]}function Msn(e,t){return arguments.length<2?VB(this,e).values.value:n8.call(this,e,wS().remove(Kf).insert(t))}function n8(e,t){wHe(t)||et("Second argument to changes must be a changeset.");const n=VB(this,e);return n.modified=!0,this.pulse(n.input,t)}function Asn(e,t){return n8.call(this,e,wS().insert(t))}function Rsn(e,t){return n8.call(this,e,wS().remove(t))}function cYe(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function uYe(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function r8(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function Isn(e){var t=r8(e),n=cYe(e),r=uYe(e);e._renderer.background(e.background()),e._renderer.resize(n,r,t),e._handler.origin(t),e._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){e.error(o)}})}function Dsn(e,t,n){var r=e._renderer,i=r&&r.canvas(),o,s,a;return i&&(a=r8(e),s=t.changedTouches?t.changedTouches[0]:t,o=UV(s,i),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=Lsn(e,n,o),t}function Lsn(e,t,n){const r=t?t.mark.marktype==="group"?t:t.mark.group:null;function i(s){var a=r,l;if(s){for(l=t;l;l=l.mark.group)if(l.mark.name===s){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;Kt(s)&&(s=i(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:yl(e),item:yl(t||{}),group:i,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const PTe="view",Fsn="timer",$sn="window",Nsn={trap:!1};function zsn(e){const t=nr({defaults:{}},e),n=(r,i)=>{i.forEach(o=>{lt(r[o])&&(r[o]=vh(r[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function fYe(e,t,n,r){e._eventListeners.push({type:n,sources:Vt(t),handler:r})}function jsn(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[t]:i?!i[t]:e.preventDefault()}function TN(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return r===!1||Ht(r)&&!r[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function Bsn(e,t,n){var r=this,i=new lV(n),o=function(c,u){r.runAsync(null,()=>{e===PTe&&jsn(r,t)&&c.preventDefault(),i.receive(Dsn(r,c,u))})},s;if(e===Fsn)TN(r,"timer",t)&&r.timer(o,t);else if(e===PTe)TN(r,"view",t)&&r.addEventListener(t,o,Nsn);else if(e===$sn?TN(r,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&TN(r,"selector",t)&&(s=Array.from(document.querySelectorAll(e))),!s)r.warn("Can not resolve event source: "+e);else{for(var a=0,l=s.length;a=0;)t[i].stop();for(i=r.length;--i>=0;)for(s=r[i],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(e&&e.call(this,this._handler,null,null,null),i=n.length;--i>=0;)l=n[i].type,a=n[i].handler,this._handler.off(l,a);return this}function Ru(e,t,n){const r=document.createElement(e);for(const i in t)r.setAttribute(i,t[i]);return n!=null&&(r.textContent=n),r}const Wsn="vega-bind",Hsn="vega-bind-name",Gsn="vega-bind-radio";function qsn(e,t,n){if(!t)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:s=>{s!=e.signal(r.signal)&&e.runAsync(null,()=>{i.source=!0,e.signal(r.signal,s)})}},r.debounce&&(i.update=gue(r.debounce,i.update))),(r.input==null&&r.element?Xsn:Qsn)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(e.signal(r.signal))}),i.active=!0),i}function Xsn(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),fYe(r,t,i,o),e.set=s=>{t.value=s,t.dispatchEvent(Ysn(i))}}function Ysn(e){return typeof Event<"u"?new Event(e):{type:e}}function Qsn(e,t,n,r){const i=r.signal(n.signal),o=Ru("div",{class:Wsn}),s=n.input==="radio"?o:o.appendChild(Ru("label"));s.appendChild(Ru("span",{class:Hsn},n.name||n.signal)),t.appendChild(o);let a=Ksn;switch(n.input){case"checkbox":a=Zsn;break;case"select":a=Jsn;break;case"radio":a=ean;break;case"range":a=tan;break}a(e,s,n,i)}function Ksn(e,t,n,r){const i=Ru("input");for(const o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",()=>e.update(i.value)),e.elements=[i],e.set=o=>i.value=o}function Zsn(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=Ru("input",i);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function Jsn(e,t,n,r){const i=Ru("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const l={value:s};WB(s,r)&&(l.selected=!0),i.appendChild(Ru("option",l,(o[a]||s)+""))}),t.appendChild(i),i.addEventListener("change",()=>{e.update(n.options[i.selectedIndex])}),e.elements=[i],e.set=s=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:s};WB(s,r)&&(l.checked=!0);const c=Ru("input",l);c.addEventListener("change",()=>e.update(s));const u=Ru("label",{},(o[a]||s)+"");return u.prepend(c),i.appendChild(u),c}),e.set=s=>{const a=e.elements,l=a.length;for(let c=0;c{l.textContent=a.value,e.update(+a.value)};a.addEventListener("input",c),a.addEventListener("change",c),e.elements=[a],e.set=u=>{a.value=u,l.textContent=u}}function WB(e,t){return e===t||e+""==t+""}function dYe(e,t,n,r,i,o){return t=t||new r(e.loader()),t.initialize(n,cYe(e),uYe(e),r8(e),i,o).background(e.background())}function Whe(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function nan(e,t,n,r){const i=new r(e.loader(),Whe(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,r8(e),e);return t&&t.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function ran(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=VV(r);e=n._el=e?iX(n,e,!0):null,Tsn(n),o||n.error("Unrecognized renderer type: "+r);const s=o.handler||lL,a=e?o.renderer:o.headless;return n._renderer=a?dYe(n,n._renderer,e,a):null,n._handler=nan(n,n._handler,e,s),n._redraw=!0,e&&i!=="none"&&(t=t?n._elBind=iX(n,t,!0):e.appendChild(Ru("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&i!=="container"&&(l.element=iX(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{qsn(n,l.element||t,l)})),n}function iX(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(r){t=null,e.error(r)}return t}const t2=e=>+e||0,ian=e=>({top:e,bottom:e,left:e,right:e});function RTe(e){return Ht(e)?{top:t2(e.top),bottom:t2(e.bottom),left:t2(e.left),right:t2(e.right)}:ian(t2(e))}async function Hhe(e,t,n,r){const i=VV(t),o=i&&i.headless;return o||et("Unrecognized renderer type: "+t),await e.runAsync(),dYe(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}async function oan(e,t){e!==g0.Canvas&&e!==g0.SVG&&e!==g0.PNG&&et("Unrecognized image type: "+e);const n=await Hhe(this,e,t);return e===g0.SVG?san(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function san(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function aan(e,t){return(await Hhe(this,g0.Canvas,e,t)).canvas()}async function lan(e){return(await Hhe(this,g0.SVG,e)).svg()}function can(e,t,n){return sYe(e,aE,CR,n).parse(t)}function uan(e){var t=this._runtime.scales;return Yt(t,e)||et("Unrecognized scale or projection: "+e),t[e].value}var hYe="width",pYe="height",Ghe="padding",ITe={skip:!0};function gYe(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===Ghe?r.left+r.right:0)}function mYe(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===Ghe?r.top+r.bottom:0)}function fan(e){var t=e._signals,n=t[hYe],r=t[pYe],i=t[Ghe];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=gYe(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=mYe(e,a.size),o()},{size:r});const s=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,s.rank=i.rank+1}function dan(e,t,n,r,i,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(hYe,n,ITe),s._resizeWidth.skip(!0)),s.height()!==r&&(a=1,s.signal(pYe,r,ITe),s._resizeHeight.skip(!0)),s._viewWidth!==e&&(s._resize=1,s._viewWidth=e),s._viewHeight!==t&&(s._resize=1,s._viewHeight=t),(s._origin[0]!==i[0]||s._origin[1]!==i[1])&&(s._resize=1,s._origin=i),a&&s.run("enter"),o&&s.runAfter(l=>l.resize())},!1,1)}function han(e){return this._runtime.getState(e||{data:pan,signals:gan,recurse:!0})}function pan(e,t){return t.modified&<(t.input.value)&&!e.startsWith("_:vega:_")}function gan(e,t){return!(e==="parent"||t instanceof aE.proxy)}function man(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function van(e,t){function n(r){e({timestamp:Date.now(),elapsed:r})}this._timers.push(Ben(n,t))}function yan(e,t,n,r){const i=e.element();i&&i.setAttribute("title",ban(r))}function ban(e){return e==null?"":lt(e)?vYe(e):Ht(e)&&!D0(e)?xan(e):e+""}function xan(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(lt(n)?vYe(n):yYe(n))}).join(` -`)}function vYe(e){return"["+e.map(yYe).join(", ")+"]"}function yYe(e){return lt(e)?"[…]":Ht(e)&&!D0(e)?"{…}":e}function wan(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e?.();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function bYe(e,t){const n=this;if(t=t||{},pO.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=nr({},e.locale,t.locale);n.locale(fHe(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||g0.Canvas,n._scenegraph=new h7e;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||yan,n._redraw=!0,n._handler=new lL().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=zsn(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=can(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:nr({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=gYe(n,n._width),n._viewHeight=mYe(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,fan(n),Psn(n),ksn(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function PN(e,t){return Yt(e._signals,t)?e._signals[t]:et("Unrecognized signal name: "+Tt(t))}function xYe(e,t){const n=(e._targets||[]).filter(r=>r._update&&r._update.handler===t);return n.length?n[0]:null}function DTe(e,t,n,r){let i=xYe(n,r);return i||(i=Whe(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function LTe(e,t,n){const r=xYe(t,n);return r&&t._targets.remove(r),e}Rt(bYe,pO,{async evaluate(e,t,n){if(await pO.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,Isn(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&zz(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&lYe(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=PN(this,e);return arguments.length===1?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",RTe(e)):RTe(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(VV(e)||et("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(pO.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(PN(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:dan,addEventListener(e,t,n){let r=t;return n&&n.trap===!1||(r=Whe(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,e===o&&(t===i||t===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return DTe(this,e,PN(this,e),t)},removeSignalListener(e,t){return LTe(this,PN(this,e),t)},addDataListener(e,t){return DTe(this,e,VB(this,e).values,t)},removeDataListener(e,t){return LTe(this,VB(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=Gre(this,null);this._globalCursor=!!e,t&&Gre(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:van,events:Bsn,finalize:Vsn,hover:Usn,data:Msn,change:n8,insert:Asn,remove:Rsn,scale:uan,initialize:ran,toImageURL:oan,toCanvas:aan,toSVG:lan,getState:han,setState:man,_watchPixelRatio:wan});const San="view",HB="[",GB="]",wYe="{",SYe="}",_an=":",_Ye=",",Can="@",Oan=">",Ean=/[[\]{}]/,Tan={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let CYe,OYe;function Lb(e,t,n){return CYe=t||San,OYe=n||Tan,EYe(e.trim()).map(qre)}function Pan(e){return OYe[e]}function aA(e,t,n,r,i){const o=e.length;let s=0,a;for(;t' after between selector: "+e;r=r.map(qre);const i=qre(e.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function Man(e){const t={source:CYe},n=[];let r=[0,0],i=0,o=0,s=e.length,a=0,l,c;if(e[s-1]===SYe){if(a=e.lastIndexOf(wYe),a>=0){try{r=Aan(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===Can&&(i=++a),l=aA(e,a,_an),l1?(t.type=n[1],i?t.markname=n[0].slice(1):Pan(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),c!=null&&(t.filter=c),r[0]&&(t.throttle=r[0]),r[1]&&(t.debounce=r[1]),t}function Aan(e){const t=e.split(_Ye);if(!e.length||t.length>2)throw e;return t.map(n=>{const r=+n;if(r!==r)throw e;return r})}function Ran(e){return Ht(e)?e:{type:e||"pad"}}const n2=e=>+e||0,Ian=e=>({top:e,bottom:e,left:e,right:e});function Dan(e){return Ht(e)?e.signal?e:{top:n2(e.top),bottom:n2(e.bottom),left:n2(e.left),right:n2(e.right)}:Ian(n2(e))}const na=e=>Ht(e)&&!lt(e)?nr({},e):{value:e};function FTe(e,t,n,r){return n!=null?(Ht(n)&&!lt(n)||lt(n)&&n.length&&Ht(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function Na(e,t,n){for(const r in t)FTe(e,r,t[r]);for(const r in n)FTe(e,r,n[r],"update")}function iP(e,t,n){for(const r in t)n&&Yt(n,r)||(e[r]=nr(e[r]||{},t[r]));return e}function PC(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const qhe="mark",Xhe="frame",Yhe="scope",Lan="axis",Fan="axis-domain",$an="axis-grid",Nan="axis-label",zan="axis-tick",jan="axis-title",Ban="legend",Uan="legend-band",Van="legend-entry",Wan="legend-gradient",TYe="legend-label",Han="legend-symbol",Gan="legend-title",qan="title",Xan="title-text",Yan="title-subtitle";function Qan(e,t,n,r,i){const o={},s={};let a,l,c,u;l="lineBreak",t==="text"&&i[l]!=null&&!PC(l,e)&&oX(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),u=n===Xhe?i.group:n===qhe?nr({},i.mark,i[t]):null;for(l in u)c=PC(l,e)||(l==="fill"||l==="stroke")&&(PC("fill",e)||PC("stroke",e)),c||oX(o,l,u[l]);Vt(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)PC(h,e)||oX(o,h,d[h])}),e=nr({},e);for(l in o)u=o[l],u.signal?(a=a||{})[l]=u:s[l]=u;return e.enter=nr(s,e.enter),a&&(e.update=nr(a,e.update)),e}function oX(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const PYe=e=>Kt(e)?Tt(e):e.signal?`(${e.signal})`:kYe(e);function i8(e){if(e.gradient!=null)return Zan(e);let t=e.signal?`(${e.signal})`:e.color?Kan(e.color):e.field!=null?kYe(e.field):e.value!==void 0?Tt(e.value):void 0;return e.scale!=null&&(t=Jan(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${r5(e.exponent)})`),e.mult!=null&&(t+=`*${r5(e.mult)}`),e.offset!=null&&(t+=`+${r5(e.offset)}`),e.round&&(t=`round(${t})`),t}const kN=(e,t,n,r)=>`(${e}(${[t,n,r].map(i8).join(",")})+'')`;function Kan(e){return e.c?kN("hcl",e.h,e.c,e.l):e.h||e.s?kN("hsl",e.h,e.s,e.l):e.l||e.a?kN("lab",e.l,e.a,e.b):e.r||e.g||e.b?kN("rgb",e.r,e.g,e.b):null}function Zan(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:Tt(n));for(;t.length&&Mr(t)==null;)t.pop();return t.unshift(PYe(e.gradient)),`gradient(${t.join(",")})`}function r5(e){return Ht(e)?"("+i8(e)+")":e}function kYe(e){return MYe(Ht(e)?e:{datum:e})}function MYe(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):et("Invalid field reference: "+Tt(e));return e.signal||(r=Kt(r)?bg(r).map(Tt).join("]["):MYe(r)),t+"["+r+"]"}function Jan(e,t){const n=PYe(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+r5(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function eln(e){let t="";return e.forEach(n=>{const r=i8(n);t+=n.test?`(${n.test})?${r}:`:r}),Mr(t)===":"&&(t+="null"),t}function AYe(e,t,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},e=Qan(e,t,n,r,i.config);for(const a in e)s[a]=tln(e[a],t,o,i);return o}function tln(e,t,n,r){const i={},o={};for(const s in e)e[s]!=null&&(i[s]=rln(nln(e[s]),r,n,o));return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function nln(e){return lt(e)?eln(e):i8(e)}function rln(e,t,n,r){const i=sg(e,t);return i.$fields.forEach(o=>r[o]=1),nr(n,i.$params),i.$expr}const iln="outer",oln=["value","update","init","react","bind"];function $Te(e,t){et(e+' for "outer" push: '+Tt(t))}function RYe(e,t){const n=e.name;if(e.push===iln)t.signals[n]||$Te("No prior signal definition",n),oln.forEach(r=>{e[r]!==void 0&&$Te("Invalid property ",r)});else{const r=t.addSignal(n,e.value);e.react===!1&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function Xre(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function o8(e,t,n,r){return new Xre(e,t,n,r)}function qB(e,t){return o8("operator",e,t)}function wn(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function OR(e,t){return t?{$field:e,$name:t}:{$field:e}}const Yre=OR("key");function NTe(e,t){return{$compare:e,$order:t}}function sln(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const aln="ascending",lln="descending";function cln(e){return Ht(e)?(e.order===lln?"-":"+")+s8(e.op,e.field):""}function s8(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const Qhe="scope",Qre="view";function $s(e){return e&&e.signal}function uln(e){return e&&e.expr}function i5(e){if($s(e))return!0;if(Ht(e)){for(const t in e)if(i5(e[t]))return!0}return!1}function Bd(e,t){return e??t}function U1(e){return e&&e.signal||e}const zTe="timer";function ER(e,t){return(e.merge?dln:e.stream?hln:e.type?pln:et("Invalid stream specification: "+Tt(e)))(e,t)}function fln(e){return e===Qhe?Qre:e||Qre}function dln(e,t){const n=e.merge.map(i=>ER(i,t)),r=Khe({merge:n},e,t);return t.addStream(r).id}function hln(e,t){const n=ER(e.stream,t),r=Khe({stream:n},e,t);return t.addStream(r).id}function pln(e,t){let n;e.type===zTe?(n=t.event(zTe,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(fln(e.source),e.type);const r=Khe({stream:n},e,t);return Object.keys(r).length===1?n:t.addStream(r).id}function Khe(e,t,n){let r=t.between;return r&&(r.length!==2&&et('Stream "between" parameter must have 2 entries: '+Tt(t)),e.between=[ER(r[0],n),ER(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(gln(t.marktype,t.markname,t.markrole)),t.source===Qhe&&r.push("inScope(event.item)"),r.length&&(e.filter=sg("("+r.join(")&&(")+")",n).$expr),(r=t.throttle)!=null&&(e.throttle=+r),(r=t.debounce)!=null&&(e.debounce=+r),t.consume&&(e.consume=!0),e}function gln(e,t,n){const r="event.item";return r+(e&&e!=="*"?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}const mln={code:"_.$value",ast:{type:"Identifier",value:"value"}};function vln(e,t,n){const r=e.encode,i={target:n};let o=e.events,s=e.update,a=[];o||et("Signal update missing events specification."),Kt(o)&&(o=Lb(o,t.isSubscope()?Qhe:Qre)),o=Vt(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[bln(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&et("Signal encode and update are mutually exclusive."),s="encode(item(),"+Tt(r)+")"),i.update=Kt(s)?sg(s,t):s.expr!=null?sg(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:mln,$params:{$value:t.signalRef(s.signal)}}:et("Invalid signal update specification."),e.force&&(i.options={force:!0}),a.forEach(l=>t.addUpdate(nr(yln(l,t),i)))}function yln(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):ER(e,t)}}function bln(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function xln(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?et("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=sg(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(i=>vln(i,t,n.id))}const Di=e=>(t,n,r)=>o8(e,n,t||void 0,r),IYe=Di("aggregate"),wln=Di("axisticks"),DYe=Di("bound"),Rh=Di("collect"),jTe=Di("compare"),Sln=Di("datajoin"),LYe=Di("encode"),_ln=Di("expression"),Cln=Di("facet"),Oln=Di("field"),Eln=Di("key"),Tln=Di("legendentries"),Pln=Di("load"),kln=Di("mark"),Mln=Di("multiextent"),Aln=Di("multivalues"),Rln=Di("overlap"),Iln=Di("params"),FYe=Di("prefacet"),Dln=Di("projection"),Lln=Di("proxy"),Fln=Di("relay"),$Ye=Di("render"),$ln=Di("scale"),CS=Di("sieve"),Nln=Di("sortitems"),NYe=Di("viewlayout"),zln=Di("values");let jln=0;const zYe={min:"min",max:"max",count:"sum"};function Bln(e,t){const n=e.type||"linear";E9e(n)||et("Unrecognized scale type: "+Tt(n)),t.addScale(e.name,{type:n,domain:void 0})}function Uln(e,t){const n=t.getScale(e.name).params;let r;n.domain=jYe(e.domain,e,t),e.range!=null&&(n.range=UYe(e,t,n)),e.interpolate!=null&&Zln(e.interpolate,n),e.nice!=null&&(n.nice=Kln(e.nice,t)),e.bins!=null&&(n.bins=Qln(e.bins,t));for(r in e)Yt(n,r)||r==="name"||(n[r]=Pf(e[r],t))}function Pf(e,t){return Ht(e)?e.signal?t.signalRef(e.signal):et("Unsupported object: "+Tt(e)):e}function o5(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Pf(n,t))}function a8(e){et("Can not find data set: "+Tt(e))}function jYe(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&et("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(lt(e)?Vln:e.fields?Hln:Wln)(e,t,n)}function Vln(e,t,n){return e.map(r=>Pf(r,n))}function Wln(e,t,n){const r=n.getData(e.data);return r||a8(e.data),dE(t.type)?r.valuesRef(n,e.field,BYe(e.sort,!1)):k9e(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function Hln(e,t,n){const r=e.data,i=e.fields.reduce((o,s)=>(s=Kt(s)?{data:r,field:s}:lt(s)||s.signal?Gln(s,n):s,o.push(s),o),[]);return(dE(t.type)?qln:k9e(t.type)?Xln:Yln)(e,n,i)}function Gln(e,t){const n="_:vega:_"+jln++,r=Rh({});if(lt(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+Tt(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,CS({})]),{data:n,field:"data"}}function qln(e,t,n){const r=BYe(e.sort,!0);let i,o;const s=n.map(c=>{const u=t.getData(c.data);return u||a8(c.data),u.countsRef(t,c.field,r)}),a={groupby:Yre,pulse:s};r&&(i=r.op||"count",o=r.field?s8(i,r.field):"count",a.ops=[zYe[i]],a.fields=[t.fieldRef(o)],a.as=[o]),i=t.add(IYe(a));const l=t.add(Rh({pulse:wn(i)}));return o=t.add(zln({field:Yre,sort:t.sortRef(r),pulse:wn(l)})),wn(o)}function BYe(e,t){return e&&(!e.field&&!e.op?Ht(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?et("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!zYe[e.op]&&et("Multiple domain scales can not be sorted using "+e.op)),e}function Xln(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||a8(i.data),o.domainRef(t,i.field)});return wn(t.add(Aln({values:r})))}function Yln(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||a8(i.data),o.extentRef(t,i.field)});return wn(t.add(Mln({extents:r})))}function Qln(e,t){return e.signal||lt(e)?o5(e,t):t.objectProperty(e)}function Kln(e,t){return e.signal?t.signalRef(e.signal):Ht(e)?{interval:Pf(e.interval),step:Pf(e.step)}:Pf(e)}function Zln(e,t){t.interpolate=Pf(e.type||e),e.gamma!=null&&(t.interpolateGamma=Pf(e.gamma))}function UYe(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(Kt(i)){if(r&&Yt(r,i))return e=nr({},e,{range:r[i]}),UYe(e,t,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=dE(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:et("Unrecognized scale range value: "+Tt(i))}else if(i.scheme){n.scheme=lt(i.scheme)?o5(i.scheme,t):Pf(i.scheme,t),i.extent&&(n.schemeExtent=o5(i.extent,t)),i.count&&(n.schemeCount=Pf(i.count,t));return}else if(i.step){n.rangeStep=Pf(i.step,t);return}else{if(dE(e.type)&&!lt(i))return jYe(i,e,t);lt(i)||et("Unsupported range type: "+Tt(i))}return i.map(o=>(lt(o)?o5:Pf)(o,t))}function Jln(e,t){const n=t.config.projection||{},r={};for(const i in e)i!=="name"&&(r[i]=Kre(e[i],i,t));for(const i in n)r[i]==null&&(r[i]=Kre(n[i],i,t));t.addProjection(e.name,r)}function Kre(e,t,n){return lt(e)?e.map(r=>Kre(r,t,n)):Ht(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:et("Unsupported parameter object: "+Tt(e)):e}const Ih="top",oP="left",sP="right",sb="bottom",VYe="center",ecn="vertical",tcn="start",ncn="middle",rcn="end",Zre="index",Zhe="label",icn="offset",wE="perc",ocn="perc2",$f="value",vL="guide-label",Jhe="guide-title",scn="group-title",acn="group-subtitle",BTe="symbol",s5="gradient",Jre="discrete",eie="size",lcn="shape",ccn="fill",ucn="stroke",fcn="strokeWidth",dcn="strokeDash",hcn="opacity",epe=[eie,lcn,ccn,ucn,fcn,dcn,hcn],yL={name:1,style:1,interactive:1},$r={value:0},Nf={value:1},l8="group",WYe="rect",tpe="rule",pcn="symbol",OS="text";function TR(e){return e.type=l8,e.interactive=e.interactive||!1,e}function qc(e,t){const n=(r,i)=>Bd(e[r],Bd(t[r],i));return n.isVertical=r=>ecn===Bd(e.direction,t.direction||(r?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>Bd(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>Bd(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>Bd(e.columns,Bd(t.columns,+n.isVertical(!0))),n}function HYe(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function gcn(e,t,n){const r=t.config.style[n];return r&&r[e]}function c8(e,t,n){return`item.anchor === '${tcn}' ? ${e} : item.anchor === '${rcn}' ? ${t} : ${n}`}const npe=c8(Tt(oP),Tt(sP),Tt(VYe));function mcn(e){const t=e("tickBand");let n=e("tickOffset"),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},Ht(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e("bandPosition"),i=e("tickExtra")),{extra:i,band:r,offset:n}}function GYe(e,t){return t?e?Ht(e)?Object.assign({},e,{offset:GYe(e.offset,t)}):{value:e,offset:t}:t:e}function Vu(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=iP(e.encode,t,yL)):e.interactive=!1,e}function vcn(e,t,n,r){const i=qc(e,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,c,u,f,d;o?(c=[0,1],u=[0,0],f=s,d=a):(c=[0,0],u=[1,0],f=a,d=s);const h={enter:l={opacity:$r,x:$r,y:$r,width:na(f),height:na(d)},update:nr({},l,{opacity:Nf,fill:{gradient:t,start:c,stop:u}}),exit:{opacity:$r}};return Na(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),Vu({type:WYe,role:Wan,encode:h},r)}function ycn(e,t,n,r,i){const o=qc(e,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let c,u,f,d,h="";s?(c="y",f="y2",u="x",d="width",h="1-"):(c="x",f="x2",u="y",d="height");const p={opacity:$r,fill:{scale:t,field:$f}};p[c]={signal:h+"datum."+wE,mult:l},p[u]=$r,p[f]={signal:h+"datum."+ocn,mult:l},p[d]=na(a);const g={enter:p,update:nr({},p,{opacity:Nf}),exit:{opacity:$r}};return Na(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Vu({type:WYe,role:Uan,key:$f,from:i,encode:g},r)}const bcn=`datum.${wE}<=0?"${oP}":datum.${wE}>=1?"${sP}":"${VYe}"`,xcn=`datum.${wE}<=0?"${sb}":datum.${wE}>=1?"${Ih}":"${ncn}"`;function UTe(e,t,n,r){const i=qc(e,t),o=i.isVertical(),s=na(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),c,u,f,d,h="";const p={enter:c={opacity:$r},update:u={opacity:Nf,text:{field:Zhe}},exit:{opacity:$r}};return Na(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:Bd(e.labelLimit,t.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=u.baseline={signal:xcn},f="y",d="x",h="1-"):(c.align=u.align={signal:bcn},c.baseline={value:"top"},f="x",d="y"),c[f]=u[f]={signal:h+"datum."+wE,mult:a},c[d]=u[d]=s,s.offset=Bd(e.labelOffset,t.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+Zre}:void 0,Vu({type:OS,role:TYe,style:vL,key:$f,from:r,encode:p,overlap:l},n)}function wcn(e,t,n,r,i){const o=qc(e,t),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${icn} : datum.${eie}`,h=c?na(c):{field:eie},p=`datum.${Zre}`,g=`max(1, ${i})`;let m,v,y,b,w;h.mult=.5,m={enter:v={opacity:$r,x:{signal:d,mult:.5,offset:u},y:h},update:y={opacity:Nf,x:v.x,y:v.y},exit:{opacity:$r}};let S=null,_=null;e.fill||(S=t.symbolBaseFillColor,_=t.symbolBaseStrokeColor),Na(m,{fill:o("symbolFillColor",S),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),epe.forEach(P=>{e[P]&&(y[P]=v[P]={scale:e[P],field:$f})});const E=Vu({type:pcn,role:Han,key:$f,from:f,clip:c?!0:void 0,encode:m},n.symbols),T=na(u);T.offset=o("labelOffset"),m={enter:v={opacity:$r,x:{signal:d,offset:T},y:h},update:y={opacity:Nf,text:{field:Zhe},x:v.x,y:v.y},exit:{opacity:$r}},Na(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=Vu({type:OS,role:TYe,style:vL,key:$f,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!c},width:$r,height:c?na(c):$r,opacity:$r},exit:{opacity:$r},update:y={opacity:Nf,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,y.row.signal=`${p}%${b}`,y.column.signal=`floor(${p} / ${b})`,w={field:["row",p]}):(y.row.signal=`floor(${p} / ${g})`,y.column.signal=`${p} % ${g}`,w={field:p}),y.column.signal=`(${i})?${y.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:Zre}},TR({role:Yhe,from:r,encode:iP(m,s,yL),marks:[E,k],name:l,interactive:a,sort:w})}function Scn(e,t){const n=qc(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const rpe='item.orient === "left"',ipe='item.orient === "right"',u8=`(${rpe} || ${ipe})`,_cn=`datum.vgrad && ${u8}`,Ccn=c8('"top"','"bottom"','"middle"'),Ocn=c8('"right"','"left"','"center"'),Ecn=`datum.vgrad && ${ipe} ? (${Ocn}) : (${u8} && !(datum.vgrad && ${rpe})) ? "left" : ${npe}`,Tcn=`item._anchor || (${u8} ? "middle" : "start")`,Pcn=`${_cn} ? (${rpe} ? -90 : 90) : 0`,kcn=`${u8} ? (datum.vgrad ? (${ipe} ? "bottom" : "top") : ${Ccn}) : "top"`;function Mcn(e,t,n,r){const i=qc(e,t),o={enter:{opacity:$r},update:{opacity:Nf,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:$r}};return Na(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:Tcn},angle:{signal:Pcn},align:{signal:Ecn},baseline:{signal:kcn},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),Vu({type:OS,role:Gan,style:Jhe,from:r,encode:o},n)}function Acn(e,t){let n;return Ht(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+VTe(e.path)+")":e.sphere&&(n="geoShape("+VTe(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function VTe(e){return Ht(e)&&e.signal?e.signal:Tt(e)}function qYe(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===l8?Yhe:t||qhe}function Rcn(e){return{marktype:e.type,name:e.name||void 0,role:e.role||qYe(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Icn(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function ope(e,t){const n=CHe(e.type);n||et("Unrecognized transform type: "+Tt(e.type));const r=o8(n.type.toLowerCase(),null,XYe(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function XYe(e,t,n){const r={},i=e.params.length;for(let o=0;oWTe(e,o,n)):WTe(e,i,n)}function WTe(e,t,n){const r=e.type;if($s(t))return GTe(r)?et("Expression references can not be signals."):sX(r)?n.fieldRef(t):qTe(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||sX(r);return i&&$cn(t)?n.exprRef(t.expr,t.as):i&&Ncn(t)?OR(t.field,t.as):GTe(r)?sg(t,n):zcn(r)?wn(n.getData(t).values):sX(r)?OR(t):qTe(r)?n.compareRef(t):t}}function Lcn(e,t,n){return Kt(t.from)||et('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Fcn(e,t,n){const r=t[e.name];return e.array?(lt(r)||et("Expected an array of sub-parameters. Instead: "+Tt(r)),r.map(i=>HTe(e,i,n))):HTe(e,r,n)}function HTe(e,t,n){const r=e.params.length;let i;for(let s=0;se&&e.expr,Ncn=e=>e&&e.field,zcn=e=>e==="data",GTe=e=>e==="expr",sX=e=>e==="field",qTe=e=>e==="compare";function jcn(e,t,n){let r,i,o,s,a;return e?(r=e.facet)&&(t||et("Only group marks can be faceted."),r.field!=null?s=a=a5(r,n):(e.data?a=wn(n.getData(e.data).aggregate):(o=ope(nr({type:"aggregate",groupby:Vt(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=a5(r,n),s=a=wn(n.add(o))),i=n.keyRef(r.groupby,!0))):s=wn(n.add(Rh(null,[{}]))),s||(s=a5(e,n)),{key:i,pulse:s,parent:a}}function a5(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:wn(t.getData(e.data).output)}function Ow(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}Ow.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",u=sg(c,t);l.update=u.$expr,l.params=u.$params}function f8(e,t){const n=qYe(e),r=e.type===l8,i=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===Yhe||n===Xhe,a,l,c,u,f,d,h;const p=n===qhe||s||i,g=jcn(e.from,r,t);l=t.add(Sln({key:g.key||(e.key?OR(e.key):void 0),pulse:g.pulse,clean:!r}));const m=wn(l);l=c=t.add(Rh({pulse:m})),l=t.add(kln({markdef:Rcn(e),interactive:Icn(e.interactive,t),clip:Acn(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:wn(l)}));const v=wn(l);l=u=t.add(LYe(AYe(e.encode,e.type,n,e.style,t,{mod:!1,pulse:v}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach(_=>{const E=ope(_,t),T=E.metadata;(T.generates||T.changes)&&et("Mark transforms should not generate new data."),T.nomod||(u.params.mod=!0),E.params.pulse=wn(l),t.add(l=E)}),e.sort&&(l=t.add(Nln({sort:t.compareRef(e.sort),pulse:wn(l)})));const y=wn(l);(i||s)&&(s=t.add(NYe({layout:t.objectProperty(e.layout),legends:t.legends,mark:v,pulse:y})),d=wn(s));const b=t.add(DYe({mark:v,pulse:d||y}));h=wn(b),r&&(p&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(y,d||h,m),i?Bcn(e,t,g):p?Ucn(e,t,g):t.parse(e),t.popState(),p&&(s&&a.push(s),a.push(b))),o&&(h=Vcn(o,h,t));const w=t.add($Ye({pulse:h})),S=t.add(CS({pulse:wn(w)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new Ow(t,c,w,S)),e.on&&e.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&et("Marks only support modify triggers."),QYe(_,t,f)}))}function Vcn(e,t,n){const r=e.method,i=e.bound,o=e.separation,s={separation:$s(o)?n.signalRef(o.signal):o,method:$s(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),i){const a=i.tolerance;s.boundTolerance=$s(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return wn(n.add(Rln(s)))}function Wcn(e,t){const n=t.config.legend,r=e.encode||{},i=qc(e,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,c={};let u=0,f,d,h;epe.forEach(b=>e[b]?(c[b]=e[b],u=u||e[b]):0),u||et("Missing valid scale for legend.");const p=Hcn(e,t.scaleType(u)),g={title:e.title!=null,scales:c,type:p,vgrad:p!=="symbol"&&i.isVertical()},m=wn(t.add(Rh(null,[g]))),v={enter:{x:{value:0},y:{value:0}}},y=wn(t.add(Tln(d={type:p,scale:t.scaleRef(u),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===s5?(h=[vcn(e,u,n,r.gradient),UTe(e,n,r.labels,y)],d.count=d.count||t.signalRef(`max(2,2*floor((${U1(i.gradientLength())})/100))`)):p===Jre?h=[ycn(e,u,n,r.gradient,y),UTe(e,n,r.labels,y)]:(f=Scn(e,n),h=[wcn(e,n,r,y,U1(f.columns))],d.size=Xcn(e,t,h[0].marks)),h=[TR({role:Van,from:m,encode:v,marks:h,layout:f,interactive:a})],g.title&&h.push(Mcn(e,n,r.title,m)),f8(TR({role:Ban,from:m,encode:iP(qcn(i,e,n),o,yL),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),t)}function Hcn(e,t){let n=e.type||BTe;return!e.type&&Gcn(e)===1&&(e.fill||e.stroke)&&(n=ode(t)?s5:Hne(t)?Jre:BTe),n!==s5?n:Hne(t)?Jre:s5}function Gcn(e){return epe.reduce((t,n)=>t+(e[n]?1:0),0)}function qcn(e,t,n){const r={enter:{},update:{}};return Na(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function Xcn(e,t,n){const r=U1(YTe("size",e,n)),i=U1(YTe("strokeWidth",e,n)),o=U1(Ycn(n[1].encode,t,vL));return sg(`max(ceil(sqrt(${r})+${i}),${o})`,t)}function YTe(e,t,n){return t[e]?`scale("${t[e]}",datum)`:HYe(e,n[0].encode)}function Ycn(e,t,n){return HYe("fontSize",e)||gcn("fontSize",t,n)}const Qcn=`item.orient==="${oP}"?-90:item.orient==="${sP}"?90:0`;function Kcn(e,t){e=Kt(e)?{text:e}:e;const n=qc(e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],c={},u=wn(t.add(Rh(null,[c])));return l.push(eun(e,n,Zcn(e),u)),e.subtitle&&l.push(tun(e,n,r.subtitle,u)),f8(TR({role:qan,from:u,encode:Jcn(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function Zcn(e){const t=e.encode;return t&&t.title||nr({name:e.name,interactive:e.interactive,style:e.style},t)}function Jcn(e,t){const n={enter:{},update:{}};return Na(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:npe},angle:{signal:Qcn},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),iP(n,t,yL)}function eun(e,t,n,r){const i={value:0},o=e.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Na(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Vu({type:OS,role:Xan,style:scn,from:r,encode:s},n)}function tun(e,t,n,r){const i={value:0},o=e.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Na(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Vu({type:OS,role:Yan,style:acn,from:r,encode:s},n)}function nun(e,t){const n=[];e.transform&&e.transform.forEach(r=>{n.push(ope(r,t))}),e.on&&e.on.forEach(r=>{QYe(r,t,e.name)}),t.addDataPipeline(e.name,run(e,t,n))}function run(e,t,n){const r=[];let i=null,o=!1,s=!1,a,l,c,u,f;for(e.values?$s(e.values)||i5(e.format)?(r.push(QTe(t,e)),r.push(i=mx())):r.push(i=mx({$ingest:e.values,$format:e.format})):e.url?i5(e.url)||i5(e.format)?(r.push(QTe(t,e)),r.push(i=mx())):r.push(i=mx({$request:e.url,$format:e.format})):e.source&&(i=a=Vt(e.source).map(d=>wn(t.getData(d).output)),r.push(null)),l=0,c=n.length;le===sb||e===Ih,d8=(e,t,n)=>$s(e)?aun(e.signal,t,n):e===oP||e===Ih?t:n,ra=(e,t,n)=>$s(e)?oun(e.signal,t,n):KYe(e)?t:n,ch=(e,t,n)=>$s(e)?sun(e.signal,t,n):KYe(e)?n:t,ZYe=(e,t,n)=>$s(e)?lun(e.signal,t,n):e===Ih?{value:t}:{value:n},iun=(e,t,n)=>$s(e)?cun(e.signal,t,n):e===sP?{value:t}:{value:n},oun=(e,t,n)=>JYe(`${e} === '${Ih}' || ${e} === '${sb}'`,t,n),sun=(e,t,n)=>JYe(`${e} !== '${Ih}' && ${e} !== '${sb}'`,t,n),aun=(e,t,n)=>spe(`${e} === '${oP}' || ${e} === '${Ih}'`,t,n),lun=(e,t,n)=>spe(`${e} === '${Ih}'`,t,n),cun=(e,t,n)=>spe(`${e} === '${sP}'`,t,n),JYe=(e,t,n)=>(t=t!=null?na(t):t,n=n!=null?na(n):n,KTe(t)&&KTe(n)?(t=t?t.signal||Tt(t.value):null,n=n?n.signal||Tt(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[nr({test:e},t)].concat(n||[])),KTe=e=>e==null||Object.keys(e).length===1,spe=(e,t,n)=>({signal:`${e} ? (${YC(t)}) : (${YC(n)})`}),uun=(e,t,n,r,i)=>({signal:(r!=null?`${e} === '${oP}' ? (${YC(r)}) : `:"")+(n!=null?`${e} === '${sb}' ? (${YC(n)}) : `:"")+(i!=null?`${e} === '${sP}' ? (${YC(i)}) : `:"")+(t!=null?`${e} === '${Ih}' ? (${YC(t)}) : `:"")+"(null)"}),YC=e=>$s(e)?e.signal:e==null?null:Tt(e),fun=(e,t)=>t===0?0:$s(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},yO=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function $_(e,t,n,r){let i;if(t&&Yt(t,e))return t[e];if(Yt(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[Jhe][i]}else if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[vL][i]}return null}function ZTe(e){const t={};for(const n of e)if(n)for(const r in n)t[r]=1;return Object.keys(t)}function dun(e,t){var n=t.config,r=n.style,i=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,l,c;if($s(s)){const f=ZTe([n.axisX,n.axisY]),d=ZTe([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(c of f)a[c]=ra(s,$_(c,n.axisX,i,r),$_(c,n.axisY,i,r));l={};for(c of d)l[c]=uun(s.signal,$_(c,n.axisTop,i,r),$_(c,n.axisBottom,i,r),$_(c,n.axisLeft,i,r),$_(c,n.axisRight,i,r))}else a=s===Ih||s===sb?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?nr({},i,a,l,o):i}function hun(e,t,n,r){const i=qc(e,t),o=e.orient;let s,a;const l={enter:s={opacity:$r},update:a={opacity:Nf},exit:{opacity:$r}};Na(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const c=JTe(e,0),u=JTe(e,1);return s.x=a.x=ra(o,c,$r),s.x2=a.x2=ra(o,u),s.y=a.y=ch(o,c,$r),s.y2=a.y2=ch(o,u),Vu({type:tpe,role:Fan,from:r,encode:l},n)}function JTe(e,t){return{scale:e.scale,range:t}}function pun(e,t,n,r,i){const o=qc(e,t),s=e.orient,a=e.gridScale,l=d8(s,1,-1),c=gun(e.offset,l);let u,f,d;const h={enter:u={opacity:$r},update:d={opacity:Nf},exit:f={opacity:$r}};Na(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:$f,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=ra(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:c}:{value:0,offset:c},v=a?{scale:a,range:1,mult:l,offset:c}:nr(g,{mult:l,offset:c});return u.x=d.x=ra(s,p,m),u.y=d.y=ch(s,p,m),u.x2=d.x2=ch(s,v),u.y2=d.y2=ra(s,v),f.x=ra(s,p),f.y=ch(s,p),Vu({type:tpe,role:$an,key:$f,from:r,encode:h},n)}function gun(e,t){if(t!==1)if(!Ht(e))e=$s(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=nr({},e);for(;n.mult!=null;)if(Ht(n.mult))n=n.mult=nr({},n.mult);else return n.mult=$s(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function mun(e,t,n,r,i,o){const s=qc(e,t),a=e.orient,l=d8(a,-1,1);let c,u,f;const d={enter:c={opacity:$r},update:f={opacity:Nf},exit:u={opacity:$r}};Na(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=na(i);h.mult=l;const p={scale:e.scale,field:$f,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=c.y=ra(a,$r,p),f.y2=c.y2=ra(a,h),u.x=ra(a,p),f.x=c.x=ch(a,$r,p),f.x2=c.x2=ch(a,h),u.y=ch(a,p),Vu({type:tpe,role:zan,key:$f,from:r,encode:d},n)}function aX(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function vun(e,t,n,r,i,o){const s=qc(e,t),a=e.orient,l=e.scale,c=d8(a,-1,1),u=U1(s("labelFlush")),f=U1(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=u===0||!!u,g;const m=na(i);m.mult=c,m.offset=na(s("labelPadding")||0),m.offset.mult=c;const v={scale:l,field:$f,band:.5,offset:GYe(o.offset,s("labelOffset"))},y=ra(a,p?aX(l,u,'"left"','"right"','"center"'):{value:"center"},iun(a,"left","right")),b=ra(a,ZYe(a,"bottom","top"),p?aX(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),w=aX(l,u,`-(${f})`,f,0);p=p&&f;const S={opacity:$r,x:ra(a,v,m),y:ch(a,v,m)},_={enter:S,update:g={opacity:Nf,text:{field:Zhe},x:S.x,y:S.y,align:y,baseline:b},exit:{opacity:$r,x:S.x,y:S.y}};Na(_,{dx:!d&&p?ra(a,w):null,dy:!h&&p?ch(a,w):null}),Na(_,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const E=s("labelBound");let T=s("labelOverlap");return T=T||E?{separation:s("labelSeparation"),method:T,order:"datum.index",bound:E?{scale:l,orient:a,tolerance:E}:null}:void 0,g.align!==y&&(g.align=yO(g.align,y)),g.baseline!==b&&(g.baseline=yO(g.baseline,b)),Vu({type:OS,role:Nan,style:vL,key:$f,from:r,encode:_,overlap:T},n)}function yun(e,t,n,r){const i=qc(e,t),o=e.orient,s=d8(o,-1,1);let a,l;const c={enter:a={opacity:$r,anchor:na(i("titleAnchor",null)),align:{signal:npe}},update:l=nr({},a,{opacity:Nf,text:na(e.title)}),exit:{opacity:$r}},u={signal:`lerp(range("${e.scale}"), ${c8(0,1,.5)})`};return l.x=ra(o,u),l.y=ch(o,u),a.angle=ra(o,$r,fun(s,90)),a.baseline=ra(o,ZYe(o,sb,Ih),{value:sb}),l.angle=a.angle,l.baseline=a.baseline,Na(c,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),bun(i,o,c,n),c.update.align=yO(c.update.align,a.align),c.update.angle=yO(c.update.angle,a.angle),c.update.baseline=yO(c.update.baseline,a.baseline),Vu({type:OS,role:jan,style:Jhe,from:r,encode:c},n)}function bun(e,t,n,r){const i=(a,l)=>a!=null?(n.update[l]=yO(na(a),n.update[l]),!1):!PC(l,r),o=i(e("titleX"),"x"),s=i(e("titleY"),"y");n.enter.auto=s===o?na(s):ra(t,na(s),na(o))}function xun(e,t){const n=dun(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=qc(e,n),c=mcn(l),u={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:e.title!=null},f=wn(t.add(Rh({},[u]))),d=wn(t.add(wln({scale:t.scaleRef(e.scale),extra:t.property(c.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return u.grid&&h.push(pun(e,n,r.grid,d,c)),u.ticks&&(p=l("tickSize"),h.push(mun(e,n,r.ticks,d,p,c))),u.labels&&(p=u.ticks?p:0,h.push(vun(e,n,r.labels,d,p,c))),u.domain&&h.push(hun(e,n,r.domain,f)),u.title&&h.push(yun(e,n,r.title,f)),f8(TR({role:Lan,from:f,encode:iP(wun(l,e),i,yL),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),t)}function wun(e,t){const n={enter:{},update:{}};return Na(n,{orient:e("orient"),offset:e("offset")||0,position:Bd(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function eQe(e,t,n){const r=Vt(e.signals),i=Vt(e.scales);return n||r.forEach(o=>RYe(o,t)),Vt(e.projections).forEach(o=>Jln(o,t)),i.forEach(o=>Bln(o,t)),Vt(e.data).forEach(o=>nun(o,t)),i.forEach(o=>Uln(o,t)),(n||r).forEach(o=>xln(o,t)),Vt(e.axes).forEach(o=>xun(o,t)),Vt(e.marks).forEach(o=>f8(o,t)),Vt(e.legends).forEach(o=>Wcn(o,t)),e.title&&Kcn(e.title,t),t.parseLambdas(),t}const Sun=e=>iP({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function _un(e,t){const n=t.config,r=wn(t.root=t.add(qB())),i=Cun(e,n);i.forEach(c=>RYe(c,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Rh()),s=t.add(LYe(AYe(Sun(e.encode),l8,Xhe,e.style,t,{pulse:wn(o)}))),a=t.add(NYe({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:wn(s)}));t.operators.pop(),t.pushState(wn(s),wn(a),null),eQe(e,t,i),t.operators.push(a);let l=t.add(DYe({mark:r,pulse:wn(a)}));return l=t.add($Ye({pulse:wn(l)})),l=t.add(CS({pulse:wn(l)})),t.addData("root",new Ow(t,o,o,l)),t}function i2(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Cun(e,t){const n=s=>Bd(e[s],t[s]),r=[i2("background",n("background")),i2("autosize",Ran(n("autosize"))),i2("padding",Dan(n("padding"))),i2("width",n("width")||0),i2("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return Vt(e.signals).forEach(s=>{Yt(i,s.name)?s=nr(i[s.name],s):r.push(s),o[s.name]=s}),Vt(t.signals).forEach(s=>{!Yt(o,s.name)&&!Yt(i,s.name)&&r.push(s)}),r}function tQe(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function ePe(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}tQe.prototype=ePe.prototype={parse(e){return eQe(e,this)},fork(){return new ePe(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof Xre?wn(e):e;return this.add(Lln({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(wn(this.add(CS({pulse:e})))),this._parent.push(t),this._lookup.push(n?wn(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Mr(this._parent)},encode(){return Mr(this._encode)},lookup(){return Mr(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Kt(e))return OR(e,t);e.signal||et("Unsupported field reference: "+Tt(e));const n=e.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};t&&(i.as=t),this.field[n]=r=wn(this.add(Oln(i)))}return r},compareRef(e){let t=!1;const n=o=>$s(o)?(t=!0,this.signalRef(o.signal)):uln(o)?(t=!0,this.exprRef(o.expr)):o,r=Vt(e.field).map(n),i=Vt(e.order).map(n);return t?wn(this.add(jTe({fields:r,orders:i}))):NTe(r,i)},keyRef(e,t){let n=!1;const r=o=>$s(o)?(n=!0,wn(i[o.signal])):o,i=this.signals;return e=Vt(e).map(r),n?wn(this.add(Eln({fields:e,flat:t}))):sln(e,t)},sortRef(e){if(!e)return e;const t=s8(e.op,e.field),n=e.order||aln;return n.signal?wn(this.add(jTe({fields:t,orders:this.signalRef(n.signal)}))):NTe(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return Yt(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&et("Duplicate signal name: "+Tt(e));const n=t instanceof Xre?t:this.add(qB(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||et("Unrecognized signal name: "+Tt(e)),this.signals[e]},signalRef(e){return this.signals[e]?wn(this.signals[e]):(Yt(this.lambdas,e)||(this.lambdas[e]=this.add(qB(null))),wn(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(Ht(i)?i.signal||ape(i):Tt(i))}return n+"]"}function Eun(e){let t="{",n=0,r,i;for(r in e)i=e[r],t+=(++n>1?",":"")+Tt(r)+":"+(Ht(i)?i.signal||ape(i):Tt(i));return t+"}"}function Tun(){const e="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:e,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:e,fontSize:10},"guide-title":{fill:i,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function Pun(e,t,n){return Ht(e)||et("Input Vega specification must be an object."),t=XU(Tun(),t,e.config),_un(e,new tQe(t,n)).toRuntime()}var kun="6.2.0";nr(aE,p7t,XKt,EZt,fen,otn,Rnn,fnn,Dnn,irn,prn,wrn);const Mun=kun,Aun=Object.freeze(Object.defineProperty({__proto__:null,Bounds:xs,CanvasHandler:lL,CanvasRenderer:aB,DATE:jc,DAY:ll,DAYOFYEAR:ig,Dataflow:pO,Debug:q8e,DisallowedObjectProperties:W8e,Error:lue,EventStream:lV,Gradient:W9e,GroupItem:LV,HOURS:ju,Handler:Mde,HybridHandler:D7e,HybridRenderer:nre,Info:G8e,Item:DV,MILLISECONDS:yh,MINUTES:Bu,MONTH:pl,Marks:Uu,MultiPulse:Due,None:H8e,Operator:Bi,Parameters:aV,Pulse:F0,QUARTER:zc,RenderType:g0,Renderer:aL,ResourceLoader:Q9e,SECONDS:Zf,SVGHandler:w7e,SVGRenderer:Fde,SVGStringRenderer:I7e,Scenegraph:h7e,TIME_UNITS:Cue,Transform:Ze,View:bYe,WEEK:Ds,Warn:cue,YEAR:$a,accessor:Gc,accessorFields:hl,accessorName:Bo,array:Vt,ascending:zD,bandwidthNRD:Nue,bin:THe,bootstrapCI:PHe,boundClip:W7e,boundContext:rL,boundItem:Kne,boundMark:c7e,boundStroke:Rv,changeset:wS,clampRange:iWe,codegenExpression:GXe,compare:pue,constant:yl,cumulativeLogNormal:Wue,cumulativeNormal:uV,cumulativeUniform:Xue,dayofyear:DWe,debounce:gue,defaultLocale:kue,definition:CHe,densityLogNormal:Vue,densityNormal:zue,densityUniform:que,domChild:As,domClear:vf,domCreate:h0,domFind:kde,dotbin:kHe,error:et,expressionFunction:os,extend:nr,extent:tg,extentIndex:oWe,falsy:Ly,fastmap:qT,field:Qf,flush:sWe,font:jV,fontFamily:sL,fontSize:wg,format:Nz,formatLocale:$j,formats:Rue,hasOwnProperty:Yt,id:ND,identity:vl,inferType:hHe,inferTypes:pHe,ingest:li,inherits:Rt,inrange:VC,interpolate:sde,interpolateColors:RV,interpolateRange:M9e,intersect:j7e,intersectBoxLine:HC,intersectPath:pde,intersectPoint:gde,intersectRule:Z9e,isArray:lt,isBoolean:vS,isDate:D0,isFunction:ir,isIterable:aWe,isNumber:Qr,isObject:Ht,isRegExp:mue,isString:Kt,isTuple:oV,key:vue,lerp:lWe,lineHeight:rb,loader:rV,locale:fHe,logger:uue,lruCache:cWe,markup:Lde,merge:uWe,mergeConfig:XU,multiLineOffset:Ede,one:HT,pad:fWe,panLinear:Z8e,panLog:J8e,panPow:eWe,panSymlog:tWe,parse:Pun,parseExpression:Lhe,parseSelector:Lb,path:gV,pathCurves:fde,pathEqual:H7e,pathParse:hE,pathRectangle:q9e,pathRender:hR,pathSymbols:G9e,pathTrail:X9e,peek:Mr,point:UV,projection:the,quantileLogNormal:Hue,quantileNormal:fV,quantileUniform:Yue,quantiles:Fue,quantizeInterpolator:A9e,quarter:nWe,quartiles:$ue,get random(){return Jf},randomInteger:y9t,randomKDE:Bue,randomLCG:v9t,randomLogNormal:AHe,randomMixture:RHe,randomNormal:jue,randomUniform:IHe,read:vHe,regressionConstant:Que,regressionExp:LHe,regressionLinear:Kue,regressionLoess:NHe,regressionLog:DHe,regressionPoly:$He,regressionPow:FHe,regressionQuad:Zue,renderModule:VV,repeat:rM,resetDefaultLocale:gGt,resetSVGDefIds:dKt,responseType:mHe,runtimeContext:sYe,sampleCurve:hV,sampleLogNormal:Uue,sampleNormal:cV,sampleUniform:Gue,scale:Zr,sceneEqual:$de,sceneFromJSON:f7e,scenePickVisit:Jj,sceneToJSON:u7e,sceneVisit:bh,sceneZOrder:mde,scheme:ade,serializeXML:k7e,setHybridRendererOptions:lKt,setRandom:g9t,span:jD,splitAccessPath:bg,stringValue:Tt,textMetrics:Au,timeBin:KWe,timeFloor:BWe,timeFormatLocale:oR,timeInterval:KT,timeOffset:WWe,timeSequence:qWe,timeUnitSpecifier:IWe,timeUnits:Oue,toBoolean:yue,toDate:bue,toNumber:ul,toSet:vh,toString:xue,transform:OHe,transforms:aE,truncate:dWe,truthy:Kf,tupleid:Sn,typeParsers:Ine,utcFloor:UWe,utcInterval:ZT,utcOffset:HWe,utcSequence:XWe,utcdayofyear:$We,utcquarter:rWe,utcweek:NWe,version:Mun,visitArray:Yy,week:LWe,writeConfig:GT,zero:o0,zoomLinear:fue,zoomLog:due,zoomPow:Mj,zoomSymlog:hue},Symbol.toStringTag,{value:"Module"}));var Run="6.4.1",Iun={version:Run};function lpe(e){return _t(e,"or")}function cpe(e){return _t(e,"and")}function upe(e){return _t(e,"not")}function l5(e,t){if(upe(e))l5(e.not,t);else if(cpe(e))for(const n of e.and)l5(n,t);else if(lpe(e))for(const n of e.or)l5(n,t);else t(e)}function bO(e,t){return upe(e)?{not:bO(e.not,t)}:cpe(e)?{and:e.and.map(n=>bO(n,t))}:lpe(e)?{or:e.or.map(n=>bO(n,t))}:t(e)}const Un=structuredClone;function nQe(e){throw new Error(e)}function SE(e,t){const n={};for(const r of t)Yt(e,r)&&(n[r]=e[r]);return n}function Iu(e,t){const n={...e};for(const r of t)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>yi(e)).join(",")})`};function Or(e){if(Qr(e))return e;const t=Kt(e)?e:yi(e);if(t.length<250)return t;let n=0;for(let r=0;ra===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function hpe(e,t){return e===void 0||t===void 0?!0:dpe(nie(e),nie(t))}function Vi(e){return wt(e).length===0}const wt=Object.keys,vs=Object.values,ab=Object.entries;function PR(e){return e===!0||e===!1}function xo(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function lA(e,t){return upe(e)?`!(${lA(e.not,t)})`:cpe(e)?`(${e.and.map(n=>lA(n,t)).join(") && (")})`:lpe(e)?`(${e.or.map(n=>lA(n,t)).join(") || (")})`:t(e)}function XB(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&XB(e[n],t)&&delete e[n],Vi(e)}function bL(e){return e.charAt(0).toUpperCase()+e.substr(1)}function ppe(e,t="datum"){const n=bg(e),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(Tt).join("][")}]`;r.push(`${t}${o}`)}return r.join(" && ")}function oQe(e,t="datum"){return`${t}[${Tt(bg(e).join("."))}]`}function Oi(e){return`datum['${e.replaceAll("'","\\'")}']`}function sQe(e){return e.replaceAll("\\'","'").replaceAll("\\.",".")}function Fun(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function td(e){return`${bg(e).map(Fun).join("\\.")}`}function Ew(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function aP(e){return`${bg(e).join(".")}`}function CE(e){return e?bg(e).length:0}function es(...e){return e.find(t=>t!==void 0)}let aQe=42;function lQe(e){const t=++aQe;return e?String(e)+t:t}function $un(){aQe=42}function cQe(e){return uQe(e)?e:`__${e}`}function uQe(e){return e.startsWith("__")}function kR(e){if(e!==void 0)return(e%360+360)%360}function h8(e){return Qr(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const tPe=Object.getPrototypeOf(structuredClone({}));function Ou(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Ou(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;for(const o of e.entries())if(!Ou(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==tPe.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==tPe.toString)return e.toString()===t.toString();const i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!Ou(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function yi(e){const t=[];return(function n(r){if(r?.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?`${r}`:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;iw8(e[t])?xo(`_${t}_${ab(e[t])}`):xo(`_${t}_${e[t]}`)).join("")}`}function Ji(e){return e===!0||PS(e)&&!e.binned}function wa(e){return e==="binned"||PS(e)&&e.binned===!0}function PS(e){return Ht(e)}function w8(e){return _t(e,"param")}function nPe(e){switch(e){case Ym:case Qm:case Fv:case Uc:case Eg:case Tg:case jb:case $v:case Nb:case zb:case Vc:return 6;case Bb:return 4;default:return 10}}function _L(e){return _t(e,"expr")}function _a(e,{level:t}={level:0}){const n=wt(e||{}),r={};for(const i of n)r[i]=t===0?wu(e[i]):_a(e[i],{level:t-1});return r}function CQe(e){const{anchor:t,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},v={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},y={...l?{subtitleColor:l}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},b=SE(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:b,nonMarkTitleProperties:v,subtitle:y}}function Jy(e){return Kt(e)||lt(e)&&Kt(e[0])}function hn(e){return _t(e,"signal")}function kS(e){return _t(e,"step")}function lfn(e){return lt(e)?!1:_t(e,"fields")&&!_t(e,"data")}function cfn(e){return lt(e)?!1:_t(e,"fields")&&_t(e,"data")}function Nm(e){return lt(e)?!1:_t(e,"field")&&_t(e,"data")}const ufn={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},ffn=wt(ufn),dfn={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},rie=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],hfn=" – ";function OQe(e){const t=lt(e.condition)?e.condition.map(rPe):rPe(e.condition);return{...wu(e),condition:t}}function wu(e){if(_L(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function rPe(e){if(_L(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function lo(e){if(_L(e)){const{expr:t,...n}=e;return{signal:t,...n}}return hn(e)?e:e!==void 0?{value:e}:void 0}function pfn(e){return hn(e)?e.signal:Tt(e)}function iPe(e){return hn(e)?e.signal:Tt(e.value)}function nh(e){return hn(e)?e.signal:e==null?null:Tt(e)}function gfn(e,t,n){for(const r of n){const i=ag(r,t.markDef,t.config);i!==void 0&&(e[r]=lo(i))}return e}function EQe(e){return[].concat(e.type,e.style??[])}function vi(e,t,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&_t(t,i)?t[i]:t[e]!==void 0?t[e]:o&&(!i||i===e)?void 0:ag(e,t,n,r)}function ag(e,t,n,{vgChannel:r}={}){const i=iie(e,t,n.style);return es(r?i:void 0,i,r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function iie(e,t,n){return TQe(e,EQe(t),n)}function TQe(e,t,n){t=Vt(t);let r;for(const i of t){const o=n[i];_t(o,e)&&(r=o[e])}return r}function PQe(e,t){return Vt(e).reduce((n,r)=>(n.field.push(It(r,t)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function kQe(e,t){const n=[...e];return t.forEach(r=>{for(const i of n)if(Ou(i,r))return;n.push(r)}),n}function MQe(e,t){return Ou(e,t)||!t?e:e?[...Vt(e),...Vt(t)].join(", "):t}function AQe(e,t){const n=e.value,r=t.value;if(n==null||r===null)return{explicit:e.explicit,value:null};if((Jy(n)||hn(n))&&(Jy(r)||hn(r)))return{explicit:e.explicit,value:MQe(n,r)};if(Jy(n)||hn(n))return{explicit:e.explicit,value:n};if(Jy(r)||hn(r))return{explicit:e.explicit,value:r};if(!Jy(n)&&!hn(n)&&!Jy(r)&&!hn(r))return{explicit:e.explicit,value:kQe(n,r)};throw new Error("It should never reach here")}function Cpe(e){return`Invalid specification ${yi(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const mfn='Autosize "fit" only works for single views and layered views.';function oPe(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function sPe(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function aPe(e){return e?`Dropping "fit-${e}" because spec has discrete ${Wc(e)}.`:'Dropping "fit" because spec has discrete size.'}function Ope(e){return`Unknown field for ${e}. Cannot calculate view size.`}function lPe(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function vfn(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function yfn(e){return`The "nearest" transform is not supported for ${e} marks.`}function RQe(e){return`Selection not supported for ${e} yet.`}function bfn(e){return`Cannot find a selection named "${e}".`}const xfn="Scale bindings are currently only supported for scales with unbinned, continuous domains.",wfn="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Sfn="Legend bindings are only supported for selections over an individual field or encoding channel.";function _fn(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Cfn(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Ofn="The same selection must be used to override scale domains in a layered view.",Efn='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Tfn(e){return`Unknown repeated value "${e}".`}function cPe(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Pfn="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",Epe="Animation involving facet, layer, or concat is currently unsupported.";function kfn(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Tt(e)}.`}function Mfn(e,t,n,r){return`${e.length?"Multiple ":"No "}matching ${Tt(t)} encoding found for selection ${Tt(n.param)}. Using "field": ${Tt(r)}.`}const Afn="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Rfn(e){return`Unrecognized parse "${e}".`}function uPe(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Ifn="Attempt to add the same child twice.";function Dfn(e){return`Ignoring an invalid transform: ${yi(e)}.`}const Lfn='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function fPe(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Ffn(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${yi(t)} is overridden by a child projection ${yi(n)}.`}const $fn="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Nfn(e){return`${e}Offset dropped because ${e} is continuous`}function zfn(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${yi(n)}}.`}function IQe(e){return`Invalid field type "${e}".`}function jfn(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Bfn(e){return`Invalid aggregation operator "${e}".`}function DQe(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function Ufn(e){return`Position range does not support relative band size for ${e}.`}function oie(e,t){return`Dropping ${yi(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Vfn="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function S8(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Wfn(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Hfn(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Gfn(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function qfn(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function uX(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Xfn(e){return`The ${e} for range marks cannot be an expression`}function Yfn(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Qfn(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Kfn(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Zfn(e){return`Cannot use the relative band size with ${e} scale.`}function Jfn(e){return`Using unaggregated domain with raw field has no effect (${yi(e)}).`}function edn(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function tdn(e){return`Unaggregated domain is currently unsupported for log scale (${yi(e)}).`}function ndn(e){return`Cannot apply size to non-oriented mark "${e}".`}function rdn(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function idn(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function LQe(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function FQe(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function odn(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${yi(n)} and ${yi(r)}). Using ${yi(n)}.`}function sdn(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${yi(n)} and ${yi(r)}). Using the union of the two domains.`}function adn(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function ldn(e){return`Dropping sort property ${yi(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const dPe="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",cdn="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",udn="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",fdn="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function ddn(e){return`Cannot stack "${e}" if there is already "${e}2".`}function hdn(e){return`Stack is applied to a non-linear scale (${e}).`}function pdn(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function YB(e,t){return`Invalid ${e}: ${yi(t)}.`}function gdn(e){return`Dropping day from datetime ${yi(e)} as day cannot be combined with other units.`}function mdn(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function vdn(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function ydn(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function hPe(e){return`1D error band does not support ${e}.`}function $Qe(e){return`Channel ${e} is required for "binned" bin.`}function bdn(e){return`Channel ${e} should not be used with "binned" bin.`}function xdn(e){return`Domain for ${e} is required for threshold scale.`}const NQe=uue(cue);let Pw=NQe;function wdn(e){return Pw=e,Pw}function Sdn(){return Pw=NQe,Pw}function Tpe(...e){Pw.error(...e)}function Et(...e){Pw.warn(...e)}function _dn(...e){Pw.debug(...e)}function MS(e){if(e&&Ht(e)){for(const t of kpe)if(_t(e,t))return!0}return!1}const zQe=["january","february","march","april","may","june","july","august","september","october","november","december"],Cdn=zQe.map(e=>e.substr(0,3)),jQe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Odn=jQe.map(e=>e.substr(0,3));function Edn(e){if(h8(e)&&(e=+e),Qr(e))return e>4&&Et(YB("quarter",e)),e-1;throw new Error(YB("quarter",e))}function Tdn(e){if(h8(e)&&(e=+e),Qr(e))return e-1;{const t=e.toLowerCase(),n=zQe.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Cdn.indexOf(r);if(i!==-1)return i;throw new Error(YB("month",e))}}function Pdn(e){if(h8(e)&&(e=+e),Qr(e))return e%7;{const t=e.toLowerCase(),n=jQe.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Odn.indexOf(r);if(i!==-1)return i;throw new Error(YB("day",e))}}function Ppe(e,t){const n=[];if(t&&e.day!==void 0&&wt(e).length>1&&(Et(gdn(e)),e=Un(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const r=t?Tdn(e.month):e.month;n.push(r)}else if(e.quarter!==void 0){const r=t?Edn(e.quarter):e.quarter;n.push(Qr(r)?r*3:`${r}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const r=t?Pdn(e.day):e.day;n.push(Qr(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=e[r];n.push(typeof i>"u"?0:i)}return n}function kw(e){const n=Ppe(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function kdn(e){const n=Ppe(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Mdn(e){const t=Ppe(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const BQe={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},kpe=wt(BQe);function Adn(e){return Yt(BQe,e)}function AS(e){return Ht(e)?e.binned:UQe(e)}function UQe(e){return e?.startsWith("binned")}function Mpe(e){return e.startsWith("utc")}function Rdn(e){return e.substring(3)}const Idn={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function _8(e){return kpe.filter(t=>WQe(e,t))}function VQe(e){const t=_8(e);return t[t.length-1]}function WQe(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Ddn(e,t,{end:n}={end:!1}){const r=ppe(t),i=Mpe(e)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of kpe)WQe(e,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),kdn(a)}function HQe(e){if(!e)return;const t=_8(e);return`timeUnitSpecifier(${yi(t)}, ${yi(Idn)})`}function Ldn(e,t,n){if(!e)return;const r=HQe(e);return`${n||Mpe(e)?"utc":"time"}Format(${t}, ${r})`}function sa(e){if(!e)return;let t;return Kt(e)?UQe(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Ht(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Mpe(t.unit)&&(t.utc=!0,t.unit=Rdn(t.unit)),t}function Fdn(e){const{utc:t,...n}=sa(e);return n.unit?(t?"utc":"")+wt(n).map(r=>xo(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):`${t?"utc":""}timeunit${wt(n).map(r=>xo(`_${r}_${n[r]}`)).join("")}`}function GQe(e,t=n=>n){const n=sa(e),r=VQe(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=qQe(r,n.step),a={...i,[s]:+i[s]+o};return`${t(kw(a))} - ${t(kw(i))}`}}const $dn={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Ndn(e){return Yt($dn,e)}function qQe(e,t=1){if(Ndn(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function zdn(e){return _t(e,"param")}function Ape(e){return!!e?.field&&e.equal!==void 0}function Rpe(e){return!!e?.field&&e.lt!==void 0}function Ipe(e){return!!e?.field&&e.lte!==void 0}function Dpe(e){return!!e?.field&&e.gt!==void 0}function Lpe(e){return!!e?.field&&e.gte!==void 0}function Fpe(e){if(e?.field){if(lt(e.range)&&e.range.length===2)return!0;if(hn(e.range))return!0}return!1}function $pe(e){return!!e?.field&&(lt(e.oneOf)||lt(e.in))}function jdn(e){return!!e?.field&&e.valid!==void 0}function XQe(e){return $pe(e)||Ape(e)||Fpe(e)||Rpe(e)||Dpe(e)||Ipe(e)||Lpe(e)}function Jh(e,t){return I8(e,{timeUnit:t,wrapTime:!0})}function Bdn(e,t){return e.map(n=>Jh(n,t))}function YQe(e,t=!0){const{field:n}=e,r=sa(e.timeUnit),{unit:i,binned:o}=r||{},s=It(e,{expr:"datum"}),a=i?`time(${o?s:Ddn(i,n)})`:s;if(Ape(e))return`${a}===${Jh(e.equal,i)}`;if(Rpe(e)){const l=e.lt;return`${a}<${Jh(l,i)}`}else if(Dpe(e)){const l=e.gt;return`${a}>${Jh(l,i)}`}else if(Ipe(e)){const l=e.lte;return`${a}<=${Jh(l,i)}`}else if(Lpe(e)){const l=e.gte;return`${a}>=${Jh(l,i)}`}else{if($pe(e))return`indexof([${Bdn(e.oneOf,i).join(",")}], ${a}) !== -1`;if(jdn(e))return C8(a,e.valid);if(Fpe(e)){const{range:l}=_a(e),c=hn(l)?{signal:`${l.signal}[0]`}:l[0],u=hn(l)?{signal:`${l.signal}[1]`}:l[1];if(c!==null&&u!==null&&t)return`inrange(${a}, [${Jh(c,i)}, ${Jh(u,i)}])`;const f=[];return c!==null&&f.push(`${a} >= ${Jh(c,i)}`),u!==null&&f.push(`${a} <= ${Jh(u,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${yi(e)}`)}function C8(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Udn(e){return XQe(e)&&e.timeUnit?{...e,timeUnit:sa(e.timeUnit)}:e}const CL={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Vdn(e){return e==="quantitative"||e==="temporal"}function Npe(e){return e==="ordinal"||e==="nominal"}const Mw=CL.quantitative,zpe=CL.ordinal,EE=CL.temporal,jpe=CL.nominal,cP=CL.geojson;function Wdn(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Mw:return"quantitative";case"t":case EE:return"temporal";case"o":case zpe:return"ordinal";case"n":case jpe:return"nominal";case cP:return"geojson"}}const Oa={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},sie={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function Hdn(e,t){const n=sie[e],r=sie[t];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const Gdn={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function pPe(e){return Gdn[e]}const QQe=new Set(["linear","log","pow","sqrt","symlog"]),KQe=new Set([...QQe,"time","utc"]);function ZQe(e){return QQe.has(e)}const JQe=new Set(["quantile","quantize","threshold"]),qdn=new Set([...KQe,...JQe,"sequential","identity"]),Xdn=new Set(["ordinal","bin-ordinal","point","band"]);function la(e){return Xdn.has(e)}function xh(e){return qdn.has(e)}function Tp(e){return KQe.has(e)}function TE(e){return JQe.has(e)}const Ydn={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function Qdn(e){return!Kt(e)&&_t(e,"name")}function eKe(e){return _t(e,"param")}function Kdn(e){return _t(e,"unionWith")}function Zdn(e){return Ht(e)&&"field"in e}const Jdn={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:ohr,domain:shr,range:ahr,rangeMax:lhr,rangeMin:chr,scheme:uhr,...ehn}=Jdn,thn=wt(ehn);function aie(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return Tp(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Tp(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return Tp(e);case"nice":return Tp(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return xh(e)&&!vr(["log","time","utc","threshold","quantile"],e)}}function tKe(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return xO(e)?void 0:Kfn(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function nhn(e,t){return vr([zpe,jpe],t)?e===void 0||la(e):t===EE?vr([Oa.TIME,Oa.UTC,void 0],e):t===Mw?ZQe(e)||TE(e)||e===void 0:!0}function rhn(e,t,n=!1){if(!kg(e))return!1;switch(e){case _o:case ha:case Fb:case lP:case hd:case Lh:return Tp(t)||t==="band"?!0:t==="point"?!n:!1;case $b:return vr(["linear","band"],t);case Fv:case jb:case $v:case Nb:case zb:case ES:return Tp(t)||TE(t)||vr(["band","point","ordinal"],t);case Uc:case Eg:case Tg:return t!=="band";case Bb:case Vc:return t==="ordinal"||TE(t)}}function ihn(e){return Ht(e)&&"value"in e}const oc={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},nKe=oc.arc,O8=oc.area,E8=oc.bar,ohn=oc.image,T8=oc.line,P8=oc.point,shn=oc.rect,QB=oc.rule,rKe=oc.text,Bpe=oc.tick,ahn=oc.trail,Upe=oc.circle,Vpe=oc.square,iKe=oc.geoshape;function Vb(e){return["line","area","trail"].includes(e)}function MR(e){return["rect","bar","image","arc","tick"].includes(e)}const lhn=new Set(wt(oc));function lg(e){return _t(e,"type")}const chn=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],uhn=["fill","fillOpacity"],fhn=[...chn,...uhn],dhn={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},gPe=wt(dhn),fX=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],hhn={area:["line","point"],bar:fX,rect:fX,line:["point"],tick:["bandSize","thickness",...fX]},phn={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},ghn={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},oKe=wt(ghn);function Aw(e){return _t(e,"band")}const mhn={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},vhn=5,Wpe={binSpacing:0,continuousBandSize:vhn,minBandSize:.25,timeUnitBandPosition:.5},yhn={...Wpe,binSpacing:1},bhn={...Wpe,thickness:1};function xhn(e){return lg(e)?e.type:e}function sKe(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Hpe({markDef:e,config:t,scaleChannel:n,scaleType:r,isCountAggregate:i}){if(!r||!xh(r)||i)return"always-valid";const o=sKe(vi("invalid",e,t),{isPath:Vb(e.type)});return t.scale?.invalid?.[n]!==void 0?"show":o}function whn(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function aKe({scaleName:e,scale:t,mode:n}){const r=`domain('${e}')`;if(!t||!e)return;const i=`${r}[0]`,o=`peek(${r})`,s=t.domainHasZero();return s==="definitely"?{scale:e,value:0}:s==="maybe"?{signal:`scale('${e}', inrange(0, ${r}) ? 0 : ${n==="zeroOrMin"?i:o})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?i:o})`}}function lKe({scaleChannel:e,channelDef:t,scale:n,scaleName:r,markDef:i,config:o}){const s=n?.get("type"),a=Sh(t),l=x8(a?.aggregate),c=Hpe({scaleChannel:e,markDef:i,config:o,scaleType:s,isCountAggregate:l});if(a&&c==="show"){const u=o.scale.invalid?.[e]??"zero-or-min";return{test:C8(It(a,{expr:"datum"}),!1),...Shn(u,n,r)}}}function Shn(e,t,n){if(ihn(e)){const{value:r}=e;return hn(r)?{signal:r.signal}:{value:r}}return aKe({scale:t,scaleName:n,mode:"zeroOrMin"})}function Gpe(e){const{channel:t,channelDef:n,markDef:r,scale:i,scaleName:o,config:s}=e,a=TS(t),l=qpe(e),c=lKe({scaleChannel:a,channelDef:n,scale:i,scaleName:o,markDef:r,config:s});return c!==void 0?[c,l]:l}function _hn(e){const{datum:t}=e;return MS(t)?kw(t):`${yi(t)}`}function V1(e,t,n,r){const i={};if(t&&(i.scale=t),Mg(e)){const{datum:o}=e;MS(o)?i.signal=kw(o):hn(o)?i.signal=o.signal:_L(o)?i.signal=o.expr:i.value=o}else i.field=It(e,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function KB({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!hn(s)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return $hn(e);default:return Fhn(e,t)}};let wKe=xKe;function SKe(e){wKe=e}function Nhn(){SKe(xKe)}function wO(e,t,{allowDisabling:n,includeDefault:r=!0}){const i=Kpe(e)?.title;if(!Ot(e))return i??e.title;const o=e,s=r?Zpe(o,t):void 0;return n?es(i,o.title,s):i??o.title??s}function Kpe(e){if(kE(e)&&e.axis)return e.axis;if(yKe(e)&&e.legend)return e.legend;if(Ype(e)&&e.header)return e.header}function Zpe(e,t){return wKe(e,t)}function e4(e){if(bKe(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Kpe(e)??{},{format:n,formatType:r}=t;return{format:n,formatType:r}}}function zhn(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Qpe(e)&<(e.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=e;if(i)return"temporal";if(r||n&&!Ub(n)&&!mv(n))return"quantitative";if(RS(e)&&e.scale?.type)switch(sie[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Sh(e){if(Ot(e))return e;if(A8(e))return e.condition}function Ls(e){if(Hn(e))return e;if(PL(e))return e.condition}function _Ke(e,t,n,r={}){if(Kt(e)||Qr(e)||vS(e)){const i=Kt(e)?"string":Qr(e)?"number":"boolean";return Et(zfn(t,i,e)),{value:e}}return Hn(e)?t4(e,t,n,r):PL(e)?{...e,condition:t4(e.condition,t,n,r)}:e}function t4(e,t,n,r){if(bKe(e)){const{format:i,formatType:o,...s}=e;if(Rw(o)&&!n.customFormatTypes)return Et(fPe(t)),t4(s,t,n,r)}else{const i=kE(e)?"axis":yKe(e)?"legend":Ype(e)?"header":null;if(i&&e[i]){const{format:o,formatType:s,...a}=e[i];if(Rw(s)&&!n.customFormatTypes)return Et(fPe(t)),t4({...e,[i]:a},t,n,r)}}return Ot(e)?Jpe(e,t,r):jhn(e)}function jhn(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Qr(n)?"quantitative":Kt(n)?"nominal":MS(n)?"temporal":void 0,{...e,type:t}}function Jpe(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=e,a={...e};if(!n&&r&&!_pe(r)&&!Ub(r)&&!mv(r)&&(Et(Bfn(r)),delete a.aggregate),i&&(a.timeUnit=sa(i)),s&&(a.field=`${s}`),Ji(o)&&(a.bin=R8(o,t)),wa(o)&&!ts(t)&&Et(bdn(t)),Kl(a)){const{type:l}=a,c=Wdn(l);l!==c&&(a.type=c),l!=="quantitative"&&x8(r)&&(Et(jfn(l,r)),a.type="quantitative")}else if(!vQe(t)){const l=zhn(a,t);a.type=l}if(Kl(a)){const{compatible:l,warning:c}=Bhn(a,t)||{};l===!1&&Et(c)}if(Qpe(a)&&Kt(a.sort)){const{sort:l}=a;if(vPe(l))return{...a,sort:{encoding:l}};const c=l.substring(1);if(l.charAt(0)==="-"&&vPe(c))return{...a,sort:{encoding:c,order:"descending"}}}if(Ype(a)){const{header:l}=a;if(l){const{orient:c,...u}=l;if(c)return{...a,header:{...u,labelOrient:l.labelOrient||c,titleOrient:l.titleOrient||c}}}}return a}function R8(e,t){return vS(e)?{maxbins:nPe(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:nPe(t)}:e}const N_={compatible:!0};function Bhn(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Ym:case Qm:case p8:return JB(e)?N_:{compatible:!1,warning:Hfn(t)};case _o:case ha:case Fb:case lP:case Uc:case Eg:case Tg:case xL:case wL:case g8:case Tw:case m8:case v8:case ES:case hd:case Lh:case y8:return N_;case $h:case nd:case Fh:case Nh:return n!==Mw?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:N_;case $v:case Nb:case zb:case jb:case Fv:case Lv:case Dv:case Dh:case Og:case $b:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:N_;case Vc:case Bb:return!JB(e)&&!Dhn(e)?{compatible:!1,warning:Gfn(t)}:N_;case OE:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:N_}}function ME(e){const{formatType:t}=e4(e);return t==="time"||!t&&Uhn(e)}function Uhn(e){return e&&(e.type==="temporal"||Ot(e)&&!!e.timeUnit)}function I8(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){const o=t&&sa(t)?.unit;let s=o||n==="temporal",a;return _L(e)?a=e.expr:hn(e)?a=e.signal:MS(e)?(s=!0,a=kw(e)):(Kt(e)||Qr(e))&&s&&(a=`datetime(${yi(e)})`,Adn(o)&&(Qr(e)&&e<1e4||Kt(e)&&isNaN(Date.parse(e)))&&(a=kw({[o]:e}))),a?r&&s?`time(${a})`:a:i?void 0:yi(e)}function CKe(e,t){const{type:n}=e;return t.map(r=>{const i=Ot(e)&&!AS(e.timeUnit)?e.timeUnit:void 0,o=I8(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function kL(e,t){return Ji(e.bin)?kg(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const xPe={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function ML(e){return e?.condition}const OKe=["domain","grid","labels","ticks","title"],Vhn={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},EKe={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Whn={...EKe,style:1,labelExpr:1,encoding:1};function wPe(e){return Yt(Whn,e)}const Hhn={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},TKe=wt(Hhn);function zv(e){return _t(e,"mark")}class D8{name;run;constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return zv(t)?xhn(t.mark)===this.name:!1}}function W1(e,t){const n=e?.[t];return n?lt(n)?_E(n,r=>!!r.field):Ot(n)||A8(n):!1}function PKe(e,t){const n=e?.[t];return n?lt(n)?_E(n,r=>!!r.field):Ot(n)||Mg(n)||PL(n):!1}function kKe(e,t){if(ts(t)){const n=e[t];if((Ot(n)||Mg(n))&&(Npe(n.type)||Ot(n)&&n.timeUnit)){const r=ype(t);return PKe(e,r)}}return!1}function MKe(e){return _E(jun,t=>{if(W1(e,t)){const n=e[t];if(lt(n))return _E(n,r=>!!r.aggregate);{const r=Sh(n);return r&&!!r.aggregate}}return!1})}function AKe(e,t){const n=[],r=[],i=[],o=[],s={};return ege(e,(a,l)=>{if(Ot(a)){const{field:c,aggregate:u,bin:f,timeUnit:d,...h}=a;if(u||d||f){const g=Kpe(a)?.title;let m=It(a,{forAs:!0});const v={...g?[]:{title:wO(a,t,{allowDisabling:!0})},...h,field:m};if(u){let y;if(Ub(u)?(y="argmax",m=It({op:"argmax",field:u.argmax},{forAs:!0}),v.field=`${m}.${c}`):mv(u)?(y="argmin",m=It({op:"argmin",field:u.argmin},{forAs:!0}),v.field=`${m}.${c}`):u!=="boxplot"&&u!=="errorbar"&&u!=="errorband"&&(y=u),y){const b={op:y,as:m};c&&(b.field=c),o.push(b)}}else if(n.push(m),Kl(a)&&Ji(f)){if(r.push({bin:f,field:c,as:m}),n.push(It(a,{binSuffix:"end"})),kL(a,l)&&n.push(It(a,{binSuffix:"range"})),ts(l)){const y={field:`${m}_end`};s[`${l}2`]=y}v.bin="binned",vQe(l)||(v.type=Mw)}else if(d&&!AS(d)){i.push({timeUnit:d,field:c,as:m});const y=Kl(a)&&a.type!==EE&&"time";y&&(l===xL||l===Tw?v.formatType=y:Kun(l)?v.legend={formatType:y,...v.legend}:ts(l)&&(v.axis={formatType:y,...v.axis}))}s[l]=v}else n.push(c),s[l]=e[l]}else s[l]=e[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function Ghn(e,t,n){const r=Jun(t,n);if(r){if(r==="binned"){const i=e[t===Dh?_o:ha];return!!(Ot(i)&&Ot(e[t])&&wa(i.bin))}}else return!1;return!0}function qhn(e,t,n,r){const i={};for(const o of wt(e))mQe(o)||Et(Wfn(o));for(let o of Gun){if(!e[o])continue;const s=e[o];if(SL(o)){const a=Hun(o),l=i[a];if(Ot(l)&&Vdn(l.type)&&Ot(s)&&!l.timeUnit){Et(Nfn(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(Et($fn),o=hd),!Ghn(e,o,t)){Et(S8(o,t));continue}if(o===Fv&&t==="line"&&Sh(e[o])?.aggregate){Et(Vfn);continue}if(o===Uc&&(n?"fill"in e:"stroke"in e)){Et(DQe("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===wL||o===OE&&!lt(s)&&!wh(s)||o===Tw&<(s)){if(s){if(o===OE){const a=e[o];if(vKe(a)){i[o]=a;continue}}i[o]=Vt(s).reduce((a,l)=>(Ot(l)?a.push(Jpe(l,o)):Et(oie(l,o)),a),[])}}else{if(o===Tw&&s===null)i[o]=null;else if(!Ot(s)&&!Mg(s)&&!wh(s)&&!TL(s)&&!hn(s)){Et(oie(s,o));continue}i[o]=_Ke(s,o,r)}}return i}function L8(e,t){const n={};for(const r of wt(e)){const i=_Ke(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function Xhn(e){const t=[];for(const n of wt(e))if(W1(e,n)){const r=e[n],i=Vt(r);for(const o of i)Ot(o)?t.push(o):A8(o)&&t.push(o.condition)}return t}function ege(e,t,n){if(e)for(const r of wt(e)){const i=e[r];if(lt(i))for(const o of i)t.call(n,o,r);else t.call(n,i,r)}}function Yhn(e,t,n,r){return e?wt(e).reduce((i,o)=>{const s=e[o];return lt(s)?s.reduce((a,l)=>t.call(r,a,l,o),i):t.call(r,i,s,o)},n):n}function RKe(e,t){return wt(t).reduce((n,r)=>{switch(r){case _o:case ha:case m8:case y8:case v8:case Dh:case Og:case Fb:case lP:case hd:case Lv:case Lh:case Dv:case $b:case Fh:case $h:case Nh:case nd:case xL:case Vc:case ES:case Tw:return n;case OE:if(e==="line"||e==="trail")return n;case wL:case g8:{const i=t[r];if(lt(i)||Ot(i))for(const o of Vt(i))o.aggregate||n.push(It(o,{}));return n}case Fv:if(e==="trail")return n;case Uc:case Eg:case Tg:case $v:case Nb:case zb:case Bb:case jb:{const i=Sh(t[r]);return i&&!i.aggregate&&n.push(It(i,{})),n}}},[])}function Qhn(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(lt(t)){for(const o of t)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return lt(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function cie(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=e.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${tge(t)}`:"";return{field:s+t.field,type:t.type,title:hn(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=Xhn(n).map(Rhn);return{tooltip:[...i,...Ep(o,Or)]}}function tge(e){const{title:t,field:n}=e;return es(t,n)}function nge(e,t,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:c,endPositionPrefix:u=void 0,extraEncoding:f={}})=>{const d=tge(n);return IKe(e,a,i,{mark:l,encoding:{[t]:{field:`${c}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...Kt(u)?{[`${t}2`]:{field:`${u}_${n.field}`}}:{},...r,...f}})}}function IKe(e,t,n,r){const{clip:i,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...lg(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(t)}`,...vS(e[t])?{}:e[t]}}]:[]}function DKe(e,t,n){const{encoding:r}=e,i=t==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:MN(o,n),continuousAxisChannelDef2:MN(s,n),continuousAxisChannelDefError:MN(a,n),continuousAxisChannelDefError2:MN(l,n),continuousAxis:i}}function MN(e,t){if(e?.aggregate){const{aggregate:n,...r}=e;return n!==t&&Et(ydn(n,t)),r}else return e}function LKe(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(lg(n)&&n.orient)return n.orient;if(x0(i)){if(x0(o)){const s=Ot(i)&&i.aggregate,a=Ot(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return ME(o)&&!ME(i)?"horizontal":"vertical"}return"horizontal"}else{if(x0(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const n4="boxplot",Khn=["box","median","outliers","rule","ticks"],Zhn=new D8(n4,$Ke);function FKe(e){return Qr(e)?"tukey":e}function $Ke(e,{config:t}){e={...e,encoding:L8(e.encoding,t)};const{mark:n,encoding:r,params:i,projection:o,...s}=e,a=lg(n)?n:{type:n};i&&Et(RQe("boxplot"));const l=a.extent??t.boxplot.extent,c=vi("size",a,t),u=a.invalid,f=FKe(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:v,aggregate:y,encodingWithoutContinuousAxis:b,ticksOrient:w,boxOrient:S,customTooltipWithoutAggregatedField:_}=Jhn(e,l,t),E=aP(g.field),{color:T,size:k,...P}=b,R=J=>nge(a,m,g,J,t.boxplot),I=R(P),F=R(b),A=(Ht(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",L=R({...P,...k?{size:k}:{},color:{condition:{test:`${Oi(`lower_box_${g.field}`)} >= ${Oi(`upper_box_${g.field}`)}`,...T||{value:A}}}}),$=cie([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,b),j={type:"tick",color:"black",opacity:1,orient:w,invalid:u,aria:!1},V=f==="min-max"?$:cie([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,b),U=[...I({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:V}),...I({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:V}),...I({partName:"ticks",mark:j,positionPrefix:"lower_whisker",extraEncoding:V}),...I({partName:"ticks",mark:j,positionPrefix:"upper_whisker",extraEncoding:V})],z=[...f!=="tukey"?U:[],...F({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:S,invalid:u,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:$}),...L({partName:"median",mark:{type:"tick",invalid:u,...Ht(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...c?{size:c}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:$})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:z};const N=Oi(`lower_box_${g.field}`),B=Oi(`upper_box_${g.field}`),H=`(${B} - ${N})`,Q=`${N} - ${l} * ${H}`,Y=`${B} + ${l} * ${H}`,Z=Oi(g.field),pe={joinaggregate:NKe(g.field),groupby:v},ie={transform:[{filter:`(${Q} <= ${Z}) && (${Z} <= ${Y})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${E}`},{op:"max",field:g.field,as:`upper_whisker_${E}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${E}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${E}`},...y],groupby:v}],layer:U},{tooltip:ne,...fe}=P,{scale:me,axis:se}=g,ue=tge(g),G=IKe(a,"outliers",t.boxplot,{transform:[{filter:`(${Z} < ${Q}) || (${Z} > ${Y})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...ue!==void 0?{title:ue}:{},...me!==void 0?{scale:me}:{},...se!==void 0?{axis:se}:{}},...fe,...T?{color:T}:{},..._?{tooltip:_}:{}}})[0];let ce;const he=[...d,...h,pe];return G?ce={transform:he,layer:[G,ie]}:(ce=ie,ce.transform.unshift(...he)),{...s,layer:[ce,{transform:p,layer:z}]}}function NKe(e){const t=aP(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Jhn(e,t,n){const r=LKe(e,n4),{continuousAxisChannelDef:i,continuousAxis:o}=DKe(e,r,n4),s=i.field,a=aP(s),l=FKe(t),c=[...NKe(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(l==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(l==="min-max"?"upper_whisker_":"max_")+a}],u=l==="min-max"||l==="tukey"?[]:[{calculate:`${Oi(`upper_box_${a}`)} - ${Oi(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${Oi(`upper_box_${a}`)} + ${Oi(`iqr_${a}`)} * ${t}, ${Oi(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${Oi(`lower_box_${a}`)} - ${Oi(`iqr_${a}`)} * ${t}, ${Oi(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[o]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Qhn(d),{bins:g,timeUnits:m,aggregate:v,groupby:y,encoding:b}=AKe(p,n),w=r==="vertical"?"horizontal":"vertical",S=r,_=[...g,...m,{aggregate:[...v,...c],groupby:y},...u];return{bins:g,timeUnits:m,transform:_,groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:b,ticksOrient:w,boxOrient:S,customTooltipWithoutAggregatedField:h}}const rge="errorbar",epn=["ticks","rule"],tpn=new D8(rge,zKe);function zKe(e,{config:t}){e={...e,encoding:L8(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:c}=jKe(e,rge,t);delete o.size;const u=nge(a,i,r,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...u({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:c}),...u({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:c}),...u({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function npn(e,t){const{encoding:n}=e;if(rpn(n))return{orient:LKe(e,t),inputType:"raw"};const r=ipn(n),i=opn(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(Hn(a)&&Hn(l))throw new Error(`${t} cannot have both x2 and y2`);if(Hn(a)){if(x0(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Hn(l)){if(x0(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,c=n.yError,u=n.yError2;if(Hn(l)&&!Hn(a))throw new Error(`${t} cannot have xError2 without xError`);if(Hn(u)&&!Hn(c))throw new Error(`${t} cannot have yError2 without yError`);if(Hn(a)&&Hn(c))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Hn(a)){if(x0(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Hn(c)){if(x0(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function rpn(e){return(Hn(e.x)||Hn(e.y))&&!Hn(e.x2)&&!Hn(e.y2)&&!Hn(e.xError)&&!Hn(e.xError2)&&!Hn(e.yError)&&!Hn(e.yError2)}function ipn(e){return Hn(e.x2)||Hn(e.y2)}function opn(e){return Hn(e.xError)||Hn(e.xError2)||Hn(e.yError)||Hn(e.yError2)}function jKe(e,t,n){const{mark:r,encoding:i,params:o,projection:s,...a}=e,l=lg(r)?r:{type:r};o&&Et(RQe(t));const{orient:c,inputType:u}=npn(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=DKe(e,c,t),{errorBarSpecificAggregate:m,postAggregateCalculates:v,tooltipSummary:y,tooltipTitleWithFieldName:b}=spn(l,f,d,h,p,u,t,n),{[g]:w,[g==="x"?"x2":"y2"]:S,[g==="x"?"xError":"yError"]:_,[g==="x"?"xError2":"yError2"]:E,...T}=i,{bins:k,timeUnits:P,aggregate:R,groupby:I,encoding:F}=AKe(T,n),A=[...R,...m],L=u!=="raw"?[]:I,$=cie(y,f,F,b);return{transform:[...a.transform??[],...k,...P,...A.length===0?[]:[{aggregate:A,groupby:L}],...v],groupby:L,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:F,ticksOrient:c==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:$}}function spn(e,t,n,r,i,o,s,a){let l=[],c=[];const u=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Et(vdn(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:u,as:`extent_${u}`},{op:h,field:u,as:`center_${u}`}],c=[{calculate:`${Oi(`center_${u}`)} + ${Oi(`extent_${u}`)}`,as:`upper_${u}`},{calculate:`${Oi(`center_${u}`)} - ${Oi(`extent_${u}`)}`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:bL(h)},{fieldPrefix:"upper_",titlePrefix:SPe(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:SPe(h,p,"-")}],d=!0;else{let g,m,v;p==="ci"?(g="mean",m="ci0",v="ci1"):(g="median",m="q1",v="q3"),l=[{op:m,field:u,as:`lower_${u}`},{op:v,field:u,as:`upper_${u}`},{op:g,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:wO({field:u,aggregate:v,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:wO({field:u,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:wO({field:u,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&Et(mdn(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],c=[{calculate:Oi(n.field),as:`upper_${u}`},{calculate:Oi(u),as:`lower_${u}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`${Oi(u)} + ${Oi(r.field)}`,as:`upper_${u}`}],i?c.push({calculate:`${Oi(u)} + ${Oi(i.field)}`,as:`lower_${u}`}):c.push({calculate:`${Oi(u)} - ${Oi(r.field)}`,as:`lower_${u}`}));for(const h of c)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:Ew(Ew(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function SPe(e,t,n){return`${bL(e)} ${n} ${t}`}const ige="errorband",apn=["band","borders"],lpn=new D8(ige,BKe);function BKe(e,{config:t}){e={...e,encoding:L8(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=jKe(e,ige,t),c=s,u=nge(c,i,r,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):c.interpolate?Et(hPe("interpolate")):c.tension&&Et(hPe("tension")),{...a,transform:n,layer:[...u({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const UKe={};function oge(e,t,n){const r=new D8(e,t);UKe[e]={normalizer:r,parts:n}}function cpn(){return wt(UKe)}oge(n4,$Ke,Khn);oge(rge,zKe,epn);oge(ige,BKe,apn);const upn=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],VKe={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},WKe={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},fpn=wt(VKe),dpn=wt(WKe),hpn={header:1,headerRow:1,headerColumn:1,headerFacet:1},HKe=wt(hpn),GKe=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],ppn={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},gpn={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},_h="_vgsid_",mpn={point:{on:"click",fields:[_h],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function sge(e){return e==="legend"||!!e?.legend}function dX(e){return sge(e)&&Ht(e)}function age(e){return!!e?.select}function qKe(e){const t=[];for(const n of e||[]){if(age(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};t.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};t.push(s)}}return t}function vpn(e){return F8(e)||cge(e)||lge(e)}function lge(e){return _t(e,"concat")}function F8(e){return _t(e,"vconcat")}function cge(e){return _t(e,"hconcat")}function XKe({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function cg(e){return _t(e,"step")}function _Pe(e){return _t(e,"view")||_t(e,"width")||_t(e,"height")}const CPe=20,ypn={align:1,bounds:1,center:1,columns:1,spacing:1},bpn=wt(ypn);function xpn(e,t,n){const r=n[t],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&(M8(e)&&!EL(e.facet)||lge(e))&&(i.columns=s),F8(e)&&(i.columns=1);for(const a of bpn)if(e[a]!==void 0)if(a==="spacing"){const l=e[a];i[a]=Qr(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=e[a];return i}function uie(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function fie(e,t){const n=r4(e,t);return cg(n)?n.step:YKe}function r4(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return es(n,{step:e.step})}const YKe=20,wpn={continuousWidth:300,continuousHeight:300,step:YKe},Spn={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:wpn,mark:phn,arc:{},area:{},bar:yhn,circle:{},geoshape:{},image:{},line:{},point:{},rect:Wpe,rule:{color:"black"},square:{},text:{color:"black"},tick:bhn,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:Ydn,projection:{},legend:ppn,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:mpn,style:{},title:{},facet:{spacing:CPe},concat:{spacing:CPe},normalizedNumberFormat:".0%"},Zg=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],OPe={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},EPe={blue:Zg[0],orange:Zg[1],red:Zg[2],teal:Zg[3],green:Zg[4],yellow:Zg[5],purple:Zg[6],pink:Zg[7],brown:Zg[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function _pn(e={}){return{signals:[{name:"color",value:Ht(e)?{...EPe,...e}:EPe}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Cpn(e){return{signals:[{name:"fontSize",value:Ht(e)?{...OPe,...e}:OPe}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Opn(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function QKe(e){const t=wt(e||{}),n={};for(const r of t){const i=e[r];n[r]=ML(i)?OQe(i):wu(i)}return n}function Epn(e){const t=wt(e),n={};for(const r of t)n[r]=QKe(e[r]);return n}const Tpn=[...oKe,...TKe,...HKe,"background","padding","legend","lineBreak","scale","style","title","view"];function KKe(e={}){const{color:t,font:n,fontSize:r,selection:i,...o}=e,s=XU({},Un(Spn),n?Opn(n):{},t?_pn(t):{},r?Cpn(r):{},o||{});i&>(s,"selection",i,!0);const a=Iu(s,Tpn);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=wu(s[l]));for(const l of oKe)s[l]&&(a[l]=_a(s[l]));for(const l of TKe)s[l]&&(a[l]=QKe(s[l]));for(const l of HKe)s[l]&&(a[l]=_a(s[l]));if(s.legend&&(a.legend=_a(s.legend)),s.scale){const{invalid:l,...c}=s.scale,u=_a(l,{level:1});a.scale={..._a(c),...wt(u).length>0?{invalid:u}:{}}}return s.style&&(a.style=Epn(s.style)),s.title&&(a.title=_a(s.title)),s.view&&(a.view=_a(s.view)),a}const Ppn=new Set(["view",...lhn]),kpn=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Mpn={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...hhn};function Apn(e){e=Un(e);for(const t of kpn)delete e[t];if(e.axis)for(const t in e.axis)ML(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of upn)delete e.legend[t];if(e.mark){for(const t of gPe)delete e.mark[t];e.mark.tooltip&&Ht(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(qKe(e.params)),delete e.params);for(const t of Ppn){for(const r of gPe)delete e[t][r];const n=Mpn[t];if(n)for(const r of n)delete e[t][r];Ipn(e,t)}for(const t of cpn())delete e[t];Rpn(e);for(const t in e)Ht(e[t])&&Vi(e[t])&&delete e[t];return Vi(e)?void 0:e}function Rpn(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=CQe(e.title);Vi(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Vi(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Vi(r)?delete e.title:e.title=r}function Ipn(e,t,n,r){const i=e[t];t==="view"&&(n="cell");const o={...i,...e.style[n??t]};Vi(o)||(e.style[n??t]=o),delete e[t]}function $8(e){return _t(e,"layer")}function Dpn(e){return _t(e,"repeat")}function Lpn(e){return!lt(e.repeat)&&_t(e.repeat,"layer")}class uge{map(t,n){return M8(t)?this.mapFacet(t,n):Dpn(t)?this.mapRepeat(t,n):cge(t)?this.mapHConcat(t,n):F8(t)?this.mapVConcat(t,n):lge(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if($8(t))return this.mapLayer(t,n);if(zv(t))return this.mapUnit(t,n);throw new Error(Cpe(t))}mapLayer(t,n){return{...t,layer:t.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(r=>this.map(r,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(r=>this.map(r,n))}}mapConcat(t,n){const{concat:r,...i}=t;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const Fpn={zero:1,center:1,normalize:1};function $pn(e){return Yt(Fpn,e)}const Npn=new Set([nKe,E8,O8,QB,P8,Upe,Vpe,T8,rKe,Bpe]),zpn=new Set([E8,O8,nKe]);function z_(e){return Ot(e)&&PE(e)==="quantitative"&&!e.bin}function TPe(e,t,{orient:n,type:r}){const i=t==="x"?"y":"radius",o=t==="x"&&["bar","area"].includes(r),s=e[t],a=e[i];if(Ot(s)&&Ot(a))if(z_(s)&&z_(a)){if(s.stack)return t;if(a.stack)return i;const l=Ot(s)&&!!s.aggregate,c=Ot(a)&&!!a.aggregate;if(l!==c)return l?t:i;if(o){if(n==="vertical")return i;if(n==="horizontal")return t}}else{if(z_(s))return t;if(z_(a))return i}else{if(z_(s))return o&&n==="vertical"?void 0:t;if(z_(a))return o&&n==="horizontal"?void 0:i}}function jpn(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function ZKe(e,t){const n=lg(e)?e:{type:e},r=n.type;if(!Npn.has(r))return null;const i=TPe(t,"x",n)||TPe(t,"theta",n);if(!i)return null;const o=t[i],s=Ot(o)?It(o,{}):void 0,a=jpn(i),l=[],c=new Set;if(t[a]){const g=t[a],m=Ot(g)?It(g,{}):void 0;m&&m!==s&&(l.push(a),c.add(m))}const u=a==="x"?"xOffset":"yOffset",f=t[u],d=Ot(f)?It(f,{}):void 0;d&&d!==s&&(l.push(u),c.add(d));const h=qun.reduce((g,m)=>{if(m!=="tooltip"&&W1(t,m)){const v=t[m];for(const y of Vt(v)){const b=Sh(y);if(b.aggregate)continue;const w=It(b,{});(!w||!c.has(w))&&g.push({channel:m,fieldDef:b})}}return g},[]);let p;return o.stack!==void 0?vS(o.stack)?p=o.stack?"zero":null:p=o.stack:zpn.has(r)&&(p="zero"),!p||!$pn(p)||MKe(t)&&h.length===0?null:(o?.scale?.type&&o?.scale?.type!==Oa.LINEAR&&o?.stack&&Et(hdn(o.scale.type)),Hn(t[Pg(i)])?(o.stack!==void 0&&Et(ddn(i)),null):(Ot(o)&&o.aggregate&&!sfn.has(o.aggregate)&&Et(pdn(o.aggregate)),{groupbyChannels:l,groupbyFields:c,fieldChannel:i,impute:o.impute===null?!1:Vb(r),stackBy:h,offset:p}))}function JKe(e,t,n){const r=_a(e),i=vi("orient",r,n);if(r.orient=Wpn(r.type,t,i),i!==void 0&&i!==r.orient&&Et(Qfn(r.orient,i)),r.type==="bar"&&r.orient){const l=vi("cornerRadiusEnd",r,n);if(l!==void 0){const c=r.orient==="horizontal"&&t.x2||r.orient==="vertical"&&t.y2?["cornerRadius"]:mhn[r.orient];for(const u of c)r[u]=l;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}const o=vi("opacity",r,n),s=vi("fillOpacity",r,n);return o===void 0&&s===void 0&&(r.opacity=Upn(r.type,t)),vi("cursor",r,n)===void 0&&(r.cursor=Bpn(r,t,n)),r}function Bpn(e,t,n){return t.href||e.href||vi("href",e,n)?"pointer":e.cursor}const eZe=.7;function Upn(e,t){if(vr([P8,Bpe,Upe,Vpe],e)&&!MKe(t))return eZe}function Vpn(e,t,{graticule:n}){if(n)return!1;const r=ag("filled",e,t),i=e.type;return es(r,i!==P8&&i!==T8&&i!==QB)}function Wpn(e,t,n){switch(e){case P8:case Upe:case Vpe:case shn:case ohn:return}const{x:r,y:i,x2:o,y2:s}=t;switch(e){case rKe:case E8:if(Ot(r)&&(wa(r.bin)||Ot(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Ot(i)&&(wa(i.bin)||Ot(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(Ot(r)&&r.type===Mw&&!Ji(r.bin)||ZB(r))&&Ot(i)&&wa(i.bin)?"horizontal":"vertical";if(!s)return(Ot(i)&&i.type===Mw&&!Ji(i.bin)||ZB(i))&&Ot(r)&&wa(r.bin)?"vertical":"horizontal"}case QB:if(o&&!(Ot(r)&&wa(r.bin))&&s&&!(Ot(i)&&wa(i.bin)))return;case O8:if(s)return Ot(i)&&wa(i.bin)?"horizontal":"vertical";if(o)return Ot(r)&&wa(r.bin)?"vertical":"horizontal";if(e===QB){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case T8:case Bpe:{const a=bPe(r),l=bPe(i);if(n)return n;if(a&&!l)return e!=="tick"?"horizontal":"vertical";if(!a&&l)return e!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const c=Kl(r)&&r.type===EE,u=Kl(i)&&i.type===EE;if(c&&!u)return"vertical";if(!c&&u)return"horizontal"}return}}return"vertical"}function Hpn(e){const{point:t,line:n,...r}=e;return wt(r).length>1?r:r.type}function Gpn(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Iu(e[t],["point","line"])});return e}function hX(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Ht(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Ht(t.point)?t.point:{}:void 0}function PPe(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class qpn{name="path-overlay";hasMatchingType(t,n){if(zv(t)){const{mark:r,encoding:i}=t,o=lg(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!hX(o,n[o.type],i);case"area":return!!hX(o,n[o.type],i)||!!PPe(o,n[o.type])}}return!1}run(t,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:c,...u}=t,f=L8(c,i),d=lg(a)?a:{type:a},h=hX(d,i[d.type],f),p=d.type==="area"&&PPe(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:Hpn({...d.type==="area"&&vi("opacity",d,i)==null&&vi("fillOpacity",d,i)==null?{opacity:eZe}:{},...d}),encoding:Iu(f,["shape"])}],m=ZKe(JKe(d,f,i),f);let v=f;if(m){const{fieldChannel:y,offset:b}=m;v={...f,[y]:{...f[y],...b?{stack:b}:{}}}}return v=Iu(v,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...SE(d,["clip","interpolate","tension","tooltip"]),...p},encoding:v}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...SE(d,["clip","tooltip"]),...h},encoding:v}),r({...u,layer:g},{...n,config:Gpn(i)})}}function Xpn(e,t){return t?EL(e)?nZe(e,t):tZe(e,t):e}function pX(e,t){return t?nZe(e,t):e}function die(e,t,n){const r=t[e];if(Mhn(r)){if(r.repeat in n)return{...t,[e]:n[r.repeat]};Et(Tfn(r.repeat));return}return t}function tZe(e,t){if(e=die("field",e,t),e!==void 0){if(e===null)return null;if(Qpe(e)&&Km(e.sort)){const n=die("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function kPe(e,t){if(Ot(e))return tZe(e,t);{const n=die("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function MPe(e,t){if(Hn(e)){const n=kPe(e,t);if(n)return n;if(TL(e))return{condition:e.condition}}else{if(PL(e)){const n=kPe(e.condition,t);if(n)return{...e,condition:n};{const{condition:r,...i}=e;return i}}return e}}function nZe(e,t){const n={};for(const r in e)if(_t(e,r)){const i=e[r];if(lt(i))n[r]=i.map(o=>MPe(o,t)).filter(o=>o);else{const o=MPe(i,t);o!==void 0&&(n[r]=o)}}return n}class Ypn{name="RuleForRangedLine";hasMatchingType(t){if(zv(t)){const{encoding:n,mark:r}=t;if(r==="line"||lg(r)&&r.type==="line")for(const i of Wun){const o=TS(i),s=n[o];if(n[i]&&(Ot(s)&&!wa(s.bin)||Mg(s)))return!0}}return!1}run(t,n,r){const{encoding:i,mark:o}=t;return Et(Yfn(!!i.x2,!!i.y2)),r({...t,mark:Ht(o)?{...o,type:"rule"}:"rule"},n)}}class Qpn extends uge{nonFacetUnitNormalizers=[Zhn,tpn,lpn,new qpn,new Ypn];map(t,n){if(zv(t)){const r=W1(t.encoding,Ym),i=W1(t.encoding,Qm),o=W1(t.encoding,p8);if(r||i||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:r,parentProjection:i}=n,o=pX(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(t,n){return Lpn(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:r,spec:i,...o}=t,{row:s,column:a,layer:l}=r,{repeater:c={},repeaterPrefix:u=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...c,layer:f},h=`${(i.name?`${i.name}_`:"")+u}child__layer_${xo(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:r,spec:i,data:o,...s}=t;!lt(r)&&t.columns&&(t=Iu(t,["columns"]),Et(cPe("repeat")));const a=[],{repeater:l={},repeaterPrefix:c=""}=n,u=!lt(r)&&r.row||[l?l.row:null],f=!lt(r)&&r.column||[l?l.column:null],d=lt(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of u)for(const m of f){const v={repeat:p,row:g,column:m,layer:l.layer},y=`${(i.name?`${i.name}_`:"")+c}child__${lt(r)?`${xo(p)}`:(r.row?`row_${xo(g)}`:"")+(r.column?`column_${xo(m)}`:"")}`,b=this.map(i,{...n,repeater:v,repeaterPrefix:y});b.name=y,a.push(Iu(b,["data"]))}const h=lt(r)?t.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:r}=t;return EL(r)&&t.columns&&(t=Iu(t,["columns"]),Et(cPe("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:r,projection:i}=t,{parentEncoding:o,parentProjection:s,config:a}=n,l=RPe({parentProjection:s,projection:i}),c=APe({parentEncoding:o,encoding:pX(r,n.repeater)});return this.mapUnit({...t,...l?{projection:l}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(t,n){const{row:r,column:i,facet:o,...s}=t.encoding,{mark:a,width:l,projection:c,height:u,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),v=pX(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...u?{height:u}:{},...f?{view:f}:{},...c?{projection:c}:{},mark:a,encoding:v,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:r,column:i,facet:o}=t;if(r||i){o&&Et(qfn([...r?[Ym]:[],...i?[Qm]:[]]));const s={},a={};for(const l of[Ym,Qm]){const c=t[l];if(c){const{align:u,center:f,spacing:d,columns:h,...p}=c;s[l]=p;for(const g of["align","center","spacing"])c[g]!==void 0&&(a[g]??={},a[g][l]=c[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:c,...u}=o;return{facetMapping:Xpn(u,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...c?{columns:c}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=t,l={...i,parentEncoding:APe({parentEncoding:n,encoding:o,layer:!0}),parentProjection:RPe({parentProjection:r,projection:s})};return super.mapLayer({...a,...t.name?{name:[l.repeaterPrefix,t.name].filter(c=>c).join("_")}:{}},l)}}function APe({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){const i=new Set([...wt(e),...wt(t)]);for(const o of i){const s=t[o],a=e[o];if(Hn(s)){const l={...a,...s};r[o]=l}else PL(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||wh(a)||hn(a)||Hn(a)||lt(a))&&(r[o]=a)}}else r=t;return!r||Vi(r)?void 0:r}function RPe(e){const{parentProjection:t,projection:n}=e;return t&&n&&Et(Ffn({parentProjection:t,projection:n})),n??t}function fge(e){return _t(e,"filter")}function Kpn(e){return _t(e,"stop")}function rZe(e){return _t(e,"lookup")}function Zpn(e){return _t(e,"data")}function Jpn(e){return _t(e,"param")}function egn(e){return _t(e,"pivot")}function tgn(e){return _t(e,"density")}function ngn(e){return _t(e,"quantile")}function rgn(e){return _t(e,"regression")}function ign(e){return _t(e,"loess")}function ogn(e){return _t(e,"sample")}function sgn(e){return _t(e,"window")}function agn(e){return _t(e,"joinaggregate")}function lgn(e){return _t(e,"flatten")}function cgn(e){return _t(e,"calculate")}function iZe(e){return _t(e,"bin")}function ugn(e){return _t(e,"impute")}function fgn(e){return _t(e,"timeUnit")}function dgn(e){return _t(e,"aggregate")}function hgn(e){return _t(e,"stack")}function pgn(e){return _t(e,"fold")}function ggn(e){return _t(e,"extent")&&!_t(e,"density")&&!_t(e,"regression")}function mgn(e){return e.map(t=>fge(t)?{filter:bO(t.filter,Udn)}:t)}class vgn extends uge{map(t,n){return n.emptySelections??={},n.selectionPredicates??={},t=IPe(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=IPe(t,n),t.encoding){const r={};for(const[i,o]of ab(t.encoding))r[i]=oZe(o,n);t={...t,encoding:r}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:r,...i}=t;return r?{...i,params:ab(r).map(([o,s])=>{const{init:a,bind:l,empty:c,...u}=s;u.type==="single"?(u.type="point",u.toggle=!1):u.type==="multi"&&(u.type="point"),n.emptySelections[o]=c!=="none";for(const f of vs(n.selectionPredicates[o]??{}))f.empty=c!=="none";return{name:o,value:a,select:u,bind:l}})}:t}}function IPe(e,t){const{transform:n,...r}=e;if(n){const i=n.map(o=>{if(fge(o))return{filter:hie(o,t)};if(iZe(o)&&PS(o.bin))return{...o,bin:sZe(o.bin)};if(rZe(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return e}function oZe(e,t){const n=Un(e);if(Ot(n)&&PS(n.bin)&&(n.bin=sZe(n.bin)),RS(n)&&n.scale?.domain?.selection){const{selection:r,...i}=n.scale.domain;n.scale.domain={...i,...r?{param:r}:{}}}if(TL(n))if(lt(n.condition))n.condition=n.condition.map(r=>{const{selection:i,param:o,test:s,...a}=r;return o?r:{...a,test:hie(r,t)}});else{const{selection:r,param:i,test:o,...s}=oZe(n.condition,t);n.condition=i?n.condition:{...s,test:hie(n.condition,t)}}return n}function sZe(e){const t=e.extent;if(t?.selection){const{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function hie(e,t){const n=r=>bO(r,i=>{const o=t.emptySelections[i]??!0,s={param:i,empty:o};return t.selectionPredicates[i]??=[],t.selectionPredicates[i].push(s),s});return e.selection?n(e.selection):bO(e.test||e.filter,r=>r.selection?n(r.selection):r)}class pie extends uge{map(t,n){const r=n.selections??[];if(t.params&&!zv(t)){const i=[];for(const o of t.params)age(o)?r.push(o):i.push(o);t.params=i}return n.selections=r,super.map(t,n)}mapUnit(t,n){const r=n.selections;if(!r||!r.length)return t;const i=(n.path??[]).concat(t.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(Kt(a)&&(a===t.name||i.includes(a))||lt(a)&&a.map(l=>i.indexOf(l)).every((l,c,u)=>l!==-1&&(c===0||l>u[c-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=pie.prototype[e];pie.prototype[e]=function(n,r){return t.call(this,n,ygn(n,r))}}function ygn(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function aZe(e,t){t===void 0&&(t=KKe(e.config));const n=Sgn(e,t),{width:r,height:i}=e,o=_gn(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const bgn=new Qpn,xgn=new vgn,wgn=new pie;function Sgn(e,t={}){const n={config:t};return wgn.map(bgn.map(xgn.map(e,n),n),n)}function DPe(e){return Kt(e)?{type:e}:e??{}}function _gn(e,t,n){let{width:r,height:i}=t;const o=zv(e)||$8(e),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(Et(oPe("width")),r=void 0),i=="container"&&(Et(oPe("height")),i=void 0));const a={type:"pad",...s,...n?DPe(n.autosize):{},...DPe(e.autosize)};if(a.type==="fit"&&!o&&(Et(mfn),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Et(sPe("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Et(sPe("height")),!Ou(a,{type:"pad"}))return a}function Cgn(e){return["fit","fit-x","fit-y"].includes(e)}function Ogn(e){return e?`fit-${b8(e)}`:"fit"}const Egn=["background","padding"];function LPe(e,t){const n={};for(const r of Egn)e&&e[r]!==void 0&&(n[r]=wu(e[r]));return t&&(n.params=e.params),n}class jv{explicit;implicit;constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new jv(Un(this.explicit),Un(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return es(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:r}){n!==void 0&&this.set(t,n,r)}set(t,n,r){return delete this[r?"implicit":"explicit"][t],this[r?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:r}){n[t]!==void 0?this.set(t,n[t],!0):r[t]!==void 0&&this.set(t,r[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of wt(t.combine())){const r=t.getWithExplicit(n);this.setWithExplicit(n,r)}}}function op(e){return{explicit:!0,value:e}}function uu(e){return{explicit:!1,value:e}}function lZe(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:N8(t,n,r,i)}}function N8(e,t,n,r){return e.explicit&&t.explicit&&Et(odn(n,r,e.value,t.value)),e}function ub(e,t,n,r,i=N8){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Ou(e.value,t.value)?e:i(e,t,n,r)}class Tgn extends jv{explicit;implicit;parseNothing;constructor(t={},n={},r=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=r}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function AE(e){return _t(e,"url")}function AR(e){return _t(e,"values")}function cZe(e){return _t(e,"name")&&!AE(e)&&!AR(e)&&!z0(e)}function z0(e){return e&&(uZe(e)||fZe(e)||dge(e))}function uZe(e){return _t(e,"sequence")}function fZe(e){return _t(e,"sphere")}function dge(e){return _t(e,"graticule")}var Ao;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ao||(Ao={}));function dZe({invalid:e,isPath:t}){switch(sKe(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function Pgn(e){const{marks:t,scales:n}=dZe(e);return t===n?Ao.Main:n==="include-invalid-values"?Ao.PreFilterInvalid:Ao.PostFilterInvalid}class Ti{debugName;_children=[];_parent=null;_hash;constructor(t,n){this.debugName=n,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){Et(Ifn);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const i of this._children)i.parent=t;this._children=[],t.removeChild(this);const r=t.parent.removeChild(t);this._parent=n,n.addChild(this,r),t.parent=this}}class Rc extends Ti{type;refCounts;_source;_name;clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,r,i){super(t,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${lQe()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function gX(e){return e.as!==void 0}function FPe(e){return`${e}_end`}class qp extends Ti{timeUnits;clone(){return new qp(null,Un(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let c;if(AS(l)){if(Po(n)){const{mark:u,markDef:f,config:d}=n,h=cb({fieldDef:o,markDef:f,config:d});(MR(u)||h)&&(c={timeUnit:sa(l),field:a})}}else c={as:It(o,{forAs:!0}),field:a,timeUnit:l};if(Po(n)){const{mark:u,markDef:f,config:d}=n,h=cb({fieldDef:o,markDef:f,config:d});MR(u)&&ts(s)&&h!==.5&&(c.rectBandPosition=h)}c&&(i[Or(c)]=c)}return i},{});return Vi(r)?null:new qp(t,r)}static makeFromTransform(t,n){const{timeUnit:r,...i}={...n},o=sa(r),s={...i,timeUnit:o};return new qp(t,{[Or(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[r,i]of ab(this.timeUnits)){const o=gX(i)?i.as:`${i.field}_end`;t.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(vs(this.timeUnits).map(t=>gX(t)?t.as:FPe(t.field)))}dependentFields(){return new Set(vs(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${Or(this.timeUnits)}`}assemble(){const t=[];for(const n of vs(this.timeUnits)){const{rectBandPosition:r}=n,i=sa(n.timeUnit);if(gX(n)){const{field:o,as:s}=n,{unit:a,utc:l,...c}=i,u=[s,`${s}_end`];t.push({field:td(o),type:"timeunit",...a?{units:_8(a)}:{},...l?{timezone:"utc"}:{},...c,as:u}),t.push(...$Pe(u,r,i))}else if(n){const{field:o}=n,s=sQe(o),a=hZe({timeUnit:i,field:s}),l=FPe(s);t.push({type:"formula",expr:a,as:l}),t.push(...$Pe([s,l],r,i))}}return t}}const z8="offsetted_rect_start",j8="offsetted_rect_end";function hZe({timeUnit:e,field:t,reverse:n}){const{unit:r,utc:i}=e,o=VQe(r),{part:s,step:a}=qQe(o,e.step);return`${i?"utcOffset":"timeOffset"}('${s}', ${Oi(t)}, ${n?-a:a})`}function $Pe([e,t],n,r){if(n!==void 0&&n!==.5){const i=Oi(e),o=Oi(t);return[{type:"formula",expr:NPe([hZe({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${z8}`},{type:"formula",expr:NPe([i,o],n+.5),as:`${e}_${j8}`}]}return[]}function NPe([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const AL="_tuple_fields";class kgn{hasChannel;hasField;hasSelectionId;timeUnit;items;constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Mgn={defined:()=>!0,parse:(e,t,n)=>{const r=t.name,i=t.project??=new kgn,o={},s={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let v=xo(`${r}_${m}`);for(let y=1;a.has(v);y++)v=xo(`${r}_${m}_${y}`);return a.add(v),{[g]:v}},c=t.type,u=e.config.selection[c],f=n.value!==void 0?Vt(n.value):null;let{fields:d,encodings:h}=Ht(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(Ht(p))for(const g of wt(p))Vun(g)?(h||(h=[])).push(g):c==="interval"?(Et(Efn),h=u.encodings):(d??=[]).push(g)}!d&&!h&&(h=u.encodings,"fields"in u&&(d=u.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Et(vfn(p,g.aggregate));continue}else if(!m){Et(lPe(p));continue}if(g.timeUnit&&!AS(g.timeUnit)){m=e.vgField(p);const v={timeUnit:g.timeUnit,as:m,field:g.field};s[Or(v)]=v}if(!o[m]){const v=c==="interval"&&kg(p)&&xh(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",y={field:m,channel:p,type:v,index:i.items.length};y.signals={...l(y,"data"),...l(y,"visual")},i.items.push(o[m]=y),i.hasField[m]=o[m],i.hasSelectionId=i.hasSelectionId||m===_h,pQe(p)?(y.geoChannel=p,y.channel=hQe(p),i.hasChannel[y.channel]=o[m]):i.hasChannel[p]=o[m]}}else Et(lPe(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===_h}f&&(t.init=f.map(p=>i.items.map(g=>Ht(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Vi(s)||(i.timeUnit=new qp(null,s))},signals:(e,t,n)=>{const r=t.name+AL;return n.filter(o=>o.name===r).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(vZe)})}},pZe="_curr",c5="anim_value",kC="anim_clock",gie="eased_anim_clock",gZe="min_extent",mZe="max_range_extent",mX="last_tick_at",vX="is_playing",Agn=1/60*1e3,Rgn=(e,t)=>[{name:gie,update:kC},{name:`${e}_domain`,init:`domain('${t}')`},{name:gZe,init:`extent(${e}_domain)[0]`},{name:mZe,init:`extent(range('${t}'))[1]`},{name:c5,update:`invert('${t}', ${gie})`}],Ign={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(Xp(t)&&(n=n.concat([{name:kC,init:"0",on:[{events:{type:"timer",throttle:Agn},update:`${vX} ? (${kC} + (now() - ${mX}) > ${mZe} ? 0 : ${kC} + (now() - ${mX})) : ${kC}`}]},{name:mX,init:"now()",on:[{events:[{signal:kC},{signal:vX}],update:"now()"}]},{name:vX,init:"true"}])),n),signals:(e,t,n)=>{const r=t.name,i=r+AL,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=vs(e.component.selection??{}).reduce((u,f)=>f.type==="interval"?u.concat(f.name+SO):u,[]).map(u=>`indexof(item().mark.name, '${u}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let c=`unit: ${H1(e)}, `;if(t.project.hasSelectionId)c+=`${_h}: ${s}[${Tt(_h)}]`;else if(Xp(t))c+=`fields: ${i}, values: [${c5} ? ${c5} : ${gZe}]`;else{const u=o.items.map(f=>e.fieldDef(f.channel)?.bin?`[${s}[${Tt(e.vgField(f.channel,{}))}], ${s}[${Tt(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${s}[${Tt(f.field)}]`).join(", ");c+=`fields: ${i}, values: [${u}]`}if(Xp(t))return n.concat(Rgn(t.name,e.scaleName($b)),[{name:r+yv,on:[{events:[{signal:gie},{signal:c5}],update:`{${c}}`,force:!0}]}]);{const u=t.events;return n.concat([{name:r+yv,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}}};function vZe(e){const{signals:t,hasLegend:n,index:r,...i}=e;return i.field=td(i.field),i}function Iw(e,t=!0,n=vl){if(lt(e)){const r=e.map(i=>Iw(i,t,n));return t?`[${r.join(", ")}]`:r}else if(MS(e))return n(t?kw(e):Mdn(e));return t?n(yi(e)):e}function Dgn(e,t){for(const n of vs(e.component.selection??{})){const r=n.name;let i=`${r}${yv}, ${n.resolve==="global"?"true":`{unit: ${H1(e)}}`}`;for(const o of B8)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(i=o.modifyExpr(e,n,i)));t.push({name:r+amn,on:[{events:{signal:n.name+yv},update:`modify(${Tt(n.name+Dw)}, ${i})`}]})}return hge(t)}function Lgn(e,t){if(e.component.selection&&wt(e.component.selection).length){const n=Tt(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Lb("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return hge(t)}function Fgn(e,t){let n=!1;for(const r of vs(e.component.selection??{})){const i=r.name,o=Tt(i+Dw);if(t.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";t.push({name:r.name,update:`${LZe}(${o}, ${Tt(a)}${l}`})}n=!0;for(const a of B8)a.defined(r)&&a.topLevelSignals&&(t=a.topLevelSignals(e,r,t))}return n&&t.filter(i=>i.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),hge(t)}function $gn(e,t){const n=[],r=[],i=H1(e,{escape:!1});for(const o of vs(e.component.selection??{})){const s={name:o.name+Dw};if(o.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:_h}}]),o.init){const l=o.project.items.map(vZe);s.values=o.project.hasSelectionId?o.init.map(c=>({unit:i,[_h]:Iw(c,!1)[0]})):o.init.map(c=>({unit:i,fields:l,values:Iw(c,!1)}))}if([...n,...t].filter(l=>l.name===o.name+Dw).length||n.push(s),Xp(o)&&t.length){const l=e.lookupDataSource(e.getDataName(Ao.Main)),c=t.find(f=>f.name===l),u=c.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(u){c.transform=c.transform.filter(d=>d!==u);const f={name:c.name+pZe,source:c.name,transform:[u]};r.push(f)}}}return n.concat(t,r)}function yZe(e,t){for(const n of vs(e.component.selection??{}))for(const r of B8)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function Ngn(e,t){for(const n of e.children)Po(n)&&(t=yZe(n,t));return t}function zgn(e,t,n,r){const i=jZe(e,t.param,t);return{signal:xh(n.get("type"))&<(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function hge(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const Zm={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!kg(i))continue;const o=e.getScaleComponent(i),s=o?o.get("type"):void 0;if(s=="sequential"&&Et(wfn),!o||!xh(s)){Et(xfn);continue}o.set("selectionExtent",{param:t.name,field:r.field},!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||vie(e)||r.length===0)return n;const i=n.find(s=>s.name===t.name);let o=i.update;if(o.includes(LZe))i.update=`{${r.map(s=>`${Tt(td(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${Tt(td(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!vie(e))for(const r of t.scales){const i=n.find(o=>o.name===r.signals.data);i.push="outer",delete i.value,delete i.update}return n}};function mie(e,t){return`domain(${Tt(e.scaleName(t))})`}function vie(e){return e.parent&&pP(e.parent)&&(!e.parent.parent||vie(e.parent.parent))}const SO="_brush",bZe="_scale_trigger",o2="geo_interval_init_tick",xZe="_init",jgn="_center",Bgn={defined:e=>e.type==="interval",parse:(e,t,n)=>{if(e.hasProjection){const r={...Ht(n.select)?n.select:{}};r.fields=[_h],r.encodings||(r.encodings=n.value?wt(n.value):[$h,Fh]),n.select={type:"interval",...r}}if(t.translate&&!Zm.defined(t)){const r=`!event.item || event.item.mark.name !== ${Tt(t.name+SO)}`;for(const i of t.events){if(!i.between){Et(`${i} is not an ordered event stream for interval selections.`);continue}const o=Vt(i.between[0].filter??=[]);o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const r=t.name,i=r+yv,o=vs(t.project.hasChannel).filter(a=>a.channel===_o||a.channel===ha),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(Ugn(e,t,l,s?.[l.index])),[])),e.hasProjection){const a=Tt(e.projectionName()),l=e.projectionName()+jgn,{x:c,y:u}=t.project.hasChannel,f=c?.signals.visual,d=u?.signals.visual,h=c?s?.[c.index]:`${l}[0]`,p=u?s?.[u.index]:`${l}[1]`,g=S=>e.getSizeSignalRef(S).signal,m=`[[${f?`${f}[0]`:"0"}, ${d?`${d}[0]`:"0"}],[${f?`${f}[1]`:g("width")}, ${d?`${d}[1]`:g("height")}]]`;s&&(n.unshift({name:r+xZe,init:`[scale(${a}, [${c?h[0]:h}, ${u?p[0]:p}]), scale(${a}, [${c?h[1]:h}, ${u?p[1]:p}])]`}),(!c||!u)&&(n.find(_=>_.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const v=`intersect(${m}, {markname: ${Tt(e.getName("marks"))}}, unit.mark)`,y=`{unit: ${H1(e)}}`,b=`vlSelectionTuples(${v}, ${y})`,w=o.map(S=>S.signals.visual);return n.concat({name:i,on:[{events:[...w.length?[{signal:w.join(" || ")}]:[],...s?[{signal:o2}]:[]],update:b}]})}else{if(!Zm.defined(t)){const c=r+bZe,u=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=Tt(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),v=xh(m)?"+":"";return`(!isArray(${h}) || (${v}invert(${g}, ${p})[0] === ${v}${h}[0] && ${v}invert(${g}, ${p})[1] === ${v}${h}[1]))`});u.length&&n.push({name:c,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:`${u.join(" && ")} ? ${c} : {}`}]})}const a=o.map(c=>c.signals.data),l=`unit: ${H1(e)}, fields: ${r+AL}, values`;return n.concat({name:i,...s?{init:`{${l}: ${Iw(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Po(e)&&e.hasProjection&&t.init&&(n.filter(i=>i.name===o2).length||n.unshift({name:o2,value:null,on:[{events:"timer{1}",update:`${o2} === null ? {} : ${o2}`}]})),n),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,s=i?.signals.visual,a=o?.signals.visual,l=`data(${Tt(t.name+Dw)})`;if(Zm.defined(t)||!i&&!o)return n;const c={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of wt(c))c[m]=[{test:`${l}.length && ${l}[0].unit === ${H1(e)}`,...c[m]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=t.mark,p=wt(h).reduce((m,v)=>(m[v]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[v]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${r+SO}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:r+SO,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}};function Ugn(e,t,n,r){const i=!e.hasProjection,o=n.channel,s=n.signals.visual,a=Tt(i?e.scaleName(o):e.projectionName()),l=d=>`scale(${a}, ${d})`,c=e.getSizeSignalRef(o===_o?"width":"height").signal,u=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${u}, ${u}]`},{events:h,update:`[${s}[0], clamp(${u}, 0, ${c})]`}],[]);if(i){const d=n.signals.data,h=Zm.defined(t),p=e.getScaleComponent(o),g=p?p.get("type"):void 0,m=r?{init:Iw(r,!0,l)}:{value:[]};return f.push({events:{signal:t.name+bZe},update:xh(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...r?{init:Iw(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===_o?0:1,h=t.name+xZe,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}function uP({model:e,channelDef:t,vgChannel:n,invalidValueRef:r,mainRefFn:i}){const o=TL(t)&&t.condition;let s=[];o&&(s=Vt(o).map(c=>{const u=i(c);if(khn(c)){const{param:f,empty:d}=c;return{test:zZe(e,{param:f,empty:d}),...u}}else return{test:s4(e,c.test),...u}})),r!==void 0&&s.push(r);const a=i(t);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function pge(e,t="text"){const n=e.encoding[t];return uP({model:e,channelDef:n,vgChannel:t,mainRefFn:r=>gge(r,e.config),invalidValueRef:void 0})}function gge(e,t,n="datum"){if(e){if(wh(e))return lo(e.value);if(Hn(e)){const{format:r,formatType:i}=e4(e);return Xpe({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function wZe(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,s=n.tooltip;if(lt(s))return{tooltip:zPe({tooltip:s},o,i,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return uP({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:c=>{const u=_Ze(c,i,a);if(u)return u;if(c===null)return;let f=vi("tooltip",r,i);if(f===!0&&(f={content:"encoding"}),Kt(f))return{value:f};if(Ht(f))return hn(f)?f:f.content==="encoding"?zPe(n,o,i,t):{signal:a}},invalidValueRef:void 0})}}function SZe(e,t,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o=new Set,s=r?"datum.datum":"datum",a=[];function l(u,f){const d=TS(f),h=Kl(u)?u:{...u,type:e[d].type},p=h.title||Zpe(h,i),g=Vt(p).join(", ").replaceAll(/"/g,'\\"');let m;if(ts(f)){const v=f==="x"?"x2":"y2",y=Sh(e[v]);if(wa(h.bin)&&y){const b=It(h,{expr:s}),w=It(y,{expr:s}),{format:S,formatType:_}=e4(h);m=OL(b,w,S,_,i),o.add(v)}}if((ts(f)||f===hd||f===Lh)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:v,formatType:y}=e4(h);m=Xpe({fieldOrDatumDef:h,format:v,formatType:y,expr:s,config:i,normalizeStack:!0}).signal}m??=_Ze(h,i,s).signal,a.push({channel:f,key:g,value:m})}ege(e,(u,f)=>{Ot(u)?l(u,f):A8(u)&&l(u.condition,f)});const c={};for(const{channel:u,key:f,value:d}of a)!o.has(u)&&!c[f]&&(c[f]=d);return c}function zPe(e,t,n,{reactiveGeom:r}={}){const i=SZe(e,t,n,{reactiveGeom:r}),o=ab(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function _Ze(e,t,n="datum"){if(Ot(e)&&Npe(e.type)&&!_t(e,"format")){const r=`datum["${e.field}"]`;return{signal:`isValid(${r}) ? isArray(${r}) ? join(${r}, '\\n') : ${r} : ""+${r}`}}return gge(e,t,n)}function Vgn(e){const{markDef:t,config:n}=e,r=vi("aria",t,n);return r===!1?{}:{...r?{aria:r}:{},...Wgn(e),...Hgn(e)}}function Wgn(e){const{mark:t,markDef:n,config:r}=e;if(r.aria===!1)return{};const i=vi("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:Yt(dfn,t)?{}:{ariaRoleDescription:{value:t}}}function Hgn(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return uP({model:e,channelDef:o,vgChannel:"description",mainRefFn:l=>gge(l,e.config),invalidValueRef:void 0});const s=vi("description",n,r);if(s!=null)return{description:lo(s)};if(r.aria===!1)return{};const a=SZe(t,i,r);if(!Vi(a))return{description:{signal:ab(a).filter(([l])=>!l.startsWith("_")).map(([l,c])=>[l,c.replaceAll("\\n"," ")]).map(([l,c],u)=>`"${u>0?"; ":""}${l}: " + (${c})`).join(" + ")}}}function Pa(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;const c=i[e];a===void 0&&(l??=vi(e,r,o,{vgChannel:s,ignoreVgConfig:!TL(c)}),l!==void 0&&(a=lo(l)));const u={markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=lKe({...u,scaleChannel:e,channelDef:c});return uP({model:t,channelDef:c,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>qpe({...u,channel:e,channelDef:h,stack:null,defaultRef:a})})}function CZe(e,t={filled:void 0}){const{markDef:n,encoding:r,config:i}=e,{type:o}=n,s=t.filled??vi("filled",n,i),a=vr(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=vi(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,c=vi(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],u=s?"fill":"stroke",f={...l?{fill:lo(l)}:{},...c?{stroke:lo(c)}:{}};return n.color&&(s?n.fill:n.stroke)&&Et(DQe("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...Pa("color",e,{vgChannel:u,defaultValue:s?l:c}),...Pa("fill",e,{defaultValue:r.fill?l:void 0}),...Pa("stroke",e,{defaultValue:r.stroke?c:void 0})}}function Ggn(e){const{encoding:t,mark:n}=e,r=t.order;return!Vb(n)&&wh(r)?uP({model:e,channelDef:r,vgChannel:"zindex",mainRefFn:i=>lo(i.value),invalidValueRef:void 0}):{}}function RE({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:qpe({channel:o,channelDef:a,markDef:t,config:r?.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:lo(s),bandPosition:i})};const l=t[o];return l?{offsetType:"visual",offset:l}:{}}function Vl(e,t,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=t,l=i[e],c=i[Pg(e)],u=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=RE({channel:e,markDef:o,encoding:i,model:t,bandPosition:.5}),p=mge({model:t,defaultPos:n,channel:e,scaleName:u,scale:f}),g=!l&&ts(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:qgn({channel:e,channelDef:l,channel2Def:c,markDef:o,config:s,scaleName:u,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||e]:g}:void 0}function qgn(e){const{channel:t,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=e;if(Hn(n)&&i&&t===i.fieldChannel){if(Ot(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return KB({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return V1(n,r,{suffix:"end"},{offset:o})}return Gpe(e)}function mge({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=e;return()=>{const a=TS(n),l=lb(n),c=vi(n,o,s,{vgChannel:l});if(c!==void 0)return cA(n,c);switch(t){case"zeroOrMin":return jPe({scaleName:r,scale:i,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return jPe({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[Wc(n)],mult:.5}}}}function jPe({mainChannel:e,config:t,...n}){const r=aKe(n),{mode:i}=n;if(r)return r;switch(e){case"radius":{if(i==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=i.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return i==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return i==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return i==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const Xgn={left:"x",center:"xc",right:"x2"},Ygn={top:"y",middle:"yc",bottom:"y2"};function OZe(e,t,n,r="middle"){if(e==="radius"||e==="theta")return lb(e);const i=e==="x"?"align":"baseline",o=vi(i,t,n);let s;return hn(o)?(Et(Xfn(i)),s=void 0):s=o,e==="x"?Xgn[s||(r==="top"?"left":"center")]:Ygn[s||r]}function i4(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?EZe(e,t,{defaultPos:n,defaultPos2:r}):Vl(e,t,{defaultPos:n})}function EZe(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,s=Pg(e),a=Wc(e),l=Qgn(t,r,s),c=l[a]?OZe(e,i,o):lb(e);return{...Vl(e,t,{defaultPos:n,vgChannel:c}),...l}}function Qgn(e,t,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=e,l=TS(n),c=Wc(n),u=lb(n),f=r[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=n in r||n in o?RE({channel:n,markDef:o,encoding:r,model:e}):RE({channel:l,markDef:o,encoding:r,model:e});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const m=Wc(n),v=e.markDef[m];return v!=null?{[m]:{value:v}}:{[u]:{field:e.getName(n)}}}const g=Kgn({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[u]:g}:AN(n,o)||AN(n,{[n]:iie(n,o,a.style),[c]:iie(c,o,a.style)})||AN(n,a[i])||AN(n,a.mark)||{[u]:mge({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Kgn({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c}){return Hn(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?V1(t,o,{suffix:"start"},{offset:l}):Gpe({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:c})}function AN(e,t){const n=Wc(e),r=lb(e);if(t[r]!==void 0)return{[r]:cA(e,t[r])};if(t[e]!==void 0)return{[r]:cA(e,t[e])};if(t[n]){const i=t[n];if(Aw(i))Et(Ufn(n));else return{[n]:cA(e,i)}}}function vv(e,t){const{config:n,encoding:r,markDef:i}=e,o=i.type,s=Pg(t),a=Wc(t),l=r[t],c=r[s],u=e.getScaleComponent(t),f=u?u.get("type"):void 0,d=i.orient,h=r[a]??r.size??vi("size",i,n,{vgChannel:a}),p=yQe(t),g=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return Ot(l)&&(Ji(l.bin)||wa(l.bin)||l.timeUnit&&!c)&&!(h&&!Aw(h))&&!r[p]&&!la(f)?emn({fieldDef:l,fieldDef2:c,channel:t,model:e}):(Hn(l)&&la(f)||g)&&!c?Jgn(l,t,e):EZe(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Zgn(e,t,n,r,i,o,s){if(Aw(i))if(n){const l=n.get("type");if(l==="band"){let c=`bandwidth('${t}')`;i.band!==1&&(c=`${i.band} * ${c}`);const u=ag("minBandSize",{type:s},r);return{signal:u?`max(${nh(u)}, ${c})`:c}}else i.band!==1&&(Et(Zfn(l)),i=void 0)}else return{mult:i.band,field:{group:e}};else{if(hn(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(kS(l)&&Qr(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:c,rectBandPaddingInner:u,tickBandPaddingInner:f}=r.scale,d=es(l,s==="tick"?f:s==="bar"?c:u);if(hn(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Qr(d))return{signal:`${1-d} * ${e}`}}return{value:fie(r.view,e)-2}}function Jgn(e,t,n){const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(t),c=n.getScaleComponent(t),u=Wc(t),f=Pg(t),d=yQe(t),h=n.scaleName(d),p=n.getScaleComponent(ype(t)),g=r.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(i.size||r.size)&&(g?m=Pa("size",n,{vgChannel:u,defaultRef:lo(r.size)}):Et(ndn(r.type)));const v=!!m,y=gKe({channel:t,fieldDef:e,markDef:r,config:o,scaleType:(c||p)?.get("type"),useVlSizeChannel:g});m=m||{[u]:Zgn(u,h||l,p||c,o,y,!!e,r.type)};const b=(c||p)?.get("type")==="band"&&Aw(y)&&!v?"top":"middle",w=OZe(t,r,o,b),S=w==="xc"||w==="yc",{offset:_,offsetType:E}=RE({channel:t,markDef:r,encoding:i,model:n,bandPosition:S?.5:0}),T=Gpe({channel:t,channelDef:e,markDef:r,config:o,scaleName:l,scale:c,stack:s,offset:_,defaultRef:mge({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:c}),bandPosition:S?E==="encoding"?0:.5:hn(y)?{signal:`(1-${y})/2`}:Aw(y)?(1-y.band)/2:0});if(u)return{[w]:T,...m};{const k=lb(f),P=m[u],R=_?{...P,offset:_}:P;return{[w]:T,[k]:lt(T)?[T[0],{...T[1],offset:R}]:{...T,offset:R}}}}function BPe(e,t,n,r,i,o,s){if(dQe(e))return 0;const a=e==="x"||e==="y2",l=a?-t/2:t/2;if(hn(n)||hn(i)||hn(r)||o){const c=nh(n),u=nh(i),f=nh(r),d=nh(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",m=c?`(${c} ? -1 : 1) * `:"",v=u?`(${u} + ${p})`:p;return{signal:g+m+v}}else return i=i||0,r+(n?-i-l:+i+l)}function emn({fieldDef:e,fieldDef2:t,channel:n,model:r}){const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),c=a?a.get("type"):void 0,u=a.get("reverse"),f=gKe({channel:n,fieldDef:e,markDef:o,config:i,scaleType:c}),h=r.component.axes[n]?.[0]?.get("translate")??.5,p=ts(n)?vi("binSpacing",o,i)??0:0,g=Pg(n),m=lb(n),v=lb(g),y=ag("minBandSize",o,i),{offset:b}=RE({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:w}=RE({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),S=Chn({fieldDef:e,scaleName:l}),_=BPe(n,p,u,h,b,y,S),E=BPe(g,p,u,h,w??b,y,S),T=hn(f)?{signal:`(1-${f.signal})/2`}:Aw(f)?(1-f.band)/2:.5,k=cb({fieldDef:e,fieldDef2:t,markDef:o,config:i});if(Ji(e.bin)||e.timeUnit){const P=e.timeUnit&&k!==.5;return{[v]:UPe({fieldDef:e,scaleName:l,bandPosition:T,offset:E,useRectOffsetField:P}),[m]:UPe({fieldDef:e,scaleName:l,bandPosition:hn(T)?{signal:`1-${T.signal}`}:1-T,offset:_,useRectOffsetField:P})}}else if(wa(e.bin)){const P=V1(e,l,{},{offset:E});if(Ot(t))return{[v]:P,[m]:V1(t,l,{},{offset:_})};if(PS(e.bin)&&e.bin.step)return{[v]:P,[m]:{signal:`scale("${l}", ${It(e,{expr:"datum"})} + ${e.bin.step})`,offset:_}}}Et($Qe(g))}function UPe({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return KB({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:z8,endSuffix:j8}:{}})}const tmn=new Set(["aria","width","height"]);function pd(e,t){const{fill:n=void 0,stroke:r=void 0}=t.color==="include"?CZe(e):{};return{...nmn(e.markDef,t),...VPe("fill",n),...VPe("stroke",r),...Pa("opacity",e),...Pa("fillOpacity",e),...Pa("strokeOpacity",e),...Pa("strokeWidth",e),...Pa("strokeDash",e),...Ggn(e),...wZe(e),...pge(e,"href"),...Vgn(e)}}function VPe(e,t){return t?{[e]:t}:{}}function nmn(e,t){return ffn.reduce((n,r)=>(!tmn.has(r)&&_t(e,r)&&t[r]!=="ignore"&&(n[r]=lo(e[r])),n),{})}function vge(e){const{config:t,markDef:n}=e,r=new Set;if(e.forEachFieldDef((i,o)=>{let s;if(!kg(o)||!(s=e.getScaleType(o)))return;const a=x8(i.aggregate),l=Hpe({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(whn(l)){const c=e.vgField(o,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});c&&r.add(c)}}),r.size>0)return{defined:{signal:[...r].map(o=>C8(o,!0)).join(" && ")}}}function WPe(e,t){if(t!==void 0)return{[e]:lo(t)}}const yX="voronoi",TZe={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(yX)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(Vb(o))return Et(yfn(o)),n;const s={name:e.getName(yX),type:"path",interactive:!0,aria:!1,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...wZe(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((c,u)=>{const f=c.name??"";f===e.component.mark[0].name?a=u:f.includes(yX)&&(l=!0)}),l||n.splice(a+1,0,s),n}},PZe={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!sge(e.bind),parse:(e,t,n)=>FZe(t,n),topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,s=t.init?.[0],a=TZe.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,c)=>{const u=xo(`${r}_${l.field}`);n.filter(d=>d.name===u).length||n.unshift({name:u,...s?{init:Iw(s[c])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${Tt(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(c=>c.name===r+yv),s=r+AL,a=i.items.map(c=>xo(`${r}_${c.field}`)),l=a.map(c=>`${c} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},o4="_toggle",kZe={defined:e=>e.type==="point"&&!Xp(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+o4,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+yv,r=t.name+o4;return`${r} ? null : ${n}, ${t.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${H1(e)}}, `}${r} ? ${n} : null`}},rmn={defined:e=>e.clear!==void 0&&e.clear!==!1&&!Xp(e),parse:(e,t)=>{t.clear&&(t.clear=Kt(t.clear)?Lb(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(PZe.defined(t))for(const r of t.project.items){const i=n.findIndex(o=>o.name===xo(`${t.name}_${r.field}`));i!==-1&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const i of t.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===t.name+yv);r(i,"null"),kZe.defined(t)&&(i=n.findIndex(o=>o.name===t.name+o4),r(i,"false"))}return n}},MZe={defined:e=>{const t=e.resolve==="global"&&e.bind&&sge(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==_h;return t&&!n&&Et(Sfn),t&&n},parse:(e,t,n)=>{const r=Un(n);if(r.select=Kt(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},FZe(t,r),Ht(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=Vt(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=dX(t.bind)?t.bind.legend:"click",o=Kt(i)?Lb(i,"view"):Vt(i);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=dX(t.bind)&&t.bind.legend,o=s=>a=>{const l=Un(a);return l.markname=s,l};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${xo(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(u=>u.name===l).length===0){const u=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...t.init?{}:{value:null},on:[{events:u,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(d=>d.name===r+yv),s=r+AL,a=i.items.filter(d=>d.hasLegend).map(d=>xo(`${r}_${xo(d.field)}_legend`)),c=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:c}):a.length>0&&(o.update=c,delete o.value,delete o.on);const u=n.find(d=>d.name===r+o4),f=dX(t.bind)&&t.bind.legend;return u&&(t.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};function imn(e,t,n){const r=e.fieldDef(t)?.field;for(const i of vs(e.component.selection??{})){const o=i.project.hasField[r]??i.project.hasChannel[t];if(o&&MZe.defined(i)){const s=n.get("selections")??[];s.push(i.name),n.set("selections",s,!1),o.hasLegend=!0}}}const AZe="_translate_anchor",RZe="_translate_delta",omn={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const r=t.name,i=Zm.defined(t),o=r+AZe,{x:s,y:a}=t.project.hasChannel;let l=Lb(t.translate,"scope");return i||(l=l.map(c=>(c.between[0].markname=r+SO,c))),n.push({name:o,value:{},on:[{events:l.map(c=>c.between[0]),update:`{x: x(unit), y: y(unit)${s!==void 0?`, extent_x: ${i?mie(e,_o):`slice(${s.signals.visual})`}`:""}${a!==void 0?`, extent_y: ${i?mie(e,ha):`slice(${a.signals.visual})`}`:""}}`}]},{name:r+RZe,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&HPe(e,t,s,"width",n),a!==void 0&&HPe(e,t,a,"height",n),n}};function HPe(e,t,n,r,i){const o=t.name,s=o+AZe,a=o+RZe,l=n.channel,c=Zm.defined(t),u=i.find(S=>S.name===n.signals[c?"data":"visual"]),f=e.getSizeSignalRef(r).signal,d=e.getScaleComponent(l),h=d?.get("type"),p=d?.get("reverse"),g=c?l===_o?p?"":"-":p?"-":"":"",m=`${s}.extent_${l}`,v=`${g}${a}.${l} / ${c?`${f}`:`span(${m})`}`,y=!c||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",b=c?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",w=`${y}(${m}, ${v}${b})`;u.on.push({events:{signal:a},update:c?w:`clampRange(${w}, 0, ${f})`})}const IZe="_zoom_anchor",DZe="_zoom_delta",smn={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=Zm.defined(t),o=r+DZe,{x:s,y:a}=t.project.hasChannel,l=Tt(e.scaleName(_o)),c=Tt(e.scaleName(ha));let u=Lb(t.zoom,"scope");return i||(u=u.map(f=>(f.markname=r+SO,f))),n.push({name:r+IZe,on:[{events:u,update:i?`{${[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(f=>f).join(", ")}}`:"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&GPe(e,t,s,"width",n),a!==void 0&&GPe(e,t,a,"height",n),n}};function GPe(e,t,n,r,i){const o=t.name,s=n.channel,a=Zm.defined(t),l=i.find(y=>y.name===n.signals[a?"data":"visual"]),c=e.getSizeSignalRef(r).signal,u=e.getScaleComponent(s),f=u?.get("type"),d=a?mie(e,s):l.name,h=o+DZe,p=`${o}${IZe}.${s}`,g=!a||!u?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${u.get("exponent")??1}`:f==="symlog"?`, ${u.get("constant")??1}`:"":"",v=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?v:`clampRange(${v}, 0, ${c})`})}const Dw="_store",yv="_tuple",amn="_modify",LZe="vlSelectionResolve",B8=[Ign,Bgn,Mgn,kZe,PZe,Zm,MZe,rmn,omn,smn,TZe];function lmn(e){let t=e.parent;for(;t&&!Du(t);)t=t.parent;return t}function H1(e,{escape:t}={escape:!0}){let n=t?Tt(e.name):e.name;const r=lmn(e);if(r){const{facet:i}=r;for(const o of kf)i[o]&&(n+=` + '__facet_${o}_' + (facet[${Tt(r.vgField(o))}])`)}return n}function yge(e){return vs(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function FZe(e,t){(Kt(t.select)||!t.select.on)&&delete e.events,(Kt(t.select)||!t.select.clear)&&delete e.clear,(Kt(t.select)||!t.select.toggle)&&delete e.toggle}function Xp(e){return e.events?.find(t=>"type"in t&&t.type==="timer")}function yie(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...yie(e.object)),t.push(...yie(e.property))),t)}function $Ze(e){return e.object.type==="MemberExpression"?$Ze(e.object):e.object.name==="datum"}function NZe(e){const t=Lhe(e),n=new Set;return t.visit(r=>{r.type==="MemberExpression"&&$Ze(r)&&n.add(yie(r).slice(1).join("."))}),n}class fP extends Ti{model;filter;expr;_dependentFields;clone(){return new fP(null,this.model,Un(this.filter))}constructor(t,n,r){super(t),this.model=n,this.filter=r,this.expr=s4(this.model,this.filter,this),this._dependentFields=NZe(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function cmn(e,t){const n={},r=e.config.selection;if(!t||!t.length)return n;let i=0;for(const o of t){const s=xo(o.name),a=o.select,l=Kt(a)?a:a.type,c=Ht(a)?Un(a):{type:l},u=r[l];for(const h in u)h==="fields"||h==="encodings"||(h==="mark"&&(c.mark={...u.mark,...c.mark}),(c[h]===void 0||c[h]===!0)&&(c[h]=Un(u[h]??c[h])));const f=n[s]={...c,name:s,type:l,init:o.value,bind:o.bind,events:Kt(c.on)?Lb(c.on,"scope"):Vt(Un(c.on))};if(Xp(f)&&(i++,i>1)){delete n[s];continue}const d=Un(o);for(const h of B8)h.defined(f)&&h.parse&&h.parse(e,f,d)}return i>1&&Et(Pfn),n}function zZe(e,t,n,r="datum"){const i=Kt(t)?t:t.param,o=xo(i),s=Tt(o+Dw);let a;try{a=e.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",c=a.resolve==="global"?")":`, ${Tt(a.resolve)})`,u=`${l}${s}, ${r}${c}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${u}`:`!${f} || ${u}`}function jZe(e,t,n){const r=xo(t),i=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(r,t)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&Et(kfn(o));else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,Et(Mfn(a,i,n,o))):o=a[0].field}return`${s.name}[${Tt(td(o))}]`}function umn(e,t){for(const[n,r]of ab(e.component.selection??{})){const i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new Rc(new fP(t,e,{param:n}),i,Ao.Lookup,e.component.data.outputNodeRefCounts)}}function s4(e,t,n){return lA(t,r=>Kt(r)?r:zdn(r)?zZe(e,r,n):YQe(r))}function fmn(e,t){if(e)return lt(e)&&!Jy(e)?e.map(n=>Zpe(n,t)).join(", "):e}function bX(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function CM(e,t,n,r={header:!1}){const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:c,...u}=e.combine();if(!i){for(const f in u){const d=f,h=Vhn[d],p=u[d];if(h&&h!==t&&h!=="both")delete u[d];else if(ML(p)){const{condition:g,...m}=p,v=Vt(g),y=xPe[d];if(y){const{vgProp:b,part:w}=y,S=[...v.map(_=>{const{test:E,...T}=_;return{test:s4(null,E),...T}}),m];bX(u,w,b,S),delete u[d]}else if(y===null){const b={signal:v.map(w=>{const{test:S,..._}=w;return`${s4(null,S)} ? ${iPe(_)} : `}).join("")+iPe(m)};u[d]=b}}else if(hn(p)){const g=xPe[d];if(g){const{vgProp:m,part:v}=g;bX(u,v,m,p),delete u[d]}}vr(["labelAlign","labelBaseline"],d)&&u[d]===null&&delete u[d]}if(t==="grid"){if(!u.grid)return;if(u.encode){const{grid:f}=u.encode;u.encode={...f?{grid:f}:{}},Vi(u.encode)&&delete u.encode}return{scale:s,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:es(c,0)}}else{if(!r.header&&e.mainExtracted)return;if(a!==void 0){let d=a;u.encode?.labels?.update&&hn(u.encode.labels.update.text)&&(d=Ew(a,"datum.label",u.encode.labels.update.text.signal)),bX(u,"labels","text",{signal:d})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(const d of OKe)e.hasAxisPart(d)||delete u.encode[d];Vi(u.encode)&&delete u.encode}const f=fmn(l,n);return{scale:s,orient:o,grid:!1,...f?{title:f}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:es(c,0)}}}}function BZe(e){const{axes:t}=e.component,n=[];for(const r of Nv)if(t[r]){for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function dmn(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(i=>CM(i,"grid",t)),...r.map(i=>CM(i,"grid",t)),...n.map(i=>CM(i,"main",t)),...r.map(i=>CM(i,"main",t))].filter(i=>i)}function qPe(e,t,n,r){return Object.assign.apply(null,[{},...e.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...wt(s),...wt(a)]),c={};for(const u of l.values())c[u]={signal:`${r.signal} === "${o}" ? ${nh(s[u])} : ${nh(a[u])}`};return c}return t[i]})])}function hmn(e,t,n,r){const i=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:ZQe(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=hn(n)?"axisOrient":`axis${bL(n)}`,a=[...i,...i.map(c=>o+c.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:qPe(a,r,e,n),vgAxisConfig:qPe(l,r,e,n),axisConfigStyle:pmn([...l,...a],r)}}function pmn(e,t){const n=[{}];for(const r of e){let i=t[r]?.style;if(i){i=Vt(i);for(const o of i)n.push(t.style[o])}}return Object.assign.apply(null,n)}function bie(e,t,n,r={}){const i=TQe(e,n,t);if(i!==void 0)return{configFrom:"style",configValue:i};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(r[o]?.[e]!==void 0)return{configFrom:o,configValue:r[o][e]};return{}}const XPe={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??gmn(n,e),gridScale:({model:e,channel:t})=>mmn(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||VZe(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||UZe(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??ymn(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??bmn(t.type,n,Ot(t)&&!!t.timeUnit,Ot(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??wmn({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??Smn({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const r=WZe(t,n);if(r!==void 0)return r;const i=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return kQe(i?[yPe(i)]:[],Ot(s)?[yPe(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>_mn(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Cmn(n,t)};function gmn(e,t){return!la(e)&&Ot(t)&&!Ji(t?.bin)&&!wa(t?.bin)}function mmn(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function vmn(e,t,n,r,i){const o=t?.labelAngle;if(o!==void 0)return hn(o)?o:kR(o);{const{configValue:s}=bie("labelAngle",r,t?.style,i);return s!==void 0?kR(s):n===_o&&vr([jpe,zpe],e.type)&&!(Ot(e)&&e.timeUnit)?270:void 0}}function xie(e){return`(((${e.signal} % 360) + 360) % 360)`}function UZe(e,t,n,r){if(e!==void 0)if(n==="x"){if(hn(e)){const i=xie(e),o=hn(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45{if(RS(r)&&pKe(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((c,u)=>`${YQe({field:o,timeUnit:s,equal:c})} ? ${u} : `).join("")+a.length;t=new IE(t,{calculate:l,as:DE(r,i,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Or(this.transform)}`}}function DE(e,t,n){return It(e,{prefix:t,suffix:"sort_index",...n})}function U8(e,t){return vr(["top","bottom"],t)?"column":vr(["left","right"],t)||e==="row"?"row":"column"}function LE(e,t,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return es((t||{})[e],i[e],n.header[e])}function V8(e,t,n,r){const i={};for(const o of e){const s=LE(o,t||{},n,r);s!==void 0&&(i[o]=s)}return i}const bge=["row","column"],xge=["header","footer"];function Omn(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=V8(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),l=U8(t,a),c=kR(s);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...GZe(c,l),...HZe(l,c,o),...qZe(r,i,t,fpn,VKe)}}}function HZe(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=VZe(t,e==="row"?"left":"top",e==="row"?"y":"x");return r?{align:r}:{}}function GZe(e,t){const n=UZe(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Emn(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of xge)if(n[i])for(const o of n[i]){const s=Pmn(e,t,i,n,o);s!=null&&r.push(s)}return r}function Tmn(e,t){const{sort:n}=e;return Km(n)?{field:It(n,{expr:"datum"}),order:n.order??"ascending"}:lt(n)?{field:DE(e,t,{expr:"datum"}),order:"ascending"}:{field:It(e,{expr:"datum"}),order:n??"ascending"}}function wie(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=V8(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),c=Xpe({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,u=U8(t,a);return{text:{signal:l?Ew(Ew(l,"datum.label",c),"datum.value",It(e,{expr:"parent"})):c},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...GZe(o,u),...HZe(u,o,s),...qZe(n,e,t,dpn,WKe)}}function Pmn(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=e.config?e.config:void 0;if(s&&i.labels){const{labelOrient:f}=V8(["labelOrient"],s.header,a,t);(t==="row"&&!vr(["top","bottom"],f)||t==="column"&&!vr(["left","right"],f))&&(o=wie(s,t,a))}const l=Du(e)&&!EL(e.facet),c=i.axes,u=c?.length>0;if(o||u){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Tmn(s,t)}:{},...u&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const kmn={column:{start:0,end:1},row:{start:1,end:0}};function Mmn(e,t){return kmn[t][e]}function Amn(e,t){const n={};for(const r of kf){const i=e[r];if(i?.facetFieldDef){const{titleAnchor:o,titleOrient:s}=V8(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=U8(r,s),l=Mmn(o,a);l!==void 0&&(n[a]=l)}}return Vi(n)?void 0:n}function qZe(e,t,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=LE(s,t?.header,e,n);a!==void 0&&(o[i[s]]=a)}return o}function wge(e){return[...RN(e,"width"),...RN(e,"height"),...RN(e,"childWidth"),...RN(e,"childHeight")]}function RN(e,t){const n=t==="width"?"x":"y",r=e.component.layoutSize.get(t);if(r==null||r==="merged")return[];const i=e.getSizeSignalRef(t).signal;if(r==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(la(s)&&kS(a)){const l=e.scaleName(n);return Du(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[YPe(l,a)]:[YPe(l,a),{name:i,update:XZe(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=uie(e.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function YPe(e,t){const n=`${e}_step`;return hn(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function XZe(e,t,n){const r=t.get("type"),i=t.get("padding"),o=es(t.get("paddingOuter"),i);let s=t.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${nh(s)}, ${nh(o)}) * ${e}_step`}function YZe(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function QZe(e,t){return wt(e).reduce((n,r)=>({...n,...uP({model:t,channelDef:e[r],vgChannel:r,mainRefFn:i=>lo(i.value),invalidValueRef:void 0})}),{})}function KZe(e,t){if(Du(t))return e==="theta"?"independent":"shared";if(pP(t))return"shared";if(Pge(t))return ts(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Sge(e,t){const n=e.scale[t],r=ts(t)?"axis":"legend";return n==="independent"?(e[r][t]==="shared"&&Et(adn(t)),"independent"):e[r][t]||"shared"}const Rmn={...gpn,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},ZZe=wt(Rmn);class Imn extends jv{}const QPe={symbols:Dmn,gradient:Lmn,labels:Fmn,entries:$mn};function Dmn(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:c}=n,u=s.filled&&c!=="trail";let f={...gfn({},n,fhn),...CZe(n,{filled:u})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?JZe(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||u&&r===Uc)delete f.fill;else if(_t(f.fill,"field"))h?delete f.fill:(f.fill=lo(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=lo(g??1));else if(lt(f.fill)){const m=Sie(a.fill??a.color)??s.fill??(u&&s.color);m&&(f.fill=lo(m))}}if(f.stroke){if(r==="stroke"||!u&&r===Uc)delete f.stroke;else if(_t(f.stroke,"field")||p)delete f.stroke;else if(lt(f.stroke)){const m=es(Sie(a.stroke||a.color),s.stroke,u?s.color:void 0);m&&(f.stroke={value:m})}}if(r!==$v){const m=Ot(t)&&tJe(n,i,t);m?f.opacity=[{test:m,...lo(g??1)},lo(l.legend.unselectedOpacity)]:g&&(f.opacity=lo(g))}return f={...f,...e},Vi(f)?void 0:f}function Lmn(e,{model:t,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=t;let a={};const c=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?JZe(s.opacity)||o.opacity:void 0;return c&&(a.opacity=lo(c)),a={...a,...e},Vi(a)?void 0:a}function Fmn(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=Ot(t)?tJe(n,i,t):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:u}=o;let f;Rw(u)?f=rh({fieldOrDatumDef:t,field:"datum.value",format:c,formatType:u,config:s}):c===void 0&&u===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=rh({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&Ot(t)&&t.timeUnit===void 0&&(f=rh({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return Vi(d)?void 0:d}function $mn(e,{legendCmpt:t}){return t.get("selections")?.length?{...e,fill:{value:"transparent"}}:e}function JZe(e){return eJe(e,(t,n)=>Math.max(t,n.value))}function Sie(e){return eJe(e,(t,n)=>es(t,n.value))}function eJe(e,t){if(Ahn(e))return Vt(e.condition).reduce(t,e.value);if(wh(e))return e.value}function tJe(e,t,n){const r=t.get("selections");if(!r?.length)return;const i=Tt(n.field);return r.map(o=>`(!length(data(${Tt(xo(o)+Dw)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const KPe={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return fKe(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return dKe(r,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??Wmn(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??Hmn(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??zmn(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>wO(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(xO(n)&&Tp(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>Nmn(t,e)};function Nmn(e,t){const n=e.values;if(lt(n))return CKe(t,n);if(hn(n))return n}function zmn(e,t,n,r){if(t!=="shape"){const i=Sie(n)??r;if(i)return i}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function jmn(e){const{legend:t}=e;return es(t.type,Bmn(e))}function Bmn({channel:e,timeUnit:t,scaleType:n}){if(xO(e)){if(vr(["quarter","month","day"],t))return"symbol";if(Tp(n))return"gradient"}return"symbol"}function Umn({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?"gradientDirection":"symbolDirection"]??Vmn(n,t)}function Vmn(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function Wmn({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(Tp(i))return n==="horizontal"?r==="top"||r==="bottom"?ZPe(t,"width",s,o):s:ZPe(t,"height",l,a)}function ZPe(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function Hmn(e){if(vr(["quantile","threshold","log","symlog"],e))return"greedy"}function nJe(e){const t=Po(e)?Gmn(e):Qmn(e);return e.component.legends=t,t}function Gmn(e){const{encoding:t}=e,n={};for(const r of[Uc,...GKe]){const i=Ls(t[r]);!i||!e.getScaleComponent(r)||r===Vc&&Ot(i)&&i.type===cP||(n[r]=Ymn(e,r))}return n}function qmn(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function Xmn(e,t,n,r){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===r?.title)return!0}return e===(n||{})[t]}function Ymn(e,t){let n=e.legend(t);const{markDef:r,encoding:i,config:o}=e,s=o.legend,a=new Imn({},qmn(e,t));imn(e,t,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const c=e.getScaleComponent(t).get("type"),u=Ls(i[t]),f=Ot(u)?sa(u.timeUnit)?.unit:void 0,d=n.orient||o.legend.orient||"right",h=jmn({legend:n,channel:t,timeUnit:f,scaleType:c}),p=Umn({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:s,config:o,scaleType:c,orient:d,legendType:h,direction:p};for(const w of ZZe){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const S=w in KPe?KPe[w](g):n[w];if(S!==void 0){const _=Xmn(S,w,n,e.fieldDef(t));(_||o.legend[w]===void 0)&&a.set(w,S,_)}}const m=n?.encoding??{},v=a.get("selections"),y={},b={fieldOrDatumDef:u,model:e,channel:t,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const S=QZe(m[w]??{},e),_=w in QPe?QPe[w](S,b):S;_!==void 0&&!Vi(_)&&(y[w]={...v?.length&&Ot(u)?{name:`${xo(u.field)}_legend_${w}`}:{},...v?.length?{interactive:!0}:{},update:v?.length?{..._,cursor:{value:"pointer"}}:_})}return Vi(y)||a.set("encode",y,!!n?.encoding),a}function Qmn(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){nJe(r);for(const i of wt(r.component.legends))n.legend[i]=Sge(e.component.resolve,i),n.legend[i]==="shared"&&(t[i]=rJe(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of wt(t))for(const i of e.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return t}function rJe(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const o of ZZe){const s=ub(e.getWithExplicit(o),t.getWithExplicit(o),o,"legend",(a,l)=>{switch(o){case"symbolType":return Kmn(a,l);case"title":return AQe(a,l);case"type":return i=!0,uu("symbol")}return N8(a,l,o,"legend")});e.setWithExplicit(o,s)}return i&&(e.implicit?.encode?.gradient&&XB(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&XB(e.explicit,["encode","gradient"])),e}function Kmn(e,t){return t.value==="circle"?t:e}function Zmn(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function iJe(e){const t=e.component.legends,n={};for(const i of wt(t)){const o=e.getScaleComponent(i),s=yi(o.get("domains"));if(n[s])for(const a of n[s])rJe(a,t[i])||n[s].push(t[i]);else n[s]=[t[i].clone()]}return vs(n).flat().map(i=>Jmn(i,e.config)).filter(i=>i!==void 0)}function Jmn(e,t){const{disable:n,labelExpr:r,selections:i,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),o.encode?.symbols){const s=o.encode.symbols.update;s.fill&&s.fill.value!=="transparent"&&!s.stroke&&!o.stroke&&(s.stroke={value:"transparent"});for(const a of GKe)o[a]&&delete s[a]}if(o.title||delete o.title,r!==void 0){let s=r;o.encode?.labels?.update&&hn(o.encode.labels.update.text)&&(s=Ew(r,"datum.label",o.encode.labels.update.text.signal)),Zmn(o,"labels","text",{signal:s})}return o}}function evn(e){return pP(e)||Pge(e)?tvn(e):oJe(e)}function tvn(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),oJe(e))}function oJe(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const l=hn(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return vr(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const nvn=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class sJe extends jv{specifiedProjection;size;data;merged=!1;constructor(t,n,r,i){super({...n},{name:t}),this.specifiedProjection=n,this.size=r,this.data=i}get isFit(){return!!this.data}}function aJe(e){e.component.projection=Po(e)?rvn(e):svn(e)}function rvn(e){if(e.hasProjection){const t=_a(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),r=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,i=n?ivn(e):void 0,o=new sJe(e.projectionName(!0),{..._a(e.config.projection),...t},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function ivn(e){const t=[],{encoding:n}=e;for(const r of[[$h,Fh],[nd,Nh]])(Ls(n[r[0]])||Ls(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Vc)&&e.typedFieldDef(Vc).type===cP&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ao.Main)),t}function ovn(e,t){const n=fpe(nvn,i=>!!(!Yt(e.explicit,i)&&!Yt(t.explicit,i)||Yt(e.explicit,i)&&Yt(t.explicit,i)&&Ou(e.get(i),t.get(i))));if(Ou(e.size,t.size)){if(n)return e;if(Ou(e.explicit,{}))return t;if(Ou(t.explicit,{}))return e}return null}function svn(e){if(e.children.length===0)return;let t;for(const r of e.children)aJe(r);const n=fpe(e.children,r=>{const i=r.component.projection;if(i)if(t){const o=ovn(t,i);return o&&(t=o),!!o}else return t=i,!0;else return!0});if(t&&n){const r=e.projectionName(!0),i=new sJe(r,t.specifiedProjection,t.size,Un(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function avn(e,t,n,r){if(kL(t,n)){const i=Po(e)?e.axis(n)??e.legend(n)??{}:{},o=It(t,{expr:"datum"}),s=It(t,{expr:"datum",binSuffix:"end"});return{formulaAs:It(t,{binSuffix:"range",forAs:!0}),formula:OL(o,s,i.format,i.formatType,r)}}return{}}function lJe(e,t){return`${_Qe(e)}_${t}`}function lvn(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function _ge(e,t,n){const r=R8(n,void 0)??{},i=lJe(r,t);return e.getName(`${i}_bins`)}function cvn(e){return"as"in e}function JPe(e,t,n){let r,i;cvn(e)?r=Kt(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:r=[It(e,{forAs:!0}),It(e,{binSuffix:"end",forAs:!0})];const o={...R8(t,void 0)},s=lJe(o,e.field),{signal:a,extentSignal:l}=lvn(n,s);if(w8(o.extent)){const u=o.extent;i=jZe(n,u.param,u),delete o.extent}const c={bin:o,field:e.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:c}}class Yp extends Ti{bins;clone(){return new Yp(null,Un(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{if(Kl(o)&&Ji(o.bin)){const{key:a,binComponent:l}=JPe(o,o.bin,n);i[a]={...l,...i[a],...avn(n,o,s,n.config)}}return i},{});return Vi(r)?null:new Yp(t,r)}static makeFromTransform(t,n,r){const{key:i,binComponent:o}=JPe(n,n.bin,r);return new Yp(t,{[i]:o})}merge(t,n){for(const r of wt(t.bins))r in this.bins?(n(t.bins[r].signal,this.bins[r].signal),this.bins[r].as=Ep([...this.bins[r].as,...t.bins[r].as],Or)):this.bins[r]=t.bins[r];for(const r of t.children)t.removeChild(r),r.parent=this;t.remove()}producedFields(){return new Set(vs(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(vs(this.bins).map(t=>t.field))}hash(){return`Bin ${Or(this.bins)}`}assemble(){return vs(this.bins).flatMap(t=>{const n=[],[r,...i]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:td(t.field),as:r,signal:t.signal,...w8(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:td(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const l of i)for(let c=0;c<2;c++)n.push({type:"formula",expr:It({field:r[c]},{expr:"datum"}),as:l[c]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function uvn(e,t,n,r){const i=Po(r)?r.encoding[Pg(t)]:void 0;if(Kl(n)&&Po(r)&&mKe(n,i,r.markDef,r.config)){e.add(It(n,{})),e.add(It(n,{suffix:"end"}));const{mark:o,markDef:s,config:a}=r,l=cb({fieldDef:n,markDef:s,config:a});MR(o)&&l!==.5&&ts(t)&&(e.add(It(n,{suffix:z8})),e.add(It(n,{suffix:j8}))),n.bin&&kL(n,t)&&e.add(It(n,{binSuffix:"range"}))}else if(pQe(t)){const o=hQe(t);e.add(r.getName(o))}else e.add(It(n));return RS(n)&&Zdn(n.scale?.range)&&e.add(n.scale.range.field),e}function fvn(e,t){for(const n of wt(t)){const r=t[n];for(const i of wt(r))n in e?e[n][i]=new Set([...e[n][i]??[],...r[i]]):e[n]={[i]:r[i]}}}class uh extends Ti{dimensions;measures;clone(){return new uh(null,new Set(this.dimensions),Un(this.measures))}constructor(t,n,r){super(t),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:c}=s;if(l)if(l==="count")i["*"]??={},i["*"].count=new Set([It(s,{forAs:!0})]);else{if(mv(l)||Ub(l)){const u=mv(l)?"argmin":"argmax",f=l[u];i[f]??={},i[f][u]=new Set([It({op:u,field:f},{forAs:!0})])}else i[c]??={},i[c][l]=new Set([It(s,{forAs:!0})]);kg(a)&&n.scaleDomain(a)==="unaggregated"&&(i[c]??={},i[c].min=new Set([It({field:c,aggregate:"min"},{forAs:!0})]),i[c].max=new Set([It({field:c,aggregate:"max"},{forAs:!0})]))}else uvn(o,a,s,n)}),o.size+wt(i).length===0)?null:new uh(t,o,i)}static makeFromTransform(t,n){const r=new Set,i={};for(const o of n.aggregate){const{op:s,field:a,as:l}=o;s&&(s==="count"?(i["*"]??={},i["*"].count=new Set([l||It(o,{forAs:!0})])):(i[a]??={},i[a][s]??=new Set,i[a][s].add(l||It(o,{forAs:!0}))))}for(const o of n.groupby??[])r.add(o);return r.size+wt(i).length===0?null:new uh(t,r,i)}merge(t){return iQe(this.dimensions,t.dimensions)?(fvn(this.measures,t.measures),!0):(_dn("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...wt(this.measures)])}producedFields(){const t=new Set;for(const n of wt(this.measures))for(const r of wt(this.measures[n])){const i=this.measures[n][r];i.size===0?t.add(`${r}_${n}`):i.forEach(t.add,t)}return t}hash(){return`Aggregate ${Or({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],r=[];for(const o of wt(this.measures))for(const s of wt(this.measures[o]))for(const a of this.measures[o][s])r.push(a),t.push(s),n.push(o==="*"?null:td(o));return{type:"aggregate",groupby:[...this.dimensions].map(td),ops:t,fields:n,as:r}}}class dP extends Ti{model;name;data;column;row;facet;childModel;constructor(t,n,r,i){super(t),this.model=n,this.name=r,this.data=i;for(const o of kf){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[It(s),...Ji(a)?[It(s,{binSuffix:"end"})]:[]],...Km(l)?{sortField:l}:lt(l)?{sortIndexField:DE(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of kf)this[n]&&(t+=` ${n.charAt(0)}:${Or(this[n])}`);return t}get fields(){const t=[];for(const n of kf)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of kf)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of Nv){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if(la(i)&&kS(o)){const s=W8(this.childModel,n),a=Tge(s);a?t[n]=a:Et(Ope(n))}}}return t}assembleRowColumnHeaderData(t,n,r){const i={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:c}=this[t];if(l){const{op:u=k8,field:f}=l;o.push(f),s.push(u),a.push(It(l,{forAs:!0}))}else c&&(o.push(c),s.push("max"),a.push(c));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const l of bge){for(const c of xge){const u=r[l]?.[c]??[];for(const f of u)if(f.axes?.length>0){o[l]=!0;break}}if(o[l]){const c=`length(data("${this.facet.name}"))`,u=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};i.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:u}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){const t=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[Qm,Ym])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&t.push(...a)}return t}}function eke(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function dvn(e,t){const n=ppe(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const r=eke(t.slice(5,t.length));return`timeParse(${n},'${r}')`}else if(t.startsWith("utc:")){const r=eke(t.slice(4,t.length));return`utcParse(${n},'${r}')`}else return Et(Rfn(t)),null}function hvn(e){const t={};return l5(e.filter,n=>{if(XQe(n)){let r=null;Ape(n)?r=wu(n.equal):Ipe(n)?r=wu(n.lte):Rpe(n)?r=wu(n.lt):Dpe(n)?r=wu(n.gt):Lpe(n)?r=wu(n.gte):Fpe(n)?r=n.range[0]:$pe(n)&&(r=(n.oneOf??n.in)[0]),r&&(MS(r)?t[n.field]="date":Qr(r)?t[n.field]="number":Kt(r)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function pvn(e){const t={};function n(r){ME(r)?t[r.field]="date":r.type==="quantitative"&&ofn(r.aggregate)?t[r.field]="number":CE(r.field)>1?r.field in t||(t[r.field]="flatten"):RS(r)&&Km(r.sort)&&CE(r.sort.field)>1&&(r.sort.field in t||(t[r.sort.field]="flatten"))}if((Po(e)||Du(e))&&e.forEachFieldDef((r,i)=>{if(Kl(r))n(r);else{const o=TS(i),s=e.fieldDef(o);n({...r,type:s.type})}}),Po(e)){const{mark:r,markDef:i,encoding:o}=e;if(Vb(r)&&!e.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];Ot(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function gvn(e){const t={};if(Po(e)&&e.component.selection)for(const n of wt(e.component.selection)){const r=e.component.selection[n];for(const i of r.project.items)!i.channel&&CE(i.field)>1&&(t[i.field]="flatten")}return t}class fl extends Ti{_parse;clone(){return new fl(null,Un(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${Or(this._parse)}`}static makeExplicit(t,n,r){let i={};const o=n.data;return!z0(o)&&o?.format?.parse&&(i=o.format.parse),this.makeWithAncestors(t,i,{},r)}static makeWithAncestors(t,n,r,i){for(const a of wt(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:Et(uPe(a,r[a],l.value)))}for(const a of wt(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:Et(uPe(a,n[a],l)))}const o=new jv(n,r);i.copyAll(o);const s={};for(const a of wt(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return wt(s).length===0||i.parseNothing?null:new fl(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of wt(this._parse)){const r=this._parse[n];CE(n)===1&&(t[n]=r)}return t}producedFields(){return new Set(wt(this._parse))}dependentFields(){return new Set(wt(this._parse))}assembleTransforms(t=!1){return wt(this._parse).filter(n=>t?CE(n)>1:!0).map(n=>{const r=dvn(n,this._parse[n]);return r?{type:"formula",expr:r,as:aP(n)}:null}).filter(n=>n!==null)}}class fb extends Ti{clone(){return new fb(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([_h])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:_h}}}class RL extends Ti{params;clone(){return new RL(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Or(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class IL extends Ti{params;clone(){return new IL(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Or(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Lw extends Ti{_data;_name;_generator;constructor(t){super(null),t??={name:"source"};let n;if(z0(t)||(n=t.format?{...Iu(t.format,["parse"])}:{}),AR(t))this._data={values:t.values};else if(AE(t)){if(this._data={url:t.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(t.url)[1];vr(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else fZe(t)?this._data={values:[{type:"Sphere"}]}:(cZe(t)||z0(t))&&(this._data={});this._generator=z0(t),t.name&&(this._name=t.name),n&&!Vi(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}function Cge(e){return e instanceof Lw||e instanceof RL||e instanceof IL}class Oge{#e;constructor(){this.#e=!1}setModified(){this.#e=!0}get modifiedFlag(){return this.#e}}class IS extends Oge{getNodeDepths(t,n,r){r.set(t,n);for(const i of t.children)this.getNodeDepths(i,n+1,r);return r}optimize(t){const r=[...this.getNodeDepths(t,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class Ege extends Oge{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class mvn extends Ege{mergeNodes(t,n){const r=n.shift();for(const i of n)t.removeChild(i),i.parent=r,i.remove()}run(t){const n=t.children.map(i=>i.hash()),r={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(t,r[i]))}}class vvn extends Ege{requiresSelectionId;constructor(t){super(),this.requiresSelectionId=t&&yge(t)}run(t){t instanceof fb&&(this.requiresSelectionId&&(Cge(t.parent)||t.parent instanceof uh||t.parent instanceof fl)||(this.setModified(),t.remove()))}}class yvn extends Oge{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let r=new Set;t instanceof qp&&(r=t.producedFields(),dpe(r,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const i of t.children)this.run(i,new Set([...n,...r]))}}class bvn extends Ege{constructor(){super()}run(t){t instanceof Rc&&!t.isRequired()&&(this.setModified(),t.remove())}}class xvn extends IS{run(t){if(!Cge(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof fl)if(t instanceof fl)this.setModified(),t.merge(n);else{if(hpe(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class wvn extends IS{run(t){const n=[...t.children],r=t.children.filter(i=>i instanceof fl);if(t.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of wt(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Vi(i)){this.setModified();const s=new fl(t,i);for(const a of n){if(a instanceof fl)for(const l of wt(i))delete a.parse[l];t.removeChild(a),a.parent=s,a instanceof fl&&wt(a.parse).length===0&&a.remove()}}}}}class Svn extends IS{run(t){t instanceof Rc||t.numChildren()>0||t instanceof dP||t instanceof Lw||(this.setModified(),t.remove())}}class _vn extends IS{run(t){const n=t.children.filter(i=>i instanceof qp),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class Cvn extends IS{run(t){const n=t.children.filter(i=>i instanceof uh),r={};for(const i of n){const o=Or(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of wt(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class Ovn extends IS{model;constructor(t){super(),this.model=t}run(t){const n=!(Cge(t)||t instanceof fP||t instanceof fl||t instanceof fb),r=[],i=[];for(const o of t.children)o instanceof Yp&&(n&&!hpe(t.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Yp?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class Evn extends IS{run(t){const n=[...t.children];if(!_E(n,s=>s instanceof Rc)||t.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof Rc){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof Rc)a=l;else break}i.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class DS extends Ti{transform;clone(){return new DS(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Ep(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??It(t)}hash(){return`JoinAggregateTransform ${Or(this.transform)}`}assemble(){const t=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:t,...i!==void 0?{groupby:i}:{}}}}class FE extends Ti{filter;clone(){return new FE(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,r){const{config:i,markDef:o}=n,{marks:s,scales:a}=r;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const l=n.reduceFieldDef((c,u,f)=>{const d=kg(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=u,g=Hpe({scaleChannel:f,markDef:o,config:i,scaleType:h,isCountAggregate:x8(p)});g!=="show"&&g!=="always-valid"&&(c[u.field]=u)}return c},{});return wt(l).length?new FE(t,l):null}dependentFields(){return new Set(wt(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Or(this.filter)}`}assemble(){const t=wt(this.filter).reduce((n,r)=>{const i=this.filter[r],o=It(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (${_ie(o)}))`):i.type==="quantitative"&&n.push(_ie(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function _ie(e){return`isValid(${e}) && isFinite(+${e})`}function Tvn(e){return e.stack.stackBy.reduce((t,n)=>{const r=n.fieldDef,i=It(r);return i&&t.push(i),t},[])}function Pvn(e){return lt(e)&&e.every(t=>Kt(t))&&e.length>1}class Jm extends Ti{_stack;clone(){return new Jm(null,Un(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(es(f.order,"ascending"));const c={field:a,order:l};let u;return Pvn(o)?u=o:Kt(o)?u=[o,`${o}_end`]:u=[`${n.stack}_start`,`${n.stack}_end`],new Jm(t,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:c,facetby:[],as:u})}static makeFromEncoding(t,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,c=o.map(h=>{const p=i[h];return Sh(p)}).filter(h=>!!h),u=Tvn(n),f=n.encoding.order;let d;if(lt(f)||Ot(f))d=PQe(f);else{const h=vKe(f)?f.sort:s==="y"?"descending":"ascending";d=u.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new Jm(t,{dimensionFieldDefs:c,stackField:n.vgField(s),facetby:[],stackby:u,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Or(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:r}=this._stack;return t.length>0?t.map(i=>i.bin?n?[It(i,{binSuffix:"mid"})]:[It(i,{}),It(i,{binSuffix:"end"})]:[It(i)]).flat():r??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:c}=this._stack;if(l)for(const u of r){const{bandPosition:f=.5,bin:d}=u;if(d){const h=It(u,{expr:"datum"}),p=It(u,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${_ie(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:It(u,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...o,...n],key:It(u,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:c,offset:a}),t}}class hP extends Ti{transform;clone(){return new hP(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Ep(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??It(t)}hash(){return`WindowTransform ${Or(this.transform)}`}assemble(){const t=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>_pe(f)))return{type:"joinaggregate",as:r,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const c={field:a,order:l},u=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:t,sort:c,...u!==void 0?{ignorePeers:u}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function kvn(e){function t(n){if(!(n instanceof dP)){const r=n.clone();if(r instanceof Rc){const i=Oie+r.getSource();r.setSource(i),e.model.component.data.outputNodes[i]=r}else(r instanceof uh||r instanceof Jm||r instanceof hP||r instanceof DS)&&r.addDimensions(e.fields);for(const i of n.children.flatMap(t))i.parent=r;return[r]}return n.children.flatMap(t)}return t}function Cie(e){if(e instanceof dP)if(e.numChildren()===1&&!(e.children[0]instanceof Rc)){const t=e.children[0];(t instanceof uh||t instanceof Jm||t instanceof hP||t instanceof DS)&&t.addDimensions(e.fields),t.swapWithParent(),Cie(e)}else{const t=e.model.component.data.main;cJe(t);const n=kvn(e),r=e.children.map(n).flat();for(const i of r)i.parent=t}else e.children.map(Cie)}function cJe(e){if(e instanceof Rc&&e.type===Ao.Main&&e.numChildren()===1){const t=e.children[0];t instanceof dP||(t.swapWithParent(),cJe(e))}}const Oie="scale_",IN=5;function Eie(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Eie(t.children))return!1}return!0}function Ed(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function tke(e,t,n){let r=e.sources,i=!1;return i=Ed(new bvn,r)||i,i=Ed(new vvn(t),r)||i,r=r.filter(o=>o.numChildren()>0),i=Ed(new Svn,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Ed(new xvn,r)||i,i=Ed(new Ovn(t),r)||i,i=Ed(new yvn,r)||i,i=Ed(new wvn,r)||i,i=Ed(new Cvn,r)||i,i=Ed(new _vn,r)||i,i=Ed(new mvn,r)||i,i=Ed(new Evn,r)||i),e.sources=r,i}function Mvn(e,t){Eie(e.sources);let n=0,r=0;for(let i=0;it(n))}}function uJe(e){Po(e)?Avn(e):Rvn(e)}function Avn(e){const t=e.component.scales;for(const n of wt(t)){const r=Dvn(e,n);if(t[n].setWithExplicit("domains",r),Fvn(e,n),e.component.data.isFaceted){let o=e;for(;!Du(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)Nm(a)&&(a.data=Oie+a.data.replace(Oie,""))}}}function Rvn(e){for(const n of e.children)uJe(n);const t=e.component.scales;for(const n of wt(t)){let r,i=null;for(const o of e.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=ub(r,s.getWithExplicit("domains"),"domains","scale",Tie);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&Et(Ofn),i=a}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}function Ivn(e,t,n,r){if(e==="unaggregated"){const{valid:i,reason:o}=nke(t,n);if(!i){Et(o);return}}else if(e===void 0&&r.useUnaggregatedDomain){const{valid:i}=nke(t,n);if(i)return"unaggregated"}return e}function Dvn(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=Ivn(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:i}),t==="x"&&Ls(r.x2)?Ls(r.x)?ub($y(n,i,e,"x"),$y(n,i,e,"x2"),"domain","scale",Tie):$y(n,i,e,"x2"):t==="y"&&Ls(r.y2)?Ls(r.y)?ub($y(n,i,e,"y"),$y(n,i,e,"y2"),"domain","scale",Tie):$y(n,i,e,"y2"):$y(n,i,e,t)}function Lvn(e,t,n){return e.map(r=>({signal:`{data: ${I8(r,{timeUnit:n,type:t})}}`}))}function xX(e,t,n){const r=sa(n)?.unit;return t==="temporal"||r?Lvn(e,t,r):[e]}function $y(e,t,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,c=Ls(i[r]),{type:u}=c,f=c.timeUnit,d=Pgn({invalid:ag("invalid",o,a),isPath:Vb(s)});if(Kdn(t)){const g=$y(e,void 0,n,r),m=xX(t.unionWith,u,f);return op([...m,...g.value])}else{if(hn(t))return op([t]);if(t&&t!=="unaggregated"&&!eKe(t))return op(xX(t,u,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return uu([[0,1]]);const g=n.requestDataName(d);return uu([{data:g,field:n.vgField(r,{suffix:"start"})},{data:g,field:n.vgField(r,{suffix:"end"})}])}const h=kg(r)&&Ot(c)?$vn(n,r,e):void 0;if(Mg(c)){const g=xX([c.datum],u,f);return uu(g)}const p=c;if(t==="unaggregated"){const{field:g}=c;return uu([{data:n.requestDataName(d),field:It({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:It({field:g,aggregate:"max"})}])}else if(Ji(p.bin)){if(la(e))return uu(e==="bin-ordinal"?[]:[{data:PR(h)?n.requestDataName(d):n.requestDataName(Ao.Raw),field:n.vgField(r,kL(p,r)?{binSuffix:"range"}:{}),sort:h===!0||!Ht(h)?{field:n.vgField(r,{}),op:"min"}:h}]);{const{bin:g}=p;if(Ji(g)){const m=_ge(n,p.field,g);return uu([new Ys(()=>{const v=n.getSignalName(m);return`[${v}.start, ${v}.stop]`})])}else return uu([{data:n.requestDataName(d),field:n.vgField(r,{})}])}}else if(p.timeUnit&&vr(["time","utc"],e)){const g=i[Pg(r)];if(mKe(p,g,o,a)){const m=n.requestDataName(d),v=cb({fieldDef:p,fieldDef2:g,markDef:o,config:a}),y=MR(s)&&v!==.5&&ts(r);return uu([{data:m,field:n.vgField(r,y?{suffix:z8}:{})},{data:m,field:n.vgField(r,{suffix:y?j8:"end"})}])}}return uu(h?[{data:PR(h)?n.requestDataName(d):n.requestDataName(Ao.Raw),field:n.vgField(r),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(r)}])}function wX(e,t){const{op:n,field:r,order:i}=e;return{op:n??(t?"sum":k8),...r?{field:td(r)}:{},...i?{order:i}:{}}}function Fvn(e,t){const n=e.component.scales[t],r=e.specifiedScales[t].domain,i=e.fieldDef(t)?.bin,o=eKe(r)?r:void 0,s=PS(i)&&w8(i.extent)?i.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function $vn(e,t,n){if(!la(n))return;const r=e.fieldDef(t),i=r.sort;if(pKe(i))return{op:"min",field:DE(r,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(Km(i)){const a=o&&!s.has(i.field);return wX(i,a)}else if(Phn(i)){const{encoding:a,order:l}=i,c=e.fieldDef(a),{aggregate:u,field:f}=c,d=o&&!s.has(f);if(mv(u)||Ub(u))return wX({field:It(c),order:l},d);if(_pe(u)||!u)return wX({op:u,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(vr(["ascending",void 0],i))return!0}}function nke(e,t){const{aggregate:n,type:r}=e;return n?Kt(n)&&!afn.has(n)?{valid:!1,reason:edn(n)}:r==="quantitative"&&t==="log"?{valid:!1,reason:tdn(e)}:{valid:!0}:{valid:!1,reason:Jfn(e)}}function Tie(e,t,n,r){return e.explicit&&t.explicit&&Et(sdn(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Nvn(e){const t=Ep(e.map(s=>{if(Nm(s)){const{sort:a,...l}=s;return l}return s}),Or),n=Ep(e.map(s=>{if(Nm(s)){const a=s.sort;return a!==void 0&&!PR(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),Or);if(t.length===0)return;if(t.length===1){const s=e[0];if(Nm(s)&&n.length>0){let a=n[0];if(n.length>1){Et(dPe);const l=n.filter(c=>Ht(c)&&"op"in c&&c.op!=="min");n.every(c=>Ht(c)&&"op"in c)&&l.length===1?a=l[0]:a=!0}else if(Ht(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=Ep(n.map(s=>PR(s)||!("op"in s)||Kt(s.op)&&Yt(rfn,s.op)?s:(Et(ldn(s)),!0)),Or);let i;r.length===1?i=r[0]:r.length>1&&(Et(dPe),i=!0);const o=Ep(e.map(s=>Nm(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...i?{sort:i}:{}}:{fields:t,...i?{sort:i}:{}}}function Tge(e){if(Nm(e)&&Kt(e.field))return e.field;if(lfn(e)){let t;for(const n of e.fields)if(Nm(n)&&Kt(n.field)){if(!t)t=n.field;else if(t!==n.field)return Et(cdn),t}return Et(udn),t}else if(cfn(e)){Et(fdn);const t=e.fields[0];return Kt(t)?t:void 0}}function W8(e,t){const r=e.component.scales[t].get("domains").map(i=>(Nm(i)&&(i.data=e.lookupDataSource(i.data)),i));return Nvn(r)}function fJe(e){return pP(e)||Pge(e)?e.children.reduce((t,n)=>t.concat(fJe(n)),rke(e)):rke(e)}function rke(e){return wt(e.component.scales).reduce((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:c,reverse:u,...f}=i,d=zvn(i.range,o,n,e),h=W8(e,n),p=a?zgn(e,a,r,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...u!==void 0?{reverse:u}:{},...f}),t},[])}function zvn(e,t,n,r){if(ts(n)){if(kS(e))return{step:{signal:`${t}_step`}}}else if(Ht(e)&&Nm(e))return{...e,data:r.lookupDataSource(e.data)};return e}class dJe extends jv{merged=!1;constructor(t,n){super({},{name:t}),this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(vr([Oa.LOG,Oa.TIME,Oa.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&vr([Oa.LINEAR,Oa.SQRT,Oa.POW],t))return"definitely";const r=this.get("domains");if(r.length>0){let i=!1,o=!1,s=!1;for(const a of r){if(lt(a)){const l=a[0],c=a[a.length-1];if(Qr(l)&&Qr(c))if(l<=0&&c>=0){i=!0;continue}else{o=!0;continue}}s=!0}if(i)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const jvn=["range","scheme"];function Bvn(e){const t=e.component.scales;for(const n of Spe){const r=t[n];if(!r)continue;const i=Uvn(n,e);r.setWithExplicit("range",i)}}function ike(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:r,field:i}=n,o=Wc(t),s=e.getName(o);if(Ht(r)&&r.binned&&r.step!==void 0)return new Ys(()=>{const a=e.scaleName(t),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${e.getSignalName(s)} / (${l})`});if(Ji(r)){const a=_ge(e,i,r);return new Ys(()=>{const l=e.getSignalName(a),c=`(${l}.stop - ${l}.start) / ${l}.step`;return`${e.getSignalName(s)} / (${c})`})}}}function Uvn(e,t){const n=t.specifiedScales[e],{size:r}=t,o=t.getScaleComponent(e).get("type");for(const f of jvn)if(n[f]!==void 0){const d=aie(o,f),h=tKe(e,f);if(!d)Et(LQe(o,f,e));else if(h)Et(h);else switch(f){case"range":{const p=n.range;if(lt(p)){if(ts(e))return op(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),v=t.getSignalName.bind(t);return Ys.fromName(v,m)}return g}))}else if(Ht(p))return op({data:t.requestDataName(Ao.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return op(p)}case"scheme":return op(Vvn(n[f]))}}const s=e===_o||e==="xOffset"?"width":"height",a=r[s];if(cg(a)){if(ts(e))if(la(o)){const f=pJe(a,t,e);if(f)return op({step:f})}else Et(FQe(s));else if(SL(e)){const f=e===Fb?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=gJe(a,o);if(p)return op(p)}}}const{rangeMin:l,rangeMax:c}=n,u=Wvn(e,t);return(l!==void 0||c!==void 0)&&aie(o,"rangeMin")&<(u)&&u.length===2?op([l??u[0],c??u[1]]):uu(u)}function Vvn(e){return Qdn(e)?{scheme:e.name,...Iu(e,["name"])}:{scheme:e}}function hJe(e,t,n,{center:r}={}){const i=Wc(e),o=t.getName(i),s=t.getSignalName.bind(t);return e===ha&&xh(n)?r?[Ys.fromName(a=>`${s(a)}/2`,o),Ys.fromName(a=>`-${s(a)}/2`,o)]:[Ys.fromName(s,o),0]:r?[Ys.fromName(a=>`-${s(a)}/2`,o),Ys.fromName(a=>`${s(a)}/2`,o)]:[0,Ys.fromName(s,o)]}function Wvn(e,t){const{size:n,config:r,mark:i,encoding:o}=t,{type:s}=Ls(o[e]),l=t.getScaleComponent(e).get("type"),{domain:c,domainMid:u}=t.specifiedScales[e];switch(e){case _o:case ha:{if(vr(["point","band"],l)){const f=mJe(e,n,r.view);if(cg(f))return{step:pJe(f,t,e)}}return hJe(e,t,l)}case Fb:case lP:return Hvn(e,t,l);case Fv:{const f=Xvn(i,r),d=Yvn(i,n,t,r);return TE(l)?qvn(f,d,Gvn(l,r,c,e)):[f,d]}case hd:return[0,Math.PI*2];case ES:return[0,360];case Lh:return[0,new Ys(()=>{const f=t.getSignalName(Du(t.parent)?"child_width":"width"),d=t.getSignalName(Du(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case $b:return{step:1e3/r.scale.framesPerSecond};case jb:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case Bb:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Vc:return"symbol";case Uc:case Eg:case Tg:return l==="ordinal"?s==="nominal"?"category":"ordinal":u!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case $v:case Nb:case zb:return[r.scale.minOpacity,r.scale.maxOpacity]}}function pJe(e,t,n){const{encoding:r}=t,i=t.getScaleComponent(n),o=ype(n),s=r[o];if(XKe({step:e,offsetIsDiscrete:Hn(s)&&Npe(s.type)})==="offset"&&PKe(r,o)){const l=t.getScaleComponent(o);let u=`domain('${t.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;u=`bandspace(${u}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${e.step} * ${u} / (1-${pfn(f)})`}}else return e.step}function gJe(e,t){if(XKe({step:e,offsetIsDiscrete:la(t)})==="offset")return{step:e.step}}function Hvn(e,t,n){const r=e===Fb?"x":"y",i=t.getScaleComponent(r);if(!i)return hJe(r,t,n,{center:!0});const o=i.get("type"),s=t.scaleName(r),{markDef:a,config:l}=t;if(o==="band"){const c=mJe(r,t.size,t.config.view);if(cg(c)){const u=gJe(c,n);if(u)return u}return[0,{signal:`bandwidth('${s}')`}]}else{const c=t.encoding[r];if(Ot(c)&&c.timeUnit){const u=GQe(c.timeUnit,p=>`scale('${s}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=cb({fieldDef:c,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=hn(f)?`${f.signal}/2${h}`:`${f/2+d}`,g=hn(f)?`(1 - ${f.signal}/2)${h}`:`${1-f/2+d}`;return[{signal:`${p} * (${u})`},{signal:`${g} * (${u})`}]}return[0,{signal:u}]}return nQe(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}function mJe(e,t,n){const r=e===_o?"width":"height",i=t[r];return i!==void 0?i:r4(n,r)}function Gvn(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&<(n)?n.length+1:(Et(xdn(r)),3)}}function qvn(e,t,n){const r=()=>{const i=nh(t),o=nh(e),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return hn(t)?new Ys(r):{signal:r()}}function Xvn(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(S8("size",e))}const oke=.95;function Yvn(e,t,n,r){const i={x:ike(n,"x"),y:ike(n,"y")};switch(e){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=ske(t,i,r.view);return Qr(o)?o-1:new Ys(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=ske(t,i,r.view);return Qr(o)?Math.pow(oke*o,2):new Ys(()=>`pow(${oke} * ${o.signal}, 2)`)}}throw new Error(S8("size",e))}function ske(e,t,n){const r=cg(e.width)?e.width.step:fie(n,"width"),i=cg(e.height)?e.height.step:fie(n,"height");return t.x||t.y?new Ys(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function vJe(e,t){Po(e)?Qvn(e,t):bJe(e,t)}function Qvn(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=e;for(const a of wt(n)){const l=s[a],c=n[a],u=e.getScaleComponent(a),f=Ls(i[a]),d=l[t],h=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),m=aie(h,t),v=tKe(a,t);if(d!==void 0&&(m?v&&Et(v):Et(LQe(h,t,a))),m&&v===void 0)if(d!==void 0){const y=f.timeUnit,b=f.type;switch(t){case"domainMax":case"domainMin":MS(l[t])||b==="temporal"||y?c.set(t,{signal:I8(l[t],{type:b,timeUnit:y})},!0):c.set(t,l[t],!0);break;default:c.copyKeyFromObject(t,l)}}else{const y=_t(ake,t)?ake[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:kKe(i,a),hasSecondaryRangeChannel:!!i[Pg(a)]}):r.scale[t];y!==void 0&&c.set(t,y,!1)}}}const ake={bins:({model:e,fieldOrDatumDef:t})=>Ot(t)?Kvn(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Zvn(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>Jvn(e,t,n,r,i,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>eyn(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>tyn(e,t,n.type,r,i.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>nyn(e,t,n,r,i.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>{const i=Ot(e)?e.sort:void 0;return ryn(t,i,n,r.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>iyn(e,t,n,r,i,o.scale,s)};function yJe(e){Po(e)?Bvn(e):bJe(e,"range")}function bJe(e,t){const n=e.component.scales;for(const r of e.children)t==="range"?yJe(r):vJe(r,t);for(const r of wt(n)){let i;for(const o of e.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(t);i=ub(i,a,t,"scale",lZe((l,c)=>{switch(t){case"range":return l.step&&c.step?l.step-c.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function Kvn(e,t){const n=t.bin;if(Ji(n)){const r=_ge(e,t.field,n);return new Ys(()=>e.getSignalName(r))}else if(wa(n)&&PS(n)&&n.step!==void 0)return{step:n.step}}function Zvn(e,t){if(vr([Uc,Eg,Tg],e)&&t!=="nominal")return"hcl"}function Jvn(e,t,n,r,i,o){if(!(Sh(o)?.bin||lt(n)||i!=null||r!=null||vr([Oa.TIME,Oa.UTC],e)))return ts(t)?!0:void 0}function eyn(e,t,n,r,i,o){if(ts(e)){if(Tp(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(Ot(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===Oa.POINT)return n.pointPadding}}function tyn(e,t,n,r,i,o=!1){if(e===void 0){if(ts(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,tickBandPaddingInner:c,bandWithNestedOffsetPaddingInner:u}=i;return o?u:es(s,n==="bar"?a:n==="tick"?c:l)}else if(SL(t)&&r===Oa.BAND)return i.offsetBandPaddingInner}}function nyn(e,t,n,r,i,o=!1){if(e===void 0){if(ts(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===Oa.BAND)return es(s,hn(r)?{signal:`${r.signal}/2`}:r/2)}else if(SL(t)){if(n===Oa.POINT)return .5;if(n===Oa.BAND)return i.offsetBandPaddingOuter}}}function ryn(e,t,n,r){if(n==="x"&&r.xReverse!==void 0)return xh(e)&&t==="descending"?hn(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(xh(e)&&t==="descending")return!0}function iyn(e,t,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&xh(i)){if(lt(n)){const l=n[0],c=n[n.length-1];if(Qr(l)&&l<=0&&Qr(c)&&c>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!TE(i))return!0;if(!(Ot(t)&&t.bin)&&vr([...Nv,...Xun],e)){const{orient:l,type:c}=r;return vr(["bar","area","line","trail"],c)&&(l==="horizontal"&&e==="y"||l==="vertical"&&e==="x")?!1:vr(["bar","area"],c)&&!s?!0:o?.zero}return!1}function oyn(e,t,n,r,i=!1){const o=syn(t,n,r,i),{type:s}=e;return kg(t)?s!==void 0?rhn(t,s)?Ot(n)&&!nhn(s,n.type)?(Et(idn(s,o)),o):s:(Et(rdn(t,s,o)),o):o:null}function syn(e,t,n,r){switch(t.type){case"nominal":case"ordinal":{if(xO(e)||cX(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&Et(uX(e,"ordinal")),"ordinal";if(lX(e))return"band";if(ts(e)||SL(e)){if(vr(["rect","bar","image","rule","tick"],n.type)||r)return"band"}else if(n.type==="arc"&&e in wpe)return"band";const i=n[Wc(e)];return Aw(i)||kE(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return xO(e)?"time":cX(e)==="discrete"?(Et(uX(e,"temporal")),"ordinal"):Ot(t)&&t.timeUnit&&sa(t.timeUnit).utc?"utc":lX(e)?"band":"time";case"quantitative":return xO(e)?Ot(t)&&Ji(t.bin)?"bin-ordinal":"linear":cX(e)==="discrete"?(Et(uX(e,"quantitative")),"ordinal"):lX(e)?"band":"linear";case"geojson":return}throw new Error(IQe(t.type))}function ayn(e,{ignoreRange:t}={}){xJe(e),uJe(e);for(const n of thn)vJe(e,n);t||yJe(e)}function xJe(e){Po(e)?e.component.scales=lyn(e):e.component.scales=uyn(e)}function lyn(e){const{encoding:t,mark:n,markDef:r}=e,i={};for(const o of Spe){const s=Ls(t[o]);if(s&&n===iKe&&o===Vc&&s.type===cP)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??={};const l=kKe(t,o),c=oyn(a,o,s,r,l);i[o]=new dJe(e.scaleName(`${o}`,!0),{value:c,explicit:a.type===c})}}return i}const cyn=lZe((e,t)=>pPe(e)-pPe(t));function uyn(e){const t=e.component.scales={},n={},r=e.component.resolve;for(const i of e.children){xJe(i);for(const o of wt(i.component.scales))if(r.scale[o]??=KZe(o,e),r.scale[o]==="shared"){const s=n[o],a=i.component.scales[o].getWithExplicit("type");s?Hdn(s.value,a.value)?n[o]=ub(s,a,"type","scale",cyn):(r.scale[o]="independent",delete n[o]):n[o]=a}}for(const i of wt(n)){const o=e.scaleName(i,!0),s=n[i];t[i]=new dJe(o,s);for(const a of e.children){const l=a.component.scales[i];l&&(a.renameScale(l.get("name"),o),l.merged=!0)}}return t}class SX{nameMap;constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Po(e){return e?.type==="unit"}function Du(e){return e?.type==="facet"}function Pge(e){return e?.type==="concat"}function pP(e){return e?.type==="layer"}class kge{type;parent;config;name;size;title;description;data;transforms;layout;scaleNameMap;projectionNameMap;signalNameMap;component;view;constructor(t,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.parent=r,this.config=o,this.view=_a(a),this.name=t.name??i,this.title=Jy(t.title)?{text:t.title}:t.title?_a(t.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new SX,this.projectionNameMap=r?r.projectionNameMap:new SX,this.signalNameMap=r?r.signalNameMap:new SX,this.data=t.data,this.description=t.description,this.transforms=mgn(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:xpn(t,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:M8(t)||r?.component.data.isFaceted&&t.data===void 0},layoutSize:new jv,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Un(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){ayn(this)}parseProjection(){aJe(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){nJe(this)}assembleEncodeFromView(t){const{style:n,...r}=t,i={};for(const o of wt(r)){const s=r[o];s!==void 0&&(i[o]=lo(s))}return i}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=lo(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Vi(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:r,config:i}=this,o=Amn(r.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const r of kf)t[r].title&&n.push(Omn(this,r));for(const r of bge)n=n.concat(Emn(this,r));return n}assembleAxes(){return dmn(this.component.axes,this.config)}assembleLegends(){return iJe(this)}assembleProjections(){return evn(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},r={...CQe(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(r.text)return vr(["unit","layer"],this.type)?vr(["middle",void 0],r.anchor)&&(r.frame??="group"):r.anchor??="start",Vi(r)?void 0:r}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||Du(this.parent)?fJe(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return xo((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ao[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(t){if(Du(this.parent)){const n=YZe(t),r=b8(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if(la(o)&&kS(s)){const a=i.get("name"),l=W8(this,r),c=Tge(l);if(c){const u=It({aggregate:"distinct",field:c},{expr:"datum"});return{signal:XZe(a,i,u)}}else return Et(Ope(r)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(mQe(t)&&kg(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let r=this.component.selection[t];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(t,n)),!r)throw new Error(bfn(n));return r}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}}class wJe extends kge{vgField(t,n={}){const r=this.fieldDef(t);if(r)return It(r,n)}reduceFieldDef(t,n){return Yhn(this.getMapping(),(r,i,o)=>{const s=Sh(i);return s?t(r,s,o):r},n)}forEachFieldDef(t,n){ege(this.getMapping(),(r,i)=>{const o=Sh(r);o&&t(o,i)},n)}}class H8 extends Ti{transform;clone(){return new H8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const i=this.transform.resolve??"shared";this.transform.resolve=i}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Or(this.transform)}`}assemble(){const{density:t,...n}=this.transform,r={type:"kde",field:t,...n};return r.resolve=this.transform.resolve,r}}class G8 extends Ti{transform;clone(){return new G8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Or(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class q8 extends Ti{transform;clone(){return new q8(this.parent,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Or(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class X8 extends Ti{transform;clone(){return new X8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Or(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class _O extends Ti{fields;geojson;signal;clone(){return new _O(null,Un(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let r=0;for(const i of[[$h,Fh],[nd,Nh]]){const o=i.map(s=>{const a=Ls(n.encoding[s]);return Ot(a)?a.field:Mg(a)?{expr:`${a.datum}`}:wh(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new _O(t,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(Vc)){const i=n.typedFieldDef(Vc);i.type===cP&&(t=new _O(t,null,i.field,n.getName(`geojson_${r++}`)))}return t}constructor(t,n,r,i){super(t),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const t=(this.fields??[]).filter(Kt);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Or(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class RR extends Ti{projection;fields;as;clone(){return new RR(null,this.projection,Un(this.fields),Un(this.as))}constructor(t,n,r,i){super(t),this.projection=n,this.fields=r,this.as=i}static parseAll(t,n){if(!n.projectionName())return t;for(const r of[[$h,Fh],[nd,Nh]]){const i=r.map(s=>{const a=Ls(n.encoding[s]);return Ot(a)?a.field:Mg(a)?{expr:`${a.datum}`}:wh(a)?{expr:`${a.value}`}:void 0}),o=r[0]===nd?"2":"";(i[0]||i[1])&&(t=new RR(t,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(Kt))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Or(this.fields)} ${Or(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class G1 extends Ti{transform;clone(){return new G1(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:r,step:i}=t;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(t,n){return new G1(t,n)}static makeFromEncoding(t,n){const r=n.encoding,i=r.x,o=r.y;if(Ot(i)&&Ot(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:c,frame:u,keyvals:f}=s.impute,d=RKe(n.mark,r);return new G1(t,{impute:s.field,key:a.field,...l?{method:l}:{},...c!==void 0?{value:c}:{},...u?{frame:u}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Or(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:t,key:n,...r?{keyvals:Kpn(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const c={type:"window",as:[`imputed_${t}_value`],ops:[i],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},u={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[l,c,u]}else return[l]}}class Y8 extends Ti{transform;clone(){return new Y8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Or(this.transform)}`}assemble(){const{loess:t,on:n,...r}=this.transform;return{type:"loess",x:n,y:t,...r}}}class IR extends Ti{transform;secondary;clone(){return new IR(null,Un(this.transform),this.secondary)}constructor(t,n,r){super(t),this.transform=n,this.secondary=r}static make(t,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(Zpn(s)){let l=CJe(s.data,o);l||(l=new Lw(s.data),o.push(l));const c=n.getName(`lookup_${i}`);a=new Rc(l,c,Ao.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[c]=a}else if(Jpn(s)){const l=s.param;r={as:l,...r};let c;try{c=n.getSelectionComponent(xo(l),l)}catch{throw new Error(_fn(l))}if(a=c.materialized,!a)throw new Error(Cfn(l))}return new IR(t,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Vt(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Or({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:Vt(this.transform.as)}:{}};else{let n=this.transform.as;Kt(n)||(Et(Lfn),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Q8 extends Ti{transform;clone(){return new Q8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Or(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class K8 extends Ti{transform;clone(){return new K8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Or(this.transform)}`}assemble(){const{regression:t,on:n,...r}=this.transform;return{type:"regression",x:n,y:t,...r}}}class Z8 extends Ti{transform;clone(){return new Z8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Ep((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Or(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:t,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class J8 extends Ti{transform;clone(){return new J8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Or(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function SJe(e){let t=0;function n(r,i){if(r instanceof Lw&&!r.isGenerator&&!AE(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof fl&&(r.parent instanceof Lw&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof dP){i.name||(i.name=`data_${t++}`),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,e.push(...r.assemble());return}switch((r instanceof RL||r instanceof IL||r instanceof FE||r instanceof fP||r instanceof IE||r instanceof RR||r instanceof uh||r instanceof IR||r instanceof hP||r instanceof DS||r instanceof X8||r instanceof q8||r instanceof H8||r instanceof Y8||r instanceof Q8||r instanceof K8||r instanceof fb||r instanceof J8||r instanceof Z8||r instanceof G8)&&i.transform.push(r.assemble()),(r instanceof Yp||r instanceof qp||r instanceof G1||r instanceof Jm||r instanceof _O)&&i.transform.push(...r.assemble()),r instanceof Rc&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof Rc?r.setSource(i.name):(i.name||(i.name=`data_${t++}`),r.setSource(i.name),r.numChildren()===1&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof Rc&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${t++}`);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function fyn(e){const t=[],n=SJe(t);for(const r of e.children)n(r,{source:e.name,name:null,transform:[]});return t}function dyn(e,t){const n=[],r=SJe(n);let i=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function hyn(e){return e==="top"||e==="left"||hn(e)?"header":"footer"}function pyn(e){for(const t of kf)gyn(e,t);lke(e,"x"),lke(e,"y")}function gyn(e,t){const{facet:n,config:r,child:i,component:o}=e;if(e.channelHasField(t)){const s=n[t],a=LE("title",null,r,t);let l=wO(s,r,{allowDisabling:!0,includeDefault:a===void 0||!!a});i.component.layoutHeaders[t].title&&(l=lt(l)?l.join(", "):l,l+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);const c=LE("labelOrient",s.header,r,t),u=s.header!==null?es(s.header?.labels,r.header.labels,!0):!1,f=vr(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:s.header!==null?l:null,facetFieldDef:s,[f]:t==="facet"?[]:[_Je(e,t,u)]}}}function _Je(e,t,n){const r=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function lke(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=Sge(i,t),i.axis[t]==="shared"){const o=t==="x"?"column":"row",s=r[o];for(const a of n.component.axes[t]){const l=hyn(a.get("orient"));s[l]??=[_Je(e,o,!1)];const c=CM(a,"main",e.config,{header:!0});c&&s[l][0].axes.push(c),a.mainExtracted=!0}}}}function myn(e){Mge(e),a4(e,"width"),a4(e,"height")}function vyn(e){Mge(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";a4(e,t),a4(e,n)}function Mge(e){for(const t of e.children)t.parseLayoutSize()}function a4(e,t){const n=YZe(t),r=b8(n),i=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const l=a.component.layoutSize.getWithExplicit(n),c=i.scale[r]??KZe(r,e);if(c==="independent"&&l.value==="step"){s=void 0;break}if(s){if(c==="independent"&&s.value!==l.value){s=void 0;break}s=ub(s,l,n,"")}else s=l}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function yyn(e){const{size:t,component:n}=e;for(const r of Nv){const i=Wc(r);if(t[i]!=null&&t[i]!=null){const o=t[i];n.layoutSize.set(i,cg(o)?"step":o,!0)}else{const o=byn(e,i);n.layoutSize.set(i,o,!1)}}}function byn(e,t){const n=t==="width"?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if(la(o)){const a=r4(r.view,t);return kS(s)||cg(a)?"step":a}else return uie(r.view,t)}else{if(e.hasProjection||e.mark==="arc")return uie(r.view,t);{const o=r4(r.view,t);return cg(o)?o.step:o}}}function Pie(e,t,n){return It(t,{suffix:`by_${It(e)}`,...n})}class uA extends wJe{facet;child;children;constructor(t,n,r,i){super(t,"facet",n,r,i,t.resolve),this.child=Lge(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!EL(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=wt(t),r={};for(const i of n){if(![Ym,Qm].includes(i)){Et(S8(i,"facet"));break}const o=t[i];if(o.field===void 0){Et(oie(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(t,n){const r=Jpe(t,n);return r.header?r.header=_a(r.header):r.header===null&&(r.header=null),r}channelHasField(t){return _t(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=eW(this),this.child.parseData()}parseLayoutSize(){Mge(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,vs(this.component.selection).some(t=>Xp(t))&&Tpe(Epe)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),pyn(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of kf)for(const r of xge){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=LE("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=U8(n,a);t.titleAnchor??={},t.titleAnchor[l]="end"}}if(o?.[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[l]??={},t[l][n]=.5),i.title&&(t.offset??={},t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,r=t?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof uA))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof uA?{...this.channelHasField("column")?{encode:{update:{columns:{field:It(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],r=[];if(this.child instanceof uA){if(this.child.channelHasField("column")){const i=It(this.child.facet.column);t.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of Nv){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(la(s)&&kS(a)){const l=W8(this.child,i),c=Tge(l);c?(t.push(c),n.push("distinct"),r.push(`distinct_${c}`)):Et(Ope(i))}}}return{fields:t,ops:n,as:r}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const u of kf){const f=this.facet[u];if(f){l.push(It(f));const{bin:d,sort:h}=f;if(Ji(d)&&l.push(It(f,{binSuffix:"end"})),Km(h)){const{field:p,op:g=k8}=h,m=Pie(f,h);r&&i?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(lt(h)){const p=DE(f,u);o.push(p),s.push("max"),a.push(p)}}}const c=!!r&&!!i;return{name:t,data:n,groupby:l,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,r=n[t];return r?Km(r.sort)?[Pie(r,r.sort,{expr:"datum"})]:lt(r.sort)?[DE(r,t,{expr:"datum"})]:[It(r,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,r=n[t];if(r){const{sort:i}=r;return[(Km(i)?i.order:!lt(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:n}=this;if(t.facet)return wie(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of bge)if(t[i]){const o=LE("labelOrient",t[i]?.header,n,i);if(r[i].includes(o))return wie(t[i],i,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,r=fyn(n),i=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:kf.map(l=>this.facetSortFields(l)).flat(),order:kf.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup(Lgn(this,[]))}]}getMapping(){return this.facet}}function xyn(e,t){const{row:n,column:r}=t;if(n&&r){let i=null;for(const o of[n,r])if(Km(o.sort)){const{field:s,op:a=k8}=o.sort;e=i=new DS(e,{joinaggregate:[{op:a,field:s,as:Pie(o,o.sort,{forAs:!0})}],groupby:[It(o)]})}return i}return null}function CJe(e,t){for(const n of t){const r=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const i=e.format?.mesh,o=r.format?.feature;if(i&&o)continue;const s=e.format?.feature;if((s||o)&&s!==o)continue;const a=r.format?.mesh;if(!((i||a)&&i!==a)){if(AR(e)&&AR(r)){if(Ou(e.values,r.values))return n}else if(AE(e)&&AE(r)){if(e.url===r.url)return n}else if(cZe(e)&&e.name===n.dataName)return n}}return null}function wyn(e,t){if(e.data||!e.parent){if(e.data===null){const r=new Lw({values:[]});return t.push(r),r}const n=CJe(e.data,t);if(n)return z0(e.data)||(n.data.format=rQe({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const r=new Lw(e.data);return t.push(r),r}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Syn(e,t,n){let r=0;for(const i of t.transforms){let o,s;if(cgn(i))s=e=new IE(e,i),o="derived";else if(fge(i)){const a=hvn(i);s=e=fl.makeWithAncestors(e,{},a,n)??e,e=new fP(e,t,i.filter)}else if(iZe(i))s=e=Yp.makeFromTransform(e,i,t),o="number";else if(fgn(i))o="date",n.getWithExplicit(i.field).value===void 0&&(e=new fl(e,{[i.field]:o}),n.set(i.field,o,!1)),s=e=qp.makeFromTransform(e,i);else if(dgn(i))s=e=uh.makeFromTransform(e,i),o="number",yge(t)&&(e=new fb(e));else if(rZe(i))s=e=IR.make(e,t,i,r++),o="derived";else if(sgn(i))s=e=new hP(e,i),o="number";else if(agn(i))s=e=new DS(e,i),o="number";else if(hgn(i))s=e=Jm.makeFromTransform(e,i),o="derived";else if(pgn(i))s=e=new X8(e,i),o="derived";else if(ggn(i))s=e=new G8(e,i),o="derived";else if(lgn(i))s=e=new q8(e,i),o="derived";else if(egn(i))s=e=new Z8(e,i),o="derived";else if(ogn(i))e=new J8(e,i);else if(ugn(i))s=e=G1.makeFromTransform(e,i),o="derived";else if(tgn(i))s=e=new H8(e,i),o="derived";else if(ngn(i))s=e=new Q8(e,i),o="derived";else if(rgn(i))s=e=new K8(e,i),o="derived";else if(ign(i))s=e=new Y8(e,i),o="derived";else{Et(Dfn(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function eW(e){let t=wyn(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,s=!(i&&(z0(i)||AE(i)||AR(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Tgn;z0(i)?(uZe(i)?t=new IL(t,i.sequence):dge(i)&&(t=new RL(t,i.graticule)),s.parseNothing=!0):i?.format?.parse===null&&(s.parseNothing=!0),t=fl.makeExplicit(t,e,s)??t,t=new fb(t);const a=e.parent&&pP(e.parent);(Po(e)||Du(e))&&a&&(t=Yp.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Syn(t,e,s));const l=gvn(e),c=pvn(e);t=fl.makeWithAncestors(t,{},{...l,...c},s)??t,Po(e)&&(t=_O.parseAll(t,e),t=RR.parseAll(t,e)),(Po(e)||Du(e))&&(a||(t=Yp.makeFromEncoding(t,e)??t),t=qp.makeFromEncoding(t,e)??t,t=IE.parseAllForSortIndex(t,e));const u=t=DN(Ao.Raw,e,t);if(Po(e)){const m=uh.makeFromEncoding(t,e);m&&(t=m,yge(e)&&(t=new fb(t))),t=G1.makeFromEncoding(t,e)??t,t=Jm.makeFromEncoding(t,e)??t}let f,d;if(Po(e)){const{markDef:m,mark:v,config:y}=e,b=vi("invalid",m,y),{marks:w,scales:S}=d=dZe({invalid:b,isPath:Vb(v)});w!==S&&S==="include-invalid-values"&&(f=t=DN(Ao.PreFilterInvalid,e,t)),w==="exclude-invalid-values"&&(t=FE.make(t,e,d)??t)}const h=t=DN(Ao.Main,e,t);let p;if(Po(e)&&d){const{marks:m,scales:v}=d;m==="include-invalid-values"&&v==="exclude-invalid-values"&&(t=FE.make(t,e,d)??t,p=t=DN(Ao.PostFilterInvalid,e,t))}Po(e)&&umn(e,h);let g=null;if(Du(e)){const m=e.getName("facet");t=xyn(t,e.facet)??t,g=new dP(t,e,m,h.getSource()),n[m]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:u,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function DN(e,t,n){const{outputNodes:r,outputNodeRefCounts:i}=t.component.data,o=t.getDataName(e),s=new Rc(n,o,e,i);return r[o]=s,s}class _yn extends kge{children;constructor(t,n,r,i){super(t,"concat",n,r,i,t.resolve),(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&Et(Afn),this.children=this.getChildren(t).map((o,s)=>Lge(o,this,this.getName(`concat_${s}`),void 0,i))}parseData(){this.component.data=eW(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of wt(t.component.selection))this.component.selection[n]=t.component.selection[n]}vs(this.component.selection).some(t=>Xp(t))&&Tpe(Epe)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return F8(t)?t.vconcat:cge(t)?t.hconcat:t.concat}parseLayoutSize(){vyn(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=wge(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),r=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function Cyn(e){return e===!1||e===null}const Oyn={disable:1,gridScale:1,scale:1,...EKe,labelExpr:1,encode:1},OJe=wt(Oyn);class Age extends jv{explicit;implicit;mainExtracted;constructor(t={},n={},r=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=r}clone(){return new Age(Un(this.explicit),Un(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Cyn(this.get(t))}hasOrientSignalRef(){return hn(this.explicit.orient)}}function Eyn(e,t,n){const{encoding:r,config:i}=e,o=Ls(r[t])??Ls(r[Pg(t)]),s=e.axis(t)||{},{format:a,formatType:l}=s;if(Rw(l))return{text:rh({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(PE(o)==="quantitative"){if(kE(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:rh({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:rh({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(PE(o)==="temporal"&&i.timeFormatType&&Ot(o)&&!o.timeUnit)return{text:rh({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function Tyn(e){return Nv.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Dyn(n,e)]),t),{})}const Pyn={bottom:"top",top:"bottom",left:"right",right:"left"};function kyn(e){const{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(const i of e.children){i.parseAxesAndHeaders();for(const o of wt(i.component.axes))n.axis[o]=Sge(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=Myn(t[o],i.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const i of Nv){for(const o of e.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){t[i]=(t[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!hn(a)){if(r[a]>0&&!l){const c=Pyn[a];r[a]>r[c]&&s.set("orient",c,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&t[i]&&t[i].length>1)for(const[o,s]of(t[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function Myn(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let r=0;rn.clone());return e}function Ayn(e,t){for(const n of OJe){const r=ub(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return AQe(i,o);case"gridScale":return{explicit:i.explicit,value:es(i.value,o.value)}}return N8(i,o,n,"axis")});e.setWithExplicit(n,r)}return e}function Ryn(e,t,n,r,i){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(hn(n.labelAngle)?n.labelAngle:kR(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===WZe(r,i))return!0}return e===n[t]}const Iyn=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Dyn(e,t){let n=t.axis(e);const r=new Age,i=Ls(t.encoding[e]),{mark:o,config:s}=t,a=n?.orient||s[e==="x"?"axisX":"axisY"]?.orient||s.axis?.orient||xmn(e),l=t.getScaleComponent(e).get("type"),c=hmn(e,l,a,t.config),u=n!==void 0?!n:bie("disable",s.style,n?.style,c).configValue;if(r.set("disable",u,n!==void 0),u)return r;n=n||{};const f=vmn(i,n,e,s.style,c),d=dKe(n.formatType,i,l),h=fKe(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const v of OJe){const y=v in XPe?XPe[v](p):wPe(v)?n[v]:void 0,b=y!==void 0,w=Ryn(y,v,n,t,e);if(b&&w)r.set(v,y,w);else{const{configValue:S=void 0,configFrom:_=void 0}=wPe(v)&&v!=="values"?bie(v,s.style,n.style,c):{},E=S!==void 0;b&&!E?r.set(v,y,w):(_!=="vgAxisConfig"||Iyn.has(v)&&E||ML(S)||hn(S))&&r.set(v,S,!1)}}const g=n.encoding??{},m=OKe.reduce((v,y)=>{if(!r.hasAxisPart(y))return v;const b=QZe(g[y]??{},t),w=y==="labels"?Eyn(t,e,b):b;return w!==void 0&&!Vi(w)&&(v[y]={update:w}),v},{});return Vi(m)||r.set("encode",m,!!n.encoding||n.labelAngle!==void 0),r}function Lyn({encoding:e,size:t}){for(const n of Nv){const r=Wc(n);cg(t[r])&&x0(e[n])&&(delete t[r],Et(FQe(r)))}return t}const Fyn={vgMark:"arc",encodeEntry:e=>({...pd(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Vl("x",e,{defaultPos:"mid"}),...Vl("y",e,{defaultPos:"mid"}),...vv(e,"radius"),...vv(e,"theta")})},$yn={vgMark:"area",encodeEntry:e=>({...pd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...i4("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...i4("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...vge(e)})},Nyn={vgMark:"rect",encodeEntry:e=>({...pd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...vv(e,"x"),...vv(e,"y")})},zyn={vgMark:"shape",encodeEntry:e=>({...pd(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&Ot(n)&&n.type===cP?{field:It(n,{expr:"datum"})}:{}}]}},jyn={vgMark:"image",encodeEntry:e=>({...pd(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...vv(e,"x"),...vv(e,"y"),...pge(e,"url")})},Byn={vgMark:"line",encodeEntry:e=>({...pd(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Vl("x",e,{defaultPos:"mid"}),...Vl("y",e,{defaultPos:"mid"}),...Pa("size",e,{vgChannel:"strokeWidth"}),...vge(e)})},Uyn={vgMark:"trail",encodeEntry:e=>({...pd(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Vl("x",e,{defaultPos:"mid"}),...Vl("y",e,{defaultPos:"mid"}),...Pa("size",e),...vge(e)})};function Rge(e,t){const{config:n}=e;return{...pd(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Vl("x",e,{defaultPos:"mid"}),...Vl("y",e,{defaultPos:"mid"}),...Pa("size",e),...Pa("angle",e),...Vyn(e,n,t)}}function Vyn(e,t,n){return n?{shape:{value:n}}:Pa("shape",e)}const Wyn={vgMark:"symbol",encodeEntry:e=>Rge(e)},Hyn={vgMark:"symbol",encodeEntry:e=>Rge(e,"circle")},Gyn={vgMark:"symbol",encodeEntry:e=>Rge(e,"square")},qyn={vgMark:"rect",encodeEntry:e=>({...pd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...vv(e,"x"),...vv(e,"y")})},Xyn={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...pd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...i4("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...i4("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...Pa("size",e,{vgChannel:"strokeWidth"})}}},Yyn={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...pd(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Vl("x",e,{defaultPos:"mid"}),...Vl("y",e,{defaultPos:"mid"}),...pge(e),...Pa("size",e,{vgChannel:"fontSize"}),...Pa("angle",e),...WPe("align",Qyn(e.markDef,n,t)),...WPe("baseline",Kyn(e.markDef,n,t)),...Vl("radius",e,{defaultPos:null}),...Vl("theta",e,{defaultPos:null})}}};function Qyn(e,t,n){if(vi("align",e,n)===void 0)return"center"}function Kyn(e,t,n){if(vi("baseline",e,n)===void 0)return"middle"}const Zyn={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i=r==="horizontal"?"x":"y",o=r==="horizontal"?"y":"x",s=r==="horizontal"?"height":"width";return{...pd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...vv(e,i),...Vl(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:lo(vi("thickness",n,t))}}},LN={arc:Fyn,area:$yn,bar:Nyn,circle:Hyn,geoshape:zyn,image:jyn,line:Byn,point:Wyn,rect:qyn,rule:Xyn,square:Gyn,text:Yyn,tick:Zyn,trail:Uyn};function Jyn(e){if(vr([T8,O8,ahn],e.mark)){const t=RKe(e.mark,e.encoding);if(t.length>0)return e0n(e,t)}else if(e.mark===E8){const t=rie.some(n=>vi(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return t0n(e)}return Ige(e)}const cke="faceted_path_";function e0n(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:cke+e.requestDataName(Ao.Main),data:e.requestDataName(Ao.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Ige(e,{fromPrefix:cke})}]}const uke="stack_group_";function t0n(e){const[t]=Ige(e,{fromPrefix:uke}),n=e.scaleName(e.stack.fieldChannel),r=(c={})=>e.vgField(e.stack.fieldChannel,c),i=(c,u)=>{const f=[r({prefix:"min",suffix:"start",expr:u}),r({prefix:"max",suffix:"start",expr:u}),r({prefix:"min",suffix:"end",expr:u}),r({prefix:"max",suffix:"end",expr:u})];return`${c}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...SE(t.encode.update,["y","yc","y2","height",...rie]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Iu(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...SE(t.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Iu(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of rie){const u=ag(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):u&&(o[c]=lo(u)),u&&(t.encode.update[c]={value:0})}const a=[];if(e.stack.groupbyChannels?.length>0)for(const c of e.stack.groupbyChannels){const u=e.fieldDef(c),f=It(u);f&&a.push(f),(u?.bin||u?.timeUnit)&&a.push(It(u,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,u)=>{if(t.encode.update[u])return{...c,[u]:t.encode.update[u]};{const f=ag(u,e.markDef,e.config);return f!==void 0?{...c,[u]:lo(f)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ao.Main),name:uke+e.requestDataName(Ao.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[t]}]}]}function n0n(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,s=t.order;if(!(!lt(s)&&wh(s)&&tie(s.value)||!s&&tie(vi("order",i,o)))){if((lt(s)||Ot(s))&&!n)return PQe(s,{expr:"datum"});if(Vb(r)){const a=i.orient==="horizontal"?"y":"x",l=t[a];if(Ot(l))return{field:a}}}}function Ige(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,s=es(r.clip,r0n(e),i0n(e)),a=EQe(r),l=i.key,c=n0n(e),u=o0n(e);u&&Object.values(e.component.selection).some(h=>h.type==="point"&&!h.bind&&h.on!=="pointerover")&&(e.markDef.cursor??="pointer");const f=vi("aria",r,o),d=LN[n].postEncodingTransform?LN[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:LN[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ao.Main)},encode:{update:LN[n].encodeEntry(e)},...d?{transform:d}:{}}]}function r0n(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function i0n(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function o0n(e){if(!e.component.selection)return null;const t=wt(e.component.selection).length;let n=t,r=e.parent;for(;r&&n===0;)n=wt(r.component.selection).length,r=r.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class EJe extends wJe{markDef;encoding;specifiedScales={};stack;specifiedAxes={};specifiedLegends={};specifiedProjection={};selection=[];children=[];constructor(t,n,r,i={},o){super(t,"unit",n,r,o,void 0,_Pe(t)?t.view:void 0);const s=lg(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=Vpn(s,o,{graticule:t.data&&dge(t.data)}));const l=this.encoding=qhn(t.encoding||{},a,s.filled,o);this.markDef=JKe(s,l,o),this.size=Lyn({encoding:l,size:_Pe(t)?{...i,...t.width!==void 0?{width:t.width}:{},...t.height!==void 0?{height:t.height}:{}}:i}),this.stack=ZKe(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(c=>age(c)),this.alignStackOrderWithColorDomain()}get hasProjection(){const{encoding:t}=this,n=this.mark===iKe,r=t&&zun.some(i=>Hn(t[i]));return n||r}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return Spe.reduce((r,i)=>{const o=Ls(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(t){const{domain:n,range:r}=t,i=_a(t);return lt(n)&&(i.domain=n.map(wu)),lt(r)&&(i.range=r.map(wu)),i}initAxes(t){return Nv.reduce((n,r)=>{const i=t[r];if(Hn(i)||r===_o&&Hn(t.x2)||r===ha&&Hn(t.y2)){const o=Hn(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=wt(t),r={};for(const i of n){const o=t[i];r[i]=ML(o)?OQe(o):wu(o)}return r}initLegends(t){return Qun.reduce((n,r)=>{const i=Ls(t[r]);if(i&&Zun(r)){const o=i.legend;n[r]=o&&_a(o)}return n},{})}alignStackOrderWithColorDomain(){const{color:t,fill:n,order:r,xOffset:i,yOffset:o}=this.encoding,s=n||t,a=Ot(s)?s:void 0,l=a?.field,c=a?.scale,u=a?.type,f=c?.domain,d=i||o,h=Ot(d)?d:void 0,p=`_${l}_sort_index`;if(!r&&Array.isArray(f)&&typeof l=="string"&&u==="nominal")if(h&&!h.sort)h.sort=f;else{if(!this.stack)return;const g=`indexof(${Tt(f)}, datum['${l}'])`,m=this.markDef?.orient==="horizontal"?"ascending":"descending";this.transforms.push({calculate:g,as:p}),this.encoding.order={field:p,type:"quantitative",sort:m}}}parseData(){this.component.data=eW(this)}parseLayoutSize(){yyn(this)}parseSelections(){this.component.selection=cmn(this,this.selection)}parseMarkGroup(){this.component.mark=Jyn(this)}parseAxesAndHeaders(){this.component.axes=Tyn(this)}assembleSelectionTopLevelSignals(t){return Fgn(this,t)}assembleSignals(){return[...BZe(this),...Dgn(this,[])]}assembleSelectionData(t){return $gn(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return wge(this)}correctDataNames=t=>(t.from?.data&&(t.from.data=this.lookupDataSource(t.from.data),"time"in this.encoding&&(t.from.data=t.from.data+pZe)),t.from?.facet?.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t);assembleMarks(){let t=this.component.mark??[];return(!this.parent||!pP(this.parent))&&(t=yZe(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return W1(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Sh(n)}typedFieldDef(t){const n=this.fieldDef(t);return Kl(n)?n:null}}class Dge extends kge{children;constructor(t,n,r,i,o){super(t,"layer",n,r,o,t.resolve,t.view);const s={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,l)=>{if($8(a))return new Dge(a,this,this.getName(`layer_${l}`),s,o);if(zv(a))return new EJe(a,this,this.getName(`layer_${l}`),s,o);throw new Error(Cpe(a))})}parseData(){this.component.data=eW(this);for(const t of this.children)t.parseData()}parseLayoutSize(){myn(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of wt(t.component.selection))this.component.selection[n]=t.component.selection[n]}vs(this.component.selection).some(t=>Xp(t))&&Tpe(Epe)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){kyn(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),BZe(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),wge(this))}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const r of this.children)for(const i of Vt(r.assembleGroupStyle()))t.add(i);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return Ngn(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),iJe(this))}}function Lge(e,t,n,r,i){if(M8(e))return new uA(e,t,n,i);if($8(e))return new Dge(e,t,n,r,i);if(zv(e))return new EJe(e,t,n,r,i);if(vpn(e))return new _yn(e,t,n,i);throw new Error(Cpe(e))}function s0n(e,t={}){t.logger&&wdn(t.logger),t.fieldTitle&&SKe(t.fieldTitle);try{const n=KKe(XU(t.config,e.config)),r=aZe(e,n),i=Lge(r,null,"",void 0,n);return i.parse(),Mvn(i.component.data,i),{spec:l0n(i,a0n(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&Sdn(),t.fieldTitle&&Nhn()}}function a0n(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):Kt(t)&&(t={type:t}),i&&o&&Cgn(t.type)){if(i==="step"&&o==="step")Et(aPe()),t.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";Et(aPe(b8(s)));const a=s==="width"?"height":"width";t.type=Ogn(a)}}return{...wt(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...LPe(n,!1),...LPe(e,!0)}}function l0n(e,t,n={},r){const i=e.config?Apn(e.config):void 0,o=dyn(e.component.data,n),s=e.assembleSelectionData(o),a=e.assembleProjections(),l=e.assembleTitle(),c=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v6.json",...e.description?{description:e.description}:{},...h,...l?{title:l}:{},...c?{style:c}:{},...u?{encode:{update:u}}:{},data:s,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...qKe(d)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const c0n=Iun.version,u0n=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:CE,accessPathWithDatum:ppe,accessWithDatumToUnescapedPath:Oi,compile:s0n,contains:vr,deepEqual:Ou,deleteNestedProperty:XB,duplicate:Un,entries:ab,every:fpe,fieldIntersection:hpe,flatAccessWithDatum:oQe,getFirstDefined:es,hasIntersection:dpe,hasProperty:_t,hash:Or,internalField:cQe,isBoolean:PR,isEmpty:Vi,isEqual:Lun,isInternalField:uQe,isNullOrFalse:tie,isNumeric:h8,keys:wt,logicalExpr:lA,mergeDeep:rQe,never:nQe,normalize:aZe,normalizeAngle:kR,omit:Iu,pick:SE,prefixGenerator:nie,removePathFromField:aP,replaceAll:Ew,replacePathInField:td,resetIdCounter:$un,setEqual:iQe,some:_E,stringify:yi,titleCase:bL,unescapeSingleQuoteAndPathDot:sQe,unique:Ep,uniqueId:lQe,vals:vs,varName:xo,version:c0n},Symbol.toStringTag,{value:"Module"}));var FN={},fke;function f0n(){if(fke)return FN;fke=1,Object.defineProperty(FN,"__esModule",{value:!0});function e(t){var n=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g,r=n.exec(t).slice(1,3),i=r[0],o=r[1];return{library:i,version:o}}return FN.default=e,FN}var d0n=f0n();const TJe=Vn(d0n);var h0n="2.15.0",p0n={version:h0n};const j_="#fff",dke="#888",g0n={background:"#333",view:{stroke:dke},title:{color:j_,subtitleColor:j_},style:{"guide-label":{fill:j_},"guide-title":{fill:j_}},axis:{domainColor:j_,gridColor:dke,tickColor:j_}},vx="#4572a7",m0n={background:"#fff",arc:{fill:vx},area:{fill:vx},line:{stroke:vx,strokeWidth:2},path:{stroke:vx},rect:{fill:vx},shape:{stroke:vx},symbol:{fill:vx,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},yx="#30a2da",_X="#cbcbcb",v0n="#999",y0n="#333",hke="#f0f0f0",pke="#333",b0n={arc:{fill:yx},area:{fill:yx},axis:{domainColor:_X,grid:!0,gridColor:_X,gridWidth:1,labelColor:v0n,labelFontSize:10,titleColor:y0n,tickColor:_X,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:hke,group:{fill:hke},legend:{labelColor:pke,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:pke,titleFontSize:14,titlePadding:10},line:{stroke:yx,strokeWidth:2},path:{stroke:yx,strokeWidth:.5},rect:{fill:yx},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:yx},bar:{binSpacing:2,fill:yx,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},bx="#000",x0n={group:{fill:"#e5e5e5"},arc:{fill:bx},area:{fill:bx},line:{stroke:bx},path:{stroke:bx},rect:{fill:bx},shape:{stroke:bx},symbol:{fill:bx,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},w0n=22,S0n="normal",gke="Benton Gothic, sans-serif",mke=11.5,_0n="normal",xx="#82c6df",CX="Benton Gothic Bold, sans-serif",vke="normal",yke=13,s2={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},C0n={background:"#ffffff",title:{anchor:"start",color:"#000000",font:CX,fontSize:w0n,fontWeight:S0n},arc:{fill:xx},area:{fill:xx},line:{stroke:xx,strokeWidth:2},path:{stroke:xx},rect:{fill:xx},shape:{stroke:xx},symbol:{fill:xx,size:30},axis:{labelFont:gke,labelFontSize:mke,labelFontWeight:_0n,titleFont:CX,titleFontSize:yke,titleFontWeight:vke},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:gke,labelFontSize:mke,symbolType:"square",titleFont:CX,titleFontSize:yke,titleFontWeight:vke},range:{category:s2["category-6"],diverging:s2["fireandice-6"],heatmap:s2["fire-7"],ordinal:s2["fire-7"],ramp:s2["fire-7"]}},wx="#ab5787",$N="#979797",O0n={background:"#f9f9f9",arc:{fill:wx},area:{fill:wx},line:{stroke:wx},path:{stroke:wx},rect:{fill:wx},shape:{stroke:wx},symbol:{fill:wx,size:30},axis:{domainColor:$N,domainWidth:.5,gridWidth:.2,labelColor:$N,tickColor:$N,tickWidth:.2,titleColor:$N},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Sx="#3e5c69",E0n={background:"#fff",arc:{fill:Sx},area:{fill:Sx},line:{stroke:Sx},path:{stroke:Sx},rect:{fill:Sx},shape:{stroke:Sx},symbol:{fill:Sx},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},sf="#1696d2",bke="#000000",T0n="#FFFFFF",NN="Lato",OX="Lato",P0n="Lato",k0n="#DEDDDD",M0n=18,a2={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},A0n={background:T0n,title:{anchor:"start",fontSize:M0n,font:NN},axisX:{domain:!0,domainColor:bke,domainWidth:1,grid:!1,labelFontSize:12,labelFont:OX,labelAngle:0,tickColor:bke,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:NN},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:k0n,gridWidth:1,labelFontSize:12,labelFont:OX,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:NN,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:OX,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:NN,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:a2["six-groups-cat-1"],diverging:a2["diverging-colors"],heatmap:a2["diverging-colors"],ordinal:a2["six-groups-seq"],ramp:a2["shades-blue"]},area:{fill:sf},rect:{fill:sf},line:{color:sf,stroke:sf,strokeWidth:5},trail:{color:sf,stroke:sf,strokeWidth:0,size:1},path:{stroke:sf,strokeWidth:.5},point:{filled:!0},text:{font:P0n,color:sf,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:sf,stroke:null}},arc:{fill:sf},shape:{stroke:sf},symbol:{fill:sf,size:30}},_x="#3366CC",xke="#ccc",zN="Arial, sans-serif",R0n={arc:{fill:_x},area:{fill:_x},path:{stroke:_x},rect:{fill:_x},shape:{stroke:_x},symbol:{stroke:_x},circle:{fill:_x},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:zN,fontSize:12},"guide-title":{font:zN,fontSize:12},"group-title":{font:zN,fontSize:12}},title:{font:zN,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:xke,tickColor:xke,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Fge=e=>e*(1/3+1),wke=Fge(9),Ske=Fge(10),_ke=Fge(12),l2="Segoe UI",Cke="wf_standard-font, helvetica, arial, sans-serif",Oke="#252423",c2="#605E5C",Eke="transparent",I0n="#C8C6C4",Ld="#118DFF",D0n="#12239E",L0n="#E66C37",F0n="#6B007B",$0n="#E044A7",N0n="#744EC2",z0n="#D9B300",j0n="#D64550",PJe=Ld,kJe="#DEEFFF",Tke=[kJe,PJe],B0n=[kJe,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",PJe],U0n={view:{stroke:Eke},background:Eke,font:l2,header:{titleFont:Cke,titleFontSize:_ke,titleColor:Oke,labelFont:l2,labelFontSize:Ske,labelColor:c2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:c2,labelFontSize:wke,titleFont:Cke,titleColor:Oke,titleFontSize:_ke,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:I0n,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Ld},line:{stroke:Ld,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:l2,fontSize:wke,fill:c2},arc:{fill:Ld},area:{fill:Ld,line:!0,opacity:.6},path:{stroke:Ld},rect:{fill:Ld},point:{fill:Ld,filled:!0,size:75},shape:{stroke:Ld},symbol:{fill:Ld,strokeWidth:1.5,size:50},legend:{titleFont:l2,titleFontWeight:"bold",titleColor:c2,labelFont:l2,labelFontSize:Ske,labelColor:c2,symbolType:"circle",symbolSize:75},range:{category:[Ld,D0n,L0n,F0n,$0n,N0n,z0n,j0n],diverging:Tke,heatmap:Tke,ordinal:B0n}},EX='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',V0n='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',TX=400,jN={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},W0n=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],H0n=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function tW({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",r=jN.gridBg[e],i=jN.textPrimary[e],o=jN.textSecondary[e],s=n==="dark"?W0n:H0n,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:EX,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:V0n,labelFontWeight:TX,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:jN.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:EX,fill:o,fontWeight:TX},"guide-title":{font:EX,fill:o,fontWeight:TX}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const G0n=tW({theme:"white",background:"#ffffff"}),q0n=tW({theme:"g10",background:"#f4f4f4"}),X0n=tW({theme:"g90",background:"#262626"}),Y0n=tW({theme:"g100",background:"#161616"}),Q0n=p0n.version,K0n=Object.freeze(Object.defineProperty({__proto__:null,carbong10:q0n,carbong100:Y0n,carbong90:X0n,carbonwhite:G0n,dark:g0n,excel:m0n,fivethirtyeight:b0n,ggplot2:x0n,googlecharts:R0n,latimes:C0n,powerbi:U0n,quartz:O0n,urbaninstitute:A0n,version:Q0n,vox:E0n},Symbol.toStringTag,{value:"Module"})),Z0n=`#vg-tooltip-element { + : v !== v && u === u ? ${r} : `}var trn={operator:(e,t)=>qk(e,["_"],t.code),parameter:(e,t)=>qk(e,["datum","_"],t.code),event:(e,t)=>qk(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return qk(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const s="o["+Tt(o)+"]";i+=`$=${r[o].code};if(${s}!==$)${s}=$,m=1;`}return i+=Knn(r,n),i+="return m;",qk(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(Tt).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=(o,s)=>{const a=t[s];let l,c;return o.path?(l=`a${o.path}`,c=`b${o.path}`):((n=n||{})["f"+s]=o,l=`this.f${s}(a)`,c=`this.f${s}(b)`),ern(l,c,-a,a)},i=Function("a","b","var u, v; return "+e.map(r).join("")+"0;");return n?i.bind(n):i}}};function nrn(e){const t=this;Znn(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function rrn(e){const t=this;if(e.params){const n=t.get(e.id);n||et("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function irn(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=it(i)?i.map(o=>OOe(o,n,t)):OOe(i,n,t)}return t}function OOe(e,t,n){if(!e||!Bt(e))return e;for(let r=0,i=EOe.length,o;ri&&i.$tupleid?Sn:i);return t.fn[n]||(t.fn[n]=Zle(r,e.$order,t.expr.codegen))}function urn(e,t){const n=e.$encode,r={};for(const i in n){const o=n[i];r[i]=Hc(t.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function frn(e,t){return t}function drn(e,t){const n=e.$subflow;return function(r,i,o){const s=t.fork().parse(n),a=s.get(n.operators[0].id),l=s.signals.parent;return l&&l.set(o),a.detachSubflow=()=>t.detach(s),a}}function hrn(){return Sn}function prn(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,r=e.stream!=null?t.get(e.stream):void 0,i;e.source?r=t.events(e.source,e.type,n):e.merge&&(i=e.merge.map(o=>t.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),e.between&&(i=e.between.map(o=>t.get(o)),r=r.between(i[0],i[1])),e.filter&&(r=r.filter(n)),e.throttle!=null&&(r=r.throttle(+e.throttle)),e.debounce!=null&&(r=r.debounce(+e.debounce)),r==null&&et("Invalid stream definition: "+JSON.stringify(e)),e.consume&&r.consume(!0),t.stream(e,r)}function grn(e){var t=this,n=Bt(n=e.source)?n.$ref:n,r=t.get(n),i=null,o=e.update,s=void 0;r||et("Source not defined: "+e.source),i=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(s=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,r,i,o,s)}const mrn={skip:!0};function vrn(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach(o=>{const s=t.signals[o];e.signals(o,s)&&(r[o]=s.value)})}if(e.data){var i=n.data={};Object.keys(t.data).forEach(o=>{const s=t.data[o];e.data(o,s)&&(i[o]=s.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function yrn(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach(o=>{n.update(t.signals[o],i[o],mrn)}),Object.keys(r||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Qf).insert(r[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function W7e(e,t,n,r){return new H7e(e,t,n,r)}function H7e(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||trn,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function TOe(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}H7e.prototype=TOe.prototype={fork(){const e=new TOe(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),Jnn(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(r.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),r.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const s=n.data[o]||(n.data[o]={});e.data[o].forEach(a=>s[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[Tde(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:Ynn,parseOperator:nrn,parseOperatorParameters:rrn,parseParameters:irn,parseStream:prn,parseUpdate:grn,getState:vrn,setState:yrn};function brn(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),G7e(t,e.description()))}function G7e(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function xrn(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const U7="default";function wrn(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:U7,item:null}));e.on(e.events("view","pointermove"),t,(n,r)=>{const i=t.value,o=i?Ut(i)?i:i.user:U7,s=r.item&&r.item.cursor||null;return i&&o===i.user&&s==i.item?i:{user:o,item:s}}),e.add(null,function(n){let r=n.cursor,i=this.value;return Ut(r)||(i=r.item,r=r.user),Fne(e,r&&r!==U7?r:i||r),i},{cursor:t})}function Fne(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function yB(e,t){var n=e._runtime.data;return Qt(n,t)||et("Unrecognized data set: "+t),n[t]}function Srn(e,t){return arguments.length<2?yB(this,e).values.value:kV.call(this,e,hS().remove(Qf).insert(t))}function kV(e,t){o8e(t)||et("Second argument to changes must be a changeset.");const n=yB(this,e);return n.modified=!0,this.pulse(n.input,t)}function _rn(e,t){return kV.call(this,e,hS().insert(t))}function Crn(e,t){return kV.call(this,e,hS().remove(t))}function q7e(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function X7e(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function MV(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function Orn(e){var t=MV(e),n=q7e(e),r=X7e(e);e._renderer.background(e.background()),e._renderer.resize(n,r,t),e._handler.origin(t),e._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){e.error(o)}})}function Ern(e,t,n){var r=e._renderer,i=r&&r.canvas(),o,s,a;return i&&(a=MV(e),s=t.changedTouches?t.changedTouches[0]:t,o=gV(s,i),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=Trn(e,n,o),t}function Trn(e,t,n){const r=t?t.mark.marktype==="group"?t:t.mark.group:null;function i(s){var a=r,l;if(s){for(l=t;l;l=l.mark.group)if(l.mark.name===s){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;Ut(s)&&(s=i(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:vl(e),item:vl(t||{}),group:i,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const POe="view",Prn="timer",krn="window",Mrn={trap:!1};function Arn(e){const t=rr({defaults:{}},e),n=(r,i)=>{i.forEach(o=>{it(r[o])&&(r[o]=mh(r[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function Y7e(e,t,n,r){e._eventListeners.push({type:n,sources:Ht(t),handler:r})}function Rrn(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[t]:i?!i[t]:e.preventDefault()}function dN(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return r===!1||Bt(r)&&!r[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function Irn(e,t,n){var r=this,i=new LU(n),o=function(c,u){r.runAsync(null,()=>{e===POe&&Rrn(r,t)&&c.preventDefault(),i.receive(Ern(r,c,u))})},s;if(e===Prn)dN(r,"timer",t)&&r.timer(o,t);else if(e===POe)dN(r,"view",t)&&r.addEventListener(t,o,Mrn);else if(e===krn?dN(r,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&dN(r,"selector",t)&&(s=Array.from(document.querySelectorAll(e))),!s)r.warn("Can not resolve event source: "+e);else{for(var a=0,l=s.length;a=0;)t[i].stop();for(i=r.length;--i>=0;)for(s=r[i],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(e&&e.call(this,this._handler,null,null,null),i=n.length;--i>=0;)l=n[i].type,a=n[i].handler,this._handler.off(l,a);return this}function Ru(e,t,n){const r=document.createElement(e);for(const i in t)r.setAttribute(i,t[i]);return n!=null&&(r.textContent=n),r}const Frn="vega-bind",$rn="vega-bind-name",Nrn="vega-bind-radio";function zrn(e,t,n){if(!t)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:s=>{s!=e.signal(r.signal)&&e.runAsync(null,()=>{i.source=!0,e.signal(r.signal,s)})}},r.debounce&&(i.update=Jle(r.debounce,i.update))),(r.input==null&&r.element?jrn:Urn)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(e.signal(r.signal))}),i.active=!0),i}function jrn(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),Y7e(r,t,i,o),e.set=s=>{t.value=s,t.dispatchEvent(Brn(i))}}function Brn(e){return typeof Event<"u"?new Event(e):{type:e}}function Urn(e,t,n,r){const i=r.signal(n.signal),o=Ru("div",{class:Frn}),s=n.input==="radio"?o:o.appendChild(Ru("label"));s.appendChild(Ru("span",{class:$rn},n.name||n.signal)),t.appendChild(o);let a=Vrn;switch(n.input){case"checkbox":a=Wrn;break;case"select":a=Hrn;break;case"radio":a=Grn;break;case"range":a=qrn;break}a(e,s,n,i)}function Vrn(e,t,n,r){const i=Ru("input");for(const o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",()=>e.update(i.value)),e.elements=[i],e.set=o=>i.value=o}function Wrn(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=Ru("input",i);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function Hrn(e,t,n,r){const i=Ru("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const l={value:s};bB(s,r)&&(l.selected=!0),i.appendChild(Ru("option",l,(o[a]||s)+""))}),t.appendChild(i),i.addEventListener("change",()=>{e.update(n.options[i.selectedIndex])}),e.elements=[i],e.set=s=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:s};bB(s,r)&&(l.checked=!0);const c=Ru("input",l);c.addEventListener("change",()=>e.update(s));const u=Ru("label",{},(o[a]||s)+"");return u.prepend(c),i.appendChild(u),c}),e.set=s=>{const a=e.elements,l=a.length;for(let c=0;c{l.textContent=a.value,e.update(+a.value)};a.addEventListener("input",c),a.addEventListener("change",c),e.elements=[a],e.set=u=>{a.value=u,l.textContent=u}}function bB(e,t){return e===t||e+""==t+""}function Q7e(e,t,n,r,i,o){return t=t||new r(e.loader()),t.initialize(n,q7e(e),X7e(e),MV(e),i,o).background(e.background())}function Pde(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function Xrn(e,t,n,r){const i=new r(e.loader(),Pde(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,MV(e),e);return t&&t.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function Yrn(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=mV(r);e=n._el=e?V7(n,e,!0):null,brn(n),o||n.error("Unrecognized renderer type: "+r);const s=o.handler||QD,a=e?o.renderer:o.headless;return n._renderer=a?Q7e(n,n._renderer,e,a):null,n._handler=Xrn(n,n._handler,e,s),n._redraw=!0,e&&i!=="none"&&(t=t?n._elBind=V7(n,t,!0):e.appendChild(Ru("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&i!=="container"&&(l.element=V7(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{zrn(n,l.element||t,l)})),n}function V7(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(r){t=null,e.error(r)}return t}const Xk=e=>+e||0,Qrn=e=>({top:e,bottom:e,left:e,right:e});function ROe(e){return Bt(e)?{top:Xk(e.top),bottom:Xk(e.bottom),left:Xk(e.left),right:Xk(e.right)}:Qrn(Xk(e))}async function kde(e,t,n,r){const i=mV(t),o=i&&i.headless;return o||et("Unrecognized renderer type: "+t),await e.runAsync(),Q7e(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}async function Krn(e,t){e!==u0.Canvas&&e!==u0.SVG&&e!==u0.PNG&&et("Unrecognized image type: "+e);const n=await kde(this,e,t);return e===u0.SVG?Zrn(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function Zrn(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function Jrn(e,t){return(await kde(this,u0.Canvas,e,t)).canvas()}async function ein(e){return(await kde(this,u0.SVG,e)).svg()}function tin(e,t,n){return W7e(e,ZO,hR,n).parse(t)}function nin(e){var t=this._runtime.scales;return Qt(t,e)||et("Unrecognized scale or projection: "+e),t[e].value}var K7e="width",Z7e="height",Mde="padding",IOe={skip:!0};function J7e(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===Mde?r.left+r.right:0)}function eqe(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===Mde?r.top+r.bottom:0)}function rin(e){var t=e._signals,n=t[K7e],r=t[Z7e],i=t[Mde];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=J7e(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=eqe(e,a.size),o()},{size:r});const s=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,s.rank=i.rank+1}function iin(e,t,n,r,i,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(K7e,n,IOe),s._resizeWidth.skip(!0)),s.height()!==r&&(a=1,s.signal(Z7e,r,IOe),s._resizeHeight.skip(!0)),s._viewWidth!==e&&(s._resize=1,s._viewWidth=e),s._viewHeight!==t&&(s._resize=1,s._viewHeight=t),(s._origin[0]!==i[0]||s._origin[1]!==i[1])&&(s._resize=1,s._origin=i),a&&s.run("enter"),o&&s.runAfter(l=>l.resize())},!1,1)}function oin(e){return this._runtime.getState(e||{data:sin,signals:ain,recurse:!0})}function sin(e,t){return t.modified&&it(t.input.value)&&!e.startsWith("_:vega:_")}function ain(e,t){return!(e==="parent"||t instanceof ZO.proxy)}function lin(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function cin(e,t){function n(r){e({timestamp:Date.now(),elapsed:r})}this._timers.push(IKt(n,t))}function uin(e,t,n,r){const i=e.element();i&&i.setAttribute("title",fin(r))}function fin(e){return e==null?"":it(e)?tqe(e):Bt(e)&&!P0(e)?din(e):e+""}function din(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(it(n)?tqe(n):nqe(n))}).join(` +`)}function tqe(e){return"["+e.map(nqe).join(", ")+"]"}function nqe(e){return it(e)?"[…]":Bt(e)&&!P0(e)?"{…}":e}function hin(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e?.();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function rqe(e,t){const n=this;if(t=t||{},oO.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=rr({},e.locale,t.locale);n.locale(YVe(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||u0.Canvas,n._scenegraph=new KHe;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||uin,n._redraw=!0,n._handler=new QD().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=Arn(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=tin(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:rr({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=J7e(n,n._width),n._viewHeight=eqe(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,rin(n),xrn(n),wrn(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function hN(e,t){return Qt(e._signals,t)?e._signals[t]:et("Unrecognized signal name: "+Tt(t))}function iqe(e,t){const n=(e._targets||[]).filter(r=>r._update&&r._update.handler===t);return n.length?n[0]:null}function DOe(e,t,n,r){let i=iqe(n,r);return i||(i=Pde(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function LOe(e,t,n){const r=iqe(t,n);return r&&t._targets.remove(r),e}Rt(rqe,oO,{async evaluate(e,t,n){if(await oO.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,Orn(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&yz(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&G7e(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=hN(this,e);return arguments.length===1?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",ROe(e)):ROe(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(mV(e)||et("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(oO.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(hN(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:iin,addEventListener(e,t,n){let r=t;return n&&n.trap===!1||(r=Pde(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,e===o&&(t===i||t===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return DOe(this,e,hN(this,e),t)},removeSignalListener(e,t){return LOe(this,hN(this,e),t)},addDataListener(e,t){return DOe(this,e,yB(this,e).values,t)},removeDataListener(e,t){return LOe(this,yB(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=Fne(this,null);this._globalCursor=!!e,t&&Fne(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:cin,events:Irn,finalize:Lrn,hover:Drn,data:Srn,change:kV,insert:_rn,remove:Crn,scale:nin,initialize:Yrn,toImageURL:Krn,toCanvas:Jrn,toSVG:ein,getState:oin,setState:lin,_watchPixelRatio:hin});const pin="view",xB="[",wB="]",oqe="{",sqe="}",gin=":",aqe=",",min="@",vin=">",yin=/[[\]{}]/,bin={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let lqe,cqe;function Ab(e,t,n){return lqe=t||pin,cqe=n||bin,uqe(e.trim()).map($ne)}function xin(e){return cqe[e]}function YM(e,t,n,r,i){const o=e.length;let s=0,a;for(;t' after between selector: "+e;r=r.map($ne);const i=$ne(e.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function Sin(e){const t={source:lqe},n=[];let r=[0,0],i=0,o=0,s=e.length,a=0,l,c;if(e[s-1]===sqe){if(a=e.lastIndexOf(oqe),a>=0){try{r=_in(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===min&&(i=++a),l=YM(e,a,gin),l1?(t.type=n[1],i?t.markname=n[0].slice(1):xin(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),c!=null&&(t.filter=c),r[0]&&(t.throttle=r[0]),r[1]&&(t.debounce=r[1]),t}function _in(e){const t=e.split(aqe);if(!e.length||t.length>2)throw e;return t.map(n=>{const r=+n;if(r!==r)throw e;return r})}function Cin(e){return Bt(e)?e:{type:e||"pad"}}const Yk=e=>+e||0,Oin=e=>({top:e,bottom:e,left:e,right:e});function Ein(e){return Bt(e)?e.signal?e:{top:Yk(e.top),bottom:Yk(e.bottom),left:Yk(e.left),right:Yk(e.right)}:Oin(Yk(e))}const na=e=>Bt(e)&&!it(e)?rr({},e):{value:e};function FOe(e,t,n,r){return n!=null?(Bt(n)&&!it(n)||it(n)&&n.length&&Bt(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function $a(e,t,n){for(const r in t)FOe(e,r,t[r]);for(const r in n)FOe(e,r,n[r],"update")}function KT(e,t,n){for(const r in t)n&&Qt(n,r)||(e[r]=rr(e[r]||{},t[r]));return e}function yC(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const Ade="mark",Rde="frame",Ide="scope",Tin="axis",Pin="axis-domain",kin="axis-grid",Min="axis-label",Ain="axis-tick",Rin="axis-title",Iin="legend",Din="legend-band",Lin="legend-entry",Fin="legend-gradient",fqe="legend-label",$in="legend-symbol",Nin="legend-title",zin="title",jin="title-text",Bin="title-subtitle";function Uin(e,t,n,r,i){const o={},s={};let a,l,c,u;l="lineBreak",t==="text"&&i[l]!=null&&!yC(l,e)&&W7(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),u=n===Rde?i.group:n===Ade?rr({},i.mark,i[t]):null;for(l in u)c=yC(l,e)||(l==="fill"||l==="stroke")&&(yC("fill",e)||yC("stroke",e)),c||W7(o,l,u[l]);Ht(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)yC(h,e)||W7(o,h,d[h])}),e=rr({},e);for(l in o)u=o[l],u.signal?(a=a||{})[l]=u:s[l]=u;return e.enter=rr(s,e.enter),a&&(e.update=rr(a,e.update)),e}function W7(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const dqe=e=>Ut(e)?Tt(e):e.signal?`(${e.signal})`:hqe(e);function AV(e){if(e.gradient!=null)return Win(e);let t=e.signal?`(${e.signal})`:e.color?Vin(e.color):e.field!=null?hqe(e.field):e.value!==void 0?Tt(e.value):void 0;return e.scale!=null&&(t=Hin(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${Fz(e.exponent)})`),e.mult!=null&&(t+=`*${Fz(e.mult)}`),e.offset!=null&&(t+=`+${Fz(e.offset)}`),e.round&&(t=`round(${t})`),t}const pN=(e,t,n,r)=>`(${e}(${[t,n,r].map(AV).join(",")})+'')`;function Vin(e){return e.c?pN("hcl",e.h,e.c,e.l):e.h||e.s?pN("hsl",e.h,e.s,e.l):e.l||e.a?pN("lab",e.l,e.a,e.b):e.r||e.g||e.b?pN("rgb",e.r,e.g,e.b):null}function Win(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:Tt(n));for(;t.length&&Ar(t)==null;)t.pop();return t.unshift(dqe(e.gradient)),`gradient(${t.join(",")})`}function Fz(e){return Bt(e)?"("+AV(e)+")":e}function hqe(e){return pqe(Bt(e)?e:{datum:e})}function pqe(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):et("Invalid field reference: "+Tt(e));return e.signal||(r=Ut(r)?vg(r).map(Tt).join("]["):pqe(r)),t+"["+r+"]"}function Hin(e,t){const n=dqe(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+Fz(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Gin(e){let t="";return e.forEach(n=>{const r=AV(n);t+=n.test?`(${n.test})?${r}:`:r}),Ar(t)===":"&&(t+="null"),t}function gqe(e,t,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},e=Uin(e,t,n,r,i.config);for(const a in e)s[a]=qin(e[a],t,o,i);return o}function qin(e,t,n,r){const i={},o={};for(const s in e)e[s]!=null&&(i[s]=Yin(Xin(e[s]),r,n,o));return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function Xin(e){return it(e)?Gin(e):AV(e)}function Yin(e,t,n,r){const i=og(e,t);return i.$fields.forEach(o=>r[o]=1),rr(n,i.$params),i.$expr}const Qin="outer",Kin=["value","update","init","react","bind"];function $Oe(e,t){et(e+' for "outer" push: '+Tt(t))}function mqe(e,t){const n=e.name;if(e.push===Qin)t.signals[n]||$Oe("No prior signal definition",n),Kin.forEach(r=>{e[r]!==void 0&&$Oe("Invalid property ",r)});else{const r=t.addSignal(n,e.value);e.react===!1&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function Nne(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function RV(e,t,n,r){return new Nne(e,t,n,r)}function SB(e,t){return RV("operator",e,t)}function wn(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function pR(e,t){return t?{$field:e,$name:t}:{$field:e}}const zne=pR("key");function NOe(e,t){return{$compare:e,$order:t}}function Zin(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Jin="ascending",eon="descending";function ton(e){return Bt(e)?(e.order===eon?"-":"+")+IV(e.op,e.field):""}function IV(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const Dde="scope",jne="view";function $s(e){return e&&e.signal}function non(e){return e&&e.expr}function $z(e){if($s(e))return!0;if(Bt(e)){for(const t in e)if($z(e[t]))return!0}return!1}function Nd(e,t){return e??t}function R1(e){return e&&e.signal||e}const zOe="timer";function gR(e,t){return(e.merge?ion:e.stream?oon:e.type?son:et("Invalid stream specification: "+Tt(e)))(e,t)}function ron(e){return e===Dde?jne:e||jne}function ion(e,t){const n=e.merge.map(i=>gR(i,t)),r=Lde({merge:n},e,t);return t.addStream(r).id}function oon(e,t){const n=gR(e.stream,t),r=Lde({stream:n},e,t);return t.addStream(r).id}function son(e,t){let n;e.type===zOe?(n=t.event(zOe,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(ron(e.source),e.type);const r=Lde({stream:n},e,t);return Object.keys(r).length===1?n:t.addStream(r).id}function Lde(e,t,n){let r=t.between;return r&&(r.length!==2&&et('Stream "between" parameter must have 2 entries: '+Tt(t)),e.between=[gR(r[0],n),gR(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(aon(t.marktype,t.markname,t.markrole)),t.source===Dde&&r.push("inScope(event.item)"),r.length&&(e.filter=og("("+r.join(")&&(")+")",n).$expr),(r=t.throttle)!=null&&(e.throttle=+r),(r=t.debounce)!=null&&(e.debounce=+r),t.consume&&(e.consume=!0),e}function aon(e,t,n){const r="event.item";return r+(e&&e!=="*"?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}const lon={code:"_.$value",ast:{type:"Identifier",value:"value"}};function con(e,t,n){const r=e.encode,i={target:n};let o=e.events,s=e.update,a=[];o||et("Signal update missing events specification."),Ut(o)&&(o=Ab(o,t.isSubscope()?Dde:jne)),o=Ht(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[fon(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&et("Signal encode and update are mutually exclusive."),s="encode(item(),"+Tt(r)+")"),i.update=Ut(s)?og(s,t):s.expr!=null?og(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:lon,$params:{$value:t.signalRef(s.signal)}}:et("Invalid signal update specification."),e.force&&(i.options={force:!0}),a.forEach(l=>t.addUpdate(rr(uon(l,t),i)))}function uon(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):gR(e,t)}}function fon(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function don(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?et("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=og(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(i=>con(i,t,n.id))}const Di=e=>(t,n,r)=>RV(e,n,t||void 0,r),vqe=Di("aggregate"),hon=Di("axisticks"),yqe=Di("bound"),Ph=Di("collect"),jOe=Di("compare"),pon=Di("datajoin"),bqe=Di("encode"),gon=Di("expression"),mon=Di("facet"),von=Di("field"),yon=Di("key"),bon=Di("legendentries"),xon=Di("load"),won=Di("mark"),Son=Di("multiextent"),_on=Di("multivalues"),Con=Di("overlap"),Oon=Di("params"),xqe=Di("prefacet"),Eon=Di("projection"),Ton=Di("proxy"),Pon=Di("relay"),wqe=Di("render"),kon=Di("scale"),mS=Di("sieve"),Mon=Di("sortitems"),Sqe=Di("viewlayout"),Aon=Di("values");let Ron=0;const _qe={min:"min",max:"max",count:"sum"};function Ion(e,t){const n=e.type||"linear";uHe(n)||et("Unrecognized scale type: "+Tt(n)),t.addScale(e.name,{type:n,domain:void 0})}function Don(e,t){const n=t.getScale(e.name).params;let r;n.domain=Cqe(e.domain,e,t),e.range!=null&&(n.range=Eqe(e,t,n)),e.interpolate!=null&&Won(e.interpolate,n),e.nice!=null&&(n.nice=Von(e.nice,t)),e.bins!=null&&(n.bins=Uon(e.bins,t));for(r in e)Qt(n,r)||r==="name"||(n[r]=Tf(e[r],t))}function Tf(e,t){return Bt(e)?e.signal?t.signalRef(e.signal):et("Unsupported object: "+Tt(e)):e}function Nz(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Tf(n,t))}function DV(e){et("Can not find data set: "+Tt(e))}function Cqe(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&et("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(it(e)?Lon:e.fields?$on:Fon)(e,t,n)}function Lon(e,t,n){return e.map(r=>Tf(r,n))}function Fon(e,t,n){const r=n.getData(e.data);return r||DV(e.data),rE(t.type)?r.valuesRef(n,e.field,Oqe(e.sort,!1)):hHe(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function $on(e,t,n){const r=e.data,i=e.fields.reduce((o,s)=>(s=Ut(s)?{data:r,field:s}:it(s)||s.signal?Non(s,n):s,o.push(s),o),[]);return(rE(t.type)?zon:hHe(t.type)?jon:Bon)(e,n,i)}function Non(e,t){const n="_:vega:_"+Ron++,r=Ph({});if(it(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+Tt(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,mS({})]),{data:n,field:"data"}}function zon(e,t,n){const r=Oqe(e.sort,!0);let i,o;const s=n.map(c=>{const u=t.getData(c.data);return u||DV(c.data),u.countsRef(t,c.field,r)}),a={groupby:zne,pulse:s};r&&(i=r.op||"count",o=r.field?IV(i,r.field):"count",a.ops=[_qe[i]],a.fields=[t.fieldRef(o)],a.as=[o]),i=t.add(vqe(a));const l=t.add(Ph({pulse:wn(i)}));return o=t.add(Aon({field:zne,sort:t.sortRef(r),pulse:wn(l)})),wn(o)}function Oqe(e,t){return e&&(!e.field&&!e.op?Bt(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?et("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!_qe[e.op]&&et("Multiple domain scales can not be sorted using "+e.op)),e}function jon(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||DV(i.data),o.domainRef(t,i.field)});return wn(t.add(_on({values:r})))}function Bon(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||DV(i.data),o.extentRef(t,i.field)});return wn(t.add(Son({extents:r})))}function Uon(e,t){return e.signal||it(e)?Nz(e,t):t.objectProperty(e)}function Von(e,t){return e.signal?t.signalRef(e.signal):Bt(e)?{interval:Tf(e.interval),step:Tf(e.step)}:Tf(e)}function Won(e,t){t.interpolate=Tf(e.type||e),e.gamma!=null&&(t.interpolateGamma=Tf(e.gamma))}function Eqe(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(Ut(i)){if(r&&Qt(r,i))return e=rr({},e,{range:r[i]}),Eqe(e,t,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=rE(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:et("Unrecognized scale range value: "+Tt(i))}else if(i.scheme){n.scheme=it(i.scheme)?Nz(i.scheme,t):Tf(i.scheme,t),i.extent&&(n.schemeExtent=Nz(i.extent,t)),i.count&&(n.schemeCount=Tf(i.count,t));return}else if(i.step){n.rangeStep=Tf(i.step,t);return}else{if(rE(e.type)&&!it(i))return Cqe(i,e,t);it(i)||et("Unsupported range type: "+Tt(i))}return i.map(o=>(it(o)?Nz:Tf)(o,t))}function Hon(e,t){const n=t.config.projection||{},r={};for(const i in e)i!=="name"&&(r[i]=Bne(e[i],i,t));for(const i in n)r[i]==null&&(r[i]=Bne(n[i],i,t));t.addProjection(e.name,r)}function Bne(e,t,n){return it(e)?e.map(r=>Bne(r,t,n)):Bt(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:et("Unsupported parameter object: "+Tt(e)):e}const kh="top",ZT="left",JT="right",eb="bottom",Tqe="center",Gon="vertical",qon="start",Xon="middle",Yon="end",Une="index",Fde="label",Qon="offset",dE="perc",Kon="perc2",$f="value",oL="guide-label",$de="guide-title",Zon="group-title",Jon="group-subtitle",BOe="symbol",zz="gradient",Vne="discrete",Wne="size",esn="shape",tsn="fill",nsn="stroke",rsn="strokeWidth",isn="strokeDash",osn="opacity",Nde=[Wne,esn,tsn,nsn,rsn,isn,osn],sL={name:1,style:1,interactive:1},Nr={value:0},Nf={value:1},LV="group",Pqe="rect",zde="rule",ssn="symbol",vS="text";function mR(e){return e.type=LV,e.interactive=e.interactive||!1,e}function Gc(e,t){const n=(r,i)=>Nd(e[r],Nd(t[r],i));return n.isVertical=r=>Gon===Nd(e.direction,t.direction||(r?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>Nd(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>Nd(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>Nd(e.columns,Nd(t.columns,+n.isVertical(!0))),n}function kqe(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function asn(e,t,n){const r=t.config.style[n];return r&&r[e]}function FV(e,t,n){return`item.anchor === '${qon}' ? ${e} : item.anchor === '${Yon}' ? ${t} : ${n}`}const jde=FV(Tt(ZT),Tt(JT),Tt(Tqe));function lsn(e){const t=e("tickBand");let n=e("tickOffset"),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},Bt(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e("bandPosition"),i=e("tickExtra")),{extra:i,band:r,offset:n}}function Mqe(e,t){return t?e?Bt(e)?Object.assign({},e,{offset:Mqe(e.offset,t)}):{value:e,offset:t}:t:e}function Vu(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=KT(e.encode,t,sL)):e.interactive=!1,e}function csn(e,t,n,r){const i=Gc(e,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,c,u,f,d;o?(c=[0,1],u=[0,0],f=s,d=a):(c=[0,0],u=[1,0],f=a,d=s);const h={enter:l={opacity:Nr,x:Nr,y:Nr,width:na(f),height:na(d)},update:rr({},l,{opacity:Nf,fill:{gradient:t,start:c,stop:u}}),exit:{opacity:Nr}};return $a(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),Vu({type:Pqe,role:Fin,encode:h},r)}function usn(e,t,n,r,i){const o=Gc(e,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let c,u,f,d,h="";s?(c="y",f="y2",u="x",d="width",h="1-"):(c="x",f="x2",u="y",d="height");const p={opacity:Nr,fill:{scale:t,field:$f}};p[c]={signal:h+"datum."+dE,mult:l},p[u]=Nr,p[f]={signal:h+"datum."+Kon,mult:l},p[d]=na(a);const g={enter:p,update:rr({},p,{opacity:Nf}),exit:{opacity:Nr}};return $a(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Vu({type:Pqe,role:Din,key:$f,from:i,encode:g},r)}const fsn=`datum.${dE}<=0?"${ZT}":datum.${dE}>=1?"${JT}":"${Tqe}"`,dsn=`datum.${dE}<=0?"${eb}":datum.${dE}>=1?"${kh}":"${Xon}"`;function UOe(e,t,n,r){const i=Gc(e,t),o=i.isVertical(),s=na(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),c,u,f,d,h="";const p={enter:c={opacity:Nr},update:u={opacity:Nf,text:{field:Fde}},exit:{opacity:Nr}};return $a(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:Nd(e.labelLimit,t.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=u.baseline={signal:dsn},f="y",d="x",h="1-"):(c.align=u.align={signal:fsn},c.baseline={value:"top"},f="x",d="y"),c[f]=u[f]={signal:h+"datum."+dE,mult:a},c[d]=u[d]=s,s.offset=Nd(e.labelOffset,t.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+Une}:void 0,Vu({type:vS,role:fqe,style:oL,key:$f,from:r,encode:p,overlap:l},n)}function hsn(e,t,n,r,i){const o=Gc(e,t),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${Qon} : datum.${Wne}`,h=c?na(c):{field:Wne},p=`datum.${Une}`,g=`max(1, ${i})`;let m,v,y,b,w;h.mult=.5,m={enter:v={opacity:Nr,x:{signal:d,mult:.5,offset:u},y:h},update:y={opacity:Nf,x:v.x,y:v.y},exit:{opacity:Nr}};let S=null,_=null;e.fill||(S=t.symbolBaseFillColor,_=t.symbolBaseStrokeColor),$a(m,{fill:o("symbolFillColor",S),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),Nde.forEach(P=>{e[P]&&(y[P]=v[P]={scale:e[P],field:$f})});const E=Vu({type:ssn,role:$in,key:$f,from:f,clip:c?!0:void 0,encode:m},n.symbols),T=na(u);T.offset=o("labelOffset"),m={enter:v={opacity:Nr,x:{signal:d,offset:T},y:h},update:y={opacity:Nf,text:{field:Fde},x:v.x,y:v.y},exit:{opacity:Nr}},$a(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=Vu({type:vS,role:fqe,style:oL,key:$f,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!c},width:Nr,height:c?na(c):Nr,opacity:Nr},exit:{opacity:Nr},update:y={opacity:Nf,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,y.row.signal=`${p}%${b}`,y.column.signal=`floor(${p} / ${b})`,w={field:["row",p]}):(y.row.signal=`floor(${p} / ${g})`,y.column.signal=`${p} % ${g}`,w={field:p}),y.column.signal=`(${i})?${y.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:Une}},mR({role:Ide,from:r,encode:KT(m,s,sL),marks:[E,k],name:l,interactive:a,sort:w})}function psn(e,t){const n=Gc(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const Bde='item.orient === "left"',Ude='item.orient === "right"',$V=`(${Bde} || ${Ude})`,gsn=`datum.vgrad && ${$V}`,msn=FV('"top"','"bottom"','"middle"'),vsn=FV('"right"','"left"','"center"'),ysn=`datum.vgrad && ${Ude} ? (${vsn}) : (${$V} && !(datum.vgrad && ${Bde})) ? "left" : ${jde}`,bsn=`item._anchor || (${$V} ? "middle" : "start")`,xsn=`${gsn} ? (${Bde} ? -90 : 90) : 0`,wsn=`${$V} ? (datum.vgrad ? (${Ude} ? "bottom" : "top") : ${msn}) : "top"`;function Ssn(e,t,n,r){const i=Gc(e,t),o={enter:{opacity:Nr},update:{opacity:Nf,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Nr}};return $a(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:bsn},angle:{signal:xsn},align:{signal:ysn},baseline:{signal:wsn},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),Vu({type:vS,role:Nin,style:$de,from:r,encode:o},n)}function _sn(e,t){let n;return Bt(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+VOe(e.path)+")":e.sphere&&(n="geoShape("+VOe(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function VOe(e){return Bt(e)&&e.signal?e.signal:Tt(e)}function Aqe(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===LV?Ide:t||Ade}function Csn(e){return{marktype:e.type,name:e.name||void 0,role:e.role||Aqe(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Osn(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function Vde(e,t){const n=l8e(e.type);n||et("Unrecognized transform type: "+Tt(e.type));const r=RV(n.type.toLowerCase(),null,Rqe(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function Rqe(e,t,n){const r={},i=e.params.length;for(let o=0;oWOe(e,o,n)):WOe(e,i,n)}function WOe(e,t,n){const r=e.type;if($s(t))return GOe(r)?et("Expression references can not be signals."):H7(r)?n.fieldRef(t):qOe(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||H7(r);return i&&ksn(t)?n.exprRef(t.expr,t.as):i&&Msn(t)?pR(t.field,t.as):GOe(r)?og(t,n):Asn(r)?wn(n.getData(t).values):H7(r)?pR(t):qOe(r)?n.compareRef(t):t}}function Tsn(e,t,n){return Ut(t.from)||et('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Psn(e,t,n){const r=t[e.name];return e.array?(it(r)||et("Expected an array of sub-parameters. Instead: "+Tt(r)),r.map(i=>HOe(e,i,n))):HOe(e,r,n)}function HOe(e,t,n){const r=e.params.length;let i;for(let s=0;se&&e.expr,Msn=e=>e&&e.field,Asn=e=>e==="data",GOe=e=>e==="expr",H7=e=>e==="field",qOe=e=>e==="compare";function Rsn(e,t,n){let r,i,o,s,a;return e?(r=e.facet)&&(t||et("Only group marks can be faceted."),r.field!=null?s=a=jz(r,n):(e.data?a=wn(n.getData(e.data).aggregate):(o=Vde(rr({type:"aggregate",groupby:Ht(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=jz(r,n),s=a=wn(n.add(o))),i=n.keyRef(r.groupby,!0))):s=wn(n.add(Ph(null,[{}]))),s||(s=jz(e,n)),{key:i,pulse:s,parent:a}}function jz(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:wn(t.getData(e.data).output)}function vw(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}vw.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",u=og(c,t);l.update=u.$expr,l.params=u.$params}function NV(e,t){const n=Aqe(e),r=e.type===LV,i=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===Ide||n===Rde,a,l,c,u,f,d,h;const p=n===Ade||s||i,g=Rsn(e.from,r,t);l=t.add(pon({key:g.key||(e.key?pR(e.key):void 0),pulse:g.pulse,clean:!r}));const m=wn(l);l=c=t.add(Ph({pulse:m})),l=t.add(won({markdef:Csn(e),interactive:Osn(e.interactive,t),clip:_sn(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:wn(l)}));const v=wn(l);l=u=t.add(bqe(gqe(e.encode,e.type,n,e.style,t,{mod:!1,pulse:v}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach(_=>{const E=Vde(_,t),T=E.metadata;(T.generates||T.changes)&&et("Mark transforms should not generate new data."),T.nomod||(u.params.mod=!0),E.params.pulse=wn(l),t.add(l=E)}),e.sort&&(l=t.add(Mon({sort:t.compareRef(e.sort),pulse:wn(l)})));const y=wn(l);(i||s)&&(s=t.add(Sqe({layout:t.objectProperty(e.layout),legends:t.legends,mark:v,pulse:y})),d=wn(s));const b=t.add(yqe({mark:v,pulse:d||y}));h=wn(b),r&&(p&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(y,d||h,m),i?Isn(e,t,g):p?Dsn(e,t,g):t.parse(e),t.popState(),p&&(s&&a.push(s),a.push(b))),o&&(h=Lsn(o,h,t));const w=t.add(wqe({pulse:h})),S=t.add(mS({pulse:wn(w)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new vw(t,c,w,S)),e.on&&e.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&et("Marks only support modify triggers."),Dqe(_,t,f)}))}function Lsn(e,t,n){const r=e.method,i=e.bound,o=e.separation,s={separation:$s(o)?n.signalRef(o.signal):o,method:$s(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),i){const a=i.tolerance;s.boundTolerance=$s(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return wn(n.add(Con(s)))}function Fsn(e,t){const n=t.config.legend,r=e.encode||{},i=Gc(e,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,c={};let u=0,f,d,h;Nde.forEach(b=>e[b]?(c[b]=e[b],u=u||e[b]):0),u||et("Missing valid scale for legend.");const p=$sn(e,t.scaleType(u)),g={title:e.title!=null,scales:c,type:p,vgrad:p!=="symbol"&&i.isVertical()},m=wn(t.add(Ph(null,[g]))),v={enter:{x:{value:0},y:{value:0}}},y=wn(t.add(bon(d={type:p,scale:t.scaleRef(u),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===zz?(h=[csn(e,u,n,r.gradient),UOe(e,n,r.labels,y)],d.count=d.count||t.signalRef(`max(2,2*floor((${R1(i.gradientLength())})/100))`)):p===Vne?h=[usn(e,u,n,r.gradient,y),UOe(e,n,r.labels,y)]:(f=psn(e,n),h=[hsn(e,n,r,y,R1(f.columns))],d.size=jsn(e,t,h[0].marks)),h=[mR({role:Lin,from:m,encode:v,marks:h,layout:f,interactive:a})],g.title&&h.push(Ssn(e,n,r.title,m)),NV(mR({role:Iin,from:m,encode:KT(zsn(i,e,n),o,sL),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),t)}function $sn(e,t){let n=e.type||BOe;return!e.type&&Nsn(e)===1&&(e.fill||e.stroke)&&(n=Vue(t)?zz:Lte(t)?Vne:BOe),n!==zz?n:Lte(t)?Vne:zz}function Nsn(e){return Nde.reduce((t,n)=>t+(e[n]?1:0),0)}function zsn(e,t,n){const r={enter:{},update:{}};return $a(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function jsn(e,t,n){const r=R1(YOe("size",e,n)),i=R1(YOe("strokeWidth",e,n)),o=R1(Bsn(n[1].encode,t,oL));return og(`max(ceil(sqrt(${r})+${i}),${o})`,t)}function YOe(e,t,n){return t[e]?`scale("${t[e]}",datum)`:kqe(e,n[0].encode)}function Bsn(e,t,n){return kqe("fontSize",e)||asn("fontSize",t,n)}const Usn=`item.orient==="${ZT}"?-90:item.orient==="${JT}"?90:0`;function Vsn(e,t){e=Ut(e)?{text:e}:e;const n=Gc(e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],c={},u=wn(t.add(Ph(null,[c])));return l.push(Gsn(e,n,Wsn(e),u)),e.subtitle&&l.push(qsn(e,n,r.subtitle,u)),NV(mR({role:zin,from:u,encode:Hsn(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function Wsn(e){const t=e.encode;return t&&t.title||rr({name:e.name,interactive:e.interactive,style:e.style},t)}function Hsn(e,t){const n={enter:{},update:{}};return $a(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:jde},angle:{signal:Usn},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),KT(n,t,sL)}function Gsn(e,t,n,r){const i={value:0},o=e.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return $a(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Vu({type:vS,role:jin,style:Zon,from:r,encode:s},n)}function qsn(e,t,n,r){const i={value:0},o=e.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return $a(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Vu({type:vS,role:Bin,style:Jon,from:r,encode:s},n)}function Xsn(e,t){const n=[];e.transform&&e.transform.forEach(r=>{n.push(Vde(r,t))}),e.on&&e.on.forEach(r=>{Dqe(r,t,e.name)}),t.addDataPipeline(e.name,Ysn(e,t,n))}function Ysn(e,t,n){const r=[];let i=null,o=!1,s=!1,a,l,c,u,f;for(e.values?$s(e.values)||$z(e.format)?(r.push(QOe(t,e)),r.push(i=dx())):r.push(i=dx({$ingest:e.values,$format:e.format})):e.url?$z(e.url)||$z(e.format)?(r.push(QOe(t,e)),r.push(i=dx())):r.push(i=dx({$request:e.url,$format:e.format})):e.source&&(i=a=Ht(e.source).map(d=>wn(t.getData(d).output)),r.push(null)),l=0,c=n.length;le===eb||e===kh,zV=(e,t,n)=>$s(e)?Jsn(e.signal,t,n):e===ZT||e===kh?t:n,ra=(e,t,n)=>$s(e)?Ksn(e.signal,t,n):Lqe(e)?t:n,lh=(e,t,n)=>$s(e)?Zsn(e.signal,t,n):Lqe(e)?n:t,Fqe=(e,t,n)=>$s(e)?ean(e.signal,t,n):e===kh?{value:t}:{value:n},Qsn=(e,t,n)=>$s(e)?tan(e.signal,t,n):e===JT?{value:t}:{value:n},Ksn=(e,t,n)=>$qe(`${e} === '${kh}' || ${e} === '${eb}'`,t,n),Zsn=(e,t,n)=>$qe(`${e} !== '${kh}' && ${e} !== '${eb}'`,t,n),Jsn=(e,t,n)=>Wde(`${e} === '${ZT}' || ${e} === '${kh}'`,t,n),ean=(e,t,n)=>Wde(`${e} === '${kh}'`,t,n),tan=(e,t,n)=>Wde(`${e} === '${JT}'`,t,n),$qe=(e,t,n)=>(t=t!=null?na(t):t,n=n!=null?na(n):n,KOe(t)&&KOe(n)?(t=t?t.signal||Tt(t.value):null,n=n?n.signal||Tt(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[rr({test:e},t)].concat(n||[])),KOe=e=>e==null||Object.keys(e).length===1,Wde=(e,t,n)=>({signal:`${e} ? (${zC(t)}) : (${zC(n)})`}),nan=(e,t,n,r,i)=>({signal:(r!=null?`${e} === '${ZT}' ? (${zC(r)}) : `:"")+(n!=null?`${e} === '${eb}' ? (${zC(n)}) : `:"")+(i!=null?`${e} === '${JT}' ? (${zC(i)}) : `:"")+(t!=null?`${e} === '${kh}' ? (${zC(t)}) : `:"")+"(null)"}),zC=e=>$s(e)?e.signal:e==null?null:Tt(e),ran=(e,t)=>t===0?0:$s(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},cO=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function k_(e,t,n,r){let i;if(t&&Qt(t,e))return t[e];if(Qt(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[$de][i]}else if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[oL][i]}return null}function ZOe(e){const t={};for(const n of e)if(n)for(const r in n)t[r]=1;return Object.keys(t)}function ian(e,t){var n=t.config,r=n.style,i=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,l,c;if($s(s)){const f=ZOe([n.axisX,n.axisY]),d=ZOe([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(c of f)a[c]=ra(s,k_(c,n.axisX,i,r),k_(c,n.axisY,i,r));l={};for(c of d)l[c]=nan(s.signal,k_(c,n.axisTop,i,r),k_(c,n.axisBottom,i,r),k_(c,n.axisLeft,i,r),k_(c,n.axisRight,i,r))}else a=s===kh||s===eb?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?rr({},i,a,l,o):i}function oan(e,t,n,r){const i=Gc(e,t),o=e.orient;let s,a;const l={enter:s={opacity:Nr},update:a={opacity:Nf},exit:{opacity:Nr}};$a(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const c=JOe(e,0),u=JOe(e,1);return s.x=a.x=ra(o,c,Nr),s.x2=a.x2=ra(o,u),s.y=a.y=lh(o,c,Nr),s.y2=a.y2=lh(o,u),Vu({type:zde,role:Pin,from:r,encode:l},n)}function JOe(e,t){return{scale:e.scale,range:t}}function san(e,t,n,r,i){const o=Gc(e,t),s=e.orient,a=e.gridScale,l=zV(s,1,-1),c=aan(e.offset,l);let u,f,d;const h={enter:u={opacity:Nr},update:d={opacity:Nf},exit:f={opacity:Nr}};$a(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:$f,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=ra(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:c}:{value:0,offset:c},v=a?{scale:a,range:1,mult:l,offset:c}:rr(g,{mult:l,offset:c});return u.x=d.x=ra(s,p,m),u.y=d.y=lh(s,p,m),u.x2=d.x2=lh(s,v),u.y2=d.y2=ra(s,v),f.x=ra(s,p),f.y=lh(s,p),Vu({type:zde,role:kin,key:$f,from:r,encode:h},n)}function aan(e,t){if(t!==1)if(!Bt(e))e=$s(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=rr({},e);for(;n.mult!=null;)if(Bt(n.mult))n=n.mult=rr({},n.mult);else return n.mult=$s(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function lan(e,t,n,r,i,o){const s=Gc(e,t),a=e.orient,l=zV(a,-1,1);let c,u,f;const d={enter:c={opacity:Nr},update:f={opacity:Nf},exit:u={opacity:Nr}};$a(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=na(i);h.mult=l;const p={scale:e.scale,field:$f,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=c.y=ra(a,Nr,p),f.y2=c.y2=ra(a,h),u.x=ra(a,p),f.x=c.x=lh(a,Nr,p),f.x2=c.x2=lh(a,h),u.y=lh(a,p),Vu({type:zde,role:Ain,key:$f,from:r,encode:d},n)}function G7(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function can(e,t,n,r,i,o){const s=Gc(e,t),a=e.orient,l=e.scale,c=zV(a,-1,1),u=R1(s("labelFlush")),f=R1(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=u===0||!!u,g;const m=na(i);m.mult=c,m.offset=na(s("labelPadding")||0),m.offset.mult=c;const v={scale:l,field:$f,band:.5,offset:Mqe(o.offset,s("labelOffset"))},y=ra(a,p?G7(l,u,'"left"','"right"','"center"'):{value:"center"},Qsn(a,"left","right")),b=ra(a,Fqe(a,"bottom","top"),p?G7(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),w=G7(l,u,`-(${f})`,f,0);p=p&&f;const S={opacity:Nr,x:ra(a,v,m),y:lh(a,v,m)},_={enter:S,update:g={opacity:Nf,text:{field:Fde},x:S.x,y:S.y,align:y,baseline:b},exit:{opacity:Nr,x:S.x,y:S.y}};$a(_,{dx:!d&&p?ra(a,w):null,dy:!h&&p?lh(a,w):null}),$a(_,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const E=s("labelBound");let T=s("labelOverlap");return T=T||E?{separation:s("labelSeparation"),method:T,order:"datum.index",bound:E?{scale:l,orient:a,tolerance:E}:null}:void 0,g.align!==y&&(g.align=cO(g.align,y)),g.baseline!==b&&(g.baseline=cO(g.baseline,b)),Vu({type:vS,role:Min,style:oL,key:$f,from:r,encode:_,overlap:T},n)}function uan(e,t,n,r){const i=Gc(e,t),o=e.orient,s=zV(o,-1,1);let a,l;const c={enter:a={opacity:Nr,anchor:na(i("titleAnchor",null)),align:{signal:jde}},update:l=rr({},a,{opacity:Nf,text:na(e.title)}),exit:{opacity:Nr}},u={signal:`lerp(range("${e.scale}"), ${FV(0,1,.5)})`};return l.x=ra(o,u),l.y=lh(o,u),a.angle=ra(o,Nr,ran(s,90)),a.baseline=ra(o,Fqe(o,eb,kh),{value:eb}),l.angle=a.angle,l.baseline=a.baseline,$a(c,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),fan(i,o,c,n),c.update.align=cO(c.update.align,a.align),c.update.angle=cO(c.update.angle,a.angle),c.update.baseline=cO(c.update.baseline,a.baseline),Vu({type:vS,role:Rin,style:$de,from:r,encode:c},n)}function fan(e,t,n,r){const i=(a,l)=>a!=null?(n.update[l]=cO(na(a),n.update[l]),!1):!yC(l,r),o=i(e("titleX"),"x"),s=i(e("titleY"),"y");n.enter.auto=s===o?na(s):ra(t,na(s),na(o))}function dan(e,t){const n=ian(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=Gc(e,n),c=lsn(l),u={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:e.title!=null},f=wn(t.add(Ph({},[u]))),d=wn(t.add(hon({scale:t.scaleRef(e.scale),extra:t.property(c.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return u.grid&&h.push(san(e,n,r.grid,d,c)),u.ticks&&(p=l("tickSize"),h.push(lan(e,n,r.ticks,d,p,c))),u.labels&&(p=u.ticks?p:0,h.push(can(e,n,r.labels,d,p,c))),u.domain&&h.push(oan(e,n,r.domain,f)),u.title&&h.push(uan(e,n,r.title,f)),NV(mR({role:Tin,from:f,encode:KT(han(l,e),i,sL),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),t)}function han(e,t){const n={enter:{},update:{}};return $a(n,{orient:e("orient"),offset:e("offset")||0,position:Nd(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function Nqe(e,t,n){const r=Ht(e.signals),i=Ht(e.scales);return n||r.forEach(o=>mqe(o,t)),Ht(e.projections).forEach(o=>Hon(o,t)),i.forEach(o=>Ion(o,t)),Ht(e.data).forEach(o=>Xsn(o,t)),i.forEach(o=>Don(o,t)),(n||r).forEach(o=>don(o,t)),Ht(e.axes).forEach(o=>dan(o,t)),Ht(e.marks).forEach(o=>NV(o,t)),Ht(e.legends).forEach(o=>Fsn(o,t)),e.title&&Vsn(e.title,t),t.parseLambdas(),t}const pan=e=>KT({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function gan(e,t){const n=t.config,r=wn(t.root=t.add(SB())),i=man(e,n);i.forEach(c=>mqe(c,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Ph()),s=t.add(bqe(gqe(pan(e.encode),LV,Rde,e.style,t,{pulse:wn(o)}))),a=t.add(Sqe({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:wn(s)}));t.operators.pop(),t.pushState(wn(s),wn(a),null),Nqe(e,t,i),t.operators.push(a);let l=t.add(yqe({mark:r,pulse:wn(a)}));return l=t.add(wqe({pulse:wn(l)})),l=t.add(mS({pulse:wn(l)})),t.addData("root",new vw(t,o,o,l)),t}function Kk(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function man(e,t){const n=s=>Nd(e[s],t[s]),r=[Kk("background",n("background")),Kk("autosize",Cin(n("autosize"))),Kk("padding",Ein(n("padding"))),Kk("width",n("width")||0),Kk("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return Ht(e.signals).forEach(s=>{Qt(i,s.name)?s=rr(i[s.name],s):r.push(s),o[s.name]=s}),Ht(t.signals).forEach(s=>{!Qt(o,s.name)&&!Qt(i,s.name)&&r.push(s)}),r}function zqe(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function eEe(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}zqe.prototype=eEe.prototype={parse(e){return Nqe(e,this)},fork(){return new eEe(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof Nne?wn(e):e;return this.add(Ton({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(wn(this.add(mS({pulse:e})))),this._parent.push(t),this._lookup.push(n?wn(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ar(this._parent)},encode(){return Ar(this._encode)},lookup(){return Ar(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Ut(e))return pR(e,t);e.signal||et("Unsupported field reference: "+Tt(e));const n=e.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};t&&(i.as=t),this.field[n]=r=wn(this.add(von(i)))}return r},compareRef(e){let t=!1;const n=o=>$s(o)?(t=!0,this.signalRef(o.signal)):non(o)?(t=!0,this.exprRef(o.expr)):o,r=Ht(e.field).map(n),i=Ht(e.order).map(n);return t?wn(this.add(jOe({fields:r,orders:i}))):NOe(r,i)},keyRef(e,t){let n=!1;const r=o=>$s(o)?(n=!0,wn(i[o.signal])):o,i=this.signals;return e=Ht(e).map(r),n?wn(this.add(yon({fields:e,flat:t}))):Zin(e,t)},sortRef(e){if(!e)return e;const t=IV(e.op,e.field),n=e.order||Jin;return n.signal?wn(this.add(jOe({fields:t,orders:this.signalRef(n.signal)}))):NOe(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return Qt(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&et("Duplicate signal name: "+Tt(e));const n=t instanceof Nne?t:this.add(SB(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||et("Unrecognized signal name: "+Tt(e)),this.signals[e]},signalRef(e){return this.signals[e]?wn(this.signals[e]):(Qt(this.lambdas,e)||(this.lambdas[e]=this.add(SB(null))),wn(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(Bt(i)?i.signal||Hde(i):Tt(i))}return n+"]"}function yan(e){let t="{",n=0,r,i;for(r in e)i=e[r],t+=(++n>1?",":"")+Tt(r)+":"+(Bt(i)?i.signal||Hde(i):Tt(i));return t+"}"}function ban(){const e="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:e,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:e,fontSize:10},"guide-title":{fill:i,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function xan(e,t,n){return Bt(e)||et("Input Vega specification must be an object."),t=$T(ban(),t,e.config),gan(e,new zqe(t,n)).toRuntime()}var wan="6.2.0";rr(ZO,sHt,jXt,yYt,rKt,KKt,CJt,rJt,EJt,QJt,sen,hen);const San=wan,_an=Object.freeze(Object.defineProperty({__proto__:null,Bounds:ws,CanvasHandler:QD,CanvasRenderer:Fj,DATE:Nc,DAY:ll,DAYOFYEAR:rg,Dataflow:oO,Debug:RUe,DisallowedObjectProperties:Gle,Error:qle,EventStream:LU,Gradient:PHe,GroupItem:lV,HOURS:ju,Handler:pfe,HybridHandler:yGe,HybridRenderer:Gte,Info:AUe,Item:aV,MILLISECONDS:vh,MINUTES:Bu,MONTH:hl,Marks:Uu,MultiPulse:yce,None:MUe,Operator:ji,Parameters:DU,Pulse:M0,QUARTER:$c,RenderType:u0,Renderer:YD,ResourceLoader:DHe,SECONDS:Kf,SVGHandler:oGe,SVGRenderer:xfe,SVGStringRenderer:vGe,Scenegraph:KHe,TIME_UNITS:lce,Transform:Je,View:rqe,WEEK:Ds,Warn:Xle,YEAR:La,accessor:Hc,accessorFields:dl,accessorName:Bo,array:Ht,ascending:zT,bandwidthNRD:Sce,bin:f8e,bootstrapCI:d8e,boundClip:PGe,boundContext:HD,boundItem:Bte,boundMark:qHe,boundStroke:Pv,changeset:hS,clampRange:VUe,codegenExpression:M7e,compare:Zle,constant:vl,cumulativeLogNormal:Pce,cumulativeNormal:$U,cumulativeUniform:Rce,dayofyear:yVe,debounce:Jle,defaultLocale:hce,definition:l8e,densityLogNormal:Tce,densityNormal:_ce,densityUniform:Ace,domChild:As,domClear:mf,domCreate:l0,domFind:hfe,dotbin:h8e,error:et,expressionFunction:ls,extend:rr,extent:eg,extentIndex:WUe,falsy:Ay,fastmap:jT,field:Yf,flush:HUe,font:hV,fontFamily:XD,fontSize:bg,format:vz,formatLocale:dj,formats:mce,hasOwnProperty:Qt,id:TD,identity:ml,inferType:KVe,inferTypes:ZVe,ingest:li,inherits:Rt,inrange:IC,interpolate:Wue,interpolateColors:oV,interpolateRange:pHe,intersect:CGe,intersectBoxLine:LC,intersectPath:Zue,intersectPoint:Jue,intersectRule:FHe,isArray:it,isBoolean:cS,isDate:P0,isFunction:Jn,isIterable:GUe,isNumber:Qr,isObject:Bt,isRegExp:ece,isString:Ut,isTuple:RU,key:tce,lerp:qUe,lineHeight:K0,loader:MU,locale:YVe,logger:wU,lruCache:XUe,markup:bfe,merge:YUe,mergeConfig:$T,multiLineOffset:ufe,one:FT,pad:QUe,panLinear:$Ue,panLog:NUe,panPow:zUe,panSymlog:jUe,parse:xan,parseExpression:bde,parseSelector:Ab,path:UU,pathCurves:Yue,pathEqual:kGe,pathParse:iE,pathRectangle:AHe,pathRender:nR,pathSymbols:MHe,pathTrail:RHe,peek:Ar,point:gV,projection:zfe,quantileLogNormal:kce,quantileNormal:NU,quantileUniform:Ice,quantiles:xce,quantizeInterpolator:gHe,quarter:BUe,quartiles:wce,get random(){return Zf},randomInteger:uWt,randomKDE:Oce,randomLCG:cWt,randomLogNormal:g8e,randomMixture:m8e,randomNormal:Cce,randomUniform:v8e,read:t8e,regressionConstant:Dce,regressionExp:b8e,regressionLinear:Lce,regressionLoess:S8e,regressionLog:y8e,regressionPoly:w8e,regressionPow:x8e,regressionQuad:Fce,renderModule:mV,repeat:q2,resetDefaultLocale:a8t,resetSVGDefIds:iXt,responseType:e8e,runtimeContext:W7e,sampleCurve:jU,sampleLogNormal:Ece,sampleNormal:FU,sampleUniform:Mce,scale:Zr,sceneEqual:wfe,sceneFromJSON:YHe,scenePickVisit:Pj,sceneToJSON:XHe,sceneVisit:yh,sceneZOrder:efe,scheme:Hue,serializeXML:hGe,setHybridRendererOptions:eXt,setRandom:aWt,span:PD,splitAccessPath:vg,stringValue:Tt,textMetrics:Au,timeBin:LVe,timeFloor:OVe,timeFormatLocale:XA,timeInterval:WT,timeOffset:PVe,timeSequence:AVe,timeUnitSpecifier:vVe,timeUnits:cce,toBoolean:nce,toDate:rce,toNumber:cl,toSet:mh,toString:ice,transform:c8e,transforms:ZO,truncate:KUe,truthy:Qf,tupleid:Sn,typeParsers:_te,utcFloor:EVe,utcInterval:HT,utcOffset:kVe,utcSequence:RVe,utcdayofyear:wVe,utcquarter:UUe,utcweek:SVe,version:San,visitArray:Hy,week:bVe,writeConfig:NT,zero:t0,zoomLinear:Yle,zoomLog:Qle,zoomPow:ij,zoomSymlog:Kle},Symbol.toStringTag,{value:"Module"}));function Can(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var Oan={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},Ean={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},Tan={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const Pan=Array.prototype.slice,hx=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,Pan.call(t,1))},kan=(e,t=0,n=1,r=0,i=0,o=0,s=0)=>Ut(e)?new Date(e):new Date(e,t,n,r,i,o,s);var Man={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:kan,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return hx("join",arguments)},indexof:function(){return hx("indexOf",arguments)},lastindexof:function(){return hx("lastIndexOf",arguments)},slice:function(){return hx("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(zT),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return hx("substring",arguments,String)},split:function(){return hx("split",arguments,String)},replace:function(){return hx("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Aan=["view","item","group","xy","x","y"],Hne=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Hne.add(setImmediate);const Ran={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:Oan[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),Hne.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||Man[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Ean[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Tan[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,r)=>{e.memberDepth+=1;const i=e(r.key);e.memberDepth-=1;const o=e(r.value);return Gle.has(i)?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):Hne.has(o)?console.error(`Prevented interpretation of method "${i}" which could lead to insecure code execution`):n[i]=o,n},{})};function Zk(e,t,n,r,i,o){const s=a=>Ran[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=r,s.event=i,s.item=o,Aan.forEach(a=>s.fn[a]=(...l)=>i.vega[a](...l)),s(e)}var Ian={operator(e,t){const n=t.ast,r=e.functions;return i=>Zk(n,r,i)},parameter(e,t){const n=t.ast,r=e.functions;return(i,o)=>Zk(n,r,o,i)},event(e,t){const n=t.ast,r=e.functions;return i=>Zk(n,r,void 0,void 0,i)},handler(e,t){const n=t.ast,r=e.functions;return(i,o)=>{const s=o.item&&o.item.datum;return Zk(n,r,i,s,o)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const l=s.datum;let c=0,u;for(const f in r)u=Zk(r[f].ast,i,a,l,void 0,s),s[f]!==u&&(s[f]=u,c=1);return n!=="rule"&&Can(s,r,o),c}}},Dan="6.4.2",Lan={version:Dan};function Gde(e){return _t(e,"or")}function qde(e){return _t(e,"and")}function Xde(e){return _t(e,"not")}function Bz(e,t){if(Xde(e))Bz(e.not,t);else if(qde(e))for(const n of e.and)Bz(n,t);else if(Gde(e))for(const n of e.or)Bz(n,t);else t(e)}function uO(e,t){return Xde(e)?{not:uO(e.not,t)}:qde(e)?{and:e.and.map(n=>uO(n,t))}:Gde(e)?{or:e.or.map(n=>uO(n,t))}:t(e)}const Un=structuredClone;function jqe(e){throw new Error(e)}function hE(e,t){const n={};for(const r of t)Qt(e,r)&&(n[r]=e[r]);return n}function Iu(e,t){const n={...e};for(const r of t)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Ei(e)).join(",")})`};function ar(e){if(Qr(e))return e;const t=Ut(e)?e:Ei(e);if(t.length<250)return t;let n=0;for(let r=0;ra===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function Kde(e,t){return e===void 0||t===void 0?!0:Qde(qne(e),qne(t))}function Vi(e){return wt(e).length===0}const wt=Object.keys,ys=Object.values,tb=Object.entries;function gE(e){return e===!0||e===!1}function _B(e){return Ut(e)||Qr(e)||gE(e)}function xo(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function QM(e,t){return Xde(e)?`!(${QM(e.not,t)})`:qde(e)?`(${e.and.map(n=>QM(n,t)).join(") && (")})`:Gde(e)?`(${e.or.map(n=>QM(n,t)).join(") || (")})`:t(e)}function CB(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&CB(e[n],t)&&delete e[n],Vi(e)}function aL(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Zde(e,t="datum"){const n=vg(e),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(Tt).join("][")}]`;r.push(`${t}${o}`)}return r.join(" && ")}function Vqe(e,t="datum"){return`${t}[${Tt(vg(e).join("."))}]`}function Ci(e){return`datum['${e.replaceAll("'","\\'")}']`}function Wqe(e){return e.replaceAll("\\'","'").replaceAll("\\.",".")}function Nan(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function ed(e){return`${vg(e).map(Nan).join("\\.")}`}function yw(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function eP(e){return`${vg(e).join(".")}`}function mE(e){return e?vg(e).length:0}function is(...e){return e.find(t=>t!==void 0)}let Hqe=42;function Gqe(e){const t=++Hqe;return e?String(e)+t:t}function zan(){Hqe=42}function qqe(e){return Xqe(e)?e:`__${e}`}function Xqe(e){return e.startsWith("__")}function vR(e){if(e!==void 0)return(e%360+360)%360}function jV(e){return Qr(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const tEe=Object.getPrototypeOf(structuredClone({}));function Cu(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Cu(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;for(const o of e.entries())if(!Cu(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==tEe.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==tEe.toString)return e.toString()===t.toString();const i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!Cu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ei(e){const t=[];return(function n(r){if(r?.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?`${r}`:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;iXV(e[t])?xo(`_${t}_${tb(e[t])}`):xo(`_${t}_${e[t]}`)).join("")}`}function eo(e){return e===!0||xS(e)&&!e.binned}function xa(e){return e==="binned"||xS(e)&&e.binned===!0}function xS(e){return Bt(e)}function XV(e){return _t(e,"param")}function nEe(e){switch(e){case Hm:case Gm:case Rv:case jc:case Cg:case Og:case Fb:case Iv:case Db:case Lb:case Bc:return 6;case $b:return 4;default:return 10}}function fL(e){return _t(e,"expr")}function Sa(e,{level:t}={level:0}){const n=wt(e||{}),r={};for(const i of n)r[i]=t===0?xu(e[i]):Sa(e[i],{level:t-1});return r}function lXe(e){const{anchor:t,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},v={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},y={...l?{subtitleColor:l}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},b=hE(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:b,nonMarkTitleProperties:v,subtitle:y}}function Yy(e){return Ut(e)||it(e)&&Ut(e[0])}function hn(e){return _t(e,"signal")}function wS(e){return _t(e,"step")}function cXe(e){return it(e)?!1:_t(e,"fields")&&!_t(e,"data")}function uln(e){return it(e)?!1:_t(e,"fields")&&_t(e,"data")}function Lm(e){return it(e)?!1:_t(e,"field")&&_t(e,"data")}const fln={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},dln=wt(fln),hln={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Xne=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],pln=" – ";function uXe(e){const t=it(e.condition)?e.condition.map(rEe):rEe(e.condition);return{...xu(e),condition:t}}function xu(e){if(fL(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function rEe(e){if(fL(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function lo(e){if(fL(e)){const{expr:t,...n}=e;return{signal:t,...n}}return hn(e)?e:e!==void 0?{value:e}:void 0}function gln(e){return hn(e)?e.signal:Tt(e)}function iEe(e){return hn(e)?e.signal:Tt(e.value)}function eh(e){return hn(e)?e.signal:e==null?null:Tt(e)}function mln(e,t,n){for(const r of n){const i=sg(r,t.markDef,t.config);i!==void 0&&(e[r]=lo(i))}return e}function fXe(e){return[].concat(e.type,e.style??[])}function vi(e,t,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&_t(t,i)?t[i]:t[e]!==void 0?t[e]:o&&(!i||i===e)?void 0:sg(e,t,n,r)}function sg(e,t,n,{vgChannel:r}={}){const i=Yne(e,t,n.style);return is(r?i:void 0,i,r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function Yne(e,t,n){return dXe(e,fXe(t),n)}function dXe(e,t,n){t=Ht(t);let r;for(const i of t){const o=n[i];_t(o,e)&&(r=o[e])}return r}function hXe(e,t){return Ht(e).reduce((n,r)=>(n.field.push(It(r,t)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function pXe(e,t){const n=[...e];return t.forEach(r=>{for(const i of n)if(Cu(i,r))return;n.push(r)}),n}function gXe(e,t){return Cu(e,t)||!t?e:e?[...Ht(e),...Ht(t)].join(", "):t}function mXe(e,t){const n=e.value,r=t.value;if(n==null||r===null)return{explicit:e.explicit,value:null};if((Yy(n)||hn(n))&&(Yy(r)||hn(r)))return{explicit:e.explicit,value:gXe(n,r)};if(Yy(n)||hn(n))return{explicit:e.explicit,value:n};if(Yy(r)||hn(r))return{explicit:e.explicit,value:r};if(!Yy(n)&&!hn(n)&&!Yy(r)&&!hn(r))return{explicit:e.explicit,value:pXe(n,r)};throw new Error("It should never reach here")}function lhe(e){return`Invalid specification ${Ei(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const vln='Autosize "fit" only works for single views and layered views.';function oEe(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function sEe(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function aEe(e){return e?`Dropping "fit-${e}" because spec has discrete ${Uc(e)}.`:'Dropping "fit" because spec has discrete size.'}function che(e){return`Unknown field for ${e}. Cannot calculate view size.`}function lEe(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function yln(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function bln(e){return`The "nearest" transform is not supported for ${e} marks.`}function vXe(e){return`Selection not supported for ${e} yet.`}function xln(e){return`Cannot find a selection named "${e}".`}const wln="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Sln="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",_ln="Legend bindings are only supported for selections over an individual field or encoding channel.";function Cln(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Oln(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Eln="The same selection must be used to override scale domains in a layered view.",Tln='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Pln(e){return`Unknown repeated value "${e}".`}function cEe(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const kln="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",uhe="Animation involving facet, layer, or concat is currently unsupported.";function Mln(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Tt(e)}.`}function Aln(e,t,n,r){return`${e.length?"Multiple ":"No "}matching ${Tt(t)} encoding found for selection ${Tt(n.param)}. Using "field": ${Tt(r)}.`}const Rln="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Iln(e){return`Unrecognized parse "${e}".`}function uEe(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Dln="Attempt to add the same child twice.";function Lln(e){return`Ignoring an invalid transform: ${Ei(e)}.`}const Fln='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function fEe(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function $ln(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Ei(t)} is overridden by a child projection ${Ei(n)}.`}const Nln="Arc marks uses theta channel rather than angle, replacing angle with theta.";function zln(e){return`${e}Offset dropped because ${e} is continuous`}function jln(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Ei(n)}}.`}function yXe(e){return`Invalid field type "${e}".`}function Bln(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Uln(e){return`Invalid aggregation operator "${e}".`}function bXe(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function Vln(e){return`Position range does not support relative band size for ${e}.`}function Qne(e,t){return`Dropping ${Ei(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Wln="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function YV(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Hln(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Gln(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function qln(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Xln(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function Y7(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Yln(e){return`The ${e} for range marks cannot be an expression`}function Qln(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Kln(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Zln(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Jln(e){return`Cannot use the relative band size with ${e} scale.`}function ecn(e){return`Using unaggregated domain with raw field has no effect (${Ei(e)}).`}function tcn(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function ncn(e){return`Unaggregated domain is currently unsupported for log scale (${Ei(e)}).`}function rcn(e){return`Cannot apply size to non-oriented mark "${e}".`}function icn(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function ocn(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function xXe(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function wXe(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function scn(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ei(n)} and ${Ei(r)}). Using ${Ei(n)}.`}function acn(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ei(n)} and ${Ei(r)}). Using the union of the two domains.`}function lcn(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function ccn(e){return`Dropping sort property ${Ei(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const dEe="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",ucn="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",fcn="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",dcn="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function hcn(e,t){return`Unioning discrete legend values from ${e} and ${t}.`}function pcn(e){return`Cannot stack "${e}" if there is already "${e}2".`}function gcn(e){return`Stack is applied to a non-linear scale (${e}).`}function mcn(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function OB(e,t){return`Invalid ${e}: ${Ei(t)}.`}function vcn(e){return`Dropping day from datetime ${Ei(e)} as day cannot be combined with other units.`}function ycn(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function bcn(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function xcn(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function hEe(e){return`1D error band does not support ${e}.`}function SXe(e){return`Channel ${e} is required for "binned" bin.`}function wcn(e){return`Channel ${e} should not be used with "binned" bin.`}function Scn(e){return`Domain for ${e} is required for threshold scale.`}const _Xe=wU(Xle);let xw=_Xe;function _cn(e){return xw=e,xw}function Ccn(){return xw=_Xe,xw}function fhe(...e){xw.error(...e)}function Ct(...e){xw.warn(...e)}function Ocn(...e){xw.debug(...e)}function SS(e){if(e&&Bt(e)){for(const t of hhe)if(_t(e,t))return!0}return!1}const CXe=["january","february","march","april","may","june","july","august","september","october","november","december"],Ecn=CXe.map(e=>e.substr(0,3)),OXe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Tcn=OXe.map(e=>e.substr(0,3));function Pcn(e){if(jV(e)&&(e=+e),Qr(e))return e>4&&Ct(OB("quarter",e)),e-1;throw new Error(OB("quarter",e))}function kcn(e){if(jV(e)&&(e=+e),Qr(e))return e-1;{const t=e.toLowerCase(),n=CXe.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Ecn.indexOf(r);if(i!==-1)return i;throw new Error(OB("month",e))}}function Mcn(e){if(jV(e)&&(e=+e),Qr(e))return e%7;{const t=e.toLowerCase(),n=OXe.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Tcn.indexOf(r);if(i!==-1)return i;throw new Error(OB("day",e))}}function dhe(e,t){const n=[];if(t&&e.day!==void 0&&wt(e).length>1&&(Ct(vcn(e)),e=Un(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const r=t?kcn(e.month):e.month;n.push(r)}else if(e.quarter!==void 0){const r=t?Pcn(e.quarter):e.quarter;n.push(Qr(r)?r*3:`${r}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const r=t?Mcn(e.day):e.day;n.push(Qr(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=e[r];n.push(typeof i>"u"?0:i)}return n}function ww(e){const n=dhe(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Acn(e){const n=dhe(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Rcn(e){const t=dhe(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const EXe={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},hhe=wt(EXe);function Icn(e){return Qt(EXe,e)}function _S(e){return Bt(e)?e.binned:TXe(e)}function TXe(e){return e?.startsWith("binned")}function phe(e){return e.startsWith("utc")}function Dcn(e){return e.substring(3)}const Lcn={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function QV(e){return hhe.filter(t=>kXe(e,t))}function PXe(e){const t=QV(e);return t[t.length-1]}function kXe(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Fcn(e,t,{end:n}={end:!1}){const r=Zde(t),i=phe(e)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of hhe)kXe(e,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),Acn(a)}function MXe(e){if(!e)return;const t=QV(e);return`timeUnitSpecifier(${Ei(t)}, ${Ei(Lcn)})`}function $cn(e,t,n){if(!e)return;const r=MXe(e);return`${n||phe(e)?"utc":"time"}Format(${t}, ${r})`}function aa(e){if(!e)return;let t;return Ut(e)?TXe(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Bt(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),phe(t.unit)&&(t.utc=!0,t.unit=Dcn(t.unit)),t}function Ncn(e){const{utc:t,...n}=aa(e);return n.unit?(t?"utc":"")+wt(n).map(r=>xo(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):`${t?"utc":""}timeunit${wt(n).map(r=>xo(`_${r}_${n[r]}`)).join("")}`}function AXe(e,t=n=>n){const n=aa(e),r=PXe(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=RXe(r,n.step),a={...i,[s]:+i[s]+o};return`${t(ww(a))} - ${t(ww(i))}`}}const zcn={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function jcn(e){return Qt(zcn,e)}function RXe(e,t=1){if(jcn(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Bcn(e){return _t(e,"param")}function ghe(e){return!!e?.field&&e.equal!==void 0}function mhe(e){return!!e?.field&&e.lt!==void 0}function vhe(e){return!!e?.field&&e.lte!==void 0}function yhe(e){return!!e?.field&&e.gt!==void 0}function bhe(e){return!!e?.field&&e.gte!==void 0}function xhe(e){if(e?.field){if(it(e.range)&&e.range.length===2)return!0;if(hn(e.range))return!0}return!1}function whe(e){return!!e?.field&&(it(e.oneOf)||it(e.in))}function Ucn(e){return!!e?.field&&e.valid!==void 0}function IXe(e){return whe(e)||ghe(e)||xhe(e)||mhe(e)||yhe(e)||vhe(e)||bhe(e)}function Qh(e,t){return s8(e,{timeUnit:t,wrapTime:!0})}function Vcn(e,t){return e.map(n=>Qh(n,t))}function DXe(e,t=!0){const{field:n}=e,r=aa(e.timeUnit),{unit:i,binned:o}=r||{},s=It(e,{expr:"datum"}),a=i?`time(${o?s:Fcn(i,n)})`:s;if(ghe(e))return`${a}===${Qh(e.equal,i)}`;if(mhe(e)){const l=e.lt;return`${a}<${Qh(l,i)}`}else if(yhe(e)){const l=e.gt;return`${a}>${Qh(l,i)}`}else if(vhe(e)){const l=e.lte;return`${a}<=${Qh(l,i)}`}else if(bhe(e)){const l=e.gte;return`${a}>=${Qh(l,i)}`}else{if(whe(e))return`indexof([${Vcn(e.oneOf,i).join(",")}], ${a}) !== -1`;if(Ucn(e))return KV(a,e.valid);if(xhe(e)){const{range:l}=Sa(e),c=hn(l)?{signal:`${l.signal}[0]`}:l[0],u=hn(l)?{signal:`${l.signal}[1]`}:l[1];if(c!==null&&u!==null&&t)return`inrange(${a}, [${Qh(c,i)}, ${Qh(u,i)}])`;const f=[];return c!==null&&f.push(`${a} >= ${Qh(c,i)}`),u!==null&&f.push(`${a} <= ${Qh(u,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Ei(e)}`)}function KV(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Wcn(e){return IXe(e)&&e.timeUnit?{...e,timeUnit:aa(e.timeUnit)}:e}const dL={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Hcn(e){return e==="quantitative"||e==="temporal"}function She(e){return e==="ordinal"||e==="nominal"}const Sw=dL.quantitative,_he=dL.ordinal,yE=dL.temporal,Che=dL.nominal,nP=dL.geojson;function Gcn(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Sw:return"quantitative";case"t":case yE:return"temporal";case"o":case _he:return"ordinal";case"n":case Che:return"nominal";case nP:return"geojson"}}const Ca={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},Kne={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function qcn(e,t){const n=Kne[e],r=Kne[t];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const Xcn={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function pEe(e){return Xcn[e]}const LXe=new Set(["linear","log","pow","sqrt","symlog"]),FXe=new Set([...LXe,"time","utc"]);function $Xe(e){return LXe.has(e)}const NXe=new Set(["quantile","quantize","threshold"]),Ycn=new Set([...FXe,...NXe,"sequential","identity"]),Qcn=new Set(["ordinal","bin-ordinal","point","band"]);function Wo(e){return Qcn.has(e)}function bh(e){return Ycn.has(e)}function Op(e){return FXe.has(e)}function bE(e){return NXe.has(e)}const Kcn={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function Zcn(e){return!Ut(e)&&_t(e,"name")}function zXe(e){return _t(e,"param")}function Jcn(e){return _t(e,"unionWith")}function eun(e){return Bt(e)&&"field"in e}const tun={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:cur,domain:uur,range:fur,rangeMax:dur,rangeMin:hur,scheme:pur,...nun}=tun,run=wt(nun);function Zne(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return Op(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Op(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return Op(e);case"nice":return Op(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return bh(e)&&!yr(["log","time","utc","threshold","quantile"],e)}}function jXe(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return fO(e)?void 0:Zln(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function iun(e,t){return yr([_he,Che],t)?e===void 0||Wo(e):t===yE?yr([Ca.TIME,Ca.UTC,void 0],e):t===Sw?$Xe(e)||bE(e)||e===void 0:!0}function oun(e,t,n=!1){if(!Tg(e))return!1;switch(e){case _o:case ha:case Rb:case tP:case fd:case Ah:return Op(t)||t==="band"?!0:t==="point"?!n:!1;case Ib:return yr(["linear","band"],t);case Rv:case Fb:case Iv:case Db:case Lb:case yS:return Op(t)||bE(t)||yr(["band","point","ordinal"],t);case jc:case Cg:case Og:return t!=="band";case $b:case Bc:return t==="ordinal"||bE(t)}}function sun(e){return Bt(e)&&"value"in e}const nc={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},BXe=nc.arc,ZV=nc.area,JV=nc.bar,aun=nc.image,e8=nc.line,t8=nc.point,lun=nc.rect,EB=nc.rule,UXe=nc.text,Ohe=nc.tick,cun=nc.trail,Ehe=nc.circle,The=nc.square,VXe=nc.geoshape;function zb(e){return["line","area","trail"].includes(e)}function yR(e){return["rect","bar","image","arc","tick"].includes(e)}const uun=new Set(wt(nc));function ag(e){return _t(e,"type")}const fun=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],dun=["fill","fillOpacity"],hun=[...fun,...dun],pun={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},gEe=wt(pun),Q7=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],gun={area:["line","point"],bar:Q7,rect:Q7,line:["point"],tick:["bandSize","thickness",...Q7]},mun={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},vun={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},WXe=wt(vun);function _w(e){return _t(e,"band")}const yun={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},bun=5,Phe={binSpacing:0,continuousBandSize:bun,minBandSize:.25,timeUnitBandPosition:.5},xun={...Phe,binSpacing:1},wun={...Phe,thickness:1};function Sun(e){return ag(e)?e.type:e}function HXe(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function khe({markDef:e,config:t,scaleChannel:n,scaleType:r,isCountAggregate:i}){if(!r||!bh(r)||i)return"always-valid";const o=HXe(vi("invalid",e,t),{isPath:zb(e.type)});return t.scale?.invalid?.[n]!==void 0?"show":o}function _un(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function GXe({scaleName:e,scale:t,mode:n}){const r=`domain('${e}')`;if(!t||!e)return;const i=`${r}[0]`,o=`peek(${r})`,s=t.domainHasZero();return s==="definitely"?{scale:e,value:0}:s==="maybe"?{signal:`scale('${e}', inrange(0, ${r}) ? 0 : ${n==="zeroOrMin"?i:o})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?i:o})`}}function qXe({scaleChannel:e,channelDef:t,scale:n,scaleName:r,markDef:i,config:o}){const s=n?.get("type"),a=wh(t),l=qV(a?.aggregate),c=khe({scaleChannel:e,markDef:i,config:o,scaleType:s,isCountAggregate:l});if(a&&c==="show"){const u=o.scale.invalid?.[e]??"zero-or-min";return{test:KV(It(a,{expr:"datum"}),!1),...Cun(u,n,r)}}}function Cun(e,t,n){if(sun(e)){const{value:r}=e;return hn(r)?{signal:r.signal}:{value:r}}return GXe({scale:t,scaleName:n,mode:"zeroOrMin"})}function Mhe(e){const{channel:t,channelDef:n,markDef:r,scale:i,scaleName:o,config:s}=e,a=bS(t),l=Ahe(e),c=qXe({scaleChannel:a,channelDef:n,scale:i,scaleName:o,markDef:r,config:s});return c!==void 0?[c,l]:l}function Oun(e){const{datum:t}=e;return SS(t)?ww(t):`${Ei(t)}`}function I1(e,t,n,r){const i={};if(t&&(i.scale=t),Pg(e)){const{datum:o}=e;SS(o)?i.signal=ww(o):hn(o)?i.signal=o.signal:fL(o)?i.signal=o.expr:i.value=o}else i.field=It(e,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function TB({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!hn(s)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return zun(e);default:return Nun(e,t)}};let sYe=oYe;function aYe(e){sYe=e}function jun(){aYe(oYe)}function dO(e,t,{allowDisabling:n,includeDefault:r=!0}){const i=Lhe(e)?.title;if(!Et(e))return i??e.title;const o=e,s=r?Fhe(o,t):void 0;return n?is(i,o.title,s):i??o.title??s}function Lhe(e){if(wE(e)&&e.axis)return e.axis;if(rYe(e)&&e.legend)return e.legend;if(Ihe(e)&&e.header)return e.header}function Fhe(e,t){return sYe(e,t)}function SE(e){if(iYe(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Lhe(e)??{},{format:n,formatType:r}=t;return{format:n,formatType:r}}}function Bun(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Dhe(e)&&it(e.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=e;if(i)return"temporal";if(r||n&&!Nb(n)&&!dv(n))return"quantitative";if(CS(e)&&e.scale?.type)switch(Kne[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function wh(e){if(Et(e))return e;if(i8(e))return e.condition}function Ls(e){if(Hn(e))return e;if(mL(e))return e.condition}function lYe(e,t,n,r={}){if(_B(e)){const i=Ut(e)?"string":Qr(e)?"number":"boolean";return Ct(jln(t,i,e)),{value:e}}return Hn(e)?MB(e,t,n,r):mL(e)?{...e,condition:MB(e.condition,t,n,r)}:e}function MB(e,t,n,r){if(iYe(e)){const{format:i,formatType:o,...s}=e;if(Cw(o)&&!n.customFormatTypes)return Ct(fEe(t)),MB(s,t,n,r)}else{const i=wE(e)?"axis":rYe(e)?"legend":Ihe(e)?"header":null;if(i&&e[i]){const{format:o,formatType:s,...a}=e[i];if(Cw(s)&&!n.customFormatTypes)return Ct(fEe(t)),MB({...e,[i]:a},t,n,r)}}return Et(e)?$he(e,t,r):Uun(e)}function Uun(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Qr(n)?"quantitative":Ut(n)?"nominal":SS(n)?"temporal":void 0,{...e,type:t}}function $he(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=e,a={...e};if(!n&&r&&!ahe(r)&&!Nb(r)&&!dv(r)&&(Ct(Uln(r)),delete a.aggregate),i&&(a.timeUnit=aa(i)),s&&(a.field=`${s}`),eo(o)&&(a.bin=o8(o,t)),xa(o)&&!os(t)&&Ct(wcn(t)),Yl(a)){const{type:l}=a,c=Gcn(l);l!==c&&(a.type=c),l!=="quantitative"&&qV(r)&&(Ct(Bln(l,r)),a.type="quantitative")}else if(!tXe(t)){const l=Bun(a,t);a.type=l}if(Yl(a)){const{compatible:l,warning:c}=Vun(a,t)||{};l===!1&&Ct(c)}if(Dhe(a)&&Ut(a.sort)){const{sort:l}=a;if(vEe(l))return{...a,sort:{encoding:l}};const c=l.substring(1);if(l.charAt(0)==="-"&&vEe(c))return{...a,sort:{encoding:c,order:"descending"}}}if(Ihe(a)){const{header:l}=a;if(l){const{orient:c,...u}=l;if(c)return{...a,header:{...u,labelOrient:l.labelOrient||c,titleOrient:l.titleOrient||c}}}}return a}function o8(e,t){return cS(e)?{maxbins:nEe(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:nEe(t)}:e}const M_={compatible:!0};function Vun(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Hm:case Gm:case BV:return kB(e)?M_:{compatible:!1,warning:Gln(t)};case _o:case ha:case Rb:case tP:case jc:case Cg:case Og:case lL:case cL:case UV:case bw:case VV:case WV:case yS:case fd:case Ah:case HV:return M_;case Ih:case td:case Rh:case Dh:return n!==Sw?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:M_;case Iv:case Db:case Lb:case Fb:case Rv:case Av:case Mv:case Mh:case _g:case Ib:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:M_;case Bc:case $b:return!kB(e)&&!Fun(e)?{compatible:!1,warning:qln(t)}:M_;case vE:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:M_}}function _E(e){const{formatType:t}=SE(e);return t==="time"||!t&&Wun(e)}function Wun(e){return e&&(e.type==="temporal"||Et(e)&&!!e.timeUnit)}function s8(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){const o=t&&aa(t)?.unit;let s=o||n==="temporal",a;return fL(e)?a=e.expr:hn(e)?a=e.signal:SS(e)?(s=!0,a=ww(e)):(Ut(e)||Qr(e))&&s&&(a=`datetime(${Ei(e)})`,Icn(o)&&(Qr(e)&&e<1e4||Ut(e)&&isNaN(Date.parse(e)))&&(a=ww({[o]:e}))),a?r&&s?`time(${a})`:a:i?void 0:Ei(e)}function cYe(e,t){const{type:n}=e;return t.map(r=>{const i=Et(e)&&!_S(e.timeUnit)?e.timeUnit:void 0,o=s8(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function vL(e,t){return eo(e.bin)?Tg(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const xEe={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function yL(e){return e?.condition}const uYe=["domain","grid","labels","ticks","title"],Hun={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},fYe={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Gun={...fYe,style:1,labelExpr:1,encoding:1};function wEe(e){return Qt(Gun,e)}const qun={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},dYe=wt(qun);function Lv(e){return _t(e,"mark")}class a8{name;run;constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Lv(t)?Sun(t.mark)===this.name:!1}}function D1(e,t){const n=e?.[t];return n?it(n)?pE(n,r=>!!r.field):Et(n)||i8(n):!1}function hYe(e,t){const n=e?.[t];return n?it(n)?pE(n,r=>!!r.field):Et(n)||Pg(n)||mL(n):!1}function pYe(e,t){if(os(t)){const n=e[t];if((Et(n)||Pg(n))&&(She(n.type)||Et(n)&&n.timeUnit)){const r=nhe(t);return hYe(e,r)}}return!1}function gYe(e){return pE(Uan,t=>{if(D1(e,t)){const n=e[t];if(it(n))return pE(n,r=>!!r.aggregate);{const r=wh(n);return r&&!!r.aggregate}}return!1})}function mYe(e,t){const n=[],r=[],i=[],o=[],s={};return Nhe(e,(a,l)=>{if(Et(a)){const{field:c,aggregate:u,bin:f,timeUnit:d,...h}=a;if(u||d||f){const g=Lhe(a)?.title;let m=It(a,{forAs:!0});const v={...g?[]:{title:dO(a,t,{allowDisabling:!0})},...h,field:m};if(u){let y;if(Nb(u)?(y="argmax",m=It({op:"argmax",field:u.argmax},{forAs:!0}),v.field=`${m}.${c}`):dv(u)?(y="argmin",m=It({op:"argmin",field:u.argmin},{forAs:!0}),v.field=`${m}.${c}`):u!=="boxplot"&&u!=="errorbar"&&u!=="errorband"&&(y=u),y){const b={op:y,as:m};c&&(b.field=c),o.push(b)}}else if(n.push(m),Yl(a)&&eo(f)){if(r.push({bin:f,field:c,as:m}),n.push(It(a,{binSuffix:"end"})),vL(a,l)&&n.push(It(a,{binSuffix:"range"})),os(l)){const y={field:`${m}_end`};s[`${l}2`]=y}v.bin="binned",tXe(l)||(v.type=Sw)}else if(d&&!_S(d)){i.push({timeUnit:d,field:c,as:m});const y=Yl(a)&&a.type!==yE&&"time";y&&(l===lL||l===bw?v.formatType=y:Jan(l)?v.legend={formatType:y,...v.legend}:os(l)&&(v.axis={formatType:y,...v.axis}))}s[l]=v}else n.push(c),s[l]=e[l]}else s[l]=e[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function Xun(e,t,n){const r=tln(t,n);if(r){if(r==="binned"){const i=e[t===Mh?_o:ha];return!!(Et(i)&&Et(e[t])&&xa(i.bin))}}else return!1;return!0}function Yun(e,t,n,r){const i={};for(const o of wt(e))eXe(o)||Ct(Hln(o));for(let o of Xan){if(!e[o])continue;const s=e[o];if(uL(o)){const a=qan(o),l=i[a];if(Et(l)&&Hcn(l.type)&&Et(s)&&!l.timeUnit){Ct(zln(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(Ct(Nln),o=fd),!Xun(e,o,t)){Ct(YV(o,t));continue}if(o===Rv&&t==="line"&&wh(e[o])?.aggregate){Ct(Wln);continue}if(o===jc&&(n?"fill"in e:"stroke"in e)){Ct(bXe("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===cL||o===vE&&!it(s)&&!xh(s)||o===bw&&it(s)){if(s){if(o===vE){const a=e[o];if(nYe(a)){i[o]=a;continue}}i[o]=Ht(s).reduce((a,l)=>(Et(l)?a.push($he(l,o)):Ct(Qne(l,o)),a),[])}}else{if(o===bw&&s===null)i[o]=null;else if(!Et(s)&&!Pg(s)&&!xh(s)&&!gL(s)&&!hn(s)){Ct(Qne(s,o));continue}i[o]=lYe(s,o,r)}}return i}function l8(e,t){const n={};for(const r of wt(e)){const i=lYe(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function Qun(e){const t=[];for(const n of wt(e))if(D1(e,n)){const r=e[n],i=Ht(r);for(const o of i)Et(o)?t.push(o):i8(o)&&t.push(o.condition)}return t}function Nhe(e,t,n){if(e)for(const r of wt(e)){const i=e[r];if(it(i))for(const o of i)t.call(n,o,r);else t.call(n,i,r)}}function Kun(e,t,n,r){return e?wt(e).reduce((i,o)=>{const s=e[o];return it(s)?s.reduce((a,l)=>t.call(r,a,l,o),i):t.call(r,i,s,o)},n):n}function vYe(e,t){return wt(t).reduce((n,r)=>{switch(r){case _o:case ha:case VV:case HV:case WV:case Mh:case _g:case Rb:case tP:case fd:case Av:case Ah:case Mv:case Ib:case Rh:case Ih:case Dh:case td:case lL:case Bc:case yS:case bw:return n;case vE:if(e==="line"||e==="trail")return n;case cL:case UV:{const i=t[r];if(it(i)||Et(i))for(const o of Ht(i))o.aggregate||n.push(It(o,{}));return n}case Rv:if(e==="trail")return n;case jc:case Cg:case Og:case Iv:case Db:case Lb:case $b:case Fb:{const i=wh(t[r]);return i&&!i.aggregate&&n.push(It(i,{})),n}}},[])}function Zun(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(it(t)){for(const o of t)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return it(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function ere(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=e.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${zhe(t)}`:"";return{field:s+t.field,type:t.type,title:hn(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=Qun(n).map(Dun);return{tooltip:[...i,..._u(o,ar)]}}function zhe(e){const{title:t,field:n}=e;return is(t,n)}function jhe(e,t,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:c,endPositionPrefix:u=void 0,extraEncoding:f={}})=>{const d=zhe(n);return yYe(e,a,i,{mark:l,encoding:{[t]:{field:`${c}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...Ut(u)?{[`${t}2`]:{field:`${u}_${n.field}`}}:{},...r,...f}})}}function yYe(e,t,n,r){const{clip:i,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...ag(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(t)}`,...cS(e[t])?{}:e[t]}}]:[]}function bYe(e,t,n){const{encoding:r}=e,i=t==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:gN(o,n),continuousAxisChannelDef2:gN(s,n),continuousAxisChannelDefError:gN(a,n),continuousAxisChannelDefError2:gN(l,n),continuousAxis:i}}function gN(e,t){if(e?.aggregate){const{aggregate:n,...r}=e;return n!==t&&Ct(xcn(n,t)),r}else return e}function xYe(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(ag(n)&&n.orient)return n.orient;if(g0(i)){if(g0(o)){const s=Et(i)&&i.aggregate,a=Et(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return _E(o)&&!_E(i)?"horizontal":"vertical"}return"horizontal"}else{if(g0(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const AB="boxplot",Jun=["box","median","outliers","rule","ticks"],efn=new a8(AB,SYe);function wYe(e){return Qr(e)?"tukey":e}function SYe(e,{config:t}){e={...e,encoding:l8(e.encoding,t)};const{mark:n,encoding:r,params:i,projection:o,...s}=e,a=ag(n)?n:{type:n};i&&Ct(vXe("boxplot"));const l=a.extent??t.boxplot.extent,c=vi("size",a,t),u=a.invalid,f=wYe(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:v,aggregate:y,encodingWithoutContinuousAxis:b,ticksOrient:w,boxOrient:S,customTooltipWithoutAggregatedField:_}=tfn(e,l,t),E=eP(g.field),{color:T,size:k,...P}=b,I=J=>jhe(a,m,g,J,t.boxplot),R=I(P),F=I(b),A=(Bt(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",L=I({...P,...k?{size:k}:{},color:{condition:{test:`${Ci(`lower_box_${g.field}`)} >= ${Ci(`upper_box_${g.field}`)}`,...T||{value:A}}}}),$=ere([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,b),j={type:"tick",color:"black",opacity:1,orient:w,invalid:u,aria:!1},V=f==="min-max"?$:ere([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,b),U=[...R({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:V}),...R({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:V}),...R({partName:"ticks",mark:j,positionPrefix:"lower_whisker",extraEncoding:V}),...R({partName:"ticks",mark:j,positionPrefix:"upper_whisker",extraEncoding:V})],z=[...f!=="tukey"?U:[],...F({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:S,invalid:u,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:$}),...L({partName:"median",mark:{type:"tick",invalid:u,...Bt(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...c?{size:c}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:$})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:z};const N=Ci(`lower_box_${g.field}`),B=Ci(`upper_box_${g.field}`),H=`(${B} - ${N})`,Q=`${N} - ${l} * ${H}`,Y=`${B} + ${l} * ${H}`,Z=Ci(g.field),ge={joinaggregate:_Ye(g.field),groupby:v},ne={transform:[{filter:`(${Q} <= ${Z}) && (${Z} <= ${Y})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${E}`},{op:"max",field:g.field,as:`upper_whisker_${E}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${E}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${E}`},...y],groupby:v}],layer:U},{tooltip:ie,...fe}=P,{scale:ve,axis:se}=g,ue=zhe(g),G=yYe(a,"outliers",t.boxplot,{transform:[{filter:`(${Z} < ${Q}) || (${Z} > ${Y})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...ue!==void 0?{title:ue}:{},...ve!==void 0?{scale:ve}:{},...se!==void 0?{axis:se}:{}},...fe,...T?{color:T}:{},..._?{tooltip:_}:{}}})[0];let ce;const pe=[...d,...h,ge];return G?ce={transform:pe,layer:[G,ne]}:(ce=ne,ce.transform.unshift(...pe)),{...s,layer:[ce,{transform:p,layer:z}]}}function _Ye(e){const t=eP(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function tfn(e,t,n){const r=xYe(e,AB),{continuousAxisChannelDef:i,continuousAxis:o}=bYe(e,r,AB),s=i.field,a=eP(s),l=wYe(t),c=[..._Ye(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(l==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(l==="min-max"?"upper_whisker_":"max_")+a}],u=l==="min-max"||l==="tukey"?[]:[{calculate:`${Ci(`upper_box_${a}`)} - ${Ci(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${Ci(`upper_box_${a}`)} + ${Ci(`iqr_${a}`)} * ${t}, ${Ci(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${Ci(`lower_box_${a}`)} - ${Ci(`iqr_${a}`)} * ${t}, ${Ci(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[o]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Zun(d),{bins:g,timeUnits:m,aggregate:v,groupby:y,encoding:b}=mYe(p,n),w=r==="vertical"?"horizontal":"vertical",S=r,_=[...g,...m,{aggregate:[...v,...c],groupby:y},...u];return{bins:g,timeUnits:m,transform:_,groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:b,ticksOrient:w,boxOrient:S,customTooltipWithoutAggregatedField:h}}const Bhe="errorbar",nfn=["ticks","rule"],rfn=new a8(Bhe,CYe);function CYe(e,{config:t}){e={...e,encoding:l8(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:c}=OYe(e,Bhe,t);delete o.size;const u=jhe(a,i,r,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...u({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:c}),...u({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:c}),...u({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function ifn(e,t){const{encoding:n}=e;if(ofn(n))return{orient:xYe(e,t),inputType:"raw"};const r=sfn(n),i=afn(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(Hn(a)&&Hn(l))throw new Error(`${t} cannot have both x2 and y2`);if(Hn(a)){if(g0(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Hn(l)){if(g0(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,c=n.yError,u=n.yError2;if(Hn(l)&&!Hn(a))throw new Error(`${t} cannot have xError2 without xError`);if(Hn(u)&&!Hn(c))throw new Error(`${t} cannot have yError2 without yError`);if(Hn(a)&&Hn(c))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Hn(a)){if(g0(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Hn(c)){if(g0(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function ofn(e){return(Hn(e.x)||Hn(e.y))&&!Hn(e.x2)&&!Hn(e.y2)&&!Hn(e.xError)&&!Hn(e.xError2)&&!Hn(e.yError)&&!Hn(e.yError2)}function sfn(e){return Hn(e.x2)||Hn(e.y2)}function afn(e){return Hn(e.xError)||Hn(e.xError2)||Hn(e.yError)||Hn(e.yError2)}function OYe(e,t,n){const{mark:r,encoding:i,params:o,projection:s,...a}=e,l=ag(r)?r:{type:r};o&&Ct(vXe(t));const{orient:c,inputType:u}=ifn(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=bYe(e,c,t),{errorBarSpecificAggregate:m,postAggregateCalculates:v,tooltipSummary:y,tooltipTitleWithFieldName:b}=lfn(l,f,d,h,p,u,t,n),{[g]:w,[g==="x"?"x2":"y2"]:S,[g==="x"?"xError":"yError"]:_,[g==="x"?"xError2":"yError2"]:E,...T}=i,{bins:k,timeUnits:P,aggregate:I,groupby:R,encoding:F}=mYe(T,n),A=[...I,...m],L=u!=="raw"?[]:R,$=ere(y,f,F,b);return{transform:[...a.transform??[],...k,...P,...A.length===0?[]:[{aggregate:A,groupby:L}],...v],groupby:L,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:F,ticksOrient:c==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:$}}function lfn(e,t,n,r,i,o,s,a){let l=[],c=[];const u=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Ct(bcn(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:u,as:`extent_${u}`},{op:h,field:u,as:`center_${u}`}],c=[{calculate:`${Ci(`center_${u}`)} + ${Ci(`extent_${u}`)}`,as:`upper_${u}`},{calculate:`${Ci(`center_${u}`)} - ${Ci(`extent_${u}`)}`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:aL(h)},{fieldPrefix:"upper_",titlePrefix:SEe(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:SEe(h,p,"-")}],d=!0;else{let g,m,v;p==="ci"?(g="mean",m="ci0",v="ci1"):(g="median",m="q1",v="q3"),l=[{op:m,field:u,as:`lower_${u}`},{op:v,field:u,as:`upper_${u}`},{op:g,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:dO({field:u,aggregate:v,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:dO({field:u,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:dO({field:u,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&Ct(ycn(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],c=[{calculate:Ci(n.field),as:`upper_${u}`},{calculate:Ci(u),as:`lower_${u}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`${Ci(u)} + ${Ci(r.field)}`,as:`upper_${u}`}],i?c.push({calculate:`${Ci(u)} + ${Ci(i.field)}`,as:`lower_${u}`}):c.push({calculate:`${Ci(u)} - ${Ci(r.field)}`,as:`lower_${u}`}));for(const h of c)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:yw(yw(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function SEe(e,t,n){return`${aL(e)} ${n} ${t}`}const Uhe="errorband",cfn=["band","borders"],ufn=new a8(Uhe,EYe);function EYe(e,{config:t}){e={...e,encoding:l8(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=OYe(e,Uhe,t),c=s,u=jhe(c,i,r,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):c.interpolate?Ct(hEe("interpolate")):c.tension&&Ct(hEe("tension")),{...a,transform:n,layer:[...u({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const TYe={};function Vhe(e,t,n){const r=new a8(e,t);TYe[e]={normalizer:r,parts:n}}function ffn(){return wt(TYe)}Vhe(AB,SYe,Jun);Vhe(Bhe,CYe,nfn);Vhe(Uhe,EYe,cfn);const dfn=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],PYe={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},kYe={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},hfn=wt(PYe),pfn=wt(kYe),gfn={header:1,headerRow:1,headerColumn:1,headerFacet:1},MYe=wt(gfn),AYe=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],mfn={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},vfn={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Sh="_vgsid_",yfn={point:{on:"click",fields:[Sh],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Whe(e){return e==="legend"||!!e?.legend}function K7(e){return Whe(e)&&Bt(e)}function Hhe(e){return!!e?.select}function RYe(e){const t=[];for(const n of e||[]){if(Hhe(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};t.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};t.push(s)}}return t}function bfn(e){return c8(e)||qhe(e)||Ghe(e)}function Ghe(e){return _t(e,"concat")}function c8(e){return _t(e,"vconcat")}function qhe(e){return _t(e,"hconcat")}function IYe({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function lg(e){return _t(e,"step")}function _Ee(e){return _t(e,"view")||_t(e,"width")||_t(e,"height")}const CEe=20,xfn={align:1,bounds:1,center:1,columns:1,spacing:1},wfn=wt(xfn);function Sfn(e,t,n){const r=n[t],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&(r8(e)&&!pL(e.facet)||Ghe(e))&&(i.columns=s),c8(e)&&(i.columns=1);for(const a of wfn)if(e[a]!==void 0)if(a==="spacing"){const l=e[a];i[a]=Qr(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=e[a];return i}function tre(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function nre(e,t){const n=RB(e,t);return lg(n)?n.step:DYe}function RB(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return is(n,{step:e.step})}const DYe=20,_fn={continuousWidth:300,continuousHeight:300,step:DYe},Cfn={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:_fn,mark:mun,arc:{},area:{},bar:xun,circle:{},geoshape:{},image:{},line:{},point:{},rect:Phe,rule:{color:"black"},square:{},text:{color:"black"},tick:wun,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:Kcn,projection:{},legend:mfn,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:yfn,style:{},title:{},facet:{spacing:CEe},concat:{spacing:CEe},normalizedNumberFormat:".0%"},Yg=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],OEe={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},EEe={blue:Yg[0],orange:Yg[1],red:Yg[2],teal:Yg[3],green:Yg[4],yellow:Yg[5],purple:Yg[6],pink:Yg[7],brown:Yg[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Ofn(e={}){return{signals:[{name:"color",value:Bt(e)?{...EEe,...e}:EEe}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Efn(e){return{signals:[{name:"fontSize",value:Bt(e)?{...OEe,...e}:OEe}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Tfn(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function LYe(e){const t=wt(e||{}),n={};for(const r of t){const i=e[r];n[r]=yL(i)?uXe(i):xu(i)}return n}function Pfn(e){const t=wt(e),n={};for(const r of t)n[r]=LYe(e[r]);return n}const kfn=[...WXe,...dYe,...MYe,"background","padding","legend","lineBreak","scale","style","title","view"];function FYe(e={}){const{color:t,font:n,fontSize:r,selection:i,...o}=e,s=$T({},Un(Cfn),n?Tfn(n):{},t?Ofn(t):{},r?Efn(r):{},o||{});i&&NT(s,"selection",i,!0);const a=Iu(s,kfn);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=xu(s[l]));for(const l of WXe)s[l]&&(a[l]=Sa(s[l]));for(const l of dYe)s[l]&&(a[l]=LYe(s[l]));for(const l of MYe)s[l]&&(a[l]=Sa(s[l]));if(s.legend&&(a.legend=Sa(s.legend)),s.scale){const{invalid:l,...c}=s.scale,u=Sa(l,{level:1});a.scale={...Sa(c),...wt(u).length>0?{invalid:u}:{}}}return s.style&&(a.style=Pfn(s.style)),s.title&&(a.title=Sa(s.title)),s.view&&(a.view=Sa(s.view)),a}const Mfn=new Set(["view",...uun]),Afn=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Rfn={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...gun};function Ifn(e){e=Un(e);for(const t of Afn)delete e[t];if(e.axis)for(const t in e.axis)yL(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of dfn)delete e.legend[t];if(e.mark){for(const t of gEe)delete e.mark[t];e.mark.tooltip&&Bt(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(RYe(e.params)),delete e.params);for(const t of Mfn){for(const r of gEe)delete e[t][r];const n=Rfn[t];if(n)for(const r of n)delete e[t][r];Lfn(e,t)}for(const t of ffn())delete e[t];Dfn(e);for(const t in e)Bt(e[t])&&Vi(e[t])&&delete e[t];return Vi(e)?void 0:e}function Dfn(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=lXe(e.title);Vi(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Vi(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Vi(r)?delete e.title:e.title=r}function Lfn(e,t,n,r){const i=e[t];t==="view"&&(n="cell");const o={...i,...e.style[n??t]};Vi(o)||(e.style[n??t]=o),delete e[t]}function u8(e){return _t(e,"layer")}function Ffn(e){return _t(e,"repeat")}function $fn(e){return!it(e.repeat)&&_t(e.repeat,"layer")}class Xhe{map(t,n){return r8(t)?this.mapFacet(t,n):Ffn(t)?this.mapRepeat(t,n):qhe(t)?this.mapHConcat(t,n):c8(t)?this.mapVConcat(t,n):Ghe(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(u8(t))return this.mapLayer(t,n);if(Lv(t))return this.mapUnit(t,n);throw new Error(lhe(t))}mapLayer(t,n){return{...t,layer:t.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(r=>this.map(r,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(r=>this.map(r,n))}}mapConcat(t,n){const{concat:r,...i}=t;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const Nfn={zero:1,center:1,normalize:1};function zfn(e){return Qt(Nfn,e)}const jfn=new Set([BXe,JV,ZV,EB,t8,Ehe,The,e8,UXe,Ohe]),Bfn=new Set([JV,ZV,BXe]);function A_(e){return Et(e)&&xE(e)==="quantitative"&&!e.bin}function TEe(e,t,{orient:n,type:r}){const i=t==="x"?"y":"radius",o=t==="x"&&["bar","area"].includes(r),s=e[t],a=e[i];if(Et(s)&&Et(a))if(A_(s)&&A_(a)){if(s.stack)return t;if(a.stack)return i;const l=Et(s)&&!!s.aggregate,c=Et(a)&&!!a.aggregate;if(l!==c)return l?t:i;if(o){if(n==="vertical")return i;if(n==="horizontal")return t}}else{if(A_(s))return t;if(A_(a))return i}else{if(A_(s))return o&&n==="vertical"?void 0:t;if(A_(a))return o&&n==="horizontal"?void 0:i}}function Ufn(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function $Ye(e,t){const n=ag(e)?e:{type:e},r=n.type;if(!jfn.has(r))return null;const i=TEe(t,"x",n)||TEe(t,"theta",n);if(!i)return null;const o=t[i],s=Et(o)?It(o,{}):void 0,a=Ufn(i),l=[],c=new Set;if(t[a]){const g=t[a],m=Et(g)?It(g,{}):void 0;m&&m!==s&&(l.push(a),c.add(m))}const u=a==="x"?"xOffset":"yOffset",f=t[u],d=Et(f)?It(f,{}):void 0;d&&d!==s&&(l.push(u),c.add(d));const h=Yan.reduce((g,m)=>{if(m!=="tooltip"&&D1(t,m)){const v=t[m];for(const y of Ht(v)){const b=wh(y);if(b.aggregate)continue;const w=It(b,{});(!w||!c.has(w))&&g.push({channel:m,fieldDef:b})}}return g},[]);let p;return o.stack!==void 0?cS(o.stack)?p=o.stack?"zero":null:p=o.stack:Bfn.has(r)&&(p="zero"),!p||!zfn(p)||gYe(t)&&h.length===0?null:(o?.scale?.type&&o?.scale?.type!==Ca.LINEAR&&o?.stack&&Ct(gcn(o.scale.type)),Hn(t[Eg(i)])?(o.stack!==void 0&&Ct(pcn(i)),null):(Et(o)&&o.aggregate&&!lln.has(o.aggregate)&&Ct(mcn(o.aggregate)),{groupbyChannels:l,groupbyFields:c,fieldChannel:i,impute:o.impute===null?!1:zb(r),stackBy:h,offset:p}))}function NYe(e,t,n){const r=Sa(e),i=vi("orient",r,n);if(r.orient=Gfn(r.type,t,i),i!==void 0&&i!==r.orient&&Ct(Kln(r.orient,i)),r.type==="bar"&&r.orient){const l=vi("cornerRadiusEnd",r,n);if(l!==void 0){const c=r.orient==="horizontal"&&t.x2||r.orient==="vertical"&&t.y2?["cornerRadius"]:yun[r.orient];for(const u of c)r[u]=l;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}const o=vi("opacity",r,n),s=vi("fillOpacity",r,n);return o===void 0&&s===void 0&&(r.opacity=Wfn(r.type,t)),vi("cursor",r,n)===void 0&&(r.cursor=Vfn(r,t,n)),r}function Vfn(e,t,n){return t.href||e.href||vi("href",e,n)?"pointer":e.cursor}const zYe=.7;function Wfn(e,t){if(yr([t8,Ohe,Ehe,The],e)&&!gYe(t))return zYe}function Hfn(e,t,{graticule:n}){if(n)return!1;const r=sg("filled",e,t),i=e.type;return is(r,i!==t8&&i!==e8&&i!==EB)}function Gfn(e,t,n){switch(e){case t8:case Ehe:case The:case lun:case aun:return}const{x:r,y:i,x2:o,y2:s}=t;switch(e){case UXe:case JV:if(Et(r)&&(xa(r.bin)||Et(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Et(i)&&(xa(i.bin)||Et(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(Et(r)&&r.type===Sw&&!eo(r.bin)||PB(r))&&Et(i)&&xa(i.bin)?"horizontal":"vertical";if(!s)return(Et(i)&&i.type===Sw&&!eo(i.bin)||PB(i))&&Et(r)&&xa(r.bin)?"vertical":"horizontal"}case EB:if(o&&!(Et(r)&&xa(r.bin))&&s&&!(Et(i)&&xa(i.bin)))return;case ZV:if(s)return Et(i)&&xa(i.bin)?"horizontal":"vertical";if(o)return Et(r)&&xa(r.bin)?"vertical":"horizontal";if(e===EB){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case e8:case Ohe:{const a=bEe(r),l=bEe(i);if(n)return n;if(a&&!l)return e!=="tick"?"horizontal":"vertical";if(!a&&l)return e!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const c=Yl(r)&&r.type===yE,u=Yl(i)&&i.type===yE;if(c&&!u)return"vertical";if(!c&&u)return"horizontal"}return}}return"vertical"}function qfn(e){const{point:t,line:n,...r}=e;return wt(r).length>1?r:r.type}function Xfn(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Iu(e[t],["point","line"])});return e}function Z7(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Bt(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Bt(t.point)?t.point:{}:void 0}function PEe(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class Yfn{name="path-overlay";hasMatchingType(t,n){if(Lv(t)){const{mark:r,encoding:i}=t,o=ag(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!Z7(o,n[o.type],i);case"area":return!!Z7(o,n[o.type],i)||!!PEe(o,n[o.type])}}return!1}run(t,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:c,...u}=t,f=l8(c,i),d=ag(a)?a:{type:a},h=Z7(d,i[d.type],f),p=d.type==="area"&&PEe(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:qfn({...d.type==="area"&&vi("opacity",d,i)==null&&vi("fillOpacity",d,i)==null?{opacity:zYe}:{},...d}),encoding:Iu(f,["shape"])}],m=$Ye(NYe(d,f,i),f);let v=f;if(m){const{fieldChannel:y,offset:b}=m;v={...f,[y]:{...f[y],...b?{stack:b}:{}}}}return v=Iu(v,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...hE(d,["clip","interpolate","tension","tooltip"]),...p},encoding:v}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...hE(d,["clip","tooltip"]),...h},encoding:v}),r({...u,layer:g},{...n,config:Xfn(i)})}}function Qfn(e,t){return t?pL(e)?BYe(e,t):jYe(e,t):e}function J7(e,t){return t?BYe(e,t):e}function rre(e,t,n){const r=t[e];if(Run(r)){if(r.repeat in n)return{...t,[e]:n[r.repeat]};Ct(Pln(r.repeat));return}return t}function jYe(e,t){if(e=rre("field",e,t),e!==void 0){if(e===null)return null;if(Dhe(e)&&qm(e.sort)){const n=rre("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function kEe(e,t){if(Et(e))return jYe(e,t);{const n=rre("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function MEe(e,t){if(Hn(e)){const n=kEe(e,t);if(n)return n;if(gL(e))return{condition:e.condition}}else{if(mL(e)){const n=kEe(e.condition,t);if(n)return{...e,condition:n};{const{condition:r,...i}=e;return i}}return e}}function BYe(e,t){const n={};for(const r in e)if(_t(e,r)){const i=e[r];if(it(i))n[r]=i.map(o=>MEe(o,t)).filter(o=>o);else{const o=MEe(i,t);o!==void 0&&(n[r]=o)}}return n}class Kfn{name="RuleForRangedLine";hasMatchingType(t){if(Lv(t)){const{encoding:n,mark:r}=t;if(r==="line"||ag(r)&&r.type==="line")for(const i of Gan){const o=bS(i),s=n[o];if(n[i]&&(Et(s)&&!xa(s.bin)||Pg(s)))return!0}}return!1}run(t,n,r){const{encoding:i,mark:o}=t;return Ct(Qln(!!i.x2,!!i.y2)),r({...t,mark:Bt(o)?{...o,type:"rule"}:"rule"},n)}}class Zfn extends Xhe{nonFacetUnitNormalizers=[efn,rfn,ufn,new Yfn,new Kfn];map(t,n){if(Lv(t)){const r=D1(t.encoding,Hm),i=D1(t.encoding,Gm),o=D1(t.encoding,BV);if(r||i||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:r,parentProjection:i}=n,o=J7(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(t,n){return $fn(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:r,spec:i,...o}=t,{row:s,column:a,layer:l}=r,{repeater:c={},repeaterPrefix:u=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...c,layer:f},h=`${(i.name?`${i.name}_`:"")+u}child__layer_${xo(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:r,spec:i,data:o,...s}=t;!it(r)&&t.columns&&(t=Iu(t,["columns"]),Ct(cEe("repeat")));const a=[],{repeater:l={},repeaterPrefix:c=""}=n,u=!it(r)&&r.row||[l?l.row:null],f=!it(r)&&r.column||[l?l.column:null],d=it(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of u)for(const m of f){const v={repeat:p,row:g,column:m,layer:l.layer},y=`${(i.name?`${i.name}_`:"")+c}child__${it(r)?`${xo(p)}`:(r.row?`row_${xo(g)}`:"")+(r.column?`column_${xo(m)}`:"")}`,b=this.map(i,{...n,repeater:v,repeaterPrefix:y});b.name=y,a.push(Iu(b,["data"]))}const h=it(r)?t.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:r}=t;return pL(r)&&t.columns&&(t=Iu(t,["columns"]),Ct(cEe("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:r,projection:i}=t,{parentEncoding:o,parentProjection:s,config:a}=n,l=REe({parentProjection:s,projection:i}),c=AEe({parentEncoding:o,encoding:J7(r,n.repeater)});return this.mapUnit({...t,...l?{projection:l}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(t,n){const{row:r,column:i,facet:o,...s}=t.encoding,{mark:a,width:l,projection:c,height:u,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),v=J7(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...u?{height:u}:{},...f?{view:f}:{},...c?{projection:c}:{},mark:a,encoding:v,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:r,column:i,facet:o}=t;if(r||i){o&&Ct(Xln([...r?[Hm]:[],...i?[Gm]:[]]));const s={},a={};for(const l of[Hm,Gm]){const c=t[l];if(c){const{align:u,center:f,spacing:d,columns:h,...p}=c;s[l]=p;for(const g of["align","center","spacing"])c[g]!==void 0&&(a[g]??={},a[g][l]=c[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:c,...u}=o;return{facetMapping:Qfn(u,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...c?{columns:c}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=t,l={...i,parentEncoding:AEe({parentEncoding:n,encoding:o,layer:!0}),parentProjection:REe({parentProjection:r,projection:s})};return super.mapLayer({...a,...t.name?{name:[l.repeaterPrefix,t.name].filter(c=>c).join("_")}:{}},l)}}function AEe({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){const i=new Set([...wt(e),...wt(t)]);for(const o of i){const s=t[o],a=e[o];if(Hn(s)){const l={...a,...s};r[o]=l}else mL(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||xh(a)||hn(a)||Hn(a)||it(a))&&(r[o]=a)}}else r=t;return!r||Vi(r)?void 0:r}function REe(e){const{parentProjection:t,projection:n}=e;return t&&n&&Ct($ln({parentProjection:t,projection:n})),n??t}function Yhe(e){return _t(e,"filter")}function Jfn(e){return _t(e,"stop")}function UYe(e){return _t(e,"lookup")}function edn(e){return _t(e,"data")}function tdn(e){return _t(e,"param")}function ndn(e){return _t(e,"pivot")}function rdn(e){return _t(e,"density")}function idn(e){return _t(e,"quantile")}function odn(e){return _t(e,"regression")}function sdn(e){return _t(e,"loess")}function adn(e){return _t(e,"sample")}function ldn(e){return _t(e,"window")}function cdn(e){return _t(e,"joinaggregate")}function udn(e){return _t(e,"flatten")}function fdn(e){return _t(e,"calculate")}function VYe(e){return _t(e,"bin")}function ddn(e){return _t(e,"impute")}function hdn(e){return _t(e,"timeUnit")}function pdn(e){return _t(e,"aggregate")}function gdn(e){return _t(e,"stack")}function mdn(e){return _t(e,"fold")}function vdn(e){return _t(e,"extent")&&!_t(e,"density")&&!_t(e,"regression")}function ydn(e){return e.map(t=>Yhe(t)?{filter:uO(t.filter,Wcn)}:t)}class bdn extends Xhe{map(t,n){return n.emptySelections??={},n.selectionPredicates??={},t=IEe(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=IEe(t,n),t.encoding){const r={};for(const[i,o]of tb(t.encoding))r[i]=WYe(o,n);t={...t,encoding:r}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:r,...i}=t;return r?{...i,params:tb(r).map(([o,s])=>{const{init:a,bind:l,empty:c,...u}=s;u.type==="single"?(u.type="point",u.toggle=!1):u.type==="multi"&&(u.type="point"),n.emptySelections[o]=c!=="none";for(const f of ys(n.selectionPredicates[o]??{}))f.empty=c!=="none";return{name:o,value:a,select:u,bind:l}})}:t}}function IEe(e,t){const{transform:n,...r}=e;if(n){const i=n.map(o=>{if(Yhe(o))return{filter:ire(o,t)};if(VYe(o)&&xS(o.bin))return{...o,bin:HYe(o.bin)};if(UYe(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return e}function WYe(e,t){const n=Un(e);if(Et(n)&&xS(n.bin)&&(n.bin=HYe(n.bin)),CS(n)&&n.scale?.domain?.selection){const{selection:r,...i}=n.scale.domain;n.scale.domain={...i,...r?{param:r}:{}}}if(gL(n))if(it(n.condition))n.condition=n.condition.map(r=>{const{selection:i,param:o,test:s,...a}=r;return o?r:{...a,test:ire(r,t)}});else{const{selection:r,param:i,test:o,...s}=WYe(n.condition,t);n.condition=i?n.condition:{...s,test:ire(n.condition,t)}}return n}function HYe(e){const t=e.extent;if(t?.selection){const{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function ire(e,t){const n=r=>uO(r,i=>{const o=t.emptySelections[i]??!0,s={param:i,empty:o};return t.selectionPredicates[i]??=[],t.selectionPredicates[i].push(s),s});return e.selection?n(e.selection):uO(e.test||e.filter,r=>r.selection?n(r.selection):r)}class ore extends Xhe{map(t,n){const r=n.selections??[];if(t.params&&!Lv(t)){const i=[];for(const o of t.params)Hhe(o)?r.push(o):i.push(o);t.params=i}return n.selections=r,super.map(t,n)}mapUnit(t,n){const r=n.selections;if(!r||!r.length)return t;const i=(n.path??[]).concat(t.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(Ut(a)&&(a===t.name||i.includes(a))||it(a)&&a.map(l=>i.indexOf(l)).every((l,c,u)=>l!==-1&&(c===0||l>u[c-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=ore.prototype[e];ore.prototype[e]=function(n,r){return t.call(this,n,xdn(n,r))}}function xdn(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function GYe(e,t){t===void 0&&(t=FYe(e.config));const n=Cdn(e,t),{width:r,height:i}=e,o=Odn(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const wdn=new Zfn,Sdn=new bdn,_dn=new ore;function Cdn(e,t={}){const n={config:t};return _dn.map(wdn.map(Sdn.map(e,n),n),n)}function DEe(e){return Ut(e)?{type:e}:e??{}}function Odn(e,t,n){let{width:r,height:i}=t;const o=Lv(e)||u8(e),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(Ct(oEe("width")),r=void 0),i=="container"&&(Ct(oEe("height")),i=void 0));const a={type:"pad",...s,...n?DEe(n.autosize):{},...DEe(e.autosize)};if(a.type==="fit"&&!o&&(Ct(vln),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Ct(sEe("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Ct(sEe("height")),!Cu(a,{type:"pad"}))return a}function Edn(e){return["fit","fit-x","fit-y"].includes(e)}function Tdn(e){return e?`fit-${GV(e)}`:"fit"}const Pdn=["background","padding"];function LEe(e,t){const n={};for(const r of Pdn)e&&e[r]!==void 0&&(n[r]=xu(e[r]));return t&&(n.params=e.params),n}class Fv{explicit;implicit;constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new Fv(Un(this.explicit),Un(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return is(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:r}){n!==void 0&&this.set(t,n,r)}set(t,n,r){return delete this[r?"implicit":"explicit"][t],this[r?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:r}){n[t]!==void 0?this.set(t,n[t],!0):r[t]!==void 0&&this.set(t,r[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of wt(t.combine())){const r=t.getWithExplicit(n);this.setWithExplicit(n,r)}}}function rp(e){return{explicit:!0,value:e}}function cu(e){return{explicit:!1,value:e}}function qYe(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:f8(t,n,r,i)}}function f8(e,t,n,r){return e.explicit&&t.explicit&&Ct(scn(n,r,e.value,t.value)),e}function ib(e,t,n,r,i=f8){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Cu(e.value,t.value)?e:i(e,t,n,r)}class kdn extends Fv{explicit;implicit;parseNothing;constructor(t={},n={},r=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=r}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function CE(e){return _t(e,"url")}function bR(e){return _t(e,"values")}function XYe(e){return _t(e,"name")&&!CE(e)&&!bR(e)&&!I0(e)}function I0(e){return e&&(YYe(e)||QYe(e)||Qhe(e))}function YYe(e){return _t(e,"sequence")}function QYe(e){return _t(e,"sphere")}function Qhe(e){return _t(e,"graticule")}var Ao;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ao||(Ao={}));function KYe({invalid:e,isPath:t}){switch(HXe(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function Mdn(e){const{marks:t,scales:n}=KYe(e);return t===n?Ao.Main:n==="include-invalid-values"?Ao.PreFilterInvalid:Ao.PostFilterInvalid}class Ti{debugName;_children=[];_parent=null;_hash;constructor(t,n){this.debugName=n,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){Ct(Dln);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const i of this._children)i.parent=t;this._children=[],t.removeChild(this);const r=t.parent.removeChild(t);this._parent=n,n.addChild(this,r),t.parent=this}}class Mc extends Ti{type;refCounts;_source;_name;clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,r,i){super(t,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${Gqe()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function eq(e){return e.as!==void 0}function FEe(e){return`${e}_end`}class Gp extends Ti{timeUnits;clone(){return new Gp(null,Un(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let c;if(_S(l)){if(vo(n)){const{mark:u,markDef:f,config:d}=n,h=rb({fieldDef:o,markDef:f,config:d});(yR(u)||h)&&(c={timeUnit:aa(l),field:a})}}else c={as:It(o,{forAs:!0}),field:a,timeUnit:l};if(vo(n)){const{mark:u,markDef:f,config:d}=n,h=rb({fieldDef:o,markDef:f,config:d});yR(u)&&os(s)&&h!==.5&&(c.rectBandPosition=h)}c&&(i[ar(c)]=c)}return i},{});return Vi(r)?null:new Gp(t,r)}static makeFromTransform(t,n){const{timeUnit:r,...i}={...n},o=aa(r),s={...i,timeUnit:o};return new Gp(t,{[ar(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[r,i]of tb(this.timeUnits)){const o=eq(i)?i.as:`${i.field}_end`;t.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(ys(this.timeUnits).map(t=>eq(t)?t.as:FEe(t.field)))}dependentFields(){return new Set(ys(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${ar(this.timeUnits)}`}assemble(){const t=[];for(const n of ys(this.timeUnits)){const{rectBandPosition:r}=n,i=aa(n.timeUnit);if(eq(n)){const{field:o,as:s}=n,{unit:a,utc:l,...c}=i,u=[s,`${s}_end`];t.push({field:ed(o),type:"timeunit",...a?{units:QV(a)}:{},...l?{timezone:"utc"}:{},...c,as:u}),t.push(...$Ee(u,r,i))}else if(n){const{field:o}=n,s=Wqe(o),a=ZYe({timeUnit:i,field:s}),l=FEe(s);t.push({type:"formula",expr:a,as:l}),t.push(...$Ee([s,l],r,i))}}return t}}const d8="offsetted_rect_start",h8="offsetted_rect_end";function ZYe({timeUnit:e,field:t,reverse:n}){const{unit:r,utc:i}=e,o=PXe(r),{part:s,step:a}=RXe(o,e.step);return`${i?"utcOffset":"timeOffset"}('${s}', ${Ci(t)}, ${n?-a:a})`}function $Ee([e,t],n,r){if(n!==void 0&&n!==.5){const i=Ci(e),o=Ci(t);return[{type:"formula",expr:NEe([ZYe({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${d8}`},{type:"formula",expr:NEe([i,o],n+.5),as:`${e}_${h8}`}]}return[]}function NEe([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const bL="_tuple_fields";class Adn{hasChannel;hasField;hasSelectionId;timeUnit;items;constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Rdn={defined:()=>!0,parse:(e,t,n)=>{const r=t.name,i=t.project??=new Adn,o={},s={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let v=xo(`${r}_${m}`);for(let y=1;a.has(v);y++)v=xo(`${r}_${m}_${y}`);return a.add(v),{[g]:v}},c=t.type,u=e.config.selection[c],f=n.value!==void 0?Ht(n.value):null;let{fields:d,encodings:h}=Bt(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(Bt(p))for(const g of wt(p))Han(g)?(h||(h=[])).push(g):c==="interval"?(Ct(Tln),h=u.encodings):(d??=[]).push(g)}!d&&!h&&(h=u.encodings,"fields"in u&&(d=u.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Ct(yln(p,g.aggregate));continue}else if(!m){Ct(lEe(p));continue}if(g.timeUnit&&!_S(g.timeUnit)){m=e.vgField(p);const v={timeUnit:g.timeUnit,as:m,field:g.field};s[ar(v)]=v}if(!o[m]){const v=c==="interval"&&Tg(p)&&bh(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",y={field:m,channel:p,type:v,index:i.items.length};y.signals={...l(y,"data"),...l(y,"visual")},i.items.push(o[m]=y),i.hasField[m]=o[m],i.hasSelectionId=i.hasSelectionId||m===Sh,Zqe(p)?(y.geoChannel=p,y.channel=Kqe(p),i.hasChannel[y.channel]=o[m]):i.hasChannel[p]=o[m]}}else Ct(lEe(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===Sh}f&&(t.init=f.map(p=>i.items.map(g=>Bt(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Vi(s)||(i.timeUnit=new Gp(null,s))},signals:(e,t,n)=>{const r=t.name+bL;return n.filter(o=>o.name===r).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(nQe)})}},JYe="_curr",Uz="anim_value",bC="anim_clock",sre="eased_anim_clock",eQe="min_extent",tQe="max_range_extent",tq="last_tick_at",nq="is_playing",Idn=1/60*1e3,Ddn=(e,t)=>[{name:sre,update:bC},{name:`${e}_domain`,init:`domain('${t}')`},{name:eQe,init:`extent(${e}_domain)[0]`},{name:tQe,init:`extent(range('${t}'))[1]`},{name:Uz,update:`invert('${t}', ${sre})`}],Ldn={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(qp(t)&&(n=n.concat([{name:bC,init:"0",on:[{events:{type:"timer",throttle:Idn},update:`${nq} ? (${bC} + (now() - ${tq}) > ${tQe} ? 0 : ${bC} + (now() - ${tq})) : ${bC}`}]},{name:tq,init:"now()",on:[{events:[{signal:bC},{signal:nq}],update:"now()"}]},{name:nq,init:"true"}])),n),signals:(e,t,n)=>{const r=t.name,i=r+bL,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=ys(e.component.selection??{}).reduce((u,f)=>f.type==="interval"?u.concat(f.name+hO):u,[]).map(u=>`indexof(item().mark.name, '${u}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let c=`unit: ${L1(e)}, `;if(t.project.hasSelectionId)c+=`${Sh}: ${s}[${Tt(Sh)}]`;else if(qp(t))c+=`fields: ${i}, values: [${Uz} ? ${Uz} : ${eQe}]`;else{const u=o.items.map(f=>e.fieldDef(f.channel)?.bin?`[${s}[${Tt(e.vgField(f.channel,{}))}], ${s}[${Tt(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${s}[${Tt(f.field)}]`).join(", ");c+=`fields: ${i}, values: [${u}]`}if(qp(t))return n.concat(Ddn(t.name,e.scaleName(Ib)),[{name:r+pv,on:[{events:[{signal:sre},{signal:Uz}],update:`{${c}}`,force:!0}]}]);{const u=t.events;return n.concat([{name:r+pv,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}}};function nQe(e){const{signals:t,hasLegend:n,index:r,...i}=e;return i.field=ed(i.field),i}function Ow(e,t=!0,n=ml){if(it(e)){const r=e.map(i=>Ow(i,t,n));return t?`[${r.join(", ")}]`:r}else if(SS(e))return n(t?ww(e):Rcn(e));return t?n(Ei(e)):e}function Fdn(e,t){for(const n of ys(e.component.selection??{})){const r=n.name;let i=`${r}${pv}, ${n.resolve==="global"?"true":`{unit: ${L1(e)}}`}`;for(const o of p8)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(i=o.modifyExpr(e,n,i)));t.push({name:r+chn,on:[{events:{signal:n.name+pv},update:`modify(${Tt(n.name+Ew)}, ${i})`}]})}return Khe(t)}function $dn(e,t){if(e.component.selection&&wt(e.component.selection).length){const n=Tt(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Ab("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Khe(t)}function Ndn(e,t){let n=!1;for(const r of ys(e.component.selection??{})){const i=r.name,o=Tt(i+Ew);if(t.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";t.push({name:r.name,update:`${xQe}(${o}, ${Tt(a)}${l}`})}n=!0;for(const a of p8)a.defined(r)&&a.topLevelSignals&&(t=a.topLevelSignals(e,r,t))}return n&&t.filter(i=>i.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Khe(t)}function zdn(e,t){const n=[],r=[],i=L1(e,{escape:!1});for(const o of ys(e.component.selection??{})){const s={name:o.name+Ew};if(o.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:Sh}}]),o.init){const l=o.project.items.map(nQe);s.values=o.project.hasSelectionId?o.init.map(c=>({unit:i,[Sh]:Ow(c,!1)[0]})):o.init.map(c=>({unit:i,fields:l,values:Ow(c,!1)}))}if([...n,...t].filter(l=>l.name===o.name+Ew).length||n.push(s),qp(o)&&t.length){const l=e.lookupDataSource(e.getDataName(Ao.Main)),c=t.find(f=>f.name===l),u=c.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(u){c.transform=c.transform.filter(d=>d!==u);const f={name:c.name+JYe,source:c.name,transform:[u]};r.push(f)}}}return n.concat(t,r)}function rQe(e,t){for(const n of ys(e.component.selection??{}))for(const r of p8)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function jdn(e,t){for(const n of e.children)vo(n)&&(t=rQe(n,t));return t}function Bdn(e,t,n,r){const i=OQe(e,t.param,t);return{signal:bh(n.get("type"))&&it(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function Khe(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const Xm={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!Tg(i))continue;const o=e.getScaleComponent(i),s=o?o.get("type"):void 0;if(s=="sequential"&&Ct(Sln),!o||!bh(s)){Ct(wln);continue}o.set("selectionExtent",{param:t.name,field:r.field},!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||lre(e)||r.length===0)return n;const i=n.find(s=>s.name===t.name);let o=i.update;if(o.includes(xQe))i.update=`{${r.map(s=>`${Tt(ed(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${Tt(ed(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!lre(e))for(const r of t.scales){const i=n.find(o=>o.name===r.signals.data);i.push="outer",delete i.value,delete i.update}return n}};function are(e,t){return`domain(${Tt(e.scaleName(t))})`}function lre(e){return e.parent&&aP(e.parent)&&(!e.parent.parent||lre(e.parent.parent))}const hO="_brush",iQe="_scale_trigger",Jk="geo_interval_init_tick",oQe="_init",Udn="_center",Vdn={defined:e=>e.type==="interval",parse:(e,t,n)=>{if(e.hasProjection){const r={...Bt(n.select)?n.select:{}};r.fields=[Sh],r.encodings||(r.encodings=n.value?wt(n.value):[Ih,Rh]),n.select={type:"interval",...r}}if(t.translate&&!Xm.defined(t)){const r=`!event.item || event.item.mark.name !== ${Tt(t.name+hO)}`;for(const i of t.events){if(!i.between){Ct(`${i} is not an ordered event stream for interval selections.`);continue}const o=Ht(i.between[0].filter??=[]);o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const r=t.name,i=r+pv,o=ys(t.project.hasChannel).filter(a=>a.channel===_o||a.channel===ha),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(Wdn(e,t,l,s?.[l.index])),[])),e.hasProjection){const a=Tt(e.projectionName()),l=e.projectionName()+Udn,{x:c,y:u}=t.project.hasChannel,f=c?.signals.visual,d=u?.signals.visual,h=c?s?.[c.index]:`${l}[0]`,p=u?s?.[u.index]:`${l}[1]`,g=S=>e.getSizeSignalRef(S).signal,m=`[[${f?`${f}[0]`:"0"}, ${d?`${d}[0]`:"0"}],[${f?`${f}[1]`:g("width")}, ${d?`${d}[1]`:g("height")}]]`;s&&(n.unshift({name:r+oQe,init:`[scale(${a}, [${c?h[0]:h}, ${u?p[0]:p}]), scale(${a}, [${c?h[1]:h}, ${u?p[1]:p}])]`}),(!c||!u)&&(n.find(_=>_.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const v=`intersect(${m}, {markname: ${Tt(e.getName("marks"))}}, unit.mark)`,y=`{unit: ${L1(e)}}`,b=`vlSelectionTuples(${v}, ${y})`,w=o.map(S=>S.signals.visual);return n.concat({name:i,on:[{events:[...w.length?[{signal:w.join(" || ")}]:[],...s?[{signal:Jk}]:[]],update:b}]})}else{if(!Xm.defined(t)){const c=r+iQe,u=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=Tt(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),v=bh(m)?"+":"";return`(!isArray(${h}) || (${v}invert(${g}, ${p})[0] === ${v}${h}[0] && ${v}invert(${g}, ${p})[1] === ${v}${h}[1]))`});u.length&&n.push({name:c,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:`${u.join(" && ")} ? ${c} : {}`}]})}const a=o.map(c=>c.signals.data),l=`unit: ${L1(e)}, fields: ${r+bL}, values`;return n.concat({name:i,...s?{init:`{${l}: ${Ow(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(vo(e)&&e.hasProjection&&t.init&&(n.filter(i=>i.name===Jk).length||n.unshift({name:Jk,value:null,on:[{events:"timer{1}",update:`${Jk} === null ? {} : ${Jk}`}]})),n),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,s=i?.signals.visual,a=o?.signals.visual,l=`data(${Tt(t.name+Ew)})`;if(Xm.defined(t)||!i&&!o)return n;const c={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of wt(c))c[m]=[{test:`${l}.length && ${l}[0].unit === ${L1(e)}`,...c[m]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=t.mark,p=wt(h).reduce((m,v)=>(m[v]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[v]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${r+hO}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:r+hO,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}};function Wdn(e,t,n,r){const i=!e.hasProjection,o=n.channel,s=n.signals.visual,a=Tt(i?e.scaleName(o):e.projectionName()),l=d=>`scale(${a}, ${d})`,c=e.getSizeSignalRef(o===_o?"width":"height").signal,u=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${u}, ${u}]`},{events:h,update:`[${s}[0], clamp(${u}, 0, ${c})]`}],[]);if(i){const d=n.signals.data,h=Xm.defined(t),p=e.getScaleComponent(o),g=p?p.get("type"):void 0,m=r?{init:Ow(r,!0,l)}:{value:[]};return f.push({events:{signal:t.name+iQe},update:bh(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...r?{init:Ow(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===_o?0:1,h=t.name+oQe,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}function rP({model:e,channelDef:t,vgChannel:n,invalidValueRef:r,mainRefFn:i}){const o=gL(t)&&t.condition;let s=[];o&&(s=Ht(o).map(c=>{const u=i(c);if(Aun(c)){const{param:f,empty:d}=c;return{test:CQe(e,{param:f,empty:d}),...u}}else return{test:LB(e,c.test),...u}})),r!==void 0&&s.push(r);const a=i(t);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function Zhe(e,t="text"){const n=e.encoding[t];return rP({model:e,channelDef:n,vgChannel:t,mainRefFn:r=>Jhe(r,e.config),invalidValueRef:void 0})}function Jhe(e,t,n="datum"){if(e){if(xh(e))return lo(e.value);if(Hn(e)){const{format:r,formatType:i}=SE(e);return Rhe({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function sQe(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,s=n.tooltip;if(it(s))return{tooltip:zEe({tooltip:s},o,i,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return rP({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:c=>{const u=lQe(c,i,a);if(u)return u;if(c===null)return;let f=vi("tooltip",r,i);if(f===!0&&(f={content:"encoding"}),Ut(f))return{value:f};if(Bt(f))return hn(f)?f:f.content==="encoding"?zEe(n,o,i,t):{signal:a}},invalidValueRef:void 0})}}function aQe(e,t,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o=new Set,s=r?"datum.datum":"datum",a=[];function l(u,f){const d=bS(f),h=Yl(u)?u:{...u,type:e[d].type},p=h.title||Fhe(h,i),g=Ht(p).join(", ").replaceAll(/"/g,'\\"');let m;if(os(f)){const v=f==="x"?"x2":"y2",y=wh(e[v]);if(xa(h.bin)&&y){const b=It(h,{expr:s}),w=It(y,{expr:s}),{format:S,formatType:_}=SE(h);m=hL(b,w,S,_,i),o.add(v)}}if((os(f)||f===fd||f===Ah)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:v,formatType:y}=SE(h);m=Rhe({fieldOrDatumDef:h,format:v,formatType:y,expr:s,config:i,normalizeStack:!0}).signal}m??=lQe(h,i,s).signal,a.push({channel:f,key:g,value:m})}Nhe(e,(u,f)=>{Et(u)?l(u,f):i8(u)&&l(u.condition,f)});const c={};for(const{channel:u,key:f,value:d}of a)!o.has(u)&&!c[f]&&(c[f]=d);return c}function zEe(e,t,n,{reactiveGeom:r}={}){const i=aQe(e,t,n,{reactiveGeom:r}),o=tb(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function lQe(e,t,n="datum"){if(Et(e)&&She(e.type)&&!SE(e).format&&!SE(e).formatType){const r=`${n}["${e.field}"]`;return{signal:`isValid(${r}) ? isArray(${r}) ? join(${r}, '\\n') : ${r} : ""+${r}`}}return Jhe(e,t,n)}function Hdn(e){const{markDef:t,config:n}=e,r=vi("aria",t,n);return r===!1?{}:{...r?{aria:r}:{},...Gdn(e),...qdn(e)}}function Gdn(e){const{mark:t,markDef:n,config:r}=e;if(r.aria===!1)return{};const i=vi("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:Qt(hln,t)?{}:{ariaRoleDescription:{value:t}}}function qdn(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return rP({model:e,channelDef:o,vgChannel:"description",mainRefFn:l=>Jhe(l,e.config),invalidValueRef:void 0});const s=vi("description",n,r);if(s!=null)return{description:lo(s)};if(r.aria===!1)return{};const a=aQe(t,i,r);if(!Vi(a))return{description:{signal:tb(a).filter(([l])=>!l.startsWith("_")).map(([l,c])=>[l,c.replaceAll("\\n"," ")]).map(([l,c],u)=>`"${u>0?"; ":""}${l}: " + (${c})`).join(" + ")}}}function Ta(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;const c=i[e];a===void 0&&(l??=vi(e,r,o,{vgChannel:s,ignoreVgConfig:!gL(c)}),l!==void 0&&(a=lo(l)));const u={markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=qXe({...u,scaleChannel:e,channelDef:c});return rP({model:t,channelDef:c,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>Ahe({...u,channel:e,channelDef:h,stack:null,defaultRef:a})})}function cQe(e,t={filled:void 0}){const{markDef:n,encoding:r,config:i}=e,{type:o}=n,s=t.filled??vi("filled",n,i),a=yr(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=vi(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,c=vi(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],u=s?"fill":"stroke",f={...l?{fill:lo(l)}:{},...c?{stroke:lo(c)}:{}};return n.color&&(s?n.fill:n.stroke)&&Ct(bXe("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...Ta("color",e,{vgChannel:u,defaultValue:s?l:c}),...Ta("fill",e,{defaultValue:r.fill?l:void 0}),...Ta("stroke",e,{defaultValue:r.stroke?c:void 0})}}function Xdn(e){const{encoding:t,mark:n}=e,r=t.order;return!zb(n)&&xh(r)?rP({model:e,channelDef:r,vgChannel:"zindex",mainRefFn:i=>lo(i.value),invalidValueRef:void 0}):{}}function OE({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:Ahe({channel:o,channelDef:a,markDef:t,config:r?.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:lo(s),bandPosition:i})};const l=t[o];return l?{offsetType:"visual",offset:l}:{}}function Ul(e,t,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=t,l=i[e],c=i[Eg(e)],u=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=OE({channel:e,markDef:o,encoding:i,model:t,bandPosition:.5}),p=epe({model:t,defaultPos:n,channel:e,scaleName:u,scale:f}),g=!l&&os(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:Ydn({channel:e,channelDef:l,channel2Def:c,markDef:o,config:s,scaleName:u,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||e]:g}:void 0}function Ydn(e){const{channel:t,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=e;if(Hn(n)&&i&&t===i.fieldChannel){if(Et(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return TB({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return I1(n,r,{suffix:"end"},{offset:o})}return Mhe(e)}function epe({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=e;return()=>{const a=bS(n),l=nb(n),c=vi(n,o,s,{vgChannel:l});if(c!==void 0)return KM(n,c);switch(t){case"zeroOrMin":return jEe({scaleName:r,scale:i,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return jEe({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[Uc(n)],mult:.5}}}}function jEe({mainChannel:e,config:t,...n}){const r=GXe(n),{mode:i}=n;if(r)return r;switch(e){case"radius":{if(i==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=i.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return i==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return i==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return i==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const Qdn={left:"x",center:"xc",right:"x2"},Kdn={top:"y",middle:"yc",bottom:"y2"};function uQe(e,t,n,r="middle"){if(e==="radius"||e==="theta")return nb(e);const i=e==="x"?"align":"baseline",o=vi(i,t,n);let s;return hn(o)?(Ct(Yln(i)),s=void 0):s=o,e==="x"?Qdn[s||(r==="top"?"left":"center")]:Kdn[s||r]}function IB(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?fQe(e,t,{defaultPos:n,defaultPos2:r}):Ul(e,t,{defaultPos:n})}function fQe(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,s=Eg(e),a=Uc(e),l=Zdn(t,r,s),c=l[a]?uQe(e,i,o):nb(e);return{...Ul(e,t,{defaultPos:n,vgChannel:c}),...l}}function Zdn(e,t,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=e,l=bS(n),c=Uc(n),u=nb(n),f=r[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=n in r||n in o?OE({channel:n,markDef:o,encoding:r,model:e}):OE({channel:l,markDef:o,encoding:r,model:e});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const m=Uc(n),v=e.markDef[m];return v!=null?{[m]:{value:v}}:{[u]:{field:e.getName(n)}}}const g=Jdn({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[u]:g}:mN(n,o)||mN(n,{[n]:Yne(n,o,a.style),[c]:Yne(c,o,a.style)})||mN(n,a[i])||mN(n,a.mark)||{[u]:epe({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Jdn({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c}){return Hn(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?I1(t,o,{suffix:"start"},{offset:l}):Mhe({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:c})}function mN(e,t){const n=Uc(e),r=nb(e);if(t[r]!==void 0)return{[r]:KM(e,t[r])};if(t[e]!==void 0)return{[r]:KM(e,t[e])};if(t[n]){const i=t[n];if(_w(i))Ct(Vln(n));else return{[n]:KM(e,i)}}}function hv(e,t){const{config:n,encoding:r,markDef:i}=e,o=i.type,s=Eg(t),a=Uc(t),l=r[t],c=r[s],u=e.getScaleComponent(t),f=u?u.get("type"):void 0,d=i.orient,h=r[a]??r.size??vi("size",i,n,{vgChannel:a}),p=nXe(t),g=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return Et(l)&&(eo(l.bin)||xa(l.bin)||l.timeUnit&&!c)&&!(h&&!_w(h))&&!r[p]&&!Wo(f)?nhn({fieldDef:l,fieldDef2:c,channel:t,model:e}):(Hn(l)&&Wo(f)||g)&&!c?thn(l,t,e):fQe(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function ehn(e,t,n,r,i,o,s){if(_w(i))if(n){const l=n.get("type");if(l==="band"){let c=`bandwidth('${t}')`;i.band!==1&&(c=`${i.band} * ${c}`);const u=sg("minBandSize",{type:s},r);return{signal:u?`max(${eh(u)}, ${c})`:c}}else i.band!==1&&(Ct(Jln(l)),i=void 0)}else return{mult:i.band,field:{group:e}};else{if(hn(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(wS(l)&&Qr(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:c,rectBandPaddingInner:u,tickBandPaddingInner:f}=r.scale,d=is(l,s==="tick"?f:s==="bar"?c:u);if(hn(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Qr(d))return{signal:`${1-d} * ${e}`}}return{value:nre(r.view,e)-2}}function thn(e,t,n){const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(t),c=n.getScaleComponent(t),u=Uc(t),f=Eg(t),d=nXe(t),h=n.scaleName(d),p=n.getScaleComponent(nhe(t)),g=r.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(i.size||r.size)&&(g?m=Ta("size",n,{vgChannel:u,defaultRef:lo(r.size)}):Ct(rcn(r.type)));const v=!!m,y=eYe({channel:t,fieldDef:e,markDef:r,config:o,scaleType:(c||p)?.get("type"),useVlSizeChannel:g});m=m||{[u]:ehn(u,h||l,p||c,o,y,!!e,r.type)};const b=(c||p)?.get("type")==="band"&&_w(y)&&!v?"top":"middle",w=uQe(t,r,o,b),S=w==="xc"||w==="yc",{offset:_,offsetType:E}=OE({channel:t,markDef:r,encoding:i,model:n,bandPosition:S?.5:0}),T=Mhe({channel:t,channelDef:e,markDef:r,config:o,scaleName:l,scale:c,stack:s,offset:_,defaultRef:epe({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:c}),bandPosition:S?E==="encoding"?0:.5:hn(y)?{signal:`(1-${y})/2`}:_w(y)?(1-y.band)/2:0});if(u)return{[w]:T,...m};{const k=nb(f),P=m[u],I=_?{...P,offset:_}:P;return{[w]:T,[k]:it(T)?[T[0],{...T[1],offset:I}]:{...T,offset:I}}}}function BEe(e,t,n,r,i,o,s){if(Qqe(e))return 0;const a=e==="x"||e==="y2",l=a?-t/2:t/2;if(hn(n)||hn(i)||hn(r)||o){const c=eh(n),u=eh(i),f=eh(r),d=eh(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",m=c?`(${c} ? -1 : 1) * `:"",v=u?`(${u} + ${p})`:p;return{signal:g+m+v}}else return i=i||0,r+(n?-i-l:+i+l)}function nhn({fieldDef:e,fieldDef2:t,channel:n,model:r}){const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),c=a?a.get("type"):void 0,u=a.get("reverse"),f=eYe({channel:n,fieldDef:e,markDef:o,config:i,scaleType:c}),h=r.component.axes[n]?.[0]?.get("translate")??.5,p=os(n)?vi("binSpacing",o,i)??0:0,g=Eg(n),m=nb(n),v=nb(g),y=sg("minBandSize",o,i),{offset:b}=OE({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:w}=OE({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),S=Eun({fieldDef:e,scaleName:l}),_=BEe(n,p,u,h,b,y,S),E=BEe(g,p,u,h,w??b,y,S),T=hn(f)?{signal:`(1-${f.signal})/2`}:_w(f)?(1-f.band)/2:.5,k=rb({fieldDef:e,fieldDef2:t,markDef:o,config:i});if(eo(e.bin)||e.timeUnit){const P=e.timeUnit&&k!==.5;return{[v]:UEe({fieldDef:e,scaleName:l,bandPosition:T,offset:E,useRectOffsetField:P}),[m]:UEe({fieldDef:e,scaleName:l,bandPosition:hn(T)?{signal:`1-${T.signal}`}:1-T,offset:_,useRectOffsetField:P})}}else if(xa(e.bin)){const P=I1(e,l,{},{offset:E});if(Et(t))return{[v]:P,[m]:I1(t,l,{},{offset:_})};if(xS(e.bin)&&e.bin.step)return{[v]:P,[m]:{signal:`scale("${l}", ${It(e,{expr:"datum"})} + ${e.bin.step})`,offset:_}}}Ct(SXe(g))}function UEe({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return TB({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:d8,endSuffix:h8}:{}})}const rhn=new Set(["aria","width","height"]);function dd(e,t){const{fill:n=void 0,stroke:r=void 0}=t.color==="include"?cQe(e):{};return{...ihn(e.markDef,t),...VEe("fill",n),...VEe("stroke",r),...Ta("opacity",e),...Ta("fillOpacity",e),...Ta("strokeOpacity",e),...Ta("strokeWidth",e),...Ta("strokeDash",e),...Xdn(e),...sQe(e),...Zhe(e,"href"),...Hdn(e)}}function VEe(e,t){return t?{[e]:t}:{}}function ihn(e,t){return dln.reduce((n,r)=>(!rhn.has(r)&&_t(e,r)&&t[r]!=="ignore"&&(n[r]=lo(e[r])),n),{})}function tpe(e){const{config:t,markDef:n}=e,r=new Set;if(e.forEachFieldDef((i,o)=>{let s;if(!Tg(o)||!(s=e.getScaleType(o)))return;const a=qV(i.aggregate),l=khe({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(_un(l)){const c=e.vgField(o,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});c&&r.add(c)}}),r.size>0)return{defined:{signal:[...r].map(o=>KV(o,!0)).join(" && ")}}}function WEe(e,t){if(t!==void 0)return{[e]:lo(t)}}const rq="voronoi",dQe={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(rq)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(zb(o))return Ct(bln(o)),n;const s={name:e.getName(rq),type:"path",interactive:!0,aria:!1,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...sQe(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((c,u)=>{const f=c.name??"";f===e.component.mark[0].name?a=u:f.includes(rq)&&(l=!0)}),l||n.splice(a+1,0,s),n}},hQe={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!Whe(e.bind),parse:(e,t,n)=>wQe(t,n),topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,s=t.init?.[0],a=dQe.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,c)=>{const u=xo(`${r}_${l.field}`);n.filter(d=>d.name===u).length||n.unshift({name:u,...s?{init:Ow(s[c])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${Tt(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(c=>c.name===r+pv),s=r+bL,a=i.items.map(c=>xo(`${r}_${c.field}`)),l=a.map(c=>`${c} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},DB="_toggle",pQe={defined:e=>e.type==="point"&&!qp(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+DB,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+pv,r=t.name+DB;return`${r} ? null : ${n}, ${t.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${L1(e)}}, `}${r} ? ${n} : null`}},ohn={defined:e=>e.clear!==void 0&&e.clear!==!1&&!qp(e),parse:(e,t)=>{t.clear&&(t.clear=Ut(t.clear)?Ab(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(hQe.defined(t))for(const r of t.project.items){const i=n.findIndex(o=>o.name===xo(`${t.name}_${r.field}`));i!==-1&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const i of t.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===t.name+pv);r(i,"null"),pQe.defined(t)&&(i=n.findIndex(o=>o.name===t.name+DB),r(i,"false"))}return n}},gQe={defined:e=>{const t=e.resolve==="global"&&e.bind&&Whe(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Sh;return t&&!n&&Ct(_ln),t&&n},parse:(e,t,n)=>{const r=Un(n);if(r.select=Ut(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},wQe(t,r),Bt(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=Ht(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=K7(t.bind)?t.bind.legend:"click",o=Ut(i)?Ab(i,"view"):Ht(i);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=K7(t.bind)&&t.bind.legend,o=s=>a=>{const l=Un(a);return l.markname=s,l};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${xo(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(u=>u.name===l).length===0){const u=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...t.init?{}:{value:null},on:[{events:u,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(d=>d.name===r+pv),s=r+bL,a=i.items.filter(d=>d.hasLegend).map(d=>xo(`${r}_${xo(d.field)}_legend`)),c=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:c}):a.length>0&&(o.update=c,delete o.value,delete o.on);const u=n.find(d=>d.name===r+DB),f=K7(t.bind)&&t.bind.legend;return u&&(t.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};function shn(e,t,n){const r=e.fieldDef(t)?.field;for(const i of ys(e.component.selection??{})){const o=i.project.hasField[r]??i.project.hasChannel[t];if(o&&gQe.defined(i)){const s=n.get("selections")??[];s.push(i.name),n.set("selections",s,!1),o.hasLegend=!0}}}const mQe="_translate_anchor",vQe="_translate_delta",ahn={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const r=t.name,i=Xm.defined(t),o=r+mQe,{x:s,y:a}=t.project.hasChannel;let l=Ab(t.translate,"scope");return i||(l=l.map(c=>(c.between[0].markname=r+hO,c))),n.push({name:o,value:{},on:[{events:l.map(c=>c.between[0]),update:`{x: x(unit), y: y(unit)${s!==void 0?`, extent_x: ${i?are(e,_o):`slice(${s.signals.visual})`}`:""}${a!==void 0?`, extent_y: ${i?are(e,ha):`slice(${a.signals.visual})`}`:""}}`}]},{name:r+vQe,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&HEe(e,t,s,"width",n),a!==void 0&&HEe(e,t,a,"height",n),n}};function HEe(e,t,n,r,i){const o=t.name,s=o+mQe,a=o+vQe,l=n.channel,c=Xm.defined(t),u=i.find(S=>S.name===n.signals[c?"data":"visual"]),f=e.getSizeSignalRef(r).signal,d=e.getScaleComponent(l),h=d?.get("type"),p=d?.get("reverse"),g=c?l===_o?p?"":"-":p?"-":"":"",m=`${s}.extent_${l}`,v=`${g}${a}.${l} / ${c?`${f}`:`span(${m})`}`,y=!c||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",b=c?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",w=`${y}(${m}, ${v}${b})`;u.on.push({events:{signal:a},update:c?w:`clampRange(${w}, 0, ${f})`})}const yQe="_zoom_anchor",bQe="_zoom_delta",lhn={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=Xm.defined(t),o=r+bQe,{x:s,y:a}=t.project.hasChannel,l=Tt(e.scaleName(_o)),c=Tt(e.scaleName(ha));let u=Ab(t.zoom,"scope");return i||(u=u.map(f=>(f.markname=r+hO,f))),n.push({name:r+yQe,on:[{events:u,update:i?`{${[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(f=>f).join(", ")}}`:"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&GEe(e,t,s,"width",n),a!==void 0&&GEe(e,t,a,"height",n),n}};function GEe(e,t,n,r,i){const o=t.name,s=n.channel,a=Xm.defined(t),l=i.find(y=>y.name===n.signals[a?"data":"visual"]),c=e.getSizeSignalRef(r).signal,u=e.getScaleComponent(s),f=u?.get("type"),d=a?are(e,s):l.name,h=o+bQe,p=`${o}${yQe}.${s}`,g=!a||!u?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${u.get("exponent")??1}`:f==="symlog"?`, ${u.get("constant")??1}`:"":"",v=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?v:`clampRange(${v}, 0, ${c})`})}const Ew="_store",pv="_tuple",chn="_modify",xQe="vlSelectionResolve",p8=[Ldn,Vdn,Rdn,pQe,hQe,Xm,gQe,ohn,ahn,lhn,dQe];function uhn(e){let t=e.parent;for(;t&&!Du(t);)t=t.parent;return t}function L1(e,{escape:t}={escape:!0}){let n=t?Tt(e.name):e.name;const r=uhn(e);if(r){const{facet:i}=r;for(const o of Pf)i[o]&&(n+=` + '__facet_${o}_' + (facet[${Tt(r.vgField(o))}])`)}return n}function npe(e){return ys(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function wQe(e,t){(Ut(t.select)||!t.select.on)&&delete e.events,(Ut(t.select)||!t.select.clear)&&delete e.clear,(Ut(t.select)||!t.select.toggle)&&delete e.toggle}function qp(e){return e.events?.find(t=>"type"in t&&t.type==="timer")}function cre(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...cre(e.object)),t.push(...cre(e.property))),t)}function SQe(e){return e.object.type==="MemberExpression"?SQe(e.object):e.object.name==="datum"}function _Qe(e){const t=bde(e),n=new Set;return t.visit(r=>{r.type==="MemberExpression"&&SQe(r)&&n.add(cre(r).slice(1).join("."))}),n}class iP extends Ti{model;filter;expr;_dependentFields;clone(){return new iP(null,this.model,Un(this.filter))}constructor(t,n,r){super(t),this.model=n,this.filter=r,this.expr=LB(this.model,this.filter,this),this._dependentFields=_Qe(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function fhn(e,t){const n={},r=e.config.selection;if(!t||!t.length)return n;let i=0;for(const o of t){const s=xo(o.name),a=o.select,l=Ut(a)?a:a.type,c=Bt(a)?Un(a):{type:l},u=r[l];for(const h in u)h==="fields"||h==="encodings"||(h==="mark"&&(c.mark={...u.mark,...c.mark}),(c[h]===void 0||c[h]===!0)&&(c[h]=Un(u[h]??c[h])));const f=n[s]={...c,name:s,type:l,init:o.value,bind:o.bind,events:Ut(c.on)?Ab(c.on,"scope"):Ht(Un(c.on))};if(qp(f)&&(i++,i>1)){delete n[s];continue}const d=Un(o);for(const h of p8)h.defined(f)&&h.parse&&h.parse(e,f,d)}return i>1&&Ct(kln),n}function CQe(e,t,n,r="datum"){const i=Ut(t)?t:t.param,o=xo(i),s=Tt(o+Ew);let a;try{a=e.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",c=a.resolve==="global"?")":`, ${Tt(a.resolve)})`,u=`${l}${s}, ${r}${c}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${u}`:`!${f} || ${u}`}function OQe(e,t,n){const r=xo(t),i=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(r,t)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&Ct(Mln(o));else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,Ct(Aln(a,i,n,o))):o=a[0].field}return`${s.name}[${Tt(ed(o))}]`}function dhn(e,t){for(const[n,r]of tb(e.component.selection??{})){const i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new Mc(new iP(t,e,{param:n}),i,Ao.Lookup,e.component.data.outputNodeRefCounts)}}function LB(e,t,n){return QM(t,r=>Ut(r)?r:Bcn(r)?CQe(e,r,n):DXe(r))}function hhn(e,t){if(e)return it(e)&&!Yy(e)?e.map(n=>Fhe(n,t)).join(", "):e}function iq(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function pM(e,t,n,r={header:!1}){const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:c,...u}=e.combine();if(!i){for(const f in u){const d=f,h=Hun[d],p=u[d];if(h&&h!==t&&h!=="both")delete u[d];else if(yL(p)){const{condition:g,...m}=p,v=Ht(g),y=xEe[d];if(y){const{vgProp:b,part:w}=y,S=[...v.map(_=>{const{test:E,...T}=_;return{test:LB(null,E),...T}}),m];iq(u,w,b,S),delete u[d]}else if(y===null){const b={signal:v.map(w=>{const{test:S,..._}=w;return`${LB(null,S)} ? ${iEe(_)} : `}).join("")+iEe(m)};u[d]=b}}else if(hn(p)){const g=xEe[d];if(g){const{vgProp:m,part:v}=g;iq(u,v,m,p),delete u[d]}}yr(["labelAlign","labelBaseline"],d)&&u[d]===null&&delete u[d]}if(t==="grid"){if(!u.grid)return;if(u.encode){const{grid:f}=u.encode;u.encode={...f?{grid:f}:{}},Vi(u.encode)&&delete u.encode}return{scale:s,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:is(c,0)}}else{if(!r.header&&e.mainExtracted)return;if(a!==void 0){let d=a;u.encode?.labels?.update&&hn(u.encode.labels.update.text)&&(d=yw(a,"datum.label",u.encode.labels.update.text.signal)),iq(u,"labels","text",{signal:d})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(const d of uYe)e.hasAxisPart(d)||delete u.encode[d];Vi(u.encode)&&delete u.encode}const f=hhn(l,n);return{scale:s,orient:o,grid:!1,...f?{title:f}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:is(c,0)}}}}function EQe(e){const{axes:t}=e.component,n=[];for(const r of Dv)if(t[r]){for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function phn(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(i=>pM(i,"grid",t)),...r.map(i=>pM(i,"grid",t)),...n.map(i=>pM(i,"main",t)),...r.map(i=>pM(i,"main",t))].filter(i=>i)}function qEe(e,t,n,r){return Object.assign.apply(null,[{},...e.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...wt(s),...wt(a)]),c={};for(const u of l.values())c[u]={signal:`${r.signal} === "${o}" ? ${eh(s[u])} : ${eh(a[u])}`};return c}return t[i]})])}function ghn(e,t,n,r){const i=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:$Xe(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=hn(n)?"axisOrient":`axis${aL(n)}`,a=[...i,...i.map(c=>o+c.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:qEe(a,r,e,n),vgAxisConfig:qEe(l,r,e,n),axisConfigStyle:mhn([...l,...a],r)}}function mhn(e,t){const n=[{}];for(const r of e){let i=t[r]?.style;if(i){i=Ht(i);for(const o of i)n.push(t.style[o])}}return Object.assign.apply(null,n)}function ure(e,t,n,r={}){const i=dXe(e,n,t);if(i!==void 0)return{configFrom:"style",configValue:i};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(r[o]?.[e]!==void 0)return{configFrom:o,configValue:r[o][e]};return{}}const XEe={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??vhn(n,e),gridScale:({model:e,channel:t})=>yhn(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||PQe(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||TQe(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??xhn(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??whn(t.type,n,Et(t)&&!!t.timeUnit,Et(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??_hn({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??Chn({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const r=kQe(t,n);if(r!==void 0)return r;const i=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return pXe(i?[yEe(i)]:[],Et(s)?[yEe(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Ohn(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Ehn(n,t)};function vhn(e,t){return!Wo(e)&&Et(t)&&!eo(t?.bin)&&!xa(t?.bin)}function yhn(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function bhn(e,t,n,r,i){const o=t?.labelAngle;if(o!==void 0)return hn(o)?o:vR(o);{const{configValue:s}=ure("labelAngle",r,t?.style,i);return s!==void 0?vR(s):n===_o&&yr([Che,_he],e.type)&&!(Et(e)&&e.timeUnit)?270:void 0}}function fre(e){return`(((${e.signal} % 360) + 360) % 360)`}function TQe(e,t,n,r){if(e!==void 0)if(n==="x"){if(hn(e)){const i=fre(e),o=hn(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45{if(CS(r)&&JXe(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((c,u)=>`${DXe({field:o,timeUnit:s,equal:c})} ? ${u} : `).join("")+a.length;t=new EE(t,{calculate:l,as:TE(r,i,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${ar(this.transform)}`}}function TE(e,t,n){return It(e,{prefix:t,suffix:"sort_index",...n})}function g8(e,t){return yr(["top","bottom"],t)?"column":yr(["left","right"],t)||e==="row"?"row":"column"}function PE(e,t,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return is((t||{})[e],i[e],n.header[e])}function m8(e,t,n,r){const i={};for(const o of e){const s=PE(o,t||{},n,r);s!==void 0&&(i[o]=s)}return i}const rpe=["row","column"],ipe=["header","footer"];function Thn(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=m8(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),l=g8(t,a),c=vR(s);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...AQe(c,l),...MQe(l,c,o),...RQe(r,i,t,hfn,PYe)}}}function MQe(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=PQe(t,e==="row"?"left":"top",e==="row"?"y":"x");return r?{align:r}:{}}function AQe(e,t){const n=TQe(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Phn(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of ipe)if(n[i])for(const o of n[i]){const s=Mhn(e,t,i,n,o);s!=null&&r.push(s)}return r}function khn(e,t){const{sort:n}=e;return qm(n)?{field:It(n,{expr:"datum"}),order:n.order??"ascending"}:it(n)?{field:TE(e,t,{expr:"datum"}),order:"ascending"}:{field:It(e,{expr:"datum"}),order:n??"ascending"}}function dre(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=m8(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),c=Rhe({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,u=g8(t,a);return{text:{signal:l?yw(yw(l,"datum.label",c),"datum.value",It(e,{expr:"parent"})):c},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...AQe(o,u),...MQe(u,o,s),...RQe(n,e,t,pfn,kYe)}}function Mhn(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=e.config?e.config:void 0;if(s&&i.labels){const{labelOrient:f}=m8(["labelOrient"],s.header,a,t);(t==="row"&&!yr(["top","bottom"],f)||t==="column"&&!yr(["left","right"],f))&&(o=dre(s,t,a))}const l=Du(e)&&!pL(e.facet),c=i.axes,u=c?.length>0;if(o||u){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:khn(s,t)}:{},...u&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const Ahn={column:{start:0,end:1},row:{start:1,end:0}};function Rhn(e,t){return Ahn[t][e]}function Ihn(e,t){const n={};for(const r of Pf){const i=e[r];if(i?.facetFieldDef){const{titleAnchor:o,titleOrient:s}=m8(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=g8(r,s),l=Rhn(o,a);l!==void 0&&(n[a]=l)}}return Vi(n)?void 0:n}function RQe(e,t,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=PE(s,t?.header,e,n);a!==void 0&&(o[i[s]]=a)}return o}function ope(e){return[...vN(e,"width"),...vN(e,"height"),...vN(e,"childWidth"),...vN(e,"childHeight")]}function vN(e,t){const n=t==="width"?"x":"y",r=e.component.layoutSize.get(t);if(r==null||r==="merged")return[];const i=e.getSizeSignalRef(t).signal;if(r==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(Wo(s)&&wS(a)){const l=e.scaleName(n);return Du(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[YEe(l,a)]:[YEe(l,a),{name:i,update:IQe(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=tre(e.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function YEe(e,t){const n=`${e}_step`;return hn(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function IQe(e,t,n){const r=t.get("type"),i=t.get("padding"),o=is(t.get("paddingOuter"),i);let s=t.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${eh(s)}, ${eh(o)}) * ${e}_step`}function DQe(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function LQe(e,t){return wt(e).reduce((n,r)=>({...n,...rP({model:t,channelDef:e[r],vgChannel:r,mainRefFn:i=>lo(i.value),invalidValueRef:void 0})}),{})}function FQe(e,t){if(Du(t))return e==="theta"?"independent":"shared";if(aP(t))return"shared";if(dpe(t))return os(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function spe(e,t){const n=e.scale[t],r=os(t)?"axis":"legend";return n==="independent"?(e[r][t]==="shared"&&Ct(lcn(t)),"independent"):e[r][t]||"shared"}const Dhn={...vfn,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},$Qe=wt(Dhn);class Lhn extends Fv{}const QEe={symbols:Fhn,gradient:$hn,labels:Nhn,entries:zhn};function Fhn(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:c}=n,u=s.filled&&c!=="trail";let f={...mln({},n,hun),...cQe(n,{filled:u})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?NQe(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||u&&r===jc)delete f.fill;else if(_t(f.fill,"field"))h?delete f.fill:(f.fill=lo(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=lo(g??1));else if(it(f.fill)){const m=hre(a.fill??a.color)??s.fill??(u&&s.color);m&&(f.fill=lo(m))}}if(f.stroke){if(r==="stroke"||!u&&r===jc)delete f.stroke;else if(_t(f.stroke,"field")||p)delete f.stroke;else if(it(f.stroke)){const m=is(hre(a.stroke||a.color),s.stroke,u?s.color:void 0);m&&(f.stroke={value:m})}}if(r!==Iv){const m=Et(t)&&jQe(n,i,t);m?f.opacity=[{test:m,...lo(g??1)},lo(l.legend.unselectedOpacity)]:g&&(f.opacity=lo(g))}return f={...f,...e},Vi(f)?void 0:f}function $hn(e,{model:t,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=t;let a={};const c=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?NQe(s.opacity)||o.opacity:void 0;return c&&(a.opacity=lo(c)),a={...a,...e},Vi(a)?void 0:a}function Nhn(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=Et(t)?jQe(n,i,t):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:u}=o;let f;Cw(u)?f=th({fieldOrDatumDef:t,field:"datum.value",format:c,formatType:u,config:s}):c===void 0&&u===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=th({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&Et(t)&&t.timeUnit===void 0&&(f=th({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return Vi(d)?void 0:d}function zhn(e,{legendCmpt:t}){return t.get("selections")?.length?{...e,fill:{value:"transparent"}}:e}function NQe(e){return zQe(e,(t,n)=>Math.max(t,n.value))}function hre(e){return zQe(e,(t,n)=>is(t,n.value))}function zQe(e,t){if(Iun(e))return Ht(e.condition).reduce(t,e.value);if(xh(e))return e.value}function jQe(e,t,n){const r=t.get("selections");if(!r?.length)return;const i=Tt(n.field);return r.map(o=>`(!length(data(${Tt(xo(o)+Ew)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const KEe={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return QXe(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return KXe(r,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??Ghn(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??qhn(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??Bhn(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>dO(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(fO(n)&&Op(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>jhn(t,e)};function jhn(e,t){const n=e.values;if(it(n))return cYe(t,n);if(hn(n))return n}function Bhn(e,t,n,r){if(t!=="shape"){const i=hre(n)??r;if(i)return i}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function Uhn(e){const{legend:t}=e;return is(t.type,Vhn(e))}function Vhn({channel:e,timeUnit:t,scaleType:n}){if(fO(e)){if(yr(["quarter","month","day"],t))return"symbol";if(Op(n))return"gradient"}return"symbol"}function Whn({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?"gradientDirection":"symbolDirection"]??Hhn(n,t)}function Hhn(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function Ghn({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(Op(i))return n==="horizontal"?r==="top"||r==="bottom"?ZEe(t,"width",s,o):s:ZEe(t,"height",l,a)}function ZEe(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function qhn(e){if(yr(["quantile","threshold","log","symlog"],e))return"greedy"}function BQe(e){const t=vo(e)?Xhn(e):Zhn(e);return e.component.legends=t,t}function Xhn(e){const{encoding:t}=e,n={};for(const r of[jc,...AYe]){const i=Ls(t[r]);!i||!e.getScaleComponent(r)||r===Bc&&Et(i)&&i.type===nP||(n[r]=Khn(e,r))}return n}function Yhn(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function Qhn(e,t,n,r){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===r?.title)return!0}return e===(n||{})[t]}function Khn(e,t){let n=e.legend(t);const{markDef:r,encoding:i,config:o}=e,s=o.legend,a=new Lhn({},Yhn(e,t));shn(e,t,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const c=e.getScaleComponent(t).get("type"),u=Ls(i[t]),f=Et(u)?aa(u.timeUnit)?.unit:void 0,d=n.orient||o.legend.orient||"right",h=Uhn({legend:n,channel:t,timeUnit:f,scaleType:c}),p=Whn({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:s,config:o,scaleType:c,orient:d,legendType:h,direction:p};for(const w of $Qe){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const S=w in KEe?KEe[w](g):n[w];if(S!==void 0){const _=Qhn(S,w,n,e.fieldDef(t));(_||o.legend[w]===void 0)&&a.set(w,S,_)}}const m=n?.encoding??{},v=a.get("selections"),y={},b={fieldOrDatumDef:u,model:e,channel:t,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const S=LQe(m[w]??{},e),_=w in QEe?QEe[w](S,b):S;_!==void 0&&!Vi(_)&&(y[w]={...v?.length&&Et(u)?{name:`${xo(u.field)}_legend_${w}`}:{},...v?.length?{interactive:!0}:{},update:v?.length?{..._,cursor:{value:"pointer"}}:_})}return Vi(y)||a.set("encode",y,!!n?.encoding),a}function Zhn(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){BQe(r);for(const i of wt(r.component.legends))n.legend[i]=spe(e.component.resolve,i),n.legend[i]==="shared"&&(t[i]=UQe(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of wt(t))for(const i of e.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return t}function UQe(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const o of $Qe){const s=ib(e.getWithExplicit(o),t.getWithExplicit(o),o,"legend",(a,l)=>{switch(o){case"symbolType":return Jhn(a,l);case"title":return mXe(a,l);case"type":return i=!0,cu("symbol")}return f8(a,l,o,"legend")});e.setWithExplicit(o,s)}return i&&(e.implicit?.encode?.gradient&&CB(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&CB(e.explicit,["encode","gradient"])),e}function Jhn(e,t){return t.value==="circle"?t:e}function epn(e,t,n,r){if(vL(t,n)){const i=vo(e)?e.axis(n)??e.legend(n)??{}:{},o=It(t,{expr:"datum"}),s=It(t,{expr:"datum",binSuffix:"end"});return{formulaAs:It(t,{binSuffix:"range",forAs:!0}),formula:hL(o,s,i.format,i.formatType,r)}}return{}}function VQe(e,t){return`${aXe(e)}_${t}`}function tpn(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function ape(e,t,n){const r=o8(n,void 0)??{},i=VQe(r,t);return e.getName(`${i}_bins`)}function npn(e){return"as"in e}function JEe(e,t,n){let r,i;npn(e)?r=Ut(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:r=[It(e,{forAs:!0}),It(e,{binSuffix:"end",forAs:!0})];const o={...o8(t,void 0)},s=VQe(o,e.field),{signal:a,extentSignal:l}=tpn(n,s);if(XV(o.extent)){const u=o.extent;i=OQe(n,u.param,u),delete o.extent}const c={bin:o,field:e.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:c}}class Xp extends Ti{bins;clone(){return new Xp(null,Un(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{if(Yl(o)&&eo(o.bin)){const{key:a,binComponent:l}=JEe(o,o.bin,n);i[a]={...l,...i[a],...epn(n,o,s,n.config)}}return i},{});return Vi(r)?null:new Xp(t,r)}static makeFromTransform(t,n,r){const{key:i,binComponent:o}=JEe(n,n.bin,r);return new Xp(t,{[i]:o})}merge(t,n){for(const r of wt(t.bins))r in this.bins?(n(t.bins[r].signal,this.bins[r].signal),this.bins[r].as=_u([...this.bins[r].as,...t.bins[r].as],ar)):this.bins[r]=t.bins[r];for(const r of t.children)t.removeChild(r),r.parent=this;t.remove()}producedFields(){return new Set(ys(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(ys(this.bins).map(t=>t.field))}hash(){return`Bin ${ar(this.bins)}`}assemble(){return ys(this.bins).flatMap(t=>{const n=[],[r,...i]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:ed(t.field),as:r,signal:t.signal,...XV(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:ed(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const l of i)for(let c=0;c<2;c++)n.push({type:"formula",expr:It({field:r[c]},{expr:"datum"}),as:l[c]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function rpn(e,t,n,r){const i=vo(r)?r.encoding[Eg(t)]:void 0;if(Yl(n)&&vo(r)&&tYe(n,i,r.markDef,r.config)){e.add(It(n,{})),e.add(It(n,{suffix:"end"}));const{mark:o,markDef:s,config:a}=r,l=rb({fieldDef:n,markDef:s,config:a});yR(o)&&l!==.5&&os(t)&&(e.add(It(n,{suffix:d8})),e.add(It(n,{suffix:h8}))),n.bin&&vL(n,t)&&e.add(It(n,{binSuffix:"range"}))}else if(Zqe(t)){const o=Kqe(t);e.add(r.getName(o))}else e.add(It(n));return CS(n)&&eun(n.scale?.range)&&e.add(n.scale.range.field),e}function ipn(e,t){for(const n of wt(t)){const r=t[n];for(const i of wt(r))n in e?e[n][i]=new Set([...e[n][i]??[],...r[i]]):e[n]={[i]:r[i]}}}class ch extends Ti{dimensions;measures;clone(){return new ch(null,new Set(this.dimensions),Un(this.measures))}constructor(t,n,r){super(t),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:c}=s;if(l)if(l==="count")i["*"]??={},i["*"].count=new Set([It(s,{forAs:!0})]);else{if(dv(l)||Nb(l)){const u=dv(l)?"argmin":"argmax",f=l[u];i[f]??={},i[f][u]=new Set([It({op:u,field:f},{forAs:!0})])}else i[c]??={},i[c][l]=new Set([It(s,{forAs:!0})]);Tg(a)&&n.scaleDomain(a)==="unaggregated"&&(i[c]??={},i[c].min=new Set([It({field:c,aggregate:"min"},{forAs:!0})]),i[c].max=new Set([It({field:c,aggregate:"max"},{forAs:!0})]))}else rpn(o,a,s,n)}),o.size+wt(i).length===0)?null:new ch(t,o,i)}static makeFromTransform(t,n){const r=new Set,i={};for(const o of n.aggregate){const{op:s,field:a,as:l}=o;s&&(s==="count"?(i["*"]??={},i["*"].count=new Set([l||It(o,{forAs:!0})])):(i[a]??={},i[a][s]??=new Set,i[a][s].add(l||It(o,{forAs:!0}))))}for(const o of n.groupby??[])r.add(o);return r.size+wt(i).length===0?null:new ch(t,r,i)}merge(t){return Uqe(this.dimensions,t.dimensions)?(ipn(this.measures,t.measures),!0):(Ocn("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...wt(this.measures)])}producedFields(){const t=new Set;for(const n of wt(this.measures))for(const r of wt(this.measures[n])){const i=this.measures[n][r];i.size===0?t.add(`${r}_${n}`):i.forEach(t.add,t)}return t}hash(){return`Aggregate ${ar({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],r=[];for(const o of wt(this.measures))for(const s of wt(this.measures[o]))for(const a of this.measures[o][s])r.push(a),t.push(s),n.push(o==="*"?null:ed(o));return{type:"aggregate",groupby:[...this.dimensions].map(ed),ops:t,fields:n,as:r}}}class oP extends Ti{model;name;data;column;row;facet;childModel;constructor(t,n,r,i){super(t),this.model=n,this.name=r,this.data=i;for(const o of Pf){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[It(s),...eo(a)?[It(s,{binSuffix:"end"})]:[]],...qm(l)?{sortField:l}:it(l)?{sortIndexField:TE(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Pf)this[n]&&(t+=` ${n.charAt(0)}:${ar(this[n])}`);return t}get fields(){const t=[];for(const n of Pf)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of Pf)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of Dv){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if(Wo(i)&&wS(o)){const s=Pw(this.childModel,n),a=fpe(s);a?t[n]=a:Ct(che(n))}}}return t}assembleRowColumnHeaderData(t,n,r){const i={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:c}=this[t];if(l){const{op:u=n8,field:f}=l;o.push(f),s.push(u),a.push(It(l,{forAs:!0}))}else c&&(o.push(c),s.push("max"),a.push(c));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const l of rpe){for(const c of ipe){const u=r[l]?.[c]??[];for(const f of u)if(f.axes?.length>0){o[l]=!0;break}}if(o[l]){const c=`length(data("${this.facet.name}"))`,u=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};i.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:u}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){const t=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[Gm,Hm])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&t.push(...a)}return t}}function eTe(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function opn(e,t){const n=Zde(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const r=eTe(t.slice(5,t.length));return`timeParse(${n},'${r}')`}else if(t.startsWith("utc:")){const r=eTe(t.slice(4,t.length));return`utcParse(${n},'${r}')`}else return Ct(Iln(t)),null}function spn(e){const t={};return Bz(e.filter,n=>{if(IXe(n)){let r=null;ghe(n)?r=xu(n.equal):vhe(n)?r=xu(n.lte):mhe(n)?r=xu(n.lt):yhe(n)?r=xu(n.gt):bhe(n)?r=xu(n.gte):xhe(n)?r=n.range[0]:whe(n)&&(r=(n.oneOf??n.in)[0]),r&&(SS(r)?t[n.field]="date":Qr(r)?t[n.field]="number":Ut(r)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function apn(e){const t={};function n(r){_E(r)?t[r.field]="date":r.type==="quantitative"&&aln(r.aggregate)?t[r.field]="number":mE(r.field)>1?r.field in t||(t[r.field]="flatten"):CS(r)&&qm(r.sort)&&mE(r.sort.field)>1&&(r.sort.field in t||(t[r.sort.field]="flatten"))}if((vo(e)||Du(e))&&e.forEachFieldDef((r,i)=>{if(Yl(r))n(r);else{const o=bS(i),s=e.fieldDef(o);n({...r,type:s.type})}}),vo(e)){const{mark:r,markDef:i,encoding:o}=e;if(zb(r)&&!e.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];Et(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function lpn(e){const t={};if(vo(e)&&e.component.selection)for(const n of wt(e.component.selection)){const r=e.component.selection[n];for(const i of r.project.items)!i.channel&&mE(i.field)>1&&(t[i.field]="flatten")}return t}class ul extends Ti{_parse;clone(){return new ul(null,Un(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${ar(this._parse)}`}static makeExplicit(t,n,r){let i={};const o=n.data;return!I0(o)&&o?.format?.parse&&(i=o.format.parse),this.makeWithAncestors(t,i,{},r)}static makeWithAncestors(t,n,r,i){for(const a of wt(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:Ct(uEe(a,r[a],l.value)))}for(const a of wt(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:Ct(uEe(a,n[a],l)))}const o=new Fv(n,r);i.copyAll(o);const s={};for(const a of wt(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return wt(s).length===0||i.parseNothing?null:new ul(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of wt(this._parse)){const r=this._parse[n];mE(n)===1&&(t[n]=r)}return t}producedFields(){return new Set(wt(this._parse))}dependentFields(){return new Set(wt(this._parse))}assembleTransforms(t=!1){return wt(this._parse).filter(n=>t?mE(n)>1:!0).map(n=>{const r=opn(n,this._parse[n]);return r?{type:"formula",expr:r,as:eP(n)}:null}).filter(n=>n!==null)}}class ob extends Ti{clone(){return new ob(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Sh])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Sh}}}class xL extends Ti{params;clone(){return new xL(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${ar(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class wL extends Ti{params;clone(){return new wL(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${ar(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Tw extends Ti{_data;_name;_generator;constructor(t){super(null),t??={name:"source"};let n;if(I0(t)||(n=t.format?{...Iu(t.format,["parse"])}:{}),bR(t))this._data={values:t.values};else if(CE(t)){if(this._data={url:t.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(t.url)[1];yr(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else QYe(t)?this._data={values:[{type:"Sphere"}]}:(XYe(t)||I0(t))&&(this._data={});this._generator=I0(t),t.name&&(this._name=t.name),n&&!Vi(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}function lpe(e){return e instanceof Tw||e instanceof xL||e instanceof wL}class cpe{#e;constructor(){this.#e=!1}setModified(){this.#e=!0}get modifiedFlag(){return this.#e}}class OS extends cpe{getNodeDepths(t,n,r){r.set(t,n);for(const i of t.children)this.getNodeDepths(i,n+1,r);return r}optimize(t){const r=[...this.getNodeDepths(t,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class upe extends cpe{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class cpn extends upe{mergeNodes(t,n){const r=n.shift();for(const i of n)t.removeChild(i),i.parent=r,i.remove()}run(t){const n=t.children.map(i=>i.hash()),r={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(t,r[i]))}}class upn extends upe{requiresSelectionId;constructor(t){super(),this.requiresSelectionId=t&&npe(t)}run(t){t instanceof ob&&(this.requiresSelectionId&&(lpe(t.parent)||t.parent instanceof ch||t.parent instanceof ul)||(this.setModified(),t.remove()))}}class fpn extends cpe{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let r=new Set;t instanceof Gp&&(r=t.producedFields(),Qde(r,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const i of t.children)this.run(i,new Set([...n,...r]))}}class dpn extends upe{constructor(){super()}run(t){t instanceof Mc&&!t.isRequired()&&(this.setModified(),t.remove())}}class hpn extends OS{run(t){if(!lpe(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof ul)if(t instanceof ul)this.setModified(),t.merge(n);else{if(Kde(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class ppn extends OS{run(t){const n=[...t.children],r=t.children.filter(i=>i instanceof ul);if(t.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of wt(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Vi(i)){this.setModified();const s=new ul(t,i);for(const a of n){if(a instanceof ul)for(const l of wt(i))delete a.parse[l];t.removeChild(a),a.parent=s,a instanceof ul&&wt(a.parse).length===0&&a.remove()}}}}}class gpn extends OS{run(t){t instanceof Mc||t.numChildren()>0||t instanceof oP||t instanceof Tw||(this.setModified(),t.remove())}}class mpn extends OS{run(t){const n=t.children.filter(i=>i instanceof Gp),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class vpn extends OS{run(t){const n=t.children.filter(i=>i instanceof ch),r={};for(const i of n){const o=ar(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of wt(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class ypn extends OS{model;constructor(t){super(),this.model=t}run(t){const n=!(lpe(t)||t instanceof iP||t instanceof ul||t instanceof ob),r=[],i=[];for(const o of t.children)o instanceof Xp&&(n&&!Kde(t.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Xp?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class bpn extends OS{run(t){const n=[...t.children];if(!pE(n,s=>s instanceof Mc)||t.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof Mc){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof Mc)a=l;else break}i.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class ES extends Ti{transform;clone(){return new ES(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=_u(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??It(t)}hash(){return`JoinAggregateTransform ${ar(this.transform)}`}assemble(){const t=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:t,...i!==void 0?{groupby:i}:{}}}}class kE extends Ti{filter;clone(){return new kE(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,r){const{config:i,markDef:o}=n,{marks:s,scales:a}=r;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const l=n.reduceFieldDef((c,u,f)=>{const d=Tg(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=u,g=khe({scaleChannel:f,markDef:o,config:i,scaleType:h,isCountAggregate:qV(p)});g!=="show"&&g!=="always-valid"&&(c[u.field]=u)}return c},{});return wt(l).length?new kE(t,l):null}dependentFields(){return new Set(wt(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${ar(this.filter)}`}assemble(){const t=wt(this.filter).reduce((n,r)=>{const i=this.filter[r],o=It(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (${pre(o)}))`):i.type==="quantitative"&&n.push(pre(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function pre(e){return`isValid(${e}) && isFinite(+${e})`}function xpn(e){return e.stack.stackBy.reduce((t,n)=>{const r=n.fieldDef,i=It(r);return i&&t.push(i),t},[])}function wpn(e){return it(e)&&e.every(t=>Ut(t))&&e.length>1}class Ym extends Ti{_stack;clone(){return new Ym(null,Un(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(is(f.order,"ascending"));const c={field:a,order:l};let u;return wpn(o)?u=o:Ut(o)?u=[o,`${o}_end`]:u=[`${n.stack}_start`,`${n.stack}_end`],new Ym(t,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:c,facetby:[],as:u})}static makeFromEncoding(t,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,c=o.map(h=>{const p=i[h];return wh(p)}).filter(h=>!!h),u=xpn(n),f=n.encoding.order;let d;if(it(f)||Et(f))d=hXe(f);else{const h=nYe(f)?f.sort:s==="y"?"descending":"ascending";d=u.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new Ym(t,{dimensionFieldDefs:c,stackField:n.vgField(s),facetby:[],stackby:u,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${ar(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:r}=this._stack;return t.length>0?t.map(i=>i.bin?n?[It(i,{binSuffix:"mid"})]:[It(i,{}),It(i,{binSuffix:"end"})]:[It(i)]).flat():r??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:c}=this._stack;if(l)for(const u of r){const{bandPosition:f=.5,bin:d}=u;if(d){const h=It(u,{expr:"datum"}),p=It(u,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${pre(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:It(u,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...o,...n],key:It(u,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:c,offset:a}),t}}class sP extends Ti{transform;clone(){return new sP(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=_u(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??It(t)}hash(){return`WindowTransform ${ar(this.transform)}`}assemble(){const t=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>ahe(f)))return{type:"joinaggregate",as:r,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const c={field:a,order:l},u=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:t,sort:c,...u!==void 0?{ignorePeers:u}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function Spn(e){function t(n){if(!(n instanceof oP)){const r=n.clone();if(r instanceof Mc){const i=mre+r.getSource();r.setSource(i),e.model.component.data.outputNodes[i]=r}else(r instanceof ch||r instanceof Ym||r instanceof sP||r instanceof ES)&&r.addDimensions(e.fields);for(const i of n.children.flatMap(t))i.parent=r;return[r]}return n.children.flatMap(t)}return t}function gre(e){if(e instanceof oP)if(e.numChildren()===1&&!(e.children[0]instanceof Mc)){const t=e.children[0];(t instanceof ch||t instanceof Ym||t instanceof sP||t instanceof ES)&&t.addDimensions(e.fields),t.swapWithParent(),gre(e)}else{const t=e.model.component.data.main;WQe(t);const n=Spn(e),r=e.children.map(n).flat();for(const i of r)i.parent=t}else e.children.map(gre)}function WQe(e){if(e instanceof Mc&&e.type===Ao.Main&&e.numChildren()===1){const t=e.children[0];t instanceof oP||(t.swapWithParent(),WQe(e))}}const mre="scale_",yN=5;function vre(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!vre(t.children))return!1}return!0}function Cd(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function tTe(e,t,n){let r=e.sources,i=!1;return i=Cd(new dpn,r)||i,i=Cd(new upn(t),r)||i,r=r.filter(o=>o.numChildren()>0),i=Cd(new gpn,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Cd(new hpn,r)||i,i=Cd(new ypn(t),r)||i,i=Cd(new fpn,r)||i,i=Cd(new ppn,r)||i,i=Cd(new vpn,r)||i,i=Cd(new mpn,r)||i,i=Cd(new cpn,r)||i,i=Cd(new bpn,r)||i),e.sources=r,i}function _pn(e,t){vre(e.sources);let n=0,r=0;for(let i=0;it(n))}}function HQe(e){vo(e)?Cpn(e):Opn(e)}function Cpn(e){const t=e.component.scales;for(const n of wt(t)){const r=Tpn(e,n);if(t[n].setWithExplicit("domains",r),kpn(e,n),e.component.data.isFaceted){let o=e;for(;!Du(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)Lm(a)&&(a.data=mre+a.data.replace(mre,""))}}}function Opn(e){for(const n of e.children)HQe(n);const t=e.component.scales;for(const n of wt(t)){let r,i=null;for(const o of e.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=ib(r,s.getWithExplicit("domains"),"domains","scale",yre);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&Ct(Eln),i=a}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}function Epn(e,t,n,r){if(e==="unaggregated"){const{valid:i,reason:o}=nTe(t,n);if(!i){Ct(o);return}}else if(e===void 0&&r.useUnaggregatedDomain){const{valid:i}=nTe(t,n);if(i)return"unaggregated"}return e}function Tpn(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=Epn(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:i}),t==="x"&&Ls(r.x2)?Ls(r.x)?ib(Iy(n,i,e,"x"),Iy(n,i,e,"x2"),"domain","scale",yre):Iy(n,i,e,"x2"):t==="y"&&Ls(r.y2)?Ls(r.y)?ib(Iy(n,i,e,"y"),Iy(n,i,e,"y2"),"domain","scale",yre):Iy(n,i,e,"y2"):Iy(n,i,e,t)}function Ppn(e,t,n){return e.map(r=>({signal:`{data: ${s8(r,{timeUnit:n,type:t})}}`}))}function oq(e,t,n){const r=aa(n)?.unit;return t==="temporal"||r?Ppn(e,t,r):[e]}function Iy(e,t,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,c=Ls(i[r]),{type:u}=c,f=c.timeUnit,d=Mdn({invalid:sg("invalid",o,a),isPath:zb(s)});if(Jcn(t)){const g=Iy(e,void 0,n,r),m=oq(t.unionWith,u,f);return rp([...m,...g.value])}else{if(hn(t))return rp([t]);if(t&&t!=="unaggregated"&&!zXe(t))return rp(oq(t,u,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return cu([[0,1]]);const g=n.requestDataName(d);return cu([{data:g,field:n.vgField(r,{suffix:"start"})},{data:g,field:n.vgField(r,{suffix:"end"})}])}const h=Tg(r)&&Et(c)?Mpn(n,r,e):void 0;if(Pg(c)){const g=oq([c.datum],u,f);return cu(g)}const p=c;if(t==="unaggregated"){const{field:g}=c;return cu([{data:n.requestDataName(d),field:It({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:It({field:g,aggregate:"max"})}])}else if(eo(p.bin)){if(Wo(e))return cu(e==="bin-ordinal"?[]:[{data:gE(h)?n.requestDataName(d):n.requestDataName(Ao.Raw),field:n.vgField(r,vL(p,r)?{binSuffix:"range"}:{}),sort:h===!0||!Bt(h)?{field:n.vgField(r,{}),op:"min"}:h}]);{const{bin:g}=p;if(eo(g)){const m=ape(n,p.field,g);return cu([new Ys(()=>{const v=n.getSignalName(m);return`[${v}.start, ${v}.stop]`})])}else return cu([{data:n.requestDataName(d),field:n.vgField(r,{})}])}}else if(p.timeUnit&&yr(["time","utc"],e)){const g=i[Eg(r)];if(tYe(p,g,o,a)){const m=n.requestDataName(d),v=rb({fieldDef:p,fieldDef2:g,markDef:o,config:a}),y=yR(s)&&v!==.5&&os(r);return cu([{data:m,field:n.vgField(r,y?{suffix:d8}:{})},{data:m,field:n.vgField(r,{suffix:y?h8:"end"})}])}}return cu(h?[{data:gE(h)?n.requestDataName(d):n.requestDataName(Ao.Raw),field:n.vgField(r),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(r)}])}function sq(e,t){const{op:n,field:r,order:i}=e;return{op:n??(t?"sum":n8),...r?{field:ed(r)}:{},...i?{order:i}:{}}}function kpn(e,t){const n=e.component.scales[t],r=e.specifiedScales[t].domain,i=e.fieldDef(t)?.bin,o=zXe(r)?r:void 0,s=xS(i)&&XV(i.extent)?i.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function Mpn(e,t,n){if(!Wo(n))return;const r=e.fieldDef(t),i=r.sort;if(JXe(i))return{op:"min",field:TE(r,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(qm(i)){const a=o&&!s.has(i.field);return sq(i,a)}else if(Mun(i)){const{encoding:a,order:l}=i,c=e.fieldDef(a),{aggregate:u,field:f}=c,d=o&&!s.has(f);if(dv(u)||Nb(u))return sq({field:It(c),order:l},d);if(ahe(u)||!u)return sq({op:u,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(yr(["ascending",void 0],i))return!0}}function nTe(e,t){const{aggregate:n,type:r}=e;return n?Ut(n)&&!cln.has(n)?{valid:!1,reason:tcn(n)}:r==="quantitative"&&t==="log"?{valid:!1,reason:ncn(e)}:{valid:!0}:{valid:!1,reason:ecn(e)}}function yre(e,t,n,r){return e.explicit&&t.explicit&&Ct(acn(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Apn(e){const t=_u(e.map(s=>{if(Lm(s)){const{sort:a,...l}=s;return l}return s}),ar),n=_u(e.map(s=>{if(Lm(s)){const a=s.sort;return a!==void 0&&!gE(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),ar);if(t.length===0)return;if(t.length===1){const s=e[0];if(Lm(s)&&n.length>0){let a=n[0];if(n.length>1){Ct(dEe);const l=n.filter(c=>Bt(c)&&"op"in c&&c.op!=="min");n.every(c=>Bt(c)&&"op"in c)&&l.length===1?a=l[0]:a=!0}else if(Bt(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=_u(n.map(s=>gE(s)||!("op"in s)||Ut(s.op)&&Qt(oln,s.op)?s:(Ct(ccn(s)),!0)),ar);let i;r.length===1?i=r[0]:r.length>1&&(Ct(dEe),i=!0);const o=_u(e.map(s=>Lm(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...i?{sort:i}:{}}:{fields:t,...i?{sort:i}:{}}}function fpe(e){if(Lm(e)&&Ut(e.field))return e.field;if(cXe(e)){let t;for(const n of e.fields)if(Lm(n)&&Ut(n.field)){if(!t)t=n.field;else if(t!==n.field)return Ct(ucn),t}return Ct(fcn),t}else if(uln(e)){Ct(dcn);const t=e.fields[0];return Ut(t)?t:void 0}}function Pw(e,t){const r=e.component.scales[t].get("domains").map(i=>(Lm(i)&&(i.data=e.lookupDataSource(i.data)),i));return Apn(r)}function Rpn(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function GQe(e,t){if(vo(e)){const r=e.fieldDef(t);if(r?.field)return r.field}const n=(e.children??[]).map(r=>GQe(r,t)).filter(r=>!!r);if(n.length>0){const r=_u(n,ar);return r.length===1?r[0]:void 0}}function Ipn(e,t,n){if(t===n)return!0;const r=e.getScaleType(t),i=e.getScaleType(n);if(!r||!i)return!1;const o=Wo(r),s=Wo(i);return o===s}function Dpn(e,t){return e?`field:${e}`:`channel:${String(t)}`}function Lpn(e){if(it(e)){const t=e.filter(_B);return t.length>0?t:null}if(cXe(e)){const t=[];if(t.push(...e.fields.flatMap(n=>it(n)?n.filter(_B):[])),t.length>0)return _u(t,ar)}return null}function bre(e,t){try{const n=Pw(e,t);return Lpn(n)}catch{return null}}function Fpn(e,t,n){const r=bre(e,t),i=bre(e,n);return r&&i?_u([...r,...i],ar):null}function rTe(e,t,n){t&&t.length>0&&(e.getWithExplicit("values")?.explicit||(n&&Ct(n),e.set("values",t,!1)))}function $pn(e,t,n){const r=e.getScaleComponent(t),i=e.getScaleComponent(n);if(!r||!i)return!1;const o=r.getWithExplicit("domains"),s=i.getWithExplicit("domains");if(!(o?.explicit&&s?.explicit))return!1;const a=Pw(e,t),l=Pw(e,n);return ar(a)===ar(l)}function qQe(e){const t=e.component.legends,n={};for(const i of wt(t)){const o=GQe(e,i),s=Dpn(o,i);if(!n[s]){n[s]=[{channel:i,cmpt:t[i].clone()}];continue}let a=!1;for(const l of n[s]){if(!Ipn(e,l.channel,i))continue;if(UQe(l.cmpt,t[i])){const u=e.getScaleType(l.channel),f=e.getScaleType(i);u&&f&&Wo(u)&&Wo(f)&&($pn(e,l.channel,i)?rTe(l.cmpt,bre(e,l.channel)):rTe(l.cmpt,Fpn(e,l.channel,i),hcn(l.channel,i))),a=!0;break}}a||n[s].push({channel:i,cmpt:t[i].clone()})}return ys(n).flat().map(i=>Npn(i.cmpt,e.config)).filter(i=>i!==void 0)}function Npn(e,t){const{disable:n,labelExpr:r,selections:i,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),o.encode?.symbols){const s=o.encode.symbols.update;s.fill&&s.fill.value!=="transparent"&&!s.stroke&&!o.stroke&&(s.stroke={value:"transparent"});for(const a of AYe)o[a]&&delete s[a]}if(o.title||delete o.title,r!==void 0){let s=r;o.encode?.labels?.update&&hn(o.encode.labels.update.text)&&(s=yw(r,"datum.label",o.encode.labels.update.text.signal)),Rpn(o,"labels","text",{signal:s})}return o}}function zpn(e){return aP(e)||dpe(e)?jpn(e):XQe(e)}function jpn(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),XQe(e))}function XQe(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const l=hn(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return yr(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const Bpn=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class YQe extends Fv{specifiedProjection;size;data;merged=!1;constructor(t,n,r,i){super({...n},{name:t}),this.specifiedProjection=n,this.size=r,this.data=i}get isFit(){return!!this.data}}function QQe(e){e.component.projection=vo(e)?Upn(e):Hpn(e)}function Upn(e){if(e.hasProjection){const t=Sa(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),r=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,i=n?Vpn(e):void 0,o=new YQe(e.projectionName(!0),{...Sa(e.config.projection),...t},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function Vpn(e){const t=[],{encoding:n}=e;for(const r of[[Ih,Rh],[td,Dh]])(Ls(n[r[0]])||Ls(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Bc)&&e.typedFieldDef(Bc).type===nP&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ao.Main)),t}function Wpn(e,t){const n=Yde(Bpn,i=>!!(!Qt(e.explicit,i)&&!Qt(t.explicit,i)||Qt(e.explicit,i)&&Qt(t.explicit,i)&&Cu(e.get(i),t.get(i))));if(Cu(e.size,t.size)){if(n)return e;if(Cu(e.explicit,{}))return t;if(Cu(t.explicit,{}))return e}return null}function Hpn(e){if(e.children.length===0)return;let t;for(const r of e.children)QQe(r);const n=Yde(e.children,r=>{const i=r.component.projection;if(i)if(t){const o=Wpn(t,i);return o&&(t=o),!!o}else return t=i,!0;else return!0});if(t&&n){const r=e.projectionName(!0),i=new YQe(r,t.specifiedProjection,t.size,Un(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function KQe(e){return aP(e)||dpe(e)?e.children.reduce((t,n)=>t.concat(KQe(n)),iTe(e)):iTe(e)}function iTe(e){return wt(e.component.scales).reduce((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:c,reverse:u,...f}=i,d=Gpn(i.range,o,n,e),h=Pw(e,n),p=a?Bdn(e,a,r,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...u!==void 0?{reverse:u}:{},...f}),t},[])}function Gpn(e,t,n,r){if(os(n)){if(wS(e))return{step:{signal:`${t}_step`}}}else if(Bt(e)&&Lm(e))return{...e,data:r.lookupDataSource(e.data)};return e}class ZQe extends Fv{merged=!1;constructor(t,n){super({},{name:t}),this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(yr([Ca.LOG,Ca.TIME,Ca.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&yr([Ca.LINEAR,Ca.SQRT,Ca.POW],t))return"definitely";const r=this.get("domains");if(r.length>0){let i=!1,o=!1,s=!1;for(const a of r){if(it(a)){const l=a[0],c=a[a.length-1];if(Qr(l)&&Qr(c))if(l<=0&&c>=0){i=!0;continue}else{o=!0;continue}}s=!0}if(i)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const qpn=["range","scheme"];function Xpn(e){const t=e.component.scales;for(const n of she){const r=t[n];if(!r)continue;const i=Ypn(n,e);r.setWithExplicit("range",i)}}function oTe(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:r,field:i}=n,o=Uc(t),s=e.getName(o);if(Bt(r)&&r.binned&&r.step!==void 0)return new Ys(()=>{const a=e.scaleName(t),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${e.getSignalName(s)} / (${l})`});if(eo(r)){const a=ape(e,i,r);return new Ys(()=>{const l=e.getSignalName(a),c=`(${l}.stop - ${l}.start) / ${l}.step`;return`${e.getSignalName(s)} / (${c})`})}}}function Ypn(e,t){const n=t.specifiedScales[e],{size:r}=t,o=t.getScaleComponent(e).get("type");for(const f of qpn)if(n[f]!==void 0){const d=Zne(o,f),h=jXe(e,f);if(!d)Ct(xXe(o,f,e));else if(h)Ct(h);else switch(f){case"range":{const p=n.range;if(it(p)){if(os(e))return rp(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),v=t.getSignalName.bind(t);return Ys.fromName(v,m)}return g}))}else if(Bt(p))return rp({data:t.requestDataName(Ao.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return rp(p)}case"scheme":return rp(Qpn(n[f]))}}const s=e===_o||e==="xOffset"?"width":"height",a=r[s];if(lg(a)){if(os(e))if(Wo(o)){const f=eKe(a,t,e);if(f)return rp({step:f})}else Ct(wXe(s));else if(uL(e)){const f=e===Rb?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=tKe(a,o);if(p)return rp(p)}}}const{rangeMin:l,rangeMax:c}=n,u=Kpn(e,t);return(l!==void 0||c!==void 0)&&Zne(o,"rangeMin")&&it(u)&&u.length===2?rp([l??u[0],c??u[1]]):cu(u)}function Qpn(e){return Zcn(e)?{scheme:e.name,...Iu(e,["name"])}:{scheme:e}}function JQe(e,t,n,{center:r}={}){const i=Uc(e),o=t.getName(i),s=t.getSignalName.bind(t);return e===ha&&bh(n)?r?[Ys.fromName(a=>`${s(a)}/2`,o),Ys.fromName(a=>`-${s(a)}/2`,o)]:[Ys.fromName(s,o),0]:r?[Ys.fromName(a=>`-${s(a)}/2`,o),Ys.fromName(a=>`${s(a)}/2`,o)]:[0,Ys.fromName(s,o)]}function Kpn(e,t){const{size:n,config:r,mark:i,encoding:o}=t,{type:s}=Ls(o[e]),l=t.getScaleComponent(e).get("type"),{domain:c,domainMid:u}=t.specifiedScales[e];switch(e){case _o:case ha:{if(yr(["point","band"],l)){const f=nKe(e,n,r.view);if(lg(f))return{step:eKe(f,t,e)}}return JQe(e,t,l)}case Rb:case tP:return Zpn(e,t,l);case Rv:{const f=tgn(i,r),d=ngn(i,n,t,r);return bE(l)?egn(f,d,Jpn(l,r,c,e)):[f,d]}case fd:return[0,Math.PI*2];case yS:return[0,360];case Ah:return[0,new Ys(()=>{const f=t.getSignalName(Du(t.parent)?"child_width":"width"),d=t.getSignalName(Du(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Ib:return{step:1e3/r.scale.framesPerSecond};case Fb:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case $b:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Bc:return"symbol";case jc:case Cg:case Og:return l==="ordinal"?s==="nominal"?"category":"ordinal":u!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case Iv:case Db:case Lb:return[r.scale.minOpacity,r.scale.maxOpacity]}}function eKe(e,t,n){const{encoding:r}=t,i=t.getScaleComponent(n),o=nhe(n),s=r[o];if(IYe({step:e,offsetIsDiscrete:Hn(s)&&She(s.type)})==="offset"&&hYe(r,o)){const l=t.getScaleComponent(o);let u=`domain('${t.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;u=`bandspace(${u}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${e.step} * ${u} / (1-${gln(f)})`}}else return e.step}function tKe(e,t){if(IYe({step:e,offsetIsDiscrete:Wo(t)})==="offset")return{step:e.step}}function Zpn(e,t,n){const r=e===Rb?"x":"y",i=t.getScaleComponent(r);if(!i)return JQe(r,t,n,{center:!0});const o=i.get("type"),s=t.scaleName(r),{markDef:a,config:l}=t;if(o==="band"){const c=nKe(r,t.size,t.config.view);if(lg(c)){const u=tKe(c,n);if(u)return u}return[0,{signal:`bandwidth('${s}')`}]}else{const c=t.encoding[r];if(Et(c)&&c.timeUnit){const u=AXe(c.timeUnit,p=>`scale('${s}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=rb({fieldDef:c,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=hn(f)?`${f.signal}/2${h}`:`${f/2+d}`,g=hn(f)?`(1 - ${f.signal}/2)${h}`:`${1-f/2+d}`;return[{signal:`${p} * (${u})`},{signal:`${g} * (${u})`}]}return[0,{signal:u}]}return jqe(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}function nKe(e,t,n){const r=e===_o?"width":"height",i=t[r];return i!==void 0?i:RB(n,r)}function Jpn(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&it(n)?n.length+1:(Ct(Scn(r)),3)}}function egn(e,t,n){const r=()=>{const i=eh(t),o=eh(e),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return hn(t)?new Ys(r):{signal:r()}}function tgn(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(YV("size",e))}const sTe=.95;function ngn(e,t,n,r){const i={x:oTe(n,"x"),y:oTe(n,"y")};switch(e){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=aTe(t,i,r.view);return Qr(o)?o-1:new Ys(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=aTe(t,i,r.view);return Qr(o)?Math.pow(sTe*o,2):new Ys(()=>`pow(${sTe} * ${o.signal}, 2)`)}}throw new Error(YV("size",e))}function aTe(e,t,n){const r=lg(e.width)?e.width.step:nre(n,"width"),i=lg(e.height)?e.height.step:nre(n,"height");return t.x||t.y?new Ys(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function rKe(e,t){vo(e)?rgn(e,t):oKe(e,t)}function rgn(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=e;for(const a of wt(n)){const l=s[a],c=n[a],u=e.getScaleComponent(a),f=Ls(i[a]),d=l[t],h=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),m=Zne(h,t),v=jXe(a,t);if(d!==void 0&&(m?v&&Ct(v):Ct(xXe(h,t,a))),m&&v===void 0)if(d!==void 0){const y=f.timeUnit,b=f.type;switch(t){case"domainMax":case"domainMin":SS(l[t])||b==="temporal"||y?c.set(t,{signal:s8(l[t],{type:b,timeUnit:y})},!0):c.set(t,l[t],!0);break;default:c.copyKeyFromObject(t,l)}}else{const y=_t(lTe,t)?lTe[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:pYe(i,a),hasSecondaryRangeChannel:!!i[Eg(a)]}):r.scale[t];y!==void 0&&c.set(t,y,!1)}}}const lTe={bins:({model:e,fieldOrDatumDef:t})=>Et(t)?ign(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>ogn(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>sgn(e,t,n,r,i,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>agn(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>lgn(e,t,n.type,r,i.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>cgn(e,t,n,r,i.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>{const i=Et(e)?e.sort:void 0;return ugn(t,i,n,r.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>fgn(e,t,n,r,i,o.scale,s)};function iKe(e){vo(e)?Xpn(e):oKe(e,"range")}function oKe(e,t){const n=e.component.scales;for(const r of e.children)t==="range"?iKe(r):rKe(r,t);for(const r of wt(n)){let i;for(const o of e.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(t);i=ib(i,a,t,"scale",qYe((l,c)=>t==="range"&&l.step&&c.step?l.step-c.step:0))}}n[r].setWithExplicit(t,i)}}function ign(e,t){const n=t.bin;if(eo(n)){const r=ape(e,t.field,n);return new Ys(()=>e.getSignalName(r))}else if(xa(n)&&xS(n)&&n.step!==void 0)return{step:n.step}}function ogn(e,t){if(yr([jc,Cg,Og],e)&&t!=="nominal")return"hcl"}function sgn(e,t,n,r,i,o){if(!(wh(o)?.bin||it(n)||i!=null||r!=null||yr([Ca.TIME,Ca.UTC],e)))return os(t)?!0:void 0}function agn(e,t,n,r,i,o){if(os(e)){if(Op(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(Et(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===Ca.POINT)return n.pointPadding}}function lgn(e,t,n,r,i,o=!1){if(e===void 0){if(os(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,tickBandPaddingInner:c,bandWithNestedOffsetPaddingInner:u}=i;return o?u:is(s,n==="bar"?a:n==="tick"?c:l)}else if(uL(t)&&r===Ca.BAND)return i.offsetBandPaddingInner}}function cgn(e,t,n,r,i,o=!1){if(e===void 0){if(os(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===Ca.BAND)return is(s,hn(r)?{signal:`${r.signal}/2`}:r/2)}else if(uL(t)){if(n===Ca.POINT)return .5;if(n===Ca.BAND)return i.offsetBandPaddingOuter}}}function ugn(e,t,n,r){if(n==="x"&&r.xReverse!==void 0)return bh(e)&&t==="descending"?hn(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(bh(e)&&t==="descending")return!0}function fgn(e,t,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&bh(i)){if(it(n)){const l=n[0],c=n[n.length-1];if(Qr(l)&&l<=0&&Qr(c)&&c>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!bE(i))return!0;if(!(Et(t)&&t.bin)&&yr([...Dv,...Qan],e)){const{orient:l,type:c}=r;return yr(["bar","area","line","trail"],c)&&(l==="horizontal"&&e==="y"||l==="vertical"&&e==="x")?!1:yr(["bar","area"],c)&&!s?!0:o?.zero}return!1}function dgn(e,t,n,r,i=!1){const o=hgn(t,n,r,i),{type:s}=e;return Tg(t)?s!==void 0?oun(t,s)?Et(n)&&!iun(s,n.type)?(Ct(ocn(s,o)),o):s:(Ct(icn(t,s,o)),o):o:null}function hgn(e,t,n,r){switch(t.type){case"nominal":case"ordinal":{if(fO(e)||X7(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&Ct(Y7(e,"ordinal")),"ordinal";if(q7(e))return"band";if(os(e)||uL(e)){if(yr(["rect","bar","image","rule","tick"],n.type)||r)return"band"}else if(n.type==="arc"&&e in ohe)return"band";const i=n[Uc(e)];return _w(i)||wE(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return fO(e)?"time":X7(e)==="discrete"?(Ct(Y7(e,"temporal")),"ordinal"):Et(t)&&t.timeUnit&&aa(t.timeUnit).utc?"utc":q7(e)?"band":"time";case"quantitative":return fO(e)?Et(t)&&eo(t.bin)?"bin-ordinal":"linear":X7(e)==="discrete"?(Ct(Y7(e,"quantitative")),"ordinal"):q7(e)?"band":"linear";case"geojson":return}throw new Error(yXe(t.type))}function pgn(e,{ignoreRange:t}={}){sKe(e),HQe(e);for(const n of run)rKe(e,n);t||iKe(e)}function sKe(e){vo(e)?e.component.scales=ggn(e):e.component.scales=vgn(e)}function ggn(e){const{encoding:t,mark:n,markDef:r}=e,i={};for(const o of she){const s=Ls(t[o]);if(s&&n===VXe&&o===Bc&&s.type===nP)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??={};const l=pYe(t,o),c=dgn(a,o,s,r,l);i[o]=new ZQe(e.scaleName(`${o}`,!0),{value:c,explicit:a.type===c})}}return i}const mgn=qYe((e,t)=>pEe(e)-pEe(t));function vgn(e){const t=e.component.scales={},n={},r=e.component.resolve;for(const i of e.children){sKe(i);for(const o of wt(i.component.scales))if(r.scale[o]??=FQe(o,e),r.scale[o]==="shared"){const s=n[o],a=i.component.scales[o].getWithExplicit("type");s?qcn(s.value,a.value)?n[o]=ib(s,a,"type","scale",mgn):(r.scale[o]="independent",delete n[o]):n[o]=a}}for(const i of wt(n)){const o=e.scaleName(i,!0),s=n[i];t[i]=new ZQe(o,s);for(const a of e.children){const l=a.component.scales[i];l&&(a.renameScale(l.get("name"),o),l.merged=!0)}}return t}class aq{nameMap;constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function vo(e){return e?.type==="unit"}function Du(e){return e?.type==="facet"}function dpe(e){return e?.type==="concat"}function aP(e){return e?.type==="layer"}class hpe{type;parent;config;name;size;title;description;data;transforms;layout;scaleNameMap;projectionNameMap;signalNameMap;component;view;constructor(t,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.parent=r,this.config=o,this.view=Sa(a),this.name=t.name??i,this.title=Yy(t.title)?{text:t.title}:t.title?Sa(t.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new aq,this.projectionNameMap=r?r.projectionNameMap:new aq,this.signalNameMap=r?r.signalNameMap:new aq,this.data=t.data,this.description=t.description,this.transforms=ydn(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Sfn(t,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:r8(t)||r?.component.data.isFaceted&&t.data===void 0},layoutSize:new Fv,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Un(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){pgn(this)}parseProjection(){QQe(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){BQe(this)}assembleEncodeFromView(t){const{style:n,...r}=t,i={};for(const o of wt(r)){const s=r[o];s!==void 0&&(i[o]=lo(s))}return i}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=lo(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Vi(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:r,config:i}=this,o=Ihn(r.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const r of Pf)t[r].title&&n.push(Thn(this,r));for(const r of rpe)n=n.concat(Phn(this,r));return n}assembleAxes(){return phn(this.component.axes,this.config)}assembleLegends(){return qQe(this)}assembleProjections(){return zpn(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},r={...lXe(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(r.text)return yr(["unit","layer"],this.type)?yr(["middle",void 0],r.anchor)&&(r.frame??="group"):r.anchor??="start",Vi(r)?void 0:r}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||Du(this.parent)?KQe(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return xo((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ao[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(t){if(Du(this.parent)){const n=DQe(t),r=GV(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if(Wo(o)&&wS(s)){const a=i.get("name"),l=Pw(this,r),c=fpe(l);if(c){const u=It({aggregate:"distinct",field:c},{expr:"datum"});return{signal:IQe(a,i,u)}}else return Ct(che(r)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(eXe(t)&&Tg(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let r=this.component.selection[t];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(t,n)),!r)throw new Error(xln(n));return r}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}}class aKe extends hpe{vgField(t,n={}){const r=this.fieldDef(t);if(r)return It(r,n)}reduceFieldDef(t,n){return Kun(this.getMapping(),(r,i,o)=>{const s=wh(i);return s?t(r,s,o):r},n)}forEachFieldDef(t,n){Nhe(this.getMapping(),(r,i)=>{const o=wh(r);o&&t(o,i)},n)}}class v8 extends Ti{transform;clone(){return new v8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const i=this.transform.resolve??"shared";this.transform.resolve=i}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${ar(this.transform)}`}assemble(){const{density:t,...n}=this.transform,r={type:"kde",field:t,...n};return r.resolve=this.transform.resolve,r}}class y8 extends Ti{transform;clone(){return new y8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${ar(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class b8 extends Ti{transform;clone(){return new b8(this.parent,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${ar(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class x8 extends Ti{transform;clone(){return new x8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${ar(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class pO extends Ti{fields;geojson;signal;clone(){return new pO(null,Un(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let r=0;for(const i of[[Ih,Rh],[td,Dh]]){const o=i.map(s=>{const a=Ls(n.encoding[s]);return Et(a)?a.field:Pg(a)?{expr:`${a.datum}`}:xh(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new pO(t,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(Bc)){const i=n.typedFieldDef(Bc);i.type===nP&&(t=new pO(t,null,i.field,n.getName(`geojson_${r++}`)))}return t}constructor(t,n,r,i){super(t),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const t=(this.fields??[]).filter(Ut);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${ar(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class xR extends Ti{projection;fields;as;clone(){return new xR(null,this.projection,Un(this.fields),Un(this.as))}constructor(t,n,r,i){super(t),this.projection=n,this.fields=r,this.as=i}static parseAll(t,n){if(!n.projectionName())return t;for(const r of[[Ih,Rh],[td,Dh]]){const i=r.map(s=>{const a=Ls(n.encoding[s]);return Et(a)?a.field:Pg(a)?{expr:`${a.datum}`}:xh(a)?{expr:`${a.value}`}:void 0}),o=r[0]===td?"2":"";(i[0]||i[1])&&(t=new xR(t,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(Ut))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${ar(this.fields)} ${ar(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class F1 extends Ti{transform;clone(){return new F1(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:r,step:i}=t;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(t,n){return new F1(t,n)}static makeFromEncoding(t,n){const r=n.encoding,i=r.x,o=r.y;if(Et(i)&&Et(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:c,frame:u,keyvals:f}=s.impute,d=vYe(n.mark,r);return new F1(t,{impute:s.field,key:a.field,...l?{method:l}:{},...c!==void 0?{value:c}:{},...u?{frame:u}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${ar(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:t,key:n,...r?{keyvals:Jfn(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const c={type:"window",as:[`imputed_${t}_value`],ops:[i],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},u={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[l,c,u]}else return[l]}}class w8 extends Ti{transform;clone(){return new w8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${ar(this.transform)}`}assemble(){const{loess:t,on:n,...r}=this.transform;return{type:"loess",x:n,y:t,...r}}}class wR extends Ti{transform;secondary;clone(){return new wR(null,Un(this.transform),this.secondary)}constructor(t,n,r){super(t),this.transform=n,this.secondary=r}static make(t,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(edn(s)){let l=uKe(s.data,o);l||(l=new Tw(s.data),o.push(l));const c=n.getName(`lookup_${i}`);a=new Mc(l,c,Ao.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[c]=a}else if(tdn(s)){const l=s.param;r={as:l,...r};let c;try{c=n.getSelectionComponent(xo(l),l)}catch{throw new Error(Cln(l))}if(a=c.materialized,!a)throw new Error(Oln(l))}return new wR(t,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Ht(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${ar({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:Ht(this.transform.as)}:{}};else{let n=this.transform.as;Ut(n)||(Ct(Fln),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class S8 extends Ti{transform;clone(){return new S8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${ar(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class _8 extends Ti{transform;clone(){return new _8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Un(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${ar(this.transform)}`}assemble(){const{regression:t,on:n,...r}=this.transform;return{type:"regression",x:n,y:t,...r}}}class C8 extends Ti{transform;clone(){return new C8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=_u((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${ar(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:t,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class O8 extends Ti{transform;clone(){return new O8(null,Un(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${ar(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function lKe(e){let t=0;function n(r,i){if(r instanceof Tw&&!r.isGenerator&&!CE(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof ul&&(r.parent instanceof Tw&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof oP){i.name||(i.name=`data_${t++}`),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,e.push(...r.assemble());return}switch((r instanceof xL||r instanceof wL||r instanceof kE||r instanceof iP||r instanceof EE||r instanceof xR||r instanceof ch||r instanceof wR||r instanceof sP||r instanceof ES||r instanceof x8||r instanceof b8||r instanceof v8||r instanceof w8||r instanceof S8||r instanceof _8||r instanceof ob||r instanceof O8||r instanceof C8||r instanceof y8)&&i.transform.push(r.assemble()),(r instanceof Xp||r instanceof Gp||r instanceof F1||r instanceof Ym||r instanceof pO)&&i.transform.push(...r.assemble()),r instanceof Mc&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof Mc?r.setSource(i.name):(i.name||(i.name=`data_${t++}`),r.setSource(i.name),r.numChildren()===1&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof Mc&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${t++}`);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function ygn(e){const t=[],n=lKe(t);for(const r of e.children)n(r,{source:e.name,name:null,transform:[]});return t}function bgn(e,t){const n=[],r=lKe(n);let i=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function xgn(e){return e==="top"||e==="left"||hn(e)?"header":"footer"}function wgn(e){for(const t of Pf)Sgn(e,t);cTe(e,"x"),cTe(e,"y")}function Sgn(e,t){const{facet:n,config:r,child:i,component:o}=e;if(e.channelHasField(t)){const s=n[t],a=PE("title",null,r,t);let l=dO(s,r,{allowDisabling:!0,includeDefault:a===void 0||!!a});i.component.layoutHeaders[t].title&&(l=it(l)?l.join(", "):l,l+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);const c=PE("labelOrient",s.header,r,t),u=s.header!==null?is(s.header?.labels,r.header.labels,!0):!1,f=yr(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:s.header!==null?l:null,facetFieldDef:s,[f]:t==="facet"?[]:[cKe(e,t,u)]}}}function cKe(e,t,n){const r=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function cTe(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=spe(i,t),i.axis[t]==="shared"){const o=t==="x"?"column":"row",s=r[o];for(const a of n.component.axes[t]){const l=xgn(a.get("orient"));s[l]??=[cKe(e,o,!1)];const c=pM(a,"main",e.config,{header:!0});c&&s[l][0].axes.push(c),a.mainExtracted=!0}}}}function _gn(e){ppe(e),FB(e,"width"),FB(e,"height")}function Cgn(e){ppe(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";FB(e,t),FB(e,n)}function ppe(e){for(const t of e.children)t.parseLayoutSize()}function FB(e,t){const n=DQe(t),r=GV(n),i=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const l=a.component.layoutSize.getWithExplicit(n),c=i.scale[r]??FQe(r,e);if(c==="independent"&&l.value==="step"){s=void 0;break}if(s){if(c==="independent"&&s.value!==l.value){s=void 0;break}s=ib(s,l,n,"")}else s=l}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function Ogn(e){const{size:t,component:n}=e;for(const r of Dv){const i=Uc(r);if(t[i]!=null&&t[i]!=null){const o=t[i];n.layoutSize.set(i,lg(o)?"step":o,!0)}else{const o=Egn(e,i);n.layoutSize.set(i,o,!1)}}}function Egn(e,t){const n=t==="width"?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if(Wo(o)){const a=RB(r.view,t);return wS(s)||lg(a)?"step":a}else return tre(r.view,t)}else{if(e.hasProjection||e.mark==="arc")return tre(r.view,t);{const o=RB(r.view,t);return lg(o)?o.step:o}}}function xre(e,t,n){return It(t,{suffix:`by_${It(e)}`,...n})}class ZM extends aKe{facet;child;children;constructor(t,n,r,i){super(t,"facet",n,r,i,t.resolve),this.child=bpe(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!pL(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=wt(t),r={};for(const i of n){if(![Hm,Gm].includes(i)){Ct(YV(i,"facet"));break}const o=t[i];if(o.field===void 0){Ct(Qne(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(t,n){const r=$he(t,n);return r.header?r.header=Sa(r.header):r.header===null&&(r.header=null),r}channelHasField(t){return _t(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=E8(this),this.child.parseData()}parseLayoutSize(){ppe(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,ys(this.component.selection).some(t=>qp(t))&&fhe(uhe)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),wgn(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of Pf)for(const r of ipe){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=PE("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=g8(n,a);t.titleAnchor??={},t.titleAnchor[l]="end"}}if(o?.[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[l]??={},t[l][n]=.5),i.title&&(t.offset??={},t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,r=t?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof ZM))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof ZM?{...this.channelHasField("column")?{encode:{update:{columns:{field:It(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],r=[];if(this.child instanceof ZM){if(this.child.channelHasField("column")){const i=It(this.child.facet.column);t.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of Dv){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(Wo(s)&&wS(a)){const l=Pw(this.child,i),c=fpe(l);c?(t.push(c),n.push("distinct"),r.push(`distinct_${c}`)):Ct(che(i))}}}return{fields:t,ops:n,as:r}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const u of Pf){const f=this.facet[u];if(f){l.push(It(f));const{bin:d,sort:h}=f;if(eo(d)&&l.push(It(f,{binSuffix:"end"})),qm(h)){const{field:p,op:g=n8}=h,m=xre(f,h);r&&i?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(it(h)){const p=TE(f,u);o.push(p),s.push("max"),a.push(p)}}}const c=!!r&&!!i;return{name:t,data:n,groupby:l,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,r=n[t];return r?qm(r.sort)?[xre(r,r.sort,{expr:"datum"})]:it(r.sort)?[TE(r,t,{expr:"datum"})]:[It(r,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,r=n[t];if(r){const{sort:i}=r;return[(qm(i)?i.order:!it(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:n}=this;if(t.facet)return dre(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of rpe)if(t[i]){const o=PE("labelOrient",t[i]?.header,n,i);if(r[i].includes(o))return dre(t[i],i,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,r=ygn(n),i=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:Pf.map(l=>this.facetSortFields(l)).flat(),order:Pf.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup($dn(this,[]))}]}getMapping(){return this.facet}}function Tgn(e,t){const{row:n,column:r}=t;if(n&&r){let i=null;for(const o of[n,r])if(qm(o.sort)){const{field:s,op:a=n8}=o.sort;e=i=new ES(e,{joinaggregate:[{op:a,field:s,as:xre(o,o.sort,{forAs:!0})}],groupby:[It(o)]})}return i}return null}function uKe(e,t){for(const n of t){const r=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const i=e.format?.mesh,o=r.format?.feature;if(i&&o)continue;const s=e.format?.feature;if((s||o)&&s!==o)continue;const a=r.format?.mesh;if(!((i||a)&&i!==a)){if(bR(e)&&bR(r)){if(Cu(e.values,r.values))return n}else if(CE(e)&&CE(r)){if(e.url===r.url)return n}else if(XYe(e)&&e.name===n.dataName)return n}}return null}function Pgn(e,t){if(e.data||!e.parent){if(e.data===null){const r=new Tw({values:[]});return t.push(r),r}const n=uKe(e.data,t);if(n)return I0(e.data)||(n.data.format=Bqe({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const r=new Tw(e.data);return t.push(r),r}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function kgn(e,t,n){let r=0;for(const i of t.transforms){let o,s;if(fdn(i))s=e=new EE(e,i),o="derived";else if(Yhe(i)){const a=spn(i);s=e=ul.makeWithAncestors(e,{},a,n)??e,e=new iP(e,t,i.filter)}else if(VYe(i))s=e=Xp.makeFromTransform(e,i,t),o="number";else if(hdn(i))o="date",n.getWithExplicit(i.field).value===void 0&&(e=new ul(e,{[i.field]:o}),n.set(i.field,o,!1)),s=e=Gp.makeFromTransform(e,i);else if(pdn(i))s=e=ch.makeFromTransform(e,i),o="number",npe(t)&&(e=new ob(e));else if(UYe(i))s=e=wR.make(e,t,i,r++),o="derived";else if(ldn(i))s=e=new sP(e,i),o="number";else if(cdn(i))s=e=new ES(e,i),o="number";else if(gdn(i))s=e=Ym.makeFromTransform(e,i),o="derived";else if(mdn(i))s=e=new x8(e,i),o="derived";else if(vdn(i))s=e=new y8(e,i),o="derived";else if(udn(i))s=e=new b8(e,i),o="derived";else if(ndn(i))s=e=new C8(e,i),o="derived";else if(adn(i))e=new O8(e,i);else if(ddn(i))s=e=F1.makeFromTransform(e,i),o="derived";else if(rdn(i))s=e=new v8(e,i),o="derived";else if(idn(i))s=e=new S8(e,i),o="derived";else if(odn(i))s=e=new _8(e,i),o="derived";else if(sdn(i))s=e=new w8(e,i),o="derived";else{Ct(Lln(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function E8(e){let t=Pgn(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,s=!(i&&(I0(i)||CE(i)||bR(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new kdn;I0(i)?(YYe(i)?t=new wL(t,i.sequence):Qhe(i)&&(t=new xL(t,i.graticule)),s.parseNothing=!0):i?.format?.parse===null&&(s.parseNothing=!0),t=ul.makeExplicit(t,e,s)??t,t=new ob(t);const a=e.parent&&aP(e.parent);(vo(e)||Du(e))&&a&&(t=Xp.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=kgn(t,e,s));const l=lpn(e),c=apn(e);t=ul.makeWithAncestors(t,{},{...l,...c},s)??t,vo(e)&&(t=pO.parseAll(t,e),t=xR.parseAll(t,e)),(vo(e)||Du(e))&&(a||(t=Xp.makeFromEncoding(t,e)??t),t=Gp.makeFromEncoding(t,e)??t,t=EE.parseAllForSortIndex(t,e));const u=t=bN(Ao.Raw,e,t);if(vo(e)){const m=ch.makeFromEncoding(t,e);m&&(t=m,npe(e)&&(t=new ob(t))),t=F1.makeFromEncoding(t,e)??t,t=Ym.makeFromEncoding(t,e)??t}let f,d;if(vo(e)){const{markDef:m,mark:v,config:y}=e,b=vi("invalid",m,y),{marks:w,scales:S}=d=KYe({invalid:b,isPath:zb(v)});w!==S&&S==="include-invalid-values"&&(f=t=bN(Ao.PreFilterInvalid,e,t)),w==="exclude-invalid-values"&&(t=kE.make(t,e,d)??t)}const h=t=bN(Ao.Main,e,t);let p;if(vo(e)&&d){const{marks:m,scales:v}=d;m==="include-invalid-values"&&v==="exclude-invalid-values"&&(t=kE.make(t,e,d)??t,p=t=bN(Ao.PostFilterInvalid,e,t))}vo(e)&&dhn(e,h);let g=null;if(Du(e)){const m=e.getName("facet");t=Tgn(t,e.facet)??t,g=new oP(t,e,m,h.getSource()),n[m]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:u,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function bN(e,t,n){const{outputNodes:r,outputNodeRefCounts:i}=t.component.data,o=t.getDataName(e),s=new Mc(n,o,e,i);return r[o]=s,s}class Mgn extends hpe{children;constructor(t,n,r,i){super(t,"concat",n,r,i,t.resolve),(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&Ct(Rln),this.children=this.getChildren(t).map((o,s)=>bpe(o,this,this.getName(`concat_${s}`),void 0,i))}parseData(){this.component.data=E8(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of wt(t.component.selection))this.component.selection[n]=t.component.selection[n]}ys(this.component.selection).some(t=>qp(t))&&fhe(uhe)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return c8(t)?t.vconcat:qhe(t)?t.hconcat:t.concat}parseLayoutSize(){Cgn(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=ope(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),r=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function Agn(e){return e===!1||e===null}const Rgn={disable:1,gridScale:1,scale:1,...fYe,labelExpr:1,encode:1},fKe=wt(Rgn);class gpe extends Fv{explicit;implicit;mainExtracted;constructor(t={},n={},r=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=r}clone(){return new gpe(Un(this.explicit),Un(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Agn(this.get(t))}hasOrientSignalRef(){return hn(this.explicit.orient)}}function Ign(e,t,n){const{encoding:r,config:i}=e,o=Ls(r[t])??Ls(r[Eg(t)]),s=e.axis(t)||{},{format:a,formatType:l}=s;if(Cw(l))return{text:th({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(xE(o)==="quantitative"){if(wE(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:th({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:th({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(xE(o)==="temporal"&&i.timeFormatType&&Et(o)&&!o.timeUnit)return{text:th({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function Dgn(e){return Dv.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Bgn(n,e)]),t),{})}const Lgn={bottom:"top",top:"bottom",left:"right",right:"left"};function Fgn(e){const{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(const i of e.children){i.parseAxesAndHeaders();for(const o of wt(i.component.axes))n.axis[o]=spe(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=$gn(t[o],i.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const i of Dv){for(const o of e.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){t[i]=(t[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!hn(a)){if(r[a]>0&&!l){const c=Lgn[a];r[a]>r[c]&&s.set("orient",c,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&t[i]&&t[i].length>1)for(const[o,s]of(t[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function $gn(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let r=0;rn.clone());return e}function Ngn(e,t){for(const n of fKe){const r=ib(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return mXe(i,o);case"gridScale":return{explicit:i.explicit,value:is(i.value,o.value)}}return f8(i,o,n,"axis")});e.setWithExplicit(n,r)}return e}function zgn(e,t,n,r,i){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(hn(n.labelAngle)?n.labelAngle:vR(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===kQe(r,i))return!0}return e===n[t]}const jgn=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Bgn(e,t){let n=t.axis(e);const r=new gpe,i=Ls(t.encoding[e]),{mark:o,config:s}=t,a=n?.orient||s[e==="x"?"axisX":"axisY"]?.orient||s.axis?.orient||Shn(e),l=t.getScaleComponent(e).get("type"),c=ghn(e,l,a,t.config),u=n!==void 0?!n:ure("disable",s.style,n?.style,c).configValue;if(r.set("disable",u,n!==void 0),u)return r;n=n||{};const f=bhn(i,n,e,s.style,c),d=KXe(n.formatType,i,l),h=QXe(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const v of fKe){const y=v in XEe?XEe[v](p):wEe(v)?n[v]:void 0,b=y!==void 0,w=zgn(y,v,n,t,e);if(b&&w)r.set(v,y,w);else{const{configValue:S=void 0,configFrom:_=void 0}=wEe(v)&&v!=="values"?ure(v,s.style,n.style,c):{},E=S!==void 0;b&&!E?r.set(v,y,w):(_!=="vgAxisConfig"||jgn.has(v)&&E||yL(S)||hn(S))&&r.set(v,S,!1)}}const g=n.encoding??{},m=uYe.reduce((v,y)=>{if(!r.hasAxisPart(y))return v;const b=LQe(g[y]??{},t),w=y==="labels"?Ign(t,e,b):b;return w!==void 0&&!Vi(w)&&(v[y]={update:w}),v},{});return Vi(m)||r.set("encode",m,!!n.encoding||n.labelAngle!==void 0),r}function Ugn({encoding:e,size:t}){for(const n of Dv){const r=Uc(n);lg(t[r])&&g0(e[n])&&(delete t[r],Ct(wXe(r)))}return t}const Vgn={vgMark:"arc",encodeEntry:e=>({...dd(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ul("x",e,{defaultPos:"mid"}),...Ul("y",e,{defaultPos:"mid"}),...hv(e,"radius"),...hv(e,"theta")})},Wgn={vgMark:"area",encodeEntry:e=>({...dd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...IB("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...IB("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...tpe(e)})},Hgn={vgMark:"rect",encodeEntry:e=>({...dd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...hv(e,"x"),...hv(e,"y")})},Ggn={vgMark:"shape",encodeEntry:e=>({...dd(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&Et(n)&&n.type===nP?{field:It(n,{expr:"datum"})}:{}}]}},qgn={vgMark:"image",encodeEntry:e=>({...dd(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...hv(e,"x"),...hv(e,"y"),...Zhe(e,"url")})},Xgn={vgMark:"line",encodeEntry:e=>({...dd(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ul("x",e,{defaultPos:"mid"}),...Ul("y",e,{defaultPos:"mid"}),...Ta("size",e,{vgChannel:"strokeWidth"}),...tpe(e)})},Ygn={vgMark:"trail",encodeEntry:e=>({...dd(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ul("x",e,{defaultPos:"mid"}),...Ul("y",e,{defaultPos:"mid"}),...Ta("size",e),...tpe(e)})};function mpe(e,t){const{config:n}=e;return{...dd(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ul("x",e,{defaultPos:"mid"}),...Ul("y",e,{defaultPos:"mid"}),...Ta("size",e),...Ta("angle",e),...Qgn(e,n,t)}}function Qgn(e,t,n){return n?{shape:{value:n}}:Ta("shape",e)}const Kgn={vgMark:"symbol",encodeEntry:e=>mpe(e)},Zgn={vgMark:"symbol",encodeEntry:e=>mpe(e,"circle")},Jgn={vgMark:"symbol",encodeEntry:e=>mpe(e,"square")},emn={vgMark:"rect",encodeEntry:e=>({...dd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...hv(e,"x"),...hv(e,"y")})},tmn={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...dd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...IB("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...IB("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...Ta("size",e,{vgChannel:"strokeWidth"})}}},nmn={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...dd(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Ul("x",e,{defaultPos:"mid"}),...Ul("y",e,{defaultPos:"mid"}),...Zhe(e),...Ta("size",e,{vgChannel:"fontSize"}),...Ta("angle",e),...WEe("align",rmn(e.markDef,n,t)),...WEe("baseline",imn(e.markDef,n,t)),...Ul("radius",e,{defaultPos:null}),...Ul("theta",e,{defaultPos:null})}}};function rmn(e,t,n){if(vi("align",e,n)===void 0)return"center"}function imn(e,t,n){if(vi("baseline",e,n)===void 0)return"middle"}const omn={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i=r==="horizontal"?"x":"y",o=r==="horizontal"?"y":"x",s=r==="horizontal"?"height":"width";return{...dd(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...hv(e,i),...Ul(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:lo(vi("thickness",n,t))}}},xN={arc:Vgn,area:Wgn,bar:Hgn,circle:Zgn,geoshape:Ggn,image:qgn,line:Xgn,point:Kgn,rect:emn,rule:tmn,square:Jgn,text:nmn,tick:omn,trail:Ygn};function smn(e){if(yr([e8,ZV,cun],e.mark)){const t=vYe(e.mark,e.encoding);if(t.length>0)return amn(e,t)}else if(e.mark===JV){const t=Xne.some(n=>vi(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return lmn(e)}return vpe(e)}const uTe="faceted_path_";function amn(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:uTe+e.requestDataName(Ao.Main),data:e.requestDataName(Ao.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:vpe(e,{fromPrefix:uTe})}]}const fTe="stack_group_";function lmn(e){const[t]=vpe(e,{fromPrefix:fTe}),n=e.scaleName(e.stack.fieldChannel),r=(c={})=>e.vgField(e.stack.fieldChannel,c),i=(c,u)=>{const f=[r({prefix:"min",suffix:"start",expr:u}),r({prefix:"max",suffix:"start",expr:u}),r({prefix:"min",suffix:"end",expr:u}),r({prefix:"max",suffix:"end",expr:u})];return`${c}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...hE(t.encode.update,["y","yc","y2","height",...Xne]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Iu(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...hE(t.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Iu(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of Xne){const u=sg(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):u&&(o[c]=lo(u)),u&&(t.encode.update[c]={value:0})}const a=[];if(e.stack.groupbyChannels?.length>0)for(const c of e.stack.groupbyChannels){const u=e.fieldDef(c),f=It(u);f&&a.push(f),(u?.bin||u?.timeUnit)&&a.push(It(u,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,u)=>{if(t.encode.update[u])return{...c,[u]:t.encode.update[u]};{const f=sg(u,e.markDef,e.config);return f!==void 0?{...c,[u]:lo(f)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ao.Main),name:fTe+e.requestDataName(Ao.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[t]}]}]}function cmn(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,s=t.order;if(!(!it(s)&&xh(s)&&Gne(s.value)||!s&&Gne(vi("order",i,o)))){if((it(s)||Et(s))&&!n)return hXe(s,{expr:"datum"});if(zb(r)){const a=i.orient==="horizontal"?"y":"x",l=t[a];if(Et(l))return{field:a}}}}function vpe(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,s=is(r.clip,umn(e),fmn(e)),a=fXe(r),l=i.key,c=cmn(e),u=dmn(e);u&&Object.values(e.component.selection).some(h=>h.type==="point"&&!h.bind&&h.on!=="pointerover")&&(e.markDef.cursor??="pointer");const f=vi("aria",r,o),d=xN[n].postEncodingTransform?xN[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:xN[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ao.Main)},encode:{update:xN[n].encodeEntry(e)},...d?{transform:d}:{}}]}function umn(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function fmn(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function dmn(e){if(!e.component.selection)return null;const t=wt(e.component.selection).length;let n=t,r=e.parent;for(;r&&n===0;)n=wt(r.component.selection).length,r=r.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class dKe extends aKe{markDef;encoding;specifiedScales={};stack;specifiedAxes={};specifiedLegends={};specifiedProjection={};selection=[];children=[];constructor(t,n,r,i={},o){super(t,"unit",n,r,o,void 0,_Ee(t)?t.view:void 0);const s=ag(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=Hfn(s,o,{graticule:t.data&&Qhe(t.data)}));const l=this.encoding=Yun(t.encoding||{},a,s.filled,o);this.markDef=NYe(s,l,o),this.size=Ugn({encoding:l,size:_Ee(t)?{...i,...t.width!==void 0?{width:t.width}:{},...t.height!==void 0?{height:t.height}:{}}:i}),this.stack=$Ye(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(c=>Hhe(c)),this.alignStackOrderWithColorDomain()}get hasProjection(){const{encoding:t}=this,n=this.mark===VXe,r=t&&Ban.some(i=>Hn(t[i]));return n||r}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return she.reduce((r,i)=>{const o=Ls(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(t){const{domain:n,range:r}=t,i=Sa(t);return it(n)&&(i.domain=n.map(xu)),it(r)&&(i.range=r.map(xu)),i}initAxes(t){return Dv.reduce((n,r)=>{const i=t[r];if(Hn(i)||r===_o&&Hn(t.x2)||r===ha&&Hn(t.y2)){const o=Hn(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=wt(t),r={};for(const i of n){const o=t[i];r[i]=yL(o)?uXe(o):xu(o)}return r}initLegends(t){return Zan.reduce((n,r)=>{const i=Ls(t[r]);if(i&&eln(r)){const o=i.legend;n[r]=o&&Sa(o)}return n},{})}alignStackOrderWithColorDomain(){const{color:t,fill:n,order:r,xOffset:i,yOffset:o}=this.encoding,s=n||t,a=Et(s)?s:void 0,l=a?.field,c=a?.scale,u=a?.type,f=c?.domain,d=i||o,h=Et(d)?d:void 0,p=`_${l}_sort_index`;if(!r&&Array.isArray(f)&&typeof l=="string"&&u==="nominal")if(h&&!h.sort)h.sort=f;else{if(!this.stack)return;const g=`indexof(${Tt(f)}, datum['${l}'])`,m=this.markDef?.orient==="horizontal"?"ascending":"descending";this.transforms.push({calculate:g,as:p}),this.encoding.order={field:p,type:"quantitative",sort:m}}}parseData(){this.component.data=E8(this)}parseLayoutSize(){Ogn(this)}parseSelections(){this.component.selection=fhn(this,this.selection)}parseMarkGroup(){this.component.mark=smn(this)}parseAxesAndHeaders(){this.component.axes=Dgn(this)}assembleSelectionTopLevelSignals(t){return Ndn(this,t)}assembleSignals(){return[...EQe(this),...Fdn(this,[])]}assembleSelectionData(t){return zdn(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return ope(this)}correctDataNames=t=>(t.from?.data&&(t.from.data=this.lookupDataSource(t.from.data),"time"in this.encoding&&(t.from.data=t.from.data+JYe)),t.from?.facet?.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t);assembleMarks(){let t=this.component.mark??[];return(!this.parent||!aP(this.parent))&&(t=rQe(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return D1(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return wh(n)}typedFieldDef(t){const n=this.fieldDef(t);return Yl(n)?n:null}}class ype extends hpe{children;constructor(t,n,r,i,o){super(t,"layer",n,r,o,t.resolve,t.view);const s={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,l)=>{if(u8(a))return new ype(a,this,this.getName(`layer_${l}`),s,o);if(Lv(a))return new dKe(a,this,this.getName(`layer_${l}`),s,o);throw new Error(lhe(a))})}parseData(){this.component.data=E8(this);for(const t of this.children)t.parseData()}parseLayoutSize(){_gn(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of wt(t.component.selection))this.component.selection[n]=t.component.selection[n]}ys(this.component.selection).some(t=>qp(t))&&fhe(uhe)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Fgn(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),EQe(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),ope(this))}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const r of this.children)for(const i of Ht(r.assembleGroupStyle()))t.add(i);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return jdn(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),qQe(this))}}function bpe(e,t,n,r,i){if(r8(e))return new ZM(e,t,n,i);if(u8(e))return new ype(e,t,n,r,i);if(Lv(e))return new dKe(e,t,n,r,i);if(bfn(e))return new Mgn(e,t,n,i);throw new Error(lhe(e))}function hmn(e,t={}){t.logger&&_cn(t.logger),t.fieldTitle&&aYe(t.fieldTitle);try{const n=FYe($T(t.config,e.config)),r=GYe(e,n),i=bpe(r,null,"",void 0,n);return i.parse(),_pn(i.component.data,i),{spec:gmn(i,pmn(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&Ccn(),t.fieldTitle&&jun()}}function pmn(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):Ut(t)&&(t={type:t}),i&&o&&Edn(t.type)){if(i==="step"&&o==="step")Ct(aEe()),t.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";Ct(aEe(GV(s)));const a=s==="width"?"height":"width";t.type=Tdn(a)}}return{...wt(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...LEe(n,!1),...LEe(e,!0)}}function gmn(e,t,n={},r){const i=e.config?Ifn(e.config):void 0,o=bgn(e.component.data,n),s=e.assembleSelectionData(o),a=e.assembleProjections(),l=e.assembleTitle(),c=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v6.json",...e.description?{description:e.description}:{},...h,...l?{title:l}:{},...c?{style:c}:{},...u?{encode:{update:u}}:{},data:s,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...RYe(d)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const mmn=Lan.version,vmn=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:mE,accessPathWithDatum:Zde,accessWithDatumToUnescapedPath:Ci,compile:hmn,contains:yr,deepEqual:Cu,deleteNestedProperty:CB,duplicate:Un,entries:tb,every:Yde,fieldIntersection:Kde,flatAccessWithDatum:Vqe,getFirstDefined:is,hasIntersection:Qde,hasProperty:_t,hash:ar,internalField:qqe,isBoolean:gE,isEmpty:Vi,isEqual:$an,isInternalField:Xqe,isNullOrFalse:Gne,isNumeric:jV,isPrimitive:_B,keys:wt,logicalExpr:QM,mergeDeep:Bqe,never:jqe,normalize:GYe,normalizeAngle:vR,omit:Iu,pick:hE,prefixGenerator:qne,removePathFromField:eP,replaceAll:yw,replacePathInField:ed,resetIdCounter:zan,setEqual:Uqe,some:pE,stringify:Ei,titleCase:aL,unescapeSingleQuoteAndPathDot:Wqe,unique:_u,uniqueId:Gqe,vals:ys,varName:xo,version:mmn},Symbol.toStringTag,{value:"Module"}));function hKe(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var ymn="3.0.0",bmn={version:ymn};const R_="#fff",dTe="#888",xmn={background:"#333",view:{stroke:dTe},title:{color:R_,subtitleColor:R_},style:{"guide-label":{fill:R_},"guide-title":{fill:R_}},axis:{domainColor:R_,gridColor:dTe,tickColor:R_}},px="#4572a7",wmn={background:"#fff",arc:{fill:px},area:{fill:px},line:{stroke:px,strokeWidth:2},path:{stroke:px},rect:{fill:px},shape:{stroke:px},symbol:{fill:px,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},gx="#30a2da",lq="#cbcbcb",Smn="#999",_mn="#333",hTe="#f0f0f0",pTe="#333",Cmn={arc:{fill:gx},area:{fill:gx},axis:{domainColor:lq,grid:!0,gridColor:lq,gridWidth:1,labelColor:Smn,labelFontSize:10,titleColor:_mn,tickColor:lq,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:hTe,group:{fill:hTe},legend:{labelColor:pTe,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:pTe,titleFontSize:14,titlePadding:10},line:{stroke:gx,strokeWidth:2},path:{stroke:gx,strokeWidth:.5},rect:{fill:gx},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:gx},bar:{binSpacing:2,fill:gx,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},mx="#000",Omn={group:{fill:"#e5e5e5"},arc:{fill:mx},area:{fill:mx},line:{stroke:mx},path:{stroke:mx},rect:{fill:mx},shape:{stroke:mx},symbol:{fill:mx,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Emn=22,Tmn="normal",gTe="Benton Gothic, sans-serif",mTe=11.5,Pmn="normal",vx="#82c6df",cq="Benton Gothic Bold, sans-serif",vTe="normal",yTe=13,e2={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},kmn={background:"#ffffff",title:{anchor:"start",color:"#000000",font:cq,fontSize:Emn,fontWeight:Tmn},arc:{fill:vx},area:{fill:vx},line:{stroke:vx,strokeWidth:2},path:{stroke:vx},rect:{fill:vx},shape:{stroke:vx},symbol:{fill:vx,size:30},axis:{labelFont:gTe,labelFontSize:mTe,labelFontWeight:Pmn,titleFont:cq,titleFontSize:yTe,titleFontWeight:vTe},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:gTe,labelFontSize:mTe,symbolType:"square",titleFont:cq,titleFontSize:yTe,titleFontWeight:vTe},range:{category:e2["category-6"],diverging:e2["fireandice-6"],heatmap:e2["fire-7"],ordinal:e2["fire-7"],ramp:e2["fire-7"]}},yx="#ab5787",wN="#979797",Mmn={background:"#f9f9f9",arc:{fill:yx},area:{fill:yx},line:{stroke:yx},path:{stroke:yx},rect:{fill:yx},shape:{stroke:yx},symbol:{fill:yx,size:30},axis:{domainColor:wN,domainWidth:.5,gridWidth:.2,labelColor:wN,tickColor:wN,tickWidth:.2,titleColor:wN},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},bx="#3e5c69",Amn={background:"#fff",arc:{fill:bx},area:{fill:bx},line:{stroke:bx},path:{stroke:bx},rect:{fill:bx},shape:{stroke:bx},symbol:{fill:bx},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},sf="#1696d2",bTe="#000000",Rmn="#FFFFFF",SN="Lato",uq="Lato",Imn="Lato",Dmn="#DEDDDD",Lmn=18,t2={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},Fmn={background:Rmn,title:{anchor:"start",fontSize:Lmn,font:SN},axisX:{domain:!0,domainColor:bTe,domainWidth:1,grid:!1,labelFontSize:12,labelFont:uq,labelAngle:0,tickColor:bTe,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:SN},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Dmn,gridWidth:1,labelFontSize:12,labelFont:uq,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:SN,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:uq,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:SN,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:t2["six-groups-cat-1"],diverging:t2["diverging-colors"],heatmap:t2["diverging-colors"],ordinal:t2["six-groups-seq"],ramp:t2["shades-blue"]},area:{fill:sf},rect:{fill:sf},line:{color:sf,stroke:sf,strokeWidth:5},trail:{color:sf,stroke:sf,strokeWidth:0,size:1},path:{stroke:sf,strokeWidth:.5},point:{filled:!0},text:{font:Imn,color:sf,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:sf,stroke:null}},arc:{fill:sf},shape:{stroke:sf},symbol:{fill:sf,size:30}},xx="#3366CC",xTe="#ccc",_N="Arial, sans-serif",$mn={arc:{fill:xx},area:{fill:xx},path:{stroke:xx},rect:{fill:xx},shape:{stroke:xx},symbol:{stroke:xx},circle:{fill:xx},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:_N,fontSize:12},"guide-title":{font:_N,fontSize:12},"group-title":{font:_N,fontSize:12}},title:{font:_N,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:xTe,tickColor:xTe,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},xpe=e=>e*(1/3+1),wTe=xpe(9),STe=xpe(10),_Te=xpe(12),n2="Segoe UI",CTe="wf_standard-font, helvetica, arial, sans-serif",OTe="#252423",r2="#605E5C",ETe="transparent",Nmn="#C8C6C4",Id="#118DFF",zmn="#12239E",jmn="#E66C37",Bmn="#6B007B",Umn="#E044A7",Vmn="#744EC2",Wmn="#D9B300",Hmn="#D64550",pKe=Id,gKe="#DEEFFF",TTe=[gKe,pKe],Gmn=[gKe,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",pKe],qmn={view:{stroke:ETe},background:ETe,font:n2,header:{titleFont:CTe,titleFontSize:_Te,titleColor:OTe,labelFont:n2,labelFontSize:STe,labelColor:r2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:r2,labelFontSize:wTe,titleFont:CTe,titleColor:OTe,titleFontSize:_Te,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Nmn,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Id},line:{stroke:Id,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:n2,fontSize:wTe,fill:r2},arc:{fill:Id},area:{fill:Id,line:!0,opacity:.6},path:{stroke:Id},rect:{fill:Id},point:{fill:Id,filled:!0,size:75},shape:{stroke:Id},symbol:{fill:Id,strokeWidth:1.5,size:50},legend:{titleFont:n2,titleFontWeight:"bold",titleColor:r2,labelFont:n2,labelFontSize:STe,labelColor:r2,symbolType:"circle",symbolSize:75},range:{category:[Id,zmn,jmn,Bmn,Umn,Vmn,Wmn,Hmn],diverging:TTe,heatmap:TTe,ordinal:Gmn}},fq='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Xmn='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',dq=400,CN={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Ymn=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Qmn=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function T8({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",r=CN.gridBg[e],i=CN.textPrimary[e],o=CN.textSecondary[e],s=n==="dark"?Ymn:Qmn,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:fq,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:Xmn,labelFontWeight:dq,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:CN.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:fq,fill:o,fontWeight:dq},"guide-title":{font:fq,fill:o,fontWeight:dq}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Kmn=T8({theme:"white",background:"#ffffff"}),Zmn=T8({theme:"g10",background:"#f4f4f4"}),Jmn=T8({theme:"g90",background:"#262626"}),evn=T8({theme:"g100",background:"#161616"}),tvn=bmn.version,mKe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Zmn,carbong100:evn,carbong90:Jmn,carbonwhite:Kmn,dark:xmn,excel:wmn,fivethirtyeight:Cmn,ggplot2:Omn,googlecharts:$mn,latimes:kmn,powerbi:qmn,quartz:Mmn,urbaninstitute:Fmn,version:tvn,vox:Amn},Symbol.toStringTag,{value:"Module"}));function nvn(e,t,n,r){if(it(e))return`[${e.map(i=>t(Ut(i)?i:PTe(i,n))).join(", ")}]`;if(Bt(e)){let i="";const{title:o,image:s,...a}=e;o&&(i+=`

${t(o)}

`),s&&(i+=``);const l=Object.keys(a);if(l.length>0){i+="";for(const c of l){let u=a[c];u!==void 0&&(Bt(u)&&(u=PTe(u,n)),i+=``)}i+="
${t(c)}${t(u)}
"}return i||"{}"}return t(e)}function rvn(e){const t=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}function PTe(e,t){return JSON.stringify(e,rvn(t))}var ivn=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -334,241 +333,276 @@ return result$$;`.replaceAll("$$",String(SSe)));return SSe+=1,(a,l)=>o(i,a,l)},E /* The default theme is the light theme. */ background-color: rgba(255, 255, 255, 0.95); border: 1px solid #d9d9d9; - color: black; } - #vg-tooltip-element.visible { - visibility: visible; } - #vg-tooltip-element h2 { - margin-top: 0; - margin-bottom: 10px; - font-size: 13px; } - #vg-tooltip-element table { - border-spacing: 0; } - #vg-tooltip-element table tr { - border: none; } - #vg-tooltip-element table tr td { - overflow: hidden; - text-overflow: ellipsis; - padding-top: 2px; - padding-bottom: 2px; } - #vg-tooltip-element table tr td.key { - color: #808080; - max-width: 150px; - text-align: right; - padding-right: 4px; } - #vg-tooltip-element table tr td.value { - display: block; - max-width: 300px; - max-height: 7em; - text-align: left; } - #vg-tooltip-element.dark-theme { - background-color: rgba(32, 32, 32, 0.9); - border: 1px solid #f5f5f5; - color: white; } - #vg-tooltip-element.dark-theme td.key { - color: #bfbfbf; } -`,MJe="vg-tooltip-element",J0n={offsetX:10,offsetY:10,id:MJe,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:ebn,maxDepth:2};function ebn(e){return String(e).replace(/&/g,"&").replace(/function(t){return t[e]},ibn=e=>{const t=e.length;return function(n){for(let r=0;rs?c():s=a+1:l==="["?(a>s&&c(),i=s=a+1):l==="]"&&(i||PX("Access path missing open bracket: "+e),i>0&&c(),i=0,s=a+1)}return i&&PX("Access path missing closing bracket: "+e),r&&PX("Access path missing closing quote: "+e),a>s&&(a++,c()),t}function sbn(e,t,n){const r=obn(e);return e=r.length===1?r[0]:e,gP(nbn(r),[e],e)}sbn("id");gP(e=>e,[],"identity");gP(()=>0,[],"zero");gP(()=>1,[],"one");gP(()=>!0,[],"true");gP(()=>!1,[],"false");new Set(Object.getOwnPropertyNames(Object.prototype));var AJe=Array.isArray;function l4(e){return e===Object(e)}const Pke=e=>e!=="__proto__";function RJe(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const o in i)if(o==="signals")r.signals=abn(r.signals,i.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;IJe(r,o,i[o],s)}return r},{})}function IJe(e,t,n,r){if(!Pke(t))return;let i,o;if(l4(n)&&!AJe(n)){o=l4(e[t])?e[t]:e[t]={};for(i in n)r&&(r===!0||r[i])?IJe(o,i,n[i]):Pke(i)&&(o[i]=n[i])}else e[t]=n}function abn(e,t){if(e==null)return t;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return t.forEach(i),e.forEach(i),r}function lbn(e){return typeof e=="boolean"}function c4(e){return typeof e=="string"}var cbn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);it(c4(r)?r:kke(r,n))).join(", ")}]`;if(l4(e)){let r="";const i=e,{title:o}=i,s=cbn(i,["title"]);o&&(r+=`

${t(o)}

`);const a=Object.keys(s);if(a.length>0){r+="";for(const l of a){let c=s[l];c!==void 0&&(l4(c)&&(c=kke(c,n)),r+=``)}r+="
${t(l)}:${t(c)}
"}return r||"{}"}return t(e)}function fbn(e){const t=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}function kke(e,t){return JSON.stringify(e,fbn(t))}function dbn(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}class hbn{constructor(t){this.options=Object.assign(Object.assign({},J0n),t);const n=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=tbn(n);const i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}this.el=document.getElementById(n),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",n),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}tooltipHandler(t,n,r,i){if(i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=ubn(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=dbn(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${s}px; left: ${o}px`)}}function pbn(e,t,n){const r=e.open(t),i=250;let o=40;function s(l){l.source===r&&(o=0,e.removeEventListener("message",s,!1))}e.addEventListener("message",s,!1);function a(){o<=0||(r.postMessage(n,"*"),setTimeout(a,i),o-=1)}setTimeout(a,i)}const gbn=`.vega-embed { + color: black; +} +#vg-tooltip-element.visible { + visibility: visible; +} +#vg-tooltip-element h2 { + margin-top: 0; + margin-bottom: 10px; + font-size: 13px; +} +#vg-tooltip-element table { + border-spacing: 0; +} +#vg-tooltip-element table tr { + border: none; +} +#vg-tooltip-element table tr td { + overflow: hidden; + text-overflow: ellipsis; + padding-top: 2px; + padding-bottom: 2px; +} +#vg-tooltip-element table tr td.key { + color: #808080; + max-width: 150px; + text-align: right; + padding-right: 4px; +} +#vg-tooltip-element table tr td.value { + display: block; + max-width: 300px; + max-height: 7em; + text-align: left; +} +#vg-tooltip-element.dark-theme { + background-color: rgba(32, 32, 32, 0.9); + border: 1px solid #f5f5f5; + color: white; +} +#vg-tooltip-element.dark-theme td.key { + color: #bfbfbf; +} +`;const vKe="vg-tooltip-element",ovn={offsetX:10,offsetY:10,id:vKe,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:svn,maxDepth:2,formatTooltip:nvn,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function svn(e){return String(e).replace(/&/g,"&").replace(/=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function uvn(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class fvn{call;options;el;constructor(t){this.options={...ovn,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=avn(n);const i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}}tooltipHandler(t,n,r,i){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=this.options.anchor==="mark"?lvn(t,n,r,this.el.getBoundingClientRect(),this.options):yKe(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var hq={};var dvn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),hvn=Object.prototype.hasOwnProperty;function wre(e,t){return hvn.call(e,t)}function Sre(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Nx(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function wKe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Cre(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&l[u-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[h]===void 0?d=l.slice(0,u).join("/"):u==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),u++,Array.isArray(c)){if(h==="-")h=c.length;else{if(n&&!_re(h))throw new No("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);_re(h)&&(h=~~h)}if(u>=f){if(n&&t.op==="add"&&h>c.length)throw new No("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var s=gvn[t.op].call(t,c,h,e);if(s.test===!1)throw new No("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(u>=f){var s=jC[t.op].call(t,c,h,e);if(s.test===!1)throw new No("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(c=c[h],n&&u0)throw new No('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new No("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new No("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Cre(e.value))throw new No("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new No("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new No("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var s={op:"_get",path:e.from,value:void 0},a=_Ke([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new No("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new No("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function _Ke(e,t,n){try{if(!Array.isArray(e))throw new No("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)P8(Ou(t),Ou(e),n||!0);else{n=n||NB;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function Spe(e,t,n,r,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=Sre(t),s=Sre(e),a=!1,l=s.length-1;l>=0;l--){var c=s[l],u=e[c];if(wre(t,c)&&!(t[c]===void 0&&u!==void 0&&Array.isArray(t)===!1)){var f=t[c];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?Spe(u,f,n,r+"/"+Nx(c),i):u!==f&&(i&&n.push({op:"test",path:r+"/"+Nx(c),value:Ou(u)}),n.push({op:"replace",path:r+"/"+Nx(c),value:Ou(f)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+Nx(c),value:Ou(u)}),n.push({op:"remove",path:r+"/"+Nx(c)}),a=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!a&&o.length==s.length))for(var l=0;l=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,r)}return this}}return pq=e,pq}var gq,ATe;function _pe(){if(ATe)return gq;ATe=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return gq=r=>r?typeof r!="object"?e:r:t,gq}var ON={exports:{}},mq,RTe;function Cpe(){if(RTe)return mq;RTe=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=t-6;return mq={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},mq}var vq,ITe;function k8(){return ITe||(ITe=1,vq=typeof process=="object"&&hq&&hq.NODE_DEBUG&&/\bsemver\b/i.test(hq.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),vq}var DTe;function Ope(){return DTe||(DTe=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Cpe(),o=k8();t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],c=t.safeSrc=[],u=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[d,r]],p=m=>{for(const[v,y]of h)m=m.split(`${v}*`).join(`${v}{0,${y}}`).split(`${v}+`).join(`${v}{1,${y}}`);return m},g=(m,v,y)=>{const b=p(v),w=f++;o(m,w,v),u[m]=w,l[w]=v,c[w]=b,s[w]=new RegExp(v,y?"g":void 0),a[w]=new RegExp(b,y?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),g("FULL",`^${l[u.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),g("LOOSE",`^${l[u.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),g("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[u.COERCE],!0),g("COERCERTLFULL",l[u.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ON,ON.exports)),ON.exports}var yq,LTe;function kvn(){if(LTe)return yq;LTe=1;const e=/^[0-9]+$/,t=(r,i)=>{const o=e.test(r),s=e.test(i);return o&&s&&(r=+r,i=+i),r===i?0:o&&!s?-1:s&&!o?1:rt(i,r)},yq}var bq,FTe;function Epe(){if(FTe)return bq;FTe=1;const e=k8(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Cpe(),{safeRe:r,t:i}=Ope(),o=_pe(),{compareIdentifiers:s}=kvn();class a{constructor(c,u){if(u=o(u),c instanceof a){if(c.loose===!!u.loose&&c.includePrerelease===!!u.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=c.trim().match(u.loose?r[i.LOOSE]:r[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(u){let h=[u,d];f===!1&&(h=[u]),s(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return bq=a,bq}var xq,$Te;function lP(){if($Te)return xq;$Te=1;const e=Epe();return xq=(n,r,i)=>new e(n,i).compare(new e(r,i)),xq}var wq,NTe;function Mvn(){if(NTe)return wq;NTe=1;const e=lP();return wq=(n,r,i)=>e(n,r,i)===0,wq}var Sq,zTe;function Avn(){if(zTe)return Sq;zTe=1;const e=lP();return Sq=(n,r,i)=>e(n,r,i)!==0,Sq}var _q,jTe;function Rvn(){if(jTe)return _q;jTe=1;const e=lP();return _q=(n,r,i)=>e(n,r,i)>0,_q}var Cq,BTe;function Ivn(){if(BTe)return Cq;BTe=1;const e=lP();return Cq=(n,r,i)=>e(n,r,i)>=0,Cq}var Oq,UTe;function Dvn(){if(UTe)return Oq;UTe=1;const e=lP();return Oq=(n,r,i)=>e(n,r,i)<0,Oq}var Eq,VTe;function Lvn(){if(VTe)return Eq;VTe=1;const e=lP();return Eq=(n,r,i)=>e(n,r,i)<=0,Eq}var Tq,WTe;function Fvn(){if(WTe)return Tq;WTe=1;const e=Mvn(),t=Avn(),n=Rvn(),r=Ivn(),i=Dvn(),o=Lvn();return Tq=(a,l,c,u)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,u);case"!=":return t(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return i(a,c,u);case"<=":return o(a,c,u);default:throw new TypeError(`Invalid operator: ${l}`)}},Tq}var Pq,HTe;function $vn(){if(HTe)return Pq;HTe=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,f){if(f=n(f),u instanceof t){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return o(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||o(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||o(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Pq=t;const n=_pe(),{safeRe:r,t:i}=Ope(),o=Fvn(),s=k8(),a=Epe(),l=CKe();return Pq}var kq,GTe;function CKe(){if(GTe)return kq;GTe=1;const e=/\s+/g;class t{constructor(L,$){if($=i($),L instanceof t)return L.loose===!!$.loose&&L.includePrerelease===!!$.includePrerelease?L:new t(L.raw,$);if(L instanceof o)return this.raw=L.value,this.set=[[L]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=L.trim().replace(e," "),this.set=this.raw.split("||").map(j=>this.parseRange(j.trim())).filter(j=>j.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const j=this.set[0];if(this.set=this.set.filter(V=>!g(V[0])),this.set.length===0)this.set=[j];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&m(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let L=0;L0&&(this.formatted+="||");const $=this.set[L];for(let j=0;j<$.length;j++)j>0&&(this.formatted+=" "),this.formatted+=$[j].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(L){const j=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+L,V=r.get(j);if(V)return V;const U=this.options.loose,z=U?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];L=L.replace(z,R(this.options.includePrerelease)),s("hyphen replace",L),L=L.replace(l[c.COMPARATORTRIM],u),s("comparator trim",L),L=L.replace(l[c.TILDETRIM],f),s("tilde trim",L),L=L.replace(l[c.CARETTRIM],d),s("caret trim",L);let N=L.split(" ").map(Y=>y(Y,this.options)).join(" ").split(/\s+/).map(Y=>I(Y,this.options));U&&(N=N.filter(Y=>(s("loose invalid filter",Y,this.options),!!Y.match(l[c.COMPARATORLOOSE])))),s("range list",N);const B=new Map,H=N.map(Y=>new o(Y,this.options));for(const Y of H){if(g(Y))return[Y];B.set(Y.value,Y)}B.size>1&&B.has("")&&B.delete("");const Q=[...B.values()];return r.set(j,Q),Q}intersects(L,$){if(!(L instanceof t))throw new TypeError("a Range is required");return this.set.some(j=>v(j,$)&&L.set.some(V=>v(V,$)&&j.every(U=>V.every(z=>U.intersects(z,$)))))}test(L){if(!L)return!1;if(typeof L=="string")try{L=new a(L,this.options)}catch{return!1}for(let $=0;$A.value==="<0.0.0-0",m=A=>A.value==="",v=(A,L)=>{let $=!0;const j=A.slice();let V=j.pop();for(;$&&j.length;)$=j.every(U=>V.intersects(U,L)),V=j.pop();return $},y=(A,L)=>(s("comp",A,L),A=_(A,L),s("caret",A),A=w(A,L),s("tildes",A),A=T(A,L),s("xrange",A),A=P(A,L),s("stars",A),A),b=A=>!A||A.toLowerCase()==="x"||A==="*",w=(A,L)=>A.trim().split(/\s+/).map($=>S($,L)).join(" "),S=(A,L)=>{const $=L.loose?l[c.TILDELOOSE]:l[c.TILDE];return A.replace($,(j,V,U,z,N)=>{s("tilde",A,j,V,U,z,N);let B;return b(V)?B="":b(U)?B=`>=${V}.0.0 <${+V+1}.0.0-0`:b(z)?B=`>=${V}.${U}.0 <${V}.${+U+1}.0-0`:N?(s("replaceTilde pr",N),B=`>=${V}.${U}.${z}-${N} <${V}.${+U+1}.0-0`):B=`>=${V}.${U}.${z} <${V}.${+U+1}.0-0`,s("tilde return",B),B})},_=(A,L)=>A.trim().split(/\s+/).map($=>E($,L)).join(" "),E=(A,L)=>{s("caret",A,L);const $=L.loose?l[c.CARETLOOSE]:l[c.CARET],j=L.includePrerelease?"-0":"";return A.replace($,(V,U,z,N,B)=>{s("caret",A,V,U,z,N,B);let H;return b(U)?H="":b(z)?H=`>=${U}.0.0${j} <${+U+1}.0.0-0`:b(N)?U==="0"?H=`>=${U}.${z}.0${j} <${U}.${+z+1}.0-0`:H=`>=${U}.${z}.0${j} <${+U+1}.0.0-0`:B?(s("replaceCaret pr",B),U==="0"?z==="0"?H=`>=${U}.${z}.${N}-${B} <${U}.${z}.${+N+1}-0`:H=`>=${U}.${z}.${N}-${B} <${U}.${+z+1}.0-0`:H=`>=${U}.${z}.${N}-${B} <${+U+1}.0.0-0`):(s("no pr"),U==="0"?z==="0"?H=`>=${U}.${z}.${N}${j} <${U}.${z}.${+N+1}-0`:H=`>=${U}.${z}.${N}${j} <${U}.${+z+1}.0-0`:H=`>=${U}.${z}.${N} <${+U+1}.0.0-0`),s("caret return",H),H})},T=(A,L)=>(s("replaceXRanges",A,L),A.split(/\s+/).map($=>k($,L)).join(" ")),k=(A,L)=>{A=A.trim();const $=L.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return A.replace($,(j,V,U,z,N,B)=>{s("xRange",A,j,V,U,z,N,B);const H=b(U),Q=H||b(z),Y=Q||b(N),Z=Y;return V==="="&&Z&&(V=""),B=L.includePrerelease?"-0":"",H?V===">"||V==="<"?j="<0.0.0-0":j="*":V&&Z?(Q&&(z=0),N=0,V===">"?(V=">=",Q?(U=+U+1,z=0,N=0):(z=+z+1,N=0)):V==="<="&&(V="<",Q?U=+U+1:z=+z+1),V==="<"&&(B="-0"),j=`${V+U}.${z}.${N}${B}`):Q?j=`>=${U}.0.0${B} <${+U+1}.0.0-0`:Y&&(j=`>=${U}.${z}.0${B} <${U}.${+z+1}.0-0`),s("xRange return",j),j})},P=(A,L)=>(s("replaceStars",A,L),A.trim().replace(l[c.STAR],"")),I=(A,L)=>(s("replaceGTE0",A,L),A.trim().replace(l[L.includePrerelease?c.GTE0PRE:c.GTE0],"")),R=A=>(L,$,j,V,U,z,N,B,H,Q,Y,Z)=>(b(j)?$="":b(V)?$=`>=${j}.0.0${A?"-0":""}`:b(U)?$=`>=${j}.${V}.0${A?"-0":""}`:z?$=`>=${$}`:$=`>=${$}${A?"-0":""}`,b(H)?B="":b(Q)?B=`<${+H+1}.0.0-0`:b(Y)?B=`<${H}.${+Q+1}.0-0`:Z?B=`<=${H}.${Q}.${Y}-${Z}`:A?B=`<${H}.${Q}.${+Y+1}-0`:B=`<=${B}`,`${$} ${B}`.trim()),F=(A,L,$)=>{for(let j=0;j0){const V=A[j].semver;if(V.major===L.major&&V.minor===L.minor&&V.patch===L.patch)return!0}return!1}return!0};return kq}var Mq,qTe;function Nvn(){if(qTe)return Mq;qTe=1;const e=CKe();return Mq=(n,r,i)=>{try{r=new e(r,i)}catch{return!1}return r.test(n)},Mq}var zvn=Nvn(),OKe=Tvn(zvn);function jvn(e,t,n){const r=e.open(t),i=250,{origin:o}=new URL(t);let s=40;function a(c){c.source===r&&(s=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function l(){s<=0||(r.postMessage(n,o),setTimeout(l,i),s-=1)}setTimeout(l,i)}var Bvn=`.vega-embed { position: relative; - display: inline-block; } - .vega-embed.has-actions { - padding-right: 38px; } - .vega-embed details:not([open]) > :not(summary) { - display: none !important; } - .vega-embed summary { - list-style: none; - position: absolute; - top: 0; - right: 0; - padding: 6px; - z-index: 1000; - background: white; - box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); - color: #1b1e23; - border: 1px solid #aaa; - border-radius: 999px; - opacity: 0.2; - transition: opacity 0.4s ease-in; - outline: none; - cursor: pointer; - line-height: 0px; } - .vega-embed summary::-webkit-details-marker { - display: none; } - .vega-embed summary:active { - box-shadow: #aaa 0px 0px 0px 1px inset; } - .vega-embed summary svg { - width: 14px; - height: 14px; } - .vega-embed details[open] summary { - opacity: 0.7; } - .vega-embed:hover summary, - .vega-embed:focus summary { - opacity: 1 !important; - transition: opacity 0.2s ease; } - .vega-embed .vega-actions { - position: absolute; - z-index: 1001; - top: 35px; - right: -9px; - display: flex; - flex-direction: column; - padding-bottom: 8px; - padding-top: 8px; - border-radius: 4px; - box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2); - border: 1px solid #d9d9d9; - background: white; - animation-duration: 0.15s; - animation-name: scale-in; - animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); - text-align: left; } - .vega-embed .vega-actions a { - padding: 8px 16px; - font-family: sans-serif; - font-size: 14px; - font-weight: 600; - white-space: nowrap; - color: #434a56; - text-decoration: none; } - .vega-embed .vega-actions a:hover { - background-color: #f7f7f9; - color: black; } - .vega-embed .vega-actions::before, .vega-embed .vega-actions::after { - content: ""; - display: inline-block; - position: absolute; } - .vega-embed .vega-actions::before { - left: auto; - right: 14px; - top: -16px; - border: 8px solid #0000; - border-bottom-color: #d9d9d9; } - .vega-embed .vega-actions::after { - left: auto; - right: 15px; - top: -14px; - border: 7px solid #0000; - border-bottom-color: #fff; } + display: inline-block; + box-sizing: border-box; +} +.vega-embed.has-actions { + padding-right: 38px; +} +.vega-embed details:not([open]) > :not(summary) { + display: none !important; +} +.vega-embed summary { + list-style: none; + position: absolute; + top: 0; + right: 0; + padding: 6px; + z-index: 1000; + background: white; + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); + color: #1b1e23; + border: 1px solid #aaa; + border-radius: 999px; + opacity: 0.2; + transition: opacity 0.4s ease-in; + cursor: pointer; + line-height: 0px; +} +.vega-embed summary::-webkit-details-marker { + display: none; +} +.vega-embed summary:active { + box-shadow: #aaa 0px 0px 0px 1px inset; +} +.vega-embed summary svg { + width: 14px; + height: 14px; +} +.vega-embed details[open] summary { + opacity: 0.7; +} +.vega-embed:hover summary, .vega-embed:focus-within summary { + opacity: 1 !important; + transition: opacity 0.2s ease; +} +.vega-embed .vega-actions { + position: absolute; + z-index: 1001; + top: 35px; + right: -9px; + display: flex; + flex-direction: column; + padding-bottom: 8px; + padding-top: 8px; + border-radius: 4px; + box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2); + border: 1px solid #d9d9d9; + background: white; + animation-duration: 0.15s; + animation-name: scale-in; + animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); + text-align: left; +} +.vega-embed .vega-actions a { + padding: 8px 16px; + font-family: sans-serif; + font-size: 14px; + font-weight: 600; + white-space: nowrap; + color: #434a56; + text-decoration: none; +} +.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus { + background-color: #f7f7f9; + color: black; +} +.vega-embed .vega-actions::before, .vega-embed .vega-actions::after { + content: ""; + display: inline-block; + position: absolute; +} +.vega-embed .vega-actions::before { + left: auto; + right: 14px; + top: -16px; + border: 8px solid rgba(0, 0, 0, 0); + border-bottom-color: #d9d9d9; +} +.vega-embed .vega-actions::after { + left: auto; + right: 15px; + top: -14px; + border: 7px solid rgba(0, 0, 0, 0); + border-bottom-color: #fff; +} +.vega-embed .chart-wrapper.fit-x { + width: 100%; +} +.vega-embed .chart-wrapper.fit-y { + height: 100%; +} .vega-embed-wrapper { max-width: 100%; - overflow: scroll; - padding-right: 14px; } + overflow: auto; + padding-right: 14px; +} @keyframes scale-in { from { opacity: 0; - transform: scale(0.6); } + transform: scale(0.6); + } to { opacity: 1; - transform: scale(1); } } -`;String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e});function DJe(e,...t){for(const n of t)mbn(e,n);return e}function mbn(e,t){for(const n of Object.keys(t))GT(e,n,t[n],!0)}var kX;const s0=Aun;let DR=u0n;const BN=typeof window<"u"?window:void 0;DR===void 0&&(!((kX=BN?.vl)===null||kX===void 0)&&kX.compile)&&(DR=BN.vl);const vbn={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},ybn={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},OM={vega:"Vega","vega-lite":"Vega-Lite"},u4={vega:s0.version,"vega-lite":DR?DR.version:"not available"},bbn={vega:e=>e,"vega-lite":(e,t)=>DR.compile(e,{config:t}).spec},xbn=` + transform: scale(1); + } +} +`;function EKe(e,...t){for(const n of t)Uvn(e,n);return e}function Uvn(e,t){for(const n of Object.keys(t))NT(e,n,t[n],!0)}const Zh=_an;let _R=vmn;const XTe=typeof window<"u"?window:void 0;_R===void 0&&XTe?.vl?.compile&&(_R=XTe.vl);const Vvn={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Wvn={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},gM={vega:"Vega","vega-lite":"Vega-Lite"},zB={vega:Zh.version,"vega-lite":_R?_R.version:"not available"},Hvn={vega:e=>e,"vega-lite":(e,t,n)=>_R.compile(e,{config:n,logger:t}).spec},Gvn=` -`;function wbn(e){return typeof e=="function"}function Mke(e,t,n,r){const i=`${t}
`,o=`
${n}`,s=window.open("");s.document.write(i+e+o),s.document.title=`${OM[r]} JSON Source`}function Sbn(e,t){var n;if(e.$schema){const r=TJe(e.$schema);t&&t!==r.library&&console.warn(`The given visualization spec is written in ${OM[r.library]}, but mode argument sets ${(n=OM[t])!==null&&n!==void 0?n:t}.`);const i=r.library;return U8e.satisfies(u4[i],`^${r.version.slice(1)}`)||console.warn(`The input spec uses ${OM[i]} ${r.version}, but the current version of ${OM[i]} is v${u4[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function _bn(e){return!!(e&&"load"in e)}function Cbn(e,t,n={}){var r,i,o;return Ej(this,void 0,void 0,function*(){const s=_bn(n.loader)?n.loader:s0.loader(n.loader),a=c4(t)?JSON.parse(yield s.load(t)):t,l=yield Ake((r=a.usermeta&&a.usermeta.embedOptions)!==null&&r!==void 0?r:{},s),c=yield Ake(n,s),u=Object.assign(Object.assign({},DJe(c,l)),{config:RJe((i=c.config)!==null&&i!==void 0?i:{},(o=l.config)!==null&&o!==void 0?o:{})});return yield Obn(e,a,u,s)})}function Ake(e,t){var n;return Ej(this,void 0,void 0,function*(){const r=c4(e.config)?JSON.parse(yield t.load(e.config)):(n=e.config)!==null&&n!==void 0?n:{},i=c4(e.patch)?JSON.parse(yield t.load(e.patch)):e.patch;return Object.assign(Object.assign(Object.assign({},e),i?{patch:i}:{}),r?{config:r}:{})})}function Obn(e,t,n={},r){var i,o,s,a,l,c;return Ej(this,void 0,void 0,function*(){const u=n.theme?RJe(K0n[n.theme],(i=n.config)!==null&&i!==void 0?i:{}):n.config,f=lbn(n.actions)?n.actions:DJe({},vbn,(o=n.actions)!==null&&o!==void 0?o:{}),d=Object.assign(Object.assign({},ybn),n.i18n),h=(s=n.renderer)!==null&&s!==void 0?s:"canvas",p=(a=n.logLevel)!==null&&a!==void 0?a:s0.Warn,g=(l=n.downloadFileName)!==null&&l!==void 0?l:"visualization";if(n.defaultStyle!==!1){const k="vega-embed-style";if(!document.getElementById(k)){const P=document.createElement("style");P.id=k,P.innerText=n.defaultStyle===void 0||n.defaultStyle===!0?gbn.toString():n.defaultStyle,document.head.appendChild(P)}}const m=Sbn(t,n.mode);let v=bbn[m](t,u);if(m==="vega-lite"&&v.$schema){const k=TJe(v.$schema);U8e.satisfies(u4.vega,`^${k.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${k.version}, but current version is v${u4.vega}.`)}const y=typeof e=="string"?document.querySelector(e):e;if(!y)throw Error(`${e} does not exist`);y.classList.add("vega-embed"),f&&y.classList.add("has-actions"),y.innerHTML="";const b=n.patch;b&&(b instanceof Function?v=b(v):v=UU(v,b,!0,!1).newDocument),n.formatLocale&&s0.formatLocale(n.formatLocale),n.timeFormatLocale&&s0.timeFormatLocale(n.timeFormatLocale);const w=s0.parse(v,m==="vega-lite"?{}:u),S=new s0.View(w,{loader:r,logLevel:p,renderer:h});if(n.tooltip!==!1){let k;wbn(n.tooltip)?k=n.tooltip:k=new hbn(n.tooltip===!0?{}:n.tooltip).call,S.tooltip(k)}let{hover:_}=n;if(_===void 0&&(_=m==="vega"),_){const{hoverSet:k,updateSet:P}=typeof _=="boolean"?{}:_;S.hover(k,P)}n&&(n.width!=null&&S.width(n.width),n.height!=null&&S.height(n.height),n.padding!=null&&S.padding(n.padding)),yield S.initialize(e).runAsync();let E;if(f!==!1){let k=y;if(n.defaultStyle!==!1){const R=document.createElement("details");R.title=d.CLICK_TO_VIEW_ACTIONS,y.append(R),k=R;const I=document.createElement("summary");I.innerHTML=xbn,R.append(I),E=F=>{R.contains(F.target)||R.removeAttribute("open")},document.addEventListener("click",E)}const P=document.createElement("div");if(k.append(P),P.classList.add("vega-actions"),f===!0||f.export!==!1){for(const R of["svg","png"])if(f===!0||f.export===!0||f.export[R]){const I=d[`${R.toUpperCase()}_ACTION`],F=document.createElement("a");F.text=I,F.href="#",F.target="_blank",F.download=`${g}.${R}`,F.addEventListener("mousedown",function(A){return Ej(this,void 0,void 0,function*(){A.preventDefault();const L=yield S.toImageURL(R,n.scaleFactor);this.href=L})}),P.append(F)}}if(f===!0||f.source!==!1){const R=document.createElement("a");R.text=d.SOURCE_ACTION,R.href="#",R.addEventListener("mousedown",function(I){var F,A;Mke(f7(t),(F=n.sourceHeader)!==null&&F!==void 0?F:"",(A=n.sourceFooter)!==null&&A!==void 0?A:"",m),I.preventDefault()}),P.append(R)}if(m==="vega-lite"&&(f===!0||f.compiled!==!1)){const R=document.createElement("a");R.text=d.COMPILED_ACTION,R.href="#",R.addEventListener("mousedown",function(I){var F,A;Mke(f7(v),(F=n.sourceHeader)!==null&&F!==void 0?F:"",(A=n.sourceFooter)!==null&&A!==void 0?A:"","vega"),I.preventDefault()}),P.append(R)}if(f===!0||f.editor!==!1){const R=(c=n.editorUrl)!==null&&c!==void 0?c:"https://vega.github.io/editor/",I=document.createElement("a");I.text=d.EDITOR_ACTION,I.href="#",I.addEventListener("mousedown",function(F){pbn(window,R,{config:u,mode:m,renderer:h,spec:f7(t)}),F.preventDefault()}),P.append(I)}}function T(){E&&document.removeEventListener("click",E),S.finalize()}return{view:S,spec:t,vgSpec:v,finalize:T}})}function Ebn(e){return!!e&&{}.toString.call(e)==="[object Function]"}function Tbn(e,t,n){n&&(Ebn(n)?n(e.data(t)):e.change(t,s0.changeset().remove(()=>!0).insert(n)))}function Pbn(e,t){Object.keys(t).forEach(n=>{Tbn(e,n,t[n])})}function LJe(e){const t=new Set;return e.forEach(n=>{Object.keys(n).forEach(r=>{t.add(r)})}),t}const FJe=()=>{};function MX(e,t){const n=Object.keys(t);return n.forEach(r=>{try{e.addSignalListener(r,t[r])}catch(i){console.warn("Cannot add invalid signal listener.",i)}}),n.length>0}var AX,Rke;function kbn(){return Rke||(Rke=1,AX=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n}),AX}var Mbn=kbn();const Abn=Vn(Mbn);function Rbn(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},r=LJe([e,t]);return r.has("width")&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r.has("height")&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),r.delete("width"),r.delete("height"),[...r].some(i=>!(i in e)||!(i in t)||!Abn(e[i],t[i]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function Ike(e,t){const n=Object.keys(t);return n.forEach(r=>{try{e.removeSignalListener(r,t[r])}catch(i){console.warn("Cannot remove invalid signal listener.",i)}}),n.length>0}function RX(e){const{spec:t,width:n,height:r}=e;return typeof n<"u"&&typeof r<"u"?{...t,width:n,height:r}:typeof n<"u"?{...t,width:n}:typeof r<"u"?{...t,height:r}:t}function EM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class $Je extends Te.PureComponent{constructor(){super(...arguments),EM(this,"containerRef",Te.createRef()),EM(this,"resultPromise",void 0),EM(this,"handleError",t=>{const{onError:n=FJe}=this.props;n(t,this.containerRef.current),console.warn(t)}),EM(this,"modifyView",t=>{this.resultPromise&&this.resultPromise.then(n=>(n&&t(n.view),!0)).catch(this.handleError)})}componentDidMount(){this.createView()}componentDidUpdate(t){const n=LJe([this.props,t]);if(n.delete("className"),n.delete("signalListeners"),n.delete("spec"),n.delete("style"),n.delete("width"),n.delete("height"),Array.from(n).some(r=>this.props[r]!==t[r]))this.clearView(),this.createView();else{const r=Rbn(RX(this.props),RX(t)),{signalListeners:i}=this.props,{signalListeners:o}=t;if(r)if(r.isExpensive)this.clearView(),this.createView();else{const s=!gne(i,o);this.modifyView(a=>{r.width!==!1&&a.width(r.width),r.height!==!1&&a.height(r.height),s&&(o&&Ike(a,o),i&&MX(a,i)),a.run()})}else gne(i,o)||this.modifyView(s=>{o&&Ike(s,o),i&&MX(s,i),s.run()})}}componentWillUnmount(){this.clearView()}createView(){const{spec:t,onNewView:n,signalListeners:r={},width:i,height:o,...s}=this.props;if(this.containerRef.current){const a=RX(this.props);this.resultPromise=Cbn(this.containerRef.current,a,s).then(l=>{if(l){const{view:c}=l;MX(c,r)&&c.run()}return l}).catch(this.handleError),n&&this.modifyView(n)}}clearView(){return this.resultPromise&&this.resultPromise.then(t=>{t&&t.finalize()}).catch(this.handleError),this.resultPromise=void 0,this}render(){const{className:t,style:n}=this.props;return Te.createElement("div",{ref:this.containerRef,className:t,style:n})}}EM($Je,"propTypes",{className:le.string,onError:le.func});function kie(){return kie=Object.assign||function(e){for(var t=1;t{this.update();const{onNewView:n=FJe}=this.props;n(t)})}componentDidMount(){this.update()}componentDidUpdate(t){gne(this.props.data,t.data)||this.update()}update(){const{data:t}=this.props;this.vegaEmbed.current&&t&&Object.keys(t).length>0&&this.vegaEmbed.current.modifyView(n=>{Pbn(n,t),n.resize().run()})}render(){const{data:t,...n}=this.props;return Te.createElement($Je,kie({ref:this.vegaEmbed},n,{onNewView:this.handleNewView}))}}Mie(NJe,"defaultProps",{data:Ibn});function Aie(){return Aie=Object.assign||function(e){for(var t=1;te*(1/3+1),Vke=$ge(9),Wke=$ge(10),Hke=$ge(12),d2="Segoe UI",Gke="wf_standard-font, helvetica, arial, sans-serif",qke="#252423",h2="#605E5C",Xke="transparent",txn="#C8C6C4",Fd="#118DFF",nxn="#12239E",rxn="#E66C37",ixn="#6B007B",oxn="#E044A7",sxn="#744EC2",axn="#D9B300",lxn="#D64550",zJe=Fd,jJe="#DEEFFF",Yke=[jJe,zJe],cxn=[jJe,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",zJe],uxn={view:{stroke:Xke},background:Xke,font:d2,header:{titleFont:Gke,titleFontSize:Hke,titleColor:qke,labelFont:d2,labelFontSize:Wke,labelColor:h2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:h2,labelFontSize:Vke,titleFont:Gke,titleColor:qke,titleFontSize:Hke,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:txn,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Fd},line:{stroke:Fd,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:d2,fontSize:Vke,fill:h2},arc:{fill:Fd},area:{fill:Fd,line:!0,opacity:.6},path:{stroke:Fd},rect:{fill:Fd},point:{fill:Fd,filled:!0,size:75},shape:{stroke:Fd},symbol:{fill:Fd,strokeWidth:1.5,size:50},legend:{titleFont:d2,titleFontWeight:"bold",titleColor:h2,labelFont:d2,labelFontSize:Wke,labelColor:h2,symbolType:"circle",symbolSize:75},range:{category:[Fd,nxn,rxn,ixn,oxn,sxn,axn,lxn],diverging:Yke,heatmap:Yke,ordinal:cxn}},FX='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',fxn='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',$X=400,HN={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},dxn=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],hxn=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function nW({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",r=HN.gridBg[e],i=HN.textPrimary[e],o=HN.textSecondary[e],s=n==="dark"?dxn:hxn,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:FX,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:fxn,labelFontWeight:$X,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:HN.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:FX,fill:o,fontWeight:$X},"guide-title":{font:FX,fill:o,fontWeight:$X}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const pxn=nW({theme:"white",background:"#ffffff"}),gxn=nW({theme:"g10",background:"#f4f4f4"}),mxn=nW({theme:"g90",background:"#262626"}),vxn=nW({theme:"g100",background:"#161616"}),yxn=Fbn.version,bxn=Object.freeze(Object.defineProperty({__proto__:null,carbong10:gxn,carbong100:vxn,carbong90:mxn,carbonwhite:pxn,dark:$bn,excel:Nbn,fivethirtyeight:Bbn,ggplot2:Ubn,googlecharts:exn,latimes:Gbn,powerbi:uxn,quartz:qbn,urbaninstitute:Jbn,version:yxn,vox:Xbn},Symbol.toStringTag,{value:"Module"})),xxn=e=>Bp(e)&&(e.select==="point"||e.select==="interval"||Bp(e.select)&&(e.select.type==="point"||e.select.type==="interval")&&TD(e.select.on));function wxn(e,t,n,r){const i=M.useMemo(()=>{const s=[];return!e||!e.params?s:e.params.filter(xxn).reduce((a,l)=>(l.select==="point"?a.push(["click",l.name]):l.select==="interval"?a.push(["drag",l.name]):a.push([l.select.on,l.name]),a),s)},[e]),o=M.useCallback((s,a)=>{if(n)return r({componentType:t,id:n,property:s,value:a})},[n,r,t]);return M.useMemo(()=>{const s={click:o,drag:o},a={};return i.forEach(([l,c])=>{s[l]?a[c]=s[l]:console.warn(`The signal "${l}" is not yet supported in chartlets.js`)}),a},[i,o])}const Sxn=e=>!!e&&e in bxn,Qke=()=>window.matchMedia("(prefers-color-scheme: dark)").matches;function _xn(e){const t=y$t();return M.useMemo(()=>!e||e==="default"?t==="dark"||t==="system"&&Qke()?"dark":void 0:e==="system"?Qke()?"dark":void 0:Sxn(e)?e:void 0,[e,t])}function Cxn(){const e=M.useRef(null),[t,n]=M.useState(0),r=M.useCallback(i=>{if(e.current&&(e.current.disconnect(),e.current=null),i!==null){const o=new ResizeObserver(s=>{n(Date.now())});o.observe(i),e.current=o}},[]);return{containerSizeKey:t,containerCallbackRef:r}}function Oxn({type:e,id:t,style:n,theme:r,chart:i,onChange:o}){const s=wxn(i,e,t,o),a=_xn(r),{containerSizeKey:l,containerCallbackRef:c}=Cxn();return i?O.jsx("div",{id:"chart-container",ref:c,style:n,children:O.jsx(Dbn,{theme:a,spec:i,style:n,signalListeners:s,actions:!1},l)}):O.jsx("div",{id:t})}function Exn(){return{components:[["VegaChart",Oxn]]}}const Rie={selectedDatasetId:{type:"str | None",description:"The identifier of the currently selected dataset.",selector:RT},selectedDatasetTitle:{type:"str | None",description:"The title of the currently selected dataset.",selector:xce},selectedVariableName:{type:"str | None",description:"The name of the currently selected variable within the selected dataset.",selector:dS},selectedDataset2Id:{type:"str | None",description:"The identifier of the dataset that contains the pinned variable.",selector:vce},selectedDataset2Title:{type:"str | None",description:"The title of the dataset that contains the pinned variable.",selector:K6e},selectedVariable2Name:{type:"str | None",description:"The name of the pinned variable.",selector:yce},selectedPlaceGeometry:{type:"dict[str, Any] | None",description:"The geometry of the currently selected place in GeoJSON format.",selector:$Lt},selectedPlaceId:{type:"str | None",description:"The identifier of the currently selected place.",selector:hS},selectedPlaceGroup:{type:"list[dict[str, Any]]",description:"The list of dataset place group and user place groups.",selector:CD},selectedTimeLabel:{type:"str | None",description:"The currently selected UTC time using ISO format.",selector:gS},themeMode:{type:"str",description:'The appearance mode of the UI. Either "light" or "dark".',selector:e=>S4e(e.controlState.themeMode)}};function Txn(e){return{subscribe(t){return e.subscribe(t)},get(t){const n=Rie[t];if(n)return n.selector(e.getState())}}}const Pxn=!1,Kke=["http","https","mailto","tel"];function kxn(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}var NX,Zke;function Mxn(){return Zke||(Zke=1,NX=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}),NX}var Axn=Mxn();const BJe=Vn(Axn);function fA(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jke(e.position):"start"in e||"end"in e?Jke(e):"line"in e||"column"in e?Iie(e):""}function Iie(e){return e2e(e&&e.line)+":"+e2e(e&&e.column)}function Jke(e){return Iie(e&&e.start)+"-"+Iie(e&&e.end)}function e2e(e){return e&&typeof e=="number"?e:1}class gd extends Error{constructor(t,n,r){const i=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const s=r.indexOf(":");s===-1?i[1]=r:(i[0]=r.slice(0,s),i[1]=r.slice(s+1))}n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=fA(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}gd.prototype.file="";gd.prototype.name="";gd.prototype.reason="";gd.prototype.message="";gd.prototype.stack="";gd.prototype.fatal=null;gd.prototype.column=null;gd.prototype.line=null;gd.prototype.source=null;gd.prototype.ruleId=null;gd.prototype.position=null;const tp={basename:Rxn,dirname:Ixn,extname:Dxn,join:Lxn,sep:"/"};function Rxn(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');DL(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.charCodeAt(i)===t.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Ixn(e){if(DL(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function Dxn(e){DL(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.charCodeAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Lxn(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function $xn(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function DL(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Nxn={cwd:zxn};function zxn(){return"/"}function Die(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function jxn(e){if(typeof e=="string")e=new URL(e);else if(!Die(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Bxn(e)}function Bxn(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||e.call(c,d)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return UX=function l(){var c,u,f,d,h,p,g=arguments[0],m=1,v=arguments.length,y=!1;for(typeof g=="boolean"&&(y=g,g=arguments[1]||{},m=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});ms.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const qxn=WJe().freeze(),VJe={}.hasOwnProperty;function WJe(){const e=Hxn(),t=[];let n={},r,i=-1;return o.data=s,o.Parser=void 0,o.Compiler=void 0,o.freeze=a,o.attachers=t,o.use=l,o.parse=c,o.stringify=u,o.run=f,o.runSync=d,o.process=h,o.processSync=p,o;function o(){const g=WJe();let m=-1;for(;++m{if(_||!E||!T)S(_);else{const k=o.stringify(E,T);k==null||(Qxn(k)?T.value=k:T.result=k),S(_,T)}});function S(_,E){_||!E?b(_):y?y(E):m(null,E)}}}function p(g){let m;o.freeze(),VX("processSync",o.Parser),WX("processSync",o.Compiler);const v=p2(g);return o.process(v,y),a2e("processSync","process",m),v;function y(b){m=!0,n2e(b)}}}function o2e(e,t){return typeof e=="function"&&e.prototype&&(Xxn(e.prototype)||t in e.prototype)}function Xxn(e){let t;for(t in e)if(VJe.call(e,t))return!0;return!1}function VX(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function WX(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function HX(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function s2e(e){if(!Lie(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function a2e(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function p2(e){return Yxn(e)?e:new UJe(e)}function Yxn(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Qxn(e){return typeof e=="string"||BJe(e)}const Kxn={};function Zxn(e,t){const n=Kxn,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return HJe(e,r,i)}function HJe(e,t,n){if(Jxn(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return l2e(e.children,t,n)}return Array.isArray(e)?l2e(e,t,n):""}function l2e(e,t,n){const r=[];let i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Lu(e,e.length,0,t),e):t}const c2e={}.hasOwnProperty;function GJe(e){const t={};let n=-1;for(;++ns))return;const E=t.events.length;let T=E,k,P;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(k){P=t.events[T][1].end;break}k=!0}for(v(r),_=E;_b;){const S=n[w];t.containerState=S[1],S[0].exit.call(t,e)}n.length=b}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function u1n(e,t,n){return Nr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function d4(e){if(e===null||Wi(e)||Fw(e))return 1;if(rW(e))return 2}function iW(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),d=Object.assign({},e[n][1].start);f2e(f,-l),f2e(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:d},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=yf(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=yf(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=yf(c,iW(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=yf(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=yf(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Lu(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&_r(_)?Nr(e,y,"linePrefix",o+1)(_):y(_)}function y(_){return _===null||In(_)?e.check(h2e,g,w)(_):(e.enter("codeFlowValue"),b(_))}function b(_){return _===null||In(_)?(e.exit("codeFlowValue"),y(_)):(e.consume(_),b)}function w(_){return e.exit("codeFenced"),t(_)}function S(_,E,T){let k=0;return P;function P(L){return _.enter("lineEnding"),_.consume(L),_.exit("lineEnding"),R}function R(L){return _.enter("codeFencedFence"),_r(L)?Nr(_,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return L===a?(_.enter("codeFencedFenceSequence"),F(L)):T(L)}function F(L){return L===a?(k++,_.consume(L),F):k>=s?(_.exit("codeFencedFenceSequence"),_r(L)?Nr(_,A,"whitespace")(L):A(L)):T(L)}function A(L){return L===null||In(L)?(_.exit("codeFencedFence"),E(L)):T(L)}}}function S1n(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const GX={name:"codeIndented",tokenize:C1n},_1n={tokenize:O1n,partial:!0};function C1n(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Nr(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):In(c)?e.attempt(_1n,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||In(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function O1n(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):In(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Nr(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):In(s)?i(s):n(s)}}const E1n={name:"codeText",tokenize:k1n,resolve:T1n,previous:P1n};function T1n(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function KJe(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),d):v===null||v===32||v===41||f4(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(v))}function d(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(e.exit("chunkString"),e.exit(a),d(v)):v===null||v===60||In(v)?n(v):(e.consume(v),v===92?p:h)}function p(v){return v===60||v===62||v===92?(e.consume(v),h):h(v)}function g(v){return!u&&(v===null||v===41||Wi(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):u999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):In(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||In(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!_r(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function JJe(e,t,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(o),c(d))}function c(d){return d===s?(e.exit(o),l(s)):d===null?n(d):In(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Nr(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||In(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:u)}function f(d){return d===s||d===92?(e.consume(d),u):u(d)}}function dA(e,t){let n;return r;function r(i){return In(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_r(i)?Nr(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function fh(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const F1n={name:"definition",tokenize:N1n},$1n={tokenize:z1n,partial:!0};function N1n(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return ZJe.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=fh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return Wi(h)?dA(e,c)(h):c(h)}function c(h){return KJe(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt($1n,f,f)(h)}function f(h){return _r(h)?Nr(e,d,"whitespace")(h):d(h)}function d(h){return h===null||In(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function z1n(e,t,n){return r;function r(a){return Wi(a)?dA(e,i)(a):n(a)}function i(a){return JJe(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return _r(a)?Nr(e,s,"whitespace")(a):s(a)}function s(a){return a===null||In(a)?t(a):n(a)}}const j1n={name:"hardBreakEscape",tokenize:B1n};function B1n(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return In(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const U1n={name:"headingAtx",tokenize:W1n,resolve:V1n};function V1n(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Lu(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function W1n(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||Wi(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||In(u)?(e.exit("atxHeading"),t(u)):_r(u)?Nr(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Wi(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const H1n=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],g2e=["pre","script","style","textarea"],G1n={name:"htmlFlow",tokenize:Q1n,resolveTo:Y1n,concrete:!0},q1n={tokenize:Z1n,partial:!0},X1n={tokenize:K1n,partial:!0};function Y1n(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Q1n(e,t,n){const r=this;let i,o,s,a,l;return c;function c(H){return u(H)}function u(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),f}function f(H){return H===33?(e.consume(H),d):H===47?(e.consume(H),o=!0,g):H===63?(e.consume(H),i=3,r.interrupt?t:z):zl(H)?(e.consume(H),s=String.fromCharCode(H),m):n(H)}function d(H){return H===45?(e.consume(H),i=2,h):H===91?(e.consume(H),i=5,a=0,p):zl(H)?(e.consume(H),i=4,r.interrupt?t:z):n(H)}function h(H){return H===45?(e.consume(H),r.interrupt?t:z):n(H)}function p(H){const Q="CDATA[";return H===Q.charCodeAt(a++)?(e.consume(H),a===Q.length?r.interrupt?t:I:p):n(H)}function g(H){return zl(H)?(e.consume(H),s=String.fromCharCode(H),m):n(H)}function m(H){if(H===null||H===47||H===62||Wi(H)){const Q=H===47,Y=s.toLowerCase();return!Q&&!o&&g2e.includes(Y)?(i=1,r.interrupt?t(H):I(H)):H1n.includes(s.toLowerCase())?(i=6,Q?(e.consume(H),v):r.interrupt?t(H):I(H)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(H):o?y(H):b(H))}return H===45||dl(H)?(e.consume(H),s+=String.fromCharCode(H),m):n(H)}function v(H){return H===62?(e.consume(H),r.interrupt?t:I):n(H)}function y(H){return _r(H)?(e.consume(H),y):P(H)}function b(H){return H===47?(e.consume(H),P):H===58||H===95||zl(H)?(e.consume(H),w):_r(H)?(e.consume(H),b):P(H)}function w(H){return H===45||H===46||H===58||H===95||dl(H)?(e.consume(H),w):S(H)}function S(H){return H===61?(e.consume(H),_):_r(H)?(e.consume(H),S):b(H)}function _(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),l=H,E):_r(H)?(e.consume(H),_):T(H)}function E(H){return H===l?(e.consume(H),l=null,k):H===null||In(H)?n(H):(e.consume(H),E)}function T(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||Wi(H)?S(H):(e.consume(H),T)}function k(H){return H===47||H===62||_r(H)?b(H):n(H)}function P(H){return H===62?(e.consume(H),R):n(H)}function R(H){return H===null||In(H)?I(H):_r(H)?(e.consume(H),R):n(H)}function I(H){return H===45&&i===2?(e.consume(H),$):H===60&&i===1?(e.consume(H),j):H===62&&i===4?(e.consume(H),N):H===63&&i===3?(e.consume(H),z):H===93&&i===5?(e.consume(H),U):In(H)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(q1n,B,F)(H)):H===null||In(H)?(e.exit("htmlFlowData"),F(H)):(e.consume(H),I)}function F(H){return e.check(X1n,A,B)(H)}function A(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),L}function L(H){return H===null||In(H)?F(H):(e.enter("htmlFlowData"),I(H))}function $(H){return H===45?(e.consume(H),z):I(H)}function j(H){return H===47?(e.consume(H),s="",V):I(H)}function V(H){if(H===62){const Q=s.toLowerCase();return g2e.includes(Q)?(e.consume(H),N):I(H)}return zl(H)&&s.length<8?(e.consume(H),s+=String.fromCharCode(H),V):I(H)}function U(H){return H===93?(e.consume(H),z):I(H)}function z(H){return H===62?(e.consume(H),N):H===45&&i===2?(e.consume(H),z):I(H)}function N(H){return H===null||In(H)?(e.exit("htmlFlowData"),B(H)):(e.consume(H),N)}function B(H){return e.exit("htmlFlow"),t(H)}}function K1n(e,t,n){const r=this;return i;function i(s){return In(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Z1n(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(LL,t,n)}}const J1n={name:"htmlText",tokenize:ewn};function ewn(e,t,n){const r=this;let i,o,s;return a;function a(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),l}function l(z){return z===33?(e.consume(z),c):z===47?(e.consume(z),S):z===63?(e.consume(z),b):zl(z)?(e.consume(z),T):n(z)}function c(z){return z===45?(e.consume(z),u):z===91?(e.consume(z),o=0,p):zl(z)?(e.consume(z),y):n(z)}function u(z){return z===45?(e.consume(z),h):n(z)}function f(z){return z===null?n(z):z===45?(e.consume(z),d):In(z)?(s=f,j(z)):(e.consume(z),f)}function d(z){return z===45?(e.consume(z),h):f(z)}function h(z){return z===62?$(z):z===45?d(z):f(z)}function p(z){const N="CDATA[";return z===N.charCodeAt(o++)?(e.consume(z),o===N.length?g:p):n(z)}function g(z){return z===null?n(z):z===93?(e.consume(z),m):In(z)?(s=g,j(z)):(e.consume(z),g)}function m(z){return z===93?(e.consume(z),v):g(z)}function v(z){return z===62?$(z):z===93?(e.consume(z),v):g(z)}function y(z){return z===null||z===62?$(z):In(z)?(s=y,j(z)):(e.consume(z),y)}function b(z){return z===null?n(z):z===63?(e.consume(z),w):In(z)?(s=b,j(z)):(e.consume(z),b)}function w(z){return z===62?$(z):b(z)}function S(z){return zl(z)?(e.consume(z),_):n(z)}function _(z){return z===45||dl(z)?(e.consume(z),_):E(z)}function E(z){return In(z)?(s=E,j(z)):_r(z)?(e.consume(z),E):$(z)}function T(z){return z===45||dl(z)?(e.consume(z),T):z===47||z===62||Wi(z)?k(z):n(z)}function k(z){return z===47?(e.consume(z),$):z===58||z===95||zl(z)?(e.consume(z),P):In(z)?(s=k,j(z)):_r(z)?(e.consume(z),k):$(z)}function P(z){return z===45||z===46||z===58||z===95||dl(z)?(e.consume(z),P):R(z)}function R(z){return z===61?(e.consume(z),I):In(z)?(s=R,j(z)):_r(z)?(e.consume(z),R):k(z)}function I(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),i=z,F):In(z)?(s=I,j(z)):_r(z)?(e.consume(z),I):(e.consume(z),A)}function F(z){return z===i?(e.consume(z),i=void 0,L):z===null?n(z):In(z)?(s=F,j(z)):(e.consume(z),F)}function A(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||Wi(z)?k(z):(e.consume(z),A)}function L(z){return z===47||z===62||Wi(z)?k(z):n(z)}function $(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function j(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),V}function V(z){return _r(z)?Nr(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):U(z)}function U(z){return e.enter("htmlTextData"),s(z)}}const zge={name:"labelEnd",tokenize:swn,resolveTo:own,resolveAll:iwn},twn={tokenize:awn},nwn={tokenize:lwn},rwn={tokenize:cwn};function iwn(e){let t=-1;for(;++t=3&&(c===null||In(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),_r(c)?Nr(e,a,"whitespace")(c):a(c))}}const hc={name:"list",tokenize:ywn,continuation:{tokenize:bwn},exit:wwn},mwn={tokenize:Swn,partial:!0},vwn={tokenize:xwn,partial:!0};function ywn(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Fie(h)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(u5,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return Fie(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(LL,r.interrupt?n:u,e.attempt(mwn,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return _r(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function bwn(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(LL,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Nr(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!_r(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vwn,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Nr(e,e.attempt(hc,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function xwn(e,t,n){const r=this;return Nr(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function wwn(e){e.exit(this.containerState.type)}function Swn(e,t,n){const r=this;return Nr(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!_r(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const m2e={name:"setextUnderline",tokenize:Cwn,resolveTo:_wn};function _wn(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Cwn(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),_r(c)?Nr(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||In(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Own={tokenize:Ewn};function Ewn(e){const t=this,n=e.attempt(LL,r,e.attempt(this.parser.constructs.flowInitial,i,Nr(e,e.attempt(this.parser.constructs.flow,i,e.attempt(A1n,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Twn={resolveAll:tet()},Pwn=eet("string"),kwn=eet("text");function eet(e){return{tokenize:t,resolveAll:tet(e==="text"?Mwn:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Iwn(e,t){let n=-1;const r=[];let i;for(;++n`,qvn="chart-wrapper";function Xvn(e){return typeof e=="function"}function YTe(e,t,n,r){const i=`${t}
`,o=`
${n}`,s=window.open("");s.document.write(i+e+o),s.document.title=`${gM[r]} JSON Source`}function Yvn(e,t,n){if(e.$schema){const r=hKe(e.$schema);n&&n!==r.library&&t.warn(`The given visualization spec is written in ${gM[r.library]}, but mode argument sets ${gM[n]??n}.`);const i=r.library;return OKe(zB[i],`^${r.version.slice(1)}`)||t.warn(`The input spec uses ${gM[i]} ${r.version}, but the current version of ${gM[i]} is v${zB[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":n??"vega"}function TKe(e){return!!(e&&"load"in e)}function QTe(e){return TKe(e)?e:Zh.loader(e)}function Qvn(e){const t=e.usermeta?.embedOptions??{};return Ut(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Kvn(e,t,n={}){let r,i;Ut(t)?(i=QTe(n.loader),r=JSON.parse(await i.load(t))):r=t;const o=Qvn(r),s=o.loader;(!i||s)&&(i=QTe(n.loader??s));const a=await KTe(o,i),l=await KTe(n,i),c={...EKe(l,a),config:$T(l.config??{},a.config??{})};return await Jvn(e,r,c,i)}async function KTe(e,t){const n=Ut(e.config)?JSON.parse(await t.load(e.config)):e.config??{},r=Ut(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...r?{patch:r}:{},...n?{config:n}:{}}}function Zvn(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Jvn(e,t,n={},r){const i=n.theme?$T(mKe[n.theme],n.config??{}):n.config,o=cS(n.actions)?n.actions:EKe({},Vvn,n.actions??{}),s={...Wvn,...n.i18n},a=n.renderer??"svg",l=n.logger??wU(Zh.Warn);n.logLevel!==void 0&&l.level(n.logLevel);const c=n.downloadFileName??"visualization",u=typeof e=="string"?document.querySelector(e):e;if(!u)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const S="vega-embed-style",{root:_,rootContainer:E}=Zvn(u);if(!_.getElementById(S)){const T=document.createElement("style");T.id=S,T.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?Bvn.toString():n.defaultStyle,E.appendChild(T)}}const f=Yvn(t,l,n.mode);let d=Hvn[f](t,l,i);if(f==="vega-lite"&&d.$schema){const S=hKe(d.$schema);OKe(zB.vega,`^${S.version.slice(1)}`)||l.warn(`The compiled spec uses Vega ${S.version}, but current version is v${zB.vega}.`)}u.classList.add("vega-embed"),o&&u.classList.add("has-actions"),u.innerHTML="";let h=u;if(o){const S=document.createElement("div");S.classList.add(qvn),u.appendChild(S),h=S}const p=n.patch;if(p&&(d=p instanceof Function?p(d):P8(d,p,!0,!1).newDocument),n.formatLocale&&Zh.formatLocale(n.formatLocale),n.timeFormatLocale&&Zh.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const S in n.expressionFunctions){const _=n.expressionFunctions[S];"fn"in _?Zh.expressionFunction(S,_.fn,_.visitor):_ instanceof Function&&Zh.expressionFunction(S,_)}const{ast:g}=n,m=Zh.parse(d,f==="vega-lite"?{}:i,{ast:g}),v=new(n.viewClass||Zh.View)(m,{loader:r,logger:l,renderer:a,...g?{expr:Zh.expressionInterpreter??n.expr??Ian}:{}});if(v.addSignalListener("autosize",(S,_)=>{const{type:E}=_;E=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):E=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):E=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:S,tooltip:_}=n,E=S&&!TKe(S)?S?.baseURL:void 0,T=Xvn(_)?_:new fvn({baseURL:E,..._===!0?{}:_}).call;v.tooltip(T)}let{hover:y}=n;if(y===void 0&&(y=f==="vega"),y){const{hoverSet:S,updateSet:_}=typeof y=="boolean"?{}:y;v.hover(S,_)}n&&(n.width!=null&&v.width(n.width),n.height!=null&&v.height(n.height),n.padding!=null&&v.padding(n.padding)),await v.initialize(h,n.bind).runAsync();let b;if(o!==!1){let S=u;if(n.defaultStyle!==!1||n.forceActionsMenu){const E=document.createElement("details");E.title=s.CLICK_TO_VIEW_ACTIONS,u.append(E),S=E;const T=document.createElement("summary");T.innerHTML=Gvn,E.append(T),b=k=>{E.contains(k.target)||E.removeAttribute("open")},document.addEventListener("click",b)}const _=document.createElement("div");if(S.append(_),_.classList.add("vega-actions"),o===!0||o.export!==!1){for(const E of["svg","png"])if(o===!0||o.export===!0||o.export[E]){const T=s[`${E.toUpperCase()}_ACTION`],k=document.createElement("a"),P=Bt(n.scaleFactor)?n.scaleFactor[E]:n.scaleFactor;k.text=T,k.href="#",k.target="_blank",k.download=`${c}.${E}`,k.addEventListener("mousedown",async function(I){I.preventDefault();const R=await v.toImageURL(E,P);this.href=R}),_.append(k)}}if(o===!0||o.source!==!1){const E=document.createElement("a");E.text=s.SOURCE_ACTION,E.href="#",E.addEventListener("click",function(T){YTe(j9(t),n.sourceHeader??"",n.sourceFooter??"",f),T.preventDefault()}),_.append(E)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const E=document.createElement("a");E.text=s.COMPILED_ACTION,E.href="#",E.addEventListener("click",function(T){YTe(j9(d),n.sourceHeader??"",n.sourceFooter??"","vega"),T.preventDefault()}),_.append(E)}if(o===!0||o.editor!==!1){const E=n.editorUrl??"https://vega.github.io/editor/",T=document.createElement("a");T.text=s.EDITOR_ACTION,T.href="#",T.addEventListener("click",function(k){jvn(window,E,{config:i,mode:p?"vega":f,renderer:a,spec:j9(p?d:t)}),k.preventDefault()}),_.append(T)}}function w(){b&&document.removeEventListener("click",b),v.finalize()}return{view:v,spec:t,vgSpec:d,finalize:w,embedOptions:n}}function eyn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ZTe,JTe;function tyn(){return JTe||(JTe=1,ZTe=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n}),ZTe}var nyn=tyn();const ryn=eyn(nyn);function iyn(e){const[t,n]=Te.useState(null),{ref:r,spec:i,onEmbed:o,onError:s,options:a={}}=e;return oyn(()=>{let l=!1,c=null;return(async()=>{if(!(!r.current||l))try{if(c=await Kvn(r.current,i,a),l){c.finalize();return}n(c),o?.(c)}catch(u){console.error(`[react-vega] Error creating view: ${u}`),s?.(u)}})(),()=>{l=!0,c?.finalize()}},[i,a]),t}function oyn(e,t){const n=Te.useRef(null),r=Te.useRef(0);(!n.current||!ryn(t,n.current))&&(r.current+=1),n.current=t,Te.useEffect(e,[r.current])}const PKe=Te.forwardRef((e,t)=>{const{spec:n,options:r,onEmbed:i,onError:o,...s}=e,a=Te.useRef(null);return Te.useImperativeHandle(t,()=>{if(!a.current)throw new Error("VegaEmbed: ref is not attached to a div element");return a.current},[]),iyn({ref:a,spec:n,onEmbed:i,onError:o,options:r}),O.jsx("div",{ref:a,...s})});PKe.displayName="VegaEmbed";function syn(e){const t=M.useRef(null),n=M.useCallback(r=>{t.current?.(),t.current=null;const i=r?.view;if(!i)return;const o=[];for(const[s,a]of Object.entries(e)){const l=(c,u)=>a(c,u);i.addSignalListener(s,l),o.push({name:s,fn:l})}t.current=()=>{for(const{name:s,fn:a}of o)i.removeSignalListener(s,a)}},[e]);return M.useEffect(()=>()=>{t.current?.(),t.current=null},[]),n}const ayn=e=>jp(e)&&(e.select==="point"||e.select==="interval"||jp(e.select)&&(e.select.type==="point"||e.select.type==="interval")&&mD(e.select.on));function lyn(e,t,n,r){const i=M.useMemo(()=>{const a=[];return!e||!e.params?a:e.params.filter(ayn).reduce((l,c)=>(c.select==="point"?l.push(["click",c.name]):c.select==="interval"?l.push(["drag",c.name]):l.push([c.select.on,c.name]),l),a)},[e]),o=M.useCallback((a,l)=>{if(n)return r({componentType:t,id:n,property:a,value:l})},[n,r,t]),s=M.useMemo(()=>{const a={click:o,drag:o},l={};return i.forEach(([c,u])=>{a[c]?l[u]=a[c]:console.warn(`The signal "${c}" is not yet supported in chartlets.js`)}),l},[i,o]);return{onEmbed:syn(s),signalListenerMap:s}}const cyn=e=>!!e&&e in mKe,ePe=()=>window.matchMedia("(prefers-color-scheme: dark)").matches;function uyn(e){const t=QDt();return M.useMemo(()=>!e||e==="default"?t==="dark"||t==="system"&&ePe()?"dark":void 0:e==="system"?ePe()?"dark":void 0:cyn(e)?e:void 0,[e,t])}function fyn(){const e=M.useRef(null),[t,n]=M.useState(0),r=M.useCallback(i=>{if(e.current&&(e.current.disconnect(),e.current=null),i!==null){const o=new ResizeObserver(s=>{n(Date.now())});o.observe(i),e.current=o}},[]);return{containerSizeKey:t,containerCallbackRef:r}}function dyn({type:e,id:t,style:n,theme:r,chart:i,onChange:o}){const{onEmbed:s}=lyn(i,e,t,o),a=uyn(r),{containerSizeKey:l,containerCallbackRef:c}=fyn(),u=M.useRef(null);return i?O.jsx("div",{id:"chart-container",ref:c,style:n,children:O.jsx(PKe,{ref:u,spec:i,onEmbed:s,options:{actions:!1,theme:a},style:n},l)}):O.jsx("div",{id:t})}function hyn(){return{components:[["VegaChart",dyn]]}}const Ere={selectedDatasetId:{type:"str | None",description:"The identifier of the currently selected dataset.",selector:CT},selectedDatasetTitle:{type:"str | None",description:"The title of the currently selected dataset.",selector:WBe},selectedVariableName:{type:"str | None",description:"The name of the currently selected variable within the selected dataset.",selector:iS},selectedDataset2Id:{type:"str | None",description:"The identifier of the dataset that contains the pinned variable.",selector:ule},selectedDataset2Title:{type:"str | None",description:"The title of the dataset that contains the pinned variable.",selector:HBe},selectedVariable2Name:{type:"str | None",description:"The name of the pinned variable.",selector:fle},selectedPlaceGeometry:{type:"dict[str, Any] | None",description:"The geometry of the currently selected place in GeoJSON format.",selector:wIt},selectedPlaceId:{type:"str | None",description:"The identifier of the currently selected place.",selector:oS},selectedPlaceGroup:{type:"list[dict[str, Any]]",description:"The list of dataset place group and user place groups.",selector:hD},selectedTimeLabel:{type:"str | None",description:"The currently selected UTC time using ISO format.",selector:aS},themeMode:{type:"str",description:'The appearance mode of the UI. Either "light" or "dark".',selector:e=>gje(e.controlState.themeMode)}};function pyn(e){return{subscribe(t){return e.subscribe(t)},get(t){const n=Ere[t];if(n)return n.selector(e.getState())}}}const gyn=!1,tPe=["http","https","mailto","tel"];function myn(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}var Aq,nPe;function vyn(){return nPe||(nPe=1,Aq=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}),Aq}var yyn=vyn();const kKe=Yn(yyn);function JM(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rPe(e.position):"start"in e||"end"in e?rPe(e):"line"in e||"column"in e?Tre(e):""}function Tre(e){return iPe(e&&e.line)+":"+iPe(e&&e.column)}function rPe(e){return Tre(e&&e.start)+"-"+Tre(e&&e.end)}function iPe(e){return e&&typeof e=="number"?e:1}class hd extends Error{constructor(t,n,r){const i=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const s=r.indexOf(":");s===-1?i[1]=r:(i[0]=r.slice(0,s),i[1]=r.slice(s+1))}n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=JM(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}hd.prototype.file="";hd.prototype.name="";hd.prototype.reason="";hd.prototype.message="";hd.prototype.stack="";hd.prototype.fatal=null;hd.prototype.column=null;hd.prototype.line=null;hd.prototype.source=null;hd.prototype.ruleId=null;hd.prototype.position=null;const Jh={basename:byn,dirname:xyn,extname:wyn,join:Syn,sep:"/"};function byn(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');SL(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.charCodeAt(i)===t.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function xyn(e){if(SL(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function wyn(e){SL(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.charCodeAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Syn(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Cyn(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function SL(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Oyn={cwd:Eyn};function Eyn(){return"/"}function Pre(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function Tyn(e){if(typeof e=="string")e=new URL(e);else if(!Pre(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Pyn(e)}function Pyn(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||e.call(c,d)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return Lq=function l(){var c,u,f,d,h,p,g=arguments[0],m=1,v=arguments.length,y=!1;for(typeof g=="boolean"&&(y=g,g=arguments[1]||{},m=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});ms.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Dyn=RKe().freeze(),AKe={}.hasOwnProperty;function RKe(){const e=Ryn(),t=[];let n={},r,i=-1;return o.data=s,o.Parser=void 0,o.Compiler=void 0,o.freeze=a,o.attachers=t,o.use=l,o.parse=c,o.stringify=u,o.run=f,o.runSync=d,o.process=h,o.processSync=p,o;function o(){const g=RKe();let m=-1;for(;++m{if(_||!E||!T)S(_);else{const k=o.stringify(E,T);k==null||($yn(k)?T.value=k:T.result=k),S(_,T)}});function S(_,E){_||!E?b(_):y?y(E):m(null,E)}}}function p(g){let m;o.freeze(),Fq("processSync",o.Parser),$q("processSync",o.Compiler);const v=i2(g);return o.process(v,y),fPe("processSync","process",m),v;function y(b){m=!0,sPe(b)}}}function cPe(e,t){return typeof e=="function"&&e.prototype&&(Lyn(e.prototype)||t in e.prototype)}function Lyn(e){let t;for(t in e)if(AKe.call(e,t))return!0;return!1}function Fq(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function $q(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function Nq(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function uPe(e){if(!kre(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fPe(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function i2(e){return Fyn(e)?e:new MKe(e)}function Fyn(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $yn(e){return typeof e=="string"||kKe(e)}const Nyn={};function zyn(e,t){const n=Nyn,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return IKe(e,r,i)}function IKe(e,t,n){if(jyn(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dPe(e.children,t,n)}return Array.isArray(e)?dPe(e,t,n):""}function dPe(e,t,n){const r=[];let i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Lu(e,e.length,0,t),e):t}const hPe={}.hasOwnProperty;function DKe(e){const t={};let n=-1;for(;++ns))return;const E=t.events.length;let T=E,k,P;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(k){P=t.events[T][1].end;break}k=!0}for(v(r),_=E;_b;){const S=n[w];t.containerState=S[1],S[0].exit.call(t,e)}n.length=b}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Kyn(e,t,n){return zr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function BB(e){if(e===null||Wi(e)||kw(e))return 1;if(M8(e))return 2}function A8(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),d=Object.assign({},e[n][1].start);gPe(f,-l),gPe(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:d},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=vf(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=vf(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=vf(c,A8(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=vf(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=vf(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Lu(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&Or(_)?zr(e,y,"linePrefix",o+1)(_):y(_)}function y(_){return _===null||In(_)?e.check(vPe,g,w)(_):(e.enter("codeFlowValue"),b(_))}function b(_){return _===null||In(_)?(e.exit("codeFlowValue"),y(_)):(e.consume(_),b)}function w(_){return e.exit("codeFenced"),t(_)}function S(_,E,T){let k=0;return P;function P(L){return _.enter("lineEnding"),_.consume(L),_.exit("lineEnding"),I}function I(L){return _.enter("codeFencedFence"),Or(L)?zr(_,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):R(L)}function R(L){return L===a?(_.enter("codeFencedFenceSequence"),F(L)):T(L)}function F(L){return L===a?(k++,_.consume(L),F):k>=s?(_.exit("codeFencedFenceSequence"),Or(L)?zr(_,A,"whitespace")(L):A(L)):T(L)}function A(L){return L===null||In(L)?(_.exit("codeFencedFence"),E(L)):T(L)}}}function c0n(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const zq={name:"codeIndented",tokenize:f0n},u0n={tokenize:d0n,partial:!0};function f0n(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),zr(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):In(c)?e.attempt(u0n,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||In(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function d0n(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):In(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):zr(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):In(s)?i(s):n(s)}}const h0n={name:"codeText",tokenize:m0n,resolve:p0n,previous:g0n};function p0n(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function zKe(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),d):v===null||v===32||v===41||jB(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(v))}function d(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(e.exit("chunkString"),e.exit(a),d(v)):v===null||v===60||In(v)?n(v):(e.consume(v),v===92?p:h)}function p(v){return v===60||v===62||v===92?(e.consume(v),h):h(v)}function g(v){return!u&&(v===null||v===41||Wi(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):u999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):In(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||In(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!Or(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function BKe(e,t,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(o),c(d))}function c(d){return d===s?(e.exit(o),l(s)):d===null?n(d):In(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),zr(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||In(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:u)}function f(d){return d===s||d===92?(e.consume(d),u):u(d)}}function eA(e,t){let n;return r;function r(i){return In(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Or(i)?zr(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function uh(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _0n={name:"definition",tokenize:O0n},C0n={tokenize:E0n,partial:!0};function O0n(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return jKe.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=uh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return Wi(h)?eA(e,c)(h):c(h)}function c(h){return zKe(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(C0n,f,f)(h)}function f(h){return Or(h)?zr(e,d,"whitespace")(h):d(h)}function d(h){return h===null||In(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function E0n(e,t,n){return r;function r(a){return Wi(a)?eA(e,i)(a):n(a)}function i(a){return BKe(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Or(a)?zr(e,s,"whitespace")(a):s(a)}function s(a){return a===null||In(a)?t(a):n(a)}}const T0n={name:"hardBreakEscape",tokenize:P0n};function P0n(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return In(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const k0n={name:"headingAtx",tokenize:A0n,resolve:M0n};function M0n(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Lu(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function A0n(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||Wi(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||In(u)?(e.exit("atxHeading"),t(u)):Or(u)?zr(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Wi(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const R0n=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],bPe=["pre","script","style","textarea"],I0n={name:"htmlFlow",tokenize:$0n,resolveTo:F0n,concrete:!0},D0n={tokenize:z0n,partial:!0},L0n={tokenize:N0n,partial:!0};function F0n(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $0n(e,t,n){const r=this;let i,o,s,a,l;return c;function c(H){return u(H)}function u(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),f}function f(H){return H===33?(e.consume(H),d):H===47?(e.consume(H),o=!0,g):H===63?(e.consume(H),i=3,r.interrupt?t:z):Nl(H)?(e.consume(H),s=String.fromCharCode(H),m):n(H)}function d(H){return H===45?(e.consume(H),i=2,h):H===91?(e.consume(H),i=5,a=0,p):Nl(H)?(e.consume(H),i=4,r.interrupt?t:z):n(H)}function h(H){return H===45?(e.consume(H),r.interrupt?t:z):n(H)}function p(H){const Q="CDATA[";return H===Q.charCodeAt(a++)?(e.consume(H),a===Q.length?r.interrupt?t:R:p):n(H)}function g(H){return Nl(H)?(e.consume(H),s=String.fromCharCode(H),m):n(H)}function m(H){if(H===null||H===47||H===62||Wi(H)){const Q=H===47,Y=s.toLowerCase();return!Q&&!o&&bPe.includes(Y)?(i=1,r.interrupt?t(H):R(H)):R0n.includes(s.toLowerCase())?(i=6,Q?(e.consume(H),v):r.interrupt?t(H):R(H)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(H):o?y(H):b(H))}return H===45||fl(H)?(e.consume(H),s+=String.fromCharCode(H),m):n(H)}function v(H){return H===62?(e.consume(H),r.interrupt?t:R):n(H)}function y(H){return Or(H)?(e.consume(H),y):P(H)}function b(H){return H===47?(e.consume(H),P):H===58||H===95||Nl(H)?(e.consume(H),w):Or(H)?(e.consume(H),b):P(H)}function w(H){return H===45||H===46||H===58||H===95||fl(H)?(e.consume(H),w):S(H)}function S(H){return H===61?(e.consume(H),_):Or(H)?(e.consume(H),S):b(H)}function _(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),l=H,E):Or(H)?(e.consume(H),_):T(H)}function E(H){return H===l?(e.consume(H),l=null,k):H===null||In(H)?n(H):(e.consume(H),E)}function T(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||Wi(H)?S(H):(e.consume(H),T)}function k(H){return H===47||H===62||Or(H)?b(H):n(H)}function P(H){return H===62?(e.consume(H),I):n(H)}function I(H){return H===null||In(H)?R(H):Or(H)?(e.consume(H),I):n(H)}function R(H){return H===45&&i===2?(e.consume(H),$):H===60&&i===1?(e.consume(H),j):H===62&&i===4?(e.consume(H),N):H===63&&i===3?(e.consume(H),z):H===93&&i===5?(e.consume(H),U):In(H)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(D0n,B,F)(H)):H===null||In(H)?(e.exit("htmlFlowData"),F(H)):(e.consume(H),R)}function F(H){return e.check(L0n,A,B)(H)}function A(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),L}function L(H){return H===null||In(H)?F(H):(e.enter("htmlFlowData"),R(H))}function $(H){return H===45?(e.consume(H),z):R(H)}function j(H){return H===47?(e.consume(H),s="",V):R(H)}function V(H){if(H===62){const Q=s.toLowerCase();return bPe.includes(Q)?(e.consume(H),N):R(H)}return Nl(H)&&s.length<8?(e.consume(H),s+=String.fromCharCode(H),V):R(H)}function U(H){return H===93?(e.consume(H),z):R(H)}function z(H){return H===62?(e.consume(H),N):H===45&&i===2?(e.consume(H),z):R(H)}function N(H){return H===null||In(H)?(e.exit("htmlFlowData"),B(H)):(e.consume(H),N)}function B(H){return e.exit("htmlFlow"),t(H)}}function N0n(e,t,n){const r=this;return i;function i(s){return In(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function z0n(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(_L,t,n)}}const j0n={name:"htmlText",tokenize:B0n};function B0n(e,t,n){const r=this;let i,o,s;return a;function a(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),l}function l(z){return z===33?(e.consume(z),c):z===47?(e.consume(z),S):z===63?(e.consume(z),b):Nl(z)?(e.consume(z),T):n(z)}function c(z){return z===45?(e.consume(z),u):z===91?(e.consume(z),o=0,p):Nl(z)?(e.consume(z),y):n(z)}function u(z){return z===45?(e.consume(z),h):n(z)}function f(z){return z===null?n(z):z===45?(e.consume(z),d):In(z)?(s=f,j(z)):(e.consume(z),f)}function d(z){return z===45?(e.consume(z),h):f(z)}function h(z){return z===62?$(z):z===45?d(z):f(z)}function p(z){const N="CDATA[";return z===N.charCodeAt(o++)?(e.consume(z),o===N.length?g:p):n(z)}function g(z){return z===null?n(z):z===93?(e.consume(z),m):In(z)?(s=g,j(z)):(e.consume(z),g)}function m(z){return z===93?(e.consume(z),v):g(z)}function v(z){return z===62?$(z):z===93?(e.consume(z),v):g(z)}function y(z){return z===null||z===62?$(z):In(z)?(s=y,j(z)):(e.consume(z),y)}function b(z){return z===null?n(z):z===63?(e.consume(z),w):In(z)?(s=b,j(z)):(e.consume(z),b)}function w(z){return z===62?$(z):b(z)}function S(z){return Nl(z)?(e.consume(z),_):n(z)}function _(z){return z===45||fl(z)?(e.consume(z),_):E(z)}function E(z){return In(z)?(s=E,j(z)):Or(z)?(e.consume(z),E):$(z)}function T(z){return z===45||fl(z)?(e.consume(z),T):z===47||z===62||Wi(z)?k(z):n(z)}function k(z){return z===47?(e.consume(z),$):z===58||z===95||Nl(z)?(e.consume(z),P):In(z)?(s=k,j(z)):Or(z)?(e.consume(z),k):$(z)}function P(z){return z===45||z===46||z===58||z===95||fl(z)?(e.consume(z),P):I(z)}function I(z){return z===61?(e.consume(z),R):In(z)?(s=I,j(z)):Or(z)?(e.consume(z),I):k(z)}function R(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),i=z,F):In(z)?(s=R,j(z)):Or(z)?(e.consume(z),R):(e.consume(z),A)}function F(z){return z===i?(e.consume(z),i=void 0,L):z===null?n(z):In(z)?(s=F,j(z)):(e.consume(z),F)}function A(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||Wi(z)?k(z):(e.consume(z),A)}function L(z){return z===47||z===62||Wi(z)?k(z):n(z)}function $(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function j(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),V}function V(z){return Or(z)?zr(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):U(z)}function U(z){return e.enter("htmlTextData"),s(z)}}const Ppe={name:"labelEnd",tokenize:q0n,resolveTo:G0n,resolveAll:H0n},U0n={tokenize:X0n},V0n={tokenize:Y0n},W0n={tokenize:Q0n};function H0n(e){let t=-1;for(;++t=3&&(c===null||In(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Or(c)?zr(e,a,"whitespace")(c):a(c))}}const uc={name:"list",tokenize:obn,continuation:{tokenize:sbn},exit:lbn},rbn={tokenize:cbn,partial:!0},ibn={tokenize:abn,partial:!0};function obn(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Mre(h)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Vz,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return Mre(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(_L,r.interrupt?n:u,e.attempt(rbn,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return Or(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function sbn(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_L,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zr(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Or(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ibn,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,zr(e,e.attempt(uc,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function abn(e,t,n){const r=this;return zr(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function lbn(e){e.exit(this.containerState.type)}function cbn(e,t,n){const r=this;return zr(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Or(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const xPe={name:"setextUnderline",tokenize:fbn,resolveTo:ubn};function ubn(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function fbn(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Or(c)?zr(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||In(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const dbn={tokenize:hbn};function hbn(e){const t=this,n=e.attempt(_L,r,e.attempt(this.parser.constructs.flowInitial,i,zr(e,e.attempt(this.parser.constructs.flow,i,e.attempt(y0n,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const pbn={resolveAll:VKe()},gbn=UKe("string"),mbn=UKe("text");function UKe(e){return{tokenize:t,resolveAll:VKe(e==="text"?vbn:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function xbn(e,t){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const qwn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ret(e){return e.replace(qwn,Xwn)}function Xwn(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return net(n.slice(o?2:1),o?16:10)}return Nge(n)||e}const iet={}.hasOwnProperty,Ywn=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Qwn(n)(Gwn(Wwn(n).document().write(Hwn()(e,t,!0))))};function Qwn(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(we),autolinkProtocol:R,autolinkEmail:R,atxHeading:a(he),blockQuote:a(me),characterEscape:R,characterReference:R,codeFenced:a(se),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(se,l),codeText:a(ue,l),codeTextData:R,data:R,codeFlowValue:R,definition:a(G),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ce),hardBreakEscape:a(J),hardBreakTrailing:a(J),htmlFlow:a(te,l),htmlFlowData:R,htmlText:a(te,l),htmlTextData:R,image:a(ae),label:l,link:a(we),listItem:a(ee),listItemValue:p,listOrdered:a(Pe,h),listUnordered:a(Pe),paragraph:a(oe),reference:Y,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(he),strong:a(Se),thematicBreak:a(be)},exit:{atxHeading:u(),atxHeadingSequence:E,autolink:u(),autolinkEmail:fe,autolinkProtocol:ne,blockQuote:u(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ie,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:g,codeFencedFenceMeta:m,codeFlowValue:I,codeIndented:u(b),codeText:u(j),codeTextData:I,data:I,definition:u(),definitionDestinationString:_,definitionLabelString:w,definitionTitleString:S,emphasis:u(),hardBreakEscape:u(A),hardBreakTrailing:u(A),htmlFlow:u(L),htmlFlowData:I,htmlText:u($),htmlTextData:I,image:u(U),label:N,labelText:z,lineEnding:F,link:u(V),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Z,resourceDestinationString:B,resourceTitleString:H,resource:Q,setextHeading:u(P),setextHeadingLineSequence:k,setextHeadingText:T,strong:u(),thematicBreak:u()}};oet(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ge){let xe={type:"root",children:[]};const re={stack:[xe],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:s},Ee=[];let ke=-1;for(;++ke0){const je=re.tokenStack[re.tokenStack.length-1];(je[1]||y2e).call(re,void 0,je[0])}for(xe.position={start:by(ge.length>0?ge[0][1].start:{line:1,column:1,offset:0}),end:by(ge.length>0?ge[ge.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke{const r=this.data("settings");return Ywn(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function Jwn(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function eSn(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` -`}]}function tSn(e,t){const n=t.value?t.value+` -`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function nSn(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rSn(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mP(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function set(e,t){const n=String(t.identifier).toUpperCase(),r=mP(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let o;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,o=e.footnoteOrder.length):(e.footnoteCounts[n]++,o=i+1);const s=e.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,a);const l={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,l),e.applyData(t,l)}function iSn(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},set(e,{type:"footnoteReference",identifier:i,position:t.position})}function oSn(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sSn(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function aet(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function aSn(e,t){const n=e.definition(t.identifier);if(!n)return aet(e,t);const r={src:mP(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function lSn(e,t){const n={src:mP(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cSn(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function uSn(e,t){const n=e.definition(t.identifier);if(!n)return aet(e,t);const r={href:mP(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function fSn(e,t){const n={href:mP(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function dSn(e,t,n){const r=e.all(t),i=n?hSn(n):cet(t),o={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const Dbn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function HKe(e){return e.replace(Dbn,Lbn)}function Lbn(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return WKe(n.slice(o?2:1),o?16:10)}return Tpe(n)||e}const GKe={}.hasOwnProperty,Fbn=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),$bn(n)(Ibn(Abn(n).document().write(Rbn()(e,t,!0))))};function $bn(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(we),autolinkProtocol:I,autolinkEmail:I,atxHeading:a(pe),blockQuote:a(ve),characterEscape:I,characterReference:I,codeFenced:a(se),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(se,l),codeText:a(ue,l),codeTextData:I,data:I,codeFlowValue:I,definition:a(G),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ce),hardBreakEscape:a(J),hardBreakTrailing:a(J),htmlFlow:a(te,l),htmlFlowData:I,htmlText:a(te,l),htmlTextData:I,image:a(ae),label:l,link:a(we),listItem:a(ee),listItemValue:p,listOrdered:a(Pe,h),listUnordered:a(Pe),paragraph:a(re),reference:Y,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(pe),strong:a(Se),thematicBreak:a(xe)},exit:{atxHeading:u(),atxHeadingSequence:E,autolink:u(),autolinkEmail:fe,autolinkProtocol:ie,blockQuote:u(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:ne,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:g,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:u(b),codeText:u(j),codeTextData:R,data:R,definition:u(),definitionDestinationString:_,definitionLabelString:w,definitionTitleString:S,emphasis:u(),hardBreakEscape:u(A),hardBreakTrailing:u(A),htmlFlow:u(L),htmlFlowData:R,htmlText:u($),htmlTextData:R,image:u(U),label:N,labelText:z,lineEnding:F,link:u(V),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Z,resourceDestinationString:B,resourceTitleString:H,resource:Q,setextHeading:u(P),setextHeadingLineSequence:k,setextHeadingText:T,strong:u(),thematicBreak:u()}};qKe(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(me){let be={type:"root",children:[]};const oe={stack:[be],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:s},Ee=[];let ke=-1;for(;++ke0){const ze=oe.tokenStack[oe.tokenStack.length-1];(ze[1]||SPe).call(oe,void 0,ze[0])}for(be.position={start:gy(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:gy(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke{const r=this.data("settings");return Fbn(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function jbn(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Bbn(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`}]}function Ubn(e,t){const n=t.value?t.value+` +`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Vbn(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wbn(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cP(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function XKe(e,t){const n=String(t.identifier).toUpperCase(),r=cP(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let o;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,o=e.footnoteOrder.length):(e.footnoteCounts[n]++,o=i+1);const s=e.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,a);const l={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,l),e.applyData(t,l)}function Hbn(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},XKe(e,{type:"footnoteReference",identifier:i,position:t.position})}function Gbn(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qbn(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function YKe(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Xbn(e,t){const n=e.definition(t.identifier);if(!n)return YKe(e,t);const r={src:cP(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function Ybn(e,t){const n={src:cP(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Qbn(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Kbn(e,t){const n=e.definition(t.identifier);if(!n)return YKe(e,t);const r={href:cP(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Zbn(e,t){const n={href:cP(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jbn(e,t,n){const r=e.all(t),i=n?exn(n):QKe(t),o={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function pSn(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i-1?r.offset:null}}}function bSn(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=jge(t.children[1]),l=Bge(t.children[t.children.length-1]);a.line&&l.line&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function xSn(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(w2e(t.slice(i),i>0,!1)),o.join("")}function w2e(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===b2e||o===x2e;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===b2e||o===x2e;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _Sn(e,t){const n={type:"text",value:SSn(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function CSn(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const OSn={blockquote:Jwn,break:eSn,code:tSn,delete:nSn,emphasis:rSn,footnoteReference:set,footnote:iSn,heading:oSn,html:sSn,imageReference:aSn,image:lSn,inlineCode:cSn,linkReference:uSn,link:fSn,listItem:dSn,list:pSn,paragraph:gSn,root:mSn,strong:vSn,table:bSn,tableCell:wSn,tableRow:xSn,text:_Sn,thematicBreak:CSn,toml:GN,yaml:GN,definition:GN,footnoteDefinition:GN};function GN(){return null}const Uge=(function(e){if(e==null)return kSn;if(typeof e=="string")return PSn(e);if(typeof e=="object")return Array.isArray(e)?ESn(e):TSn(e);if(typeof e=="function")return oW(e);throw new Error("Expected function, string, or object as test")});function ESn(e){const t=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let d=[],h,p,g;if((!t||i(a,l,c[c.length-1]||null))&&(d=RSn(n(a,c)),d[0]===S2e))return d;if(a.children&&d[0]!==ASn)for(p=(r?a.children.length:-1)+o,g=c.concat(a);p>-1&&p{const i=C2e(r.identifier);i&&!_2e.call(t,i)&&(t[i]=r)}),n;function n(r){const i=C2e(r);return i&&_2e.call(t,i)?t[i]:null}}function C2e(e){return String(e||"").toUpperCase()}const h4={}.hasOwnProperty;function LSn(e,t){const n=t||{},r=n.allowDangerousHtml||!1,i={};return s.dangerous=r,s.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,s.footnoteLabel=n.footnoteLabel||"Footnotes",s.footnoteLabelTagName=n.footnoteLabelTagName||"h2",s.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},s.footnoteBackLabel=n.footnoteBackLabel||"Back to content",s.unknownHandler=n.unknownHandler,s.passThrough=n.passThrough,s.handlers={...OSn,...n.handlers},s.definition=DSn(e),s.footnoteById=i,s.footnoteOrder=[],s.footnoteCounts={},s.patch=FSn,s.applyData=$Sn,s.one=a,s.all=l,s.wrap=zSn,s.augment=o,Vge(e,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();h4.call(i,u)||(i[u]=c)}),s;function o(c,u){if(c&&"data"in c&&c.data){const f=c.data;f.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=f.hName),u.type==="element"&&f.hProperties&&(u.properties={...u.properties,...f.hProperties}),"children"in u&&u.children&&f.hChildren&&(u.children=f.hChildren)}if(c){const f="type"in c?c:{position:c};ISn(f)||(u.position={start:jge(f),end:Bge(f)})}return u}function s(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),o(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function a(c,u){return det(s,c,u)}function l(c){return Wge(s,c)}}function FSn(e,t){e.position&&(t.position=ySn(e))}function $Sn(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function det(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return h4.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:Wge(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):NSn(e,t)}function Wge(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i1}function txn(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i-1?r.offset:null}}}function sxn(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=kpe(t.children[1]),l=Mpe(t.children[t.children.length-1]);a.line&&l.line&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function axn(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(OPe(t.slice(i),i>0,!1)),o.join("")}function OPe(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===_Pe||o===CPe;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===_Pe||o===CPe;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function uxn(e,t){const n={type:"text",value:cxn(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function fxn(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const dxn={blockquote:jbn,break:Bbn,code:Ubn,delete:Vbn,emphasis:Wbn,footnoteReference:XKe,footnote:Hbn,heading:Gbn,html:qbn,imageReference:Xbn,image:Ybn,inlineCode:Qbn,linkReference:Kbn,link:Zbn,listItem:Jbn,list:txn,paragraph:nxn,root:rxn,strong:ixn,table:sxn,tableCell:lxn,tableRow:axn,text:uxn,thematicBreak:fxn,toml:EN,yaml:EN,definition:EN,footnoteDefinition:EN};function EN(){return null}const Ape=(function(e){if(e==null)return mxn;if(typeof e=="string")return gxn(e);if(typeof e=="object")return Array.isArray(e)?hxn(e):pxn(e);if(typeof e=="function")return R8(e);throw new Error("Expected function, string, or object as test")});function hxn(e){const t=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let d=[],h,p,g;if((!t||i(a,l,c[c.length-1]||null))&&(d=bxn(n(a,c)),d[0]===EPe))return d;if(a.children&&d[0]!==yxn)for(p=(r?a.children.length:-1)+o,g=c.concat(a);p>-1&&p{const i=PPe(r.identifier);i&&!TPe.call(t,i)&&(t[i]=r)}),n;function n(r){const i=PPe(r);return i&&TPe.call(t,i)?t[i]:null}}function PPe(e){return String(e||"").toUpperCase()}const UB={}.hasOwnProperty;function Sxn(e,t){const n=t||{},r=n.allowDangerousHtml||!1,i={};return s.dangerous=r,s.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,s.footnoteLabel=n.footnoteLabel||"Footnotes",s.footnoteLabelTagName=n.footnoteLabelTagName||"h2",s.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},s.footnoteBackLabel=n.footnoteBackLabel||"Back to content",s.unknownHandler=n.unknownHandler,s.passThrough=n.passThrough,s.handlers={...dxn,...n.handlers},s.definition=wxn(e),s.footnoteById=i,s.footnoteOrder=[],s.footnoteCounts={},s.patch=_xn,s.applyData=Cxn,s.one=a,s.all=l,s.wrap=Exn,s.augment=o,Rpe(e,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();UB.call(i,u)||(i[u]=c)}),s;function o(c,u){if(c&&"data"in c&&c.data){const f=c.data;f.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=f.hName),u.type==="element"&&f.hProperties&&(u.properties={...u.properties,...f.hProperties}),"children"in u&&u.children&&f.hChildren&&(u.children=f.hChildren)}if(c){const f="type"in c?c:{position:c};xxn(f)||(u.position={start:kpe(f),end:Mpe(f)})}return u}function s(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),o(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function a(c,u){return JKe(s,c,u)}function l(c){return Ipe(s,c)}}function _xn(e,t){e.position&&(t.position=oxn(e))}function Cxn(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function JKe(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return UB.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:Ipe(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):Oxn(e,t)}function Ipe(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i0&&n.push({type:"text",value:` -`}),n}function jSn(e){const t=[];let n=-1;for(;++n1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(f)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const f=c.children[c.children.length-1];f&&f.type==="text"?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+s},children:e.wrap(i,!0)};e.patch(r,u),t.push(u)}if(t.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:` +`}),n}function Txn(e){const t=[];let n=-1;for(;++n1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(f)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const f=c.children[c.children.length-1];f&&f.type==="text"?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+s},children:e.wrap(i,!0)};e.patch(r,u),t.push(u)}if(t.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:` -`}]}}function het(e,t){const n=LSn(e,t),r=n.one(e,null),i=jSn(n);return i&&r.children.push({type:"text",value:` -`},i),Array.isArray(r)?{type:"root",children:r}:r}const BSn=(function(e,t){return e&&"run"in e?USn(e,t):VSn(e||t)});function USn(e,t){return(n,r,i)=>{e.run(het(n,t),r,o=>{i(o)})}}function VSn(e){return t=>het(t,e)}class FL{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}FL.prototype.property={};FL.prototype.normal={};FL.prototype.space=null;function pet(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&XSn.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(E2e,ZSn);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!E2e.test(o)){let s=o.replace(YSn,KSn);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Hge}return new i(r,t)}function KSn(e){return"-"+e.toLowerCase()}function ZSn(e){return e.charAt(1).toUpperCase()}const T2e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},JSn=pet([vet,met,xet,wet,GSn],"html"),e_n=pet([vet,met,xet,wet,qSn],"svg");function t_n(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{Vge(t,"element",(n,r,i)=>{const o=i;let s;if(e.allowedElements?s=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(s=e.disallowedElements.includes(n.tagName)),!s&&e.allowElement&&typeof r=="number"&&(s=!e.allowElement(n,r,o)),s&&typeof r=="number")return e.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}var YX={exports:{}},hi={};var P2e;function n_n(){if(P2e)return hi;P2e=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function g(m){if(typeof m=="object"&&m!==null){var v=m.$$typeof;switch(v){case e:switch(m=m.type,m){case n:case i:case r:case c:case u:return m;default:switch(m=m&&m.$$typeof,m){case a:case s:case l:case d:case f:case o:return m;default:return v}}case t:return v}}}return hi.ContextConsumer=s,hi.ContextProvider=o,hi.Element=e,hi.ForwardRef=l,hi.Fragment=n,hi.Lazy=d,hi.Memo=f,hi.Portal=t,hi.Profiler=i,hi.StrictMode=r,hi.Suspense=c,hi.SuspenseList=u,hi.isAsyncMode=function(){return!1},hi.isConcurrentMode=function(){return!1},hi.isContextConsumer=function(m){return g(m)===s},hi.isContextProvider=function(m){return g(m)===o},hi.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},hi.isForwardRef=function(m){return g(m)===l},hi.isFragment=function(m){return g(m)===n},hi.isLazy=function(m){return g(m)===d},hi.isMemo=function(m){return g(m)===f},hi.isPortal=function(m){return g(m)===t},hi.isProfiler=function(m){return g(m)===i},hi.isStrictMode=function(m){return g(m)===r},hi.isSuspense=function(m){return g(m)===c},hi.isSuspenseList=function(m){return g(m)===u},hi.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===i||m===r||m===c||m===u||m===h||typeof m=="object"&&m!==null&&(m.$$typeof===d||m.$$typeof===f||m.$$typeof===o||m.$$typeof===s||m.$$typeof===l||m.$$typeof===p||m.getModuleId!==void 0)},hi.typeOf=g,hi}var k2e;function r_n(){return k2e||(k2e=1,YX.exports=n_n()),YX.exports}var i_n=r_n();const o_n=Vn(i_n);function s_n(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function a_n(e){return e.join(" ").trim()}function l_n(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var qN={exports:{}},QX,M2e;function c_n(){if(M2e)return QX;M2e=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=` -`,c="/",u="*",f="",d="comment",h="declaration";QX=function(g,m){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];m=m||{};var v=1,y=1;function b(F){var A=F.match(t);A&&(v+=A.length);var L=F.lastIndexOf(l);y=~L?F.length-L:y+F.length}function w(){var F={line:v,column:y};return function(A){return A.position=new S(F),T(),A}}function S(F){this.start=F,this.end={line:v,column:y},this.source=m.source}S.prototype.content=g;function _(F){var A=new Error(m.source+":"+v+":"+y+": "+F);if(A.reason=F,A.filename=m.source,A.line=v,A.column=y,A.source=g,!m.silent)throw A}function E(F){var A=F.exec(g);if(A){var L=A[0];return b(L),g=g.slice(L.length),A}}function T(){E(n)}function k(F){var A;for(F=F||[];A=P();)A!==!1&&F.push(A);return F}function P(){var F=w();if(!(c!=g.charAt(0)||u!=g.charAt(1))){for(var A=2;f!=g.charAt(A)&&(u!=g.charAt(A)||c!=g.charAt(A+1));)++A;if(A+=2,f===g.charAt(A-1))return _("End of comment missing");var L=g.slice(2,A-2);return y+=2,b(L),g=g.slice(A),y+=2,F({type:d,comment:L})}}function R(){var F=w(),A=E(r);if(A){if(P(),!E(i))return _("property missing ':'");var L=E(o),$=F({type:h,property:p(A[0].replace(e,f)),value:L?p(L[0].replace(e,f)):f});return E(s),$}}function I(){var F=[];k(F);for(var A;A=R();)A!==!1&&(F.push(A),k(F));return F}return T(),I()};function p(g){return g?g.replace(a,f):f}return QX}var A2e;function u_n(){if(A2e)return qN.exports;A2e=1;var e=c_n();function t(n,r){var i=null;if(!n||typeof n!="string")return i;for(var o,s=e(n),a=typeof r=="function",l,c,u=0,f=s.length;u0?Te.createElement(h,l,f):Te.createElement(h,l)}function g_n(e){let t=-1;for(;++t for more info)`),delete XN[o]}const t=qxn().use(Zwn).use(e.remarkPlugins||[]).use(BSn,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(t_n,e),n=new UJe;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=Te.createElement(Te.Fragment,{},_et({options:e,schema:JSn,listDepth:0},r));return e.className&&(i=Te.createElement("div",{className:e.className},i)),i}Cet.propTypes={children:le.string,className:le.string,allowElement:le.func,allowedElements:le.arrayOf(le.string),disallowedElements:le.arrayOf(le.string),unwrapDisallowed:le.bool,remarkPlugins:le.arrayOf(le.oneOfType([le.object,le.func,le.arrayOf(le.oneOfType([le.bool,le.string,le.object,le.func,le.arrayOf(le.any)]))])),rehypePlugins:le.arrayOf(le.oneOfType([le.object,le.func,le.arrayOf(le.oneOfType([le.bool,le.string,le.object,le.func,le.arrayOf(le.any)]))])),sourcePos:le.bool,rawSourcePos:le.bool,skipHtml:le.bool,includeElementIndex:le.bool,transformLinkUri:le.oneOfType([le.func,le.bool]),linkTarget:le.oneOfType([le.func,le.string]),transformImageUri:le.func,components:le.object};const w_n={tokenize:T_n,partial:!0},Oet={tokenize:P_n,partial:!0},Eet={tokenize:k_n,partial:!0},Tet={tokenize:M_n,partial:!0},S_n={tokenize:A_n,partial:!0},Pet={tokenize:O_n,previous:Met},ket={tokenize:E_n,previous:Aet},Bv={tokenize:C_n,previous:Ret},Ag={},__n={text:Ag};let Ax=48;for(;Ax<123;)Ag[Ax]=Bv,Ax++,Ax===58?Ax=65:Ax===91&&(Ax=97);Ag[43]=Bv;Ag[45]=Bv;Ag[46]=Bv;Ag[95]=Bv;Ag[72]=[Bv,ket];Ag[104]=[Bv,ket];Ag[87]=[Bv,Pet];Ag[119]=[Bv,Pet];function C_n(e,t,n){const r=this;let i,o;return s;function s(f){return!Bie(f)||!Ret.call(r,r.previous)||Gge(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Bie(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(S_n,u,c)(f):f===45||f===95||dl(f)?(o=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),i=!0,l}function u(f){return o&&i&&zl(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function O_n(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Met.call(r,r.previous)||Gge(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(w_n,e.attempt(Oet,e.attempt(Eet,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function E_n(e,t,n){const r=this;let i="",o=!1;return s;function s(f){return(f===72||f===104)&&Aet.call(r,r.previous)&&!Gge(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(zl(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),o?c:(o=!0,l)):n(f)}function c(f){return f===null||f4(f)||Wi(f)||Fw(f)||rW(f)?n(f):e.attempt(Oet,e.attempt(Eet,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function T_n(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function P_n(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(Tet,l,a)(c):c===null||Wi(c)||Fw(c)||c!==45&&rW(c)?l(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function l(c){return i||r||!o?n(c):t(c)}}function k_n(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const R_n={tokenize:j_n,partial:!0};function I_n(){return{document:{91:{tokenize:$_n,continuation:{tokenize:N_n},exit:z_n}},text:{91:{tokenize:F_n},93:{add:"after",tokenize:D_n,resolveTo:L_n}}}}function D_n(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const c=fh(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function L_n(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function F_n(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(o>999||f===93&&!s||f===null||f===91||Wi(f))return n(f);if(f===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(fh(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Wi(f)||(s=!0),o++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),o++,c):c(f)}}function $_n(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(s>999||p===93&&!a||p===null||p===91||Wi(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return o=fh(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Wi(p)||(a=!0),s++,e.consume(p),p===92?f:u}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,u):u(p)}function d(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(o)||i.push(o),Nr(e,h,"gfmFootnoteDefinitionWhitespace")):n(p)}function h(p){return t(p)}}function N_n(e,t,n){return e.check(LL,t,e.attempt(R_n,t,n))}function z_n(e){e.exit("gfmFootnoteDefinition")}function j_n(e,t,n){const r=this;return Nr(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function B_n(e){let n=(e||{}).singleTilde;const r={tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l1?l(p):(s.consume(p),f++,h);if(f<2&&!n)return l(p);const m=s.exit("strikethroughSequenceTemporary"),v=d4(p);return m._open=!v||v===2&&!!g,m._close=!g||g===2&&!!v,a(p)}}}class U_n{constructor(){this.map=[]}add(t,n,r){V_n(this,t,n,r)}consume(t){if(this.map.sort((o,s)=>o[0]-s[0]),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1])),r.push(this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function V_n(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const A=r.events[R][1].type;if(A==="lineEnding"||A==="linePrefix")R--;else break}const I=R>-1?r.events[R][1].type:null,F=I==="tableHead"||I==="tableRow"?_:l;return F===_&&r.parser.lazy[r.now().line]?n(P):F(P)}function l(P){return e.enter("tableHead"),e.enter("tableRow"),c(P)}function c(P){return P===124||(s=!0,o+=1),u(P)}function u(P){return P===null?n(P):In(P)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),h):n(P):_r(P)?Nr(e,u,"whitespace")(P):(o+=1,s&&(s=!1,i+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),f(P)))}function f(P){return P===null||P===124||Wi(P)?(e.exit("data"),u(P)):(e.consume(P),P===92?d:f)}function d(P){return P===92||P===124?(e.consume(P),f):f(P)}function h(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),s=!1,_r(P)?Nr(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):p(P))}function p(P){return P===45||P===58?m(P):P===124?(s=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),g):S(P)}function g(P){return _r(P)?Nr(e,m,"whitespace")(P):m(P)}function m(P){return P===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),v):P===45?(o+=1,v(P)):P===null||In(P)?w(P):S(P)}function v(P){return P===45?(e.enter("tableDelimiterFiller"),y(P)):S(P)}function y(P){return P===45?(e.consume(P),y):P===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(P))}function b(P){return _r(P)?Nr(e,w,"whitespace")(P):w(P)}function w(P){return P===124?p(P):P===null||In(P)?!s||i!==o?S(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):S(P)}function S(P){return n(P)}function _(P){return e.enter("tableRow"),E(P)}function E(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),E):P===null||In(P)?(e.exit("tableRow"),t(P)):_r(P)?Nr(e,E,"whitespace")(P):(e.enter("data"),T(P))}function T(P){return P===null||P===124||Wi(P)?(e.exit("data"),E(P)):(e.consume(P),P===92?k:T)}function k(P){return P===92||P===124?(e.consume(P),T):T(P)}}function q_n(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,u,f;const d=new U_n;for(;++nn[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(o.end=Object.assign({},MC(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function I2e(e,t,n,r,i){const o=[],s=MC(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function MC(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const X_n={tokenize:Q_n},Y_n={text:{91:X_n}};function Q_n(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Wi(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return In(l)?t(l):_r(l)?e.check({tokenize:K_n},t,n)(l):n(l)}}function K_n(e,t,n){return Nr(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Z_n(e){return GJe([__n,I_n(),B_n(e),H_n,Y_n])}function D2e(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function J_n(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const eCn={}.hasOwnProperty,tCn=(function(e,t,n,r){let i,o;typeof t=="string"||t instanceof RegExp?(o=[[t,n]],i=r):(o=t,i=n),i||(i={});const s=Uge(i.ignore||[]),a=nCn(o);let l=-1;for(;++l0?{type:"text",value:E}:void 0),E!==!1&&(m!==S&&b.push({type:"text",value:f.value.slice(m,S)}),Array.isArray(E)?b.push(...E):E&&b.push(E),m=S+w[0].length,y=!0),!p.global)break;w=p.exec(f.value)}return y?(me}const ZX="phrasing",JX=["autolink","link","image","label"],rCn={transforms:[uCn],enter:{literalAutolink:oCn,literalAutolinkEmail:eY,literalAutolinkHttp:eY,literalAutolinkWww:eY},exit:{literalAutolink:cCn,literalAutolinkEmail:lCn,literalAutolinkHttp:sCn,literalAutolinkWww:aCn}},iCn={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ZX,notInConstruct:JX},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ZX,notInConstruct:JX},{character:":",before:"[ps]",after:"\\/",inConstruct:ZX,notInConstruct:JX}]};function oCn(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function eY(e){this.config.enter.autolinkProtocol.call(this,e)}function sCn(e){this.config.exit.autolinkProtocol.call(this,e)}function aCn(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function lCn(e){this.config.exit.autolinkEmail.call(this,e)}function cCn(e){this.exit(e)}function uCn(e){tCn(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fCn],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,dCn]],{ignore:["link","linkReference"]})}function fCn(e,t,n,r,i){let o="";if(!Iet(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!hCn(n)))return!1;const s=pCn(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function dCn(e,t,n,r){return!Iet(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function hCn(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function pCn(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=D2e(e,"(");let o=D2e(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Iet(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Fw(n)||rW(n))&&(!t||n!==47)}function Det(e){return e.label||!e.identifier?e.label||"":ret(e.identifier)}function gCn(e,t,n){const r=t.indexStack,i=e.children||[],o=t.createTracker(n),s=[];let a=-1;for(r.push(-1);++a{e.run(eZe(n,t),r,o=>{i(o)})}}function Mxn(e){return t=>eZe(t,e)}class CL{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}CL.prototype.property={};CL.prototype.normal={};CL.prototype.space=null;function tZe(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Lxn.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(MPe,zxn);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!MPe.test(o)){let s=o.replace(Fxn,Nxn);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Dpe}return new i(r,t)}function Nxn(e){return"-"+e.toLowerCase()}function zxn(e){return e.charAt(1).toUpperCase()}const APe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},jxn=tZe([iZe,rZe,aZe,lZe,Ixn],"html"),Bxn=tZe([iZe,rZe,aZe,lZe,Dxn],"svg");function Uxn(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{Rpe(t,"element",(n,r,i)=>{const o=i;let s;if(e.allowedElements?s=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(s=e.disallowedElements.includes(n.tagName)),!s&&e.allowElement&&typeof r=="number"&&(s=!e.allowElement(n,r,o)),s&&typeof r=="number")return e.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}var Uq={exports:{}},hi={};var RPe;function Vxn(){if(RPe)return hi;RPe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function g(m){if(typeof m=="object"&&m!==null){var v=m.$$typeof;switch(v){case e:switch(m=m.type,m){case n:case i:case r:case c:case u:return m;default:switch(m=m&&m.$$typeof,m){case a:case s:case l:case d:case f:case o:return m;default:return v}}case t:return v}}}return hi.ContextConsumer=s,hi.ContextProvider=o,hi.Element=e,hi.ForwardRef=l,hi.Fragment=n,hi.Lazy=d,hi.Memo=f,hi.Portal=t,hi.Profiler=i,hi.StrictMode=r,hi.Suspense=c,hi.SuspenseList=u,hi.isAsyncMode=function(){return!1},hi.isConcurrentMode=function(){return!1},hi.isContextConsumer=function(m){return g(m)===s},hi.isContextProvider=function(m){return g(m)===o},hi.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},hi.isForwardRef=function(m){return g(m)===l},hi.isFragment=function(m){return g(m)===n},hi.isLazy=function(m){return g(m)===d},hi.isMemo=function(m){return g(m)===f},hi.isPortal=function(m){return g(m)===t},hi.isProfiler=function(m){return g(m)===i},hi.isStrictMode=function(m){return g(m)===r},hi.isSuspense=function(m){return g(m)===c},hi.isSuspenseList=function(m){return g(m)===u},hi.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===i||m===r||m===c||m===u||m===h||typeof m=="object"&&m!==null&&(m.$$typeof===d||m.$$typeof===f||m.$$typeof===o||m.$$typeof===s||m.$$typeof===l||m.$$typeof===p||m.getModuleId!==void 0)},hi.typeOf=g,hi}var IPe;function Wxn(){return IPe||(IPe=1,Uq.exports=Vxn()),Uq.exports}var Hxn=Wxn();const Gxn=Yn(Hxn);function qxn(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function Xxn(e){return e.join(" ").trim()}function Yxn(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var TN={exports:{}},Vq,DPe;function Qxn(){if(DPe)return Vq;DPe=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=` +`,c="/",u="*",f="",d="comment",h="declaration";Vq=function(g,m){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];m=m||{};var v=1,y=1;function b(F){var A=F.match(t);A&&(v+=A.length);var L=F.lastIndexOf(l);y=~L?F.length-L:y+F.length}function w(){var F={line:v,column:y};return function(A){return A.position=new S(F),T(),A}}function S(F){this.start=F,this.end={line:v,column:y},this.source=m.source}S.prototype.content=g;function _(F){var A=new Error(m.source+":"+v+":"+y+": "+F);if(A.reason=F,A.filename=m.source,A.line=v,A.column=y,A.source=g,!m.silent)throw A}function E(F){var A=F.exec(g);if(A){var L=A[0];return b(L),g=g.slice(L.length),A}}function T(){E(n)}function k(F){var A;for(F=F||[];A=P();)A!==!1&&F.push(A);return F}function P(){var F=w();if(!(c!=g.charAt(0)||u!=g.charAt(1))){for(var A=2;f!=g.charAt(A)&&(u!=g.charAt(A)||c!=g.charAt(A+1));)++A;if(A+=2,f===g.charAt(A-1))return _("End of comment missing");var L=g.slice(2,A-2);return y+=2,b(L),g=g.slice(A),y+=2,F({type:d,comment:L})}}function I(){var F=w(),A=E(r);if(A){if(P(),!E(i))return _("property missing ':'");var L=E(o),$=F({type:h,property:p(A[0].replace(e,f)),value:L?p(L[0].replace(e,f)):f});return E(s),$}}function R(){var F=[];k(F);for(var A;A=I();)A!==!1&&(F.push(A),k(F));return F}return T(),R()};function p(g){return g?g.replace(a,f):f}return Vq}var LPe;function Kxn(){if(LPe)return TN.exports;LPe=1;var e=Qxn();function t(n,r){var i=null;if(!n||typeof n!="string")return i;for(var o,s=e(n),a=typeof r=="function",l,c,u=0,f=s.length;u0?Te.createElement(h,l,f):Te.createElement(h,l)}function n1n(e){let t=-1;for(;++t for more info)`),delete PN[o]}const t=Dyn().use(zbn).use(e.remarkPlugins||[]).use(Pxn,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(Uxn,e),n=new MKe;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=Te.createElement(Te.Fragment,{},cZe({options:e,schema:jxn,listDepth:0},r));return e.className&&(i=Te.createElement("div",{className:e.className},i)),i}uZe.propTypes={children:le.string,className:le.string,allowElement:le.func,allowedElements:le.arrayOf(le.string),disallowedElements:le.arrayOf(le.string),unwrapDisallowed:le.bool,remarkPlugins:le.arrayOf(le.oneOfType([le.object,le.func,le.arrayOf(le.oneOfType([le.bool,le.string,le.object,le.func,le.arrayOf(le.any)]))])),rehypePlugins:le.arrayOf(le.oneOfType([le.object,le.func,le.arrayOf(le.oneOfType([le.bool,le.string,le.object,le.func,le.arrayOf(le.any)]))])),sourcePos:le.bool,rawSourcePos:le.bool,skipHtml:le.bool,includeElementIndex:le.bool,transformLinkUri:le.oneOfType([le.func,le.bool]),linkTarget:le.oneOfType([le.func,le.string]),transformImageUri:le.func,components:le.object};const l1n={tokenize:p1n,partial:!0},fZe={tokenize:g1n,partial:!0},dZe={tokenize:m1n,partial:!0},hZe={tokenize:v1n,partial:!0},c1n={tokenize:y1n,partial:!0},pZe={tokenize:d1n,previous:mZe},gZe={tokenize:h1n,previous:vZe},$v={tokenize:f1n,previous:yZe},kg={},u1n={text:kg};let wx=48;for(;wx<123;)kg[wx]=$v,wx++,wx===58?wx=65:wx===91&&(wx=97);kg[43]=$v;kg[45]=$v;kg[46]=$v;kg[95]=$v;kg[72]=[$v,gZe];kg[104]=[$v,gZe];kg[87]=[$v,pZe];kg[119]=[$v,pZe];function f1n(e,t,n){const r=this;let i,o;return s;function s(f){return!Lre(f)||!yZe.call(r,r.previous)||Lpe(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Lre(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(c1n,u,c)(f):f===45||f===95||fl(f)?(o=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),i=!0,l}function u(f){return o&&i&&Nl(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function d1n(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!mZe.call(r,r.previous)||Lpe(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(l1n,e.attempt(fZe,e.attempt(dZe,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function h1n(e,t,n){const r=this;let i="",o=!1;return s;function s(f){return(f===72||f===104)&&vZe.call(r,r.previous)&&!Lpe(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(Nl(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),o?c:(o=!0,l)):n(f)}function c(f){return f===null||jB(f)||Wi(f)||kw(f)||M8(f)?n(f):e.attempt(fZe,e.attempt(dZe,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function p1n(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function g1n(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(hZe,l,a)(c):c===null||Wi(c)||kw(c)||c!==45&&M8(c)?l(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function l(c){return i||r||!o?n(c):t(c)}}function m1n(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const b1n={tokenize:T1n,partial:!0};function x1n(){return{document:{91:{tokenize:C1n,continuation:{tokenize:O1n},exit:E1n}},text:{91:{tokenize:_1n},93:{add:"after",tokenize:w1n,resolveTo:S1n}}}}function w1n(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const c=uh(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function S1n(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function _1n(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(o>999||f===93&&!s||f===null||f===91||Wi(f))return n(f);if(f===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(uh(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Wi(f)||(s=!0),o++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),o++,c):c(f)}}function C1n(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(s>999||p===93&&!a||p===null||p===91||Wi(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return o=uh(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Wi(p)||(a=!0),s++,e.consume(p),p===92?f:u}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,u):u(p)}function d(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(o)||i.push(o),zr(e,h,"gfmFootnoteDefinitionWhitespace")):n(p)}function h(p){return t(p)}}function O1n(e,t,n){return e.check(_L,t,e.attempt(b1n,t,n))}function E1n(e){e.exit("gfmFootnoteDefinition")}function T1n(e,t,n){const r=this;return zr(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function P1n(e){let n=(e||{}).singleTilde;const r={tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l1?l(p):(s.consume(p),f++,h);if(f<2&&!n)return l(p);const m=s.exit("strikethroughSequenceTemporary"),v=BB(p);return m._open=!v||v===2&&!!g,m._close=!g||g===2&&!!v,a(p)}}}class k1n{constructor(){this.map=[]}add(t,n,r){M1n(this,t,n,r)}consume(t){if(this.map.sort((o,s)=>o[0]-s[0]),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1])),r.push(this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function M1n(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const A=r.events[I][1].type;if(A==="lineEnding"||A==="linePrefix")I--;else break}const R=I>-1?r.events[I][1].type:null,F=R==="tableHead"||R==="tableRow"?_:l;return F===_&&r.parser.lazy[r.now().line]?n(P):F(P)}function l(P){return e.enter("tableHead"),e.enter("tableRow"),c(P)}function c(P){return P===124||(s=!0,o+=1),u(P)}function u(P){return P===null?n(P):In(P)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),h):n(P):Or(P)?zr(e,u,"whitespace")(P):(o+=1,s&&(s=!1,i+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),f(P)))}function f(P){return P===null||P===124||Wi(P)?(e.exit("data"),u(P)):(e.consume(P),P===92?d:f)}function d(P){return P===92||P===124?(e.consume(P),f):f(P)}function h(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),s=!1,Or(P)?zr(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):p(P))}function p(P){return P===45||P===58?m(P):P===124?(s=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),g):S(P)}function g(P){return Or(P)?zr(e,m,"whitespace")(P):m(P)}function m(P){return P===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),v):P===45?(o+=1,v(P)):P===null||In(P)?w(P):S(P)}function v(P){return P===45?(e.enter("tableDelimiterFiller"),y(P)):S(P)}function y(P){return P===45?(e.consume(P),y):P===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(P))}function b(P){return Or(P)?zr(e,w,"whitespace")(P):w(P)}function w(P){return P===124?p(P):P===null||In(P)?!s||i!==o?S(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):S(P)}function S(P){return n(P)}function _(P){return e.enter("tableRow"),E(P)}function E(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),E):P===null||In(P)?(e.exit("tableRow"),t(P)):Or(P)?zr(e,E,"whitespace")(P):(e.enter("data"),T(P))}function T(P){return P===null||P===124||Wi(P)?(e.exit("data"),E(P)):(e.consume(P),P===92?k:T)}function k(P){return P===92||P===124?(e.consume(P),T):T(P)}}function D1n(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,u,f;const d=new k1n;for(;++nn[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(o.end=Object.assign({},xC(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function $Pe(e,t,n,r,i){const o=[],s=xC(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function xC(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const L1n={tokenize:$1n},F1n={text:{91:L1n}};function $1n(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Wi(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return In(l)?t(l):Or(l)?e.check({tokenize:N1n},t,n)(l):n(l)}}function N1n(e,t,n){return zr(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function z1n(e){return DKe([u1n,x1n(),P1n(e),R1n,F1n])}function NPe(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function j1n(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const B1n={}.hasOwnProperty,U1n=(function(e,t,n,r){let i,o;typeof t=="string"||t instanceof RegExp?(o=[[t,n]],i=r):(o=t,i=n),i||(i={});const s=Ape(i.ignore||[]),a=V1n(o);let l=-1;for(;++l0?{type:"text",value:E}:void 0),E!==!1&&(m!==S&&b.push({type:"text",value:f.value.slice(m,S)}),Array.isArray(E)?b.push(...E):E&&b.push(E),m=S+w[0].length,y=!0),!p.global)break;w=p.exec(f.value)}return y?(me}const Hq="phrasing",Gq=["autolink","link","image","label"],W1n={transforms:[K1n],enter:{literalAutolink:G1n,literalAutolinkEmail:qq,literalAutolinkHttp:qq,literalAutolinkWww:qq},exit:{literalAutolink:Q1n,literalAutolinkEmail:Y1n,literalAutolinkHttp:q1n,literalAutolinkWww:X1n}},H1n={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Hq,notInConstruct:Gq},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Hq,notInConstruct:Gq},{character:":",before:"[ps]",after:"\\/",inConstruct:Hq,notInConstruct:Gq}]};function G1n(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qq(e){this.config.enter.autolinkProtocol.call(this,e)}function q1n(e){this.config.exit.autolinkProtocol.call(this,e)}function X1n(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function Y1n(e){this.config.exit.autolinkEmail.call(this,e)}function Q1n(e){this.exit(e)}function K1n(e){U1n(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Z1n],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,J1n]],{ignore:["link","linkReference"]})}function Z1n(e,t,n,r,i){let o="";if(!bZe(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!ewn(n)))return!1;const s=twn(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function J1n(e,t,n,r){return!bZe(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ewn(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function twn(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=NPe(e,"(");let o=NPe(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function bZe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||kw(n)||M8(n))&&(!t||n!==47)}function xZe(e){return e.label||!e.identifier?e.label||"":HKe(e.identifier)}function nwn(e,t,n){const r=t.indexStack,i=e.children||[],o=t.createTracker(n),s=[];let a=-1;for(r.push(-1);++a `}return` -`}const vCn=/\r?\n|\r/g;function yCn(e,t){const n=[];let r=0,i=0,o;for(;o=vCn.exec(e);)s(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return s(e.slice(r)),n.join("");function s(a){n.push(t(a,i,!a))}}function Let(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function bCn(e,t){return $2e(e,t.inConstruct,!0)&&!$2e(e,t.notInConstruct,!1)}function $2e(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r=c||u+10?" ":"")),i.shift(4),o+=i.move(yCn(gCn(e,n,i.current()),ICn)),s(),o}function ICn(e,t,n){return t===0?e:(n?"":" ")+e}function Net(e,t,n){const r=t.indexStack,i=e.children||[],o=[];let s=-1,a=n.before;r.push(-1);let l=t.createTracker(n);for(;++s0&&(a==="\r"||a===` -`)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(o.join(""))),o.push(l.move(t.handle(c,e,t,{...l.current(),before:a,after:u}))),a=o[o.length-1].slice(-1)}return r.pop(),o.join("")}const DCn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zet.peek=zCn;const LCn={canContainEols:["delete"],enter:{strikethrough:$Cn},exit:{strikethrough:NCn}},FCn={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:DCn}],handlers:{delete:zet}};function $Cn(e){this.enter({type:"delete",children:[]},e)}function NCn(e){this.exit(e)}function zet(e,t,n,r){const i=sW(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=Net(e,n,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function zCn(){return"~"}jet.peek=jCn;function jet(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++oc&&(c=e[u].length);++vl[v])&&(l[v]=b)}g.push(y)}s[u]=g,a[u]=m}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=y),h[f]=y),d[f]=b}s.splice(1,0,d),a.splice(1,0,h),u=-1;const p=[];for(;++un==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function GCn(e){this.exit(e),this.setData("inTable")}function qCn(e){this.enter({type:"tableRow",children:[]},e)}function tY(e){this.exit(e)}function j2e(e){this.enter({type:"tableCell",children:[]},e)}function XCn(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,YCn));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function YCn(e,t){return t==="|"?t:e}function QCn(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`}const iwn=/\r?\n|\r/g;function own(e,t){const n=[];let r=0,i=0,o;for(;o=iwn.exec(e);)s(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return s(e.slice(r)),n.join("");function s(a){n.push(t(a,i,!a))}}function wZe(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function swn(e,t){return BPe(e,t.inConstruct,!0)&&!BPe(e,t.notInConstruct,!1)}function BPe(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r=c||u+10?" ":"")),i.shift(4),o+=i.move(own(nwn(e,n,i.current()),xwn)),s(),o}function xwn(e,t,n){return t===0?e:(n?"":" ")+e}function CZe(e,t,n){const r=t.indexStack,i=e.children||[],o=[];let s=-1,a=n.before;r.push(-1);let l=t.createTracker(n);for(;++s0&&(a==="\r"||a===` +`)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(o.join(""))),o.push(l.move(t.handle(c,e,t,{...l.current(),before:a,after:u}))),a=o[o.length-1].slice(-1)}return r.pop(),o.join("")}const wwn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];OZe.peek=Ewn;const Swn={canContainEols:["delete"],enter:{strikethrough:Cwn},exit:{strikethrough:Own}},_wn={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wwn}],handlers:{delete:OZe}};function Cwn(e){this.enter({type:"delete",children:[]},e)}function Own(e){this.exit(e)}function OZe(e,t,n,r){const i=I8(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=CZe(e,n,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function Ewn(){return"~"}EZe.peek=Twn;function EZe(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++oc&&(c=e[u].length);++vl[v])&&(l[v]=b)}g.push(y)}s[u]=g,a[u]=m}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=y),h[f]=y),d[f]=b}s.splice(1,0,d),a.splice(1,0,h),u=-1;const p=[];for(;++un==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function Iwn(e){this.exit(e),this.setData("inTable")}function Dwn(e){this.enter({type:"tableRow",children:[]},e)}function Xq(e){this.exit(e)}function WPe(e){this.enter({type:"tableCell",children:[]},e)}function Lwn(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,Fwn));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function Fwn(e,t){return t==="|"?t:e}function $wn(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:s,tableRow:a,tableCell:l,inlineCode:d}};function s(h,p,g,m){return c(u(h,g,m),h.align)}function a(h,p,g,m){const v=f(h,g,m),y=c([v]);return y.slice(0,y.indexOf(` -`))}function l(h,p,g,m){const v=g.enter("tableCell"),y=g.enter("phrasing"),b=Net(h,g,{...m,before:o,after:o});return y(),v(),b}function c(h,p){return UCn(h,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(h,p,g){const m=h.children;let v=-1;const y=[],b=p.enter("table");for(;++v-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(f,d,h){return d?(h?"":" ".repeat(s))+f:(h?o:o+" ".repeat(s-o.length))+f}}const eOn={exit:{taskListCheckValueChecked:B2e,taskListCheckValueUnchecked:B2e,paragraph:nOn}},tOn={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rOn}};function B2e(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function nOn(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1],r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o({p:i=>{const{node:o,...s}=i;return O.jsx("p",{...s,style:{padding:0,margin:0}})},a:i=>{const{node:o,...s}=i;return O.jsx("a",{...s,style:{color:n.palette.mode==="dark"?"#90caf9":"#1e90ff"}})},code:i=>{const{node:o,...s}=i;return O.jsx("code",{...s,style:{color:n.palette.mode==="dark"?"#bbb":"#666"}})},img:i=>{const o=n.palette.mode,{node:s,...a}=i,l=a.alt,c=a.src,[u,f]=c.split("#");if(f==="light-mode-only"&&o!=="light"||f==="dark-mode-only"&&o!=="dark")return null;const d={display:"block",margin:"1rem auto",maxWidth:"100%"};return O.jsx("img",{src:t?t+u:u,alt:l,style:d})}}),[n,t]);return e?O.jsx(Cet,{children:e,components:r,linkTarget:"_blank",remarkPlugins:[sOn]}):null}function aOn(){return{components:[["Markdown",Hb]]}}function lOn(e){return(t,n)=>{const r=Vo(n());k$t({plugins:[l8t(),Exn(),aOn()],hostStore:Txn(e),logging:{enabled:Pxn},api:{serverUrl:r.url,endpointName:"viewer/ext"}})}}const Bet="POST_MESSAGE";function aa(e,t){return{type:Bet,messageType:e,messageText:typeof t=="string"?t:t.message}}const Uet="HIDE_MESSAGE";function cOn(e){return{type:Uet,messageId:e}}var nY,U2e;function uOn(){return U2e||(U2e=1,nY={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]}),nY}var fOn=uOn();const V2e=Vn(fOn);var W2e={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function dOn(e){var t,n=[],r=1,i;if(typeof e=="string")if(e=e.toLowerCase(),V2e[e])n=V2e[e].slice(),i="rgb";else if(e==="transparent")r=0,i="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var o=e.slice(1),s=o.length,a=s<=4;r=1,a?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],s===4&&(r=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],s===8&&(r=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var l=t[1],c=l==="rgb",o=l.replace(/a$/,"");i=o;var s=o==="cmyk"?4:o==="gray"?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===s?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(W2e[d]!==void 0)return W2e[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[s]===void 0?1:n[s],n=n.slice(0,s)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),i=e.match(/([a-z])/ig).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(n=[e[0],e[1],e[2]],i="rgb",r=e.length===4?e[3]:1):e instanceof Object&&(e.r!=null||e.red!=null||e.R!=null?(i="rgb",n=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(i="hsl",n=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),r=e.a||e.alpha||e.opacity||1,e.opacity!=null&&(r/=100)):(i="rgb",n=[e>>>16,(e&65280)>>>8,e&255]);return{space:i,values:n,alpha:r}}const Uie={min:[0,0,0],max:[255,255,255]};var rY={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100,i,o,s,a,l,c=0;if(n===0)return l=r*255,[l,l,l];for(o=r<.5?r*(1+n):r+n-r*n,i=2*r-o,a=[0,0,0];c<3;)s=t+1/3*-(c-1),s<0?s++:s>1&&s--,l=6*s<1?i+(o-i)*6*s:2*s<1?o:3*s<2?i+(o-i)*(2/3-s)*6:i,a[c++]=l*255;return a}};Uie.hsl=function(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=o-i,a,l,c;return o===i?a=0:t===o?a=(n-r)/s:n===o?a=2+(r-t)/s:r===o&&(a=4+(t-n)/s),a=Math.min(a*60,360),a<0&&(a+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=s/(o+i):l=s/(2-o-i),[a,l*100,c*100]};function hOn(e){Array.isArray(e)&&e.raw&&(e=String.raw(...arguments));var t,n=dOn(e);if(!n.space)return[];const r=n.space[0]==="h"?rY.min:Uie.min,i=n.space[0]==="h"?rY.max:Uie.max;return t=Array(3),t[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),t[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),t[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(t=rY.rgb(t)),t.push(Math.min(Math.max(n.alpha,0),1)),t}function qge(e,t,n,r="circle"){if(e.getGeometry()instanceof zp)e.setStyle(pOn(7,t,"white",2,r));else{n=typeof n=="number"?n:.25;let i=hOn(t);Array.isArray(i)&&i.length===4?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],e.setStyle(mOn(i,t,2))}}function pOn(e,t,n,r,i="circle"){return new Op({image:gOn(e,t,n,r,i)})}function gOn(e,t,n,r,i){const o=new cw({color:t}),s=new jp({color:n,width:r});switch(i){case"square":return new Vte({fill:o,stroke:s,radius:e,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new Vte({fill:o,stroke:s,radius:e,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new gD({fill:o,stroke:s,radius:e})}}function mOn(e,t,n){const r=new cw({color:e}),i=new jp({color:t,width:n});return new Op({fill:r,stroke:i})}function vOn(e,t,n){Qs[e]}function yOn(e,t,n){if(Qs[e]){const o=Qs[e].getSource()?.getFeatureById(t);o&&qge(o,n.color,n.opacity)}}function bOn(e,t,n){if(Qs[e]){const r=Qs[e],i=r.getView().getProjection(),s=(Array.isArray(t)?Ate(t):t).transform(aS,i);s.getType()==="Point"?r.getView().setCenter(s.getFirstCoordinate()):n?r.getView().fit(s,{size:r.getSize()}):r.getView().setCenter(X0(s.getExtent()))}}function xOn(){return{current:Qs.map?Qs.map.getTargetElement():null}}const Vet="1.7.1",wOn=["userPlaceGroups","timeSeriesGroups","statistics","datasets"],SOn=["selectedDatasetId","selectedVariableName","selectedDataset2Id","selectedVariable2Name","selectedTime","selectedTimeRange","selectedUserPlaceId","selectedPlaceId","selectedPlaceGroupIds","layerMenuOpen","layerVisibilities","sidePanelOpen","sidePanelId","sidePanelSize","variableSplitPos","variableCompareMode","userBaseMaps","userOverlays","userColorBars","mapProjection"];function _On(e){return{version:Vet,creationDate:new Date().toUTCString(),apiUrl:Vo(e).url,viewerUrl:ST.origin,state:{dataState:H2e(e.dataState,wOn),controlState:H2e(e.controlState,SOn),mapState:COn()}}}function H2e(e,t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}function COn(){if(Qs.map){const t=Qs.map.getView(),n=t.getProjection().getCode(),r=t.getCenter();if(r!==void 0){const i=t.getZoom(),o=t.getRotation();return{view:{projection:n,center:r,zoom:i,rotation:o}}}}}const Xge="APPLY_PERSISTED_STATE";function OOn(e){return t=>{console.debug("Restoring persisted state:",e),t(EOn(e));const{mapState:n}=e.state;n&&TOn(n)}}function EOn(e){return{type:Xge,persistedState:e}}function TOn(e){Qs.map&&(console.debug("Restoring map:",e),Qs.map.setView(new pp(e.view)))}function Wet(e,t){return e?t.map(n=>e.querySelector(n)).filter(Boolean):[]}const p4="UPDATE_SERVER_INFO";function POn(){return(e,t)=>{const n=Vo(t());e($L(p4,Ce.get("Connecting to server"))),NPt(n.url).then(r=>{e(kOn(r))}).catch(r=>{e(aa("error",r))}).then(()=>{e(NL(p4))})}}function kOn(e){return{type:p4,serverInfo:e}}const G2e="SHARE_STATE_PERMALINK";function Het(){return(e,t)=>{const n=Vo(t());e($L(G2e,Ce.get("Creating permalink"))),WPt(n.url,t().userAuthState.accessToken,_On(t())).then(r=>{if(r){const i=window.location,s=`${i.origin+i.pathname}?stateKey=${r}`,a=On.instance.branding.permalinkExpirationDays,l=typeof a=="number"?Ce.get("Permalink copied to clipboard (expires in ${expiration} days)",{expiration:a}):Ce.get("Permalink copied to clipboard");navigator.clipboard.writeText(s).then(()=>{e(aa("success",l))})}else e(aa("error",Ce.get("Failed to create permalink")))}).finally(()=>e(NL(G2e)))}}const q2e="UPDATE_RESOURCES";function Get(){return(e,t)=>{const n=Vo(t());e($L(q2e,Ce.get("Updating resources"))),UPt(n.url,t().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>e(NL(q2e)))}}const LR="UPDATE_DATASETS";function qet(){return(e,t)=>{const n=Vo(t());e($L(LR,Ce.get("Loading data"))),IPt(n.url,t().userAuthState.accessToken).then(r=>{let i=r.datasets;const o=r.entrypointDatasetId,s=mPt();if(i&&i.length>0){i=i.map(l=>({...l,variables:[...l.variables,...s[l.id]||[]]})),e(X2e(i,o));const a=t().controlState.selectedDatasetId||o||i[0].id;e(ptt(a,i,!0))}}).catch(r=>{e(aa("error",r)),e(X2e([]))}).then(()=>{e(NL(LR))})}}function X2e(e,t){return{type:LR,datasets:e,entrypointDatasetId:t}}function MOn(e,t){return(n,r)=>{n(AOn(e,t));const i={};r().dataState.datasets.forEach(o=>{const[s,a]=Jle(o);a.length>=0&&(i[o.id]=a)}),gPt(i)}}const Xet="UPDATE_DATASET_USER_VARIABLES";function AOn(e,t){return{type:Xet,datasetId:e,userVariables:t}}const Yge="UPDATE_DATASET_PLACE_GROUP";function ROn(e,t){return{type:Yge,datasetId:e,placeGroup:t}}const Qge="ADD_DRAWN_USER_PLACE";function IOn(e,t,n,r,i){return(o,s)=>{o(DOn(e,t,n,r,i)),s().controlState.autoShowTimeSeries&&s().controlState.selectedPlaceId===t&&o(aW())}}function DOn(e,t,n,r,i){return{type:Qge,placeGroupTitle:e,id:t,properties:n,geometry:r,selected:i}}const Kge="ADD_IMPORTED_USER_PLACES";function LOn(e,t,n){return{type:Kge,placeGroups:e,mapProjection:t,selected:n}}function Yet(e){return(t,n)=>{const r=oLt(n());let i;try{if(r==="csv"){const o=sLt(n());i=ePt(e,o)}else if(r==="geojson"){const o=aLt(n());i=oPt(e,o)}else if(r==="wkt"){const o=lLt(n());i=uPt(e,o)}else i=[]}catch(o){t(aa("error",o)),t(FS("addUserPlacesFromText")),i=[]}if(i.length>0){if(t(LOn(i,Ov(n()),!0)),i.length===1&&i[0].features.length===1){const s=i[0].features[0];t(lW(s.id,OD(n()),!0)),n().controlState.autoShowTimeSeries&&t(aW())}let o=0;i.forEach(s=>{o+=s.features?s.features.length:0}),t(aa("info",Ce.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else t(aa("warning",Ce.get("No places imported")))}}const Zge="RENAME_USER_PLACE_GROUP";function FOn(e,t){return{type:Zge,placeGroupId:e,newName:t}}const Qet="RENAME_USER_PLACE";function $On(e,t,n){return r=>{r(NOn(e,t,n)),vOn(e)}}function NOn(e,t,n){return{type:Qet,placeGroupId:e,placeId:t,newName:n}}const Ket="RESTYLE_USER_PLACE";function zOn(e,t,n){return r=>{r(jOn(e,t,n)),yOn(e,t,n)}}function jOn(e,t,n){return{type:Ket,placeGroupId:e,placeId:t,placeStyle:n}}const Jge="REMOVE_USER_PLACE";function BOn(e,t,n){return{type:Jge,placeGroupId:e,placeId:t,places:n}}const Zet="REMOVE_USER_PLACE_GROUP";function UOn(e){return{type:Zet,placeGroupId:e}}function Jet(){return(e,t)=>{const n=Vo(t()),r=Co(t()),i=nc(t()),o=ED(t()),s=gS(t()),a=t().controlState.sidePanelOpen,l=t().controlState.sidePanelId;r&&i&&o&&(l!=="stats"&&e(ome("stats")),a||e(ime(!0)),e(Y2e(null)),jPt(n.url,r,i,o,s,t().userAuthState.accessToken).then(c=>e(Y2e(c))).catch(c=>{e(aa("error",c))}))}}const ett="ADD_STATISTICS";function Y2e(e){return{type:ett,statistics:e}}const ttt="REMOVE_STATISTICS";function VOn(e){return{type:ttt,index:e}}function aW(){return(e,t)=>{const n=Vo(t()),r=Co(t()),i=DT(t()),o=nc(t()),s=hS(t()),a=Sce(t()),l=t().controlState.timeSeriesUpdateMode,c=t().controlState.timeSeriesUseMedian,u=t().controlState.timeSeriesIncludeStdev;let f=ULt(t());const d=t().controlState.sidePanelOpen,h=t().controlState.sidePanelId,p=W6e(t());if(r&&o&&s&&i){h!=="timeSeries"&&e(ome("timeSeries")),d||e(ime(!0));const g=i.labels,m=g.length;f=f>0?f:m;let v=m-1,y=v-f+1;const b=()=>{const S=y>=0?g[y]:null,_=g[v];return zPt(n.url,r,o,a.id,a.geometry,S,_,c,u,t().userAuthState.accessToken)},w=S=>{if(S!==null&&Q2e(p,a.id)){const _=y>0,E=_?(m-y)/m:1;e(WOn({...S,dataProgress:E},l,v===m-1?"new":"append")),_&&Q2e(p,a.id)&&(y-=f,v-=f,b().then(w))}else e(aa("info","No data found here"))};b().then(w).catch(S=>{e(aa("error",S))})}}}function Q2e(e,t){return Xle(e,t)!==null}const ntt="UPDATE_TIME_SERIES";function WOn(e,t,n){return{type:ntt,timeSeries:e,updateMode:t,dataMode:n}}const rtt="ADD_PLACE_GROUP_TIME_SERIES";function HOn(e,t){return{type:rtt,timeSeriesGroupId:e,timeSeries:t}}const itt="REMOVE_TIME_SERIES";function GOn(e,t){return{type:itt,groupId:e,index:t}}const ott="REMOVE_TIME_SERIES_GROUP";function qOn(e){return{type:ott,id:e}}const stt="REMOVE_ALL_TIME_SERIES";function XOn(){return{type:stt}}const eme="CONFIGURE_SERVERS";function YOn(e,t,n){return(r,i)=>{i().controlState.selectedServerId!==t?(r(XOn()),r(K2e(e,t)),r(tme(n))):i().dataState.userServers!==e&&r(K2e(e,t))}}function K2e(e,t){return{type:eme,servers:e,selectedServerId:t}}function tme(e,t=!1){return n=>{n(POn()),n(KOn()),n(JOn()),n(lOn(e));const r=Om.get("stateKey");n(r&&t?QOn(e,r):qet())}}function QOn(e,t){return(n,r)=>{const i=Vo(e.getState()).url;VPt(i,r().userAuthState.accessToken,t).then(o=>{if(typeof o=="object"){const s=o,{apiUrl:a}=s;n(a===i?OOn(s):aa("warning","Failed to restore state, backend mismatch"))}else n(aa("warning",o))})}}const att="UPDATE_EXPRESSION_CAPABILITIES";function KOn(){return(e,t)=>{const n=Vo(t());$Pt(n.url).then(r=>{e(ZOn(r))}).catch(r=>{e(aa("error",r))})}}function ZOn(e){return{type:att,expressionCapabilities:e}}const ltt="UPDATE_COLOR_BARS";function JOn(){return(e,t)=>{const n=Vo(t());kPt(n.url).then(r=>{e(eEn(r))}).catch(r=>{e(aa("error",r))})}}function eEn(e){return{type:ltt,colorBars:e}}const ctt="UPDATE_VARIABLE_COLOR_BAR";function tEn(e,t,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariableName;s&&a&&i(utt(s,a,e,t,n,r))}}function nEn(e,t,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariable2Name;s&&a&&i(utt(s,a,e,t,n,r))}}function utt(e,t,n,r,i,o){if(i==="log"){let[s,a]=r;s<=0&&(s=.001),a<=s&&(a=1),r=[s,a]}return{type:ctt,datasetId:e,variableName:t,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const ftt="UPDATE_VARIABLE_VOLUME";function rEn(e,t,n,r,i){return{type:ftt,datasetId:e,variableName:t,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function iEn(){return(e,t)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:s,exportFileName:a}=t().controlState;let l=[];n?(l=[],xD(t()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...wD(t())]):i&&(l=IT(t())),aEn(t().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:s,fileName:a})}}class dtt{}class oEn extends dtt{fileName;zipArchive;constructor(t){super(),this.fileName=t,this.zipArchive=new bFt}write(t,n){this.zipArchive.file(t,n)}close(){this.zipArchive.generateAsync({type:"blob"}).then(t=>LUe.saveAs(t,this.fileName))}}class sEn extends dtt{write(t,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});LUe.saveAs(r,t)}close(){}}function aEn(e,t,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:s}=n;let{separator:a,fileName:l}=n;if(a=a||"TAB",a.toUpperCase()==="TAB"&&(a=" "),l=l||"export",!r&&!i)return;let c;s?c=new oEn(`${l}.zip`):c=new sEn;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=$Dt(e,t),p={number:!0,string:!0},g=f.join(a),m=d.map(y=>y.map(b=>p[typeof b]?b+"":"").join(a)),v=[g].concat(m).join(` -`);c.write(`${l}.txt`,v),u=h}else u={},t.forEach(f=>{f.features&&f.features.forEach(d=>{u[d.id]=d})});if(i)if(o){const f={type:"FeatureCollection",features:Object.keys(u).map(d=>u[d])};c.write(`${l}.geojson`,JSON.stringify(f,null,2))}else Object.keys(u).forEach(f=>{c.write(`${f}.geojson`,JSON.stringify(u[f],null,2))});c.close()}const htt="SELECT_DATASET";function ptt(e,t,n){return(r,i)=>{r(lEn(e,t));const o=i().controlState.datasetLocateMode;e&&n&&o!=="doNothing"&&r(gtt(e,i().controlState.datasetLocateMode==="panAndZoom"))}}function lEn(e,t){return{type:htt,selectedDatasetId:e,datasets:t}}function cEn(){return(e,t)=>{const n=RT(t());n&&e(gtt(n,!0))}}function uEn(){return(e,t)=>{const n=hS(t());n&&e(mtt(n,!0))}}function gtt(e,t){return(n,r)=>{const i=xD(r()),o=dO(i,e);o&&o.bbox&&n(Vie(o.bbox,t))}}const fEn=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function mtt(e,t){return(n,r)=>{const i=IT(r()),o=Xle(i,e);o&&(o.bbox&&o.bbox.length===4?n(Vie(o.bbox,t)):o.geometry&&fEn.includes(o.geometry.type)&&n(Vie(new fS().readGeometry(o.geometry),t)))}}function Vie(e,t){return n=>{e!==null&&(n(dEn("map",e)),bOn("map",e,t))}}const vtt="FLY_TO";function dEn(e,t){return{type:vtt,mapId:e,location:t}}const ytt="SELECT_PLACE_GROUPS";function hEn(e){return(t,n)=>{const r=Vo(n());t(pEn(e));const i=Co(n()),o=vUe(n());if(i!==null&&o.length>0){for(const s of o)if(!OT(s)){const a=i.id,l=s.id,c=`${Yge}-${a}-${l}`;t($L(c,Ce.get("Loading places"))),FPt(r.url,a,l,n().userAuthState.accessToken).then(u=>{t(ROn(i.id,u))}).catch(u=>{t(aa("error",u))}).finally(()=>{t(NL(c))})}}}}function pEn(e){return{type:ytt,selectedPlaceGroupIds:e}}const btt="SELECT_PLACE";function lW(e,t,n){return(r,i)=>{r(gEn(e,t));const o=i().controlState.placeLocateMode;n&&e&&o!=="doNothing"&&r(mtt(e,i().controlState.placeLocateMode==="panAndZoom"))}}function gEn(e,t){return{type:btt,placeId:e,places:t}}const xtt="TOGGLE_DATASET_RGB_LAYER";function mEn(e){return{type:xtt,visible:e}}const wtt="SET_LAYER_VISIBILITIES";function Stt(e){return{type:wtt,layerVisibilities:e}}const _tt="SET_LAYER_GROUP_STATES";function vEn(e){return{type:_tt,layerGroupStates:e}}const Ctt="SET_MAP_POINT_INFO_BOX_ENABLED";function yEn(e){return{type:Ctt,mapPointInfoBoxEnabled:e}}const Ott="SET_VARIABLE_COMPARE_MODE";function bEn(e){return{type:Ott,variableCompareMode:e}}const nme="UPDATE_VARIABLE_SPLIT_POS";function xEn(e,t){return{type:nme,size:e,isDelta:t}}const Ett="SELECT_VARIABLE";function Ttt(e){return{type:Ett,selectedVariableName:e}}const Ptt="SELECT_VARIABLE_2";function wEn(e,t){return{type:Ptt,selectedDataset2Id:e,selectedVariable2Name:t}}const ktt="SELECT_TIME";function cW(e){return{type:ktt,selectedTime:e}}const Mtt="INC_SELECTED_TIME";function SEn(e){return{type:Mtt,increment:e}}const rme="SELECT_TIME_RANGE";function Att(e,t,n){return{type:rme,selectedTimeRange:e,selectedGroupId:t,selectedValueRange:n}}const _En="SELECT_TIME_SERIES_UPDATE_MODE",Rtt="UPDATE_TIME_ANIMATION";function CEn(e,t){return{type:Rtt,timeAnimationActive:e,timeAnimationInterval:t}}const Itt="SET_MAP_INTERACTION";function Dtt(e){return{type:Itt,mapInteraction:e}}const Ltt="SET_LAYER_MENU_OPEN";function Ftt(e){return{type:Ltt,layerMenuOpen:e}}const $tt="SET_SIDE_PANEL_OPEN";function ime(e){return{type:$tt,sidePanelOpen:e}}const Ntt="SET_SIDE_PANEL_ID";function ome(e){return{type:Ntt,sidePanelId:e}}const sme="UPDATE_SIDE_PANEL_SIZE";function OEn(e){return{type:sme,sizeDelta:e}}const ztt="SET_VOLUME_RENDER_MODE";function EEn(e){return{type:ztt,volumeRenderMode:e}}const jtt="UPDATE_VOLUME_STATE";function TEn(e,t){return{type:jtt,volumeId:e,volumeState:t}}const Btt="SET_VISIBLE_INFO_CARD_ELEMENTS";function PEn(e){return{type:Btt,visibleElements:e}}const Utt="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function kEn(e,t){return{type:Utt,elementType:e,viewMode:t}}const Vtt="ADD_ACTIVITY";function $L(e,t){return{type:Vtt,id:e,message:t}}const Wtt="REMOVE_ACTIVITY";function NL(e){return{type:Wtt,id:e}}const Htt="CHANGE_LOCALE";function ame(e){return{type:Htt,locale:e}}const Gtt="OPEN_DIALOG";function FS(e){return{type:Gtt,dialogId:e}}const qtt="CLOSE_DIALOG";function $S(e){return{type:qtt,dialogId:e}}const lme="UPDATE_SETTINGS";function zL(e){return{type:lme,settings:e}}const Xtt="STORE_SETTINGS";function Ytt(){return{type:Xtt}}function Qtt(e){return t=>{t(MEn(e)),t(AEn(e))}}const Ktt="ADD_USER_COLOR_BAR";function MEn(e){return{type:Ktt,colorBarId:e}}const Ztt="REMOVE_USER_COLOR_BAR";function Jtt(e){return{type:Ztt,colorBarId:e}}function ent(e){return t=>{t(nnt(e)),t(cme(e))}}const tnt="UPDATE_USER_COLOR_BAR";function nnt(e){return{type:tnt,userColorBar:e}}function AEn(e){return(t,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===e);r&&t(cme(r))}}function cme(e){return t=>{Fkt(e).then(({imageData:n,errorMessage:r})=>{t(nnt({...e,imageData:n,errorMessage:r}))})}}function REn(){return(e,t)=>{t().controlState.userColorBars.forEach(n=>{n.imageData||e(cme(n))})}}function rnt(e){return{type:lme,settings:{userColorBars:e}}}const ume="SET_ZOOM_LEVEL";function int(e){return{type:ume,zoomLevel:e}}const fme="SET_DATASET_Z_LEVEL";function IEn(e){return{type:fme,datasetZLevel:e}}function uW(e){const[t,n]=M.useState();return M.useEffect(()=>{e?fetch(e).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[e]),t}const ont=()=>{const e=On.instance.branding.configPath,t=uW(e+"about.en.md");return O.jsx(Hb,{text:t,path:e})},DEn=({open:e,closeDialog:t})=>{function n(){t("about")}const r=On.instance.branding.appBarTitle;return O.jsxs(Gu,{open:e,onClose:n,children:[O.jsx(gg,{children:Ce.get("About ${appName}",{appName:r})}),O.jsx(Nc,{children:O.jsx(ont,{})})]})},LEn=e=>({locale:e.controlState.locale,open:!!e.controlState.dialogOpen.about}),FEn={closeDialog:$S,changeLocale:ame},$En=dr(LEn,FEn)(DEn);var f5={exports:{}};const NEn={},zEn=Object.freeze(Object.defineProperty({__proto__:null,default:NEn},Symbol.toStringTag,{value:"Module"})),jEn=Sdt(zEn);var BEn=f5.exports,Z2e;function fW(){return Z2e||(Z2e=1,(function(e,t){(function(n,r){e.exports=r()})(BEn,function(){var n=n||(function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof Rs<"u"&&Rs.crypto&&(o=Rs.crypto),!o&&typeof J2=="function")try{o=jEn}catch{}var s=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||(function(){function y(){}return function(b){var w;return y.prototype=b,w=new y,y.prototype=null,w}})(),l={},c=l.lib={},u=c.Base=(function(){return{extend:function(y){var b=a(this);return y&&b.mixIn(y),(!b.hasOwnProperty("init")||this.init===b.init)&&(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var b in y)y.hasOwnProperty(b)&&(this[b]=y[b]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),f=c.WordArray=u.extend({init:function(y,b){y=this.words=y||[],b!=i?this.sigBytes=b:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var b=this.words,w=y.words,S=this.sigBytes,_=y.sigBytes;if(this.clamp(),S%4)for(var E=0;E<_;E++){var T=w[E>>>2]>>>24-E%4*8&255;b[S+E>>>2]|=T<<24-(S+E)%4*8}else for(var k=0;k<_;k+=4)b[S+k>>>2]=w[k>>>2];return this.sigBytes+=_,this},clamp:function(){var y=this.words,b=this.sigBytes;y[b>>>2]&=4294967295<<32-b%4*8,y.length=r.ceil(b/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var b=[],w=0;w>>2]>>>24-_%4*8&255;S.push((E>>>4).toString(16)),S.push((E&15).toString(16))}return S.join("")},parse:function(y){for(var b=y.length,w=[],S=0;S>>3]|=parseInt(y.substr(S,2),16)<<24-S%8*4;return new f.init(w,b/2)}},p=d.Latin1={stringify:function(y){for(var b=y.words,w=y.sigBytes,S=[],_=0;_>>2]>>>24-_%4*8&255;S.push(String.fromCharCode(E))}return S.join("")},parse:function(y){for(var b=y.length,w=[],S=0;S>>2]|=(y.charCodeAt(S)&255)<<24-S%4*8;return new f.init(w,b)}},g=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},m=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var b,w=this._data,S=w.words,_=w.sigBytes,E=this.blockSize,T=E*4,k=_/T;y?k=r.ceil(k):k=r.max((k|0)-this._minBufferSize,0);var P=k*E,R=r.min(P*4,_);if(P){for(var I=0;I>>7)^(k<<14|k>>>18)^k>>>3,R=f[T-2],I=(R<<15|R>>>17)^(R<<13|R>>>19)^R>>>10;f[T]=P+f[T-7]+I+f[T-16]}var F=w&S^~w&_,A=m&v^m&y^v&y,L=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),$=(w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25),j=E+$+F+u[T]+f[T],V=L+A;E=_,_=S,S=w,w=b+j|0,b=y,y=v,v=m,m=j+V|0}g[0]=g[0]+m|0,g[1]=g[1]+v|0,g[2]=g[2]+y|0,g[3]=g[3]+b|0,g[4]=g[4]+w|0,g[5]=g[5]+S|0,g[6]=g[6]+_|0,g[7]=g[7]+E|0},_doFinalize:function(){var h=this._data,p=h.words,g=this._nDataBytes*8,m=h.sigBytes*8;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=r.floor(g/4294967296),p[(m+64>>>9<<4)+15]=g,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=a._createHelper(d),i.HmacSHA256=a._createHmacHelper(d)})(Math),n.SHA256})})(d5)),d5.exports}var GEn=HEn();const qEn=Vn(GEn);var h5={exports:{}},XEn=h5.exports,eMe;function YEn(){return eMe||(eMe=1,(function(e,t){(function(n,r){e.exports=r(fW())})(XEn,function(n){return(function(){var r=n,i=r.lib,o=i.WordArray,s=r.enc;s.Base64={stringify:function(l){var c=l.words,u=l.sigBytes,f=this._map;l.clamp();for(var d=[],h=0;h>>2]>>>24-h%4*8&255,g=c[h+1>>>2]>>>24-(h+1)%4*8&255,m=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|g<<8|m,y=0;y<4&&h+y*.75>>6*(3-y)&63));var b=f.charAt(64);if(b)for(;d.length%4;)d.push(b);return d.join("")},parse:function(l){var c=l.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d>>6-h%4*2,m=p|g;f[d>>>2]|=m<<24-d%4*8,d++}return o.create(f,d)}})(),n.enc.Base64})})(h5)),h5.exports}var QEn=YEn();const tMe=Vn(QEn);var p5={exports:{}},KEn=p5.exports,nMe;function ZEn(){return nMe||(nMe=1,(function(e,t){(function(n,r){e.exports=r(fW())})(KEn,function(n){return n.enc.Utf8})})(p5)),p5.exports}var JEn=ZEn();const eTn=Vn(JEn);function Wie(e){this.message=e}Wie.prototype=new Error,Wie.prototype.name="InvalidCharacterError";var rMe=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Wie("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function tTn(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return(function(n){return decodeURIComponent(rMe(n).replace(/(.)/g,(function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o})))})(t)}catch{return rMe(t)}}function g4(e){this.message=e}function nTn(e,t){if(typeof e!="string")throw new g4("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(tTn(e.split(".")[n]))}catch(r){throw new g4("Invalid token specified: "+r.message)}}g4.prototype=new Error,g4.prototype.name="InvalidTokenError";var rTn={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},np,rp,m4=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(m4||{});(e=>{function t(){np=3,rp=rTn}e.reset=t;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");np=i}e.setLevel=n;function r(i){rp=i}e.setLogger=r})(m4||(m4={}));var Zn=class{constructor(e){this._name=e}debug(...e){np>=4&&rp.debug(Zn._format(this._name,this._method),...e)}info(...e){np>=3&&rp.info(Zn._format(this._name,this._method),...e)}warn(...e){np>=2&&rp.warn(Zn._format(this._name,this._method),...e)}error(...e){np>=1&&rp.error(Zn._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new Zn(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){np>=4&&rp.debug(Zn._format(e),...t)}static info(e,...t){np>=3&&rp.info(Zn._format(e),...t)}static warn(e,...t){np>=2&&rp.warn(Zn._format(e),...t)}static error(e,...t){np>=1&&rp.error(Zn._format(e),...t)}};m4.reset();var iTn="10000000-1000-4000-8000-100000000000",Pp=class{static _randomWord(){return VEn.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return iTn.replace(/[018]/g,t=>(+t^Pp._randomWord()&15>>+t/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Pp.generateUUIDv4()+Pp.generateUUIDv4()+Pp.generateUUIDv4()}static generateCodeChallenge(e){try{const t=qEn(e);return tMe.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw Zn.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=eTn.parse([e,t].join(":"));return tMe.stringify(n)}},e0=class{constructor(t){this._name=t,this._logger=new Zn(`Event('${this._name}')`),this._callbacks=[]}addHandler(t){return this._callbacks.push(t),()=>this.removeHandler(t)}removeHandler(t){const n=this._callbacks.lastIndexOf(t);n>=0&&this._callbacks.splice(n,1)}raise(...t){this._logger.debug("raise:",...t);for(const n of this._callbacks)n(...t)}},Hie=class{static decode(e){try{return nTn(e)}catch(t){throw Zn.error("JwtUtils.decode",t),t}}},iMe=class{static center({...e}){var t,n,r;return e.width==null&&(e.width=(t=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?t:360),(n=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((r=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},zf=class extends e0{constructor(){super(...arguments),this._logger=new Zn(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-zf.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=zf.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=zf.getEpochTime()+e;if(this.expiration===n&&this._timerHandle){t.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,r*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},Gie=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const r=new URL(e,"http://127.0.0.1")[t==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},qie=";",$w=class extends Error{constructor(e,t){var n,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw Zn.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(n=e.error_description)!=null?n:null,this.error_uri=(r=e.error_uri)!=null?r:null,this.state=e.userState,this.session_state=(i=e.session_state)!=null?i:null,this.url_state=e.url_state}},dme=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},oTn=class{constructor(e){this._logger=new Zn("AccessTokenEvents"),this._expiringTimer=new zf("Access token expiring"),this._expiredTimer=new zf("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),t.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},sTn=class{constructor(e,t,n,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new Zn("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=s=>{s.origin===this._frame_origin&&s.source===this._frame.contentWindow&&(s.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):s.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(s.data+" message from check session op iframe"))};const o=new URL(n);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},snt=class{constructor(){this._logger=new Zn("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},hme=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new Zn("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(e,{...t,signal:i.signal})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?new dme("Network timed out"):s}finally{clearTimeout(o)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);let o;try{r.debug("url:",e),o=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${e}`)),o.ok&&this._jwtHandler&&s?.startsWith("application/jwt"))return await this._jwtHandler(await o.text());let a;try{a=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",a),a.error?new $w(a):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`);return a}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(s.Authorization="Basic "+n),this.appendExtraHeaders(s);let a;try{o.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"POST",headers:s,body:t,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",a.status);const l=a.headers.get("Content-Type");if(l&&!this._contentTypes.find(f=>l.startsWith(f)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${e}`);const c=await a.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),a.ok?f:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw o.error("Error from server:",u),u.error?new $w(u,t):new Error(`${a.statusText} (${a.status}): ${JSON.stringify(u)}`);return u}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){t.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(e[i]=o)})}},aTn=class{constructor(e){this._settings=e,this._logger=new Zn("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new hme(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),r[e]===void 0){if(t===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},ant=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new Zn("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const i=Hie.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new hme(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}},lnt=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new Zn("TokenClient"),this._jsonService=new hme(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),t||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;a=Pp.generateBasicAuth(n,r);break;case"client_secret_post":s.append("client_id",n),r&&s.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");t||o.throw(new Error("A client_id is required"));const s=new URLSearchParams({grant_type:e,scope:r});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Pp.generateBasicAuth(t,n);break;case"client_secret_post":s.append("client_id",t),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");t||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:e});for(const[u,f]of Object.entries(i))Array.isArray(f)?f.forEach(d=>s.append(u,d)):f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Pp.generateBasicAuth(t,n);break;case"client_secret_post":s.append("client_id",t),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(t=e.token_type_hint)!=null?t:"default token type"}`);const i=new URLSearchParams;for(const[o,s]of Object.entries(e))s!=null&&i.set(o,s);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},gTn=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new Zn("ResponseValidator"),this._userInfoService=new pTn(this._settings,this._metadataService),this._tokenClient=new lnt(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t?.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&e.id_token&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){var n,r;const i=this._logger.create("validateRefreshResponse");e.userState=t.data,(n=e.session_state)!=null||(e.session_state=t.session_state),(r=e.scope)!=null||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const o=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,o),i.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new $w(e)}_processSigninState(e,t){var n;const r=this._logger.create("_processSigninState");if(t.id!==e.state&&r.throw(new Error("State does not match")),t.client_id||r.throw(new Error("No client_id on state")),t.authority||r.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,(n=e.scope)!=null||(e.scope=t.scope),e.error)throw r.warn("Response was error",e.error),new $w(e);t.code_verifier&&!e.code&&r.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=Hie.decode((n=e.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const o=Hie.decode(t);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},$E=class{constructor(e){this.id=e.id||Pp.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=zf.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new Zn("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return Zn.createStatic("State","fromStorageString"),new $E(JSON.parse(e))}static async clearStaleState(e,t){const n=Zn.createStatic("State","clearStaleState"),r=zf.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let o=0;oy.searchParams.append("resource",S));for(const[w,S]of Object.entries({response_mode:a,...v,...p}))S!=null&&y.searchParams.append(w,S.toString());this.url=y.href}},vTn="openid",iY=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const t=decodeURIComponent(this.state).split(qie);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(qie))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-zf.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+zf.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(vTn))||!!this.id_token}},yTn=class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o,client_id:s}){if(this._logger=new Zn("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(e);n&&a.searchParams.append("id_token_hint",n),s&&a.searchParams.append("client_id",s),r&&(a.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new $E({data:t,request_type:o}),a.searchParams.append("state",this.state.id)));for(const[l,c]of Object.entries({...i}))c!=null&&a.searchParams.append(l,c.toString());this.url=a.href}},bTn=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},xTn=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],wTn=["sub","iss","aud","exp","iat"],STn=class{constructor(e){this._settings=e,this._logger=new Zn("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=xTn;for(const r of n)wTn.includes(r)||delete t[r]}return t}mergeClaims(e,t){const n={...e};for(const[r,i]of Object.entries(t))for(const o of Array.isArray(i)?i:[i]){const s=n[r];s===void 0?n[r]=o:Array.isArray(s)?s.includes(o)||s.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(s,o):n[r]=[s,o])}return n}},_Tn=class{constructor(e,t){this._logger=new Zn("OidcClient"),this.settings=e instanceof Xie?e:new Xie(e),this.metadataService=t??new aTn(this.settings),this._claimsService=new STn(this.settings),this._validator=new gTn(this.settings,this.metadataService,this._claimsService),this._tokenClient=new lnt(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:s,nonce:a,url_state:l,response_type:c=this.settings.response_type,scope:u=this.settings.scope,redirect_uri:f=this.settings.redirect_uri,prompt:d=this.settings.prompt,display:h=this.settings.display,max_age:p=this.settings.max_age,ui_locales:g=this.settings.ui_locales,acr_values:m=this.settings.acr_values,resource:v=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:b=this.settings.extraQueryParams,extraTokenParams:w=this.settings.extraTokenParams}){const S=this._logger.create("createSigninRequest");if(c!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();S.debug("Received authorization endpoint",_);const E=new mTn({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:f,response_type:c,scope:u,state_data:e,url_state:l,prompt:d,display:h,max_age:p,ui_locales:g,id_token_hint:i,login_hint:o,acr_values:m,resource:v,request:t,request_uri:n,extraQueryParams:b,extraTokenParams:w,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const T=E.state;return await this.settings.stateStore.set(T.id,T.toStorageString()),E}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new iY(Gie.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:pme.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),o=new iY(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=e.scope;else{const a=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=e.scope)==null?void 0:n.split(" "))||[]).filter(c=>a.includes(c)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:i,timeoutInSeconds:t}),s=new iY(new URLSearchParams);return Object.assign(s,o),r.debug("validating response",s),await this._validator.validateRefreshResponse(s,{...e,scope:i}),s}async createSignoutRequest({state:e,id_token_hint:t,client_id:n,request_type:r,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const s=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw s.throw(new Error("No end session endpoint")),null;s.debug("Received end session endpoint",a),!n&&i&&!t&&(n=this.settings.client_id);const l=new yTn({url:a,id_token_hint:t,client_id:n,post_logout_redirect_uri:i,state_data:e,extraQueryParams:o,request_type:r});await this.clearStaleState();const c=l.state;return c&&(s.debug("Signout request has state to persist"),await this.settings.stateStore.set(c.id,c.toStorageString())),l}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new bTn(Gie.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new $w(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:$E.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),$E.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},CTn=class{constructor(e){this._userManager=e,this._logger=new Zn("SessionMonitor"),this._start=async t=>{const n=t.session_state;if(!n)return;const r=this._logger.create("_start");if(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,s=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,l=new sTn(this._callback,o,i,s,a);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const t=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){t.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const t=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?t.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):t.debug("different subject signed into OP",n.sub):t.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():t.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(t.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(t=>{this._logger.error(t)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const t=await this._userManager.querySessionStatus();if(t){const n={session_state:t.session_state,profile:t.sub&&t.sid?{sub:t.sub,sid:t.sid}:null};this._start(n)}}}},g5=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=(t=e.session_state)!=null?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-zf.getEpochTime()}set expires_in(e){e!==void 0&&(this.expires_at=Math.floor(e)+zf.getEpochTime())}get expired(){const e=this.expires_in;if(e!==void 0)return e<=0}get scopes(){var e,t;return(t=(e=this.scope)==null?void 0:e.split(" "))!=null?t:[]}toStorageString(){return new Zn("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return Zn.createStatic("User","fromStorageString"),new g5(JSON.parse(e))}},oMe="oidc-client",cnt=class{constructor(){this._abort=new e0("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const s=a=>{var l;const c=a.data,u=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(a.origin!==u||c?.source!==oMe)){try{const f=Gie.readParams(c.url,e.response_mode).get("state");if(f||t.warn("no state found in response url"),a.source!==this._window&&f!==e.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",s,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",s,!1)),this._disposeHandlers.add(this._abort.addHandler(a=>{this._dispose(),o(a)}))});return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:oMe,url:t,keepOpen:n},r)}},unt={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},fnt="_blank",OTn=60,ETn=2,dnt=10,TTn=class extends Xie{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=unt,popupWindowTarget:i=fnt,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,silent_redirect_uri:c=e.redirect_uri,silentRequestTimeoutInSeconds:u=dnt,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:g=!1,checkSessionIntervalInSeconds:m=ETn,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:b=["access_token","refresh_token"],revokeTokensOnSignout:w=!1,includeIdTokenInSilentSignout:S=!1,accessTokenExpiringNotificationTimeInSeconds:_=OTn,userStore:E}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=s,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=l,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=u,this.automaticSilentRenew=f,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=h,this.monitorSession=p,this.monitorAnonymousSession=g,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=b,this.revokeTokensOnSignout=w,this.includeIdTokenInSilentSignout=S,this.accessTokenExpiringNotificationTimeInSeconds=_,E)this.userStore=E;else{const T=typeof window<"u"?window.sessionStorage:new snt;this.userStore=new ant({store:T})}}},Yie=class extends cnt{constructor({silentRequestTimeoutInSeconds:e=dnt}){super(),this._logger=new Zn("IFrameWindow"),this._timeoutInSeconds=e,this._frame=Yie.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout(()=>this._abort.raise(new dme("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(t)),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",t=>{var n;const r=t.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(e=this._frame.contentWindow)==null||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},PTn=class{constructor(e){this._settings=e,this._logger=new Zn("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Yie({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Yie.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},kTn=500,MTn=1e3,sMe=class extends cnt{constructor({popupWindowTarget:e=fnt,popupWindowFeatures:t={}}){super(),this._logger=new Zn("PopupWindow");const n=iMe.center({...unt,...t});this._window=window.open(void 0,e,iMe.serialize(n)),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},t.closePopupWindowAfterInSeconds*MTn)}async navigate(e){var t;(t=this._window)==null||t.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},kTn);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},ATn=class{constructor(e){this._settings=e,this._logger=new Zn("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new sMe({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),sMe.notifyOpener(e,t)}},RTn=class{constructor(e){this._settings=e,this._logger=new Zn("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;t==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[e].bind(r.location);let o;return{navigate:async s=>{this._logger.create("navigate");const a=new Promise((l,c)=>{o=c});return i(s.url),await a},close:()=>{this._logger.create("close"),o?.(new Error("Redirect aborted")),r.stop()}}}async callback(){}},ITn=class extends oTn{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new Zn("UserManagerEvents"),this._userLoaded=new e0("User loaded"),this._userUnloaded=new e0("User unloaded"),this._silentRenewError=new e0("Silent renew error"),this._userSignedIn=new e0("User signed in"),this._userSignedOut=new e0("User signed out"),this._userSessionChanged=new e0("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},DTn=class{constructor(e){this._userManager=e,this._logger=new Zn("SilentRenewService"),this._isStarted=!1,this._retryTimer=new zf("Retry Silent Renew"),this._tokenExpiring=async()=>{const t=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),t.debug("silent token renewal successful")}catch(n){if(n instanceof dme){t.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}t.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},LTn=class{constructor(e,t){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.resource=t,this.data=e.state}},FTn=class{constructor(e,t,n,r){this._logger=new Zn("UserManager"),this.settings=new TTn(e),this._client=new _Tn(e),this._redirectNavigator=t??new RTn(this.settings),this._popupNavigator=n??new ATn(this.settings),this._iframeNavigator=r??new PTn(this.settings),this._events=new ITn(this.settings),this._silentRenewService=new DTn(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new CTn(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,o=this.settings.popup_redirect_uri;o||t.throw(new Error("No popup_redirect_uri configured"));const s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},s);return a&&(a.profile&&a.profile.sub?t.info("success, signed in subject",a.profile.sub):t.info("no subject")),a}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,resource:i,...o}=e;let s=await this._loadUser();if(s?.refresh_token){n.debug("using refresh token");const u=new LTn(s,i);return await this._useRefreshToken(u)}const a=this.settings.silent_redirect_uri;a||n.throw(new Error("No silent_redirect_uri configured"));let l;s&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",s.profile.sub),l=s.profile.sub);const c=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return s=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?s?.id_token:void 0,...o},c,l),s&&((t=s.profile)!=null&&t.sub?n.info("success, signed in subject",s.profile.sub):n.info("no subject")),s}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new g5({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":return await this.signoutRedirectCallback(e);case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o?.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},s);try{const l=await this._client.processSigninResponse(a.url);return t.debug("got signin response"),l.session_state&&l.profile.sub?(t.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(t.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof $w)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),r}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new g5(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new $w({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,o=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:o==null?void 0:{},...i},s),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=e.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const s=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:s.url,state:(n=s.state)==null?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,o=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...i},a),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter(i=>typeof e[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(e[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(e[i]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),g5.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},gme=Te.createContext(void 0);gme.displayName="AuthContext";var $Tn={isLoading:!0,isAuthenticated:!1},NTn=(e,t)=>{switch(t.type){case"INITIALISED":case"USER_LOADED":return{...e,user:t.user,isLoading:!1,isAuthenticated:t.user?!t.user.expired:!1,error:void 0};case"USER_SIGNED_OUT":case"USER_UNLOADED":return{...e,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...e,isLoading:!0,activeNavigator:t.method};case"NAVIGATOR_CLOSE":return{...e,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...e,isLoading:!1,error:t.error};default:return{...e,isLoading:!1,error:new Error(`unknown type ${t.type}`)}}},zTn=(e=window.location)=>{let t=new URLSearchParams(e.search);return!!((t.get("code")||t.get("error"))&&t.get("state")||(t=new URLSearchParams(e.hash.replace("#","?")),(t.get("code")||t.get("error"))&&t.get("state")))},hnt=e=>t=>t instanceof Error?t:new Error(e),jTn=hnt("Login failed"),BTn=hnt("Sign-out failed"),UTn=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],VTn=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],oY=e=>()=>{throw new Error(`UserManager#${e} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},WTn=typeof window>"u"?null:FTn,HTn=e=>{const{children:t,onSigninCallback:n,skipSigninCallback:r,matchSignoutCallback:i,onSignoutCallback:o,onRemoveUser:s,onSignoutRedirect:a,onSignoutPopup:l,implementation:c=WTn,userManager:u,...f}=e,[d]=Te.useState(()=>u??(c?new c(f):{settings:f})),[h,p]=Te.useReducer(NTn,$Tn),g=Te.useMemo(()=>Object.assign({settings:d.settings,events:d.events},Object.fromEntries(UTn.map(_=>{var E,T;return[_,(T=(E=d[_])==null?void 0:E.bind(d))!=null?T:oY(_)]})),Object.fromEntries(VTn.map(_=>[_,d[_]?async E=>{p({type:"NAVIGATOR_INIT",method:_});try{return await d[_](E)}catch(T){return p({type:"ERROR",error:T}),null}finally{p({type:"NAVIGATOR_CLOSE"})}}:oY(_)]))),[d]),m=Te.useRef(!1);Te.useEffect(()=>{!d||m.current||(m.current=!0,(async()=>{let _=null;try{zTn()&&!r&&(_=await d.signinCallback(),n&&await n(_)),_=_||await d.getUser(),p({type:"INITIALISED",user:_})}catch(E){p({type:"ERROR",error:jTn(E)})}try{if(i&&i(d.settings)){const E=await d.signoutCallback();o&&await o(E)}}catch(E){p({type:"ERROR",error:BTn(E)})}})())},[d,r,n,o,i]),Te.useEffect(()=>{if(!d)return;const _=P=>{p({type:"USER_LOADED",user:P})};d.events.addUserLoaded(_);const E=()=>{p({type:"USER_UNLOADED"})};d.events.addUserUnloaded(E);const T=()=>{p({type:"USER_SIGNED_OUT"})};d.events.addUserSignedOut(T);const k=P=>{p({type:"ERROR",error:P})};return d.events.addSilentRenewError(k),()=>{d.events.removeUserLoaded(_),d.events.removeUserUnloaded(E),d.events.removeUserSignedOut(T),d.events.removeSilentRenewError(k)}},[d]);const v=Te.useCallback(d?()=>d.removeUser().then(s):oY("removeUser"),[d,s]),y=Te.useCallback(_=>g.signoutRedirect(_).then(a),[g.signoutRedirect,a]),b=Te.useCallback(_=>g.signoutPopup(_).then(l),[g.signoutPopup,l]),w=Te.useCallback(_=>g.signoutSilent(_),[g.signoutSilent]),S=Te.useMemo(()=>({...h,...g,removeUser:v,signoutRedirect:y,signoutPopup:b,signoutSilent:w}),[h,g,v]);return Te.createElement(gme.Provider,{value:S},t)},GTn=()=>{const e=Te.useContext(gme);return e||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component."),e};class pnt extends M.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error(t),n.componentStack&&console.error(n.componentStack)}render(){if(!this.props.children)throw new Error("An ErrorBoundary requires at least one child");return this.state.error?O.jsxs("div",{children:[O.jsx("h2",{className:"errorBoundary-header",children:Ce.get("Something went wrong.")}),O.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),O.jsx("br",{})]})]}):this.props.children}}const qTn=({children:e})=>{const t=On.instance.authClient;if(!t)return O.jsx(O.Fragment,{children:e});const n=o=>{window.history.replaceState({},document.title,window.location.pathname)},r=()=>{console.debug("handleRemoveUser"),window.location.pathname="/"},i=ST.href;return O.jsx(pnt,{children:O.jsx(HTn,{...t,loadUserInfo:!0,scope:"openid email profile",automaticSilentRenew:!0,redirect_uri:i,post_logout_redirect_uri:i,popup_post_logout_redirect_uri:i,onSigninCallback:n,onRemoveUser:r,children:e})})},QN={size:"0.5rem",borderRadius:0},XTn={trackColor:"#222",thumbColor:"#666",thumbColorHover:"#444"},YTn={trackColor:"#eee",thumbColor:"#ccc",thumbColorHover:"#aaa"},QTn=()=>{const t=is().palette.mode==="dark"?XTn:YTn;return O.jsx(Eje,{styles:{"::-webkit-scrollbar":{width:QN.size,height:QN.size},"::-webkit-scrollbar-track":{backgroundColor:t.trackColor,borderRadius:QN.borderRadius},"::-webkit-scrollbar-thumb":{backgroundColor:t.thumbColor,borderRadius:QN.borderRadius,"&:hover":{backgroundColor:t.thumbColorHover}},"::-webkit-scrollbar-corner":{backgroundColor:t.trackColor}}})},gnt=ot(O.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload"),mnt=ot(O.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),vnt=ot(O.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share");const KTn=ot(O.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"CodeOutlined"),ynt=ot(O.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),ZTn=ot(O.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined"),JTn=ot(O.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),ePn=ot(O.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),tPn=ot(O.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),nPn=ot([O.jsx("path",{d:"m21 5-9-4-9 4v6c0 5.55 3.84 10.74 9 12 2.3-.56 4.33-1.9 5.88-3.71l-3.12-3.12c-1.94 1.29-4.58 1.07-6.29-.64-1.95-1.95-1.95-5.12 0-7.07s5.12-1.95 7.07 0c1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),O.jsx("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy"),yP=ot(O.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),sY={dialog:e=>({backgroundColor:e.palette.mode==="dark"?e.palette.grey[800]:e.palette.grey[200],padding:2}),appBar:{position:"relative"},title:e=>({marginLeft:e.spacing(2),flex:1})},rPn=Qn("div")(({theme:e})=>({marginTop:e.spacing(4),marginLeft:e.spacing(40),marginRight:e.spacing(40)})),iPn=Te.forwardRef(function(t,n){return O.jsx(g1t,{direction:"up",ref:n,...t})}),bnt=({title:e,text:t,open:n,onClose:r})=>O.jsxs(Gu,{fullScreen:!0,open:n,onClose:r,TransitionComponent:iPn,PaperProps:{tabIndex:-1},children:[O.jsx(Ije,{sx:sY.appBar,children:O.jsxs(nD,{children:[O.jsx(Mn,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:O.jsx(yP,{})}),O.jsx(yn,{variant:"h6",sx:sY.title,children:e})]})}),O.jsx(Nc,{sx:sY.dialog,children:O.jsx(rPn,{children:O.jsx(Hb,{text:t})})})]}),oPn=({open:e,onClose:t})=>{const n=uW(Ce.get("docs/imprint.en.md"));return O.jsx(bnt,{title:Ce.get("Imprint"),text:n??"",open:e,onClose:t})},sPn=({open:e,onClose:t})=>{const n=uW(Ce.get("docs/dev-reference.en.md")),r=QUe(),i=M.useMemo(()=>{if(n){const o=aPn(r),s=lPn();return n.replace("${extensions}",o).replace("${derivedState}",s)}},[n,r]);return O.jsx(bnt,{title:Ce.get("Developer Reference"),text:i||"",open:e,onClose:t})};function aPn(e){const t=[];return Object.getOwnPropertyNames(e).forEach(n=>{const r=e[n];t.push(` +`))}function l(h,p,g,m){const v=g.enter("tableCell"),y=g.enter("phrasing"),b=CZe(h,g,{...m,before:o,after:o});return y(),v(),b}function c(h,p){return kwn(h,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(h,p,g){const m=h.children;let v=-1;const y=[],b=p.enter("table");for(;++v-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(f,d,h){return d?(h?"":" ".repeat(s))+f:(h?o:o+" ".repeat(s-o.length))+f}}const Bwn={exit:{taskListCheckValueChecked:HPe,taskListCheckValueUnchecked:HPe,paragraph:Vwn}},Uwn={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Wwn}};function HPe(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function Vwn(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1],r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o({p:i=>{const{node:o,...s}=i;return O.jsx("p",{...s,style:{padding:0,margin:0}})},a:i=>{const{node:o,...s}=i;return O.jsx("a",{...s,style:{color:n.palette.mode==="dark"?"#90caf9":"#1e90ff"}})},code:i=>{const{node:o,...s}=i;return O.jsx("code",{...s,style:{color:n.palette.mode==="dark"?"#bbb":"#666"}})},img:i=>{const o=n.palette.mode,{node:s,...a}=i,l=a.alt,c=a.src,[u,f]=c.split("#");let d=u;if(f==="light-mode-only"&&o!=="light"||f==="dark-mode-only"&&o!=="dark")return null;const h={display:"block",margin:"1rem auto",maxWidth:"100%"};return t&&(d=B6(t,d)),O.jsx("img",{src:d,alt:l,style:h})}}),[n,t]);return e?O.jsx(uZe,{children:e,components:r,linkTarget:"_blank",remarkPlugins:[qwn]}):null}function Xwn(){return{components:[["Markdown",Bb]]}}function Ywn(e){return(t,n)=>{const r=Go(n());aLt({plugins:[B6t(),hyn(),Xwn()],hostStore:pyn(e),logging:{enabled:gyn},api:{serverUrl:r.url,endpointName:"viewer/ext"}})}}const TZe="POST_MESSAGE";function la(e,t){return{type:TZe,messageType:e,messageText:typeof t=="string"?t:t.message}}const PZe="HIDE_MESSAGE";function Qwn(e){return{type:PZe,messageId:e}}var Yq,GPe;function Kwn(){return GPe||(GPe=1,Yq={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]}),Yq}var Zwn=Kwn();const qPe=Yn(Zwn);var XPe={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Jwn(e){var t,n=[],r=1,i;if(typeof e=="string")if(e=e.toLowerCase(),qPe[e])n=qPe[e].slice(),i="rgb";else if(e==="transparent")r=0,i="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var o=e.slice(1),s=o.length,a=s<=4;r=1,a?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],s===4&&(r=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],s===8&&(r=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var l=t[1],c=l==="rgb",o=l.replace(/a$/,"");i=o;var s=o==="cmyk"?4:o==="gray"?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===s?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(XPe[d]!==void 0)return XPe[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[s]===void 0?1:n[s],n=n.slice(0,s)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),i=e.match(/([a-z])/ig).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(n=[e[0],e[1],e[2]],i="rgb",r=e.length===4?e[3]:1):e instanceof Object&&(e.r!=null||e.red!=null||e.R!=null?(i="rgb",n=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(i="hsl",n=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),r=e.a||e.alpha||e.opacity||1,e.opacity!=null&&(r/=100)):(i="rgb",n=[e>>>16,(e&65280)>>>8,e&255]);return{space:i,values:n,alpha:r}}const Fre={min:[0,0,0],max:[255,255,255]};var Qq={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100,i,o,s,a,l,c=0;if(n===0)return l=r*255,[l,l,l];for(o=r<.5?r*(1+n):r+n-r*n,i=2*r-o,a=[0,0,0];c<3;)s=t+1/3*-(c-1),s<0?s++:s>1&&s--,l=6*s<1?i+(o-i)*6*s:2*s<1?o:3*s<2?i+(o-i)*(2/3-s)*6:i,a[c++]=l*255;return a}};Fre.hsl=function(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=o-i,a,l,c;return o===i?a=0:t===o?a=(n-r)/s:n===o?a=2+(r-t)/s:r===o&&(a=4+(t-n)/s),a=Math.min(a*60,360),a<0&&(a+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=s/(o+i):l=s/(2-o-i),[a,l*100,c*100]};function eSn(e){Array.isArray(e)&&e.raw&&(e=String.raw(...arguments));var t,n=Jwn(e);if(!n.space)return[];const r=n.space[0]==="h"?Qq.min:Fre.min,i=n.space[0]==="h"?Qq.max:Fre.max;return t=Array(3),t[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),t[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),t[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(t=Qq.rgb(t)),t.push(Math.min(Math.max(n.alpha,0),1)),t}function Fpe(e,t,n,r="circle"){if(e.getGeometry()instanceof Np)e.setStyle(tSn(7,t,"white",2,r));else{n=typeof n=="number"?n:.25;let i=eSn(t);Array.isArray(i)&&i.length===4?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],e.setStyle(rSn(i,t,2))}}function tSn(e,t,n,r,i="circle"){return new Cp({image:nSn(e,t,n,r,i)})}function nSn(e,t,n,r,i){const o=new tw({color:t}),s=new zp({color:n,width:r});switch(i){case"square":return new zee({fill:o,stroke:s,radius:e,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new zee({fill:o,stroke:s,radius:e,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new iD({fill:o,stroke:s,radius:e})}}function rSn(e,t,n){const r=new tw({color:e}),i=new zp({color:t,width:n});return new Cp({fill:r,stroke:i})}function iSn(e,t,n){Qs[e]}function oSn(e,t,n){if(Qs[e]){const o=Qs[e].getSource()?.getFeatureById(t);o&&Fpe(o,n.color,n.opacity)}}function sSn(e,t,n){if(Qs[e]){const r=Qs[e],i=r.getView().getProjection(),s=(Array.isArray(t)?Tee(t):t).transform(Jw,i);s.getType()==="Point"?r.getView().setCenter(s.getFirstCoordinate()):n?r.getView().fit(s,{size:r.getSize()}):r.getView().setCenter(U0(s.getExtent()))}}function aSn(){return{current:Qs.map?Qs.map.getTargetElement():null}}const kZe="1.7.2",lSn=["userPlaceGroups","timeSeriesGroups","statistics","datasets"],cSn=["selectedDatasetId","selectedVariableName","selectedDataset2Id","selectedVariable2Name","selectedTime","selectedTimeRange","selectedUserPlaceId","selectedPlaceId","selectedPlaceGroupIds","layerMenuOpen","layerVisibilities","sidePanelOpen","sidePanelId","sidePanelSize","variableSplitPos","variableCompareMode","userBaseMaps","userOverlays","userColorBars","mapProjection","zoomLevel"];function uSn(e){return{version:kZe,creationDate:new Date().toUTCString(),apiUrl:Go(e).url,viewerUrl:pT.origin,state:{dataState:YPe(e.dataState,lSn),controlState:YPe(e.controlState,cSn),mapState:fSn()}}}function YPe(e,t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}function fSn(){if(Qs.map){const t=Qs.map.getView(),n=t.getProjection().getCode(),r=t.getCenter();if(r!==void 0){const i=t.getZoom(),o=t.getRotation();return{view:{projection:n,center:r,zoom:i,rotation:o}}}}}const $pe="APPLY_PERSISTED_STATE";function dSn(e){return t=>{console.debug("Restoring persisted state:",e),t(hSn(e));const{mapState:n}=e.state;n&&pSn(n)}}function hSn(e){return{type:$pe,persistedState:e}}function pSn(e){Qs.map&&(console.debug("Restoring map:",e),Qs.map.setView(new hp(e.view)))}function MZe(e,t){return e?t.map(n=>e.querySelector(n)).filter(Boolean):[]}const VB="UPDATE_SERVER_INFO";function gSn(){return(e,t)=>{const n=Go(t());e(OL(VB,Ce.get("Connecting to server"))),wEt(n.url).then(r=>{e(mSn(r))}).catch(r=>{e(la("error",r))}).then(()=>{e(EL(VB))})}}function mSn(e){return{type:VB,serverInfo:e}}const QPe="SHARE_STATE_PERMALINK";function AZe(){return(e,t)=>{const n=Go(t());e(OL(QPe,Ce.get("Creating permalink"))),TEt(n.url,t().userAuthState.accessToken,uSn(t())).then(r=>{if(r){const i=window.location,s=`${i.origin+i.pathname}?stateKey=${r}`,a=On.instance.branding.permalinkExpirationDays,l=typeof a=="number"?Ce.get("Permalink copied to clipboard (expires in ${expiration} days)",{expiration:a}):Ce.get("Permalink copied to clipboard");navigator.clipboard.writeText(s).then(()=>{e(la("success",l))})}else e(la("error",Ce.get("Failed to create permalink")))}).finally(()=>e(EL(QPe)))}}const KPe="UPDATE_RESOURCES";function RZe(){return(e,t)=>{const n=Go(t());e(OL(KPe,Ce.get("Updating resources"))),OEt(n.url,t().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>e(EL(KPe)))}}const CR="UPDATE_DATASETS";function IZe(){return(e,t)=>{const n=Go(t());e(OL(CR,Ce.get("Loading data"))),mEt(n.url,t().userAuthState.accessToken).then(r=>{let i=r.datasets;const o=r.entrypointDatasetId,s=JOt();if(i&&i.length>0){i=i.map(l=>({...l,variables:[...l.variables,...s[l.id]||[]]})),e(ZPe(i,o));const a=t().controlState.selectedDatasetId||o||i[0].id;e(eJe(a,i,!0))}}).catch(r=>{e(la("error",r)),e(ZPe([]))}).then(()=>{e(EL(CR))})}}function ZPe(e,t){return{type:CR,datasets:e,entrypointDatasetId:t}}function vSn(e,t){return(n,r)=>{n(ySn(e,t));const i={};r().dataState.datasets.forEach(o=>{const[s,a]=Gae(o);a.length>=0&&(i[o.id]=a)}),ZOt(i)}}const DZe="UPDATE_DATASET_USER_VARIABLES";function ySn(e,t){return{type:DZe,datasetId:e,userVariables:t}}const Npe="UPDATE_DATASET_PLACE_GROUP";function bSn(e,t){return{type:Npe,datasetId:e,placeGroup:t}}const zpe="ADD_DRAWN_USER_PLACE";function xSn(e,t,n,r,i){return(o,s)=>{o(wSn(e,t,n,r,i)),s().controlState.autoShowTimeSeries&&s().controlState.selectedPlaceId===t&&o(D8())}}function wSn(e,t,n,r,i){return{type:zpe,placeGroupTitle:e,id:t,properties:n,geometry:r,selected:i}}const jpe="ADD_IMPORTED_USER_PLACES";function SSn(e,t,n){return{type:jpe,placeGroups:e,mapProjection:t,selected:n}}function LZe(e){return(t,n)=>{const r=VRt(n());let i;try{if(r==="csv"){const o=WRt(n());i=$Ot(e,o)}else if(r==="geojson"){const o=HRt(n());i=UOt(e,o)}else if(r==="wkt"){const o=GRt(n());i=qOt(e,o)}else i=[]}catch(o){t(la("error",o)),t(PS("addUserPlacesFromText")),i=[]}if(i.length>0){if(t(SSn(i,wv(n()),!0)),i.length===1&&i[0].features.length===1){const s=i[0].features[0];t(L8(s.id,pD(n()),!0)),n().controlState.autoShowTimeSeries&&t(D8())}let o=0;i.forEach(s=>{o+=s.features?s.features.length:0}),t(la("info",Ce.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else t(la("warning",Ce.get("No places imported")))}}const Bpe="RENAME_USER_PLACE_GROUP";function _Sn(e,t){return{type:Bpe,placeGroupId:e,newName:t}}const FZe="RENAME_USER_PLACE";function CSn(e,t,n){return r=>{r(OSn(e,t,n)),iSn(e)}}function OSn(e,t,n){return{type:FZe,placeGroupId:e,placeId:t,newName:n}}const $Ze="RESTYLE_USER_PLACE";function ESn(e,t,n){return r=>{r(TSn(e,t,n)),oSn(e,t,n)}}function TSn(e,t,n){return{type:$Ze,placeGroupId:e,placeId:t,placeStyle:n}}const Upe="REMOVE_USER_PLACE";function PSn(e,t,n){return{type:Upe,placeGroupId:e,placeId:t,places:n}}const NZe="REMOVE_USER_PLACE_GROUP";function kSn(e){return{type:NZe,placeGroupId:e}}function zZe(){return(e,t)=>{const n=Go(t()),r=Co(t()),i=ec(t()),o=gD(t()),s=aS(t()),a=t().controlState.sidePanelOpen,l=t().controlState.sidePanelId;r&&i&&o&&(l!=="stats"&&e(Xpe("stats")),a||e(qpe(!0)),e(JPe(null)),_Et(n.url,r,i,o,s,t().userAuthState.accessToken).then(c=>e(JPe(c))).catch(c=>{e(la("error",c))}))}}const jZe="ADD_STATISTICS";function JPe(e){return{type:jZe,statistics:e}}const BZe="REMOVE_STATISTICS";function MSn(e){return{type:BZe,index:e}}function D8(){return(e,t)=>{const n=Go(t()),r=Co(t()),i=ET(t()),o=ec(t()),s=oS(t()),a=ple(t()),l=t().controlState.timeSeriesUpdateMode,c=t().controlState.timeSeriesUseMedian,u=t().controlState.timeSeriesIncludeStdev;let f=EIt(t());const d=t().controlState.sidePanelOpen,h=t().controlState.sidePanelId,p=$Be(t());if(r&&o&&s&&i){h!=="timeSeries"&&e(Xpe("timeSeries")),d||e(qpe(!0));const g=i.labels,m=g.length;f=f>0?f:m;let v=m-1,y=v-f+1;const b=()=>{const S=y>=0?g[y]:null,_=g[v];return SEt(n.url,r,o,a.id,a.geometry,S,_,c,u,t().userAuthState.accessToken)},w=S=>{if(S!==null&&eke(p,a.id)){const _=y>0,E=_?(m-y)/m:1;e(ASn({...S,dataProgress:E},l,v===m-1?"new":"append")),_&&eke(p,a.id)&&(y-=f,v-=f,b().then(w))}else e(la("info","No data found here"))};b().then(w).catch(S=>{e(la("error",S))})}}}function eke(e,t){return Uae(e,t)!==null}const UZe="UPDATE_TIME_SERIES";function ASn(e,t,n){return{type:UZe,timeSeries:e,updateMode:t,dataMode:n}}const VZe="ADD_PLACE_GROUP_TIME_SERIES";function RSn(e,t){return{type:VZe,timeSeriesGroupId:e,timeSeries:t}}const WZe="REMOVE_TIME_SERIES";function ISn(e,t){return{type:WZe,groupId:e,index:t}}const HZe="REMOVE_TIME_SERIES_GROUP";function DSn(e){return{type:HZe,id:e}}const GZe="REMOVE_ALL_TIME_SERIES";function LSn(){return{type:GZe}}const Vpe="CONFIGURE_SERVERS";function FSn(e,t,n){return(r,i)=>{i().controlState.selectedServerId!==t?(r(LSn()),r(tke(e,t)),r(Wpe(n))):i().dataState.userServers!==e&&r(tke(e,t))}}function tke(e,t){return{type:Vpe,servers:e,selectedServerId:t}}function Wpe(e,t=!1){return n=>{n(gSn()),n(NSn()),n(jSn()),n(Ywn(e));const r=Sm.get("stateKey");n(r&&t?$Sn(e,r):IZe())}}function $Sn(e,t){return(n,r)=>{const i=Go(e.getState()).url;EEt(i,r().userAuthState.accessToken,t).then(o=>{if(typeof o=="object"){const s=o,{apiUrl:a}=s;n(a===i?dSn(s):la("warning","Failed to restore state, backend mismatch"))}else n(la("warning",o))})}}const qZe="UPDATE_EXPRESSION_CAPABILITIES";function NSn(){return(e,t)=>{const n=Go(t());xEt(n.url).then(r=>{e(zSn(r))}).catch(r=>{e(la("error",r))})}}function zSn(e){return{type:qZe,expressionCapabilities:e}}const XZe="UPDATE_COLOR_BARS";function jSn(){return(e,t)=>{const n=Go(t());dEt(n.url).then(r=>{e(BSn(r))}).catch(r=>{e(la("error",r))})}}function BSn(e){return{type:XZe,colorBars:e}}const YZe="UPDATE_VARIABLE_COLOR_BAR";function USn(e,t,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariableName;s&&a&&i(QZe(s,a,e,t,n,r))}}function VSn(e,t,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariable2Name;s&&a&&i(QZe(s,a,e,t,n,r))}}function QZe(e,t,n,r,i,o){if(i==="log"){let[s,a]=r;s<=0&&(s=.001),a<=s&&(a=1),r=[s,a]}return{type:YZe,datasetId:e,variableName:t,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const KZe="UPDATE_VARIABLE_VOLUME";function WSn(e,t,n,r,i){return{type:KZe,datasetId:e,variableName:t,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function HSn(){return(e,t)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:s,exportFileName:a}=t().controlState;let l=[];n?(l=[],cD(t()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...uD(t())]):i&&(l=OT(t())),XSn(t().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:s,fileName:a})}}class ZZe{}class GSn extends ZZe{fileName;zipArchive;constructor(t){super(),this.fileName=t,this.zipArchive=new rDt}write(t,n){this.zipArchive.file(t,n)}close(){this.zipArchive.generateAsync({type:"blob"}).then(t=>k4e.saveAs(t,this.fileName))}}class qSn extends ZZe{write(t,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});k4e.saveAs(r,t)}close(){}}function XSn(e,t,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:s}=n;let{separator:a,fileName:l}=n;if(a=a||"TAB",a.toUpperCase()==="TAB"&&(a=" "),l=l||"export",!r&&!i)return;let c;s?c=new GSn(`${l}.zip`):c=new qSn;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=wRt(e,t),p={number:!0,string:!0},g=f.join(a),m=d.map(y=>y.map(b=>p[typeof b]?b+"":"").join(a)),v=[g].concat(m).join(` +`);c.write(`${l}.txt`,v),u=h}else u={},t.forEach(f=>{f.features&&f.features.forEach(d=>{u[d.id]=d})});if(i)if(o){const f={type:"FeatureCollection",features:Object.keys(u).map(d=>u[d])};c.write(`${l}.geojson`,JSON.stringify(f,null,2))}else Object.keys(u).forEach(f=>{c.write(`${f}.geojson`,JSON.stringify(u[f],null,2))});c.close()}const JZe="SELECT_DATASET";function eJe(e,t,n){return(r,i)=>{r(YSn(e,t));const o=i().controlState.datasetLocateMode;e&&n&&o!=="doNothing"&&r(tJe(e,i().controlState.datasetLocateMode==="panAndZoom"))}}function YSn(e,t){return{type:JZe,selectedDatasetId:e,datasets:t}}function QSn(){return(e,t)=>{const n=CT(t());n&&e(tJe(n,!0))}}function KSn(){return(e,t)=>{const n=oS(t());n&&e(nJe(n,!0))}}function tJe(e,t){return(n,r)=>{const i=cD(r()),o=rO(i,e);o&&o.bbox&&n($re(o.bbox,t))}}const ZSn=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function nJe(e,t){return(n,r)=>{const i=OT(r()),o=Uae(i,e);o&&(o.bbox&&o.bbox.length===4?n($re(o.bbox,t)):o.geometry&&ZSn.includes(o.geometry.type)&&n($re(new rS().readGeometry(o.geometry),t)))}}function $re(e,t){return n=>{e!==null&&(n(JSn("map",e)),sSn("map",e,t))}}const rJe="FLY_TO";function JSn(e,t){return{type:rJe,mapId:e,location:t}}const iJe="SELECT_PLACE_GROUPS";function e_n(e){return(t,n)=>{const r=Go(n());t(t_n(e));const i=Co(n()),o=f4e(n());if(i!==null&&o.length>0){for(const s of o)if(!vT(s)){const a=i.id,l=s.id,c=`${Npe}-${a}-${l}`;t(OL(c,Ce.get("Loading places"))),bEt(r.url,a,l,n().userAuthState.accessToken).then(u=>{t(bSn(i.id,u))}).catch(u=>{t(la("error",u))}).finally(()=>{t(EL(c))})}}}}function t_n(e){return{type:iJe,selectedPlaceGroupIds:e}}const oJe="SELECT_PLACE";function L8(e,t,n){return(r,i)=>{r(n_n(e,t));const o=i().controlState.placeLocateMode;n&&e&&o!=="doNothing"&&r(nJe(e,i().controlState.placeLocateMode==="panAndZoom"))}}function n_n(e,t){return{type:oJe,placeId:e,places:t}}const sJe="TOGGLE_DATASET_RGB_LAYER";function r_n(e){return{type:sJe,visible:e}}const aJe="SET_LAYER_VISIBILITIES";function lJe(e){return{type:aJe,layerVisibilities:e}}const cJe="SET_LAYER_GROUP_STATES";function i_n(e){return{type:cJe,layerGroupStates:e}}const uJe="SET_MAP_POINT_INFO_BOX_ENABLED";function o_n(e){return{type:uJe,mapPointInfoBoxEnabled:e}}const fJe="SET_VARIABLE_COMPARE_MODE";function s_n(e){return{type:fJe,variableCompareMode:e}}const Hpe="UPDATE_VARIABLE_SPLIT_POS";function a_n(e,t){return{type:Hpe,size:e,isDelta:t}}const dJe="SELECT_VARIABLE";function hJe(e){return{type:dJe,selectedVariableName:e}}const pJe="SELECT_VARIABLE_2";function l_n(e,t){return{type:pJe,selectedDataset2Id:e,selectedVariable2Name:t}}const gJe="SELECT_TIME";function F8(e){return{type:gJe,selectedTime:e}}const mJe="INC_SELECTED_TIME";function c_n(e){return{type:mJe,increment:e}}const Gpe="SELECT_TIME_RANGE";function vJe(e,t,n){return{type:Gpe,selectedTimeRange:e,selectedGroupId:t,selectedValueRange:n}}const u_n="SELECT_TIME_SERIES_UPDATE_MODE",yJe="UPDATE_TIME_ANIMATION";function f_n(e,t){return{type:yJe,timeAnimationActive:e,timeAnimationInterval:t}}const bJe="SET_MAP_INTERACTION";function xJe(e){return{type:bJe,mapInteraction:e}}const wJe="SET_LAYER_MENU_OPEN";function SJe(e){return{type:wJe,layerMenuOpen:e}}const _Je="SET_SIDE_PANEL_OPEN";function qpe(e){return{type:_Je,sidePanelOpen:e}}const CJe="SET_SIDE_PANEL_ID";function Xpe(e){return{type:CJe,sidePanelId:e}}const Ype="UPDATE_SIDE_PANEL_SIZE";function d_n(e){return{type:Ype,sizeDelta:e}}const OJe="SET_VOLUME_RENDER_MODE";function h_n(e){return{type:OJe,volumeRenderMode:e}}const EJe="UPDATE_VOLUME_STATE";function p_n(e,t){return{type:EJe,volumeId:e,volumeState:t}}const TJe="SET_VISIBLE_INFO_CARD_ELEMENTS";function g_n(e){return{type:TJe,visibleElements:e}}const PJe="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function m_n(e,t){return{type:PJe,elementType:e,viewMode:t}}const kJe="ADD_ACTIVITY";function OL(e,t){return{type:kJe,id:e,message:t}}const MJe="REMOVE_ACTIVITY";function EL(e){return{type:MJe,id:e}}const AJe="CHANGE_LOCALE";function Qpe(e){return{type:AJe,locale:e}}const RJe="OPEN_DIALOG";function PS(e){return{type:RJe,dialogId:e}}const IJe="CLOSE_DIALOG";function kS(e){return{type:IJe,dialogId:e}}const Kpe="UPDATE_SETTINGS";function TL(e){return{type:Kpe,settings:e}}const DJe="STORE_SETTINGS";function LJe(){return{type:DJe}}function FJe(e){return t=>{t(v_n(e)),t(y_n(e))}}const $Je="ADD_USER_COLOR_BAR";function v_n(e){return{type:$Je,colorBarId:e}}const NJe="REMOVE_USER_COLOR_BAR";function zJe(e){return{type:NJe,colorBarId:e}}function jJe(e){return t=>{t(UJe(e)),t(Zpe(e))}}const BJe="UPDATE_USER_COLOR_BAR";function UJe(e){return{type:BJe,userColorBar:e}}function y_n(e){return(t,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===e);r&&t(Zpe(r))}}function Zpe(e){return t=>{xTt(e).then(({imageData:n,errorMessage:r})=>{t(UJe({...e,imageData:n,errorMessage:r}))})}}function b_n(){return(e,t)=>{t().controlState.userColorBars.forEach(n=>{n.imageData||e(Zpe(n))})}}function VJe(e){return{type:Kpe,settings:{userColorBars:e}}}const Jpe="SET_ZOOM_LEVEL";function WJe(e){return{type:Jpe,zoomLevel:e}}const ege="SET_DATASET_Z_LEVEL";function x_n(e){return{type:ege,datasetZLevel:e}}function $8(e){const[t,n]=M.useState();return M.useEffect(()=>{e?fetch(e).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[e]),t}const HJe=()=>{const e=On.instance.configPath,t=B6(pT.href,e,"about.en.md"),n=$8(t);return O.jsx(Bb,{text:n,path:e})},w_n=({open:e,closeDialog:t})=>{function n(){t("about")}const r=On.instance.branding.appBarTitle;return O.jsxs(Gu,{open:e,onClose:n,children:[O.jsx(hg,{children:Ce.get("About ${appName}",{appName:r})}),O.jsx(Fc,{children:O.jsx(HJe,{})})]})},S_n=e=>({locale:e.controlState.locale,open:!!e.controlState.dialogOpen.about}),__n={closeDialog:kS,changeLocale:Qpe},C_n=hr(S_n,__n)(w_n);var Wz={exports:{}};const O_n={},E_n=Object.freeze(Object.defineProperty({__proto__:null,default:O_n},Symbol.toStringTag,{value:"Module"})),T_n=sut(E_n);var P_n=Wz.exports,nke;function N8(){return nke||(nke=1,(function(e,t){(function(n,r){e.exports=r()})(P_n,function(){var n=n||(function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof Rs<"u"&&Rs.crypto&&(o=Rs.crypto),!o&&typeof V2=="function")try{o=T_n}catch{}var s=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||(function(){function y(){}return function(b){var w;return y.prototype=b,w=new y,y.prototype=null,w}})(),l={},c=l.lib={},u=c.Base=(function(){return{extend:function(y){var b=a(this);return y&&b.mixIn(y),(!b.hasOwnProperty("init")||this.init===b.init)&&(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var b in y)y.hasOwnProperty(b)&&(this[b]=y[b]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),f=c.WordArray=u.extend({init:function(y,b){y=this.words=y||[],b!=i?this.sigBytes=b:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var b=this.words,w=y.words,S=this.sigBytes,_=y.sigBytes;if(this.clamp(),S%4)for(var E=0;E<_;E++){var T=w[E>>>2]>>>24-E%4*8&255;b[S+E>>>2]|=T<<24-(S+E)%4*8}else for(var k=0;k<_;k+=4)b[S+k>>>2]=w[k>>>2];return this.sigBytes+=_,this},clamp:function(){var y=this.words,b=this.sigBytes;y[b>>>2]&=4294967295<<32-b%4*8,y.length=r.ceil(b/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var b=[],w=0;w>>2]>>>24-_%4*8&255;S.push((E>>>4).toString(16)),S.push((E&15).toString(16))}return S.join("")},parse:function(y){for(var b=y.length,w=[],S=0;S>>3]|=parseInt(y.substr(S,2),16)<<24-S%8*4;return new f.init(w,b/2)}},p=d.Latin1={stringify:function(y){for(var b=y.words,w=y.sigBytes,S=[],_=0;_>>2]>>>24-_%4*8&255;S.push(String.fromCharCode(E))}return S.join("")},parse:function(y){for(var b=y.length,w=[],S=0;S>>2]|=(y.charCodeAt(S)&255)<<24-S%4*8;return new f.init(w,b)}},g=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},m=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var b,w=this._data,S=w.words,_=w.sigBytes,E=this.blockSize,T=E*4,k=_/T;y?k=r.ceil(k):k=r.max((k|0)-this._minBufferSize,0);var P=k*E,I=r.min(P*4,_);if(P){for(var R=0;R>>7)^(k<<14|k>>>18)^k>>>3,I=f[T-2],R=(I<<15|I>>>17)^(I<<13|I>>>19)^I>>>10;f[T]=P+f[T-7]+R+f[T-16]}var F=w&S^~w&_,A=m&v^m&y^v&y,L=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),$=(w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25),j=E+$+F+u[T]+f[T],V=L+A;E=_,_=S,S=w,w=b+j|0,b=y,y=v,v=m,m=j+V|0}g[0]=g[0]+m|0,g[1]=g[1]+v|0,g[2]=g[2]+y|0,g[3]=g[3]+b|0,g[4]=g[4]+w|0,g[5]=g[5]+S|0,g[6]=g[6]+_|0,g[7]=g[7]+E|0},_doFinalize:function(){var h=this._data,p=h.words,g=this._nDataBytes*8,m=h.sigBytes*8;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=r.floor(g/4294967296),p[(m+64>>>9<<4)+15]=g,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=a._createHelper(d),i.HmacSHA256=a._createHmacHelper(d)})(Math),n.SHA256})})(Hz)),Hz.exports}var I_n=R_n();const D_n=Yn(I_n);var Gz={exports:{}},L_n=Gz.exports,ike;function F_n(){return ike||(ike=1,(function(e,t){(function(n,r){e.exports=r(N8())})(L_n,function(n){return(function(){var r=n,i=r.lib,o=i.WordArray,s=r.enc;s.Base64={stringify:function(l){var c=l.words,u=l.sigBytes,f=this._map;l.clamp();for(var d=[],h=0;h>>2]>>>24-h%4*8&255,g=c[h+1>>>2]>>>24-(h+1)%4*8&255,m=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|g<<8|m,y=0;y<4&&h+y*.75>>6*(3-y)&63));var b=f.charAt(64);if(b)for(;d.length%4;)d.push(b);return d.join("")},parse:function(l){var c=l.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d>>6-h%4*2,m=p|g;f[d>>>2]|=m<<24-d%4*8,d++}return o.create(f,d)}})(),n.enc.Base64})})(Gz)),Gz.exports}var $_n=F_n();const oke=Yn($_n);var qz={exports:{}},N_n=qz.exports,ske;function z_n(){return ske||(ske=1,(function(e,t){(function(n,r){e.exports=r(N8())})(N_n,function(n){return n.enc.Utf8})})(qz)),qz.exports}var j_n=z_n();const B_n=Yn(j_n);function Nre(e){this.message=e}Nre.prototype=new Error,Nre.prototype.name="InvalidCharacterError";var ake=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Nre("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function U_n(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return(function(n){return decodeURIComponent(ake(n).replace(/(.)/g,(function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o})))})(t)}catch{return ake(t)}}function WB(e){this.message=e}function V_n(e,t){if(typeof e!="string")throw new WB("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(U_n(e.split(".")[n]))}catch(r){throw new WB("Invalid token specified: "+r.message)}}WB.prototype=new Error,WB.prototype.name="InvalidTokenError";var W_n={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},ep,tp,HB=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(HB||{});(e=>{function t(){ep=3,tp=W_n}e.reset=t;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");ep=i}e.setLevel=n;function r(i){tp=i}e.setLogger=r})(HB||(HB={}));var Zn=class{constructor(e){this._name=e}debug(...e){ep>=4&&tp.debug(Zn._format(this._name,this._method),...e)}info(...e){ep>=3&&tp.info(Zn._format(this._name,this._method),...e)}warn(...e){ep>=2&&tp.warn(Zn._format(this._name,this._method),...e)}error(...e){ep>=1&&tp.error(Zn._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new Zn(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){ep>=4&&tp.debug(Zn._format(e),...t)}static info(e,...t){ep>=3&&tp.info(Zn._format(e),...t)}static warn(e,...t){ep>=2&&tp.warn(Zn._format(e),...t)}static error(e,...t){ep>=1&&tp.error(Zn._format(e),...t)}};HB.reset();var H_n="10000000-1000-4000-8000-100000000000",Ep=class{static _randomWord(){return M_n.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return H_n.replace(/[018]/g,t=>(+t^Ep._randomWord()&15>>+t/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Ep.generateUUIDv4()+Ep.generateUUIDv4()+Ep.generateUUIDv4()}static generateCodeChallenge(e){try{const t=D_n(e);return oke.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw Zn.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=B_n.parse([e,t].join(":"));return oke.stringify(n)}},Qy=class{constructor(t){this._name=t,this._logger=new Zn(`Event('${this._name}')`),this._callbacks=[]}addHandler(t){return this._callbacks.push(t),()=>this.removeHandler(t)}removeHandler(t){const n=this._callbacks.lastIndexOf(t);n>=0&&this._callbacks.splice(n,1)}raise(...t){this._logger.debug("raise:",...t);for(const n of this._callbacks)n(...t)}},zre=class{static decode(e){try{return V_n(e)}catch(t){throw Zn.error("JwtUtils.decode",t),t}}},lke=class{static center({...e}){var t,n,r;return e.width==null&&(e.width=(t=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?t:360),(n=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((r=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},zf=class extends Qy{constructor(){super(...arguments),this._logger=new Zn(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-zf.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=zf.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=zf.getEpochTime()+e;if(this.expiration===n&&this._timerHandle){t.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,r*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},jre=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const r=new URL(e,"http://127.0.0.1")[t==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},Bre=";",Mw=class extends Error{constructor(e,t){var n,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw Zn.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(n=e.error_description)!=null?n:null,this.error_uri=(r=e.error_uri)!=null?r:null,this.state=e.userState,this.session_state=(i=e.session_state)!=null?i:null,this.url_state=e.url_state}},tge=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},G_n=class{constructor(e){this._logger=new Zn("AccessTokenEvents"),this._expiringTimer=new zf("Access token expiring"),this._expiredTimer=new zf("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),t.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},q_n=class{constructor(e,t,n,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new Zn("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=s=>{s.origin===this._frame_origin&&s.source===this._frame.contentWindow&&(s.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):s.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(s.data+" message from check session op iframe"))};const o=new URL(n);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},GJe=class{constructor(){this._logger=new Zn("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},nge=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new Zn("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(e,{...t,signal:i.signal})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?new tge("Network timed out"):s}finally{clearTimeout(o)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);let o;try{r.debug("url:",e),o=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${e}`)),o.ok&&this._jwtHandler&&s?.startsWith("application/jwt"))return await this._jwtHandler(await o.text());let a;try{a=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",a),a.error?new Mw(a):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`);return a}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(s.Authorization="Basic "+n),this.appendExtraHeaders(s);let a;try{o.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"POST",headers:s,body:t,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",a.status);const l=a.headers.get("Content-Type");if(l&&!this._contentTypes.find(f=>l.startsWith(f)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${e}`);const c=await a.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),a.ok?f:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw o.error("Error from server:",u),u.error?new Mw(u,t):new Error(`${a.statusText} (${a.status}): ${JSON.stringify(u)}`);return u}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){t.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(e[i]=o)})}},X_n=class{constructor(e){this._settings=e,this._logger=new Zn("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new nge(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),r[e]===void 0){if(t===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},qJe=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new Zn("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const i=zre.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new nge(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}},XJe=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new Zn("TokenClient"),this._jsonService=new nge(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),t||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;a=Ep.generateBasicAuth(n,r);break;case"client_secret_post":s.append("client_id",n),r&&s.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");t||o.throw(new Error("A client_id is required"));const s=new URLSearchParams({grant_type:e,scope:r});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Ep.generateBasicAuth(t,n);break;case"client_secret_post":s.append("client_id",t),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");t||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:e});for(const[u,f]of Object.entries(i))Array.isArray(f)?f.forEach(d=>s.append(u,d)):f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Ep.generateBasicAuth(t,n);break;case"client_secret_post":s.append("client_id",t),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(t=e.token_type_hint)!=null?t:"default token type"}`);const i=new URLSearchParams;for(const[o,s]of Object.entries(e))s!=null&&i.set(o,s);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},nCn=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new Zn("ResponseValidator"),this._userInfoService=new tCn(this._settings,this._metadataService),this._tokenClient=new XJe(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t?.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&e.id_token&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){var n,r;const i=this._logger.create("validateRefreshResponse");e.userState=t.data,(n=e.session_state)!=null||(e.session_state=t.session_state),(r=e.scope)!=null||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const o=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,o),i.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new Mw(e)}_processSigninState(e,t){var n;const r=this._logger.create("_processSigninState");if(t.id!==e.state&&r.throw(new Error("State does not match")),t.client_id||r.throw(new Error("No client_id on state")),t.authority||r.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,(n=e.scope)!=null||(e.scope=t.scope),e.error)throw r.warn("Response was error",e.error),new Mw(e);t.code_verifier&&!e.code&&r.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=zre.decode((n=e.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const o=zre.decode(t);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},ME=class{constructor(e){this.id=e.id||Ep.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=zf.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new Zn("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return Zn.createStatic("State","fromStorageString"),new ME(JSON.parse(e))}static async clearStaleState(e,t){const n=Zn.createStatic("State","clearStaleState"),r=zf.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let o=0;oy.searchParams.append("resource",S));for(const[w,S]of Object.entries({response_mode:a,...v,...p}))S!=null&&y.searchParams.append(w,S.toString());this.url=y.href}},iCn="openid",Kq=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const t=decodeURIComponent(this.state).split(Bre);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(Bre))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-zf.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+zf.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(iCn))||!!this.id_token}},oCn=class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o,client_id:s}){if(this._logger=new Zn("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(e);n&&a.searchParams.append("id_token_hint",n),s&&a.searchParams.append("client_id",s),r&&(a.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new ME({data:t,request_type:o}),a.searchParams.append("state",this.state.id)));for(const[l,c]of Object.entries({...i}))c!=null&&a.searchParams.append(l,c.toString());this.url=a.href}},sCn=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},aCn=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],lCn=["sub","iss","aud","exp","iat"],cCn=class{constructor(e){this._settings=e,this._logger=new Zn("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=aCn;for(const r of n)lCn.includes(r)||delete t[r]}return t}mergeClaims(e,t){const n={...e};for(const[r,i]of Object.entries(t))for(const o of Array.isArray(i)?i:[i]){const s=n[r];s===void 0?n[r]=o:Array.isArray(s)?s.includes(o)||s.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(s,o):n[r]=[s,o])}return n}},uCn=class{constructor(e,t){this._logger=new Zn("OidcClient"),this.settings=e instanceof Ure?e:new Ure(e),this.metadataService=t??new X_n(this.settings),this._claimsService=new cCn(this.settings),this._validator=new nCn(this.settings,this.metadataService,this._claimsService),this._tokenClient=new XJe(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:s,nonce:a,url_state:l,response_type:c=this.settings.response_type,scope:u=this.settings.scope,redirect_uri:f=this.settings.redirect_uri,prompt:d=this.settings.prompt,display:h=this.settings.display,max_age:p=this.settings.max_age,ui_locales:g=this.settings.ui_locales,acr_values:m=this.settings.acr_values,resource:v=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:b=this.settings.extraQueryParams,extraTokenParams:w=this.settings.extraTokenParams}){const S=this._logger.create("createSigninRequest");if(c!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();S.debug("Received authorization endpoint",_);const E=new rCn({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:f,response_type:c,scope:u,state_data:e,url_state:l,prompt:d,display:h,max_age:p,ui_locales:g,id_token_hint:i,login_hint:o,acr_values:m,resource:v,request:t,request_uri:n,extraQueryParams:b,extraTokenParams:w,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const T=E.state;return await this.settings.stateStore.set(T.id,T.toStorageString()),E}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new Kq(jre.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:rge.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),o=new Kq(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:e,timeoutInSeconds:t,extraTokenParams:n}){var r;const i=this._logger.create("useRefreshToken");let o;if(this.settings.refreshTokenAllowedScope===void 0)o=e.scope;else{const l=this.settings.refreshTokenAllowedScope.split(" ");o=(((r=e.scope)==null?void 0:r.split(" "))||[]).filter(u=>l.includes(u)).join(" ")}const s=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:o,timeoutInSeconds:t,...n}),a=new Kq(new URLSearchParams);return Object.assign(a,s),i.debug("validating response",a),await this._validator.validateRefreshResponse(a,{...e,scope:o}),a}async createSignoutRequest({state:e,id_token_hint:t,client_id:n,request_type:r,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const s=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw s.throw(new Error("No end session endpoint")),null;s.debug("Received end session endpoint",a),!n&&i&&!t&&(n=this.settings.client_id);const l=new oCn({url:a,id_token_hint:t,client_id:n,post_logout_redirect_uri:i,state_data:e,extraQueryParams:o,request_type:r});await this.clearStaleState();const c=l.state;return c&&(s.debug("Signout request has state to persist"),await this.settings.stateStore.set(c.id,c.toStorageString())),l}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new sCn(jre.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new Mw(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:ME.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),ME.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},fCn=class{constructor(e){this._userManager=e,this._logger=new Zn("SessionMonitor"),this._start=async t=>{const n=t.session_state;if(!n)return;const r=this._logger.create("_start");if(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,s=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,l=new q_n(this._callback,o,i,s,a);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const t=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){t.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const t=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?t.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):t.debug("different subject signed into OP",n.sub):t.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():t.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(t.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(t=>{this._logger.error(t)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const t=await this._userManager.querySessionStatus();if(t){const n={session_state:t.session_state,profile:t.sub&&t.sid?{sub:t.sub,sid:t.sid}:null};this._start(n)}}}},Xz=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=(t=e.session_state)!=null?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-zf.getEpochTime()}set expires_in(e){e!==void 0&&(this.expires_at=Math.floor(e)+zf.getEpochTime())}get expired(){const e=this.expires_in;if(e!==void 0)return e<=0}get scopes(){var e,t;return(t=(e=this.scope)==null?void 0:e.split(" "))!=null?t:[]}toStorageString(){return new Zn("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return Zn.createStatic("User","fromStorageString"),new Xz(JSON.parse(e))}},cke="oidc-client",YJe=class{constructor(){this._abort=new Qy("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const s=a=>{var l;const c=a.data,u=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(a.origin!==u||c?.source!==cke)){try{const f=jre.readParams(c.url,e.response_mode).get("state");if(f||t.warn("no state found in response url"),a.source!==this._window&&f!==e.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",s,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",s,!1)),this._disposeHandlers.add(this._abort.addHandler(a=>{this._dispose(),o(a)}))});return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:cke,url:t,keepOpen:n},r)}},QJe={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},KJe="_blank",dCn=60,hCn=2,ZJe=10,pCn=class extends Ure{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=QJe,popupWindowTarget:i=KJe,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,silent_redirect_uri:c=e.redirect_uri,silentRequestTimeoutInSeconds:u=ZJe,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:g=!1,checkSessionIntervalInSeconds:m=hCn,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:b=["access_token","refresh_token"],revokeTokensOnSignout:w=!1,includeIdTokenInSilentSignout:S=!1,accessTokenExpiringNotificationTimeInSeconds:_=dCn,userStore:E}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=s,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=l,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=u,this.automaticSilentRenew=f,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=h,this.monitorSession=p,this.monitorAnonymousSession=g,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=b,this.revokeTokensOnSignout=w,this.includeIdTokenInSilentSignout=S,this.accessTokenExpiringNotificationTimeInSeconds=_,E)this.userStore=E;else{const T=typeof window<"u"?window.sessionStorage:new GJe;this.userStore=new qJe({store:T})}}},Vre=class extends YJe{constructor({silentRequestTimeoutInSeconds:e=ZJe}){super(),this._logger=new Zn("IFrameWindow"),this._timeoutInSeconds=e,this._frame=Vre.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout(()=>this._abort.raise(new tge("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(t)),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",t=>{var n;const r=t.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(e=this._frame.contentWindow)==null||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},gCn=class{constructor(e){this._settings=e,this._logger=new Zn("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Vre({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Vre.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},mCn=500,vCn=1e3,uke=class extends YJe{constructor({popupWindowTarget:e=KJe,popupWindowFeatures:t={}}){super(),this._logger=new Zn("PopupWindow");const n=lke.center({...QJe,...t});this._window=window.open(void 0,e,lke.serialize(n)),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},t.closePopupWindowAfterInSeconds*vCn)}async navigate(e){var t;(t=this._window)==null||t.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},mCn);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},yCn=class{constructor(e){this._settings=e,this._logger=new Zn("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new uke({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),uke.notifyOpener(e,t)}},bCn=class{constructor(e){this._settings=e,this._logger=new Zn("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;t==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[e].bind(r.location);let o;return{navigate:async s=>{this._logger.create("navigate");const a=new Promise((l,c)=>{o=c});return i(s.url),await a},close:()=>{this._logger.create("close"),o?.(new Error("Redirect aborted")),r.stop()}}}async callback(){}},xCn=class extends G_n{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new Zn("UserManagerEvents"),this._userLoaded=new Qy("User loaded"),this._userUnloaded=new Qy("User unloaded"),this._silentRenewError=new Qy("Silent renew error"),this._userSignedIn=new Qy("User signed in"),this._userSignedOut=new Qy("User signed out"),this._userSessionChanged=new Qy("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},wCn=class{constructor(e){this._userManager=e,this._logger=new Zn("SilentRenewService"),this._isStarted=!1,this._retryTimer=new zf("Retry Silent Renew"),this._tokenExpiring=async()=>{const t=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),t.debug("silent token renewal successful")}catch(n){if(n instanceof tge){t.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}t.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},SCn=class{constructor(e,t){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.resource=t,this.data=e.state}},_Cn=class{constructor(e,t,n,r){this._logger=new Zn("UserManager"),this.settings=new pCn(e),this._client=new uCn(e),this._redirectNavigator=t??new bCn(this.settings),this._popupNavigator=n??new yCn(this.settings),this._iframeNavigator=r??new gCn(this.settings),this._events=new xCn(this.settings),this._silentRenewService=new wCn(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new fCn(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,o=this.settings.popup_redirect_uri;o||t.throw(new Error("No popup_redirect_uri configured"));const s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},s);return a&&(a.profile&&a.profile.sub?t.info("success, signed in subject",a.profile.sub):t.info("no subject")),a}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,resource:i,...o}=e;let s=await this._loadUser();if(s?.refresh_token){n.debug("using refresh token");const u=new SCn(s,i);return await this._useRefreshToken({state:u,extraTokenParams:o.extraTokenParams})}const a=this.settings.silent_redirect_uri;a||n.throw(new Error("No silent_redirect_uri configured"));let l;s&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",s.profile.sub),l=s.profile.sub);const c=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return s=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?s?.id_token:void 0,...o},c,l),s&&((t=s.profile)!=null&&t.sub?n.info("success, signed in subject",s.profile.sub):n.info("no subject")),s}async _useRefreshToken(e){const t=await this._client.useRefreshToken({...e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new Xz({...e.state,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":return await this.signoutRedirectCallback(e);case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o?.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},s);try{const l=await this._client.processSigninResponse(a.url);return t.debug("got signin response"),l.session_state&&l.profile.sub?(t.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(t.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof Mw)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),r}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new Xz(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new Mw({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,o=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:o==null?void 0:{},...i},s),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=e.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const s=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:s.url,state:(n=s.state)==null?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,o=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...i},a),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter(i=>typeof e[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(e[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(e[i]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),Xz.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},ige=Te.createContext(void 0);ige.displayName="AuthContext";var CCn={isLoading:!0,isAuthenticated:!1},OCn=(e,t)=>{switch(t.type){case"INITIALISED":case"USER_LOADED":return{...e,user:t.user,isLoading:!1,isAuthenticated:t.user?!t.user.expired:!1,error:void 0};case"USER_SIGNED_OUT":case"USER_UNLOADED":return{...e,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...e,isLoading:!0,activeNavigator:t.method};case"NAVIGATOR_CLOSE":return{...e,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...e,isLoading:!1,error:t.error};default:return{...e,isLoading:!1,error:new Error(`unknown type ${t.type}`)}}},ECn=(e=window.location)=>{let t=new URLSearchParams(e.search);return!!((t.get("code")||t.get("error"))&&t.get("state")||(t=new URLSearchParams(e.hash.replace("#","?")),(t.get("code")||t.get("error"))&&t.get("state")))},JJe=e=>t=>t instanceof Error?t:new Error(e),TCn=JJe("Login failed"),PCn=JJe("Sign-out failed"),kCn=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],MCn=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],Zq=e=>()=>{throw new Error(`UserManager#${e} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},ACn=typeof window>"u"?null:_Cn,RCn=e=>{const{children:t,onSigninCallback:n,skipSigninCallback:r,matchSignoutCallback:i,onSignoutCallback:o,onRemoveUser:s,onSignoutRedirect:a,onSignoutPopup:l,implementation:c=ACn,userManager:u,...f}=e,[d]=Te.useState(()=>u??(c?new c(f):{settings:f})),[h,p]=Te.useReducer(OCn,CCn),g=Te.useMemo(()=>Object.assign({settings:d.settings,events:d.events},Object.fromEntries(kCn.map(_=>{var E,T;return[_,(T=(E=d[_])==null?void 0:E.bind(d))!=null?T:Zq(_)]})),Object.fromEntries(MCn.map(_=>[_,d[_]?async E=>{p({type:"NAVIGATOR_INIT",method:_});try{return await d[_](E)}catch(T){return p({type:"ERROR",error:T}),null}finally{p({type:"NAVIGATOR_CLOSE"})}}:Zq(_)]))),[d]),m=Te.useRef(!1);Te.useEffect(()=>{!d||m.current||(m.current=!0,(async()=>{let _=null;try{ECn()&&!r&&(_=await d.signinCallback(),n&&await n(_)),_=_||await d.getUser(),p({type:"INITIALISED",user:_})}catch(E){p({type:"ERROR",error:TCn(E)})}try{if(i&&i(d.settings)){const E=await d.signoutCallback();o&&await o(E)}}catch(E){p({type:"ERROR",error:PCn(E)})}})())},[d,r,n,o,i]),Te.useEffect(()=>{if(!d)return;const _=P=>{p({type:"USER_LOADED",user:P})};d.events.addUserLoaded(_);const E=()=>{p({type:"USER_UNLOADED"})};d.events.addUserUnloaded(E);const T=()=>{p({type:"USER_SIGNED_OUT"})};d.events.addUserSignedOut(T);const k=P=>{p({type:"ERROR",error:P})};return d.events.addSilentRenewError(k),()=>{d.events.removeUserLoaded(_),d.events.removeUserUnloaded(E),d.events.removeUserSignedOut(T),d.events.removeSilentRenewError(k)}},[d]);const v=Te.useCallback(d?()=>d.removeUser().then(s):Zq("removeUser"),[d,s]),y=Te.useCallback(_=>g.signoutRedirect(_).then(a),[g.signoutRedirect,a]),b=Te.useCallback(_=>g.signoutPopup(_).then(l),[g.signoutPopup,l]),w=Te.useCallback(_=>g.signoutSilent(_),[g.signoutSilent]),S=Te.useMemo(()=>({...h,...g,removeUser:v,signoutRedirect:y,signoutPopup:b,signoutSilent:w}),[h,g,v]);return Te.createElement(ige.Provider,{value:S},t)},ICn=()=>{const e=Te.useContext(ige);return e||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component."),e};class eet extends M.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error(t),n.componentStack&&console.error(n.componentStack)}render(){if(!this.props.children)throw new Error("An ErrorBoundary requires at least one child");return this.state.error?O.jsxs("div",{children:[O.jsx("h2",{className:"errorBoundary-header",children:Ce.get("Something went wrong.")}),O.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),O.jsx("br",{})]})]}):this.props.children}}const DCn=({children:e})=>{const t=On.instance.authClient;if(!t)return O.jsx(O.Fragment,{children:e});const n=o=>{window.history.replaceState({},document.title,window.location.pathname)},r=()=>{console.debug("handleRemoveUser"),window.location.pathname="/"},i=pT.href;return O.jsx(eet,{children:O.jsx(RCn,{...t,loadUserInfo:!0,scope:"openid email profile",automaticSilentRenew:!0,redirect_uri:i,post_logout_redirect_uri:i,popup_post_logout_redirect_uri:i,onSigninCallback:n,onRemoveUser:r,children:e})})},MN={size:"0.5rem",borderRadius:0},LCn={trackColor:"#222",thumbColor:"#666",thumbColorHover:"#444"},FCn={trackColor:"#eee",thumbColor:"#ccc",thumbColorHover:"#aaa"},$Cn=()=>{const t=as().palette.mode==="dark"?LCn:FCn;return O.jsx(Sze,{styles:{"::-webkit-scrollbar":{width:MN.size,height:MN.size},"::-webkit-scrollbar-track":{backgroundColor:t.trackColor,borderRadius:MN.borderRadius},"::-webkit-scrollbar-thumb":{backgroundColor:t.thumbColor,borderRadius:MN.borderRadius,"&:hover":{backgroundColor:t.thumbColorHover}},"::-webkit-scrollbar-corner":{backgroundColor:t.trackColor}}})},tet=at(O.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload"),net=at(O.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),ret=at(O.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share");const NCn=at(O.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"CodeOutlined"),iet=at(O.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),zCn=at(O.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined"),jCn=at(O.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),BCn=at(O.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),UCn=at(O.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),VCn=at([O.jsx("path",{d:"m21 5-9-4-9 4v6c0 5.55 3.84 10.74 9 12 2.3-.56 4.33-1.9 5.88-3.71l-3.12-3.12c-1.94 1.29-4.58 1.07-6.29-.64-1.95-1.95-1.95-5.12 0-7.07s5.12-1.95 7.07 0c1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),O.jsx("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy"),fP=at(O.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Jq={dialog:e=>({backgroundColor:e.palette.mode==="dark"?e.palette.grey[800]:e.palette.grey[200],padding:2}),appBar:{position:"relative"},title:e=>({marginLeft:e.spacing(2),flex:1})},WCn=Qn("div")(({theme:e})=>({marginTop:e.spacing(4),marginLeft:e.spacing(40),marginRight:e.spacing(40)})),HCn=Te.forwardRef(function(t,n){return O.jsx(J0t,{direction:"up",ref:n,...t})}),oet=({title:e,text:t,open:n,onClose:r})=>O.jsxs(Gu,{fullScreen:!0,open:n,onClose:r,TransitionComponent:HCn,PaperProps:{tabIndex:-1},children:[O.jsx(Eze,{sx:Jq.appBar,children:O.jsxs(HI,{children:[O.jsx(Mn,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:O.jsx(fP,{})}),O.jsx(mn,{variant:"h6",sx:Jq.title,children:e})]})}),O.jsx(Fc,{sx:Jq.dialog,children:O.jsx(WCn,{children:O.jsx(Bb,{text:t})})})]}),GCn=({open:e,onClose:t})=>{const n=$8(Ce.get("docs/imprint.en.md"));return O.jsx(oet,{title:Ce.get("Imprint"),text:n??"",open:e,onClose:t})},qCn=({open:e,onClose:t})=>{const n=$8(Ce.get("docs/dev-reference.en.md")),r=W4e(),i=M.useMemo(()=>{if(n){const o=XCn(r),s=YCn();return n.replace("${extensions}",o).replace("${derivedState}",s)}},[n,r]);return O.jsx(oet,{title:Ce.get("Developer Reference"),text:i||"",open:e,onClose:t})};function XCn(e){const t=[];return Object.getOwnPropertyNames(e).forEach(n=>{const r=e[n];t.push(` Contribution point **\`${n}\`**: `),r.forEach(({name:i,extension:o})=>{t.push(`- \`${i}\` from extension \`${o}\``)})}),t.join(` -`)}function lPn(){const e=["","","| | Python type | Description |","|------------|---------------|---------------|"];return Object.getOwnPropertyNames(Rie).forEach(t=>{const n=Rie[t];e.push(`| \`${t}\` | **${n.type.replace("|","\\|")}** | ${n.description} |`)}),e.push(""),e.join(` -`)}function cPn({appName:e,allowRefresh:t,allowSharing:n,allowDownloads:r,compact:i,style:o,openDialog:s,updateResources:a,shareStatePermalink:l}){const[c,u]=M.useState(!1),[f,d]=M.useState(!1),[h,p]=M.useState(!1),g=M.useRef(null),m=()=>{p(!0)},v=()=>{p(!1)},y=()=>{v(),s("settings")},b=()=>{v(),s("about")},w=()=>{v(),window.open("https://xcube-dev.github.io/xcube-viewer/","Manual")},S=()=>{v(),d(!0)},_=()=>{d(!1)},E=()=>{v(),u(!0)},T=()=>{u(!1)},k=()=>{v(),a()},P=()=>{v(),l()},R=()=>{v(),s("export")};return O.jsxs(M.Fragment,{children:[O.jsx(_n,{arrow:!0,title:Ce.get("More"),children:O.jsx(Mn,{onClick:m,size:"small",sx:o,ref:g,children:i?O.jsx(JTn,{}):O.jsx(ePn,{})})}),O.jsx(oPn,{open:c,onClose:T}),O.jsx(sPn,{open:f,onClose:_}),O.jsxs(iS,{anchorEl:g.current,open:h,onClose:v,children:[i&&O.jsxs(O.Fragment,{children:[t&&O.jsxs(tr,{onClick:k,children:[O.jsx(rl,{children:O.jsx(mnt,{fontSize:"small"})}),O.jsx(Yi,{children:Ce.get("Refresh")})]}),n&&O.jsxs(tr,{onClick:P,children:[O.jsx(rl,{children:O.jsx(vnt,{fontSize:"small"})}),O.jsx(Yi,{children:Ce.get("Share")})]}),r&&O.jsxs(tr,{onClick:R,children:[O.jsx(rl,{children:O.jsx(gnt,{fontSize:"small"})}),O.jsx(Yi,{children:Ce.get("Export data")})]}),O.jsx(oa,{})]}),O.jsxs(tr,{onClick:y,children:[O.jsx(rl,{children:O.jsx(tPn,{fontSize:"small"})}),O.jsx(Yi,{children:Ce.get("Settings")})]}),O.jsx(oa,{}),O.jsxs(tr,{onClick:w,children:[O.jsx(rl,{children:O.jsx(ynt,{fontSize:"small"})}),O.jsx(Yi,{children:Ce.get("Documentation")})]}),O.jsxs(tr,{onClick:S,children:[O.jsx(rl,{children:O.jsx(KTn,{fontSize:"small"})}),O.jsx(Yi,{children:Ce.get("Developer Reference")})]}),O.jsxs(tr,{onClick:E,children:[O.jsx(rl,{children:O.jsx(nPn,{fontSize:"small"})}),O.jsx(Yi,{children:Ce.get("Imprint")})]}),On.instance.branding.allowAboutPage&&O.jsxs(O.Fragment,{children:[O.jsx(oa,{}),O.jsxs(tr,{onClick:b,children:[O.jsx(rl,{children:O.jsx(ZTn,{fontSize:"small"})}),O.jsx(Yi,{children:Ce.get("About ${appName}",{appName:e})})]})]})]})]})}const uPn=e=>({locale:e.controlState.locale,appName:On.instance.branding.appBarTitle,allowRefresh:On.instance.branding.allowRefresh,allowSharing:On.instance.branding.allowSharing,allowDownloads:On.instance.branding.allowDownloads,compact:On.instance.branding.compact}),fPn={openDialog:FS,updateResources:Get,shareStatePermalink:Het},xnt=dr(uPn,fPn)(cPn),aMe=ot(O.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),dPn=({userInfo:e})=>O.jsxs(y9,{container:!0,justifyContent:"center",spacing:1,children:[O.jsx(y9,{item:!0,children:O.jsx("img",{src:e.picture,width:84,alt:Ce.get("User Profile")})}),O.jsx(y9,{item:!0,children:O.jsx(fa,{elevation:3,children:O.jsxs(tD,{children:[O.jsx(cO,{children:O.jsx(Yi,{primary:e.name,secondary:Ce.get("User name")})}),O.jsx(oa,{light:!0}),O.jsx(cO,{children:O.jsx(Yi,{primary:`${e.email} (${e.email_verified?Ce.get("verified"):Ce.get("not verified")})`,secondary:Ce.get("E-mail")})}),O.jsx(oa,{light:!0}),O.jsx(cO,{children:O.jsx(Yi,{primary:e.nickname,secondary:Ce.get("Nickname")})})]})})})]}),U_={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:P1[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:P1[300]},signInProgress:{color:P1[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:e=>({marginLeft:e.spacing(2),...On.instance.branding.headerIconStyle})},hPn=Qn("div")({position:"relative"}),pPn=({updateAccessToken:e})=>{const t=GTn(),[n,r]=M.useState(null),[i,o]=M.useState(!1);M.useEffect(()=>{t.user&&t.user.access_token?e(t.user.access_token):e(null)},[t.user,e]);const s=()=>{c(),o(!0)},a=()=>{o(!1)},l=d=>{r(d.currentTarget)},c=()=>{r(null)},u=()=>{t.signinRedirect().then(()=>{}).catch(d=>{console.error(d)})},f=()=>{c(),t.signoutRedirect().then(()=>{}).catch(d=>{console.error(d)})};if(t.user){const d=t.user.profile;let h,p=O.jsx(aMe,{});if(!d)h=O.jsx(h9,{sx:U_.letterAvatar,children:"?"});else if(d.picture)h=O.jsx(h9,{sx:U_.imageAvatar,src:d.picture,alt:d.name});else{const g=d.given_name||d.name||d.nickname,m=d.family_name;let v=null;g&&m?v=g[0]+m[0]:g?v=g[0]:m&&(v=m[0]),v!==null&&(p=v.toUpperCase()),h=O.jsx(h9,{sx:U_.letterAvatar,children:p})}return O.jsxs(M.Fragment,{children:[O.jsx(Mn,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:U_.iconButton,children:h}),O.jsxs(iS,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[O.jsx(tr,{onClick:s,children:Ce.get("Profile")}),O.jsx(tr,{onClick:f,children:Ce.get("Log out")})]}),O.jsxs(Gu,{open:i,keepMounted:!0,onClose:a,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[O.jsx(gg,{id:"alert-dialog-slide-title",children:Ce.get("User Profile")}),O.jsx(Nc,{children:O.jsx(dPn,{userInfo:t.user.profile})}),O.jsx(Cb,{children:O.jsx(ji,{onClick:a,children:"OK"})})]})]})}else{let d=O.jsx(_n,{arrow:!0,title:Ce.get("User Profile"),children:O.jsx(Mn,{onClick:t.isLoading?void 0:u,size:"small",sx:U_.iconButton,children:O.jsx(aMe,{})})});return t.isLoading&&(d=O.jsxs(hPn,{children:[d,O.jsx(Eh,{size:24,sx:U_.signInProgress})]})),d}},gPn=e=>On.instance.authClient?O.jsx(pPn,{...e}):null,mPn=gPn,wnt="UPDATE_ACCESS_TOKEN";function vPn(e){return(t,n)=>{const r=n().userAuthState.accessToken;r!==e&&(t(yPn(e)),(e===null||r===null)&&t(qet()))}}function yPn(e){return{type:wnt,accessToken:e}}const bPn=e=>({}),xPn={updateAccessToken:vPn},Snt=dr(bPn,xPn)(mPn),wPn={appBar:e=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})})},SPn=Oe("a")(()=>({display:"flex",alignItems:"center"})),_Pn=Oe("img")(({theme:e})=>({marginLeft:e.spacing(1)})),V_={toolbar:e=>({backgroundColor:On.instance.branding.headerBackgroundColor,paddingRight:e.spacing(1)}),title:e=>({flexGrow:1,marginLeft:e.spacing(1),...On.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:P1[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:P1[300]},signInProgress:{color:P1[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:e=>({marginLeft:e.spacing(2),...On.instance.branding.headerIconStyle})};function CPn({appName:e,allowRefresh:t,allowSharing:n,allowDownloads:r,openDialog:i,updateResources:o,shareStatePermalink:s}){return O.jsx(Ije,{position:"absolute",sx:wPn.appBar,elevation:0,children:O.jsxs(nD,{disableGutters:!0,sx:V_.toolbar,variant:"dense",children:[O.jsx(SPn,{href:On.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:O.jsx(_Pn,{src:On.instance.branding.logoImage,width:On.instance.branding.logoWidth,alt:"xcube logo"})}),O.jsx(yn,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:V_.title,children:e}),O.jsx(Snt,{}),t&&O.jsx(_n,{arrow:!0,title:Ce.get("Refresh"),children:O.jsx(Mn,{onClick:o,size:"small",sx:V_.iconButton,children:O.jsx(mnt,{})})}),n&&O.jsx(_n,{arrow:!0,title:Ce.get("Share"),children:O.jsx(Mn,{onClick:s,size:"small",sx:V_.iconButton,children:O.jsx(vnt,{})})}),r&&O.jsx(_n,{arrow:!0,title:Ce.get("Export data"),children:O.jsx(Mn,{onClick:()=>i("export"),size:"small",sx:V_.iconButton,children:O.jsx(gnt,{})})}),O.jsx(xnt,{style:V_.iconButton})]})})}const OPn=e=>({locale:e.controlState.locale,appName:On.instance.branding.appBarTitle,allowRefresh:On.instance.branding.allowRefresh,allowSharing:On.instance.branding.allowSharing,allowDownloads:On.instance.branding.allowDownloads,compact:On.instance.branding.compact}),EPn={openDialog:FS,updateResources:Get,shareStatePermalink:Het},TPn=dr(OPn,EPn)(CPn),PPn=Qn("form")(({theme:e})=>({display:"flex",flexWrap:"wrap",paddingTop:e.spacing(1),paddingLeft:e.spacing(.5),paddingRight:e.spacing(0),paddingBottom:e.spacing(.25),flexGrow:0}));function kPn({children:e}){return O.jsx(PPn,{autoComplete:"off",children:e})}const v4=ot(O.jsx("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin"),_nt=ot(O.jsx("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore"),MPn={materialIcon:{fontFamily:"Material Icons"}},Wl=({sx:e,className:t,size:n,disabled:r,onClick:i,icon:o,tooltipText:s,tooltipPlacement:a,toggle:l,value:c,selected:u})=>{const f=p=>{l?i(p,c):i(p)},d=!o||typeof o=="string"?O.jsx(HO,{sx:MPn.materialIcon,children:o||"star"}):o,h=s?O.jsx(_n,{arrow:!0,title:s,enterDelay:600,leaveDelay:100,placement:a,children:d}):d;return l?O.jsx(oo,{sx:{padding:.3,...e},className:t,disabled:r,size:n||"small",onClick:f,value:c||"",selected:u,children:h}):O.jsx(Mn,{sx:e,className:t,disabled:r,size:n||"small",onClick:f,children:h})},km={toggleButton:{padding:.5}},APn=Qn(ld)(({theme:e})=>({marginRight:e.spacing(1),marginLeft:e.spacing(2)}));function FR({label:e,control:t,actions:n,sx:r}){return O.jsx(APn,{variant:"standard",sx:r,children:O.jsxs(bt,{children:[e,t,n]})})}function RPn({selectedDataset:e,selectedDataset2Id:t,datasets:n,selectDataset:r,layerVisibilities:i,toggleDatasetRgbLayer:o,locateSelectedDataset:s}){const a=M.useMemo(()=>n.sort((m,v)=>{const y=m.groupOrder??1/0,b=v.groupOrder??1/0;if(y!==b)return y-b;const w=m.groupTitle||"zzz",S=v.groupTitle||"zzz",_=w.localeCompare(S);if(_!==0)return _;const E=m.sortValue,T=v.sortValue;return E!==void 0&&T!==void 0?E-T:E===void 0&&T===void 0?m.title.localeCompare(v.title):E!==void 0?-1:1}),[n]),l=a.length>0&&!!a[0].groupTitle,c=m=>{const v=m.target.value||null;r(v,n,!0)},u=e?e.id:"";n=n||[];const f=O.jsx(_v,{shrink:!0,htmlFor:"dataset-select",children:Ce.get("Dataset")}),d=[];let h;a.forEach(m=>{if(l){const v=m.groupTitle||Ce.get("Others"),y=m.groupDescription;if(v!==h){const b=O.jsx(oa,{children:O.jsx(yn,{fontSize:"small",color:"text.secondary",children:v})},v);d.push(y?O.jsx(_n,{arrow:!0,title:y,children:b}):b)}h=v}d.push(O.jsxs(tr,{value:m.id,selected:m.id===u,children:[O.jsxs(Yi,{children:[lMe(m)," "]}),m.id===t&&O.jsx(v4,{fontSize:"small",color:"secondary"})]},m.id))});const p=O.jsx(Th,{variant:"standard",value:u,onChange:c,input:O.jsx(Ob,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",renderValue:()=>lMe(n.find(m=>m.id===u)),children:d}),g=i.datasetRgb&&!i.datasetVariable;return O.jsx(FR,{label:f,control:p,actions:O.jsxs(O.Fragment,{children:[e?.rgbSchema&&O.jsx(Wl,{onClick:()=>o(!g),tooltipText:Ce.get("Switch between dataset RGB layer and variable layer"),sx:{...km.toggleButton,width:"26.42px",height:"26.42px",marginLeft:.4},icon:O.jsx(yn,{fontSize:9,children:"RGB"}),toggle:!0,value:"rgb",selected:g}),O.jsx(Wl,{onClick:s,tooltipText:Ce.get("Locate dataset in map"),icon:O.jsx(_nt,{})})]}),sx:{marginLeft:0}})}function lMe(e){return e?e.title||e.id:"?"}const IPn=e=>({locale:e.controlState.locale,selectedDataset:Co(e),selectedDataset2Id:vce(e),datasets:e.dataState.datasets,layerVisibilities:e.controlState.layerVisibilities}),DPn={selectDataset:ptt,toggleDatasetRgbLayer:mEn,locateSelectedDataset:cEn},LPn=dr(IPn,DPn)(RPn),Qie=ot(O.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5.97 4.06L14.09 6l1.41 1.41L16.91 6l1.06 1.06-1.41 1.41 1.41 1.41-1.06 1.06-1.41-1.4-1.41 1.41-1.06-1.06 1.41-1.41zm-6.78.66h5v1.5h-5zM11.5 16h-2v2H8v-2H6v-1.5h2v-2h1.5v2h2zm6.5 1.25h-5v-1.5h5zm0-2.5h-5v-1.5h5z"}),"Calculate"),Cnt=ot(O.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),FPn=ot(O.jsx("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2"}),"Timeline"),y4="userVariablesDialog";function $Pn(){return{id:mh("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function NPn(e){return{...e,id:mh("user"),name:`${e.name}_copy`,title:e.title?`${e.title} Copy`:""}}const zPn={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},Ont=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],jPn={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function BPn({selectedDatasetId:e,selectedVariableName:t,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:s,addTimeSeries:a,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=T=>{u(T.target.value||null)},p=()=>{d(y4)},g=()=>{a()},m=()=>{c()},v=e===n&&t===r,y=O.jsx(_v,{shrink:!0,htmlFor:"variable-select",children:Ce.get("Variable")}),b=O.jsx(Th,{variant:"standard",value:t||"",onChange:h,input:O.jsx(Ob,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>cMe(i.find(T=>T.name===t)),children:(i||[]).map(T=>O.jsxs(tr,{value:T.name,selected:T.name===t,children:[dD(T)&&O.jsx(rl,{children:O.jsx(Qie,{fontSize:"small"})}),O.jsx(Yi,{children:cMe(T)}),e===n&&T.name===r&&O.jsx(v4,{fontSize:"small",color:"secondary"})]},T.name))}),w=o&&O.jsx(Wl,{onClick:p,tooltipText:Ce.get("Create and manage user variables"),icon:O.jsx(Qie,{})},"userVariables"),S=O.jsx(Wl,{disabled:!s,onClick:g,tooltipText:Ce.get("Show time-series diagram"),icon:O.jsx(FPn,{})},"timeSeries"),_=O.jsx(Wl,{disabled:!l,onClick:m,tooltipText:Ce.get("Add statistics"),icon:O.jsx(Cnt,{})},"statistics"),E=O.jsx(oo,{selected:v,value:"comparison",size:"small",sx:{...km.toggleButton,marginLeft:.4},onClick:()=>f(e,t),children:O.jsx(_n,{arrow:!0,title:Ce.get("Make it 2nd variable for comparison"),children:O.jsx(v4,{fontSize:"small"})})},"variable2");return O.jsx(FR,{label:y,control:b,actions:[E,w,S,_]})}function cMe(e){return e?e.title||e.name:"?"}const UPn=e=>({locale:e.controlState.locale,selectedDatasetId:e.controlState.selectedDatasetId,selectedVariableName:e.controlState.selectedVariableName,selectedDataset2Id:e.controlState.selectedDataset2Id,selectedVariable2Name:e.controlState.selectedVariable2Name,userVariablesAllowed:cLt(),canAddTimeSeries:yUe(e),canAddStatistics:bUe(e),variables:xLt(e)}),VPn={openDialog:FS,selectVariable:Ttt,selectVariable2:wEn,addTimeSeries:aW,addStatistics:Jet},WPn=dr(UPn,VPn)(BPn),bP=ot(O.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),dW=ot(O.jsx("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline"),Ent=({itemValue:e,setItemValue:t,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:s,actions:a})=>{const l=M.useRef(null),[c,u]=M.useState("");M.useEffect(()=>{r&&u(e)},[r,e,u]),M.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=O.jsx(_v,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return O.jsx(FR,{label:f,control:s,actions:a});const d=n?n(c):!0,h=O.jsx(Ob,{value:c,error:!d,inputRef:l,onBlur:()=>i(!1),onKeyUp:p=>{p.code==="Escape"?i(!1):p.code==="Enter"&&d&&(i(!1),t(c))},onChange:p=>{u(p.currentTarget.value)}});return O.jsx(FR,{label:f,control:h})},HPn={select:{minWidth:"4rem"}};function GPn({placeGroups:e,selectPlaceGroups:t,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[s,a]=M.useState(!1);if(e=e||[],i=i||[],e.length===0)return null;const l=i.length===1?i[0]:null,c=g=>{n(l,g)},u=g=>{t(g.target.value||null)},f=()=>o,d=O.jsx(Th,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:O.jsx(Ob,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:HPn.select,children:e.map(g=>O.jsxs(tr,{value:g.id,children:[O.jsx(FA,{checked:i.indexOf(g.id)>-1}),O.jsx(Yi,{primary:g.title})]},g.id))});let h=!1;l!==null&&l.startsWith(CT)&&(h=!!e.find(g=>g.id===l&&g.features&&g.features.length>=0));let p;if(h){const g=()=>{a(!0)},m=()=>{r(l)};p=[O.jsx(Wl,{onClick:g,tooltipText:Ce.get("Rename place group"),icon:O.jsx(bP,{})},"editPlaceGroup"),O.jsx(Wl,{onClick:m,tooltipText:Ce.get("Remove places"),icon:O.jsx(dW,{})},"removePlaceGroup")]}return O.jsx(Ent,{itemValue:o,setItemValue:c,validateItemValue:g=>g.trim().length>0,editMode:s,setEditMode:a,labelText:Ce.get("Places"),select:d,actions:p})}const qPn=e=>({locale:e.controlState.locale,selectedPlaceGroupIds:e.controlState.selectedPlaceGroupIds,placeGroups:CD(e),selectedPlaceGroupsTitle:FLt(e)}),XPn={selectPlaceGroups:hEn,renameUserPlaceGroup:FOn,removeUserPlaceGroup:UOn},YPn=dr(qPn,XPn)(GPn),QPn=ot(O.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill"),Rx={container:{display:"grid",gridTemplateColumns:"auto 120px",gridTemplateRows:"auto",gridTemplateAreas:"'colorLabel colorValue' 'opacityLabel opacityValue'",rowGap:1,columnGap:2.5,padding:1},colorLabel:{gridArea:"colorLabel",alignSelf:"center"},colorValue:{gridArea:"colorValue",alignSelf:"center",width:"100%",height:"22px",borderWidth:1,borderStyle:"solid",borderColor:"black"},opacityLabel:{gridArea:"opacityLabel",alignSelf:"center"},opacityValue:{gridArea:"opacityValue",alignSelf:"center",width:"100%"},colorMenuItem:{padding:"4px 8px 4px 8px"},colorMenuItemBox:{width:"104px",height:"18px"}},KPn=({anchorEl:e,setAnchorEl:t,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,s]=M.useState(null);function a(l){s(l.currentTarget)}return O.jsxs(O.Fragment,{children:[O.jsx(rS,{open:e!==null,anchorEl:e,onClose:()=>t(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:O.jsxs(bt,{sx:Rx.container,children:[O.jsx(yn,{sx:Rx.colorLabel,children:Ce.get("Color")}),O.jsx(yn,{sx:Rx.opacityLabel,color:n?"text.secondary":"text.primary",children:Ce.get("Opacity")}),O.jsx(bt,{sx:Rx.colorValue,style:{backgroundColor:r.color},onClick:a}),O.jsx(oS,{sx:Rx.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),O.jsx(iS,{open:!!o,anchorEl:o,onClose:()=>s(null),children:ble.map(([l,c])=>O.jsx(tr,{selected:r.color===l,sx:Rx.colorMenuItem,onClick:()=>i({...r,color:l}),children:O.jsx(_n,{title:l,children:O.jsx(bt,{sx:{...Rx.colorMenuItemBox,backgroundColor:l}})})},l))})]})},ZPn={select:{minWidth:"4rem"}};function JPn({selectPlace:e,placeLabels:t,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:s,removeUserPlace:a,places:l,locateSelectedPlace:c}){const[u,f]=M.useState(!1),[d,h]=M.useState(null);l=l||[],t=t||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,g=l.findIndex(E=>E.id===n),m=g>=0?t[g]:"",v=E=>{o(p,n,E)},y=E=>{s(p,n,E)},b=E=>{e(E.target.value||null,l,!0)},w=O.jsx(Th,{variant:"standard",value:n,onChange:b,input:O.jsx(Ob,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:ZPn.select,disabled:l.length===0,children:l.map((E,T)=>O.jsx(tr,{value:E.id,selected:E.id===n,children:t[T]},E.id))}),S=p!==null&&p.startsWith(CT)&&n!=="";let _=[O.jsx(Wl,{onClick:c,tooltipText:Ce.get("Locate place in map"),icon:O.jsx(_nt,{})},"locatePlace")];if(!u&&S){const E=()=>{f(!0)},T=P=>{h(P.currentTarget)},k=()=>{a(p,n,l)};_=[O.jsx(Wl,{onClick:E,tooltipText:Ce.get("Rename place"),icon:O.jsx(bP,{})},"editButton"),O.jsx(Wl,{onClick:T,tooltipText:Ce.get("Style place"),icon:O.jsx(QPn,{})},"styleButton"),O.jsx(Wl,{onClick:k,tooltipText:Ce.get("Remove place"),icon:O.jsx(dW,{})},"removeButton")].concat(_)}return O.jsxs(O.Fragment,{children:[O.jsx(Ent,{itemValue:m,setItemValue:v,validateItemValue:E=>E.trim().length>0,editMode:u,setEditMode:f,labelText:Ce.get("Place"),select:w,actions:_}),i&&O.jsx(KPn,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const ekn=e=>({locale:e.controlState.locale,datasets:e.dataState.datasets,selectedPlaceGroupIds:e.controlState.selectedPlaceGroupIds,selectedPlaceId:e.controlState.selectedPlaceId,selectedPlaceInfo:ED(e),places:OD(e),placeLabels:BLt(e)}),tkn={selectPlace:lW,renameUserPlace:$On,restyleUserPlace:zOn,removeUserPlace:BOn,locateSelectedPlace:uEn,openDialog:FS},nkn=dr(ekn,tkn)(JPn),rkn=ot(O.jsx("path",{d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7m4 8h-3v3h-2v-3H8V8h3V5h2v3h3z"}),"AddLocation"),ikn=ot(O.jsx("path",{d:"M11.71 17.99C8.53 17.84 6 15.22 6 12c0-3.31 2.69-6 6-6 3.22 0 5.84 2.53 5.99 5.71l-2.1-.63C15.48 9.31 13.89 8 12 8c-2.21 0-4 1.79-4 4 0 1.89 1.31 3.48 3.08 3.89zM22 12c0 .3-.01.6-.04.9l-1.97-.59c.01-.1.01-.21.01-.31 0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8c.1 0 .21 0 .31-.01l.59 1.97c-.3.03-.6.04-.9.04-5.52 0-10-4.48-10-10S6.48 2 12 2s10 4.48 10 10m-3.77 4.26L22 15l-10-3 3 10 1.26-3.77 4.27 4.27 1.98-1.98z"}),"AdsClick"),okn=ot([O.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),O.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),O.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category"),skn=ot(O.jsx("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord"),akn=ot(O.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload"),lkn=Qn(ld)(({theme:e})=>({marginTop:e.spacing(2),marginLeft:e.spacing(1),marginRight:e.spacing(2)}));function ckn({mapInteraction:e,setMapInteraction:t}){function n(r,i){t(i!==null?i:"Select")}return O.jsx(lkn,{variant:"standard",children:O.jsxs(rD,{size:"small",value:e,exclusive:!0,onChange:n,children:[O.jsx(oo,{value:"Select",size:"small",sx:km.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Select a place in map"),children:O.jsx(ikn,{})})},0),O.jsx(oo,{value:"Point",size:"small",sx:km.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Add a point location in map"),children:O.jsx(rkn,{})})},1),O.jsx(oo,{value:"Polygon",size:"small",sx:km.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Draw a polygon area in map"),children:O.jsx(okn,{})})},2),O.jsx(oo,{value:"Circle",size:"small",sx:km.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Draw a circular area in map"),children:O.jsx(skn,{})})},3),O.jsx(oo,{value:"Geometry",size:"small",sx:km.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Import places"),children:O.jsx(akn,{})})},4)]})})}const ukn=e=>({mapInteraction:e.controlState.mapInteraction}),fkn={setMapInteraction:Dtt},dkn=dr(ukn,fkn)(ckn);var uMe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jL=(typeof window>"u"?"undefined":uMe(window))==="object"&&(typeof document>"u"?"undefined":uMe(document))==="object"&&document.nodeType===9,hkn={}.constructor;function Kie(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Kie);if(e.constructor!==hkn)return e;var t={};for(var n in e)t[n]=Kie(e[n]);return t}function mme(e,t,n){e===void 0&&(e="unnamed");var r=n.jss,i=Kie(t),o=r.plugins.onCreateRule(e,i,n);return o||(e[0],null)}var fMe=function(t,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,dMe=typeof CSS<"u"&&CSS.escape,vme=(function(e){return dMe?dMe(e):e.replace(pkn,"\\$1")}),Tnt=(function(){function e(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,s=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:s&&(this.renderer=new s)}var t=e.prototype;return t.prop=function(r,i,o){if(i===void 0)return this.style[r];var s=o?o.force:!1;if(!s&&this.style[r]===i)return this;var a=i;(!o||o.process!==!1)&&(a=this.options.jss.plugins.onChangeValue(i,r,this));var l=a==null||a===!1,c=r in this.style;if(l&&!c&&!s)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=a,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,a),this;var f=this.options.sheet;return f&&f.attached,this},e})(),Zie=(function(e){KI(t,e);function t(r,i,o){var s;s=e.call(this,r,i,o)||this;var a=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return a?s.selectorText=a:l!==!1&&(s.id=u(en(en(s)),c),s.selectorText="."+vme(s.id)),s}var n=t.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var s=this.toJSON();for(var a in s)o.setProperty(i,a,s[a])}return this},n.toJSON=function(){var i={};for(var o in this.style){var s=this.style[o];typeof s!="object"?i[o]=s:Array.isArray(s)&&(i[o]=q1(s))}return i},n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?X({},i,{allowEmpty:!0}):i;return $R(this.selectorText,this.style,a)},Cr(t,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,s=this.renderable;if(!(!s||!o)){var a=o.setSelector(s,i);a||o.replaceRule(s,this)}}},get:function(){return this.selectorText}}]),t})(Tnt),gkn={onCreateRule:function(t,n,r){return t[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new Zie(t,n,r)}},aY={indent:1,children:!0},mkn=/@([\w-]+)/,vkn=(function(){function e(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(mkn);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new hW(X({},i,{parent:this}));for(var s in r)this.rules.add(s,r[s]);this.rules.process()}var t=e.prototype;return t.getRule=function(r){return this.rules.get(r)},t.indexOf=function(r){return this.rules.indexOf(r)},t.addRule=function(r,i,o){var s=this.rules.add(r,i,o);return s?(this.options.jss.plugins.onProcessRule(s),s):null},t.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},t.toString=function(r){r===void 0&&(r=aY);var i=xP(r),o=i.linebreak;if(r.indent==null&&(r.indent=aY.indent),r.children==null&&(r.children=aY.children),r.children===!1)return this.query+" {}";var s=this.rules.toString(r);return s?this.query+" {"+o+s+o+"}":""},e})(),ykn=/@container|@media|@supports\s+/,bkn={onCreateRule:function(t,n,r){return ykn.test(t)?new vkn(t,n,r):null}},lY={indent:1,children:!0},xkn=/@keyframes\s+([\w-]+)/,Jie=(function(){function e(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(xkn);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var s=i.scoped,a=i.sheet,l=i.generateId;this.id=s===!1?this.name:vme(l(this,a)),this.rules=new hW(X({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],X({},i,{parent:this}));this.rules.process()}var t=e.prototype;return t.toString=function(r){r===void 0&&(r=lY);var i=xP(r),o=i.linebreak;if(r.indent==null&&(r.indent=lY.indent),r.children==null&&(r.children=lY.children),r.children===!1)return this.at+" "+this.id+" {}";var s=this.rules.toString(r);return s&&(s=""+o+s+o),this.at+" "+this.id+" {"+s+"}"},e})(),wkn=/@keyframes\s+/,Skn=/\$([\w-]+)/g,eoe=function(t,n){return typeof t=="string"?t.replace(Skn,function(r,i){return i in n?n[i]:r}):t},hMe=function(t,n,r){var i=t[n],o=eoe(i,r);o!==i&&(t[n]=o)},_kn={onCreateRule:function(t,n,r){return typeof t=="string"&&wkn.test(t)?new Jie(t,n,r):null},onProcessStyle:function(t,n,r){return n.type!=="style"||!r||("animation-name"in t&&hMe(t,"animation-name",r.keyframes),"animation"in t&&hMe(t,"animation",r.keyframes)),t},onChangeValue:function(t,n,r){var i=r.options.sheet;if(!i)return t;switch(n){case"animation":return eoe(t,i.keyframes);case"animation-name":return eoe(t,i.keyframes);default:return t}}},Ckn=(function(e){KI(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?X({},i,{allowEmpty:!0}):i;return $R(this.key,this.style,a)},t})(Tnt),Okn={onCreateRule:function(t,n,r){return r.parent&&r.parent.type==="keyframes"?new Ckn(t,n,r):null}},Ekn=(function(){function e(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var t=e.prototype;return t.toString=function(r){var i=xP(r),o=i.linebreak;if(Array.isArray(this.style)){for(var s="",a=0;a=this.index){i.push(r);return}for(var s=0;so){i.splice(s,0,r);return}}},t.reset=function(){this.registry=[]},t.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},t.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,s=it(i,["attached"]),a=xP(s),l=a.linebreak,c="",u=0;u-1?i.substr(0,o-1):i;t.style.setProperty(n,s,o>-1?"important":"")}}catch{return!1}return!0},zkn=function(t,n){try{t.attributeStyleMap?t.attributeStyleMap.delete(n):t.style.removeProperty(n)}catch{}},jkn=function(t,n){return t.selectorText=n,t.selectorText===n},Mnt=knt(function(){return document.querySelector("head")});function Bkn(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}function Ukn(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}function Vkn(e){for(var t=Mnt(),n=0;n0){var n=Bkn(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=Ukn(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&typeof r=="string"){var i=Vkn(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function Hkn(e,t){var n=t.insertionPoint,r=Wkn(t);if(r!==!1&&r.parent){r.parent.insertBefore(e,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling);return}Mnt().appendChild(e)}var Gkn=knt(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),yMe=function(t,n,r){try{"insertRule"in t?t.insertRule(n,r):"appendRule"in t&&t.appendRule(n)}catch{return!1}return t.cssRules[r]},bMe=function(t,n){var r=t.cssRules.length;return n===void 0||n>r?r:n},qkn=function(){var t=document.createElement("style");return t.textContent=` -`,t},Xkn=(function(){function e(n){this.getPropertyValue=$kn,this.setProperty=Nkn,this.removeProperty=zkn,this.setSelector=jkn,this.hasInsertedRules=!1,this.cssRules=[],n&&hA.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,s=r.element;this.element=s||qkn(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var a=Gkn();a&&this.element.setAttribute("nonce",a)}var t=e.prototype;return t.attach=function(){if(!(this.element.parentNode||!this.sheet)){Hkn(this.element,this.sheet.options);var r=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=` +`)}function YCn(){const e=["","","| | Python type | Description |","|------------|---------------|---------------|"];return Object.getOwnPropertyNames(Ere).forEach(t=>{const n=Ere[t];e.push(`| \`${t}\` | **${n.type.replace("|","\\|")}** | ${n.description} |`)}),e.push(""),e.join(` +`)}function QCn({appName:e,allowRefresh:t,allowSharing:n,allowDownloads:r,compact:i,style:o,openDialog:s,updateResources:a,shareStatePermalink:l}){const[c,u]=M.useState(!1),[f,d]=M.useState(!1),[h,p]=M.useState(!1),g=M.useRef(null),m=()=>{p(!0)},v=()=>{p(!1)},y=()=>{v(),s("settings")},b=()=>{v(),s("about")},w=()=>{v(),window.open("https://xcube-dev.github.io/xcube-viewer/","Manual")},S=()=>{v(),d(!0)},_=()=>{d(!1)},E=()=>{v(),u(!0)},T=()=>{u(!1)},k=()=>{v(),a()},P=()=>{v(),l()},I=()=>{v(),s("export")};return O.jsxs(M.Fragment,{children:[O.jsx(_n,{arrow:!0,title:Ce.get("More"),children:O.jsx(Mn,{onClick:m,size:"small",sx:o,ref:g,children:i?O.jsx(jCn,{}):O.jsx(BCn,{})})}),O.jsx(GCn,{open:c,onClose:T}),O.jsx(qCn,{open:f,onClose:_}),O.jsxs(Qw,{anchorEl:g.current,open:h,onClose:v,children:[i&&O.jsxs(O.Fragment,{children:[t&&O.jsxs(nr,{onClick:k,children:[O.jsx(rl,{children:O.jsx(net,{fontSize:"small"})}),O.jsx(Qi,{children:Ce.get("Refresh")})]}),n&&O.jsxs(nr,{onClick:P,children:[O.jsx(rl,{children:O.jsx(ret,{fontSize:"small"})}),O.jsx(Qi,{children:Ce.get("Share")})]}),r&&O.jsxs(nr,{onClick:I,children:[O.jsx(rl,{children:O.jsx(tet,{fontSize:"small"})}),O.jsx(Qi,{children:Ce.get("Export data")})]}),O.jsx(sa,{})]}),O.jsxs(nr,{onClick:y,children:[O.jsx(rl,{children:O.jsx(UCn,{fontSize:"small"})}),O.jsx(Qi,{children:Ce.get("Settings")})]}),O.jsx(sa,{}),O.jsxs(nr,{onClick:w,children:[O.jsx(rl,{children:O.jsx(iet,{fontSize:"small"})}),O.jsx(Qi,{children:Ce.get("Documentation")})]}),O.jsxs(nr,{onClick:S,children:[O.jsx(rl,{children:O.jsx(NCn,{fontSize:"small"})}),O.jsx(Qi,{children:Ce.get("Developer Reference")})]}),O.jsxs(nr,{onClick:E,children:[O.jsx(rl,{children:O.jsx(VCn,{fontSize:"small"})}),O.jsx(Qi,{children:Ce.get("Imprint")})]}),On.instance.branding.allowAboutPage&&O.jsxs(O.Fragment,{children:[O.jsx(sa,{}),O.jsxs(nr,{onClick:b,children:[O.jsx(rl,{children:O.jsx(zCn,{fontSize:"small"})}),O.jsx(Qi,{children:Ce.get("About ${appName}",{appName:e})})]})]})]})]})}const KCn=e=>({locale:e.controlState.locale,appName:On.instance.branding.appBarTitle,allowRefresh:On.instance.branding.allowRefresh,allowSharing:On.instance.branding.allowSharing,allowDownloads:On.instance.branding.allowDownloads,compact:On.instance.branding.compact}),ZCn={openDialog:PS,updateResources:RZe,shareStatePermalink:AZe},set=hr(KCn,ZCn)(QCn),fke=at(O.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),JCn=({userInfo:e})=>O.jsxs(XG,{container:!0,justifyContent:"center",spacing:1,children:[O.jsx(XG,{item:!0,children:O.jsx("img",{src:e.picture,width:84,alt:Ce.get("User Profile")})}),O.jsx(XG,{item:!0,children:O.jsx(fa,{elevation:3,children:O.jsxs(WI,{children:[O.jsx(eO,{children:O.jsx(Qi,{primary:e.name,secondary:Ce.get("User name")})}),O.jsx(sa,{light:!0}),O.jsx(eO,{children:O.jsx(Qi,{primary:`${e.email} (${e.email_verified?Ce.get("verified"):Ce.get("not verified")})`,secondary:Ce.get("E-mail")})}),O.jsx(sa,{light:!0}),O.jsx(eO,{children:O.jsx(Qi,{primary:e.nickname,secondary:Ce.get("Nickname")})})]})})})]}),I_={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:x1[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:x1[300]},signInProgress:{color:x1[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:e=>({marginLeft:e.spacing(2),...On.instance.branding.headerIconStyle})},eOn=Qn("div")({position:"relative"}),tOn=({updateAccessToken:e})=>{const t=ICn(),[n,r]=M.useState(null),[i,o]=M.useState(!1);M.useEffect(()=>{t.user&&t.user.access_token?e(t.user.access_token):e(null)},[t.user,e]);const s=()=>{c(),o(!0)},a=()=>{o(!1)},l=d=>{r(d.currentTarget)},c=()=>{r(null)},u=()=>{t.signinRedirect().then(()=>{}).catch(d=>{console.error(d)})},f=()=>{c(),t.signoutRedirect().then(()=>{}).catch(d=>{console.error(d)})};if(t.user){const d=t.user.profile;let h,p=O.jsx(fke,{});if(!d)h=O.jsx(VG,{sx:I_.letterAvatar,children:"?"});else if(d.picture)h=O.jsx(VG,{sx:I_.imageAvatar,src:d.picture,alt:d.name});else{const g=d.given_name||d.name||d.nickname,m=d.family_name;let v=null;g&&m?v=g[0]+m[0]:g?v=g[0]:m&&(v=m[0]),v!==null&&(p=v.toUpperCase()),h=O.jsx(VG,{sx:I_.letterAvatar,children:p})}return O.jsxs(M.Fragment,{children:[O.jsx(Mn,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:I_.iconButton,children:h}),O.jsxs(Qw,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[O.jsx(nr,{onClick:s,children:Ce.get("Profile")}),O.jsx(nr,{onClick:f,children:Ce.get("Log out")})]}),O.jsxs(Gu,{open:i,keepMounted:!0,onClose:a,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[O.jsx(hg,{id:"alert-dialog-slide-title",children:Ce.get("User Profile")}),O.jsx(Fc,{children:O.jsx(JCn,{userInfo:t.user.profile})}),O.jsx(xb,{children:O.jsx(zi,{onClick:a,children:"OK"})})]})]})}else{let d=O.jsx(_n,{arrow:!0,title:Ce.get("User Profile"),children:O.jsx(Mn,{onClick:t.isLoading?void 0:u,size:"small",sx:I_.iconButton,children:O.jsx(fke,{})})});return t.isLoading&&(d=O.jsxs(eOn,{children:[d,O.jsx(Ch,{size:24,sx:I_.signInProgress})]})),d}},nOn=e=>On.instance.authClient?O.jsx(tOn,{...e}):null,rOn=nOn,aet="UPDATE_ACCESS_TOKEN";function iOn(e){return(t,n)=>{const r=n().userAuthState.accessToken;r!==e&&(t(oOn(e)),(e===null||r===null)&&t(IZe()))}}function oOn(e){return{type:aet,accessToken:e}}const sOn=e=>({}),aOn={updateAccessToken:iOn},cet=hr(sOn,aOn)(rOn),lOn={appBar:e=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})})},cOn=Oe("a")(()=>({display:"flex",alignItems:"center"})),uOn=Oe("img")(({theme:e})=>({marginLeft:e.spacing(1)})),D_={toolbar:e=>({backgroundColor:On.instance.branding.headerBackgroundColor,paddingRight:e.spacing(1)}),title:e=>({flexGrow:1,marginLeft:e.spacing(1),...On.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:x1[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:x1[300]},signInProgress:{color:x1[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:e=>({marginLeft:e.spacing(2),...On.instance.branding.headerIconStyle})};function fOn({appName:e,allowRefresh:t,allowSharing:n,allowDownloads:r,openDialog:i,updateResources:o,shareStatePermalink:s}){return O.jsx(Eze,{position:"absolute",sx:lOn.appBar,elevation:0,children:O.jsxs(HI,{disableGutters:!0,sx:D_.toolbar,variant:"dense",children:[O.jsx(cOn,{href:On.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:O.jsx(uOn,{src:On.instance.branding.logoImage,width:On.instance.branding.logoWidth,alt:"xcube logo"})}),O.jsx(mn,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:D_.title,children:e}),O.jsx(cet,{}),t&&O.jsx(_n,{arrow:!0,title:Ce.get("Refresh"),children:O.jsx(Mn,{onClick:o,size:"small",sx:D_.iconButton,children:O.jsx(net,{})})}),n&&O.jsx(_n,{arrow:!0,title:Ce.get("Share"),children:O.jsx(Mn,{onClick:s,size:"small",sx:D_.iconButton,children:O.jsx(ret,{})})}),r&&O.jsx(_n,{arrow:!0,title:Ce.get("Export data"),children:O.jsx(Mn,{onClick:()=>i("export"),size:"small",sx:D_.iconButton,children:O.jsx(tet,{})})}),O.jsx(set,{style:D_.iconButton})]})})}const dOn=e=>({locale:e.controlState.locale,appName:On.instance.branding.appBarTitle,allowRefresh:On.instance.branding.allowRefresh,allowSharing:On.instance.branding.allowSharing,allowDownloads:On.instance.branding.allowDownloads,compact:On.instance.branding.compact}),hOn={openDialog:PS,updateResources:RZe,shareStatePermalink:AZe},pOn=hr(dOn,hOn)(fOn),gOn=Qn("form")(({theme:e})=>({display:"flex",flexWrap:"wrap",paddingTop:e.spacing(1),paddingLeft:e.spacing(.5),paddingRight:e.spacing(0),paddingBottom:e.spacing(.25),flexGrow:0}));function mOn({children:e}){return O.jsx(gOn,{autoComplete:"off",children:e})}const GB=at(O.jsx("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin"),uet=at(O.jsx("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore"),vOn={materialIcon:{fontFamily:"Material Icons"}},Vl=({sx:e,className:t,size:n,disabled:r,onClick:i,icon:o,tooltipText:s,tooltipPlacement:a,toggle:l,value:c,selected:u})=>{const f=p=>{l?i(p,c):i(p)},d=!o||typeof o=="string"?O.jsx(iae,{sx:vOn.materialIcon,children:o||"star"}):o,h=s?O.jsx(_n,{arrow:!0,title:s,enterDelay:600,leaveDelay:100,placement:a,children:d}):d;return l?O.jsx(oo,{sx:{padding:.3,...e},className:t,disabled:r,size:n||"small",onClick:f,value:c||"",selected:u,children:h}):O.jsx(Mn,{sx:e,className:t,disabled:r,size:n||"small",onClick:f,children:h})},Em={toggleButton:{padding:.5}},yOn=Qn(sd)(({theme:e})=>({marginRight:e.spacing(1),marginLeft:e.spacing(2)}));function OR({label:e,control:t,actions:n,sx:r}){return O.jsx(yOn,{variant:"standard",sx:r,children:O.jsxs(bt,{children:[e,t,n]})})}function bOn({selectedDataset:e,selectedDataset2Id:t,datasets:n,selectDataset:r,layerVisibilities:i,toggleDatasetRgbLayer:o,locateSelectedDataset:s}){const a=M.useMemo(()=>n.sort((m,v)=>{const y=m.groupOrder??1/0,b=v.groupOrder??1/0;if(y!==b)return y-b;const w=m.groupTitle||"zzz",S=v.groupTitle||"zzz",_=w.localeCompare(S);if(_!==0)return _;const E=m.sortValue,T=v.sortValue;return E!==void 0&&T!==void 0?E-T:E===void 0&&T===void 0?m.title.localeCompare(v.title):E!==void 0?-1:1}),[n]),l=a.length>0&&!!a[0].groupTitle,c=m=>{const v=m.target.value||null;r(v,n,!0)},u=e?e.id:"";n=n||[];const f=O.jsx(bv,{shrink:!0,htmlFor:"dataset-select",children:Ce.get("Dataset")}),d=[];let h;a.forEach(m=>{if(l){const v=m.groupTitle||Ce.get("Others"),y=m.groupDescription;if(v!==h){const b=O.jsx(sa,{children:O.jsx(mn,{fontSize:"small",color:"text.secondary",children:v})},v);d.push(y?O.jsx(_n,{arrow:!0,title:y,children:b}):b)}h=v}d.push(O.jsxs(nr,{value:m.id,selected:m.id===u,children:[O.jsxs(Qi,{children:[dke(m)," "]}),m.id===t&&O.jsx(GB,{fontSize:"small",color:"secondary"})]},m.id))});const p=O.jsx(Oh,{variant:"standard",value:u,onChange:c,input:O.jsx(wb,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",renderValue:()=>dke(n.find(m=>m.id===u)),children:d}),g=i.datasetRgb&&!i.datasetVariable;return O.jsx(OR,{label:f,control:p,actions:O.jsxs(O.Fragment,{children:[e?.rgbSchema&&O.jsx(Vl,{onClick:()=>o(!g),tooltipText:Ce.get("Switch between dataset RGB layer and variable layer"),sx:{...Em.toggleButton,width:"26.42px",height:"26.42px",marginLeft:.4},icon:O.jsx(mn,{fontSize:9,children:"RGB"}),toggle:!0,value:"rgb",selected:g}),O.jsx(Vl,{onClick:s,tooltipText:Ce.get("Locate dataset in map"),icon:O.jsx(uet,{})})]}),sx:{marginLeft:0}})}function dke(e){return e?e.title||e.id:"?"}const xOn=e=>({locale:e.controlState.locale,selectedDataset:Co(e),selectedDataset2Id:ule(e),datasets:e.dataState.datasets,layerVisibilities:e.controlState.layerVisibilities}),wOn={selectDataset:eJe,toggleDatasetRgbLayer:r_n,locateSelectedDataset:QSn},SOn=hr(xOn,wOn)(bOn),Wre=at(O.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5.97 4.06L14.09 6l1.41 1.41L16.91 6l1.06 1.06-1.41 1.41 1.41 1.41-1.06 1.06-1.41-1.4-1.41 1.41-1.06-1.06 1.41-1.41zm-6.78.66h5v1.5h-5zM11.5 16h-2v2H8v-2H6v-1.5h2v-2h1.5v2h2zm6.5 1.25h-5v-1.5h5zm0-2.5h-5v-1.5h5z"}),"Calculate"),fet=at(O.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),_On=at(O.jsx("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2"}),"Timeline"),qB="userVariablesDialog";function COn(){return{id:gh("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function OOn(e){return{...e,id:gh("user"),name:`${e.name}_copy`,title:e.title?`${e.title} Copy`:""}}const EOn={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},det=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],TOn={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function POn({selectedDatasetId:e,selectedVariableName:t,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:s,addTimeSeries:a,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=T=>{u(T.target.value||null)},p=()=>{d(qB)},g=()=>{a()},m=()=>{c()},v=e===n&&t===r,y=O.jsx(bv,{shrink:!0,htmlFor:"variable-select",children:Ce.get("Variable")}),b=O.jsx(Oh,{variant:"standard",value:t||"",onChange:h,input:O.jsx(wb,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>hke(i.find(T=>T.name===t)),children:(i||[]).map(T=>O.jsxs(nr,{value:T.name,selected:T.name===t,children:[tD(T)&&O.jsx(rl,{children:O.jsx(Wre,{fontSize:"small"})}),O.jsx(Qi,{children:hke(T)}),e===n&&T.name===r&&O.jsx(GB,{fontSize:"small",color:"secondary"})]},T.name))}),w=o&&O.jsx(Vl,{onClick:p,tooltipText:Ce.get("Create and manage user variables"),icon:O.jsx(Wre,{})},"userVariables"),S=O.jsx(Vl,{disabled:!s,onClick:g,tooltipText:Ce.get("Show time-series diagram"),icon:O.jsx(_On,{})},"timeSeries"),_=O.jsx(Vl,{disabled:!l,onClick:m,tooltipText:Ce.get("Add statistics"),icon:O.jsx(fet,{})},"statistics"),E=O.jsx(oo,{selected:v,value:"comparison",size:"small",sx:{...Em.toggleButton,marginLeft:.4},onClick:()=>f(e,t),children:O.jsx(_n,{arrow:!0,title:Ce.get("Make it 2nd variable for comparison"),children:O.jsx(GB,{fontSize:"small"})})},"variable2");return O.jsx(OR,{label:y,control:b,actions:[E,w,S,_]})}function hke(e){return e?e.title||e.name:"?"}const kOn=e=>({locale:e.controlState.locale,selectedDatasetId:e.controlState.selectedDatasetId,selectedVariableName:e.controlState.selectedVariableName,selectedDataset2Id:e.controlState.selectedDataset2Id,selectedVariable2Name:e.controlState.selectedVariable2Name,userVariablesAllowed:qRt(),canAddTimeSeries:d4e(e),canAddStatistics:h4e(e),variables:iIt(e)}),MOn={openDialog:PS,selectVariable:hJe,selectVariable2:l_n,addTimeSeries:D8,addStatistics:zZe},AOn=hr(kOn,MOn)(POn),dP=at(O.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),z8=at(O.jsx("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline"),het=({itemValue:e,setItemValue:t,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:s,actions:a})=>{const l=M.useRef(null),[c,u]=M.useState("");M.useEffect(()=>{r&&u(e)},[r,e,u]),M.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=O.jsx(bv,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return O.jsx(OR,{label:f,control:s,actions:a});const d=n?n(c):!0,h=O.jsx(wb,{value:c,error:!d,inputRef:l,onBlur:()=>i(!1),onKeyUp:p=>{p.code==="Escape"?i(!1):p.code==="Enter"&&d&&(i(!1),t(c))},onChange:p=>{u(p.currentTarget.value)}});return O.jsx(OR,{label:f,control:h})},ROn={select:{minWidth:"4rem"}};function IOn({placeGroups:e,selectPlaceGroups:t,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[s,a]=M.useState(!1);if(e=e||[],i=i||[],e.length===0)return null;const l=i.length===1?i[0]:null,c=g=>{n(l,g)},u=g=>{t(g.target.value||null)},f=()=>o,d=O.jsx(Oh,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:O.jsx(wb,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:ROn.select,children:e.map(g=>O.jsxs(nr,{value:g.id,children:[O.jsx(OA,{checked:i.indexOf(g.id)>-1}),O.jsx(Qi,{primary:g.title})]},g.id))});let h=!1;l!==null&&l.startsWith(mT)&&(h=!!e.find(g=>g.id===l&&g.features&&g.features.length>=0));let p;if(h){const g=()=>{a(!0)},m=()=>{r(l)};p=[O.jsx(Vl,{onClick:g,tooltipText:Ce.get("Rename place group"),icon:O.jsx(dP,{})},"editPlaceGroup"),O.jsx(Vl,{onClick:m,tooltipText:Ce.get("Remove places"),icon:O.jsx(z8,{})},"removePlaceGroup")]}return O.jsx(het,{itemValue:o,setItemValue:c,validateItemValue:g=>g.trim().length>0,editMode:s,setEditMode:a,labelText:Ce.get("Places"),select:d,actions:p})}const DOn=e=>({locale:e.controlState.locale,selectedPlaceGroupIds:e.controlState.selectedPlaceGroupIds,placeGroups:hD(e),selectedPlaceGroupsTitle:xIt(e)}),LOn={selectPlaceGroups:e_n,renameUserPlaceGroup:_Sn,removeUserPlaceGroup:kSn},FOn=hr(DOn,LOn)(IOn),$On=at(O.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill"),Sx={container:{display:"grid",gridTemplateColumns:"auto 120px",gridTemplateRows:"auto",gridTemplateAreas:"'colorLabel colorValue' 'opacityLabel opacityValue'",rowGap:1,columnGap:2.5,padding:1},colorLabel:{gridArea:"colorLabel",alignSelf:"center"},colorValue:{gridArea:"colorValue",alignSelf:"center",width:"100%",height:"22px",borderWidth:1,borderStyle:"solid",borderColor:"black"},opacityLabel:{gridArea:"opacityLabel",alignSelf:"center"},opacityValue:{gridArea:"opacityValue",alignSelf:"center",width:"100%"},colorMenuItem:{padding:"4px 8px 4px 8px"},colorMenuItemBox:{width:"104px",height:"18px"}},NOn=({anchorEl:e,setAnchorEl:t,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,s]=M.useState(null);function a(l){s(l.currentTarget)}return O.jsxs(O.Fragment,{children:[O.jsx(Yw,{open:e!==null,anchorEl:e,onClose:()=>t(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:O.jsxs(bt,{sx:Sx.container,children:[O.jsx(mn,{sx:Sx.colorLabel,children:Ce.get("Color")}),O.jsx(mn,{sx:Sx.opacityLabel,color:n?"text.secondary":"text.primary",children:Ce.get("Opacity")}),O.jsx(bt,{sx:Sx.colorValue,style:{backgroundColor:r.color},onClick:a}),O.jsx(Kw,{sx:Sx.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),O.jsx(Qw,{open:!!o,anchorEl:o,onClose:()=>s(null),children:hae.map(([l,c])=>O.jsx(nr,{selected:r.color===l,sx:Sx.colorMenuItem,onClick:()=>i({...r,color:l}),children:O.jsx(_n,{title:l,children:O.jsx(bt,{sx:{...Sx.colorMenuItemBox,backgroundColor:l}})})},l))})]})},zOn={select:{minWidth:"4rem"}};function jOn({selectPlace:e,placeLabels:t,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:s,removeUserPlace:a,places:l,locateSelectedPlace:c}){const[u,f]=M.useState(!1),[d,h]=M.useState(null);l=l||[],t=t||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,g=l.findIndex(E=>E.id===n),m=g>=0?t[g]:"",v=E=>{o(p,n,E)},y=E=>{s(p,n,E)},b=E=>{e(E.target.value||null,l,!0)},w=O.jsx(Oh,{variant:"standard",value:n,onChange:b,input:O.jsx(wb,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:zOn.select,disabled:l.length===0,children:l.map((E,T)=>O.jsx(nr,{value:E.id,selected:E.id===n,children:t[T]},E.id))}),S=p!==null&&p.startsWith(mT)&&n!=="";let _=[O.jsx(Vl,{onClick:c,tooltipText:Ce.get("Locate place in map"),icon:O.jsx(uet,{})},"locatePlace")];if(!u&&S){const E=()=>{f(!0)},T=P=>{h(P.currentTarget)},k=()=>{a(p,n,l)};_=[O.jsx(Vl,{onClick:E,tooltipText:Ce.get("Rename place"),icon:O.jsx(dP,{})},"editButton"),O.jsx(Vl,{onClick:T,tooltipText:Ce.get("Style place"),icon:O.jsx($On,{})},"styleButton"),O.jsx(Vl,{onClick:k,tooltipText:Ce.get("Remove place"),icon:O.jsx(z8,{})},"removeButton")].concat(_)}return O.jsxs(O.Fragment,{children:[O.jsx(het,{itemValue:m,setItemValue:v,validateItemValue:E=>E.trim().length>0,editMode:u,setEditMode:f,labelText:Ce.get("Place"),select:w,actions:_}),i&&O.jsx(NOn,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const BOn=e=>({locale:e.controlState.locale,datasets:e.dataState.datasets,selectedPlaceGroupIds:e.controlState.selectedPlaceGroupIds,selectedPlaceId:e.controlState.selectedPlaceId,selectedPlaceInfo:gD(e),places:pD(e),placeLabels:OIt(e)}),UOn={selectPlace:L8,renameUserPlace:CSn,restyleUserPlace:ESn,removeUserPlace:PSn,locateSelectedPlace:KSn,openDialog:PS},VOn=hr(BOn,UOn)(jOn),WOn=at(O.jsx("path",{d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7m4 8h-3v3h-2v-3H8V8h3V5h2v3h3z"}),"AddLocation"),HOn=at(O.jsx("path",{d:"M11.71 17.99C8.53 17.84 6 15.22 6 12c0-3.31 2.69-6 6-6 3.22 0 5.84 2.53 5.99 5.71l-2.1-.63C15.48 9.31 13.89 8 12 8c-2.21 0-4 1.79-4 4 0 1.89 1.31 3.48 3.08 3.89zM22 12c0 .3-.01.6-.04.9l-1.97-.59c.01-.1.01-.21.01-.31 0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8c.1 0 .21 0 .31-.01l.59 1.97c-.3.03-.6.04-.9.04-5.52 0-10-4.48-10-10S6.48 2 12 2s10 4.48 10 10m-3.77 4.26L22 15l-10-3 3 10 1.26-3.77 4.27 4.27 1.98-1.98z"}),"AdsClick"),GOn=at([O.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),O.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),O.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category"),qOn=at(O.jsx("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord"),XOn=at(O.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload"),YOn=Qn(sd)(({theme:e})=>({marginTop:e.spacing(2),marginLeft:e.spacing(1),marginRight:e.spacing(2)}));function QOn({mapInteraction:e,setMapInteraction:t}){function n(r,i){t(i!==null?i:"Select")}return O.jsx(YOn,{variant:"standard",children:O.jsxs(GI,{size:"small",value:e,exclusive:!0,onChange:n,children:[O.jsx(oo,{value:"Select",size:"small",sx:Em.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Select a place in map"),children:O.jsx(HOn,{})})},0),O.jsx(oo,{value:"Point",size:"small",sx:Em.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Add a point location in map"),children:O.jsx(WOn,{})})},1),O.jsx(oo,{value:"Polygon",size:"small",sx:Em.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Draw a polygon area in map"),children:O.jsx(GOn,{})})},2),O.jsx(oo,{value:"Circle",size:"small",sx:Em.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Draw a circular area in map"),children:O.jsx(qOn,{})})},3),O.jsx(oo,{value:"Geometry",size:"small",sx:Em.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Import places"),children:O.jsx(XOn,{})})},4)]})})}const KOn=e=>({mapInteraction:e.controlState.mapInteraction}),ZOn={setMapInteraction:xJe},JOn=hr(KOn,ZOn)(QOn);var pke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},PL=(typeof window>"u"?"undefined":pke(window))==="object"&&(typeof document>"u"?"undefined":pke(document))==="object"&&document.nodeType===9,eEn={}.constructor;function Hre(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Hre);if(e.constructor!==eEn)return e;var t={};for(var n in e)t[n]=Hre(e[n]);return t}function oge(e,t,n){e===void 0&&(e="unnamed");var r=n.jss,i=Hre(t),o=r.plugins.onCreateRule(e,i,n);return o||(e[0],null)}var gke=function(t,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,mke=typeof CSS<"u"&&CSS.escape,sge=(function(e){return mke?mke(e):e.replace(tEn,"\\$1")}),pet=(function(){function e(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,s=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:s&&(this.renderer=new s)}var t=e.prototype;return t.prop=function(r,i,o){if(i===void 0)return this.style[r];var s=o?o.force:!1;if(!s&&this.style[r]===i)return this;var a=i;(!o||o.process!==!1)&&(a=this.options.jss.plugins.onChangeValue(i,r,this));var l=a==null||a===!1,c=r in this.style;if(l&&!c&&!s)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=a,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,a),this;var f=this.options.sheet;return f&&f.attached,this},e})(),Gre=(function(e){jI(t,e);function t(r,i,o){var s;s=e.call(this,r,i,o)||this;var a=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return a?s.selectorText=a:l!==!1&&(s.id=u(tn(tn(s)),c),s.selectorText="."+sge(s.id)),s}var n=t.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var s=this.toJSON();for(var a in s)o.setProperty(i,a,s[a])}return this},n.toJSON=function(){var i={};for(var o in this.style){var s=this.style[o];typeof s!="object"?i[o]=s:Array.isArray(s)&&(i[o]=N1(s))}return i},n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?X({},i,{allowEmpty:!0}):i;return ER(this.selectorText,this.style,a)},Er(t,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,s=this.renderable;if(!(!s||!o)){var a=o.setSelector(s,i);a||o.replaceRule(s,this)}}},get:function(){return this.selectorText}}]),t})(pet),nEn={onCreateRule:function(t,n,r){return t[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new Gre(t,n,r)}},eX={indent:1,children:!0},rEn=/@([\w-]+)/,iEn=(function(){function e(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(rEn);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new j8(X({},i,{parent:this}));for(var s in r)this.rules.add(s,r[s]);this.rules.process()}var t=e.prototype;return t.getRule=function(r){return this.rules.get(r)},t.indexOf=function(r){return this.rules.indexOf(r)},t.addRule=function(r,i,o){var s=this.rules.add(r,i,o);return s?(this.options.jss.plugins.onProcessRule(s),s):null},t.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},t.toString=function(r){r===void 0&&(r=eX);var i=hP(r),o=i.linebreak;if(r.indent==null&&(r.indent=eX.indent),r.children==null&&(r.children=eX.children),r.children===!1)return this.query+" {}";var s=this.rules.toString(r);return s?this.query+" {"+o+s+o+"}":""},e})(),oEn=/@container|@media|@supports\s+/,sEn={onCreateRule:function(t,n,r){return oEn.test(t)?new iEn(t,n,r):null}},tX={indent:1,children:!0},aEn=/@keyframes\s+([\w-]+)/,qre=(function(){function e(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(aEn);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var s=i.scoped,a=i.sheet,l=i.generateId;this.id=s===!1?this.name:sge(l(this,a)),this.rules=new j8(X({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],X({},i,{parent:this}));this.rules.process()}var t=e.prototype;return t.toString=function(r){r===void 0&&(r=tX);var i=hP(r),o=i.linebreak;if(r.indent==null&&(r.indent=tX.indent),r.children==null&&(r.children=tX.children),r.children===!1)return this.at+" "+this.id+" {}";var s=this.rules.toString(r);return s&&(s=""+o+s+o),this.at+" "+this.id+" {"+s+"}"},e})(),lEn=/@keyframes\s+/,cEn=/\$([\w-]+)/g,Xre=function(t,n){return typeof t=="string"?t.replace(cEn,function(r,i){return i in n?n[i]:r}):t},vke=function(t,n,r){var i=t[n],o=Xre(i,r);o!==i&&(t[n]=o)},uEn={onCreateRule:function(t,n,r){return typeof t=="string"&&lEn.test(t)?new qre(t,n,r):null},onProcessStyle:function(t,n,r){return n.type!=="style"||!r||("animation-name"in t&&vke(t,"animation-name",r.keyframes),"animation"in t&&vke(t,"animation",r.keyframes)),t},onChangeValue:function(t,n,r){var i=r.options.sheet;if(!i)return t;switch(n){case"animation":return Xre(t,i.keyframes);case"animation-name":return Xre(t,i.keyframes);default:return t}}},fEn=(function(e){jI(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?X({},i,{allowEmpty:!0}):i;return ER(this.key,this.style,a)},t})(pet),dEn={onCreateRule:function(t,n,r){return r.parent&&r.parent.type==="keyframes"?new fEn(t,n,r):null}},hEn=(function(){function e(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var t=e.prototype;return t.toString=function(r){var i=hP(r),o=i.linebreak;if(Array.isArray(this.style)){for(var s="",a=0;a=this.index){i.push(r);return}for(var s=0;so){i.splice(s,0,r);return}}},t.reset=function(){this.registry=[]},t.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},t.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,s=st(i,["attached"]),a=hP(s),l=a.linebreak,c="",u=0;u-1?i.substr(0,o-1):i;t.style.setProperty(n,s,o>-1?"important":"")}}catch{return!1}return!0},EEn=function(t,n){try{t.attributeStyleMap?t.attributeStyleMap.delete(n):t.style.removeProperty(n)}catch{}},TEn=function(t,n){return t.selectorText=n,t.selectorText===n},vet=met(function(){return document.querySelector("head")});function PEn(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}function kEn(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}function MEn(e){for(var t=vet(),n=0;n0){var n=PEn(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=kEn(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&typeof r=="string"){var i=MEn(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function REn(e,t){var n=t.insertionPoint,r=AEn(t);if(r!==!1&&r.parent){r.parent.insertBefore(e,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling);return}vet().appendChild(e)}var IEn=met(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),Ske=function(t,n,r){try{"insertRule"in t?t.insertRule(n,r):"appendRule"in t&&t.appendRule(n)}catch{return!1}return t.cssRules[r]},_ke=function(t,n){var r=t.cssRules.length;return n===void 0||n>r?r:n},DEn=function(){var t=document.createElement("style");return t.textContent=` +`,t},LEn=(function(){function e(n){this.getPropertyValue=CEn,this.setProperty=OEn,this.removeProperty=EEn,this.setSelector=TEn,this.hasInsertedRules=!1,this.cssRules=[],n&&tA.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,s=r.element;this.element=s||DEn(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var a=IEn();a&&this.element.setAttribute("nonce",a)}var t=e.prototype;return t.attach=function(){if(!(this.element.parentNode||!this.sheet)){REn(this.element,this.sheet.options);var r=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=` `)}},t.deploy=function(){var r=this.sheet;if(r){if(r.options.link){this.insertRules(r.rules);return}this.element.textContent=` `+r.toString()+` -`}},t.insertRules=function(r,i){for(var o=0;o{n[o]&&(i[o]=`${t[o]} ${n[o]}`)}),i}const QC={set:(e,t,n,r)=>{let i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)},get:(e,t,n)=>{const r=e.get(t);return r?r.get(n):void 0},delete:(e,t,n)=>{e.get(t).delete(n)}};function Dnt(){const e=Y6();return e?.$$material??e}const Kkn=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function Zkn(e={}){const{disableGlobal:t=!1,productionPrefix:n="jss",seed:r=""}=e,i=r===""?"":`${r}-`;let o=0;const s=()=>(o+=1,o);return(a,l)=>{const c=l.options.name;if(c&&c.startsWith("Mui")&&!l.options.link&&!t){if(Kkn.includes(a.key))return`Mui-${a.key}`;const u=`${i}${c}-${a.key}`;return!l.options.theme[pje]||r!==""?u:`${u}-${s()}`}return`${i}${n}${s()}`}}var Lnt=Date.now(),cY="fnValues"+Lnt,uY="fnStyle"+ ++Lnt,Jkn=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=mme(n,{},i);return o[uY]=r,o},onProcessStyle:function(n,r){if(cY in r||uY in r)return n;var i={};for(var o in n){var s=n[o];typeof s=="function"&&(delete n[o],i[o]=s)}return r[cY]=i,n},onUpdate:function(n,r,i,o){var s=r,a=s[uY];a&&(s.style=a(n)||{});var l=s[cY];if(l)for(var c in l)s.prop(c,l[c](n),o)}}},j0="@global",roe="@global ",e2n=(function(){function e(n,r,i){this.type="global",this.at=j0,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new hW(X({},i,{parent:this}));for(var o in r)this.rules.add(o,r[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(r){return this.rules.get(r)},t.addRule=function(r,i,o){var s=this.rules.add(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},t.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},t.indexOf=function(r){return this.rules.indexOf(r)},t.toString=function(r){return this.rules.toString(r)},e})(),t2n=(function(){function e(n,r,i){this.type="global",this.at=j0,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(roe.length);this.rule=i.jss.createRule(o,r,X({},i,{parent:this}))}var t=e.prototype;return t.toString=function(r){return this.rule?this.rule.toString(r):""},e})(),n2n=/\s*,\s*/g;function Fnt(e,t){for(var n=e.split(n2n),r="",i=0;i-1){var o=Bnt[t];if(!Array.isArray(o))return rr.js+db(o)in n?rr.css+o:!1;if(!i)return!1;for(var s=0;sr?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(e),s=0;s"u"?null:Y2n(),Q2n()]}}const Z2n=Ant(K2n()),J2n=Zkn(),eMn=new Map,tMn={disableGeneration:!1,generateClassName:J2n,jss:Z2n,sheetsCache:null,sheetsManager:eMn,sheetsRegistry:null},nMn=M.createContext(tMn);let _Me=-1e9;function rMn(){return _Me+=1,_Me}function CMe(e){return e.length===0}function iMn(e){const{variant:t,...n}=e;let r=t||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=CMe(r)?e[i]:Ve(e[i]):r+=`${CMe(r)?i:Ve(i)}${Ve(e[i].toString())}`}),r}const oMn={};function sMn(e){const t=typeof e=="function";return{create:(n,r)=>{let i;try{i=t?e(n):e}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return i;const o=n.components[r].styleOverrides||{},s=n.components[r].variants||[],a={...i};return Object.keys(o).forEach(l=>{a[l]=ia(a[l]||{},o[l])}),s.forEach(l=>{const c=iMn(l.props);a[c]=ia(a[c]||{},l.style)}),a},options:{}}}function aMn({state:e,stylesOptions:t},n,r){if(t.disableGeneration)return n||{};e.cacheClasses||(e.cacheClasses={value:null,lastProp:null,lastJSS:{}});let i=!1;return e.classes!==e.cacheClasses.lastJSS&&(e.cacheClasses.lastJSS=e.classes,i=!0),n!==e.cacheClasses.lastProp&&(e.cacheClasses.lastProp=n,i=!0),i&&(e.cacheClasses.value=Int({baseClasses:e.cacheClasses.lastJSS,newClasses:n,Component:r})),e.cacheClasses.value}function lMn({state:e,theme:t,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let s=QC.get(n.sheetsManager,r,t);s||(s={refs:0,staticSheet:null,dynamicStyles:null},QC.set(n.sheetsManager,r,t,s));const a={...r.options,...n,theme:t,flip:typeof n.flip=="boolean"?n.flip:t.direction==="rtl"};a.generateId=a.serverGenerateClassName||a.generateClassName;const l=n.sheetsRegistry;if(s.refs===0){let c;n.sheetsCache&&(c=QC.get(n.sheetsCache,r,t));const u=r.create(t,i);c||(c=n.jss.createStyleSheet(u,{link:!1,...a}),c.attach(),n.sheetsCache&&QC.set(n.sheetsCache,r,t,c)),l&&l.add(c),s.staticSheet=c,s.dynamicStyles=Rnt(u)}if(s.dynamicStyles){const c=n.jss.createStyleSheet(s.dynamicStyles,{link:!0,...a});c.update(o),c.attach(),e.dynamicSheet=c,e.classes=Int({baseClasses:s.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else e.classes=s.staticSheet.classes;s.refs+=1}function cMn({state:e},t){e.dynamicSheet&&e.dynamicSheet.update(t)}function uMn({state:e,theme:t,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=QC.get(n.sheetsManager,r,t);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(QC.delete(n.sheetsManager,r,t),n.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),e.dynamicSheet&&(n.jss.removeStyleSheet(e.dynamicSheet),o&&o.remove(e.dynamicSheet))}function fMn(e,t){const n=M.useRef([]);let r;const i=M.useMemo(()=>({}),t);n.current!==i&&(n.current=i,r=e()),M.useEffect(()=>()=>{r&&r()},[i])}function dMn(e,t={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=oMn,...s}=t,a=sMn(e),l=n||r||"makeStyles";return a.options={index:rMn(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=Dnt()||o,d={...M.useContext(nMn),...s},h=M.useRef(),p=M.useRef();return fMn(()=>{const m={name:n,state:{},stylesCreator:a,stylesOptions:d,theme:f};return lMn(m,u),p.current=!1,h.current=m,()=>{uMn(m)}},[f,a]),M.useEffect(()=>{p.current&&cMn(h.current,u),p.current=!0}),aMn(h.current,u.classes,i)}}function hMn(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n]||!t.components[n].defaultProps)return r;const i={...r},o=t.components[n].defaultProps;let s;for(s in o)i[s]===void 0&&(i[s]=o[s]);return i}const pMn=(e,t={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o,...s}=t;let a=o;const l=dMn(e,{defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:a,...s}),c=M.forwardRef(function(f,d){const{classes:h,...p}=f,g=l({...n.defaultProps,...f});let m,v=p;return(typeof o=="string"||i)&&(m=Dnt()||r,o&&(v=hMn({theme:m,name:o,props:p})),i&&!v.theme&&(v.theme=m)),O.jsx(n,{ref:d,classes:g,...v})});return Xee(c,n),c},gMn=["localeText"],soe=M.createContext(null),Vnt=function(t){const{localeText:n}=t,r=it(t,gMn),{utils:i,localeText:o}=M.useContext(soe)??{utils:void 0,localeText:void 0},s=Ar({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:f,localeText:d}=s,h=M.useMemo(()=>X({},d,o,n),[d,o,n]),p=M.useMemo(()=>{if(!l)return i||null;const v=new l({locale:f,formats:c,instance:u});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` -`));return v},[l,f,c,u,i]),g=M.useMemo(()=>p?{minDate:p.date("1900-01-01T00:00:00.000"),maxDate:p.date("2099-12-31T00:00:00.000")}:null,[p]),m=M.useMemo(()=>({utils:p,defaultDates:g,localeText:h}),[g,p,h]);return O.jsx(soe.Provider,{value:m,children:a})};var ZN={exports:{}},OMe;function mMn(){return OMe||(OMe=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],f=u[1],d=u[2];if(!d)return n(l,c);var h;switch(f){case"P":h=c.dateTime({width:"short"});break;case"PP":h=c.dateTime({width:"medium"});break;case"PPP":h=c.dateTime({width:"long"});break;case"PPPP":default:h=c.dateTime({width:"full"});break}return h.replace("{{date}}",n(f,c)).replace("{{time}}",r(d,c))},o={p:r,P:i},s=o;t.default=s,e.exports=t.default})(ZN,ZN.exports)),ZN.exports}var vMn=mMn();const yMn=Vn(vMn),bMn={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},xMn={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class wMn{constructor(t){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=bMn,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=s=>typeof s>"u"?new Date:s===null?null:new Date(s),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=s=>s,this.toJsDate=s=>s,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=s=>{const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return s.match(a).map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=this.longFormatters[c];return u(l,this.locale.formatLong)}return l}).join("")},this.formatNumber=s=>s,this.getDayOfWeek=s=>s.getDay()+1;const{locale:n,formats:r,longFormatters:i,lib:o}=t;this.locale=n,this.formats=X({},xMn,r),this.longFormatters=i,this.lib=o||"date-fns"}}class SMn extends wMn{constructor({locale:t,formats:n}={}){super({locale:t??pce,formats:n,longFormatters:yMn}),this.parse=(r,i)=>r===""?null:aDt(r,i,new Date,{locale:this.locale}),this.isValid=r=>r==null?!1:O6e(r),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>ZRt(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:r===null||i===null?!1:dIt(r,i),this.isSameYear=(r,i)=>fDt(r,i),this.isSameMonth=(r,i)=>uDt(r,i),this.isSameDay=(r,i)=>JAt(r,i),this.isSameHour=(r,i)=>cDt(r,i),this.isAfter=(r,i)=>B9(r,i),this.isAfterYear=(r,i)=>B9(r,Qwe(i)),this.isAfterDay=(r,i)=>B9(r,Ywe(i)),this.isBefore=(r,i)=>U9(r,i),this.isBeforeYear=(r,i)=>U9(r,this.startOfYear(i)),this.isBeforeDay=(r,i)=>U9(r,this.startOfDay(i)),this.isWithinRange=(r,[i,o])=>dDt(r,{start:i,end:o}),this.startOfYear=r=>rRt(r),this.startOfMonth=r=>nRt(r),this.startOfWeek=r=>KA(r,{locale:this.locale}),this.startOfDay=r=>Yte(r),this.endOfYear=r=>Qwe(r),this.endOfMonth=r=>tRt(r),this.endOfWeek=r=>iRt(r,{locale:this.locale}),this.endOfDay=r=>Ywe(r),this.addYears=(r,i)=>KAt(r,i),this.addMonths=(r,i)=>_6e(r,i),this.addWeeks=(r,i)=>QAt(r,i),this.addDays=(r,i)=>S6e(r,i),this.addHours=(r,i)=>HAt(r,i),this.addMinutes=(r,i)=>XAt(r,i),this.addSeconds=(r,i)=>YAt(r,i),this.getYear=r=>fIt(r),this.getMonth=r=>oIt(r),this.getDate=r=>tIt(r),this.getHours=r=>nIt(r),this.getMinutes=r=>iIt(r),this.getSeconds=r=>sIt(r),this.getMilliseconds=r=>rIt(r),this.setYear=(r,i)=>LDt(r,i),this.setMonth=(r,i)=>kDt(r,i),this.setDate=(r,i)=>MDt(r,i),this.setHours=(r,i)=>ADt(r,i),this.setMinutes=(r,i)=>IDt(r,i),this.setSeconds=(r,i)=>DDt(r,i),this.setMilliseconds=(r,i)=>RDt(r,i),this.getDaysInMonth=r=>I6e(r),this.getWeekArray=r=>{const i=this.startOfWeek(this.startOfMonth(r)),o=this.endOfWeek(this.endOfMonth(r));let s=0,a=i;const l=[];for(;this.isBefore(a,o);){const c=Math.floor(s/7);l[c]=l[c]||[],l[c].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>uIt(r,{locale:this.locale}),this.getYearRange=([r,i])=>{const o=this.startOfYear(r),s=this.endOfYear(i),a=[];let l=o;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a}}}const xp=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),_Mn=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const i=n??r;let o;if(e!=null)o=e;else if(i.includes(t))o=t;else if(i.length>0)o=i[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:i,openTo:o}},x4=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},gA=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{const l=x4(s,s.date(void 0,a),e);n&&s.isBefore(i,l)&&(i=l),t&&s.isAfter(r,l)&&(r=l);let c=e,u=e;for(s.isBefore(e,i)&&(c=i,u=null),s.isAfter(e,r)&&(u&&(u=r),c=null);c||u;){if(c&&s.isAfter(c,r)&&(c=null),u&&s.isBefore(u,i)&&(u=null),c){if(!o(c))return c;c=s.addDays(c,1)}if(u){if(!o(u))return u;u=s.addDays(u,-1)}}return null},CMn=(e,t)=>t==null||!e.isValid(t)?null:t,rd=(e,t,n)=>t==null||!e.isValid(t)?n:t,OMn=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),xme=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const i=r[r.length-1];r.push(e.addMonths(i,1))}return r},wme=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),zm=(e,t)=>{const n=e.setHours(e.date(),t==="am"?2:14);return e.format(n,"meridiem")},EMn=["year","month","day"],NE=e=>EMn.includes(e),EMe=(e,{format:t,views:n},r)=>{if(t!=null)return t;const i=e.formats;return xp(n,["year"])?i.year:xp(n,["month"])?i.month:xp(n,["day"])?i.dayOfMonth:xp(n,["month","year"])?`${i.month} ${i.year}`:xp(n,["day","month"])?`${i.month} ${i.dayOfMonth}`:i.keyboardDate},TMn=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},Wnt=["hours","minutes","seconds"],zE=e=>Wnt.includes(e),kM=e=>Wnt.includes(e)||e==="meridiem",PMn=(e,t)=>e?t.getHours(e)>=12?"pm":"am":null,NR=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?t==="am"?e-12:e+12:e,kMn=(e,t,n,r)=>{const i=NR(r.getHours(e),t,n);return r.setHours(e,i)},TMe=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),BL=(e,t)=>(n,r)=>e?t.isAfter(n,r):TMe(n,t)>TMe(r,t),PMe=(e,{format:t,views:n,ampm:r})=>{if(t!=null)return t;const i=e.formats;return xp(n,["hours"])?r?`${i.hours12h} ${i.meridiem}`:i.hours24h:xp(n,["minutes"])?i.minutes:xp(n,["seconds"])?i.seconds:xp(n,["minutes","seconds"])?`${i.minutes}:${i.seconds}`:xp(n,["hours","minutes","seconds"])?r?`${i.hours12h}:${i.minutes}:${i.seconds} ${i.meridiem}`:`${i.hours24h}:${i.minutes}:${i.seconds}`:r?`${i.hours12h}:${i.minutes} ${i.meridiem}`:`${i.hours24h}:${i.minutes}`},qd={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},MMn=e=>Math.max(...e.map(t=>qd[t.type]??1)),m2=(e,t,n)=>{if(t===qd.year)return e.startOfYear(n);if(t===qd.month)return e.startOfMonth(n);if(t===qd.day)return e.startOfDay(n);let r=n;return t{let o=i?i():m2(t,n,wme(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,o)&&(o=m2(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,o)&&(o=m2(t,n,e.maxDate));const s=BL(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&s(e.minTime,o)&&(o=m2(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:x4(t,o,e.minTime))),e.maxTime!=null&&s(o,e.maxTime)&&(o=m2(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:x4(t,o,e.maxTime))),o},Hnt=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` -`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},RMn=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},pW=(e,t)=>{const n=[],r=e.date(void 0,"default"),i=e.startOfWeek(r),o=e.endOfWeek(r);let s=i;for(;e.isBefore(s,o);)n.push(s),s=e.addDays(s,1);return n.map(a=>e.formatByString(a,t))},Gnt=(e,t,n,r)=>{switch(n){case"month":return xme(e,e.date(void 0,t)).map(i=>e.formatByString(i,r));case"weekDay":return pW(e,r);case"meridiem":{const i=e.date(void 0,t);return[e.startOfDay(i),e.endOfDay(i)].map(o=>e.formatByString(o,r))}default:return[]}},kMe="s",IMn=["0","1","2","3","4","5","6","7","8","9"],DMn=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),kMe)==="0"?IMn:Array.from({length:10}).map((r,i)=>e.formatByString(e.setSeconds(t,i),kMe))},Nw=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let i=0;i-1&&(n.push(o.toString()),r="")}return n.join("")},Sme=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),MMe=(e,t)=>{const n=Nw(e,t);return n!==" "&&!Number.isNaN(Number(n))},qnt=(e,t)=>{let n=e;for(n=Number(n).toString();n.length{if(i.type==="day"&&i.contentType==="digit-with-letter"){const s=e.setDate(n.longestMonth,t);return e.formatByString(s,i.format)}let o=t.toString();return i.hasLeadingZerosInInput&&(o=qnt(o,i.maxLength)),Sme(o,r)},LMn=(e,t,n,r,i,o,s,a)=>{const l=RMn(r),c=r==="Home",u=r==="End",f=n.value===""||c||u,d=()=>{const p=i[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),g=y=>Xnt(e,y,p,o,n),m=n.type==="minutes"&&a?.minutesStep?a.minutesStep:1;let v;if(f){if(n.type==="year"&&!u&&!c)return e.formatByString(e.date(void 0,t),n.format);l>0||c?v=p.minimum:v=p.maximum}else v=parseInt(Nw(n.value,o),10)+l*m;return v%m!==0&&((l<0||c)&&(v+=m-(m+v)%m),(l>0||u)&&(v-=v%m)),v>p.maximum?g(p.minimum+(v-p.maximum-1)%(p.maximum-p.minimum+1)):v{const p=Gnt(e,t,n.type,n.format);if(p.length===0)return n.value;if(f)return l>0||c?p[0]:p[p.length-1];const v=((p.indexOf(n.value)+l)%p.length+p.length)%p.length;return p[v]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?d():h()},_me=(e,t,n)=>{let r=e.value||e.placeholder;const i=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(Nw(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!i&&r.length===1&&(r=`${r}‎`),t==="input-rtl"&&(r=`⁨${r}⁩`),r},AMe=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),FMn=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,Ynt=(e,t,n,r)=>{if(t!=="digit")return!1;const i=e.date(void 0,"default");switch(n){case"year":return e.lib==="dayjs"&&r==="YY"?!0:e.formatByString(e.setYear(i,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(i),r).length>1;case"day":return e.formatByString(e.startOfMonth(i),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(i),r).length>1;case"hours":return e.formatByString(e.setHours(i,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(i,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(i,1),r).length>1;default:throw new Error("Invalid section type")}},$Mn=(e,t,n)=>{const r=t.some(l=>l.type==="day"),i=[],o=[];for(let l=0;le.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),zMn=(e,t,n)=>{const i=e.map(o=>{const s=_me(o,n?"input-rtl":"input-ltr",t);return`${o.startSeparator}${s}${o.endSeparator}`}).join("");return n?`⁦${i}⁩`:i},jMn=(e,t,n)=>{const r=e.date(void 0,n),i=e.endOfYear(r),o=e.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=xme(e,r).reduce((l,c)=>{const u=e.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:FMn(e,l)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(i)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&e.isValid(l)?e.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=pW(e,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=e.getHours(o);return Nw(e.formatByString(e.endOfDay(r),l),t)!==c.toString()?{minimum:1,maximum:Number(Nw(e.formatByString(e.startOfDay(r),l),t))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},BMn=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const i=pW(e,t.format),o=e.formatByString(n,t.format),s=i.indexOf(o),l=i.indexOf(t.value)-s;return e.addDays(n,l)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const i=e.getHours(n)<12,o=e.getHours(r);return i&&o>=12?e.addHours(r,-12):!i&&o<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},RMe={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},IMe=(e,t,n,r,i)=>[...n].sort((o,s)=>RMe[o.type]-RMe[s.type]).reduce((o,s)=>!i||s.modified?BMn(e,s,t,o):o,r),UMn=()=>navigator.userAgent.toLowerCase().includes("android"),VMn=(e,t)=>{const n={};if(!t)return e.forEach((l,c)=>{const u=c===0?null:c-1,f=c===e.length-1?null:c+1;n[c]={leftIndex:u,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},i={};let o=0,s=0,a=e.length-1;for(;a>=0;){s=e.findIndex((l,c)=>c>=o&&l.endSeparator?.includes(" ")&&l.endSeparator!==" / "),s===-1&&(s=e.length-1);for(let l=s;l>=o;l-=1)i[l]=a,r[a]=l,a-=1;o=s+1}return e.forEach((l,c)=>{const u=i[c],f=u===0?null:r[u-1],d=u===e.length-1?null:r[u+1];n[c]={leftIndex:f,rightIndex:d}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},aoe=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},WMn=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},HMn=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},GMn=["value","referenceDate"],bl={emptyValue:null,getTodayValue:wme,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=it(e,GMn);return t!=null&&r.utils.isValid(t)?t:n??AMn(r)},cleanValue:CMn,areValuesEqual:OMn,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},qMn={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:NMn,getV6InputValueFromSections:zMn,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},Cme=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:i,shouldDisableMonth:o,shouldDisableYear:s,disablePast:a,disableFuture:l}=e,c=r.utils.date(void 0,n),u=rd(r.utils,e.minDate,r.defaultDates.minDate),f=rd(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(i&&i(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(s&&s(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,c)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(t,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(t,u)):return"minDate";case!!(f&&r.utils.isAfterDay(t,f)):return"maxDate";default:return null}};Cme.valueManager=bl;const Qnt=({adapter:e,value:t,timezone:n,props:r})=>{if(t===null)return null;const{minTime:i,maxTime:o,minutesStep:s,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:c,disableFuture:u}=r,f=e.utils.date(void 0,n),d=BL(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(i&&d(i,t)):return"minTime";case!!(o&&d(t,o)):return"maxTime";case!!(u&&e.utils.isAfter(t,f)):return"disableFuture";case!!(c&&e.utils.isBefore(t,f)):return"disablePast";case!!(a&&a(t,"hours")):return"shouldDisableTime-hours";case!!(a&&a(t,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(t,"seconds")):return"shouldDisableTime-seconds";case!!(s&&e.utils.getMinutes(t)%s!==0):return"minutesStep";default:return null}};Qnt.valueManager=bl;const gW=({adapter:e,value:t,timezone:n,props:r})=>{const i=Cme({adapter:e,value:t,timezone:n,props:r});return i!==null?i:Qnt({adapter:e,value:t,timezone:n,props:r})};gW.valueManager=bl;const Knt=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],Znt=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],Jnt=["minDateTime","maxDateTime"],XMn=[...Knt,...Znt,...Jnt],ert=e=>XMn.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{}),YMn=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:X({},e)}}}}),trt=e=>{const{utils:t,formatKey:n,contextTranslation:r,propsTranslation:i}=e;return o=>{const s=o!==null&&t.isValid(o)?t.format(o,n):null;return(i??r)(o,t,s)}},nrt={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${!r&&(t===null||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>e.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},QMn=nrt;YMn(nrt);const NS=()=>{const e=M.useContext(soe);if(e===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` +`}},t.insertRules=function(r,i){for(var o=0;o{n[o]&&(i[o]=`${t[o]} ${n[o]}`)}),i}const BC={set:(e,t,n,r)=>{let i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)},get:(e,t,n)=>{const r=e.get(t);return r?r.get(n):void 0},delete:(e,t,n)=>{e.get(t).delete(n)}};function wet(){const e=T6();return e?.$$material??e}const NEn=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function zEn(e={}){const{disableGlobal:t=!1,productionPrefix:n="jss",seed:r=""}=e,i=r===""?"":`${r}-`;let o=0;const s=()=>(o+=1,o);return(a,l)=>{const c=l.options.name;if(c&&c.startsWith("Mui")&&!l.options.link&&!t){if(NEn.includes(a.key))return`Mui-${a.key}`;const u=`${i}${c}-${a.key}`;return!l.options.theme[uze]||r!==""?u:`${u}-${s()}`}return`${i}${n}${s()}`}}var _et=Date.now(),nX="fnValues"+_et,rX="fnStyle"+ ++_et,jEn=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=oge(n,{},i);return o[rX]=r,o},onProcessStyle:function(n,r){if(nX in r||rX in r)return n;var i={};for(var o in n){var s=n[o];typeof s=="function"&&(delete n[o],i[o]=s)}return r[nX]=i,n},onUpdate:function(n,r,i,o){var s=r,a=s[rX];a&&(s.style=a(n)||{});var l=s[nX];if(l)for(var c in l)s.prop(c,l[c](n),o)}}},D0="@global",Kre="@global ",BEn=(function(){function e(n,r,i){this.type="global",this.at=D0,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new j8(X({},i,{parent:this}));for(var o in r)this.rules.add(o,r[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(r){return this.rules.get(r)},t.addRule=function(r,i,o){var s=this.rules.add(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},t.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},t.indexOf=function(r){return this.rules.indexOf(r)},t.toString=function(r){return this.rules.toString(r)},e})(),UEn=(function(){function e(n,r,i){this.type="global",this.at=D0,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(Kre.length);this.rule=i.jss.createRule(o,r,X({},i,{parent:this}))}var t=e.prototype;return t.toString=function(r){return this.rule?this.rule.toString(r):""},e})(),VEn=/\s*,\s*/g;function Cet(e,t){for(var n=e.split(VEn),r="",i=0;i-1){var o=ket[t];if(!Array.isArray(o))return ir.js+sb(o)in n?ir.css+o:!1;if(!i)return!1;for(var s=0;sr?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(e),s=0;s"u"?null:FTn(),$Tn()]}}const zTn=yet(NTn()),jTn=zEn(),BTn=new Map,UTn={disableGeneration:!1,generateClassName:jTn,jss:zTn,sheetsCache:null,sheetsManager:BTn,sheetsRegistry:null},VTn=M.createContext(UTn);let Tke=-1e9;function WTn(){return Tke+=1,Tke}function Pke(e){return e.length===0}function HTn(e){const{variant:t,...n}=e;let r=t||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=Pke(r)?e[i]:Ue(e[i]):r+=`${Pke(r)?i:Ue(i)}${Ue(e[i].toString())}`}),r}const GTn={};function qTn(e){const t=typeof e=="function";return{create:(n,r)=>{let i;try{i=t?e(n):e}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return i;const o=n.components[r].styleOverrides||{},s=n.components[r].variants||[],a={...i};return Object.keys(o).forEach(l=>{a[l]=oa(a[l]||{},o[l])}),s.forEach(l=>{const c=HTn(l.props);a[c]=oa(a[c]||{},l.style)}),a},options:{}}}function XTn({state:e,stylesOptions:t},n,r){if(t.disableGeneration)return n||{};e.cacheClasses||(e.cacheClasses={value:null,lastProp:null,lastJSS:{}});let i=!1;return e.classes!==e.cacheClasses.lastJSS&&(e.cacheClasses.lastJSS=e.classes,i=!0),n!==e.cacheClasses.lastProp&&(e.cacheClasses.lastProp=n,i=!0),i&&(e.cacheClasses.value=xet({baseClasses:e.cacheClasses.lastJSS,newClasses:n,Component:r})),e.cacheClasses.value}function YTn({state:e,theme:t,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let s=BC.get(n.sheetsManager,r,t);s||(s={refs:0,staticSheet:null,dynamicStyles:null},BC.set(n.sheetsManager,r,t,s));const a={...r.options,...n,theme:t,flip:typeof n.flip=="boolean"?n.flip:t.direction==="rtl"};a.generateId=a.serverGenerateClassName||a.generateClassName;const l=n.sheetsRegistry;if(s.refs===0){let c;n.sheetsCache&&(c=BC.get(n.sheetsCache,r,t));const u=r.create(t,i);c||(c=n.jss.createStyleSheet(u,{link:!1,...a}),c.attach(),n.sheetsCache&&BC.set(n.sheetsCache,r,t,c)),l&&l.add(c),s.staticSheet=c,s.dynamicStyles=bet(u)}if(s.dynamicStyles){const c=n.jss.createStyleSheet(s.dynamicStyles,{link:!0,...a});c.update(o),c.attach(),e.dynamicSheet=c,e.classes=xet({baseClasses:s.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else e.classes=s.staticSheet.classes;s.refs+=1}function QTn({state:e},t){e.dynamicSheet&&e.dynamicSheet.update(t)}function KTn({state:e,theme:t,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=BC.get(n.sheetsManager,r,t);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(BC.delete(n.sheetsManager,r,t),n.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),e.dynamicSheet&&(n.jss.removeStyleSheet(e.dynamicSheet),o&&o.remove(e.dynamicSheet))}function ZTn(e,t){const n=M.useRef([]);let r;const i=M.useMemo(()=>({}),t);n.current!==i&&(n.current=i,r=e()),M.useEffect(()=>()=>{r&&r()},[i])}function JTn(e,t={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=GTn,...s}=t,a=qTn(e),l=n||r||"makeStyles";return a.options={index:WTn(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=wet()||o,d={...M.useContext(VTn),...s},h=M.useRef(),p=M.useRef();return ZTn(()=>{const m={name:n,state:{},stylesCreator:a,stylesOptions:d,theme:f};return YTn(m,u),p.current=!1,h.current=m,()=>{KTn(m)}},[f,a]),M.useEffect(()=>{p.current&&QTn(h.current,u),p.current=!0}),XTn(h.current,u.classes,i)}}function ePn(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n]||!t.components[n].defaultProps)return r;const i={...r},o=t.components[n].defaultProps;let s;for(s in o)i[s]===void 0&&(i[s]=o[s]);return i}const tPn=(e,t={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o,...s}=t;let a=o;const l=JTn(e,{defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:a,...s}),c=M.forwardRef(function(f,d){const{classes:h,...p}=f,g=l({...n.defaultProps,...f});let m,v=p;return(typeof o=="string"||i)&&(m=wet()||r,o&&(v=ePn({theme:m,name:o,props:p})),i&&!v.theme&&(v.theme=m)),O.jsx(n,{ref:d,classes:g,...v})});return WJ(c,n),c},nPn=["localeText"],eie=M.createContext(null),Aet=function(t){const{localeText:n}=t,r=st(t,nPn),{utils:i,localeText:o}=M.useContext(eie)??{utils:void 0,localeText:void 0},s=Rr({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:f,localeText:d}=s,h=M.useMemo(()=>X({},d,o,n),[d,o,n]),p=M.useMemo(()=>{if(!l)return i||null;const v=new l({locale:f,formats:c,instance:u});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` +`));return v},[l,f,c,u,i]),g=M.useMemo(()=>p?{minDate:p.date("1900-01-01T00:00:00.000"),maxDate:p.date("2099-12-31T00:00:00.000")}:null,[p]),m=M.useMemo(()=>({utils:p,defaultDates:g,localeText:h}),[g,p,h]);return O.jsx(eie.Provider,{value:m,children:a})};var RN={exports:{}},kke;function rPn(){return kke||(kke=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],f=u[1],d=u[2];if(!d)return n(l,c);var h;switch(f){case"P":h=c.dateTime({width:"short"});break;case"PP":h=c.dateTime({width:"medium"});break;case"PPP":h=c.dateTime({width:"long"});break;default:h=c.dateTime({width:"full"});break}return h.replace("{{date}}",n(f,c)).replace("{{time}}",r(d,c))},o={p:r,P:i},s=o;t.default=s,e.exports=t.default})(RN,RN.exports)),RN.exports}var iPn=rPn();const oPn=Yn(iPn),sPn={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},aPn={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class lPn{constructor(t){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=sPn,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=s=>typeof s>"u"?new Date:s===null?null:new Date(s),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=s=>s,this.toJsDate=s=>s,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=s=>{const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return s.match(a).map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=this.longFormatters[c];return u(l,this.locale.formatLong)}return l}).join("")},this.formatNumber=s=>s,this.getDayOfWeek=s=>s.getDay()+1;const{locale:n,formats:r,longFormatters:i,lib:o}=t;this.locale=n,this.formats=X({},aPn,r),this.longFormatters=i,this.lib=o||"date-fns"}}class cPn extends lPn{constructor({locale:t,formats:n}={}){super({locale:t??ale,formats:n,longFormatters:oPn}),this.parse=(r,i)=>r===""?null:HAt(r,i,new Date,{locale:this.locale}),this.isValid=r=>r==null?!1:yBe(r),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>FMt(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:r===null||i===null?!1:QMt(r,i),this.isSameYear=(r,i)=>YAt(r,i),this.isSameMonth=(r,i)=>XAt(r,i),this.isSameDay=(r,i)=>$2t(r,i),this.isSameHour=(r,i)=>qAt(r,i),this.isAfter=(r,i)=>v9(r,i),this.isAfterYear=(r,i)=>v9(r,W1e(i)),this.isAfterDay=(r,i)=>v9(r,V1e(i)),this.isBefore=(r,i)=>y9(r,i),this.isBeforeYear=(r,i)=>y9(r,this.startOfYear(i)),this.isBeforeDay=(r,i)=>y9(r,this.startOfDay(i)),this.isWithinRange=(r,[i,o])=>QAt(r,{start:i,end:o}),this.startOfYear=r=>B2t(r),this.startOfMonth=r=>j2t(r),this.startOfWeek=r=>jA(r,{locale:this.locale}),this.startOfDay=r=>Hee(r),this.endOfYear=r=>W1e(r),this.endOfMonth=r=>z2t(r),this.endOfWeek=r=>U2t(r,{locale:this.locale}),this.endOfDay=r=>V1e(r),this.addYears=(r,i)=>L2t(r,i),this.addMonths=(r,i)=>mBe(r,i),this.addWeeks=(r,i)=>D2t(r,i),this.addDays=(r,i)=>gBe(r,i),this.addHours=(r,i)=>k2t(r,i),this.addMinutes=(r,i)=>R2t(r,i),this.addSeconds=(r,i)=>I2t(r,i),this.getYear=r=>YMt(r),this.getMonth=r=>VMt(r),this.getDate=r=>zMt(r),this.getHours=r=>jMt(r),this.getMinutes=r=>UMt(r),this.getSeconds=r=>WMt(r),this.getMilliseconds=r=>BMt(r),this.setYear=(r,i)=>bRt(r,i),this.setMonth=(r,i)=>hRt(r,i),this.setDate=(r,i)=>pRt(r,i),this.setHours=(r,i)=>gRt(r,i),this.setMinutes=(r,i)=>vRt(r,i),this.setSeconds=(r,i)=>yRt(r,i),this.setMilliseconds=(r,i)=>mRt(r,i),this.getDaysInMonth=r=>EBe(r),this.getWeekArray=r=>{const i=this.startOfWeek(this.startOfMonth(r)),o=this.endOfWeek(this.endOfMonth(r));let s=0,a=i;const l=[];for(;this.isBefore(a,o);){const c=Math.floor(s/7);l[c]=l[c]||[],l[c].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>XMt(r,{locale:this.locale}),this.getYearRange=([r,i])=>{const o=this.startOfYear(r),s=this.endOfYear(i),a=[];let l=o;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a}}}const bp=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),uPn=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const i=n??r;let o;if(e!=null)o=e;else if(i.includes(t))o=t;else if(i.length>0)o=i[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:i,openTo:o}},YB=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},rA=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{const l=YB(s,s.date(void 0,a),e);n&&s.isBefore(i,l)&&(i=l),t&&s.isAfter(r,l)&&(r=l);let c=e,u=e;for(s.isBefore(e,i)&&(c=i,u=null),s.isAfter(e,r)&&(u&&(u=r),c=null);c||u;){if(c&&s.isAfter(c,r)&&(c=null),u&&s.isBefore(u,i)&&(u=null),c){if(!o(c))return c;c=s.addDays(c,1)}if(u){if(!o(u))return u;u=s.addDays(u,-1)}}return null},fPn=(e,t)=>t==null||!e.isValid(t)?null:t,nd=(e,t,n)=>t==null||!e.isValid(t)?n:t,dPn=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),cge=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const i=r[r.length-1];r.push(e.addMonths(i,1))}return r},uge=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),Fm=(e,t)=>{const n=e.setHours(e.date(),t==="am"?2:14);return e.format(n,"meridiem")},hPn=["year","month","day"],AE=e=>hPn.includes(e),Mke=(e,{format:t,views:n},r)=>{if(t!=null)return t;const i=e.formats;return bp(n,["year"])?i.year:bp(n,["month"])?i.month:bp(n,["day"])?i.dayOfMonth:bp(n,["month","year"])?`${i.month} ${i.year}`:bp(n,["day","month"])?`${i.month} ${i.dayOfMonth}`:i.keyboardDate},pPn=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},Ret=["hours","minutes","seconds"],RE=e=>Ret.includes(e),yM=e=>Ret.includes(e)||e==="meridiem",gPn=(e,t)=>e?t.getHours(e)>=12?"pm":"am":null,TR=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?t==="am"?e-12:e+12:e,mPn=(e,t,n,r)=>{const i=TR(r.getHours(e),t,n);return r.setHours(e,i)},Ake=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),kL=(e,t)=>(n,r)=>e?t.isAfter(n,r):Ake(n,t)>Ake(r,t),Rke=(e,{format:t,views:n,ampm:r})=>{if(t!=null)return t;const i=e.formats;return bp(n,["hours"])?r?`${i.hours12h} ${i.meridiem}`:i.hours24h:bp(n,["minutes"])?i.minutes:bp(n,["seconds"])?i.seconds:bp(n,["minutes","seconds"])?`${i.minutes}:${i.seconds}`:bp(n,["hours","minutes","seconds"])?r?`${i.hours12h}:${i.minutes}:${i.seconds} ${i.meridiem}`:`${i.hours24h}:${i.minutes}:${i.seconds}`:r?`${i.hours12h}:${i.minutes} ${i.meridiem}`:`${i.hours24h}:${i.minutes}`},Wd={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},vPn=e=>Math.max(...e.map(t=>Wd[t.type]??1)),s2=(e,t,n)=>{if(t===Wd.year)return e.startOfYear(n);if(t===Wd.month)return e.startOfMonth(n);if(t===Wd.day)return e.startOfDay(n);let r=n;return t{let o=i?i():s2(t,n,uge(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,o)&&(o=s2(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,o)&&(o=s2(t,n,e.maxDate));const s=kL(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&s(e.minTime,o)&&(o=s2(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:YB(t,o,e.minTime))),e.maxTime!=null&&s(o,e.maxTime)&&(o=s2(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:YB(t,o,e.maxTime))),o},Iet=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` +`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},bPn=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},B8=(e,t)=>{const n=[],r=e.date(void 0,"default"),i=e.startOfWeek(r),o=e.endOfWeek(r);let s=i;for(;e.isBefore(s,o);)n.push(s),s=e.addDays(s,1);return n.map(a=>e.formatByString(a,t))},Det=(e,t,n,r)=>{switch(n){case"month":return cge(e,e.date(void 0,t)).map(i=>e.formatByString(i,r));case"weekDay":return B8(e,r);case"meridiem":{const i=e.date(void 0,t);return[e.startOfDay(i),e.endOfDay(i)].map(o=>e.formatByString(o,r))}default:return[]}},Ike="s",xPn=["0","1","2","3","4","5","6","7","8","9"],wPn=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),Ike)==="0"?xPn:Array.from({length:10}).map((r,i)=>e.formatByString(e.setSeconds(t,i),Ike))},Aw=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let i=0;i-1&&(n.push(o.toString()),r="")}return n.join("")},fge=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),Dke=(e,t)=>{const n=Aw(e,t);return n!==" "&&!Number.isNaN(Number(n))},Let=(e,t)=>{let n=e;for(n=Number(n).toString();n.length{if(i.type==="day"&&i.contentType==="digit-with-letter"){const s=e.setDate(n.longestMonth,t);return e.formatByString(s,i.format)}let o=t.toString();return i.hasLeadingZerosInInput&&(o=Let(o,i.maxLength)),fge(o,r)},SPn=(e,t,n,r,i,o,s,a)=>{const l=bPn(r),c=r==="Home",u=r==="End",f=n.value===""||c||u,d=()=>{const p=i[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),g=y=>Fet(e,y,p,o,n),m=n.type==="minutes"&&a?.minutesStep?a.minutesStep:1;let v;if(f){if(n.type==="year"&&!u&&!c)return e.formatByString(e.date(void 0,t),n.format);l>0||c?v=p.minimum:v=p.maximum}else v=parseInt(Aw(n.value,o),10)+l*m;return v%m!==0&&((l<0||c)&&(v+=m-(m+v)%m),(l>0||u)&&(v-=v%m)),v>p.maximum?g(p.minimum+(v-p.maximum-1)%(p.maximum-p.minimum+1)):v{const p=Det(e,t,n.type,n.format);if(p.length===0)return n.value;if(f)return l>0||c?p[0]:p[p.length-1];const v=((p.indexOf(n.value)+l)%p.length+p.length)%p.length;return p[v]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?d():h()},dge=(e,t,n)=>{let r=e.value||e.placeholder;const i=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(Aw(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!i&&r.length===1&&(r=`${r}‎`),t==="input-rtl"&&(r=`⁨${r}⁩`),r},Lke=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),_Pn=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,$et=(e,t,n,r)=>{if(t!=="digit")return!1;const i=e.date(void 0,"default");switch(n){case"year":return e.lib==="dayjs"&&r==="YY"?!0:e.formatByString(e.setYear(i,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(i),r).length>1;case"day":return e.formatByString(e.startOfMonth(i),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(i),r).length>1;case"hours":return e.formatByString(e.setHours(i,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(i,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(i,1),r).length>1;default:throw new Error("Invalid section type")}},CPn=(e,t,n)=>{const r=t.some(l=>l.type==="day"),i=[],o=[];for(let l=0;le.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),EPn=(e,t,n)=>{const i=e.map(o=>{const s=dge(o,n?"input-rtl":"input-ltr",t);return`${o.startSeparator}${s}${o.endSeparator}`}).join("");return n?`⁦${i}⁩`:i},TPn=(e,t,n)=>{const r=e.date(void 0,n),i=e.endOfYear(r),o=e.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=cge(e,r).reduce((l,c)=>{const u=e.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:_Pn(e,l)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(i)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&e.isValid(l)?e.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=B8(e,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=e.getHours(o);return Aw(e.formatByString(e.endOfDay(r),l),t)!==c.toString()?{minimum:1,maximum:Number(Aw(e.formatByString(e.startOfDay(r),l),t))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},PPn=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const i=B8(e,t.format),o=e.formatByString(n,t.format),s=i.indexOf(o),l=i.indexOf(t.value)-s;return e.addDays(n,l)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const i=e.getHours(n)<12,o=e.getHours(r);return i&&o>=12?e.addHours(r,-12):!i&&o<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},Fke={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},$ke=(e,t,n,r,i)=>[...n].sort((o,s)=>Fke[o.type]-Fke[s.type]).reduce((o,s)=>!i||s.modified?PPn(e,s,t,o):o,r),kPn=()=>navigator.userAgent.toLowerCase().includes("android"),MPn=(e,t)=>{const n={};if(!t)return e.forEach((l,c)=>{const u=c===0?null:c-1,f=c===e.length-1?null:c+1;n[c]={leftIndex:u,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},i={};let o=0,s=0,a=e.length-1;for(;a>=0;){s=e.findIndex((l,c)=>c>=o&&l.endSeparator?.includes(" ")&&l.endSeparator!==" / "),s===-1&&(s=e.length-1);for(let l=s;l>=o;l-=1)i[l]=a,r[a]=l,a-=1;o=s+1}return e.forEach((l,c)=>{const u=i[c],f=u===0?null:r[u-1],d=u===e.length-1?null:r[u+1];n[c]={leftIndex:f,rightIndex:d}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},tie=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},APn=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},RPn=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},IPn=["value","referenceDate"],yl={emptyValue:null,getTodayValue:uge,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=st(e,IPn);return t!=null&&r.utils.isValid(t)?t:n??yPn(r)},cleanValue:fPn,areValuesEqual:dPn,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},DPn={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:OPn,getV6InputValueFromSections:EPn,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},hge=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:i,shouldDisableMonth:o,shouldDisableYear:s,disablePast:a,disableFuture:l}=e,c=r.utils.date(void 0,n),u=nd(r.utils,e.minDate,r.defaultDates.minDate),f=nd(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(i&&i(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(s&&s(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,c)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(t,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(t,u)):return"minDate";case!!(f&&r.utils.isAfterDay(t,f)):return"maxDate";default:return null}};hge.valueManager=yl;const Net=({adapter:e,value:t,timezone:n,props:r})=>{if(t===null)return null;const{minTime:i,maxTime:o,minutesStep:s,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:c,disableFuture:u}=r,f=e.utils.date(void 0,n),d=kL(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(i&&d(i,t)):return"minTime";case!!(o&&d(t,o)):return"maxTime";case!!(u&&e.utils.isAfter(t,f)):return"disableFuture";case!!(c&&e.utils.isBefore(t,f)):return"disablePast";case!!(a&&a(t,"hours")):return"shouldDisableTime-hours";case!!(a&&a(t,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(t,"seconds")):return"shouldDisableTime-seconds";case!!(s&&e.utils.getMinutes(t)%s!==0):return"minutesStep";default:return null}};Net.valueManager=yl;const U8=({adapter:e,value:t,timezone:n,props:r})=>{const i=hge({adapter:e,value:t,timezone:n,props:r});return i!==null?i:Net({adapter:e,value:t,timezone:n,props:r})};U8.valueManager=yl;const zet=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],jet=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],Bet=["minDateTime","maxDateTime"],LPn=[...zet,...jet,...Bet],Uet=e=>LPn.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{}),FPn=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:X({},e)}}}}),Vet=e=>{const{utils:t,formatKey:n,contextTranslation:r,propsTranslation:i}=e;return o=>{const s=o!==null&&t.isValid(o)?t.format(o,n):null;return(i??r)(o,t,s)}},Wet={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${!r&&(t===null||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>e.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},$Pn=Wet;FPn(Wet);const MS=()=>{const e=M.useContext(eie);if(e===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` `));if(e.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(` -`));const t=M.useMemo(()=>X({},QMn,e.localeText),[e.localeText]);return M.useMemo(()=>X({},e,{localeText:t}),[e,t])},xi=()=>NS().utils,UL=()=>NS().defaultDates,zS=e=>{const t=xi(),n=M.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current};function rrt(e){const{props:t,validator:n,value:r,timezone:i,onError:o}=e,s=NS(),a=M.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:i,props:t}),c=n.valueManager.hasError(l);M.useEffect(()=>{o&&!n.valueManager.isSameError(l,a.current)&&o(l,r),a.current=l},[n,o,l,r]);const u=ft(f=>n({adapter:s,value:f,timezone:i,props:t}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const Xc=()=>NS().localeText,KMn=({utils:e,format:t})=>{let n=10,r=t,i=e.expandFormat(t);for(;i!==r;)if(r=i,i=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return i},ZMn=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:i}=e.escapedCharacters,o=new RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g");let s=null;for(;s=o.exec(t);)n.push({start:s.index,end:o.lastIndex-1});return n},JMn=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},eAn=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=Hnt(e,s),c=Ynt(e,l.contentType,l.type,s),u=n?c:l.contentType==="digit",f=t!=null&&e.isValid(t);let d=f?e.formatByString(t,s):"",h=null;if(u)if(c)h=d===""?e.formatByString(o,s).length:d.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);h=l.maxLength,f&&(d=Sme(qnt(Nw(d,i),h),i))}return X({},l,{format:s,maxLength:h,value:d,placeholder:JMn(e,r,l,s),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:a,endSeparator:"",modified:!1})},tAn=e=>{const{utils:t,expandedFormat:n,escapedParts:r}=e,i=t.date(void 0),o=[];let s="";const a=Object.keys(t.formatTokenMap).sort((h,p)=>p.length-h.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${a.join("|")})*$`),u=new RegExp(`^(${a.join("|")})`),f=h=>r.find(p=>p.start<=h&&p.end>=h);let d=0;for(;d0;){const v=u.exec(m)[1];m=m.slice(v.length),o.push(eAn(X({},e,{now:i,token:v,startSeparator:s}))),s=""}d+=g.length}else{const m=n[d];p&&h?.start===d||h?.end===d||(o.length===0?s+=m:o[o.length-1].endSeparator+=m),d+=1}}return o.length===0&&s.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),o},nAn=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const i=o=>{let s=o;return e&&s!==null&&s.includes(" ")&&(s=`⁩${s}⁦`),t==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=i(r.startSeparator),r.endSeparator=i(r.endSeparator),r}),DMe=e=>{let t=KMn(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=ZMn(X({},e,{expandedFormat:t})),r=tAn(X({},e,{expandedFormat:t,escapedParts:n}));return nAn(X({},e,{sections:r}))},Ome=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:i,valueManager:o})=>{const s=xi(),a=M.useRef(n),l=t??a.current??o.emptyValue,c=M.useMemo(()=>o.getTimezone(s,l),[s,o,l]),u=ft(p=>c==null?p:o.setTimezone(s,c,p));let f;e?f=e:c?f=c:r?f=s.getTimezone(r):f="default";const d=M.useMemo(()=>o.setTimezone(s,f,l),[o,s,f,l]),h=ft((p,...g)=>{const m=u(p);i?.(m,...g)});return{value:d,handleValueChange:h,timezone:f}},wP=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:i,onChange:o,valueManager:s})=>{const[a,l]=Fa({name:e,state:"value",controlled:n,default:r??s.emptyValue}),c=ft((u,...f)=>{l(u),o?.(u,...f)});return Ome({timezone:t,value:a,defaultValue:void 0,referenceDate:i,onChange:c,valueManager:s})},rAn=e=>{const t=xi(),n=Xc(),r=NS(),i=bi(),{valueManager:o,fieldValueManager:s,valueType:a,validator:l,internalProps:c,internalProps:{value:u,defaultValue:f,referenceDate:d,onChange:h,format:p,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:b,enableAccessibleFieldDOMStructure:w=!1}}=e,{timezone:S,value:_,handleValueChange:E}=Ome({timezone:b,value:u,defaultValue:f,referenceDate:d,onChange:h,valueManager:o}),T=M.useMemo(()=>DMn(t),[t]),k=M.useMemo(()=>jMn(t,T,S),[t,T,S]),P=M.useCallback((Y,Z=null)=>s.getSectionsFromValue(t,Y,Z,pe=>DMe({utils:t,localeText:n,localizedDigits:T,format:p,date:pe,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:w,isRtl:i})),[s,p,n,T,i,y,t,g,w]),[R,I]=M.useState(()=>{const Y=P(_),Z={sections:Y,value:_,referenceValue:o.emptyValue,tempValueStrAndroid:null},pe=MMn(Y),ie=o.getInitialReferenceValue({referenceDate:d,value:_,utils:t,props:c,granularity:pe,timezone:S});return X({},Z,{referenceValue:ie})}),[F,A]=Fa({controlled:m,default:null,name:"useField",state:"selectedSections"}),L=Y=>{A(Y),v?.(Y)},$=M.useMemo(()=>aoe(F,R.sections),[F,R.sections]),j=$==="all"?0:$,V=({value:Y,referenceValue:Z,sections:pe})=>{if(I(ne=>X({},ne,{sections:pe,value:Y,referenceValue:Z,tempValueStrAndroid:null})),o.areValuesEqual(t,R.value,Y))return;const ie={validationError:l({adapter:r,value:Y,timezone:S,props:c})};E(Y,ie)},U=(Y,Z)=>{const pe=[...R.sections];return pe[Y]=X({},pe[Y],{value:Z,modified:!0}),pe},z=()=>{V({value:o.emptyValue,referenceValue:R.referenceValue,sections:P(o.emptyValue)})},N=()=>{if(j==null)return;const Y=R.sections[j],Z=s.getActiveDateManager(t,R,Y),ie=Z.getSections(R.sections).filter(se=>se.value!=="").length===(Y.value===""?0:1),ne=U(j,""),fe=ie?null:t.getInvalidDate(),me=Z.getNewValuesFromNewActiveDate(fe);V(X({},me,{sections:ne}))},B=Y=>{const Z=(ne,fe)=>{const me=t.parse(ne,p);if(me==null||!t.isValid(me))return null;const se=DMe({utils:t,localeText:n,localizedDigits:T,format:p,date:me,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:w,isRtl:i});return IMe(t,me,se,fe,!1)},pe=s.parseValueStr(Y,R.referenceValue,Z),ie=s.updateReferenceValue(t,pe,R.referenceValue);V({value:pe,referenceValue:ie,sections:P(pe,R.sections)})},H=({activeSection:Y,newSectionValue:Z,shouldGoToNextSection:pe})=>{pe&&jX({},G,se,{sections:ne,tempValueStrAndroid:null}))},Q=Y=>I(Z=>X({},Z,{tempValueStrAndroid:Y}));return M.useEffect(()=>{const Y=P(R.value);I(Z=>X({},Z,{sections:Y}))},[p,t.locale,i]),M.useEffect(()=>{let Y;o.areValuesEqual(t,R.value,_)?Y=o.getTimezone(t,R.value)!==o.getTimezone(t,_):Y=!0,Y&&I(Z=>X({},Z,{value:_,referenceValue:s.updateReferenceValue(t,_,Z.referenceValue),sections:P(_)}))},[_]),{state:R,activeSectionIndex:j,parsedSelectedSections:$,setSelectedSections:L,clearValue:z,clearActiveSection:N,updateSectionValue:H,updateValueFromValueStr:B,setTempAndroidValueStr:Q,getSectionsFromValue:P,sectionsValueBoundaries:k,localizedDigits:T,timezone:S}},iAn=5e3,G_=e=>e.saveQuery!=null,oAn=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{const s=xi(),[a,l]=M.useState(null),c=ft(()=>l(null));M.useEffect(()=>{a!=null&&e[a.sectionIndex]?.type!==a.sectionType&&c()},[e,a,c]),M.useEffect(()=>{if(a!=null){const p=setTimeout(()=>c(),iAn);return()=>{clearTimeout(p)}}return()=>{}},[a,c]);const u=({keyPressed:p,sectionIndex:g},m,v)=>{const y=p.toLowerCase(),b=e[g];if(a!=null&&(!v||v(a.value))&&a.sectionIndex===g){const S=`${a.value}${y}`,_=m(S,b);if(!G_(_))return l({sectionIndex:g,value:S,sectionType:b.type}),_}const w=m(y,b);return G_(w)&&!w.saveQuery?(c(),null):(l({sectionIndex:g,value:y,sectionType:b.type}),G_(w)?null:w)},f=p=>{const g=(y,b,w)=>{const S=b.filter(_=>_.toLowerCase().startsWith(w));return S.length===0?{saveQuery:!1}:{sectionValue:S[0],shouldGoToNextSection:S.length===1}},m=(y,b,w,S)=>{const _=E=>Gnt(s,o,b.type,E);if(b.contentType==="letter")return g(b.format,_(b.format),y);if(w&&S!=null&&Hnt(s,w).contentType==="letter"){const E=_(w),T=g(w,E,y);return G_(T)?{saveQuery:!1}:X({},T,{sectionValue:S(T.sectionValue,E)})}return{saveQuery:!1}};return u(p,(y,b)=>{switch(b.type){case"month":{const w=S=>AMe(s,S,s.formats.month,b.format);return m(y,b,s.formats.month,w)}case"weekDay":{const w=(S,_)=>_.indexOf(S).toString();return m(y,b,s.formats.weekday,w)}case"meridiem":return m(y,b);default:return{saveQuery:!1}}})},d=p=>{const g=(v,y)=>{const b=Nw(v,r),w=Number(b),S=n[y.type]({currentDate:null,format:y.format,contentType:y.contentType});if(w>S.maximum)return{saveQuery:!1};if(wS.maximum||b.length===S.maximum.toString().length;return{sectionValue:Xnt(s,w,S,r,y),shouldGoToNextSection:_}};return u(p,(v,y)=>{if(y.contentType==="digit"||y.contentType==="digit-with-letter")return g(v,y);if(y.type==="month"){Ynt(s,"digit","month","MM");const b=g(v,{type:y.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(G_(b))return b;const w=AMe(s,b.sectionValue,"MM",y.format);return X({},b,{sectionValue:w})}if(y.type==="weekDay"){const b=g(v,y);if(G_(b))return b;const w=pW(s,y.format)[Number(b.sectionValue)-1];return X({},b,{sectionValue:w})}return{saveQuery:!1}},v=>MMe(v,r))};return{applyCharacterEditing:ft(p=>{const g=e[p.sectionIndex],v=MMe(p.keyPressed,r)?d(X({},p,{keyPressed:Sme(p.keyPressed,r)})):f(p);if(v==null){i(null);return}t({activeSection:g,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:c}};function sAn(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const aAn=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},Al=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?Al(t.shadowRoot):t:null},w4=e=>Array.from(e.children).indexOf(Al(document)),lAn="@media (pointer: fine)",cAn=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:s,onInput:a,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:f,applyCharacterEditing:d,resetCharacterQuery:h,setSelectedSections:p,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:b,updateValueFromValueStr:w,sectionOrder:S,areAllSectionsEmpty:_,sectionsValueBoundaries:E}=e,T=M.useRef(null),k=zn(r,T),P=Xc(),R=xi(),I=ur(),[F,A]=M.useState(!1),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!T.current)return;const ue=document.getSelection();if(!ue)return;if(g==null){ue.rangeCount>0&&T.current.getRoot().contains(ue.getRangeAt(0).startContainer)&&ue.removeAllRanges(),F&&T.current.getRoot().blur();return}if(!T.current.getRoot().contains(Al(document)))return;const G=new window.Range;let ce;g==="all"?ce=T.current.getRoot():m.sections[g].type==="empty"?ce=T.current.getSectionContainer(g):ce=T.current.getSectionContent(g),G.selectNodeContents(ce),ce.focus(),ue.removeAllRanges(),ue.addRange(G)},getActiveSectionIndexFromDOM:()=>{const ue=Al(document);return!ue||!T.current||!T.current.getRoot().contains(ue)?null:T.current.getSectionIndexFromDOMElement(ue)},focusField:(ue=0)=>{if(!T.current||L.getActiveSectionIndexFromDOM()!=null)return;const G=aoe(ue,m.sections);A(!0),T.current.getSectionContent(G).focus()},setSelectedSections:ue=>{if(!T.current)return;const G=aoe(ue,m.sections);A((G==="all"?0:G)!==null),p(ue)},isFieldFocused:()=>{const ue=Al(document);return!!T.current&&T.current.getRoot().contains(ue)}}),[g,p,m.sections,F]),$=ft(ue=>{if(!T.current)return;const G=m.sections[ue];T.current.getSectionContent(ue).innerHTML=G.value||G.placeholder,L.syncSelectionToDOM()}),j=ft((ue,...G)=>{ue.isDefaultPrevented()||!T.current||(A(!0),o?.(ue,...G),g==="all"?setTimeout(()=>{const ce=document.getSelection().getRangeAt(0).startOffset;if(ce===0){p(S.startIndex);return}let he=0,J=0;for(;J{if(a?.(ue),!T.current||g!=="all")return;const ce=ue.target.textContent??"";T.current.getRoot().innerHTML=m.sections.map(he=>`${he.startSeparator}${he.value||he.placeholder}${he.endSeparator}`).join(""),L.syncSelectionToDOM(),ce.length===0||ce.charCodeAt(0)===10?(h(),y(),p("all")):ce.length>1?w(ce):(g==="all"&&p(0),d({keyPressed:ce,sectionIndex:0}))}),U=ft(ue=>{if(l?.(ue),n||g!=="all"){ue.preventDefault();return}const G=ue.clipboardData.getData("text");ue.preventDefault(),h(),w(G)}),z=ft((...ue)=>{if(s?.(...ue),F||!T.current)return;A(!0),T.current.getSectionIndexFromDOMElement(Al(document))!=null||p(S.startIndex)}),N=ft((...ue)=>{i?.(...ue),setTimeout(()=>{if(!T.current)return;const G=Al(document);!T.current.getRoot().contains(G)&&(A(!1),p(null))})}),B=ft(ue=>G=>{G.isDefaultPrevented()||p(ue)}),H=ft(ue=>{ue.preventDefault()}),Q=ft(ue=>()=>{p(ue)}),Y=ft(ue=>{if(ue.preventDefault(),n||t||typeof g!="number")return;const G=m.sections[g],ce=ue.clipboardData.getData("text"),he=/^[a-zA-Z]+$/.test(ce),J=/^[0-9]+$/.test(ce),te=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ce);G.contentType==="letter"&&he||G.contentType==="digit"&&J||G.contentType==="digit-with-letter"&&te?(h(),b({activeSection:G,newSectionValue:ce,shouldGoToNextSection:!0})):!he&&!J&&(h(),w(ce))}),Z=ft(ue=>{ue.preventDefault(),ue.dataTransfer.dropEffect="none"}),pe=ft(ue=>{if(!T.current)return;const G=ue.target,ce=G.textContent??"",he=T.current.getSectionIndexFromDOMElement(G),J=m.sections[he];if(n||!T.current){$(he);return}if(ce.length===0){if(J.value===""){$(he);return}const te=ue.nativeEvent.inputType;if(te==="insertParagraph"||te==="insertLineBreak"){$(he);return}h(),v();return}d({keyPressed:ce,sectionIndex:he}),$(he)});ar(()=>{if(!(!F||!T.current)){if(g==="all")T.current.getRoot().focus();else if(typeof g=="number"){const ue=T.current.getSectionContent(g);ue&&ue.focus()}}},[g,F]);const ie=M.useMemo(()=>m.sections.reduce((ue,G)=>(ue[G.type]=E[G.type]({currentDate:null,contentType:G.contentType,format:G.format}),ue),{}),[E,m.sections]),ne=g==="all",fe=M.useMemo(()=>m.sections.map((ue,G)=>{const ce=!ne&&!t&&!n;return{container:{"data-sectionindex":G,onClick:B(G)},content:{tabIndex:ne||G>0?-1:0,contentEditable:!ne&&!t&&!n,role:"spinbutton",id:`${I}-${ue.type}`,"aria-labelledby":`${I}-${ue.type}`,"aria-readonly":n,"aria-valuenow":HMn(ue,R),"aria-valuemin":ie[ue.type].minimum,"aria-valuemax":ie[ue.type].maximum,"aria-valuetext":ue.value?WMn(ue,R):P.empty,"aria-label":P[ue.type],"aria-disabled":t,spellCheck:ce?!1:void 0,autoCapitalize:ce?"off":void 0,autoCorrect:ce?"off":void 0,[parseInt(M.version,10)>=17?"enterKeyHint":"enterkeyhint"]:ce?"next":void 0,children:ue.value||ue.placeholder,onInput:pe,onPaste:Y,onFocus:Q(G),onDragOver:Z,onMouseUp:H,inputMode:ue.contentType==="letter"?"text":"numeric"},before:{children:ue.startSeparator},after:{children:ue.endSeparator}}}),[m.sections,Q,Y,Z,pe,B,H,t,n,ne,P,R,ie,I]),me=ft(ue=>{w(ue.target.value)}),se=M.useMemo(()=>_?"":f.getV7HiddenInputValueFromSections(m.sections),[_,m.sections,f]);return M.useEffect(()=>{if(T.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.","","If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(` -`));u&&T.current&&T.current.getSectionContent(S.startIndex).focus()},[]),{interactions:L,returnedValue:{autoFocus:u,readOnly:n,focused:c??F,sectionListRef:k,onBlur:N,onClick:j,onFocus:z,onInput:V,onPaste:U,enableAccessibleFieldDOMStructure:!0,elements:fe,tabIndex:g===0?-1:0,contentEditable:ne,value:se,onChange:me,areAllSectionsEmpty:_}}},KC=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),uAn=(e,t,n)=>{let r=0,i=n?1:0;const o=[];for(let s=0;s{const t=bi(),n=M.useRef(void 0),r=M.useRef(void 0),{forwardedProps:{onFocus:i,onClick:o,onPaste:s,onBlur:a,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:f=!1},parsedSelectedSections:d,activeSectionIndex:h,state:p,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:b,updateValueFromValueStr:w,clearActiveSection:S,clearValue:_,setTempAndroidValueStr:E,setSelectedSections:T,getSectionsFromValue:k,areAllSectionsEmpty:P,localizedDigits:R}=e,I=M.useRef(null),F=zn(l,I),A=M.useMemo(()=>uAn(p.sections,R,t),[p.sections,R,t]),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!I.current)return;if(d==null){I.current.scrollLeft&&(I.current.scrollLeft=0);return}if(I.current!==Al(document))return;const pe=I.current.scrollTop;if(d==="all")I.current.select();else{const ie=A[d],ne=ie.type==="empty"?ie.startInInput-ie.startSeparator.length:ie.startInInput,fe=ie.type==="empty"?ie.endInInput+ie.endSeparator.length:ie.endInInput;(ne!==I.current.selectionStart||fe!==I.current.selectionEnd)&&I.current===Al(document)&&I.current.setSelectionRange(ne,fe),clearTimeout(r.current),r.current=setTimeout(()=>{I.current&&I.current===Al(document)&&I.current.selectionStart===I.current.selectionEnd&&(I.current.selectionStart!==ne||I.current.selectionEnd!==fe)&&L.syncSelectionToDOM()})}I.current.scrollTop=pe},getActiveSectionIndexFromDOM:()=>{const pe=I.current.selectionStart??0,ie=I.current.selectionEnd??0;if(pe===0&&ie===0)return null;const ne=pe<=A[0].startInInput?1:A.findIndex(fe=>fe.startInInput-fe.startSeparator.length>pe);return ne===-1?A.length-1:ne-1},focusField:(pe=0)=>{Al(document)!==I.current&&(I.current?.focus(),T(pe))},setSelectedSections:pe=>T(pe),isFieldFocused:()=>I.current===Al(document)}),[I,d,A,T]),$=()=>{const pe=I.current.selectionStart??0;let ie;pe<=A[0].startInInput||pe>=A[A.length-1].endInInput?ie=1:ie=A.findIndex(fe=>fe.startInInput-fe.startSeparator.length>pe);const ne=ie===-1?A.length-1:ie-1;T(ne)},j=ft((...pe)=>{i?.(...pe);const ie=I.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ie||ie!==I.current||h==null&&(ie.value.length&&Number(ie.selectionEnd)-Number(ie.selectionStart)===ie.value.length?T("all"):$())})}),V=ft((pe,...ie)=>{pe.isDefaultPrevented()||(o?.(pe,...ie),$())}),U=ft(pe=>{if(s?.(pe),pe.preventDefault(),u||f)return;const ie=pe.clipboardData.getData("text");if(typeof d=="number"){const ne=p.sections[d],fe=/^[a-zA-Z]+$/.test(ie),me=/^[0-9]+$/.test(ie),se=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ie);if(ne.contentType==="letter"&&fe||ne.contentType==="digit"&&me||ne.contentType==="digit-with-letter"&&se){y(),b({activeSection:ne,newSectionValue:ie,shouldGoToNextSection:!0});return}if(fe||me)return}y(),w(ie)}),z=ft((...pe)=>{a?.(...pe),T(null)}),N=ft(pe=>{if(u)return;const ie=pe.target.value;if(ie===""){y(),_();return}const ne=pe.nativeEvent.data,fe=ne&&ne.length>1,me=fe?ne:ie,se=KC(me);if(d==="all"&&T(h),h==null||fe){w(fe?ne:se);return}let ue;if(d==="all"&&se.length===1)ue=se;else{const G=KC(g.getV6InputValueFromSections(A,R,t));let ce=-1,he=-1;for(let we=0;weJ.end)return;const ae=se.length-G.length+J.end-KC(J.endSeparator||"").length;ue=se.slice(J.start+KC(J.startSeparator||"").length,ae)}if(ue.length===0){UMn()&&E(me),y(),S();return}v({keyPressed:ue,sectionIndex:h})}),B=M.useMemo(()=>c!==void 0?c:g.getV6InputValueFromSections(k(m.emptyValue),R,t),[c,g,k,m.emptyValue,R,t]),H=M.useMemo(()=>p.tempValueStrAndroid??g.getV6InputValueFromSections(p.sections,R,t),[p.sections,g,p.tempValueStrAndroid,R,t]);M.useEffect(()=>(I.current&&I.current===Al(document)&&T("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const Q=M.useMemo(()=>h==null||p.sections[h].contentType==="letter"?"text":"numeric",[h,p.sections]),Z=!(I.current&&I.current===Al(document))&&P;return{interactions:L,returnedValue:{readOnly:u,onBlur:z,onClick:V,onFocus:j,onPaste:U,inputRef:F,enableAccessibleFieldDOMStructure:!1,placeholder:B,inputMode:Q,autoComplete:"off",value:Z?"":H,onChange:N}}},dAn=e=>{const t=xi(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:f},fieldValueManager:d,valueManager:h,validator:p}=e,g=bi(),m=rAn(e),{state:v,activeSectionIndex:y,parsedSelectedSections:b,setSelectedSections:w,clearValue:S,clearActiveSection:_,updateSectionValue:E,setTempAndroidValueStr:T,sectionsValueBoundaries:k,localizedDigits:P,timezone:R}=m,I=oAn({sections:v.sections,updateSectionValue:E,sectionsValueBoundaries:k,localizedDigits:P,setTempAndroidValueStr:T,timezone:R}),{resetCharacterQuery:F}=I,A=h.areValuesEqual(t,v.value,h.emptyValue),L=o?cAn:fAn,$=M.useMemo(()=>VMn(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:j,interactions:V}=L(X({},e,m,I,{areAllSectionsEmpty:A,sectionOrder:$})),U=ft(Y=>{if(l?.(Y),!s)switch(!0){case((Y.ctrlKey||Y.metaKey)&&String.fromCharCode(Y.keyCode)==="A"&&!Y.shiftKey&&!Y.altKey):{Y.preventDefault(),w("all");break}case Y.key==="ArrowRight":{if(Y.preventDefault(),b==null)w($.startIndex);else if(b==="all")w($.endIndex);else{const Z=$.neighbors[b].rightIndex;Z!==null&&w(Z)}break}case Y.key==="ArrowLeft":{if(Y.preventDefault(),b==null)w($.endIndex);else if(b==="all")w($.startIndex);else{const Z=$.neighbors[b].leftIndex;Z!==null&&w(Z)}break}case Y.key==="Delete":{if(Y.preventDefault(),a)break;b==null||b==="all"?S():_(),F();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(Y.key):{if(Y.preventDefault(),a||y==null)break;b==="all"&&w(y);const Z=v.sections[y],pe=d.getActiveDateManager(t,v,Z),ie=LMn(t,R,Z,Y.key,k,P,pe.date,{minutesStep:i});E({activeSection:Z,newSectionValue:ie,shouldGoToNextSection:!1});break}}});ar(()=>{V.syncSelectionToDOM()});const{hasValidationError:z}=rrt({props:n,validator:p,timezone:R,value:v.value,onError:n.onError}),N=M.useMemo(()=>c!==void 0?c:z,[z,c]);M.useEffect(()=>{!N&&y==null&&F()},[v.referenceValue,y,N]),M.useEffect(()=>{v.tempValueStrAndroid!=null&&y!=null&&(F(),_())},[v.sections]),M.useImperativeHandle(r,()=>({getSections:()=>v.sections,getActiveSectionIndex:V.getActiveSectionIndexFromDOM,setSelectedSections:V.setSelectedSections,focusField:V.focusField,isFieldFocused:V.isFieldFocused}));const B=ft((Y,...Z)=>{Y.preventDefault(),f?.(Y,...Z),S(),V.isFieldFocused()?w($.startIndex):V.focusField(0)}),H={onKeyDown:U,onClear:B,error:N,clearable:!!(u&&!A&&!a&&!s)},Q={disabled:s,readOnly:a};return X({},e.forwardedProps,H,Q,j)},hAn=ot(O.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),pAn=ot(O.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),gAn=ot(O.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),mAn=ot(O.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar");ot(O.jsxs(M.Fragment,{children:[O.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),O.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");const vAn=ot(O.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),yAn=ot(O.jsxs(M.Fragment,{children:[O.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),O.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),bAn=ot(O.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),xAn=["clearable","onClear","InputProps","sx","slots","slotProps"],wAn=["ownerState"],SAn=e=>{const t=Xc(),{clearable:n,onClear:r,InputProps:i,sx:o,slots:s,slotProps:a}=e,l=it(e,xAn),c=s?.clearButton??Mn,u=Yn({elementType:c,externalSlotProps:a?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),f=it(u,wAn),d=s?.clearIcon??bAn,h=Yn({elementType:d,externalSlotProps:a?.clearIcon,ownerState:{}});return X({},l,{InputProps:X({},i,{endAdornment:O.jsxs(M.Fragment,{children:[n&&O.jsx(ule,{position:"end",sx:{marginRight:i?.endAdornment?-1:-1.5},children:O.jsx(c,X({},f,{onClick:r,children:O.jsx(d,X({fontSize:"small"},h))}))}),i?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})},_An=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],CAn=(e,t)=>M.useMemo(()=>{const n=X({},e),r={},i=o=>{n.hasOwnProperty(o)&&(r[o]=n[o],delete n[o])};return _An.forEach(i),Knt.forEach(i),Znt.forEach(i),Jnt.forEach(i),{forwardedProps:n,internalProps:r}},[e,t]),OAn=M.createContext(null);function irt(e){const{contextValue:t,localeText:n,children:r}=e;return O.jsx(OAn.Provider,{value:t,children:O.jsx(Vnt,{localeText:n,children:r})})}const EAn=e=>{const t=xi(),n=UL(),i=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h;return X({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??i,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:rd(t,e.minDateTime??e.minDate,n.minDate),maxDate:rd(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime})},TAn=e=>{const t=EAn(e),{forwardedProps:n,internalProps:r}=CAn(t,"date-time");return dAn({forwardedProps:n,internalProps:r,valueManager:bl,fieldValueManager:qMn,validator:gW,valueType:"date-time"})};function PAn(e){return pt("MuiPickersTextField",e)}dt("MuiPickersTextField",["root","focused","disabled","error","required"]);function kAn(e){return pt("MuiPickersInputBase",e)}const OO=dt("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function MAn(e){return pt("MuiPickersSectionList",e)}const v2=dt("MuiPickersSectionList",["root","section","sectionContent"]),AAn=["slots","slotProps","elements","sectionListRef"],ort=Oe("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),srt=Oe("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),art=Oe("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),lrt=Oe("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),RAn=e=>{const{classes:t}=e;return Xe({root:["root"],section:["section"],sectionContent:["sectionContent"]},MAn,t)};function IAn(e){const{slots:t,slotProps:n,element:r,classes:i}=e,o=t?.section??srt,s=Yn({elementType:o,externalSlotProps:n?.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),a=t?.sectionContent??lrt,l=Yn({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),c=t?.sectionSeparator??art,u=Yn({elementType:c,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Yn({elementType:c,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return O.jsxs(o,X({},s,{children:[O.jsx(c,X({},u)),O.jsx(a,X({},l)),O.jsx(c,X({},f))]}))}const DAn=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersSectionList"}),{slots:i,slotProps:o,elements:s,sectionListRef:a}=r,l=it(r,AAn),c=RAn(r),u=M.useRef(null),f=zn(n,u),d=g=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${g} before the mount of the component.`);return u.current};M.useImperativeHandle(a,()=>({getRoot(){return d("getRoot")},getSectionContainer(g){return d("getSectionContainer").querySelector(`.${v2.section}[data-sectionindex="${g}"]`)},getSectionContent(g){return d("getSectionContent").querySelector(`.${v2.section}[data-sectionindex="${g}"] .${v2.sectionContent}`)},getSectionIndexFromDOMElement(g){const m=d("getSectionIndexFromDOMElement");if(g==null||!m.contains(g))return null;let v=null;return g.classList.contains(v2.section)?v=g:g.classList.contains(v2.sectionContent)&&(v=g.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const h=i?.root??ort,p=Yn({elementType:h,externalSlotProps:o?.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return O.jsx(h,X({},p,{children:p.contentEditable?s.map(({content:g,before:m,after:v})=>`${m.children}${g.children}${v.children}`).join(""):O.jsx(M.Fragment,{children:s.map((g,m)=>O.jsx(IAn,{slots:i,slotProps:o,element:g,classes:c},m))})}))}),LAn=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],FAn=e=>Math.round(e*1e5)/1e5,mW=Oe("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>X({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${FAn(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),Eme=Oe(ort,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:t,focused:n,filled:r,label:i})=>!t&&!n&&!r&&i==null,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),$An=Oe(srt,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),NAn=Oe(lrt,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),zAn=Oe(art,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),jAn=Oe("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(X({},uje)),BAn=e=>{const{focused:t,disabled:n,error:r,classes:i,fullWidth:o,readOnly:s,color:a,size:l,endAdornment:c,startAdornment:u}=e,f={root:["root",t&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",o&&"fullWidth",`color${Ve(a)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Xe(f,kAn,i)},Tme=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:o,value:s,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:f,slots:d,slotProps:h,contentEditable:p,tabIndex:g,onInput:m,onPaste:v,onKeyDown:y,name:b,readOnly:w,inputProps:S,inputRef:_,sectionListRef:E}=r,T=it(r,LAn),k=M.useRef(null),P=zn(n,k),R=zn(S?.ref,_),I=bi(),F=tc();if(!F)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const A=z=>{if(F.disabled){z.stopPropagation();return}F.onFocus?.(z)};M.useEffect(()=>{F&&F.setAdornedStart(!!u)},[F,u]),M.useEffect(()=>{F&&(o?F.onEmpty():F.onFilled())},[F,o]);const L=X({},r,F,{isRtl:I}),$=BAn(L),j=d?.root||mW,V=Yn({elementType:j,externalSlotProps:h?.root,externalForwardedProps:T,additionalProps:{"aria-invalid":F.error,ref:P},className:$.root,ownerState:L}),U=d?.input||Eme;return O.jsxs(j,X({},V,{children:[u,O.jsx(DAn,{sectionListRef:E,elements:i,contentEditable:p,tabIndex:g,className:$.sectionsContainer,onFocus:A,onBlur:F.onBlur,onInput:m,onPaste:v,onKeyDown:y,slots:{root:U,section:$An,sectionContent:NAn,sectionSeparator:zAn},slotProps:{root:{ownerState:L},sectionContent:{className:OO.sectionContent},sectionSeparator:({position:z})=>({className:z==="before"?OO.sectionBefore:OO.sectionAfter})}}),c,f?f(X({},F)):null,O.jsx(jAn,X({name:b,className:$.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:w,required:F.required,disabled:F.disabled},S,{ref:R}))]}))});function UAn(e){return pt("MuiPickersOutlinedInput",e)}const Td=X({},OO,dt("MuiPickersOutlinedInput",["root","notchedOutline","input"])),VAn=["children","className","label","notched","shrink"],WAn=Oe("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),LMe=Oe("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),HAn=Oe("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function GAn(e){const{className:t,label:n}=e,r=it(e,VAn),i=n!=null&&n!=="",o=X({},e,{withLabel:i});return O.jsx(WAn,X({"aria-hidden":!0,className:t},r,{ownerState:o,children:O.jsx(HAn,{ownerState:o,children:i?O.jsx(LMe,{children:n}):O.jsx(LMe,{className:"notranslate",children:"​"})})}))}const qAn=["label","autoFocus","ownerState","notched"],XAn=Oe(mW,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Td.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Td.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Td.focused} .${Td.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Td.disabled}`]:{[`& .${Td.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${Td.error} .${Td.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>(e.vars??e).palette[n]?.main??!1).map(n=>({props:{color:n},style:{[`&.${Td.focused}:not(.${Td.error}) .${Td.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),YAn=Oe(Eme,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),QAn=e=>{const{classes:t}=e,r=Xe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},UAn,t);return X({},t,r)},crt=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:o,notched:s}=r,a=it(r,qAn),l=tc(),c=X({},r,o,l,{color:l?.color||"primary"}),u=QAn(c);return O.jsx(Tme,X({slots:{root:XAn,input:YAn},renderSuffix:f=>O.jsx(GAn,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:u.notchedOutline,label:i!=null&&i!==""&&l?.required?O.jsxs(M.Fragment,{children:[i," ","*"]}):i,ownerState:c})},a,{label:i,classes:u,ref:n}))});crt.muiName="Input";function KAn(e){return pt("MuiPickersFilledInput",e)}const Ix=X({},OO,dt("MuiPickersFilledInput",["root","underline","input"])),ZAn=["label","autoFocus","disableUnderline","ownerState"],JAn=Oe(mW,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Cz(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Ix.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Ix.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:o},variants:[...Object.keys((e.vars??e).palette).filter(s=>(e.vars??e).palette[s].main).map(s=>({props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Ix.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Ix.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Ix.disabled}, .${Ix.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Ix.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),eRn=Oe(Eme,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),tRn=e=>{const{classes:t,disableUnderline:n}=e,i=Xe({root:["root",!n&&"underline"],input:["input"]},KAn,t);return X({},t,i)},urt=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=it(r,ZAn),l=tc(),c=X({},r,s,l,{color:l?.color||"primary"}),u=tRn(c);return O.jsx(Tme,X({slots:{root:JAn,input:eRn},slotProps:{root:{disableUnderline:o}}},a,{label:i,classes:u,ref:n}))});urt.muiName="Input";function nRn(e){return pt("MuiPickersFilledInput",e)}const y2=X({},OO,dt("MuiPickersInput",["root","input"])),rRn=["label","autoFocus","disableUnderline","ownerState"],iRn=Oe(mW,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${y2.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${y2.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${y2.disabled}, .${y2.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${y2.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),oRn=e=>{const{classes:t,disableUnderline:n}=e,i=Xe({root:["root",!n&&"underline"],input:["input"]},nRn,t);return X({},t,i)},frt=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=it(r,rRn),l=tc(),c=X({},r,s,l,{disableUnderline:o,color:l?.color||"primary"}),u=oRn(c);return O.jsx(Tme,X({slots:{root:iRn}},a,{label:i,classes:u,ref:n}))});frt.muiName="Input";const sRn=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],aRn={standard:frt,filled:urt,outlined:crt},lRn=Oe(ld,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),cRn=e=>{const{focused:t,disabled:n,classes:r,required:i}=e;return Xe({root:["root",t&&!n&&"focused",n&&"disabled",i&&"required"]},PAn,r)},uRn=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersTextField"}),{onFocus:i,onBlur:o,className:s,color:a="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:f=!1,InputProps:d,inputProps:h,inputRef:p,sectionListRef:g,elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:b,onKeyUp:w,onPaste:S,onInput:_,endAdornment:E,startAdornment:T,tabIndex:k,contentEditable:P,focused:R,value:I,onChange:F,fullWidth:A,id:L,name:$,helperText:j,FormHelperTextProps:V,label:U,InputLabelProps:z}=r,N=it(r,sRn),B=M.useRef(null),H=zn(n,B),Q=ur(L),Y=j&&Q?`${Q}-helper-text`:void 0,Z=U&&Q?`${Q}-label`:void 0,pe=X({},r,{color:a,disabled:l,error:c,focused:R,required:f,variant:u}),ie=cRn(pe),ne=aRn[u];return O.jsxs(lRn,X({className:Re(ie.root,s),ref:H,focused:R,onFocus:i,onBlur:o,disabled:l,variant:u,error:c,color:a,fullWidth:A,required:f,ownerState:pe},N,{children:[O.jsx(_v,X({htmlFor:Q,id:Z},z,{children:U})),O.jsx(ne,X({elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:b,onKeyUp:w,onInput:_,onPaste:S,endAdornment:E,startAdornment:T,tabIndex:k,contentEditable:P,value:I,onChange:F,id:Q,fullWidth:A,inputProps:h,inputRef:p,sectionListRef:g,label:U,name:$,role:"group","aria-labelledby":Z,"aria-describedby":Y,"aria-live":Y?"polite":void 0},d)),j&&O.jsx(lle,X({id:Y},V,{children:j}))]}))}),fRn=["enableAccessibleFieldDOMStructure"],dRn=["InputProps","readOnly"],hRn=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],pRn=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=it(e,fRn);if(t){const{InputProps:f,readOnly:d}=n,h=it(n,dRn);return X({},h,{InputProps:X({},f??{},{readOnly:d})})}const{onPaste:r,onKeyDown:i,inputMode:o,readOnly:s,InputProps:a,inputProps:l,inputRef:c}=n,u=it(n,hRn);return X({},u,{InputProps:X({},a??{},{readOnly:s}),inputProps:X({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:c})})},gRn=["slots","slotProps","InputProps","inputProps"],drt=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiDateTimeField"}),{slots:i,slotProps:o,InputProps:s,inputProps:a}=r,l=it(r,gRn),c=r,u=i?.textField??(t.enableAccessibleFieldDOMStructure?uRn:Ri),f=Yn({elementType:u,externalSlotProps:o?.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});f.inputProps=X({},a,f.inputProps),f.InputProps=X({},s,f.InputProps);const d=TAn(f),h=pRn(d),p=SAn(X({},h,{slots:i,slotProps:o}));return O.jsx(u,X({},p))});function mRn(e){return pt("MuiDateTimePickerTabs",e)}dt("MuiDateTimePickerTabs",["root"]);const vRn=e=>NE(e)?"date":"time",yRn=e=>e==="date"?"day":"hours",bRn=e=>{const{classes:t}=e;return Xe({root:["root"]},mRn,t)},xRn=Oe(vle,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${kz.indicator}`]:{bottom:"auto",top:0}}})),wRn=function(t){const n=Ar({props:t,name:"MuiDateTimePickerTabs"}),{dateIcon:r=O.jsx(vAn,{}),onViewChange:i,timeIcon:o=O.jsx(yAn,{}),view:s,hidden:a=typeof window>"u"||window.innerHeight<667,className:l,sx:c}=n,u=Xc(),f=bRn(n),d=(h,p)=>{i(yRn(p))};return a?null:O.jsxs(xRn,{ownerState:n,variant:"fullWidth",value:vRn(s),onChange:d,className:Re(l,f.root),sx:c,children:[O.jsx(zA,{value:"date","aria-label":u.dateTableLabel,icon:O.jsx(M.Fragment,{children:r})}),O.jsx(zA,{value:"time","aria-label":u.timeTableLabel,icon:O.jsx(M.Fragment,{children:o})})]})};function SRn(e){return pt("MuiPickersToolbarText",e)}const loe=dt("MuiPickersToolbarText",["root","selected"]),_Rn=["className","selected","value"],CRn=e=>{const{classes:t,selected:n}=e;return Xe({root:["root",n&&"selected"]},SRn,t)},ORn=Oe(yn,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${loe.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${loe.selected}`]:{color:(e.vars||e).palette.text.primary}})),hrt=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersToolbarText"}),{className:i,value:o}=r,s=it(r,_Rn),a=CRn(r);return O.jsx(ORn,X({ref:n,className:Re(a.root,i),component:"span"},s,{children:o}))});function prt(e){return pt("MuiPickersToolbar",e)}const ERn=dt("MuiPickersToolbar",["root","content"]),TRn=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],PRn=e=>{const{classes:t}=e;return Xe({root:["root"],content:["content"]},prt,t)},kRn=Oe("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),MRn=Oe("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),ARn=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersToolbar"}),{children:i,className:o,toolbarTitle:s,hidden:a,titleId:l}=r,c=it(r,TRn),u=r,f=PRn(u);return a?null:O.jsxs(kRn,X({ref:n,className:Re(f.root,o),ownerState:u},c,{children:[O.jsx(yn,{color:"text.secondary",variant:"overline",id:l,children:s}),O.jsx(MRn,{className:f.content,ownerState:u,children:i})]}))}),RRn=["align","className","selected","typographyClassName","value","variant","width"],IRn=e=>{const{classes:t}=e;return Xe({root:["root"]},prt,t)},DRn=Oe(ji,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),xy=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:s,typographyClassName:a,value:l,variant:c,width:u}=r,f=it(r,RRn),d=IRn(r);return O.jsx(DRn,X({variant:"text",ref:n,className:Re(d.root,o)},u?{sx:{width:u}}:{},f,{children:O.jsx(hrt,{align:i,className:a,variant:c,value:l,selected:s})}))});function LRn(e){return pt("MuiDateTimePickerToolbar",e)}const vY=dt("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]);function FRn(e,{disableFuture:t,maxDate:n,timezone:r}){const i=xi();return M.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(t&&i.isBefore(o,n)?o:n);return!i.isAfter(s,e)},[t,n,e,i,r])}function $Rn(e,{disablePast:t,minDate:n,timezone:r}){const i=xi();return M.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(t&&i.isAfter(o,n)?o:n);return!i.isBefore(s,e)},[t,n,e,i,r])}function Pme(e,t,n,r){const i=xi(),o=PMn(e,i),s=M.useCallback(a=>{const l=e==null?null:kMn(e,a,!!t,i);n(l,r??"partial")},[t,e,n,r,i]);return{meridiemMode:o,handleMeridiemChange:s}}const zR=36,vW=2,yW=320,NRn=280,bW=336,grt=232,MM=48,zRn=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],jRn=e=>{const{classes:t,isLandscape:n,isRtl:r}=e;return Xe({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},LRn,t)},BRn=Oe(ARn,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${ERn.content} .${loe.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),URn=Oe("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),VRn=Oe("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&t!=="desktop",style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&t!=="desktop"&&n,style:{flexDirection:"column-reverse"}}]}),WRn=Oe("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),FMe=Oe(hrt,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),HRn=Oe("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${vY.ampmLabel}`]:t.ampmLabel},{[`&.${vY.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${vY.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function GRn(e){const t=Ar({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:s,isLandscape:a,onViewChange:l,toolbarFormat:c,toolbarPlaceholder:u="––",views:f,disabled:d,readOnly:h,toolbarVariant:p="mobile",toolbarTitle:g,className:m}=t,v=it(t,zRn),y=bi(),b=X({},t,{isRtl:y}),w=xi(),{meridiemMode:S,handleMeridiemChange:_}=Pme(i,n,o),E=!!(n&&!r),T=p==="desktop",k=Xc(),P=jRn(b),R=g??k.dateTimePickerToolbarTitle,I=A=>n?w.format(A,"hours12h"):w.format(A,"hours24h"),F=M.useMemo(()=>i?c?w.formatByString(i,c):w.format(i,"shortDate"):u,[i,c,u,w]);return O.jsxs(BRn,X({isLandscape:a,className:Re(P.root,m),toolbarTitle:R},v,{ownerState:b,children:[O.jsxs(URn,{className:P.dateContainer,ownerState:b,children:[f.includes("year")&&O.jsx(xy,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:s==="year",value:i?w.format(i,"year"):"–"}),f.includes("day")&&O.jsx(xy,{tabIndex:-1,variant:T?"h5":"h4",onClick:()=>l("day"),selected:s==="day",value:F})]}),O.jsxs(VRn,{className:P.timeContainer,ownerState:b,children:[O.jsxs(WRn,{className:P.timeDigitsContainer,ownerState:b,children:[f.includes("hours")&&O.jsxs(M.Fragment,{children:[O.jsx(xy,{variant:T?"h5":"h3",width:T&&!a?MM:void 0,onClick:()=>l("hours"),selected:s==="hours",value:i?I(i):"--"}),O.jsx(FMe,{variant:T?"h5":"h3",value:":",className:P.separator,ownerState:b}),O.jsx(xy,{variant:T?"h5":"h3",width:T&&!a?MM:void 0,onClick:()=>l("minutes"),selected:s==="minutes"||!f.includes("minutes")&&s==="hours",value:i?w.format(i,"minutes"):"--",disabled:!f.includes("minutes")})]}),f.includes("seconds")&&O.jsxs(M.Fragment,{children:[O.jsx(FMe,{variant:T?"h5":"h3",value:":",className:P.separator,ownerState:b}),O.jsx(xy,{variant:T?"h5":"h3",width:T&&!a?MM:void 0,onClick:()=>l("seconds"),selected:s==="seconds",value:i?w.format(i,"seconds"):"--"})]})]}),E&&!T&&O.jsxs(HRn,{className:P.ampmSelection,ownerState:b,children:[O.jsx(xy,{variant:"subtitle2",selected:S==="am",typographyClassName:P.ampmLabel,value:zm(w,"am"),onClick:h?void 0:()=>_("am"),disabled:d}),O.jsx(xy,{variant:"subtitle2",selected:S==="pm",typographyClassName:P.ampmLabel,value:zm(w,"pm"),onClick:h?void 0:()=>_("pm"),disabled:d})]}),n&&T&&O.jsx(xy,{variant:"h5",onClick:()=>l("meridiem"),selected:s==="meridiem",value:i&&S?zm(w,S):"--",width:MM})]})]}))}function mrt(e,t){const n=xi(),r=UL(),i=Ar({props:e,name:t}),o=i.ampm??n.is12HourCycleInCurrentLocale(),s=M.useMemo(()=>i.localeText?.toolbarTitle==null?i.localeText:X({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle}),[i.localeText]);return X({},i,_Mn({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:s,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:rd(n,i.minDateTime??i.minDate,r.minDate),maxDate:rd(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:X({toolbar:GRn,tabs:wRn},i.slots),slotProps:X({},i.slotProps,{toolbar:X({ampm:o},i.slotProps?.toolbar)})})}const vrt=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s,timezone:a})=>{const l=NS();return M.useCallback(c=>Cme({adapter:l,value:c,timezone:a,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s}})!==null,[l,e,t,n,r,i,o,s,a])},qRn=(e,t,n)=>(r,i)=>{switch(i.type){case"changeMonth":return X({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const o=i.newTimezone;if(n.getTimezone(r.currentMonth)===o)return r;let s=n.setTimezone(r.currentMonth,o);return n.getMonth(s)!==n.getMonth(r.currentMonth)&&(s=n.setMonth(s,n.getMonth(r.currentMonth))),X({},r,{currentMonth:s})}case"finishMonthSwitchingAnimation":return X({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&i.focusedDay!=null&&n.isSameDay(i.focusedDay,r.focusedDay))return r;const o=i.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,i.focusedDay);return X({},r,{focusedDay:i.focusedDay,isMonthSwitchingAnimating:o&&!e&&!i.withoutMonthSwitchingAnimation,currentMonth:o?n.startOfMonth(i.focusedDay):r.currentMonth,slideDirection:i.focusedDay!=null&&n.isAfterDay(i.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},XRn=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:i,disableSwitchToMonthOnDayFocus:o=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:f}=e,d=xi(),h=M.useRef(qRn(!!c,o,d)).current,p=M.useMemo(()=>bl.getInitialReferenceValue({value:t,utils:d,timezone:f,props:e,referenceDate:n,granularity:qd.day}),[n,f]),[g,m]=M.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:p,currentMonth:d.startOfMonth(p),slideDirection:"left"});M.useEffect(()=>{m({type:"changeMonthTimezone",newTimezone:d.getTimezone(p)})},[p,d]);const v=M.useCallback(_=>{m(X({type:"changeMonth"},_)),l&&l(_.newMonth)},[l]),y=M.useCallback(_=>{const E=_;d.isSameMonth(E,g.currentMonth)||v({newMonth:d.startOfMonth(E),direction:d.isAfterDay(E,g.currentMonth)?"left":"right"})},[g.currentMonth,v,d]),b=vrt({shouldDisableDate:u,minDate:a,maxDate:s,disableFuture:r,disablePast:i,timezone:f}),w=M.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),S=ft((_,E)=>{b(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:E})});return{referenceDate:p,calendarState:g,changeMonth:y,changeFocusedDay:S,isDateDisabled:b,onMonthSwitchingAnimationEnd:w,handleChangeMonth:v}},YRn=e=>pt("MuiPickersFadeTransitionGroup",e);dt("MuiPickersFadeTransitionGroup",["root"]);const QRn=e=>{const{classes:t}=e;return Xe({root:["root"]},YRn,t)},KRn=Oe(ZI,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function yrt(e){const t=Ar({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,s=QRn(t),a=is();return i?n:O.jsx(KRn,{className:Re(s.root,r),children:O.jsx(iw,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},o)})}function ZRn(e){return pt("MuiPickersDay",e)}const Dx=dt("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),JRn=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],eIn=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=e,c=s&&!a;return Xe({root:["root",t&&!c&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",s&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},ZRn,l)},brt=({theme:e})=>X({},e.typography.caption,{width:zR,height:zR,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Bt(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Dx.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Dx.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Dx.disabled}:not(.${Dx.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Dx.disabled}&.${Dx.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${vW}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${Dx.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),xrt=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},tIn=Oe(Gf,{name:"MuiPickersDay",slot:"Root",overridesResolver:xrt})(brt),nIn=Oe("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:xrt})(({theme:e})=>X({},brt({theme:e}),{opacity:0,pointerEvents:"none"})),b2=()=>{},rIn=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=b2,onBlur:p=b2,onKeyDown:g=b2,onMouseDown:m=b2,onMouseEnter:v=b2,outsideCurrentMonth:y,selected:b=!1,showDaysOutsideCurrentMonth:w=!1,children:S,today:_=!1}=r,E=it(r,JRn),T=X({},r,{autoFocus:i,disabled:a,disableHighlightToday:l,disableMargin:c,selected:b,showDaysOutsideCurrentMonth:w,today:_}),k=eIn(T),P=xi(),R=M.useRef(null),I=zn(R,n);ar(()=>{i&&!a&&!u&&!y&&R.current.focus()},[i,a,u,y]);const F=L=>{m(L),y&&L.preventDefault()},A=L=>{a||d(s),y&&L.currentTarget.focus(),f&&f(L)};return y&&!w?O.jsx(nIn,{className:Re(k.root,k.hiddenDaySpacingFiller,o),ownerState:T,role:E.role}):O.jsx(tIn,X({className:Re(k.root,o),ref:I,centerRipple:!0,disabled:a,tabIndex:b?0:-1,onKeyDown:L=>g(L,s),onFocus:L=>h(L,s),onBlur:L=>p(L,s),onMouseEnter:L=>v(L,s),onClick:A,onMouseDown:F},E,{ownerState:T,children:S||P.format(s,"dayOfMonth")}))}),iIn=M.memo(rIn),oIn=e=>pt("MuiPickersSlideTransition",e),lf=dt("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),sIn=["children","className","reduceAnimations","slideDirection","transKey","classes"],aIn=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Xe(r,oIn,t)},lIn=Oe(ZI,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${lf["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${lf["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${lf.slideEnterActive}`]:t.slideEnterActive},{[`.${lf.slideExit}`]:t.slideExit},{[`.${lf["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${lf["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${lf["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${lf["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${lf.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${lf.slideExit}`]:{transform:"translate(0%)"},[`& .${lf["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${lf["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function cIn(e){const t=Ar({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,s=it(t,sIn),a=aIn(t),l=is();if(i)return O.jsx("div",{className:Re(a.root,r),children:n});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return O.jsx(lIn,{className:Re(a.root,r),childFactory:u=>M.cloneElement(u,{classNames:c}),role:"presentation",children:O.jsx(Xae,X({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},s,{children:n}),o)})}const uIn=e=>pt("MuiDayCalendar",e);dt("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const fIn=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],dIn=["ownerState"],hIn=e=>{const{classes:t}=e;return Xe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},uIn,t)},wrt=(zR+vW*2)*6,pIn=Oe("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),gIn=Oe("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),mIn=Oe(yn,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),vIn=Oe(yn,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),yIn=Oe(yn,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>X({},e.typography.caption,{width:zR,height:zR,padding:0,margin:`0 ${vW}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),bIn=Oe("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:wrt}),xIn=Oe(cIn,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:wrt}),wIn=Oe("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),SIn=Oe("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${vW}px 0`,display:"flex",justifyContent:"center"});function _In(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:s,isViewFocused:a}=e,l=it(e,fIn);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:d,slots:h,slotProps:p,timezone:g}=t,m=xi(),v=zS(g),y=r!==null&&m.isSameDay(n,r),b=i.some(I=>m.isSameDay(I,n)),w=m.isSameDay(n,v),S=h?.day??iIn,_=Yn({elementType:S,externalSlotProps:p?.day,additionalProps:X({disableHighlightToday:u,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:f,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:X({},t,{day:n,selected:b})}),E=it(_,dIn),T=M.useMemo(()=>c||o(n),[c,o,n]),k=M.useMemo(()=>m.getMonth(n)!==s,[m,n,s]),P=M.useMemo(()=>{const I=m.startOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.startOfWeek(I)):m.isSameDay(n,I)},[s,n,d,m]),R=M.useMemo(()=>{const I=m.endOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.endOfWeek(I)):m.isSameDay(n,I)},[s,n,d,m]);return O.jsx(S,X({},E,{day:n,disabled:T,autoFocus:a&&y,today:w,outsideCurrentMonth:k,isFirstVisibleCell:P,isLastVisibleCell:R,selected:b,tabIndex:y?0:-1,"aria-selected":b,"aria-current":w?"date":void 0}))}function CIn(e){const t=Ar({props:e,name:"MuiDayCalendar"}),n=xi(),{onFocusedDayChange:r,className:i,currentMonth:o,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:f,reduceAnimations:d,renderLoading:h=()=>O.jsx("span",{children:"..."}),slideDirection:p,TransitionProps:g,disablePast:m,disableFuture:v,minDate:y,maxDate:b,shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,dayOfWeekFormatter:E=he=>n.format(he,"weekdayShort").charAt(0).toUpperCase(),hasFocus:T,onFocusedViewChange:k,gridLabelId:P,displayWeekNumber:R,fixedWeekNumber:I,autoFocus:F,timezone:A}=t,L=zS(A),$=hIn(t),j=bi(),V=vrt({shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,minDate:y,maxDate:b,disablePast:m,disableFuture:v,timezone:A}),U=Xc(),[z,N]=Fa({name:"DayCalendar",state:"hasFocus",controlled:T,default:F??!1}),[B,H]=M.useState(()=>a||L),Q=ft(he=>{f||c(he)}),Y=he=>{V(he)||(r(he),H(he),k?.(!0),N(!0))},Z=ft((he,J)=>{switch(he.key){case"ArrowUp":Y(n.addDays(J,-7)),he.preventDefault();break;case"ArrowDown":Y(n.addDays(J,7)),he.preventDefault();break;case"ArrowLeft":{const te=n.addDays(J,j?1:-1),ae=n.addMonths(J,j?1:-1),we=gA({utils:n,date:te,minDate:j?te:n.startOfMonth(ae),maxDate:j?n.endOfMonth(ae):te,isDateDisabled:V,timezone:A});Y(we||te),he.preventDefault();break}case"ArrowRight":{const te=n.addDays(J,j?-1:1),ae=n.addMonths(J,j?-1:1),we=gA({utils:n,date:te,minDate:j?n.startOfMonth(ae):te,maxDate:j?te:n.endOfMonth(ae),isDateDisabled:V,timezone:A});Y(we||te),he.preventDefault();break}case"Home":Y(n.startOfWeek(J)),he.preventDefault();break;case"End":Y(n.endOfWeek(J)),he.preventDefault();break;case"PageUp":Y(n.addMonths(J,1)),he.preventDefault();break;case"PageDown":Y(n.addMonths(J,-1)),he.preventDefault();break}}),pe=ft((he,J)=>Y(J)),ie=ft((he,J)=>{z&&n.isSameDay(B,J)&&k?.(!1)}),ne=n.getMonth(o),fe=n.getYear(o),me=M.useMemo(()=>s.filter(he=>!!he).map(he=>n.startOfDay(he)),[n,s]),se=`${fe}-${ne}`,ue=M.useMemo(()=>M.createRef(),[se]),G=M.useMemo(()=>{const he=n.startOfMonth(o),J=n.endOfMonth(o);return V(B)||n.isAfterDay(B,J)||n.isBeforeDay(B,he)?gA({utils:n,date:B,minDate:he,maxDate:J,disablePast:m,disableFuture:v,isDateDisabled:V,timezone:A}):B},[o,v,m,B,V,n,A]),ce=M.useMemo(()=>{const he=n.getWeekArray(o);let J=n.addMonths(o,1);for(;I&&he.length{he.lengthO.jsx(mIn,{variant:"caption",role:"columnheader","aria-label":n.format(he,"weekday"),className:$.weekDayLabel,children:E(he)},J.toString()))]}),l?O.jsx(bIn,{className:$.loadingContainer,children:h()}):O.jsx(xIn,X({transKey:se,onExited:u,reduceAnimations:d,slideDirection:p,className:Re(i,$.slideTransition)},g,{nodeRef:ue,children:O.jsx(wIn,{ref:ue,role:"rowgroup",className:$.monthContainer,children:ce.map((he,J)=>O.jsxs(SIn,{role:"row",className:$.weekContainer,"aria-rowindex":J+1,children:[R&&O.jsx(yIn,{className:$.weekNumber,role:"rowheader","aria-label":U.calendarWeekNumberAriaLabelText(n.getWeekNumber(he[0])),children:U.calendarWeekNumberText(n.getWeekNumber(he[0]))}),he.map((te,ae)=>O.jsx(_In,{parentProps:t,day:te,selectedDays:me,focusableDay:G,onKeyDown:Z,onFocus:pe,onBlur:ie,onDaySelect:Q,isDateDisabled:V,currentMonthNumber:ne,isViewFocused:z,"aria-colindex":ae+1},te.toString()))]},`week-${he[0]}`))})}))]})}function OIn(e){return pt("MuiPickersMonth",e)}const JN=dt("MuiPickersMonth",["root","monthButton","disabled","selected"]),EIn=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],TIn=e=>{const{disabled:t,selected:n,classes:r}=e;return Xe({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},OIn,r)},PIn=Oe("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),kIn=Oe("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${JN.disabled}`]:t.disabled},{[`&.${JN.selected}`]:t.selected}]})(({theme:e})=>X({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${JN.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${JN.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),MIn=M.memo(function(t){const n=Ar({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,"aria-label":g,slots:m,slotProps:v}=n,y=it(n,EIn),b=M.useRef(null),w=TIn(n);ar(()=>{r&&b.current?.focus()},[r]);const S=m?.monthButton??kIn,_=Yn({elementType:S,externalSlotProps:v?.monthButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:b,type:"button",role:"radio","aria-current":p,"aria-checked":a,"aria-label":g,onClick:E=>u(E,l),onKeyDown:E=>f(E,l),onFocus:E=>d(E,l),onBlur:E=>h(E,l)},ownerState:n,className:w.monthButton});return O.jsx(PIn,X({className:Re(w.root,i),ownerState:n},y,{children:O.jsx(S,X({},_))}))});function AIn(e){return pt("MuiMonthCalendar",e)}dt("MuiMonthCalendar",["root"]);const RIn=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],IIn=e=>{const{classes:t}=e;return Xe({root:["root"]},AIn,t)};function DIn(e,t){const n=xi(),r=UL(),i=Ar({props:e,name:t});return X({disableFuture:!1,disablePast:!1},i,{minDate:rd(n,i.minDate,r.minDate),maxDate:rd(n,i.maxDate,r.maxDate)})}const LIn=Oe("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:yW,boxSizing:"border-box"}),FIn=M.forwardRef(function(t,n){const r=DIn(t,"MuiMonthCalendar"),{className:i,value:o,defaultValue:s,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:g,autoFocus:m=!1,onMonthFocus:v,hasFocus:y,onFocusedViewChange:b,monthsPerRow:w=3,timezone:S,gridLabelId:_,slots:E,slotProps:T}=r,k=it(r,RIn),{value:P,handleValueChange:R,timezone:I}=wP({name:"MonthCalendar",timezone:S,value:o,defaultValue:s,referenceDate:a,onChange:h,valueManager:bl}),F=zS(I),A=bi(),L=xi(),$=M.useMemo(()=>bl.getInitialReferenceValue({value:P,utils:L,props:r,timezone:I,referenceDate:a,granularity:qd.month}),[]),j=r,V=IIn(j),U=M.useMemo(()=>L.getMonth(F),[L,F]),z=M.useMemo(()=>P!=null?L.getMonth(P):null,[P,L]),[N,B]=M.useState(()=>z||L.getMonth($)),[H,Q]=Fa({name:"MonthCalendar",state:"hasFocus",controlled:y,default:m??!1}),Y=ft(se=>{Q(se),b&&b(se)}),Z=M.useCallback(se=>{const ue=L.startOfMonth(u&&L.isAfter(F,d)?F:d),G=L.startOfMonth(c&&L.isBefore(F,f)?F:f),ce=L.startOfMonth(se);return L.isBefore(ce,ue)||L.isAfter(ce,G)?!0:p?p(ce):!1},[c,u,f,d,F,p,L]),pe=ft((se,ue)=>{if(g)return;const G=L.setMonth(P??$,ue);R(G)}),ie=ft(se=>{Z(L.setMonth(P??$,se))||(B(se),Y(!0),v&&v(se))});M.useEffect(()=>{B(se=>z!==null&&se!==z?z:se)},[z]);const ne=ft((se,ue)=>{switch(se.key){case"ArrowUp":ie((12+ue-3)%12),se.preventDefault();break;case"ArrowDown":ie((12+ue+3)%12),se.preventDefault();break;case"ArrowLeft":ie((12+ue+(A?1:-1))%12),se.preventDefault();break;case"ArrowRight":ie((12+ue+(A?-1:1))%12),se.preventDefault();break}}),fe=ft((se,ue)=>{ie(ue)}),me=ft((se,ue)=>{N===ue&&Y(!1)});return O.jsx(LIn,X({ref:n,className:Re(V.root,i),ownerState:j,role:"radiogroup","aria-labelledby":_},k,{children:xme(L,P??$).map(se=>{const ue=L.getMonth(se),G=L.format(se,"monthShort"),ce=L.format(se,"month"),he=ue===z,J=l||Z(se);return O.jsx(MIn,{selected:he,value:ue,onClick:pe,onKeyDown:ne,autoFocus:H&&ue===N,disabled:J,tabIndex:ue===N&&!J?0:-1,onFocus:fe,onBlur:me,"aria-current":U===ue?"date":void 0,"aria-label":ce,monthsPerRow:w,slots:E,slotProps:T,children:G},G)})}))});function $In(e){return pt("MuiPickersYear",e)}const e3=dt("MuiPickersYear",["root","yearButton","selected","disabled"]),NIn=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],zIn=e=>{const{disabled:t,selected:n,classes:r}=e;return Xe({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},$In,r)},jIn=Oe("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),BIn=Oe("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${e3.disabled}`]:t.disabled},{[`&.${e3.selected}`]:t.selected}]})(({theme:e})=>X({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Bt(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${e3.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${e3.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),UIn=M.memo(function(t){const n=Ar({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,slots:g,slotProps:m}=n,v=it(n,NIn),y=M.useRef(null),b=zIn(n);ar(()=>{r&&y.current?.focus()},[r]);const w=g?.yearButton??BIn,S=Yn({elementType:w,externalSlotProps:m?.yearButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:y,type:"button",role:"radio","aria-current":p,"aria-checked":a,onClick:_=>u(_,l),onKeyDown:_=>f(_,l),onFocus:_=>d(_,l),onBlur:_=>h(_,l)},ownerState:n,className:b.yearButton});return O.jsx(jIn,X({className:Re(b.root,i),ownerState:n},v,{children:O.jsx(w,X({},S))}))});function VIn(e){return pt("MuiYearCalendar",e)}dt("MuiYearCalendar",["root"]);const WIn=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],HIn=e=>{const{classes:t}=e;return Xe({root:["root"]},VIn,t)};function GIn(e,t){const n=xi(),r=UL(),i=Ar({props:e,name:t});return X({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:rd(n,i.minDate,r.minDate),maxDate:rd(n,i.maxDate,r.maxDate)})}const qIn=Oe("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:yW,maxHeight:NRn,boxSizing:"border-box",position:"relative"}),XIn=M.forwardRef(function(t,n){const r=GIn(t,"MuiYearCalendar"),{autoFocus:i,className:o,value:s,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onChange:p,readOnly:g,shouldDisableYear:m,onYearFocus:v,hasFocus:y,onFocusedViewChange:b,yearsOrder:w="asc",yearsPerRow:S,timezone:_,gridLabelId:E,slots:T,slotProps:k}=r,P=it(r,WIn),{value:R,handleValueChange:I,timezone:F}=wP({name:"YearCalendar",timezone:_,value:s,defaultValue:a,referenceDate:l,onChange:p,valueManager:bl}),A=zS(F),L=bi(),$=xi(),j=M.useMemo(()=>bl.getInitialReferenceValue({value:R,utils:$,props:r,timezone:F,referenceDate:l,granularity:qd.year}),[]),V=r,U=HIn(V),z=M.useMemo(()=>$.getYear(A),[$,A]),N=M.useMemo(()=>R!=null?$.getYear(R):null,[R,$]),[B,H]=M.useState(()=>N||$.getYear(j)),[Q,Y]=Fa({name:"YearCalendar",state:"hasFocus",controlled:y,default:i??!1}),Z=ft(te=>{Y(te),b&&b(te)}),pe=M.useCallback(te=>{if(f&&$.isBeforeYear(te,A)||u&&$.isAfterYear(te,A)||h&&$.isBeforeYear(te,h)||d&&$.isAfterYear(te,d))return!0;if(!m)return!1;const ae=$.startOfYear(te);return m(ae)},[u,f,d,h,A,m,$]),ie=ft((te,ae)=>{if(g)return;const we=$.setYear(R??j,ae);I(we)}),ne=ft(te=>{pe($.setYear(R??j,te))||(H(te),Z(!0),v?.(te))});M.useEffect(()=>{H(te=>N!==null&&te!==N?N:te)},[N]);const fe=w!=="desc"?S*1:S*-1,me=L&&w==="asc"||!L&&w==="desc"?-1:1,se=ft((te,ae)=>{switch(te.key){case"ArrowUp":ne(ae-fe),te.preventDefault();break;case"ArrowDown":ne(ae+fe),te.preventDefault();break;case"ArrowLeft":ne(ae-me),te.preventDefault();break;case"ArrowRight":ne(ae+me),te.preventDefault();break}}),ue=ft((te,ae)=>{ne(ae)}),G=ft((te,ae)=>{B===ae&&Z(!1)}),ce=M.useRef(null),he=zn(n,ce);M.useEffect(()=>{if(i||ce.current===null)return;const te=ce.current.querySelector('[tabindex="0"]');if(!te)return;const ae=te.offsetHeight,we=te.offsetTop,Pe=ce.current.clientHeight,ee=ce.current.scrollTop,oe=we+ae;ae>Pe||we{const ae=$.getYear(te),we=ae===N,Pe=c||pe(te);return O.jsx(UIn,{selected:we,value:ae,onClick:ie,onKeyDown:se,autoFocus:Q&&ae===B,disabled:Pe,tabIndex:ae===B&&!Pe?0:-1,onFocus:ue,onBlur:G,"aria-current":z===ae?"date":void 0,yearsPerRow:S,slots:T,slotProps:k,children:$.format(te,"year")},$.format(te,"year"))})}))});function VL({onChange:e,onViewChange:t,openTo:n,view:r,views:i,autoFocus:o,focusedView:s,onFocusedViewChange:a}){const l=M.useRef(n),c=M.useRef(i),u=M.useRef(i.includes(n)?n:i[0]),[f,d]=Fa({name:"useViews",state:"view",controlled:r,default:u.current}),h=M.useRef(o?f:null),[p,g]=Fa({name:"useViews",state:"focusedView",controlled:s,default:h.current});M.useEffect(()=>{(l.current&&l.current!==n||c.current&&c.current.some(E=>!i.includes(E)))&&(d(i.includes(n)?n:i[0]),c.current=i,l.current=n)},[n,d,f,i]);const m=i.indexOf(f),v=i[m-1]??null,y=i[m+1]??null,b=ft((E,T)=>{g(T?E:k=>E===k?null:k),a?.(E,T)}),w=ft(E=>{b(E,!0),E!==f&&(d(E),t&&t(E))}),S=ft(()=>{y&&w(y)}),_=ft((E,T,k)=>{const P=T==="finish",R=k?i.indexOf(k)pt("MuiPickersCalendarHeader",e),QIn=dt("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function KIn(e){return pt("MuiPickersArrowSwitcher",e)}dt("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const ZIn=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],JIn=["ownerState"],eDn=["ownerState"],tDn=Oe("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),nDn=Oe("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),$Me=Oe(Mn,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),rDn=e=>{const{classes:t}=e;return Xe({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},KIn,t)},Srt=M.forwardRef(function(t,n){const r=bi(),i=Ar({props:t,name:"MuiPickersArrowSwitcher"}),{children:o,className:s,slots:a,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:f,nextLabel:d,isPreviousDisabled:h,isPreviousHidden:p,onGoToPrevious:g,previousLabel:m,labelId:v}=i,y=it(i,ZIn),b=i,w=rDn(b),S={isDisabled:c,isHidden:u,goTo:f,label:d},_={isDisabled:h,isHidden:p,goTo:g,label:m},E=a?.previousIconButton??$Me,T=Yn({elementType:E,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:_.label,"aria-label":_.label,disabled:_.isDisabled,edge:"end",onClick:_.goTo},ownerState:X({},b,{hidden:_.isHidden}),className:Re(w.button,w.previousIconButton)}),k=a?.nextIconButton??$Me,P=Yn({elementType:k,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:S.label,"aria-label":S.label,disabled:S.isDisabled,edge:"start",onClick:S.goTo},ownerState:X({},b,{hidden:S.isHidden}),className:Re(w.button,w.nextIconButton)}),R=a?.leftArrowIcon??pAn,I=Yn({elementType:R,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:b,className:w.leftArrowIcon}),F=it(I,JIn),A=a?.rightArrowIcon??gAn,L=Yn({elementType:A,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:b,className:w.rightArrowIcon}),$=it(L,eDn);return O.jsxs(tDn,X({ref:n,className:Re(w.root,s),ownerState:b},y,{children:[O.jsx(E,X({},T,{children:r?O.jsx(A,X({},$)):O.jsx(R,X({},F))})),o?O.jsx(yn,{variant:"subtitle1",component:"span",id:v,children:o}):O.jsx(nDn,{className:w.spacer,ownerState:b}),O.jsx(k,X({},P,{children:r?O.jsx(R,X({},F)):O.jsx(A,X({},$))}))]}))}),iDn=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],oDn=["ownerState"],sDn=e=>{const{classes:t}=e;return Xe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},YIn,t)},aDn=Oe("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),lDn=Oe("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>X({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),cDn=Oe("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),uDn=Oe(Mn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${QIn.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),fDn=Oe(hAn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),dDn=M.forwardRef(function(t,n){const r=Xc(),i=xi(),o=Ar({props:t,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onMonthChange:p,onViewChange:g,view:m,reduceAnimations:v,views:y,labelId:b,className:w,timezone:S,format:_=`${i.formats.month} ${i.formats.year}`}=o,E=it(o,iDn),T=o,k=sDn(o),P=s?.switchViewButton??uDn,R=Yn({elementType:P,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(m)},ownerState:T,className:k.switchViewButton}),I=s?.switchViewIcon??fDn,F=Yn({elementType:I,externalSlotProps:a?.switchViewIcon,ownerState:T,className:k.switchViewIcon}),A=it(F,oDn),L=()=>p(i.addMonths(l,1),"left"),$=()=>p(i.addMonths(l,-1),"right"),j=FRn(l,{disableFuture:u,maxDate:d,timezone:S}),V=$Rn(l,{disablePast:f,minDate:h,timezone:S}),U=()=>{if(!(y.length===1||!g||c))if(y.length===2)g(y.find(N=>N!==m)||y[0]);else{const N=y.indexOf(m)!==0?0:1;g(y[N])}};if(y.length===1&&y[0]==="year")return null;const z=i.formatByString(l,_);return O.jsxs(aDn,X({},E,{ownerState:T,className:Re(k.root,w),ref:n,children:[O.jsxs(lDn,{role:"presentation",onClick:U,ownerState:T,"aria-live":"polite",className:k.labelContainer,children:[O.jsx(yrt,{reduceAnimations:v,transKey:z,children:O.jsx(cDn,{id:b,ownerState:T,className:k.label,children:z})}),y.length>1&&!c&&O.jsx(P,X({},R,{children:O.jsx(I,X({},A))}))]}),O.jsx(iw,{in:m==="day",appear:!v,enter:!v,children:O.jsx(Srt,{slots:s,slotProps:a,onGoToPrevious:$,isPreviousDisabled:V,previousLabel:r.previousMonth,onGoToNext:L,isNextDisabled:j,nextLabel:r.nextMonth})})]}))}),xW=Oe("div")({overflow:"hidden",width:yW,maxHeight:bW,display:"flex",flexDirection:"column",margin:"0 auto"}),hDn="@media (prefers-reduced-motion: reduce)",EO=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),NMe=EO&&EO[1]?parseInt(EO[1],10):null,zMe=EO&&EO[2]?parseInt(EO[2],10):null,pDn=NMe&&NMe<10||zMe&&zMe<13||!1,_rt=()=>cle(hDn,{defaultMatches:!1})||pDn,gDn=e=>pt("MuiDateCalendar",e);dt("MuiDateCalendar",["root","viewTransitionContainer"]);const mDn=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],vDn=e=>{const{classes:t}=e;return Xe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},gDn,t)};function yDn(e,t){const n=xi(),r=UL(),i=_rt(),o=Ar({props:e,name:t});return X({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>O.jsx("span",{children:"..."})),minDate:rd(n,o.minDate,r.minDate),maxDate:rd(n,o.maxDate,r.maxDate)})}const bDn=Oe(xW,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:bW}),xDn=Oe(yrt,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),wDn=M.forwardRef(function(t,n){const r=xi(),i=ur(),o=yDn(t,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:c,referenceDate:u,disableFuture:f,disablePast:d,onChange:h,onYearChange:p,onMonthChange:g,reduceAnimations:m,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:b,view:w,views:S,openTo:_,className:E,disabled:T,readOnly:k,minDate:P,maxDate:R,disableHighlightToday:I,focusedView:F,onFocusedViewChange:A,showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:j,slots:V,slotProps:U,loading:z,renderLoading:N,displayWeekNumber:B,yearsOrder:H,yearsPerRow:Q,monthsPerRow:Y,timezone:Z}=o,pe=it(o,mDn),{value:ie,handleValueChange:ne,timezone:fe}=wP({name:"DateCalendar",timezone:Z,value:l,defaultValue:c,referenceDate:u,onChange:h,valueManager:bl}),{view:me,setView:se,focusedView:ue,setFocusedView:G,goToNextView:ce,setValueAndGoToNextView:he}=VL({view:w,views:S,openTo:_,onChange:ne,onViewChange:a,autoFocus:s,focusedView:F,onFocusedViewChange:A}),{referenceDate:J,calendarState:te,changeFocusedDay:ae,changeMonth:we,handleChangeMonth:Pe,isDateDisabled:ee,onMonthSwitchingAnimationEnd:oe}=XRn({value:ie,referenceDate:u,reduceAnimations:m,onMonthChange:g,minDate:P,maxDate:R,shouldDisableDate:v,disablePast:d,disableFuture:f,timezone:fe}),Se=T&&ie||P,ye=T&&ie||R,be=`${i}-grid-label`,ge=ue!==null,xe=V?.calendarHeader??dDn,re=Yn({elementType:xe,externalSlotProps:U?.calendarHeader,additionalProps:{views:S,view:me,currentMonth:te.currentMonth,onViewChange:se,onMonthChange:(Fe,ht)=>Pe({newMonth:Fe,direction:ht}),minDate:Se,maxDate:ye,disabled:T,disablePast:d,disableFuture:f,reduceAnimations:m,timezone:fe,labelId:be},ownerState:o}),Ee=ft(Fe=>{const ht=r.startOfMonth(Fe),gt=r.endOfMonth(Fe),St=ee(Fe)?gA({utils:r,date:Fe,minDate:r.isBefore(P,ht)?ht:P,maxDate:r.isAfter(R,gt)?gt:R,disablePast:d,disableFuture:f,isDateDisabled:ee,timezone:fe}):Fe;St?(he(St,"finish"),g?.(ht)):(ce(),we(ht)),ae(St,!0)}),ke=ft(Fe=>{const ht=r.startOfYear(Fe),gt=r.endOfYear(Fe),St=ee(Fe)?gA({utils:r,date:Fe,minDate:r.isBefore(P,ht)?ht:P,maxDate:r.isAfter(R,gt)?gt:R,disablePast:d,disableFuture:f,isDateDisabled:ee,timezone:fe}):Fe;St?(he(St,"finish"),p?.(St)):(ce(),we(ht)),ae(St,!0)}),je=ft(Fe=>ne(Fe&&x4(r,Fe,ie??J),"finish",me));M.useEffect(()=>{ie!=null&&r.isValid(ie)&&we(ie)},[ie]);const De=o,ze=vDn(De),Je={disablePast:d,disableFuture:f,maxDate:R,minDate:P},mt={disableHighlightToday:I,readOnly:k,disabled:T,timezone:fe,gridLabelId:be,slots:V,slotProps:U},Me=M.useRef(me);M.useEffect(()=>{Me.current!==me&&(ue===Me.current&&G(me,!0),Me.current=me)},[ue,G,me]);const st=M.useMemo(()=>[ie],[ie]);return O.jsxs(bDn,X({ref:n,className:Re(ze.root,E),ownerState:De},pe,{children:[O.jsx(xe,X({},re,{slots:V,slotProps:U})),O.jsx(xDn,{reduceAnimations:m,className:ze.viewTransitionContainer,transKey:me,ownerState:De,children:O.jsxs("div",{children:[me==="year"&&O.jsx(XIn,X({},Je,mt,{value:ie,onChange:ke,shouldDisableYear:b,hasFocus:ge,onFocusedViewChange:Fe=>G("year",Fe),yearsOrder:H,yearsPerRow:Q,referenceDate:J})),me==="month"&&O.jsx(FIn,X({},Je,mt,{hasFocus:ge,className:E,value:ie,onChange:Ee,shouldDisableMonth:y,onFocusedViewChange:Fe=>G("month",Fe),monthsPerRow:Y,referenceDate:J})),me==="day"&&O.jsx(CIn,X({},te,Je,mt,{onMonthSwitchingAnimationEnd:oe,onFocusedDayChange:ae,reduceAnimations:m,selectedDays:st,onSelectedDaysChange:je,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:b,hasFocus:ge,onFocusedViewChange:Fe=>G("day",Fe),showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:j,displayWeekNumber:B,loading:z,renderLoading:N}))]})})]}))}),TO=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:b,monthsPerRow:w,onYearChange:S,yearsOrder:_,yearsPerRow:E,slots:T,slotProps:k,loading:P,renderLoading:R,disableHighlightToday:I,readOnly:F,disabled:A,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:j,autoFocus:V,fixedWeekNumber:U,displayWeekNumber:z,timezone:N})=>O.jsx(wDn,{view:e,onViewChange:t,views:n.filter(NE),focusedView:r&&NE(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:b,monthsPerRow:w,onYearChange:S,yearsOrder:_,yearsPerRow:E,slots:T,slotProps:k,loading:P,renderLoading:R,disableHighlightToday:I,readOnly:F,disabled:A,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:j,autoFocus:V,fixedWeekNumber:U,displayWeekNumber:z,timezone:N});function SDn(e){return pt("MuiPickersPopper",e)}dt("MuiPickersPopper",["root","paper"]);const _Dn=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],CDn=e=>{const{classes:t}=e;return Xe({root:["root"],paper:["paper"]},SDn,t)},ODn=Oe(Sb,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),EDn=Oe(fa,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function TDn(e,t){return t.documentElement.clientWidth{if(!e)return;function l(){o.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),o.current=!1}},[e]);const s=ft(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=ci(i.current);if(!i.current||"clientX"in l&&TDn(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(i.current)>-1:f=!u.documentElement.contains(l.target)||i.current.contains(l.target),!f&&!c&&t(l)}),a=()=>{r.current=!0};return M.useEffect(()=>{if(e){const l=ci(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[e,s]),M.useEffect(()=>{if(e){const l=ci(i.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[e,s]),[i,a,a]}const kDn=M.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:i,children:o,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:c}=e,u=it(e,_Dn),f=X({},i,{placement:r}),d=Yn({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:f});return O.jsx(n,X({},u,d,{onClick:h=>{l(h),d.onClick?.(h)},onTouchStart:h=>{c(h),d.onTouchStart?.(h)},ownerState:f,children:o}))});function MDn(e){const t=Ar({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:i=null,shouldRestoreFocus:o,onBlur:s,onDismiss:a,open:l,role:c,placement:u,slots:f,slotProps:d,reduceAnimations:h}=t;M.useEffect(()=>{function L($){l&&$.key==="Escape"&&a()}return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L)}},[a,l]);const p=M.useRef(null);M.useEffect(()=>{c==="tooltip"||o&&!o()||(l?p.current=Al(document):p.current&&p.current instanceof HTMLElement&&setTimeout(()=>{p.current instanceof HTMLElement&&p.current.focus()}))},[l,c,o]);const[g,m,v]=PDn(l,s??a),y=M.useRef(null),b=zn(y,i),w=zn(b,g),S=t,_=CDn(S),E=_rt(),T=h??E,k=L=>{L.key==="Escape"&&(L.stopPropagation(),a())},P=f?.desktopTransition??T?iw:ow,R=f?.desktopTrapFocus??sle,I=f?.desktopPaper??EDn,F=f?.popper??ODn,A=Yn({elementType:F,externalSlotProps:d?.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:n,placement:u,onKeyDown:k},className:_.root,ownerState:t});return O.jsx(F,X({},A,{children:({TransitionProps:L,placement:$})=>O.jsx(R,X({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},d?.desktopTrapFocus,{children:O.jsx(P,X({},L,d?.desktopTransition,{children:O.jsx(kDn,{PaperComponent:I,ownerState:S,popperPlacement:$,ref:w,onPaperClick:m,onPaperTouchStart:v,paperClasses:_.paper,paperSlotProps:d?.desktopPaper,children:r})}))}))}))}const ADn=({open:e,onOpen:t,onClose:n})=>{const r=M.useRef(typeof e=="boolean").current,[i,o]=M.useState(!1);M.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");o(e)}},[r,e]);const s=M.useCallback(a=>{r||o(a),a&&t&&t(),!a&&n&&n()},[r,t,n]);return{isOpen:i,setIsOpen:s}},RDn=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:i}=e,o=!i&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?o&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?o?!0:n(r.lastPublishedValue):!1},IDn=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=e,s=!i&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?s&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&o?s?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},DDn=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},LDn=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i})=>{const{onAccept:o,onChange:s,value:a,defaultValue:l,closeOnSelect:c=r==="desktop",timezone:u,referenceDate:f}=e,{current:d}=M.useRef(l),{current:h}=M.useRef(a!==void 0),[p,g]=M.useState(u),m=xi(),v=NS(),{isOpen:y,setIsOpen:b}=ADn(e),{timezone:w,value:S,handleValueChange:_}=Ome({timezone:u,value:a,defaultValue:d,referenceDate:f,onChange:s,valueManager:t}),[E,T]=M.useState(()=>{let ne;return S!==void 0?ne=S:d!==void 0?ne=d:ne=t.emptyValue,{draft:ne,lastPublishedValue:ne,lastCommittedValue:ne,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),k=t.getTimezone(m,E.draft);p!==u&&(g(u),u&&k&&u!==k&&T(ne=>X({},ne,{draft:t.setTimezone(m,u,ne.draft)})));const{getValidationErrorForNewValue:P}=rrt({props:e,validator:i,timezone:w,value:E.draft,onError:e.onError}),R=ft(ne=>{const fe={action:ne,dateState:E,hasChanged:he=>!t.areValuesEqual(m,ne.value,he),isControlled:h,closeOnSelect:c},me=RDn(fe),se=IDn(fe),ue=DDn(fe);T(he=>X({},he,{draft:ne.value,lastPublishedValue:me?ne.value:he.lastPublishedValue,lastCommittedValue:se?ne.value:he.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let G=null;const ce=()=>(G||(G={validationError:ne.name==="setValueFromField"?ne.context.validationError:P(ne.value)},ne.name==="setValueFromShortcut"&&(G.shortcut=ne.shortcut)),G);me&&_(ne.value,ce()),se&&o&&o(ne.value,ce()),ue&&b(!1)});if(E.lastControlledValue!==a){const ne=t.areValuesEqual(m,E.draft,S);T(fe=>X({},fe,{lastControlledValue:a},ne?{}:{lastCommittedValue:S,lastPublishedValue:S,draft:S,hasBeenModifiedSinceMount:!0}))}const I=ft(()=>{R({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),F=ft(()=>{R({value:E.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),A=ft(()=>{R({value:E.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),L=ft(()=>{R({value:E.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),$=ft(()=>{R({value:t.getTodayValue(m,w,n),name:"setValueFromAction",pickerAction:"today"})}),j=ft(ne=>{ne.preventDefault(),b(!0)}),V=ft(ne=>{ne?.preventDefault(),b(!1)}),U=ft((ne,fe="partial")=>R({name:"setValueFromView",value:ne,selectionState:fe})),z=ft((ne,fe,me)=>R({name:"setValueFromShortcut",value:ne,changeImportance:fe,shortcut:me})),N=ft((ne,fe)=>R({name:"setValueFromField",value:ne,context:fe})),B={onClear:I,onAccept:F,onDismiss:A,onCancel:L,onSetToday:$,onOpen:j,onClose:V},H={value:E.draft,onChange:N},Q=M.useMemo(()=>t.cleanValue(m,E.draft),[m,t,E.draft]),Y={value:Q,onChange:U,onClose:V,open:y},pe=X({},B,{value:Q,onChange:U,onSelectShortcut:z,isValid:ne=>{const fe=i({adapter:v,value:ne,timezone:w,props:e});return!t.hasError(fe)}}),ie=M.useMemo(()=>({onOpen:j,onClose:V,open:y}),[y,V,j]);return{open:y,fieldProps:H,viewProps:Y,layoutProps:pe,actions:B,contextValue:ie}},FDn=["className","sx"],$Dn=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{const{onChange:s,open:a,onClose:l}=t,{view:c,views:u,openTo:f,onViewChange:d,viewRenderers:h,timezone:p}=e,g=it(e,FDn),{view:m,setView:v,defaultView:y,focusedView:b,setFocusedView:w,setValueAndGoToNextView:S}=VL({view:c,views:u,openTo:f,onChange:s,onViewChange:d,autoFocus:r}),{hasUIView:_,viewModeLookup:E}=M.useMemo(()=>u.reduce((A,L)=>{let $;return h[L]!=null?$="UI":$="field",A.viewModeLookup[L]=$,$==="UI"&&(A.hasUIView=!0),A},{hasUIView:!1,viewModeLookup:{}}),[h,u]),T=M.useMemo(()=>u.reduce((A,L)=>h[L]!=null&&zE(L)?A+1:A,0),[h,u]),k=E[m],P=ft(()=>k==="UI"),[R,I]=M.useState(k==="UI"?m:null);return R!==m&&E[m]==="UI"&&I(m),ar(()=>{k==="field"&&a&&(l(),setTimeout(()=>{o?.current?.setSelectedSections(m),o?.current?.focusField(m)}))},[m]),ar(()=>{if(!a)return;let A=m;k==="field"&&R!=null&&(A=R),A!==y&&E[A]==="UI"&&E[y]==="UI"&&(A=y),A!==m&&v(A),w(A,!0)},[a]),{hasUIView:_,shouldRestoreFocus:P,layoutProps:{views:u,view:R,onViewChange:v},renderCurrentView:()=>{if(R==null)return null;const A=h[R];if(A==null)return null;const L=X({},g,n,t,{views:u,timezone:p,onChange:S,view:R,onViewChange:v,focusedView:b,onFocusedViewChange:w,showViewSwitcher:T>1,timeViewsCount:T});return i?i(h,R,L):A(L)}}};function jMe(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const NDn=(e,t)=>{const[n,r]=M.useState(jMe);return ar(()=>{const o=()=>{r(jMe())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),sAn(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},zDn=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:i}=e,o=NDn(n.views,i),s=bi();return{layoutProps:X({},n,t,{isLandscape:o,isRtl:s,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function jDn(e){const{props:t,pickerValueResponse:n}=e;return M.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const Crt=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const c=LDn({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o}),u=$Dn({props:e,additionalViewProps:i,autoFocusView:s,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:a}),f=zDn({props:e,wrapperVariant:r,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),d=jDn({props:e,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:c.contextValue,ownerState:d}};function Ort(e){return pt("MuiPickersLayout",e)}const Ud=dt("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),BDn=["onAccept","onClear","onCancel","onSetToday","actions"];function UDn(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:i,actions:o}=e,s=it(e,BDn),a=Xc();if(o==null||o.length===0)return null;const l=o?.map(c=>{switch(c){case"clear":return O.jsx(ji,{onClick:n,children:a.clearButtonLabel},c);case"cancel":return O.jsx(ji,{onClick:r,children:a.cancelButtonLabel},c);case"accept":return O.jsx(ji,{onClick:t,children:a.okButtonLabel},c);case"today":return O.jsx(ji,{onClick:i,children:a.todayButtonLabel},c);default:return null}});return O.jsx(Cb,X({},s,{children:l}))}const VDn=["items","changeImportance","isLandscape","onChange","isValid"],WDn=["getValue"];function HDn(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:i}=e,o=it(e,VDn);if(t==null||t.length===0)return null;const s=t.map(a=>{let{getValue:l}=a,c=it(a,WDn);const u=l({isValid:i});return X({},c,{label:c.label,onClick:()=>{r(u,n,c)},disabled:!i(u)})});return O.jsx(tD,X({dense:!0,sx:[{maxHeight:bW,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:s.map(a=>O.jsx(cO,{children:O.jsx(J6,X({},a))},a.id??a.label))}))}function GDn(e){return e.view!==null}const qDn=e=>{const{classes:t,isLandscape:n}=e;return Xe({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},Ort,t)},Ert=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:s,views:a,onViewChange:l,value:c,onChange:u,onSelectShortcut:f,isValid:d,isLandscape:h,disabled:p,readOnly:g,children:m,slots:v,slotProps:y}=e,b=qDn(e),w=v?.actionBar??UDn,S=Yn({elementType:w,externalSlotProps:y?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:t==="desktop"?[]:["cancel","accept"]},className:b.actionBar,ownerState:X({},e,{wrapperVariant:t})}),_=O.jsx(w,X({},S)),E=v?.toolbar,T=Yn({elementType:E,externalSlotProps:y?.toolbar,additionalProps:{isLandscape:h,onChange:u,value:c,view:s,onViewChange:l,views:a,disabled:p,readOnly:g},className:b.toolbar,ownerState:X({},e,{wrapperVariant:t})}),k=GDn(T)&&E?O.jsx(E,X({},T)):null,P=m,R=v?.tabs,I=s&&R?O.jsx(R,X({view:s,onViewChange:l,className:b.tabs},y?.tabs)):null,F=v?.shortcuts??HDn,A=Yn({elementType:F,externalSlotProps:y?.shortcuts,additionalProps:{isValid:d,isLandscape:h,onChange:f},className:b.shortcuts,ownerState:{isValid:d,isLandscape:h,onChange:f,wrapperVariant:t}}),L=s&&F?O.jsx(F,X({},A)):null;return{toolbar:k,content:P,tabs:I,actionBar:_,shortcuts:L}},XDn=e=>{const{isLandscape:t,classes:n}=e;return Xe({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},Ort,n)},Trt=Oe("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${Ud.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${Ud.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${Ud.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${Ud.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${Ud.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${Ud.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${Ud.shortcuts}`]:{gridColumn:3}}}]}),Prt=Oe("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),krt=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiPickersLayout"}),{toolbar:i,content:o,tabs:s,actionBar:a,shortcuts:l}=Ert(r),{sx:c,className:u,isLandscape:f,wrapperVariant:d}=r,h=XDn(r);return O.jsxs(Trt,{ref:n,sx:c,className:Re(h.root,u),ownerState:r,children:[f?l:i,f?i:l,O.jsx(Prt,{className:h.contentWrapper,children:d==="desktop"?O.jsxs(M.Fragment,{children:[o,s]}):O.jsxs(M.Fragment,{children:[s,o]})}),a]})}),YDn=["props","getOpenDialogAriaText"],QDn=["ownerState"],KDn=["ownerState"],ZDn=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=it(e,YDn);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,autoFocus:b,localeText:w,reduceAnimations:S}=t,_=M.useRef(null),E=M.useRef(null),T=ur(),k=o?.toolbar?.hidden??!1,{open:P,actions:R,hasUIView:I,layoutProps:F,renderCurrentView:A,shouldRestoreFocus:L,fieldProps:$,contextValue:j,ownerState:V}=Crt(X({},r,{props:t,fieldRef:E,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),U=i.inputAdornment??ule,z=Yn({elementType:U,externalSlotProps:o?.inputAdornment,additionalProps:{position:"end"},ownerState:t}),N=it(z,QDn),B=i.openPickerButton??Mn,H=Yn({elementType:B,externalSlotProps:o?.openPickerButton,additionalProps:{disabled:y||v,onClick:P?R.onClose:R.onOpen,"aria-label":n($.value),edge:N.position},ownerState:t}),Q=it(H,KDn),Y=i.openPickerIcon,Z=Yn({elementType:Y,externalSlotProps:o?.openPickerIcon,ownerState:V}),pe=i.field,ie=Yn({elementType:pe,externalSlotProps:o?.field,additionalProps:X({},$,k&&{id:T},{readOnly:v,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p,autoFocus:b&&!t.open,focused:P?!0:void 0},m?{inputRef:m}:{}),ownerState:t});I&&(ie.InputProps=X({},ie.InputProps,{ref:_},!t.disableOpenPicker&&{[`${N.position}Adornment`]:O.jsx(U,X({},N,{children:O.jsx(B,X({},Q,{children:O.jsx(Y,X({},Z))}))}))}));const ne=X({textField:i.textField,clearIcon:i.clearIcon,clearButton:i.clearButton},ie.slots),fe=i.layout??krt;let me=T;k&&(g?me=`${T}-label`:me=void 0);const se=X({},o,{toolbar:X({},o?.toolbar,{titleId:T}),popper:X({"aria-labelledby":me},o?.popper)}),ue=zn(E,ie.unstableFieldRef);return{renderPicker:()=>O.jsxs(irt,{contextValue:j,localeText:w,children:[O.jsx(pe,X({},ie,{slots:ne,slotProps:se,unstableFieldRef:ue})),O.jsx(MDn,X({role:"dialog",placement:"bottom-start",anchorEl:_.current},R,{open:P,slots:i,slotProps:se,shouldRestoreFocus:L,reduceAnimations:S,children:O.jsx(fe,X({},F,se?.layout,{slots:i,slotProps:se,children:A()}))}))]})}},JDn=["views","format"],Mrt=(e,t,n)=>{let{views:r,format:i}=t,o=it(t,JDn);if(i)return i;const s=[],a=[];if(r.forEach(u=>{zE(u)?a.push(u):NE(u)&&s.push(u)}),a.length===0)return EMe(e,X({views:s},o));if(s.length===0)return PMe(e,X({views:a},o));const l=PMe(e,X({views:a},o));return`${EMe(e,X({views:s},o))} ${l}`},eLn=(e,t,n)=>n?t.filter(r=>!kM(r)||r==="hours"):e?[...t,"meridiem"]:t,tLn=(e,t)=>1440/((e.hours??1)*(e.minutes??5))<=t;function nLn({thresholdToRenderTimeInASingleColumn:e,ampm:t,timeSteps:n,views:r}){const i=e??24,o=X({hours:1,minutes:5,seconds:5},n),s=tLn(o,i);return{thresholdToRenderTimeInASingleColumn:i,timeSteps:o,shouldRenderTimeInASingleColumn:s,views:eLn(t,r,s)}}function rLn(e){return pt("MuiTimeClock",e)}dt("MuiTimeClock",["root","arrowSwitcher"]);const jE=220,ev=36,jR={x:jE/2,y:jE/2},Art={x:jR.x,y:0},iLn=Art.x-jR.x,oLn=Art.y-jR.y,sLn=e=>e*(180/Math.PI),Rrt=(e,t,n)=>{const r=t-jR.x,i=n-jR.y,o=Math.atan2(iLn,oLn)-Math.atan2(r,i);let s=sLn(o);s=Math.round(s/e)*e,s%=360;const a=Math.floor(s/e)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:a,distance:c}},aLn=(e,t,n=1)=>{const r=n*6;let{value:i}=Rrt(r,e,t);return i=i*n%60,i},lLn=(e,t,n)=>{const{value:r,distance:i}=Rrt(30,e,t);let o=r||12;return n?o%=12:i{const{classes:t}=e;return Xe({root:["root"],thumb:["thumb"]},cLn,t)},dLn=Oe("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:e.transitions.create(["transform","height"])}}]})),hLn=Oe("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({width:4,height:4,backgroundColor:(e.vars||e).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${ev/2}px)`,border:`${(ev-4)/2}px solid ${(e.vars||e).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(e.vars||e).palette.primary.main}}]}));function pLn(e){const t=Ar({props:e,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,viewValue:o}=t,s=it(t,uLn),a=M.useRef(i);M.useEffect(()=>{a.current=i},[i]);const l=X({},t,{shouldAnimate:a.current!==i}),c=fLn(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*jE),transform:`rotateZ(${d}deg)`}};return O.jsx(dLn,X({style:u(),className:Re(c.root,n),ownerState:l},s,{children:O.jsx(hLn,{ownerState:l,className:c.thumb})}))}function gLn(e){return pt("MuiClock",e)}dt("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const mLn=e=>{const{classes:t,meridiemMode:n}=e;return Xe({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",n==="am"&&"selected"],pmButton:["pmButton",n==="pm"&&"selected"],meridiemText:["meridiemText"]},gLn,t)},vLn=Oe("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),yLn=Oe("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),bLn=Oe("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),xLn=Oe("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),wLn=Oe("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),Irt=(e,t)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:ev,variants:[{props:{meridiemMode:t},style:{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:hover":{backgroundColor:(e.vars||e).palette.primary.light}}}]}),SLn=Oe(Mn,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>X({},Irt(e,"am"),{position:"absolute",left:8})),_Ln=Oe(Mn,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>X({},Irt(e,"pm"),{position:"absolute",right:8})),BMe=Oe(yn,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function CLn(e){const t=Ar({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:f,selectedId:d,type:h,viewValue:p,viewRange:[g,m],disabled:v=!1,readOnly:y,className:b}=t,w=t,S=xi(),_=Xc(),E=M.useRef(!1),T=mLn(w),k=l(p,h),P=!n&&h==="hours"&&(p<1||p>12),R=(H,Q)=>{v||y||l(H,h)||f(H,Q)},I=(H,Q)=>{let{offsetX:Y,offsetY:Z}=H;if(Y===void 0){const ie=H.target.getBoundingClientRect();Y=H.changedTouches[0].clientX-ie.left,Z=H.changedTouches[0].clientY-ie.top}const pe=h==="seconds"||h==="minutes"?aLn(Y,Z,u):lLn(Y,Z,!!n);R(pe,Q)},F=H=>{E.current=!0,I(H,"shallow")},A=H=>{E.current&&(I(H,"finish"),E.current=!1),H.preventDefault()},L=H=>{H.buttons>0&&I(H.nativeEvent,"shallow")},$=H=>{E.current&&(E.current=!1),I(H.nativeEvent,"finish")},j=M.useMemo(()=>h==="hours"?!0:p%5===0,[h,p]),V=h==="minutes"?u:1,U=M.useRef(null);ar(()=>{i&&U.current.focus()},[i]);const z=H=>Math.max(g,Math.min(m,H)),N=H=>(H+(m+1))%(m+1),B=H=>{if(!E.current)switch(H.key){case"Home":R(g,"partial"),H.preventDefault();break;case"End":R(m,"partial"),H.preventDefault();break;case"ArrowUp":R(N(p+V),"partial"),H.preventDefault();break;case"ArrowDown":R(N(p-V),"partial"),H.preventDefault();break;case"PageUp":R(z(p+5),"partial"),H.preventDefault();break;case"PageDown":R(z(p-5),"partial"),H.preventDefault();break;case"Enter":case" ":R(p,"finish"),H.preventDefault();break}};return O.jsxs(vLn,{className:Re(T.root,b),children:[O.jsxs(yLn,{className:T.clock,children:[O.jsx(xLn,{onTouchMove:F,onTouchStart:F,onTouchEnd:A,onMouseUp:$,onMouseMove:L,ownerState:{disabled:v},className:T.squareMask}),!k&&O.jsxs(M.Fragment,{children:[O.jsx(wLn,{className:T.pin}),s!=null&&O.jsx(pLn,{type:h,viewValue:p,isInner:P,hasSelected:j})]}),O.jsx(bLn,{"aria-activedescendant":d,"aria-label":_.clockLabelText(h,s,S,s==null?null:S.format(s,"fullTime")),ref:U,role:"listbox",onKeyDown:B,tabIndex:0,className:T.wrapper,children:o})]}),n&&r&&O.jsxs(M.Fragment,{children:[O.jsx(SLn,{onClick:y?void 0:()=>a("am"),disabled:v||c===null,ownerState:w,className:T.amButton,title:zm(S,"am"),children:O.jsx(BMe,{variant:"caption",className:T.meridiemText,children:zm(S,"am")})}),O.jsx(_Ln,{disabled:v||c===null,onClick:y?void 0:()=>a("pm"),ownerState:w,className:T.pmButton,title:zm(S,"pm"),children:O.jsx(BMe,{variant:"caption",className:T.meridiemText,children:zm(S,"pm")})})]})]})}function OLn(e){return pt("MuiClockNumber",e)}const t3=dt("MuiClockNumber",["root","selected","disabled"]),ELn=["className","disabled","index","inner","label","selected"],TLn=e=>{const{classes:t,selected:n,disabled:r}=e;return Xe({root:["root",n&&"selected",r&&"disabled"]},OLn,t)},PLn=Oe("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${t3.disabled}`]:t.disabled},{[`&.${t3.selected}`]:t.selected}]})(({theme:e})=>({height:ev,width:ev,position:"absolute",left:`calc((100% - ${ev}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(e.vars||e).palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:(e.vars||e).palette.background.paper},[`&.${t3.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${t3.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:X({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function Drt(e){const t=Ar({props:e,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:s,selected:a}=t,l=it(t,ELn),c=t,u=TLn(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(jE-ev-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return O.jsx(PLn,X({className:Re(u.root,n),"aria-disabled":r?!0:void 0,"aria-selected":a?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(jE-ev)/2}px`},ownerState:c},l,{children:s}))}const kLn=({ampm:e,value:t,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const s=t?o.getHours(t):null,a=[],l=e?1:0,c=e?12:23,u=f=>s===null?!1:e?f===12?s===12||s===0:s===f||s-12===f:s===f;for(let f=l;f<=c;f+=1){let d=f.toString();f===0&&(d="00");const h=!e&&(f===0||f>12);d=o.formatNumber(d);const p=u(f);a.push(O.jsx(Drt,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return a},UMe=({utils:e,value:t,isDisabled:n,getClockNumberText:r,selectedId:i})=>{const o=e.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([s,a],l)=>{const c=s===t;return O.jsx(Drt,{label:a,id:c?i:void 0,index:l+1,inner:!1,disabled:n(s),selected:c,"aria-label":r(a)},s)})},kme=({value:e,referenceDate:t,utils:n,props:r,timezone:i})=>{const o=M.useMemo(()=>bl.getInitialReferenceValue({value:e,utils:n,props:r,referenceDate:t,granularity:qd.day,timezone:i,getTodayDate:()=>wme(n,i,"date")}),[]);return e??o},MLn=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],ALn=e=>{const{classes:t}=e;return Xe({root:["root"],arrowSwitcher:["arrowSwitcher"]},rLn,t)},RLn=Oe(xW,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),ILn=Oe(Srt,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),DLn=["hours","minutes"],LLn=M.forwardRef(function(t,n){const r=xi(),i=Ar({props:t,name:"MuiTimeClock"}),{ampm:o=r.is12HourCycleInCurrentLocale(),ampmInClock:s=!1,autoFocus:a,slots:l,slotProps:c,value:u,defaultValue:f,referenceDate:d,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:p,minTime:g,disableFuture:m,disablePast:v,minutesStep:y=1,shouldDisableTime:b,showViewSwitcher:w,onChange:S,view:_,views:E=DLn,openTo:T,onViewChange:k,focusedView:P,onFocusedViewChange:R,className:I,disabled:F,readOnly:A,timezone:L}=i,$=it(i,MLn),{value:j,handleValueChange:V,timezone:U}=wP({name:"TimeClock",timezone:L,value:u,defaultValue:f,referenceDate:d,onChange:S,valueManager:bl}),z=kme({value:j,referenceDate:d,utils:r,props:i,timezone:U}),N=Xc(),B=zS(U),{view:H,setView:Q,previousView:Y,nextView:Z,setValueAndGoToNextView:pe}=VL({view:_,views:E,openTo:T,onViewChange:k,onChange:V,focusedView:P,onFocusedViewChange:R}),{meridiemMode:ie,handleMeridiemChange:ne}=Pme(z,o,pe),fe=M.useCallback((ce,he)=>{const J=BL(h,r),te=he==="hours"||he==="minutes"&&E.includes("seconds"),ae=({start:Pe,end:ee})=>!(g&&J(g,ee)||p&&J(Pe,p)||m&&J(Pe,B)||v&&J(B,te?ee:Pe)),we=(Pe,ee=1)=>{if(Pe%ee!==0)return!1;if(b)switch(he){case"hours":return!b(r.setHours(z,Pe),"hours");case"minutes":return!b(r.setMinutes(z,Pe),"minutes");case"seconds":return!b(r.setSeconds(z,Pe),"seconds");default:return!1}return!0};switch(he){case"hours":{const Pe=NR(ce,ie,o),ee=r.setHours(z,Pe);if(r.getHours(ee)!==Pe)return!0;const oe=r.setSeconds(r.setMinutes(ee,0),0),Se=r.setSeconds(r.setMinutes(ee,59),59);return!ae({start:oe,end:Se})||!we(Pe)}case"minutes":{const Pe=r.setMinutes(z,ce),ee=r.setSeconds(Pe,0),oe=r.setSeconds(Pe,59);return!ae({start:ee,end:oe})||!we(ce,y)}case"seconds":{const Pe=r.setSeconds(z,ce);return!ae({start:Pe,end:Pe})||!we(ce)}default:throw new Error("not supported")}},[o,z,h,p,ie,g,y,b,r,m,v,B,E]),me=ur(),se=M.useMemo(()=>{switch(H){case"hours":{const ce=(te,ae)=>{const we=NR(te,ie,o);pe(r.setHours(z,we),ae,"hours")},he=r.getHours(z);let J;return o?he>12?J=[12,23]:J=[0,11]:J=[0,23],{onChange:ce,viewValue:he,children:kLn({value:j,utils:r,ampm:o,getClockNumberText:N.hoursClockNumberText,isDisabled:te=>F||fe(te,"hours"),selectedId:me}),viewRange:J}}case"minutes":{const ce=r.getMinutes(z);return{viewValue:ce,onChange:(J,te)=>{pe(r.setMinutes(z,J),te,"minutes")},children:UMe({utils:r,value:ce,getClockNumberText:N.minutesClockNumberText,isDisabled:J=>F||fe(J,"minutes"),selectedId:me}),viewRange:[0,59]}}case"seconds":{const ce=r.getSeconds(z);return{viewValue:ce,onChange:(J,te)=>{pe(r.setSeconds(z,J),te,"seconds")},children:UMe({utils:r,value:ce,getClockNumberText:N.secondsClockNumberText,isDisabled:J=>F||fe(J,"seconds"),selectedId:me}),viewRange:[0,59]}}default:throw new Error("You must provide the type for ClockView")}},[H,r,j,o,N.hoursClockNumberText,N.minutesClockNumberText,N.secondsClockNumberText,ie,pe,z,fe,me,F]),ue=i,G=ALn(ue);return O.jsxs(RLn,X({ref:n,className:Re(G.root,I),ownerState:ue},$,{children:[O.jsx(CLn,X({autoFocus:a??!!P,ampmInClock:s&&E.includes("hours"),value:j,type:H,ampm:o,minutesStep:y,isTimeDisabled:fe,meridiemMode:ie,handleMeridiemChange:ne,selectedId:me,disabled:F,readOnly:A},se)),w&&O.jsx(ILn,{className:G.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>Q(Y),isPreviousDisabled:!Y,previousLabel:N.openPreviousView,onGoToNext:()=>Q(Z),isNextDisabled:!Z,nextLabel:N.openNextView,ownerState:ue})]}))});function FLn(e){return pt("MuiDigitalClock",e)}const $Ln=dt("MuiDigitalClock",["root","list","item"]),NLn=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],zLn=e=>{const{classes:t}=e;return Xe({root:["root"],list:["list"],item:["item"]},FLn,t)},jLn=Oe(xW,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(e,t)=>t.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:grt,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),BLn=Oe(nS,{name:"MuiDigitalClock",slot:"List",overridesResolver:(e,t)=>t.list})({padding:0}),ULn=Oe(tr,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(e,t)=>t.item})(({theme:e})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.primary.main,e.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Bt(e.palette.primary.main,e.palette.action.focusOpacity)}})),VLn=M.forwardRef(function(t,n){const r=xi(),i=M.useRef(null),o=zn(n,i),s=M.useRef(null),a=Ar({props:t,name:"MuiDigitalClock"}),{ampm:l=r.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:f,slotProps:d,value:h,defaultValue:p,referenceDate:g,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:v,minTime:y,disableFuture:b,disablePast:w,minutesStep:S=1,shouldDisableTime:_,onChange:E,view:T,openTo:k,onViewChange:P,focusedView:R,onFocusedViewChange:I,className:F,disabled:A,readOnly:L,views:$=["hours"],skipDisabled:j=!1,timezone:V}=a,U=it(a,NLn),{value:z,handleValueChange:N,timezone:B}=wP({name:"DigitalClock",timezone:V,value:h,defaultValue:p,referenceDate:g,onChange:E,valueManager:bl}),H=Xc(),Q=zS(B),Y=M.useMemo(()=>X({},a,{alreadyRendered:!!i.current}),[a]),Z=zLn(Y),pe=f?.digitalClockItem??ULn,ie=Yn({elementType:pe,externalSlotProps:d?.digitalClockItem,ownerState:{},className:Z.item}),ne=kme({value:z,referenceDate:g,utils:r,props:a,timezone:B}),fe=ft(J=>N(J,"finish","hours")),{setValueAndGoToNextView:me}=VL({view:T,views:$,openTo:k,onViewChange:P,onChange:fe,focusedView:R,onFocusedViewChange:I}),se=ft(J=>{me(J,"finish")});M.useEffect(()=>{if(i.current===null)return;const J=i.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!J)return;const te=J.offsetTop;(u||R)&&J.focus(),i.current.scrollTop=te-4});const ue=M.useCallback(J=>{const te=BL(m,r),ae=()=>!(y&&te(y,J)||v&&te(J,v)||b&&te(J,Q)||w&&te(Q,J)),we=()=>r.getMinutes(J)%S!==0?!1:_?!_(J,"hours"):!0;return!ae()||!we()},[m,r,y,v,b,Q,w,S,_]),G=M.useMemo(()=>{const J=[];let ae=r.startOfDay(ne);for(;r.isSameDay(ne,ae);)J.push(ae),ae=r.addMinutes(ae,c);return J},[ne,c,r]),ce=G.findIndex(J=>r.isEqual(J,ne)),he=J=>{switch(J.key){case"PageUp":{const te=w4(s.current)-5,ae=s.current.children,we=Math.max(0,te),Pe=ae[we];Pe&&Pe.focus(),J.preventDefault();break}case"PageDown":{const te=w4(s.current)+5,ae=s.current.children,we=Math.min(ae.length-1,te),Pe=ae[we];Pe&&Pe.focus(),J.preventDefault();break}}};return O.jsx(jLn,X({ref:o,className:Re(Z.root,F),ownerState:Y},U,{children:O.jsx(BLn,{ref:s,role:"listbox","aria-label":H.timePickerToolbarTitle,className:Z.list,onKeyDown:he,children:G.map((J,te)=>{if(j&&ue(J))return null;const ae=r.isEqual(J,z),we=r.format(J,l?"fullTime12h":"fullTime24h"),Pe=ce===te||ce===-1&&te===0?0:-1;return O.jsx(pe,X({onClick:()=>!L&&se(J),selected:ae,disabled:A||ue(J),disableRipple:L,role:"option","aria-disabled":L,"aria-selected":ae,tabIndex:Pe},ie,{children:we}),`${J.valueOf()}-${we}`)})})}))});function WLn(e){return pt("MuiMultiSectionDigitalClock",e)}const VMe=dt("MuiMultiSectionDigitalClock",["root"]);function HLn(e){return pt("MuiMultiSectionDigitalClockSection",e)}const GLn=dt("MuiMultiSectionDigitalClockSection",["root","item"]),qLn=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],XLn=e=>{const{classes:t}=e;return Xe({root:["root"],item:["item"]},HLn,t)},YLn=Oe(nS,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({maxHeight:grt,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),QLn=Oe(tr,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(e,t)=>t.item})(({theme:e})=>({padding:8,margin:"2px 4px",width:MM,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Bt(e.palette.primary.main,e.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Bt(e.palette.primary.main,e.palette.action.focusOpacity)}})),KLn=M.forwardRef(function(t,n){const r=M.useRef(null),i=zn(n,r),o=M.useRef(null),s=Ar({props:t,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:a,onChange:l,className:c,disabled:u,readOnly:f,items:d,active:h,slots:p,slotProps:g,skipDisabled:m}=s,v=it(s,qLn),y=M.useMemo(()=>X({},s,{alreadyRendered:!!r.current}),[s]),b=XLn(y),w=p?.digitalClockSectionItem??QLn;M.useEffect(()=>{if(r.current===null)return;const E=r.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(h&&a&&E&&E.focus(),!E||o.current===E)return;o.current=E;const T=E.offsetTop;r.current.scrollTop=T-4});const S=d.findIndex(E=>E.isFocused(E.value)),_=E=>{switch(E.key){case"PageUp":{const T=w4(r.current)-5,k=r.current.children,P=Math.max(0,T),R=k[P];R&&R.focus(),E.preventDefault();break}case"PageDown":{const T=w4(r.current)+5,k=r.current.children,P=Math.min(k.length-1,T),R=k[P];R&&R.focus(),E.preventDefault();break}}};return O.jsx(YLn,X({ref:i,className:Re(b.root,c),ownerState:y,autoFocusItem:a&&h,role:"listbox",onKeyDown:_},v,{children:d.map((E,T)=>{const k=E.isDisabled?.(E.value),P=u||k;if(m&&P)return null;const R=E.isSelected(E.value),I=S===T||S===-1&&T===0?0:-1;return O.jsx(w,X({onClick:()=>!f&&l(E.value),selected:R,disabled:P,disableRipple:f,role:"option","aria-disabled":f||P||void 0,"aria-label":E.ariaLabel,"aria-selected":R,tabIndex:I,className:b.item},g?.digitalClockSectionItem,{children:E.label}),E.label)})}))}),ZLn=({now:e,value:t,utils:n,ampm:r,isDisabled:i,resolveAriaLabel:o,timeStep:s,valueOrReferenceDate:a})=>{const l=t?n.getHours(t):null,c=[],u=(h,p)=>{const g=p??l;return g===null?!1:r?h===12?g===12||g===0:g===h||g-12===h:g===h},f=h=>u(h,n.getHours(a)),d=r?11:23;for(let h=0;h<=d;h+=s){let p=n.format(n.setHours(e,h),r?"hours12h":"hours24h");const g=o(parseInt(p,10).toString());p=n.formatNumber(p),c.push({value:h,label:p,isSelected:u,isDisabled:i,isFocused:f,ariaLabel:g})}return c},WMe=({value:e,utils:t,isDisabled:n,timeStep:r,resolveLabel:i,resolveAriaLabel:o,hasValue:s=!0})=>{const a=c=>e===null?!1:s&&e===c,l=c=>e===c;return[...Array.from({length:Math.ceil(60/r)},(c,u)=>{const f=r*u;return{value:f,label:t.formatNumber(i(f)),isDisabled:n,isSelected:a,isFocused:l,ariaLabel:o(f.toString())}})]},JLn=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],eFn=e=>{const{classes:t}=e;return Xe({root:["root"]},WLn,t)},tFn=Oe(xW,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(e.vars||e).palette.divider}`})),nFn=M.forwardRef(function(t,n){const r=xi(),i=bi(),o=Ar({props:t,name:"MuiMultiSectionDigitalClock"}),{ampm:s=r.is12HourCycleInCurrentLocale(),timeSteps:a,autoFocus:l,slots:c,slotProps:u,value:f,defaultValue:d,referenceDate:h,disableIgnoringDatePartForTimeValidation:p=!1,maxTime:g,minTime:m,disableFuture:v,disablePast:y,minutesStep:b=1,shouldDisableTime:w,onChange:S,view:_,views:E=["hours","minutes"],openTo:T,onViewChange:k,focusedView:P,onFocusedViewChange:R,className:I,disabled:F,readOnly:A,skipDisabled:L=!1,timezone:$}=o,j=it(o,JLn),{value:V,handleValueChange:U,timezone:z}=wP({name:"MultiSectionDigitalClock",timezone:$,value:f,defaultValue:d,referenceDate:h,onChange:S,valueManager:bl}),N=Xc(),B=zS(z),H=M.useMemo(()=>X({hours:1,minutes:5,seconds:5},a),[a]),Q=kme({value:V,referenceDate:h,utils:r,props:o,timezone:z}),Y=ft((ae,we,Pe)=>U(ae,we,Pe)),Z=M.useMemo(()=>!s||!E.includes("hours")||E.includes("meridiem")?E:[...E,"meridiem"],[s,E]),{view:pe,setValueAndGoToNextView:ie,focusedView:ne}=VL({view:_,views:Z,openTo:T,onViewChange:k,onChange:Y,focusedView:P,onFocusedViewChange:R}),fe=ft(ae=>{ie(ae,"finish","meridiem")}),{meridiemMode:me,handleMeridiemChange:se}=Pme(Q,s,fe,"finish"),ue=M.useCallback((ae,we)=>{const Pe=BL(p,r),ee=we==="hours"||we==="minutes"&&Z.includes("seconds"),oe=({start:ye,end:be})=>!(m&&Pe(m,be)||g&&Pe(ye,g)||v&&Pe(ye,B)||y&&Pe(B,ee?be:ye)),Se=(ye,be=1)=>{if(ye%be!==0)return!1;if(w)switch(we){case"hours":return!w(r.setHours(Q,ye),"hours");case"minutes":return!w(r.setMinutes(Q,ye),"minutes");case"seconds":return!w(r.setSeconds(Q,ye),"seconds");default:return!1}return!0};switch(we){case"hours":{const ye=NR(ae,me,s),be=r.setHours(Q,ye);if(r.getHours(be)!==ye)return!0;const ge=r.setSeconds(r.setMinutes(be,0),0),xe=r.setSeconds(r.setMinutes(be,59),59);return!oe({start:ge,end:xe})||!Se(ye)}case"minutes":{const ye=r.setMinutes(Q,ae),be=r.setSeconds(ye,0),ge=r.setSeconds(ye,59);return!oe({start:be,end:ge})||!Se(ae,b)}case"seconds":{const ye=r.setSeconds(Q,ae);return!oe({start:ye,end:ye})||!Se(ae)}default:throw new Error("not supported")}},[s,Q,p,g,me,m,b,w,r,v,y,B,Z]),G=M.useCallback(ae=>{switch(ae){case"hours":return{onChange:we=>{const Pe=NR(we,me,s);ie(r.setHours(Q,Pe),"finish","hours")},items:ZLn({now:B,value:V,ampm:s,utils:r,isDisabled:we=>ue(we,"hours"),timeStep:H.hours,resolveAriaLabel:N.hoursClockNumberText,valueOrReferenceDate:Q})};case"minutes":return{onChange:we=>{ie(r.setMinutes(Q,we),"finish","minutes")},items:WMe({value:r.getMinutes(Q),utils:r,isDisabled:we=>ue(we,"minutes"),resolveLabel:we=>r.format(r.setMinutes(B,we),"minutes"),timeStep:H.minutes,hasValue:!!V,resolveAriaLabel:N.minutesClockNumberText})};case"seconds":return{onChange:we=>{ie(r.setSeconds(Q,we),"finish","seconds")},items:WMe({value:r.getSeconds(Q),utils:r,isDisabled:we=>ue(we,"seconds"),resolveLabel:we=>r.format(r.setSeconds(B,we),"seconds"),timeStep:H.seconds,hasValue:!!V,resolveAriaLabel:N.secondsClockNumberText})};case"meridiem":{const we=zm(r,"am"),Pe=zm(r,"pm");return{onChange:se,items:[{value:"am",label:we,isSelected:()=>!!V&&me==="am",isFocused:()=>!!Q&&me==="am",ariaLabel:we},{value:"pm",label:Pe,isSelected:()=>!!V&&me==="pm",isFocused:()=>!!Q&&me==="pm",ariaLabel:Pe}]}}default:throw new Error(`Unknown view: ${ae} found.`)}},[B,V,s,r,H.hours,H.minutes,H.seconds,N.hoursClockNumberText,N.minutesClockNumberText,N.secondsClockNumberText,me,ie,Q,ue,se]),ce=M.useMemo(()=>{if(!i)return Z;const ae=Z.filter(we=>we!=="meridiem");return ae.reverse(),Z.includes("meridiem")&&ae.push("meridiem"),ae},[i,Z]),he=M.useMemo(()=>Z.reduce((ae,we)=>X({},ae,{[we]:G(we)}),{}),[Z,G]),J=o,te=eFn(J);return O.jsx(tFn,X({ref:n,className:Re(te.root,I),ownerState:J,role:"group"},j,{children:ce.map(ae=>O.jsx(KLn,{items:he[ae].items,onChange:he[ae].onChange,active:pe===ae,autoFocus:l||ne===ae,disabled:F,readOnly:A,slots:c,slotProps:u,skipDisabled:L,"aria-label":N.selectViewText(ae)},ae))}))}),yY=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:b,slotProps:w,readOnly:S,disabled:_,sx:E,autoFocus:T,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:P,timezone:R})=>O.jsx(LLn,{view:e,onViewChange:t,focusedView:n&&zE(n)?n:null,onFocusedViewChange:r,views:i.filter(zE),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:b,slotProps:w,readOnly:S,disabled:_,sx:E,autoFocus:T,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:P,timezone:R}),rFn=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:k,skipDisabled:P,timezone:R})=>O.jsx(VLn,{view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i.filter(zE),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeStep:k?.minutes,skipDisabled:P,timezone:R}),HMe=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:k,skipDisabled:P,timezone:R})=>O.jsx(nFn,{view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i.filter(zE),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:k,skipDisabled:P,timezone:R}),iFn=M.forwardRef(function(t,n){const r=bi(),{toolbar:i,tabs:o,content:s,actionBar:a,shortcuts:l}=Ert(t),{sx:c,className:u,isLandscape:f,classes:d}=t,h=a&&(a.props.actions?.length??0)>0,p=X({},t,{isRtl:r});return O.jsxs(Trt,{ref:n,className:Re(Ud.root,d?.root,u),sx:[{[`& .${Ud.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${Ud.actionBar}`]:{gridRow:5}},...Array.isArray(c)?c:[c]],ownerState:p,children:[f?l:i,f?i:l,O.jsxs(Prt,{className:Re(Ud.contentWrapper,d?.contentWrapper),sx:{display:"grid"},children:[s,o,h&&O.jsx(oa,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),a]})}),oFn=["openTo","focusedView","timeViewsCount"],sFn=function(t,n,r){const{openTo:i,focusedView:o,timeViewsCount:s}=r,a=it(r,oFn),l=X({},a,{autoFocus:!1,focusedView:null,sx:[{[`&.${VMe.root}`]:{borderBottom:0},[`&.${VMe.root}, .${GLn.root}, &.${$Ln.root}`]:{maxHeight:bW}}]}),c=kM(n);return O.jsxs(M.Fragment,{children:[t[c?"day":n]?.(X({},r,{view:c?"day":n,focusedView:o&&NE(o)?o:null,views:r.views.filter(NE),sx:[{gridColumn:1},...l.sx]})),s>0&&O.jsxs(M.Fragment,{children:[O.jsx(oa,{orientation:"vertical",sx:{gridColumn:2}}),t[c?n:"hours"]?.(X({},l,{view:c?n:"hours",focusedView:o&&kM(o)?o:null,openTo:kM(i)?i:"hours",views:r.views.filter(kM),sx:[{gridColumn:3},...l.sx]}))]})]})},Lrt=M.forwardRef(function(t,n){const r=Xc(),i=xi(),o=mrt(t,"MuiDesktopDateTimePicker"),{shouldRenderTimeInASingleColumn:s,thresholdToRenderTimeInASingleColumn:a,views:l,timeSteps:c}=nLn(o),u=s?rFn:HMe,f=X({day:TO,month:TO,year:TO,hours:u,minutes:u,seconds:u,meridiem:u},o.viewRenderers),d=o.ampmInClock??!0,p=f.hours?.name===HMe.name?l:l.filter(y=>y!=="meridiem"),g=s?[]:["accept"],m=X({},o,{viewRenderers:f,format:Mrt(i,o),views:p,yearsPerRow:o.yearsPerRow??4,ampmInClock:d,timeSteps:c,thresholdToRenderTimeInASingleColumn:a,shouldRenderTimeInASingleColumn:s,slots:X({field:drt,layout:iFn,openPickerIcon:mAn},o.slots),slotProps:X({},o.slotProps,{field:y=>X({},IA(o.slotProps?.field,y),ert(o),{ref:n}),toolbar:X({hidden:!0,ampmInClock:d,toolbarVariant:"desktop"},o.slotProps?.toolbar),tabs:X({hidden:!0},o.slotProps?.tabs),actionBar:y=>X({actions:g},IA(o.slotProps?.actionBar,y))})}),{renderPicker:v}=ZDn({props:m,valueManager:bl,valueType:"date-time",getOpenDialogAriaText:trt({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:m.localeText?.openDatePickerDialogue}),validator:gW,rendererInterceptor:sFn});return v()});Lrt.propTypes={ampm:le.bool,ampmInClock:le.bool,autoFocus:le.bool,className:le.string,closeOnSelect:le.bool,dayOfWeekFormatter:le.func,defaultValue:le.object,disabled:le.bool,disableFuture:le.bool,disableHighlightToday:le.bool,disableIgnoringDatePartForTimeValidation:le.bool,disableOpenPicker:le.bool,disablePast:le.bool,displayWeekNumber:le.bool,enableAccessibleFieldDOMStructure:le.any,fixedWeekNumber:le.number,format:le.string,formatDensity:le.oneOf(["dense","spacious"]),inputRef:lje,label:le.node,loading:le.bool,localeText:le.object,maxDate:le.object,maxDateTime:le.object,maxTime:le.object,minDate:le.object,minDateTime:le.object,minTime:le.object,minutesStep:le.number,monthsPerRow:le.oneOf([3,4]),name:le.string,onAccept:le.func,onChange:le.func,onClose:le.func,onError:le.func,onMonthChange:le.func,onOpen:le.func,onSelectedSectionsChange:le.func,onViewChange:le.func,onYearChange:le.func,open:le.bool,openTo:le.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:le.oneOf(["landscape","portrait"]),readOnly:le.bool,reduceAnimations:le.bool,referenceDate:le.object,renderLoading:le.func,selectedSections:le.oneOfType([le.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),le.number]),shouldDisableDate:le.func,shouldDisableMonth:le.func,shouldDisableTime:le.func,shouldDisableYear:le.func,showDaysOutsideCurrentMonth:le.bool,skipDisabled:le.bool,slotProps:le.object,slots:le.object,sx:le.oneOfType([le.arrayOf(le.oneOfType([le.func,le.object,le.bool])),le.func,le.object]),thresholdToRenderTimeInASingleColumn:le.number,timeSteps:le.shape({hours:le.number,minutes:le.number,seconds:le.number}),timezone:le.string,value:le.object,view:le.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:le.shape({day:le.func,hours:le.func,meridiem:le.func,minutes:le.func,month:le.func,seconds:le.func,year:le.func}),views:le.arrayOf(le.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:le.oneOf(["asc","desc"]),yearsPerRow:le.oneOf([3,4])};const aFn=Oe(Gu)({[`& .${WM.container}`]:{outline:0},[`& .${WM.paper}`]:{outline:0,minWidth:yW}}),lFn=Oe(Nc)({"&:first-of-type":{padding:0}});function cFn(e){const{children:t,onDismiss:n,open:r,slots:i,slotProps:o}=e,s=i?.dialog??aFn,a=i?.mobileTransition??iw;return O.jsx(s,X({open:r,onClose:n},o?.dialog,{TransitionComponent:a,TransitionProps:o?.mobileTransition,PaperComponent:i?.mobilePaper,PaperProps:o?.mobilePaper,children:O.jsx(lFn,{children:t})}))}const uFn=["props","getOpenDialogAriaText"],fFn=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=it(e,uFn);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,localeText:b}=t,w=M.useRef(null),S=ur(),_=o?.toolbar?.hidden??!1,{open:E,actions:T,layoutProps:k,renderCurrentView:P,fieldProps:R,contextValue:I}=Crt(X({},r,{props:t,fieldRef:w,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),F=i.field,A=Yn({elementType:F,externalSlotProps:o?.field,additionalProps:X({},R,_&&{id:S},!(y||v)&&{onClick:T.onOpen,onKeyDown:aAn(T.onOpen)},{readOnly:v??!0,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p},m?{inputRef:m}:{}),ownerState:t});A.inputProps=X({},A.inputProps,{"aria-label":n(R.value)});const L=X({textField:i.textField},A.slots),$=i.layout??krt;let j=S;_&&(g?j=`${S}-label`:j=void 0);const V=X({},o,{toolbar:X({},o?.toolbar,{titleId:S}),mobilePaper:X({"aria-labelledby":j},o?.mobilePaper)}),U=zn(w,A.unstableFieldRef);return{renderPicker:()=>O.jsxs(irt,{contextValue:I,localeText:b,children:[O.jsx(F,X({},A,{slots:L,slotProps:V,unstableFieldRef:U})),O.jsx(cFn,X({},T,{open:E,slots:i,slotProps:V,children:O.jsx($,X({},k,V?.layout,{slots:i,slotProps:V,children:P()}))}))]})}},Frt=M.forwardRef(function(t,n){const r=Xc(),i=xi(),o=mrt(t,"MuiMobileDateTimePicker"),s=X({day:TO,month:TO,year:TO,hours:yY,minutes:yY,seconds:yY},o.viewRenderers),a=o.ampmInClock??!1,l=X({},o,{viewRenderers:s,format:Mrt(i,o),ampmInClock:a,slots:X({field:drt},o.slots),slotProps:X({},o.slotProps,{field:u=>X({},IA(o.slotProps?.field,u),ert(o),{ref:n}),toolbar:X({hidden:!1,ampmInClock:a},o.slotProps?.toolbar),tabs:X({hidden:!1},o.slotProps?.tabs)})}),{renderPicker:c}=fFn({props:l,valueManager:bl,valueType:"date-time",getOpenDialogAriaText:trt({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:l.localeText?.openDatePickerDialogue}),validator:gW});return c()});Frt.propTypes={ampm:le.bool,ampmInClock:le.bool,autoFocus:le.bool,className:le.string,closeOnSelect:le.bool,dayOfWeekFormatter:le.func,defaultValue:le.object,disabled:le.bool,disableFuture:le.bool,disableHighlightToday:le.bool,disableIgnoringDatePartForTimeValidation:le.bool,disableOpenPicker:le.bool,disablePast:le.bool,displayWeekNumber:le.bool,enableAccessibleFieldDOMStructure:le.any,fixedWeekNumber:le.number,format:le.string,formatDensity:le.oneOf(["dense","spacious"]),inputRef:lje,label:le.node,loading:le.bool,localeText:le.object,maxDate:le.object,maxDateTime:le.object,maxTime:le.object,minDate:le.object,minDateTime:le.object,minTime:le.object,minutesStep:le.number,monthsPerRow:le.oneOf([3,4]),name:le.string,onAccept:le.func,onChange:le.func,onClose:le.func,onError:le.func,onMonthChange:le.func,onOpen:le.func,onSelectedSectionsChange:le.func,onViewChange:le.func,onYearChange:le.func,open:le.bool,openTo:le.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:le.oneOf(["landscape","portrait"]),readOnly:le.bool,reduceAnimations:le.bool,referenceDate:le.object,renderLoading:le.func,selectedSections:le.oneOfType([le.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),le.number]),shouldDisableDate:le.func,shouldDisableMonth:le.func,shouldDisableTime:le.func,shouldDisableYear:le.func,showDaysOutsideCurrentMonth:le.bool,slotProps:le.object,slots:le.object,sx:le.oneOfType([le.arrayOf(le.oneOfType([le.func,le.object,le.bool])),le.func,le.object]),timezone:le.string,value:le.object,view:le.oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:le.shape({day:le.func,hours:le.func,minutes:le.func,month:le.func,seconds:le.func,year:le.func}),views:le.arrayOf(le.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:le.oneOf(["asc","desc"]),yearsPerRow:le.oneOf([3,4])};const dFn=["desktopModeMediaQuery"],hFn=M.forwardRef(function(t,n){const r=Ar({props:t,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i=lAn}=r,o=it(r,dFn);return cle(i,{defaultMatches:!0})?O.jsx(Lrt,X({ref:n},o)):O.jsx(Frt,X({ref:n},o))}),pFn=e=>({dateTimePicker:{marginTop:e.spacing(2)}}),gFn=({classes:e,hasTimeDimension:t,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?sPt(d):null)},s=O.jsx(_v,{shrink:!0,htmlFor:"time-select",children:`${Ce.get("Time")} (UTC)`}),l=typeof n=="number"?_9(n):null;let c,u;Array.isArray(r)&&(c=_9(r[0]),u=_9(r[1]));const f=O.jsx(Vnt,{dateAdapter:SMn,children:O.jsx(hFn,{disabled:!t,className:e.dateTimePicker,format:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,slotProps:{textField:{variant:"standard",size:"small"}},viewRenderers:{hours:null,minutes:null,seconds:null}})});return O.jsx(FR,{label:s,control:f})},mFn=pMn(pFn)(gFn),vFn=e=>({locale:e.controlState.locale,hasTimeDimension:!!DT(e),selectedTime:e.controlState.selectedTime,selectedTimeRange:e.controlState.selectedTimeRange}),yFn={selectTime:cW},bFn=dr(vFn,yFn)(mFn),GMe=5,xFn={box:{marginLeft:GMe,marginRight:GMe,minWidth:"10rem",height:"3rem"}};function wFn({hasTimeDimension:e,selectedTime:t,selectTime:n,selectedTimeRange:r}){const[i,o]=M.useState(t);if(M.useEffect(()=>{o(t||(r?r[0]:0))},[t,r]),!e)return null;const s=(f,d)=>{typeof d=="number"&&o(d)},a=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*B6e.years,Date.now()]);const c=[{value:r[0],label:WA(r[0])},{value:r[1],label:WA(r[1])}];function u(f){return ET(f)}return O.jsx(bt,{sx:xFn.box,children:O.jsx(_n,{arrow:!0,title:Ce.get("Select time in dataset"),children:O.jsx(oS,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:s,onChangeCommitted:a,size:"small"})})})}const SFn=e=>({locale:e.controlState.locale,hasTimeDimension:!!DT(e),selectedTime:e.controlState.selectedTime,selectedTimeRange:e.controlState.selectedTimeRange}),_Fn={selectTime:cW,selectTimeRange:Att},CFn=dr(SFn,_Fn)(wFn),$rt=ot(O.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),Nrt=ot(O.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),OFn=ot(O.jsx("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),EFn=ot(O.jsx("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),TFn=ot(O.jsx("path",{d:"M9 16h2V8H9zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m1-4h2V8h-2z"}),"PauseCircleOutline"),PFn=ot(O.jsx("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline"),q_={formControl:{marginLeft:1,marginRight:1,marginTop:2},iconButton:{padding:"2px"}};function kFn({timeAnimationActive:e,timeAnimationInterval:t,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:s}){const a=M.useRef(null);M.useEffect(()=>(p(),m));const l=()=>{s(1)},c=()=>{n(!e,t)},u=()=>{s(1)},f=()=>{s(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{e?g():m()},g=()=>{m(),a.current=window.setInterval(l,t)},m=()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},v=typeof r=="number",y=e?O.jsx(TFn,{}):O.jsx(PFn,{}),b=O.jsx(Mn,{disabled:!v,onClick:c,size:"small",sx:q_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Auto-step through times in the dataset"),children:y})}),w=O.jsx(Mn,{disabled:!v||e,onClick:d,size:"small",sx:q_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("First time step"),children:O.jsx(OFn,{})})}),S=O.jsx(Mn,{disabled:!v||e,onClick:f,size:"small",sx:q_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Previous time step"),children:O.jsx($rt,{})})}),_=O.jsx(Mn,{disabled:!v||e,onClick:u,size:"small",sx:q_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Next time step"),children:O.jsx(Nrt,{})})}),E=O.jsx(Mn,{disabled:!v||e,onClick:h,size:"small",sx:q_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Last time step"),children:O.jsx(EFn,{})})});return O.jsx(ld,{sx:q_.formControl,variant:"standard",children:O.jsxs(bt,{children:[w,S,b,_,E]})})}const MFn=e=>({locale:e.controlState.locale,selectedTime:e.controlState.selectedTime,selectedTimeRange:e.controlState.selectedTimeRange,timeAnimationActive:e.controlState.timeAnimationActive,timeAnimationInterval:e.controlState.timeAnimationInterval}),AFn={selectTime:cW,incSelectedTime:SEn,updateTimeAnimation:CEn},RFn=dr(MFn,AFn)(kFn),IFn={formControl:{marginLeft:"auto",marginRight:1,marginTop:2,marginBottom:0,display:"flex",flexDirection:"row",alignItems:"center",gap:1,flexGrow:0}};function DFn({visible:e,sidePanelOpen:t,setSidePanelOpen:n,compact:r}){if(!e)return null;const i=O.jsx(Wl,{sx:km.toggleButton,value:"sidebar",onClick:()=>n(!t),tooltipText:Ce.get(t?"Hide sidebar":"Show sidebar"),icon:t?O.jsx(Nrt,{}):O.jsx($rt,{})});return O.jsxs(ld,{sx:IFn.formControl,variant:"standard",children:[r&&O.jsx(Snt,{}),r&&O.jsx(xnt,{style:km.toggleButton}),i]})}const LFn=e=>({locale:e.controlState.locale,visible:!!(e.controlState.selectedDatasetId||e.controlState.selectedPlaceId),sidePanelOpen:e.controlState.sidePanelOpen,compact:On.instance.branding.compact}),FFn={setSidePanelOpen:ime},$Fn=dr(LFn,FFn)(DFn),NFn=e=>({locale:e.controlState.locale,show:e.dataState.datasets.length>0}),zFn={},jFn=({show:e})=>e?O.jsxs(kPn,{children:[O.jsx(LPn,{}),O.jsx(oa,{orientation:"vertical",variant:"middle",flexItem:!0}),O.jsx(WPn,{}),O.jsx(oa,{orientation:"vertical",variant:"middle",flexItem:!0}),O.jsx(YPn,{}),O.jsx(nkn,{}),O.jsx(dkn,{}),O.jsx(oa,{orientation:"vertical",variant:"middle",flexItem:!0}),O.jsx(bFn,{}),O.jsx(RFn,{}),O.jsx(CFn,{}),O.jsx($Fn,{})]}):null,BFn=dr(NFn,zFn)(jFn);function UFn(e,t){return Lr(t)&&t>0?VFn(e,t):WFn(e)}function VFn(e,t){let n=0,r;return((...i)=>{const o=Date.now();return(n===0||o-n>=t)&&(r=e(...i),n=o),r})}function WFn(e){let t=!1;return((...n)=>{t||(t=!0,requestAnimationFrame(()=>{e(...n),t=!1}))})}function zrt({onDragStart:e,onDragMove:t,onDragEnd:n}){const r=M.useRef(null),i=M.useCallback(c=>{if(c.buttons===1&&r.current!==null&&(c.preventDefault(),t)){const{clientX:u,clientY:f}=c,[d,h]=r.current;r.current=[u,f],t([u-d,f-h],c)}},[t]),o=M.useMemo(()=>UFn(i),[i]),s=M.useCallback(c=>{if(c.buttons===1){c.preventDefault(),r.current=[c.clientX,c.clientY];const u=l.current;document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",u),e&&e(c)}},[e,o]),a=M.useCallback(c=>{if(r.current!==null){c.preventDefault(),r.current=null;const u=l.current;document.body.removeEventListener("mousemove",o),document.body.removeEventListener("mouseup",u),n&&n(c)}},[n,o]),l=M.useRef(()=>{});return M.useEffect(()=>{l.current=a},[a]),s}const jrt="8px",w0={container:{display:"flex"},resizeHandle:e=>({position:"absolute",opacity:0,zIndex:999,top:0,left:0,transition:"background 0.3s ease, opacity 0.3s ease","&:hover":{background:e.palette.mode==="dark"?"#FFF":"#000",opacity:.25}}),child1:{},child2:{position:"relative"}},HFn={container:{...w0.container,flexFlow:"row nowrap"},resizeHandle:e=>({...w0.resizeHandle(e),width:jrt,height:"100%",cursor:"col-resize"}),child1:{...w0.child1,height:"100%"},child2:{...w0.child2,height:"100%"}},GFn={container:{...w0.container,flexFlow:"column nowrap"},resizeHandle:e=>({...w0.resizeHandle(e),width:"100%",height:jrt,cursor:"row-resize"}),child1:{...w0.child1,width:"100%"},child2:{...w0.child2,width:"100%"}};function qFn({dir:e,childPos:t,childSize:n,updateChildSize:r,children:i,style:o}){const s=M.useRef(null),a=M.useRef(null),l=!t||t==="first",c=M.useCallback(([d,h])=>{const p=e==="hor"?d:h;r(l?p:-p)},[e,l,r]),u=zrt({onDragMove:c}),f=M.useMemo(()=>{const d=e==="hor"?HFn:GFn,h=`${n}px`,p=`calc(100% - ${n}px)`,g=l?h:p,m=l?p:h;return{...d,container:d.container,child1:{...d.child1,...e==="hor"?{width:g}:{height:g}},child2:{...d.child2,...e==="hor"?{width:m}:{height:m}}}},[e,l,n]);return!i||!Array.isArray(i)||i.length!==2?null:O.jsxs(bt,{id:"SplitPane-Container",sx:f.container,ref:s,style:o,children:[O.jsx(bt,{id:"SplitPane-Child1",sx:f.child1,ref:a,children:i[0]}),O.jsxs(bt,{id:"SplitPane-Child2",sx:f.child2,children:[O.jsx(bt,{id:"SplitPane-ResizeHandle",sx:f.resizeHandle,onMouseDown:u}),i[1]]})]})}const XFn=({placeGroup:e,mapProjection:t,visible:n})=>{const r=M.useRef(new vD);return M.useEffect(()=>{const i=r.current,o=e.features;if(o.length===0)i.clear();else{const s=i.getFeatures(),a=new Set(s.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!a.has(f.id));s.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new fS().readFeature(f,{dataProjection:"EPSG:4326",featureProjection:t});d.getId()!==f.id&&d.setId(f.id);const h=(f.properties||{}).color||"red",p=(f.properties||{}).opacity,g=(f.properties||{}).source?"diamond":"circle";qge(d,h,xle(p),g),i.addFeature(d)})}},[e,t]),O.jsx(xU,{id:e.id,opacity:e.id===Yd?1:.8,visible:n,zIndex:501,source:r.current})};class YFn extends bD{addMapObject(t){const n=new FMt(this.getOptions());return t.addControl(n),n}updateMapObject(t,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(t,n){t.removeControl(n)}}class bY extends bD{addMapObject(t){const n=new dAt(this.getOptions()),r=!!this.props.active;return n.setActive(r),t.addInteraction(n),r&&this.listen(n,this.props),n}updateMapObject(t,n,r){n.setProperties(this.getOptions());const i=!!this.props.active;return n.setActive(i),this.unlisten(n,r),i&&this.listen(n,this.props),n}removeMapObject(t,n){this.unlisten(n,this.props),t.removeInteraction(n)}getOptions(){const t=super.getOptions();delete t.layerId,delete t.active,delete t.onDrawStart,delete t.onDrawEnd;const n=this.props.layerId;if(n&&!t.source){const r=this.getMapObject(n);r&&(t.source=r.getSource())}return t}listen(t,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&t.on("drawstart",r),i&&t.on("drawend",i)}unlisten(t,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&t.un("drawstart",r),i&&t.un("drawend",i)}}class QFn extends bD{addMapObject(t){return this.updateView(t)}removeMapObject(t,n){}updateMapObject(t,n){return this.updateView(t)}updateView(t){const n=this.props.projection;let r=t.getView().getProjection();if(typeof n=="string"&&r&&(r=r.getCode()),n&&n!==r){const i=t.getView(),o=new pp({...this.props,center:uU(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});t.getLayers().forEach(s=>{s instanceof mU&&s.getSource().forEachFeature(a=>{a.getGeometry()?.transform(r,n)})}),t.setView(o)}else t.getView().setProperties(this.props);return t.getView()}}const KFn={wrapper:{zIndex:1e3,position:"absolute",bottom:0,left:0,width:"100%",height:"5px",pointerEvents:"none"}};function ZFn({progress:e,visibility:t,enabled:n}){return n?O.jsx(bt,{sx:KFn.wrapper,children:O.jsx(bt,{sx:r=>({height:"100%",backgroundColor:r.palette.primary.main,transition:" width 300ms ease",width:`${e}%`,visibility:t})})}):null}const xY="selection",JFn=new vD,Brt=[255,220,0,.8],e$n=new jp({color:Brt,width:10,lineCap:"square",lineDash:[10,15]}),qMe=new cw({color:[0,0,0,0]}),t$n=new Op({stroke:e$n,fill:qMe,image:new gD({radius:15,stroke:new jp({color:Brt,width:6,lineCap:"square",lineDash:[6,6]}),fill:qMe})});function n$n({theme:e,mapId:t,mapInteraction:n,mapProjection:r,baseMapLayers:i,overlayLayers:o,rgb2Layer:s,rgbLayer:a,variable2Layer:l,variableLayer:c,datasetBoundaryLayer:u,placeGroupLayers:f,colorBarLegend:d,colorBarLegend2:h,mapSplitter:p,mapPointInfoBox:g,mapControlActions:m,userDrawnPlaceGroupName:v,addDrawnUserPlace:y,importUserPlacesFromText:b,userPlaceGroups:w,userPlaceGroupsVisibility:S,showUserPlaces:_,selectPlace:E,selectedPlaceId:T,places:k,imageSmoothing:P,variableSplitPos:R,onMapRef:I,showProgressBar:F,zoomBox:A,setZoomLevel:L,setDatasetZLevel:$}){e=tS();const[j,V]=M.useState(null),[U,z]=M.useState(T||null);M.useEffect(()=>{if(j){const me=T||null;if(me!==U&&Qs[xY]){const ue=Qs[xY].getSource();if(ue.clear(),me){const G=r$n(j,me);if(G){const ce=G.clone();ce.setId("select-"+G.getId()),ce.setStyle(void 0),ue.addFeature(ce)}}z(me)}}},[j,T,U]),M.useEffect(()=>{j&&j.getLayers().forEach(me=>{me instanceof Zle?me.getSource().changed():me.changed()})},[j,P]),M.useEffect(()=>{if(j===null||!Lr(R))return;const me=ae=>{XMe(j,ae,R,0)},se=ae=>{XMe(j,ae,R,1)},ue=ae=>{ae.context.restore()},G=Q2(j,"rgb2"),ce=Q2(j,"variable2"),he=Q2(j,"rgb"),J=Q2(j,"variable"),te=[[G,me],[ce,me],[he,se],[J,se]];for(const[ae,we]of te)ae&&(ae.on("prerender",we),ae.on("postrender",ue));return()=>{for(const[ae,we]of te)ae&&(ae.un("prerender",we),ae.un("postrender",ue))}});const N=me=>{if(n==="Select"){const se=me.map;let ue=null;const G=se.getFeaturesAtPixel(me.pixel);if(G){for(const ce of G)if(typeof ce.getId=="function"){ue=ce.getId()+"";break}}E&&E(ue,k,!1)}},B=me=>{if(j!==null&&y&&n!=="Select"){const se=me.feature;let ue=se.getGeometry();if(!ue)return;const G=mh(CT+n.toLowerCase()+"-"),ce=j.getView().getProjection();if(ue instanceof lce){const Pe=QEt(ue);se.setGeometry(Pe)}ue=se.clone().getGeometry().transform(ce,aS);const he=new fS().writeGeometryObject(ue);se.setId(G);let J=0;if(Qs[Yd]){const ee=Qs[Yd]?.getSource()?.getFeatures();ee&&(J=ee.length)}const te=i$n(w,n),ae=sw(J),we=wBe(ae,e.palette.mode);qge(se,we,xle()),y(v,G,{label:te,color:ae},he,!0)}return!0};function H(me){I&&I(me),V(me)}const Q=me=>{b&&me.forEach(se=>{const ue=new FileReader;ue.onloadend=()=>{typeof ue.result=="string"&&b(ue.result)},ue.readAsText(se,"UTF-8")})},[Y,Z]=M.useState(0),[pe,ie]=M.useState("hidden"),ne=M.useCallback(me=>{Z(me.value),ie(me.active?"visible":"hidden")},[]),fe=(me,se)=>{if(L){const ue=me.target.getZoom();L(ue)}if($){const ue=wwe(me.target,se);$(ue)}};return M.useEffect(()=>{if(j&&$){const me=wwe(j.getView(),j);$(me)}},[j,c,$]),O.jsx(pnt,{children:O.jsxs(UAt,{id:t,onClick:me=>N(me),onZoom:(me,se)=>fe(me,se),onMapRef:H,mapObjects:Qs,isStale:!0,onDropFiles:Q,onTileLoadProgress:ne,children:[O.jsx(QFn,{id:"view",projection:r}),O.jsxs(v6e,{children:[O.jsx(O.Fragment,{children:i}),s,a,l,c,O.jsx(O.Fragment,{children:o}),u,O.jsx(xU,{id:xY,opacity:.7,zIndex:500,style:t$n,source:JFn}),O.jsx(O.Fragment,{children:w.map(me=>O.jsx(XFn,{placeGroup:me,mapProjection:r,visible:_&&S[me.id]},me.id))})]}),f,O.jsx(bY,{id:"drawPoint",layerId:Yd,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:B}),O.jsx(bY,{id:"drawPolygon",layerId:Yd,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:B}),O.jsx(bY,{id:"drawCircle",layerId:Yd,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:B}),d,h,g,m,p,O.jsx(ZFn,{enabled:F,progress:Y,visibility:pe}),A,O.jsx(YFn,{bar:!1})]})})}function r$n(e,t){for(const n of e.getLayers().getArray())if(n instanceof mU){const i=n.getSource()?.getFeatureById(t);if(i)return i}return null}function i$n(e,t){const n=Ce.get(t),r=e.find(i=>i.id===Yd);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(a=>a.properties?a.properties.label===o:!1))return o}return`${n} 1`}function XMe(e,t,n,r){const i=e.getSize();if(!i)return;const o=i[0],s=i[1];let a,l,c,u;r===0?(a=gy(t,[0,0]),l=gy(t,[n,0]),c=gy(t,[0,s]),u=gy(t,[n,s])):(a=gy(t,[n,0]),l=gy(t,[o,0]),c=gy(t,[n,s]),u=gy(t,[o,s]));const f=t.context;f.save(),f.beginPath(),f.moveTo(a[0],a[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const n3=1,BR=.2,SP=240,Urt=20,o$n={borderColor:"#3B3B3B"},s$n={borderColor:"#E5E5E5"};function a$n(e){return(e.palette.mode==="dark"?o$n:s$n).borderColor}function wW(e){return`1px solid ${a$n(e)}`}const r3={container:{width:SP},itemContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},itemLabelBox:{paddingLeft:1,fontSize:"small"},itemColorBox:e=>({width:"48px",height:"16px",borderStyle:"solid",borderColor:e.palette.mode==="dark"?"lightgray":"darkgray",borderWidth:1})};function l$n({categories:e,onOpenColorBarEditor:t}){return!e||e.length===0?null:O.jsx(bt,{sx:r3.container,children:e.map((n,r)=>O.jsxs(bt,{onClick:t,sx:r3.itemContainer,children:[O.jsx(bt,{sx:r3.itemColorBox,style:{backgroundColor:n.color}}),O.jsx(bt,{component:"span",sx:r3.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const c$n=Qn("canvas")(({theme:e})=>({border:wW(e),cursor:"pointer"})),YMe={nominal:{},error:{border:"1px solid red"}};function u$n({colorBar:e,opacity:t,width:n,height:r,onClick:i}){const o=M.useRef(null);M.useEffect(()=>{const c=o.current;c!==null&&GDt(e,t,c)},[e,t]);const{baseName:s,imageData:a}=e,l=a?s:Ce.get("Unknown color bar")+`: ${s}`;return O.jsx(_n,{title:l,children:O.jsx(c$n,{ref:o,width:n||SP-4,height:r||Urt+4,onClick:i,style:a?YMe.nominal:YMe.error})})}function f$n(e,t,n=5,r=!1,i=!1){return coe(h$n(e,t,n,r),i)}function coe(e,t=!1){return e.map(n=>jf(n,void 0,t))}function jf(e,t,n){if(t===void 0&&(t=n?2:d$n(e)),n)return e.toExponential(t);const r=Math.round(e);if(r===e||Math.abs(r-e)<1e-8)return r+"";{let i=e.toFixed(t);if(i.includes("."))for(;i.endsWith("0")&&!i.endsWith(".0");)i=i.substring(0,i.length-1);return i}}function d$n(e){if(e===0||e===Math.floor(e))return 0;const t=Math.floor(Math.log10(Math.abs(e)));return Math.min(16,Math.max(2,t<0?1-t:0))}function h$n(e,t,n,r){const i=new Array(n);if(r){const o=Math.log10(e),a=(Math.log10(t)-o)/(n-1);for(let l=1;lf$n(e,t,n,r),[e,t,n,r]);return O.jsx(bt,{sx:QMe.container,onClick:i,children:o.map((s,a)=>O.jsx(yn,{sx:QMe.label,children:s},a))})}const g$n=ot(O.jsx("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress"),KMe=e=>e,m$n=e=>Math.pow(10,e),v$n=Math.log10,ZMe=(e,t)=>typeof e=="number"?t(e):e.map(t);class y$n{_fn;_invFn;constructor(t){t?(this._fn=v$n,this._invFn=m$n):(this._fn=KMe,this._invFn=KMe)}scale(t){return ZMe(t,this._fn)}scaleInv(t){return ZMe(t,this._invFn)}}function b$n({variableColorBarName:e,variableColorBarMinMax:t,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const s=M.useMemo(()=>new y$n(n==="log"),[n]),[a,l]=M.useState(()=>s.scale(t));M.useEffect(()=>{l(s.scale(t))},[s,t]);const c=(k,P)=>{Array.isArray(P)&&l(P)},u=(k,P)=>{if(Array.isArray(P)){const I=coe(s.scaleInv(P)).map(F=>Number.parseFloat(F));i(e,I,n,r)}},[f,d]=s.scale(o),h=f=2?v=Math.max(2,Math.round(m/2)):(v=4,m=8);const y=f({value:E[P],label:k}));return O.jsx(oS,{min:w,max:S,value:a,marks:T,step:_,valueLabelFormat:k=>jf(s.scaleInv(k)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const wY=5,wy={container:e=>({marginTop:e.spacing(2),marginBottom:e.spacing(2),display:"flex",flexDirection:"column",gap:1}),header:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{paddingLeft:2,fontWeight:"bold"},sliderBox:e=>({marginTop:e.spacing(1),marginLeft:e.spacing(wY),marginRight:e.spacing(wY),minWidth:320,width:`calc(100% - ${e.spacing(2*(wY+1))}px)`}),logLabel:{margin:0,paddingRight:2,fontWeight:"bold"},minMaxBox:{display:"flex",justifyContent:"center"},minTextField:{maxWidth:"8em",marginRight:2},maxTextField:{maxWidth:"8em",marginLeft:2}};function x$n({variableColorBar:e,variableColorBarName:t,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[s,a]=M.useState(n),[l,c]=M.useState(n),[u,f]=M.useState(JMe(n)),[d,h]=M.useState([!1,!1]);M.useEffect(()=>{f(JMe(n))},[n]);const p=y=>{const b=y.target.value;f([b,u[1]]);const w=Number.parseFloat(b);let S=!1;if(!Number.isNaN(w)&&w{const b=y.target.value;f([u[0],b]);const w=Number.parseFloat(b);let S=!1;if(!Number.isNaN(w)&&w>s[0]){if(w!==s[1]){const _=[s[0],w];a(_),c(_),o(t,_,r,i)}}else S=!0;h([d[0],S])},m=()=>{const y=e.colorRecords,b=y[0].value,w=y[y.length-1].value,S=[b,w];a(S),c(S),o(t,S,r,i),h([!1,!1])},v=(y,b)=>{o(t,n,b?"log":"lin",i)};return O.jsxs(bt,{sx:wy.container,children:[O.jsxs(bt,{sx:wy.header,children:[O.jsx(yn,{sx:wy.title,children:Ce.get("Value Range")}),O.jsx("span",{style:{flexGrow:1}}),e.colorRecords&&O.jsx(Wl,{sx:{marginRight:1},icon:O.jsx(g$n,{}),onClick:m,tooltipText:Ce.get("Set min/max from color mapping values")}),O.jsx(sh,{sx:wy.logLabel,control:O.jsx(_n,{title:Ce.get("Logarithmic scaling"),children:O.jsx(gle,{checked:r==="log",onChange:v,size:"small"})}),label:O.jsx(yn,{variant:"body2",children:Ce.get("Log-scaled")}),labelPlacement:"start"})]}),O.jsx(bt,{sx:wy.sliderBox,children:O.jsx(b$n,{variableColorBarName:t,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),O.jsxs(bt,{component:"form",sx:wy.minMaxBox,children:[O.jsx(Ri,{sx:wy.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),O.jsx(Ri,{sx:wy.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>g(y)})]})]})}function JMe(e){return[e[0]+"",e[1]+""]}function w$n({variableColorBar:e,variableColorBarName:t,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:s}){const[a,l]=M.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return O.jsxs(O.Fragment,{children:[O.jsx(u$n,{colorBar:e,opacity:i,onClick:s}),O.jsx(p$n,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),O.jsx(rS,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:O.jsx(x$n,{variableColorBar:e,variableColorBarName:t,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}const S$n=ot(O.jsx("path",{d:"M12 4.81V19c-3.31 0-6-2.63-6-5.87 0-1.56.62-3.03 1.75-4.14zM6.35 7.56C4.9 8.99 4 10.96 4 13.13 4 17.48 7.58 21 12 21s8-3.52 8-7.87c0-2.17-.9-4.14-2.35-5.57L12 2z"}),"InvertColors"),_$n=ot(O.jsx("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity"),x2={container:{display:"flex",alignItems:"center",justifyContent:"space-between"},settingsBar:{display:"flex",gap:"1px"},opacityContainer:{display:"flex",alignItems:"center"},opacityLabel:e=>({color:e.palette.text.secondary}),opacitySlider:{flexGrow:"1px",marginLeft:"10px",marginRight:"10px"}};function C$n({variableColorBarName:e,variableColorBarMinMax:t,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const s=()=>{const c=!r.isAlpha;e=cj({...r,isAlpha:c}),o(e,t,n,i)},a=()=>{const c=!r.isReversed;e=cj({...r,isReversed:c}),o(e,t,n,i)},l=(c,u)=>{o(e,t,n,u)};return O.jsxs(O.Fragment,{children:[O.jsx(bt,{sx:x2.container,children:O.jsxs(bt,{sx:x2.settingsBar,children:[O.jsx(_n,{arrow:!0,title:Ce.get("Hide small values"),children:O.jsx(oo,{value:"alpha",selected:r.isAlpha,onChange:s,size:"small",children:O.jsx(_$n,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Reverse"),children:O.jsx(oo,{value:"reverse",selected:r.isReversed,onChange:a,size:"small",children:O.jsx(S$n,{fontSize:"inherit"})})})]})}),O.jsxs(bt,{component:"div",sx:x2.opacityContainer,children:[O.jsx(bt,{component:"span",fontSize:"small",sx:x2.opacityLabel,children:Ce.get("Opacity")}),O.jsx(oS,{min:0,max:1,value:i,step:.01,sx:x2.opacitySlider,onChange:l,size:"small"})]})]})}const O$n={colorBarGroupTitle:e=>({marginTop:e.spacing(2*BR),fontSize:"small",color:e.palette.text.secondary})};function Vrt({title:e,description:t}){return O.jsx(_n,{arrow:!0,title:t,placement:"left",children:O.jsx(bt,{sx:O$n.colorBarGroupTitle,children:e})})}const eAe=e=>({marginTop:e.spacing(BR),height:20,border:wW(e),cursor:"pointer"}),tAe={colorBarItem:e=>({...eAe(e)}),colorBarItemSelected:e=>({...eAe(e),borderColor:"blue"})};function Mme({imageData:e,selected:t,onSelect:n,width:r,title:i}){let o=O.jsx("img",{src:e?`data:image/png;base64,${e}`:void 0,alt:e?"color bar":"error",width:"100%",height:"100%",onClick:n});return i&&(o=O.jsx(_n,{arrow:!0,title:i,placement:"left",children:o})),O.jsx(bt,{width:r||SP,sx:t?tAe.colorBarItemSelected:tAe.colorBarItem,children:o})}function E$n({colorBarGroup:e,selectedColorBarName:t,onSelectColorBar:n,images:r}){return O.jsxs(O.Fragment,{children:[O.jsx(Vrt,{title:e.title,description:e.description}),e.names.map(i=>O.jsx(Mme,{title:i,imageData:r[i],selected:i===t,onSelect:()=>n(i)},i))]})}const SW=ot(O.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");function Wrt(){const e=M.useRef(),t=M.useRef(()=>{e.current&&(e.current(),e.current=void 0)}),n=M.useRef(r=>{e.current=r});return M.useEffect(()=>t.current,[]),[t.current,n.current]}const T$n=ot(O.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel"),P$n=ot(O.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function k$n({anchorEl:e,markdownText:t,open:n,onClose:r}){return t?O.jsx(rS,{anchorEl:e,open:n,onClose:r,children:O.jsx(fa,{sx:{width:"24rem",overflowY:"auto",fontSize:"smaller",padding:2},children:O.jsx(Hb,{text:t})})}):null}function Hrt({size:e,helpUrl:t}){const[n,r]=M.useState(null),i=M.useRef(null),o=uW(t),s=()=>{r(i.current)},a=()=>{r(null)};return O.jsxs(O.Fragment,{children:[O.jsx(Mn,{onClick:s,size:e,ref:i,children:O.jsx(ynt,{fontSize:"inherit"})}),O.jsx(k$n,{anchorEl:n,open:!!n,onClose:a,markdownText:o})]})}const nAe={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function _W({onDone:e,onCancel:t,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return O.jsxs(bt,{sx:nAe.container,children:[O.jsx(bt,{children:o&&O.jsx(Hrt,{size:i,helpUrl:o})}),O.jsxs(bt,{sx:nAe.doneCancel,children:[O.jsx(Mn,{onClick:e,color:"primary",disabled:n,size:i,children:O.jsx(P$n,{fontSize:"inherit"})}),O.jsx(Mn,{onClick:t,color:"primary",disabled:r,size:i,children:O.jsx(T$n,{fontSize:"inherit"})})]})]})}const SY={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},M$n=[["continuous","Contin.","Continuous color assignment, where each value represents a support point of a color gradient"],["stepwise","Stepwise","Stepwise color mapping where values are bounds of value ranges mapped to the same single color"],["categorical","Categ.","Values represent unique categories or indexes that are mapped to a color"]];function A$n({colorMapType:e,setColorMapType:t}){return O.jsx(oU,{row:!0,value:e,onChange:(n,r)=>{t(r)},sx:SY.radioGroup,children:M$n.map(([n,r,i])=>O.jsx(_n,{arrow:!0,title:Ce.get(i),children:O.jsx(sh,{value:n,control:O.jsx(uO,{size:"small",sx:SY.radio}),label:O.jsx(bt,{component:"span",sx:SY.label,children:Ce.get(r)})})},n))})}function R$n({userColorBar:e,updateUserColorBar:t,selected:n,onSelect:r,onDone:i,onCancel:o}){const s=l=>{t({...e,code:l.currentTarget.value})},a=l=>{t({...e,type:l})};return O.jsxs(bt,{children:[O.jsx(Mme,{imageData:e.imageData,title:e.errorMessage,selected:n,onSelect:r}),O.jsx(A$n,{colorMapType:e.type,setColorMapType:a}),O.jsx(Ri,{label:"Color mapping",placeholder:z4e,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:e.code,onChange:s,color:e.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),O.jsx(_W,{onDone:i,onCancel:o,doneDisabled:!!e.errorMessage,size:"small",helpUrl:Ce.get("docs/color-mappings.en.md")})]})}const I$n=ot(O.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),D$n={container:{display:"flex",alignItems:"center",width:SP,height:Urt,gap:BR,marginTop:BR}};function L$n({imageData:e,title:t,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:s}){const[a,l]=M.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!a;return O.jsxs(O.Fragment,{children:[O.jsxs(bt,{sx:D$n.container,children:[O.jsx(Mme,{imageData:e,selected:n,onSelect:o,width:SP-20,title:t}),O.jsx(Mn,{size:"small",onClick:c,children:O.jsx(I$n,{fontSize:"inherit"})})]}),O.jsx(rS,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:a,onClose:u,children:O.jsxs(bt,{children:[O.jsx(Mn,{onClick:f,size:"small",disabled:s,children:O.jsx(bP,{fontSize:"inherit"})}),O.jsx(Mn,{onClick:d,size:"small",disabled:s,children:O.jsx(dW,{fontSize:"inherit"})})]})})]})}const F$n={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function $$n({colorBarGroup:e,selectedColorBarName:t,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:s,updateUserColorBars:a,storeSettings:l}){const[c,u]=M.useState({}),[f,d]=Wrt(),h=M.useMemo(()=>r.findIndex(b=>b.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>a(r));const b=mh("ucb");i(b),u({action:"add",colorBarId:b})},g=b=>{d(()=>a(r)),u({action:"edit",colorBarId:b})},m=b=>{d(void 0),o(b)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return O.jsxs(O.Fragment,{children:[O.jsxs(bt,{sx:F$n.container,children:[O.jsx(Vrt,{title:Ce.get(e.title),description:Ce.get(e.description)}),O.jsx(Mn,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:O.jsx(SW,{fontSize:"inherit"})})]}),r.map(b=>b.id===c.colorBarId&&h>=0?O.jsx(R$n,{userColorBar:b,updateUserColorBar:s,selected:b.id===t,onSelect:()=>n(b.id),onDone:v,onCancel:y},b.id):O.jsx(L$n,{imageData:b.imageData,title:b.errorMessage,disabled:!!c.action,selected:b.id===t,onSelect:()=>n(b.id),onEdit:()=>g(b.id),onRemove:()=>m(b.id)},b.id))]})}function N$n({variableColorBarName:e,variableColorBarMinMax:t,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:s,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{e=cj({...r,baseName:p}),o(e,t,n,i)};return O.jsx(O.Fragment,{children:s.groups.map(p=>p.title===N4e?O.jsx($$n,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):O.jsx(E$n,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:s.images},p.title))})}const z$n={colorBarBox:e=>({marginTop:e.spacing(n3-2*BR),marginLeft:e.spacing(n3),marginRight:e.spacing(n3),marginBottom:e.spacing(n3)})};function j$n(e){const{colorBars:t,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s,...a}=e;return O.jsxs(bt,{sx:z$n.colorBarBox,children:[O.jsx(C$n,{...a}),O.jsx(N$n,{...a,colorBars:t,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s})]})}const i3={container:e=>({position:"absolute",zIndex:1e3,top:10,border:wW(e),borderRadius:"5px",boxShadow:"0 3px 3px 0 rgba(0, 0, 0, 0.2), 1px 4px 4px 1px rgba(0, 0, 0, 0.2)",backgroundColor:Bt(e.palette.background.default,.85),maxWidth:`${SP+20}px`,paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),paddingBottom:e.spacing(.5),paddingTop:e.spacing(.5)}),header:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",paddingBottom:.5},title:{fontSize:"0.8rem",fontWeight:"normal",wordBreak:"break-word",wordWrap:"break-word"},subTitle:{fontSize:"0.7rem",fontWeight:"lighter",wordBreak:"break-word",wordWrap:"break-word"}};function Grt(e){const{datasetTitle:t,variableName:n,variableTitle:r,variableUnits:i,variableColorBar:o,style:s}=e,a=M.useRef(null),[l,c]=M.useState(null),u=()=>{c(a.current)},f=()=>{c(null)};if(!n)return null;const d=o.type==="categorical"||!i||i==="1"||i==="-"?r||n:`${r||n} (${i})`;return O.jsxs(bt,{sx:i3.container,style:s,ref:a,children:[O.jsxs(bt,{sx:i3.header,children:[O.jsx(yn,{sx:i3.title,variant:"subtitle1",color:"textPrimary",children:d}),t&&O.jsx(yn,{sx:i3.subTitle,variant:"subtitle2",color:"textSecondary",children:t})]}),o.type==="categorical"?O.jsx(l$n,{categories:o.colorRecords,onOpenColorBarEditor:u,...e}):O.jsx(w$n,{onOpenColorBarEditor:u,...e}),O.jsx(rS,{anchorEl:l,open:!!l,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:O.jsx(j$n,{...e})})]})}const B$n=e=>({datasetTitle:xce(e),variableName:dS(e),variableTitle:ELt(e),variableUnits:PLt(e),variableColorBarName:CU(e),variableColorBarMinMax:iUe(e),variableColorBarNorm:aUe(e),variableColorBar:wce(e),variableOpacity:hUe(e),userColorBars:pS(e),colorBars:EU(e),style:{right:10}}),U$n={updateVariableColorBar:tEn,addUserColorBar:Qtt,removeUserColorBar:Jtt,updateUserColorBar:ent,updateUserColorBars:rnt,storeSettings:Ytt},V$n=dr(B$n,U$n)(Grt),W$n=e=>{const t=e.controlState.variableSplitPos;return{datasetTitle:K6e(e),variableName:t?yce(e):null,variableTitle:TLt(e),variableUnits:kLt(e),variableColorBarName:OU(e),variableColorBarMinMax:oUe(e),variableColorBarNorm:lUe(e),variableColorBar:uUe(e),variableOpacity:pUe(e),userColorBars:pS(e),colorBars:EU(e),style:{left:t?t-280:0}}},H$n={updateVariableColorBar:nEn,addUserColorBar:Qtt,removeUserColorBar:Jtt,updateUserColorBar:ent,updateUserColorBars:rnt,storeSettings:Ytt},G$n=dr(W$n,H$n)(Grt),q$n={splitter:{position:"absolute",top:0,left:"50%",width:"6px",height:"100%",backgroundColor:"#ffffff60",zIndex:999,borderLeft:"0.5px solid #ffffffd0",borderRight:"0.5px solid #ffffffd0",cursor:"col-resize",boxShadow:"0px 0px 1px 0px black"}};function X$n({hidden:e,position:t,updatePosition:n}){const r=M.useRef(null),i=M.useCallback(([s,a])=>{n(s,!0)},[n]),o=zrt({onDragMove:i});return M.useEffect(()=>{!e&&!Lr(t)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[e,t,n]),e?null:O.jsx("div",{id:"MapSplitter",ref:r,style:{...q$n.splitter,left:Lr(t)?t:"50%"},onMouseDown:o})}const Y$n=e=>({hidden:!e.controlState.variableCompareMode,position:e.controlState.variableSplitPos}),Q$n={updatePosition:xEn},K$n=dr(Y$n,Q$n)(X$n);function Z$n(e,t,n,r,i,o,s){const a=M.useRef(0),[l,c]=M.useState(),[u,f]=M.useState(),[d,h]=M.useState();M.useEffect(()=>{!i&&!o&&h(void 0)},[i,o]);const p=M.useCallback(async(v,y,b,w,S)=>{S({dataset:v,variable:y,result:{fetching:!0}});try{const _=await BPt(t,v,y,b,w,s,null);S({dataset:v,variable:y,result:{value:_.value}})}catch(_){S({dataset:v,variable:y,result:{error:_}})}},[t,s]),g=M.useCallback(v=>{const y=v.map;if(!e||!n||!r||!y){f(void 0),h(void 0);return}const b=v.pixel[0],w=v.pixel[1],S=uU(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),_=S[0],E=S[1];c({pixelX:b,pixelY:w,lon:_,lat:E});const T=new Date().getTime();T-a.current>=500&&(a.current=T,p(n,r,_,E,f).finally(()=>{i&&o&&p(i,o,_,E,h)}))},[p,e,n,r,i,o]),m=Qs.map;return M.useEffect(()=>{if(e&&m){const v=y=>{y.dragging?c(void 0):g(y)};return m.on("pointermove",v),()=>{m.un("pointermove",v)}}else c(void 0)},[e,m,g]),M.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const Jg={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function J$n({location:e,payload:t,payload2:n}){const r=M.useMemo(()=>n?"(R) "+_Y(t):_Y(t),[t,n]);return O.jsxs(bt,{sx:Jg.container,children:[O.jsx(bt,{sx:Jg.labelItem,children:"Longitude"}),O.jsx(bt,{sx:Jg.valueItem,children:jf(e.lon,4)}),O.jsx(bt,{sx:Jg.labelItem,children:"Latitude"}),O.jsx(bt,{sx:Jg.valueItem,children:jf(e.lat,4)}),O.jsx(bt,{sx:Jg.labelItem,children:r}),O.jsx(bt,{sx:Jg.valueItem,children:rAe(t)}),n&&O.jsx(bt,{sx:Jg.labelItem,children:"(L) "+_Y(n)}),n&&O.jsx(bt,{sx:Jg.valueItem,children:rAe(n)})]})}function _Y(e){const t=e.variable;return t.title||t.name}function rAe(e){const t=e.result;return t.error?`${t.error}`:t.fetching?"...":Lr(t.value)?jf(t.value,4):"---"}const eNn={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function tNn({enabled:e,serverUrl:t,dataset1:n,variable1:r,dataset2:i,variable2:o,time:s}){const a=Z$n(e,t,n,r,i,o,s);if(!a)return null;const{pixelX:l,pixelY:c}=a.location;return O.jsx(bt,{sx:{...eNn.container,left:l,top:c},children:O.jsx(J$n,{...a})})}const nNn=e=>({enabled:e.controlState.mapPointInfoBoxEnabled,serverUrl:Vo(e).url,dataset1:Co(e),variable1:nc(e),dataset2:Ev(e),variable2:Tv(e),time:gS(e)}),rNn={},iNn=dr(nNn,rNn)(tNn),oNn=ot(O.jsx("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare"),qrt=ot(O.jsx("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers"),sNn=ot(O.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Message"),iAe={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function aNn({style:e,sx:t,children:n}){return O.jsx(bt,{className:"ol-unselectable ol-control",sx:t,style:e?{...iAe,...e}:iAe,children:n})}function m5({icon:e,tooltipTitle:t,onClick:n,selected:r,onSelect:i,className:o}){const s=a=>{i&&i(a,!r),n&&n(a)};return t&&(e=O.jsx(_n,{title:t,children:e})),O.jsx(Mn,{className:o,onClick:s,"data-selected":r,children:e})}const Xrt=ot([O.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),O.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt");function lNn(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const cNn=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function B0(e){const t=[];for(let n=0,r=e.length;ntu||e.height>tu)&&(e.width>tu&&e.height>tu?e.width>e.height?(e.height*=tu/e.width,e.width=tu):(e.width*=tu/e.height,e.height=tu):e.width>tu?(e.height*=tu/e.width,e.width=tu):(e.width*=tu/e.height,e.height=tu))}function _4(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function pNn(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function gNn(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(e),pNn(i)}const Ic=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Ic(n,t)};function mNn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function vNn(e,t){return Yrt(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function yNn(e,t,n,r){const i=`.${e}:${t}`,o=n.cssText?mNn(n):vNn(n,r);return document.createTextNode(`${i}{${o}}`)}function oAe(e,t,n,r){const i=window.getComputedStyle(e,n),o=i.getPropertyValue("content");if(o===""||o==="none")return;const s=cNn();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(yNn(s,n,i,r)),t.appendChild(a)}function bNn(e,t,n){oAe(e,t,":before",n),oAe(e,t,":after",n)}const sAe="application/font-woff",aAe="image/jpeg",xNn={woff:sAe,woff2:sAe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:aAe,jpeg:aAe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function wNn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ame(e){const t=wNn(e).toLowerCase();return xNn[t]||""}function SNn(e){return e.split(/,/)[1]}function uoe(e){return e.search(/^(data:)/)!==-1}function _Nn(e,t){return`data:${t};base64,${e}`}async function Krt(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,s)=>{const a=new FileReader;a.onerror=s,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(l){s(l)}},a.readAsDataURL(i)})}const CY={};function CNn(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Rme(e,t,n){const r=CNn(e,t,n.includeQueryParams);if(CY[r]!=null)return CY[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const o=await Krt(e,n.fetchRequestInit,({res:s,result:a})=>(t||(t=s.headers.get("Content-Type")||""),SNn(a)));i=_Nn(o,t)}catch(o){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${e}`;o&&(s=typeof o=="string"?o:o.message),s&&console.warn(s)}return CY[r]=i,i}async function ONn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):_4(t)}async function ENn(e,t){if(e.currentSrc){const o=document.createElement("canvas"),s=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,s?.drawImage(e,0,0,o.width,o.height);const a=o.toDataURL();return _4(a)}const n=e.poster,r=Ame(n),i=await Rme(n,r,t);return _4(i)}async function TNn(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await CW(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function PNn(e,t){return Ic(e,HTMLCanvasElement)?ONn(e):Ic(e,HTMLVideoElement)?ENn(e,t):Ic(e,HTMLIFrameElement)?TNn(e,t):e.cloneNode(Zrt(e))}const kNn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Zrt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function MNn(e,t,n){var r,i;if(Zrt(t))return t;let o=[];return kNn(e)&&e.assignedNodes?o=B0(e.assignedNodes()):Ic(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?o=B0(e.contentDocument.body.childNodes):o=B0(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),o.length===0||Ic(e,HTMLVideoElement)||await o.reduce((s,a)=>s.then(()=>CW(a,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function ANn(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Yrt(n).forEach(o=>{let s=i.getPropertyValue(o);o==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),Ic(e,HTMLIFrameElement)&&o==="display"&&s==="inline"&&(s="block"),o==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),r.setProperty(o,s,i.getPropertyPriority(o))})}function RNn(e,t){Ic(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Ic(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function INn(e,t){if(Ic(e,HTMLSelectElement)){const r=Array.from(t.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function DNn(e,t,n){return Ic(t,Element)&&(ANn(e,t,n),bNn(e,t,n),RNn(e,t),INn(e,t)),t}async function LNn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let o=0;oPNn(r,t)).then(r=>MNn(e,r,t)).then(r=>DNn(e,r,t)).then(r=>LNn(r,t))}const Jrt=/url\((['"]?)([^'"]+?)\1\)/g,FNn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,$Nn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function NNn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function zNn(e){const t=[];return e.replace(Jrt,(n,r,i)=>(t.push(i),n)),t.filter(n=>!uoe(n))}async function jNn(e,t,n,r,i){try{const o=n?lNn(t,n):t,s=Ame(t);let a;return i||(a=await Rme(o,s,r)),e.replace(NNn(t),`$1${a}$3`)}catch{}return e}function BNn(e,{preferredFontFormat:t}){return t?e.replace($Nn,n=>{for(;;){const[r,,i]=FNn.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function eit(e){return e.search(Jrt)!==-1}async function tit(e,t,n){if(!eit(e))return e;const r=BNn(e,n);return zNn(r).reduce((o,s)=>o.then(a=>jNn(a,s,t,n)),Promise.resolve(r))}async function Y_(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const o=await tit(i,null,n);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function UNn(e,t){await Y_("background",e,t)||await Y_("background-image",e,t),await Y_("mask",e,t)||await Y_("-webkit-mask",e,t)||await Y_("mask-image",e,t)||await Y_("-webkit-mask-image",e,t)}async function VNn(e,t){const n=Ic(e,HTMLImageElement);if(!(n&&!uoe(e.src))&&!(Ic(e,SVGImageElement)&&!uoe(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Rme(r,Ame(r),t);await new Promise((o,s)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...l)=>{try{o(t.onImageErrorHandler(...l))}catch(c){s(c)}}:s;const a=e;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function WNn(e,t){const r=B0(e.childNodes).map(i=>nit(i,t));await Promise.all(r).then(()=>e)}async function nit(e,t){Ic(e,Element)&&(await UNn(e,t),await VNn(e,t),await WNn(e,t))}function HNn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const lAe={};async function cAe(e){let t=lAe[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},lAe[e]=t,t}async function uAe(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),Krt(a,t.fetchRequestInit,({result:l})=>(n=n.replace(s,`url(${l})`),[s,l]))});return Promise.all(o).then(()=>n)}function fAe(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(s,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=a.exec(r),l===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;t.push(l[0])}return t}async function GNn(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{B0(i.cssRules||[]).forEach((o,s)=>{if(o.type===CSSRule.IMPORT_RULE){let a=s+1;const l=o.href,c=cAe(l).then(u=>uAe(u,t)).then(u=>fAe(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?a+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(o){const s=e.find(a=>a.href==null)||document.styleSheets[0];i.href!=null&&r.push(cAe(i.href).then(a=>uAe(a,t)).then(a=>fAe(a).forEach(l=>{s.insertRule(l,s.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{B0(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function qNn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>eit(t.style.getPropertyValue("src")))}async function XNn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=B0(e.ownerDocument.styleSheets),r=await GNn(n,t);return qNn(r)}function rit(e){return e.trim().replace(/["']/g,"")}function YNn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(o=>{t.add(rit(o))}),Array.from(r.children).forEach(o=>{o instanceof HTMLElement&&n(o)})}return n(e),t}async function QNn(e,t){const n=await XNn(e,t),r=YNn(e);return(await Promise.all(n.filter(o=>r.has(rit(o.style.fontFamily))).map(o=>{const s=o.parentStyleSheet?o.parentStyleSheet.href:null;return tit(o.cssText,s,t)}))).join(` -`)}async function KNn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await QNn(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function ZNn(e,t={}){const{width:n,height:r}=Qrt(e,t),i=await CW(e,t,!0);return await KNn(i,t),await nit(i,t),HNn(i,t),await gNn(i,n,r)}async function JNn(e,t={}){const{width:n,height:r}=Qrt(e,t),i=await ZNn(e,t),o=await _4(i),s=document.createElement("canvas"),a=s.getContext("2d"),l=t.pixelRatio||dNn(),c=t.canvasWidth||n,u=t.canvasHeight||r;return s.width=c*l,s.height=u*l,t.skipAutoScale||hNn(s),s.style.width=`${c}`,s.style.height=`${u}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}function e3n(e,t){t3n(e,t).then(()=>{t?.handleSuccess&&t.handleSuccess()}).catch(n=>{if(t?.handleError)t.handleError(n);else throw n})}async function t3n(e,t){const n=t.format||"png";let r=t.hiddenElements;typeof r=="function"?r=r(e):Array.isArray(r)||(r=[]),r.forEach(f=>{f.style.visibility="hidden"});const s=t.exportResolution/96,a=t.width||e.clientWidth,l=t.height||e.clientHeight,c=await JNn(e,{width:a*s,height:l*s,style:{transform:`scale(${s})`,transformOrigin:"top left",width:`${a}px`,height:`${l}px`},pixelRatio:1,canvasWidth:a*s,canvasHeight:l*s,backgroundColor:"#00000000",skipFonts:!0}),u=await new Promise((f,d)=>{c.toBlob(h=>{h===null?d(new Error("Failed to create a blob from the canvas.")):f(h)},`image/${n}`)});await navigator.clipboard.write([new ClipboardItem({[u.type]:u})]),r.forEach(f=>{f.style.visibility="visible"})}function iit(e,t){const{postMessage:n,hiddenElements:r,exportResolution:i}=t,o=M.useCallback(()=>{n("success",Ce.get("Snapshot copied to clipboard"))},[n]),s=M.useCallback(l=>{const c="Error copying snapshot to clipboard";console.error(c+":",l),n("error",Ce.get(c))},[n]);return{onSnapshotClick:M.useCallback(()=>{e.current?e3n(e.current,{format:"png",handleSuccess:o,handleError:s,hiddenElements:r,exportResolution:i}):s(new Error("missing element reference"))},[e,o,s,r,i])}}function n3n({postMessage:e,exportResolution:t,hiddenElementItems:n=[],className:r}){const i=xOn(),s={hiddenElements:l=>Wet(l,n),postMessage:e,exportResolution:t},{onSnapshotClick:a}=iit(i,s);return O.jsx(m5,{className:r,icon:O.jsx(Xrt,{fontSize:"small"}),tooltipTitle:Ce.get("Copy snapshot to clipboard"),onClick:a})}const r3n={left:"0.5em",top:75};function i3n({layerMenuOpen:e,setLayerMenuOpen:t,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o,postMessage:s,exportResolution:a}){return O.jsxs(aNn,{style:r3n,children:[O.jsx(m5,{className:"layer-panel",icon:O.jsx(qrt,{fontSize:"small"}),tooltipTitle:Ce.get("Show or hide layers panel"),selected:e,onSelect:(l,c)=>void t(c)}),O.jsx(m5,{className:"split-mode",icon:O.jsx(oNn,{fontSize:"small"}),tooltipTitle:Ce.get("Turn layer split mode on or off"),selected:n,onSelect:(l,c)=>void r(c)}),O.jsx(m5,{className:"info-box",icon:O.jsx(sNn,{fontSize:"small"}),tooltipTitle:Ce.get("Turn info box on or off"),selected:i,onSelect:(l,c)=>void o(c)}),O.jsx(n3n,{className:"snapshot-button",postMessage:s,exportResolution:a,hiddenElementItems:[".ol-unselectable.ol-control.MuiBox-root.css-0",".ol-zoom.ol-unselectable.ol-control"]})]})}const o3n=e=>({layerMenuOpen:e.controlState.layerMenuOpen,variableCompareMode:e.controlState.variableCompareMode,mapPointInfoBoxEnabled:e.controlState.mapPointInfoBoxEnabled,exportResolution:e.controlState.exportResolution}),s3n={setLayerMenuOpen:Ftt,setVariableCompareMode:bEn,setMapPointInfoBoxEnabled:yEn,postMessage:aa},a3n=dr(o3n,s3n)(i3n),w2={container:e=>({position:"absolute",zIndex:1e3,border:wW(e),borderRadius:"4px",backgroundColor:Bt(e.palette.background.default,.85),minWidth:"120px",paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),paddingBottom:e.spacing(.5),paddingTop:e.spacing(.5),display:"flex",flexDirection:"row",justifyContent:"space-between",gap:1}),title:{fontSize:"0.8rem",fontWeight:"normal",wordBreak:"break-word",wordWrap:"break-word"},subTitle:{fontSize:"0.7rem",fontWeight:"lighter",wordBreak:"break-word",wordWrap:"break-word"}};function l3n({style:e,zoomLevel:t,datasetLevel:n,datasetLevels:r,visibility:i}){return i?O.jsx("div",{children:O.jsxs(bt,{sx:w2.container,style:e,children:[O.jsxs(bt,{children:[O.jsx(yn,{sx:w2.title,variant:"subtitle1",color:"textPrimary",children:"Zoom"}),O.jsx(yn,{sx:w2.subTitle,variant:"subtitle2",color:"textPrimary",children:t!==void 0?jf(t,4):"no zoom level"})]}),O.jsx(oa,{orientation:"vertical",flexItem:!0}),O.jsxs(bt,{children:[O.jsx(yn,{sx:w2.title,variant:"subtitle1",color:"textPrimary",children:"Level"}),O.jsx(yn,{sx:w2.subTitle,variant:"subtitle2",color:"textPrimary",children:n!==void 0?jf(n+1,0)+" / "+jf(r,0):"no dataset level"})]})]})}):null}const c3n=e=>({style:{left:"0.5em",bottom:40},zoomLevel:uLt(e),datasetLevel:OLt(e),datasetLevels:Z6e(e).length,visibility:e.controlState.showZoomInfoBox}),u3n={setZoomLevel:int},f3n=dr(c3n,u3n)(l3n),d3n=(e,t)=>({mapId:"map",locale:e.controlState.locale,variableLayer:eFt(e),variable2Layer:tFt(e),rgbLayer:nFt(e),rgb2Layer:rFt(e),datasetBoundaryLayer:JLt(e),placeGroupLayers:aFt(e),colorBarLegend:O.jsx(V$n,{}),colorBarLegend2:O.jsx(G$n,{}),mapSplitter:O.jsx(K$n,{}),mapPointInfoBox:O.jsx(iNn,{}),mapControlActions:O.jsx(a3n,{}),userDrawnPlaceGroupName:e.controlState.userDrawnPlaceGroupName,userPlaceGroups:wD(e),userPlaceGroupsVisibility:LLt(e),showUserPlaces:X6e(e),mapInteraction:e.controlState.mapInteraction,mapProjection:Ov(e),selectedPlaceId:e.controlState.selectedPlaceId,places:OD(e),baseMapLayers:pFt(e),overlayLayers:gFt(e),imageSmoothing:_D(e),variableSplitPos:e.controlState.variableSplitPos,onMapRef:t.onMapRef,showProgressBar:e.controlState.showProgressBar,zoomBox:O.jsx(f3n,{})}),h3n={addDrawnUserPlace:IOn,importUserPlacesFromText:Yet,selectPlace:lW,setZoomLevel:int,setDatasetZLevel:IEn},OY=dr(d3n,h3n)(n$n),p3n=ot(O.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"}),"Details"),g3n=ot(O.jsx("path",{d:"m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99z"}),"StackedLineChart"),m3n=ot(O.jsx("path",{d:"M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95s.33.5.56.69c.24.18.51.32.82.41q.45.15.96.15c.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72.2-.61.2-.97c0-.19-.02-.38-.07-.56s-.12-.35-.23-.51c-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33s.27-.27.37-.42.17-.3.22-.46.07-.32.07-.48q0-.54-.18-.96t-.51-.69c-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3q0-.255.09-.45c.09-.195.14-.25.25-.34s.23-.17.38-.22.3-.08.48-.08c.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49s-.14.27-.25.37-.25.18-.41.24-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4s.1.35.1.57c0 .41-.12.72-.35.93-.23.23-.55.33-.95.33m8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27s.84-.43 1.16-.76.57-.73.74-1.19c.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57q-.27-.705-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85s-.43.41-.71.53q-.435.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0"}),"ThreeDRotation"),v3n=({contribution:e,panelIndex:t})=>{const n=e.componentResult;return n.status==="pending"?O.jsx(Eh,{},e.name):n.error?O.jsx("div",{children:O.jsx(yn,{color:"error",children:n.error.message})},e.name):e.component?O.jsx(qUe,{...e.component,onChange:r=>{p$t("panels",t,r)}},e.name):null},Ime={sidebarColor:"#181818",backgroundColor:"#1F1F1F",borderColor:"#2B2B2B"},Dme={sidebarColor:"#F8F8F8",backgroundColor:"#FFFFFF",borderColor:"#E5E5E5"},y3n=e=>(e.palette.mode==="dark"?Ime:Dme).sidebarColor,b3n=e=>(e.palette.mode==="dark"?Ime:Dme).backgroundColor,S2=e=>(e.palette.mode==="dark"?Ime:Dme).borderColor,X1={mainContainer:e=>({display:"flex",flexDirection:"row",backgroundColor:b3n(e),width:"100%",height:"100%",overflow:"hidden"}),panelContainer:{display:"flex",flexDirection:"column",flex:"1 1 auto",overflow:"hidden"},panelHeader:e=>({padding:1,borderTop:`1px solid ${S2(e)}`,borderRight:`1px solid ${S2(e)}`,borderBottom:`1px solid ${S2(e)}`,flex:"0 0 auto"}),panelContent:e=>({padding:1,borderRight:`1px solid ${S2(e)}`,flex:"1 1 auto",overflow:"auto"}),sidebarContainer:e=>({display:"flex",flexDirection:"column",gap:1,padding:1,borderTop:`1px solid ${S2(e)}`,backgroundColor:y3n(e),flex:"0 0 auto"}),sidebarButton:e=>({color:e.palette.text.secondary}),sidebarButtonSelected:e=>({background:e.palette.action.selected})};function x3n(e){return e.filter(w3n).map(S3n).sort(_3n)}function w3n(e){return!!e.content&&!e.hidden}function S3n(e,t){return!Lr(e.position)||e.position<0?{...e,position:t}:e}function _3n(e,t){if(Lr(e.position))if(Lr(t.position)){const r=e.position-t.position;if(r!==0)return r}else return-1;else if(Lr(t.position))return 1;const n=e.title.localeCompare(t.title);return n===0?e.id.localeCompare(t.id):n}function C3n({hidden:e,panels:t,selectedPanelId:n,setSelectedPanelId:r}){const i=M.useMemo(()=>x3n(t||[]),[t]);return e?null:O.jsx(bt,{sx:X1.sidebarContainer,children:i.map(o=>O.jsx(Wl,{sx:o.id===n?X1.sidebarButtonSelected:X1.sidebarButton,disabled:o.disabled,icon:o.icon,tooltipText:o.tooltip||o.title,tooltipPlacement:"left",selected:o.id===n,onClick:()=>r(o.id!==n?o.id:null)},o.id))})}function O3n({selectedPanel:e}){return O.jsx(bt,{sx:X1.panelHeader,children:O.jsx(yn,{variant:"subtitle2",color:"textSecondary",sx:{textTransform:"uppercase",fontWeight:"normal"},children:e?.title})})}function E3n({selectedPanel:e}){return O.jsx(bt,{sx:X1.panelContent,children:e?.content})}function T3n({width:e,height:t,panels:n,selectedPanelId:r,setSelectedPanelId:i}){const o=M.useMemo(()=>n&&n.find(s=>s.id===r),[n,r]);return O.jsxs(bt,{width:e||"100%",height:t||"100%",sx:X1.mainContainer,children:[r&&O.jsxs(bt,{sx:X1.panelContainer,children:[O.jsx(O3n,{selectedPanel:o}),O.jsx(E3n,{selectedPanel:o})]}),O.jsx(C3n,{panels:n,selectedPanelId:r,setSelectedPanelId:i})]})}const Eu={accordion:{border:"none",background:"none"},accordionSummary:{padding:"0 4px"},accordionDetails:{padding:"0 4px",display:"flex",flexDirection:"column",gap:1},cardHeader:{padding:0},cardTitle:{display:"flex",gap:1,fontSize:"1rem"},cardContent:{padding:"4px 0"},table:{borderRadius:0},media:{maxHeight:200},code:{fontFamily:"Monospace"},toggleButton:{},htmlContent:e=>({background:e.palette.mode==="dark"?"#383838":"#e0e0e0",padding:1,fontFamily:"Roboto",fontSize:"0.75rem"})};function foe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function P3n(e,t){const n=M3n(t.id);return["from xcube.core.store import new_data_store","","store = new_data_store(",' "s3",',' root="datasets", # can also use "pyramids" here'," storage_options={",' "anon": True,',' "client_kwargs": {',` "endpoint_url": "${e.url}/s3"`," }"," }",")","# store.list_data_ids()",`dataset = store.open_data(data_id="${n}")`].join(` -`)}function k3n(e,t,n){const r=t.name,i=t.colorBarMin,o=t.colorBarMax,s=t.colorBarName;let a="";n!==null&&(a=`sel(time="${ET(n)}", method="nearest")`);const l=[];if(dD(t)){const c=t.expression;l.push("from xcube.util.expression import compute_array_expr"),l.push("from xcube.util.expression import new_dataset_namespace"),l.push(""),l.push("namespace = new_dataset_namespace(dataset)"),l.push(`${r} = compute_array_expr("${c}", namespace`),a&&l.push(`${r} = ${r}.${a}`)}else a?l.push(`${r} = dataset.${r}.${a}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${s}")`),l.join(` -`)}function M3n(e){return A3n(e)[0]+".zarr"}function A3n(e){const t=e.lastIndexOf(".");return t>=0?[e.substring(0,t),e.substring(t)]:[e,""]}function R3n(e){return typeof e=="string"?e:typeof e=="object"?JSON.stringify(e):`${e}`}const I3n={keyValueTableContainer:e=>({background:e.palette.mode==="dark"?"#181818":"#f0f0f0"})},UR=({data:e,types:t})=>O.jsx(mle,{sx:I3n.keyValueTableContainer,children:O.jsx(sU,{sx:Eu.table,size:"small",children:O.jsx(lU,{children:e.map((n,r)=>{const[i,o]=n,s=R3n(o),a=typeof o=="string"&&s.startsWith("https://");return O.jsxs(pf,{children:[O.jsx(mi,{children:i}),t&&O.jsx(mi,{children:Array.isArray(o)?"array":typeof o}),O.jsx(mi,{align:"right",children:a?O.jsx(_wt,{href:s,target:"_blank",rel:"noreferrer",children:s}):s})]},r)})})})}),oit=1024;let D3n=0,EY=class{constructor(t,n){this.from=t,this.to=n}};class yr{constructor(t={}){this.id=D3n++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Hc.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}yr.closedBy=new yr({deserialize:e=>e.split(" ")});yr.openedBy=new yr({deserialize:e=>e.split(" ")});yr.group=new yr({deserialize:e=>e.split(" ")});yr.isolate=new yr({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});yr.contextHash=new yr({perNode:!0});yr.lookAhead=new yr({perNode:!0});yr.mounted=new yr({perNode:!0});class C4{constructor(t,n,r){this.tree=t,this.overlay=n,this.parser=r}static get(t){return t&&t.props&&t.props[yr.mounted.id]}}const L3n=Object.create(null);class Hc{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):L3n,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new Hc(t.name||"",n,t.id,r);if(t.props){for(let o of t.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(yr.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(yr.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Hc.none=new Hc("",Object.create(null),0,8);class Lme{constructor(t){this.types=t;for(let n=0;n0;for(let l=this.cursor(s|Ms.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Nme(Hc.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new gs(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new gs(Hc.none,n,r,i)))}static build(t){return z3n(t)}}gs.empty=new gs(Hc.none,[],[],0);class Fme{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Fme(this.buffer,this.index)}}class hb{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return Hc.none}toString(){let t=[];for(let n=0;n0));l=s[l+3]);return a}slice(t,n,r){let i=this.buffer,o=new Uint16Array(n-t),s=0;for(let a=t,l=0;a=t&&nt;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function VR(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?a.length:-1;t!=c;t+=n){let u=a[t],f=l[t]+s.from;if(sit(i,r,f,f+u.length)){if(u instanceof hb){if(o&Ms.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new kp(new F3n(s,u,t,f),null,d)}else if(o&Ms.IncludeAnonymous||!u.type.isAnonymous||$me(u)){let d;if(!(o&Ms.IgnoreMounts)&&(d=C4.get(u))&&!d.overlay)return new Dc(d.tree,f,t,s);let h=new Dc(u,f,t,s);return o&Ms.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Ms.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?t=s.index+n:t=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&Ms.IgnoreOverlays)&&(i=C4.get(this._tree))&&i.overlay){let o=t-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s=o:a>o))return new Dc(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function hAe(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function doe(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class F3n{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class kp extends ait{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new kp(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&Ms.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return o<0?null:new kp(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new kp(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new kp(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];t.push(r.slice(i,o,s)),n.push(0)}return new gs(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function lit(e){if(!e.length)return null;let t=0,n=e[0];for(let o=1;on.from||s.to=t){let a=new Dc(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(VR(a,t,n,!1))}}return i?lit(i):r}class hoe{get name(){return this.type.name}constructor(t,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof Dc)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof Dc?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&Ms.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ms.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Ms.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index-1)for(let o=n+t,s=t<0?-1:r._tree.children.length;o!=s;o+=t){let a=r._tree.children[o];if(this.mode&Ms.IncludeAnonymous||a instanceof hb||!a.type.isAnonymous||$me(a))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let s=t;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return doe(this._tree,t,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(t[i]&&t[i]!=s.name)return!1;i--}}return!0}}function $me(e){return e.children.some(t=>t instanceof hb||!t.type.isAnonymous||$me(t))}function z3n(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=oit,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new Fme(n,n.length):n,l=r.types,c=0,u=0;function f(S,_,E,T,k,P){let{id:R,start:I,end:F,size:A}=a,L=u,$=c;if(A<0)if(a.next(),A==-1){let N=o[R];E.push(N),T.push(I-S);return}else if(A==-3){c=R;return}else if(A==-4){u=R;return}else throw new RangeError(`Unrecognized record size: ${A}`);let j=l[R],V,U,z=I-S;if(F-I<=i&&(U=m(a.pos-_,k))){let N=new Uint16Array(U.size-U.skip),B=a.pos-U.size,H=N.length;for(;a.pos>B;)H=v(U.start,N,H);V=new hb(N,F-U.start,r),z=U.start-S}else{let N=a.pos-A;a.next();let B=[],H=[],Q=R>=s?R:-1,Y=0,Z=F;for(;a.pos>N;)Q>=0&&a.id==Q&&a.size>=0?(a.end<=Z-i&&(p(B,H,I,Y,a.end,Z,Q,L,$),Y=B.length,Z=a.end),a.next()):P>2500?d(I,N,B,H):f(I,N,B,H,Q,P+1);if(Q>=0&&Y>0&&Y-1&&Y>0){let pe=h(j,$);V=Nme(j,B,H,0,B.length,0,F-I,pe,pe)}else V=g(j,B,H,F-I,L-F,$)}E.push(V),T.push(z)}function d(S,_,E,T){let k=[],P=0,R=-1;for(;a.pos>_;){let{id:I,start:F,end:A,size:L}=a;if(L>4)a.next();else{if(R>-1&&F=0;A-=3)I[L++]=k[A],I[L++]=k[A+1]-F,I[L++]=k[A+2]-F,I[L++]=L;E.push(new hb(I,k[2]-F,r)),T.push(F-S)}}function h(S,_){return(E,T,k)=>{let P=0,R=E.length-1,I,F;if(R>=0&&(I=E[R])instanceof gs){if(!R&&I.type==S&&I.length==k)return I;(F=I.prop(yr.lookAhead))&&(P=T[R]+I.length+F)}return g(S,E,T,k,P,_)}}function p(S,_,E,T,k,P,R,I,F){let A=[],L=[];for(;S.length>T;)A.push(S.pop()),L.push(_.pop()+E-k);S.push(g(r.types[R],A,L,P-k,I-P,F)),_.push(k-E)}function g(S,_,E,T,k,P,R){if(P){let I=[yr.contextHash,P];R=R?[I].concat(R):[I]}if(k>25){let I=[yr.lookAhead,k];R=R?[I].concat(R):[I]}return new gs(S,_,E,T,R)}function m(S,_){let E=a.fork(),T=0,k=0,P=0,R=E.end-i,I={size:0,start:0,skip:0};e:for(let F=E.pos-S;E.pos>F;){let A=E.size;if(E.id==_&&A>=0){I.size=T,I.start=k,I.skip=P,P+=4,T+=4,E.next();continue}let L=E.pos-A;if(A<0||L=s?4:0,j=E.start;for(E.next();E.pos>L;){if(E.size<0)if(E.size==-3||E.size==-4)$+=4;else break e;else E.id>=s&&($+=4);E.next()}k=j,T+=A,P+=$}return(_<0||T==S)&&(I.size=T,I.start=k,I.skip=P),I.size>4?I:void 0}function v(S,_,E){let{id:T,start:k,end:P,size:R}=a;if(a.next(),R>=0&&T4){let F=a.pos-(R-4);for(;a.pos>F;)E=v(S,_,E)}_[--E]=I,_[--E]=P-S,_[--E]=k-S,_[--E]=T}else R==-3?c=T:R==-4&&(u=T);return E}let y=[],b=[];for(;a.pos>0;)f(e.start||0,e.bufferStart||0,y,b,-1,0);let w=(t=e.length)!==null&&t!==void 0?t:y.length?b[0]+y[0].length:0;return new gs(l[e.topID],y.reverse(),b.reverse(),w)}const pAe=new WeakMap;function v5(e,t){if(!e.isAnonymous||t instanceof hb||t.type!=e)return 1;let n=pAe.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof gs)){n=1;break}n+=v5(e,r)}pAe.set(t,n)}return n}function Nme(e,t,n,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;_+=E}if(b==w+1){if(_>u){let E=p[w];h(E.children,E.positions,0,E.children.length,g[w]+y);continue}f.push(p[w])}else{let E=g[b-1]+p[b-1].length-S;f.push(Nme(e,p,g,w,b,S,E,null,l))}d.push(S+y-o)}}return h(t,n,r,i,0),(a||l)(f,d,s)}class j3n{constructor(){this.map=new WeakMap}setBuffer(t,n,r){let i=this.map.get(t);i||this.map.set(t,i=new Map),i.set(n,r)}getBuffer(t,n){let r=this.map.get(t);return r&&r.get(n)}set(t,n){t instanceof kp?this.setBuffer(t.context.buffer,t.index,n):t instanceof Dc&&this.map.set(t.tree,n)}get(t){return t instanceof kp?this.getBuffer(t.context.buffer,t.index):t instanceof Dc?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Y1{constructor(t,n,r,i,o=!1,s=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new Y1(0,t.length,t,0,!1,r)];for(let o of n)o.to>t.length&&i.push(o);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],o=1,s=t.length?t[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.from=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new Y1(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=onew EY(i.from,i.to)):[new EY(0,0)]:[new EY(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let o=i.advance();if(o)return o}}}class B3n{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new yr({perNode:!0});var gAe={};class O4{constructor(t,n,r,i,o,s,a,l,c,u=0,f){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new O4(t,[],n,r,r,0,[],0,i?new mAe(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:o}=this.p,s=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}storeNode(t,n,r,i=4,o=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(t,n,r,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=t,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let o=t,{parser:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new O4(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new U3n(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;ol&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i>19,i=n&65535,o=this.stack.length-r*3;if(o<0||t.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),t.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&t.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class mAe{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class U3n{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class E4{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new E4(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new E4(this.stack,this.pos,this.index)}}function s3(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class y5{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const vAe=new y5;class V3n{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=vAe,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,o=this.pos+t;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=vAe,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class PO{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;W3n(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}PO.prototype.contextual=PO.prototype.fallback=PO.prototype.extend=!1;PO.prototype.fallback=PO.prototype.extend=!1;class OW{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function W3n(e,t,n,r,i,o){let s=0,a=1<0){let p=e[h];if(l.allows(p)&&(t.token.value==-1||t.token.value==p||H3n(p,t.token.value,i,o))){t.acceptToken(p);break}}let u=t.next,f=0,d=e[s+2];if(t.next<0&&d>f&&e[c+d*3-3]==65535){s=e[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),g=e[p],m=e[p+1]||65536;if(u=m)f=h+1;else{s=e[p+2],t.advance();continue e}}break}}function yAe(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function H3n(e,t,n,r){let i=yAe(n,r,t);return i<0||yAe(n,r,e)t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class G3n{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?bAe(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?bAe(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=s,null;if(o instanceof gs){if(s==t){if(s=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class q3n{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new y5)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:o}=i,s=i.stateSlot(t.state,3),a=t.curContext?t.curContext.hash:0,l=0;for(let c=0;cf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!u.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&t.setLookAhead(l),!r&&t.pos==this.stream.end&&(r=new y5,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new y5,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:o}=r.p;for(let s=0;s=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?t.value=a>>1:t.extended=a>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let o=0;ot.bufferLength*4?new G3n(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&t.length==1){let[s]=t;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(a);else{if(this.advanceStack(a,r,t))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&K3n(i);if(s)return nu&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw nu&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return nu&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let c=t.curContext&&t.curContext.tracker.strict,u=c?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(t.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(yr.contextHash)||0)==u))return t.useNode(f,d),nu&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof gs)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof gs&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(t.state,4);if(a>0)return t.reduce(a),nu&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let c=0;ci?n.push(p):r.push(p)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return xAe(t,n),!0}}runRecovery(t,n,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),nu&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;h<10&&f.forceReduce()&&(nu&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)nu&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))nu&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),nu&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),xAe(a,r)):(!i||i.scoree;class Q3n{constructor(t){this.start=t.start,this.shift=t.shift||PY,this.reduce=t.reduce||PY,this.reuse=t.reuse||PY,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class WR extends cit{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;at.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new Lme(n.map((a,l)=>Hc.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(l)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=oit;let s=s3(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new PO(s,a):a),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new X3n(this,t,n,r);for(let o of this.wrappers)i=o(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let o=this.stateSlot(t,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=_m(this.data,o+2);else break;i=n(_m(this.data,o+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=_m(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(WR.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(o=>o.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=t.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=wAe(s),s})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let o of t.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;or)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,r)<<1|t}return e.get}let Z3n=0;class bf{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=Z3n++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof bf&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new bf(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(t){let n=new T4(t);return r=>r.modified.indexOf(n)>-1?r:T4.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let J3n=0;class T4{constructor(t){this.name=t,this.instances=[],this.id=J3n++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(a=>a.base==t&&ezn(n,a.modified));if(r)return r;let i=[],o=new bf(t.name,i,t,n);for(let a of n)a.instances.push(o);let s=tzn(n);for(let a of t.set)if(!a.modified.length)for(let l of s)i.push(T4.get(a,l));return o}}function ezn(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function tzn(e){let t=[[]];for(let n=0;nr.length-n.length)}function zme(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new HR(r,s,l>0?o.slice(0,l):null);t[c]=u.sort(t[c])}}return uit.add(t)}const uit=new yr({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new HR(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class HR{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function nzn(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function rzn(e,t,n,r=0,i=e.length){let o=new izn(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}class izn{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,o){let{type:s,from:a,to:l}=t;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=ozn(t)||HR.empty,f=nzn(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=t.tree&&t.tree.prop(yr.mounted);if(d&&d.overlay){let h=t.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(m=>!m.scope||m.scope(d.tree.type)),g=t.firstChild();for(let m=0,v=a;;m++){let y=m=b||!t.nextSibling())););if(!y||b>r)break;v=y.to+a,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}g&&t.parent()}else if(t.firstChild()){d&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,o),this.startSpan(Math.min(r,t.to),c)}while(t.nextSibling());t.parent()}}}function ozn(e){let t=e.type.prop(uit);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const jt=bf.define,a3=jt(),t0=jt(),SAe=jt(t0),_Ae=jt(t0),n0=jt(),l3=jt(n0),kY=jt(n0),ep=jt(),Lx=jt(ep),Xh=jt(),Yh=jt(),poe=jt(),_2=jt(poe),c3=jt(),We={comment:a3,lineComment:jt(a3),blockComment:jt(a3),docComment:jt(a3),name:t0,variableName:jt(t0),typeName:SAe,tagName:jt(SAe),propertyName:_Ae,attributeName:jt(_Ae),className:jt(t0),labelName:jt(t0),namespace:jt(t0),macroName:jt(t0),literal:n0,string:l3,docString:jt(l3),character:jt(l3),attributeValue:jt(l3),number:kY,integer:jt(kY),float:jt(kY),bool:jt(n0),regexp:jt(n0),escape:jt(n0),color:jt(n0),url:jt(n0),keyword:Xh,self:jt(Xh),null:jt(Xh),atom:jt(Xh),unit:jt(Xh),modifier:jt(Xh),operatorKeyword:jt(Xh),controlKeyword:jt(Xh),definitionKeyword:jt(Xh),moduleKeyword:jt(Xh),operator:Yh,derefOperator:jt(Yh),arithmeticOperator:jt(Yh),logicOperator:jt(Yh),bitwiseOperator:jt(Yh),compareOperator:jt(Yh),updateOperator:jt(Yh),definitionOperator:jt(Yh),typeOperator:jt(Yh),controlOperator:jt(Yh),punctuation:poe,separator:jt(poe),bracket:_2,angleBracket:jt(_2),squareBracket:jt(_2),paren:jt(_2),brace:jt(_2),content:ep,heading:Lx,heading1:jt(Lx),heading2:jt(Lx),heading3:jt(Lx),heading4:jt(Lx),heading5:jt(Lx),heading6:jt(Lx),contentSeparator:jt(ep),list:jt(ep),quote:jt(ep),emphasis:jt(ep),strong:jt(ep),link:jt(ep),monospace:jt(ep),strikethrough:jt(ep),inserted:jt(),deleted:jt(),changed:jt(),invalid:jt(),meta:c3,documentMeta:jt(c3),annotation:jt(c3),processingInstruction:jt(c3),definition:bf.defineModifier("definition"),constant:bf.defineModifier("constant"),function:bf.defineModifier("function"),standard:bf.defineModifier("standard"),local:bf.defineModifier("local"),special:bf.defineModifier("special")};for(let e in We){let t=We[e];t instanceof bf&&(t.name=e)}fit([{tag:We.link,class:"tok-link"},{tag:We.heading,class:"tok-heading"},{tag:We.emphasis,class:"tok-emphasis"},{tag:We.strong,class:"tok-strong"},{tag:We.keyword,class:"tok-keyword"},{tag:We.atom,class:"tok-atom"},{tag:We.bool,class:"tok-bool"},{tag:We.url,class:"tok-url"},{tag:We.labelName,class:"tok-labelName"},{tag:We.inserted,class:"tok-inserted"},{tag:We.deleted,class:"tok-deleted"},{tag:We.literal,class:"tok-literal"},{tag:We.string,class:"tok-string"},{tag:We.number,class:"tok-number"},{tag:[We.regexp,We.escape,We.special(We.string)],class:"tok-string2"},{tag:We.variableName,class:"tok-variableName"},{tag:We.local(We.variableName),class:"tok-variableName tok-local"},{tag:We.definition(We.variableName),class:"tok-variableName tok-definition"},{tag:We.special(We.variableName),class:"tok-variableName2"},{tag:We.definition(We.propertyName),class:"tok-propertyName tok-definition"},{tag:We.typeName,class:"tok-typeName"},{tag:We.namespace,class:"tok-namespace"},{tag:We.className,class:"tok-className"},{tag:We.macroName,class:"tok-macroName"},{tag:We.propertyName,class:"tok-propertyName"},{tag:We.operator,class:"tok-operator"},{tag:We.comment,class:"tok-comment"},{tag:We.meta,class:"tok-meta"},{tag:We.invalid,class:"tok-invalid"},{tag:We.punctuation,class:"tok-punctuation"}]);const szn=1,dit=194,hit=195,azn=196,CAe=197,lzn=198,czn=199,uzn=200,fzn=2,pit=3,OAe=201,dzn=24,hzn=25,pzn=49,gzn=50,mzn=55,vzn=56,yzn=57,bzn=59,xzn=60,wzn=61,Szn=62,_zn=63,Czn=65,Ozn=238,Ezn=71,Tzn=241,Pzn=242,kzn=243,Mzn=244,Azn=245,Rzn=246,Izn=247,Dzn=248,git=72,Lzn=249,Fzn=250,$zn=251,Nzn=252,zzn=253,jzn=254,Bzn=255,Uzn=256,Vzn=73,Wzn=77,Hzn=263,Gzn=112,qzn=130,Xzn=151,Yzn=152,Qzn=155,zw=10,GR=13,jme=32,EW=9,Bme=35,Kzn=40,Zzn=46,goe=123,EAe=125,mit=39,vit=34,TAe=92,Jzn=111,e5n=120,t5n=78,n5n=117,r5n=85,i5n=new Set([hzn,pzn,gzn,Hzn,Czn,qzn,vzn,yzn,Ozn,Szn,_zn,git,Vzn,Wzn,xzn,wzn,Xzn,Yzn,Qzn,Gzn]);function MY(e){return e==zw||e==GR}function AY(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const o5n=new OW((e,t)=>{let n;if(e.next<0)e.acceptToken(czn);else if(t.context.flags&b5)MY(e.next)&&e.acceptToken(lzn,1);else if(((n=e.peek(-1))<0||MY(n))&&t.canShift(CAe)){let r=0;for(;e.next==jme||e.next==EW;)e.advance(),r++;(e.next==zw||e.next==GR||e.next==Bme)&&e.acceptToken(CAe,-r)}else MY(e.next)&&e.acceptToken(azn,1)},{contextual:!0}),s5n=new OW((e,t)=>{let n=t.context;if(n.flags)return;let r=e.peek(-1);if(r==zw||r==GR){let i=0,o=0;for(;;){if(e.next==jme)i++;else if(e.next==EW)i+=8-i%8;else break;e.advance(),o++}i!=n.indent&&e.next!=zw&&e.next!=GR&&e.next!=Bme&&(i[e,t|yit])),c5n=new Q3n({start:a5n,reduce(e,t,n,r){return e.flags&b5&&i5n.has(t)||(t==Ezn||t==git)&&e.flags&yit?e.parent:e},shift(e,t,n,r){return t==dit?new x5(e,l5n(r.read(r.pos,n.pos)),0):t==hit?e.parent:t==dzn||t==mzn||t==bzn||t==pit?new x5(e,0,b5):PAe.has(t)?new x5(e,0,PAe.get(t)|e.flags&b5):e},hash(e){return e.hash}}),u5n=new OW(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==jme||n==EW)){n!=Kzn&&n!=Zzn&&n!=zw&&n!=GR&&n!=Bme&&e.acceptToken(szn);return}}}),f5n=new OW((e,t)=>{let{flags:n}=t.context,r=n&um?vit:mit,i=(n&fm)>0,o=!(n&dm),s=(n&hm)>0,a=e.pos;for(;!(e.next<0);)if(s&&e.next==goe)if(e.peek(1)==goe)e.advance(2);else{if(e.pos==a){e.acceptToken(pit,1);return}break}else if(o&&e.next==TAe){if(e.pos==a){e.advance();let l=e.next;l>=0&&(e.advance(),d5n(e,l)),e.acceptToken(fzn);return}break}else if(e.next==TAe&&!o&&e.peek(1)>-1)e.advance(2);else if(e.next==r&&(!i||e.peek(1)==r&&e.peek(2)==r)){if(e.pos==a){e.acceptToken(OAe,i?3:1);return}break}else if(e.next==zw){if(i)e.advance();else if(e.pos==a){e.acceptToken(OAe);return}break}else e.advance();e.pos>a&&e.acceptToken(uzn)});function d5n(e,t){if(t==Jzn)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==e5n)for(let n=0;n<2&&AY(e.next);n++)e.advance();else if(t==n5n)for(let n=0;n<4&&AY(e.next);n++)e.advance();else if(t==r5n)for(let n=0;n<8&&AY(e.next);n++)e.advance();else if(t==t5n&&e.next==goe){for(e.advance();e.next>=0&&e.next!=EAe&&e.next!=mit&&e.next!=vit&&e.next!=zw;)e.advance();e.next==EAe&&e.advance()}}const h5n=zme({'async "*" "**" FormatConversion FormatSpec':We.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":We.controlKeyword,"in not and or is del":We.operatorKeyword,"from def class global nonlocal lambda":We.definitionKeyword,import:We.moduleKeyword,"with as print":We.keyword,Boolean:We.bool,None:We.null,VariableName:We.variableName,"CallExpression/VariableName":We.function(We.variableName),"FunctionDefinition/VariableName":We.function(We.definition(We.variableName)),"ClassDefinition/VariableName":We.definition(We.className),PropertyName:We.propertyName,"CallExpression/MemberExpression/PropertyName":We.function(We.propertyName),Comment:We.lineComment,Number:We.number,String:We.string,FormatString:We.special(We.string),Escape:We.escape,UpdateOp:We.updateOperator,"ArithOp!":We.arithmeticOperator,BitOp:We.bitwiseOperator,CompareOp:We.compareOperator,AssignOp:We.definitionOperator,Ellipsis:We.punctuation,At:We.meta,"( )":We.paren,"[ ]":We.squareBracket,"{ }":We.brace,".":We.derefOperator,", ;":We.separator}),p5n={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},g5n=WR.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[u5n,s5n,o5n,f5n,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>p5n[e]||-1}],tokenPrec:7668});let moe=[],bit=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=bit[r])t=r+1;else return!0;if(t==n)return!1}}function kAe(e){return e>=127462&&e<=127487}const MAe=8205;function v5n(e,t,n=!0,r=!0){return(n?xit:y5n)(e,t,r)}function xit(e,t,n){if(t==e.length)return t;t&&wit(e.charCodeAt(t))&&Sit(e.charCodeAt(t-1))&&t--;let r=RY(e,t);for(t+=AAe(r);t=0&&kAe(RY(e,s));)o++,s-=2;if(o%2==0)break;t+=2}else break}return t}function y5n(e,t,n){for(;t>0;){let r=xit(e,t-2,n);if(r=56320&&e<57344}function Sit(e){return e>=55296&&e<56320}function AAe(e){return e<65536?1:2}let Yr=class _it{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=BE(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),wp.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=BE(this,t,n);let r=[];return this.decompose(t,n,r,0),wp.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new mA(this),o=new mA(t);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(t=1){return new mA(this,t)}iterRange(t,n=this.length){return new Cit(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Oit(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?_it.empty:t.length<=32?new Ko(t):wp.from(Ko.split(t,[]))}};class Ko extends Yr{constructor(t,n=b5n(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=t)return new x5n(i,a,r,s);i=a+1,r++}}decompose(t,n,r,i){let o=t<=0&&n>=this.length?this:new Ko(RAe(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let s=r.pop(),a=w5(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Ko(a,s.length+o.length));else{let l=a.length>>1;r.push(new Ko(a.slice(0,l)),new Ko(a.slice(l)))}}else r.push(o)}replace(t,n,r){if(!(r instanceof Ko))return super.replace(t,n,r);[t,n]=BE(this,t,n);let i=w5(this.text,w5(r.text,RAe(this.text,0,t)),n),o=this.length+r.length-(n-t);return i.length<=32?new Ko(i,o):wp.from(Ko.split(i,[]),o)}sliceString(t,n=this.length,r=` -`){[t,n]=BE(this,t,n);let i="";for(let o=0,s=0;o<=n&&st&&s&&(i+=r),to&&(i+=a.slice(Math.max(0,t-o),n-o)),o=l+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let o of t)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Ko(r,i)),r=[],i=-1);return i>-1&&n.push(new Ko(r,i)),n}}class wp extends Yr{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=t)return s.lineInner(t,n,r,i);i=a+1,r=l+1}}decompose(t,n,r,i){for(let o=0,s=0;s<=n&&o=s){let c=i&((s<=t?1:0)|(l>=n?2:0));s>=t&&l<=n&&!c?r.push(a):a.decompose(t-s,n-s,r,c)}s=l+1}}replace(t,n,r){if([t,n]=BE(this,t,n),r.lines=o&&n<=a){let l=s.replace(t-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new wp(u,this.length-(n-t)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=` -`){[t,n]=BE(this,t,n);let i="";for(let o=0,s=0;ot&&o&&(i+=r),ts&&(i+=a.sliceString(t-s,n-s,r)),s=l+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof wp))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=t.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of t)r+=h.lines;if(r<32){let h=[];for(let p of t)p.flatten(h);return new Ko(h,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof wp)for(let g of h.children)f(g);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof Ko&&l&&(p=u[u.length-1])instanceof Ko&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Ko(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:wp.from(u,c)),c=-1,l=u.length=0)}for(let h of t)f(h);return d(),a.length==1?a[0]:new wp(a,n)}}Yr.empty=new Ko([""],0);function b5n(e){let t=-1;for(let n of e)t+=n.length+1;return t}function w5(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(t instanceof Ko?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof Ko?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=` -`,this;t--}else if(i instanceof Ko){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,t))return this.value=t==0?l:n>0?l.slice(t):l.slice(0,l.length-t),this;t-=l.length}else{let l=i.children[s+(n<0?-1:0)];t>l.length?(t-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Ko?l.text.length:l.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Cit{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new mA(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Oit{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Yr.prototype[Symbol.iterator]=function(){return this.iter()},mA.prototype[Symbol.iterator]=Cit.prototype[Symbol.iterator]=Oit.prototype[Symbol.iterator]=function(){return this});let x5n=class{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function BE(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Ia(e,t,n=!0,r=!0){return v5n(e,t,n,r)}function w5n(e){return e>=56320&&e<57344}function S5n(e){return e>=55296&&e<56320}function wc(e,t){let n=e.charCodeAt(t);if(!S5n(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return w5n(r)?(n-55296<<10)+(r-56320)+65536:n}function Ume(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Sp(e){return e<65536?1:2}const voe=/\r\n?|\n/;var ka=(function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e})(ka||(ka={}));class Qp{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return o+(t-i);o+=a}else{if(r!=ka.Simple&&c>=t&&(r==ka.TrackDel&&it||r==ka.TrackBefore&&it))return null;if(c>t||c==t&&n<0&&!a)return t==i||n<0?o:o+l;o+=l}i=c}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return o}touchesRange(t,n=t){for(let r=0,i=0;r=0&&i<=n&&a>=t)return in?"cover":!0;i=a}return!1}toString(){let t="";for(let n=0;n=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qp(t)}static create(t){return new Qp(t)}}class Ps extends Qp{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return yoe(this,(n,r,i,o,s)=>t=t.replace(i,i+(r-n),s),!1),t}mapDesc(t,n=!1){return boe(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length0&&S0(r,n,o.text),o.forward(u),a+=u}let c=t[s++];for(;a>1].toJSON()))}return t}static of(t,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sd||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?Yr.of(h.split(r||voe)):h:Yr.empty,g=p.length;if(f==d&&g==0)return;fs&&ol(i,f-s,-1),ol(i,d-f,g),S0(o,i,p),s=d}}return c(t),l(!a),a}static empty(t){return new Ps(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function S0(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,c,o,u,f),i=c,o=u}}}function boe(e,t,n,r=!1){let i=[],o=r?[]:null,s=new qR(e),a=new qR(t);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);ol(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class qR{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Yr.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?Yr.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class x1{constructor(t,n,r){this.from=t,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new x1(r,i,this.flags)}extend(t,n=t){if(t<=this.anchor&&n>=this.anchor)return ct.range(t,n);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return ct.range(this.anchor,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ct.range(t.anchor,t.head)}static create(t,n,r){return new x1(t,n,r)}}class ct{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:ct.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;rt.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ct(t.ranges.map(n=>x1.fromJSON(n)),t.main)}static single(t,n=t){return new ct([ct.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;it?8:0)|o)}static normalized(t,n=0){let r=t[n];t.sort((i,o)=>i.from-o.from),n=t.indexOf(r);for(let i=1;io.head?ct.range(l,a):ct.range(a,l))}}return new ct(t,n)}}function Tit(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let Vme=0;class nn{constructor(t,n,r,i,o){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Vme++,this.default=t([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(t={}){return new nn(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:Wme),!!t.static,t.enables)}of(t){return new S5([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new S5(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new S5(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function Wme(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class S5{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=Vme++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=t[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:(((n=t[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(t[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||xoe(f,u)){let h=r(f);if(a?!IAe(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let g=k4(d,p);if(this.dependencies.every(m=>m instanceof nn?d.facet(m)===f.facet(m):m instanceof pa?d.field(m,!1)==f.field(m,!1):!0)||(a?IAe(h=r(f),g,i):i(h=r(f),g)))return f.values[s]=g,0}else h=r(f);return f.values[s]=h,1}}}}function IAe(e,t,n){if(e.length!=t.length)return!1;for(let r=0;re[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=e[t.id]>>1;function a(l){let c=[];for(let u=0;ur===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(u3).find(r=>r.field==this);return(n?.create||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>{let o=r.facet(u3),s=i.facet(u3),a;return(a=o.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(t){return[this,u3.of({field:this,create:t})]}get extension(){return this}}const a1={lowest:4,low:3,default:2,high:1,highest:0};function C2(e){return t=>new Pit(t,e)}const Gb={highest:C2(a1.highest),high:C2(a1.high),default:C2(a1.default),low:C2(a1.low),lowest:C2(a1.lowest)};class Pit{constructor(t,n){this.inner=t,this.prec=n}}class TW{of(t){return new woe(this,t)}reconfigure(t){return TW.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class woe{constructor(t,n){this.compartment=t,this.inner=n}}class P4{constructor(t,n,r,i,o,s){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,r){let i=[],o=Object.create(null),s=new Map;for(let d of C5n(t,n,s))d instanceof pa?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r?.config.facets;for(let d in o){let h=o[d],p=h[0].facet,g=u&&u[d]||[];if(h.every(m=>m.type==0))if(a[p.id]=l.length<<1|1,Wme(g,h))l.push(r.facet(p));else{let m=p.combine(h.map(v=>v.value));l.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of h)m.type==0?(a[m.id]=l.length<<1|1,l.push(m.value)):(a[m.id]=c.length<<1,c.push(v=>m.dynamicSlot(v)));a[p.id]=c.length<<1,c.push(m=>_5n(m,p,h))}}let f=c.map(d=>d(a));return new P4(t,s,f,a,l,o)}}function C5n(e,t,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof woe&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof woe){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof Pit)o(s.inner,s.prec);else if(s instanceof pa)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof S5)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,a1.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(e,a1.default),r.reduce((s,a)=>s.concat(a))}function vA(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function k4(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const kit=nn.define(),Soe=nn.define({combine:e=>e.some(t=>t),static:!0}),Mit=nn.define({combine:e=>e.length?e[0]:void 0,static:!0}),Ait=nn.define(),Rit=nn.define(),Iit=nn.define(),Dit=nn.define({combine:e=>e.length?e[0]:!1});class Rg{constructor(t,n){this.type=t,this.value=n}static define(){return new O5n}}class O5n{of(t){return new Rg(this,t)}}class E5n{constructor(t){this.map=t}of(t){return new Gn(this,t)}}class Gn{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Gn(this.type,n)}is(t){return this.type==t}static define(t={}){return new E5n(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let o=i.map(n);o&&r.push(o)}return r}}Gn.reconfigure=Gn.define();Gn.appendConfig=Gn.define();class ms{constructor(t,n,r,i,o,s){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&Tit(r,n.newLength),o.some(a=>a.type==ms.time)||(this.annotations=o.concat(ms.time.of(Date.now())))}static create(t,n,r,i,o,s){return new ms(t,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(ms.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}ms.time=Rg.define();ms.userEvent=Rg.define();ms.addToHistory=Rg.define();ms.remote=Rg.define();function T5n(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r=e[r]))o=e[r++],s=e[r++];else if(i=0;i--){let o=r[i](e);o instanceof ms?e=o:Array.isArray(o)&&o.length==1&&o[0]instanceof ms?e=o[0]:e=Fit(t,kO(o),!1)}return e}function k5n(e){let t=e.startState,n=t.facet(Iit),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=Lit(r,_oe(t,o,e.changes.newLength),!0))}return r==e?e:ms.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const M5n=[];function kO(e){return e==null?M5n:Array.isArray(e)?e:[e]}var wo=(function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e})(wo||(wo={}));const A5n=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Coe;try{Coe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function R5n(e){if(Coe)return Coe.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||A5n.test(n)))return!0}return!1}function I5n(e){return t=>{if(!/\S/.test(t))return wo.Space;if(R5n(t))return wo.Word;for(let n=0;n-1)return wo.Word;return wo.Other}}class Pr{constructor(t,n,r,i,o,s){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(Gn.reconfigure)?(n=null,r=a.value):a.is(Gn.appendConfig)&&(n=null,r=kO(r).concat(a.value));let o;n?o=t.startState.values.slice():(n=P4.resolve(r,i,this),o=new Pr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=t.startState.facet(Soe)?t.newSelection:t.newSelection.asSingle();new Pr(n,t.newDoc,s,o,(a,l)=>l.update(a,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:ct.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=kO(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return Pr.create({doc:t.doc,selection:ct.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=P4.resolve(t.extensions||[],new Map),r=t.doc instanceof Yr?t.doc:Yr.of((t.doc||"").split(n.staticFacet(Pr.lineSeparator)||voe)),i=t.selection?t.selection instanceof ct?t.selection:ct.single(t.selection.anchor,t.selection.head):ct.single(0);return Tit(i,r.length),n.staticFacet(Soe)||(i=i.asSingle()),new Pr(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(Pr.tabSize)}get lineBreak(){return this.facet(Pr.lineSeparator)||` -`}get readOnly(){return this.facet(Dit)}phrase(t,...n){for(let r of this.facet(Pr.phrases))if(Object.prototype.hasOwnProperty.call(r,t)){t=r[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),t}languageDataAt(t,n,r=-1){let i=[];for(let o of this.facet(kit))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,t)&&i.push(s[t]);return i}charCategorizer(t){return I5n(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:n,from:r,length:i}=this.doc.lineAt(t),o=this.charCategorizer(t),s=t-r,a=t-r;for(;s>0;){let l=Ia(n,s,!1);if(o(n.slice(l,s))!=wo.Word)break;s=l}for(;ae.length?e[0]:4});Pr.lineSeparator=Mit;Pr.readOnly=Dit;Pr.phrases=nn.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(i=>e[i]==t[i])}});Pr.languageData=kit;Pr.changeFilter=Ait;Pr.transactionFilter=Rit;Pr.transactionExtender=Iit;TW.reconfigure=Gn.define();function Ig(e,t,n={}){let r={};for(let i of e)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in t)r[i]===void 0&&(r[i]=t[i]);return r}class jw{eq(t){return this==t}range(t,n=t){return XR.create(t,n,this)}}jw.prototype.startSide=jw.prototype.endSide=0;jw.prototype.point=!1;jw.prototype.mapMode=ka.TrackDel;class XR{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new XR(t,n,r)}}function Ooe(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Hme{constructor(t,n,r,i){this.from=t,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-t||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(t,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new Hme(i,o,r,a):null,pos:s}}}class Ur{constructor(t,n,r,i){this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(t,n,r,i){return new Ur(t,n,r,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=t,s=t.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(Ooe)),this.isEmpty)return n.length?Ur.of(n):this;let a=new $it(this,null,-1).goto(0),l=0,c=[],u=new bv;for(;a.value||l=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&t<=o+s.length&&s.between(o,t-o,n-o,r)===!1)return}this.nextLayer.between(t,n,r)}}iter(t=0){return YR.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return YR.from(t).goto(n)}static compare(t,n,r,i,o=-1){let s=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=DAe(s,a,r),c=new O2(s,l,o),u=new O2(a,l,o);r.iterGaps((f,d,h)=>LAe(c,f,u,d,h,i)),r.empty&&r.length==0&&LAe(c,0,u,0,0,i)}static eq(t,n,r=0,i){i==null&&(i=999999999);let o=t.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&t.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=DAe(o,s),l=new O2(o,a,0).goto(r),c=new O2(s,a,0).goto(r);for(;;){if(l.to!=c.to||!Eoe(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(t,n,r,i,o=-1){let s=new O2(t,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(t,n=!1){let r=new bv;for(let i of t instanceof XR?[t]:n?D5n(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return Ur.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=Ur.empty;i=i.nextLayer)n=new Ur(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Ur.empty=new Ur([],[],null,-1);function D5n(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(Ooe);t=r}return e}Ur.empty.nextLayer=Ur.empty;class bv{finishChunk(t){this.chunks.push(new Hme(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new bv)).add(t,n,r)}addInner(t,n,r){let i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}finish(){return this.finishInner(Ur.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Ur.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function DAe(e,t,n){let r=new Map;for(let o of e)for(let s=0;s=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new $it(s,n,r,o));return i.length==1?i[0]:new YR(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let r of this.heap)r.goto(t,n);for(let r=this.heap.length>>1;r>=0;r--)IY(this.heap,r);return this.next(),this}forward(t,n){for(let r of this.heap)r.forward(t,n);for(let r=this.heap.length>>1;r>=0;r--)IY(this.heap,r);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),IY(this.heap,0)}}}function IY(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class O2{constructor(t,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=YR.from(t,n,r)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){f3(this.active,t),f3(this.activeTo,t),f3(this.activeRank,t),this.minActive=FAe(this.active,this.activeTo)}addActive(t){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;d3(this.active,n,r),d3(this.activeTo,n,i),d3(this.activeRank,n,o),t&&d3(t,n,this.cursor.from),this.minActive=FAe(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&f3(r,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(t){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}function LAe(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t;for(;;){let c=e.to+l-n.to,u=c||e.endSide-n.endSide,f=u<0?e.to+l:n.to,d=Math.min(f,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&Eoe(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,d,e.point,n.point):d>a&&!Eoe(e.active,n.active)&&o.compareRange(a,d,e.active,n.active),f>s)break;(c||e.openEnd!=n.openEnd)&&o.boundChange&&o.boundChange(f),a=f,u<=0&&e.next(),u>=0&&n.next()}}function Eoe(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function FAe(e,t){let n=-1,r=1e9;for(let i=0;i=t)return i;if(i==e.length)break;o+=e.charCodeAt(i)==9?n-o%n:1,i=Ia(e,i)}return r===!0?-1:e.length}const Poe="ͼ",$Ae=typeof Symbol>"u"?"__"+Poe:Symbol.for(Poe),koe=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),NAe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class pb{constructor(t,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(g=>s.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in t)o(i(s),t[s],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let t=NAe[$Ae]||1;return NAe[$Ae]=t+1,Poe+t.toString(36)}static mount(t,n,r){let i=t[koe],o=r&&r.nonce;i?o&&i.setNonce(o):i=new L5n(t,o),i.mount(Array.isArray(n)?n:[n],t)}}let zAe=new Map;class L5n{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let o=zAe.get(r);if(o)return t[koe]=o;this.sheet=new i.CSSStyleSheet,zAe.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[koe]=this}mount(t,n){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},F5n=typeof navigator<"u"&&/Mac/.test(navigator.platform),$5n=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ea=0;Ea<10;Ea++)gb[48+Ea]=gb[96+Ea]=String(Ea);for(var Ea=1;Ea<=24;Ea++)gb[Ea+111]="F"+Ea;for(var Ea=65;Ea<=90;Ea++)gb[Ea]=String.fromCharCode(Ea+32),QR[Ea]=String.fromCharCode(Ea);for(var DY in gb)QR.hasOwnProperty(DY)||(QR[DY]=gb[DY]);function N5n(e){var t=F5n&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||$5n&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?QR:gb)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Ni(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t2);var qt={mac:BAe||/Mac/.test(Rl.platform),windows:/Win/.test(Rl.platform),linux:/Linux|X11/.test(Rl.platform),ie:PW,ie_version:zit?Moe.documentMode||6:Roe?+Roe[1]:Aoe?+Aoe[1]:0,gecko:jAe,gecko_version:jAe?+(/Firefox\/(\d+)/.exec(Rl.userAgent)||[0,0])[1]:0,chrome:!!LY,chrome_version:LY?+LY[1]:0,ios:BAe,android:/Android\b/.test(Rl.userAgent),webkit_version:z5n?+(/\bAppleWebKit\/(\d+)/.exec(Rl.userAgent)||[0,0])[1]:0,safari:Ioe,safari_version:Ioe?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Rl.userAgent)||[0,0])[1]:0,tabSize:Moe.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function KR(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function Doe(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function _5(e,t){if(!t.anchorNode)return!1;try{return Doe(e,t.anchorNode)}catch{return!1}}function UE(e){return e.nodeType==3?Uw(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function yA(e,t,n,r){return n?UAe(e,t,n,r,-1)||UAe(e,t,n,r,1):!1}function Bw(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function M4(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function UAe(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ug(e))){if(e.nodeName=="DIV")return!1;let o=e.parentNode;if(!o||o.nodeType!=1)return!1;t=Bw(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=i<0?ug(e):0}else return!1}}function ug(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function WL(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function j5n(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function jit(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function B5n(e,t,n,r,i,o,s,a){let l=e.ownerDocument,c=l.defaultView||window;for(let u=e,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,g=1;if(h)d=j5n(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:g}=jit(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*g}}let m=0,v=0;if(i=="nearest")t.top0&&t.bottom>d.bottom+v&&(v=t.bottom-d.bottom+s)):t.bottom>d.bottom&&(v=t.bottom-d.bottom+s,n<0&&t.top-v0&&t.right>d.right+m&&(m=t.right-d.right+o)):t.right>d.right&&(m=t.right-d.right+o,n<0&&t.leftd.bottom||t.leftd.right)&&(t={left:Math.max(t.left,d.left),right:Math.min(t.right,d.right),top:Math.max(t.top,d.top),bottom:Math.min(t.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function U5n(e){let t=e.ownerDocument,n,r;for(let i=e.parentNode;i&&!(i==t.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class V5n{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:r}=t;this.set(n,Math.min(t.anchorOffset,n?ug(n):0),r,Math.min(t.focusOffset,r?ug(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Xx=null;qt.safari&&qt.safari_version>=26&&(Xx=!1);function Bit(e){if(e.setActive)return e.setActive();if(Xx)return e.focus(Xx);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(Xx==null?{get preventScroll(){return Xx={preventScroll:!0},!0}}:void 0),!Xx){Xx=!1;for(let n=0;nMath.max(1,e.scrollHeight-e.clientHeight-4)}function Wit(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=ug(n)}else if(n.parentNode&&!M4(n))r=Bw(n),n=n.parentNode;else return null}}function Hit(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&rn)return f.domBoundsAround(t,n,c);if(d>=t&&i==-1&&(i=l,o=c),c>n&&f.dom.parentNode==this.dom){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let n=this.parent;n;n=n.parent){if(t&&(n.flags|=2),n.flags&1)return;n.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let n=t.parent;if(!n)return t;t=n}}replaceChildren(t,n,r=Gme){this.markDirty();for(let i=t;ithis.pos||t==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function qit(e,t,n,r,i,o,s,a,l){let{children:c}=e,u=c.length?c[t]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:s;if(!(t==r&&u&&!s&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,a,l))){if(r0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(nG5n||r.flags&8)?!1:(this.text=this.text.slice(0,t)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(t){let n=new Ch(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(t,n){return t==this.dom?n:n?this.text.length:0}domAtPos(t){return new cl(this.dom,t)}domBoundsAround(t,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,n){return q5n(this.dom,t,n)}}class xv extends Ii{constructor(t,n=[],r=0){super(),this.mark=t,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(t){if(Uit(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)t.setAttribute(n,this.mark.attrs[n]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,n)}merge(t,n,r,i,o,s){return r&&(!(r instanceof xv&&r.mark.eq(this.mark))||t&&o<=0||nt&&n.push(r=t&&(i=o),r=l,o++}let s=this.length-t;return this.length=t,i>-1&&(this.children.length=i,this.markDirty()),new xv(this.mark,n,s)}domAtPos(t){return Yit(this,t)}coordsAt(t,n){return Kit(this,t,n)}}function q5n(e,t,n){let r=e.nodeValue.length;t>r&&(t=r);let i=t,o=t,s=0;t==0&&n<0||t==r&&n>=0?qt.chrome||qt.gecko||(t?(i--,s=1):o=0)?0:a.length-1];return qt.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?WL(l,s<0):l||null}class jm extends Ii{static create(t,n,r){return new jm(t,n,r)}constructor(t,n,r){super(),this.widget=t,this.length=n,this.side=r,this.prevWidget=null}split(t){let n=jm.create(this.widget,this.length-t,this.side);return this.length-=t,n}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,n,r,i,o,s){return r&&(!(r instanceof jm)||!this.widget.compare(r.widget)||t>0&&o<=0||n0)?cl.before(this.dom):cl.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,n){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:t>0;for(let a=s?i.length-1:0;o=i[a],!(t>0?a==0:a==i.length-1||o.top0?cl.before(this.dom):cl.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Yr.empty}get isHidden(){return!0}}Ch.prototype.children=jm.prototype.children=VE.prototype.children=Gme;function Yit(e,t){let n=e.dom,{children:r}=e,i=0;for(let o=0;io&&t0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o0&&t instanceof xv&&i.length&&(r=i[i.length-1])instanceof xv&&r.mark.eq(t.mark)?Qit(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function Kit(e,t,n){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let f=0,d=0;f=u&&(h.children.length?a(h,u-d):(!o||o.isHidden&&(n>0||Y5n(o,h)))&&(p>u||d==p&&h.getSide()>0)?(o=h,s=u-d):(d-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||e[o]!==t[o]))return!1;return!0}function Foe(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i=="style"?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i=="style"?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Q5n(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new mb(t,n,n,r,t.widget||null,!1)}static replace(t){let n=!!t.block,r,i;if(t.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=Zit(t,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new mb(t,r,i,n,t.widget||null,!0)}static line(t){return new GL(t)}static set(t,n=!1){return Ur.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}vn.none=Ur.empty;class HL extends vn{constructor(t){let{start:n,end:r}=Zit(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var n,r;return this==t||t instanceof HL&&this.tagName==t.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(t.class||((r=t.attrs)===null||r===void 0?void 0:r.class))&&A4(this.attrs,t.attrs,"class")}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}HL.prototype.point=!1;class GL extends vn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof GL&&this.spec.class==t.spec.class&&A4(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}GL.prototype.mapMode=ka.TrackBefore;GL.prototype.point=!0;class mb extends vn{constructor(t,n,r,i,o,s){super(n,r,o,t),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?ka.TrackBefore:ka.TrackAfter:ka.TrackDel}get type(){return this.startSide!=this.endSide?ql.WidgetRange:this.startSide<=0?ql.WidgetBefore:ql.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof mb&&K5n(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}mb.prototype.point=!0;function Zit(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n??t,end:r??t}}function K5n(e,t){return e==t||!!(e&&t&&e.compare(t))}function C5(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}class us extends Ii{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,n,r,i,o,s){if(r){if(!(r instanceof us))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),Xit(this,t,n,r?r.children.slice():[],o,s),!0}split(t){let n=new us;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(t);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=t,n}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){A4(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,n){Qit(this,t,n)}addLineDeco(t){let n=t.spec.attributes,r=t.spec.class;n&&(this.attrs=Loe(n,this.attrs||{})),r&&(this.attrs=Loe({class:r},this.attrs||{}))}domAtPos(t){return Yit(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,n){var r;this.dom?this.flags&4&&(Uit(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Foe(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,n);let i=this.dom.lastChild;for(;i&&Ii.get(i)instanceof xv;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Ii.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!qt.ios||!this.children.some(o=>o instanceof Ch))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,n;for(let r of this.children){if(!(r instanceof Ch)||/[^ -~]/.test(r.text))return null;let i=UE(r.dom);if(i.length!=1)return null;t+=i[0].width,n=i[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:n}:null}coordsAt(t,n){let r=Kit(this,t,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=n){if(o instanceof us)return o;if(s>n)break}i=s+o.breakAfter}return null}}class tv extends Ii{constructor(t,n,r){super(),this.widget=t,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(t,n,r,i,o,s){return r&&(!(r instanceof tv)||!this.widget.compare(r.widget)||t>0&&o<=0||n0}}class $oe extends Dg{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class bA{constructor(t,n,r,i){this.doc=t,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof tv&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new us),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(h3(new VE(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof tv)&&this.getLine()}buildText(t,n,r){for(;t>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:a,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}else this.text=s,this.textOff=0}let i=Math.min(this.text.length-this.textOff,t),o=Math.min(i,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(h3(new Ch(this.text.slice(this.textOff,this.textOff+o)),n),r),this.atCursorPos=!0,this.textOff+=o,t-=o,r=i<=o?0:n.length}}span(t,n,r,i){this.buildText(n-t,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(t,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof mb){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-t;if(r instanceof mb)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new tv(r.widget||WE.block,a,r));else{let l=jm.create(r.widget||WE.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(t0),u=!l.isEditable&&(ti.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(h3(new VE(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(h3(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?ti.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(t,n,r,i,o){let s=new bA(t,n,r,o);return s.openEnd=Ur.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function h3(e,t){for(let n of t)e=new xv(n,[e],e.length);return e}class WE extends Dg{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}WE.inline=new WE("span");WE.block=new WE("div");var ho=(function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e})(ho||(ho={}));const Vw=ho.LTR,qme=ho.RTL;function Jit(e){let t=[];for(let n=0;n=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromn:t[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function tot(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;g-=3)if(Qh[g+1]==-h){let m=Qh[g+2],v=m&2?i:m&4?m&1?o:i:0;v&&(zi[f]=zi[Qh[g]]=v),a=g;break}}else{if(Qh.length==189)break;Qh[a++]=f,Qh[a++]=d,Qh[a++]=l}else if((p=zi[f])==2||p==1){let g=p==i;l=g?0:1;for(let m=a-3;m>=0;m-=3){let v=Qh[m+2];if(v&2)break;if(g)Qh[m+2]|=2;else{if(v&4)break;Qh[m+2]|=4}}}}}function rjn(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:e,a=il;)p==m&&(p=n[--g].from,m=g?n[g-1].to:e),zi[--p]=h;l=u}else o=c,l++}}}function zoe(e,t,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=t,c=0;ll&&s.push(new _0(l,g.from,h));let m=g.direction==Vw!=!(h%2);joe(e,m?r+1:r,i,g.inner,g.from,g.to,s),l=g.to}p=g.to}else{if(p==n||(u?zi[p]!=a:zi[p]==a))break;p++}d?zoe(e,l,p,r+1,i,d,s):lt;){let u=!0,f=!1;if(!c||l>o[c-1].to){let g=zi[l-1];g!=a&&(u=!1,f=g==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let g=o[--c];if(!u)for(let m=g.from,v=c;;){if(m==t)break e;if(v&&o[v-1].to==m)m=o[--v].from;else{if(zi[m-1]==a)break e;break}}if(d)d.push(g);else{g.tozi.length;)zi[zi.length]=256;let r=[],i=t==Vw?0:1;return joe(e,i,i,n,0,e.length,r),r}function not(e){return[new _0(0,e,0)]}let rot="";function ojn(e,t,n,r,i){var o;let s=r.head-e.from,a=_0.find(t,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=t[a],c=l.side(i,n);if(s==c){let d=a+=i?1:-1;if(d<0||d>=t.length)return null;l=t[a=d],s=l.side(!i,n),c=l.side(i,n)}let u=Ia(e.text,s,l.forward(i,n));(ul.to)&&(u=c),rot=e.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?t.length-1:0)?null:t[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)e.some(t=>t)}),fot=nn.define({combine:e=>e.some(t=>t)}),dot=nn.define();class AO{constructor(t,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(t){return t.empty?this:new AO(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new AO(ct.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const p3=Gn.define({map:(e,t)=>e.map(t)}),hot=Gn.define();function Pc(e,t,n){let r=e.facet(aot);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const Mm=nn.define({combine:e=>e.length?e[0]:!0});let ajn=0;const ZC=nn.define({combine(e){return e.filter((t,n)=>{for(let r=0;r{let l=[];return s&&l.push(ZR.of(c=>{let u=c.plugin(a);return u?s(u):vn.none})),o&&l.push(o(a)),l})}static fromClass(t,n){return ns.define((r,i)=>new t(r,i),n)}}class FY{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Pc(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Pc(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Pc(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const pot=nn.define(),Qme=nn.define(),ZR=nn.define(),got=nn.define(),qL=nn.define(),mot=nn.define();function GAe(e,t){let n=e.state.facet(mot);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(e):o),i=[];return Ur.spans(r,t.from,t.to,{point(){},span(o,s,a,l){let c=o-t.from,u=s-t.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=sjn(t.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let g={from:c,to:u,direction:h,inner:[]};f.push(g),f=g.inner}}}}),i}const vot=nn.define();function Kme(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(vot)){let s=o(e);s&&(s.left!=null&&(t=Math.max(t,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:t,right:n,top:r,bottom:i}}const AM=nn.define();class Bf{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new Bf(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,r=this;for(;n>0;n--){let i=t[n-1];if(!(i.fromA>r.toA)){if(i.toAu)break;o+=2}if(!l)return r;new Bf(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class R4{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Ps.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new Bf(o,s,a,l))),this.changedRanges=i}static create(t,n,r){return new R4(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class qAe extends Ii{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=vn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new us],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Bf(0,0,0,t.state.doc.length)],0,null)}update(t){var n;let r=t.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!pjn(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let o=i>-1?cjn(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new Bf(c,u,t.changes.mapPos(c,-1),t.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(qt.ie||qt.chrome)&&!o&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=djn(s,a,t.changes);return r=Bf.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,t.startState.doc.length,o),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=qt.chrome||qt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:f}=a,d,h,p,g;if(r&&r.range.fromBu){let w=bA.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),S=bA.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=w.breakAtStart,p=w.openStart,g=S.openEnd;let _=this.compositionView(r);S.breakAtStart?_.breakAfter=1:S.content.length&&_.merge(_.length,_.length,S.content[0],!1,S.openStart,0)&&(_.breakAfter=S.content[0].breakAfter,S.content.shift()),w.content.length&&_.merge(0,0,w.content[w.content.length-1],!0,0,w.openEnd)&&w.content.pop(),d=w.content.concat(_).concat(S.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:g}=bA.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:v}=o.findPos(c,1),{i:y,off:b}=o.findPos(l,-1);qit(this,y,b,m,v,d,h,p,g)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let n of t.transactions)for(let r of n.effects)r.is(hot)&&(this.editContextFormatting=r.value)}compositionView(t){let n=new Ch(t.text.nodeValue);n.flags|=8;for(let{deco:i}of t.marks)n=new xv(i,[n],n.length);let r=new us;return r.append(n,0),r}fixCompositionDOM(t){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Ii.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(t.range.fromB,1),i=this.children[r.i];n(t.line,i);for(let o=t.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?t.marks[o].node:t.text,i)}updateSelection(t=!1,n=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&!(this.view.state.facet(Mm)||this.dom.tabIndex>-1)&&_5(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(qt.gecko&&a.empty&&!this.hasComposition&&ljn(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new cl(f,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!yA(l.node,l.offset,u.anchorNode,u.anchorOffset)||!yA(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{qt.android&&qt.chrome&&this.dom.contains(u.focusNode)&&hjn(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=KR(this.view.root);if(f)if(a.empty){if(qt.gecko){let d=ujn(l.node,l.offset);if(d&&d!=3){let h=(d==1?Wit:Hit)(l.node,l.offset);h&&(l=new cl(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new cl(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new cl(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&yA(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,r=KR(t.root),{anchorNode:i,anchorOffset:o}=t.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=us.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(t){let n=this.dom,r;if(t.node!=n)return t;for(let i=t.offset;!r&&i=0;i--){let o=Ii.get(n.childNodes[i]);o instanceof us&&(r=o.domAtPos(o.length))}return r?new cl(r.node,r.offset,!0):t}nearest(t){for(let n=t;n;){let r=Ii.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(t,n){let r=this.nearest(t);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(t,n)+r.posAtStart}domAtPos(t){let{i:n,off:r}=this.childCursor().findPos(t,-1);for(;n=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(lt||a.covers(1))&&(!r||a instanceof us&&!(r instanceof us&&n>=0)))r=a,i=c;else if(r&&c==t&&l==t&&a instanceof tv&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(r=null)}o=c}return r?r.coordsAt(t-i,n):null}coordsForChar(t){let{i:n,off:r}=this.childPos(t,1),i=this.children[n];if(!(i instanceof us))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof Ch))return null;let o=Ia(i.text,r);if(o==r)return null;let s=Uw(i.dom,r,o).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==ho.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),s){let p=f.dom.lastChild,g=p?UE(p):[];if(g.length){let m=g[g.length-1],v=l?m.right-h.left:h.right-m.left;v>a&&(a=v,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return n}textDirectionAt(t){let{i:n}=this.childPos(t,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?ho.RTL:ho.LTR}measureTextSize(){for(let o of this.children)if(o instanceof us){let s=o.measureTextSize();if(s)return s}let t=document.createElement("div"),n,r,i;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let o=UE(t.firstChild)[0];n=t.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(t=this.length){let n=this.children.length;return n&&(t-=this.children[--n].length),new Git(this.children,t,n)}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;t.push(vn.replace({widget:new $oe(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return vn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(ZR).map(o=>(this.dynamicDecorationMap[t++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(got).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[t++]=r,n.push(Ur.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];tn.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=Kme(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;B5n(this.view.scrollDOM,s,n.headi instanceof jm||i.children.some(r);return r(this.children[n])}}function ljn(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function yot(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Wit(n.focusNode,n.focusOffset),i=Hit(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let a=Ii.get(i.node);if(!a||a instanceof Ch&&a.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let l=Ii.get(r.node);!l||l instanceof Ch&&l.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}function cjn(e,t,n){let r=yot(e,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc,c=new Bf(l.mapPos(o),l.mapPos(s),o,s),u=[];for(let f=i.parentNode;;f=f.parentNode){let d=Ii.get(f);if(d instanceof xv)u.push({node:f,deco:d.mark});else{if(d instanceof us||f.nodeName=="DIV"&&f.parentNode==e.contentDOM)return{range:c,text:i,marks:u,line:f};if(f!=e.contentDOM)u.push({node:f,deco:new HL({inclusive:!0,attributes:Q5n(f),tagName:f.tagName.toLowerCase()})});else return null}}}function ujn(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{rt.from&&(n=!0)}),n}function gjn(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(i.length==0)return ct.cursor(t);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=Ia(i.text,o,!1):a=Ia(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=Ia(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;ae?t.left-e:Math.max(0,e-t.right)}function vjn(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function $Y(e,t){return e.topt.top+1}function XAe(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function Uoe(e,t,n){let r,i,o,s,a=!1,l,c,u,f;for(let p=e.firstChild;p;p=p.nextSibling){let g=UE(p);for(let m=0;mb||s==b&&o>y)&&(r=p,i=v,o=y,s=b,a=y?t0:mv.bottom&&(!u||u.bottomv.top)&&(c=p,f=v):u&&$Y(u,v)?u=YAe(u,v.bottom):f&&$Y(f,v)&&(f=XAe(f,v.top))}}if(u&&u.bottom>=n?(r=l,i=u):f&&f.top<=n&&(r=c,i=f),!r)return{node:e,offset:0};let d=Math.max(i.left,Math.min(i.right,t));if(r.nodeType==3)return QAe(r,d,n);if(a&&r.contentEditable!="false")return Uoe(r,d,n);let h=Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0);return{node:e,offset:h}}function QAe(e,t,n){let r=e.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;an?u.top-n:n-u.bottom)-1;if(u.left-1<=t&&u.right+1>=t&&f=(u.left+u.right)/2,h=d;if(qt.chrome||qt.gecko){let p=Uw(e,a).getBoundingClientRect();Math.abs(p.left-u.right)<.1&&(h=!d)}if(f<=0)return{node:e,offset:a+(h?1:0)};i=a+(h?1:0),o=f}}}return{node:e,offset:i>-1?i:s>0?e.nodeValue.length:0}}function bot(e,t,n,r=-1){var i,o;let s=e.contentDOM.getBoundingClientRect(),a=s.top+e.viewState.paddingTop,l,{docHeight:c}=e.viewState,{x:u,y:f}=t,d=f-a;if(d<0)return 0;if(d>c)return e.state.doc.length;for(let w=e.viewState.heightOracle.textHeight/2,S=!1;l=e.elementAtHeight(d),l.type!=ql.Text;)for(;d=r>0?l.bottom+w:l.top-w,!(d>=0&&d<=c);){if(S)return n?null:0;S=!0,r=-r}f=a+d;let h=l.from;if(he.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:KAe(e,s,l,u,f);let p=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:p,m=g.elementFromPoint(u,f);m&&!e.contentDOM.contains(m)&&(m=null),m||(u=Math.max(s.left+1,Math.min(s.right-1,u)),m=g.elementFromPoint(u,f),m&&!e.contentDOM.contains(m)&&(m=null));let v,y=-1;if(m&&((i=e.docView.nearest(m))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let w=p.caretPositionFromPoint(u,f);w&&({offsetNode:v,offset:y}=w)}else if(p.caretRangeFromPoint){let w=p.caretRangeFromPoint(u,f);w&&({startContainer:v,startOffset:y}=w)}v&&(!e.contentDOM.contains(v)||qt.safari&&yjn(v,y,u)||qt.chrome&&bjn(v,y,u))&&(v=void 0),v&&(y=Math.min(ug(v),y))}if(!v||!e.docView.dom.contains(v)){let w=us.find(e.docView,h);if(!w)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=Uoe(w.dom,u,f))}let b=e.docView.nearest(v);if(!b)return null;if(b.isWidget&&((o=b.dom)===null||o===void 0?void 0:o.nodeType)==1){let w=b.dom.getBoundingClientRect();return t.ye.defaultLineHeight*1.5){let a=e.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(e.defaultLineHeight-a)*.5)/a);o+=l*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+Toe(s,o,e.state.tabSize)}function xot(e,t,n){let r,i=e;if(e.nodeType!=3||t!=(r=e.nodeValue.length))return!1;for(;;){let o=i.nextSibling;if(o){if(o.nodeName=="BR")break;return!1}else{let s=i.parentNode;if(!s||s.nodeName=="DIV")break;i=s}}return Uw(e,r-1,r).getBoundingClientRect().right>n}function yjn(e,t,n){return xot(e,t,n)}function bjn(e,t,n){if(t!=0)return xot(e,t,n);for(let i=e;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=e.nodeType==1?e.getBoundingClientRect():Uw(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Voe(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let i;for(let o of r.type){if(o.from>t)break;if(!(o.tot)return o;(!i||o.type==ql.Text&&(i.type!=o.type||(n<0?o.fromt)))&&(i=o)}}return i||r}return r}function xjn(e,t,n,r){let i=Voe(e,t.head,t.assoc||-1),o=!r||i.type!=ql.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(o){let s=e.dom.getBoundingClientRect(),a=e.textDirectionAt(i.from),l=e.posAtCoords({x:n==(a==ho.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return ct.cursor(l,n?-1:1)}return ct.cursor(n?i.to:i.from,n?-1:1)}function ZAe(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),s=e.textDirectionAt(i.from);for(let a=t,l=null;;){let c=ojn(i,o,s,a,n),u=rot;if(!c){if(i.number==(n?e.state.doc.lines:1))return a;u=` -`,i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),c=e.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function wjn(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return o=>{let s=r(o);return i==wo.Space&&(i=s),i==s}}function Sjn(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return ct.cursor(i,t.assoc);let s=t.goalColumn,a,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(i,t.assoc||-1),u=e.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=e.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let f=l.left+s,d=r??e.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*o,g=bot(e,{x:f,y:p},!1,o);if(pl.bottom||(o<0?gi)){let m=e.docView.coordsForChar(g),v=!m||p{if(t>o&&ti(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:ct.cursor(r,ro)&&!Ojn(s,n)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(t){let n=t.nodeValue;for(let r of this.points)r.node==t&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==t&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(t){if(t.cmIgnore)return;let n=Ii.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let r of this.points)r.node==t&&t.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(t,n){for(let r of this.points)(t.nodeType==3?r.node==t:t.contains(r.node))&&(r.pos=this.text.length+(Cjn(t,r.node,r.offset)?n:0))}}function Cjn(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:o,impreciseAnchor:s}=t.docView;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=t.docView.domBoundsAround(n,r,0))){let a=o||s?[]:Pjn(t),l=new _jn(a,t.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=kjn(a,this.bounds.from)}else{let a=t.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!Doe(t.contentDOM,a.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!Doe(t.contentDOM,a.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=t.viewport;if((qt.ios||qt.chrome)&&t.state.selection.main.empty&&l!=c&&(u.from>0||u.to-1&&t.state.selection.ranges.length>1?this.newSel=t.state.selection.replaceRange(ct.range(c,l)):this.newSel=ct.single(c,l)}}}function Sot(e,t){let n,{newSel:r}=t,i=e.state.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:s,to:a}=t.bounds,l=i.from,c=null;(o===8||qt.android&&t.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:e.state.doc.lineAt(i.from).toDate.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:qt.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` - `&&e.lineWrapping&&(r&&(r=ct.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Yr.of([" "])}),n)return Zme(e,n,r,o);if(r&&!r.main.eq(i)){let s=!1,a="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(s=!0),a=e.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=wot(e.state.facet(qL).map(l=>l(e)),r))),e.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function Zme(e,t,n,r=-1){if(qt.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(qt.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&MO(e.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.lengthi.head)&&MO(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&MO(e.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s,a=()=>s||(s=Tjn(e,t,n));return e.state.facet(lot).some(l=>l(e,t.from,t.to,o,a))||e.dispatch(a()),!0}function Tjn(e,t,n){let r,i=e.state,o=i.selection.main,s=-1;if(t.from==t.to&&t.fromo.to){let l=t.fromf(e)),c,l);t.from==u&&(s=u)}if(s>-1)r={changes:t,selection:ct.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let l=o.fromt.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(l+t.insert.sliceString(0,void 0,e.state.lineBreak)+c))}else{let l=i.changes(t),c=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let u=e.state.sliceDoc(t.from,t.to),f,d=n&&yot(e,n.main.head);if(d){let p=t.insert.length-(t.to-t.from);f={from:d.from,to:d.to-p}}else f=e.state.doc.lineAt(o.head);let h=o.to-t.to;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:l,range:c||p.map(l)};let g=p.to-h,m=g-u.length;if(e.state.sliceDoc(m,g)!=u||g>=f.from&&m<=f.to)return{range:p};let v=i.changes({from:m,to:g,insert:t.insert}),y=p.to-o.to;return{changes:v,range:c?ct.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):p.map(v)}})}else r={changes:l,selection:c&&i.selection.replaceRange(c)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function _ot(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function Pjn(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new JAe(n,r)),(i!=n||o!=r)&&t.push(new JAe(i,o))),t}function kjn(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?ct.single(n+t,r+t):null}class Mjn{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,qt.safari&&t.contentDOM.addEventListener("input",()=>null),qt.gecko&&Gjn(t.contentDOM.ownerDocument)}handleEvent(t){!Njn(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let r=this.handlers[t];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=Ajn(t),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Oot.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),qt.android&&qt.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let n;return qt.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((n=Cot.find(r=>r.keyCode==t.keyCode))&&!t.ctrlKey||Rjn.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=n||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:qt.safari&&!qt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function eRe(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){Pc(n.state,i)}}}function Ajn(e){let t=Object.create(null);function n(r){return t[r]||(t[r]={observers:[],handlers:[]})}for(let r of e){let i=r.spec,o=i&&i.plugin.domEventHandlers,s=i&&i.plugin.domEventObservers;if(o)for(let a in o){let l=o[a];l&&n(a).handlers.push(eRe(r.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(eRe(r.value,l))}}for(let r in Oh)n(r).handlers.push(Oh[r]);for(let r in id)n(r).observers.push(id[r]);return t}const Cot=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Rjn="dthko",Oot=[16,17,18,20,91,92,224,225],g3=6;function m3(e){return Math.max(0,e)*.7+8}function Ijn(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class Djn{constructor(t,n,r,i){this.view=t,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=U5n(t.contentDOM),this.atoms=t.state.facet(qL).map(s=>s(t));let o=t.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(Pr.allowMultipleSelections)&&Ljn(t,n),this.dragging=$jn(t,n)&&Pot(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Ijn(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Kme(this.view);t.clientX-l.left<=i+g3?n=-m3(i-t.clientX):t.clientX+l.right>=s-g3&&(n=m3(t.clientX-s)),t.clientY-l.top<=o+g3?r=-m3(o-t.clientY):t.clientY+l.bottom>=a-g3&&(r=m3(t.clientY-a)),this.setScrollSpeed(n,r)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,r=wot(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Ljn(e,t){let n=e.state.facet(iot);return n.length?n[0](t):qt.mac?t.metaKey:t.ctrlKey}function Fjn(e,t){let n=e.state.facet(oot);return n.length?n[0](t):qt.mac?!t.altKey:!t.ctrlKey}function $jn(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=KR(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=t.clientX&&s.top<=t.clientY&&s.bottom>=t.clientY)return!0}return!1}function Njn(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Ii.get(n))&&r.ignoreEvent(t))return!1;return!0}const Oh=Object.create(null),id=Object.create(null),Eot=qt.ie&&qt.ie_version<15||qt.ios&&qt.webkit_version<604;function zjn(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),Tot(e,n.value)},50)}function kW(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function Tot(e,t){t=kW(e.state,Xme,t);let{state:n}=e,r,i=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(Woe!=null&&n.selection.ranges.every(l=>l.empty)&&Woe==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((s?o.line(i++).text:t)+n.lineBreak);return{changes:{from:u.from,insert:f},range:ct.cursor(c.from+f.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:ct.cursor(l.from+c.length)}}):r=n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}id.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft};Oh.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);id.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")};id.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Oh.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(sot))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=Ujn(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new Djn(e,t,n,r)),r&&e.observer.ignore(()=>{Bit(e.contentDOM);let o=e.root.activeElement;o&&!o.contains(e.contentDOM)&&o.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function tRe(e,t,n,r){if(r==1)return ct.cursor(t,n);if(r==2)return gjn(e.state,t,n);{let i=us.find(e.docView,t),o=e.state.doc.lineAt(i?i.posAtEnd:t),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return at>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right;function jjn(e,t,n,r){let i=us.find(e.docView,t);if(!i)return 1;let o=t-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&nRe(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&nRe(n,r,a)?1:s&&s.bottom>=r?-1:1}function rRe(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:jjn(e,n,t.clientX,t.clientY)}}const Bjn=qt.ie&&qt.ie_version<=11;let iRe=null,oRe=0,sRe=0;function Pot(e){if(!Bjn)return e.detail;let t=iRe,n=sRe;return iRe=e,sRe=Date.now(),oRe=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(oRe+1)%3:1}function Ujn(e,t){let n=rRe(e,t),r=Pot(t),i=e.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=rRe(e,o),c,u=tRe(e,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let f=tRe(e,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=Vjn(i,l.pos))?c:a?i.addRange(u):ct.create([u])}}}function Vjn(e,t){for(let n=0;n=t)return ct.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}Oh.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.nearest(t.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=ct.range(o,s))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",kW(e.state,Yme,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Oh.dragend=e=>(e.inputState.draggedContent=null,!1);function aRe(e,t,n,r){if(n=kW(e.state,Xme,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:o}=e.inputState,s=r&&o&&Fjn(e,t)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Oh.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&aRe(e,t,r.filter(s=>s!=null).join(e.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=t.dataTransfer.getData("Text");if(r)return aRe(e,t,r,!0),!0}return!1};Oh.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=Eot?null:t.clipboardData;return n?(Tot(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(zjn(e),!1)};function Wjn(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function Hjn(e){let t=[],n=[],r=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let i=-1;for(let{from:o}of e.selection.ranges){let s=e.doc.lineAt(o);s.number>i&&(t.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),i=s.number}r=!0}return{text:kW(e,Yme,t.join(e.lineBreak)),ranges:n,linewise:r}}let Woe=null;Oh.copy=Oh.cut=(e,t)=>{let{text:n,ranges:r,linewise:i}=Hjn(e.state);if(!n&&!i)return!1;Woe=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Eot?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(Wjn(e,n),!1)};const kot=Rg.define();function Mot(e,t){let n=[];for(let r of e.facet(cot)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:kot.of(!0)}):null}function Aot(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Mot(e.state,t);n?e.dispatch(n):e.update([])}},10)}id.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Aot(e)};id.blur=e=>{e.observer.clearSelectionRange(),Aot(e)};id.compositionstart=id.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};id.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,qt.chrome&&qt.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};id.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Oh.beforeinput=(e,t)=>{var n,r;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let o=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=t.getTargetRanges();if(o&&s.length){let a=s[0],l=e.posAtDOM(a.startContainer,a.startOffset),c=e.posAtDOM(a.endContainer,a.endOffset);return Zme(e,{from:l,to:c,insert:e.state.toText(o)},null),!0}}let i;if(qt.chrome&&qt.android&&(i=Cot.find(o=>o.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return qt.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),qt.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>id.compositionend(e,t),20),!1};const lRe=new Set;function Gjn(e){lRe.has(e)||(lRe.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const cRe=["pre-wrap","normal","pre-line","break-spaces"];let HE=!1;function uRe(){HE=!1}class qjn{constructor(t){this.lineWrapping=t,this.doc=Yr.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return cRe.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>O5&&(HE=!0),this.height=t)}replace(t,n,r){return Xl.of(r)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,ro.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,ro.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=t[r];a.break?t.splice(r,1,a.left,null,a.right):t.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(this.blockAt(0,r,i,o))}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class gu extends Rot{constructor(t,n){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,n,r,i){return new _p(i,this.length,r,this.height,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof gu||i instanceof xa&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xa?i=new gu(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Xl.of(r)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class xa extends Xl{constructor(t){super(t,0)}heightMetrics(t,n){let r=t.doc.lineAt(n).number,i=t.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(t.lineWrapping){let l=Math.min(this.height,t.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(t,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(t0){let o=r[r.length-1];o instanceof xa?r[r.length-1]=new xa(o.length+i):r.push(null,new xa(i-1))}if(t>0){let o=r[0];o instanceof xa?r[0]=new xa(t+o.length):r.unshift(new xa(t-1),null)}return Xl.of(r)}decomposeLeft(t,n){n.push(new xa(t-1),null)}decomposeRight(t,n){n.push(null,new xa(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new xa(i.from-n-1).updateHeight(t,n));a<=o&&i.more;){let u=t.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=O5&&(l=-2);let d=new gu(u,f);d.outdated=!1,s.push(d),a+=u+1}a<=o&&s.push(null,new xa(o-a).updateHeight(t,a));let c=Xl.of(s);return(l<0||Math.abs(c.height-this.height)>=O5||Math.abs(l-this.heightMetrics(t,n).perLine)>=O5)&&(HE=!0),I4(this,c)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Yjn extends Xl{constructor(t,n,r){super(t.length+n+r.length,t.height+r.height,n|(t.outdated||r.outdated?2:0)),this.left=t,this.right=r,this.size=t.size+r.size}get break(){return this.flags&1}blockAt(t,n,r,i){let o=r+this.left.height;return ta))return c;let u=n==ro.ByPosNoHeight?ro.ByPosNoHeight:ro.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(t,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)t=l&&this.right.forEachLine(t,n,r,a,l,s);else{let c=this.lineAt(l,ro.ByPos,r,i,o);t=t&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(t,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-i,n-i,r));let o=[];t>0&&this.decomposeLeft(t,o);let s=o.length;for(let a of r)o.push(a);if(t>0&&fRe(o,s-1),n=r&&n.push(null)),t>r&&this.right.decomposeLeft(t-r,n)}decomposeRight(t,n){let r=this.left.length,i=r+this.break;if(t>=i)return this.right.decomposeRight(t-i,n);t2*n.size||n.size>2*t.size?Xl.of(this.break?[t,null,n]:[t,n]):(this.left=I4(this.left,t),this.right=I4(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(t,n,r,i):o.updateHeight(t,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(t,a,r,i):s.updateHeight(t,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function fRe(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof xa&&(r=e[t+1])instanceof xa&&e.splice(t-1,3,new xa(n.length+1+r.length))}const Qjn=5;class Jme{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof gu?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new gu(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,r){if(t=Qjn)&&this.addLineDeco(i,o,s)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new gu(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,n){let r=new xa(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof gu)return t;let n=new gu(0,-1);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof gu)&&!this.isCovered?this.nodes.push(new gu(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,d.top),l=Math.min(c==e.parentNode?i.innerHeight:l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function eBn(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function tBn(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class zY{constructor(t,n,r,i){this.from=t,this.to=n,this.size=r,this.displaySize=i}static same(t,n){if(t.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new qjn(n),this.stateDeco=t.facet(ZR).filter(r=>typeof r!="function"),this.heightMap=Xl.empty().applyChanges(this.stateDeco,Yr.empty,this.heightOracle.setDoc(t.doc),[new Bf(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=vn.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!t.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);t.push(new v3(o,s))}}return this.viewports=t.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?hRe:new eve(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(IM(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=this.state.facet(ZR).filter(u=>typeof u!="function");let i=t.changedRanges,o=Bf.extendWithRanges(i,Kjn(r,this.stateDeco,t?t.changes:Ps.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);uRe(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||HE)&&(t.flags|=2),a?(this.scrollAnchorPos=t.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=o.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(fot)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ho.RTL:ho.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:w,scaleY:S}=jit(n,a);(w>.005&&Math.abs(this.scaleX-w)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=w,this.scaleY=S,c|=16,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=16);let h=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=Vit(t.scrollDOM);let p=(this.printing?tBn:Jjn)(n,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget&&!eBn(t.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=t.scrollDOM.clientHeight,c|=16),l){let w=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(w)&&(s=!0),s||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:_,textHeight:E}=t.docView.measureTextSize();s=S>0&&i.refresh(o,S,_,E,Math.max(5,y/_),w),s&&(t.docView.minWidth=0,c|=16)}g>0&&m>0?u=Math.max(g,m):g<0&&m<0&&(u=Math.min(g,m)),uRe();for(let S of this.viewports){let _=S.from==this.viewport.from?w:t.docView.measureVisibleLineHeights(S);this.heightMap=(s?Xl.empty().applyChanges(this.stateDeco,Yr.empty,this.heightOracle,[new Bf(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new Xjn(S.from,_))}HE&&(c|=2)}let b=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new v3(i.lineAt(s-r*1e3,ro.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,ro.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,ro.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=ho.LTR&&!r)return[];let a=[],l=(u,f,d,h)=>{if(f-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromy));if(!m){if(fb.from<=f&&b.to>=f)){let b=n.moveToLineBoundary(ct.cursor(f),!1,!0).head;b>u&&(f=b)}let v=this.gapSize(d,u,f,h),y=r||v<2e6?v:2e6;m=new zY(u,f,v,y)}a.push(m)},c=u=>{if(u.length2e6)for(let _ of t)_.from>=u.from&&_.fromu.from&&l(u.from,h,u,f),pn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Ur.spans(n,this.viewport.from,this.viewport.to,{span(o,s){r.push({from:o,to:s})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let o=0;o=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||IM(this.heightMap.lineAt(t,ro.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||IM(this.heightMap.lineAt(this.scaler.fromDOM(t),ro.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return IM(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class v3{constructor(t,n){this.from=t,this.to=n}}function rBn(e,t,n){let r=[],i=e,o=0;return Ur.spans(n,e,t,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let i=0;;i++){let{from:o,to:s}=t[i],a=s-o;if(r<=a)return o+r;r-=a}}function b3(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function iBn(e,t){for(let n of e)if(t(n))return n}const hRe={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};class eve{constructor(t,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,ro.ByPos,t,0,0).top,u=n.lineAt(l,ro.ByPos,t,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(t){for(let n=0,r=0,i=0;;n++){let o=nn.from==t.viewports[r].from&&n.to==t.viewports[r].to):!1}}function IM(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new _p(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>IM(i,t)):e._content)}const x3=nn.define({combine:e=>e.join(" ")}),Hoe=nn.define({combine:e=>e.indexOf(!0)>-1}),Goe=pb.newName(),Iot=pb.newName(),Dot=pb.newName(),Lot={"&light":"."+Iot,"&dark":"."+Dot};function qoe(e,t,n){return new pb(t,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return e;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):e+" "+r}})}const oBn=qoe("."+Goe,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Lot),sBn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jY=qt.ie&&qt.ie_version<=11;class aBn{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new V5n,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(qt.ie&&qt.ie_version<=11||qt.ios&&t.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&qt.android&&t.constructor.EDIT_CONTEXT!==!1&&!(qt.chrome&&qt.chrome_version<126)&&(this.editContext=new cBn(t),t.state.facet(Mm)&&(t.contentDOM.editContext=this.editContext.editContext)),jY&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,r)=>n!=t[r]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Mm)?r.root.activeElement!=this.dom:!_5(this.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(qt.ie&&qt.ie_version<=11||qt.android&&qt.chrome)&&!r.state.selection.main.empty&&i.focusNode&&yA(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=KR(t.root);if(!n)return!1;let r=qt.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&lBn(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=_5(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&MO(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of t){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&_5(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new Ejn(this.view,t,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=Sot(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(t){let n=this.view.docView.nearest(t.target);if(!n||n.ignoreMutation(t))return null;if(n.markDirty(t.type=="attributes"),t.type=="attributes"&&(n.flags|=4),t.type=="childList"){let r=pRe(n,t.previousSibling||t.target.previousSibling,-1),i=pRe(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Mm)!=t.state.facet(Mm)&&(t.view.contentDOM.editContext=t.state.facet(Mm)?this.editContext.editContext:null))}destroy(){var t,n,r;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function pRe(e,t,n){for(;t;){let r=Ii.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function gRe(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);return yA(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function lBn(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return gRe(e,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?gRe(e,n):null}class cBn{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=r=>{let i=t.state.selection.main,{anchor:o,head:s}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>r.text.length;a==this.from&&othis.to&&(l=o);let u=_ot(t.state.sliceDoc(a,l),r.text,(c?i.from:i.to)-a,c?"end":null);if(!u){let d=ct.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));d.main.eq(i)||t.dispatch({selection:d,userEvent:"select"});return}let f={from:u.from+a,to:u.toA+a,insert:Yr.of(r.text.slice(u.from,u.toB).split(` -`))};if((qt.mac||qt.android)&&f.from==s-1&&/^\. ?$/.test(r.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:Yr.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let d=this.to-this.from+(f.to-f.from+f.insert.length);Zme(t,f,ct.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(a)){let l=this.toEditorPos(o.rangeStart),c=this.toEditorPos(o.rangeEnd);if(l{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(t.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=KR(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,r=!1,i=this.pendingContextChange;return t.changes.iterChanges((o,s,a,l,c)=>{if(r)return;let u=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(t.state);if(o+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(othis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(t.state),!r}update(t){let n=this.pendingContextChange,r=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(r.from,r.to)&&t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let r=this.composing;return r&&r.drifted?r.editorBase+(t-r.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Wt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:r}=t;this.dispatchTransactions=t.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||W5n(t.parent)||document,this.viewState=new dRe(t.state||Pr.create(t)),t.scrollTo&&t.scrollTo.is(p3)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ZC).map(i=>new FY(i));for(let i of this.plugins)i.update(this);this.observer=new aBn(this),this.inputState=new Mjn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new qAe(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let n=t.length==1&&t[0]instanceof ms?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let d of t){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;t.some(d=>d.annotation(kot))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=Mot(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(Pr.phrases)!=this.state.facet(Pr.phrases))return this.setState(o);i=R4.create(this,o,t),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of t){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new AO(h.empty?h:ct.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(p3)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=D4.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(AM)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(x3)!=i.state.facet(x3)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Boe))try{d(i)}catch(h){Pc(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!Sot(this,u)&&c.force&&MO(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new dRe(t),this.plugins=t.facet(ZC).map(r=>new FY(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new qAe(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(ZC),r=t.state.facet(ZC);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new FY(o));else{let a=this.plugins[s];a.mustUpdate=t,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=t&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=t;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(Vit(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return Pc(this.state,p),mRe}}),f=R4.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Boe))a(n)}get themeClasses(){return Goe+" "+(this.state.facet(Hoe)?Dot:Iot)+" "+this.state.facet(x3)}updateAttrs(){let t=vRe(this,pot,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Mm)?"true":"false",class:"cm-content",style:`${qt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),vRe(this,Qme,n);let r=this.observer.ignore(()=>{let i=Foe(this.contentDOM,this.contentAttrs,n),o=Foe(this.dom,this.editorAttrs,t);return i||o});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let i of r.effects)if(i.is(Wt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(AM);let t=this.state.facet(Wt.cspNonce);pb.mount(this.root,this.styleModules.concat(oBn).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;nr.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return NY(this,t,ZAe(this,t,n,r))}moveByGroup(t,n){return NY(this,t,ZAe(this,t,n,r=>wjn(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),i=this.textDirectionAt(t.from),o=r[n?r.length-1:0];return ct.cursor(o.side(n,i)+t.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return xjn(this,t,n,r)}moveVertically(t,n,r){return NY(this,t,Sjn(this,t,n,r))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){return this.readMeasured(),bot(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.docView.coordsAt(t,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(t),o=this.bidiSpans(i),s=o[_0.find(o,t-i.from,-1,n)];return WL(r,s.dir==ho.LTR==n>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(uot)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>uBn)return not(t.length);let n=this.textDirectionAt(t.from),r;for(let o of this.bidiCache)if(o.from==t.from&&o.dir==n&&(o.fresh||tot(o.isolates,r=GAe(this,t))))return o.order;r||(r=GAe(this,t));let i=ijn(t.text,n,r);return this.bidiCache.push(new D4(t.from,t.to,n,r,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||qt.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Bit(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){return p3.of(new AO(typeof t=="number"?ct.cursor(t):t,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return p3.of(new AO(ct.cursor(r.from),"start","start",r.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ns.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ns.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=pb.newName(),i=[x3.of(r),AM.of(qoe(`.${r}`,t))];return n&&n.dark&&i.push(Hoe.of(!0)),i}static baseTheme(t){return Gb.lowest(AM.of(qoe("."+Goe,t,Lot)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&Ii.get(r)||Ii.get(t);return((n=i?.rootView)===null||n===void 0?void 0:n.view)||null}}Wt.styleModule=AM;Wt.inputHandler=lot;Wt.clipboardInputFilter=Xme;Wt.clipboardOutputFilter=Yme;Wt.scrollHandler=dot;Wt.focusChangeEffect=cot;Wt.perLineTextDirection=uot;Wt.exceptionSink=aot;Wt.updateListener=Boe;Wt.editable=Mm;Wt.mouseSelectionStyle=sot;Wt.dragMovesSelection=oot;Wt.clickAddsSelectionRange=iot;Wt.decorations=ZR;Wt.outerDecorations=got;Wt.atomicRanges=qL;Wt.bidiIsolatedRanges=mot;Wt.scrollMargins=vot;Wt.darkTheme=Hoe;Wt.cspNonce=nn.define({combine:e=>e.length?e[0]:""});Wt.contentAttributes=Qme;Wt.editorAttributes=pot;Wt.lineWrapping=Wt.contentAttributes.of({class:"cm-lineWrapping"});Wt.announce=Gn.define();const uBn=4096,mRe={};class D4{constructor(t,n,r,i,o,s){this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(t,n){if(n.empty&&!t.some(o=>o.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:ho.LTR;for(let o=Math.max(0,t.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(e):o;s&&Loe(s,n)}return n}const fBn=qt.mac?"mac":qt.windows?"win":qt.linux?"linux":"key";function dBn(e,t){const n=e.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),n}function pBn(e,t,n){return $ot(Fot(e.state),t,e,n)}let a0=null;const gBn=4e3;function mBn(e,t=fBn){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(v=>dBn(v,t));for(let v=1;v{let w=a0={view:b,prefix:y,scope:s};return setTimeout(()=>{a0==w&&(a0=null)},gBn),!0}]})}let g=p.join(" ");i(g,!1);let m=h[g]||(h[g]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&m.run.push(l),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of e){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let d in u)u[d].run.push(h=>f(h,Xoe))}let l=s[t]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let Xoe=null;function $ot(e,t,n,r){Xoe=t;let i=N5n(t),o=wc(i,0),s=Sp(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;a0&&a0.view==n&&a0.scope==r&&(a=a0.prefix+" ",Oot.indexOf(t.keyCode)<0&&(c=!0,a0=null));let f=new Set,d=m=>{if(m){for(let v of m.run)if(!f.has(v)&&(f.add(v),v(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},h=e[r],p,g;return h&&(d(h[a+w3(i,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(qt.windows&&t.ctrlKey&&t.altKey)&&!(qt.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=gb[t.keyCode])&&p!=i?(d(h[a+w3(p,t,!0)])||t.shiftKey&&(g=QR[t.keyCode])!=i&&g!=p&&d(h[a+w3(g,t,!1)]))&&(l=!0):s&&t.shiftKey&&d(h[a+w3(i,t,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&t.stopPropagation(),Xoe=null,l}class YL{constructor(t,n,r,i,o){this.className=t,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=Not(t);return[new YL(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return vBn(t,n,r)}}function Not(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==ho.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function bRe(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let o=e.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function vBn(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==ho.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=Not(e),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=Voe(e,r,1),p=Voe(e,i,-1),g=h.type==ql.Text?h:null,m=p.type==ql.Text?p:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=bRe(e,r,1,g)),m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=bRe(e,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(b(n.from,n.to,g));{let S=g?b(n.from,null,g):w(h,!1),_=m?b(null,n.to,m):w(p,!0),E=[];return(g||h).to<(m||p).from-(g&&m?1:0)||h.widgetLineBreaks>1&&S.bottom+e.defaultLineHeight/2<_.top?E.push(v(f,S.bottom,d,_.top)):S.bottom<_.top&&e.elementAtHeight((S.bottom+_.top)/2).type==ql.Text&&(S.bottom=_.top=(S.bottom+_.top)/2),y(S).concat(E).concat(y(_))}function v(S,_,E,T){return new YL(t,S-l.left,_-l.top,E-S,T-_)}function y({top:S,bottom:_,horizontal:E}){let T=[];for(let k=0;kI&&A.from=$)break;z>L&&R(Math.max(U,L),S==null&&U<=I,Math.min(z,$),_==null&&z>=F,V.dir)}if(L=j.to+1,L>=$)break}return P.length==0&&R(I,S==null,F,_==null,e.textDirection),{top:T,bottom:k,horizontal:P}}function w(S,_){let E=a.top+(_?S.top:S.bottom);return{top:E,bottom:E,horizontal:[]}}}function yBn(e,t){return e.constructor==t.constructor&&e.eq(t)}class bBn{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(E5)!=t.state.facet(E5)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,r=t.facet(E5);for(;n!yBn(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of t)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=t,qt.safari&&qt.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const E5=nn.define();function zot(e){return[ns.define(t=>new bBn(t,e)),E5.of(e)]}const JR=nn.define({combine(e){return Ig(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function xBn(e={}){return[JR.of(e),wBn,SBn,_Bn,fot.of(!0)]}function jot(e){return e.startState.facet(JR)!=e.state.facet(JR)}const wBn=zot({above:!0,markers(e){let{state:t}=e,n=t.facet(JR),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty||n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:ct.cursor(i.head,i.head>i.anchor?-1:1);for(let l of YL.forRange(e,s,a))r.push(l)}}return r},update(e,t){e.transactions.some(r=>r.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=jot(e);return n&&xRe(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){xRe(t.state,e)},class:"cm-cursorLayer"});function xRe(e,t){t.style.animationDuration=e.facet(JR).cursorBlinkRate+"ms"}const SBn=zot({above:!1,markers(e){return e.state.selection.ranges.map(t=>t.empty?[]:YL.forRange(e,"cm-selectionBackground",t)).reduce((t,n)=>t.concat(n))},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||jot(e)},class:"cm-selectionLayer"}),_Bn=Gb.highest(Wt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Bot=Gn.define({map(e,t){return e==null?null:t.mapPos(e)}}),DM=pa.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(Bot)?r.value:n,e)}}),CBn=ns.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(DM);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(DM)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(DM),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(DM)!=e&&this.view.dispatch({effects:Bot.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function OBn(){return[DM,CBn]}function wRe(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=t.exec(o.value);)i(s+a.index,a)}function EBn(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class TBn{constructor(t){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(t){let n=new bv,r=n.add.bind(n);for(let{from:i,to:o}of EBn(t,this.maxLength))wRe(t.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,t,s,r));return n.finish()}updateDeco(t,n){let r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges((o,s,a,l)=>{l>=t.view.viewport.from&&a<=t.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),t.viewportMoved||i-r>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}updateRange(t,n,r,i){for(let o of t.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>=s){let l=t.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;ad.push(v.range(g,m));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(m,t,g,p));n=n.update({filterFrom:u,filterTo:f,filter:(g,m)=>gf,add:d})}}return n}}const Yoe=/x/.unicode!=null?"gu":"g",PBn=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Yoe),kBn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let BY=null;function MBn(){var e;if(BY==null&&typeof document<"u"&&document.body){let t=document.body.style;BY=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return BY||!1}const T5=nn.define({combine(e){let t=Ig(e,{render:null,specialChars:PBn,addSpecialChars:null});return(t.replaceTabs=!MBn())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Yoe)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Yoe)),t}});function ABn(e={}){return[T5.of(e),RBn()]}let SRe=null;function RBn(){return SRe||(SRe=ns.fromClass(class{constructor(e){this.view=e,this.decorations=vn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(T5)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new TBn({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=wc(t[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=_P(s.text,a,r-s.from);return vn.replace({widget:new FBn((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=vn.replace({widget:new LBn(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(T5);e.startState.facet(T5)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const IBn="•";function DBn(e){return e>=32?IBn:e==10?"␤":String.fromCharCode(9216+e)}class LBn extends Dg{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=DBn(this.code),r=t.state.phrase("Control character")+" "+(kBn[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class FBn extends Dg{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function $Bn(){return zBn}const NBn=vn.line({class:"cm-activeLine"}),zBn=ns.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(NBn.range(i.from)),t=i.from)}return vn.set(n)}},{decorations:e=>e.decorations});class jBn extends Dg{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?UE(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=WL(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function BBn(e){let t=ns.fromClass(class{constructor(n){this.view=n,this.placeholder=e?vn.set([vn.widget({widget:new jBn(e),side:1}).range(0)]):vn.none}get decorations(){return this.view.state.doc.length?vn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Wt.contentAttributes.of({"aria-placeholder":e})]:t}const Qoe=2e3;function UBn(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>Qoe||n.off>Qoe||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let l=r;l<=i;l++){let c=e.doc.line(l);c.length<=a&&o.push(ct.range(c.from+s,c.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let l=r;l<=i;l++){let c=e.doc.line(l),u=Toe(c.text,s,e.tabSize,!0);if(u<0)o.push(ct.cursor(c.to));else{let f=Toe(c.text,a,e.tabSize);o.push(ct.range(c.from+u,c.from+f))}}}return o}function VBn(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function _Re(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>Qoe?-1:i==r.length?VBn(e,t.clientX):_P(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function WBn(e,t){let n=_Re(e,t),r=e.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=_Re(e,i);if(!a)return r;let l=UBn(e.state,n,a);return l.length?s?ct.create(l.concat(r.ranges)):ct.create(l):r}}:null}function HBn(e){let t=(n=>n.altKey&&n.button==0);return Wt.mouseSelectionStyle.of((n,r)=>t(r)?WBn(n,r):null)}const GBn={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},qBn={style:"cursor: crosshair"};function XBn(e={}){let[t,n]=GBn[e.key||"Alt"],r=ns.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==t||n(i))},keyup(i){(i.keyCode==t||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,Wt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?qBn:null})]}const S3="-10000px";class Uot{constructor(t,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(t,n){var r;let i=t.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(t);return!1}let s=[],a=n?[]:null;for(let l=0;ln[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function YBn(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const UY=nn.define({combine:e=>{var t,n,r;return{position:qt.ios?"absolute":((t=e.find(i=>i.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=e.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||YBn}}}),CRe=new WeakMap,tve=ns.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(UY);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Uot(e,nve,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(UY);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=S3,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(e=r.destroy)===null||e===void 0||e.call(r);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(qt.safari){let s=o.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}else n=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(e=o.width/this.parent.offsetWidth,t=o.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=Kme(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(UY).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:o}=e,s=[];for(let a=0;a=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1)){u.style.top=S3;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,g=d.right-d.left,m=(t=CRe.get(c))!==null&&t!==void 0?t:d.bottom-d.top,v=c.offset||KBn,y=this.view.textDirection==ho.LTR,b=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+v.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(h?14:0)-v.x),r.right-g),w=this.above[a];!l.strictSide&&(w?f.top-m-p-v.yr.bottom)&&w==r.bottom-f.bottom>f.top-r.top&&(w=this.above[a]=!w);let S=(w?f.top-r.top:r.bottom-f.bottom)-p;if(Sb&&T.top<_+m&&T.bottom>_&&(_=w?T.top-m-2-p:T.bottom+p+2);if(this.position=="absolute"?(u.style.top=(_-e.parent.top)/o+"px",ORe(u,(b-e.parent.left)/i)):(u.style.top=_/o+"px",ORe(u,b/i)),h){let T=f.left+(y?v.x:-v.x)-(b+14-7);h.style.left=T/i+"px"}c.overlap!==!0&&s.push({left:b,top:_,right:E,bottom:_+m}),u.classList.toggle("cm-tooltip-above",w),u.classList.toggle("cm-tooltip-below",!w),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=S3}},{eventObservers:{scroll(){this.maybeMeasure()}}});function ORe(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const QBn=Wt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),KBn={x:0,y:0},nve=nn.define({enables:[tve,QBn]}),L4=nn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class MW{static create(t){return new MW(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Uot(t,L4,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(t,n){let r=t.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let r of this.manager.tooltipViews){let i=r[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const ZBn=nve.compute([L4],e=>{let t=e.facet(L4);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:MW.create,above:t[0].above,arrow:t.some(n=>n.arrow)}});class JBn{constructor(t,n,r,i,o){this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ta.bottom||n.xa.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==ho.RTL?-1:1;o=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Pc(t.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let t=this.view.plugin(tve),n=t?t.manager.tooltips.findIndex(r=>r.create==MW.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,r;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!e4n(o.dom,t)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!t4n(this.view,s,a,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(t.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=r=>{t.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const _3=4;function e4n(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let a=s.getBoundingClientRect();i=Math.min(a.top,i),o=Math.max(a.bottom,o)}return t.clientX>=n-_3&&t.clientX<=r+_3&&t.clientY>=i-_3&&t.clientY<=o+_3}function t4n(e,t,n,r,i,o){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,a)=t&&l<=n}function n4n(e,t={}){let n=Gn.define(),r=pa.define({create(){return[]},update(i,o){if(i.length&&(t.hideOnChange&&(o.docChanged||o.selection)?i=[]:t.hideOn&&(i=i.filter(s=>!t.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,ka.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(r4n)&&(i=[]);return i},provide:i=>L4.from(i)});return{active:r,extension:[r,ns.define(i=>new JBn(i,e,r,n,t.hoverTime||300)),ZBn]}}function Vot(e,t){let n=e.plugin(tve);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const r4n=Gn.define(),ERe=nn.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function eI(e,t){let n=e.plugin(Wot),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const Wot=ns.fromClass(class{constructor(e){this.input=e.state.facet(tI),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(ERe);this.top=new C3(e,!0,t.topContainer),this.bottom=new C3(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(ERe);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new C3(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new C3(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(tI);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(e.view),a.push(u)):(u=this.panels[c],u.update&&u.update(e)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Wt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class C3{constructor(t,n,r){this.view=t,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=TRe(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=TRe(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function TRe(e){let t=e.nextSibling;return e.remove(),t}const tI=nn.define({enables:Wot});class wv extends jw{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}wv.prototype.elementClass="";wv.prototype.toDOM=void 0;wv.prototype.mapMode=ka.TrackBefore;wv.prototype.startSide=wv.prototype.endSide=-1;wv.prototype.point=!0;const P5=nn.define(),i4n=nn.define(),o4n={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ur.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},wA=nn.define();function s4n(e){return[Hot(),wA.of({...o4n,...e})]}const PRe=nn.define({combine:e=>e.some(t=>t)});function Hot(e){return[a4n]}const a4n=ns.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(wA).map(t=>new MRe(e,t)),this.fixed=!e.state.facet(PRe);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(PRe)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Ur.iter(this.view.state.facet(P5),this.view.viewport.from),r=[],i=this.gutters.map(o=>new l4n(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==ql.Text&&s){Koe(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==ql.Text){Koe(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(wA),n=e.state.facet(wA),r=e.docChanged||e.heightChanged||e.viewportChanged||!Ur.eq(e.startState.facet(P5),e.state.facet(P5),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let i of this.gutters)i.update(e)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=t.indexOf(o);s<0?i.push(new MRe(this.view,o)):(this.gutters[s].update(e),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Wt.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==ho.LTR?{left:r,right:i}:{right:r,left:i}})});function kRe(e){return Array.isArray(e)?e:[e]}function Koe(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class l4n{constructor(t,n,r){this.gutter=t,this.height=r,this.i=0,this.cursor=Ur.iter(t.markers,n.from)}addElement(t,n,r){let{gutter:i}=this,o=(n.top-this.height)/t.scaleY,s=n.height/t.scaleY;if(this.i==i.elements.length){let a=new Got(t,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(t,s,o,r);this.height=n.bottom,this.i++}line(t,n,r){let i=[];Koe(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(t,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(t,n,i)}widget(t,n){let r=this.gutter.config.widgetMarker(t,n.widget,n),i=r?[r]:null;for(let o of t.state.facet(i4n)){let s=o(t,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(t,n,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class MRe{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=t.lineBlockAtHeight(s-t.documentTop);n.domEventHandlers[r](t,a,i)&&i.preventDefault()});this.markers=kRe(n.markers(t)),n.initialSpacer&&(this.spacer=new Got(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=kRe(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let r=t.view.viewport;return!Ur.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class Got{constructor(t,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}update(t,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),c4n(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class VY extends wv{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function WY(e,t){return e.state.facet(JC).formatNumber(t,e.state)}const d4n=wA.compute([JC],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(u4n)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new VY(WY(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,r)=>{for(let i of t.state.facet(f4n)){let o=i(t,n,r);if(o)return o}return null},lineMarkerChange:t=>t.startState.facet(JC)!=t.state.facet(JC),initialSpacer(t){return new VY(WY(t,ARe(t.state.doc.lines)))},updateSpacer(t,n){let r=WY(n.view,ARe(n.view.state.doc.lines));return r==t.number?t:new VY(r)},domEventHandlers:e.facet(JC).domEventHandlers,side:"before"}));function h4n(e={}){return[JC.of(e),Hot(),d4n]}function ARe(e){let t=9;for(;t{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(p4n.range(i)))}return Ur.of(t)});function m4n(){return g4n}var HY;const eO=new yr;function v4n(e){return nn.define({combine:e?t=>t.concat(e):void 0})}const y4n=new yr;class ih{constructor(t,n,r=[],i=""){this.data=t,this.name=i,Pr.prototype.hasOwnProperty("tree")||Object.defineProperty(Pr.prototype,"tree",{get(){return ca(this)}}),this.parser=n,this.extension=[vb.of(this),Pr.languageData.of((o,s,a)=>{let l=RRe(o,s,a),c=l.type.prop(eO);if(!c)return[];let u=o.facet(c),f=l.type.prop(y4n);if(f){let d=l.resolve(s-l.from,a);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(t,n,r=-1){return RRe(t,n,r).type.prop(eO)==this.data}findRegions(t){let n=t.facet(vb);if(n?.data==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(eO)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(yr.mounted);if(a){if(a.tree.prop(eO)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),t.name)}configure(t,n){return new nI(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ca(e){let t=e.field(ih.state,!1);return t?t.tree:gs.empty}class b4n{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let r=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-r,n-r)}}let E2=null;class F4{constructor(t,n,r=[],i,o,s,a,l){this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new F4(t,n,[],gs.empty,0,r,[],null)}startParse(){return this.parser.startParse(new b4n(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=gs.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Y1.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=E2;E2=this;try{return t()}finally{E2=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=IRe(t,n.from,n.to);return t}changes(t,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!t.empty){let l=[];if(t.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=Y1.applyChanges(r,l),i=gs.empty,o=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);ut.from&&(this.fragments=IRe(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends cit{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=E2;if(l){for(let c of i)l.tempSkipped.push(c);t&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,t]):t)}return this.parsedPos=s,new gs(Hc.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return E2}}function IRe(e,t,n){return Y1.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class GE{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new GE(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=F4.create(t.facet(vb).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new GE(r)}}ih.state=pa.define({create:GE.init,update(e,t){for(let n of t.effects)if(n.is(ih.setState))return n.value;return t.startState.facet(vb)!=t.state.facet(vb)?GE.init(t.state):e.apply(t)}});let qot=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(qot=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const GY=typeof navigator<"u"&&(!((HY=navigator.scheduling)===null||HY===void 0)&&HY.isInputPending)?()=>navigator.scheduling.isInputPending():null,x4n=ns.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(ih.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(ih.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=qot(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>GY&&GY()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:ih.setState.of(new GE(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Pc(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),vb=nn.define({combine(e){return e.length?e[0]:null},enables:e=>[ih.state,x4n,Wt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Xot{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const w4n=nn.define(),QL=nn.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function $4(e){let t=e.facet(QL);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function rI(e,t){let n="",r=e.tabSize,i=e.facet(QL)[0];if(i==" "){for(;t>=r;)n+=" ",t-=r;i=" "}for(let o=0;o=t?S4n(e,n,t):null}class AW{constructor(t,n={}){this.state=t,this.options=n,this.unit=$4(t)}lineAt(t,n=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==t?{text:"",from:t}:(n<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(t,n=t.length){return _P(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:r,from:i}=this.lineAt(t,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ive=new yr;function S4n(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s&&!(s.fromr.node.to||s.from==r.node.from&&s.type==r.node.type);s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return Yot(r,e,n)}function Yot(e,t,n){for(let r=e;r;r=r.next){let i=C4n(r.node);if(i)return i(ove.create(t,n,r))}return 0}function _4n(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function C4n(e){let t=e.type.prop(ive);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(yr.closedBy))){let i=e.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>Qot(s,!0,1,void 0,o&&!_4n(s)?i.from:void 0)}return e.parent==null?O4n:null}function O4n(){return 0}class ove extends AW{constructor(t,n,r){super(t.state,t.options),this.base=t,this.pos=n,this.context=r}get node(){return this.context.node}static create(t,n,r){return new ove(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(E4n(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Yot(this.context.next,this.base,this.pos)}}function E4n(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function T4n(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=t.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let c=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function qY({closing:e,align:t=!0,units:n=1}){return r=>Qot(r,t,n,e)}function Qot(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?T4n(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}function DRe({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}const P4n=200;function k4n(){return Pr.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+P4n)return e;let o=n.sliceString(i.from,r);if(!t.some(c=>c.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=rve(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=rI(s,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[e,{changes:l,sequential:!0}]:e})}const M4n=nn.define(),sve=new yr;function Kot(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(o&&a.from=t&&c.to>n&&(o=c)}}return o}function R4n(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function N4(e,t,n){for(let r of e.facet(M4n)){let i=r(e,t,n);if(i)return i}return A4n(e,t,n)}function Zot(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const RW=Gn.define({map:Zot}),KL=Gn.define({map:Zot});function Jot(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(r=>r.from<=n&&r.to>=n)||t.push(e.lineBlockAt(n));return t}const Ww=pa.define({create(){return vn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((n,r)=>e=LRe(e,n,r)),e=e.map(t.changes);for(let n of t.effects)if(n.is(RW)&&!I4n(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(nst),i=r?vn.replace({widget:new j4n(r(t.state,n.value))}):FRe;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(KL)&&(e=e.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=LRe(e,t.selection.main.head)),e},provide:e=>Wt.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{it&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(i,o)=>i>=n||o<=t}):e}function z4(e,t,n){var r;let i=null;return(r=e.field(Ww,!1))===null||r===void 0||r.between(t,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function I4n(e,t,n){let r=!1;return e.between(t,t,(i,o)=>{i==t&&o==n&&(r=!0)}),r}function est(e,t){return e.field(Ww,!1)?t:t.concat(Gn.appendConfig.of(rst()))}const D4n=e=>{for(let t of Jot(e)){let n=N4(e.state,t.from,t.to);if(n)return e.dispatch({effects:est(e.state,[RW.of(n),tst(e,n)])}),!0}return!1},L4n=e=>{if(!e.state.field(Ww,!1))return!1;let t=[];for(let n of Jot(e)){let r=z4(e.state,n.from,n.to);r&&t.push(KL.of(r),tst(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function tst(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return Wt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const F4n=e=>{let{state:t}=e,n=[];for(let r=0;r{let t=e.state.field(Ww,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push(KL.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},N4n=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:D4n},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:L4n},{key:"Ctrl-Alt-[",run:F4n},{key:"Ctrl-Alt-]",run:$4n}],z4n={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},nst=nn.define({combine(e){return Ig(e,z4n)}});function rst(e){return[Ww,V4n]}function ist(e,t){let{state:n}=e,r=n.facet(nst),i=s=>{let a=e.lineBlockAt(e.posAtDOM(s.target)),l=z4(e.state,a.from,a.to);l&&e.dispatch({effects:KL.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const FRe=vn.replace({widget:new class extends Dg{toDOM(e){return ist(e,null)}}});class j4n extends Dg{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return ist(t,this.value)}}const B4n={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class XY extends wv{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function U4n(e={}){let t={...B4n,...e},n=new XY(t,!0),r=new XY(t,!1),i=ns.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(vb)!=s.state.facet(vb)||s.startState.field(Ww,!1)!=s.state.field(Ww,!1)||ca(s.startState)!=ca(s.state)||t.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new bv;for(let l of s.viewportLineBlocks){let c=z4(s.state,l.from,l.to)?r:N4(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=t;return[i,s4n({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Ur.empty},initialSpacer(){return new XY(t,!1)},domEventHandlers:{...o,click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=z4(s.state,a.from,a.to);if(c)return s.dispatch({effects:KL.of(c)}),!0;let u=N4(s.state,a.from,a.to);return u?(s.dispatch({effects:RW.of(u)}),!0):!1}}}),rst()]}const V4n=Wt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ZL{constructor(t,n){this.specs=t;let r;function i(a){let l=pb.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof ih?a=>a.prop(eO)==s.data:s?a=>a==s:void 0,this.style=fit(t.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new pb(r):null,this.themeType=n.themeType}static define(t,n){return new ZL(t,n||{})}}const Zoe=nn.define(),ost=nn.define({combine(e){return e.length?[e[0]]:null}});function YY(e){let t=e.facet(Zoe);return t.length?t:e.facet(ost)}function sst(e,t){let n=[H4n],r;return e instanceof ZL&&(e.module&&n.push(Wt.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(ost.of(e)):r?n.push(Zoe.computeN([Wt.darkTheme],i=>i.facet(Wt.darkTheme)==(r=="dark")?[e]:[])):n.push(Zoe.of(e)),n}class W4n{constructor(t){this.markCache=Object.create(null),this.tree=ca(t.state),this.decorations=this.buildDeco(t,YY(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=ca(t.state),r=YY(t.state),i=r!=YY(t.startState),{viewport:o}=t.view,s=t.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(n!=this.tree||t.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=o.to)}buildDeco(t,n){if(!n||!this.tree.length)return vn.none;let r=new bv;for(let{from:i,to:o}of t.visibleRanges)rzn(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=vn.mark({class:l})))},i,o);return r.finish()}}const H4n=Gb.high(ns.fromClass(W4n,{decorations:e=>e.decorations})),G4n=ZL.define([{tag:We.meta,color:"#404740"},{tag:We.link,textDecoration:"underline"},{tag:We.heading,textDecoration:"underline",fontWeight:"bold"},{tag:We.emphasis,fontStyle:"italic"},{tag:We.strong,fontWeight:"bold"},{tag:We.strikethrough,textDecoration:"line-through"},{tag:We.keyword,color:"#708"},{tag:[We.atom,We.bool,We.url,We.contentSeparator,We.labelName],color:"#219"},{tag:[We.literal,We.inserted],color:"#164"},{tag:[We.string,We.deleted],color:"#a11"},{tag:[We.regexp,We.escape,We.special(We.string)],color:"#e40"},{tag:We.definition(We.variableName),color:"#00f"},{tag:We.local(We.variableName),color:"#30a"},{tag:[We.typeName,We.namespace],color:"#085"},{tag:We.className,color:"#167"},{tag:[We.special(We.variableName),We.macroName],color:"#256"},{tag:We.definition(We.propertyName),color:"#00c"},{tag:We.comment,color:"#940"},{tag:We.invalid,color:"#f00"}]),q4n=Wt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ast=1e4,lst="()[]{}",cst=nn.define({combine(e){return Ig(e,{afterCursor:!0,brackets:lst,maxScanDistance:ast,renderMatch:Q4n})}}),X4n=vn.mark({class:"cm-matchingBracket"}),Y4n=vn.mark({class:"cm-nonmatchingBracket"});function Q4n(e){let t=[],n=e.matched?X4n:Y4n;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const K4n=pa.define({create(){return vn.none},update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(cst);for(let i of t.state.selection.ranges){if(!i.empty)continue;let o=Mp(t.state,i.head,-1,r)||i.head>0&&Mp(t.state,i.head-1,1,r)||r.afterCursor&&(Mp(t.state,i.head,1,r)||i.headWt.decorations.from(e)}),Z4n=[K4n,q4n];function J4n(e={}){return[cst.of(e),Z4n]}const e6n=new yr;function Joe(e,t,n){let r=e.prop(t<0?yr.openedBy:yr.closedBy);if(r)return r;if(e.name.length==1){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function ese(e){let t=e.type.prop(e6n);return t?t(e.node):e}function Mp(e,t,n,r={}){let i=r.maxScanDistance||ast,o=r.brackets||lst,s=ca(e),a=s.resolveInner(t,n);for(let l=a;l;l=l.parent){let c=Joe(l.type,n,o);if(c&&l.from0?t>=u.from&&tu.from&&t<=u.to))return t6n(e,t,n,l,u,c,o)}}return n6n(e,t,n,s,a.type,i,o)}function t6n(e,t,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;n<0&&(d+=h.length);let p=t+d*n;for(let g=n>0?0:h.length-1,m=n>0?h.length:-1;g!=m;g+=n){let v=s.indexOf(h[g]);if(!(v<0||r.resolveInner(p+g,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const r6n=Object.create(null),$Re=[Hc.none],NRe=[],zRe=Object.create(null),i6n=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])i6n[e]=o6n(r6n,t);function QY(e,t){NRe.indexOf(e)>-1||(NRe.push(e),console.warn(t))}function o6n(e,t){let n=[];for(let a of t.split(" ")){let l=[];for(let c of a.split(".")){let u=e[c]||We[c];u?typeof u=="function"?l.length?l=l.map(u):QY(c,`Modifier ${c} used at start of tag`):l.length?QY(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:QY(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=zRe[i];if(o)return o.id;let s=zRe[i]=Hc.define({id:$Re.length,name:r,props:[zme({[r]:n})]});return $Re.push(s),s.id}ho.RTL,ho.LTR;class ust{constructor(t,n,r,i){this.state=t,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=ca(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(dst(t,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,r){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function jRe(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function s6n(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:s6n(t);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:t,validFor:n}:null}}function a6n(e,t){return n=>{for(let r=ca(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(e.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return t(n)}}class BRe{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function Q1(e){return e.selection.main.from}function dst(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?e:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const ave=Rg.define();function l6n(e,t,n,r){let{main:i}=e.selection,o=n-i.from,s=r-i.from;return{...e.changeByRange(a=>{if(a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,r))return{range:a};let l=e.toText(t);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:l},range:ct.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const URe=new WeakMap;function c6n(e){if(!Array.isArray(e))return e;let t=URe.get(e);return t||URe.set(e,t=fst(e)),t}const j4=Gn.define(),iI=Gn.define();class u6n{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(_=Ume(S))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!y||E==1&&m||w==0&&E!=0)&&(n[f]==S||r[f]==S&&(d=!0)?s[f++]=y:s.length&&(v=!1)),w=E,y+=Sp(S)}return f==l&&s[0]==0&&v?this.result(-100+(d?-200:0),s,t):h==l&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):a>-1?this.ret(-700-t.length,[a,a+this.pattern.length]):h==l?this.ret(-900-t.length,[p,g]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),s,t):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,t)}result(t,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?Sp(wc(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(t-r.length,i)}}class f6n{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:d6n,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>r=>VRe(t(r),n(r)),optionClass:(t,n)=>r=>VRe(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function VRe(e,t){return e?t?e+" "+t:e:t}function d6n(e,t,n,r,i,o){let s=e.textDirection==ho.RTL,a=s,l=!1,c="top",u,f,d=t.left-i.left,h=i.right-t.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d=g||y>t.top?u=n.bottom-t.top:(c="bottom",u=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${c}: ${u/m}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function h6n(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;cl&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function KY(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class p6n{constructor(t,n,r){this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=t.state.field(n),{options:o,selected:s}=i.open,a=t.state.facet(Ks);this.optionContent=h6n(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=KY(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=t.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(Ks).closeOnBlur&&l.relatedTarget!=t.contentDOM&&t.dispatch({effects:iI.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let r=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=KY(o.length,s,t.state.facet(Ks).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=KY(n.options.length,n.selected,this.view.state.facet(Ks).maxRenderedOptions),this.showOptions(n.options,t.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:o}=i;if(!o)return;let s=typeof o=="string"?document.createTextNode(o):o(i);if(!s)return;"then"in s?s.then(a=>{a&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(a,i)}).catch(a=>Pc(this.view.state,a,"completion info")):(this.addInfoPane(s,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)r.appendChild(t),this.infoDestroy=null;else{let{dom:i,destroy:o}=t;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==t?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&m6n(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom{s.target==i&&s.preventDefault()});let o=null;for(let s=r.from;sr.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew p6n(n,e,t)}function m6n(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.topn.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function WRe(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function v6n(e,t){let n=[],r=null,i=null,o=u=>{n.push(u);let{section:f}=u.completion;if(f){r||(r=[]);let d=typeof f=="string"?f:f.name;r.some(h=>h.name==d)||r.push(typeof f=="string"?{name:d}:f)}},s=t.facet(Ks);for(let u of e)if(u.hasResult()){let f=u.result.getMatch;if(u.result.filter===!1)for(let d of u.result.options)o(new BRe(d,u.source,f?f(d):[],1e9-n.length));else{let d=t.sliceDoc(u.from,u.to),h,p=s.filterStrict?new f6n(d):new u6n(d);for(let g of u.result.options)if(h=p.match(g.label)){let m=g.displayLabel?f?f(g,h.matched):[]:h.matched,v=h.score+(g.boost||0);if(o(new BRe(g,u.source,m,v)),typeof g.section=="object"&&g.section.rank==="dynamic"){let{name:y}=g.section;i||(i=Object.create(null)),i[y]=Math.max(v,i[y]||-1e9)}}}}if(r){let u=Object.create(null),f=0,d=(h,p)=>(h.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[h.name]:0)||(typeof h.rank=="number"?h.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(h.named.score-f.score||c(f.completion,d.completion))){let f=u.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(u):WRe(u.completion)>WRe(l)&&(a[a.length-1]=u),l=u.completion}return a}class tO{constructor(t,n,r,i,o,s){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new tO(this.options,HRe(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,o,s){if(i&&!s&&t.some(c=>c.isPending))return i.setDisabled();let a=v6n(t,n);if(!a.length)return i&&t.some(c=>c.isPending)?i.setDisabled():null;let l=n.facet(Ks).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let u=0;uu.hasResult()?Math.min(c,u.from):c,1e8),create:_6n,above:o.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(t){return new tO(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new tO(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class B4{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new B4(w6n,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Ks),o=(r.override||n.languageDataAt("autocomplete",Q1(n)).map(c6n)).map(l=>(this.active.find(u=>u.source==l)||new Mf(l,this.active.some(u=>u.state!=0)?1:0)).update(t,r));o.length==this.active.length&&o.every((l,c)=>l==this.active[c])&&(o=this.active);let s=this.open,a=t.effects.some(l=>l.is(lve));s&&t.docChanged&&(s=s.map(t.changes)),t.selection||o.some(l=>l.hasResult()&&t.changes.touchesRange(l.from,l.to))||!y6n(o,this.active)||a?s=tO.build(o,n,this.id,s,r,a):s&&s.disabled&&!o.some(l=>l.isPending)&&(s=null),!s&&o.every(l=>!l.isPending)&&o.some(l=>l.hasResult())&&(o=o.map(l=>l.hasResult()?new Mf(l.source,0):l));for(let l of t.effects)l.is(pst)&&(s=s&&s.setSelected(l.value,this.id));return o==this.active&&s==this.open?this:new B4(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?b6n:x6n}}function y6n(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const w6n=[];function hst(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(ave);if(r&&t.activateOnCompletion(r))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Mf{constructor(t,n,r=!1){this.source=t,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=hst(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Mf(i.source,0)),r&4&&i.state==0&&(i=new Mf(this.source,1)),i=i.updateFor(t,r);for(let o of t.effects)if(o.is(j4))i=new Mf(i.source,1,o.value);else if(o.is(iI))i=new Mf(i.source,0);else if(o.is(lve))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Q1(t.state))}}class RO extends Mf{constructor(t,n,r,i,o,s){super(t,3,n),this.limit=r,this.result=i,this.from=o,this.to=s}hasResult(){return!0}updateFor(t,n){var r;if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let o=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),a=Q1(t.state);if(a>s||!i||n&2&&(Q1(t.startState)==this.from||an.map(t))}}),pst=Gn.define(),Sc=pa.define({create(){return B4.start()},update(e,t){return e.update(t)},provide:e=>[nve.from(e,t=>t.tooltip),Wt.contentAttributes.from(e,t=>t.attrs)]});function cve(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(Sc).active.find(i=>i.source==t.source);return r instanceof RO?(typeof n=="string"?e.dispatch({...l6n(e.state,n,r.from,r.to),annotations:ave.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const _6n=g6n(Sc,cve);function O3(e,t="option"){return n=>{let r=n.state.field(Sc,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a=t=="page"?0:s-1:a>=s&&(a=t=="page"?s-1:0),n.dispatch({effects:pst.of(a)}),!0}}const C6n=e=>{let t=e.state.field(Sc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Sc,!1)?(e.dispatch({effects:j4.of(!0)}),!0):!1,O6n=e=>{let t=e.state.field(Sc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:iI.of(null)}),!0)};class E6n{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const T6n=50,P6n=1e3,k6n=ns.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Sc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Sc),n=e.state.facet(Ks);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Sc)==t)return;let r=e.transactions.some(o=>{let s=hst(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;oT6n&&Date.now()-s.time>P6n){for(let a of s.context.abortListeners)try{a()}catch(l){Pc(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(o=>o.effects.some(s=>s.is(j4)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(o=>o.isPending&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of e.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Sc);for(let n of t.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ks).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Q1(t),r=new ust(t,n,e.explicit,this.view),i=new E6n(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:iI.of(null)}),Pc(this.view.state,o)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ks).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Ks),r=this.view.state.field(Sc);for(let i=0;ia.source==o.active.source);if(s&&s.isPending)if(o.done==null){let a=new Mf(o.active.source,0);for(let l of o.updates)a=a.update(l,n);a.isPending||t.push(a)}else this.startQuery(s)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:lve.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Sc,!1);if(t&&t.tooltip&&this.view.state.facet(Ks).closeOnBlur){let n=t.open&&Vot(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:iI.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:j4.of(!1)}),20),this.composing=0}}}),M6n=typeof navigator=="object"&&/Win/.test(navigator.platform),A6n=Gb.highest(Wt.domEventHandlers({keydown(e,t){let n=t.state.field(Sc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(M6n&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&cve(t,r),!1}})),gst=Wt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class R6n{constructor(t,n,r,i){this.field=t,this.line=n,this.from=r,this.to=i}}class uve{constructor(t,n,r){this.field=t,this.from=n,this.to=r}map(t){let n=t.mapPos(this.from,-1,ka.TrackDel),r=t.mapPos(this.to,1,ka.TrackDel);return n==null||r==null?null:new uve(this.field,n,r)}}class fve{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let r=[],i=[n],o=t.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let f=0;fnew uve(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(t){let n=[],r=[],i=[],o;for(let s of t.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s);){let a=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1,u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&d.field++}for(let f of i)if(f.line==r.length&&f.from>o.index){let d=o[2]?3+(o[1]||"").length:2;f.from-=d,f.to-=d}i.push(new R6n(c,r.length,o.index,o.index+u.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(s)}return new fve(r,i)}}let I6n=vn.widget({widget:new class extends Dg{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),D6n=vn.mark({class:"cm-snippetField"});class CP{constructor(t,n){this.ranges=t,this.active=n,this.deco=vn.set(t.map(r=>(r.from==r.to?I6n:D6n).range(r.from,r.to)),!0)}map(t){let n=[];for(let r of this.ranges){let i=r.map(t);if(!i)return null;n.push(i)}return new CP(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const JL=Gn.define({map(e,t){return e&&e.map(t)}}),L6n=Gn.define(),oI=pa.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(JL))return n.value;if(n.is(L6n)&&e)return new CP(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Wt.decorations.from(e,t=>t?t.deco:vn.none)});function dve(e,t){return ct.create(e.filter(n=>n.field==t).map(n=>ct.range(n.from,n.to)))}function F6n(e){let t=fve.parse(e);return(n,r,i,o)=>{let{text:s,ranges:a}=t.instantiate(n.state,i),{main:l}=n.state.selection,c={changes:{from:i,to:o==l.from?l.to:o,insert:Yr.of(s)},scrollIntoView:!0,annotations:r?[ave.of(r),ms.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=dve(a,0)),a.some(u=>u.field>0)){let u=new CP(a,0),f=c.effects=[JL.of(u)];n.state.field(oI,!1)===void 0&&f.push(Gn.appendConfig.of([oI,B6n,U6n,gst]))}n.dispatch(n.state.update(c))}}function mst(e){return({state:t,dispatch:n})=>{let r=t.field(oI,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,o=e>0&&!r.ranges.some(s=>s.field==i+e);return n(t.update({selection:dve(r.ranges,i),effects:JL.of(o?null:new CP(r.ranges,i)),scrollIntoView:!0})),!0}}const $6n=({state:e,dispatch:t})=>e.field(oI,!1)?(t(e.update({effects:JL.of(null)})),!0):!1,N6n=mst(1),z6n=mst(-1),j6n=[{key:"Tab",run:N6n,shift:z6n},{key:"Escape",run:$6n}],GRe=nn.define({combine(e){return e.length?e[0]:j6n}}),B6n=Gb.highest(XL.compute([GRe],e=>e.facet(GRe)));function em(e,t){return{...t,apply:F6n(e)}}const U6n=Wt.domEventHandlers({mousedown(e,t){let n=t.state.field(oI,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:dve(n.ranges,i.field),effects:JL.of(n.ranges.some(o=>o.field>i.field)?new CP(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),sI={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},w1=Gn.define({map(e,t){let n=t.mapPos(e,-1,ka.TrackAfter);return n??void 0}}),hve=new class extends jw{};hve.startSide=1;hve.endSide=-1;const vst=pa.define({create(){return Ur.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of t.effects)n.is(w1)&&(e=e.update({add:[hve.range(n.value,n.value+1)]}));return e}});function V6n(){return[H6n,vst]}const JY="()[]{}<>«»»«[]{}";function yst(e){for(let t=0;t{if((W6n?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Sp(wc(r,0))==1||t!=i.from||n!=i.to)return!1;let o=X6n(e.state,r);return o?(e.dispatch(o),!0):!1}),G6n=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=bst(e,e.selection.main.head).brackets||sI.brackets,i=null,o=e.changeByRange(s=>{if(s.empty){let a=Y6n(e.doc,s.head);for(let l of r)if(l==a&&IW(e.doc,s.head)==yst(wc(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:ct.cursor(s.head-l.length)}}return{range:i=s}});return i||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},q6n=[{key:"Backspace",run:G6n}];function X6n(e,t){let n=bst(e,e.selection.main.head),r=n.brackets||sI.brackets;for(let i of r){let o=yst(wc(i,0));if(t==i)return o==i?Z6n(e,i,r.indexOf(i+i+i)>-1,n):Q6n(e,i,o,n.before||sI.before);if(t==o&&xst(e,e.selection.main.from))return K6n(e,i,o)}return null}function xst(e,t){let n=!1;return e.field(vst).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function IW(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Sp(wc(n,0)))}function Y6n(e,t){let n=e.sliceString(t-2,t);return Sp(wc(n,0))==n.length?n:n.slice(1)}function Q6n(e,t,n,r){let i=null,o=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:w1.of(s.to+t.length),range:ct.range(s.anchor+t.length,s.head+t.length)};let a=IW(e.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:w1.of(s.head+t.length),range:ct.cursor(s.head+t.length)}:{range:i=s}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function K6n(e,t,n){let r=null,i=e.changeByRange(o=>o.empty&&IW(e.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:ct.cursor(o.head+n.length)}:r={range:o});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Z6n(e,t,n,r){let i=r.stringPrefixes||sI.stringPrefixes,o=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:t,from:a.to}],effects:w1.of(a.to+t.length),range:ct.range(a.anchor+t.length,a.head+t.length)};let l=a.head,c=IW(e.doc,l),u;if(c==t){if(qRe(e,l))return{changes:{insert:t+t,from:l},effects:w1.of(l+t.length),range:ct.cursor(l+t.length)};if(xst(e,l)){let d=n&&e.sliceDoc(l,l+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+d.length,insert:d},range:ct.cursor(l+d.length)}}}else{if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(u=XRe(e,l-2*t.length,i))>-1&&qRe(e,u))return{changes:{insert:t+t+t+t,from:l},effects:w1.of(l+t.length),range:ct.cursor(l+t.length)};if(e.charCategorizer(l)(c)!=wo.Word&&XRe(e,l,i)>-1&&!J6n(e,l,t,i))return{changes:{insert:t+t,from:l},effects:w1.of(l+t.length),range:ct.cursor(l+t.length)}}return{range:o=a}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function qRe(e,t){let n=ca(e).resolveInner(t+1);return n.parent&&n.from==t}function J6n(e,t,n,r){let i=ca(e).resolveInner(t,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(e.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function XRe(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=wo.Word)return t;for(let i of n){let o=t-i.length;if(e.sliceDoc(o,t)==i&&r(e.sliceDoc(o-1,o))!=wo.Word)return o}return-1}function wst(e={}){return[A6n,Sc,Ks.of(e),k6n,eUn,gst]}const Sst=[{key:"Ctrl-Space",run:ZY},{mac:"Alt-`",run:ZY},{mac:"Alt-i",run:ZY},{key:"Escape",run:O6n},{key:"ArrowDown",run:O3(!0)},{key:"ArrowUp",run:O3(!1)},{key:"PageDown",run:O3(!0,"page")},{key:"PageUp",run:O3(!1,"page")},{key:"Enter",run:C6n}],eUn=Gb.highest(XL.computeN([Ks],e=>e.facet(Ks).defaultKeymap?[Sst]:[])),YRe=new j3n,_st=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function E3(e){return(t,n,r)=>{if(r)return!1;let i=t.node.getChild("VariableName");return i&&n(i,e),!0}}const tUn={FunctionDefinition:E3("function"),ClassDefinition:E3("class"),ForStatement(e,t,n){if(n){for(let r=e.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")t(r,"variable");else if(r.name=="in")break}},ImportStatement(e,t){var n,r;let{node:i}=e,o=((n=i.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((r=s.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&t(s,o?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,r=e.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(r,"variable"),n=r},CapturePattern:E3("variable"),AsPattern:E3("variable"),__proto__:null};function Cst(e,t){let n=YRe.get(t);if(n)return n;let r=[],i=!0;function o(s,a){let l=e.sliceString(s.from,s.to);r.push({label:l,type:a})}return t.cursor(Ms.IncludeAnonymous).iterate(s=>{if(s.name){let a=tUn[s.name];if(a&&a(s,o,i)||!i&&_st.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let a of Cst(e,s.node))r.push(a);return!1}}),YRe.set(t,r),r}const QRe=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Ost=["String","FormatString","Comment","PropertyName"];function nUn(e){let t=ca(e.state).resolveInner(e.pos,-1);if(Ost.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&QRe.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let i=t;i;i=i.parent)_st.has(i.name)&&(r=r.concat(Cst(e.state.doc,i)));return{options:r,from:n?t.from:e.pos,validFor:QRe}}const rUn=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),iUn=[em("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),em("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),em("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),em("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),em(`if \${}: +`));const t=M.useMemo(()=>X({},$Pn,e.localeText),[e.localeText]);return M.useMemo(()=>X({},e,{localeText:t}),[e,t])},bi=()=>MS().utils,ML=()=>MS().defaultDates,AS=e=>{const t=bi(),n=M.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current};function Het(e){const{props:t,validator:n,value:r,timezone:i,onError:o}=e,s=MS(),a=M.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:i,props:t}),c=n.valueManager.hasError(l);M.useEffect(()=>{o&&!n.valueManager.isSameError(l,a.current)&&o(l,r),a.current=l},[n,o,l,r]);const u=ft(f=>n({adapter:s,value:f,timezone:i,props:t}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const qc=()=>MS().localeText,NPn=({utils:e,format:t})=>{let n=10,r=t,i=e.expandFormat(t);for(;i!==r;)if(r=i,i=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return i},zPn=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:i}=e.escapedCharacters,o=new RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g");let s=null;for(;s=o.exec(t);)n.push({start:s.index,end:o.lastIndex-1});return n},jPn=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},BPn=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=Iet(e,s),c=$et(e,l.contentType,l.type,s),u=n?c:l.contentType==="digit",f=t!=null&&e.isValid(t);let d=f?e.formatByString(t,s):"",h=null;if(u)if(c)h=d===""?e.formatByString(o,s).length:d.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);h=l.maxLength,f&&(d=fge(Let(Aw(d,i),h),i))}return X({},l,{format:s,maxLength:h,value:d,placeholder:jPn(e,r,l,s),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:a,endSeparator:"",modified:!1})},UPn=e=>{const{utils:t,expandedFormat:n,escapedParts:r}=e,i=t.date(void 0),o=[];let s="";const a=Object.keys(t.formatTokenMap).sort((h,p)=>p.length-h.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${a.join("|")})*$`),u=new RegExp(`^(${a.join("|")})`),f=h=>r.find(p=>p.start<=h&&p.end>=h);let d=0;for(;d0;){const v=u.exec(m)[1];m=m.slice(v.length),o.push(BPn(X({},e,{now:i,token:v,startSeparator:s}))),s=""}d+=g.length}else{const m=n[d];p&&h?.start===d||h?.end===d||(o.length===0?s+=m:o[o.length-1].endSeparator+=m),d+=1}}return o.length===0&&s.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),o},VPn=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const i=o=>{let s=o;return e&&s!==null&&s.includes(" ")&&(s=`⁩${s}⁦`),t==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=i(r.startSeparator),r.endSeparator=i(r.endSeparator),r}),Nke=e=>{let t=NPn(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=zPn(X({},e,{expandedFormat:t})),r=UPn(X({},e,{expandedFormat:t,escapedParts:n}));return VPn(X({},e,{sections:r}))},pge=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:i,valueManager:o})=>{const s=bi(),a=M.useRef(n),l=t??a.current??o.emptyValue,c=M.useMemo(()=>o.getTimezone(s,l),[s,o,l]),u=ft(p=>c==null?p:o.setTimezone(s,c,p));let f;e?f=e:c?f=c:r?f=s.getTimezone(r):f="default";const d=M.useMemo(()=>o.setTimezone(s,f,l),[o,s,f,l]),h=ft((p,...g)=>{const m=u(p);i?.(m,...g)});return{value:d,handleValueChange:h,timezone:f}},pP=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:i,onChange:o,valueManager:s})=>{const[a,l]=Da({name:e,state:"value",controlled:n,default:r??s.emptyValue}),c=ft((u,...f)=>{l(u),o?.(u,...f)});return pge({timezone:t,value:a,defaultValue:void 0,referenceDate:i,onChange:c,valueManager:s})},WPn=e=>{const t=bi(),n=qc(),r=MS(),i=yi(),{valueManager:o,fieldValueManager:s,valueType:a,validator:l,internalProps:c,internalProps:{value:u,defaultValue:f,referenceDate:d,onChange:h,format:p,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:b,enableAccessibleFieldDOMStructure:w=!1}}=e,{timezone:S,value:_,handleValueChange:E}=pge({timezone:b,value:u,defaultValue:f,referenceDate:d,onChange:h,valueManager:o}),T=M.useMemo(()=>wPn(t),[t]),k=M.useMemo(()=>TPn(t,T,S),[t,T,S]),P=M.useCallback((Y,Z=null)=>s.getSectionsFromValue(t,Y,Z,ge=>Nke({utils:t,localeText:n,localizedDigits:T,format:p,date:ge,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:w,isRtl:i})),[s,p,n,T,i,y,t,g,w]),[I,R]=M.useState(()=>{const Y=P(_),Z={sections:Y,value:_,referenceValue:o.emptyValue,tempValueStrAndroid:null},ge=vPn(Y),ne=o.getInitialReferenceValue({referenceDate:d,value:_,utils:t,props:c,granularity:ge,timezone:S});return X({},Z,{referenceValue:ne})}),[F,A]=Da({controlled:m,default:null,name:"useField",state:"selectedSections"}),L=Y=>{A(Y),v?.(Y)},$=M.useMemo(()=>tie(F,I.sections),[F,I.sections]),j=$==="all"?0:$,V=({value:Y,referenceValue:Z,sections:ge})=>{if(R(ie=>X({},ie,{sections:ge,value:Y,referenceValue:Z,tempValueStrAndroid:null})),o.areValuesEqual(t,I.value,Y))return;const ne={validationError:l({adapter:r,value:Y,timezone:S,props:c})};E(Y,ne)},U=(Y,Z)=>{const ge=[...I.sections];return ge[Y]=X({},ge[Y],{value:Z,modified:!0}),ge},z=()=>{V({value:o.emptyValue,referenceValue:I.referenceValue,sections:P(o.emptyValue)})},N=()=>{if(j==null)return;const Y=I.sections[j],Z=s.getActiveDateManager(t,I,Y),ne=Z.getSections(I.sections).filter(se=>se.value!=="").length===(Y.value===""?0:1),ie=U(j,""),fe=ne?null:t.getInvalidDate(),ve=Z.getNewValuesFromNewActiveDate(fe);V(X({},ve,{sections:ie}))},B=Y=>{const Z=(ie,fe)=>{const ve=t.parse(ie,p);if(ve==null||!t.isValid(ve))return null;const se=Nke({utils:t,localeText:n,localizedDigits:T,format:p,date:ve,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:w,isRtl:i});return $ke(t,ve,se,fe,!1)},ge=s.parseValueStr(Y,I.referenceValue,Z),ne=s.updateReferenceValue(t,ge,I.referenceValue);V({value:ge,referenceValue:ne,sections:P(ge,I.sections)})},H=({activeSection:Y,newSectionValue:Z,shouldGoToNextSection:ge})=>{ge&&jX({},G,se,{sections:ie,tempValueStrAndroid:null}))},Q=Y=>R(Z=>X({},Z,{tempValueStrAndroid:Y}));return M.useEffect(()=>{const Y=P(I.value);R(Z=>X({},Z,{sections:Y}))},[p,t.locale,i]),M.useEffect(()=>{let Y;o.areValuesEqual(t,I.value,_)?Y=o.getTimezone(t,I.value)!==o.getTimezone(t,_):Y=!0,Y&&R(Z=>X({},Z,{value:_,referenceValue:s.updateReferenceValue(t,_,Z.referenceValue),sections:P(_)}))},[_]),{state:I,activeSectionIndex:j,parsedSelectedSections:$,setSelectedSections:L,clearValue:z,clearActiveSection:N,updateSectionValue:H,updateValueFromValueStr:B,setTempAndroidValueStr:Q,getSectionsFromValue:P,sectionsValueBoundaries:k,localizedDigits:T,timezone:S}},HPn=5e3,$_=e=>e.saveQuery!=null,GPn=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{const s=bi(),[a,l]=M.useState(null),c=ft(()=>l(null));M.useEffect(()=>{a!=null&&e[a.sectionIndex]?.type!==a.sectionType&&c()},[e,a,c]),M.useEffect(()=>{if(a!=null){const p=setTimeout(()=>c(),HPn);return()=>{clearTimeout(p)}}return()=>{}},[a,c]);const u=({keyPressed:p,sectionIndex:g},m,v)=>{const y=p.toLowerCase(),b=e[g];if(a!=null&&(!v||v(a.value))&&a.sectionIndex===g){const S=`${a.value}${y}`,_=m(S,b);if(!$_(_))return l({sectionIndex:g,value:S,sectionType:b.type}),_}const w=m(y,b);return $_(w)&&!w.saveQuery?(c(),null):(l({sectionIndex:g,value:y,sectionType:b.type}),$_(w)?null:w)},f=p=>{const g=(y,b,w)=>{const S=b.filter(_=>_.toLowerCase().startsWith(w));return S.length===0?{saveQuery:!1}:{sectionValue:S[0],shouldGoToNextSection:S.length===1}},m=(y,b,w,S)=>{const _=E=>Det(s,o,b.type,E);if(b.contentType==="letter")return g(b.format,_(b.format),y);if(w&&S!=null&&Iet(s,w).contentType==="letter"){const E=_(w),T=g(w,E,y);return $_(T)?{saveQuery:!1}:X({},T,{sectionValue:S(T.sectionValue,E)})}return{saveQuery:!1}};return u(p,(y,b)=>{switch(b.type){case"month":{const w=S=>Lke(s,S,s.formats.month,b.format);return m(y,b,s.formats.month,w)}case"weekDay":{const w=(S,_)=>_.indexOf(S).toString();return m(y,b,s.formats.weekday,w)}case"meridiem":return m(y,b);default:return{saveQuery:!1}}})},d=p=>{const g=(v,y)=>{const b=Aw(v,r),w=Number(b),S=n[y.type]({currentDate:null,format:y.format,contentType:y.contentType});if(w>S.maximum)return{saveQuery:!1};if(wS.maximum||b.length===S.maximum.toString().length;return{sectionValue:Fet(s,w,S,r,y),shouldGoToNextSection:_}};return u(p,(v,y)=>{if(y.contentType==="digit"||y.contentType==="digit-with-letter")return g(v,y);if(y.type==="month"){$et(s,"digit","month","MM");const b=g(v,{type:y.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if($_(b))return b;const w=Lke(s,b.sectionValue,"MM",y.format);return X({},b,{sectionValue:w})}if(y.type==="weekDay"){const b=g(v,y);if($_(b))return b;const w=B8(s,y.format)[Number(b.sectionValue)-1];return X({},b,{sectionValue:w})}return{saveQuery:!1}},v=>Dke(v,r))};return{applyCharacterEditing:ft(p=>{const g=e[p.sectionIndex],v=Dke(p.keyPressed,r)?d(X({},p,{keyPressed:fge(p.keyPressed,r)})):f(p);if(v==null){i(null);return}t({activeSection:g,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:c}};function qPn(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const XPn=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},Ml=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?Ml(t.shadowRoot):t:null},QB=e=>Array.from(e.children).indexOf(Ml(document)),YPn="@media (pointer: fine)",QPn=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:s,onInput:a,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:f,applyCharacterEditing:d,resetCharacterQuery:h,setSelectedSections:p,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:b,updateValueFromValueStr:w,sectionOrder:S,areAllSectionsEmpty:_,sectionsValueBoundaries:E}=e,T=M.useRef(null),k=zn(r,T),P=qc(),I=bi(),R=fr(),[F,A]=M.useState(!1),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!T.current)return;const ue=document.getSelection();if(!ue)return;if(g==null){ue.rangeCount>0&&T.current.getRoot().contains(ue.getRangeAt(0).startContainer)&&ue.removeAllRanges(),F&&T.current.getRoot().blur();return}if(!T.current.getRoot().contains(Ml(document)))return;const G=new window.Range;let ce;g==="all"?ce=T.current.getRoot():m.sections[g].type==="empty"?ce=T.current.getSectionContainer(g):ce=T.current.getSectionContent(g),G.selectNodeContents(ce),ce.focus(),ue.removeAllRanges(),ue.addRange(G)},getActiveSectionIndexFromDOM:()=>{const ue=Ml(document);return!ue||!T.current||!T.current.getRoot().contains(ue)?null:T.current.getSectionIndexFromDOMElement(ue)},focusField:(ue=0)=>{if(!T.current||L.getActiveSectionIndexFromDOM()!=null)return;const G=tie(ue,m.sections);A(!0),T.current.getSectionContent(G).focus()},setSelectedSections:ue=>{if(!T.current)return;const G=tie(ue,m.sections);A((G==="all"?0:G)!==null),p(ue)},isFieldFocused:()=>{const ue=Ml(document);return!!T.current&&T.current.getRoot().contains(ue)}}),[g,p,m.sections,F]),$=ft(ue=>{if(!T.current)return;const G=m.sections[ue];T.current.getSectionContent(ue).innerHTML=G.value||G.placeholder,L.syncSelectionToDOM()}),j=ft((ue,...G)=>{ue.isDefaultPrevented()||!T.current||(A(!0),o?.(ue,...G),g==="all"?setTimeout(()=>{const ce=document.getSelection().getRangeAt(0).startOffset;if(ce===0){p(S.startIndex);return}let pe=0,J=0;for(;J{if(a?.(ue),!T.current||g!=="all")return;const ce=ue.target.textContent??"";T.current.getRoot().innerHTML=m.sections.map(pe=>`${pe.startSeparator}${pe.value||pe.placeholder}${pe.endSeparator}`).join(""),L.syncSelectionToDOM(),ce.length===0||ce.charCodeAt(0)===10?(h(),y(),p("all")):ce.length>1?w(ce):(g==="all"&&p(0),d({keyPressed:ce,sectionIndex:0}))}),U=ft(ue=>{if(l?.(ue),n||g!=="all"){ue.preventDefault();return}const G=ue.clipboardData.getData("text");ue.preventDefault(),h(),w(G)}),z=ft((...ue)=>{if(s?.(...ue),F||!T.current)return;A(!0),T.current.getSectionIndexFromDOMElement(Ml(document))!=null||p(S.startIndex)}),N=ft((...ue)=>{i?.(...ue),setTimeout(()=>{if(!T.current)return;const G=Ml(document);!T.current.getRoot().contains(G)&&(A(!1),p(null))})}),B=ft(ue=>G=>{G.isDefaultPrevented()||p(ue)}),H=ft(ue=>{ue.preventDefault()}),Q=ft(ue=>()=>{p(ue)}),Y=ft(ue=>{if(ue.preventDefault(),n||t||typeof g!="number")return;const G=m.sections[g],ce=ue.clipboardData.getData("text"),pe=/^[a-zA-Z]+$/.test(ce),J=/^[0-9]+$/.test(ce),te=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ce);G.contentType==="letter"&&pe||G.contentType==="digit"&&J||G.contentType==="digit-with-letter"&&te?(h(),b({activeSection:G,newSectionValue:ce,shouldGoToNextSection:!0})):!pe&&!J&&(h(),w(ce))}),Z=ft(ue=>{ue.preventDefault(),ue.dataTransfer.dropEffect="none"}),ge=ft(ue=>{if(!T.current)return;const G=ue.target,ce=G.textContent??"",pe=T.current.getSectionIndexFromDOMElement(G),J=m.sections[pe];if(n||!T.current){$(pe);return}if(ce.length===0){if(J.value===""){$(pe);return}const te=ue.nativeEvent.inputType;if(te==="insertParagraph"||te==="insertLineBreak"){$(pe);return}h(),v();return}d({keyPressed:ce,sectionIndex:pe}),$(pe)});lr(()=>{if(!(!F||!T.current)){if(g==="all")T.current.getRoot().focus();else if(typeof g=="number"){const ue=T.current.getSectionContent(g);ue&&ue.focus()}}},[g,F]);const ne=M.useMemo(()=>m.sections.reduce((ue,G)=>(ue[G.type]=E[G.type]({currentDate:null,contentType:G.contentType,format:G.format}),ue),{}),[E,m.sections]),ie=g==="all",fe=M.useMemo(()=>m.sections.map((ue,G)=>{const ce=!ie&&!t&&!n;return{container:{"data-sectionindex":G,onClick:B(G)},content:{tabIndex:ie||G>0?-1:0,contentEditable:!ie&&!t&&!n,role:"spinbutton",id:`${R}-${ue.type}`,"aria-labelledby":`${R}-${ue.type}`,"aria-readonly":n,"aria-valuenow":RPn(ue,I),"aria-valuemin":ne[ue.type].minimum,"aria-valuemax":ne[ue.type].maximum,"aria-valuetext":ue.value?APn(ue,I):P.empty,"aria-label":P[ue.type],"aria-disabled":t,spellCheck:ce?!1:void 0,autoCapitalize:ce?"off":void 0,autoCorrect:ce?"off":void 0,[parseInt(M.version,10)>=17?"enterKeyHint":"enterkeyhint"]:ce?"next":void 0,children:ue.value||ue.placeholder,onInput:ge,onPaste:Y,onFocus:Q(G),onDragOver:Z,onMouseUp:H,inputMode:ue.contentType==="letter"?"text":"numeric"},before:{children:ue.startSeparator},after:{children:ue.endSeparator}}}),[m.sections,Q,Y,Z,ge,B,H,t,n,ie,P,I,ne,R]),ve=ft(ue=>{w(ue.target.value)}),se=M.useMemo(()=>_?"":f.getV7HiddenInputValueFromSections(m.sections),[_,m.sections,f]);return M.useEffect(()=>{if(T.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.","","If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(` +`));u&&T.current&&T.current.getSectionContent(S.startIndex).focus()},[]),{interactions:L,returnedValue:{autoFocus:u,readOnly:n,focused:c??F,sectionListRef:k,onBlur:N,onClick:j,onFocus:z,onInput:V,onPaste:U,enableAccessibleFieldDOMStructure:!0,elements:fe,tabIndex:g===0?-1:0,contentEditable:ie,value:se,onChange:ve,areAllSectionsEmpty:_}}},UC=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),KPn=(e,t,n)=>{let r=0,i=n?1:0;const o=[];for(let s=0;s{const t=yi(),n=M.useRef(void 0),r=M.useRef(void 0),{forwardedProps:{onFocus:i,onClick:o,onPaste:s,onBlur:a,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:f=!1},parsedSelectedSections:d,activeSectionIndex:h,state:p,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:b,updateValueFromValueStr:w,clearActiveSection:S,clearValue:_,setTempAndroidValueStr:E,setSelectedSections:T,getSectionsFromValue:k,areAllSectionsEmpty:P,localizedDigits:I}=e,R=M.useRef(null),F=zn(l,R),A=M.useMemo(()=>KPn(p.sections,I,t),[p.sections,I,t]),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!R.current)return;if(d==null){R.current.scrollLeft&&(R.current.scrollLeft=0);return}if(R.current!==Ml(document))return;const ge=R.current.scrollTop;if(d==="all")R.current.select();else{const ne=A[d],ie=ne.type==="empty"?ne.startInInput-ne.startSeparator.length:ne.startInInput,fe=ne.type==="empty"?ne.endInInput+ne.endSeparator.length:ne.endInInput;(ie!==R.current.selectionStart||fe!==R.current.selectionEnd)&&R.current===Ml(document)&&R.current.setSelectionRange(ie,fe),clearTimeout(r.current),r.current=setTimeout(()=>{R.current&&R.current===Ml(document)&&R.current.selectionStart===R.current.selectionEnd&&(R.current.selectionStart!==ie||R.current.selectionEnd!==fe)&&L.syncSelectionToDOM()})}R.current.scrollTop=ge},getActiveSectionIndexFromDOM:()=>{const ge=R.current.selectionStart??0,ne=R.current.selectionEnd??0;if(ge===0&&ne===0)return null;const ie=ge<=A[0].startInInput?1:A.findIndex(fe=>fe.startInInput-fe.startSeparator.length>ge);return ie===-1?A.length-1:ie-1},focusField:(ge=0)=>{Ml(document)!==R.current&&(R.current?.focus(),T(ge))},setSelectedSections:ge=>T(ge),isFieldFocused:()=>R.current===Ml(document)}),[R,d,A,T]),$=()=>{const ge=R.current.selectionStart??0;let ne;ge<=A[0].startInInput||ge>=A[A.length-1].endInInput?ne=1:ne=A.findIndex(fe=>fe.startInInput-fe.startSeparator.length>ge);const ie=ne===-1?A.length-1:ne-1;T(ie)},j=ft((...ge)=>{i?.(...ge);const ne=R.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ne||ne!==R.current||h==null&&(ne.value.length&&Number(ne.selectionEnd)-Number(ne.selectionStart)===ne.value.length?T("all"):$())})}),V=ft((ge,...ne)=>{ge.isDefaultPrevented()||(o?.(ge,...ne),$())}),U=ft(ge=>{if(s?.(ge),ge.preventDefault(),u||f)return;const ne=ge.clipboardData.getData("text");if(typeof d=="number"){const ie=p.sections[d],fe=/^[a-zA-Z]+$/.test(ne),ve=/^[0-9]+$/.test(ne),se=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ne);if(ie.contentType==="letter"&&fe||ie.contentType==="digit"&&ve||ie.contentType==="digit-with-letter"&&se){y(),b({activeSection:ie,newSectionValue:ne,shouldGoToNextSection:!0});return}if(fe||ve)return}y(),w(ne)}),z=ft((...ge)=>{a?.(...ge),T(null)}),N=ft(ge=>{if(u)return;const ne=ge.target.value;if(ne===""){y(),_();return}const ie=ge.nativeEvent.data,fe=ie&&ie.length>1,ve=fe?ie:ne,se=UC(ve);if(d==="all"&&T(h),h==null||fe){w(fe?ie:se);return}let ue;if(d==="all"&&se.length===1)ue=se;else{const G=UC(g.getV6InputValueFromSections(A,I,t));let ce=-1,pe=-1;for(let we=0;weJ.end)return;const ae=se.length-G.length+J.end-UC(J.endSeparator||"").length;ue=se.slice(J.start+UC(J.startSeparator||"").length,ae)}if(ue.length===0){kPn()&&E(ve),y(),S();return}v({keyPressed:ue,sectionIndex:h})}),B=M.useMemo(()=>c!==void 0?c:g.getV6InputValueFromSections(k(m.emptyValue),I,t),[c,g,k,m.emptyValue,I,t]),H=M.useMemo(()=>p.tempValueStrAndroid??g.getV6InputValueFromSections(p.sections,I,t),[p.sections,g,p.tempValueStrAndroid,I,t]);M.useEffect(()=>(R.current&&R.current===Ml(document)&&T("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const Q=M.useMemo(()=>h==null||p.sections[h].contentType==="letter"?"text":"numeric",[h,p.sections]),Z=!(R.current&&R.current===Ml(document))&&P;return{interactions:L,returnedValue:{readOnly:u,onBlur:z,onClick:V,onFocus:j,onPaste:U,inputRef:F,enableAccessibleFieldDOMStructure:!1,placeholder:B,inputMode:Q,autoComplete:"off",value:Z?"":H,onChange:N}}},JPn=e=>{const t=bi(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:f},fieldValueManager:d,valueManager:h,validator:p}=e,g=yi(),m=WPn(e),{state:v,activeSectionIndex:y,parsedSelectedSections:b,setSelectedSections:w,clearValue:S,clearActiveSection:_,updateSectionValue:E,setTempAndroidValueStr:T,sectionsValueBoundaries:k,localizedDigits:P,timezone:I}=m,R=GPn({sections:v.sections,updateSectionValue:E,sectionsValueBoundaries:k,localizedDigits:P,setTempAndroidValueStr:T,timezone:I}),{resetCharacterQuery:F}=R,A=h.areValuesEqual(t,v.value,h.emptyValue),L=o?QPn:ZPn,$=M.useMemo(()=>MPn(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:j,interactions:V}=L(X({},e,m,R,{areAllSectionsEmpty:A,sectionOrder:$})),U=ft(Y=>{if(l?.(Y),!s)switch(!0){case((Y.ctrlKey||Y.metaKey)&&String.fromCharCode(Y.keyCode)==="A"&&!Y.shiftKey&&!Y.altKey):{Y.preventDefault(),w("all");break}case Y.key==="ArrowRight":{if(Y.preventDefault(),b==null)w($.startIndex);else if(b==="all")w($.endIndex);else{const Z=$.neighbors[b].rightIndex;Z!==null&&w(Z)}break}case Y.key==="ArrowLeft":{if(Y.preventDefault(),b==null)w($.endIndex);else if(b==="all")w($.startIndex);else{const Z=$.neighbors[b].leftIndex;Z!==null&&w(Z)}break}case Y.key==="Delete":{if(Y.preventDefault(),a)break;b==null||b==="all"?S():_(),F();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(Y.key):{if(Y.preventDefault(),a||y==null)break;b==="all"&&w(y);const Z=v.sections[y],ge=d.getActiveDateManager(t,v,Z),ne=SPn(t,I,Z,Y.key,k,P,ge.date,{minutesStep:i});E({activeSection:Z,newSectionValue:ne,shouldGoToNextSection:!1});break}}});lr(()=>{V.syncSelectionToDOM()});const{hasValidationError:z}=Het({props:n,validator:p,timezone:I,value:v.value,onError:n.onError}),N=M.useMemo(()=>c!==void 0?c:z,[z,c]);M.useEffect(()=>{!N&&y==null&&F()},[v.referenceValue,y,N]),M.useEffect(()=>{v.tempValueStrAndroid!=null&&y!=null&&(F(),_())},[v.sections]),M.useImperativeHandle(r,()=>({getSections:()=>v.sections,getActiveSectionIndex:V.getActiveSectionIndexFromDOM,setSelectedSections:V.setSelectedSections,focusField:V.focusField,isFieldFocused:V.isFieldFocused}));const B=ft((Y,...Z)=>{Y.preventDefault(),f?.(Y,...Z),S(),V.isFieldFocused()?w($.startIndex):V.focusField(0)}),H={onKeyDown:U,onClear:B,error:N,clearable:!!(u&&!A&&!a&&!s)},Q={disabled:s,readOnly:a};return X({},e.forwardedProps,H,Q,j)},ekn=at(O.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),tkn=at(O.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),nkn=at(O.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),rkn=at(O.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar");at(O.jsxs(M.Fragment,{children:[O.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),O.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");const ikn=at(O.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),okn=at(O.jsxs(M.Fragment,{children:[O.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),O.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),skn=at(O.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),akn=["clearable","onClear","InputProps","sx","slots","slotProps"],lkn=["ownerState"],ckn=e=>{const t=qc(),{clearable:n,onClear:r,InputProps:i,sx:o,slots:s,slotProps:a}=e,l=st(e,akn),c=s?.clearButton??Mn,u=Xn({elementType:c,externalSlotProps:a?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),f=st(u,lkn),d=s?.clearIcon??skn,h=Xn({elementType:d,externalSlotProps:a?.clearIcon,ownerState:{}});return X({},l,{InputProps:X({},i,{endAdornment:O.jsxs(M.Fragment,{children:[n&&O.jsx(oae,{position:"end",sx:{marginRight:i?.endAdornment?-1:-1.5},children:O.jsx(c,X({},f,{onClick:r,children:O.jsx(d,X({fontSize:"small"},h))}))}),i?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})},ukn=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],fkn=(e,t)=>M.useMemo(()=>{const n=X({},e),r={},i=o=>{n.hasOwnProperty(o)&&(r[o]=n[o],delete n[o])};return ukn.forEach(i),zet.forEach(i),jet.forEach(i),Bet.forEach(i),{forwardedProps:n,internalProps:r}},[e,t]),dkn=M.createContext(null);function Get(e){const{contextValue:t,localeText:n,children:r}=e;return O.jsx(dkn.Provider,{value:t,children:O.jsx(Aet,{localeText:n,children:r})})}const hkn=e=>{const t=bi(),n=ML(),i=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h;return X({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??i,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:nd(t,e.minDateTime??e.minDate,n.minDate),maxDate:nd(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime})},pkn=e=>{const t=hkn(e),{forwardedProps:n,internalProps:r}=fkn(t,"date-time");return JPn({forwardedProps:n,internalProps:r,valueManager:yl,fieldValueManager:DPn,validator:U8,valueType:"date-time"})};function gkn(e){return pt("MuiPickersTextField",e)}dt("MuiPickersTextField",["root","focused","disabled","error","required"]);function mkn(e){return pt("MuiPickersInputBase",e)}const mO=dt("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function vkn(e){return pt("MuiPickersSectionList",e)}const a2=dt("MuiPickersSectionList",["root","section","sectionContent"]),ykn=["slots","slotProps","elements","sectionListRef"],qet=Oe("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),Xet=Oe("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),Yet=Oe("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),Qet=Oe("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),bkn=e=>{const{classes:t}=e;return Xe({root:["root"],section:["section"],sectionContent:["sectionContent"]},vkn,t)};function xkn(e){const{slots:t,slotProps:n,element:r,classes:i}=e,o=t?.section??Xet,s=Xn({elementType:o,externalSlotProps:n?.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),a=t?.sectionContent??Qet,l=Xn({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),c=t?.sectionSeparator??Yet,u=Xn({elementType:c,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Xn({elementType:c,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return O.jsxs(o,X({},s,{children:[O.jsx(c,X({},u)),O.jsx(a,X({},l)),O.jsx(c,X({},f))]}))}const wkn=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersSectionList"}),{slots:i,slotProps:o,elements:s,sectionListRef:a}=r,l=st(r,ykn),c=bkn(r),u=M.useRef(null),f=zn(n,u),d=g=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${g} before the mount of the component.`);return u.current};M.useImperativeHandle(a,()=>({getRoot(){return d("getRoot")},getSectionContainer(g){return d("getSectionContainer").querySelector(`.${a2.section}[data-sectionindex="${g}"]`)},getSectionContent(g){return d("getSectionContent").querySelector(`.${a2.section}[data-sectionindex="${g}"] .${a2.sectionContent}`)},getSectionIndexFromDOMElement(g){const m=d("getSectionIndexFromDOMElement");if(g==null||!m.contains(g))return null;let v=null;return g.classList.contains(a2.section)?v=g:g.classList.contains(a2.sectionContent)&&(v=g.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const h=i?.root??qet,p=Xn({elementType:h,externalSlotProps:o?.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return O.jsx(h,X({},p,{children:p.contentEditable?s.map(({content:g,before:m,after:v})=>`${m.children}${g.children}${v.children}`).join(""):O.jsx(M.Fragment,{children:s.map((g,m)=>O.jsx(xkn,{slots:i,slotProps:o,element:g,classes:c},m))})}))}),Skn=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],_kn=e=>Math.round(e*1e5)/1e5,V8=Oe("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>X({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${_kn(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),gge=Oe(qet,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:t,focused:n,filled:r,label:i})=>!t&&!n&&!r&&i==null,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),Ckn=Oe(Xet,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),Okn=Oe(Qet,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Ekn=Oe(Yet,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),Tkn=Oe("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(X({},sze)),Pkn=e=>{const{focused:t,disabled:n,error:r,classes:i,fullWidth:o,readOnly:s,color:a,size:l,endAdornment:c,startAdornment:u}=e,f={root:["root",t&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",o&&"fullWidth",`color${Ue(a)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Xe(f,mkn,i)},mge=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:o,value:s,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:f,slots:d,slotProps:h,contentEditable:p,tabIndex:g,onInput:m,onPaste:v,onKeyDown:y,name:b,readOnly:w,inputProps:S,inputRef:_,sectionListRef:E}=r,T=st(r,Skn),k=M.useRef(null),P=zn(n,k),I=zn(S?.ref,_),R=yi(),F=Jl();if(!F)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const A=z=>{if(F.disabled){z.stopPropagation();return}F.onFocus?.(z)};M.useEffect(()=>{F&&F.setAdornedStart(!!u)},[F,u]),M.useEffect(()=>{F&&(o?F.onEmpty():F.onFilled())},[F,o]);const L=X({},r,F,{isRtl:R}),$=Pkn(L),j=d?.root||V8,V=Xn({elementType:j,externalSlotProps:h?.root,externalForwardedProps:T,additionalProps:{"aria-invalid":F.error,ref:P},className:$.root,ownerState:L}),U=d?.input||gge;return O.jsxs(j,X({},V,{children:[u,O.jsx(wkn,{sectionListRef:E,elements:i,contentEditable:p,tabIndex:g,className:$.sectionsContainer,onFocus:A,onBlur:F.onBlur,onInput:m,onPaste:v,onKeyDown:y,slots:{root:U,section:Ckn,sectionContent:Okn,sectionSeparator:Ekn},slotProps:{root:{ownerState:L},sectionContent:{className:mO.sectionContent},sectionSeparator:({position:z})=>({className:z==="before"?mO.sectionBefore:mO.sectionAfter})}}),c,f?f(X({},F)):null,O.jsx(Tkn,X({name:b,className:$.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:w,required:F.required,disabled:F.disabled},S,{ref:I}))]}))});function kkn(e){return pt("MuiPickersOutlinedInput",e)}const Od=X({},mO,dt("MuiPickersOutlinedInput",["root","notchedOutline","input"])),Mkn=["children","className","label","notched","shrink"],Akn=Oe("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),zke=Oe("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),Rkn=Oe("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function Ikn(e){const{className:t,label:n}=e,r=st(e,Mkn),i=n!=null&&n!=="",o=X({},e,{withLabel:i});return O.jsx(Akn,X({"aria-hidden":!0,className:t},r,{ownerState:o,children:O.jsx(Rkn,{ownerState:o,children:i?O.jsx(zke,{children:n}):O.jsx(zke,{className:"notranslate",children:"​"})})}))}const Dkn=["label","autoFocus","ownerState","notched"],Lkn=Oe(V8,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Od.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Od.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Od.focused} .${Od.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Od.disabled}`]:{[`& .${Od.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${Od.error} .${Od.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>(e.vars??e).palette[n]?.main??!1).map(n=>({props:{color:n},style:{[`&.${Od.focused}:not(.${Od.error}) .${Od.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),Fkn=Oe(gge,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),$kn=e=>{const{classes:t}=e,r=Xe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},kkn,t);return X({},t,r)},Ket=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:o,notched:s}=r,a=st(r,Dkn),l=Jl(),c=X({},r,o,l,{color:l?.color||"primary"}),u=$kn(c);return O.jsx(mge,X({slots:{root:Lkn,input:Fkn},renderSuffix:f=>O.jsx(Ikn,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:u.notchedOutline,label:i!=null&&i!==""&&l?.required?O.jsxs(M.Fragment,{children:[i," ","*"]}):i,ownerState:c})},a,{label:i,classes:u,ref:n}))});Ket.muiName="Input";function Nkn(e){return pt("MuiPickersFilledInput",e)}const _x=X({},mO,dt("MuiPickersFilledInput",["root","underline","input"])),zkn=["label","autoFocus","disableUnderline","ownerState"],jkn=Oe(V8,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>rz(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${_x.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${_x.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:o},variants:[...Object.keys((e.vars??e).palette).filter(s=>(e.vars??e).palette[s].main).map(s=>({props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${_x.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${_x.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${_x.disabled}, .${_x.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${_x.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),Bkn=Oe(gge,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),Ukn=e=>{const{classes:t,disableUnderline:n}=e,i=Xe({root:["root",!n&&"underline"],input:["input"]},Nkn,t);return X({},t,i)},Zet=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=st(r,zkn),l=Jl(),c=X({},r,s,l,{color:l?.color||"primary"}),u=Ukn(c);return O.jsx(mge,X({slots:{root:jkn,input:Bkn},slotProps:{root:{disableUnderline:o}}},a,{label:i,classes:u,ref:n}))});Zet.muiName="Input";function Vkn(e){return pt("MuiPickersFilledInput",e)}const l2=X({},mO,dt("MuiPickersInput",["root","input"])),Wkn=["label","autoFocus","disableUnderline","ownerState"],Hkn=Oe(V8,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${l2.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${l2.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${l2.disabled}, .${l2.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${l2.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),Gkn=e=>{const{classes:t,disableUnderline:n}=e,i=Xe({root:["root",!n&&"underline"],input:["input"]},Vkn,t);return X({},t,i)},Jet=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=st(r,Wkn),l=Jl(),c=X({},r,s,l,{disableUnderline:o,color:l?.color||"primary"}),u=Gkn(c);return O.jsx(mge,X({slots:{root:Hkn}},a,{label:i,classes:u,ref:n}))});Jet.muiName="Input";const qkn=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],Xkn={standard:Jet,filled:Zet,outlined:Ket},Ykn=Oe(sd,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),Qkn=e=>{const{focused:t,disabled:n,classes:r,required:i}=e;return Xe({root:["root",t&&!n&&"focused",n&&"disabled",i&&"required"]},gkn,r)},Kkn=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersTextField"}),{onFocus:i,onBlur:o,className:s,color:a="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:f=!1,InputProps:d,inputProps:h,inputRef:p,sectionListRef:g,elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:b,onKeyUp:w,onPaste:S,onInput:_,endAdornment:E,startAdornment:T,tabIndex:k,contentEditable:P,focused:I,value:R,onChange:F,fullWidth:A,id:L,name:$,helperText:j,FormHelperTextProps:V,label:U,InputLabelProps:z}=r,N=st(r,qkn),B=M.useRef(null),H=zn(n,B),Q=fr(L),Y=j&&Q?`${Q}-helper-text`:void 0,Z=U&&Q?`${Q}-label`:void 0,ge=X({},r,{color:a,disabled:l,error:c,focused:I,required:f,variant:u}),ne=Qkn(ge),ie=Xkn[u];return O.jsxs(Ykn,X({className:Re(ne.root,s),ref:H,focused:I,onFocus:i,onBlur:o,disabled:l,variant:u,error:c,color:a,fullWidth:A,required:f,ownerState:ge},N,{children:[O.jsx(bv,X({htmlFor:Q,id:Z},z,{children:U})),O.jsx(ie,X({elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:b,onKeyUp:w,onInput:_,onPaste:S,endAdornment:E,startAdornment:T,tabIndex:k,contentEditable:P,value:R,onChange:F,id:Q,fullWidth:A,inputProps:h,inputRef:p,sectionListRef:g,label:U,name:$,role:"group","aria-labelledby":Z,"aria-describedby":Y,"aria-live":Y?"polite":void 0},d)),j&&O.jsx(nae,X({id:Y},V,{children:j}))]}))}),Zkn=["enableAccessibleFieldDOMStructure"],Jkn=["InputProps","readOnly"],e2n=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],t2n=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=st(e,Zkn);if(t){const{InputProps:f,readOnly:d}=n,h=st(n,Jkn);return X({},h,{InputProps:X({},f??{},{readOnly:d})})}const{onPaste:r,onKeyDown:i,inputMode:o,readOnly:s,InputProps:a,inputProps:l,inputRef:c}=n,u=st(n,e2n);return X({},u,{InputProps:X({},a??{},{readOnly:s}),inputProps:X({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:c})})},n2n=["slots","slotProps","InputProps","inputProps"],ett=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiDateTimeField"}),{slots:i,slotProps:o,InputProps:s,inputProps:a}=r,l=st(r,n2n),c=r,u=i?.textField??(t.enableAccessibleFieldDOMStructure?Kkn:Ii),f=Xn({elementType:u,externalSlotProps:o?.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});f.inputProps=X({},a,f.inputProps),f.InputProps=X({},s,f.InputProps);const d=pkn(f),h=t2n(d),p=ckn(X({},h,{slots:i,slotProps:o}));return O.jsx(u,X({},p))});function r2n(e){return pt("MuiDateTimePickerTabs",e)}dt("MuiDateTimePickerTabs",["root"]);const i2n=e=>AE(e)?"date":"time",o2n=e=>e==="date"?"day":"hours",s2n=e=>{const{classes:t}=e;return Xe({root:["root"]},r2n,t)},a2n=Oe(dae,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${lz.indicator}`]:{bottom:"auto",top:0}}})),l2n=function(t){const n=Rr({props:t,name:"MuiDateTimePickerTabs"}),{dateIcon:r=O.jsx(ikn,{}),onViewChange:i,timeIcon:o=O.jsx(okn,{}),view:s,hidden:a=typeof window>"u"||window.innerHeight<667,className:l,sx:c}=n,u=qc(),f=s2n(n),d=(h,p)=>{i(o2n(p))};return a?null:O.jsxs(a2n,{ownerState:n,variant:"fullWidth",value:i2n(s),onChange:d,className:Re(l,f.root),sx:c,children:[O.jsx(PA,{value:"date","aria-label":u.dateTableLabel,icon:O.jsx(M.Fragment,{children:r})}),O.jsx(PA,{value:"time","aria-label":u.timeTableLabel,icon:O.jsx(M.Fragment,{children:o})})]})};function c2n(e){return pt("MuiPickersToolbarText",e)}const nie=dt("MuiPickersToolbarText",["root","selected"]),u2n=["className","selected","value"],f2n=e=>{const{classes:t,selected:n}=e;return Xe({root:["root",n&&"selected"]},c2n,t)},d2n=Oe(mn,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${nie.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${nie.selected}`]:{color:(e.vars||e).palette.text.primary}})),ttt=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersToolbarText"}),{className:i,value:o}=r,s=st(r,u2n),a=f2n(r);return O.jsx(d2n,X({ref:n,className:Re(a.root,i),component:"span"},s,{children:o}))});function ntt(e){return pt("MuiPickersToolbar",e)}const h2n=dt("MuiPickersToolbar",["root","content"]),p2n=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],g2n=e=>{const{classes:t}=e;return Xe({root:["root"],content:["content"]},ntt,t)},m2n=Oe("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),v2n=Oe("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),y2n=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersToolbar"}),{children:i,className:o,toolbarTitle:s,hidden:a,titleId:l}=r,c=st(r,p2n),u=r,f=g2n(u);return a?null:O.jsxs(m2n,X({ref:n,className:Re(f.root,o),ownerState:u},c,{children:[O.jsx(mn,{color:"text.secondary",variant:"overline",id:l,children:s}),O.jsx(v2n,{className:f.content,ownerState:u,children:i})]}))}),b2n=["align","className","selected","typographyClassName","value","variant","width"],x2n=e=>{const{classes:t}=e;return Xe({root:["root"]},ntt,t)},w2n=Oe(zi,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),my=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:s,typographyClassName:a,value:l,variant:c,width:u}=r,f=st(r,b2n),d=x2n(r);return O.jsx(w2n,X({variant:"text",ref:n,className:Re(d.root,o)},u?{sx:{width:u}}:{},f,{children:O.jsx(ttt,{align:i,className:a,variant:c,value:l,selected:s})}))});function S2n(e){return pt("MuiDateTimePickerToolbar",e)}const uX=dt("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]);function _2n(e,{disableFuture:t,maxDate:n,timezone:r}){const i=bi();return M.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(t&&i.isBefore(o,n)?o:n);return!i.isAfter(s,e)},[t,n,e,i,r])}function C2n(e,{disablePast:t,minDate:n,timezone:r}){const i=bi();return M.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(t&&i.isAfter(o,n)?o:n);return!i.isBefore(s,e)},[t,n,e,i,r])}function vge(e,t,n,r){const i=bi(),o=gPn(e,i),s=M.useCallback(a=>{const l=e==null?null:mPn(e,a,!!t,i);n(l,r??"partial")},[t,e,n,r,i]);return{meridiemMode:o,handleMeridiemChange:s}}const PR=36,W8=2,H8=320,O2n=280,G8=336,rtt=232,bM=48,E2n=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],T2n=e=>{const{classes:t,isLandscape:n,isRtl:r}=e;return Xe({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},S2n,t)},P2n=Oe(y2n,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${h2n.content} .${nie.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),k2n=Oe("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),M2n=Oe("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&t!=="desktop",style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&t!=="desktop"&&n,style:{flexDirection:"column-reverse"}}]}),A2n=Oe("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),jke=Oe(ttt,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),R2n=Oe("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${uX.ampmLabel}`]:t.ampmLabel},{[`&.${uX.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${uX.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function I2n(e){const t=Rr({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:s,isLandscape:a,onViewChange:l,toolbarFormat:c,toolbarPlaceholder:u="––",views:f,disabled:d,readOnly:h,toolbarVariant:p="mobile",toolbarTitle:g,className:m}=t,v=st(t,E2n),y=yi(),b=X({},t,{isRtl:y}),w=bi(),{meridiemMode:S,handleMeridiemChange:_}=vge(i,n,o),E=!!(n&&!r),T=p==="desktop",k=qc(),P=T2n(b),I=g??k.dateTimePickerToolbarTitle,R=A=>n?w.format(A,"hours12h"):w.format(A,"hours24h"),F=M.useMemo(()=>i?c?w.formatByString(i,c):w.format(i,"shortDate"):u,[i,c,u,w]);return O.jsxs(P2n,X({isLandscape:a,className:Re(P.root,m),toolbarTitle:I},v,{ownerState:b,children:[O.jsxs(k2n,{className:P.dateContainer,ownerState:b,children:[f.includes("year")&&O.jsx(my,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:s==="year",value:i?w.format(i,"year"):"–"}),f.includes("day")&&O.jsx(my,{tabIndex:-1,variant:T?"h5":"h4",onClick:()=>l("day"),selected:s==="day",value:F})]}),O.jsxs(M2n,{className:P.timeContainer,ownerState:b,children:[O.jsxs(A2n,{className:P.timeDigitsContainer,ownerState:b,children:[f.includes("hours")&&O.jsxs(M.Fragment,{children:[O.jsx(my,{variant:T?"h5":"h3",width:T&&!a?bM:void 0,onClick:()=>l("hours"),selected:s==="hours",value:i?R(i):"--"}),O.jsx(jke,{variant:T?"h5":"h3",value:":",className:P.separator,ownerState:b}),O.jsx(my,{variant:T?"h5":"h3",width:T&&!a?bM:void 0,onClick:()=>l("minutes"),selected:s==="minutes"||!f.includes("minutes")&&s==="hours",value:i?w.format(i,"minutes"):"--",disabled:!f.includes("minutes")})]}),f.includes("seconds")&&O.jsxs(M.Fragment,{children:[O.jsx(jke,{variant:T?"h5":"h3",value:":",className:P.separator,ownerState:b}),O.jsx(my,{variant:T?"h5":"h3",width:T&&!a?bM:void 0,onClick:()=>l("seconds"),selected:s==="seconds",value:i?w.format(i,"seconds"):"--"})]})]}),E&&!T&&O.jsxs(R2n,{className:P.ampmSelection,ownerState:b,children:[O.jsx(my,{variant:"subtitle2",selected:S==="am",typographyClassName:P.ampmLabel,value:Fm(w,"am"),onClick:h?void 0:()=>_("am"),disabled:d}),O.jsx(my,{variant:"subtitle2",selected:S==="pm",typographyClassName:P.ampmLabel,value:Fm(w,"pm"),onClick:h?void 0:()=>_("pm"),disabled:d})]}),n&&T&&O.jsx(my,{variant:"h5",onClick:()=>l("meridiem"),selected:s==="meridiem",value:i&&S?Fm(w,S):"--",width:bM})]})]}))}function itt(e,t){const n=bi(),r=ML(),i=Rr({props:e,name:t}),o=i.ampm??n.is12HourCycleInCurrentLocale(),s=M.useMemo(()=>i.localeText?.toolbarTitle==null?i.localeText:X({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle}),[i.localeText]);return X({},i,uPn({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:s,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:nd(n,i.minDateTime??i.minDate,r.minDate),maxDate:nd(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:X({toolbar:I2n,tabs:l2n},i.slots),slotProps:X({},i.slotProps,{toolbar:X({ampm:o},i.slotProps?.toolbar)})})}const ott=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s,timezone:a})=>{const l=MS();return M.useCallback(c=>hge({adapter:l,value:c,timezone:a,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s}})!==null,[l,e,t,n,r,i,o,s,a])},D2n=(e,t,n)=>(r,i)=>{switch(i.type){case"changeMonth":return X({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const o=i.newTimezone;if(n.getTimezone(r.currentMonth)===o)return r;let s=n.setTimezone(r.currentMonth,o);return n.getMonth(s)!==n.getMonth(r.currentMonth)&&(s=n.setMonth(s,n.getMonth(r.currentMonth))),X({},r,{currentMonth:s})}case"finishMonthSwitchingAnimation":return X({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&i.focusedDay!=null&&n.isSameDay(i.focusedDay,r.focusedDay))return r;const o=i.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,i.focusedDay);return X({},r,{focusedDay:i.focusedDay,isMonthSwitchingAnimating:o&&!e&&!i.withoutMonthSwitchingAnimation,currentMonth:o?n.startOfMonth(i.focusedDay):r.currentMonth,slideDirection:i.focusedDay!=null&&n.isAfterDay(i.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},L2n=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:i,disableSwitchToMonthOnDayFocus:o=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:f}=e,d=bi(),h=M.useRef(D2n(!!c,o,d)).current,p=M.useMemo(()=>yl.getInitialReferenceValue({value:t,utils:d,timezone:f,props:e,referenceDate:n,granularity:Wd.day}),[n,f]),[g,m]=M.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:p,currentMonth:d.startOfMonth(p),slideDirection:"left"});M.useEffect(()=>{m({type:"changeMonthTimezone",newTimezone:d.getTimezone(p)})},[p,d]);const v=M.useCallback(_=>{m(X({type:"changeMonth"},_)),l&&l(_.newMonth)},[l]),y=M.useCallback(_=>{const E=_;d.isSameMonth(E,g.currentMonth)||v({newMonth:d.startOfMonth(E),direction:d.isAfterDay(E,g.currentMonth)?"left":"right"})},[g.currentMonth,v,d]),b=ott({shouldDisableDate:u,minDate:a,maxDate:s,disableFuture:r,disablePast:i,timezone:f}),w=M.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),S=ft((_,E)=>{b(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:E})});return{referenceDate:p,calendarState:g,changeMonth:y,changeFocusedDay:S,isDateDisabled:b,onMonthSwitchingAnimationEnd:w,handleChangeMonth:v}},F2n=e=>pt("MuiPickersFadeTransitionGroup",e);dt("MuiPickersFadeTransitionGroup",["root"]);const $2n=e=>{const{classes:t}=e;return Xe({root:["root"]},F2n,t)},N2n=Oe(BI,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function stt(e){const t=Rr({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,s=$2n(t),a=as();return i?n:O.jsx(N2n,{className:Re(s.root,r),children:O.jsx(Q1,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},o)})}function z2n(e){return pt("MuiPickersDay",e)}const Cx=dt("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),j2n=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],B2n=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=e,c=s&&!a;return Xe({root:["root",t&&!c&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",s&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},z2n,l)},att=({theme:e})=>X({},e.typography.caption,{width:PR,height:PR,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Vt(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Cx.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Cx.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Cx.disabled}:not(.${Cx.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Cx.disabled}&.${Cx.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${W8}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${Cx.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),ltt=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},U2n=Oe(Hf,{name:"MuiPickersDay",slot:"Root",overridesResolver:ltt})(att),V2n=Oe("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:ltt})(({theme:e})=>X({},att({theme:e}),{opacity:0,pointerEvents:"none"})),c2=()=>{},W2n=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=c2,onBlur:p=c2,onKeyDown:g=c2,onMouseDown:m=c2,onMouseEnter:v=c2,outsideCurrentMonth:y,selected:b=!1,showDaysOutsideCurrentMonth:w=!1,children:S,today:_=!1}=r,E=st(r,j2n),T=X({},r,{autoFocus:i,disabled:a,disableHighlightToday:l,disableMargin:c,selected:b,showDaysOutsideCurrentMonth:w,today:_}),k=B2n(T),P=bi(),I=M.useRef(null),R=zn(I,n);lr(()=>{i&&!a&&!u&&!y&&I.current.focus()},[i,a,u,y]);const F=L=>{m(L),y&&L.preventDefault()},A=L=>{a||d(s),y&&L.currentTarget.focus(),f&&f(L)};return y&&!w?O.jsx(V2n,{className:Re(k.root,k.hiddenDaySpacingFiller,o),ownerState:T,role:E.role}):O.jsx(U2n,X({className:Re(k.root,o),ref:R,centerRipple:!0,disabled:a,tabIndex:b?0:-1,onKeyDown:L=>g(L,s),onFocus:L=>h(L,s),onBlur:L=>p(L,s),onMouseEnter:L=>v(L,s),onClick:A,onMouseDown:F},E,{ownerState:T,children:S||P.format(s,"dayOfMonth")}))}),H2n=M.memo(W2n),G2n=e=>pt("MuiPickersSlideTransition",e),af=dt("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),q2n=["children","className","reduceAnimations","slideDirection","transKey","classes"],X2n=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Xe(r,G2n,t)},Y2n=Oe(BI,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${af["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${af["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${af.slideEnterActive}`]:t.slideEnterActive},{[`.${af.slideExit}`]:t.slideExit},{[`.${af["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${af["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${af["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${af["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${af.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${af.slideExit}`]:{transform:"translate(0%)"},[`& .${af["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${af["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function Q2n(e){const t=Rr({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,s=st(t,q2n),a=X2n(t),l=as();if(i)return O.jsx("div",{className:Re(a.root,r),children:n});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return O.jsx(Y2n,{className:Re(a.root,r),childFactory:u=>M.cloneElement(u,{classNames:c}),role:"presentation",children:O.jsx(zse,X({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},s,{children:n}),o)})}const K2n=e=>pt("MuiDayCalendar",e);dt("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const Z2n=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],J2n=["ownerState"],eMn=e=>{const{classes:t}=e;return Xe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},K2n,t)},ctt=(PR+W8*2)*6,tMn=Oe("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),nMn=Oe("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),rMn=Oe(mn,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),iMn=Oe(mn,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),oMn=Oe(mn,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>X({},e.typography.caption,{width:PR,height:PR,padding:0,margin:`0 ${W8}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),sMn=Oe("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:ctt}),aMn=Oe(Q2n,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:ctt}),lMn=Oe("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),cMn=Oe("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${W8}px 0`,display:"flex",justifyContent:"center"});function uMn(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:s,isViewFocused:a}=e,l=st(e,Z2n);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:d,slots:h,slotProps:p,timezone:g}=t,m=bi(),v=AS(g),y=r!==null&&m.isSameDay(n,r),b=i.some(R=>m.isSameDay(R,n)),w=m.isSameDay(n,v),S=h?.day??H2n,_=Xn({elementType:S,externalSlotProps:p?.day,additionalProps:X({disableHighlightToday:u,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:f,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:X({},t,{day:n,selected:b})}),E=st(_,J2n),T=M.useMemo(()=>c||o(n),[c,o,n]),k=M.useMemo(()=>m.getMonth(n)!==s,[m,n,s]),P=M.useMemo(()=>{const R=m.startOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.startOfWeek(R)):m.isSameDay(n,R)},[s,n,d,m]),I=M.useMemo(()=>{const R=m.endOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.endOfWeek(R)):m.isSameDay(n,R)},[s,n,d,m]);return O.jsx(S,X({},E,{day:n,disabled:T,autoFocus:a&&y,today:w,outsideCurrentMonth:k,isFirstVisibleCell:P,isLastVisibleCell:I,selected:b,tabIndex:y?0:-1,"aria-selected":b,"aria-current":w?"date":void 0}))}function fMn(e){const t=Rr({props:e,name:"MuiDayCalendar"}),n=bi(),{onFocusedDayChange:r,className:i,currentMonth:o,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:f,reduceAnimations:d,renderLoading:h=()=>O.jsx("span",{children:"..."}),slideDirection:p,TransitionProps:g,disablePast:m,disableFuture:v,minDate:y,maxDate:b,shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,dayOfWeekFormatter:E=pe=>n.format(pe,"weekdayShort").charAt(0).toUpperCase(),hasFocus:T,onFocusedViewChange:k,gridLabelId:P,displayWeekNumber:I,fixedWeekNumber:R,autoFocus:F,timezone:A}=t,L=AS(A),$=eMn(t),j=yi(),V=ott({shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,minDate:y,maxDate:b,disablePast:m,disableFuture:v,timezone:A}),U=qc(),[z,N]=Da({name:"DayCalendar",state:"hasFocus",controlled:T,default:F??!1}),[B,H]=M.useState(()=>a||L),Q=ft(pe=>{f||c(pe)}),Y=pe=>{V(pe)||(r(pe),H(pe),k?.(!0),N(!0))},Z=ft((pe,J)=>{switch(pe.key){case"ArrowUp":Y(n.addDays(J,-7)),pe.preventDefault();break;case"ArrowDown":Y(n.addDays(J,7)),pe.preventDefault();break;case"ArrowLeft":{const te=n.addDays(J,j?1:-1),ae=n.addMonths(J,j?1:-1),we=rA({utils:n,date:te,minDate:j?te:n.startOfMonth(ae),maxDate:j?n.endOfMonth(ae):te,isDateDisabled:V,timezone:A});Y(we||te),pe.preventDefault();break}case"ArrowRight":{const te=n.addDays(J,j?-1:1),ae=n.addMonths(J,j?-1:1),we=rA({utils:n,date:te,minDate:j?n.startOfMonth(ae):te,maxDate:j?te:n.endOfMonth(ae),isDateDisabled:V,timezone:A});Y(we||te),pe.preventDefault();break}case"Home":Y(n.startOfWeek(J)),pe.preventDefault();break;case"End":Y(n.endOfWeek(J)),pe.preventDefault();break;case"PageUp":Y(n.addMonths(J,1)),pe.preventDefault();break;case"PageDown":Y(n.addMonths(J,-1)),pe.preventDefault();break}}),ge=ft((pe,J)=>Y(J)),ne=ft((pe,J)=>{z&&n.isSameDay(B,J)&&k?.(!1)}),ie=n.getMonth(o),fe=n.getYear(o),ve=M.useMemo(()=>s.filter(pe=>!!pe).map(pe=>n.startOfDay(pe)),[n,s]),se=`${fe}-${ie}`,ue=M.useMemo(()=>M.createRef(),[se]),G=M.useMemo(()=>{const pe=n.startOfMonth(o),J=n.endOfMonth(o);return V(B)||n.isAfterDay(B,J)||n.isBeforeDay(B,pe)?rA({utils:n,date:B,minDate:pe,maxDate:J,disablePast:m,disableFuture:v,isDateDisabled:V,timezone:A}):B},[o,v,m,B,V,n,A]),ce=M.useMemo(()=>{const pe=n.getWeekArray(o);let J=n.addMonths(o,1);for(;R&&pe.length{pe.lengthO.jsx(rMn,{variant:"caption",role:"columnheader","aria-label":n.format(pe,"weekday"),className:$.weekDayLabel,children:E(pe)},J.toString()))]}),l?O.jsx(sMn,{className:$.loadingContainer,children:h()}):O.jsx(aMn,X({transKey:se,onExited:u,reduceAnimations:d,slideDirection:p,className:Re(i,$.slideTransition)},g,{nodeRef:ue,children:O.jsx(lMn,{ref:ue,role:"rowgroup",className:$.monthContainer,children:ce.map((pe,J)=>O.jsxs(cMn,{role:"row",className:$.weekContainer,"aria-rowindex":J+1,children:[I&&O.jsx(oMn,{className:$.weekNumber,role:"rowheader","aria-label":U.calendarWeekNumberAriaLabelText(n.getWeekNumber(pe[0])),children:U.calendarWeekNumberText(n.getWeekNumber(pe[0]))}),pe.map((te,ae)=>O.jsx(uMn,{parentProps:t,day:te,selectedDays:ve,focusableDay:G,onKeyDown:Z,onFocus:ge,onBlur:ne,onDaySelect:Q,isDateDisabled:V,currentMonthNumber:ie,isViewFocused:z,"aria-colindex":ae+1},te.toString()))]},`week-${pe[0]}`))})}))]})}function dMn(e){return pt("MuiPickersMonth",e)}const IN=dt("MuiPickersMonth",["root","monthButton","disabled","selected"]),hMn=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],pMn=e=>{const{disabled:t,selected:n,classes:r}=e;return Xe({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},dMn,r)},gMn=Oe("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),mMn=Oe("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${IN.disabled}`]:t.disabled},{[`&.${IN.selected}`]:t.selected}]})(({theme:e})=>X({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${IN.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${IN.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),vMn=M.memo(function(t){const n=Rr({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,"aria-label":g,slots:m,slotProps:v}=n,y=st(n,hMn),b=M.useRef(null),w=pMn(n);lr(()=>{r&&b.current?.focus()},[r]);const S=m?.monthButton??mMn,_=Xn({elementType:S,externalSlotProps:v?.monthButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:b,type:"button",role:"radio","aria-current":p,"aria-checked":a,"aria-label":g,onClick:E=>u(E,l),onKeyDown:E=>f(E,l),onFocus:E=>d(E,l),onBlur:E=>h(E,l)},ownerState:n,className:w.monthButton});return O.jsx(gMn,X({className:Re(w.root,i),ownerState:n},y,{children:O.jsx(S,X({},_))}))});function yMn(e){return pt("MuiMonthCalendar",e)}dt("MuiMonthCalendar",["root"]);const bMn=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],xMn=e=>{const{classes:t}=e;return Xe({root:["root"]},yMn,t)};function wMn(e,t){const n=bi(),r=ML(),i=Rr({props:e,name:t});return X({disableFuture:!1,disablePast:!1},i,{minDate:nd(n,i.minDate,r.minDate),maxDate:nd(n,i.maxDate,r.maxDate)})}const SMn=Oe("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:H8,boxSizing:"border-box"}),_Mn=M.forwardRef(function(t,n){const r=wMn(t,"MuiMonthCalendar"),{className:i,value:o,defaultValue:s,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:g,autoFocus:m=!1,onMonthFocus:v,hasFocus:y,onFocusedViewChange:b,monthsPerRow:w=3,timezone:S,gridLabelId:_,slots:E,slotProps:T}=r,k=st(r,bMn),{value:P,handleValueChange:I,timezone:R}=pP({name:"MonthCalendar",timezone:S,value:o,defaultValue:s,referenceDate:a,onChange:h,valueManager:yl}),F=AS(R),A=yi(),L=bi(),$=M.useMemo(()=>yl.getInitialReferenceValue({value:P,utils:L,props:r,timezone:R,referenceDate:a,granularity:Wd.month}),[]),j=r,V=xMn(j),U=M.useMemo(()=>L.getMonth(F),[L,F]),z=M.useMemo(()=>P!=null?L.getMonth(P):null,[P,L]),[N,B]=M.useState(()=>z||L.getMonth($)),[H,Q]=Da({name:"MonthCalendar",state:"hasFocus",controlled:y,default:m??!1}),Y=ft(se=>{Q(se),b&&b(se)}),Z=M.useCallback(se=>{const ue=L.startOfMonth(u&&L.isAfter(F,d)?F:d),G=L.startOfMonth(c&&L.isBefore(F,f)?F:f),ce=L.startOfMonth(se);return L.isBefore(ce,ue)||L.isAfter(ce,G)?!0:p?p(ce):!1},[c,u,f,d,F,p,L]),ge=ft((se,ue)=>{if(g)return;const G=L.setMonth(P??$,ue);I(G)}),ne=ft(se=>{Z(L.setMonth(P??$,se))||(B(se),Y(!0),v&&v(se))});M.useEffect(()=>{B(se=>z!==null&&se!==z?z:se)},[z]);const ie=ft((se,ue)=>{switch(se.key){case"ArrowUp":ne((12+ue-3)%12),se.preventDefault();break;case"ArrowDown":ne((12+ue+3)%12),se.preventDefault();break;case"ArrowLeft":ne((12+ue+(A?1:-1))%12),se.preventDefault();break;case"ArrowRight":ne((12+ue+(A?-1:1))%12),se.preventDefault();break}}),fe=ft((se,ue)=>{ne(ue)}),ve=ft((se,ue)=>{N===ue&&Y(!1)});return O.jsx(SMn,X({ref:n,className:Re(V.root,i),ownerState:j,role:"radiogroup","aria-labelledby":_},k,{children:cge(L,P??$).map(se=>{const ue=L.getMonth(se),G=L.format(se,"monthShort"),ce=L.format(se,"month"),pe=ue===z,J=l||Z(se);return O.jsx(vMn,{selected:pe,value:ue,onClick:ge,onKeyDown:ie,autoFocus:H&&ue===N,disabled:J,tabIndex:ue===N&&!J?0:-1,onFocus:fe,onBlur:ve,"aria-current":U===ue?"date":void 0,"aria-label":ce,monthsPerRow:w,slots:E,slotProps:T,children:G},G)})}))});function CMn(e){return pt("MuiPickersYear",e)}const DN=dt("MuiPickersYear",["root","yearButton","selected","disabled"]),OMn=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],EMn=e=>{const{disabled:t,selected:n,classes:r}=e;return Xe({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},CMn,r)},TMn=Oe("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),PMn=Oe("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${DN.disabled}`]:t.disabled},{[`&.${DN.selected}`]:t.selected}]})(({theme:e})=>X({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Vt(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${DN.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${DN.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),kMn=M.memo(function(t){const n=Rr({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,slots:g,slotProps:m}=n,v=st(n,OMn),y=M.useRef(null),b=EMn(n);lr(()=>{r&&y.current?.focus()},[r]);const w=g?.yearButton??PMn,S=Xn({elementType:w,externalSlotProps:m?.yearButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:y,type:"button",role:"radio","aria-current":p,"aria-checked":a,onClick:_=>u(_,l),onKeyDown:_=>f(_,l),onFocus:_=>d(_,l),onBlur:_=>h(_,l)},ownerState:n,className:b.yearButton});return O.jsx(TMn,X({className:Re(b.root,i),ownerState:n},v,{children:O.jsx(w,X({},S))}))});function MMn(e){return pt("MuiYearCalendar",e)}dt("MuiYearCalendar",["root"]);const AMn=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],RMn=e=>{const{classes:t}=e;return Xe({root:["root"]},MMn,t)};function IMn(e,t){const n=bi(),r=ML(),i=Rr({props:e,name:t});return X({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:nd(n,i.minDate,r.minDate),maxDate:nd(n,i.maxDate,r.maxDate)})}const DMn=Oe("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:H8,maxHeight:O2n,boxSizing:"border-box",position:"relative"}),LMn=M.forwardRef(function(t,n){const r=IMn(t,"MuiYearCalendar"),{autoFocus:i,className:o,value:s,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onChange:p,readOnly:g,shouldDisableYear:m,onYearFocus:v,hasFocus:y,onFocusedViewChange:b,yearsOrder:w="asc",yearsPerRow:S,timezone:_,gridLabelId:E,slots:T,slotProps:k}=r,P=st(r,AMn),{value:I,handleValueChange:R,timezone:F}=pP({name:"YearCalendar",timezone:_,value:s,defaultValue:a,referenceDate:l,onChange:p,valueManager:yl}),A=AS(F),L=yi(),$=bi(),j=M.useMemo(()=>yl.getInitialReferenceValue({value:I,utils:$,props:r,timezone:F,referenceDate:l,granularity:Wd.year}),[]),V=r,U=RMn(V),z=M.useMemo(()=>$.getYear(A),[$,A]),N=M.useMemo(()=>I!=null?$.getYear(I):null,[I,$]),[B,H]=M.useState(()=>N||$.getYear(j)),[Q,Y]=Da({name:"YearCalendar",state:"hasFocus",controlled:y,default:i??!1}),Z=ft(te=>{Y(te),b&&b(te)}),ge=M.useCallback(te=>{if(f&&$.isBeforeYear(te,A)||u&&$.isAfterYear(te,A)||h&&$.isBeforeYear(te,h)||d&&$.isAfterYear(te,d))return!0;if(!m)return!1;const ae=$.startOfYear(te);return m(ae)},[u,f,d,h,A,m,$]),ne=ft((te,ae)=>{if(g)return;const we=$.setYear(I??j,ae);R(we)}),ie=ft(te=>{ge($.setYear(I??j,te))||(H(te),Z(!0),v?.(te))});M.useEffect(()=>{H(te=>N!==null&&te!==N?N:te)},[N]);const fe=w!=="desc"?S*1:S*-1,ve=L&&w==="asc"||!L&&w==="desc"?-1:1,se=ft((te,ae)=>{switch(te.key){case"ArrowUp":ie(ae-fe),te.preventDefault();break;case"ArrowDown":ie(ae+fe),te.preventDefault();break;case"ArrowLeft":ie(ae-ve),te.preventDefault();break;case"ArrowRight":ie(ae+ve),te.preventDefault();break}}),ue=ft((te,ae)=>{ie(ae)}),G=ft((te,ae)=>{B===ae&&Z(!1)}),ce=M.useRef(null),pe=zn(n,ce);M.useEffect(()=>{if(i||ce.current===null)return;const te=ce.current.querySelector('[tabindex="0"]');if(!te)return;const ae=te.offsetHeight,we=te.offsetTop,Pe=ce.current.clientHeight,ee=ce.current.scrollTop,re=we+ae;ae>Pe||we{const ae=$.getYear(te),we=ae===N,Pe=c||ge(te);return O.jsx(kMn,{selected:we,value:ae,onClick:ne,onKeyDown:se,autoFocus:Q&&ae===B,disabled:Pe,tabIndex:ae===B&&!Pe?0:-1,onFocus:ue,onBlur:G,"aria-current":z===ae?"date":void 0,yearsPerRow:S,slots:T,slotProps:k,children:$.format(te,"year")},$.format(te,"year"))})}))});function AL({onChange:e,onViewChange:t,openTo:n,view:r,views:i,autoFocus:o,focusedView:s,onFocusedViewChange:a}){const l=M.useRef(n),c=M.useRef(i),u=M.useRef(i.includes(n)?n:i[0]),[f,d]=Da({name:"useViews",state:"view",controlled:r,default:u.current}),h=M.useRef(o?f:null),[p,g]=Da({name:"useViews",state:"focusedView",controlled:s,default:h.current});M.useEffect(()=>{(l.current&&l.current!==n||c.current&&c.current.some(E=>!i.includes(E)))&&(d(i.includes(n)?n:i[0]),c.current=i,l.current=n)},[n,d,f,i]);const m=i.indexOf(f),v=i[m-1]??null,y=i[m+1]??null,b=ft((E,T)=>{g(T?E:k=>E===k?null:k),a?.(E,T)}),w=ft(E=>{b(E,!0),E!==f&&(d(E),t&&t(E))}),S=ft(()=>{y&&w(y)}),_=ft((E,T,k)=>{const P=T==="finish",I=k?i.indexOf(k)pt("MuiPickersCalendarHeader",e),$Mn=dt("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function NMn(e){return pt("MuiPickersArrowSwitcher",e)}dt("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const zMn=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],jMn=["ownerState"],BMn=["ownerState"],UMn=Oe("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),VMn=Oe("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),Bke=Oe(Mn,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),WMn=e=>{const{classes:t}=e;return Xe({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},NMn,t)},utt=M.forwardRef(function(t,n){const r=yi(),i=Rr({props:t,name:"MuiPickersArrowSwitcher"}),{children:o,className:s,slots:a,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:f,nextLabel:d,isPreviousDisabled:h,isPreviousHidden:p,onGoToPrevious:g,previousLabel:m,labelId:v}=i,y=st(i,zMn),b=i,w=WMn(b),S={isDisabled:c,isHidden:u,goTo:f,label:d},_={isDisabled:h,isHidden:p,goTo:g,label:m},E=a?.previousIconButton??Bke,T=Xn({elementType:E,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:_.label,"aria-label":_.label,disabled:_.isDisabled,edge:"end",onClick:_.goTo},ownerState:X({},b,{hidden:_.isHidden}),className:Re(w.button,w.previousIconButton)}),k=a?.nextIconButton??Bke,P=Xn({elementType:k,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:S.label,"aria-label":S.label,disabled:S.isDisabled,edge:"start",onClick:S.goTo},ownerState:X({},b,{hidden:S.isHidden}),className:Re(w.button,w.nextIconButton)}),I=a?.leftArrowIcon??tkn,R=Xn({elementType:I,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:b,className:w.leftArrowIcon}),F=st(R,jMn),A=a?.rightArrowIcon??nkn,L=Xn({elementType:A,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:b,className:w.rightArrowIcon}),$=st(L,BMn);return O.jsxs(UMn,X({ref:n,className:Re(w.root,s),ownerState:b},y,{children:[O.jsx(E,X({},T,{children:r?O.jsx(A,X({},$)):O.jsx(I,X({},F))})),o?O.jsx(mn,{variant:"subtitle1",component:"span",id:v,children:o}):O.jsx(VMn,{className:w.spacer,ownerState:b}),O.jsx(k,X({},P,{children:r?O.jsx(I,X({},F)):O.jsx(A,X({},$))}))]}))}),HMn=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],GMn=["ownerState"],qMn=e=>{const{classes:t}=e;return Xe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},FMn,t)},XMn=Oe("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),YMn=Oe("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>X({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),QMn=Oe("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),KMn=Oe(Mn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${$Mn.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),ZMn=Oe(ekn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),JMn=M.forwardRef(function(t,n){const r=qc(),i=bi(),o=Rr({props:t,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onMonthChange:p,onViewChange:g,view:m,reduceAnimations:v,views:y,labelId:b,className:w,timezone:S,format:_=`${i.formats.month} ${i.formats.year}`}=o,E=st(o,HMn),T=o,k=qMn(o),P=s?.switchViewButton??KMn,I=Xn({elementType:P,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(m)},ownerState:T,className:k.switchViewButton}),R=s?.switchViewIcon??ZMn,F=Xn({elementType:R,externalSlotProps:a?.switchViewIcon,ownerState:T,className:k.switchViewIcon}),A=st(F,GMn),L=()=>p(i.addMonths(l,1),"left"),$=()=>p(i.addMonths(l,-1),"right"),j=_2n(l,{disableFuture:u,maxDate:d,timezone:S}),V=C2n(l,{disablePast:f,minDate:h,timezone:S}),U=()=>{if(!(y.length===1||!g||c))if(y.length===2)g(y.find(N=>N!==m)||y[0]);else{const N=y.indexOf(m)!==0?0:1;g(y[N])}};if(y.length===1&&y[0]==="year")return null;const z=i.formatByString(l,_);return O.jsxs(XMn,X({},E,{ownerState:T,className:Re(k.root,w),ref:n,children:[O.jsxs(YMn,{role:"presentation",onClick:U,ownerState:T,"aria-live":"polite",className:k.labelContainer,children:[O.jsx(stt,{reduceAnimations:v,transKey:z,children:O.jsx(QMn,{id:b,ownerState:T,className:k.label,children:z})}),y.length>1&&!c&&O.jsx(P,X({},I,{children:O.jsx(R,X({},A))}))]}),O.jsx(Q1,{in:m==="day",appear:!v,enter:!v,children:O.jsx(utt,{slots:s,slotProps:a,onGoToPrevious:$,isPreviousDisabled:V,previousLabel:r.previousMonth,onGoToNext:L,isNextDisabled:j,nextLabel:r.nextMonth})})]}))}),q8=Oe("div")({overflow:"hidden",width:H8,maxHeight:G8,display:"flex",flexDirection:"column",margin:"0 auto"}),eAn="@media (prefers-reduced-motion: reduce)",vO=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),Uke=vO&&vO[1]?parseInt(vO[1],10):null,Vke=vO&&vO[2]?parseInt(vO[2],10):null,tAn=Uke&&Uke<10||Vke&&Vke<13||!1,ftt=()=>rae(eAn,{defaultMatches:!1})||tAn,nAn=e=>pt("MuiDateCalendar",e);dt("MuiDateCalendar",["root","viewTransitionContainer"]);const rAn=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],iAn=e=>{const{classes:t}=e;return Xe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},nAn,t)};function oAn(e,t){const n=bi(),r=ML(),i=ftt(),o=Rr({props:e,name:t});return X({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>O.jsx("span",{children:"..."})),minDate:nd(n,o.minDate,r.minDate),maxDate:nd(n,o.maxDate,r.maxDate)})}const sAn=Oe(q8,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:G8}),aAn=Oe(stt,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),lAn=M.forwardRef(function(t,n){const r=bi(),i=fr(),o=oAn(t,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:c,referenceDate:u,disableFuture:f,disablePast:d,onChange:h,onYearChange:p,onMonthChange:g,reduceAnimations:m,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:b,view:w,views:S,openTo:_,className:E,disabled:T,readOnly:k,minDate:P,maxDate:I,disableHighlightToday:R,focusedView:F,onFocusedViewChange:A,showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:j,slots:V,slotProps:U,loading:z,renderLoading:N,displayWeekNumber:B,yearsOrder:H,yearsPerRow:Q,monthsPerRow:Y,timezone:Z}=o,ge=st(o,rAn),{value:ne,handleValueChange:ie,timezone:fe}=pP({name:"DateCalendar",timezone:Z,value:l,defaultValue:c,referenceDate:u,onChange:h,valueManager:yl}),{view:ve,setView:se,focusedView:ue,setFocusedView:G,goToNextView:ce,setValueAndGoToNextView:pe}=AL({view:w,views:S,openTo:_,onChange:ie,onViewChange:a,autoFocus:s,focusedView:F,onFocusedViewChange:A}),{referenceDate:J,calendarState:te,changeFocusedDay:ae,changeMonth:we,handleChangeMonth:Pe,isDateDisabled:ee,onMonthSwitchingAnimationEnd:re}=L2n({value:ne,referenceDate:u,reduceAnimations:m,onMonthChange:g,minDate:P,maxDate:I,shouldDisableDate:v,disablePast:d,disableFuture:f,timezone:fe}),Se=T&&ne||P,he=T&&ne||I,xe=`${i}-grid-label`,me=ue!==null,be=V?.calendarHeader??JMn,oe=Xn({elementType:be,externalSlotProps:U?.calendarHeader,additionalProps:{views:S,view:ve,currentMonth:te.currentMonth,onViewChange:se,onMonthChange:(Fe,ht)=>Pe({newMonth:Fe,direction:ht}),minDate:Se,maxDate:he,disabled:T,disablePast:d,disableFuture:f,reduceAnimations:m,timezone:fe,labelId:xe},ownerState:o}),Ee=ft(Fe=>{const ht=r.startOfMonth(Fe),gt=r.endOfMonth(Fe),St=ee(Fe)?rA({utils:r,date:Fe,minDate:r.isBefore(P,ht)?ht:P,maxDate:r.isAfter(I,gt)?gt:I,disablePast:d,disableFuture:f,isDateDisabled:ee,timezone:fe}):Fe;St?(pe(St,"finish"),g?.(ht)):(ce(),we(ht)),ae(St,!0)}),ke=ft(Fe=>{const ht=r.startOfYear(Fe),gt=r.endOfYear(Fe),St=ee(Fe)?rA({utils:r,date:Fe,minDate:r.isBefore(P,ht)?ht:P,maxDate:r.isAfter(I,gt)?gt:I,disablePast:d,disableFuture:f,isDateDisabled:ee,timezone:fe}):Fe;St?(pe(St,"finish"),p?.(St)):(ce(),we(ht)),ae(St,!0)}),ze=ft(Fe=>ie(Fe&&YB(r,Fe,ne??J),"finish",ve));M.useEffect(()=>{ne!=null&&r.isValid(ne)&&we(ne)},[ne]);const De=o,Ve=iAn(De),Ze={disablePast:d,disableFuture:f,maxDate:I,minDate:P},mt={disableHighlightToday:R,readOnly:k,disabled:T,timezone:fe,gridLabelId:xe,slots:V,slotProps:U},Me=M.useRef(ve);M.useEffect(()=>{Me.current!==ve&&(ue===Me.current&&G(ve,!0),Me.current=ve)},[ue,G,ve]);const ct=M.useMemo(()=>[ne],[ne]);return O.jsxs(sAn,X({ref:n,className:Re(Ve.root,E),ownerState:De},ge,{children:[O.jsx(be,X({},oe,{slots:V,slotProps:U})),O.jsx(aAn,{reduceAnimations:m,className:Ve.viewTransitionContainer,transKey:ve,ownerState:De,children:O.jsxs("div",{children:[ve==="year"&&O.jsx(LMn,X({},Ze,mt,{value:ne,onChange:ke,shouldDisableYear:b,hasFocus:me,onFocusedViewChange:Fe=>G("year",Fe),yearsOrder:H,yearsPerRow:Q,referenceDate:J})),ve==="month"&&O.jsx(_Mn,X({},Ze,mt,{hasFocus:me,className:E,value:ne,onChange:Ee,shouldDisableMonth:y,onFocusedViewChange:Fe=>G("month",Fe),monthsPerRow:Y,referenceDate:J})),ve==="day"&&O.jsx(fMn,X({},te,Ze,mt,{onMonthSwitchingAnimationEnd:re,onFocusedDayChange:ae,reduceAnimations:m,selectedDays:ct,onSelectedDaysChange:ze,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:b,hasFocus:me,onFocusedViewChange:Fe=>G("day",Fe),showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:j,displayWeekNumber:B,loading:z,renderLoading:N}))]})})]}))}),yO=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:b,monthsPerRow:w,onYearChange:S,yearsOrder:_,yearsPerRow:E,slots:T,slotProps:k,loading:P,renderLoading:I,disableHighlightToday:R,readOnly:F,disabled:A,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:j,autoFocus:V,fixedWeekNumber:U,displayWeekNumber:z,timezone:N})=>O.jsx(lAn,{view:e,onViewChange:t,views:n.filter(AE),focusedView:r&&AE(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:b,monthsPerRow:w,onYearChange:S,yearsOrder:_,yearsPerRow:E,slots:T,slotProps:k,loading:P,renderLoading:I,disableHighlightToday:R,readOnly:F,disabled:A,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:j,autoFocus:V,fixedWeekNumber:U,displayWeekNumber:z,timezone:N});function cAn(e){return pt("MuiPickersPopper",e)}dt("MuiPickersPopper",["root","paper"]);const uAn=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],fAn=e=>{const{classes:t}=e;return Xe({root:["root"],paper:["paper"]},cAn,t)},dAn=Oe(yb,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),hAn=Oe(fa,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function pAn(e,t){return t.documentElement.clientWidth{if(!e)return;function l(){o.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),o.current=!1}},[e]);const s=ft(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=ci(i.current);if(!i.current||"clientX"in l&&pAn(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(i.current)>-1:f=!u.documentElement.contains(l.target)||i.current.contains(l.target),!f&&!c&&t(l)}),a=()=>{r.current=!0};return M.useEffect(()=>{if(e){const l=ci(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[e,s]),M.useEffect(()=>{if(e){const l=ci(i.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[e,s]),[i,a,a]}const mAn=M.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:i,children:o,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:c}=e,u=st(e,uAn),f=X({},i,{placement:r}),d=Xn({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:f});return O.jsx(n,X({},u,d,{onClick:h=>{l(h),d.onClick?.(h)},onTouchStart:h=>{c(h),d.onTouchStart?.(h)},ownerState:f,children:o}))});function vAn(e){const t=Rr({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:i=null,shouldRestoreFocus:o,onBlur:s,onDismiss:a,open:l,role:c,placement:u,slots:f,slotProps:d,reduceAnimations:h}=t;M.useEffect(()=>{function L($){l&&$.key==="Escape"&&a()}return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L)}},[a,l]);const p=M.useRef(null);M.useEffect(()=>{c==="tooltip"||o&&!o()||(l?p.current=Ml(document):p.current&&p.current instanceof HTMLElement&&setTimeout(()=>{p.current instanceof HTMLElement&&p.current.focus()}))},[l,c,o]);const[g,m,v]=gAn(l,s??a),y=M.useRef(null),b=zn(y,i),w=zn(b,g),S=t,_=fAn(S),E=ftt(),T=h??E,k=L=>{L.key==="Escape"&&(L.stopPropagation(),a())},P=f?.desktopTransition??T?Q1:K1,I=f?.desktopTrapFocus??eae,R=f?.desktopPaper??hAn,F=f?.popper??dAn,A=Xn({elementType:F,externalSlotProps:d?.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:n,placement:u,onKeyDown:k},className:_.root,ownerState:t});return O.jsx(F,X({},A,{children:({TransitionProps:L,placement:$})=>O.jsx(I,X({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},d?.desktopTrapFocus,{children:O.jsx(P,X({},L,d?.desktopTransition,{children:O.jsx(mAn,{PaperComponent:R,ownerState:S,popperPlacement:$,ref:w,onPaperClick:m,onPaperTouchStart:v,paperClasses:_.paper,paperSlotProps:d?.desktopPaper,children:r})}))}))}))}const yAn=({open:e,onOpen:t,onClose:n})=>{const r=M.useRef(typeof e=="boolean").current,[i,o]=M.useState(!1);M.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");o(e)}},[r,e]);const s=M.useCallback(a=>{r||o(a),a&&t&&t(),!a&&n&&n()},[r,t,n]);return{isOpen:i,setIsOpen:s}},bAn=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:i}=e,o=!i&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?o&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?o?!0:n(r.lastPublishedValue):!1},xAn=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=e,s=!i&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?s&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&o?s?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},wAn=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},SAn=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i})=>{const{onAccept:o,onChange:s,value:a,defaultValue:l,closeOnSelect:c=r==="desktop",timezone:u,referenceDate:f}=e,{current:d}=M.useRef(l),{current:h}=M.useRef(a!==void 0),[p,g]=M.useState(u),m=bi(),v=MS(),{isOpen:y,setIsOpen:b}=yAn(e),{timezone:w,value:S,handleValueChange:_}=pge({timezone:u,value:a,defaultValue:d,referenceDate:f,onChange:s,valueManager:t}),[E,T]=M.useState(()=>{let ie;return S!==void 0?ie=S:d!==void 0?ie=d:ie=t.emptyValue,{draft:ie,lastPublishedValue:ie,lastCommittedValue:ie,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),k=t.getTimezone(m,E.draft);p!==u&&(g(u),u&&k&&u!==k&&T(ie=>X({},ie,{draft:t.setTimezone(m,u,ie.draft)})));const{getValidationErrorForNewValue:P}=Het({props:e,validator:i,timezone:w,value:E.draft,onError:e.onError}),I=ft(ie=>{const fe={action:ie,dateState:E,hasChanged:pe=>!t.areValuesEqual(m,ie.value,pe),isControlled:h,closeOnSelect:c},ve=bAn(fe),se=xAn(fe),ue=wAn(fe);T(pe=>X({},pe,{draft:ie.value,lastPublishedValue:ve?ie.value:pe.lastPublishedValue,lastCommittedValue:se?ie.value:pe.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let G=null;const ce=()=>(G||(G={validationError:ie.name==="setValueFromField"?ie.context.validationError:P(ie.value)},ie.name==="setValueFromShortcut"&&(G.shortcut=ie.shortcut)),G);ve&&_(ie.value,ce()),se&&o&&o(ie.value,ce()),ue&&b(!1)});if(E.lastControlledValue!==a){const ie=t.areValuesEqual(m,E.draft,S);T(fe=>X({},fe,{lastControlledValue:a},ie?{}:{lastCommittedValue:S,lastPublishedValue:S,draft:S,hasBeenModifiedSinceMount:!0}))}const R=ft(()=>{I({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),F=ft(()=>{I({value:E.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),A=ft(()=>{I({value:E.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),L=ft(()=>{I({value:E.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),$=ft(()=>{I({value:t.getTodayValue(m,w,n),name:"setValueFromAction",pickerAction:"today"})}),j=ft(ie=>{ie.preventDefault(),b(!0)}),V=ft(ie=>{ie?.preventDefault(),b(!1)}),U=ft((ie,fe="partial")=>I({name:"setValueFromView",value:ie,selectionState:fe})),z=ft((ie,fe,ve)=>I({name:"setValueFromShortcut",value:ie,changeImportance:fe,shortcut:ve})),N=ft((ie,fe)=>I({name:"setValueFromField",value:ie,context:fe})),B={onClear:R,onAccept:F,onDismiss:A,onCancel:L,onSetToday:$,onOpen:j,onClose:V},H={value:E.draft,onChange:N},Q=M.useMemo(()=>t.cleanValue(m,E.draft),[m,t,E.draft]),Y={value:Q,onChange:U,onClose:V,open:y},ge=X({},B,{value:Q,onChange:U,onSelectShortcut:z,isValid:ie=>{const fe=i({adapter:v,value:ie,timezone:w,props:e});return!t.hasError(fe)}}),ne=M.useMemo(()=>({onOpen:j,onClose:V,open:y}),[y,V,j]);return{open:y,fieldProps:H,viewProps:Y,layoutProps:ge,actions:B,contextValue:ne}},_An=["className","sx"],CAn=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{const{onChange:s,open:a,onClose:l}=t,{view:c,views:u,openTo:f,onViewChange:d,viewRenderers:h,timezone:p}=e,g=st(e,_An),{view:m,setView:v,defaultView:y,focusedView:b,setFocusedView:w,setValueAndGoToNextView:S}=AL({view:c,views:u,openTo:f,onChange:s,onViewChange:d,autoFocus:r}),{hasUIView:_,viewModeLookup:E}=M.useMemo(()=>u.reduce((A,L)=>{let $;return h[L]!=null?$="UI":$="field",A.viewModeLookup[L]=$,$==="UI"&&(A.hasUIView=!0),A},{hasUIView:!1,viewModeLookup:{}}),[h,u]),T=M.useMemo(()=>u.reduce((A,L)=>h[L]!=null&&RE(L)?A+1:A,0),[h,u]),k=E[m],P=ft(()=>k==="UI"),[I,R]=M.useState(k==="UI"?m:null);return I!==m&&E[m]==="UI"&&R(m),lr(()=>{k==="field"&&a&&(l(),setTimeout(()=>{o?.current?.setSelectedSections(m),o?.current?.focusField(m)}))},[m]),lr(()=>{if(!a)return;let A=m;k==="field"&&I!=null&&(A=I),A!==y&&E[A]==="UI"&&E[y]==="UI"&&(A=y),A!==m&&v(A),w(A,!0)},[a]),{hasUIView:_,shouldRestoreFocus:P,layoutProps:{views:u,view:I,onViewChange:v},renderCurrentView:()=>{if(I==null)return null;const A=h[I];if(A==null)return null;const L=X({},g,n,t,{views:u,timezone:p,onChange:S,view:I,onViewChange:v,focusedView:b,onFocusedViewChange:w,showViewSwitcher:T>1,timeViewsCount:T});return i?i(h,I,L):A(L)}}};function Wke(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const OAn=(e,t)=>{const[n,r]=M.useState(Wke);return lr(()=>{const o=()=>{r(Wke())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),qPn(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},EAn=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:i}=e,o=OAn(n.views,i),s=yi();return{layoutProps:X({},n,t,{isLandscape:o,isRtl:s,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function TAn(e){const{props:t,pickerValueResponse:n}=e;return M.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const dtt=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const c=SAn({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o}),u=CAn({props:e,additionalViewProps:i,autoFocusView:s,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:a}),f=EAn({props:e,wrapperVariant:r,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),d=TAn({props:e,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:c.contextValue,ownerState:d}};function htt(e){return pt("MuiPickersLayout",e)}const zd=dt("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),PAn=["onAccept","onClear","onCancel","onSetToday","actions"];function kAn(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:i,actions:o}=e,s=st(e,PAn),a=qc();if(o==null||o.length===0)return null;const l=o?.map(c=>{switch(c){case"clear":return O.jsx(zi,{onClick:n,children:a.clearButtonLabel},c);case"cancel":return O.jsx(zi,{onClick:r,children:a.cancelButtonLabel},c);case"accept":return O.jsx(zi,{onClick:t,children:a.okButtonLabel},c);case"today":return O.jsx(zi,{onClick:i,children:a.todayButtonLabel},c);default:return null}});return O.jsx(xb,X({},s,{children:l}))}const MAn=["items","changeImportance","isLandscape","onChange","isValid"],AAn=["getValue"];function RAn(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:i}=e,o=st(e,MAn);if(t==null||t.length===0)return null;const s=t.map(a=>{let{getValue:l}=a,c=st(a,AAn);const u=l({isValid:i});return X({},c,{label:c.label,onClick:()=>{r(u,n,c)},disabled:!i(u)})});return O.jsx(WI,X({dense:!0,sx:[{maxHeight:G8,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:s.map(a=>O.jsx(eO,{children:O.jsx(A6,X({},a))},a.id??a.label))}))}function IAn(e){return e.view!==null}const DAn=e=>{const{classes:t,isLandscape:n}=e;return Xe({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},htt,t)},ptt=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:s,views:a,onViewChange:l,value:c,onChange:u,onSelectShortcut:f,isValid:d,isLandscape:h,disabled:p,readOnly:g,children:m,slots:v,slotProps:y}=e,b=DAn(e),w=v?.actionBar??kAn,S=Xn({elementType:w,externalSlotProps:y?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:t==="desktop"?[]:["cancel","accept"]},className:b.actionBar,ownerState:X({},e,{wrapperVariant:t})}),_=O.jsx(w,X({},S)),E=v?.toolbar,T=Xn({elementType:E,externalSlotProps:y?.toolbar,additionalProps:{isLandscape:h,onChange:u,value:c,view:s,onViewChange:l,views:a,disabled:p,readOnly:g},className:b.toolbar,ownerState:X({},e,{wrapperVariant:t})}),k=IAn(T)&&E?O.jsx(E,X({},T)):null,P=m,I=v?.tabs,R=s&&I?O.jsx(I,X({view:s,onViewChange:l,className:b.tabs},y?.tabs)):null,F=v?.shortcuts??RAn,A=Xn({elementType:F,externalSlotProps:y?.shortcuts,additionalProps:{isValid:d,isLandscape:h,onChange:f},className:b.shortcuts,ownerState:{isValid:d,isLandscape:h,onChange:f,wrapperVariant:t}}),L=s&&F?O.jsx(F,X({},A)):null;return{toolbar:k,content:P,tabs:R,actionBar:_,shortcuts:L}},LAn=e=>{const{isLandscape:t,classes:n}=e;return Xe({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},htt,n)},gtt=Oe("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${zd.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${zd.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${zd.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${zd.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${zd.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${zd.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${zd.shortcuts}`]:{gridColumn:3}}}]}),mtt=Oe("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),vtt=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPickersLayout"}),{toolbar:i,content:o,tabs:s,actionBar:a,shortcuts:l}=ptt(r),{sx:c,className:u,isLandscape:f,wrapperVariant:d}=r,h=LAn(r);return O.jsxs(gtt,{ref:n,sx:c,className:Re(h.root,u),ownerState:r,children:[f?l:i,f?i:l,O.jsx(mtt,{className:h.contentWrapper,children:d==="desktop"?O.jsxs(M.Fragment,{children:[o,s]}):O.jsxs(M.Fragment,{children:[s,o]})}),a]})}),FAn=["props","getOpenDialogAriaText"],$An=["ownerState"],NAn=["ownerState"],zAn=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=st(e,FAn);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,autoFocus:b,localeText:w,reduceAnimations:S}=t,_=M.useRef(null),E=M.useRef(null),T=fr(),k=o?.toolbar?.hidden??!1,{open:P,actions:I,hasUIView:R,layoutProps:F,renderCurrentView:A,shouldRestoreFocus:L,fieldProps:$,contextValue:j,ownerState:V}=dtt(X({},r,{props:t,fieldRef:E,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),U=i.inputAdornment??oae,z=Xn({elementType:U,externalSlotProps:o?.inputAdornment,additionalProps:{position:"end"},ownerState:t}),N=st(z,$An),B=i.openPickerButton??Mn,H=Xn({elementType:B,externalSlotProps:o?.openPickerButton,additionalProps:{disabled:y||v,onClick:P?I.onClose:I.onOpen,"aria-label":n($.value),edge:N.position},ownerState:t}),Q=st(H,NAn),Y=i.openPickerIcon,Z=Xn({elementType:Y,externalSlotProps:o?.openPickerIcon,ownerState:V}),ge=i.field,ne=Xn({elementType:ge,externalSlotProps:o?.field,additionalProps:X({},$,k&&{id:T},{readOnly:v,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p,autoFocus:b&&!t.open,focused:P?!0:void 0},m?{inputRef:m}:{}),ownerState:t});R&&(ne.InputProps=X({},ne.InputProps,{ref:_},!t.disableOpenPicker&&{[`${N.position}Adornment`]:O.jsx(U,X({},N,{children:O.jsx(B,X({},Q,{children:O.jsx(Y,X({},Z))}))}))}));const ie=X({textField:i.textField,clearIcon:i.clearIcon,clearButton:i.clearButton},ne.slots),fe=i.layout??vtt;let ve=T;k&&(g?ve=`${T}-label`:ve=void 0);const se=X({},o,{toolbar:X({},o?.toolbar,{titleId:T}),popper:X({"aria-labelledby":ve},o?.popper)}),ue=zn(E,ne.unstableFieldRef);return{renderPicker:()=>O.jsxs(Get,{contextValue:j,localeText:w,children:[O.jsx(ge,X({},ne,{slots:ie,slotProps:se,unstableFieldRef:ue})),O.jsx(vAn,X({role:"dialog",placement:"bottom-start",anchorEl:_.current},I,{open:P,slots:i,slotProps:se,shouldRestoreFocus:L,reduceAnimations:S,children:O.jsx(fe,X({},F,se?.layout,{slots:i,slotProps:se,children:A()}))}))]})}},jAn=["views","format"],ytt=(e,t,n)=>{let{views:r,format:i}=t,o=st(t,jAn);if(i)return i;const s=[],a=[];if(r.forEach(u=>{RE(u)?a.push(u):AE(u)&&s.push(u)}),a.length===0)return Mke(e,X({views:s},o));if(s.length===0)return Rke(e,X({views:a},o));const l=Rke(e,X({views:a},o));return`${Mke(e,X({views:s},o))} ${l}`},BAn=(e,t,n)=>n?t.filter(r=>!yM(r)||r==="hours"):e?[...t,"meridiem"]:t,UAn=(e,t)=>1440/((e.hours??1)*(e.minutes??5))<=t;function VAn({thresholdToRenderTimeInASingleColumn:e,ampm:t,timeSteps:n,views:r}){const i=e??24,o=X({hours:1,minutes:5,seconds:5},n),s=UAn(o,i);return{thresholdToRenderTimeInASingleColumn:i,timeSteps:o,shouldRenderTimeInASingleColumn:s,views:BAn(t,r,s)}}function WAn(e){return pt("MuiTimeClock",e)}dt("MuiTimeClock",["root","arrowSwitcher"]);const IE=220,Qm=36,kR={x:IE/2,y:IE/2},btt={x:kR.x,y:0},HAn=btt.x-kR.x,GAn=btt.y-kR.y,qAn=e=>e*(180/Math.PI),xtt=(e,t,n)=>{const r=t-kR.x,i=n-kR.y,o=Math.atan2(HAn,GAn)-Math.atan2(r,i);let s=qAn(o);s=Math.round(s/e)*e,s%=360;const a=Math.floor(s/e)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:a,distance:c}},XAn=(e,t,n=1)=>{const r=n*6;let{value:i}=xtt(r,e,t);return i=i*n%60,i},YAn=(e,t,n)=>{const{value:r,distance:i}=xtt(30,e,t);let o=r||12;return n?o%=12:i{const{classes:t}=e;return Xe({root:["root"],thumb:["thumb"]},QAn,t)},JAn=Oe("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:e.transitions.create(["transform","height"])}}]})),eRn=Oe("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({width:4,height:4,backgroundColor:(e.vars||e).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${Qm/2}px)`,border:`${(Qm-4)/2}px solid ${(e.vars||e).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(e.vars||e).palette.primary.main}}]}));function tRn(e){const t=Rr({props:e,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,viewValue:o}=t,s=st(t,KAn),a=M.useRef(i);M.useEffect(()=>{a.current=i},[i]);const l=X({},t,{shouldAnimate:a.current!==i}),c=ZAn(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*IE),transform:`rotateZ(${d}deg)`}};return O.jsx(JAn,X({style:u(),className:Re(c.root,n),ownerState:l},s,{children:O.jsx(eRn,{ownerState:l,className:c.thumb})}))}function nRn(e){return pt("MuiClock",e)}dt("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const rRn=e=>{const{classes:t,meridiemMode:n}=e;return Xe({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",n==="am"&&"selected"],pmButton:["pmButton",n==="pm"&&"selected"],meridiemText:["meridiemText"]},nRn,t)},iRn=Oe("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),oRn=Oe("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),sRn=Oe("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),aRn=Oe("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),lRn=Oe("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),wtt=(e,t)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:Qm,variants:[{props:{meridiemMode:t},style:{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:hover":{backgroundColor:(e.vars||e).palette.primary.light}}}]}),cRn=Oe(Mn,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>X({},wtt(e,"am"),{position:"absolute",left:8})),uRn=Oe(Mn,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>X({},wtt(e,"pm"),{position:"absolute",right:8})),Hke=Oe(mn,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function fRn(e){const t=Rr({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:f,selectedId:d,type:h,viewValue:p,viewRange:[g,m],disabled:v=!1,readOnly:y,className:b}=t,w=t,S=bi(),_=qc(),E=M.useRef(!1),T=rRn(w),k=l(p,h),P=!n&&h==="hours"&&(p<1||p>12),I=(H,Q)=>{v||y||l(H,h)||f(H,Q)},R=(H,Q)=>{let{offsetX:Y,offsetY:Z}=H;if(Y===void 0){const ne=H.target.getBoundingClientRect();Y=H.changedTouches[0].clientX-ne.left,Z=H.changedTouches[0].clientY-ne.top}const ge=h==="seconds"||h==="minutes"?XAn(Y,Z,u):YAn(Y,Z,!!n);I(ge,Q)},F=H=>{E.current=!0,R(H,"shallow")},A=H=>{E.current&&(R(H,"finish"),E.current=!1),H.preventDefault()},L=H=>{H.buttons>0&&R(H.nativeEvent,"shallow")},$=H=>{E.current&&(E.current=!1),R(H.nativeEvent,"finish")},j=M.useMemo(()=>h==="hours"?!0:p%5===0,[h,p]),V=h==="minutes"?u:1,U=M.useRef(null);lr(()=>{i&&U.current.focus()},[i]);const z=H=>Math.max(g,Math.min(m,H)),N=H=>(H+(m+1))%(m+1),B=H=>{if(!E.current)switch(H.key){case"Home":I(g,"partial"),H.preventDefault();break;case"End":I(m,"partial"),H.preventDefault();break;case"ArrowUp":I(N(p+V),"partial"),H.preventDefault();break;case"ArrowDown":I(N(p-V),"partial"),H.preventDefault();break;case"PageUp":I(z(p+5),"partial"),H.preventDefault();break;case"PageDown":I(z(p-5),"partial"),H.preventDefault();break;case"Enter":case" ":I(p,"finish"),H.preventDefault();break}};return O.jsxs(iRn,{className:Re(T.root,b),children:[O.jsxs(oRn,{className:T.clock,children:[O.jsx(aRn,{onTouchMove:F,onTouchStart:F,onTouchEnd:A,onMouseUp:$,onMouseMove:L,ownerState:{disabled:v},className:T.squareMask}),!k&&O.jsxs(M.Fragment,{children:[O.jsx(lRn,{className:T.pin}),s!=null&&O.jsx(tRn,{type:h,viewValue:p,isInner:P,hasSelected:j})]}),O.jsx(sRn,{"aria-activedescendant":d,"aria-label":_.clockLabelText(h,s,S,s==null?null:S.format(s,"fullTime")),ref:U,role:"listbox",onKeyDown:B,tabIndex:0,className:T.wrapper,children:o})]}),n&&r&&O.jsxs(M.Fragment,{children:[O.jsx(cRn,{onClick:y?void 0:()=>a("am"),disabled:v||c===null,ownerState:w,className:T.amButton,title:Fm(S,"am"),children:O.jsx(Hke,{variant:"caption",className:T.meridiemText,children:Fm(S,"am")})}),O.jsx(uRn,{disabled:v||c===null,onClick:y?void 0:()=>a("pm"),ownerState:w,className:T.pmButton,title:Fm(S,"pm"),children:O.jsx(Hke,{variant:"caption",className:T.meridiemText,children:Fm(S,"pm")})})]})]})}function dRn(e){return pt("MuiClockNumber",e)}const LN=dt("MuiClockNumber",["root","selected","disabled"]),hRn=["className","disabled","index","inner","label","selected"],pRn=e=>{const{classes:t,selected:n,disabled:r}=e;return Xe({root:["root",n&&"selected",r&&"disabled"]},dRn,t)},gRn=Oe("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${LN.disabled}`]:t.disabled},{[`&.${LN.selected}`]:t.selected}]})(({theme:e})=>({height:Qm,width:Qm,position:"absolute",left:`calc((100% - ${Qm}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(e.vars||e).palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:(e.vars||e).palette.background.paper},[`&.${LN.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${LN.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:X({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function Stt(e){const t=Rr({props:e,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:s,selected:a}=t,l=st(t,hRn),c=t,u=pRn(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(IE-Qm-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return O.jsx(gRn,X({className:Re(u.root,n),"aria-disabled":r?!0:void 0,"aria-selected":a?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(IE-Qm)/2}px`},ownerState:c},l,{children:s}))}const mRn=({ampm:e,value:t,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const s=t?o.getHours(t):null,a=[],l=e?1:0,c=e?12:23,u=f=>s===null?!1:e?f===12?s===12||s===0:s===f||s-12===f:s===f;for(let f=l;f<=c;f+=1){let d=f.toString();f===0&&(d="00");const h=!e&&(f===0||f>12);d=o.formatNumber(d);const p=u(f);a.push(O.jsx(Stt,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return a},Gke=({utils:e,value:t,isDisabled:n,getClockNumberText:r,selectedId:i})=>{const o=e.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([s,a],l)=>{const c=s===t;return O.jsx(Stt,{label:a,id:c?i:void 0,index:l+1,inner:!1,disabled:n(s),selected:c,"aria-label":r(a)},s)})},yge=({value:e,referenceDate:t,utils:n,props:r,timezone:i})=>{const o=M.useMemo(()=>yl.getInitialReferenceValue({value:e,utils:n,props:r,referenceDate:t,granularity:Wd.day,timezone:i,getTodayDate:()=>uge(n,i,"date")}),[]);return e??o},vRn=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],yRn=e=>{const{classes:t}=e;return Xe({root:["root"],arrowSwitcher:["arrowSwitcher"]},WAn,t)},bRn=Oe(q8,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),xRn=Oe(utt,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),wRn=["hours","minutes"],SRn=M.forwardRef(function(t,n){const r=bi(),i=Rr({props:t,name:"MuiTimeClock"}),{ampm:o=r.is12HourCycleInCurrentLocale(),ampmInClock:s=!1,autoFocus:a,slots:l,slotProps:c,value:u,defaultValue:f,referenceDate:d,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:p,minTime:g,disableFuture:m,disablePast:v,minutesStep:y=1,shouldDisableTime:b,showViewSwitcher:w,onChange:S,view:_,views:E=wRn,openTo:T,onViewChange:k,focusedView:P,onFocusedViewChange:I,className:R,disabled:F,readOnly:A,timezone:L}=i,$=st(i,vRn),{value:j,handleValueChange:V,timezone:U}=pP({name:"TimeClock",timezone:L,value:u,defaultValue:f,referenceDate:d,onChange:S,valueManager:yl}),z=yge({value:j,referenceDate:d,utils:r,props:i,timezone:U}),N=qc(),B=AS(U),{view:H,setView:Q,previousView:Y,nextView:Z,setValueAndGoToNextView:ge}=AL({view:_,views:E,openTo:T,onViewChange:k,onChange:V,focusedView:P,onFocusedViewChange:I}),{meridiemMode:ne,handleMeridiemChange:ie}=vge(z,o,ge),fe=M.useCallback((ce,pe)=>{const J=kL(h,r),te=pe==="hours"||pe==="minutes"&&E.includes("seconds"),ae=({start:Pe,end:ee})=>!(g&&J(g,ee)||p&&J(Pe,p)||m&&J(Pe,B)||v&&J(B,te?ee:Pe)),we=(Pe,ee=1)=>{if(Pe%ee!==0)return!1;if(b)switch(pe){case"hours":return!b(r.setHours(z,Pe),"hours");case"minutes":return!b(r.setMinutes(z,Pe),"minutes");case"seconds":return!b(r.setSeconds(z,Pe),"seconds");default:return!1}return!0};switch(pe){case"hours":{const Pe=TR(ce,ne,o),ee=r.setHours(z,Pe);if(r.getHours(ee)!==Pe)return!0;const re=r.setSeconds(r.setMinutes(ee,0),0),Se=r.setSeconds(r.setMinutes(ee,59),59);return!ae({start:re,end:Se})||!we(Pe)}case"minutes":{const Pe=r.setMinutes(z,ce),ee=r.setSeconds(Pe,0),re=r.setSeconds(Pe,59);return!ae({start:ee,end:re})||!we(ce,y)}case"seconds":{const Pe=r.setSeconds(z,ce);return!ae({start:Pe,end:Pe})||!we(ce)}default:throw new Error("not supported")}},[o,z,h,p,ne,g,y,b,r,m,v,B,E]),ve=fr(),se=M.useMemo(()=>{switch(H){case"hours":{const ce=(te,ae)=>{const we=TR(te,ne,o);ge(r.setHours(z,we),ae,"hours")},pe=r.getHours(z);let J;return o?pe>12?J=[12,23]:J=[0,11]:J=[0,23],{onChange:ce,viewValue:pe,children:mRn({value:j,utils:r,ampm:o,getClockNumberText:N.hoursClockNumberText,isDisabled:te=>F||fe(te,"hours"),selectedId:ve}),viewRange:J}}case"minutes":{const ce=r.getMinutes(z);return{viewValue:ce,onChange:(J,te)=>{ge(r.setMinutes(z,J),te,"minutes")},children:Gke({utils:r,value:ce,getClockNumberText:N.minutesClockNumberText,isDisabled:J=>F||fe(J,"minutes"),selectedId:ve}),viewRange:[0,59]}}case"seconds":{const ce=r.getSeconds(z);return{viewValue:ce,onChange:(J,te)=>{ge(r.setSeconds(z,J),te,"seconds")},children:Gke({utils:r,value:ce,getClockNumberText:N.secondsClockNumberText,isDisabled:J=>F||fe(J,"seconds"),selectedId:ve}),viewRange:[0,59]}}default:throw new Error("You must provide the type for ClockView")}},[H,r,j,o,N.hoursClockNumberText,N.minutesClockNumberText,N.secondsClockNumberText,ne,ge,z,fe,ve,F]),ue=i,G=yRn(ue);return O.jsxs(bRn,X({ref:n,className:Re(G.root,R),ownerState:ue},$,{children:[O.jsx(fRn,X({autoFocus:a??!!P,ampmInClock:s&&E.includes("hours"),value:j,type:H,ampm:o,minutesStep:y,isTimeDisabled:fe,meridiemMode:ne,handleMeridiemChange:ie,selectedId:ve,disabled:F,readOnly:A},se)),w&&O.jsx(xRn,{className:G.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>Q(Y),isPreviousDisabled:!Y,previousLabel:N.openPreviousView,onGoToNext:()=>Q(Z),isNextDisabled:!Z,nextLabel:N.openNextView,ownerState:ue})]}))});function _Rn(e){return pt("MuiDigitalClock",e)}const CRn=dt("MuiDigitalClock",["root","list","item"]),ORn=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],ERn=e=>{const{classes:t}=e;return Xe({root:["root"],list:["list"],item:["item"]},_Rn,t)},TRn=Oe(q8,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(e,t)=>t.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:rtt,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),PRn=Oe(Xw,{name:"MuiDigitalClock",slot:"List",overridesResolver:(e,t)=>t.list})({padding:0}),kRn=Oe(nr,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(e,t)=>t.item})(({theme:e})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.primary.main,e.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Vt(e.palette.primary.main,e.palette.action.focusOpacity)}})),MRn=M.forwardRef(function(t,n){const r=bi(),i=M.useRef(null),o=zn(n,i),s=M.useRef(null),a=Rr({props:t,name:"MuiDigitalClock"}),{ampm:l=r.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:f,slotProps:d,value:h,defaultValue:p,referenceDate:g,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:v,minTime:y,disableFuture:b,disablePast:w,minutesStep:S=1,shouldDisableTime:_,onChange:E,view:T,openTo:k,onViewChange:P,focusedView:I,onFocusedViewChange:R,className:F,disabled:A,readOnly:L,views:$=["hours"],skipDisabled:j=!1,timezone:V}=a,U=st(a,ORn),{value:z,handleValueChange:N,timezone:B}=pP({name:"DigitalClock",timezone:V,value:h,defaultValue:p,referenceDate:g,onChange:E,valueManager:yl}),H=qc(),Q=AS(B),Y=M.useMemo(()=>X({},a,{alreadyRendered:!!i.current}),[a]),Z=ERn(Y),ge=f?.digitalClockItem??kRn,ne=Xn({elementType:ge,externalSlotProps:d?.digitalClockItem,ownerState:{},className:Z.item}),ie=yge({value:z,referenceDate:g,utils:r,props:a,timezone:B}),fe=ft(J=>N(J,"finish","hours")),{setValueAndGoToNextView:ve}=AL({view:T,views:$,openTo:k,onViewChange:P,onChange:fe,focusedView:I,onFocusedViewChange:R}),se=ft(J=>{ve(J,"finish")});M.useEffect(()=>{if(i.current===null)return;const J=i.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!J)return;const te=J.offsetTop;(u||I)&&J.focus(),i.current.scrollTop=te-4});const ue=M.useCallback(J=>{const te=kL(m,r),ae=()=>!(y&&te(y,J)||v&&te(J,v)||b&&te(J,Q)||w&&te(Q,J)),we=()=>r.getMinutes(J)%S!==0?!1:_?!_(J,"hours"):!0;return!ae()||!we()},[m,r,y,v,b,Q,w,S,_]),G=M.useMemo(()=>{const J=[];let ae=r.startOfDay(ie);for(;r.isSameDay(ie,ae);)J.push(ae),ae=r.addMinutes(ae,c);return J},[ie,c,r]),ce=G.findIndex(J=>r.isEqual(J,ie)),pe=J=>{switch(J.key){case"PageUp":{const te=QB(s.current)-5,ae=s.current.children,we=Math.max(0,te),Pe=ae[we];Pe&&Pe.focus(),J.preventDefault();break}case"PageDown":{const te=QB(s.current)+5,ae=s.current.children,we=Math.min(ae.length-1,te),Pe=ae[we];Pe&&Pe.focus(),J.preventDefault();break}}};return O.jsx(TRn,X({ref:o,className:Re(Z.root,F),ownerState:Y},U,{children:O.jsx(PRn,{ref:s,role:"listbox","aria-label":H.timePickerToolbarTitle,className:Z.list,onKeyDown:pe,children:G.map((J,te)=>{if(j&&ue(J))return null;const ae=r.isEqual(J,z),we=r.format(J,l?"fullTime12h":"fullTime24h"),Pe=ce===te||ce===-1&&te===0?0:-1;return O.jsx(ge,X({onClick:()=>!L&&se(J),selected:ae,disabled:A||ue(J),disableRipple:L,role:"option","aria-disabled":L,"aria-selected":ae,tabIndex:Pe},ne,{children:we}),`${J.valueOf()}-${we}`)})})}))});function ARn(e){return pt("MuiMultiSectionDigitalClock",e)}const qke=dt("MuiMultiSectionDigitalClock",["root"]);function RRn(e){return pt("MuiMultiSectionDigitalClockSection",e)}const IRn=dt("MuiMultiSectionDigitalClockSection",["root","item"]),DRn=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],LRn=e=>{const{classes:t}=e;return Xe({root:["root"],item:["item"]},RRn,t)},FRn=Oe(Xw,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({maxHeight:rtt,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),$Rn=Oe(nr,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(e,t)=>t.item})(({theme:e})=>({padding:8,margin:"2px 4px",width:bM,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Vt(e.palette.primary.main,e.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Vt(e.palette.primary.main,e.palette.action.focusOpacity)}})),NRn=M.forwardRef(function(t,n){const r=M.useRef(null),i=zn(n,r),o=M.useRef(null),s=Rr({props:t,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:a,onChange:l,className:c,disabled:u,readOnly:f,items:d,active:h,slots:p,slotProps:g,skipDisabled:m}=s,v=st(s,DRn),y=M.useMemo(()=>X({},s,{alreadyRendered:!!r.current}),[s]),b=LRn(y),w=p?.digitalClockSectionItem??$Rn;M.useEffect(()=>{if(r.current===null)return;const E=r.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(h&&a&&E&&E.focus(),!E||o.current===E)return;o.current=E;const T=E.offsetTop;r.current.scrollTop=T-4});const S=d.findIndex(E=>E.isFocused(E.value)),_=E=>{switch(E.key){case"PageUp":{const T=QB(r.current)-5,k=r.current.children,P=Math.max(0,T),I=k[P];I&&I.focus(),E.preventDefault();break}case"PageDown":{const T=QB(r.current)+5,k=r.current.children,P=Math.min(k.length-1,T),I=k[P];I&&I.focus(),E.preventDefault();break}}};return O.jsx(FRn,X({ref:i,className:Re(b.root,c),ownerState:y,autoFocusItem:a&&h,role:"listbox",onKeyDown:_},v,{children:d.map((E,T)=>{const k=E.isDisabled?.(E.value),P=u||k;if(m&&P)return null;const I=E.isSelected(E.value),R=S===T||S===-1&&T===0?0:-1;return O.jsx(w,X({onClick:()=>!f&&l(E.value),selected:I,disabled:P,disableRipple:f,role:"option","aria-disabled":f||P||void 0,"aria-label":E.ariaLabel,"aria-selected":I,tabIndex:R,className:b.item},g?.digitalClockSectionItem,{children:E.label}),E.label)})}))}),zRn=({now:e,value:t,utils:n,ampm:r,isDisabled:i,resolveAriaLabel:o,timeStep:s,valueOrReferenceDate:a})=>{const l=t?n.getHours(t):null,c=[],u=(h,p)=>{const g=p??l;return g===null?!1:r?h===12?g===12||g===0:g===h||g-12===h:g===h},f=h=>u(h,n.getHours(a)),d=r?11:23;for(let h=0;h<=d;h+=s){let p=n.format(n.setHours(e,h),r?"hours12h":"hours24h");const g=o(parseInt(p,10).toString());p=n.formatNumber(p),c.push({value:h,label:p,isSelected:u,isDisabled:i,isFocused:f,ariaLabel:g})}return c},Xke=({value:e,utils:t,isDisabled:n,timeStep:r,resolveLabel:i,resolveAriaLabel:o,hasValue:s=!0})=>{const a=c=>e===null?!1:s&&e===c,l=c=>e===c;return[...Array.from({length:Math.ceil(60/r)},(c,u)=>{const f=r*u;return{value:f,label:t.formatNumber(i(f)),isDisabled:n,isSelected:a,isFocused:l,ariaLabel:o(f.toString())}})]},jRn=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],BRn=e=>{const{classes:t}=e;return Xe({root:["root"]},ARn,t)},URn=Oe(q8,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(e.vars||e).palette.divider}`})),VRn=M.forwardRef(function(t,n){const r=bi(),i=yi(),o=Rr({props:t,name:"MuiMultiSectionDigitalClock"}),{ampm:s=r.is12HourCycleInCurrentLocale(),timeSteps:a,autoFocus:l,slots:c,slotProps:u,value:f,defaultValue:d,referenceDate:h,disableIgnoringDatePartForTimeValidation:p=!1,maxTime:g,minTime:m,disableFuture:v,disablePast:y,minutesStep:b=1,shouldDisableTime:w,onChange:S,view:_,views:E=["hours","minutes"],openTo:T,onViewChange:k,focusedView:P,onFocusedViewChange:I,className:R,disabled:F,readOnly:A,skipDisabled:L=!1,timezone:$}=o,j=st(o,jRn),{value:V,handleValueChange:U,timezone:z}=pP({name:"MultiSectionDigitalClock",timezone:$,value:f,defaultValue:d,referenceDate:h,onChange:S,valueManager:yl}),N=qc(),B=AS(z),H=M.useMemo(()=>X({hours:1,minutes:5,seconds:5},a),[a]),Q=yge({value:V,referenceDate:h,utils:r,props:o,timezone:z}),Y=ft((ae,we,Pe)=>U(ae,we,Pe)),Z=M.useMemo(()=>!s||!E.includes("hours")||E.includes("meridiem")?E:[...E,"meridiem"],[s,E]),{view:ge,setValueAndGoToNextView:ne,focusedView:ie}=AL({view:_,views:Z,openTo:T,onViewChange:k,onChange:Y,focusedView:P,onFocusedViewChange:I}),fe=ft(ae=>{ne(ae,"finish","meridiem")}),{meridiemMode:ve,handleMeridiemChange:se}=vge(Q,s,fe,"finish"),ue=M.useCallback((ae,we)=>{const Pe=kL(p,r),ee=we==="hours"||we==="minutes"&&Z.includes("seconds"),re=({start:he,end:xe})=>!(m&&Pe(m,xe)||g&&Pe(he,g)||v&&Pe(he,B)||y&&Pe(B,ee?xe:he)),Se=(he,xe=1)=>{if(he%xe!==0)return!1;if(w)switch(we){case"hours":return!w(r.setHours(Q,he),"hours");case"minutes":return!w(r.setMinutes(Q,he),"minutes");case"seconds":return!w(r.setSeconds(Q,he),"seconds");default:return!1}return!0};switch(we){case"hours":{const he=TR(ae,ve,s),xe=r.setHours(Q,he);if(r.getHours(xe)!==he)return!0;const me=r.setSeconds(r.setMinutes(xe,0),0),be=r.setSeconds(r.setMinutes(xe,59),59);return!re({start:me,end:be})||!Se(he)}case"minutes":{const he=r.setMinutes(Q,ae),xe=r.setSeconds(he,0),me=r.setSeconds(he,59);return!re({start:xe,end:me})||!Se(ae,b)}case"seconds":{const he=r.setSeconds(Q,ae);return!re({start:he,end:he})||!Se(ae)}default:throw new Error("not supported")}},[s,Q,p,g,ve,m,b,w,r,v,y,B,Z]),G=M.useCallback(ae=>{switch(ae){case"hours":return{onChange:we=>{const Pe=TR(we,ve,s);ne(r.setHours(Q,Pe),"finish","hours")},items:zRn({now:B,value:V,ampm:s,utils:r,isDisabled:we=>ue(we,"hours"),timeStep:H.hours,resolveAriaLabel:N.hoursClockNumberText,valueOrReferenceDate:Q})};case"minutes":return{onChange:we=>{ne(r.setMinutes(Q,we),"finish","minutes")},items:Xke({value:r.getMinutes(Q),utils:r,isDisabled:we=>ue(we,"minutes"),resolveLabel:we=>r.format(r.setMinutes(B,we),"minutes"),timeStep:H.minutes,hasValue:!!V,resolveAriaLabel:N.minutesClockNumberText})};case"seconds":return{onChange:we=>{ne(r.setSeconds(Q,we),"finish","seconds")},items:Xke({value:r.getSeconds(Q),utils:r,isDisabled:we=>ue(we,"seconds"),resolveLabel:we=>r.format(r.setSeconds(B,we),"seconds"),timeStep:H.seconds,hasValue:!!V,resolveAriaLabel:N.secondsClockNumberText})};case"meridiem":{const we=Fm(r,"am"),Pe=Fm(r,"pm");return{onChange:se,items:[{value:"am",label:we,isSelected:()=>!!V&&ve==="am",isFocused:()=>!!Q&&ve==="am",ariaLabel:we},{value:"pm",label:Pe,isSelected:()=>!!V&&ve==="pm",isFocused:()=>!!Q&&ve==="pm",ariaLabel:Pe}]}}default:throw new Error(`Unknown view: ${ae} found.`)}},[B,V,s,r,H.hours,H.minutes,H.seconds,N.hoursClockNumberText,N.minutesClockNumberText,N.secondsClockNumberText,ve,ne,Q,ue,se]),ce=M.useMemo(()=>{if(!i)return Z;const ae=Z.filter(we=>we!=="meridiem");return ae.reverse(),Z.includes("meridiem")&&ae.push("meridiem"),ae},[i,Z]),pe=M.useMemo(()=>Z.reduce((ae,we)=>X({},ae,{[we]:G(we)}),{}),[Z,G]),J=o,te=BRn(J);return O.jsx(URn,X({ref:n,className:Re(te.root,R),ownerState:J,role:"group"},j,{children:ce.map(ae=>O.jsx(NRn,{items:pe[ae].items,onChange:pe[ae].onChange,active:ge===ae,autoFocus:l||ie===ae,disabled:F,readOnly:A,slots:c,slotProps:u,skipDisabled:L,"aria-label":N.selectViewText(ae)},ae))}))}),fX=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:b,slotProps:w,readOnly:S,disabled:_,sx:E,autoFocus:T,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:P,timezone:I})=>O.jsx(SRn,{view:e,onViewChange:t,focusedView:n&&RE(n)?n:null,onFocusedViewChange:r,views:i.filter(RE),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:b,slotProps:w,readOnly:S,disabled:_,sx:E,autoFocus:T,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:P,timezone:I}),WRn=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:k,skipDisabled:P,timezone:I})=>O.jsx(MRn,{view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i.filter(RE),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeStep:k?.minutes,skipDisabled:P,timezone:I}),Yke=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:k,skipDisabled:P,timezone:I})=>O.jsx(VRn,{view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i.filter(RE),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:k,skipDisabled:P,timezone:I}),HRn=M.forwardRef(function(t,n){const r=yi(),{toolbar:i,tabs:o,content:s,actionBar:a,shortcuts:l}=ptt(t),{sx:c,className:u,isLandscape:f,classes:d}=t,h=a&&(a.props.actions?.length??0)>0,p=X({},t,{isRtl:r});return O.jsxs(gtt,{ref:n,className:Re(zd.root,d?.root,u),sx:[{[`& .${zd.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${zd.actionBar}`]:{gridRow:5}},...Array.isArray(c)?c:[c]],ownerState:p,children:[f?l:i,f?i:l,O.jsxs(mtt,{className:Re(zd.contentWrapper,d?.contentWrapper),sx:{display:"grid"},children:[s,o,h&&O.jsx(sa,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),a]})}),GRn=["openTo","focusedView","timeViewsCount"],qRn=function(t,n,r){const{openTo:i,focusedView:o,timeViewsCount:s}=r,a=st(r,GRn),l=X({},a,{autoFocus:!1,focusedView:null,sx:[{[`&.${qke.root}`]:{borderBottom:0},[`&.${qke.root}, .${IRn.root}, &.${CRn.root}`]:{maxHeight:G8}}]}),c=yM(n);return O.jsxs(M.Fragment,{children:[t[c?"day":n]?.(X({},r,{view:c?"day":n,focusedView:o&&AE(o)?o:null,views:r.views.filter(AE),sx:[{gridColumn:1},...l.sx]})),s>0&&O.jsxs(M.Fragment,{children:[O.jsx(sa,{orientation:"vertical",sx:{gridColumn:2}}),t[c?n:"hours"]?.(X({},l,{view:c?n:"hours",focusedView:o&&yM(o)?o:null,openTo:yM(i)?i:"hours",views:r.views.filter(yM),sx:[{gridColumn:3},...l.sx]}))]})]})},_tt=M.forwardRef(function(t,n){const r=qc(),i=bi(),o=itt(t,"MuiDesktopDateTimePicker"),{shouldRenderTimeInASingleColumn:s,thresholdToRenderTimeInASingleColumn:a,views:l,timeSteps:c}=VAn(o),u=s?WRn:Yke,f=X({day:yO,month:yO,year:yO,hours:u,minutes:u,seconds:u,meridiem:u},o.viewRenderers),d=o.ampmInClock??!0,p=f.hours?.name===Yke.name?l:l.filter(y=>y!=="meridiem"),g=s?[]:["accept"],m=X({},o,{viewRenderers:f,format:ytt(i,o),views:p,yearsPerRow:o.yearsPerRow??4,ampmInClock:d,timeSteps:c,thresholdToRenderTimeInASingleColumn:a,shouldRenderTimeInASingleColumn:s,slots:X({field:ett,layout:HRn,openPickerIcon:rkn},o.slots),slotProps:X({},o.slotProps,{field:y=>X({},SA(o.slotProps?.field,y),Uet(o),{ref:n}),toolbar:X({hidden:!0,ampmInClock:d,toolbarVariant:"desktop"},o.slotProps?.toolbar),tabs:X({hidden:!0},o.slotProps?.tabs),actionBar:y=>X({actions:g},SA(o.slotProps?.actionBar,y))})}),{renderPicker:v}=zAn({props:m,valueManager:yl,valueType:"date-time",getOpenDialogAriaText:Vet({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:m.localeText?.openDatePickerDialogue}),validator:U8,rendererInterceptor:qRn});return v()});_tt.propTypes={ampm:le.bool,ampmInClock:le.bool,autoFocus:le.bool,className:le.string,closeOnSelect:le.bool,dayOfWeekFormatter:le.func,defaultValue:le.object,disabled:le.bool,disableFuture:le.bool,disableHighlightToday:le.bool,disableIgnoringDatePartForTimeValidation:le.bool,disableOpenPicker:le.bool,disablePast:le.bool,displayWeekNumber:le.bool,enableAccessibleFieldDOMStructure:le.any,fixedWeekNumber:le.number,format:le.string,formatDensity:le.oneOf(["dense","spacious"]),inputRef:ize,label:le.node,loading:le.bool,localeText:le.object,maxDate:le.object,maxDateTime:le.object,maxTime:le.object,minDate:le.object,minDateTime:le.object,minTime:le.object,minutesStep:le.number,monthsPerRow:le.oneOf([3,4]),name:le.string,onAccept:le.func,onChange:le.func,onClose:le.func,onError:le.func,onMonthChange:le.func,onOpen:le.func,onSelectedSectionsChange:le.func,onViewChange:le.func,onYearChange:le.func,open:le.bool,openTo:le.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:le.oneOf(["landscape","portrait"]),readOnly:le.bool,reduceAnimations:le.bool,referenceDate:le.object,renderLoading:le.func,selectedSections:le.oneOfType([le.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),le.number]),shouldDisableDate:le.func,shouldDisableMonth:le.func,shouldDisableTime:le.func,shouldDisableYear:le.func,showDaysOutsideCurrentMonth:le.bool,skipDisabled:le.bool,slotProps:le.object,slots:le.object,sx:le.oneOfType([le.arrayOf(le.oneOfType([le.func,le.object,le.bool])),le.func,le.object]),thresholdToRenderTimeInASingleColumn:le.number,timeSteps:le.shape({hours:le.number,minutes:le.number,seconds:le.number}),timezone:le.string,value:le.object,view:le.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:le.shape({day:le.func,hours:le.func,meridiem:le.func,minutes:le.func,month:le.func,seconds:le.func,year:le.func}),views:le.arrayOf(le.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:le.oneOf(["asc","desc"]),yearsPerRow:le.oneOf([3,4])};const XRn=Oe(Gu)({[`& .${RM.container}`]:{outline:0},[`& .${RM.paper}`]:{outline:0,minWidth:H8}}),YRn=Oe(Fc)({"&:first-of-type":{padding:0}});function QRn(e){const{children:t,onDismiss:n,open:r,slots:i,slotProps:o}=e,s=i?.dialog??XRn,a=i?.mobileTransition??Q1;return O.jsx(s,X({open:r,onClose:n},o?.dialog,{TransitionComponent:a,TransitionProps:o?.mobileTransition,PaperComponent:i?.mobilePaper,PaperProps:o?.mobilePaper,children:O.jsx(YRn,{children:t})}))}const KRn=["props","getOpenDialogAriaText"],ZRn=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=st(e,KRn);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,localeText:b}=t,w=M.useRef(null),S=fr(),_=o?.toolbar?.hidden??!1,{open:E,actions:T,layoutProps:k,renderCurrentView:P,fieldProps:I,contextValue:R}=dtt(X({},r,{props:t,fieldRef:w,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),F=i.field,A=Xn({elementType:F,externalSlotProps:o?.field,additionalProps:X({},I,_&&{id:S},!(y||v)&&{onClick:T.onOpen,onKeyDown:XPn(T.onOpen)},{readOnly:v??!0,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p},m?{inputRef:m}:{}),ownerState:t});A.inputProps=X({},A.inputProps,{"aria-label":n(I.value)});const L=X({textField:i.textField},A.slots),$=i.layout??vtt;let j=S;_&&(g?j=`${S}-label`:j=void 0);const V=X({},o,{toolbar:X({},o?.toolbar,{titleId:S}),mobilePaper:X({"aria-labelledby":j},o?.mobilePaper)}),U=zn(w,A.unstableFieldRef);return{renderPicker:()=>O.jsxs(Get,{contextValue:R,localeText:b,children:[O.jsx(F,X({},A,{slots:L,slotProps:V,unstableFieldRef:U})),O.jsx(QRn,X({},T,{open:E,slots:i,slotProps:V,children:O.jsx($,X({},k,V?.layout,{slots:i,slotProps:V,children:P()}))}))]})}},Ctt=M.forwardRef(function(t,n){const r=qc(),i=bi(),o=itt(t,"MuiMobileDateTimePicker"),s=X({day:yO,month:yO,year:yO,hours:fX,minutes:fX,seconds:fX},o.viewRenderers),a=o.ampmInClock??!1,l=X({},o,{viewRenderers:s,format:ytt(i,o),ampmInClock:a,slots:X({field:ett},o.slots),slotProps:X({},o.slotProps,{field:u=>X({},SA(o.slotProps?.field,u),Uet(o),{ref:n}),toolbar:X({hidden:!1,ampmInClock:a},o.slotProps?.toolbar),tabs:X({hidden:!1},o.slotProps?.tabs)})}),{renderPicker:c}=ZRn({props:l,valueManager:yl,valueType:"date-time",getOpenDialogAriaText:Vet({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:l.localeText?.openDatePickerDialogue}),validator:U8});return c()});Ctt.propTypes={ampm:le.bool,ampmInClock:le.bool,autoFocus:le.bool,className:le.string,closeOnSelect:le.bool,dayOfWeekFormatter:le.func,defaultValue:le.object,disabled:le.bool,disableFuture:le.bool,disableHighlightToday:le.bool,disableIgnoringDatePartForTimeValidation:le.bool,disableOpenPicker:le.bool,disablePast:le.bool,displayWeekNumber:le.bool,enableAccessibleFieldDOMStructure:le.any,fixedWeekNumber:le.number,format:le.string,formatDensity:le.oneOf(["dense","spacious"]),inputRef:ize,label:le.node,loading:le.bool,localeText:le.object,maxDate:le.object,maxDateTime:le.object,maxTime:le.object,minDate:le.object,minDateTime:le.object,minTime:le.object,minutesStep:le.number,monthsPerRow:le.oneOf([3,4]),name:le.string,onAccept:le.func,onChange:le.func,onClose:le.func,onError:le.func,onMonthChange:le.func,onOpen:le.func,onSelectedSectionsChange:le.func,onViewChange:le.func,onYearChange:le.func,open:le.bool,openTo:le.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:le.oneOf(["landscape","portrait"]),readOnly:le.bool,reduceAnimations:le.bool,referenceDate:le.object,renderLoading:le.func,selectedSections:le.oneOfType([le.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),le.number]),shouldDisableDate:le.func,shouldDisableMonth:le.func,shouldDisableTime:le.func,shouldDisableYear:le.func,showDaysOutsideCurrentMonth:le.bool,slotProps:le.object,slots:le.object,sx:le.oneOfType([le.arrayOf(le.oneOfType([le.func,le.object,le.bool])),le.func,le.object]),timezone:le.string,value:le.object,view:le.oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:le.shape({day:le.func,hours:le.func,minutes:le.func,month:le.func,seconds:le.func,year:le.func}),views:le.arrayOf(le.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:le.oneOf(["asc","desc"]),yearsPerRow:le.oneOf([3,4])};const JRn=["desktopModeMediaQuery"],eIn=M.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i=YPn}=r,o=st(r,JRn);return rae(i,{defaultMatches:!0})?O.jsx(_tt,X({ref:n},o)):O.jsx(Ctt,X({ref:n},o))}),tIn=e=>({dateTimePicker:{marginTop:e.spacing(2)}}),nIn=({classes:e,hasTimeDimension:t,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?VOt(d):null)},s=O.jsx(bv,{shrink:!0,htmlFor:"time-select",children:`${Ce.get("Time")} (UTC)`}),l=typeof n=="number"?JG(n):null;let c,u;Array.isArray(r)&&(c=JG(r[0]),u=JG(r[1]));const f=O.jsx(Aet,{dateAdapter:cPn,children:O.jsx(eIn,{disabled:!t,className:e.dateTimePicker,format:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,slotProps:{textField:{variant:"standard",size:"small"}},viewRenderers:{hours:null,minutes:null,seconds:null}})});return O.jsx(OR,{label:s,control:f})},rIn=tPn(tIn)(nIn),iIn=e=>({locale:e.controlState.locale,hasTimeDimension:!!ET(e),selectedTime:e.controlState.selectedTime,selectedTimeRange:e.controlState.selectedTimeRange}),oIn={selectTime:F8},sIn=hr(iIn,oIn)(rIn),Qke=5,aIn={box:{marginLeft:Qke,marginRight:Qke,minWidth:"10rem",height:"3rem"}};function lIn({hasTimeDimension:e,selectedTime:t,selectTime:n,selectedTimeRange:r}){const[i,o]=M.useState(t);if(M.useEffect(()=>{o(t||(r?r[0]:0))},[t,r]),!e)return null;const s=(f,d)=>{typeof d=="number"&&o(d)},a=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*DBe.years,Date.now()]);const c=[{value:r[0],label:IA(r[0])},{value:r[1],label:IA(r[1])}];function u(f){return yT(f)}return O.jsx(bt,{sx:aIn.box,children:O.jsx(_n,{arrow:!0,title:Ce.get("Select time in dataset"),children:O.jsx(Kw,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:s,onChangeCommitted:a,size:"small"})})})}const cIn=e=>({locale:e.controlState.locale,hasTimeDimension:!!ET(e),selectedTime:e.controlState.selectedTime,selectedTimeRange:e.controlState.selectedTimeRange}),uIn={selectTime:F8,selectTimeRange:vJe},fIn=hr(cIn,uIn)(lIn),Ott=at(O.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),Ett=at(O.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),dIn=at(O.jsx("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),hIn=at(O.jsx("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),pIn=at(O.jsx("path",{d:"M9 16h2V8H9zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m1-4h2V8h-2z"}),"PauseCircleOutline"),gIn=at(O.jsx("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline"),N_={formControl:{marginLeft:1,marginRight:1,marginTop:2},iconButton:{padding:"2px"}};function mIn({timeAnimationActive:e,timeAnimationInterval:t,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:s}){const a=M.useRef(null);M.useEffect(()=>(p(),m));const l=()=>{s(1)},c=()=>{n(!e,t)},u=()=>{s(1)},f=()=>{s(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{e?g():m()},g=()=>{m(),a.current=window.setInterval(l,t)},m=()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},v=typeof r=="number",y=e?O.jsx(pIn,{}):O.jsx(gIn,{}),b=O.jsx(Mn,{disabled:!v,onClick:c,size:"small",sx:N_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Auto-step through times in the dataset"),children:y})}),w=O.jsx(Mn,{disabled:!v||e,onClick:d,size:"small",sx:N_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("First time step"),children:O.jsx(dIn,{})})}),S=O.jsx(Mn,{disabled:!v||e,onClick:f,size:"small",sx:N_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Previous time step"),children:O.jsx(Ott,{})})}),_=O.jsx(Mn,{disabled:!v||e,onClick:u,size:"small",sx:N_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Next time step"),children:O.jsx(Ett,{})})}),E=O.jsx(Mn,{disabled:!v||e,onClick:h,size:"small",sx:N_.iconButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Last time step"),children:O.jsx(hIn,{})})});return O.jsx(sd,{sx:N_.formControl,variant:"standard",children:O.jsxs(bt,{children:[w,S,b,_,E]})})}const vIn=e=>({locale:e.controlState.locale,selectedTime:e.controlState.selectedTime,selectedTimeRange:e.controlState.selectedTimeRange,timeAnimationActive:e.controlState.timeAnimationActive,timeAnimationInterval:e.controlState.timeAnimationInterval}),yIn={selectTime:F8,incSelectedTime:c_n,updateTimeAnimation:f_n},bIn=hr(vIn,yIn)(mIn),xIn={formControl:{marginLeft:"auto",marginRight:1,marginTop:2,marginBottom:0,display:"flex",flexDirection:"row",alignItems:"center",gap:1,flexGrow:0}};function wIn({visible:e,sidePanelOpen:t,setSidePanelOpen:n,compact:r}){if(!e)return null;const i=O.jsx(Vl,{sx:Em.toggleButton,value:"sidebar",onClick:()=>n(!t),tooltipText:Ce.get(t?"Hide sidebar":"Show sidebar"),icon:t?O.jsx(Ett,{}):O.jsx(Ott,{})});return O.jsxs(sd,{sx:xIn.formControl,variant:"standard",children:[r&&O.jsx(cet,{}),r&&O.jsx(set,{style:Em.toggleButton}),i]})}const SIn=e=>({locale:e.controlState.locale,visible:!!(e.controlState.selectedDatasetId||e.controlState.selectedPlaceId),sidePanelOpen:e.controlState.sidePanelOpen,compact:On.instance.branding.compact}),_In={setSidePanelOpen:qpe},CIn=hr(SIn,_In)(wIn),OIn=e=>({locale:e.controlState.locale,show:e.dataState.datasets.length>0}),EIn={},TIn=({show:e})=>e?O.jsxs(mOn,{children:[O.jsx(SOn,{}),O.jsx(sa,{orientation:"vertical",variant:"middle",flexItem:!0}),O.jsx(AOn,{}),O.jsx(sa,{orientation:"vertical",variant:"middle",flexItem:!0}),O.jsx(FOn,{}),O.jsx(VOn,{}),O.jsx(JOn,{}),O.jsx(sa,{orientation:"vertical",variant:"middle",flexItem:!0}),O.jsx(sIn,{}),O.jsx(bIn,{}),O.jsx(fIn,{}),O.jsx(CIn,{})]}):null,PIn=hr(OIn,EIn)(TIn);function kIn(e,t){return Fr(t)&&t>0?MIn(e,t):AIn(e)}function MIn(e,t){let n=0,r;return((...i)=>{const o=Date.now();return(n===0||o-n>=t)&&(r=e(...i),n=o),r})}function AIn(e){let t=!1;return((...n)=>{t||(t=!0,requestAnimationFrame(()=>{e(...n),t=!1}))})}function Ttt({onDragStart:e,onDragMove:t,onDragEnd:n}){const r=M.useRef(null),i=M.useCallback(c=>{if(c.buttons===1&&r.current!==null&&(c.preventDefault(),t)){const{clientX:u,clientY:f}=c,[d,h]=r.current;r.current=[u,f],t([u-d,f-h],c)}},[t]),o=M.useMemo(()=>kIn(i),[i]),s=M.useCallback(c=>{if(c.buttons===1){c.preventDefault(),r.current=[c.clientX,c.clientY];const u=l.current;document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",u),e&&e(c)}},[e,o]),a=M.useCallback(c=>{if(r.current!==null){c.preventDefault(),r.current=null;const u=l.current;document.body.removeEventListener("mousemove",o),document.body.removeEventListener("mouseup",u),n&&n(c)}},[n,o]),l=M.useRef(()=>{});return M.useEffect(()=>{l.current=a},[a]),s}const Ptt="8px",m0={container:{display:"flex"},resizeHandle:e=>({position:"absolute",opacity:0,zIndex:999,top:0,left:0,transition:"background 0.3s ease, opacity 0.3s ease","&:hover":{background:e.palette.mode==="dark"?"#FFF":"#000",opacity:.25}}),child1:{},child2:{position:"relative"}},RIn={container:{...m0.container,flexFlow:"row nowrap"},resizeHandle:e=>({...m0.resizeHandle(e),width:Ptt,height:"100%",cursor:"col-resize"}),child1:{...m0.child1,height:"100%"},child2:{...m0.child2,height:"100%"}},IIn={container:{...m0.container,flexFlow:"column nowrap"},resizeHandle:e=>({...m0.resizeHandle(e),width:"100%",height:Ptt,cursor:"row-resize"}),child1:{...m0.child1,width:"100%"},child2:{...m0.child2,width:"100%"}};function DIn({dir:e,childPos:t,childSize:n,updateChildSize:r,children:i,style:o,resizeable:s=!0}){const a=M.useRef(null),l=M.useRef(null),c=!t||t==="first",u=M.useCallback(([h,p])=>{const g=e==="hor"?h:p;r(c?g:-g)},[e,c,r]),f=Ttt({onDragMove:u}),d=M.useMemo(()=>{const h=e==="hor"?RIn:IIn,p=`${n}px`,g=`calc(100% - ${n}px)`,m=c?p:g,v=c?g:p;return{...h,container:h.container,child1:{...h.child1,...e==="hor"?{width:m}:{height:m}},child2:{...h.child2,...e==="hor"?{width:v}:{height:v}}}},[e,c,n]);return!i||!Array.isArray(i)||i.length!==2?null:O.jsxs(bt,{id:"SplitPane-Container",sx:d.container,ref:a,style:o,children:[O.jsx(bt,{id:"SplitPane-Child1",sx:d.child1,ref:l,children:i[0]}),O.jsxs(bt,{id:"SplitPane-Child2",sx:d.child2,children:[s&&O.jsx(bt,{id:"SplitPane-ResizeHandle",sx:d.resizeHandle,onMouseDown:f}),i[1]]})]})}const ktt=46.5,bge={sidebarColor:"#181818",backgroundColor:"#1F1F1F",borderColor:"#2B2B2B"},xge={sidebarColor:"#F8F8F8",backgroundColor:"#FFFFFF",borderColor:"#E5E5E5"},LIn=e=>(e.palette.mode==="dark"?bge:xge).sidebarColor,FIn=e=>(e.palette.mode==="dark"?bge:xge).backgroundColor,u2=e=>(e.palette.mode==="dark"?bge:xge).borderColor,z1={mainContainer:e=>({display:"flex",flexDirection:"row",backgroundColor:FIn(e),width:"100%",height:"100%",overflow:"hidden"}),panelContainer:{display:"flex",flexDirection:"column",flex:"1 1 auto",overflow:"hidden"},panelHeader:e=>({padding:1,borderTop:`1px solid ${u2(e)}`,borderRight:`1px solid ${u2(e)}`,borderBottom:`1px solid ${u2(e)}`,flex:"0 0 auto"}),panelContent:e=>({padding:1,borderRight:`1px solid ${u2(e)}`,flex:"1 1 auto",overflow:"auto"}),sidebarContainer:e=>({display:"flex",flexDirection:"column",gap:1,padding:1,borderTop:`1px solid ${u2(e)}`,backgroundColor:LIn(e),flex:"0 0 auto",width:ktt}),sidebarButton:e=>({color:e.palette.text.secondary}),sidebarButtonSelected:e=>({background:e.palette.action.selected})},$In=({placeGroup:e,mapProjection:t,visible:n})=>{const r=M.useRef(new sD);return M.useEffect(()=>{const i=r.current,o=e.features;if(o.length===0)i.clear();else{const s=i.getFeatures(),a=new Set(s.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!a.has(f.id));s.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new rS().readFeature(f,{dataProjection:"EPSG:4326",featureProjection:t});d.getId()!==f.id&&d.setId(f.id);const h=(f.properties||{}).color||"red",p=(f.properties||{}).opacity,g=(f.properties||{}).source?"diamond":"circle";Fpe(d,h,pae(p),g),i.addFeature(d)})}},[e,t]),O.jsx(eU,{id:e.id,opacity:e.id===Gd?1:.8,visible:n,zIndex:501,source:r.current})};class NIn extends lD{addMapObject(t){const n=new xkt(this.getOptions());return t.addControl(n),n}updateMapObject(t,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(t,n){t.removeControl(n)}}class dX extends lD{addMapObject(t){const n=new Qkt(this.getOptions()),r=!!this.props.active;return n.setActive(r),t.addInteraction(n),r&&this.listen(n,this.props),n}updateMapObject(t,n,r){n.setProperties(this.getOptions());const i=!!this.props.active;return n.setActive(i),this.unlisten(n,r),i&&this.listen(n,this.props),n}removeMapObject(t,n){this.unlisten(n,this.props),t.removeInteraction(n)}getOptions(){const t=super.getOptions();delete t.layerId,delete t.active,delete t.onDrawStart,delete t.onDrawEnd;const n=this.props.layerId;if(n&&!t.source){const r=this.getMapObject(n);r&&(t.source=r.getSource())}return t}listen(t,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&t.on("drawstart",r),i&&t.on("drawend",i)}unlisten(t,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&t.un("drawstart",r),i&&t.un("drawend",i)}}class zIn extends lD{addMapObject(t){return this.updateView(t)}removeMapObject(t,n){}updateMapObject(t,n){return this.updateView(t)}updateView(t){const n=this.props.projection;let r=t.getView().getProjection();if(typeof n=="string"&&r&&(r=r.getCode()),n&&n!==r){const i=t.getView(),o=new hp({...this.props,center:V6(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});t.getLayers().forEach(s=>{s instanceof Q6&&s.getSource().forEachFeature(a=>{a.getGeometry()?.transform(r,n)})}),t.setView(o)}else t.getView().setProperties(this.props);return t.getView()}}const jIn={wrapper:{zIndex:1e3,position:"absolute",bottom:0,left:0,width:"100%",height:"5px",pointerEvents:"none"}};function BIn({progress:e,visibility:t,enabled:n}){return n?O.jsx(bt,{sx:jIn.wrapper,children:O.jsx(bt,{sx:r=>({height:"100%",backgroundColor:r.palette.primary.main,transition:" width 300ms ease",width:`${e}%`,visibility:t})})}):null}const hX="selection",UIn=new sD,Mtt=[255,220,0,.8],VIn=new zp({color:Mtt,width:10,lineCap:"square",lineDash:[10,15]}),Kke=new tw({color:[0,0,0,0]}),WIn=new Cp({stroke:VIn,fill:Kke,image:new iD({radius:15,stroke:new zp({color:Mtt,width:6,lineCap:"square",lineDash:[6,6]}),fill:Kke})});function HIn({theme:e,mapId:t,mapInteraction:n,mapProjection:r,baseMapLayers:i,overlayLayers:o,rgb2Layer:s,rgbLayer:a,variable2Layer:l,variableLayer:c,datasetBoundaryLayer:u,placeGroupLayers:f,colorBarLegend:d,colorBarLegend2:h,mapSplitter:p,mapPointInfoBox:g,mapControlActions:m,userDrawnPlaceGroupName:v,addDrawnUserPlace:y,importUserPlacesFromText:b,userPlaceGroups:w,userPlaceGroupsVisibility:S,showUserPlaces:_,selectPlace:E,selectedPlaceId:T,places:k,imageSmoothing:P,variableSplitPos:I,onMapRef:R,showProgressBar:F,zoomBox:A,setZoomLevel:L,setDatasetZLevel:$}){e=qw();const[j,V]=M.useState(null),[U,z]=M.useState(T||null);M.useEffect(()=>{if(j){const ve=T||null;if(ve!==U&&Qs[hX]){const ue=Qs[hX].getSource();if(ue.clear(),ve){const G=GIn(j,ve);if(G){const ce=G.clone();ce.setId("select-"+G.getId()),ce.setStyle(void 0),ue.addFeature(ce)}}z(ve)}}},[j,T,U]),M.useEffect(()=>{j&&j.getLayers().forEach(ve=>{ve instanceof Y6?ve.getSource().changed():ve.changed()})},[j,P]),M.useEffect(()=>{if(j===null||!Fr(I))return;const ve=ae=>{Zke(j,ae,I,0)},se=ae=>{Zke(j,ae,I,1)},ue=ae=>{ae.context.restore()},G=j2(j,"rgb2"),ce=j2(j,"variable2"),pe=j2(j,"rgb"),J=j2(j,"variable"),te=[[G,ve],[ce,ve],[pe,se],[J,se]];for(const[ae,we]of te)ae&&(ae.on("prerender",we),ae.on("postrender",ue));return()=>{for(const[ae,we]of te)ae&&(ae.un("prerender",we),ae.un("postrender",ue))}});const N=ve=>{if(n==="Select"){const se=ve.map;let ue=null;const G=se.getFeaturesAtPixel(ve.pixel);if(G){for(const ce of G)if(typeof ce.getId=="function"){ue=ce.getId()+"";break}}E&&E(ue,k,!1)}},B=ve=>{if(j!==null&&y&&n!=="Select"){const se=ve.feature;let ue=se.getGeometry();if(!ue)return;const G=gh(mT+n.toLowerCase()+"-"),ce=j.getView().getProjection();if(ue instanceof tle){const Pe=ICt(ue);se.setGeometry(Pe)}ue=se.clone().getGeometry().transform(ce,Jw);const pe=new rS().writeGeometryObject(ue);se.setId(G);let J=0;if(Qs[Gd]){const ee=Qs[Gd]?.getSource()?.getFeatures();ee&&(J=ee.length)}const te=qIn(w,n),ae=Z1(J),we=p5e(ae,e.palette.mode);Fpe(se,we,pae()),y(v,G,{label:te,color:ae},pe,!0)}return!0};function H(ve){R&&R(ve),V(ve)}const Q=ve=>{b&&ve.forEach(se=>{const ue=new FileReader;ue.onloadend=()=>{typeof ue.result=="string"&&b(ue.result)},ue.readAsText(se,"UTF-8")})},[Y,Z]=M.useState(0),[ge,ne]=M.useState("hidden"),ie=M.useCallback(ve=>{Z(ve.value),ne(ve.active?"visible":"hidden")},[]),fe=(ve,se)=>{if(L){const ue=ve.target.getZoom();L(ue)}if($){const ue=g1e(ve.target,se);$(ue)}};return M.useEffect(()=>{if(j&&$){const ve=g1e(j.getView(),j);$(ve)}},[j,c,l,a,s,$]),O.jsx(eet,{children:O.jsxs(E2t,{id:t,onClick:ve=>N(ve),onZoom:(ve,se)=>fe(ve,se),onMapRef:H,mapObjects:Qs,isStale:!0,onDropFiles:Q,onTileLoadProgress:ie,children:[O.jsx(zIn,{id:"view",projection:r}),O.jsxs(uBe,{children:[O.jsx(O.Fragment,{children:i}),s,a,l,c,O.jsx(O.Fragment,{children:o}),u,O.jsx(eU,{id:hX,opacity:.7,zIndex:500,style:WIn,source:UIn}),O.jsx(O.Fragment,{children:w.map(ve=>O.jsx($In,{placeGroup:ve,mapProjection:r,visible:_&&S[ve.id]},ve.id))})]}),f,O.jsx(dX,{id:"drawPoint",layerId:Gd,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:B}),O.jsx(dX,{id:"drawPolygon",layerId:Gd,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:B}),O.jsx(dX,{id:"drawCircle",layerId:Gd,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:B}),d,h,g,m,p,O.jsx(BIn,{enabled:F,progress:Y,visibility:ge}),A,O.jsx(NIn,{bar:!1})]})})}function GIn(e,t){for(const n of e.getLayers().getArray())if(n instanceof Q6){const i=n.getSource()?.getFeatureById(t);if(i)return i}return null}function qIn(e,t){const n=Ce.get(t),r=e.find(i=>i.id===Gd);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(a=>a.properties?a.properties.label===o:!1))return o}return`${n} 1`}function Zke(e,t,n,r){const i=e.getSize();if(!i)return;const o=i[0],s=i[1];let a,l,c,u;r===0?(a=fy(t,[0,0]),l=fy(t,[n,0]),c=fy(t,[0,s]),u=fy(t,[n,s])):(a=fy(t,[n,0]),l=fy(t,[o,0]),c=fy(t,[n,s]),u=fy(t,[o,s]));const f=t.context;f.save(),f.beginPath(),f.moveTo(a[0],a[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const FN=1,MR=.2,gP=240,Att=20,XIn={borderColor:"#3B3B3B"},YIn={borderColor:"#E5E5E5"};function QIn(e){return(e.palette.mode==="dark"?XIn:YIn).borderColor}function X8(e){return`1px solid ${QIn(e)}`}const $N={container:{width:gP},itemContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},itemLabelBox:{paddingLeft:1,fontSize:"small"},itemColorBox:e=>({width:"48px",height:"16px",borderStyle:"solid",borderColor:e.palette.mode==="dark"?"lightgray":"darkgray",borderWidth:1})};function KIn({categories:e,onOpenColorBarEditor:t}){return!e||e.length===0?null:O.jsx(bt,{sx:$N.container,children:e.map((n,r)=>O.jsxs(bt,{onClick:t,sx:$N.itemContainer,children:[O.jsx(bt,{sx:$N.itemColorBox,style:{backgroundColor:n.color}}),O.jsx(bt,{component:"span",sx:$N.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const ZIn=Qn("canvas")(({theme:e})=>({border:X8(e),cursor:"pointer"})),Jke={nominal:{},error:{border:"1px solid red"}};function JIn({colorBar:e,opacity:t,width:n,height:r,onClick:i}){const o=M.useRef(null);M.useEffect(()=>{const c=o.current;c!==null&&MRt(e,t,c)},[e,t]);const{baseName:s,imageData:a}=e,l=a?s:Ce.get("Unknown color bar")+`: ${s}`;return O.jsx(_n,{title:l,children:O.jsx(ZIn,{ref:o,width:n||gP-4,height:r||Att+4,onClick:i,style:a?Jke.nominal:Jke.error})})}function eDn(e,t,n=5,r=!1,i=!1){return rie(nDn(e,t,n,r),i)}function rie(e,t=!1){return e.map(n=>jf(n,void 0,t))}function jf(e,t,n){if(t===void 0&&(t=n?2:tDn(e)),n)return e.toExponential(t);const r=Math.round(e);if(r===e||Math.abs(r-e)<1e-8)return r+"";{let i=e.toFixed(t);if(i.includes("."))for(;i.endsWith("0")&&!i.endsWith(".0");)i=i.substring(0,i.length-1);return i}}function tDn(e){if(e===0||e===Math.floor(e))return 0;const t=Math.floor(Math.log10(Math.abs(e)));return Math.min(16,Math.max(2,t<0?1-t:0))}function nDn(e,t,n,r){const i=new Array(n);if(r){const o=Math.log10(e),a=(Math.log10(t)-o)/(n-1);for(let l=1;leDn(e,t,n,r),[e,t,n,r]);return O.jsx(bt,{sx:e2e.container,onClick:i,children:o.map((s,a)=>O.jsx(mn,{sx:e2e.label,children:s},a))})}const iDn=at(O.jsx("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress"),t2e=e=>e,oDn=e=>Math.pow(10,e),sDn=Math.log10,n2e=(e,t)=>typeof e=="number"?t(e):e.map(t);class aDn{_fn;_invFn;constructor(t){t?(this._fn=sDn,this._invFn=oDn):(this._fn=t2e,this._invFn=t2e)}scale(t){return n2e(t,this._fn)}scaleInv(t){return n2e(t,this._invFn)}}function lDn({variableColorBarName:e,variableColorBarMinMax:t,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const s=M.useMemo(()=>new aDn(n==="log"),[n]),[a,l]=M.useState(()=>s.scale(t));M.useEffect(()=>{l(s.scale(t))},[s,t]);const c=(k,P)=>{Array.isArray(P)&&l(P)},u=(k,P)=>{if(Array.isArray(P)){const R=rie(s.scaleInv(P)).map(F=>Number.parseFloat(F));i(e,R,n,r)}},[f,d]=s.scale(o),h=f=2?v=Math.max(2,Math.round(m/2)):(v=4,m=8);const y=f({value:E[P],label:k}));return O.jsx(Kw,{min:w,max:S,value:a,marks:T,step:_,valueLabelFormat:k=>jf(s.scaleInv(k)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const pX=5,vy={container:e=>({marginTop:e.spacing(2),marginBottom:e.spacing(2),display:"flex",flexDirection:"column",gap:1}),header:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{paddingLeft:2,fontWeight:"bold"},sliderBox:e=>({marginTop:e.spacing(1),marginLeft:e.spacing(pX),marginRight:e.spacing(pX),minWidth:320,width:`calc(100% - ${e.spacing(2*(pX+1))}px)`}),logLabel:{margin:0,paddingRight:2,fontWeight:"bold"},minMaxBox:{display:"flex",justifyContent:"center"},minTextField:{maxWidth:"8em",marginRight:2},maxTextField:{maxWidth:"8em",marginLeft:2}};function cDn({variableColorBar:e,variableColorBarName:t,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[s,a]=M.useState(n),[l,c]=M.useState(n),[u,f]=M.useState(r2e(n)),[d,h]=M.useState([!1,!1]);M.useEffect(()=>{f(r2e(n))},[n]);const p=y=>{const b=y.target.value;f([b,u[1]]);const w=Number.parseFloat(b);let S=!1;if(!Number.isNaN(w)&&w{const b=y.target.value;f([u[0],b]);const w=Number.parseFloat(b);let S=!1;if(!Number.isNaN(w)&&w>s[0]){if(w!==s[1]){const _=[s[0],w];a(_),c(_),o(t,_,r,i)}}else S=!0;h([d[0],S])},m=()=>{const y=e.colorRecords,b=y[0].value,w=y[y.length-1].value,S=[b,w];a(S),c(S),o(t,S,r,i),h([!1,!1])},v=(y,b)=>{o(t,n,b?"log":"lin",i)};return O.jsxs(bt,{sx:vy.container,children:[O.jsxs(bt,{sx:vy.header,children:[O.jsx(mn,{sx:vy.title,children:Ce.get("Value Range")}),O.jsx("span",{style:{flexGrow:1}}),e.colorRecords&&O.jsx(Vl,{sx:{marginRight:1},icon:O.jsx(iDn,{}),onClick:m,tooltipText:Ce.get("Set min/max from color mapping values")}),O.jsx(oh,{sx:vy.logLabel,control:O.jsx(_n,{title:Ce.get("Logarithmic scaling"),children:O.jsx(uae,{checked:r==="log",onChange:v,size:"small"})}),label:O.jsx(mn,{variant:"body2",children:Ce.get("Log-scaled")}),labelPlacement:"start"})]}),O.jsx(bt,{sx:vy.sliderBox,children:O.jsx(lDn,{variableColorBarName:t,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),O.jsxs(bt,{component:"form",sx:vy.minMaxBox,children:[O.jsx(Ii,{sx:vy.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),O.jsx(Ii,{sx:vy.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>g(y)})]})]})}function r2e(e){return[e[0]+"",e[1]+""]}function uDn({variableColorBar:e,variableColorBarName:t,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:s}){const[a,l]=M.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return O.jsxs(O.Fragment,{children:[O.jsx(JIn,{colorBar:e,opacity:i,onClick:s}),O.jsx(rDn,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),O.jsx(Yw,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:O.jsx(cDn,{variableColorBar:e,variableColorBarName:t,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}const fDn=at(O.jsx("path",{d:"M12 4.81V19c-3.31 0-6-2.63-6-5.87 0-1.56.62-3.03 1.75-4.14zM6.35 7.56C4.9 8.99 4 10.96 4 13.13 4 17.48 7.58 21 12 21s8-3.52 8-7.87c0-2.17-.9-4.14-2.35-5.57L12 2z"}),"InvertColors"),dDn=at(O.jsx("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity"),f2={container:{display:"flex",alignItems:"center",justifyContent:"space-between"},settingsBar:{display:"flex",gap:"1px"},opacityContainer:{display:"flex",alignItems:"center"},opacityLabel:e=>({color:e.palette.text.secondary}),opacitySlider:{flexGrow:"1px",marginLeft:"10px",marginRight:"10px"}};function hDn({variableColorBarName:e,variableColorBarMinMax:t,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const s=()=>{const c=!r.isAlpha;e=j5({...r,isAlpha:c}),o(e,t,n,i)},a=()=>{const c=!r.isReversed;e=j5({...r,isReversed:c}),o(e,t,n,i)},l=(c,u)=>{o(e,t,n,u)};return O.jsxs(O.Fragment,{children:[O.jsx(bt,{sx:f2.container,children:O.jsxs(bt,{sx:f2.settingsBar,children:[O.jsx(_n,{arrow:!0,title:Ce.get("Hide small values"),children:O.jsx(oo,{value:"alpha",selected:r.isAlpha,onChange:s,size:"small",children:O.jsx(dDn,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Reverse"),children:O.jsx(oo,{value:"reverse",selected:r.isReversed,onChange:a,size:"small",children:O.jsx(fDn,{fontSize:"inherit"})})})]})}),O.jsxs(bt,{component:"div",sx:f2.opacityContainer,children:[O.jsx(bt,{component:"span",fontSize:"small",sx:f2.opacityLabel,children:Ce.get("Opacity")}),O.jsx(Kw,{min:0,max:1,value:i,step:.01,sx:f2.opacitySlider,onChange:l,size:"small"})]})]})}const pDn={colorBarGroupTitle:e=>({marginTop:e.spacing(2*MR),fontSize:"small",color:e.palette.text.secondary})};function Rtt({title:e,description:t}){return O.jsx(_n,{arrow:!0,title:t,placement:"left",children:O.jsx(bt,{sx:pDn.colorBarGroupTitle,children:e})})}const i2e=e=>({marginTop:e.spacing(MR),height:20,border:X8(e),cursor:"pointer"}),o2e={colorBarItem:e=>({...i2e(e)}),colorBarItemSelected:e=>({...i2e(e),borderColor:"blue"})};function wge({imageData:e,selected:t,onSelect:n,width:r,title:i}){let o=O.jsx("img",{src:e?`data:image/png;base64,${e}`:void 0,alt:e?"color bar":"error",width:"100%",height:"100%",onClick:n});return i&&(o=O.jsx(_n,{arrow:!0,title:i,placement:"left",children:o})),O.jsx(bt,{width:r||gP,sx:t?o2e.colorBarItemSelected:o2e.colorBarItem,children:o})}function gDn({colorBarGroup:e,selectedColorBarName:t,onSelectColorBar:n,images:r}){return O.jsxs(O.Fragment,{children:[O.jsx(Rtt,{title:e.title,description:e.description}),e.names.map(i=>O.jsx(wge,{title:i,imageData:r[i],selected:i===t,onSelect:()=>n(i)},i))]})}const Y8=at(O.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");function Itt(){const e=M.useRef(),t=M.useRef(()=>{e.current&&(e.current(),e.current=void 0)}),n=M.useRef(r=>{e.current=r});return M.useEffect(()=>t.current,[]),[t.current,n.current]}const mDn=at(O.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel"),vDn=at(O.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function yDn({anchorEl:e,markdownText:t,open:n,onClose:r}){return t?O.jsx(Yw,{anchorEl:e,open:n,onClose:r,children:O.jsx(fa,{sx:{width:"24rem",overflowY:"auto",fontSize:"smaller",padding:2},children:O.jsx(Bb,{text:t})})}):null}function Dtt({size:e,helpUrl:t}){const[n,r]=M.useState(null),i=M.useRef(null),o=$8(t),s=()=>{r(i.current)},a=()=>{r(null)};return O.jsxs(O.Fragment,{children:[O.jsx(Mn,{onClick:s,size:e,ref:i,children:O.jsx(iet,{fontSize:"inherit"})}),O.jsx(yDn,{anchorEl:n,open:!!n,onClose:a,markdownText:o})]})}const s2e={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function Q8({onDone:e,onCancel:t,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return O.jsxs(bt,{sx:s2e.container,children:[O.jsx(bt,{children:o&&O.jsx(Dtt,{size:i,helpUrl:o})}),O.jsxs(bt,{sx:s2e.doneCancel,children:[O.jsx(Mn,{onClick:e,color:"primary",disabled:n,size:i,children:O.jsx(vDn,{fontSize:"inherit"})}),O.jsx(Mn,{onClick:t,color:"primary",disabled:r,size:i,children:O.jsx(mDn,{fontSize:"inherit"})})]})]})}const gX={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},bDn=[["continuous","Contin.","Continuous color assignment, where each value represents a support point of a color gradient"],["stepwise","Stepwise","Stepwise color mapping where values are bounds of value ranges mapped to the same single color"],["categorical","Categ.","Values represent unique categories or indexes that are mapped to a color"]];function xDn({colorMapType:e,setColorMapType:t}){return O.jsx($6,{row:!0,value:e,onChange:(n,r)=>{t(r)},sx:gX.radioGroup,children:bDn.map(([n,r,i])=>O.jsx(_n,{arrow:!0,title:Ce.get(i),children:O.jsx(oh,{value:n,control:O.jsx(tO,{size:"small",sx:gX.radio}),label:O.jsx(bt,{component:"span",sx:gX.label,children:Ce.get(r)})})},n))})}function wDn({userColorBar:e,updateUserColorBar:t,selected:n,onSelect:r,onDone:i,onCancel:o}){const s=l=>{t({...e,code:l.currentTarget.value})},a=l=>{t({...e,type:l})};return O.jsxs(bt,{children:[O.jsx(wge,{imageData:e.imageData,title:e.errorMessage,selected:n,onSelect:r}),O.jsx(xDn,{colorMapType:e.type,setColorMapType:a}),O.jsx(Ii,{label:"Color mapping",placeholder:Rje,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:e.code,onChange:s,color:e.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),O.jsx(Q8,{onDone:i,onCancel:o,doneDisabled:!!e.errorMessage,size:"small",helpUrl:Ce.get("docs/color-mappings.en.md")})]})}const SDn=at(O.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),_Dn={container:{display:"flex",alignItems:"center",width:gP,height:Att,gap:MR,marginTop:MR}};function CDn({imageData:e,title:t,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:s}){const[a,l]=M.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!a;return O.jsxs(O.Fragment,{children:[O.jsxs(bt,{sx:_Dn.container,children:[O.jsx(wge,{imageData:e,selected:n,onSelect:o,width:gP-20,title:t}),O.jsx(Mn,{size:"small",onClick:c,children:O.jsx(SDn,{fontSize:"inherit"})})]}),O.jsx(Yw,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:a,onClose:u,children:O.jsxs(bt,{children:[O.jsx(Mn,{onClick:f,size:"small",disabled:s,children:O.jsx(dP,{fontSize:"inherit"})}),O.jsx(Mn,{onClick:d,size:"small",disabled:s,children:O.jsx(z8,{fontSize:"inherit"})})]})})]})}const ODn={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function EDn({colorBarGroup:e,selectedColorBarName:t,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:s,updateUserColorBars:a,storeSettings:l}){const[c,u]=M.useState({}),[f,d]=Itt(),h=M.useMemo(()=>r.findIndex(b=>b.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>a(r));const b=gh("ucb");i(b),u({action:"add",colorBarId:b})},g=b=>{d(()=>a(r)),u({action:"edit",colorBarId:b})},m=b=>{d(void 0),o(b)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return O.jsxs(O.Fragment,{children:[O.jsxs(bt,{sx:ODn.container,children:[O.jsx(Rtt,{title:Ce.get(e.title),description:Ce.get(e.description)}),O.jsx(Mn,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:O.jsx(Y8,{fontSize:"inherit"})})]}),r.map(b=>b.id===c.colorBarId&&h>=0?O.jsx(wDn,{userColorBar:b,updateUserColorBar:s,selected:b.id===t,onSelect:()=>n(b.id),onDone:v,onCancel:y},b.id):O.jsx(CDn,{imageData:b.imageData,title:b.errorMessage,disabled:!!c.action,selected:b.id===t,onSelect:()=>n(b.id),onEdit:()=>g(b.id),onRemove:()=>m(b.id)},b.id))]})}function TDn({variableColorBarName:e,variableColorBarMinMax:t,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:s,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{e=j5({...r,baseName:p}),o(e,t,n,i)};return O.jsx(O.Fragment,{children:s.groups.map(p=>p.title===Aje?O.jsx(EDn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):O.jsx(gDn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:s.images},p.title))})}const PDn={colorBarBox:e=>({marginTop:e.spacing(FN-2*MR),marginLeft:e.spacing(FN),marginRight:e.spacing(FN),marginBottom:e.spacing(FN)})};function kDn(e){const{colorBars:t,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s,...a}=e;return O.jsxs(bt,{sx:PDn.colorBarBox,children:[O.jsx(hDn,{...a}),O.jsx(TDn,{...a,colorBars:t,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s})]})}const NN={container:e=>({position:"absolute",zIndex:1e3,top:10,border:X8(e),borderRadius:"5px",boxShadow:"0 3px 3px 0 rgba(0, 0, 0, 0.2), 1px 4px 4px 1px rgba(0, 0, 0, 0.2)",backgroundColor:Vt(e.palette.background.default,.85),maxWidth:`${gP+20}px`,paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),paddingBottom:e.spacing(.5),paddingTop:e.spacing(.5)}),header:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",paddingBottom:.5},title:{fontSize:"0.8rem",fontWeight:"normal",wordBreak:"break-word",wordWrap:"break-word"},subTitle:{fontSize:"0.7rem",fontWeight:"lighter",wordBreak:"break-word",wordWrap:"break-word"}};function Ltt(e){const{datasetTitle:t,variableName:n,variableTitle:r,variableUnits:i,variableColorBar:o,style:s}=e,a=M.useRef(null),[l,c]=M.useState(null),u=()=>{c(a.current)},f=()=>{c(null)};if(!n)return null;const d=o.type==="categorical"||!i||i==="1"||i==="-"?r||n:`${r||n} (${i})`;return O.jsxs(bt,{sx:NN.container,style:s,ref:a,children:[O.jsxs(bt,{sx:NN.header,children:[O.jsx(mn,{sx:NN.title,variant:"subtitle1",color:"textPrimary",children:d}),t&&O.jsx(mn,{sx:NN.subTitle,variant:"subtitle2",color:"textSecondary",children:t})]}),o.type==="categorical"?O.jsx(KIn,{categories:o.colorRecords,onOpenColorBarEditor:u,...e}):O.jsx(uDn,{onOpenColorBarEditor:u,...e}),O.jsx(Yw,{anchorEl:l,open:!!l,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:O.jsx(kDn,{...e})})]})}const MDn=e=>({datasetTitle:WBe(e),variableName:iS(e),variableTitle:uIt(e),variableUnits:dIt(e),variableColorBarName:iU(e),variableColorBarMinMax:ZBe(e),variableColorBarNorm:t4e(e),variableColorBar:hle(e),variableOpacity:a4e(e),userColorBars:sS(e),colorBars:sU(e),style:{right:10}}),ADn={updateVariableColorBar:USn,addUserColorBar:FJe,removeUserColorBar:zJe,updateUserColorBar:jJe,updateUserColorBars:VJe,storeSettings:LJe},RDn=hr(MDn,ADn)(Ltt),IDn=e=>{const t=e.controlState.variableSplitPos;return{datasetTitle:HBe(e),variableName:t?fle(e):null,variableTitle:fIt(e),variableUnits:hIt(e),variableColorBarName:oU(e),variableColorBarMinMax:JBe(e),variableColorBarNorm:n4e(e),variableColorBar:i4e(e),variableOpacity:l4e(e),userColorBars:sS(e),colorBars:sU(e),style:{left:t?t-280:0}}},DDn={updateVariableColorBar:VSn,addUserColorBar:FJe,removeUserColorBar:zJe,updateUserColorBar:jJe,updateUserColorBars:VJe,storeSettings:LJe},LDn=hr(IDn,DDn)(Ltt),FDn={splitter:{position:"absolute",top:0,left:"50%",width:"6px",height:"100%",backgroundColor:"#ffffff60",zIndex:999,borderLeft:"0.5px solid #ffffffd0",borderRight:"0.5px solid #ffffffd0",cursor:"col-resize",boxShadow:"0px 0px 1px 0px black"}};function $Dn({hidden:e,position:t,updatePosition:n}){const r=M.useRef(null),i=M.useCallback(([s,a])=>{n(s,!0)},[n]),o=Ttt({onDragMove:i});return M.useEffect(()=>{!e&&!Fr(t)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[e,t,n]),e?null:O.jsx("div",{id:"MapSplitter",ref:r,style:{...FDn.splitter,left:Fr(t)?t:"50%"},onMouseDown:o})}const NDn=e=>({hidden:!e.controlState.variableCompareMode,position:e.controlState.variableSplitPos}),zDn={updatePosition:a_n},jDn=hr(NDn,zDn)($Dn);function BDn(e,t,n,r,i,o,s){const a=M.useRef(0),[l,c]=M.useState(),[u,f]=M.useState(),[d,h]=M.useState();M.useEffect(()=>{!i&&!o&&h(void 0)},[i,o]);const p=M.useCallback(async(v,y,b,w,S)=>{S({dataset:v,variable:y,result:{fetching:!0}});try{const _=await CEt(t,v,y,b,w,s,null);S({dataset:v,variable:y,result:{value:_.value}})}catch(_){S({dataset:v,variable:y,result:{error:_}})}},[t,s]),g=M.useCallback(v=>{const y=v.map;if(!e||!n||!r||!y){f(void 0),h(void 0);return}const b=v.pixel[0],w=v.pixel[1],S=V6(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),_=S[0],E=S[1];c({pixelX:b,pixelY:w,lon:_,lat:E});const T=new Date().getTime();T-a.current>=500&&(a.current=T,p(n,r,_,E,f).finally(()=>{i&&o&&p(i,o,_,E,h)}))},[p,e,n,r,i,o]),m=Qs.map;return M.useEffect(()=>{if(e&&m){const v=y=>{y.dragging?c(void 0):g(y)};return m.on("pointermove",v),()=>{m.un("pointermove",v)}}else c(void 0)},[e,m,g]),M.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const Qg={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function UDn({location:e,payload:t,payload2:n}){const r=M.useMemo(()=>n?"(R) "+mX(t):mX(t),[t,n]);return O.jsxs(bt,{sx:Qg.container,children:[O.jsx(bt,{sx:Qg.labelItem,children:"Longitude"}),O.jsx(bt,{sx:Qg.valueItem,children:jf(e.lon,4)}),O.jsx(bt,{sx:Qg.labelItem,children:"Latitude"}),O.jsx(bt,{sx:Qg.valueItem,children:jf(e.lat,4)}),O.jsx(bt,{sx:Qg.labelItem,children:r}),O.jsx(bt,{sx:Qg.valueItem,children:a2e(t)}),n&&O.jsx(bt,{sx:Qg.labelItem,children:"(L) "+mX(n)}),n&&O.jsx(bt,{sx:Qg.valueItem,children:a2e(n)})]})}function mX(e){const t=e.variable;return t.title||t.name}function a2e(e){const t=e.result;return t.error?`${t.error}`:t.fetching?"...":Fr(t.value)?jf(t.value,4):"---"}const VDn={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function WDn({enabled:e,serverUrl:t,dataset1:n,variable1:r,dataset2:i,variable2:o,time:s}){const a=BDn(e,t,n,r,i,o,s);if(!a)return null;const{pixelX:l,pixelY:c}=a.location;return O.jsx(bt,{sx:{...VDn.container,left:l,top:c},children:O.jsx(UDn,{...a})})}const HDn=e=>({enabled:e.controlState.mapPointInfoBoxEnabled,serverUrl:Go(e).url,dataset1:Co(e),variable1:ec(e),dataset2:Sv(e),variable2:_v(e),time:aS(e)}),GDn={},qDn=hr(HDn,GDn)(WDn),XDn=at(O.jsx("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare"),Ftt=at(O.jsx("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers"),YDn=at(O.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Message"),l2e={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function QDn({style:e,sx:t,children:n}){return O.jsx(bt,{className:"ol-unselectable ol-control",sx:t,style:e?{...l2e,...e}:l2e,children:n})}function Yz({icon:e,tooltipTitle:t,onClick:n,selected:r,onSelect:i,className:o}){const s=a=>{i&&i(a,!r),n&&n(a)};return t&&(e=O.jsx(_n,{title:t,children:e})),O.jsx(Mn,{className:o,onClick:s,"data-selected":r,children:e})}const $tt=at([O.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),O.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt");function KDn(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const ZDn=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function L0(e){const t=[];for(let n=0,r=e.length;neu||e.height>eu)&&(e.width>eu&&e.height>eu?e.width>e.height?(e.height*=eu/e.width,e.width=eu):(e.width*=eu/e.height,e.height=eu):e.width>eu?(e.height*=eu/e.width,e.width=eu):(e.width*=eu/e.height,e.height=eu))}function ZB(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function rLn(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function iLn(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(e),rLn(i)}const Ac=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Ac(n,t)};function oLn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function sLn(e,t){return Ntt(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function aLn(e,t,n,r){const i=`.${e}:${t}`,o=n.cssText?oLn(n):sLn(n,r);return document.createTextNode(`${i}{${o}}`)}function c2e(e,t,n,r){const i=window.getComputedStyle(e,n),o=i.getPropertyValue("content");if(o===""||o==="none")return;const s=ZDn();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(aLn(s,n,i,r)),t.appendChild(a)}function lLn(e,t,n){c2e(e,t,":before",n),c2e(e,t,":after",n)}const u2e="application/font-woff",f2e="image/jpeg",cLn={woff:u2e,woff2:u2e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:f2e,jpeg:f2e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function uLn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Sge(e){const t=uLn(e).toLowerCase();return cLn[t]||""}function fLn(e){return e.split(/,/)[1]}function iie(e){return e.search(/^(data:)/)!==-1}function dLn(e,t){return`data:${t};base64,${e}`}async function jtt(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,s)=>{const a=new FileReader;a.onerror=s,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(l){s(l)}},a.readAsDataURL(i)})}const vX={};function hLn(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function _ge(e,t,n){const r=hLn(e,t,n.includeQueryParams);if(vX[r]!=null)return vX[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const o=await jtt(e,n.fetchRequestInit,({res:s,result:a})=>(t||(t=s.headers.get("Content-Type")||""),fLn(a)));i=dLn(o,t)}catch(o){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${e}`;o&&(s=typeof o=="string"?o:o.message),s&&console.warn(s)}return vX[r]=i,i}async function pLn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ZB(t)}async function gLn(e,t){if(e.currentSrc){const o=document.createElement("canvas"),s=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,s?.drawImage(e,0,0,o.width,o.height);const a=o.toDataURL();return ZB(a)}const n=e.poster,r=Sge(n),i=await _ge(n,r,t);return ZB(i)}async function mLn(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await K8(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function vLn(e,t){return Ac(e,HTMLCanvasElement)?pLn(e):Ac(e,HTMLVideoElement)?gLn(e,t):Ac(e,HTMLIFrameElement)?mLn(e,t):e.cloneNode(Btt(e))}const yLn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Btt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function bLn(e,t,n){var r,i;if(Btt(t))return t;let o=[];return yLn(e)&&e.assignedNodes?o=L0(e.assignedNodes()):Ac(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?o=L0(e.contentDocument.body.childNodes):o=L0(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),o.length===0||Ac(e,HTMLVideoElement)||await o.reduce((s,a)=>s.then(()=>K8(a,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function xLn(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Ntt(n).forEach(o=>{let s=i.getPropertyValue(o);o==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),Ac(e,HTMLIFrameElement)&&o==="display"&&s==="inline"&&(s="block"),o==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),r.setProperty(o,s,i.getPropertyPriority(o))})}function wLn(e,t){Ac(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Ac(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function SLn(e,t){if(Ac(e,HTMLSelectElement)){const r=Array.from(t.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function _Ln(e,t,n){return Ac(t,Element)&&(xLn(e,t,n),lLn(e,t,n),wLn(e,t),SLn(e,t)),t}async function CLn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let o=0;ovLn(r,t)).then(r=>bLn(e,r,t)).then(r=>_Ln(e,r,t)).then(r=>CLn(r,t))}const Utt=/url\((['"]?)([^'"]+?)\1\)/g,OLn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ELn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function TLn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function PLn(e){const t=[];return e.replace(Utt,(n,r,i)=>(t.push(i),n)),t.filter(n=>!iie(n))}async function kLn(e,t,n,r,i){try{const o=n?KDn(t,n):t,s=Sge(t);let a;return i||(a=await _ge(o,s,r)),e.replace(TLn(t),`$1${a}$3`)}catch{}return e}function MLn(e,{preferredFontFormat:t}){return t?e.replace(ELn,n=>{for(;;){const[r,,i]=OLn.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Vtt(e){return e.search(Utt)!==-1}async function Wtt(e,t,n){if(!Vtt(e))return e;const r=MLn(e,n);return PLn(r).reduce((o,s)=>o.then(a=>kLn(a,s,t,n)),Promise.resolve(r))}async function j_(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const o=await Wtt(i,null,n);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function ALn(e,t){await j_("background",e,t)||await j_("background-image",e,t),await j_("mask",e,t)||await j_("-webkit-mask",e,t)||await j_("mask-image",e,t)||await j_("-webkit-mask-image",e,t)}async function RLn(e,t){const n=Ac(e,HTMLImageElement);if(!(n&&!iie(e.src))&&!(Ac(e,SVGImageElement)&&!iie(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await _ge(r,Sge(r),t);await new Promise((o,s)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...l)=>{try{o(t.onImageErrorHandler(...l))}catch(c){s(c)}}:s;const a=e;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function ILn(e,t){const r=L0(e.childNodes).map(i=>Htt(i,t));await Promise.all(r).then(()=>e)}async function Htt(e,t){Ac(e,Element)&&(await ALn(e,t),await RLn(e,t),await ILn(e,t))}function DLn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const d2e={};async function h2e(e){let t=d2e[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},d2e[e]=t,t}async function p2e(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),jtt(a,t.fetchRequestInit,({result:l})=>(n=n.replace(s,`url(${l})`),[s,l]))});return Promise.all(o).then(()=>n)}function g2e(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(s,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=a.exec(r),l===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;t.push(l[0])}return t}async function LLn(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{L0(i.cssRules||[]).forEach((o,s)=>{if(o.type===CSSRule.IMPORT_RULE){let a=s+1;const l=o.href,c=h2e(l).then(u=>p2e(u,t)).then(u=>g2e(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?a+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(o){const s=e.find(a=>a.href==null)||document.styleSheets[0];i.href!=null&&r.push(h2e(i.href).then(a=>p2e(a,t)).then(a=>g2e(a).forEach(l=>{s.insertRule(l,s.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{L0(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function FLn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Vtt(t.style.getPropertyValue("src")))}async function $Ln(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=L0(e.ownerDocument.styleSheets),r=await LLn(n,t);return FLn(r)}function Gtt(e){return e.trim().replace(/["']/g,"")}function NLn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(o=>{t.add(Gtt(o))}),Array.from(r.children).forEach(o=>{o instanceof HTMLElement&&n(o)})}return n(e),t}async function zLn(e,t){const n=await $Ln(e,t),r=NLn(e);return(await Promise.all(n.filter(o=>r.has(Gtt(o.style.fontFamily))).map(o=>{const s=o.parentStyleSheet?o.parentStyleSheet.href:null;return Wtt(o.cssText,s,t)}))).join(` +`)}async function jLn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await zLn(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function BLn(e,t={}){const{width:n,height:r}=ztt(e,t),i=await K8(e,t,!0);return await jLn(i,t),await Htt(i,t),DLn(i,t),await iLn(i,n,r)}async function ULn(e,t={}){const{width:n,height:r}=ztt(e,t),i=await BLn(e,t),o=await ZB(i),s=document.createElement("canvas"),a=s.getContext("2d"),l=t.pixelRatio||tLn(),c=t.canvasWidth||n,u=t.canvasHeight||r;return s.width=c*l,s.height=u*l,t.skipAutoScale||nLn(s),s.style.width=`${c}`,s.style.height=`${u}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}function VLn(e,t){WLn(e,t).then(()=>{t?.handleSuccess&&t.handleSuccess()}).catch(n=>{if(t?.handleError)t.handleError(n);else throw n})}async function WLn(e,t){const n=t.format||"png";let r=t.hiddenElements;typeof r=="function"?r=r(e):Array.isArray(r)||(r=[]),r.forEach(f=>{f.style.visibility="hidden"});const s=t.exportResolution/96,a=t.width||e.clientWidth,l=t.height||e.clientHeight,c=await ULn(e,{width:a*s,height:l*s,style:{transform:`scale(${s})`,transformOrigin:"top left",width:`${a}px`,height:`${l}px`},pixelRatio:1,canvasWidth:a*s,canvasHeight:l*s,backgroundColor:"#00000000",skipFonts:!0}),u=await new Promise((f,d)=>{c.toBlob(h=>{h===null?d(new Error("Failed to create a blob from the canvas.")):f(h)},`image/${n}`)});await navigator.clipboard.write([new ClipboardItem({[u.type]:u})]),r.forEach(f=>{f.style.visibility="visible"})}function qtt(e,t){const{postMessage:n,hiddenElements:r,exportResolution:i}=t,o=M.useCallback(()=>{n("success",Ce.get("Snapshot copied to clipboard"))},[n]),s=M.useCallback(l=>{const c="Error copying snapshot to clipboard";console.error(c+":",l),n("error",Ce.get(c))},[n]);return{onSnapshotClick:M.useCallback(()=>{e.current?VLn(e.current,{format:"png",handleSuccess:o,handleError:s,hiddenElements:r,exportResolution:i}):s(new Error("missing element reference"))},[e,o,s,r,i])}}function HLn({postMessage:e,exportResolution:t,hiddenElementItems:n=[],className:r}){const i=aSn(),s={hiddenElements:l=>MZe(l,n),postMessage:e,exportResolution:t},{onSnapshotClick:a}=qtt(i,s);return O.jsx(Yz,{className:r,icon:O.jsx($tt,{fontSize:"small"}),tooltipTitle:Ce.get("Copy snapshot to clipboard"),onClick:a})}const GLn={left:"0.5em",top:75};function qLn({layerMenuOpen:e,setLayerMenuOpen:t,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o,postMessage:s,exportResolution:a}){return O.jsxs(QDn,{style:GLn,children:[O.jsx(Yz,{className:"layer-panel",icon:O.jsx(Ftt,{fontSize:"small"}),tooltipTitle:Ce.get("Show or hide layers panel"),selected:e,onSelect:(l,c)=>{t(c)}}),O.jsx(Yz,{className:"split-mode",icon:O.jsx(XDn,{fontSize:"small"}),tooltipTitle:Ce.get("Turn layer split mode on or off"),selected:n,onSelect:(l,c)=>{r(c)}}),O.jsx(Yz,{className:"info-box",icon:O.jsx(YDn,{fontSize:"small"}),tooltipTitle:Ce.get("Turn info box on or off"),selected:i,onSelect:(l,c)=>{o(c)}}),O.jsx(HLn,{className:"snapshot-button",postMessage:s,exportResolution:a,hiddenElementItems:[".ol-unselectable.ol-control.MuiBox-root.css-0",".ol-zoom.ol-unselectable.ol-control"]})]})}const XLn=e=>({layerMenuOpen:e.controlState.layerMenuOpen,variableCompareMode:e.controlState.variableCompareMode,mapPointInfoBoxEnabled:e.controlState.mapPointInfoBoxEnabled,exportResolution:e.controlState.exportResolution}),YLn={setLayerMenuOpen:SJe,setVariableCompareMode:s_n,setMapPointInfoBoxEnabled:o_n,postMessage:la},QLn=hr(XLn,YLn)(qLn),d2={container:e=>({position:"absolute",zIndex:1e3,border:X8(e),borderRadius:"4px",backgroundColor:Vt(e.palette.background.default,.85),minWidth:"120px",paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),paddingBottom:e.spacing(.5),paddingTop:e.spacing(.5),display:"flex",flexDirection:"row",justifyContent:"space-between",gap:1}),title:{fontSize:"0.8rem",fontWeight:"normal",wordBreak:"break-word",wordWrap:"break-word"},subTitle:{fontSize:"0.7rem",fontWeight:"lighter",wordBreak:"break-word",wordWrap:"break-word"}};function KLn({style:e,zoomLevel:t,datasetLevel:n,datasetLevels:r,visibility:i}){return i?O.jsx("div",{children:O.jsxs(bt,{sx:d2.container,style:e,children:[O.jsxs(bt,{children:[O.jsx(mn,{sx:d2.title,variant:"subtitle1",color:"textPrimary",children:"Zoom"}),O.jsx(mn,{sx:d2.subTitle,variant:"subtitle2",color:"textPrimary",children:t!==void 0?jf(t,4):"no zoom level"})]}),O.jsx(sa,{orientation:"vertical",flexItem:!0}),O.jsxs(bt,{children:[O.jsx(mn,{sx:d2.title,variant:"subtitle1",color:"textPrimary",children:"Level"}),O.jsx(mn,{sx:d2.subTitle,variant:"subtitle2",color:"textPrimary",children:n!==void 0?jf(n+1,0)+" / "+jf(r,0):"no dataset level"})]})]})}):null}const ZLn=e=>({style:{left:"0.5em",bottom:40},zoomLevel:XRt(e),datasetLevel:cIt(e),datasetLevels:GBe(e).length,visibility:e.controlState.showZoomInfoBox}),JLn={setZoomLevel:WJe},eFn=hr(ZLn,JLn)(KLn),tFn=(e,t)=>({mapId:"map",locale:e.controlState.locale,variableLayer:NIt(e),variable2Layer:zIt(e),rgbLayer:jIt(e),rgb2Layer:BIt(e),datasetBoundaryLayer:$It(e),placeGroupLayers:HIt(e),colorBarLegend:O.jsx(RDn,{}),colorBarLegend2:O.jsx(LDn,{}),mapSplitter:O.jsx(jDn,{}),mapPointInfoBox:O.jsx(qDn,{}),mapControlActions:O.jsx(QLn,{}),userDrawnPlaceGroupName:e.controlState.userDrawnPlaceGroupName,userPlaceGroups:uD(e),userPlaceGroupsVisibility:bIt(e),showUserPlaces:BBe(e),mapInteraction:e.controlState.mapInteraction,mapProjection:wv(e),selectedPlaceId:e.controlState.selectedPlaceId,places:pD(e),baseMapLayers:ZIt(e),overlayLayers:JIt(e),imageSmoothing:dD(e),variableSplitPos:e.controlState.variableSplitPos,onMapRef:t.onMapRef,showProgressBar:e.controlState.showProgressBar,zoomBox:O.jsx(eFn,{})}),nFn={addDrawnUserPlace:xSn,importUserPlacesFromText:LZe,selectPlace:L8,setZoomLevel:WJe,setDatasetZLevel:x_n},rFn=hr(tFn,nFn)(HIn),iFn=at(O.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"}),"Details"),oFn=at(O.jsx("path",{d:"m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99z"}),"StackedLineChart"),sFn=at(O.jsx("path",{d:"M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95s.33.5.56.69c.24.18.51.32.82.41q.45.15.96.15c.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72.2-.61.2-.97c0-.19-.02-.38-.07-.56s-.12-.35-.23-.51c-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33s.27-.27.37-.42.17-.3.22-.46.07-.32.07-.48q0-.54-.18-.96t-.51-.69c-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3q0-.255.09-.45c.09-.195.14-.25.25-.34s.23-.17.38-.22.3-.08.48-.08c.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49s-.14.27-.25.37-.25.18-.41.24-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4s.1.35.1.57c0 .41-.12.72-.35.93-.23.23-.55.33-.95.33m8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27s.84-.43 1.16-.76.57-.73.74-1.19c.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57q-.27-.705-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85s-.43.41-.71.53q-.435.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0"}),"ThreeDRotation"),aFn=({contribution:e,panelIndex:t})=>{const n=e.componentResult;return n.status==="pending"?O.jsx(Ch,{},e.name):n.error?O.jsx("div",{children:O.jsx(mn,{color:"error",children:n.error.message})},e.name):e.component?O.jsx(B4e,{...e.component,onChange:r=>{GDt("panels",t,r)}},e.name):null};function lFn(e){return e.filter(cFn).map(uFn).sort(fFn)}function cFn(e){return!!e.content&&!e.hidden}function uFn(e,t){return!Fr(e.position)||e.position<0?{...e,position:t}:e}function fFn(e,t){if(Fr(e.position))if(Fr(t.position)){const r=e.position-t.position;if(r!==0)return r}else return-1;else if(Fr(t.position))return 1;const n=e.title.localeCompare(t.title);return n===0?e.id.localeCompare(t.id):n}function dFn({hidden:e,panels:t,selectedPanelId:n,setSelectedPanelId:r}){const i=M.useMemo(()=>lFn(t||[]),[t]);return e?null:O.jsx(bt,{sx:z1.sidebarContainer,children:i.map(o=>O.jsx(Vl,{sx:o.id===n?z1.sidebarButtonSelected:z1.sidebarButton,disabled:o.disabled,icon:o.icon,tooltipText:o.tooltip||o.title,tooltipPlacement:"left",selected:o.id===n,onClick:()=>r(o.id!==n?o.id:null)},o.id))})}function hFn({selectedPanel:e}){return O.jsx(bt,{sx:z1.panelHeader,children:O.jsx(mn,{variant:"subtitle2",color:"textSecondary",sx:{textTransform:"uppercase",fontWeight:"normal"},children:e?.title})})}function pFn({selectedPanel:e}){return O.jsx(bt,{sx:z1.panelContent,children:e?.content})}function gFn({width:e,height:t,panels:n,selectedPanelId:r,setSelectedPanelId:i}){const o=M.useMemo(()=>n&&n.find(s=>s.id===r),[n,r]);return O.jsxs(bt,{width:e||"100%",height:t||"100%",sx:z1.mainContainer,children:[r&&O.jsxs(bt,{sx:z1.panelContainer,children:[O.jsx(hFn,{selectedPanel:o}),O.jsx(pFn,{selectedPanel:o})]}),O.jsx(dFn,{panels:n,selectedPanelId:r,setSelectedPanelId:i})]})}const Eu={accordion:{border:"none",background:"none"},accordionSummary:{padding:"0 4px"},accordionDetails:{padding:"0 4px",display:"flex",flexDirection:"column",gap:1},cardHeader:{padding:0},cardTitle:{display:"flex",gap:1,fontSize:"1rem"},cardContent:{padding:"4px 0"},table:{borderRadius:0},media:{maxHeight:200},code:{fontFamily:"Monospace"},toggleButton:{},htmlContent:e=>({background:e.palette.mode==="dark"?"#383838":"#e0e0e0",padding:1,fontFamily:"Roboto",fontSize:"0.75rem"})};function oie(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function mFn(e,t){const n=yFn(t.id);return["from xcube.core.store import new_data_store","","store = new_data_store(",' "s3",',' root="datasets", # can also use "pyramids" here'," storage_options={",' "anon": True,',' "client_kwargs": {',` "endpoint_url": "${e.url}/s3"`," }"," }",")","# store.list_data_ids()",`dataset = store.open_data(data_id="${n}")`].join(` +`)}function vFn(e,t,n){const r=t.name,i=t.colorBarMin,o=t.colorBarMax,s=t.colorBarName;let a="";n!==null&&(a=`sel(time="${yT(n)}", method="nearest")`);const l=[];if(tD(t)){const c=t.expression;l.push("from xcube.util.expression import compute_array_expr"),l.push("from xcube.util.expression import new_dataset_namespace"),l.push(""),l.push("namespace = new_dataset_namespace(dataset)"),l.push(`${r} = compute_array_expr("${c}", namespace`),a&&l.push(`${r} = ${r}.${a}`)}else a?l.push(`${r} = dataset.${r}.${a}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${s}")`),l.join(` +`)}function yFn(e){return bFn(e)[0]+".zarr"}function bFn(e){const t=e.lastIndexOf(".");return t>=0?[e.substring(0,t),e.substring(t)]:[e,""]}function xFn(e){return typeof e=="string"?e:typeof e=="object"?JSON.stringify(e):`${e}`}const wFn={keyValueTableContainer:e=>({background:e.palette.mode==="dark"?"#181818":"#f0f0f0"})},AR=({data:e,types:t})=>O.jsx(fae,{sx:wFn.keyValueTableContainer,children:O.jsx(N6,{sx:Eu.table,size:"small",children:O.jsx(j6,{children:e.map((n,r)=>{const[i,o]=n,s=xFn(o),a=typeof o=="string"&&s.startsWith("https://");return O.jsxs(hf,{children:[O.jsx(mi,{children:i}),t&&O.jsx(mi,{children:Array.isArray(o)?"array":typeof o}),O.jsx(mi,{align:"right",children:a?O.jsx(axt,{href:s,target:"_blank",rel:"noreferrer",children:s}):s})]},r)})})})}),Xtt=1024;let SFn=0,yX=class{constructor(t,n){this.from=t,this.to=n}};class br{constructor(t={}){this.id=SFn++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Vc.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}br.closedBy=new br({deserialize:e=>e.split(" ")});br.openedBy=new br({deserialize:e=>e.split(" ")});br.group=new br({deserialize:e=>e.split(" ")});br.isolate=new br({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});br.contextHash=new br({perNode:!0});br.lookAhead=new br({perNode:!0});br.mounted=new br({perNode:!0});class iA{constructor(t,n,r,i=!1){this.tree=t,this.overlay=n,this.parser=r,this.bracketed=i}static get(t){return t&&t.props&&t.props[br.mounted.id]}}const _Fn=Object.create(null);class Vc{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):_Fn,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new Vc(t.name||"",n,t.id,r);if(t.props){for(let o of t.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(br.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(br.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Vc.none=new Vc("",Object.create(null),0,8);class Cge{constructor(t){this.types=t;for(let n=0;n0;for(let l=this.cursor(s|Po.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Tge(Vc.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new rs(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new rs(Vc.none,n,r,i)))}static build(t){return TFn(t)}}rs.empty=new rs(Vc.none,[],[],0);class Oge{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Oge(this.buffer,this.index)}}class ab{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return Vc.none}toString(){let t=[];for(let n=0;n0));l=s[l+3]);return a}slice(t,n,r){let i=this.buffer,o=new Uint16Array(n-t),s=0;for(let a=t,l=0;a=t&&nt;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function RR(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?a.length:-1;t!=c;t+=n){let u=a[t],f=l[t]+s.from,d;if(!(!(o&Po.EnterBracketed&&u instanceof rs&&(d=iA.get(u))&&!d.overlay&&d.bracketed&&r>=f&&r<=f+u.length)&&!Ytt(i,r,f,f+u.length))){if(u instanceof ab){if(o&Po.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,r-f,i);if(h>-1)return new Tp(new CFn(s,u,t,f),null,h)}else if(o&Po.IncludeAnonymous||!u.type.isAnonymous||Ege(u)){let h;if(!(o&Po.IgnoreMounts)&&(h=iA.get(u))&&!h.overlay)return new Rc(h.tree,f,t,s);let p=new Rc(u,f,t,s);return o&Po.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,r,i,o)}}}if(o&Po.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?t=s.index+n:t=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&Po.IgnoreOverlays)&&(i=iA.get(this._tree))&&i.overlay){let o=t-this.from,s=r&Po.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((n>0||s?a<=o:a=o:l>o))return new Rc(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function v2e(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function sie(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class CFn{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class Tp extends Qtt{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new Tp(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&Po.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return o<0?null:new Tp(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Tp(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Tp(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];t.push(r.slice(i,o,s)),n.push(0)}return new rs(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ktt(e){if(!e.length)return null;let t=0,n=e[0];for(let o=1;on.from||s.to=t){let a=new Rc(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(RR(a,t,n,!1))}}return i?Ktt(i):r}class aie{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Po.EnterBracketed,t instanceof Rc)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof Rc?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&Po.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Po.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Po.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index-1)for(let o=n+t,s=t<0?-1:r._tree.children.length;o!=s;o+=t){let a=r._tree.children[o];if(this.mode&Po.IncludeAnonymous||a instanceof ab||!a.type.isAnonymous||Ege(a))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let s=t;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return sie(this._tree,t,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(t[i]&&t[i]!=s.name)return!1;i--}}return!0}}function Ege(e){return e.children.some(t=>t instanceof ab||!t.type.isAnonymous||Ege(t))}function TFn(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=Xtt,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new Oge(n,n.length):n,l=r.types,c=0,u=0;function f(S,_,E,T,k,P){let{id:I,start:R,end:F,size:A}=a,L=u,$=c;if(A<0)if(a.next(),A==-1){let N=o[I];E.push(N),T.push(R-S);return}else if(A==-3){c=I;return}else if(A==-4){u=I;return}else throw new RangeError(`Unrecognized record size: ${A}`);let j=l[I],V,U,z=R-S;if(F-R<=i&&(U=m(a.pos-_,k))){let N=new Uint16Array(U.size-U.skip),B=a.pos-U.size,H=N.length;for(;a.pos>B;)H=v(U.start,N,H);V=new ab(N,F-U.start,r),z=U.start-S}else{let N=a.pos-A;a.next();let B=[],H=[],Q=I>=s?I:-1,Y=0,Z=F;for(;a.pos>N;)Q>=0&&a.id==Q&&a.size>=0?(a.end<=Z-i&&(p(B,H,R,Y,a.end,Z,Q,L,$),Y=B.length,Z=a.end),a.next()):P>2500?d(R,N,B,H):f(R,N,B,H,Q,P+1);if(Q>=0&&Y>0&&Y-1&&Y>0){let ge=h(j,$);V=Tge(j,B,H,0,B.length,0,F-R,ge,ge)}else V=g(j,B,H,F-R,L-F,$)}E.push(V),T.push(z)}function d(S,_,E,T){let k=[],P=0,I=-1;for(;a.pos>_;){let{id:R,start:F,end:A,size:L}=a;if(L>4)a.next();else{if(I>-1&&F=0;A-=3)R[L++]=k[A],R[L++]=k[A+1]-F,R[L++]=k[A+2]-F,R[L++]=L;E.push(new ab(R,k[2]-F,r)),T.push(F-S)}}function h(S,_){return(E,T,k)=>{let P=0,I=E.length-1,R,F;if(I>=0&&(R=E[I])instanceof rs){if(!I&&R.type==S&&R.length==k)return R;(F=R.prop(br.lookAhead))&&(P=T[I]+R.length+F)}return g(S,E,T,k,P,_)}}function p(S,_,E,T,k,P,I,R,F){let A=[],L=[];for(;S.length>T;)A.push(S.pop()),L.push(_.pop()+E-k);S.push(g(r.types[I],A,L,P-k,R-P,F)),_.push(k-E)}function g(S,_,E,T,k,P,I){if(P){let R=[br.contextHash,P];I=I?[R].concat(I):[R]}if(k>25){let R=[br.lookAhead,k];I=I?[R].concat(I):[R]}return new rs(S,_,E,T,I)}function m(S,_){let E=a.fork(),T=0,k=0,P=0,I=E.end-i,R={size:0,start:0,skip:0};e:for(let F=E.pos-S;E.pos>F;){let A=E.size;if(E.id==_&&A>=0){R.size=T,R.start=k,R.skip=P,P+=4,T+=4,E.next();continue}let L=E.pos-A;if(A<0||L=s?4:0,j=E.start;for(E.next();E.pos>L;){if(E.size<0)if(E.size==-3||E.size==-4)$+=4;else break e;else E.id>=s&&($+=4);E.next()}k=j,T+=A,P+=$}return(_<0||T==S)&&(R.size=T,R.start=k,R.skip=P),R.size>4?R:void 0}function v(S,_,E){let{id:T,start:k,end:P,size:I}=a;if(a.next(),I>=0&&T4){let F=a.pos-(I-4);for(;a.pos>F;)E=v(S,_,E)}_[--E]=R,_[--E]=P-S,_[--E]=k-S,_[--E]=T}else I==-3?c=T:I==-4&&(u=T);return E}let y=[],b=[];for(;a.pos>0;)f(e.start||0,e.bufferStart||0,y,b,-1,0);let w=(t=e.length)!==null&&t!==void 0?t:y.length?b[0]+y[0].length:0;return new rs(l[e.topID],y.reverse(),b.reverse(),w)}const y2e=new WeakMap;function Qz(e,t){if(!e.isAnonymous||t instanceof ab||t.type!=e)return 1;let n=y2e.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof rs)){n=1;break}n+=Qz(e,r)}y2e.set(t,n)}return n}function Tge(e,t,n,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;_+=E}if(b==w+1){if(_>u){let E=p[w];h(E.children,E.positions,0,E.children.length,g[w]+y);continue}f.push(p[w])}else{let E=g[b-1]+p[b-1].length-S;f.push(Tge(e,p,g,w,b,S,E,null,l))}d.push(S+y-o)}}return h(t,n,r,i,0),(a||l)(f,d,s)}class PFn{constructor(){this.map=new WeakMap}setBuffer(t,n,r){let i=this.map.get(t);i||this.map.set(t,i=new Map),i.set(n,r)}getBuffer(t,n){let r=this.map.get(t);return r&&r.get(n)}set(t,n){t instanceof Tp?this.setBuffer(t.context.buffer,t.index,n):t instanceof Rc&&this.map.set(t.tree,n)}get(t){return t instanceof Tp?this.getBuffer(t.context.buffer,t.index):t instanceof Rc?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class j1{constructor(t,n,r,i,o=!1,s=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new j1(0,t.length,t,0,!1,r)];for(let o of n)o.to>t.length&&i.push(o);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],o=1,s=t.length?t[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.from=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new j1(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=onew yX(i.from,i.to)):[new yX(0,0)]:[new yX(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let o=i.advance();if(o)return o}}}class kFn{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new br({perNode:!0});var b2e={};class JB{constructor(t,n,r,i,o,s,a,l,c,u=0,f){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new JB(t,[],n,r,r,0,[],0,i?new x2e(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:o}=this.p,s=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}storeNode(t,n,r,i=4,o=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(t,n,r,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=t,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let o=t,{parser:s}=this.p;this.pos=i;let a=s.stateFlag(o,1);!a&&(i>r||n<=s.maxNode)&&(this.reducePos=i),this.pushState(o,a?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new JB(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new MFn(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;ol&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i>19,i=n&65535,o=this.stack.length-r*3;if(o<0||t.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),t.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&t.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class x2e{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class MFn{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class e4{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e4(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e4(this.stack,this.pos,this.index)}}function jN(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class Kz{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const w2e=new Kz;class AFn{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=w2e,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,o=this.pos+t;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=w2e,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class bO{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;RFn(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}bO.prototype.contextual=bO.prototype.fallback=bO.prototype.extend=!1;bO.prototype.fallback=bO.prototype.extend=!1;class Z8{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function RFn(e,t,n,r,i,o){let s=0,a=1<0){let p=e[h];if(l.allows(p)&&(t.token.value==-1||t.token.value==p||IFn(p,t.token.value,i,o))){t.acceptToken(p);break}}let u=t.next,f=0,d=e[s+2];if(t.next<0&&d>f&&e[c+d*3-3]==65535){s=e[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),g=e[p],m=e[p+1]||65536;if(u=m)f=h+1;else{s=e[p+2],t.advance();continue e}}break}}function S2e(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function IFn(e,t,n,r){let i=S2e(n,r,t);return i<0||S2e(n,r,e)t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class DFn{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?_2e(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?_2e(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=s,null;if(o instanceof rs){if(s==t){if(s=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class LFn{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new Kz)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:o}=i,s=i.stateSlot(t.state,3),a=t.curContext?t.curContext.hash:0,l=0;for(let c=0;cf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!u.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&t.setLookAhead(l),!r&&t.pos==this.stream.end&&(r=new Kz,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new Kz,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:o}=r.p;for(let s=0;s=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?t.value=a>>1:t.extended=a>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let o=0;ot.bufferLength*4?new DFn(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&t.length==1){let[s]=t;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(a);else{if(this.advanceStack(a,r,t))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&zFn(i);if(s)return tu&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw tu&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return tu&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&(r.sort((s,a)=>a.score-s.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let c=t.curContext&&t.curContext.tracker.strict,u=c?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(t.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(br.contextHash)||0)==u))return t.useNode(f,d),tu&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof rs)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof rs&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(t.state,4);if(a>0)return t.reduce(a),tu&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let c=0;ci?n.push(p):r.push(p)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return C2e(t,n),!0}}runRecovery(t,n,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),tu&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;h<10&&f.forceReduce()&&(tu&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)tu&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))tu&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),tu&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),C2e(a,r)):(!i||i.scoree;class NFn{constructor(t){this.start=t.start,this.shift=t.shift||xX,this.reduce=t.reduce||xX,this.reuse=t.reuse||xX,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class IR extends Ztt{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;at.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new Cge(n.map((a,l)=>Vc.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(l)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=Xtt;let s=jN(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new bO(s,a):a),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new FFn(this,t,n,r);for(let o of this.wrappers)i=o(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let o=this.stateSlot(t,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=xm(this.data,o+2);else break;i=n(xm(this.data,o+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=xm(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(IR.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(o=>o.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=t.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=O2e(s),s})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let o of t.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;or)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,r)<<1|t}return e.get}let jFn=0;class yf{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=jFn++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof yf&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new yf(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(t){let n=new t4(t);return r=>r.modified.indexOf(n)>-1?r:t4.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let BFn=0;class t4{constructor(t){this.name=t,this.instances=[],this.id=BFn++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(a=>a.base==t&&UFn(n,a.modified));if(r)return r;let i=[],o=new yf(t.name,i,t,n);for(let a of n)a.instances.push(o);let s=VFn(n);for(let a of t.set)if(!a.modified.length)for(let l of s)i.push(t4.get(a,l));return o}}function UFn(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function VFn(e){let t=[[]];for(let n=0;nr.length-n.length)}function Pge(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new DR(r,s,l>0?o.slice(0,l):null);t[c]=u.sort(t[c])}}return Jtt.add(t)}const Jtt=new br({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new DR(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class DR{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function WFn(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function HFn(e,t,n,r=0,i=e.length){let o=new GFn(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}class GFn{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,o){let{type:s,from:a,to:l}=t;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=qFn(t)||DR.empty,f=WFn(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=t.tree&&t.tree.prop(br.mounted);if(d&&d.overlay){let h=t.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(m=>!m.scope||m.scope(d.tree.type)),g=t.firstChild();for(let m=0,v=a;;m++){let y=m=b||!t.nextSibling())););if(!y||b>r)break;v=y.to+a,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}g&&t.parent()}else if(t.firstChild()){d&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,o),this.startSpan(Math.min(r,t.to),c)}while(t.nextSibling());t.parent()}}}function qFn(e){let t=e.type.prop(Jtt);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const jt=yf.define,BN=jt(),Ky=jt(),E2e=jt(Ky),T2e=jt(Ky),Zy=jt(),UN=jt(Zy),wX=jt(Zy),Kh=jt(),Ox=jt(Kh),Hh=jt(),Gh=jt(),lie=jt(),h2=jt(lie),VN=jt(),We={comment:BN,lineComment:jt(BN),blockComment:jt(BN),docComment:jt(BN),name:Ky,variableName:jt(Ky),typeName:E2e,tagName:jt(E2e),propertyName:T2e,attributeName:jt(T2e),className:jt(Ky),labelName:jt(Ky),namespace:jt(Ky),macroName:jt(Ky),literal:Zy,string:UN,docString:jt(UN),character:jt(UN),attributeValue:jt(UN),number:wX,integer:jt(wX),float:jt(wX),bool:jt(Zy),regexp:jt(Zy),escape:jt(Zy),color:jt(Zy),url:jt(Zy),keyword:Hh,self:jt(Hh),null:jt(Hh),atom:jt(Hh),unit:jt(Hh),modifier:jt(Hh),operatorKeyword:jt(Hh),controlKeyword:jt(Hh),definitionKeyword:jt(Hh),moduleKeyword:jt(Hh),operator:Gh,derefOperator:jt(Gh),arithmeticOperator:jt(Gh),logicOperator:jt(Gh),bitwiseOperator:jt(Gh),compareOperator:jt(Gh),updateOperator:jt(Gh),definitionOperator:jt(Gh),typeOperator:jt(Gh),controlOperator:jt(Gh),punctuation:lie,separator:jt(lie),bracket:h2,angleBracket:jt(h2),squareBracket:jt(h2),paren:jt(h2),brace:jt(h2),content:Kh,heading:Ox,heading1:jt(Ox),heading2:jt(Ox),heading3:jt(Ox),heading4:jt(Ox),heading5:jt(Ox),heading6:jt(Ox),contentSeparator:jt(Kh),list:jt(Kh),quote:jt(Kh),emphasis:jt(Kh),strong:jt(Kh),link:jt(Kh),monospace:jt(Kh),strikethrough:jt(Kh),inserted:jt(),deleted:jt(),changed:jt(),invalid:jt(),meta:VN,documentMeta:jt(VN),annotation:jt(VN),processingInstruction:jt(VN),definition:yf.defineModifier("definition"),constant:yf.defineModifier("constant"),function:yf.defineModifier("function"),standard:yf.defineModifier("standard"),local:yf.defineModifier("local"),special:yf.defineModifier("special")};for(let e in We){let t=We[e];t instanceof yf&&(t.name=e)}ent([{tag:We.link,class:"tok-link"},{tag:We.heading,class:"tok-heading"},{tag:We.emphasis,class:"tok-emphasis"},{tag:We.strong,class:"tok-strong"},{tag:We.keyword,class:"tok-keyword"},{tag:We.atom,class:"tok-atom"},{tag:We.bool,class:"tok-bool"},{tag:We.url,class:"tok-url"},{tag:We.labelName,class:"tok-labelName"},{tag:We.inserted,class:"tok-inserted"},{tag:We.deleted,class:"tok-deleted"},{tag:We.literal,class:"tok-literal"},{tag:We.string,class:"tok-string"},{tag:We.number,class:"tok-number"},{tag:[We.regexp,We.escape,We.special(We.string)],class:"tok-string2"},{tag:We.variableName,class:"tok-variableName"},{tag:We.local(We.variableName),class:"tok-variableName tok-local"},{tag:We.definition(We.variableName),class:"tok-variableName tok-definition"},{tag:We.special(We.variableName),class:"tok-variableName2"},{tag:We.definition(We.propertyName),class:"tok-propertyName tok-definition"},{tag:We.typeName,class:"tok-typeName"},{tag:We.namespace,class:"tok-namespace"},{tag:We.className,class:"tok-className"},{tag:We.macroName,class:"tok-macroName"},{tag:We.propertyName,class:"tok-propertyName"},{tag:We.operator,class:"tok-operator"},{tag:We.comment,class:"tok-comment"},{tag:We.meta,class:"tok-meta"},{tag:We.invalid,class:"tok-invalid"},{tag:We.punctuation,class:"tok-punctuation"}]);const XFn=1,tnt=194,nnt=195,YFn=196,P2e=197,QFn=198,KFn=199,ZFn=200,JFn=2,rnt=3,k2e=201,e$n=24,t$n=25,n$n=49,r$n=50,i$n=55,o$n=56,s$n=57,a$n=59,l$n=60,c$n=61,u$n=62,f$n=63,d$n=65,h$n=238,p$n=71,g$n=241,m$n=242,v$n=243,y$n=244,b$n=245,x$n=246,w$n=247,S$n=248,int=72,_$n=249,C$n=250,O$n=251,E$n=252,T$n=253,P$n=254,k$n=255,M$n=256,A$n=73,R$n=77,I$n=263,D$n=112,L$n=130,F$n=151,$$n=152,N$n=155,Rw=10,LR=13,kge=32,J8=9,Mge=35,z$n=40,j$n=46,cie=123,M2e=125,ont=39,snt=34,A2e=92,B$n=111,U$n=120,V$n=78,W$n=117,H$n=85,G$n=new Set([t$n,n$n,r$n,I$n,d$n,L$n,o$n,s$n,h$n,u$n,f$n,int,A$n,R$n,l$n,c$n,F$n,$$n,N$n,D$n]);function SX(e){return e==Rw||e==LR}function _X(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const q$n=new Z8((e,t)=>{let n;if(e.next<0)e.acceptToken(KFn);else if(t.context.flags&Zz)SX(e.next)&&e.acceptToken(QFn,1);else if(((n=e.peek(-1))<0||SX(n))&&t.canShift(P2e)){let r=0;for(;e.next==kge||e.next==J8;)e.advance(),r++;(e.next==Rw||e.next==LR||e.next==Mge)&&e.acceptToken(P2e,-r)}else SX(e.next)&&e.acceptToken(YFn,1)},{contextual:!0}),X$n=new Z8((e,t)=>{let n=t.context;if(n.flags)return;let r=e.peek(-1);if(r==Rw||r==LR){let i=0,o=0;for(;;){if(e.next==kge)i++;else if(e.next==J8)i+=8-i%8;else break;e.advance(),o++}i!=n.indent&&e.next!=Rw&&e.next!=LR&&e.next!=Mge&&(i[e,t|ant])),K$n=new NFn({start:Y$n,reduce(e,t,n,r){return e.flags&Zz&&G$n.has(t)||(t==p$n||t==int)&&e.flags&ant?e.parent:e},shift(e,t,n,r){return t==tnt?new Jz(e,Q$n(r.read(r.pos,n.pos)),0):t==nnt?e.parent:t==e$n||t==i$n||t==a$n||t==rnt?new Jz(e,0,Zz):R2e.has(t)?new Jz(e,0,R2e.get(t)|e.flags&Zz):e},hash(e){return e.hash}}),Z$n=new Z8(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==kge||n==J8)){n!=z$n&&n!=j$n&&n!=Rw&&n!=LR&&n!=Mge&&e.acceptToken(XFn);return}}}),J$n=new Z8((e,t)=>{let{flags:n}=t.context,r=n&am?snt:ont,i=(n&lm)>0,o=!(n&cm),s=(n&um)>0,a=e.pos;for(;!(e.next<0);)if(s&&e.next==cie)if(e.peek(1)==cie)e.advance(2);else{if(e.pos==a){e.acceptToken(rnt,1);return}break}else if(o&&e.next==A2e){if(e.pos==a){e.advance();let l=e.next;l>=0&&(e.advance(),eNn(e,l)),e.acceptToken(JFn);return}break}else if(e.next==A2e&&!o&&e.peek(1)>-1)e.advance(2);else if(e.next==r&&(!i||e.peek(1)==r&&e.peek(2)==r)){if(e.pos==a){e.acceptToken(k2e,i?3:1);return}break}else if(e.next==Rw){if(i)e.advance();else if(e.pos==a){e.acceptToken(k2e);return}break}else e.advance();e.pos>a&&e.acceptToken(ZFn)});function eNn(e,t){if(t==B$n)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==U$n)for(let n=0;n<2&&_X(e.next);n++)e.advance();else if(t==W$n)for(let n=0;n<4&&_X(e.next);n++)e.advance();else if(t==H$n)for(let n=0;n<8&&_X(e.next);n++)e.advance();else if(t==V$n&&e.next==cie){for(e.advance();e.next>=0&&e.next!=M2e&&e.next!=ont&&e.next!=snt&&e.next!=Rw;)e.advance();e.next==M2e&&e.advance()}}const tNn=Pge({'async "*" "**" FormatConversion FormatSpec':We.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":We.controlKeyword,"in not and or is del":We.operatorKeyword,"from def class global nonlocal lambda":We.definitionKeyword,import:We.moduleKeyword,"with as print":We.keyword,Boolean:We.bool,None:We.null,VariableName:We.variableName,"CallExpression/VariableName":We.function(We.variableName),"FunctionDefinition/VariableName":We.function(We.definition(We.variableName)),"ClassDefinition/VariableName":We.definition(We.className),PropertyName:We.propertyName,"CallExpression/MemberExpression/PropertyName":We.function(We.propertyName),Comment:We.lineComment,Number:We.number,String:We.string,FormatString:We.special(We.string),Escape:We.escape,UpdateOp:We.updateOperator,"ArithOp!":We.arithmeticOperator,BitOp:We.bitwiseOperator,CompareOp:We.compareOperator,AssignOp:We.definitionOperator,Ellipsis:We.punctuation,At:We.meta,"( )":We.paren,"[ ]":We.squareBracket,"{ }":We.brace,".":We.derefOperator,", ;":We.separator}),nNn={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},rNn=IR.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[Z$n,X$n,q$n,J$n,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>nNn[e]||-1}],tokenPrec:7668});let uie=[],lnt=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=lnt[r])t=r+1;else return!0;if(t==n)return!1}}function I2e(e){return e>=127462&&e<=127487}const D2e=8205;function oNn(e,t,n=!0,r=!0){return(n?cnt:sNn)(e,t,r)}function cnt(e,t,n){if(t==e.length)return t;t&&unt(e.charCodeAt(t))&&fnt(e.charCodeAt(t-1))&&t--;let r=CX(e,t);for(t+=L2e(r);t=0&&I2e(CX(e,s));)o++,s-=2;if(o%2==0)break;t+=2}else break}return t}function sNn(e,t,n){for(;t>0;){let r=cnt(e,t-2,n);if(r=56320&&e<57344}function fnt(e){return e>=55296&&e<56320}function L2e(e){return e<65536?1:2}let Yr=class dnt{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=DE(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),xp.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=DE(this,t,n);let r=[];return this.decompose(t,n,r,0),xp.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new oA(this),o=new oA(t);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(t=1){return new oA(this,t)}iterRange(t,n=this.length){return new hnt(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new pnt(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?dnt.empty:t.length<=32?new es(t):xp.from(es.split(t,[]))}};class es extends Yr{constructor(t,n=aNn(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=t)return new lNn(i,a,r,s);i=a+1,r++}}decompose(t,n,r,i){let o=t<=0&&n>=this.length?this:new es(F2e(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let s=r.pop(),a=e5(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new es(a,s.length+o.length));else{let l=a.length>>1;r.push(new es(a.slice(0,l)),new es(a.slice(l)))}}else r.push(o)}replace(t,n,r){if(!(r instanceof es))return super.replace(t,n,r);[t,n]=DE(this,t,n);let i=e5(this.text,e5(r.text,F2e(this.text,0,t)),n),o=this.length+r.length-(n-t);return i.length<=32?new es(i,o):xp.from(es.split(i,[]),o)}sliceString(t,n=this.length,r=` +`){[t,n]=DE(this,t,n);let i="";for(let o=0,s=0;o<=n&&st&&s&&(i+=r),to&&(i+=a.slice(Math.max(0,t-o),n-o)),o=l+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let o of t)r.push(o),i+=o.length+1,r.length==32&&(n.push(new es(r,i)),r=[],i=-1);return i>-1&&n.push(new es(r,i)),n}}class xp extends Yr{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=t)return s.lineInner(t,n,r,i);i=a+1,r=l+1}}decompose(t,n,r,i){for(let o=0,s=0;s<=n&&o=s){let c=i&((s<=t?1:0)|(l>=n?2:0));s>=t&&l<=n&&!c?r.push(a):a.decompose(t-s,n-s,r,c)}s=l+1}}replace(t,n,r){if([t,n]=DE(this,t,n),r.lines=o&&n<=a){let l=s.replace(t-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new xp(u,this.length-(n-t)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=` +`){[t,n]=DE(this,t,n);let i="";for(let o=0,s=0;ot&&o&&(i+=r),ts&&(i+=a.sliceString(t-s,n-s,r)),s=l+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof xp))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=t.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of t)r+=h.lines;if(r<32){let h=[];for(let p of t)p.flatten(h);return new es(h,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof xp)for(let g of h.children)f(g);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof es&&l&&(p=u[u.length-1])instanceof es&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new es(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:xp.from(u,c)),c=-1,l=u.length=0)}for(let h of t)f(h);return d(),a.length==1?a[0]:new xp(a,n)}}Yr.empty=new es([""],0);function aNn(e){let t=-1;for(let n of e)t+=n.length+1;return t}function e5(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(t instanceof es?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof es?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(i instanceof es){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,t))return this.value=t==0?l:n>0?l.slice(t):l.slice(0,l.length-t),this;t-=l.length}else{let l=i.children[s+(n<0?-1:0)];t>l.length?(t-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof es?l.text.length:l.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class hnt{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new oA(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class pnt{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Yr.prototype[Symbol.iterator]=function(){return this.iter()},oA.prototype[Symbol.iterator]=hnt.prototype[Symbol.iterator]=pnt.prototype[Symbol.iterator]=function(){return this});let lNn=class{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function DE(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function ia(e,t,n=!0,r=!0){return oNn(e,t,n,r)}function cNn(e){return e>=56320&&e<57344}function uNn(e){return e>=55296&&e<56320}function yc(e,t){let n=e.charCodeAt(t);if(!uNn(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return cNn(r)?(n-55296<<10)+(r-56320)+65536:n}function Age(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function wp(e){return e<65536?1:2}const fie=/\r\n?|\n/;var Pa=(function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e})(Pa||(Pa={}));class Yp{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return o+(t-i);o+=a}else{if(r!=Pa.Simple&&c>=t&&(r==Pa.TrackDel&&it||r==Pa.TrackBefore&&it))return null;if(c>t||c==t&&n<0&&!a)return t==i||n<0?o:o+l;o+=l}i=c}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return o}touchesRange(t,n=t){for(let r=0,i=0;r=0&&i<=n&&a>=t)return in?"cover":!0;i=a}return!1}toString(){let t="";for(let n=0;n=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Yp(t)}static create(t){return new Yp(t)}}class ks extends Yp{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return die(this,(n,r,i,o,s)=>t=t.replace(i,i+(r-n),s),!1),t}mapDesc(t,n=!1){return hie(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length0&&v0(r,n,o.text),o.forward(u),a+=u}let c=t[s++];for(;a>1].toJSON()))}return t}static of(t,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sd||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?Yr.of(h.split(r||fie)):h:Yr.empty,g=p.length;if(f==d&&g==0)return;fs&&ol(i,f-s,-1),ol(i,d-f,g),v0(o,i,p),s=d}}return c(t),l(!a),a}static empty(t){return new ks(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function v0(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,c,o,u,f),i=c,o=u}}}function hie(e,t,n,r=!1){let i=[],o=r?[]:null,s=new FR(e),a=new FR(t);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);ol(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class FR{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Yr.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?Yr.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class f1{constructor(t,n,r){this.from=t,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new f1(r,i,this.flags)}extend(t,n=t,r=0){if(t<=this.anchor&&n>=this.anchor)return ot.range(t,n,void 0,void 0,r);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return ot.range(this.anchor,i,void 0,void 0,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ot.range(t.anchor,t.head)}static create(t,n,r){return new f1(t,n,r)}}class ot{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:ot.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;rt.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ot(t.ranges.map(n=>f1.fromJSON(n)),t.main)}static single(t,n=t){return new ot([ot.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ii.from-o.from),n=t.indexOf(r);for(let i=1;io.head?ot.range(l,a):ot.range(a,l))}}return new ot(t,n)}}function mnt(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let Rge=0;class Jt{constructor(t,n,r,i,o){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Rge++,this.default=t([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(t={}){return new Jt(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:Ige),!!t.static,t.enables)}of(t){return new t5([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new t5(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new t5(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function Ige(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class t5{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=Rge++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=t[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:(((n=t[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(t[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||pie(f,u)){let h=r(f);if(a?!$2e(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let g=r4(d,p);if(this.dependencies.every(m=>m instanceof Jt?d.facet(m)===f.facet(m):m instanceof za?d.field(m,!1)==f.field(m,!1):!0)||(a?$2e(h=r(f),g,i):i(h=r(f),g)))return f.values[s]=g,0}else h=r(f);return f.values[s]=h,1}}}}function $2e(e,t,n){if(e.length!=t.length)return!1;for(let r=0;re[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=e[t.id]>>1;function a(l){let c=[];for(let u=0;ur===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(WN).find(r=>r.field==this);return(n?.create||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>{let o=r.facet(WN),s=i.facet(WN),a;return(a=o.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(t){return[this,WN.of({field:this,create:t})]}get extension(){return this}}const Zx={lowest:4,low:3,default:2,high:1,highest:0};function p2(e){return t=>new vnt(t,e)}const Ub={highest:p2(Zx.highest),high:p2(Zx.high),default:p2(Zx.default),low:p2(Zx.low),lowest:p2(Zx.lowest)};class vnt{constructor(t,n){this.inner=t,this.prec=n}}class eW{of(t){return new gie(this,t)}reconfigure(t){return eW.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class gie{constructor(t,n){this.compartment=t,this.inner=n}}class n4{constructor(t,n,r,i,o,s){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,r){let i=[],o=Object.create(null),s=new Map;for(let d of dNn(t,n,s))d instanceof za?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r?.config.facets;for(let d in o){let h=o[d],p=h[0].facet,g=u&&u[d]||[];if(h.every(m=>m.type==0))if(a[p.id]=l.length<<1|1,Ige(g,h))l.push(r.facet(p));else{let m=p.combine(h.map(v=>v.value));l.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of h)m.type==0?(a[m.id]=l.length<<1|1,l.push(m.value)):(a[m.id]=c.length<<1,c.push(v=>m.dynamicSlot(v)));a[p.id]=c.length<<1,c.push(m=>fNn(m,p,h))}}let f=c.map(d=>d(a));return new n4(t,s,f,a,l,o)}}function dNn(e,t,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof gie&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof gie){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof vnt)o(s.inner,s.prec);else if(s instanceof za)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof t5)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,Zx.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(e,Zx.default),r.reduce((s,a)=>s.concat(a))}function sA(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function r4(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const ynt=Jt.define(),mie=Jt.define({combine:e=>e.some(t=>t),static:!0}),bnt=Jt.define({combine:e=>e.length?e[0]:void 0,static:!0}),xnt=Jt.define(),wnt=Jt.define(),Snt=Jt.define(),_nt=Jt.define({combine:e=>e.length?e[0]:!1});class Mg{constructor(t,n){this.type=t,this.value=n}static define(){return new hNn}}class hNn{of(t){return new Mg(this,t)}}class pNn{constructor(t){this.map=t}of(t){return new Vn(this,t)}}class Vn{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Vn(this.type,n)}is(t){return this.type==t}static define(t={}){return new pNn(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let o=i.map(n);o&&r.push(o)}return r}}Vn.reconfigure=Vn.define();Vn.appendConfig=Vn.define();class vs{constructor(t,n,r,i,o,s){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&mnt(r,n.newLength),o.some(a=>a.type==vs.time)||(this.annotations=o.concat(vs.time.of(Date.now())))}static create(t,n,r,i,o,s){return new vs(t,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(vs.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}vs.time=Mg.define();vs.userEvent=Mg.define();vs.addToHistory=Mg.define();vs.remote=Mg.define();function gNn(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r=e[r]))o=e[r++],s=e[r++];else if(i=0;i--){let o=r[i](e);o instanceof vs?e=o:Array.isArray(o)&&o.length==1&&o[0]instanceof vs?e=o[0]:e=Ont(t,xO(o),!1)}return e}function vNn(e){let t=e.startState,n=t.facet(Snt),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=Cnt(r,vie(t,o,e.changes.newLength),!0))}return r==e?e:vs.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const yNn=[];function xO(e){return e==null?yNn:Array.isArray(e)?e:[e]}var wo=(function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e})(wo||(wo={}));const bNn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let yie;try{yie=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function xNn(e){if(yie)return yie.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||bNn.test(n)))return!0}return!1}function wNn(e){return t=>{if(!/\S/.test(t))return wo.Space;if(xNn(t))return wo.Word;for(let n=0;n-1)return wo.Word;return wo.Other}}class kr{constructor(t,n,r,i,o,s){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(Vn.reconfigure)?(n=null,r=a.value):a.is(Vn.appendConfig)&&(n=null,r=xO(r).concat(a.value));let o;n?o=t.startState.values.slice():(n=n4.resolve(r,i,this),o=new kr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=t.startState.facet(mie)?t.newSelection:t.newSelection.asSingle();new kr(n,t.newDoc,s,o,(a,l)=>l.update(a,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:ot.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=xO(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return kr.create({doc:t.doc,selection:ot.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=n4.resolve(t.extensions||[],new Map),r=t.doc instanceof Yr?t.doc:Yr.of((t.doc||"").split(n.staticFacet(kr.lineSeparator)||fie)),i=t.selection?t.selection instanceof ot?t.selection:ot.single(t.selection.anchor,t.selection.head):ot.single(0);return mnt(i,r.length),n.staticFacet(mie)||(i=i.asSingle()),new kr(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(kr.tabSize)}get lineBreak(){return this.facet(kr.lineSeparator)||` +`}get readOnly(){return this.facet(_nt)}phrase(t,...n){for(let r of this.facet(kr.phrases))if(Object.prototype.hasOwnProperty.call(r,t)){t=r[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),t}languageDataAt(t,n,r=-1){let i=[];for(let o of this.facet(ynt))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,t)&&i.push(s[t]);return i}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return wNn(n.length?n[0]:"")}wordAt(t){let{text:n,from:r,length:i}=this.doc.lineAt(t),o=this.charCategorizer(t),s=t-r,a=t-r;for(;s>0;){let l=ia(n,s,!1);if(o(n.slice(l,s))!=wo.Word)break;s=l}for(;ae.length?e[0]:4});kr.lineSeparator=bnt;kr.readOnly=_nt;kr.phrases=Jt.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(i=>e[i]==t[i])}});kr.languageData=ynt;kr.changeFilter=xnt;kr.transactionFilter=wnt;kr.transactionExtender=Snt;eW.reconfigure=Vn.define();function Ag(e,t,n={}){let r={};for(let i of e)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in t)r[i]===void 0&&(r[i]=t[i]);return r}class lb{eq(t){return this==t}range(t,n=t){return $R.create(t,n,this)}}lb.prototype.startSide=lb.prototype.endSide=0;lb.prototype.point=!1;lb.prototype.mapMode=Pa.TrackDel;function Dge(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class $R{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new $R(t,n,r)}}function bie(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Lge{constructor(t,n,r,i){this.from=t,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-t||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(t,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new Lge(i,o,r,a):null,pos:s}}}class Cr{constructor(t,n,r,i){this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(t,n,r,i){return new Cr(t,n,r,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=t,s=t.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(bie)),this.isEmpty)return n.length?Cr.of(n):this;let a=new Ent(this,null,-1).goto(0),l=0,c=[],u=new gv;for(;a.value||l=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&t<=o+s.length&&s.between(o,t-o,n-o,r)===!1)return}this.nextLayer.between(t,n,r)}}iter(t=0){return NR.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return NR.from(t).goto(n)}static compare(t,n,r,i,o=-1){let s=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=N2e(s,a,r),c=new g2(s,l,o),u=new g2(a,l,o);r.iterGaps((f,d,h)=>z2e(c,f,u,d,h,i)),r.empty&&r.length==0&&z2e(c,0,u,0,0,i)}static eq(t,n,r=0,i){i==null&&(i=999999999);let o=t.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&t.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=N2e(o,s),l=new g2(o,a,0).goto(r),c=new g2(s,a,0).goto(r);for(;;){if(l.to!=c.to||!xie(l.active,c.active)||l.point&&(!c.point||!Dge(l.point,c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(t,n,r,i,o=-1){let s=new g2(t,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(t,n=!1){let r=new gv;for(let i of t instanceof $R?[t]:n?SNn(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return Cr.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=Cr.empty;i=i.nextLayer)n=new Cr(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Cr.empty=new Cr([],[],null,-1);function SNn(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(bie);t=r}return e}Cr.empty.nextLayer=Cr.empty;class gv{finishChunk(t){this.chunks.push(new Lge(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new gv)).add(t,n,r)}addInner(t,n,r){let i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}finish(){return this.finishInner(Cr.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Cr.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function N2e(e,t,n){let r=new Map;for(let o of e)for(let s=0;s=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new Ent(s,n,r,o));return i.length==1?i[0]:new NR(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let r of this.heap)r.goto(t,n);for(let r=this.heap.length>>1;r>=0;r--)OX(this.heap,r);return this.next(),this}forward(t,n){for(let r of this.heap)r.forward(t,n);for(let r=this.heap.length>>1;r>=0;r--)OX(this.heap,r);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),OX(this.heap,0)}}}function OX(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class g2{constructor(t,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=NR.from(t,n,r)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){HN(this.active,t),HN(this.activeTo,t),HN(this.activeRank,t),this.minActive=j2e(this.active,this.activeTo)}addActive(t){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;GN(this.active,n,r),GN(this.activeTo,n,i),GN(this.activeRank,n,o),t&&GN(t,n,this.cursor.from),this.minActive=j2e(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&HN(r,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(t){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}function z2e(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t,c=!!o.boundChange;for(let u=!1;;){let f=e.to+l-n.to,d=f||e.endSide-n.endSide,h=d<0?e.to+l:n.to,p=Math.min(h,s);if(e.point||n.point?(e.point&&n.point&&Dge(e.point,n.point)&&xie(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,p,e.point,n.point),u=!1):(u&&o.boundChange(a),p>a&&!xie(e.active,n.active)&&o.compareRange(a,p,e.active,n.active),c&&ps)break;a=h,d<=0&&e.next(),d>=0&&n.next()}}function xie(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function j2e(e,t){let n=-1,r=1e9;for(let i=0;i=t)return i;if(i==e.length)break;o+=e.charCodeAt(i)==9?n-o%n:1,i=ia(e,i)}return r===!0?-1:e.length}const Sie="ͼ",B2e=typeof Symbol>"u"?"__"+Sie:Symbol.for(Sie),_ie=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),U2e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class cb{constructor(t,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(g=>s.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in t)o(i(s),t[s],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=U2e[B2e]||1;return U2e[B2e]=t+1,Sie+t.toString(36)}static mount(t,n,r){let i=t[_ie],o=r&&r.nonce;i?o&&i.setNonce(o):i=new _Nn(t,o),i.mount(Array.isArray(n)?n:[n],t)}}let V2e=new Map;class _Nn{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let o=V2e.get(r);if(o)return t[_ie]=o;this.sheet=new i.CSSStyleSheet,V2e.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[_ie]=this}mount(t,n){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},CNn=typeof navigator<"u"&&/Mac/.test(navigator.platform),ONn=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Oa=0;Oa<10;Oa++)ub[48+Oa]=ub[96+Oa]=String(Oa);for(var Oa=1;Oa<=24;Oa++)ub[Oa+111]="F"+Oa;for(var Oa=65;Oa<=90;Oa++)ub[Oa]=String.fromCharCode(Oa+32),zR[Oa]=String.fromCharCode(Oa);for(var EX in ub)zR.hasOwnProperty(EX)||(zR[EX]=ub[EX]);function ENn(e){var t=CNn&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||ONn&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?zR:ub)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Ai(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t2);var Yt={mac:H2e||/Mac/.test(Al.platform),windows:/Win/.test(Al.platform),linux:/Linux|X11/.test(Al.platform),ie:tW,ie_version:Pnt?Cie.documentMode||6:Eie?+Eie[1]:Oie?+Oie[1]:0,gecko:W2e,gecko_version:W2e?+(/Firefox\/(\d+)/.exec(Al.userAgent)||[0,0])[1]:0,chrome:!!TX,chrome_version:TX?+TX[1]:0,ios:H2e,android:/Android\b/.test(Al.userAgent),webkit_version:TNn?+(/\bAppleWebKit\/(\d+)/.exec(Al.userAgent)||[0,0])[1]:0,safari:Tie,safari_version:Tie?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Al.userAgent)||[0,0])[1]:0,tabSize:Cie.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Fge(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const i4=Object.create(null);function $ge(e,t,n){if(e==t)return!0;e||(e=i4),t||(t=i4);let r=Object.keys(e),i=Object.keys(t);if(r.length-0!=i.length-0)return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||e[o]!==t[o]))return!1;return!0}function PNn(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]==null&&e.removeAttribute(r)}for(let n in t){let r=t[n];n=="style"?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function G2e(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i=="style"?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i=="style"?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function kNn(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Iw(t,n,n,r,t.widget||null,!1)}static replace(t){let n=!!t.block,r,i;if(t.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=knt(t,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new Iw(t,r,i,n,t.widget||null,!0)}static line(t){return new IL(t)}static set(t,n=!1){return Cr.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}yn.none=Cr.empty;class RL extends yn{constructor(t){let{start:n,end:r}=knt(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Fge(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||i4}eq(t){return this==t||t instanceof RL&&this.tagName==t.tagName&&$ge(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}RL.prototype.point=!1;class IL extends yn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof IL&&this.spec.class==t.spec.class&&$ge(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}IL.prototype.mapMode=Pa.TrackBefore;IL.prototype.point=!0;class Iw extends yn{constructor(t,n,r,i,o,s){super(n,r,o,t),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?Pa.TrackBefore:Pa.TrackAfter:Pa.TrackDel}get type(){return this.startSide!=this.endSide?Fa.WidgetRange:this.startSide<=0?Fa.WidgetBefore:Fa.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Iw&&MNn(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}Iw.prototype.point=!0;function knt(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n??t,end:r??t}}function MNn(e,t){return e==t||!!(e&&t&&e.compare(t))}function wO(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}class jR extends lb{constructor(t,n){super(),this.tagName=t,this.attributes=n}eq(t){return t==this||t instanceof jR&&this.tagName==t.tagName&&$ge(this.attributes,t.attributes)}static create(t){return new jR(t.tagName,t.attributes||i4)}static set(t,n=!1){return Cr.of(t,n)}}jR.prototype.startSide=jR.prototype.endSide=-1;function BR(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function Pie(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function aA(e,t){if(!t.anchorNode)return!1;try{return Pie(e,t.anchorNode)}catch{return!1}}function lA(e){return e.nodeType==3?VR(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function cA(e,t,n,r){return n?q2e(e,t,n,r,-1)||q2e(e,t,n,r,1):!1}function fb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function o4(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function q2e(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:mv(e))){if(e.nodeName=="DIV")return!1;let o=e.parentNode;if(!o||o.nodeType!=1)return!1;t=fb(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=i<0?mv(e):0}else return!1}}function mv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function UR(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function ANn(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function Mnt(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function RNn(e,t,n,r,i,o,s,a){let l=e.ownerDocument,c=l.defaultView||window;for(let u=e,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,g=1;if(h)d=ANn(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:g}=Mnt(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*g}}let m=0,v=0;if(i=="nearest")t.top0&&t.bottom>d.bottom+v&&(v=t.bottom-d.bottom+s)):t.bottom>d.bottom&&(v=t.bottom-d.bottom+s,n<0&&t.top-v0&&t.right>d.right+m&&(m=t.right-d.right+o)):t.right>d.right&&(m=t.right-d.right+o,n<0&&t.leftd.bottom||t.leftd.right)&&(t={left:Math.max(t.left,d.left),right:Math.min(t.right,d.right),top:Math.max(t.top,d.top),bottom:Math.min(t.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Ant(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let o=e.parentNode;o&&!(o==n.body||(!t||r)&&i);)if(o.nodeType==1)!i&&o.scrollHeight>o.clientHeight&&(i=o),t&&!r&&o.scrollWidth>o.clientWidth&&(r=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:r,y:i}}class INn{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:r}=t;this.set(n,Math.min(t.anchorOffset,n?mv(n):0),r,Math.min(t.focusOffset,r?mv(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let zx=null;Yt.safari&&Yt.safari_version>=26&&(zx=!1);function Rnt(e){if(e.setActive)return e.setActive();if(zx)return e.focus(zx);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(zx==null?{get preventScroll(){return zx={preventScroll:!0},!0}}:void 0),!zx){zx=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Dnt(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=mv(n)}else if(n.parentNode&&!o4(n))r=fb(n),n=n.parentNode;else return null}}function Lnt(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromn:t[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function Nnt(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;g-=3)if(qh[g+1]==-h){let m=qh[g+2],v=m&2?i:m&4?m&1?o:i:0;v&&(Ni[f]=Ni[qh[g]]=v),a=g;break}}else{if(qh.length==189)break;qh[a++]=f,qh[a++]=d,qh[a++]=l}else if((p=Ni[f])==2||p==1){let g=p==i;l=g?0:1;for(let m=a-3;m>=0;m-=3){let v=qh[m+2];if(v&2)break;if(g)qh[m+2]|=2;else{if(v&4)break;qh[m+2]|=4}}}}}function BNn(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:e,a=il;)p==m&&(p=n[--g].from,m=g?n[g-1].to:e),Ni[--p]=h;l=u}else o=c,l++}}}function Mie(e,t,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=t,c=0;ll&&s.push(new Pp(l,g.from,h));let m=g.direction==Dw!=!(h%2);Aie(e,m?r+1:r,i,g.inner,g.from,g.to,s),l=g.to}p=g.to}else{if(p==n||(u?Ni[p]!=a:Ni[p]==a))break;p++}d?Mie(e,l,p,r+1,i,d,s):lt;){let u=!0,f=!1;if(!c||l>o[c-1].to){let g=Ni[l-1];g!=a&&(u=!1,f=g==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let g=o[--c];if(!u)for(let m=g.from,v=c;;){if(m==t)break e;if(v&&o[v-1].to==m)m=o[--v].from;else{if(Ni[m-1]==a)break e;break}}if(d)d.push(g);else{g.toNi.length;)Ni[Ni.length]=256;let r=[],i=t==Dw?0:1;return Aie(e,i,i,n,0,e.length,r),r}function znt(e){return[new Pp(0,e,0)]}let jnt="";function VNn(e,t,n,r,i){var o;let s=r.head-e.from,a=Pp.find(t,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=t[a],c=l.side(i,n);if(s==c){let d=a+=i?1:-1;if(d<0||d>=t.length)return null;l=t[a=d],s=l.side(!i,n),c=l.side(i,n)}let u=ia(e.text,s,l.forward(i,n));(ul.to)&&(u=c),jnt=e.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?t.length-1:0)?null:t[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)e.some(t=>t)}),Xnt=Jt.define({combine:e=>e.some(t=>t)}),Ynt=Jt.define();class _O{constructor(t,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(t){return t.empty?this:new _O(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new _O(ot.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const qN=Vn.define({map:(e,t)=>e.map(t)}),Qnt=Vn.define();function Ec(e,t,n){let r=e.facet(Wnt);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const Tm=Jt.define({combine:e=>e.length?e[0]:!0});let HNn=0;const VC=Jt.define({combine(e){return e.filter((t,n)=>{for(let r=0;r{let l=[];return s&&l.push(nW.of(c=>{let u=c.plugin(a);return u?s(u):yn.none})),o&&l.push(o(a)),l})}static fromClass(t,n){return Ho.define((r,i)=>new t(r,i),n)}}class PX{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Ec(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Ec(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Ec(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Knt=Jt.define(),Bge=Jt.define(),nW=Jt.define(),Znt=Jt.define(),Uge=Jt.define(),DL=Jt.define(),Jnt=Jt.define();function Y2e(e,t){let n=e.state.facet(Jnt);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(e):o),i=[];return Cr.spans(r,t.from,t.to,{point(){},span(o,s,a,l){let c=o-t.from,u=s-t.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=WNn(t.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let g={from:c,to:u,direction:h,inner:[]};f.push(g),f=g.inner}}}}),i}const ert=Jt.define();function Vge(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(ert)){let s=o(e);s&&(s.left!=null&&(t=Math.max(t,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:t,right:n,top:r,bottom:i}}const xM=Jt.define();class kf{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new kf(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,r=this;for(;n>0;n--){let i=t[n-1];if(!(i.fromA>r.toA)){if(i.toAi.push(new kf(o,s,a,l))),this.changedRanges=i}static create(t,n,r){return new s4(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const GNn=[];class Uo{constructor(t,n,r=0){this.dom=t,this.length=n,this.flags=r,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return GNn}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&PNn(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let r=n;for(let i of this.children){if(i==t)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n){return null}domPosFor(t,n){let r=fb(this.dom),i=this.length?t>0:n>0;return new nh(this.parent.dom,r+(i?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof iW)return t;return null}static get(t){return t.cmTile}}class rW extends Uo{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,r=null,i,o=t?.node==n?t:null,s=0;for(let a of this.children){if(a.sync(t),s+=a.length+a.breakAfter,i=r?r.nextSibling:n.firstChild,o&&i!=a.dom&&(o.written=!0),a.dom.parentNode==n)for(;i&&i!=a.dom;)i=Q2e(i);else n.insertBefore(a.dom,i);r=a.dom}for(i=r?r.nextSibling:n.firstChild,o&&i&&(o.written=!0);i;)i=Q2e(i);this.length=s}}function Q2e(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class iW extends rW{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=Uo.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],r=this,i=0,o=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&o++,i=n.pop()}else{let s=r.children[i++];if(s instanceof Km)n.push(i),r=s,i=0;else{let a=o+s.length,l=t(s,o);if(l!==void 0)return l;o=a+s.breakAfter}}}resolveBlock(t,n){let r,i=-1,o,s=-1;if(this.blockTiles((a,l)=>{let c=l+a.length;if(t>=l&&t<=c){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(lt||t==l&&(n>1?a.length:a.covers(-1)))&&(!o||!a.isWidget()&&o.isWidget())&&(o=a,s=t-l)}}),!r&&!o)throw new Error("No tile at position "+t);return r&&n<0||!o?{tile:r,offset:i}:{tile:o,offset:s}}}class Km extends rW{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new Km(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class LE extends rW{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,r){let i=new LE(n||document.createElement("div"),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(t,n,r){let i=null,o=-1,s=null,a=-1;function l(u,f){for(let d=0,h=0;d=f&&(p.isComposite()?l(p,f-h):(!s||s.isHidden&&(n>0||r&&XNn(s,p)))&&(g>f||p.flags&32)?(s=p,a=f-h):(hr&&(t=r);let i=t,o=t,s=0;t==0&&n<0||t==r&&n>=0?Yt.chrome||Yt.gecko||(t?(i--,s=1):o=0)?0:a.length-1];return Yt.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?UR(l,s<0):l||null}static of(t,n){let r=new d1(n||document.createTextNode(t),t);return n||(r.flags|=2),r}}class Lw extends Uo{constructor(t,n,r,i){super(t,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,r){let i=this.widget.coordsAt(this.dom,t,n);if(i)return i;if(r)return UR(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let o=this.dom.getClientRects(),s=null;if(!o.length)return null;let a=this.flags&16?!0:this.flags&32?!1:t>0;for(let l=a?o.length-1:0;s=o[l],!(t>0?l==0:l==o.length-1||s.top0;)if(i.isComposite())if(s){if(!t)break;r&&r.break(),t--,s=!1}else if(o==i.children.length){if(!t&&!a.length)break;r&&r.leave(i),s=!!i.breakAfter,{tile:i,index:o}=a.pop(),o++}else{let l=i.children[o],c=l.breakAfter;(n>0?l.length<=t:l.length=0;a--){let l=n.marks[a],c=i.lastChild;if(c instanceof Cc&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(kX(l.dom)),i=c;else{if(this.cache.reused.get(l)){let f=Uo.get(l.dom);f&&f.setDOM(kX(l.dom))}let u=Cc.of(l.mark,l.dom);i.append(u),i=u}this.cache.reused.set(l,2)}let o=Uo.get(t.text);o&&this.cache.reused.set(o,2);let s=new d1(t.text,t.text.nodeValue);s.flags|=8,i.append(s)}addInlineWidget(t,n,r){let i=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);i||this.flushBuffer();let o=this.ensureMarks(n,r);!i&&!(t.flags&16)&&o.append(this.getBuffer(1)),o.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var r;t||(t=trt);let i=LE.start(t,n||((r=this.cache.find(LE))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var r;let i=this.curLine;for(let o=t.length-1;o>=0;o--){let s=t[o],a;if(n>0&&(a=i.lastChild)&&a instanceof Cc&&a.mark.eq(s))i=a,n--;else{let l=Cc.of(s,(r=this.cache.find(Cc,c=>c.mark.eq(s)))===null||r===void 0?void 0:r.dom);i.append(l),i=l,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!K2e(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(Yt.ios&&K2e(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(MX,0,32)||new Lw(MX.toDOM(),0,MX,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=new QNn(t.from,t.to,t.value,t.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.froms.wrapper.eq(r.wrapper)))===null||t===void 0?void 0:t.dom);n.append(o),n=o}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),r=this.cache.find(a4,void 0,1);return r&&(r.flags=n),r||new a4(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class ZNn{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:i,lineBreak:o,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=i;let a=this.textOff=Math.min(t,i.length);return o?null:i.slice(0,a)}let n=Math.min(this.text.length,this.textOff+t),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const l4=[Lw,LE,d1,Cc,a4,Km,iW];for(let e=0;e[]),this.index=l4.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,r=this.buckets[n];r.length<6?r.push(t):r[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,r=2){let i=t.bucket,o=this.buckets[i],s=this.index[i];for(let a=o.length-1;a>=0;a--){let l=(a+s)%o.length,c=o[l];if((!n||n(c))&&!this.reused.has(c))return o.splice(l,1),l{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(t,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,o=0,s=0;;){let a=si){let c=l-i;this.preserve(c,!s,!a),i=l,o+=c}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.fromA,n.range.fromA,n.range.fromA{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof Cc&&i.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?i.length&&(i.length=o=0):s instanceof Cc&&(i.shift(),o=Math.min(o,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let r=null,i=this.builder,o=0,s=Cr.spans(this.decorations,t,n,{point:(a,l,c,u,f,d)=>{if(c instanceof Iw){if(this.disallowBlockEffectsFor[d]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=u.length,f>u.length)i.continueWidget(l-a);else{let h=c.widget||(c.block?FE.block:FE.inline),p=t3n(c),g=this.cache.findWidget(h,l-a,p)||Lw.of(h,this.view,l-a,p);c.block?(c.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(g)):(i.ensureLine(r),i.addInlineWidget(g,u,f))}r=null}else r=n3n(r,c);l>a&&this.text.skip(l-a)},span:(a,l,c,u)=>{for(let f=a;fo,this.openMarks=s}forward(t,n,r=1){n-t<=10?this.old.advance(n-t,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(t){let n=[],r=null;for(let i=t.parentNode;;i=i.parentNode){let o=Uo.get(i);if(i==this.view.contentDOM)break;o instanceof Cc?n.push(o):o?.isLine()?r=o:o instanceof Km||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new LE(i,trt):r||n.push(Cc.of(new RL({tagName:i.nodeName.toLowerCase(),attributes:kNn(i)}),i)))}return{line:r,marks:n}}}function K2e(e,t){let n=r=>{for(let i of r.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}function t3n(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const trt={class:"cm-line"};function n3n(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||(e={class:"cm-line"}),n&&Fge(n,e),r&&(e.class+=" "+r)),e}function r3n(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Cc&&t.push(r.mark)}return t}function kX(e){let t=Uo.get(e);return t&&t.setDOM(e.cloneNode()),e}class FE extends Lh{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}FE.inline=new FE("span");FE.block=new FE("div");const MX=new class extends Lh{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Z2e{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=yn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new iW(t,t.contentDOM),this.updateInner([new kf(0,0,0,t.state.doc.length)],null)}update(t){var n;let r=t.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!d3n(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let o=i>-1?o3n(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;r=new kf(u,f,t.changes.mapPos(u,-1),t.changes.mapPos(f,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Yt.ie||Yt.chrome)&&!o&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.blockWrappers;this.updateDeco();let l=l3n(s,this.decorations,t.changes);l.length&&(r=kf.extendWithRanges(r,l));let c=u3n(a,this.blockWrappers,t.changes);return c.length&&(r=kf.extendWithRanges(r,c)),o&&!r.some(u=>u.fromA<=o.range.fromA&&u.toA>=o.range.toA)&&(r=o.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,o),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||t.length){let s=this.tile,a=new e3n(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Uo.get(n.text)&&a.cache.reused.set(Uo.get(n.text),2),this.tile=a.run(t,n),Iie(s,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Yt.chrome||Yt.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||r.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to-1)&&aA(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(o||n||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),Yt.gecko&&l.empty&&!this.hasComposition&&i3n(c)){let d=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(d,c.node.childNodes[c.offset]||null)),c=u=new nh(d,0),a=!0}let f=this.view.observer.selectionRange;(a||!f.focusNode||(!cA(c.node,c.offset,f.anchorNode,f.anchorOffset)||!cA(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,l))&&(this.view.observer.ignore(()=>{Yt.android&&Yt.chrome&&r.contains(f.focusNode)&&f3n(f.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let d=BR(this.view.root);if(d)if(l.empty){if(Yt.gecko){let h=s3n(c.node,c.offset);if(h&&h!=3){let p=(h==1?Dnt:Lnt)(c.node,c.offset);p&&(c=new nh(p.node,p.offset))}}d.collapse(c.node,c.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(c.node,c.offset);try{d.extend(u.node,u.offset)}catch{}}else{let h=document.createRange();l.anchor>l.head&&([c,u]=[u,c]),h.setEnd(u.node,u.offset),h.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(h)}s&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new nh(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new nh(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&cA(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,r=BR(t.root),{anchorNode:i,anchorOffset:o}=t.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=this.lineAt(n.head,n.assoc);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}posFromDOM(t,n){let r=this.tile.nearest(t);if(!r)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let o;if(t==r.dom)o=r.dom.childNodes[n];else{let s=mv(t)==0?0:n==0?-1:1;for(;;){let a=t.parentNode;if(a==r.dom)break;s==0&&a.firstChild!=a.lastChild&&(t==a.firstChild?s=-1:s=1),t=a}s<0?o=t:o=t.nextSibling}if(o==r.dom.firstChild)return i;for(;o&&!Uo.get(o);)o=o.nextSibling;if(!o)return i+r.length;for(let s=0,a=i;;s++){let l=r.children[s];if(l.dom==o)return a;a+=l.length+l.breakAfter}}else return r.isText()?t==r.dom?i+n:i+(n?r.length:0):i}domAtPos(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.domPosFor(t,n):r.domIn(i,n)}inlineDOMNearPos(t,n){let r,i=-1,o=!1,s,a=-1,l=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=t)return!0;c.flags&16&&(o=!0)}else{let f=u+c.length;if(u<=t&&(r=c,i=t-u,o=f=t&&!s&&(s=c,a=t-u,l=u>t),u>t&&s)return!0}}),!r&&!s?this.domAtPos(t,n):(o&&s?r=null:l&&r&&(s=null),r&&n<0||!s?r.domIn(i,n):s.domIn(a,n))}coordsAt(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof AX?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(t,n){let{tile:r}=this.tile.resolveBlock(t,n);return r.isLine()?r:null}coordsForChar(t){let{tile:n,offset:r}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function i(o,s){if(o.isComposite())for(let a of o.children){if(a.length>=s){let l=i(a,s);if(l)return l}if(s-=a.length,s<0)break}else if(o.isText()&&sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Bi.LTR,c=0,u=(f,d,h)=>{for(let p=0;pi);p++){let g=f.children[p],m=d+g.length,v=g.dom.getBoundingClientRect(),{height:y}=v;if(h&&!p&&(c+=v.top-h.top),g instanceof Km)m>r&&u(g,d,v);else if(d>=r&&(c>0&&n.push(-c),n.push(y+c),c=0,s)){let b=g.dom.lastChild,w=b?lA(b):[];if(w.length){let S=w[w.length-1],_=l?S.right-v.left:v.right-S.left;_>a&&(a=_,this.minWidth=o,this.minWidthFrom=d,this.minWidthTo=m)}}h&&p==f.children.length-1&&(c+=h.bottom-v.bottom),d=m+g.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?Bi.RTL:Bi.LTR}measureTextSize(){let t=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let a=0,l;for(let c of s.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=lA(c.dom);if(u.length!=1)return;a+=u[0].width,l=u[0].height}if(a)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:a/s.length,textHeight:l}}});if(t)return t;let n=document.createElement("div"),r,i,o;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let s=lA(n.firstChild)[0];r=n.getBoundingClientRect().height,i=s&&s.width?s.width/27:7,o=s&&s.height?s.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:o}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.view.state.doc.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;t.push(yn.replace({widget:new AX(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return yn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(nW).map(o=>(this.dynamicDecorationMap[t++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(Uge).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[t++]=r,n.push(Cr.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof o=="function"?o(this.view):o)}scrollIntoView(t){var n;if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(Ynt))try{if(u(this.view,t.range,t))return!0}catch(f){Ec(this.view.state,f,"scroll handler")}let{range:r}=t,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),o;if(!i)return;!r.empty&&(o=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,o.left),top:Math.min(i.top,o.top),right:Math.max(i.right,o.right),bottom:Math.max(i.bottom,o.bottom)});let s=Vge(this.view),a={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(RNn(this.view.scrollDOM,a,r.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomr.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){Iie(this.tile)}}function Iie(e,t){let n=t?.get(e);if(n!=1){n==null&&e.destroy();for(let r of e.children)Iie(r,t)}}function i3n(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function nrt(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Dnt(n.focusNode,n.focusOffset),i=Lnt(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let a=Uo.get(i.node);if(!a||a.isText()&&a.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let l=Uo.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}function o3n(e,t,n){let r=nrt(e,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc;return{range:new kf(l.mapPos(o),l.mapPos(s),o,s),text:i}}function s3n(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{rt.from&&(n=!0)}),n}class AX extends Lh{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function h3n(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(i.length==0)return ot.cursor(t);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=ia(i.text,o,!1):a=ia(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=ia(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;ae.defaultLineHeight*1.5){let a=e.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(e.defaultLineHeight-a)*.5)/a);o+=l*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+wie(s,o,e.state.tabSize)}function Die(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let i;for(let o of r.type){if(o.from>t)break;if(!(o.tot)return o;(!i||o.type==Fa.Text&&(i.type!=o.type||(n<0?o.fromt)))&&(i=o)}}return i||r}return r}function g3n(e,t,n,r){let i=Die(e,t.head,t.assoc||-1),o=!r||i.type!=Fa.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(o){let s=e.dom.getBoundingClientRect(),a=e.textDirectionAt(i.from),l=e.posAtCoords({x:n==(a==Bi.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return ot.cursor(l,n?-1:1)}return ot.cursor(n?i.to:i.from,n?-1:1)}function J2e(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),s=e.textDirectionAt(i.from);for(let a=t,l=null;;){let c=VNn(i,o,s,a,n),u=jnt;if(!c){if(i.number==(n?e.state.doc.lines:1))return a;u=` +`,i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),c=e.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function m3n(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return o=>{let s=r(o);return i==wo.Space&&(i=s),i==s}}function v3n(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return ot.cursor(i,t.assoc);let s=t.goalColumn,a,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let p=e.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-p.from))),a=(o<0?p.top:p.bottom)+u}let f=l.left+s,d=e.viewState.heightOracle.textHeight>>1,h=r??d;for(let p=0;;p+=d){let g=a+(h+p)*o,m=Lie(e,{x:f,y:g},!1,o);if(n?g>l.bottom:ga:y{if(t>o&&ti(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:ot.cursor(r,re.viewState.docHeight)return new Sp(e.state.doc.length,-1);if(c=e.elementAtHeight(l),r==null)break;if(c.type==Fa.Text){if(r<0?c.toe.viewport.to)break;let d=e.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(d&&(r<0?d.top<=l+o:d.bottom>=l+o))break}let f=e.viewState.heightOracle.textHeight/2;l=r>0?c.bottom+f:c.top-f}if(e.viewport.from>=c.to||e.viewport.to<=c.from){if(n)return null;if(c.type==Fa.Text){let f=p3n(e,i,c,s,a);return new Sp(f,f==c.from?1:-1)}}if(c.type!=Fa.Text)return l<(c.top+c.bottom)/2?new Sp(c.from,1):new Sp(c.to,-1);let u=e.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=e.docView.lineAt(c.from,-2)),new y3n(e,s,a,e.textDirectionAt(c.from)).scanTile(u,c.from)}class y3n{constructor(t,n,r,i){this.view=t,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from>1;t:if(o.has(p)){let m=r+Math.floor(Math.random()*h);for(let v=0;v1)){if(v.bottomthis.y)(!l||l.top>v.top)&&(l=v),y=-1;else{let b=v.left>this.x?this.x-v.left:v.right(f.left+f.right)/2==d}}scanText(t,n){let r=[];for(let o=0;o{let s=r[o]-n,a=r[o+1]-n;return VR(t.dom,s,a).getClientRects()});return i.after?new Sp(r[i.i+1],-1):new Sp(r[i.i],1)}scanTile(t,n){if(!t.length)return new Sp(n,1);if(t.children.length==1){let a=t.children[0];if(a.isText())return this.scanText(a,n);if(a.isComposite())return this.scanTile(a,n)}let r=[n];for(let a=0,l=n;a{let l=t.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:VR(l.dom,0,l.length)).getClientRects()}),o=t.children[i.i],s=r[i.i];return o.isText()?this.scanText(o,s):o.isComposite()?this.scanTile(o,s):i.after?new Sp(r[i.i+1],-1):new Sp(s,1)}}const wC="￿";class b3n{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(kr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=wC}readRange(t,n){if(!t)return this;let r=t.parentNode;for(let i=t;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=Uo.get(i),a=i.nextSibling;if(a==n){s?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=Uo.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:o4(i))||o4(a)&&(i.nodeName!="BR"||s?.isWidget())&&this.text.length>o)&&!w3n(a,n)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(t){let n=t.nodeValue;for(let r of this.points)r.node==t&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==t&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(t){let n=Uo.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let r of this.points)r.node==t&&t.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(t,n){for(let r of this.points)(t.nodeType==3?r.node==t:t.contains(r.node))&&(r.pos=this.text.length+(x3n(t,r.node,r.offset)?n:0))}}function x3n(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:o,impreciseAnchor:s}=t.docView,a=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=irt(t.docView.tile,n,r,0))){let l=o||s?[]:C3n(t),c=new b3n(l,t);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=O3n(l,this.bounds.from)}else{let l=t.observer.selectionRange,c=o&&o.node==l.focusNode&&o.offset==l.focusOffset||!Pie(t.contentDOM,l.focusNode)?a.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),u=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!Pie(t.contentDOM,l.anchorNode)?a.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),f=t.viewport;if((Yt.ios||Yt.chrome)&&a.main.empty&&c!=u&&(f.from>0||f.to-1&&a.ranges.length>1)this.newSel=a.replaceRange(ot.range(u,c));else if(t.lineWrapping&&u==c&&!(a.main.empty&&a.main.head==c)&&t.inputState.lastTouchTime>Date.now()-100){let d=t.coordsAtPos(c,-1),h=0;d&&(h=t.inputState.lastTouchY<=d.bottom?-1:1),this.newSel=ot.create([ot.cursor(c,h)])}else this.newSel=ot.single(u,c)}}}function irt(e,t,n,r){if(e.isComposite()){let i=-1,o=-1,s=-1,a=-1;for(let l=0,c=r,u=r;ln)return irt(f,t,n,c);if(d>=t&&i==-1&&(i=l,o=c),c>n&&f.dom.parentNode==e.dom){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+e.length:a,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:s=0?e.children[s].dom:null}}else return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function ort(e,t){let n,{newSel:r}=t,{state:i}=e,o=i.selection.main,s=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:a,to:l}=t.bounds,c=o.from,u=null;(s===8||Yt.android&&t.text.length=a&&o.to<=l&&(t.typeOver||f!=t.text)&&f.slice(0,o.from-a)==t.text.slice(0,o.from-a)&&f.slice(o.to-a)==t.text.slice(d=t.text.length-(f.length-(o.to-a)))?n={from:o.from,to:o.to,insert:Yr.of(t.text.slice(o.from-a,d).split(wC))}:(h=srt(f,t.text,c-a,u))&&(Yt.chrome&&s==13&&h.toB==h.from+2&&t.text.slice(h.from,h.toB)==wC+wC&&h.toB--,n={from:a+h.from,to:a+h.toA,insert:Yr.of(t.text.slice(h.from,h.toB).split(wC))})}else r&&(!e.hasFocus&&i.facet(Tm)||c4(r,o))&&(r=null);if(!n&&!r)return!1;if((Yt.mac||Yt.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=ot.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Yr.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(o.from).toDate.now()-50?n={from:o.from,to:o.to,insert:i.toText(e.inputState.insertingText)}:Yt.chrome&&n&&n.from==n.to&&n.from==o.head&&n.insert.toString()==` + `&&e.lineWrapping&&(r&&(r=ot.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:Yr.of([" "])}),n)return Wge(e,n,r,s);if(r&&!c4(r,o)){let a=!1,l="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(a=!0),l=e.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=rrt(i.facet(DL).map(c=>c(e)),r))),e.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function Wge(e,t,n,r=-1){if(Yt.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Yt.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&SO(e.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.lengthi.head)&&SO(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&SO(e.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s,a=()=>s||(s=_3n(e,t,n));return e.state.facet(Hnt).some(l=>l(e,t.from,t.to,o,a))||e.dispatch(a()),!0}function _3n(e,t,n){let r,i=e.state,o=i.selection.main,s=-1;if(t.from==t.to&&t.fromo.to){let l=t.fromf(e)),c,l);t.from==u&&(s=u)}if(s>-1)r={changes:t,selection:ot.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let l=o.fromt.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(l+t.insert.sliceString(0,void 0,e.state.lineBreak)+c))}else{let l=i.changes(t),c=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let u=e.state.sliceDoc(t.from,t.to),f,d=n&&nrt(e,n.main.head);if(d){let p=t.insert.length-(t.to-t.from);f={from:d.from,to:d.to-p}}else f=e.state.doc.lineAt(o.head);let h=o.to-t.to;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:l,range:c||p.map(l)};let g=p.to-h,m=g-u.length;if(e.state.sliceDoc(m,g)!=u||g>=f.from&&m<=f.to)return{range:p};let v=i.changes({from:m,to:g,insert:t.insert}),y=p.to-o.to;return{changes:v,range:c?ot.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):p.map(v)}})}else r={changes:l,selection:c&&i.selection.replaceRange(c)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function srt(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function C3n(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new eMe(n,r)),(i!=n||o!=r)&&t.push(new eMe(i,o))),t}function O3n(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?ot.single(n+t,r+t):null}function c4(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class E3n{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Yt.safari&&t.contentDOM.addEventListener("input",()=>null),Yt.gecko&&B3n(t.contentDOM.ownerDocument)}handleEvent(t){!D3n(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let r=this.handlers[t];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=T3n(t),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&lrt.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Yt.android&&Yt.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let n;return Yt.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&!t.shiftKey&&((n=art.find(r=>r.keyCode==t.keyCode))&&!t.ctrlKey||P3n.indexOf(t.key)>-1&&t.ctrlKey)?(this.pendingIOSKey=n||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:Yt.safari&&!Yt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function tMe(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){Ec(n.state,i)}}}function T3n(e){let t=Object.create(null);function n(r){return t[r]||(t[r]={observers:[],handlers:[]})}for(let r of e){let i=r.spec,o=i&&i.plugin.domEventHandlers,s=i&&i.plugin.domEventObservers;if(o)for(let a in o){let l=o[a];l&&n(a).handlers.push(tMe(r.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(tMe(r.value,l))}}for(let r in _h)n(r).handlers.push(_h[r]);for(let r in Wc)n(r).observers.push(Wc[r]);return t}const art=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],P3n="dthko",lrt=[16,17,18,20,91,92,224,225],XN=6;function YN(e){return Math.max(0,e)*.7+8}function k3n(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class M3n{constructor(t,n,r,i){this.view=t,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Ant(t.contentDOM),this.atoms=t.state.facet(DL).map(s=>s(t));let o=t.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(kr.allowMultipleSelections)&&A3n(t,n),this.dragging=I3n(t,n)&&frt(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&k3n(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Vge(this.view);t.clientX-l.left<=i+XN?n=-YN(i-t.clientX):t.clientX+l.right>=s-XN&&(n=YN(t.clientX-s)),t.clientY-l.top<=o+XN?r=-YN(o-t.clientY):t.clientY+l.bottom>=a-XN&&(r=YN(t.clientY-a)),this.setScrollSpeed(n,r)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,r=rrt(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function A3n(e,t){let n=e.state.facet(Bnt);return n.length?n[0](t):Yt.mac?t.metaKey:t.ctrlKey}function R3n(e,t){let n=e.state.facet(Unt);return n.length?n[0](t):Yt.mac?!t.altKey:!t.ctrlKey}function I3n(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=BR(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=t.clientX&&s.top<=t.clientY&&s.bottom>=t.clientY)return!0}return!1}function D3n(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Uo.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}const _h=Object.create(null),Wc=Object.create(null),crt=Yt.ie&&Yt.ie_version<15||Yt.ios&&Yt.webkit_version<604;function L3n(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),urt(e,n.value)},50)}function oW(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function urt(e,t){t=oW(e.state,zge,t);let{state:n}=e,r,i=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(Fie!=null&&n.selection.ranges.every(l=>l.empty)&&Fie==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((s?o.line(i++).text:t)+n.lineBreak);return{changes:{from:u.from,insert:f},range:ot.cursor(c.from+f.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:ot.cursor(l.from+c.length)}}):r=n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Wc.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft};Wc.wheel=Wc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};_h.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Wc.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};Wc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};_h.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(Vnt))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=$3n(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new M3n(e,t,n,r)),r&&e.observer.ignore(()=>{Rnt(e.contentDOM);let o=e.root.activeElement;o&&!o.contains(e.contentDOM)&&o.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function nMe(e,t,n,r){if(r==1)return ot.cursor(t,n);if(r==2)return h3n(e.state,t,n);{let i=e.docView.lineAt(t,n),o=e.state.doc.lineAt(i?i.posAtEnd:t),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return aDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(iMe+1)%3:1}function $3n(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=frt(t),i=e.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=e.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),c,u=nMe(e,l.pos,l.assoc,r);if(n.pos!=l.pos&&!s){let f=nMe(e,n.pos,n.assoc,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=N3n(i,l.pos))?c:a?i.addRange(u):ot.create([u])}}}function N3n(e,t){for(let n=0;n=t)return ot.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}_h.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=ot.range(o,s))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",oW(e.state,jge,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};_h.dragend=e=>(e.inputState.draggedContent=null,!1);function sMe(e,t,n,r){if(n=oW(e.state,zge,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:o}=e.inputState,s=r&&o&&R3n(e,t)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}_h.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&sMe(e,t,r.filter(s=>s!=null).join(e.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=t.dataTransfer.getData("Text");if(r)return sMe(e,t,r,!0),!0}return!1};_h.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=crt?null:t.clipboardData;return n?(urt(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(L3n(e),!1)};function z3n(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function j3n(e){let t=[],n=[],r=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let i=-1;for(let{from:o}of e.selection.ranges){let s=e.doc.lineAt(o);s.number>i&&(t.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),i=s.number}r=!0}return{text:oW(e,jge,t.join(e.lineBreak)),ranges:n,linewise:r}}let Fie=null;_h.copy=_h.cut=(e,t)=>{if(!aA(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=j3n(e.state);if(!n&&!i)return!1;Fie=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=crt?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(z3n(e,n),!1)};const drt=Mg.define();function hrt(e,t){let n=[];for(let r of e.facet(Gnt)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:drt.of(!0)}):null}function prt(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=hrt(e.state,t);n?e.dispatch(n):e.update([])}},10)}Wc.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),prt(e)};Wc.blur=e=>{e.observer.clearSelectionRange(),prt(e)};Wc.compositionstart=Wc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Wc.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Yt.chrome&&Yt.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Wc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};_h.beforeinput=(e,t)=>{var n,r;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let o=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=t.getTargetRanges();if(o&&s.length){let a=s[0],l=e.posAtDOM(a.startContainer,a.startOffset),c=e.posAtDOM(a.endContainer,a.endOffset);return Wge(e,{from:l,to:c,insert:e.state.toText(o)},null),!0}}let i;if(Yt.chrome&&Yt.android&&(i=art.find(o=>o.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Yt.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),Yt.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Wc.compositionend(e,t),20),!1};const aMe=new Set;function B3n(e){aMe.has(e)||(aMe.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const lMe=["pre-wrap","normal","pre-line","break-spaces"];let $E=!1;function cMe(){$E=!1}class U3n{constructor(t){this.lineWrapping=t,this.doc=Yr.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return lMe.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let r=0;r-1,l=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>n5&&($E=!0),this.height=t)}replace(t,n,r){return Gl.of(r)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,Yi.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Yi.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=t[r];a.break?t.splice(r,1,a.left,null,a.right):t.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(this.lineAt(0,Yi.ByPos,r,i,o))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class pu extends grt{constructor(t,n,r){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(t,n){return new Kd(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof pu||i instanceof ba&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof ba?i=new pu(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Gl.of(r)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ba extends Gl{constructor(t){super(t,0)}heightMetrics(t,n){let r=t.doc.lineAt(n).number,i=t.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(t.lineWrapping){let l=Math.min(this.height,t.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(t,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(t0){let o=r[r.length-1];o instanceof ba?r[r.length-1]=new ba(o.length+i):r.push(null,new ba(i-1))}if(t>0){let o=r[0];o instanceof ba?r[0]=new ba(t+o.length):r.unshift(new ba(t-1),null)}return Gl.of(r)}decomposeLeft(t,n){n.push(new ba(t-1),null)}decomposeRight(t,n){n.push(null,new ba(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new ba(i.from-n-1).updateHeight(t,n));a<=o&&i.more;){let u=t.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++],d=0;f<0&&(d=-f,f=i.heights[i.index++]),l==-1?l=f:Math.abs(f-l)>=n5&&(l=-2);let h=new pu(u,f,d);h.outdated=!1,s.push(h),a+=u+1}a<=o&&s.push(null,new ba(o-a).updateHeight(t,a));let c=Gl.of(s);return(l<0||Math.abs(c.height-this.height)>=n5||Math.abs(l-this.heightMetrics(t,n).perLine)>=n5)&&($E=!0),u4(this,c)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class H3n extends Gl{constructor(t,n,r){super(t.length+n+r.length,t.height+r.height,n|(t.outdated||r.outdated?2:0)),this.left=t,this.right=r,this.size=t.size+r.size}get break(){return this.flags&1}blockAt(t,n,r,i){let o=r+this.left.height;return ta))return c;let u=n==Yi.ByPosNoHeight?Yi.ByPosNoHeight:Yi.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(t,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)t=l&&this.right.forEachLine(t,n,r,a,l,s);else{let c=this.lineAt(l,Yi.ByPos,r,i,o);t=t&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(t,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-i,n-i,r));let o=[];t>0&&this.decomposeLeft(t,o);let s=o.length;for(let a of r)o.push(a);if(t>0&&uMe(o,s-1),n=r&&n.push(null)),t>r&&this.right.decomposeLeft(t-r,n)}decomposeRight(t,n){let r=this.left.length,i=r+this.break;if(t>=i)return this.right.decomposeRight(t-i,n);t2*n.size||n.size>2*t.size?Gl.of(this.break?[t,null,n]:[t,n]):(this.left=u4(this.left,t),this.right=u4(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(t,n,r,i):o.updateHeight(t,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(t,a,r,i):s.updateHeight(t,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function uMe(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof ba&&(r=e[t+1])instanceof ba&&e.splice(t-1,3,new ba(n.length+1+r.length))}const G3n=5;class Hge{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof pu?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new pu(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,r){if(t=G3n)&&this.addLineDeco(i,o,s)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new pu(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let r=new ba(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof pu)return t;let n=new pu(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof pu)&&!this.isCovered?this.nodes.push(new pu(0,-1,0)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,d.top),l=Math.min(c==e.parentNode?i.innerHeight:l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function Q3n(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function K3n(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class IX{constructor(t,n,r,i){this.from=t,this.to=n,this.size=r,this.displaySize=i}static same(t,n){if(t.length!=n.length)return!1;for(let r=0;rtypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new U3n(r),this.stateDeco=hMe(n),this.heightMap=Gl.empty().applyChanges(this.stateDeco,Yr.empty,this.heightOracle.setDoc(n.doc),[new kf(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=yn.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!t.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);t.push(new QN(o,s))}}return this.viewports=t.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?dMe:new Gge(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(wM(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=hMe(this.state);let i=t.changedRanges,o=kf.extendWithRanges(i,q3n(r,this.stateDeco,t?t.changes:ks.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);cMe(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||$E)&&(t.flags|=2),a?(this.scrollAnchorPos=t.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=o.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Xnt)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Bi.RTL:Bi.LTR;let s=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent==="refresh",a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:S,scaleY:_}=Mnt(n,a);(S>.005&&Math.abs(this.scaleX-S)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=S,this.scaleY=_,c|=16,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=16);let h=Ant(this.view.contentDOM,!1).y;h!=this.scrollParent&&(this.scrollParent=h,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Int(this.scrollParent||t.win);let g=(this.printing?K3n:Y3n)(n,this.paddingTop),m=g.top-this.pixelViewport.top,v=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(l=!0)),!this.inView&&!this.scrollTarget&&!Q3n(t.dom))return 0;let b=a.width;if((this.contentDOMWidth!=b||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=t.scrollDOM.clientHeight,c|=16),l){let S=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(s=!0),s||i.lineWrapping&&Math.abs(b-this.contentDOMWidth)>i.charWidth){let{lineHeight:_,charWidth:E,textHeight:T}=t.docView.measureTextSize();s=_>0&&i.refresh(o,_,E,T,Math.max(5,b/E),S),s&&(t.docView.minWidth=0,c|=16)}m>0&&v>0?u=Math.max(m,v):m<0&&v<0&&(u=Math.min(m,v)),cMe();for(let _ of this.viewports){let E=_.from==this.viewport.from?S:t.docView.measureVisibleLineHeights(_);this.heightMap=(s?Gl.empty().applyChanges(this.stateDeco,Yr.empty,this.heightOracle,[new kf(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new V3n(_.from,E))}$E&&(c|=2)}let w=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new QN(i.lineAt(s-r*1e3,Yi.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,Yi.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Yi.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=Bi.LTR&&!r)return[];let a=[],l=(u,f,d,h)=>{if(f-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromy));if(!m){if(fb.from<=f&&b.to>=f)){let b=n.moveToLineBoundary(ot.cursor(f),!1,!0).head;b>u&&(f=b)}let v=this.gapSize(d,u,f,h),y=r||v<2e6?v:2e6;m=new IX(u,f,v,y)}a.push(m)},c=u=>{if(u.length2e6)for(let _ of t)_.from>=u.from&&_.fromu.from&&l(u.from,h,u,f),pn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Cr.spans(n,this.viewport.from,this.viewport.to,{span(o,s){r.push({from:o,to:s})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let o=0;o=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||wM(this.heightMap.lineAt(t,Yi.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||wM(this.heightMap.lineAt(this.scaler.fromDOM(t),Yi.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return wM(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class QN{constructor(t,n){this.from=t,this.to=n}}function J3n(e,t,n){let r=[],i=e,o=0;return Cr.spans(n,e,t,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let i=0;;i++){let{from:o,to:s}=t[i],a=s-o;if(r<=a)return o+r;r-=a}}function ZN(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function ezn(e,t){for(let n of e)if(t(n))return n}const dMe={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function hMe(e){let t=e.facet(nW).filter(r=>typeof r!="function"),n=e.facet(Uge).filter(r=>typeof r!="function");return n.length&&t.push(Cr.join(n)),t}class Gge{constructor(t,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,Yi.ByPos,t,0,0).top,u=n.lineAt(l,Yi.ByPos,t,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(t){for(let n=0,r=0,i=0;;n++){let o=nn.from==t.viewports[r].from&&n.to==t.viewports[r].to):!1}}function wM(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new Kd(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>wM(i,t)):e._content)}const JN=Jt.define({combine:e=>e.join(" ")}),$ie=Jt.define({combine:e=>e.indexOf(!0)>-1}),Nie=cb.newName(),mrt=cb.newName(),vrt=cb.newName(),yrt={"&light":"."+mrt,"&dark":"."+vrt};function zie(e,t,n){return new cb(t,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return e;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):e+" "+r}})}const tzn=zie("."+Nie,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},yrt),nzn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},DX=Yt.ie&&Yt.ie_version<=11;class rzn{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new INn,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Yt.ie&&Yt.ie_version<=11||Yt.ios&&t.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Yt.android&&t.constructor.EDIT_CONTEXT!==!1&&!(Yt.chrome&&Yt.chrome_version<126)&&(this.editContext=new ozn(t),t.state.facet(Tm)&&(t.contentDOM.editContext=this.editContext.editContext)),DX&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,r)=>n!=t[r]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Tm)?r.root.activeElement!=this.dom:!aA(this.dom,i))return;let o=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(Yt.ie&&Yt.ie_version<=11||Yt.android&&Yt.chrome)&&!r.state.selection.main.empty&&i.focusNode&&cA(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=BR(t.root);if(!n)return!1;let r=Yt.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&izn(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=aA(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&SO(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of t){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&aA(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new S3n(this.view,t,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=ort(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!c4(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let r=pMe(n,t.previousSibling||t.target.previousSibling,-1),i=pMe(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Tm)!=t.state.facet(Tm)&&(t.view.contentDOM.editContext=t.state.facet(Tm)?this.editContext.editContext:null))}destroy(){var t,n,r;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function pMe(e,t,n){for(;t;){let r=Uo.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function gMe(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return cA(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function izn(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return gMe(e,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?gMe(e,n):null}class ozn{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=r=>{let i=t.state.selection.main,{anchor:o,head:s}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>r.text.length;a==this.from&&othis.to&&(l=o);let u=srt(t.state.sliceDoc(a,l),r.text,(c?i.from:i.to)-a,c?"end":null);if(!u){let d=ot.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));c4(d,i)||t.dispatch({selection:d,userEvent:"select"});return}let f={from:u.from+a,to:u.toA+a,insert:Yr.of(r.text.slice(u.from,u.toB).split(` +`))};if((Yt.mac||Yt.android)&&f.from==s-1&&/^\. ?$/.test(r.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:Yr.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let d=this.to-this.from+(f.to-f.from+f.insert.length);Wge(t,f,ot.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(a)){let l=this.toEditorPos(o.rangeStart),c=this.toEditorPos(o.rangeEnd);if(l{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(t.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=BR(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,r=!1,i=this.pendingContextChange;return t.changes.iterChanges((o,s,a,l,c)=>{if(r)return;let u=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(t.state);if(o+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(othis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(t.state),!r}update(t){let n=this.pendingContextChange,r=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(r.from,r.to)&&t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let r=this.composing;return r&&r.drifted?r.editorBase+(t-r.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Gt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:r}=t;this.dispatchTransactions=t.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||DNn(t.parent)||document,this.viewState=new fMe(this,t.state||kr.create(t)),t.scrollTo&&t.scrollTo.is(qN)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(VC).map(i=>new PX(i));for(let i of this.plugins)i.update(this);this.observer=new rzn(this),this.inputState=new E3n(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Z2e(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof vs?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let d of t){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;t.some(d=>d.annotation(drt))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=hrt(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(kr.phrases)!=this.state.facet(kr.phrases))return this.setState(o);i=s4.create(this,o,t),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of t){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new _O(h.empty?h:ot.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(qN)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=f4.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(xM)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(JN)!=i.state.facet(JN)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Rie))try{d(i)}catch(h){Ec(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!ort(this,u)&&c.force&&SO(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new fMe(this,t),this.plugins=t.facet(VC).map(r=>new PX(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Z2e(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(VC),r=t.state.facet(VC);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new PX(o));else{let a=this.plugins[s];a.mustUpdate=t,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=t&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=t;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(Int(r||this.win))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return Ec(this.state,p),mMe}}),f=s4.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+p,r?r.scrollTop+=p:this.win.scrollBy(0,p),s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Rie))a(n)}get themeClasses(){return Nie+" "+(this.state.facet($ie)?vrt:mrt)+" "+this.state.facet(JN)}updateAttrs(){let t=vMe(this,Knt,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Tm)?"true":"false",class:"cm-content",style:`${Yt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),vMe(this,Bge,n);let r=this.observer.ignore(()=>{let i=G2e(this.contentDOM,this.contentAttrs,n),o=G2e(this.dom,this.editorAttrs,t);return i||o});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let i of r.effects)if(i.is(Gt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(xM);let t=this.state.facet(Gt.cspNonce);cb.mount(this.root,this.styleModules.concat(tzn).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;nr.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return RX(this,t,J2e(this,t,n,r))}moveByGroup(t,n){return RX(this,t,J2e(this,t,n,r=>m3n(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),i=this.textDirectionAt(t.from),o=r[n?r.length-1:0];return ot.cursor(o.side(n,i)+t.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return g3n(this,t,n,r)}moveVertically(t,n,r){return RX(this,t,v3n(this,t,n,r))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let r=Lie(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),Lie(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.docView.coordsAt(t,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(t),o=this.bidiSpans(i),s=o[Pp.find(o,t-i.from,-1,n)];return UR(r,s.dir==Bi.LTR==n>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(qnt)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>szn)return znt(t.length);let n=this.textDirectionAt(t.from),r;for(let o of this.bidiCache)if(o.from==t.from&&o.dir==n&&(o.fresh||Nnt(o.isolates,r=Y2e(this,t))))return o.order;r||(r=Y2e(this,t));let i=UNn(t.text,n,r);return this.bidiCache.push(new f4(t.from,t.to,n,r,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Yt.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Rnt(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){return qN.of(new _O(typeof t=="number"?ot.cursor(t):t,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return qN.of(new _O(ot.cursor(r.from),"start","start",r.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Ho.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Ho.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=cb.newName(),i=[JN.of(r),xM.of(zie(`.${r}`,t))];return n&&n.dark&&i.push($ie.of(!0)),i}static baseTheme(t){return Ub.lowest(xM.of(zie("."+Nie,t,yrt)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&Uo.get(r)||Uo.get(t);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}Gt.styleModule=xM;Gt.inputHandler=Hnt;Gt.clipboardInputFilter=zge;Gt.clipboardOutputFilter=jge;Gt.scrollHandler=Ynt;Gt.focusChangeEffect=Gnt;Gt.perLineTextDirection=qnt;Gt.exceptionSink=Wnt;Gt.updateListener=Rie;Gt.editable=Tm;Gt.mouseSelectionStyle=Vnt;Gt.dragMovesSelection=Unt;Gt.clickAddsSelectionRange=Bnt;Gt.decorations=nW;Gt.blockWrappers=Znt;Gt.outerDecorations=Uge;Gt.atomicRanges=DL;Gt.bidiIsolatedRanges=Jnt;Gt.scrollMargins=ert;Gt.darkTheme=$ie;Gt.cspNonce=Jt.define({combine:e=>e.length?e[0]:""});Gt.contentAttributes=Bge;Gt.editorAttributes=Knt;Gt.lineWrapping=Gt.contentAttributes.of({class:"cm-lineWrapping"});Gt.announce=Vn.define();const szn=4096,mMe={};class f4{constructor(t,n,r,i,o,s){this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(t,n){if(n.empty&&!t.some(o=>o.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:Bi.LTR;for(let o=Math.max(0,t.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(e):o;s&&Fge(s,n)}return n}const azn=Yt.mac?"mac":Yt.windows?"win":Yt.linux?"linux":"key";function lzn(e,t){const n=e.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),n}function uzn(e,t,n){return xrt(brt(e.state),t,e,n)}let n0=null;const fzn=4e3;function dzn(e,t=azn){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(v=>lzn(v,t));for(let v=1;v{let w=n0={view:b,prefix:y,scope:s};return setTimeout(()=>{n0==w&&(n0=null)},fzn),!0}]})}let g=p.join(" ");i(g,!1);let m=h[g]||(h[g]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&m.run.push(l),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of e){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let d in u)u[d].run.push(h=>f(h,jie))}let l=s[t]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let jie=null;function xrt(e,t,n,r){jie=t;let i=ENn(t),o=yc(i,0),s=wp(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;n0&&n0.view==n&&n0.scope==r&&(a=n0.prefix+" ",lrt.indexOf(t.keyCode)<0&&(c=!0,n0=null));let f=new Set,d=m=>{if(m){for(let v of m.run)if(!f.has(v)&&(f.add(v),v(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},h=e[r],p,g;return h&&(d(h[a+e3(i,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Yt.windows&&t.ctrlKey&&t.altKey)&&!(Yt.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=ub[t.keyCode])&&p!=i?(d(h[a+e3(p,t,!0)])||t.shiftKey&&(g=zR[t.keyCode])!=i&&g!=p&&d(h[a+e3(g,t,!1)]))&&(l=!0):s&&t.shiftKey&&d(h[a+e3(i,t,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&t.stopPropagation(),jie=null,l}class B1{constructor(t,n,r,i,o){this.className=t,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=wrt(t);return[new B1(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return hzn(t,n,r)}}function wrt(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Bi.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function bMe(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let o=e.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function hzn(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==Bi.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=wrt(e),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=Die(e,r,1),p=Die(e,i,-1),g=h.type==Fa.Text?h:null,m=p.type==Fa.Text?p:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=bMe(e,r,1,g)),m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=bMe(e,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(b(n.from,n.to,g));{let S=g?b(n.from,null,g):w(h,!1),_=m?b(null,n.to,m):w(p,!0),E=[];return(g||h).to<(m||p).from-(g&&m?1:0)||h.widgetLineBreaks>1&&S.bottom+e.defaultLineHeight/2<_.top?E.push(v(f,S.bottom,d,_.top)):S.bottom<_.top&&e.elementAtHeight((S.bottom+_.top)/2).type==Fa.Text&&(S.bottom=_.top=(S.bottom+_.top)/2),y(S).concat(E).concat(y(_))}function v(S,_,E,T){return new B1(t,S-l.left,_-l.top,Math.max(0,E-S),T-_)}function y({top:S,bottom:_,horizontal:E}){let T=[];for(let k=0;kR&&A.from=$)break;z>L&&I(Math.max(U,L),S==null&&U<=R,Math.min(z,$),_==null&&z>=F,V.dir)}if(L=j.to+1,L>=$)break}return P.length==0&&I(R,S==null,F,_==null,e.textDirection),{top:T,bottom:k,horizontal:P}}function w(S,_){let E=a.top+(_?S.top:S.bottom);return{top:E,bottom:E,horizontal:[]}}}function pzn(e,t){return e.constructor==t.constructor&&e.eq(t)}class gzn{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(r5)!=t.state.facet(r5)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,r=t.facet(r5);for(;n!pzn(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of t)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=t,Yt.safari&&Yt.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const r5=Jt.define();function Srt(e){return[Ho.define(t=>new gzn(t,e)),r5.of(e)]}const NE=Jt.define({combine(e){return Ag(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function mzn(e={}){return[NE.of(e),vzn,yzn,bzn,Xnt.of(!0)]}function _rt(e){return e.startState.facet(NE)!=e.state.facet(NE)}const vzn=Srt({above:!0,markers(e){let{state:t}=e,n=t.facet(NE),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(o&&Yt.ios&&n.iosSelectionHandles)){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:ot.cursor(i.head,i.assoc);for(let l of B1.forRange(e,s,a))r.push(l)}}return r},update(e,t){e.transactions.some(r=>r.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=_rt(e);return n&&xMe(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){xMe(t.state,e)},class:"cm-cursorLayer"});function xMe(e,t){t.style.animationDuration=e.facet(NE).cursorBlinkRate+"ms"}const yzn=Srt({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let i of r)if(!i.empty)for(let o of B1.forRange(e,"cm-selectionBackground",i))t.push(o);if(Yt.ios&&!n.empty&&e.state.facet(NE).iosSelectionHandles){for(let i of B1.forRange(e,"cm-selectionHandle cm-selectionHandle-start",ot.cursor(n.from,1)))t.push(i);for(let i of B1.forRange(e,"cm-selectionHandle cm-selectionHandle-end",ot.cursor(n.to,1)))t.push(i)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||_rt(e)},class:"cm-selectionLayer"}),bzn=Ub.highest(Gt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Crt=Vn.define({map(e,t){return e==null?null:t.mapPos(e)}}),SM=za.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(Crt)?r.value:n,e)}}),xzn=Ho.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(SM);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(SM)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(SM),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(SM)!=e&&this.view.dispatch({effects:Crt.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function wzn(){return[SM,xzn]}function wMe(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=t.exec(o.value);)i(s+a.index,a)}function Szn(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class _zn{constructor(t){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(t){let n=new gv,r=n.add.bind(n);for(let{from:i,to:o}of Szn(t,this.maxLength))wMe(t.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,t,s,r));return n.finish()}updateDeco(t,n){let r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges((o,s,a,l)=>{l>=t.view.viewport.from&&a<=t.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),t.viewportMoved||i-r>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}updateRange(t,n,r,i){for(let o of t.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>=s){let l=t.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;ad.push(v.range(g,m));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(m,t,g,p));n=n.update({filterFrom:u,filterTo:f,filter:(g,m)=>gf,add:d})}}return n}}const Bie=/x/.unicode!=null?"gu":"g",Czn=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Bie),Ozn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let LX=null;function Ezn(){var e;if(LX==null&&typeof document<"u"&&document.body){let t=document.body.style;LX=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return LX||!1}const i5=Jt.define({combine(e){let t=Ag(e,{render:null,specialChars:Czn,addSpecialChars:null});return(t.replaceTabs=!Ezn())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Bie)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Bie)),t}});function Tzn(e={}){return[i5.of(e),Pzn()]}let SMe=null;function Pzn(){return SMe||(SMe=Ho.fromClass(class{constructor(e){this.view=e,this.decorations=yn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(i5)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new _zn({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=yc(t[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=mP(s.text,a,r-s.from);return yn.replace({widget:new Rzn((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=yn.replace({widget:new Azn(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(i5);e.startState.facet(i5)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const kzn="•";function Mzn(e){return e>=32?kzn:e==10?"␤":String.fromCharCode(9216+e)}class Azn extends Lh{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=Mzn(this.code),r=t.state.phrase("Control character")+" "+(Ozn[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Rzn extends Lh{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function Izn(){return Lzn}const Dzn=yn.line({class:"cm-activeLine"}),Lzn=Ho.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(Dzn.range(i.from)),t=i.from)}return yn.set(n)}},{decorations:e=>e.decorations});class Fzn extends Lh{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?lA(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=UR(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function $zn(e){let t=Ho.fromClass(class{constructor(n){this.view=n,this.placeholder=e?yn.set([yn.widget({widget:new Fzn(e),side:1}).range(0)]):yn.none}get decorations(){return this.view.state.doc.length?yn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Gt.contentAttributes.of({"aria-placeholder":e})]:t}const Uie=2e3;function Nzn(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>Uie||n.off>Uie||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let l=r;l<=i;l++){let c=e.doc.line(l);c.length<=a&&o.push(ot.range(c.from+s,c.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let l=r;l<=i;l++){let c=e.doc.line(l),u=wie(c.text,s,e.tabSize,!0);if(u<0)o.push(ot.cursor(c.to));else{let f=wie(c.text,a,e.tabSize);o.push(ot.range(c.from+u,c.from+f))}}}return o}function zzn(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function _Me(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>Uie?-1:i==r.length?zzn(e,t.clientX):mP(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function jzn(e,t){let n=_Me(e,t),r=e.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=_Me(e,i);if(!a)return r;let l=Nzn(e.state,n,a);return l.length?s?ot.create(l.concat(r.ranges)):ot.create(l):r}}:null}function Bzn(e){let t=(n=>n.altKey&&n.button==0);return Gt.mouseSelectionStyle.of((n,r)=>t(r)?jzn(n,r):null)}const Uzn={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Vzn={style:"cursor: crosshair"};function Wzn(e={}){let[t,n]=Uzn[e.key||"Alt"],r=Ho.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==t||n(i))},keyup(i){(i.keyCode==t||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,Gt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?Vzn:null})]}const t3="-10000px";class Ort{constructor(t,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(t,n){var r;let i=t.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(t);return!1}let s=[],a=n?[]:null;for(let l=0;ln[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function Hzn(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const FX=Jt.define({combine:e=>{var t,n,r;return{position:Yt.ios?"absolute":((t=e.find(i=>i.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=e.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||Hzn}}}),CMe=new WeakMap,qge=Ho.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(FX);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ort(e,Xge,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(FX);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=t3,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(e=r.destroy)===null||e===void 0||e.call(r);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(Yt.safari){let s=o.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}else n=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(e=o.width/this.parent.offsetWidth,t=o.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=Vge(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(FX).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:o}=e,s=[];for(let a=0;a=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1)){u.style.top=t3;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,g=d.right-d.left,m=(t=CMe.get(c))!==null&&t!==void 0?t:d.bottom-d.top,v=c.offset||qzn,y=this.view.textDirection==Bi.LTR,b=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+v.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(h?14:0)-v.x),r.right-g),w=this.above[a];!l.strictSide&&(w?f.top-m-p-v.yr.bottom)&&w==r.bottom-f.bottom>f.top-r.top&&(w=this.above[a]=!w);let S=(w?f.top-r.top:r.bottom-f.bottom)-p;if(Sb&&T.top<_+m&&T.bottom>_&&(_=w?T.top-m-2-p:T.bottom+p+2);if(this.position=="absolute"?(u.style.top=(_-e.parent.top)/o+"px",OMe(u,(b-e.parent.left)/i)):(u.style.top=_/o+"px",OMe(u,b/i)),h){let T=f.left+(y?v.x:-v.x)-(b+14-7);h.style.left=T/i+"px"}c.overlap!==!0&&s.push({left:b,top:_,right:E,bottom:_+m}),u.classList.toggle("cm-tooltip-above",w),u.classList.toggle("cm-tooltip-below",!w),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=t3}},{eventObservers:{scroll(){this.maybeMeasure()}}});function OMe(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const Gzn=Gt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),qzn={x:0,y:0},Xge=Jt.define({enables:[qge,Gzn]}),d4=Jt.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class sW{static create(t){return new sW(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ort(t,d4,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(t,n){let r=t.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let r of this.manager.tooltipViews){let i=r[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Xzn=Xge.compute([d4],e=>{let t=e.facet(d4);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:sW.create,above:t[0].above,arrow:t.some(n=>n.arrow)}});class Yzn{constructor(t,n,r,i,o){this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ta.bottom||n.xa.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==Bi.RTL?-1:1;o=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Ec(t.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let t=this.view.plugin(qge),n=t?t.manager.tooltips.findIndex(r=>r.create==sW.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,r;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!Qzn(o.dom,t)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!Kzn(this.view,s,a,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(t.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=r=>{t.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const n3=4;function Qzn(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let a=s.getBoundingClientRect();i=Math.min(a.top,i),o=Math.max(a.bottom,o)}return t.clientX>=n-n3&&t.clientX<=r+n3&&t.clientY>=i-n3&&t.clientY<=o+n3}function Kzn(e,t,n,r,i,o){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,a)=t&&l<=n}function Zzn(e,t={}){let n=Vn.define(),r=za.define({create(){return[]},update(i,o){if(i.length&&(t.hideOnChange&&(o.docChanged||o.selection)?i=[]:t.hideOn&&(i=i.filter(s=>!t.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,Pa.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(Jzn)&&(i=[]);return i},provide:i=>d4.from(i)});return{active:r,extension:[r,Ho.define(i=>new Yzn(i,e,r,n,t.hoverTime||300)),Xzn]}}function Ert(e,t){let n=e.plugin(qge);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const Jzn=Vn.define(),EMe=Jt.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function Yge(e,t){let n=e.plugin(Trt),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const Trt=Ho.fromClass(class{constructor(e){this.input=e.state.facet(WR),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(EMe);this.top=new r3(e,!0,t.topContainer),this.bottom=new r3(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(EMe);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new r3(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new r3(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(WR);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(e.view),a.push(u)):(u=this.panels[c],u.update&&u.update(e)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Gt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class r3{constructor(t,n,r){this.view=t,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=TMe(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=TMe(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function TMe(e){let t=e.nextSibling;return e.remove(),t}const WR=Jt.define({enables:Trt});function e5n(e,t){let n,r=new Promise(s=>n=s),i=s=>t5n(s,t,n);e.state.field($X,!1)?e.dispatch({effects:Prt.of(i)}):e.dispatch({effects:Vn.appendConfig.of($X.init(()=>[i]))});let o=krt.of(i);return{close:o,result:r.then(s=>((e.win.queueMicrotask||(l=>e.win.setTimeout(l,10)))(()=>{e.state.field($X).indexOf(i)>-1&&e.dispatch({effects:o})}),s))}}const $X=za.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(Prt)?e=[n.value].concat(e):n.is(krt)&&(e=e.filter(r=>r!=n.value));return e},provide:e=>WR.computeN([e],t=>t.field(e))}),Prt=Vn.define(),krt=Vn.define();function t5n(e,t,n){let r=t.content?t.content(e,()=>s(null)):null;if(!r){if(r=Ai("form"),t.input){let a=Ai("input",t.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(Ai("label",(t.label||"")+": ",a))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(Ai("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a{c.keyCode==27?(c.preventDefault(),s(null)):c.keyCode==13&&(c.preventDefault(),s(l))}),l.addEventListener("submit",c=>{c.preventDefault(),s(l)})}let o=Ai("div",r,Ai("button",{onclick:()=>s(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(o.className=t.class),o.classList.add("cm-dialog");function s(a){o.contains(o.ownerDocument.activeElement)&&e.focus(),n(a)}return{dom:o,top:t.top,mount:()=>{if(t.focus){let a;typeof t.focus=="string"?a=r.querySelector(t.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class vv extends lb{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}vv.prototype.elementClass="";vv.prototype.toDOM=void 0;vv.prototype.mapMode=Pa.TrackBefore;vv.prototype.startSide=vv.prototype.endSide=-1;vv.prototype.point=!0;const o5=Jt.define(),n5n=Jt.define(),r5n={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Cr.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},fA=Jt.define();function i5n(e){return[Mrt(),fA.of({...r5n,...e})]}const PMe=Jt.define({combine:e=>e.some(t=>t)});function Mrt(e){return[o5n]}const o5n=Ho.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(fA).map(t=>new MMe(e,t)),this.fixed=!e.state.facet(PMe);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(PMe)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Cr.iter(this.view.state.facet(o5),this.view.viewport.from),r=[],i=this.gutters.map(o=>new s5n(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==Fa.Text&&s){Vie(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==Fa.Text){Vie(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(fA),n=e.state.facet(fA),r=e.docChanged||e.heightChanged||e.viewportChanged||!Cr.eq(e.startState.facet(o5),e.state.facet(o5),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let i of this.gutters)i.update(e)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=t.indexOf(o);s<0?i.push(new MMe(this.view,o)):(this.gutters[s].update(e),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Gt.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Bi.LTR?{left:r,right:i}:{right:r,left:i}})});function kMe(e){return Array.isArray(e)?e:[e]}function Vie(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class s5n{constructor(t,n,r){this.gutter=t,this.height=r,this.i=0,this.cursor=Cr.iter(t.markers,n.from)}addElement(t,n,r){let{gutter:i}=this,o=(n.top-this.height)/t.scaleY,s=n.height/t.scaleY;if(this.i==i.elements.length){let a=new Art(t,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(t,s,o,r);this.height=n.bottom,this.i++}line(t,n,r){let i=[];Vie(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(t,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(t,n,i)}widget(t,n){let r=this.gutter.config.widgetMarker(t,n.widget,n),i=r?[r]:null;for(let o of t.state.facet(n5n)){let s=o(t,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(t,n,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class MMe{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=t.lineBlockAtHeight(s-t.documentTop);n.domEventHandlers[r](t,a,i)&&i.preventDefault()});this.markers=kMe(n.markers(t)),n.initialSpacer&&(this.spacer=new Art(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=kMe(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let r=t.view.viewport;return!Cr.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class Art{constructor(t,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}update(t,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),a5n(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class NX extends vv{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function zX(e,t){return e.state.facet(WC).formatNumber(t,e.state)}const u5n=fA.compute([WC],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(l5n)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new NX(zX(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,r)=>{for(let i of t.state.facet(c5n)){let o=i(t,n,r);if(o)return o}return null},lineMarkerChange:t=>t.startState.facet(WC)!=t.state.facet(WC),initialSpacer(t){return new NX(zX(t,AMe(t.state.doc.lines)))},updateSpacer(t,n){let r=zX(n.view,AMe(n.view.state.doc.lines));return r==t.number?t:new NX(r)},domEventHandlers:e.facet(WC).domEventHandlers,side:"before"}));function f5n(e={}){return[WC.of(e),Mrt(),u5n]}function AMe(e){let t=9;for(;t{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(d5n.range(i)))}return Cr.of(t)});function p5n(){return h5n}var jX;const HC=new br;function g5n(e){return Jt.define({combine:e?t=>t.concat(e):void 0})}const m5n=new br;class rh{constructor(t,n,r=[],i=""){this.data=t,this.name=i,kr.prototype.hasOwnProperty("tree")||Object.defineProperty(kr.prototype,"tree",{get(){return ca(this)}}),this.parser=n,this.extension=[db.of(this),kr.languageData.of((o,s,a)=>{let l=RMe(o,s,a),c=l.type.prop(HC);if(!c)return[];let u=o.facet(c),f=l.type.prop(m5n);if(f){let d=l.resolve(s-l.from,a);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(t,n,r=-1){return RMe(t,n,r).type.prop(HC)==this.data}findRegions(t){let n=t.facet(db);if(n?.data==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(HC)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(br.mounted);if(a){if(a.tree.prop(HC)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),t.name)}configure(t,n){return new HR(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ca(e){let t=e.field(rh.state,!1);return t?t.tree:rs.empty}class v5n{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let r=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-r,n-r)}}let m2=null;class h4{constructor(t,n,r=[],i,o,s,a,l){this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new h4(t,n,[],rs.empty,0,r,[],null)}startParse(){return this.parser.startParse(new v5n(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=rs.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(j1.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=m2;m2=this;try{return t()}finally{m2=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=IMe(t,n.from,n.to);return t}changes(t,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!t.empty){let l=[];if(t.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=j1.applyChanges(r,l),i=rs.empty,o=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);ut.from&&(this.fragments=IMe(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends Ztt{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=m2;if(l){for(let c of i)l.tempSkipped.push(c);t&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,t]):t)}return this.parsedPos=s,new rs(Vc.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return m2}}function IMe(e,t,n){return j1.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class zE{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new zE(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=h4.create(t.facet(db).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new zE(r)}}rh.state=za.define({create:zE.init,update(e,t){for(let n of t.effects)if(n.is(rh.setState))return n.value;return t.startState.facet(db)!=t.state.facet(db)?zE.init(t.state):e.apply(t)}});let Rrt=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Rrt=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const BX=typeof navigator<"u"&&(!((jX=navigator.scheduling)===null||jX===void 0)&&jX.isInputPending)?()=>navigator.scheduling.isInputPending():null,y5n=Ho.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(rh.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(rh.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=Rrt(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>BX&&BX()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:rh.setState.of(new zE(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ec(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),db=Jt.define({combine(e){return e.length?e[0]:null},enables:e=>[rh.state,y5n,Gt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Irt{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const b5n=Jt.define(),FL=Jt.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function p4(e){let t=e.facet(FL);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function GR(e,t){let n="",r=e.tabSize,i=e.facet(FL)[0];if(i==" "){for(;t>=r;)n+=" ",t-=r;i=" "}for(let o=0;o=t?x5n(e,n,t):null}class aW{constructor(t,n={}){this.state=t,this.options=n,this.unit=p4(t)}lineAt(t,n=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==t?{text:"",from:t}:(n<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(t,n=t.length){return mP(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:r,from:i}=this.lineAt(t,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Kge=new br;function x5n(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s&&!(s.fromr.node.to||s.from==r.node.from&&s.type==r.node.type);s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return Drt(r,e,n)}function Drt(e,t,n){for(let r=e;r;r=r.next){let i=S5n(r.node);if(i)return i(Zge.create(t,n,r))}return 0}function w5n(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function S5n(e){let t=e.type.prop(Kge);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(br.closedBy))){let i=e.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>Lrt(s,!0,1,void 0,o&&!w5n(s)?i.from:void 0)}return e.parent==null?_5n:null}function _5n(){return 0}class Zge extends aW{constructor(t,n,r){super(t.state,t.options),this.base=t,this.pos=n,this.context=r}get node(){return this.context.node}static create(t,n,r){return new Zge(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(C5n(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Drt(this.context.next,this.base,this.pos)}}function C5n(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function O5n(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=t.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let c=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function UX({closing:e,align:t=!0,units:n=1}){return r=>Lrt(r,t,n,e)}function Lrt(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?O5n(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}function DMe({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}const E5n=200;function T5n(){return kr.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+E5n)return e;let o=n.sliceString(i.from,r);if(!t.some(c=>c.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=Qge(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=GR(s,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[e,{changes:l,sequential:!0}]:e})}const P5n=Jt.define(),Jge=new br;function Frt(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(o&&a.from=t&&c.to>n&&(o=c)}}return o}function M5n(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function g4(e,t,n){for(let r of e.facet(P5n)){let i=r(e,t,n);if(i)return i}return k5n(e,t,n)}function $rt(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const lW=Vn.define({map:$rt}),$L=Vn.define({map:$rt});function Nrt(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(r=>r.from<=n&&r.to>=n)||t.push(e.lineBlockAt(n));return t}const Fw=za.define({create(){return yn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((n,r)=>e=LMe(e,n,r)),e=e.map(t.changes);for(let n of t.effects)if(n.is(lW)&&!A5n(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(Brt),i=r?yn.replace({widget:new N5n(r(t.state,n.value))}):FMe;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is($L)&&(e=e.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=LMe(e,t.selection.main.head)),e},provide:e=>Gt.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{it&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(i,o)=>i>=n||o<=t}):e}function m4(e,t,n){var r;let i=null;return(r=e.field(Fw,!1))===null||r===void 0||r.between(t,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function A5n(e,t,n){let r=!1;return e.between(t,t,(i,o)=>{i==t&&o==n&&(r=!0)}),r}function zrt(e,t){return e.field(Fw,!1)?t:t.concat(Vn.appendConfig.of(Urt()))}const R5n=e=>{for(let t of Nrt(e)){let n=g4(e.state,t.from,t.to);if(n)return e.dispatch({effects:zrt(e.state,[lW.of(n),jrt(e,n)])}),!0}return!1},I5n=e=>{if(!e.state.field(Fw,!1))return!1;let t=[];for(let n of Nrt(e)){let r=m4(e.state,n.from,n.to);r&&t.push($L.of(r),jrt(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function jrt(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return Gt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const D5n=e=>{let{state:t}=e,n=[];for(let r=0;r{let t=e.state.field(Fw,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push($L.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},F5n=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:R5n},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:I5n},{key:"Ctrl-Alt-[",run:D5n},{key:"Ctrl-Alt-]",run:L5n}],$5n={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Brt=Jt.define({combine(e){return Ag(e,$5n)}});function Urt(e){return[Fw,B5n]}function Vrt(e,t){let{state:n}=e,r=n.facet(Brt),i=s=>{let a=e.lineBlockAt(e.posAtDOM(s.target)),l=m4(e.state,a.from,a.to);l&&e.dispatch({effects:$L.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const FMe=yn.replace({widget:new class extends Lh{toDOM(e){return Vrt(e,null)}}});class N5n extends Lh{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Vrt(t,this.value)}}const z5n={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class VX extends vv{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function j5n(e={}){let t={...z5n,...e},n=new VX(t,!0),r=new VX(t,!1),i=Ho.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(db)!=s.state.facet(db)||s.startState.field(Fw,!1)!=s.state.field(Fw,!1)||ca(s.startState)!=ca(s.state)||t.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new gv;for(let l of s.viewportLineBlocks){let c=m4(s.state,l.from,l.to)?r:g4(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=t;return[i,i5n({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Cr.empty},initialSpacer(){return new VX(t,!1)},domEventHandlers:{...o,click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=m4(s.state,a.from,a.to);if(c)return s.dispatch({effects:$L.of(c)}),!0;let u=g4(s.state,a.from,a.to);return u?(s.dispatch({effects:lW.of(u)}),!0):!1}}}),Urt()]}const B5n=Gt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class NL{constructor(t,n){this.specs=t;let r;function i(a){let l=cb.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof rh?a=>a.prop(HC)==s.data:s?a=>a==s:void 0,this.style=ent(t.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new cb(r):null,this.themeType=n.themeType}static define(t,n){return new NL(t,n||{})}}const Wie=Jt.define(),Wrt=Jt.define({combine(e){return e.length?[e[0]]:null}});function WX(e){let t=e.facet(Wie);return t.length?t:e.facet(Wrt)}function Hrt(e,t){let n=[V5n],r;return e instanceof NL&&(e.module&&n.push(Gt.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(Wrt.of(e)):r?n.push(Wie.computeN([Gt.darkTheme],i=>i.facet(Gt.darkTheme)==(r=="dark")?[e]:[])):n.push(Wie.of(e)),n}class U5n{constructor(t){this.markCache=Object.create(null),this.tree=ca(t.state),this.decorations=this.buildDeco(t,WX(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=ca(t.state),r=WX(t.state),i=r!=WX(t.startState),{viewport:o}=t.view,s=t.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(n!=this.tree||t.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=o.to)}buildDeco(t,n){if(!n||!this.tree.length)return yn.none;let r=new gv;for(let{from:i,to:o}of t.visibleRanges)HFn(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=yn.mark({class:l})))},i,o);return r.finish()}}const V5n=Ub.high(Ho.fromClass(U5n,{decorations:e=>e.decorations})),W5n=NL.define([{tag:We.meta,color:"#404740"},{tag:We.link,textDecoration:"underline"},{tag:We.heading,textDecoration:"underline",fontWeight:"bold"},{tag:We.emphasis,fontStyle:"italic"},{tag:We.strong,fontWeight:"bold"},{tag:We.strikethrough,textDecoration:"line-through"},{tag:We.keyword,color:"#708"},{tag:[We.atom,We.bool,We.url,We.contentSeparator,We.labelName],color:"#219"},{tag:[We.literal,We.inserted],color:"#164"},{tag:[We.string,We.deleted],color:"#a11"},{tag:[We.regexp,We.escape,We.special(We.string)],color:"#e40"},{tag:We.definition(We.variableName),color:"#00f"},{tag:We.local(We.variableName),color:"#30a"},{tag:[We.typeName,We.namespace],color:"#085"},{tag:We.className,color:"#167"},{tag:[We.special(We.variableName),We.macroName],color:"#256"},{tag:We.definition(We.propertyName),color:"#00c"},{tag:We.comment,color:"#940"},{tag:We.invalid,color:"#f00"}]),H5n=Gt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Grt=1e4,qrt="()[]{}",Xrt=Jt.define({combine(e){return Ag(e,{afterCursor:!0,brackets:qrt,maxScanDistance:Grt,renderMatch:X5n})}}),G5n=yn.mark({class:"cm-matchingBracket"}),q5n=yn.mark({class:"cm-nonmatchingBracket"});function X5n(e){let t=[],n=e.matched?G5n:q5n;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function $Me(e){let t=[],n=e.facet(Xrt);for(let r of e.selection.ranges){if(!r.empty)continue;let i=kp(e,r.head,-1,n)||r.head>0&&kp(e,r.head-1,1,n)||n.afterCursor&&(kp(e,r.head,1,n)||r.heade.decorations}),Q5n=[Y5n,H5n];function K5n(e={}){return[Xrt.of(e),Q5n]}const Z5n=new br;function Hie(e,t,n){let r=e.prop(t<0?br.openedBy:br.closedBy);if(r)return r;if(e.name.length==1){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function Gie(e){let t=e.type.prop(Z5n);return t?t(e.node):e}function kp(e,t,n,r={}){let i=r.maxScanDistance||Grt,o=r.brackets||qrt,s=ca(e),a=s.resolveInner(t,n);for(let l=a;l;l=l.parent){let c=Hie(l.type,n,o);if(c&&l.from0?t>=u.from&&tu.from&&t<=u.to))return J5n(e,t,n,l,u,c,o)}}return ejn(e,t,n,s,a.type,i,o)}function J5n(e,t,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;n<0&&(d+=h.length);let p=t+d*n;for(let g=n>0?0:h.length-1,m=n>0?h.length:-1;g!=m;g+=n){let v=s.indexOf(h[g]);if(!(v<0||r.resolveInner(p+g,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const tjn=Object.create(null),NMe=[Vc.none],zMe=[],jMe=Object.create(null),njn=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])njn[e]=rjn(tjn,t);function HX(e,t){zMe.indexOf(e)>-1||(zMe.push(e),console.warn(t))}function rjn(e,t){let n=[];for(let a of t.split(" ")){let l=[];for(let c of a.split(".")){let u=e[c]||We[c];u?typeof u=="function"?l.length?l=l.map(u):HX(c,`Modifier ${c} used at start of tag`):l.length?HX(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:HX(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=jMe[i];if(o)return o.id;let s=jMe[i]=Vc.define({id:NMe.length,name:r,props:[Pge({[r]:n})]});return NMe.push(s),s.id}Bi.RTL,Bi.LTR;class Yrt{constructor(t,n,r,i){this.state=t,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=ca(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(Krt(t,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,r){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function BMe(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function ijn(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:ijn(t);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:t,validFor:n}:null}}function ojn(e,t){return n=>{for(let r=ca(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(e.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return t(n)}}class UMe{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function U1(e){return e.selection.main.from}function Krt(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?e:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const eme=Mg.define();function sjn(e,t,n,r){let{main:i}=e.selection,o=n-i.from,s=r-i.from;return{...e.changeByRange(a=>{if(a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,r))return{range:a};let l=e.toText(t);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:l},range:ot.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const VMe=new WeakMap;function ajn(e){if(!Array.isArray(e))return e;let t=VMe.get(e);return t||VMe.set(e,t=Qrt(e)),t}const v4=Vn.define(),qR=Vn.define();class ljn{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(_=Age(S))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!y||E==1&&m||w==0&&E!=0)&&(n[f]==S||r[f]==S&&(d=!0)?s[f++]=y:s.length&&(v=!1)),w=E,y+=wp(S)}return f==l&&s[0]==0&&v?this.result(-100+(d?-200:0),s,t):h==l&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):a>-1?this.ret(-700-t.length,[a,a+this.pattern.length]):h==l?this.ret(-900-t.length,[p,g]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),s,t):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,t)}result(t,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?wp(yc(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(t-r.length,i)}}class cjn{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:ujn,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>r=>WMe(t(r),n(r)),optionClass:(t,n)=>r=>WMe(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function WMe(e,t){return e?t?e+" "+t:e:t}function ujn(e,t,n,r,i,o){let s=e.textDirection==Bi.RTL,a=s,l=!1,c="top",u,f,d=t.left-i.left,h=i.right-t.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d=g||y>t.top?u=n.bottom-t.top:(c="bottom",u=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${c}: ${u/m}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}const tme=Vn.define();function fjn(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;cl&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function GX(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class djn{constructor(t,n,r){this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=t.state.field(n),{options:o,selected:s}=i.open,a=t.state.facet(Ks);this.optionContent=fjn(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=GX(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=t.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;u!=null&&(t.dispatch({effects:tme.of(u)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(Ks).closeOnBlur&&l.relatedTarget!=t.contentDOM&&t.dispatch({effects:qR.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let r=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=GX(o.length,s,t.state.facet(Ks).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=GX(n.options.length,n.selected,this.view.state.facet(Ks).maxRenderedOptions),this.showOptions(n.options,t.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:o}=i;if(!o)return;let s=typeof o=="string"?document.createTextNode(o):o(i);if(!s)return;"then"in s?s.then(a=>{a&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(a,i)}).catch(a=>Ec(this.view.state,a,"completion info")):(this.addInfoPane(s,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)r.appendChild(t),this.infoDestroy=null;else{let{dom:i,destroy:o}=t;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==t?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&pjn(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom{s.target==i&&s.preventDefault()});let o=null;for(let s=r.from;sr.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew djn(n,e,t)}function pjn(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.topn.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function HMe(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function gjn(e,t){let n=[],r=null,i=null,o=u=>{n.push(u);let{section:f}=u.completion;if(f){r||(r=[]);let d=typeof f=="string"?f:f.name;r.some(h=>h.name==d)||r.push(typeof f=="string"?{name:d}:f)}},s=t.facet(Ks);for(let u of e)if(u.hasResult()){let f=u.result.getMatch;if(u.result.filter===!1)for(let d of u.result.options)o(new UMe(d,u.source,f?f(d):[],1e9-n.length));else{let d=t.sliceDoc(u.from,u.to),h,p=s.filterStrict?new cjn(d):new ljn(d);for(let g of u.result.options)if(h=p.match(g.label)){let m=g.displayLabel?f?f(g,h.matched):[]:h.matched,v=h.score+(g.boost||0);if(o(new UMe(g,u.source,m,v)),typeof g.section=="object"&&g.section.rank==="dynamic"){let{name:y}=g.section;i||(i=Object.create(null)),i[y]=Math.max(v,i[y]||-1e9)}}}}if(r){let u=Object.create(null),f=0,d=(h,p)=>(h.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[h.name]:0)||(typeof h.rank=="number"?h.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(h.named.score-f.score||c(f.completion,d.completion))){let f=u.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(u):HMe(u.completion)>HMe(l)&&(a[a.length-1]=u),l=u.completion}return a}class GC{constructor(t,n,r,i,o,s){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new GC(this.options,GMe(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,o,s){if(i&&!s&&t.some(c=>c.isPending))return i.setDisabled();let a=gjn(t,n);if(!a.length)return i&&t.some(c=>c.isPending)?i.setDisabled():null;let l=n.facet(Ks).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let u=0;uu.hasResult()?Math.min(c,u.from):c,1e8),create:wjn,above:o.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(t){return new GC(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new GC(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class y4{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new y4(bjn,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Ks),o=(r.override||n.languageDataAt("autocomplete",U1(n)).map(ajn)).map(l=>(this.active.find(u=>u.source==l)||new Mf(l,this.active.some(u=>u.state!=0)?1:0)).update(t,r));o.length==this.active.length&&o.every((l,c)=>l==this.active[c])&&(o=this.active);let s=this.open,a=t.effects.some(l=>l.is(nme));s&&t.docChanged&&(s=s.map(t.changes)),t.selection||o.some(l=>l.hasResult()&&t.changes.touchesRange(l.from,l.to))||!mjn(o,this.active)||a?s=GC.build(o,n,this.id,s,r,a):s&&s.disabled&&!o.some(l=>l.isPending)&&(s=null),!s&&o.every(l=>!l.isPending)&&o.some(l=>l.hasResult())&&(o=o.map(l=>l.hasResult()?new Mf(l.source,0):l));for(let l of t.effects)l.is(tme)&&(s=s&&s.setSelected(l.value,this.id));return o==this.active&&s==this.open?this:new y4(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?vjn:yjn}}function mjn(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const bjn=[];function Zrt(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(eme);if(r&&t.activateOnCompletion(r))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Mf{constructor(t,n,r=!1){this.source=t,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=Zrt(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Mf(i.source,0)),r&4&&i.state==0&&(i=new Mf(this.source,1)),i=i.updateFor(t,r);for(let o of t.effects)if(o.is(v4))i=new Mf(i.source,1,o.value);else if(o.is(qR))i=new Mf(i.source,0);else if(o.is(nme))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(U1(t.state))}}class CO extends Mf{constructor(t,n,r,i,o,s){super(t,3,n),this.limit=r,this.result=i,this.from=o,this.to=s}hasResult(){return!0}updateFor(t,n){var r;if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let o=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),a=U1(t.state);if(a>s||!i||n&2&&(U1(t.startState)==this.from||an.map(t))}}),bc=za.define({create(){return y4.start()},update(e,t){return e.update(t)},provide:e=>[Xge.from(e,t=>t.tooltip),Gt.contentAttributes.from(e,t=>t.attrs)]});function rme(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(bc).active.find(i=>i.source==t.source);return r instanceof CO?(typeof n=="string"?e.dispatch({...sjn(e.state,n,r.from,r.to),annotations:eme.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const wjn=hjn(bc,rme);function i3(e,t="option"){return n=>{let r=n.state.field(bc,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a=t=="page"?0:s-1:a>=s&&(a=t=="page"?s-1:0),n.dispatch({effects:tme.of(a)}),!0}}const Sjn=e=>{let t=e.state.field(bc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(bc,!1)?(e.dispatch({effects:v4.of(!0)}),!0):!1,_jn=e=>{let t=e.state.field(bc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:qR.of(null)}),!0)};class Cjn{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ojn=50,Ejn=1e3,Tjn=Ho.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(bc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(bc),n=e.state.facet(Ks);if(!e.selectionSet&&!e.docChanged&&e.startState.field(bc)==t)return;let r=e.transactions.some(o=>{let s=Zrt(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;oOjn&&Date.now()-s.time>Ejn){for(let a of s.context.abortListeners)try{a()}catch(l){Ec(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(o=>o.effects.some(s=>s.is(v4)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(o=>o.isPending&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of e.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(bc);for(let n of t.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ks).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=U1(t),r=new Yrt(t,n,e.explicit,this.view),i=new Cjn(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:qR.of(null)}),Ec(this.view.state,o)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ks).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Ks),r=this.view.state.field(bc);for(let i=0;ia.source==o.active.source);if(s&&s.isPending)if(o.done==null){let a=new Mf(o.active.source,0);for(let l of o.updates)a=a.update(l,n);a.isPending||t.push(a)}else this.startQuery(s)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:nme.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(bc,!1);if(t&&t.tooltip&&this.view.state.facet(Ks).closeOnBlur){let n=t.open&&Ert(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qR.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:v4.of(!1)}),20),this.composing=0}}}),Pjn=typeof navigator=="object"&&/Win/.test(navigator.platform),kjn=Ub.highest(Gt.domEventHandlers({keydown(e,t){let n=t.state.field(bc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(Pjn&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&rme(t,r),!1}})),Jrt=Gt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Mjn{constructor(t,n,r,i){this.field=t,this.line=n,this.from=r,this.to=i}}class ime{constructor(t,n,r){this.field=t,this.from=n,this.to=r}map(t){let n=t.mapPos(this.from,-1,Pa.TrackDel),r=t.mapPos(this.to,1,Pa.TrackDel);return n==null||r==null?null:new ime(this.field,n,r)}}class ome{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let r=[],i=[n],o=t.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let f=0;fnew ime(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(t){let n=[],r=[],i=[],o;for(let s of t.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s);){let a=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1,u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&d.field++}for(let f of i)if(f.line==r.length&&f.from>o.index){let d=o[2]?3+(o[1]||"").length:2;f.from-=d,f.to-=d}i.push(new Mjn(c,r.length,o.index,o.index+u.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(s)}return new ome(r,i)}}let Ajn=yn.widget({widget:new class extends Lh{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),Rjn=yn.mark({class:"cm-snippetField"});class vP{constructor(t,n){this.ranges=t,this.active=n,this.deco=yn.set(t.map(r=>(r.from==r.to?Ajn:Rjn).range(r.from,r.to)),!0)}map(t){let n=[];for(let r of this.ranges){let i=r.map(t);if(!i)return null;n.push(i)}return new vP(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const zL=Vn.define({map(e,t){return e&&e.map(t)}}),Ijn=Vn.define(),XR=za.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(zL))return n.value;if(n.is(Ijn)&&e)return new vP(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Gt.decorations.from(e,t=>t?t.deco:yn.none)});function sme(e,t){return ot.create(e.filter(n=>n.field==t).map(n=>ot.range(n.from,n.to)))}function Djn(e){let t=ome.parse(e);return(n,r,i,o)=>{let{text:s,ranges:a}=t.instantiate(n.state,i),{main:l}=n.state.selection,c={changes:{from:i,to:o==l.from?l.to:o,insert:Yr.of(s)},scrollIntoView:!0,annotations:r?[eme.of(r),vs.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=sme(a,0)),a.some(u=>u.field>0)){let u=new vP(a,0),f=c.effects=[zL.of(u)];n.state.field(XR,!1)===void 0&&f.push(Vn.appendConfig.of([XR,zjn,jjn,Jrt]))}n.dispatch(n.state.update(c))}}function eit(e){return({state:t,dispatch:n})=>{let r=t.field(XR,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,o=e>0&&!r.ranges.some(s=>s.field==i+e);return n(t.update({selection:sme(r.ranges,i),effects:zL.of(o?null:new vP(r.ranges,i)),scrollIntoView:!0})),!0}}const Ljn=({state:e,dispatch:t})=>e.field(XR,!1)?(t(e.update({effects:zL.of(null)})),!0):!1,Fjn=eit(1),$jn=eit(-1),Njn=[{key:"Tab",run:Fjn,shift:$jn},{key:"Escape",run:Ljn}],qMe=Jt.define({combine(e){return e.length?e[0]:Njn}}),zjn=Ub.highest(LL.compute([qMe],e=>e.facet(qMe)));function Kg(e,t){return{...t,apply:Djn(e)}}const jjn=Gt.domEventHandlers({mousedown(e,t){let n=t.state.field(XR,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:sme(n.ranges,i.field),effects:zL.of(n.ranges.some(o=>o.field>i.field)?new vP(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),YR={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},h1=Vn.define({map(e,t){let n=t.mapPos(e,-1,Pa.TrackAfter);return n??void 0}}),ame=new class extends lb{};ame.startSide=1;ame.endSide=-1;const tit=za.define({create(){return Cr.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of t.effects)n.is(h1)&&(e=e.update({add:[ame.range(n.value,n.value+1)]}));return e}});function Bjn(){return[Vjn,tit]}const XX="()[]{}<>«»»«[]{}";function nit(e){for(let t=0;t{if((Ujn?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&wp(yc(r,0))==1||t!=i.from||n!=i.to)return!1;let o=Gjn(e.state,r);return o?(e.dispatch(o),!0):!1}),Wjn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=rit(e,e.selection.main.head).brackets||YR.brackets,i=null,o=e.changeByRange(s=>{if(s.empty){let a=qjn(e.doc,s.head);for(let l of r)if(l==a&&cW(e.doc,s.head)==nit(yc(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:ot.cursor(s.head-l.length)}}return{range:i=s}});return i||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},Hjn=[{key:"Backspace",run:Wjn}];function Gjn(e,t){let n=rit(e,e.selection.main.head),r=n.brackets||YR.brackets;for(let i of r){let o=nit(yc(i,0));if(t==i)return o==i?Qjn(e,i,r.indexOf(i+i+i)>-1,n):Xjn(e,i,o,n.before||YR.before);if(t==o&&iit(e,e.selection.main.from))return Yjn(e,i,o)}return null}function iit(e,t){let n=!1;return e.field(tit).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function cW(e,t){let n=e.sliceString(t,t+2);return n.slice(0,wp(yc(n,0)))}function qjn(e,t){let n=e.sliceString(t-2,t);return wp(yc(n,0))==n.length?n:n.slice(1)}function Xjn(e,t,n,r){let i=null,o=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:h1.of(s.to+t.length),range:ot.range(s.anchor+t.length,s.head+t.length)};let a=cW(e.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:h1.of(s.head+t.length),range:ot.cursor(s.head+t.length)}:{range:i=s}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Yjn(e,t,n){let r=null,i=e.changeByRange(o=>o.empty&&cW(e.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:ot.cursor(o.head+n.length)}:r={range:o});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Qjn(e,t,n,r){let i=r.stringPrefixes||YR.stringPrefixes,o=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:t,from:a.to}],effects:h1.of(a.to+t.length),range:ot.range(a.anchor+t.length,a.head+t.length)};let l=a.head,c=cW(e.doc,l),u;if(c==t){if(XMe(e,l))return{changes:{insert:t+t,from:l},effects:h1.of(l+t.length),range:ot.cursor(l+t.length)};if(iit(e,l)){let d=n&&e.sliceDoc(l,l+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+d.length,insert:d},range:ot.cursor(l+d.length)}}}else{if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(u=YMe(e,l-2*t.length,i))>-1&&XMe(e,u))return{changes:{insert:t+t+t+t,from:l},effects:h1.of(l+t.length),range:ot.cursor(l+t.length)};if(e.charCategorizer(l)(c)!=wo.Word&&YMe(e,l,i)>-1&&!Kjn(e,l,t,i))return{changes:{insert:t+t,from:l},effects:h1.of(l+t.length),range:ot.cursor(l+t.length)}}return{range:o=a}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function XMe(e,t){let n=ca(e).resolveInner(t+1);return n.parent&&n.from==t}function Kjn(e,t,n,r){let i=ca(e).resolveInner(t,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(e.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function YMe(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=wo.Word)return t;for(let i of n){let o=t-i.length;if(e.sliceDoc(o,t)==i&&r(e.sliceDoc(o-1,o))!=wo.Word)return o}return-1}function oit(e={}){return[kjn,bc,Ks.of(e),Tjn,Zjn,Jrt]}const sit=[{key:"Ctrl-Space",run:qX},{mac:"Alt-`",run:qX},{mac:"Alt-i",run:qX},{key:"Escape",run:_jn},{key:"ArrowDown",run:i3(!0)},{key:"ArrowUp",run:i3(!1)},{key:"PageDown",run:i3(!0,"page")},{key:"PageUp",run:i3(!1,"page")},{key:"Enter",run:Sjn}],Zjn=Ub.highest(LL.computeN([Ks],e=>e.facet(Ks).defaultKeymap?[sit]:[])),QMe=new PFn,ait=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function o3(e){return(t,n,r)=>{if(r)return!1;let i=t.node.getChild("VariableName");return i&&n(i,e),!0}}const Jjn={FunctionDefinition:o3("function"),ClassDefinition:o3("class"),ForStatement(e,t,n){if(n){for(let r=e.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")t(r,"variable");else if(r.name=="in")break}},ImportStatement(e,t){var n,r;let{node:i}=e,o=((n=i.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((r=s.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&t(s,o?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,r=e.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(r,"variable"),n=r},CapturePattern:o3("variable"),AsPattern:o3("variable"),__proto__:null};function lit(e,t){let n=QMe.get(t);if(n)return n;let r=[],i=!0;function o(s,a){let l=e.sliceString(s.from,s.to);r.push({label:l,type:a})}return t.cursor(Po.IncludeAnonymous).iterate(s=>{if(s.name){let a=Jjn[s.name];if(a&&a(s,o,i)||!i&&ait.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let a of lit(e,s.node))r.push(a);return!1}}),QMe.set(t,r),r}const KMe=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,cit=["String","FormatString","Comment","PropertyName"];function eBn(e){let t=ca(e.state).resolveInner(e.pos,-1);if(cit.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&KMe.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let i=t;i;i=i.parent)ait.has(i.name)&&(r=r.concat(lit(e.state.doc,i)));return{options:r,from:n?t.from:e.pos,validFor:KMe}}const tBn=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),nBn=[Kg("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Kg("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Kg("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Kg("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Kg(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),em("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),em("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),em("import ${module}",{label:"import",detail:"statement",type:"keyword"}),em("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],oUn=a6n(Ost,fst(rUn.concat(iUn)));function eQ(e){let{node:t,pos:n}=e,r=e.lineIndent(n,-1),i=null;for(;;){let o=t.childBefore(n);if(o)if(o.name=="Comment")n=o.from;else if(o.name=="Body"||o.name=="MatchBody")e.baseIndentFor(o)+e.unit<=r&&(i=o),t=o;else if(o.name=="MatchClause")t=o;else if(o.type.is("Statement"))t=o;else break;else break}return i}function tQ(e,t){let n=e.baseIndentFor(t),r=e.lineAt(e.pos,-1),i=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&e.node.ton?null:n+e.unit}const nQ=nI.define({name:"python",parser:g5n.configure({props:[ive.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&eQ(e)||e.node;return(t=tQ(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=eQ(e);return(t=tQ(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":qY({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":qY({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":qY({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=eQ(e);return(t=n&&tQ(e,n))!==null&&t!==void 0?t:e.continue()}}),sve.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Kot,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function sUn(){return new Xot(nQ,[nQ.data.of({autocomplete:nUn}),nQ.data.of({autocomplete:oUn})])}const aUn=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=gve(e.state,n.from);return r.line?lUn(e):r.block?uUn(e):!1};function pve(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}const lUn=pve(hUn,0),cUn=pve(Est,0),uUn=pve((e,t)=>Est(e,t,dUn(t)),0);function gve(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const T2=50;function fUn(e,{open:t,close:n},r,i){let o=e.sliceDoc(r-T2,r),s=e.sliceDoc(i,i+T2),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-t.length,c)==t&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*T2?u=f=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+T2),f=e.sliceDoc(i-T2,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+t.length)==t&&f.slice(p,p+n.length)==n?{open:{pos:r+d+t.length,margin:/\s/.test(u.charAt(d+t.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function dUn(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function Est(e,t,n=t.selection.ranges){let r=n.map(o=>gve(t,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>fUn(t,r[s],o.from,o.to));if(e!=2&&!i.every(o=>o))return{changes:t.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(e!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=t.changes(o);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const tse=Rg.define(),pUn=Rg.define(),gUn=nn.define(),Tst=nn.define({combine(e){return Ig(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,i)=>t(r,i)||n(r,i)})}}),Pst=pa.define({create(){return Ap.empty},update(e,t){let n=t.state.facet(Tst),r=t.annotation(tse);if(r){let l=kc.fromTransaction(t,r.selection),c=r.side,u=c==0?e.undone:e.done;return l?u=U4(u,u.length,n.minDepth,l):u=Ast(u,t.startState.selection),new Ap(c==0?r.rest:u,c==0?u:r.rest)}let i=t.annotation(pUn);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(ms.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=kc.fromTransaction(t),s=t.annotation(ms.time),a=t.annotation(ms.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Ap(e.done.map(kc.fromJSON),e.undone.map(kc.fromJSON))}});function mUn(e={}){return[Pst,Tst.of(e),Wt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?kst:t.inputType=="historyRedo"?nse:null;return r?(t.preventDefault(),r(n)):!1}})]}function DW(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Pst,!1);if(!i)return!1;let o=i.pop(e,n,t);return o?(r(o),!0):!1}}const kst=DW(0,!1),nse=DW(1,!1),vUn=DW(0,!0),yUn=DW(1,!0);class kc{constructor(t,n,r,i,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(t){return new kc(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new kc(t.changes&&Ps.fromJSON(t.changes),[],t.mapped&&Qp.fromJSON(t.mapped),t.startSelection&&ct.fromJSON(t.startSelection),t.selectionsAfter.map(ct.fromJSON))}static fromTransaction(t,n){let r=Af;for(let i of t.startState.facet(gUn)){let o=i(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new kc(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Af)}static selection(t){return new kc(void 0,Af,void 0,void 0,t)}}function U4(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function bUn(e,t){let n=[],r=!1;return e.iterChangedRanges((i,o)=>n.push(i,o)),t.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function xUn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function Mst(e,t){return e.length?t.length?e.concat(t):e:t}const Af=[],wUn=200;function Ast(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-wUn));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),U4(e,e.length-1,1e9,n.setSelAfter(r)))}else return[kc.selection([t])]}function SUn(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function rQ(e,t){if(!e.length)return e;let n=e.length,r=Af;for(;n;){let i=_Un(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=e.slice(0,n);return o[n-1]=i,o}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[kc.selection(r)]:Af}function _Un(e,t,n){let r=Mst(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):Af,n);if(!e.changes)return kc.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new kc(i,Gn.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}const CUn=/^(input\.type|delete)($|\.)/;class Ap{constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Ap(this.done,this.undone):this}addChanges(t,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&t.changes&&(!r||CUn.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):LW(n,t))}function xl(e){return e.textDirectionAt(e.state.selection.main.head)==ho.LTR}const Ist=e=>Rst(e,!xl(e)),Dst=e=>Rst(e,xl(e));function Lst(e,t){return jh(e,n=>n.empty?e.moveByGroup(n,t):LW(n,t))}const EUn=e=>Lst(e,!xl(e)),TUn=e=>Lst(e,xl(e));function PUn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function FW(e,t,n){let r=ca(e).resolveInner(t.head),i=n?yr.closedBy:yr.openedBy;for(let l=t.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;PUn(e,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?Mp(e,r.from,1):Mp(e,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,ct.cursor(a,n?-1:1)}const kUn=e=>jh(e,t=>FW(e.state,t,!xl(e))),MUn=e=>jh(e,t=>FW(e.state,t,xl(e)));function Fst(e,t){return jh(e,n=>{if(!n.empty)return LW(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const $st=e=>Fst(e,!1),Nst=e=>Fst(e,!0);function zst(e){let t=e.scrollDOM.clientHeights.empty?e.moveVertically(s,t,n.height):LW(s,t));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottomjst(e,!1),rse=e=>jst(e,!0);function qb(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head!=r.from+o&&(i=ct.cursor(r.from+o))}return i}const AUn=e=>jh(e,t=>qb(e,t,!0)),RUn=e=>jh(e,t=>qb(e,t,!1)),IUn=e=>jh(e,t=>qb(e,t,!xl(e))),DUn=e=>jh(e,t=>qb(e,t,xl(e))),LUn=e=>jh(e,t=>ct.cursor(e.lineBlockAt(t.head).from,1)),FUn=e=>jh(e,t=>ct.cursor(e.lineBlockAt(t.head).to,-1));function $Un(e,t,n){let r=!1,i=OP(e.selection,o=>{let s=Mp(e,o.head,-1)||Mp(e,o.head,1)||o.head>0&&Mp(e,o.head-1,1)||o.head$Un(e,t);function vd(e,t){let n=OP(e.state.selection,r=>{let i=t(r);return ct.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(zh(e.state,n)),!0)}function Bst(e,t){return vd(e,n=>e.moveByChar(n,t))}const Ust=e=>Bst(e,!xl(e)),Vst=e=>Bst(e,xl(e));function Wst(e,t){return vd(e,n=>e.moveByGroup(n,t))}const zUn=e=>Wst(e,!xl(e)),jUn=e=>Wst(e,xl(e)),BUn=e=>vd(e,t=>FW(e.state,t,!xl(e))),UUn=e=>vd(e,t=>FW(e.state,t,xl(e)));function Hst(e,t){return vd(e,n=>e.moveVertically(n,t))}const Gst=e=>Hst(e,!1),qst=e=>Hst(e,!0);function Xst(e,t){return vd(e,n=>e.moveVertically(n,t,zst(e).height))}const ZRe=e=>Xst(e,!1),JRe=e=>Xst(e,!0),VUn=e=>vd(e,t=>qb(e,t,!0)),WUn=e=>vd(e,t=>qb(e,t,!1)),HUn=e=>vd(e,t=>qb(e,t,!xl(e))),GUn=e=>vd(e,t=>qb(e,t,xl(e))),qUn=e=>vd(e,t=>ct.cursor(e.lineBlockAt(t.head).from)),XUn=e=>vd(e,t=>ct.cursor(e.lineBlockAt(t.head).to)),eIe=({state:e,dispatch:t})=>(t(zh(e,{anchor:0})),!0),tIe=({state:e,dispatch:t})=>(t(zh(e,{anchor:e.doc.length})),!0),nIe=({state:e,dispatch:t})=>(t(zh(e,{anchor:e.selection.main.anchor,head:0})),!0),rIe=({state:e,dispatch:t})=>(t(zh(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),YUn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),QUn=({state:e,dispatch:t})=>{let n=$W(e).map(({from:r,to:i})=>ct.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:ct.create(n),userEvent:"select"})),!0},KUn=({state:e,dispatch:t})=>{let n=OP(e.selection,r=>{let i=ca(e),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return ct.range(a.to,a.from)}return r});return n.eq(e.selection)?!1:(t(zh(e,n)),!0)};function Yst(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let o of n.selection.ranges){let s=n.doc.lineAt(o.head);if(t?s.to0)for(let a=o;;){let l=e.moveVertically(a,t);if(l.heads.to){i.some(c=>c.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(e.dispatch(zh(n,ct.create(i,i.length-1))),!0)}const ZUn=e=>Yst(e,!1),JUn=e=>Yst(e,!0),eVn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=ct.create([n.main]):n.main.empty||(r=ct.create([ct.cursor(n.main.head)])),r?(t(zh(e,r)),!0):!1};function eF(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=t(o);ls&&(n="delete.forward",l=T3(e,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=T3(e,s,!1),a=T3(e,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:ct.cursor(s,si(e)))r.between(t,t,(i,o)=>{it&&(t=n?o:i)});return t}const Qst=(e,t,n)=>eF(e,r=>{let i=r.from,{state:o}=e,s=o.doc.lineAt(i),a,l;if(n&&!t&&i>s.from&&iQst(e,!1,!0),Kst=e=>Qst(e,!0,!1),Zst=(e,t)=>eF(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let l=Ia(o.text,r-o.from,t)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),Jst=e=>Zst(e,!1),tVn=e=>Zst(e,!0),nVn=e=>eF(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headeF(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),iVn=e=>eF(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Yr.of(["",""])},range:ct.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},sVn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,o=e.doc.lineAt(i),s=i==o.from?i-1:Ia(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:Ia(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:e.doc.slice(i,a).append(e.doc.slice(s,i))},range:ct.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function $W(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=e.doc.lineAt(r.to-1)),n>=i.number){let s=t[t.length-1];s.to=o.to,s.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function eat(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let o of $W(e)){if(n?o.to==e.doc.length:o.from==0)continue;let s=e.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+e.lineBreak});for(let l of o.ranges)i.push(ct.range(Math.min(e.doc.length,l.anchor+a),Math.min(e.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:e.lineBreak+s.text});for(let l of o.ranges)i.push(ct.range(l.anchor-a,l.head-a))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:ct.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const aVn=({state:e,dispatch:t})=>eat(e,t,!1),lVn=({state:e,dispatch:t})=>eat(e,t,!0);function tat(e,t,n){if(e.readOnly)return!1;let r=[];for(let i of $W(e))n?r.push({from:i.from,insert:e.doc.slice(i.from,i.to)+e.lineBreak}):r.push({from:i.to,insert:e.lineBreak+e.doc.slice(i.from,i.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const cVn=({state:e,dispatch:t})=>tat(e,t,!1),uVn=({state:e,dispatch:t})=>tat(e,t,!0),fVn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes($W(t).map(({from:i,to:o})=>(i>0?i--:o{let o;if(e.lineWrapping){let s=e.lineBlockAt(i.head),a=e.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2)}return e.moveVertically(i,!0,o)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function dVn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ca(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(yr.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const iIe=nat(!1),hVn=nat(!0);function nat(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:o,to:s}=i,a=t.doc.lineAt(o),l=!e&&o==s&&dVn(t,o);e&&(o=s=(s<=a.to?a:t.doc.lineAt(s)).to);let c=new AW(t,{simulateBreak:o,simulateDoubleBreak:!!l}),u=rve(c,o);for(u==null&&(u=_P(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=e.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),s=a.to+1}let o=e.changes(i);return{changes:i,range:ct.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const pVn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new AW(e,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=mve(e,(o,s,a)=>{let l=rve(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=rI(e,l);(c!=u||a.frome.readOnly?!1:(t(e.update(mve(e,(n,r)=>{r.push({from:n.from,insert:e.facet(QL)})}),{userEvent:"input.indent"})),!0),iat=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(mve(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=_P(i,e.tabSize),s=0,a=rI(e,Math.max(0,o-$4(e)));for(;s(e.setTabFocusMode(),!0),mVn=[{key:"Ctrl-b",run:Ist,shift:Ust,preventDefault:!0},{key:"Ctrl-f",run:Dst,shift:Vst},{key:"Ctrl-p",run:$st,shift:Gst},{key:"Ctrl-n",run:Nst,shift:qst},{key:"Ctrl-a",run:LUn,shift:qUn},{key:"Ctrl-e",run:FUn,shift:XUn},{key:"Ctrl-d",run:Kst},{key:"Ctrl-h",run:ise},{key:"Ctrl-k",run:nVn},{key:"Ctrl-Alt-h",run:Jst},{key:"Ctrl-o",run:oVn},{key:"Ctrl-t",run:sVn},{key:"Ctrl-v",run:rse}],vVn=[{key:"ArrowLeft",run:Ist,shift:Ust,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:EUn,shift:zUn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:IUn,shift:HUn,preventDefault:!0},{key:"ArrowRight",run:Dst,shift:Vst,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:TUn,shift:jUn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:DUn,shift:GUn,preventDefault:!0},{key:"ArrowUp",run:$st,shift:Gst,preventDefault:!0},{mac:"Cmd-ArrowUp",run:eIe,shift:nIe},{mac:"Ctrl-ArrowUp",run:KRe,shift:ZRe},{key:"ArrowDown",run:Nst,shift:qst,preventDefault:!0},{mac:"Cmd-ArrowDown",run:tIe,shift:rIe},{mac:"Ctrl-ArrowDown",run:rse,shift:JRe},{key:"PageUp",run:KRe,shift:ZRe},{key:"PageDown",run:rse,shift:JRe},{key:"Home",run:RUn,shift:WUn,preventDefault:!0},{key:"Mod-Home",run:eIe,shift:nIe},{key:"End",run:AUn,shift:VUn,preventDefault:!0},{key:"Mod-End",run:tIe,shift:rIe},{key:"Enter",run:iIe,shift:iIe},{key:"Mod-a",run:YUn},{key:"Backspace",run:ise,shift:ise,preventDefault:!0},{key:"Delete",run:Kst,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Jst,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:tVn,preventDefault:!0},{mac:"Mod-Backspace",run:rVn,preventDefault:!0},{mac:"Mod-Delete",run:iVn,preventDefault:!0}].concat(mVn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),yVn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:kUn,shift:BUn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:MUn,shift:UUn},{key:"Alt-ArrowUp",run:aVn},{key:"Shift-Alt-ArrowUp",run:cVn},{key:"Alt-ArrowDown",run:lVn},{key:"Shift-Alt-ArrowDown",run:uVn},{key:"Mod-Alt-ArrowUp",run:ZUn},{key:"Mod-Alt-ArrowDown",run:JUn},{key:"Escape",run:eVn},{key:"Mod-Enter",run:hVn},{key:"Alt-l",mac:"Ctrl-l",run:QUn},{key:"Mod-i",run:KUn,preventDefault:!0},{key:"Mod-[",run:iat},{key:"Mod-]",run:rat},{key:"Mod-Alt-\\",run:pVn},{key:"Shift-Mod-k",run:fVn},{key:"Shift-Mod-\\",run:NUn},{key:"Mod-/",run:aUn},{key:"Alt-A",run:cUn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:gVn}].concat(vVn),bVn={key:"Tab",run:rat,shift:iat},oIe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class qE{constructor(t,n,r=0,i=t.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(oIe(a)):oIe,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return wc(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Ume(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Sp(t);let i=this.normalize(n);if(i.length)for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=V4(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let a=new IO(n,t.sliceString(n,r));return iQ.set(t,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=t.sliceString(n,s)+o,s=n),i.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=V4(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=IO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(sat.prototype[Symbol.iterator]=aat.prototype[Symbol.iterator]=function(){return this});function xVn(e){try{return new RegExp(e,vve),!0}catch{return!1}}function V4(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t=56320&&r<57344;)t++;return t}function ose(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=Ni("input",{class:"cm-textfield",name:"line",value:t}),r=Ni("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),e.dispatch({effects:SA.of(!1)}),e.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},Ni("label",e.state.phrase("Go to line"),": ",n)," ",Ni("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),Ni("button",{name:"close",onclick:()=>{e.dispatch({effects:SA.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=e,a=s.doc.lineAt(s.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let m=h/100;l&&(m=m*(l=="-"?-1:1)+a.number/s.doc.lines),h=Math.round(s.doc.lines*m)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),g=ct.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[SA.of(!1),Wt.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}return{dom:r}}const SA=Gn.define(),sIe=pa.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(SA)&&(e=n.value);return e},provide:e=>tI.from(e,t=>t?ose:null)}),wVn=e=>{let t=eI(e,ose);if(!t){let n=[SA.of(!0)];e.state.field(sIe,!1)==null&&n.push(Gn.appendConfig.of([sIe,SVn])),e.dispatch({effects:n}),t=eI(e,ose)}return t&&t.dom.querySelector("input").select(),!0},SVn=Wt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),_Vn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},CVn=nn.define({combine(e){return Ig(e,_Vn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function OVn(e){return[MVn,kVn]}const EVn=vn.mark({class:"cm-selectionMatch"}),TVn=vn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function aIe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=wo.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=wo.Word)}function PVn(e,t,n,r){return e(t.sliceDoc(n,n+1))==wo.Word&&e(t.sliceDoc(r-1,r))==wo.Word}const kVn=ns.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(CVn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return vn.none;let i=r.main,o,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return vn.none;let l=n.wordAt(i.head);if(!l)return vn.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return vn.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(aIe(s,n,i.from,i.to)&&PVn(s,n,i.from,i.to)))return vn.none}else if(o=n.sliceDoc(i.from,i.to),!o)return vn.none}let a=[];for(let l of e.visibleRanges){let c=new qE(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||aIe(s,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(TVn.range(u,f)):(u>=i.to||f<=i.from)&&a.push(EVn.range(u,f)),a.length>t.maxMatches))return vn.none}}return vn.set(a)}},{decorations:e=>e.decorations}),MVn=Wt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),AVn=({state:e,dispatch:t})=>{let{selection:n}=e,r=ct.create(n.ranges.map(i=>e.wordAt(i.head)||ct.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function RVn(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new qE(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new qE(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=e.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const IVn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(o=>o.from===o.to))return AVn({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(o=>e.sliceDoc(o.from,o.to)!=r))return!1;let i=RVn(e,r);return i?(t(e.update({selection:e.selection.addRange(ct.range(i.from,i.to),!1),effects:Wt.scrollIntoView(i.to)})),!0):!1},EP=nn.define({combine(e){return Ig(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new HVn(t),scrollToMatch:t=>Wt.scrollIntoView(t)})}});class lat{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||xVn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` -`:r=="r"?"\r":r=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new $Vn(this):new LVn(this)}getCursor(t,n=0,r){let i=t.doc?t:Pr.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?RC(this,i,n,r):AC(this,i,n,r)}}class cat{constructor(t){this.spec=t}}function AC(e,t,n,r){return new qE(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:i=>i.toLowerCase(),e.wholeWord?DVn(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function DVn(e,t){return(n,r,i,o)=>((o>n||o+i.length=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=AC(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function RC(e,t,n,r){return new sat(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?FVn(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function W4(e,t){return e.slice(Ia(e,t,!1),t)}function H4(e,t){return e.slice(t,Ia(e,t))}function FVn(e){return(t,n,r)=>!r[0].length||(e(W4(r.input,r.index))!=wo.Word||e(H4(r.input,r.index))!=wo.Word)&&(e(H4(r.input,r.index+r[0].length))!=wo.Word||e(W4(r.input,r.index+r[0].length))!=wo.Word)}class $Vn extends cat{nextMatch(t,n,r){let i=RC(this.spec,t,r,t.doc.length).next();return i.done&&(i=RC(this.spec,t,0,n).next()),i.done?null:i.value}prevMatchInRange(t,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=RC(this.spec,t,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let o=+r.slice(0,i);if(o>0&&o=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=RC(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const aI=Gn.define(),yve=Gn.define(),U0=pa.define({create(e){return new oQ(sse(e).create(),null)},update(e,t){for(let n of t.effects)n.is(aI)?e=new oQ(n.value.create(),e.panel):n.is(yve)&&(e=new oQ(e.query,n.value?bve:null));return e},provide:e=>tI.from(e,t=>t.panel)});class oQ{constructor(t,n){this.query=t,this.panel=n}}const NVn=vn.mark({class:"cm-searchMatch"}),zVn=vn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),jVn=ns.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(U0))}update(e){let t=e.state.field(U0);(t!=e.startState.field(U0)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return vn.none;let{view:n}=this,r=new bv;for(let i=0,o=n.visibleRanges,s=o.length;io[i+1].from-500;)l=o[++i].to;e.highlight(n.state,a,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?zVn:NVn)})}return r.finish()}},{decorations:e=>e.decorations});function tF(e){return t=>{let n=t.state.field(U0,!1);return n&&n.query.spec.valid?e(t,n):dat(t)}}const G4=tF((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=ct.single(r.from,r.to),o=e.state.facet(EP);return e.dispatch({selection:i,effects:[xve(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),fat(e),!0}),q4=tF((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=ct.single(i.from,i.to),s=e.state.facet(EP);return e.dispatch({selection:o,effects:[xve(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),fat(e),!0}),BVn=tF((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ct.create(n.map(r=>ct.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),UVn=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new qE(e.doc,e.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(ct.range(a.value.from,a.value.to))}return t(e.update({selection:ct.create(o,s),userEvent:"select.search.matches"})),!0},lIe=tF((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let s=o,a=[],l,c,u=[];s.from==r&&s.to==i&&(c=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:c}),s=t.nextMatch(n,s.from,s.to),u.push(Wt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=e.state.changes(a);return s&&(l=ct.single(s.from,s.to).map(f),u.push(xve(e,s)),u.push(n.facet(EP).scrollToMatch(l.main,e))),e.dispatch({changes:f,selection:l,effects:u,userEvent:"input.replace"}),!0}),VVn=tF((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:t.getReplacement(i)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Wt.announce.of(r),userEvent:"input.replace.all"}),!0});function bve(e){return e.state.facet(EP).createPanel(e)}function sse(e,t){var n,r,i,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(EP);return new lat({search:((n=t?.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=t?.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=t?.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=t?.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function uat(e){let t=eI(e,bve);return t&&t.dom.querySelector("[main-field]")}function fat(e){let t=uat(e);t&&t==e.root.activeElement&&t.select()}const dat=e=>{let t=e.state.field(U0,!1);if(t&&t.panel){let n=uat(e);if(n&&n!=e.root.activeElement){let r=sse(e.state,t.query.spec);r.valid&&e.dispatch({effects:aI.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[yve.of(!0),t?aI.of(sse(e.state,t.query.spec)):Gn.appendConfig.of(qVn)]});return!0},hat=e=>{let t=e.state.field(U0,!1);if(!t||!t.panel)return!1;let n=eI(e,bve);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:yve.of(!1)}),!0},WVn=[{key:"Mod-f",run:dat,scope:"editor search-panel"},{key:"F3",run:G4,shift:q4,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:G4,shift:q4,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:hat,scope:"editor search-panel"},{key:"Mod-Shift-l",run:UVn},{key:"Mod-Alt-g",run:wVn},{key:"Mod-d",run:IVn,preventDefault:!0}];class HVn{constructor(t){this.view=t;let n=this.query=t.state.field(U0).query.spec;this.commit=this.commit.bind(this),this.searchField=Ni("input",{value:n.search,placeholder:ru(t,"Find"),"aria-label":ru(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ni("input",{value:n.replace,placeholder:ru(t,"Replace"),"aria-label":ru(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ni("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Ni("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Ni("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return Ni("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=Ni("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>G4(t),[ru(t,"next")]),r("prev",()=>q4(t),[ru(t,"previous")]),r("select",()=>BVn(t),[ru(t,"all")]),Ni("label",null,[this.caseField,ru(t,"match case")]),Ni("label",null,[this.reField,ru(t,"regexp")]),Ni("label",null,[this.wordField,ru(t,"by word")]),...t.state.readOnly?[]:[Ni("br"),this.replaceField,r("replace",()=>lIe(t),[ru(t,"replace")]),r("replaceAll",()=>VVn(t),[ru(t,"replace all")])],Ni("button",{name:"close",onclick:()=>hat(t),"aria-label":ru(t,"close"),type:"button"},["×"])])}commit(){let t=new lat({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:aI.of(t)}))}keydown(t){pBn(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?q4:G4)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),lIe(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(aI)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(EP).top}}function ru(e,t){return e.state.phrase(t)}const P3=30,k3=/[\s\.,:;?!]/;function xve(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-P3),s=Math.min(i,n+P3),a=e.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;la.length-P3;l--)if(!k3.test(a[l-1])&&k3.test(a[l])){a=a.slice(0,l);break}}return Wt.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}const GVn=Wt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),qVn=[U0,Gb.low(jVn),GVn];class cIe{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class l1{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(lI).markerFilter;i&&(t=i(t,r));let o=t.slice().sort((h,p)=>h.from-p.from||h.to-p.to),s=new bv,a=[],l=0,c=r.doc.iter(),u=0,f=r.doc.length;for(let h=0;;){let p=h==o.length?null:o[h];if(!p&&!a.length)break;let g,m;if(a.length)g=l,m=a.reduce((b,w)=>Math.min(b,w.to),p&&p.from>g?p.from:1e8);else{if(g=p.from,g>f)break;m=p.to,a.push(p),h++}for(;hb.from||b.to==g))a.push(b),h++,m=Math.min(b.to,m);else{m=Math.min(b.from,m);break}}m=Math.min(m,f);let v=!1;if(a.some(b=>b.from==g&&(b.to==m||m==f))&&(v=g==m,!v&&m-g<10)){let b=g-(u+c.value.length);b>0&&(c.next(b),u=g);for(let w=g;;){if(w>=m){v=!0;break}if(!c.lineBreak&&u+c.value.length>w)break;w=u+c.value.length,u+=c.value.length,c.next()}}let y=s8n(a);if(v)s.add(g,g,vn.widget({widget:new n8n(y),diagnostics:a.slice()}));else{let b=a.reduce((w,S)=>S.markClass?w+" "+S.markClass:w,"");s.add(g,m,vn.mark({class:"cm-lintRange cm-lintRange-"+y+b,diagnostics:a.slice(),inclusiveEnd:a.some(w=>w.to>m)}))}if(l=m,l==f)break;for(let b=0;b{if(!(t&&s.diagnostics.indexOf(t)<0))if(!r)r=new cIe(i,o,t||s.diagnostics[0]);else{if(s.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new cIe(r.from,o,r.diagnostic)}}),r}function XVn(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(lI).hideOn(e,n,r);if(i!=null)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(s=>s.is(pat))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}function YVn(e,t){return e.field(Tu,!1)?t:t.concat(Gn.appendConfig.of(a8n))}const pat=Gn.define(),wve=Gn.define(),gat=Gn.define(),Tu=pa.define({create(){return new l1(vn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=XE(n,e.selected.diagnostic,o)||XE(n,null,o)}!n.size&&i&&t.state.facet(lI).autoPanel&&(i=null),e=new l1(n,i,r)}for(let n of t.effects)if(n.is(pat)){let r=t.state.facet(lI).autoPanel?n.value.length?cI.open:null:e.panel;e=l1.init(n.value,r,t.state)}else n.is(wve)?e=new l1(e.diagnostics,n.value?cI.open:null,e.selected):n.is(gat)&&(e=new l1(e.diagnostics,e.panel,n.value));return e},provide:e=>[tI.from(e,t=>t.panel),Wt.decorations.from(e,t=>t.diagnostics)]}),QVn=vn.mark({class:"cm-lintRange cm-lintRange-active"});function KVn(e,t,n){let{diagnostics:r}=e.state.field(Tu),i,o=-1,s=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(l,c,{spec:u})=>{if(t>=l&&t<=c&&(l==c||(t>l||n>0)&&(tvat(e,n,!1)))}const JVn=e=>{let t=e.state.field(Tu,!1);(!t||!t.panel)&&e.dispatch({effects:YVn(e.state,[wve.of(!0)])});let n=eI(e,cI.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},uIe=e=>{let t=e.state.field(Tu,!1);return!t||!t.panel?!1:(e.dispatch({effects:wve.of(!1)}),!0)},e8n=e=>{let t=e.state.field(Tu,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},t8n=[{key:"Mod-Shift-m",run:JVn,preventDefault:!0},{key:"F8",run:e8n}],lI=nn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Ig(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:fIe,tooltipFilter:fIe,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,i,o)=>t(r,i,o)||n(r,i,o):t:n,autoPanel:(t,n)=>t||n})}}});function fIe(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function mat(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;ro.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function vat(e,t,n){var r;let i=n?mat(t.actions):[];return Ni("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ni("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=h=>{if(h.preventDefault(),a)return;a=!0;let p=XE(e.state.field(Tu).diagnostics,t);p&&o.apply(e,p.from,p.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),Ni("u",c.slice(u,u+1)),c.slice(u+1)],d=o.markClass?" "+o.markClass:"";return Ni("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),t.source&&Ni("div",{class:"cm-diagnosticSource"},t.source))}class n8n extends Dg{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ni("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class dIe{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=vat(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class cI{constructor(t){this.view=t,this.items=[];let n=i=>{if(i.keyCode==27)uIe(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=mat(o.actions);for(let a=0;a{for(let o=0;ouIe(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tu).selected;if(!t)return-1;for(let n=0;n{for(let u of c.diagnostics){if(s.has(u))continue;s.add(u);let f=-1,d;for(let h=r;hr&&(this.items.splice(r,f-r),i=!0)),n&&d.diagnostic==n.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),o=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),r++}});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.topl.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Tu),r=XE(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:gat.of(r)})}static open(t){return new cI(t)}}function r8n(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function M3(e){return r8n(``,'width="6" height="3"')}const i8n=Wt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:M3("#d11")},".cm-lintRange-warning":{backgroundImage:M3("orange")},".cm-lintRange-info":{backgroundImage:M3("#999")},".cm-lintRange-hint":{backgroundImage:M3("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function o8n(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function s8n(e){let t="hint",n=1;for(let r of e){let i=o8n(r.severity);i>n&&(n=i,t=r.severity)}return t}const a8n=[Tu,Wt.decorations.compute([Tu],e=>{let{selected:t,panel:n}=e.field(Tu);return!t||!n||t.from==t.to?vn.none:vn.set([QVn.range(t.from,t.to)])}),n4n(KVn,{hideOn:XVn}),i8n];var hIe=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(q6n)),t.defaultKeymap!==!1&&(r=r.concat(yVn)),t.searchKeymap!==!1&&(r=r.concat(WVn)),t.historyKeymap!==!1&&(r=r.concat(OUn)),t.foldKeymap!==!1&&(r=r.concat(N4n)),t.completionKeymap!==!1&&(r=r.concat(Sst)),t.lintKeymap!==!1&&(r=r.concat(t8n));var i=[];return t.lineNumbers!==!1&&i.push(h4n()),t.highlightActiveLineGutter!==!1&&i.push(m4n()),t.highlightSpecialChars!==!1&&i.push(ABn()),t.history!==!1&&i.push(mUn()),t.foldGutter!==!1&&i.push(U4n()),t.drawSelection!==!1&&i.push(xBn()),t.dropCursor!==!1&&i.push(OBn()),t.allowMultipleSelections!==!1&&i.push(Pr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&i.push(k4n()),t.syntaxHighlighting!==!1&&i.push(sst(G4n,{fallback:!0})),t.bracketMatching!==!1&&i.push(J4n()),t.closeBrackets!==!1&&i.push(V6n()),t.autocompletion!==!1&&i.push(wst()),t.rectangularSelection!==!1&&i.push(HBn()),n!==!1&&i.push(XBn()),t.highlightActiveLine!==!1&&i.push($Bn()),t.highlightSelectionMatches!==!1&&i.push(OVn()),t.tabSize&&typeof t.tabSize=="number"&&i.push(QL.of(" ".repeat(t.tabSize))),i.concat([XL.of(r.flat())]).filter(Boolean)};const l8n="#e5c07b",pIe="#e06c75",c8n="#56b6c2",u8n="#ffffff",k5="#abb2bf",ase="#7d8799",f8n="#61afef",d8n="#98c379",gIe="#d19a66",h8n="#c678dd",p8n="#21252b",mIe="#2c313a",vIe="#282c34",sQ="#353a42",g8n="#3E4451",yIe="#528bff",m8n=Wt.theme({"&":{color:k5,backgroundColor:vIe},".cm-content":{caretColor:yIe},".cm-cursor, .cm-dropCursor":{borderLeftColor:yIe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:g8n},".cm-panels":{backgroundColor:p8n,color:k5},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:vIe,color:ase,border:"none"},".cm-activeLineGutter":{backgroundColor:mIe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:sQ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:sQ,borderBottomColor:sQ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:mIe,color:k5}}},{dark:!0}),v8n=ZL.define([{tag:We.keyword,color:h8n},{tag:[We.name,We.deleted,We.character,We.propertyName,We.macroName],color:pIe},{tag:[We.function(We.variableName),We.labelName],color:f8n},{tag:[We.color,We.constant(We.name),We.standard(We.name)],color:gIe},{tag:[We.definition(We.name),We.separator],color:k5},{tag:[We.typeName,We.className,We.number,We.changed,We.annotation,We.modifier,We.self,We.namespace],color:l8n},{tag:[We.operator,We.operatorKeyword,We.url,We.escape,We.regexp,We.link,We.special(We.string)],color:c8n},{tag:[We.meta,We.comment],color:ase},{tag:We.strong,fontWeight:"bold"},{tag:We.emphasis,fontStyle:"italic"},{tag:We.strikethrough,textDecoration:"line-through"},{tag:We.link,color:ase,textDecoration:"underline"},{tag:We.heading,fontWeight:"bold",color:pIe},{tag:[We.atom,We.bool,We.special(We.variableName)],color:gIe},{tag:[We.processingInstruction,We.string,We.inserted],color:d8n},{tag:We.invalid,color:u8n}]),y8n=[m8n,sst(v8n)];var b8n=Wt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),x8n=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=t,l=[];switch(n&&l.unshift(XL.of([bVn])),a&&(typeof a=="boolean"?l.unshift(hIe()):l.unshift(hIe(a))),s&&l.unshift(BBn(s)),o){case"light":l.push(b8n);break;case"dark":l.push(y8n);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(Wt.editable.of(!1)),i&&l.push(Pr.readOnly.of(!0)),[...l]},w8n=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class S8n{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class bIe{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var aQ=null,_8n=()=>typeof window>"u"?new bIe:(aQ||(aQ=new bIe),aQ),xIe=Rg.define(),C8n=200,O8n=[];function E8n(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=O8n,autoFocus:l,theme:c="light",height:u=null,minHeight:f=null,maxHeight:d=null,width:h=null,minWidth:p=null,maxWidth:g=null,placeholder:m="",editable:v=!0,readOnly:y=!1,indentWithTab:b=!0,basicSetup:w=!0,root:S,initialState:_}=e,[E,T]=M.useState(),[k,P]=M.useState(),[R,I]=M.useState(),F=M.useState(()=>({current:null}))[0],A=M.useState(()=>({current:null}))[0],L=Wt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:h,minWidth:p,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),$=Wt.updateListener.of(U=>{if(U.docChanged&&typeof r=="function"&&!U.transactions.some(B=>B.annotation(xIe))){F.current?F.current.reset():(F.current=new S8n(()=>{if(A.current){var B=A.current;A.current=null,B()}F.current=null},C8n),_8n().add(F.current));var z=U.state.doc,N=z.toString();r(N,U)}i&&i(w8n(U))}),j=x8n({theme:c,editable:v,readOnly:y,placeholder:m,indentWithTab:b,basicSetup:w}),V=[$,L,...j];return s&&typeof s=="function"&&V.push(Wt.updateListener.of(s)),V=V.concat(a),M.useLayoutEffect(()=>{if(E&&!R){var U={doc:t,selection:n,extensions:V},z=_?Pr.fromJSON(_.json,U,_.fields):Pr.create(U);if(I(z),!k){var N=new Wt({state:z,parent:E,root:S});P(N),o&&o(N,z)}}return()=>{k&&(I(void 0),P(void 0))}},[E,R]),M.useEffect(()=>{e.container&&T(e.container)},[e.container]),M.useEffect(()=>()=>{k&&(k.destroy(),P(void 0)),F.current&&(F.current.cancel(),F.current=null)},[k]),M.useEffect(()=>{l&&k&&k.focus()},[l,k]),M.useEffect(()=>{k&&k.dispatch({effects:Gn.reconfigure.of(V)})},[c,a,u,f,d,h,p,g,m,v,y,b,w,r,s]),M.useEffect(()=>{if(t!==void 0){var U=k?k.state.doc.toString():"";if(k&&t!==U){var z=F.current&&!F.current.isDone,N=()=>{k&&t!==k.state.doc.toString()&&k.dispatch({changes:{from:0,to:k.state.doc.toString().length,insert:t||""},annotations:[xIe.of(!0)]})};z?A.current=N:N()}}},[t,k]),{state:R,setState:I,view:k,setView:P,container:E,setContainer:T}}var T8n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],NW=M.forwardRef((e,t)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:b,indentWithTab:w,editable:S,readOnly:_,root:E,initialState:T}=e,k=it(e,T8n),P=M.useRef(null),{state:R,view:I,container:F,setContainer:A}=E8n({root:E,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:b,indentWithTab:w,editable:S,readOnly:_,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:T});M.useImperativeHandle(t,()=>({editor:P.current,state:R,view:I}),[P,F,R,I]);var L=M.useCallback(j=>{P.current=j,A(j)},[A]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var $=typeof f=="string"?"cm-theme-"+f:"cm-theme";return O.jsx("div",X({ref:L,className:""+$+(n?" "+n:"")},k))});NW.displayName="CodeMirror";const Rf=({children:e})=>O.jsx(Yje,{sx:Eu.cardContent,children:e}),yat=({code:e,extension:t})=>{const n=is();return O.jsx(Rf,{children:O.jsx(NW,{theme:n.palette.mode,height:"320px",extensions:[t],value:e,readOnly:!0})})},bat=({code:e})=>O.jsx(yat,{code:e,extension:sUn()}),P8n=zme({String:We.string,Number:We.number,"True False":We.bool,PropertyName:We.propertyName,Null:We.null,", :":We.separator,"[ ]":We.squareBracket,"{ }":We.brace}),k8n=WR.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[P8n],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),M8n=nI.define({name:"json",parser:k8n.configure({props:[ive.add({Object:DRe({except:/^\s*\}/}),Array:DRe({except:/^\s*\]/})}),sve.add({"Object Array":Kot})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function xat(){return new Xot(M8n)}const Sve=({code:e})=>O.jsx(yat,{code:e,extension:xat()}),wat=ot(O.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),A8n=ot(O.jsx("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject"),R8n=ot(O.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),I8n=ot(O.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),D8n=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,L8n=({viewMode:e,setViewMode:t,hasPython:n})=>O.jsxs(rD,{size:"small",value:e,exclusive:!0,onChange:(r,i)=>t(i),children:[O.jsx(oo,{value:"text",sx:Eu.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Textual format"),children:O.jsx(I8n,{fontSize:"inherit"})})},"text"),O.jsx(oo,{value:"list",sx:Eu.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Tabular format"),children:O.jsx(R8n,{fontSize:"inherit"})})},"list"),O.jsx(oo,{value:"code",sx:Eu.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("JSON format"),children:O.jsx(A8n,{fontSize:"inherit"})})},"json"),n&&O.jsx(oo,{value:"python",sx:{...Eu.toggleButton,width:"30px"},children:O.jsx("img",{src:D8n,width:12,alt:"python logo"})},"python")]},0),F8n=({title:e,subheader:t,icon:n,tooltipText:r})=>O.jsx(ext,{title:O.jsxs(bt,{sx:Eu.cardTitle,children:[O.jsx(_n,{title:r,children:n}),e]}),subheader:t,sx:Eu.cardHeader}),_ve=({expanded:e,onExpandedStateChange:t,title:n,subheader:r,icon:i,tooltipText:o,viewMode:s,setViewMode:a,hasPython:l,children:c})=>O.jsxs(Mje,{disableGutters:!0,elevation:0,square:!0,expanded:e,onChange:(u,f)=>t(f),sx:Eu.accordion,children:[O.jsx(Rje,{expandIcon:O.jsx(wat,{}),sx:Eu.accordionSummary,children:O.jsx(F8n,{title:n,icon:i,subheader:r,tooltipText:o})}),O.jsxs(Aje,{sx:Eu.accordionDetails,children:[O.jsx(L8n,{viewMode:s,setViewMode:a,hasPython:l}),c]})]}),$8n=ot(O.jsx("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets"),N8n=({expanded:e,onExpandedStateChange:t,viewMode:n,setViewMode:r,dataset:i,serverConfig:o,hasPython:s})=>{if(!i)return null;let a,l;if(n==="code"){const c=i.dimensions.map(f=>foe(f,["name","size","dtype"])),u=foe(i,["id","title","bbox","attrs"]);u.dimensions=c,a=O.jsx(Sve,{code:JSON.stringify(u,null,2)})}else if(n==="list")a=O.jsx(Rf,{children:O.jsx(UR,{data:Object.getOwnPropertyNames(i.attrs||{}).map(c=>[c,i.attrs[c]]),types:!0})});else if(n==="text"){const c=i.description||i.attrs.description||i.attrs.abstract||i.attrs.comment;l=typeof c=="string"&&O.jsx(Rf,{children:O.jsx(Hb,{text:c})});const u=[[Ce.get("Dimension names"),i.dimensions.map(f=>f.name).join(", ")],[Ce.get("Dimension lengths"),i.dimensions.map(f=>f.size).join(", ")],[Ce.get("Dimension data types"),i.dimensions.map(f=>f.dtype).join(", ")],[Ce.get("Geographical extent")+" (x1, y1, x2, y2)",i.bbox.map(f=>jf(f,3)).join(", ")],[Ce.get("Spatial reference system"),i.spatialRef],[Ce.get("Levels"),i.resolutions.length]];a=O.jsx(Rf,{children:O.jsx(UR,{data:u})})}else n==="python"&&(a=O.jsx(bat,{code:P3n(o,i)}));return O.jsxs(_ve,{expanded:e,onExpandedStateChange:t,title:i.title||`<${Ce.get("No Title")}>`,subheader:`${Ce.get("ID")}: ${i.id}`,tooltipText:Ce.get("Information about the selected dataset"),icon:O.jsx($8n,{}),viewMode:n,setViewMode:r,hasPython:s,children:[l,a]})},z8n=({innerHTML:e})=>{const t=M.useRef(null);return M.useEffect(()=>{t.current&&e&&(t.current.innerHTML=e)},[e]),M.useEffect(()=>{document.querySelectorAll(".svg-container svg text").forEach(r=>{r.setAttribute("font-size","11px")})},[]),e&&O.jsx(Rf,{children:O.jsx(bt,{className:"svg-container",ref:t,sx:Eu.htmlContent})})},j8n=({expanded:e,onExpandedStateChange:t,viewMode:n,setViewMode:r,variable:i,time:o,serverConfig:s,hasPython:a})=>{if(!i)return null;let l,c,u;if(n==="code"){const f=foe(i,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);l=O.jsx(Sve,{code:JSON.stringify(f,null,2)})}else if(n==="list")l=O.jsx(Rf,{children:O.jsx(UR,{data:Object.getOwnPropertyNames(i.attrs||{}).map(f=>[f,i.attrs[f]]),types:!0})});else if(n==="text"){const f=i.description||i.attrs.description||i.attrs.abstract||i.attrs.comment;c=typeof f=="string"&&O.jsx(Rf,{children:O.jsx(Hb,{text:f})}),u=i.htmlRepr&&O.jsx(z8n,{innerHTML:i.htmlRepr});let d=[[Ce.get("Units"),i.units]];dD(i)?d.push([Ce.get("Expression"),i.expression]):d=[...d,[Ce.get("Data type"),i.dtype],[Ce.get("Dimension names"),i.dims.join(", ")],[Ce.get("Dimension lengths"),i.shape.map(h=>h+"").join(", ")],[Ce.get("Time chunk size"),i.timeChunkSize]],l=O.jsx(Rf,{children:O.jsx(UR,{data:d})})}else n==="python"&&(l=O.jsx(bat,{code:k3n(s,i,o)}));return O.jsxs(_ve,{expanded:e,onExpandedStateChange:t,title:i.title||`<${Ce.get("No Title")}>`,subheader:`${Ce.get("Name")}: ${i.name}`,tooltipText:Ce.get("Information about the selected variable"),icon:O.jsx(qrt,{}),viewMode:n,setViewMode:r,hasPython:a,children:[c,l,u]})},B8n=ot(O.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place"),U8n=({expanded:e,onExpandedStateChange:t,viewMode:n,setViewMode:r,placeInfo:i})=>{if(!i)return null;const o=i.place;let s,a,l;if(n==="code")s=O.jsx(Sve,{code:JSON.stringify(o,null,2)});else if(n==="list")if(o.properties){const c=Object.getOwnPropertyNames(o.properties).map(u=>[u,o.properties[u]]);s=O.jsx(Rf,{children:O.jsx(UR,{data:c,types:!0})})}else s=O.jsx(Rf,{children:O.jsx(yn,{children:Ce.get("There is no information available for this location.")})});else i.image&&i.image.startsWith("http")&&(a=O.jsx(sxt,{sx:Eu.media,image:i.image,title:i.label})),i.description&&(l=O.jsx(Rf,{children:O.jsx(Hb,{text:i.description})})),!a&&!l&&(s=O.jsx(Rf,{children:O.jsx(yn,{children:Ce.get("There is no information available for this location.")})}));return O.jsxs(_ve,{expanded:e,onExpandedStateChange:t,title:i.label,subheader:`${Ce.get("Geometry type")}: ${Ce.get(o.geometry.type)}`,tooltipText:Ce.get("Information about the selected place"),icon:O.jsx(B8n,{}),viewMode:n,setViewMode:r,children:[a,l,s]})},V8n=({visibleInfoCardElements:e,setVisibleInfoCardElements:t,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:s,selectedTime:a,serverConfig:l,allowViewModePython:c})=>{const u=(v,y)=>{const b=new Set(e);!y&&b.has(v)&&b.delete(v),y&&!b.has(v)&&b.add(v),t([...b])},f=v=>u("place",v),d=v=>r("place",v),h=v=>u("variable",v),p=v=>r("variable",v),g=v=>u("dataset",v),m=v=>r("dataset",v);return O.jsxs("div",{children:[O.jsx(N8n,{expanded:e.includes("dataset"),onExpandedStateChange:g,viewMode:n.dataset,setViewMode:m,dataset:i,serverConfig:l,hasPython:c}),O.jsx(j8n,{expanded:e.includes("variable"),onExpandedStateChange:h,viewMode:n.variable,setViewMode:p,variable:o,time:a,serverConfig:l,hasPython:c}),O.jsx(U8n,{expanded:e.includes("place"),onExpandedStateChange:f,viewMode:n.place,setViewMode:d,placeInfo:s})]})},W8n=e=>({locale:e.controlState.locale,visibleInfoCardElements:lFt(e),infoCardElementViewModes:cFt(e),selectedDataset:Co(e),selectedVariable:nc(e),selectedPlaceInfo:ED(e),selectedTime:SD(e),serverConfig:Vo(e),allowViewModePython:!!On.instance.branding.allowViewModePython}),H8n={setVisibleInfoCardElements:PEn,updateInfoCardElementViewMode:kEn},G8n=dr(W8n,H8n)(V8n),lQ=5,q8n={container:e=>({marginTop:e.spacing(1),marginLeft:e.spacing(lQ),marginRight:e.spacing(lQ),width:`calc(100% - ${e.spacing(3*(lQ+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function X8n({dataTimeRange:e,selectedTimeRange:t,selectTimeRange:n}){const[r,i]=M.useState(t);M.useEffect(()=>{i(t)},[t]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},s=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function a(u){return ET(u)}const l=Array.isArray(e);l||(e=[Date.now()-2*B6e.years,Date.now()]);const c=[{value:e[0],label:WA(e[0])},{value:e[1],label:WA(e[1])}];return O.jsx(bt,{sx:q8n.container,children:O.jsx(oS,{disabled:!l,min:e[0],max:e[1],value:r,marks:c,onChange:o,onChangeCommitted:s,size:"small",valueLabelDisplay:"on",valueLabelFormat:a})})}var cQ,wIe;function Yc(){if(wIe)return cQ;wIe=1;var e=Array.isArray;return cQ=e,cQ}var uQ,SIe;function Sat(){if(SIe)return uQ;SIe=1;var e=typeof Rs=="object"&&Rs&&Rs.Object===Object&&Rs;return uQ=e,uQ}var fQ,_Ie;function Lg(){if(_Ie)return fQ;_Ie=1;var e=Sat(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return fQ=n,fQ}var dQ,CIe;function nF(){if(CIe)return dQ;CIe=1;var e=Lg(),t=e.Symbol;return dQ=t,dQ}var hQ,OIe;function Y8n(){if(OIe)return hQ;OIe=1;var e=nF(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(s){var a=n.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[i]=l:delete s[i]),u}return hQ=o,hQ}var pQ,EIe;function Q8n(){if(EIe)return pQ;EIe=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return pQ=n,pQ}var gQ,TIe;function Uv(){if(TIe)return gQ;TIe=1;var e=nF(),t=Y8n(),n=Q8n(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?i:r:o&&o in Object(a)?t(a):n(a)}return gQ=s,gQ}var mQ,PIe;function Vv(){if(PIe)return mQ;PIe=1;function e(t){return t!=null&&typeof t=="object"}return mQ=e,mQ}var vQ,kIe;function TP(){if(kIe)return vQ;kIe=1;var e=Uv(),t=Vv(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return vQ=r,vQ}var yQ,MIe;function Cve(){if(MIe)return yQ;MIe=1;var e=Yc(),t=TP(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,s){if(e(o))return!1;var a=typeof o;return a=="number"||a=="symbol"||a=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||s!=null&&o in Object(s)}return yQ=i,yQ}var bQ,AIe;function Xb(){if(AIe)return bQ;AIe=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return bQ=e,bQ}var xQ,RIe;function Ove(){if(RIe)return xQ;RIe=1;var e=Uv(),t=Xb(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!t(a))return!1;var l=e(a);return l==r||l==i||l==n||l==o}return xQ=s,xQ}var wQ,IIe;function K8n(){if(IIe)return wQ;IIe=1;var e=Lg(),t=e["__core-js_shared__"];return wQ=t,wQ}var SQ,DIe;function Z8n(){if(DIe)return SQ;DIe=1;var e=K8n(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return SQ=n,SQ}var _Q,LIe;function _at(){if(LIe)return _Q;LIe=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return _Q=n,_Q}var CQ,FIe;function J8n(){if(FIe)return CQ;FIe=1;var e=Ove(),t=Z8n(),n=Xb(),r=_at(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!n(d)||t(d))return!1;var h=e(d)?u:o;return h.test(r(d))}return CQ=f,CQ}var OQ,$Ie;function eWn(){if($Ie)return OQ;$Ie=1;function e(t,n){return t?.[n]}return OQ=e,OQ}var EQ,NIe;function jS(){if(NIe)return EQ;NIe=1;var e=J8n(),t=eWn();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return EQ=n,EQ}var TQ,zIe;function zW(){if(zIe)return TQ;zIe=1;var e=jS(),t=e(Object,"create");return TQ=t,TQ}var PQ,jIe;function tWn(){if(jIe)return PQ;jIe=1;var e=zW();function t(){this.__data__=e?e(null):{},this.size=0}return PQ=t,PQ}var kQ,BIe;function nWn(){if(BIe)return kQ;BIe=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return kQ=e,kQ}var MQ,UIe;function rWn(){if(UIe)return MQ;UIe=1;var e=zW(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var s=this.__data__;if(e){var a=s[o];return a===t?void 0:a}return r.call(s,o)?s[o]:void 0}return MQ=i,MQ}var AQ,VIe;function iWn(){if(VIe)return AQ;VIe=1;var e=zW(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return AQ=r,AQ}var RQ,WIe;function oWn(){if(WIe)return RQ;WIe=1;var e=zW(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return RQ=n,RQ}var IQ,HIe;function sWn(){if(HIe)return IQ;HIe=1;var e=tWn(),t=nWn(),n=rWn(),r=iWn(),i=oWn();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a-1}return zQ=t,zQ}var jQ,ZIe;function fWn(){if(ZIe)return jQ;ZIe=1;var e=jW();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return jQ=t,jQ}var BQ,JIe;function BW(){if(JIe)return BQ;JIe=1;var e=aWn(),t=lWn(),n=cWn(),r=uWn(),i=fWn();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a0?1:-1},S1=function(t){return Hw(t)&&t.indexOf("%")===t.length-1},At=function(t){return DWn(t)&&!kP(t)},LWn=function(t){return fr(t)},Fs=function(t){return At(t)||Hw(t)},FWn=0,MP=function(t){var n=++FWn;return"".concat(t||"").concat(n)},Gw=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!At(t)&&!Hw(t))return r;var o;if(S1(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return kP(o)&&(o=r),i&&o>n&&(o=n),o},l0=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},$Wn=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WWn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function cse(e){"@babel/helpers - typeof";return cse=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cse(e)}var TDe={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},nv=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},PDe=null,hK=null,Rve=function e(t){if(t===PDe&&Array.isArray(hK))return hK;var n=[];return M.Children.forEach(t,function(r){fr(r)||(MWn.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),hK=n,PDe=t,n};function Vf(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return nv(i)}):r=[nv(t)],Rve(e).forEach(function(i){var o=Uf(i,"type.displayName")||Uf(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function mu(e,t){var n=Vf(e,t);return n&&n[0]}var kDe=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!At(r)||r<=0||!At(i)||i<=0)},HWn=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],GWn=function(t){return t&&t.type&&Hw(t.type)&&HWn.indexOf(t.type)>=0},kat=function(t){return t&&cse(t)==="object"&&"clipDot"in t},qWn=function(t,n,r,i){var o,s=(o=dK?.[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!er(t)&&(i&&s.includes(n)||jWn.includes(n))||r&&Ave.includes(n)},sr=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(M.isValidElement(t)&&(i=t.props),!PP(i))return null;var o={};return Object.keys(i).forEach(function(s){var a;qWn((a=i)===null||a===void 0?void 0:a[s],s,n,r)&&(o[s]=i[s])}),o},use=function e(t,n){if(t===n)return!0;var r=M.Children.count(t);if(r!==M.Children.count(n))return!1;if(r===0)return!0;if(r===1)return MDe(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZWn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function dse(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,s=e.style,a=e.title,l=e.desc,c=KWn(e,QWn),u=i||{width:n,height:r,x:0,y:0},f=Re("recharts-surface",o);return Te.createElement("svg",fse({},sr(c,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Te.createElement("title",null,a),Te.createElement("desc",null,l),t)}var JWn=["children","className"];function hse(){return hse=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tHn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Ki=Te.forwardRef(function(e,t){var n=e.children,r=e.className,i=eHn(e,JWn),o=Re("recharts-layer",r);return Te.createElement("g",hse({className:o},sr(i,!0),{ref:t}),n)}),rv=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oo?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(o);++i=o?n:e(n,r,i)}return gK=t,gK}var mK,DDe;function Mat(){if(DDe)return mK;DDe=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",s="\\u200d",a=RegExp("["+s+e+i+o+"]");function l(c){return a.test(c)}return mK=l,mK}var vK,LDe;function iHn(){if(LDe)return vK;LDe=1;function e(t){return t.split("")}return vK=e,vK}var yK,FDe;function oHn(){if(FDe)return yK;FDe=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",s="["+e+"]",a="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+a+"|"+l+")",u="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",h="\\u200d",p=c+"?",g="["+o+"]?",m="(?:"+h+"(?:"+[u,f,d].join("|")+")"+g+p+")*",v=g+p+m,y="(?:"+[u+a+"?",a,f,d,s].join("|")+")",b=RegExp(l+"(?="+l+")|"+y+v,"g");function w(S){return S.match(b)||[]}return yK=w,yK}var bK,$De;function sHn(){if($De)return bK;$De=1;var e=iHn(),t=Mat(),n=oHn();function r(i){return t(i)?n(i):e(i)}return bK=r,bK}var xK,NDe;function aHn(){if(NDe)return xK;NDe=1;var e=rHn(),t=Mat(),n=sHn(),r=Oat();function i(o){return function(s){s=r(s);var a=t(s)?n(s):void 0,l=a?a[0]:s.charAt(0),c=a?e(a,1).join(""):s.slice(1);return l[o]()+c}}return xK=i,xK}var wK,zDe;function lHn(){if(zDe)return wK;zDe=1;var e=aHn(),t=e("toUpperCase");return wK=t,wK}var cHn=lHn();const WW=Vn(cHn);function uI(e){"@babel/helpers - typeof";return uI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uI(e)}var uHn=["type","size","sizeType"];function pse(){return pse=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gHn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Aat={symbolCircle:Tfe,symbolCross:P7t,symbolDiamond:M7t,symbolSquare:A7t,symbolStar:L7t,symbolTriangle:F7t,symbolWye:N7t},mHn=Math.PI/180,vHn=function(t){var n="symbol".concat(WW(t));return Aat[n]||Tfe},yHn=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*mHn;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},bHn=function(t,n){Aat["symbol".concat(WW(t))]=n},Ive=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,s=t.sizeType,a=s===void 0?"area":s,l=pHn(t,uHn),c=BDe(BDe({},l),{},{type:r,size:o,sizeType:a}),u=function(){var m=vHn(r),v=bGe().type(m).size(yHn(o,a,r));return v()},f=c.className,d=c.cx,h=c.cy,p=sr(c,!0);return d===+d&&h===+h&&o===+o?Te.createElement("path",pse({},p,{className:Re("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};Ive.registerSymbol=bHn;function YE(e){"@babel/helpers - typeof";return YE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},YE(e)}function gse(){return gse=Object.assign?Object.assign.bind():function(e){for(var t=1;tn?null:n+e.unit}const KX=HR.define({name:"python",parser:rNn.configure({props:[Kge.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&YX(e)||e.node;return(t=QX(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=YX(e);return(t=QX(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":UX({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":UX({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":UX({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=YX(e);return(t=n&&QX(e,n))!==null&&t!==void 0?t:e.continue()}}),Jge.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Frt,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function iBn(){return new Irt(KX,[KX.data.of({autocomplete:eBn}),KX.data.of({autocomplete:rBn})])}const oBn=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=cme(e.state,n.from);return r.line?sBn(e):r.block?lBn(e):!1};function lme(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}const sBn=lme(fBn,0),aBn=lme(uit,0),lBn=lme((e,t)=>uit(e,t,uBn(t)),0);function cme(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const v2=50;function cBn(e,{open:t,close:n},r,i){let o=e.sliceDoc(r-v2,r),s=e.sliceDoc(i,i+v2),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-t.length,c)==t&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*v2?u=f=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+v2),f=e.sliceDoc(i-v2,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+t.length)==t&&f.slice(p,p+n.length)==n?{open:{pos:r+d+t.length,margin:/\s/.test(u.charAt(d+t.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function uBn(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function uit(e,t,n=t.selection.ranges){let r=n.map(o=>cme(t,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>cBn(t,r[s],o.from,o.to));if(e!=2&&!i.every(o=>o))return{changes:t.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(e!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=t.changes(o);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const qie=Mg.define(),dBn=Mg.define(),hBn=Jt.define(),fit=Jt.define({combine(e){return Ag(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,i)=>t(r,i)||n(r,i)})}}),dit=za.define({create(){return Mp.empty},update(e,t){let n=t.state.facet(fit),r=t.annotation(qie);if(r){let l=Tc.fromTransaction(t,r.selection),c=r.side,u=c==0?e.undone:e.done;return l?u=b4(u,u.length,n.minDepth,l):u=git(u,t.startState.selection),new Mp(c==0?r.rest:u,c==0?u:r.rest)}let i=t.annotation(dBn);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(vs.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=Tc.fromTransaction(t),s=t.annotation(vs.time),a=t.annotation(vs.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Mp(e.done.map(Tc.fromJSON),e.undone.map(Tc.fromJSON))}});function pBn(e={}){return[dit,fit.of(e),Gt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?hit:t.inputType=="historyRedo"?Xie:null;return r?(t.preventDefault(),r(n)):!1}})]}function uW(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(dit,!1);if(!i)return!1;let o=i.pop(e,n,t);return o?(r(o),!0):!1}}const hit=uW(0,!1),Xie=uW(1,!1),gBn=uW(0,!0),mBn=uW(1,!0);class Tc{constructor(t,n,r,i,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(t){return new Tc(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new Tc(t.changes&&ks.fromJSON(t.changes),[],t.mapped&&Yp.fromJSON(t.mapped),t.startSelection&&ot.fromJSON(t.startSelection),t.selectionsAfter.map(ot.fromJSON))}static fromTransaction(t,n){let r=Af;for(let i of t.startState.facet(hBn)){let o=i(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new Tc(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Af)}static selection(t){return new Tc(void 0,Af,void 0,void 0,t)}}function b4(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function vBn(e,t){let n=[],r=!1;return e.iterChangedRanges((i,o)=>n.push(i,o)),t.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function yBn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function pit(e,t){return e.length?t.length?e.concat(t):e:t}const Af=[],bBn=200;function git(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-bBn));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),b4(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Tc.selection([t])]}function xBn(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function ZX(e,t){if(!e.length)return e;let n=e.length,r=Af;for(;n;){let i=wBn(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=e.slice(0,n);return o[n-1]=i,o}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Tc.selection(r)]:Af}function wBn(e,t,n){let r=pit(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):Af,n);if(!e.changes)return Tc.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new Tc(i,Vn.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}const SBn=/^(input\.type|delete)($|\.)/;class Mp{constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Mp(this.done,this.undone):this}addChanges(t,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&t.changes&&(!r||SBn.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):fW(n,t))}function bl(e){return e.textDirectionAt(e.state.selection.main.head)==Bi.LTR}const vit=e=>mit(e,!bl(e)),yit=e=>mit(e,bl(e));function bit(e,t){return $h(e,n=>n.empty?e.moveByGroup(n,t):fW(n,t))}const CBn=e=>bit(e,!bl(e)),OBn=e=>bit(e,bl(e));function EBn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function dW(e,t,n){let r=ca(e).resolveInner(t.head),i=n?br.closedBy:br.openedBy;for(let l=t.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;EBn(e,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?kp(e,r.from,1):kp(e,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,ot.cursor(a,n?-1:1)}const TBn=e=>$h(e,t=>dW(e.state,t,!bl(e))),PBn=e=>$h(e,t=>dW(e.state,t,bl(e)));function xit(e,t){return $h(e,n=>{if(!n.empty)return fW(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const wit=e=>xit(e,!1),Sit=e=>xit(e,!0);function _it(e){let t=e.scrollDOM.clientHeights.empty?e.moveVertically(s,t,n.height):fW(s,t));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottomCit(e,!1),Yie=e=>Cit(e,!0);function Vb(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head!=r.from+o&&(i=ot.cursor(r.from+o))}return i}const kBn=e=>$h(e,t=>Vb(e,t,!0)),MBn=e=>$h(e,t=>Vb(e,t,!1)),ABn=e=>$h(e,t=>Vb(e,t,!bl(e))),RBn=e=>$h(e,t=>Vb(e,t,bl(e))),IBn=e=>$h(e,t=>ot.cursor(e.lineBlockAt(t.head).from,1)),DBn=e=>$h(e,t=>ot.cursor(e.lineBlockAt(t.head).to,-1));function LBn(e,t,n){let r=!1,i=yP(e.selection,o=>{let s=kp(e,o.head,-1)||kp(e,o.head,1)||o.head>0&&kp(e,o.head-1,1)||o.headLBn(e,t);function gd(e,t){let n=yP(e.state.selection,r=>{let i=t(r);return ot.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(Fh(e.state,n)),!0)}function Oit(e,t){return gd(e,n=>e.moveByChar(n,t))}const Eit=e=>Oit(e,!bl(e)),Tit=e=>Oit(e,bl(e));function Pit(e,t){return gd(e,n=>e.moveByGroup(n,t))}const $Bn=e=>Pit(e,!bl(e)),NBn=e=>Pit(e,bl(e)),zBn=e=>gd(e,t=>dW(e.state,t,!bl(e))),jBn=e=>gd(e,t=>dW(e.state,t,bl(e)));function kit(e,t){return gd(e,n=>e.moveVertically(n,t))}const Mit=e=>kit(e,!1),Ait=e=>kit(e,!0);function Rit(e,t){return gd(e,n=>e.moveVertically(n,t,_it(e).height))}const JMe=e=>Rit(e,!1),eAe=e=>Rit(e,!0),BBn=e=>gd(e,t=>Vb(e,t,!0)),UBn=e=>gd(e,t=>Vb(e,t,!1)),VBn=e=>gd(e,t=>Vb(e,t,!bl(e))),WBn=e=>gd(e,t=>Vb(e,t,bl(e))),HBn=e=>gd(e,t=>ot.cursor(e.lineBlockAt(t.head).from)),GBn=e=>gd(e,t=>ot.cursor(e.lineBlockAt(t.head).to)),tAe=({state:e,dispatch:t})=>(t(Fh(e,{anchor:0})),!0),nAe=({state:e,dispatch:t})=>(t(Fh(e,{anchor:e.doc.length})),!0),rAe=({state:e,dispatch:t})=>(t(Fh(e,{anchor:e.selection.main.anchor,head:0})),!0),iAe=({state:e,dispatch:t})=>(t(Fh(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),qBn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),XBn=({state:e,dispatch:t})=>{let n=hW(e).map(({from:r,to:i})=>ot.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:ot.create(n),userEvent:"select"})),!0},YBn=({state:e,dispatch:t})=>{let n=yP(e.selection,r=>{let i=ca(e),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return ot.range(a.to,a.from)}return r});return n.eq(e.selection)?!1:(t(Fh(e,n)),!0)};function Iit(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let o of n.selection.ranges){let s=n.doc.lineAt(o.head);if(t?s.to0)for(let a=o;;){let l=e.moveVertically(a,t);if(l.heads.to){i.some(c=>c.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(e.dispatch(Fh(n,ot.create(i,i.length-1))),!0)}const QBn=e=>Iit(e,!1),KBn=e=>Iit(e,!0),ZBn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=ot.create([n.main]):n.main.empty||(r=ot.create([ot.cursor(n.main.head)])),r?(t(Fh(e,r)),!0):!1};function jL(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=t(o);ls&&(n="delete.forward",l=s3(e,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=s3(e,s,!1),a=s3(e,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:ot.cursor(s,si(e)))r.between(t,t,(i,o)=>{it&&(t=n?o:i)});return t}const Dit=(e,t,n)=>jL(e,r=>{let i=r.from,{state:o}=e,s=o.doc.lineAt(i),a,l;if(n&&!t&&i>s.from&&iDit(e,!1,!0),Lit=e=>Dit(e,!0,!1),Fit=(e,t)=>jL(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let l=ia(o.text,r-o.from,t)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),$it=e=>Fit(e,!1),JBn=e=>Fit(e,!0),e4n=e=>jL(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headjL(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),n4n=e=>jL(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Yr.of(["",""])},range:ot.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},i4n=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,o=e.doc.lineAt(i),s=i==o.from?i-1:ia(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:ia(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:e.doc.slice(i,a).append(e.doc.slice(s,i))},range:ot.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function hW(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=e.doc.lineAt(r.to-1)),n>=i.number){let s=t[t.length-1];s.to=o.to,s.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function Nit(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let o of hW(e)){if(n?o.to==e.doc.length:o.from==0)continue;let s=e.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+e.lineBreak});for(let l of o.ranges)i.push(ot.range(Math.min(e.doc.length,l.anchor+a),Math.min(e.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:e.lineBreak+s.text});for(let l of o.ranges)i.push(ot.range(l.anchor-a,l.head-a))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:ot.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const o4n=({state:e,dispatch:t})=>Nit(e,t,!1),s4n=({state:e,dispatch:t})=>Nit(e,t,!0);function zit(e,t,n){if(e.readOnly)return!1;let r=[];for(let o of hW(e))n?r.push({from:o.from,insert:e.doc.slice(o.from,o.to)+e.lineBreak}):r.push({from:o.to,insert:e.lineBreak+e.doc.slice(o.from,o.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const a4n=({state:e,dispatch:t})=>zit(e,t,!1),l4n=({state:e,dispatch:t})=>zit(e,t,!0),c4n=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(hW(t).map(({from:i,to:o})=>(i>0?i--:o{let o;if(e.lineWrapping){let s=e.lineBlockAt(i.head),a=e.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2)}return e.moveVertically(i,!0,o)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function u4n(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ca(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(br.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const oAe=jit(!1),f4n=jit(!0);function jit(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:o,to:s}=i,a=t.doc.lineAt(o),l=!e&&o==s&&u4n(t,o);e&&(o=s=(s<=a.to?a:t.doc.lineAt(s)).to);let c=new aW(t,{simulateBreak:o,simulateDoubleBreak:!!l}),u=Qge(c,o);for(u==null&&(u=mP(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=e.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),s=a.to+1}let o=e.changes(i);return{changes:i,range:ot.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const d4n=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new aW(e,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=ume(e,(o,s,a)=>{let l=Qge(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=GR(e,l);(c!=u||a.frome.readOnly?!1:(t(e.update(ume(e,(n,r)=>{r.push({from:n.from,insert:e.facet(FL)})}),{userEvent:"input.indent"})),!0),Uit=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ume(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=mP(i,e.tabSize),s=0,a=GR(e,Math.max(0,o-p4(e)));for(;s(e.setTabFocusMode(),!0),p4n=[{key:"Ctrl-b",run:vit,shift:Eit,preventDefault:!0},{key:"Ctrl-f",run:yit,shift:Tit},{key:"Ctrl-p",run:wit,shift:Mit},{key:"Ctrl-n",run:Sit,shift:Ait},{key:"Ctrl-a",run:IBn,shift:HBn},{key:"Ctrl-e",run:DBn,shift:GBn},{key:"Ctrl-d",run:Lit},{key:"Ctrl-h",run:Qie},{key:"Ctrl-k",run:e4n},{key:"Ctrl-Alt-h",run:$it},{key:"Ctrl-o",run:r4n},{key:"Ctrl-t",run:i4n},{key:"Ctrl-v",run:Yie}],g4n=[{key:"ArrowLeft",run:vit,shift:Eit,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:CBn,shift:$Bn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ABn,shift:VBn,preventDefault:!0},{key:"ArrowRight",run:yit,shift:Tit,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:OBn,shift:NBn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:RBn,shift:WBn,preventDefault:!0},{key:"ArrowUp",run:wit,shift:Mit,preventDefault:!0},{mac:"Cmd-ArrowUp",run:tAe,shift:rAe},{mac:"Ctrl-ArrowUp",run:ZMe,shift:JMe},{key:"ArrowDown",run:Sit,shift:Ait,preventDefault:!0},{mac:"Cmd-ArrowDown",run:nAe,shift:iAe},{mac:"Ctrl-ArrowDown",run:Yie,shift:eAe},{key:"PageUp",run:ZMe,shift:JMe},{key:"PageDown",run:Yie,shift:eAe},{key:"Home",run:MBn,shift:UBn,preventDefault:!0},{key:"Mod-Home",run:tAe,shift:rAe},{key:"End",run:kBn,shift:BBn,preventDefault:!0},{key:"Mod-End",run:nAe,shift:iAe},{key:"Enter",run:oAe,shift:oAe},{key:"Mod-a",run:qBn},{key:"Backspace",run:Qie,shift:Qie,preventDefault:!0},{key:"Delete",run:Lit,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:$it,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:JBn,preventDefault:!0},{mac:"Mod-Backspace",run:t4n,preventDefault:!0},{mac:"Mod-Delete",run:n4n,preventDefault:!0}].concat(p4n.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),m4n=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:TBn,shift:zBn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:PBn,shift:jBn},{key:"Alt-ArrowUp",run:o4n},{key:"Shift-Alt-ArrowUp",run:a4n},{key:"Alt-ArrowDown",run:s4n},{key:"Shift-Alt-ArrowDown",run:l4n},{key:"Mod-Alt-ArrowUp",run:QBn},{key:"Mod-Alt-ArrowDown",run:KBn},{key:"Escape",run:ZBn},{key:"Mod-Enter",run:f4n},{key:"Alt-l",mac:"Ctrl-l",run:XBn},{key:"Mod-i",run:YBn,preventDefault:!0},{key:"Mod-[",run:Uit},{key:"Mod-]",run:Bit},{key:"Mod-Alt-\\",run:d4n},{key:"Shift-Mod-k",run:c4n},{key:"Shift-Mod-\\",run:FBn},{key:"Mod-/",run:oBn},{key:"Alt-A",run:aBn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:h4n}].concat(g4n),v4n={key:"Tab",run:Bit,shift:Uit},sAe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class jE{constructor(t,n,r=0,i=t.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(sAe(a)):sAe,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return yc(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Age(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=wp(t);let i=this.normalize(n);if(i.length)for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=x4(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let a=new OO(n,t.sliceString(n,r));return JX.set(t,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=t.sliceString(n,s)+o,s=n),i.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=x4(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=OO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Wit.prototype[Symbol.iterator]=Hit.prototype[Symbol.iterator]=function(){return this});function y4n(e){try{return new RegExp(e,fme),!0}catch{return!1}}function x4(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t=56320&&r<57344;)t++;return t}const b4n=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=e5n(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return i.then(o=>{let s=o&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(o.elements.line.value);if(!s){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,l,c,u,f]=s,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let m=h/100;l&&(m=m*(l=="-"?-1:1)+a.number/t.doc.lines),h=Math.round(t.doc.lines*m)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,h))),g=ot.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[r,Gt.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},x4n={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},w4n=Jt.define({combine(e){return Ag(e,x4n,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function S4n(e){return[T4n,E4n]}const _4n=yn.mark({class:"cm-selectionMatch"}),C4n=yn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function aAe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=wo.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=wo.Word)}function O4n(e,t,n,r){return e(t.sliceDoc(n,n+1))==wo.Word&&e(t.sliceDoc(r-1,r))==wo.Word}const E4n=Ho.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(w4n),{state:n}=e,r=n.selection;if(r.ranges.length>1)return yn.none;let i=r.main,o,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return yn.none;let l=n.wordAt(i.head);if(!l)return yn.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return yn.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(aAe(s,n,i.from,i.to)&&O4n(s,n,i.from,i.to)))return yn.none}else if(o=n.sliceDoc(i.from,i.to),!o)return yn.none}let a=[];for(let l of e.visibleRanges){let c=new jE(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||aAe(s,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(C4n.range(u,f)):(u>=i.to||f<=i.from)&&a.push(_4n.range(u,f)),a.length>t.maxMatches))return yn.none}}return yn.set(a)}},{decorations:e=>e.decorations}),T4n=Gt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),P4n=({state:e,dispatch:t})=>{let{selection:n}=e,r=ot.create(n.ranges.map(i=>e.wordAt(i.head)||ot.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function k4n(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new jE(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new jE(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=e.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const M4n=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(o=>o.from===o.to))return P4n({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(o=>e.sliceDoc(o.from,o.to)!=r))return!1;let i=k4n(e,r);return i?(t(e.update({selection:e.selection.addRange(ot.range(i.from,i.to),!1),effects:Gt.scrollIntoView(i.to)})),!0):!1},bP=Jt.define({combine(e){return Ag(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new W4n(t),scrollToMatch:t=>Gt.scrollIntoView(t)})}});class Git{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||y4n(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` +`:r=="r"?"\r":r=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new F4n(this):new I4n(this)}getCursor(t,n=0,r){let i=t.doc?t:kr.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?_C(this,i,n,r):SC(this,i,n,r)}}class qit{constructor(t){this.spec=t}}function A4n(e,t,n){return(r,i,o,s)=>{if(n&&!n(r,i,o,s))return!1;let a=r>=s&&i<=s+o.length?o.slice(r-s,i-s):t.doc.sliceString(r,i);return e(a,t,r,i)}}function SC(e,t,n,r){let i;return e.wholeWord&&(i=R4n(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=A4n(e.test,t,i)),new jE(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:o=>o.toLowerCase(),i)}function R4n(e,t){return(n,r,i,o)=>((o>n||o+i.length=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=SC(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function D4n(e,t,n){return(r,i,o)=>(!n||n(r,i,o))&&e(o[0],t,r,i)}function _C(e,t,n,r){let i;return e.wholeWord&&(i=L4n(t.charCategorizer(t.selection.main.head))),e.test&&(i=D4n(e.test,t,i)),new Wit(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function w4(e,t){return e.slice(ia(e,t,!1),t)}function S4(e,t){return e.slice(t,ia(e,t))}function L4n(e){return(t,n,r)=>!r[0].length||(e(w4(r.input,r.index))!=wo.Word||e(S4(r.input,r.index))!=wo.Word)&&(e(S4(r.input,r.index+r[0].length))!=wo.Word||e(w4(r.input,r.index+r[0].length))!=wo.Word)}class F4n extends qit{nextMatch(t,n,r){let i=_C(this.spec,t,r,t.doc.length).next();return i.done&&(i=_C(this.spec,t,0,n).next()),i.done?null:i.value}prevMatchInRange(t,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=_C(this.spec,t,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let o=+r.slice(0,i);if(o>0&&o=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=_C(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const QR=Vn.define(),dme=Vn.define(),F0=za.define({create(e){return new eY(Kie(e).create(),null)},update(e,t){for(let n of t.effects)n.is(QR)?e=new eY(n.value.create(),e.panel):n.is(dme)&&(e=new eY(e.query,n.value?hme:null));return e},provide:e=>WR.from(e,t=>t.panel)});class eY{constructor(t,n){this.query=t,this.panel=n}}const $4n=yn.mark({class:"cm-searchMatch"}),N4n=yn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),z4n=Ho.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(F0))}update(e){let t=e.state.field(F0);(t!=e.startState.field(F0)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return yn.none;let{view:n}=this,r=new gv;for(let i=0,o=n.visibleRanges,s=o.length;io[i+1].from-500;)l=o[++i].to;e.highlight(n.state,a,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?N4n:$4n)})}return r.finish()}},{decorations:e=>e.decorations});function BL(e){return t=>{let n=t.state.field(F0,!1);return n&&n.query.spec.valid?e(t,n):Qit(t)}}const _4=BL((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=ot.single(r.from,r.to),o=e.state.facet(bP);return e.dispatch({selection:i,effects:[pme(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),Yit(e),!0}),C4=BL((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=ot.single(i.from,i.to),s=e.state.facet(bP);return e.dispatch({selection:o,effects:[pme(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),Yit(e),!0}),j4n=BL((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ot.create(n.map(r=>ot.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),B4n=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new jE(e.doc,e.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(ot.range(a.value.from,a.value.to))}return t(e.update({selection:ot.create(o,s),userEvent:"select.search.matches"})),!0},lAe=BL((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let s=o,a=[],l,c,u=[];s.from==r&&s.to==i&&(c=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:c}),s=t.nextMatch(n,s.from,s.to),u.push(Gt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=e.state.changes(a);return s&&(l=ot.single(s.from,s.to).map(f),u.push(pme(e,s)),u.push(n.facet(bP).scrollToMatch(l.main,e))),e.dispatch({changes:f,selection:l,effects:u,userEvent:"input.replace"}),!0}),U4n=BL((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:t.getReplacement(i)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Gt.announce.of(r),userEvent:"input.replace.all"}),!0});function hme(e){return e.state.facet(bP).createPanel(e)}function Kie(e,t){var n,r,i,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(bP);return new Git({search:((n=t?.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=t?.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=t?.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=t?.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function Xit(e){let t=Yge(e,hme);return t&&t.dom.querySelector("[main-field]")}function Yit(e){let t=Xit(e);t&&t==e.root.activeElement&&t.select()}const Qit=e=>{let t=e.state.field(F0,!1);if(t&&t.panel){let n=Xit(e);if(n&&n!=e.root.activeElement){let r=Kie(e.state,t.query.spec);r.valid&&e.dispatch({effects:QR.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[dme.of(!0),t?QR.of(Kie(e.state,t.query.spec)):Vn.appendConfig.of(G4n)]});return!0},Kit=e=>{let t=e.state.field(F0,!1);if(!t||!t.panel)return!1;let n=Yge(e,hme);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:dme.of(!1)}),!0},V4n=[{key:"Mod-f",run:Qit,scope:"editor search-panel"},{key:"F3",run:_4,shift:C4,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:_4,shift:C4,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Kit,scope:"editor search-panel"},{key:"Mod-Shift-l",run:B4n},{key:"Mod-Alt-g",run:b4n},{key:"Mod-d",run:M4n,preventDefault:!0}];class W4n{constructor(t){this.view=t;let n=this.query=t.state.field(F0).query.spec;this.commit=this.commit.bind(this),this.searchField=Ai("input",{value:n.search,placeholder:nu(t,"Find"),"aria-label":nu(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ai("input",{value:n.replace,placeholder:nu(t,"Replace"),"aria-label":nu(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ai("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Ai("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Ai("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return Ai("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=Ai("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>_4(t),[nu(t,"next")]),r("prev",()=>C4(t),[nu(t,"previous")]),r("select",()=>j4n(t),[nu(t,"all")]),Ai("label",null,[this.caseField,nu(t,"match case")]),Ai("label",null,[this.reField,nu(t,"regexp")]),Ai("label",null,[this.wordField,nu(t,"by word")]),...t.state.readOnly?[]:[Ai("br"),this.replaceField,r("replace",()=>lAe(t),[nu(t,"replace")]),r("replaceAll",()=>U4n(t),[nu(t,"replace all")])],Ai("button",{name:"close",onclick:()=>Kit(t),"aria-label":nu(t,"close"),type:"button"},["×"])])}commit(){let t=new Git({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:QR.of(t)}))}keydown(t){uzn(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?C4:_4)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),lAe(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(QR)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(bP).top}}function nu(e,t){return e.state.phrase(t)}const a3=30,l3=/[\s\.,:;?!]/;function pme(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-a3),s=Math.min(i,n+a3),a=e.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;la.length-a3;l--)if(!l3.test(a[l-1])&&l3.test(a[l])){a=a.slice(0,l);break}}return Gt.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}const H4n=Gt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),G4n=[F0,Ub.low(z4n),H4n];class cAe{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class Jx{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(KR).markerFilter;i&&(t=i(t,r));let o=t.slice().sort((h,p)=>h.from-p.from||h.to-p.to),s=new gv,a=[],l=0,c=r.doc.iter(),u=0,f=r.doc.length;for(let h=0;;){let p=h==o.length?null:o[h];if(!p&&!a.length)break;let g,m;if(a.length)g=l,m=a.reduce((b,w)=>Math.min(b,w.to),p&&p.from>g?p.from:1e8);else{if(g=p.from,g>f)break;m=p.to,a.push(p),h++}for(;hb.from||b.to==g))a.push(b),h++,m=Math.min(b.to,m);else{m=Math.min(b.from,m);break}}m=Math.min(m,f);let v=!1;if(a.some(b=>b.from==g&&(b.to==m||m==f))&&(v=g==m,!v&&m-g<10)){let b=g-(u+c.value.length);b>0&&(c.next(b),u=g);for(let w=g;;){if(w>=m){v=!0;break}if(!c.lineBreak&&u+c.value.length>w)break;w=u+c.value.length,u+=c.value.length,c.next()}}let y=o6n(a);if(v)s.add(g,g,yn.widget({widget:new t6n(y),diagnostics:a.slice()}));else{let b=a.reduce((w,S)=>S.markClass?w+" "+S.markClass:w,"");s.add(g,m,yn.mark({class:"cm-lintRange cm-lintRange-"+y+b,diagnostics:a.slice(),inclusiveEnd:a.some(w=>w.to>m)}))}if(l=m,l==f)break;for(let b=0;b{if(!(t&&s.diagnostics.indexOf(t)<0))if(!r)r=new cAe(i,o,t||s.diagnostics[0]);else{if(s.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new cAe(r.from,o,r.diagnostic)}}),r}function q4n(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(KR).hideOn(e,n,r);if(i!=null)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(s=>s.is(Zit))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}function X4n(e,t){return e.field(Tu,!1)?t:t.concat(Vn.appendConfig.of(s6n))}const Zit=Vn.define(),gme=Vn.define(),Jit=Vn.define(),Tu=za.define({create(){return new Jx(yn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=hb(n,e.selected.diagnostic,o)||hb(n,null,o)}!n.size&&i&&t.state.facet(KR).autoPanel&&(i=null),e=new Jx(n,i,r)}for(let n of t.effects)if(n.is(Zit)){let r=t.state.facet(KR).autoPanel?n.value.length?ZR.open:null:e.panel;e=Jx.init(n.value,r,t.state)}else n.is(gme)?e=new Jx(e.diagnostics,n.value?ZR.open:null,e.selected):n.is(Jit)&&(e=new Jx(e.diagnostics,e.panel,n.value));return e},provide:e=>[WR.from(e,t=>t.panel),Gt.decorations.from(e,t=>t.diagnostics)]}),Y4n=yn.mark({class:"cm-lintRange cm-lintRange-active"});function Q4n(e,t,n){let{diagnostics:r}=e.state.field(Tu),i,o=-1,s=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(l,c,{spec:u})=>{if(t>=l&&t<=c&&(l==c||(t>l||n>0)&&(ttot(e,n,!1)))}const Z4n=e=>{let t=e.state.field(Tu,!1);(!t||!t.panel)&&e.dispatch({effects:X4n(e.state,[gme.of(!0)])});let n=Yge(e,ZR.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},uAe=e=>{let t=e.state.field(Tu,!1);return!t||!t.panel?!1:(e.dispatch({effects:gme.of(!1)}),!0)},J4n=e=>{let t=e.state.field(Tu,!1);if(!t)return!1;let n=e.state.selection.main,r=hb(t.diagnostics,null,n.to+1);return!r&&(r=hb(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},e6n=[{key:"Mod-Shift-m",run:Z4n,preventDefault:!0},{key:"F8",run:J4n}],KR=Jt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Ag(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:fAe,tooltipFilter:fAe,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,i,o)=>t(r,i,o)||n(r,i,o):t:n,autoPanel:(t,n)=>t||n})}}});function fAe(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function eot(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;ro.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function tot(e,t,n){var r;let i=n?eot(t.actions):[];return Ai("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ai("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=h=>{if(h.preventDefault(),a)return;a=!0;let p=hb(e.state.field(Tu).diagnostics,t);p&&o.apply(e,p.from,p.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),Ai("u",c.slice(u,u+1)),c.slice(u+1)],d=o.markClass?" "+o.markClass:"";return Ai("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),t.source&&Ai("div",{class:"cm-diagnosticSource"},t.source))}class t6n extends Lh{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ai("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class dAe{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=tot(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ZR{constructor(t){this.view=t,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)uAe(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=eot(o.actions);for(let a=0;a{for(let o=0;ouAe(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tu).selected;if(!t)return-1;for(let n=0;n{for(let u of c.diagnostics){if(s.has(u))continue;s.add(u);let f=-1,d;for(let h=r;hr&&(this.items.splice(r,f-r),i=!0)),n&&d.diagnostic==n.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),o=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),r++}});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.topl.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Tu),r=hb(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Jit.of(r)})}static open(t){return new ZR(t)}}function n6n(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function c3(e){return n6n(``,'width="6" height="3"')}const r6n=Gt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:c3("#d11")},".cm-lintRange-warning":{backgroundImage:c3("orange")},".cm-lintRange-info":{backgroundImage:c3("#999")},".cm-lintRange-hint":{backgroundImage:c3("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function i6n(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function o6n(e){let t="hint",n=1;for(let r of e){let i=i6n(r.severity);i>n&&(n=i,t=r.severity)}return t}const s6n=[Tu,Gt.decorations.compute([Tu],e=>{let{selected:t,panel:n}=e.field(Tu);return!t||!n||t.from==t.to?yn.none:yn.set([Y4n.range(t.from,t.to)])}),Zzn(Q4n,{hideOn:q4n}),r6n];var hAe=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(Hjn)),t.defaultKeymap!==!1&&(r=r.concat(m4n)),t.searchKeymap!==!1&&(r=r.concat(V4n)),t.historyKeymap!==!1&&(r=r.concat(_Bn)),t.foldKeymap!==!1&&(r=r.concat(F5n)),t.completionKeymap!==!1&&(r=r.concat(sit)),t.lintKeymap!==!1&&(r=r.concat(e6n));var i=[];return t.lineNumbers!==!1&&i.push(f5n()),t.highlightActiveLineGutter!==!1&&i.push(p5n()),t.highlightSpecialChars!==!1&&i.push(Tzn()),t.history!==!1&&i.push(pBn()),t.foldGutter!==!1&&i.push(j5n()),t.drawSelection!==!1&&i.push(mzn()),t.dropCursor!==!1&&i.push(wzn()),t.allowMultipleSelections!==!1&&i.push(kr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&i.push(T5n()),t.syntaxHighlighting!==!1&&i.push(Hrt(W5n,{fallback:!0})),t.bracketMatching!==!1&&i.push(K5n()),t.closeBrackets!==!1&&i.push(Bjn()),t.autocompletion!==!1&&i.push(oit()),t.rectangularSelection!==!1&&i.push(Bzn()),n!==!1&&i.push(Wzn()),t.highlightActiveLine!==!1&&i.push(Izn()),t.highlightSelectionMatches!==!1&&i.push(S4n()),t.tabSize&&typeof t.tabSize=="number"&&i.push(FL.of(" ".repeat(t.tabSize))),i.concat([LL.of(r.flat())]).filter(Boolean)};const a6n="#e5c07b",pAe="#e06c75",l6n="#56b6c2",c6n="#ffffff",s5="#abb2bf",Zie="#7d8799",u6n="#61afef",f6n="#98c379",gAe="#d19a66",d6n="#c678dd",h6n="#21252b",mAe="#2c313a",vAe="#282c34",tY="#353a42",p6n="#3E4451",yAe="#528bff",g6n=Gt.theme({"&":{color:s5,backgroundColor:vAe},".cm-content":{caretColor:yAe},".cm-cursor, .cm-dropCursor":{borderLeftColor:yAe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:p6n},".cm-panels":{backgroundColor:h6n,color:s5},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:vAe,color:Zie,border:"none"},".cm-activeLineGutter":{backgroundColor:mAe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:tY},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:tY,borderBottomColor:tY},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:mAe,color:s5}}},{dark:!0}),m6n=NL.define([{tag:We.keyword,color:d6n},{tag:[We.name,We.deleted,We.character,We.propertyName,We.macroName],color:pAe},{tag:[We.function(We.variableName),We.labelName],color:u6n},{tag:[We.color,We.constant(We.name),We.standard(We.name)],color:gAe},{tag:[We.definition(We.name),We.separator],color:s5},{tag:[We.typeName,We.className,We.number,We.changed,We.annotation,We.modifier,We.self,We.namespace],color:a6n},{tag:[We.operator,We.operatorKeyword,We.url,We.escape,We.regexp,We.link,We.special(We.string)],color:l6n},{tag:[We.meta,We.comment],color:Zie},{tag:We.strong,fontWeight:"bold"},{tag:We.emphasis,fontStyle:"italic"},{tag:We.strikethrough,textDecoration:"line-through"},{tag:We.link,color:Zie,textDecoration:"underline"},{tag:We.heading,fontWeight:"bold",color:pAe},{tag:[We.atom,We.bool,We.special(We.variableName)],color:gAe},{tag:[We.processingInstruction,We.string,We.inserted],color:f6n},{tag:We.invalid,color:c6n}]),v6n=[g6n,Hrt(m6n)];var y6n=Gt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),b6n=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=t,l=[];switch(n&&l.unshift(LL.of([v4n])),a&&(typeof a=="boolean"?l.unshift(hAe()):l.unshift(hAe(a))),s&&l.unshift($zn(s)),o){case"light":l.push(y6n);break;case"dark":l.push(v6n);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(Gt.editable.of(!1)),i&&l.push(kr.readOnly.of(!0)),[...l]},x6n=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class w6n{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class bAe{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var nY=null,S6n=()=>typeof window>"u"?new bAe:(nY||(nY=new bAe),nY),xAe=Mg.define(),_6n=200,C6n=[];function O6n(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=C6n,autoFocus:l,theme:c="light",height:u=null,minHeight:f=null,maxHeight:d=null,width:h=null,minWidth:p=null,maxWidth:g=null,placeholder:m="",editable:v=!0,readOnly:y=!1,indentWithTab:b=!0,basicSetup:w=!0,root:S,initialState:_}=e,[E,T]=M.useState(),[k,P]=M.useState(),[I,R]=M.useState(),F=M.useState(()=>({current:null}))[0],A=M.useState(()=>({current:null}))[0],L=Gt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:h,minWidth:p,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),$=Gt.updateListener.of(U=>{if(U.docChanged&&typeof r=="function"&&!U.transactions.some(B=>B.annotation(xAe))){F.current?F.current.reset():(F.current=new w6n(()=>{if(A.current){var B=A.current;A.current=null,B()}F.current=null},_6n),S6n().add(F.current));var z=U.state.doc,N=z.toString();r(N,U)}i&&i(x6n(U))}),j=b6n({theme:c,editable:v,readOnly:y,placeholder:m,indentWithTab:b,basicSetup:w}),V=[$,L,...j];return s&&typeof s=="function"&&V.push(Gt.updateListener.of(s)),V=V.concat(a),M.useLayoutEffect(()=>{if(E&&!I){var U={doc:t,selection:n,extensions:V},z=_?kr.fromJSON(_.json,U,_.fields):kr.create(U);if(R(z),!k){var N=new Gt({state:z,parent:E,root:S});P(N),o&&o(N,z)}}return()=>{k&&(R(void 0),P(void 0))}},[E,I]),M.useEffect(()=>{e.container&&T(e.container)},[e.container]),M.useEffect(()=>()=>{k&&(k.destroy(),P(void 0)),F.current&&(F.current.cancel(),F.current=null)},[k]),M.useEffect(()=>{l&&k&&k.focus()},[l,k]),M.useEffect(()=>{k&&k.dispatch({effects:Vn.reconfigure.of(V)})},[c,a,u,f,d,h,p,g,m,v,y,b,w,r,s]),M.useEffect(()=>{if(t!==void 0){var U=k?k.state.doc.toString():"";if(k&&t!==U){var z=F.current&&!F.current.isDone,N=()=>{k&&t!==k.state.doc.toString()&&k.dispatch({changes:{from:0,to:k.state.doc.toString().length,insert:t||""},annotations:[xAe.of(!0)]})};z?A.current=N:N()}}},[t,k]),{state:I,setState:R,view:k,setView:P,container:E,setContainer:T}}var E6n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],pW=M.forwardRef((e,t)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:b,indentWithTab:w,editable:S,readOnly:_,root:E,initialState:T}=e,k=st(e,E6n),P=M.useRef(null),{state:I,view:R,container:F,setContainer:A}=O6n({root:E,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:b,indentWithTab:w,editable:S,readOnly:_,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:T});M.useImperativeHandle(t,()=>({editor:P.current,state:I,view:R}),[P,F,I,R]);var L=M.useCallback(j=>{P.current=j,A(j)},[A]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var $=typeof f=="string"?"cm-theme-"+f:"cm-theme";return O.jsx("div",X({ref:L,className:""+$+(n?" "+n:"")},k))});pW.displayName="CodeMirror";const Rf=({children:e})=>O.jsx(Uze,{sx:Eu.cardContent,children:e}),not=({code:e,extension:t})=>{const n=as();return O.jsx(Rf,{children:O.jsx(pW,{theme:n.palette.mode,height:"320px",extensions:[t],value:e,readOnly:!0})})},rot=({code:e})=>O.jsx(not,{code:e,extension:iBn()}),T6n=Pge({String:We.string,Number:We.number,"True False":We.bool,PropertyName:We.propertyName,Null:We.null,", :":We.separator,"[ ]":We.squareBracket,"{ }":We.brace}),P6n=IR.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[T6n],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),k6n=HR.define({name:"json",parser:P6n.configure({props:[Kge.add({Object:DMe({except:/^\s*\}/}),Array:DMe({except:/^\s*\]/})}),Jge.add({"Object Array":Frt})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function iot(){return new Irt(k6n)}const mme=({code:e})=>O.jsx(not,{code:e,extension:iot()}),oot=at(O.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),M6n=at(O.jsx("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject"),A6n=at(O.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),R6n=at(O.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),I6n=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,D6n=({viewMode:e,setViewMode:t,hasPython:n})=>O.jsxs(GI,{size:"small",value:e,exclusive:!0,onChange:(r,i)=>t(i),children:[O.jsx(oo,{value:"text",sx:Eu.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Textual format"),children:O.jsx(R6n,{fontSize:"inherit"})})},"text"),O.jsx(oo,{value:"list",sx:Eu.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("Tabular format"),children:O.jsx(A6n,{fontSize:"inherit"})})},"list"),O.jsx(oo,{value:"code",sx:Eu.toggleButton,children:O.jsx(_n,{arrow:!0,title:Ce.get("JSON format"),children:O.jsx(M6n,{fontSize:"inherit"})})},"json"),n&&O.jsx(oo,{value:"python",sx:{...Eu.toggleButton,width:"30px"},children:O.jsx("img",{src:I6n,width:12,alt:"python logo"})},"python")]},0),L6n=({title:e,subheader:t,icon:n,tooltipText:r})=>O.jsx(Nyt,{title:O.jsxs(bt,{sx:Eu.cardTitle,children:[O.jsx(_n,{title:r,children:n}),e]}),subheader:t,sx:Eu.cardHeader}),vme=({expanded:e,onExpandedStateChange:t,title:n,subheader:r,icon:i,tooltipText:o,viewMode:s,setViewMode:a,hasPython:l,children:c})=>O.jsxs(Use,{disableGutters:!0,elevation:0,square:!0,expanded:e,onChange:(u,f)=>t(f),sx:Eu.accordion,children:[O.jsx(Wse,{expandIcon:O.jsx(oot,{}),sx:Eu.accordionSummary,children:O.jsx(L6n,{title:n,icon:i,subheader:r,tooltipText:o})}),O.jsxs(Vse,{sx:Eu.accordionDetails,children:[O.jsx(D6n,{viewMode:s,setViewMode:a,hasPython:l}),c]})]}),F6n=at(O.jsx("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets"),$6n=({expanded:e,onExpandedStateChange:t,viewMode:n,setViewMode:r,dataset:i,serverConfig:o,hasPython:s})=>{if(!i)return null;let a,l;if(n==="code"){const c=i.dimensions.map(f=>oie(f,["name","size","dtype"])),u=oie(i,["id","title","bbox","attrs"]);u.dimensions=c,a=O.jsx(mme,{code:JSON.stringify(u,null,2)})}else if(n==="list")a=O.jsx(Rf,{children:O.jsx(AR,{data:Object.getOwnPropertyNames(i.attrs||{}).map(c=>[c,i.attrs[c]]),types:!0})});else if(n==="text"){const c=i.description||i.attrs.description||i.attrs.abstract||i.attrs.comment;l=typeof c=="string"&&O.jsx(Rf,{children:O.jsx(Bb,{text:c})});const u=[[Ce.get("Dimension names"),i.dimensions.map(f=>f.name).join(", ")],[Ce.get("Dimension lengths"),i.dimensions.map(f=>f.size).join(", ")],[Ce.get("Dimension data types"),i.dimensions.map(f=>f.dtype).join(", ")],[Ce.get("Geographical extent")+" (x1, y1, x2, y2)",i.bbox.map(f=>jf(f,3)).join(", ")],[Ce.get("Spatial reference system"),i.spatialRef],[Ce.get("Levels"),i.resolutions.length]];a=O.jsx(Rf,{children:O.jsx(AR,{data:u})})}else n==="python"&&(a=O.jsx(rot,{code:mFn(o,i)}));return O.jsxs(vme,{expanded:e,onExpandedStateChange:t,title:i.title||`<${Ce.get("No Title")}>`,subheader:`${Ce.get("ID")}: ${i.id}`,tooltipText:Ce.get("Information about the selected dataset"),icon:O.jsx(F6n,{}),viewMode:n,setViewMode:r,hasPython:s,children:[l,a]})},N6n=({innerHTML:e})=>{const t=M.useRef(null);return M.useEffect(()=>{t.current&&e&&(t.current.innerHTML=e)},[e]),M.useEffect(()=>{document.querySelectorAll(".svg-container svg text").forEach(r=>{r.setAttribute("font-size","11px")})},[]),e&&O.jsx(Rf,{children:O.jsx(bt,{className:"svg-container",ref:t,sx:Eu.htmlContent})})},z6n=({expanded:e,onExpandedStateChange:t,viewMode:n,setViewMode:r,variable:i,time:o,serverConfig:s,hasPython:a})=>{if(!i)return null;let l,c,u;if(n==="code"){const f=oie(i,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);l=O.jsx(mme,{code:JSON.stringify(f,null,2)})}else if(n==="list")l=O.jsx(Rf,{children:O.jsx(AR,{data:Object.getOwnPropertyNames(i.attrs||{}).map(f=>[f,i.attrs[f]]),types:!0})});else if(n==="text"){const f=i.description||i.attrs.description||i.attrs.abstract||i.attrs.comment;c=typeof f=="string"&&O.jsx(Rf,{children:O.jsx(Bb,{text:f})}),u=i.htmlRepr&&O.jsx(N6n,{innerHTML:i.htmlRepr});let d=[[Ce.get("Units"),i.units]];tD(i)?d.push([Ce.get("Expression"),i.expression]):d=[...d,[Ce.get("Data type"),i.dtype],[Ce.get("Dimension names"),i.dims.join(", ")],[Ce.get("Dimension lengths"),i.shape.map(h=>h+"").join(", ")],[Ce.get("Time chunk size"),i.timeChunkSize]],l=O.jsx(Rf,{children:O.jsx(AR,{data:d})})}else n==="python"&&(l=O.jsx(rot,{code:vFn(s,i,o)}));return O.jsxs(vme,{expanded:e,onExpandedStateChange:t,title:i.title||`<${Ce.get("No Title")}>`,subheader:`${Ce.get("Name")}: ${i.name}`,tooltipText:Ce.get("Information about the selected variable"),icon:O.jsx(Ftt,{}),viewMode:n,setViewMode:r,hasPython:a,children:[c,l,u]})},j6n=at(O.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place"),B6n=({expanded:e,onExpandedStateChange:t,viewMode:n,setViewMode:r,placeInfo:i})=>{if(!i)return null;const o=i.place;let s,a,l;if(n==="code")s=O.jsx(mme,{code:JSON.stringify(o,null,2)});else if(n==="list")if(o.properties){const c=Object.getOwnPropertyNames(o.properties).map(u=>[u,o.properties[u]]);s=O.jsx(Rf,{children:O.jsx(AR,{data:c,types:!0})})}else s=O.jsx(Rf,{children:O.jsx(mn,{children:Ce.get("There is no information available for this location.")})});else i.image&&i.image.startsWith("http")&&(a=O.jsx(Wyt,{sx:Eu.media,image:i.image,title:i.label})),i.description&&(l=O.jsx(Rf,{children:O.jsx(Bb,{text:i.description})})),!a&&!l&&(s=O.jsx(Rf,{children:O.jsx(mn,{children:Ce.get("There is no information available for this location.")})}));return O.jsxs(vme,{expanded:e,onExpandedStateChange:t,title:i.label,subheader:`${Ce.get("Geometry type")}: ${Ce.get(o.geometry.type)}`,tooltipText:Ce.get("Information about the selected place"),icon:O.jsx(j6n,{}),viewMode:n,setViewMode:r,children:[a,l,s]})},U6n=({visibleInfoCardElements:e,setVisibleInfoCardElements:t,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:s,selectedTime:a,serverConfig:l,allowViewModePython:c})=>{const u=(v,y)=>{const b=new Set(e);!y&&b.has(v)&&b.delete(v),y&&!b.has(v)&&b.add(v),t([...b])},f=v=>u("place",v),d=v=>r("place",v),h=v=>u("variable",v),p=v=>r("variable",v),g=v=>u("dataset",v),m=v=>r("dataset",v);return O.jsxs("div",{children:[O.jsx($6n,{expanded:e.includes("dataset"),onExpandedStateChange:g,viewMode:n.dataset,setViewMode:m,dataset:i,serverConfig:l,hasPython:c}),O.jsx(z6n,{expanded:e.includes("variable"),onExpandedStateChange:h,viewMode:n.variable,setViewMode:p,variable:o,time:a,serverConfig:l,hasPython:c}),O.jsx(B6n,{expanded:e.includes("place"),onExpandedStateChange:f,viewMode:n.place,setViewMode:d,placeInfo:s})]})},V6n=e=>({locale:e.controlState.locale,visibleInfoCardElements:GIt(e),infoCardElementViewModes:qIt(e),selectedDataset:Co(e),selectedVariable:ec(e),selectedPlaceInfo:gD(e),selectedTime:fD(e),serverConfig:Go(e),allowViewModePython:!!On.instance.branding.allowViewModePython}),W6n={setVisibleInfoCardElements:g_n,updateInfoCardElementViewMode:m_n},H6n=hr(V6n,W6n)(U6n),rY=5,G6n={container:e=>({marginTop:e.spacing(1),marginLeft:e.spacing(rY),marginRight:e.spacing(rY),width:`calc(100% - ${e.spacing(3*(rY+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function q6n({dataTimeRange:e,selectedTimeRange:t,selectTimeRange:n}){const[r,i]=M.useState(t);M.useEffect(()=>{i(t)},[t]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},s=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function a(u){return yT(u)}const l=Array.isArray(e);l||(e=[Date.now()-2*DBe.years,Date.now()]);const c=[{value:e[0],label:IA(e[0])},{value:e[1],label:IA(e[1])}];return O.jsx(bt,{sx:G6n.container,children:O.jsx(Kw,{disabled:!l,min:e[0],max:e[1],value:r,marks:c,onChange:o,onChangeCommitted:s,size:"small",valueLabelDisplay:"on",valueLabelFormat:a})})}var iY,wAe;function Xc(){if(wAe)return iY;wAe=1;var e=Array.isArray;return iY=e,iY}var oY,SAe;function sot(){if(SAe)return oY;SAe=1;var e=typeof Rs=="object"&&Rs&&Rs.Object===Object&&Rs;return oY=e,oY}var sY,_Ae;function Rg(){if(_Ae)return sY;_Ae=1;var e=sot(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return sY=n,sY}var aY,CAe;function UL(){if(CAe)return aY;CAe=1;var e=Rg(),t=e.Symbol;return aY=t,aY}var lY,OAe;function X6n(){if(OAe)return lY;OAe=1;var e=UL(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(s){var a=n.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[i]=l:delete s[i]),u}return lY=o,lY}var cY,EAe;function Y6n(){if(EAe)return cY;EAe=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return cY=n,cY}var uY,TAe;function Nv(){if(TAe)return uY;TAe=1;var e=UL(),t=X6n(),n=Y6n(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?i:r:o&&o in Object(a)?t(a):n(a)}return uY=s,uY}var fY,PAe;function zv(){if(PAe)return fY;PAe=1;function e(t){return t!=null&&typeof t=="object"}return fY=e,fY}var dY,kAe;function xP(){if(kAe)return dY;kAe=1;var e=Nv(),t=zv(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return dY=r,dY}var hY,MAe;function yme(){if(MAe)return hY;MAe=1;var e=Xc(),t=xP(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,s){if(e(o))return!1;var a=typeof o;return a=="number"||a=="symbol"||a=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||s!=null&&o in Object(s)}return hY=i,hY}var pY,AAe;function Wb(){if(AAe)return pY;AAe=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return pY=e,pY}var gY,RAe;function bme(){if(RAe)return gY;RAe=1;var e=Nv(),t=Wb(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!t(a))return!1;var l=e(a);return l==r||l==i||l==n||l==o}return gY=s,gY}var mY,IAe;function Q6n(){if(IAe)return mY;IAe=1;var e=Rg(),t=e["__core-js_shared__"];return mY=t,mY}var vY,DAe;function K6n(){if(DAe)return vY;DAe=1;var e=Q6n(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return vY=n,vY}var yY,LAe;function aot(){if(LAe)return yY;LAe=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return yY=n,yY}var bY,FAe;function Z6n(){if(FAe)return bY;FAe=1;var e=bme(),t=K6n(),n=Wb(),r=aot(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!n(d)||t(d))return!1;var h=e(d)?u:o;return h.test(r(d))}return bY=f,bY}var xY,$Ae;function J6n(){if($Ae)return xY;$Ae=1;function e(t,n){return t?.[n]}return xY=e,xY}var wY,NAe;function RS(){if(NAe)return wY;NAe=1;var e=Z6n(),t=J6n();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return wY=n,wY}var SY,zAe;function gW(){if(zAe)return SY;zAe=1;var e=RS(),t=e(Object,"create");return SY=t,SY}var _Y,jAe;function eUn(){if(jAe)return _Y;jAe=1;var e=gW();function t(){this.__data__=e?e(null):{},this.size=0}return _Y=t,_Y}var CY,BAe;function tUn(){if(BAe)return CY;BAe=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return CY=e,CY}var OY,UAe;function nUn(){if(UAe)return OY;UAe=1;var e=gW(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var s=this.__data__;if(e){var a=s[o];return a===t?void 0:a}return r.call(s,o)?s[o]:void 0}return OY=i,OY}var EY,VAe;function rUn(){if(VAe)return EY;VAe=1;var e=gW(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return EY=r,EY}var TY,WAe;function iUn(){if(WAe)return TY;WAe=1;var e=gW(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return TY=n,TY}var PY,HAe;function oUn(){if(HAe)return PY;HAe=1;var e=eUn(),t=tUn(),n=nUn(),r=rUn(),i=iUn();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a-1}return DY=t,DY}var LY,ZAe;function uUn(){if(ZAe)return LY;ZAe=1;var e=mW();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return LY=t,LY}var FY,JAe;function vW(){if(JAe)return FY;JAe=1;var e=sUn(),t=aUn(),n=lUn(),r=cUn(),i=uUn();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a0?1:-1},p1=function(t){return $w(t)&&t.indexOf("%")===t.length-1},At=function(t){return IUn(t)&&!SP(t)},DUn=function(t){return dr(t)},Fs=function(t){return At(t)||$w(t)},LUn=0,_P=function(t){var n=++LUn;return"".concat(t||"").concat(n)},Nw=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!At(t)&&!$w(t))return r;var o;if(p1(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return SP(o)&&(o=r),i&&o>n&&(o=n),o},r0=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},FUn=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VUn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function eoe(e){"@babel/helpers - typeof";return eoe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eoe(e)}var TRe={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Zm=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},PRe=null,lQ=null,Eme=function e(t){if(t===PRe&&Array.isArray(lQ))return lQ;var n=[];return M.Children.forEach(t,function(r){dr(r)||(kUn.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),lQ=n,PRe=t,n};function Uf(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return Zm(i)}):r=[Zm(t)],Eme(e).forEach(function(i){var o=Bf(i,"type.displayName")||Bf(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function gu(e,t){var n=Uf(e,t);return n&&n[0]}var kRe=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!At(r)||r<=0||!At(i)||i<=0)},WUn=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],HUn=function(t){return t&&t.type&&$w(t.type)&&WUn.indexOf(t.type)>=0},hot=function(t){return t&&eoe(t)==="object"&&"clipDot"in t},GUn=function(t,n,r,i){var o,s=(o=aQ?.[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!tr(t)&&(i&&s.includes(n)||zUn.includes(n))||r&&Ome.includes(n)},sr=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(M.isValidElement(t)&&(i=t.props),!wP(i))return null;var o={};return Object.keys(i).forEach(function(s){var a;GUn((a=i)===null||a===void 0?void 0:a[s],s,n,r)&&(o[s]=i[s])}),o},toe=function e(t,n){if(t===n)return!0;var r=M.Children.count(t);if(r!==M.Children.count(n))return!1;if(r===0)return!0;if(r===1)return MRe(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KUn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function roe(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,s=e.style,a=e.title,l=e.desc,c=QUn(e,YUn),u=i||{width:n,height:r,x:0,y:0},f=Re("recharts-surface",o);return Te.createElement("svg",noe({},sr(c,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Te.createElement("title",null,a),Te.createElement("desc",null,l),t)}var ZUn=["children","className"];function ioe(){return ioe=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eVn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Zi=Te.forwardRef(function(e,t){var n=e.children,r=e.className,i=JUn(e,ZUn),o=Re("recharts-layer",r);return Te.createElement("g",ioe({className:o},sr(i,!0),{ref:t}),n)}),Jm=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oo?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(o);++i=o?n:e(n,r,i)}return uQ=t,uQ}var fQ,DRe;function pot(){if(DRe)return fQ;DRe=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",s="\\u200d",a=RegExp("["+s+e+i+o+"]");function l(c){return a.test(c)}return fQ=l,fQ}var dQ,LRe;function rVn(){if(LRe)return dQ;LRe=1;function e(t){return t.split("")}return dQ=e,dQ}var hQ,FRe;function iVn(){if(FRe)return hQ;FRe=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",s="["+e+"]",a="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+a+"|"+l+")",u="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",h="\\u200d",p=c+"?",g="["+o+"]?",m="(?:"+h+"(?:"+[u,f,d].join("|")+")"+g+p+")*",v=g+p+m,y="(?:"+[u+a+"?",a,f,d,s].join("|")+")",b=RegExp(l+"(?="+l+")|"+y+v,"g");function w(S){return S.match(b)||[]}return hQ=w,hQ}var pQ,$Re;function oVn(){if($Re)return pQ;$Re=1;var e=rVn(),t=pot(),n=iVn();function r(i){return t(i)?n(i):e(i)}return pQ=r,pQ}var gQ,NRe;function sVn(){if(NRe)return gQ;NRe=1;var e=nVn(),t=pot(),n=oVn(),r=cot();function i(o){return function(s){s=r(s);var a=t(s)?n(s):void 0,l=a?a[0]:s.charAt(0),c=a?e(a,1).join(""):s.slice(1);return l[o]()+c}}return gQ=i,gQ}var mQ,zRe;function aVn(){if(zRe)return mQ;zRe=1;var e=sVn(),t=e("toUpperCase");return mQ=t,mQ}var lVn=aVn();const xW=Yn(lVn);function JR(e){"@babel/helpers - typeof";return JR=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},JR(e)}var cVn=["type","size","sizeType"];function ooe(){return ooe=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pVn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var got={symbolCircle:fue,symbolCross:xHt,symbolDiamond:SHt,symbolSquare:_Ht,symbolStar:THt,symbolTriangle:PHt,symbolWye:MHt},gVn=Math.PI/180,mVn=function(t){var n="symbol".concat(xW(t));return got[n]||fue},vVn=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*gVn;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},yVn=function(t,n){got["symbol".concat(xW(t))]=n},Tme=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,s=t.sizeType,a=s===void 0?"area":s,l=hVn(t,cVn),c=BRe(BRe({},l),{},{type:r,size:o,sizeType:a}),u=function(){var m=mVn(r),v=rWe().type(m).size(vVn(o,a,r));return v()},f=c.className,d=c.cx,h=c.cy,p=sr(c,!0);return d===+d&&h===+h&&o===+o?Te.createElement("path",ooe({},p,{className:Re("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};Tme.registerSymbol=yVn;function BE(e){"@babel/helpers - typeof";return BE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},BE(e)}function soe(){return soe=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var y=h.inactive?c:h.color;return Te.createElement("li",gse({className:m,style:f,key:"legend-item-".concat(p)},Q4(r.props,h,p)),Te.createElement(dse,{width:s,height:s,viewBox:u,style:d},r.renderIcon(h)),Te.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},g?g(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var a={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return Te.createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}])})(M.PureComponent);fI(Dve,"displayName","Legend");fI(Dve,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var SK,VDe;function kHn(){if(VDe)return SK;VDe=1;var e=BW();function t(){this.__data__=new e,this.size=0}return SK=t,SK}var _K,WDe;function MHn(){if(WDe)return _K;WDe=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return _K=e,_K}var CK,HDe;function AHn(){if(HDe)return CK;HDe=1;function e(t){return this.__data__.get(t)}return CK=e,CK}var OK,GDe;function RHn(){if(GDe)return OK;GDe=1;function e(t){return this.__data__.has(t)}return OK=e,OK}var EK,qDe;function IHn(){if(qDe)return EK;qDe=1;var e=BW(),t=Tve(),n=Pve(),r=200;function i(o,s){var a=this.__data__;if(a instanceof e){var l=a.__data__;if(!t||l.lengthh))return!1;var g=f.get(s),m=f.get(a);if(g&&m)return g==a&&m==s;var v=-1,y=!0,b=l&i?new e:void 0;for(f.set(s,a),f.set(a,s);++v-1&&r%1==0&&r-1&&n%1==0&&n<=e}return XK=t,XK}var YK,vLe;function GHn(){if(vLe)return YK;vLe=1;var e=Uv(),t=Nve(),n=Vv(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",p="[object String]",g="[object WeakMap]",m="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",w="[object Int8Array]",S="[object Int16Array]",_="[object Int32Array]",E="[object Uint8Array]",T="[object Uint8ClampedArray]",k="[object Uint16Array]",P="[object Uint32Array]",R={};R[y]=R[b]=R[w]=R[S]=R[_]=R[E]=R[T]=R[k]=R[P]=!0,R[r]=R[i]=R[m]=R[o]=R[v]=R[s]=R[a]=R[l]=R[c]=R[u]=R[f]=R[d]=R[h]=R[p]=R[g]=!1;function I(F){return n(F)&&t(F.length)&&!!R[e(F)]}return YK=I,YK}var QK,yLe;function Bat(){if(yLe)return QK;yLe=1;function e(t){return function(n){return t(n)}}return QK=e,QK}var FM={exports:{}};FM.exports;var bLe;function qHn(){return bLe||(bLe=1,(function(e,t){var n=Sat(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,a=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=a})(FM,FM.exports)),FM.exports}var KK,xLe;function Uat(){if(xLe)return KK;xLe=1;var e=GHn(),t=Bat(),n=qHn(),r=n&&n.isTypedArray,i=r?t(r):e;return KK=i,KK}var ZK,wLe;function XHn(){if(wLe)return ZK;wLe=1;var e=VHn(),t=Fve(),n=Yc(),r=jat(),i=$ve(),o=Uat(),s=Object.prototype,a=s.hasOwnProperty;function l(c,u){var f=n(c),d=!f&&t(c),h=!f&&!d&&r(c),p=!f&&!d&&!h&&o(c),g=f||d||h||p,m=g?e(c.length,String):[],v=m.length;for(var y in c)(u||a.call(c,y))&&!(g&&(y=="length"||h&&(y=="offset"||y=="parent")||p&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,v)))&&m.push(y);return m}return ZK=l,ZK}var JK,SLe;function YHn(){if(SLe)return JK;SLe=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return JK=t,JK}var eZ,_Le;function Vat(){if(_Le)return eZ;_Le=1;function e(t,n){return function(r){return t(n(r))}}return eZ=e,eZ}var tZ,CLe;function QHn(){if(CLe)return tZ;CLe=1;var e=Vat(),t=e(Object.keys,Object);return tZ=t,tZ}var nZ,OLe;function KHn(){if(OLe)return nZ;OLe=1;var e=YHn(),t=QHn(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!e(o))return t(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return nZ=i,nZ}var rZ,ELe;function rF(){if(ELe)return rZ;ELe=1;var e=Ove(),t=Nve();function n(r){return r!=null&&t(r.length)&&!e(r)}return rZ=n,rZ}var iZ,TLe;function HW(){if(TLe)return iZ;TLe=1;var e=XHn(),t=KHn(),n=rF();function r(i){return n(i)?e(i):t(i)}return iZ=r,iZ}var oZ,PLe;function ZHn(){if(PLe)return oZ;PLe=1;var e=zHn(),t=UHn(),n=HW();function r(i){return e(i,n,t)}return oZ=r,oZ}var sZ,kLe;function JHn(){if(kLe)return sZ;kLe=1;var e=ZHn(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a,l,c,u){var f=a&t,d=e(o),h=d.length,p=e(s),g=p.length;if(h!=g&&!f)return!1;for(var m=h;m--;){var v=d[m];if(!(f?v in s:r.call(s,v)))return!1}var y=u.get(o),b=u.get(s);if(y&&b)return y==s&&b==o;var w=!0;u.set(o,s),u.set(s,o);for(var S=f;++m-1}return RZ=t,RZ}var IZ,nFe;function bGn(){if(nFe)return IZ;nFe=1;function e(t,n,r){for(var i=-1,o=t==null?0:t.length;++i=s){var v=c?null:i(l);if(v)return o(v);p=!1,d=r,m=new e}else m=c?[]:g;e:for(;++f=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DGn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function LGn(e){return e.value}function FGn(e,t){if(Te.isValidElement(e))return Te.cloneElement(e,t);if(typeof e=="function")return Te.createElement(e,t);t.ref;var n=IGn(t,OGn);return Te.createElement(Dve,n)}var uFe=1,K1=(function(e){function t(){var n;EGn(this,t);for(var r=arguments.length,i=new Array(r),o=0;ouFe||Math.abs(i.height-this.lastBoundingBox.height)>uFe)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?tm({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,a=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,d;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=s==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(a==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=a==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return tm(tm({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,a=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=tm(tm({position:"absolute",width:s||"auto",height:a||"auto"},this.getDefaultPosition(l)),l);return Te.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},FGn(o,tm(tm({},this.props),{},{payload:Xat(u,c,LGn)})))}}],[{key:"getWithHeight",value:function(r,i){var o=tm(tm({},this.defaultProps),r.props),s=o.layout;return s==="vertical"&&At(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])})(M.PureComponent);GW(K1,"displayName","Legend");GW(K1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var NZ,fFe;function $Gn(){if(fFe)return NZ;fFe=1;var e=nF(),t=Fve(),n=Yc(),r=e?e.isConcatSpreadable:void 0;function i(o){return n(o)||t(o)||!!(r&&o&&o[r])}return NZ=i,NZ}var zZ,dFe;function Kat(){if(dFe)return zZ;dFe=1;var e=zat(),t=$Gn();function n(r,i,o,s,a){var l=-1,c=r.length;for(o||(o=t),a||(a=[]);++l0&&o(u)?i>1?n(u,i-1,o,s,a):e(a,u):s||(a[a.length]=u)}return a}return zZ=n,zZ}var jZ,hFe;function NGn(){if(hFe)return jZ;hFe=1;function e(t){return function(n,r,i){for(var o=-1,s=Object(n),a=i(n),l=a.length;l--;){var c=a[t?l:++o];if(r(s[c],c,s)===!1)break}return n}}return jZ=e,jZ}var BZ,pFe;function zGn(){if(pFe)return BZ;pFe=1;var e=NGn(),t=e();return BZ=t,BZ}var UZ,gFe;function Zat(){if(gFe)return UZ;gFe=1;var e=zGn(),t=HW();function n(r,i){return r&&e(r,i,t)}return UZ=n,UZ}var VZ,mFe;function jGn(){if(mFe)return VZ;mFe=1;var e=rF();function t(n,r){return function(i,o){if(i==null)return i;if(!e(i))return n(i,o);for(var s=i.length,a=r?s:-1,l=Object(i);(r?a--:++ar||a&&l&&u&&!c&&!f||o&&l&&u||!i&&u||!s)return 1;if(!o&&!a&&!f&&n=c)return u;var f=i[o];return u*(f=="desc"?-1:1)}}return n.index-r.index}return XZ=t,XZ}var YZ,SFe;function WGn(){if(SFe)return YZ;SFe=1;var e=kve(),t=Mve(),n=Yb(),r=Jat(),i=BGn(),o=Bat(),s=VGn(),a=AP(),l=Yc();function c(u,f,d){f.length?f=e(f,function(g){return l(g)?function(m){return t(m,g.length===1?g[0]:g)}:g}):f=[a];var h=-1;f=e(f,o(n));var p=r(u,function(g,m,v){var y=e(f,function(b){return b(g)});return{criteria:y,index:++h,value:g}});return i(p,function(g,m){return s(g,m,d)})}return YZ=c,YZ}var QZ,_Fe;function HGn(){if(_Fe)return QZ;_Fe=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return QZ=e,QZ}var KZ,CFe;function GGn(){if(CFe)return KZ;CFe=1;var e=HGn(),t=Math.max;function n(r,i,o){return i=t(i===void 0?r.length-1:i,0),function(){for(var s=arguments,a=-1,l=t(s.length-i,0),c=Array(l);++a0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return tJ=r,tJ}var nJ,kFe;function QGn(){if(kFe)return nJ;kFe=1;var e=XGn(),t=YGn(),n=t(e);return nJ=n,nJ}var rJ,MFe;function KGn(){if(MFe)return rJ;MFe=1;var e=AP(),t=GGn(),n=QGn();function r(i,o){return n(t(i,o,e),i+"")}return rJ=r,rJ}var iJ,AFe;function qW(){if(AFe)return iJ;AFe=1;var e=Eve(),t=rF(),n=$ve(),r=Xb();function i(o,s,a){if(!r(a))return!1;var l=typeof s;return(l=="number"?t(a)&&n(s,a.length):l=="string"&&s in a)?e(a[s],o):!1}return iJ=i,iJ}var oJ,RFe;function ZGn(){if(RFe)return oJ;RFe=1;var e=Kat(),t=WGn(),n=KGn(),r=qW(),i=n(function(o,s){if(o==null)return[];var a=s.length;return a>1&&r(o,s[0],s[1])?s=[]:a>2&&r(s[0],s[1],s[2])&&(s=[s[0]]),t(o,e(s,1),[])});return oJ=i,oJ}var JGn=ZGn();const Bve=Vn(JGn);function dI(e){"@babel/helpers - typeof";return dI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dI(e)}function yse(){return yse=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(P2,"-left"),At(n)&&t&&At(t.x)&&n=t.y),"".concat(P2,"-top"),At(r)&&t&&At(t.y)&&rg?Math.max(u,l[r]):Math.max(f,l[r])}function p9n(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function g9n(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,a=e.useTranslate3d,l=e.viewBox,c,u,f;return s.height>0&&s.width>0&&n?(u=LFe({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=LFe({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),c=p9n({translateX:u,translateY:f,useTranslate3d:a})):c=d9n,{cssProperties:c,cssClasses:h9n({translateX:u,translateY:f,coordinate:n})}}function KE(e){"@babel/helpers - typeof";return KE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},KE(e)}function FFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $Fe(e){for(var t=1;tNFe||Math.abs(r.height-this.state.lastBoundingBox.height)>NFe)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,g=i.reverseDirection,m=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,b=g9n({allowEscapeViewBox:s,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:v}),w=b.cssClasses,S=b.cssProperties,_=$Fe($Fe({transition:d&&o?"transform ".concat(a,"ms ").concat(l):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return Te.createElement("div",{tabIndex:-1,className:w,style:_,ref:function(T){r.wrapperNode=T}},c)}}])})(M.PureComponent),O9n=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},BS={isSsr:O9n()};function ZE(e){"@babel/helpers - typeof";return ZE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ZE(e)}function zFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jFe(e){for(var t=1;t0;return Te.createElement(C9n,{allowEscapeViewBox:s,animationDuration:a,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:_,offset:h,position:m,reverseDirection:v,useTranslate3d:y,viewBox:b,wrapperStyle:w},L9n(c,jFe(jFe({},this.props),{},{payload:S})))}}])})(M.PureComponent);Uve(sp,"displayName","Tooltip");Uve(sp,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!BS.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var aJ,BFe;function F9n(){if(BFe)return aJ;BFe=1;var e=Lg(),t=function(){return e.Date.now()};return aJ=t,aJ}var lJ,UFe;function $9n(){if(UFe)return lJ;UFe=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return lJ=t,lJ}var cJ,VFe;function N9n(){if(VFe)return cJ;VFe=1;var e=$9n(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return cJ=n,cJ}var uJ,WFe;function olt(){if(WFe)return uJ;WFe=1;var e=N9n(),t=Xb(),n=TP(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=o.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):i.test(c)?r:+c}return uJ=l,uJ}var fJ,HFe;function z9n(){if(HFe)return fJ;HFe=1;var e=Xb(),t=F9n(),n=olt(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,c){var u,f,d,h,p,g,m=0,v=!1,y=!1,b=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(v=!!c.leading,y="maxWait"in c,d=y?i(n(c.maxWait)||0,l):d,b="trailing"in c?!!c.trailing:b);function w(F){var A=u,L=f;return u=f=void 0,m=F,h=a.apply(L,A),h}function S(F){return m=F,p=setTimeout(T,l),v?w(F):h}function _(F){var A=F-g,L=F-m,$=l-A;return y?o($,d-L):$}function E(F){var A=F-g,L=F-m;return g===void 0||A>=l||A<0||y&&L>=d}function T(){var F=t();if(E(F))return k(F);p=setTimeout(T,_(F))}function k(F){return p=void 0,b&&u?w(F):(u=f=void 0,h)}function P(){p!==void 0&&clearTimeout(p),m=0,u=g=f=p=void 0}function R(){return p===void 0?h:k(t())}function I(){var F=t(),A=E(F);if(u=arguments,f=this,g=F,A){if(p===void 0)return S(g);if(y)return clearTimeout(p),p=setTimeout(T,l),w(g)}return p===void 0&&(p=setTimeout(T,l)),h}return I.cancel=P,I.flush=R,I}return fJ=s,fJ}var dJ,GFe;function j9n(){if(GFe)return dJ;GFe=1;var e=z9n(),t=Xb(),n="Expected a function";function r(i,o,s){var a=!0,l=!0;if(typeof i!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(i,o,{leading:a,maxWait:o,trailing:l})}return dJ=r,dJ}var B9n=j9n();const slt=Vn(B9n);function pI(e){"@babel/helpers - typeof";return pI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pI(e)}function qFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function R3(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(F=slt(F,g,{trailing:!0,leading:!1}));var A=new ResizeObserver(F),L=S.current.getBoundingClientRect(),$=L.width,j=L.height;return R($,j),A.observe(S.current),function(){A.disconnect()}},[R,g]);var I=M.useMemo(function(){var F=k.containerWidth,A=k.containerHeight;if(F<0||A<0)return null;rv(S1(s)||S1(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,s,l),rv(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=S1(s)?F:s,$=S1(l)?A:l;n&&n>0&&(L?$=L/n:$&&(L=$*n),d&&$>d&&($=d)),rv(L>0||$>0,`The width(%s) and height(%s) of chart should be greater than 0, + H`).concat(lf,"M").concat(2*a,",").concat(o,` + A`).concat(s,",").concat(s,",0,1,1,").concat(a,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return Te.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(lf/8,"h").concat(lf,"v").concat(lf*3/4,"h").concat(-lf,"z"),className:"recharts-legend-icon"});if(Te.isValidElement(r.legendIcon)){var c=bVn({},r);return delete c.legendIcon,Te.cloneElement(r.legendIcon,c)}return Te.createElement(Tme,{fill:l,cx:o,cy:o,size:lf,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,s=i.iconSize,a=i.layout,l=i.formatter,c=i.inactiveColor,u={x:0,y:0,width:lf,height:lf},f={display:a==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(h,p){var g=h.formatter||l,m=Re(eI(eI({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",h.inactive));if(h.type==="none")return null;var v=tr(h.value)?null:h.value;Jm(!tr(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var y=h.inactive?c:h.color;return Te.createElement("li",soe({className:m,style:f,key:"legend-item-".concat(p)},T4(r.props,h,p)),Te.createElement(roe,{width:s,height:s,viewBox:u,style:d},r.renderIcon(h)),Te.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},g?g(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var a={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return Te.createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}])})(M.PureComponent);eI(Pme,"displayName","Legend");eI(Pme,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var vQ,VRe;function PVn(){if(VRe)return vQ;VRe=1;var e=vW();function t(){this.__data__=new e,this.size=0}return vQ=t,vQ}var yQ,WRe;function kVn(){if(WRe)return yQ;WRe=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return yQ=e,yQ}var bQ,HRe;function MVn(){if(HRe)return bQ;HRe=1;function e(t){return this.__data__.get(t)}return bQ=e,bQ}var xQ,GRe;function AVn(){if(GRe)return xQ;GRe=1;function e(t){return this.__data__.has(t)}return xQ=e,xQ}var wQ,qRe;function RVn(){if(qRe)return wQ;qRe=1;var e=vW(),t=wme(),n=Sme(),r=200;function i(o,s){var a=this.__data__;if(a instanceof e){var l=a.__data__;if(!t||l.lengthh))return!1;var g=f.get(s),m=f.get(a);if(g&&m)return g==a&&m==s;var v=-1,y=!0,b=l&i?new e:void 0;for(f.set(s,a),f.set(a,s);++v-1&&r%1==0&&r-1&&n%1==0&&n<=e}return VQ=t,VQ}var WQ,vIe;function HVn(){if(vIe)return WQ;vIe=1;var e=Nv(),t=Rme(),n=zv(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",p="[object String]",g="[object WeakMap]",m="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",w="[object Int8Array]",S="[object Int16Array]",_="[object Int32Array]",E="[object Uint8Array]",T="[object Uint8ClampedArray]",k="[object Uint16Array]",P="[object Uint32Array]",I={};I[y]=I[b]=I[w]=I[S]=I[_]=I[E]=I[T]=I[k]=I[P]=!0,I[r]=I[i]=I[m]=I[o]=I[v]=I[s]=I[a]=I[l]=I[c]=I[u]=I[f]=I[d]=I[h]=I[p]=I[g]=!1;function R(F){return n(F)&&t(F.length)&&!!I[e(F)]}return WQ=R,WQ}var HQ,yIe;function Oot(){if(yIe)return HQ;yIe=1;function e(t){return function(n){return t(n)}}return HQ=e,HQ}var CM={exports:{}};CM.exports;var bIe;function GVn(){return bIe||(bIe=1,(function(e,t){var n=sot(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,a=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=a})(CM,CM.exports)),CM.exports}var GQ,xIe;function Eot(){if(xIe)return GQ;xIe=1;var e=HVn(),t=Oot(),n=GVn(),r=n&&n.isTypedArray,i=r?t(r):e;return GQ=i,GQ}var qQ,wIe;function qVn(){if(wIe)return qQ;wIe=1;var e=UVn(),t=Mme(),n=Xc(),r=Cot(),i=Ame(),o=Eot(),s=Object.prototype,a=s.hasOwnProperty;function l(c,u){var f=n(c),d=!f&&t(c),h=!f&&!d&&r(c),p=!f&&!d&&!h&&o(c),g=f||d||h||p,m=g?e(c.length,String):[],v=m.length;for(var y in c)(u||a.call(c,y))&&!(g&&(y=="length"||h&&(y=="offset"||y=="parent")||p&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,v)))&&m.push(y);return m}return qQ=l,qQ}var XQ,SIe;function XVn(){if(SIe)return XQ;SIe=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return XQ=t,XQ}var YQ,_Ie;function Tot(){if(_Ie)return YQ;_Ie=1;function e(t,n){return function(r){return t(n(r))}}return YQ=e,YQ}var QQ,CIe;function YVn(){if(CIe)return QQ;CIe=1;var e=Tot(),t=e(Object.keys,Object);return QQ=t,QQ}var KQ,OIe;function QVn(){if(OIe)return KQ;OIe=1;var e=XVn(),t=YVn(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!e(o))return t(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return KQ=i,KQ}var ZQ,EIe;function VL(){if(EIe)return ZQ;EIe=1;var e=bme(),t=Rme();function n(r){return r!=null&&t(r.length)&&!e(r)}return ZQ=n,ZQ}var JQ,TIe;function wW(){if(TIe)return JQ;TIe=1;var e=qVn(),t=QVn(),n=VL();function r(i){return n(i)?e(i):t(i)}return JQ=r,JQ}var eK,PIe;function KVn(){if(PIe)return eK;PIe=1;var e=NVn(),t=BVn(),n=wW();function r(i){return e(i,n,t)}return eK=r,eK}var tK,kIe;function ZVn(){if(kIe)return tK;kIe=1;var e=KVn(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a,l,c,u){var f=a&t,d=e(o),h=d.length,p=e(s),g=p.length;if(h!=g&&!f)return!1;for(var m=h;m--;){var v=d[m];if(!(f?v in s:r.call(s,v)))return!1}var y=u.get(o),b=u.get(s);if(y&&b)return y==s&&b==o;var w=!0;u.set(o,s),u.set(s,o);for(var S=f;++m-1}return TK=t,TK}var PK,nDe;function y8n(){if(nDe)return PK;nDe=1;function e(t,n,r){for(var i=-1,o=t==null?0:t.length;++i=s){var v=c?null:i(l);if(v)return o(v);p=!1,d=r,m=new e}else m=c?[]:g;e:for(;++f=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function I8n(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function D8n(e){return e.value}function L8n(e,t){if(Te.isValidElement(e))return Te.cloneElement(e,t);if(typeof e=="function")return Te.createElement(e,t);t.ref;var n=R8n(t,C8n);return Te.createElement(Pme,n)}var uDe=1,V1=(function(e){function t(){var n;O8n(this,t);for(var r=arguments.length,i=new Array(r),o=0;ouDe||Math.abs(i.height-this.lastBoundingBox.height)>uDe)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Zg({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,a=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,d;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=s==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(a==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=a==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Zg(Zg({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,a=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=Zg(Zg({position:"absolute",width:s||"auto",height:a||"auto"},this.getDefaultPosition(l)),l);return Te.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},L8n(o,Zg(Zg({},this.props),{},{payload:Rot(u,c,D8n)})))}}],[{key:"getWithHeight",value:function(r,i){var o=Zg(Zg({},this.defaultProps),r.props),s=o.layout;return s==="vertical"&&At(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])})(M.PureComponent);SW(V1,"displayName","Legend");SW(V1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var IK,fDe;function F8n(){if(fDe)return IK;fDe=1;var e=UL(),t=Mme(),n=Xc(),r=e?e.isConcatSpreadable:void 0;function i(o){return n(o)||t(o)||!!(r&&o&&o[r])}return IK=i,IK}var DK,dDe;function Lot(){if(dDe)return DK;dDe=1;var e=_ot(),t=F8n();function n(r,i,o,s,a){var l=-1,c=r.length;for(o||(o=t),a||(a=[]);++l0&&o(u)?i>1?n(u,i-1,o,s,a):e(a,u):s||(a[a.length]=u)}return a}return DK=n,DK}var LK,hDe;function $8n(){if(hDe)return LK;hDe=1;function e(t){return function(n,r,i){for(var o=-1,s=Object(n),a=i(n),l=a.length;l--;){var c=a[t?l:++o];if(r(s[c],c,s)===!1)break}return n}}return LK=e,LK}var FK,pDe;function N8n(){if(pDe)return FK;pDe=1;var e=$8n(),t=e();return FK=t,FK}var $K,gDe;function Fot(){if(gDe)return $K;gDe=1;var e=N8n(),t=wW();function n(r,i){return r&&e(r,i,t)}return $K=n,$K}var NK,mDe;function z8n(){if(mDe)return NK;mDe=1;var e=VL();function t(n,r){return function(i,o){if(i==null)return i;if(!e(i))return n(i,o);for(var s=i.length,a=r?s:-1,l=Object(i);(r?a--:++ar||a&&l&&u&&!c&&!f||o&&l&&u||!i&&u||!s)return 1;if(!o&&!a&&!f&&n=c)return u;var f=i[o];return u*(f=="desc"?-1:1)}}return n.index-r.index}return VK=t,VK}var WK,SDe;function V8n(){if(SDe)return WK;SDe=1;var e=_me(),t=Cme(),n=Hb(),r=$ot(),i=j8n(),o=Oot(),s=U8n(),a=CP(),l=Xc();function c(u,f,d){f.length?f=e(f,function(g){return l(g)?function(m){return t(m,g.length===1?g[0]:g)}:g}):f=[a];var h=-1;f=e(f,o(n));var p=r(u,function(g,m,v){var y=e(f,function(b){return b(g)});return{criteria:y,index:++h,value:g}});return i(p,function(g,m){return s(g,m,d)})}return WK=c,WK}var HK,_De;function W8n(){if(_De)return HK;_De=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return HK=e,HK}var GK,CDe;function H8n(){if(CDe)return GK;CDe=1;var e=W8n(),t=Math.max;function n(r,i,o){return i=t(i===void 0?r.length-1:i,0),function(){for(var s=arguments,a=-1,l=t(s.length-i,0),c=Array(l);++a0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return QK=r,QK}var KK,kDe;function Y8n(){if(kDe)return KK;kDe=1;var e=q8n(),t=X8n(),n=t(e);return KK=n,KK}var ZK,MDe;function Q8n(){if(MDe)return ZK;MDe=1;var e=CP(),t=H8n(),n=Y8n();function r(i,o){return n(t(i,o,e),i+"")}return ZK=r,ZK}var JK,ADe;function _W(){if(ADe)return JK;ADe=1;var e=xme(),t=VL(),n=Ame(),r=Wb();function i(o,s,a){if(!r(a))return!1;var l=typeof s;return(l=="number"?t(a)&&n(s,a.length):l=="string"&&s in a)?e(a[s],o):!1}return JK=i,JK}var eZ,RDe;function K8n(){if(RDe)return eZ;RDe=1;var e=Lot(),t=V8n(),n=Q8n(),r=_W(),i=n(function(o,s){if(o==null)return[];var a=s.length;return a>1&&r(o,s[0],s[1])?s=[]:a>2&&r(s[0],s[1],s[2])&&(s=[s[0]]),t(o,e(s,1),[])});return eZ=i,eZ}var Z8n=K8n();const Lme=Yn(Z8n);function tI(e){"@babel/helpers - typeof";return tI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tI(e)}function coe(){return coe=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(y2,"-left"),At(n)&&t&&At(t.x)&&n=t.y),"".concat(y2,"-top"),At(r)&&t&&At(t.y)&&rg?Math.max(u,l[r]):Math.max(f,l[r])}function hWn(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function pWn(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,a=e.useTranslate3d,l=e.viewBox,c,u,f;return s.height>0&&s.width>0&&n?(u=LDe({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=LDe({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),c=hWn({translateX:u,translateY:f,useTranslate3d:a})):c=fWn,{cssProperties:c,cssClasses:dWn({translateX:u,translateY:f,coordinate:n})}}function VE(e){"@babel/helpers - typeof";return VE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},VE(e)}function FDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $De(e){for(var t=1;tNDe||Math.abs(r.height-this.state.lastBoundingBox.height)>NDe)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,g=i.reverseDirection,m=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,b=pWn({allowEscapeViewBox:s,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:v}),w=b.cssClasses,S=b.cssProperties,_=$De($De({transition:d&&o?"transform ".concat(a,"ms ").concat(l):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return Te.createElement("div",{tabIndex:-1,className:w,style:_,ref:function(T){r.wrapperNode=T}},c)}}])})(M.PureComponent),CWn=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},IS={isSsr:CWn()};function WE(e){"@babel/helpers - typeof";return WE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},WE(e)}function zDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jDe(e){for(var t=1;t0;return Te.createElement(_Wn,{allowEscapeViewBox:s,animationDuration:a,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:_,offset:h,position:m,reverseDirection:v,useTranslate3d:y,viewBox:b,wrapperStyle:w},DWn(c,jDe(jDe({},this.props),{},{payload:S})))}}])})(M.PureComponent);Fme(ip,"displayName","Tooltip");Fme(ip,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!IS.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var nZ,BDe;function LWn(){if(BDe)return nZ;BDe=1;var e=Rg(),t=function(){return e.Date.now()};return nZ=t,nZ}var rZ,UDe;function FWn(){if(UDe)return rZ;UDe=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return rZ=t,rZ}var iZ,VDe;function $Wn(){if(VDe)return iZ;VDe=1;var e=FWn(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return iZ=n,iZ}var oZ,WDe;function Vot(){if(WDe)return oZ;WDe=1;var e=$Wn(),t=Wb(),n=xP(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=o.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):i.test(c)?r:+c}return oZ=l,oZ}var sZ,HDe;function NWn(){if(HDe)return sZ;HDe=1;var e=Wb(),t=LWn(),n=Vot(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,c){var u,f,d,h,p,g,m=0,v=!1,y=!1,b=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(v=!!c.leading,y="maxWait"in c,d=y?i(n(c.maxWait)||0,l):d,b="trailing"in c?!!c.trailing:b);function w(F){var A=u,L=f;return u=f=void 0,m=F,h=a.apply(L,A),h}function S(F){return m=F,p=setTimeout(T,l),v?w(F):h}function _(F){var A=F-g,L=F-m,$=l-A;return y?o($,d-L):$}function E(F){var A=F-g,L=F-m;return g===void 0||A>=l||A<0||y&&L>=d}function T(){var F=t();if(E(F))return k(F);p=setTimeout(T,_(F))}function k(F){return p=void 0,b&&u?w(F):(u=f=void 0,h)}function P(){p!==void 0&&clearTimeout(p),m=0,u=g=f=p=void 0}function I(){return p===void 0?h:k(t())}function R(){var F=t(),A=E(F);if(u=arguments,f=this,g=F,A){if(p===void 0)return S(g);if(y)return clearTimeout(p),p=setTimeout(T,l),w(g)}return p===void 0&&(p=setTimeout(T,l)),h}return R.cancel=P,R.flush=I,R}return sZ=s,sZ}var aZ,GDe;function zWn(){if(GDe)return aZ;GDe=1;var e=NWn(),t=Wb(),n="Expected a function";function r(i,o,s){var a=!0,l=!0;if(typeof i!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(i,o,{leading:a,maxWait:o,trailing:l})}return aZ=r,aZ}var jWn=zWn();const Wot=Yn(jWn);function rI(e){"@babel/helpers - typeof";return rI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rI(e)}function qDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function f3(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(F=Wot(F,g,{trailing:!0,leading:!1}));var A=new ResizeObserver(F),L=S.current.getBoundingClientRect(),$=L.width,j=L.height;return I($,j),A.observe(S.current),function(){A.disconnect()}},[I,g]);var R=M.useMemo(function(){var F=k.containerWidth,A=k.containerHeight;if(F<0||A<0)return null;Jm(p1(s)||p1(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,s,l),Jm(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=p1(s)?F:s,$=p1(l)?A:l;n&&n>0&&(L?$=L/n:$&&(L=$*n),d&&$>d&&($=d)),Jm(L>0||$>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,L,$,s,l,u,f,n);var j=!Array.isArray(h)&&nv(h.type).endsWith("Chart");return Te.Children.map(h,function(V){return Te.isValidElement(V)?M.cloneElement(V,R3({width:L,height:$},j?{style:R3({height:"100%",width:"100%",maxHeight:$,maxWidth:L},V.props.style)}:{})):V})},[n,h,l,d,f,u,k,s]);return Te.createElement("div",{id:m?"".concat(m):void 0,className:Re("recharts-responsive-container",v),style:R3(R3({},w),{},{width:s,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:S},I)}),llt=function(t){return null};llt.displayName="Cell";function gI(e){"@babel/helpers - typeof";return gI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gI(e)}function YFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sse(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||BS.isSsr)return{width:0,height:0};var r=t7n(n),i=JSON.stringify({text:t,copyStyle:r});if(Q_.widthCache[i])return Q_.widthCache[i];try{var o=document.getElementById(QFe);o||(o=document.createElement("span"),o.setAttribute("id",QFe),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=Sse(Sse({},e7n),r);Object.assign(o.style,s),o.textContent="".concat(t);var a=o.getBoundingClientRect(),l={width:a.width,height:a.height};return Q_.widthCache[i]=l,++Q_.cacheCount>J9n&&(Q_.cacheCount=0,Q_.widthCache={}),l}catch{return{width:0,height:0}}},n7n=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function mI(e){"@babel/helpers - typeof";return mI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mI(e)}function t6(e,t){return s7n(e)||o7n(e,t)||i7n(e,t)||r7n()}function r7n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i7n(e,t){if(e){if(typeof e=="string")return KFe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KFe(e,t)}}function KFe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function x7n(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function r$e(e,t){return C7n(e)||_7n(e,t)||S7n(e,t)||w7n()}function w7n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S7n(e,t){if(e){if(typeof e=="string")return i$e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i$e(e,t)}}function i$e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function($,j){var V=j.word,U=j.width,z=$[$.length-1];if(z&&(i==null||o||z.width+U+rj.width?$:j})};if(!u)return h;for(var g="…",m=function(L){var $=f.slice(0,L),j=dlt({breakAll:c,style:l,children:$+g}).wordsWithComputedWidth,V=d(j),U=V.length>s||p(V).width>Number(i);return[U,V]},v=0,y=f.length-1,b=0,w;v<=y&&b<=f.length-1;){var S=Math.floor((v+y)/2),_=S-1,E=m(_),T=r$e(E,2),k=T[0],P=T[1],R=m(S),I=r$e(R,1),F=I[0];if(!k&&!F&&(v=S+1),k&&F&&(y=S-1),!k&&F){w=P;break}b++}return w||h},o$e=function(t){var n=fr(t)?[]:t.toString().split(flt);return[{words:n}]},E7n=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,a=t.maxLines;if((n||r)&&!BS.isSsr){var l,c,u=dlt({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return o$e(i);return O7n({breakAll:s,children:i,maxLines:a,style:o},l,c,n,r)}return o$e(i)},s$e="#808080",n6=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.lineHeight,a=s===void 0?"1em":s,l=t.capHeight,c=l===void 0?"0.71em":l,u=t.scaleToFit,f=u===void 0?!1:u,d=t.textAnchor,h=d===void 0?"start":d,p=t.verticalAnchor,g=p===void 0?"end":p,m=t.fill,v=m===void 0?s$e:m,y=n$e(t,y7n),b=M.useMemo(function(){return E7n({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),w=y.dx,S=y.dy,_=y.angle,E=y.className,T=y.breakAll,k=n$e(y,b7n);if(!Fs(r)||!Fs(o))return null;var P=r+(At(w)?w:0),R=o+(At(S)?S:0),I;switch(g){case"start":I=hJ("calc(".concat(c,")"));break;case"middle":I=hJ("calc(".concat((b.length-1)/2," * -").concat(a," + (").concat(c," / 2))"));break;default:I=hJ("calc(".concat(b.length-1," * -").concat(a,")"));break}var F=[];if(f){var A=b[0].width,L=y.width;F.push("scale(".concat((At(L)?L/A:1)/A,")"))}return _&&F.push("rotate(".concat(_,", ").concat(P,", ").concat(R,")")),F.length&&(k.transform=F.join(" ")),Te.createElement("text",_se({},sr(k,!0),{x:P,y:R,className:Re("recharts-text",E),textAnchor:h,fill:v.includes("url")?s$e:v}),b.map(function($,j){var V=$.words.join(T?"":" ");return Te.createElement("tspan",{x:P,dy:j===0?I:a,key:"".concat(V,"-").concat(j)},V)}))};const a$e=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:lR,scaleDiverging:Kfe,scaleDivergingLog:Zfe,scaleDivergingPow:PV,scaleDivergingSqrt:x9e,scaleDivergingSymlog:Jfe,scaleIdentity:zfe,scaleImplicit:Vj,scaleLinear:dR,scaleLog:Bfe,scaleOrdinal:GD,scalePoint:QM,scalePow:_V,scaleQuantile:Hfe,scaleQuantize:Gfe,scaleRadial:g9e,scaleSequential:OV,scaleSequentialLog:Yfe,scaleSequentialPow:EV,scaleSequentialQuantile:b9e,scaleSequentialSqrt:y9e,scaleSequentialSymlog:Qfe,scaleSqrt:p9e,scaleSymlog:Vfe,scaleThreshold:qfe,scaleTime:m9e,scaleUtc:v9e,tickFormat:Nfe},Symbol.toStringTag,{value:"Module"}));var pJ,l$e;function hlt(){if(l$e)return pJ;l$e=1;var e=TP();function t(n,r,i){for(var o=-1,s=n.length;++on}return gJ=e,gJ}var mJ,u$e;function P7n(){if(u$e)return mJ;u$e=1;var e=hlt(),t=T7n(),n=AP();function r(i){return i&&i.length?e(i,n,t):void 0}return mJ=r,mJ}var k7n=P7n();const C0=Vn(k7n);var vJ,f$e;function M7n(){if(f$e)return vJ;f$e=1;function e(t,n){return te.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=re.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};ln.decimalPlaces=ln.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*io;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ln.dividedBy=ln.div=function(e){return iv(this,new this.constructor(e))};ln.dividedToIntegerBy=ln.idiv=function(e){var t=this,n=t.constructor;return Ui(iv(t,new n(e),0,1),n.precision)};ln.equals=ln.eq=function(e){return!this.cmp(e)};ln.exponent=function(){return ys(this)};ln.greaterThan=ln.gt=function(e){return this.cmp(e)>0};ln.greaterThanOrEqualTo=ln.gte=function(e){return this.cmp(e)>=0};ln.isInteger=ln.isint=function(){return this.e>this.d.length-2};ln.isNegative=ln.isneg=function(){return this.s<0};ln.isPositive=ln.ispos=function(){return this.s>0};ln.isZero=function(){return this.s===0};ln.lessThan=ln.lt=function(e){return this.cmp(e)<0};ln.lessThanOrEqualTo=ln.lte=function(e){return this.cmp(e)<1};ln.logarithm=ln.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Su))throw Error(od+"NaN");if(n.s<1)throw Error(od+(n.s?"NaN":"-Infinity"));return n.eq(Su)?new r(0):(So=!1,t=iv(vI(n,o),vI(e,o),o),So=!0,Ui(t,i))};ln.minus=ln.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vlt(t,e):glt(t,(e.s=-e.s,e))};ln.modulo=ln.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(od+"NaN");return n.s?(So=!1,t=iv(n,e,0,1).times(e),So=!0,n.minus(t)):Ui(new r(n),i)};ln.naturalExponential=ln.exp=function(){return mlt(this)};ln.naturalLogarithm=ln.ln=function(){return vI(this)};ln.negated=ln.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ln.plus=ln.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?glt(t,e):vlt(t,(e.s=-e.s,e))};ln.precision=ln.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Z1+e);if(t=ys(i)+1,r=i.d.length-1,n=r*io+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ln.squareRoot=ln.sqrt=function(){var e,t,n,r,i,o,s,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(od+"NaN")}for(e=ys(a),So=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=Rp(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=IP((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t)):r=new l(i.toString()),n=l.precision,i=s=n+3;;)if(o=r,r=o.plus(iv(a,o,s+2)).times(.5),Rp(o.d).slice(0,s)===(t=Rp(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Ui(o,n+1,0),o.times(o).eq(a)){r=o;break}}else if(t!="9999")break;s+=4}return So=!0,Ui(r,n)};ln.times=ln.mul=function(e){var t,n,r,i,o,s,a,l,c,u=this,f=u.constructor,d=u.d,h=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,n=u.e+e.e,l=d.length,c=h.length,l=0;){for(t=0,i=l+r;i>r;)a=o[i]+h[r]*d[i-r-1]+t,o[i--]=a%qs|0,t=a/qs|0;o[i]=(o[i]+t)%qs|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,So?Ui(e,f.precision):e};ln.toDecimalPlaces=ln.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(fg(e,0,RP),t===void 0?t=r.rounding:fg(t,0,8),Ui(n,e+ys(n)+1,t))};ln.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=qw(r,!0):(fg(e,0,RP),t===void 0?t=i.rounding:fg(t,0,8),r=Ui(new i(r),e+1,t),n=qw(r,!0,e+1)),n};ln.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?qw(i):(fg(e,0,RP),t===void 0?t=o.rounding:fg(t,0,8),r=Ui(new o(i),e+ys(i)+1,t),n=qw(r.abs(),!1,e+ys(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ln.toInteger=ln.toint=function(){var e=this,t=e.constructor;return Ui(new t(e),ys(e)+1,t.rounding)};ln.toNumber=function(){return+this};ln.toPower=ln.pow=function(e){var t,n,r,i,o,s,a=this,l=a.constructor,c=12,u=+(e=new l(e));if(!e.s)return new l(Su);if(a=new l(a),!a.s){if(e.s<1)throw Error(od+"Infinity");return a}if(a.eq(Su))return a;if(r=l.precision,e.eq(Su))return Ui(a,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=a.s,s){if((n=u<0?-u:u)<=plt){for(i=new l(Su),t=Math.ceil(r/io+4),So=!1;n%2&&(i=i.times(a),v$e(i.d,t)),n=IP(n/2),n!==0;)a=a.times(a),v$e(a.d,t);return So=!0,e.s<0?new l(Su).div(i):Ui(i,r)}}else if(o<0)throw Error(od+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,a.s=1,So=!1,i=e.times(vI(a,r+c)),So=!0,i=mlt(i),i.s=o,i};ln.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=ys(i),r=qw(i,n<=o.toExpNeg||n>=o.toExpPos)):(fg(e,1,RP),t===void 0?t=o.rounding:fg(t,0,8),i=Ui(new o(i),e,t),n=ys(i),r=qw(i,e<=n||n<=o.toExpNeg,e)),r};ln.toSignificantDigits=ln.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(fg(e,1,RP),t===void 0?t=r.rounding:fg(t,0,8)),Ui(new r(n),e,t)};ln.toString=ln.valueOf=ln.val=ln.toJSON=ln[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ys(e),n=e.constructor;return qw(e,t<=n.toExpNeg||t>=n.toExpPos)};function glt(e,t){var n,r,i,o,s,a,l,c,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),So?Ui(t,f):t;if(l=e.d,c=t.d,s=e.e,i=t.e,l=l.slice(),o=s-i,o){for(o<0?(r=l,o=-o,a=c.length):(r=c,i=s,a=l.length),s=Math.ceil(f/io),a=s>a?s+1:a+1,o>a&&(o=a,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(a=l.length,o=c.length,a-o<0&&(o=a,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/qs|0,l[o]%=qs;for(n&&(l.unshift(n),++i),a=l.length;l[--a]==0;)l.pop();return t.d=l,t.e=i,So?Ui(t,f):t}function fg(e,t,n){if(e!==~~e||en)throw Error(Z1+e)}function Rp(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;ts?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]1;)r.shift()}return function(r,i,o,s){var a,l,c,u,f,d,h,p,g,m,v,y,b,w,S,_,E,T,k=r.constructor,P=r.s==i.s?1:-1,R=r.d,I=i.d;if(!r.s)return new k(r);if(!i.s)throw Error(od+"Division by zero");for(l=r.e-i.e,E=I.length,S=R.length,h=new k(P),p=h.d=[],c=0;I[c]==(R[c]||0);)++c;if(I[c]>(R[c]||0)&&--l,o==null?y=o=k.precision:s?y=o+(ys(r)-ys(i))+1:y=o,y<0)return new k(0);if(y=y/io+2|0,c=0,E==1)for(u=0,I=I[0],y++;(c1&&(I=e(I,u),R=e(R,u),E=I.length,S=R.length),w=E,g=R.slice(0,E),m=g.length;m=qs/2&&++_;do u=0,a=t(I,g,E,m),a<0?(v=g[0],E!=m&&(v=v*qs+(g[1]||0)),u=v/_|0,u>1?(u>=qs&&(u=qs-1),f=e(I,u),d=f.length,m=g.length,a=t(f,g,d,m),a==1&&(u--,n(f,E16)throw Error(Vve+ys(e));if(!e.s)return new u(Su);for(So=!1,a=f,s=new u(.03125);e.abs().gte(.1);)e=e.times(s),c+=5;for(r=Math.log(Yx(2,c))/Math.LN10*2+5|0,a+=r,n=i=o=new u(Su),u.precision=a;;){if(i=Ui(i.times(e),a),n=n.times(++l),s=o.plus(iv(i,n,a)),Rp(s.d).slice(0,a)===Rp(o.d).slice(0,a)){for(;c--;)o=Ui(o.times(o),a);return u.precision=f,t==null?(So=!0,Ui(o,f)):o}o=s}}function ys(e){for(var t=e.e*io,n=e.d[0];n>=10;n/=10)t++;return t}function SJ(e,t,n){if(t>e.LN10.sd())throw So=!0,n&&(e.precision=n),Error(od+"LN10 precision limit exceeded");return Ui(new e(e.LN10),t)}function r0(e){for(var t="";e--;)t+="0";return t}function vI(e,t){var n,r,i,o,s,a,l,c,u,f=1,d=10,h=e,p=h.d,g=h.constructor,m=g.precision;if(h.s<1)throw Error(od+(h.s?"NaN":"-Infinity"));if(h.eq(Su))return new g(0);if(t==null?(So=!1,c=m):c=t,h.eq(10))return t==null&&(So=!0),SJ(g,c);if(c+=d,g.precision=c,n=Rp(p),r=n.charAt(0),o=ys(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=Rp(h.d),r=n.charAt(0),f++;o=ys(h),r>1?(h=new g("0."+n),o++):h=new g(r+"."+n.slice(1))}else return l=SJ(g,c+2,m).times(o+""),h=vI(new g(r+"."+n.slice(1)),c-d).plus(l),g.precision=m,t==null?(So=!0,Ui(h,m)):h;for(a=s=h=iv(h.minus(Su),h.plus(Su),c),u=Ui(h.times(h),c),i=3;;){if(s=Ui(s.times(u),c),l=a.plus(iv(s,new g(i),c)),Rp(l.d).slice(0,c)===Rp(a.d).slice(0,c))return a=a.times(2),o!==0&&(a=a.plus(SJ(g,c+2,m).times(o+""))),a=iv(a,new g(f),c),g.precision=m,t==null?(So=!0,Ui(a,m)):a;a=l,i+=2}}function m$e(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=IP(n/io),e.d=[],r=(n+1)%io,n<0&&(r+=io),rr6||e.e<-r6))throw Error(Vve+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ui(e,t,n){var r,i,o,s,a,l,c,u,f=e.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=io,i=t,c=f[u=0];else{if(u=Math.ceil((r+1)/io),o=f.length,u>=o)return e;for(c=o=f[u],s=1;o>=10;o/=10)s++;r%=io,i=r-io+s}if(n!==void 0&&(o=Yx(10,s-i-1),a=c/o%10|0,l=t<0||f[u+1]!==void 0||c%o,l=n<4?(a||l)&&(n==0||n==(e.s<0?3:2)):a>5||a==5&&(n==4||l||n==6&&(r>0?i>0?c/Yx(10,s-i):0:f[u-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return l?(o=ys(e),f.length=1,t=t-o-1,f[0]=Yx(10,(io-t%io)%io),e.e=IP(-t/io)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=Yx(10,io-r),f[u]=i>0?(c/Yx(10,s-i)%Yx(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==qs&&(f[0]=1,++e.e);break}else{if(f[u]+=o,f[u]!=qs)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(So&&(e.e>r6||e.e<-r6))throw Error(Vve+ys(e));return e}function vlt(e,t){var n,r,i,o,s,a,l,c,u,f,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),So?Ui(t,h):t;if(l=e.d,f=t.d,r=t.e,c=e.e,l=l.slice(),s=c-r,s){for(u=s<0,u?(n=l,s=-s,a=f.length):(n=f,r=c,a=l.length),i=Math.max(Math.ceil(h/io),a)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=l.length,a=f.length,u=i0;--i)l[a++]=0;for(i=f.length;i>s;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+r0(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+r0(-i-1)+o,n&&(r=n-s)>0&&(o+=r0(r))):i>=s?(o+=r0(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+r0(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=r0(r))),e.s<0?"-"+o:o}function v$e(e,t){if(e.length>t)return e.length=t,!0}function ylt(e){var t,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Z1+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return m$e(s,o.toString())}else if(typeof o!="string")throw Error(Z1+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,j7n.test(o))m$e(s,o);else throw Error(Z1+o)}if(i.prototype=ln,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=ylt,i.config=i.set=B7n,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Z1+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Z1+n+": "+r);return this}var Wve=ylt(z7n);Su=new Wve(1);const Ai=Wve;function U7n(e){return G7n(e)||H7n(e)||W7n(e)||V7n()}function V7n(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W7n(e,t){if(e){if(typeof e=="string")return Cse(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cse(e,t)}}function H7n(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function G7n(e){if(Array.isArray(e))return Cse(e)}function Cse(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,i):e(t-s,y$e(function(){for(var a=arguments.length,l=new Array(a),c=0;ce.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function aqn(e){if(Array.isArray(e))return e}function _lt(e){var t=yI(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Clt(e,t,n){if(e.lte(0))return new Ai(0);var r=QW.getDigitCount(e.toNumber()),i=new Ai(10).pow(r),o=e.div(i),s=r!==1?.05:.1,a=new Ai(Math.ceil(o.div(s).toNumber())).add(n).mul(s),l=a.mul(i);return t?l:new Ai(Math.ceil(l))}function lqn(e,t,n){var r=1,i=new Ai(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new Ai(10).pow(QW.getDigitCount(e)-1),i=new Ai(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Ai(Math.floor(e)))}else e===0?i=new Ai(Math.floor((t-1)/2)):n||(i=new Ai(Math.floor(e)));var s=Math.floor((t-1)/2),a=Q7n(Y7n(function(l){return i.add(new Ai(l-s).mul(r)).toNumber()}),Ose);return a(0,t)}function Olt(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ai(0),tickMin:new Ai(0),tickMax:new Ai(0)};var o=Clt(new Ai(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new Ai(0):(s=new Ai(e).add(t).div(2),s=s.sub(new Ai(s).mod(o)));var a=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new Ai(t).sub(s).div(o).toNumber()),c=a+l+1;return c>n?Olt(e,t,n,r,i+1):(c0?l+(n-c):l,a=t>0?a:a+(n-c)),{step:o,tickMin:s.sub(new Ai(a).mul(o)),tickMax:s.add(new Ai(l).mul(o))})}function cqn(e){var t=yI(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),a=_lt([n,r]),l=yI(a,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(Tse(Ose(0,i-1).map(function(){return 1/0}))):[].concat(Tse(Ose(0,i-1).map(function(){return-1/0})),[u]);return n>r?Ese(f):f}if(c===u)return lqn(c,i,o);var d=Olt(c,u,s,o),h=d.step,p=d.tickMin,g=d.tickMax,m=QW.rangeStep(p,g.add(new Ai(.1).mul(h)),h);return n>r?Ese(m):m}function uqn(e,t){var n=yI(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=_lt([r,i]),a=yI(s,2),l=a[0],c=a[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(t,2),f=Clt(new Ai(c).sub(l).div(u-1),o,0),d=[].concat(Tse(QW.rangeStep(new Ai(l),new Ai(c).sub(new Ai(.99).mul(f)),f)),[c]);return r>i?Ese(d):d}var fqn=wlt(cqn),dqn=wlt(uqn),hqn="Invariant failed";function Xw(e,t){throw new Error(hqn)}var pqn=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function eT(e){"@babel/helpers - typeof";return eT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eT(e)}function i6(){return i6=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wqn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Sqn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _qn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,a=(n=r?.length)!==null&&n!==void 0?n:0;if(a<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[a-1].coordinate,f=i[c].coordinate,d=c>=a-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(oh(f-u)!==oh(d-f)){var p=[];if(oh(d-f)===oh(l[1]-l[0])){h=d;var g=f+l[1]-l[0];p[0]=Math.min(g,(g+u)/2),p[1]=Math.max(g,(g+u)/2)}else{h=u;var m=d+l[1]-l[0];p[0]=Math.min(f,(m+f)/2),p[1]=Math.max(f,(m+f)/2)}var v=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(t>v[0]&&t<=v[1]||t>=p[0]&&t<=p[1]){s=i[c].index;break}}else{var y=Math.min(u,d),b=Math.max(u,d);if(t>(y+f)/2&&t<=(b+f)/2){s=i[c].index;break}}}else for(var w=0;w0&&w(r[w].coordinate+r[w-1].coordinate)/2&&t<=(r[w].coordinate+r[w+1].coordinate)/2||w===a-1&&t>(r[w].coordinate+r[w-1].coordinate)/2){s=r[w].index;break}return s},Hve=function(t){var n,r=t,i=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?zo(zo({},t.type.defaultProps),t.props):t.props,s=o.stroke,a=o.fill,l;switch(i){case"Line":l=s;break;case"Area":case"Radar":l=s&&s!=="none"?s:a;break;default:l=a;break}return l},jqn=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},a=Object.keys(o),l=0,c=a.length;l=0});if(v&&v.length){var y=v[0].type.defaultProps,b=y!==void 0?zo(zo({},y),v[0].props):v[0].props,w=b.barSize,S=b[m];s[S]||(s[S]=[]);var _=fr(w)?n:w;s[S].push({item:v[0],stackList:v.slice(1),barSize:fr(_)?void 0:Gw(_,r,0)})}}return s},Bqn=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,o=t.sizeList,s=o===void 0?[]:o,a=t.maxBarSize,l=s.length;if(l<1)return null;var c=Gw(n,i,0,!0),u,f=[];if(s[0].barSize===+s[0].barSize){var d=!1,h=i/l,p=s.reduce(function(w,S){return w+S.barSize||0},0);p+=(l-1)*c,p>=i&&(p-=(l-1)*c,c=0),p>=i&&h>0&&(d=!0,h*=.9,p=l*h);var g=(i-p)/2>>0,m={offset:g-c,size:0};u=s.reduce(function(w,S){var _={item:S.item,position:{offset:m.offset+m.size+c,size:d?h:S.barSize}},E=[].concat(w$e(w),[_]);return m=E[E.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(T){E.push({item:T,position:m})}),E},f)}else{var v=Gw(r,i,0,!0);i-2*v-(l-1)*c<=0&&(c=0);var y=(i-2*v-(l-1)*c)/l;y>1&&(y>>=0);var b=a===+a?Math.min(y,a):y;u=s.reduce(function(w,S,_){var E=[].concat(w$e(w),[{item:S.item,position:{offset:v+(y+c)*_+(y-b)/2,size:b}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(T){E.push({item:T,position:E[E.length-1].position})}),E},f)}return u},Uqn=function(t,n,r,i){var o=r.children,s=r.width,a=r.margin,l=s-(a.left||0)-(a.right||0),c=klt({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,g=c.layout;if((g==="vertical"||g==="horizontal"&&p==="middle")&&h!=="center"&&At(t[h]))return zo(zo({},t),{},LO({},h,t[h]+(f||0)));if((g==="horizontal"||g==="vertical"&&h==="center")&&p!=="middle"&&At(t[p]))return zo(zo({},t),{},LO({},p,t[p]+(d||0)))}return t},Vqn=function(t,n,r){return fr(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Mlt=function(t,n,r,i,o){var s=n.props.children,a=Vf(s,DP).filter(function(c){return Vqn(i,o,c.props.direction)});if(a&&a.length){var l=a.map(function(c){return c.props.dataKey});return t.reduce(function(c,u){var f=Zl(u,r);if(fr(f))return c;var d=Array.isArray(f)?[XW(f),C0(f)]:[f,f],h=l.reduce(function(p,g){var m=Zl(u,g,0),v=d[0]-Math.abs(Array.isArray(m)?m[0]:m),y=d[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(v,p[0]),Math.max(y,p[1])]},[1/0,-1/0]);return[Math.min(h[0],c[0]),Math.max(h[1],c[1])]},[1/0,-1/0])}return null},Wqn=function(t,n,r,i,o){var s=n.map(function(a){return Mlt(t,a,r,o,i)}).filter(function(a){return!fr(a)});return s&&s.length?s.reduce(function(a,l){return[Math.min(a[0],l[0]),Math.max(a[1],l[1])]},[1/0,-1/0]):null},Alt=function(t,n,r,i,o){var s=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Mlt(t,l,c,i)||CA(t,c,r,o)});if(r==="number")return s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var a={};return s.reduce(function(l,c){for(var u=0,f=c.length;u=2?oh(a[0]-a[1])*2*c:c,n&&(t.ticks||t.niceTicks)){var u=(t.ticks||t.niceTicks).map(function(f){var d=o?o.indexOf(f):f;return{coordinate:i(d)+c,value:f,offset:c}});return u.filter(function(f){return!kP(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,d){return{coordinate:i(f)+c,value:f,index:d,offset:c}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,d){return{coordinate:i(f)+c,value:o?o[f]:f,index:d,offset:c}})},_J=new WeakMap,D3=function(t,n){if(typeof n!="function")return t;_J.has(t)||_J.set(t,new WeakMap);var r=_J.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},Hqn=function(t,n,r){var i=t.scale,o=t.type,s=t.layout,a=t.axisType;if(i==="auto")return s==="radial"&&a==="radiusAxis"?{scale:lR(),realScaleType:"band"}:s==="radial"&&a==="angleAxis"?{scale:dR(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:QM(),realScaleType:"point"}:o==="category"?{scale:lR(),realScaleType:"band"}:{scale:dR(),realScaleType:"linear"};if(Hw(i)){var l="scale".concat(WW(i));return{scale:(a$e[l]||QM)(),realScaleType:a$e[l]?l:"point"}}return er(i)?{scale:i}:{scale:QM(),realScaleType:"point"}},_$e=1e-4,Gqn=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),o=Math.min(i[0],i[1])-_$e,s=Math.max(i[0],i[1])+_$e,a=t(n[0]),l=t(n[r-1]);(as||ls)&&t.domain([n[0],n[r-1]])}},qqn=function(t,n){if(!t)return null;for(var r=0,i=t.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(t[a][r][0]=o,t[a][r][1]=o+l,o=t[a][r][1]):(t[a][r][0]=s,t[a][r][1]=s+l,s=t[a][r][1])}},Qqn=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r=0?(t[s][r][0]=o,t[s][r][1]=o+a,o=t[s][r][1]):(t[s][r][0]=0,t[s][r][1]=0)}},Kqn={sign:Yqn,expand:Y7t,none:lE,silhouette:Q7t,wiggle:K7t,positive:Qqn},Zqn=function(t,n,r){var i=n.map(function(a){return a.props.dataKey}),o=Kqn[r],s=X7t().keys(i).value(function(a,l){return+Zl(a,l,0)}).order(Nne).offset(o);return s(t)},Jqn=function(t,n,r,i,o,s){if(!t)return null;var a=s?n.reverse():n,l={},c=a.reduce(function(f,d){var h,p=(h=d.type)!==null&&h!==void 0&&h.defaultProps?zo(zo({},d.type.defaultProps),d.props):d.props,g=p.stackId,m=p.hide;if(m)return f;var v=p[r],y=f[v]||{hasStack:!1,stackGroups:{}};if(Fs(g)){var b=y.stackGroups[g]||{numericAxisId:r,cateAxisId:i,items:[]};b.items.push(d),y.hasStack=!0,y.stackGroups[g]=b}else y.stackGroups[MP("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return zo(zo({},f),{},LO({},v,y))},l),u={};return Object.keys(c).reduce(function(f,d){var h=c[d];if(h.hasStack){var p={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(g,m){var v=h.stackGroups[m];return zo(zo({},g),{},LO({},m,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:Zqn(t,v.items,o)}))},p)}return zo(zo({},f),{},LO({},d,h))},u)},eXn=function(t,n){var r=n.realScaleType,i=n.type,o=n.tickCount,s=n.originalDomain,a=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=t.domain();if(!c.length)return null;var u=fqn(c,o,a);return t.domain([XW(u),C0(u)]),{niceTicks:u}}if(o&&i==="number"){var f=t.domain(),d=dqn(f,o,a);return{niceTicks:d}}return null};function s6(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,o=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!fr(i[t.dataKey])){var a=X4(n,"value",i[t.dataKey]);if(a)return a.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Zl(i,fr(s)?t.dataKey:s);return fr(l)?null:t.scale(l)}var C$e=function(t){var n=t.axis,r=t.ticks,i=t.offset,o=t.bandSize,s=t.entry,a=t.index;if(n.type==="category")return r[a]?r[a].coordinate+i:null;var l=Zl(s,n.dataKey,n.domain[a]);return fr(l)?null:n.scale(l)-o/2+i},tXn=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},nXn=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?zo(zo({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(Fs(o)){var s=n[o];if(s){var a=s.items.indexOf(t);return a>=0?s.stackedData[a]:null}}return null},rXn=function(t){return t.reduce(function(n,r){return[XW(r.concat([n[0]]).filter(At)),C0(r.concat([n[1]]).filter(At))]},[1/0,-1/0])},Dlt=function(t,n,r){return Object.keys(t).reduce(function(i,o){var s=t[o],a=s.stackedData,l=a.reduce(function(c,u){var f=rXn(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},O$e=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,E$e=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ase=function(t,n,r){if(er(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(At(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(O$e.test(t[0])){var o=+O$e.exec(t[0])[1];i[0]=n[0]-o}else er(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(At(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(E$e.test(t[1])){var s=+E$e.exec(t[1])[1];i[1]=n[1]+s}else er(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},a6=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var o=Bve(n,function(f){return f.coordinate}),s=1/0,a=1,l=o.length;as&&(c=2*Math.PI-c),{radius:a,angle:aXn(c),angleInRadian:c}},uXn=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(i,o);return{startAngle:n-s*360,endAngle:r-s*360}},fXn=function(t,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),s=Math.floor(i/360),a=Math.min(o,s);return t+a*360},M$e=function(t,n){var r=t.x,i=t.y,o=cXn({x:r,y:i},n),s=o.radius,a=o.angle,l=n.innerRadius,c=n.outerRadius;if(sc)return!1;if(s===0)return!0;var u=uXn(n),f=u.startAngle,d=u.endAngle,h=a,p;if(f<=d){for(;h>d;)h-=360;for(;h=f&&h<=d}else{for(;h>f;)h-=360;for(;h=d&&h<=f}return p?k$e(k$e({},n),{},{radius:s,angle:fXn(h,n)}):null};function SI(e){"@babel/helpers - typeof";return SI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},SI(e)}var dXn=["offset"];function hXn(e){return vXn(e)||mXn(e)||gXn(e)||pXn()}function pXn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gXn(e,t){if(e){if(typeof e=="string")return Rse(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rse(e,t)}}function mXn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vXn(e){if(Array.isArray(e))return Rse(e)}function Rse(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bXn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function A$e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Es(e){for(var t=1;t=0?1:-1,b,w;i==="insideStart"?(b=h+y*s,w=g):i==="insideEnd"?(b=p-y*s,w=!g):i==="end"&&(b=p+y*s,w=g),w=v<=0?w:!w;var S=Da(c,u,m,b),_=Da(c,u,m,b+(w?1:-1)*359),E="M".concat(S.x,",").concat(S.y,` + height and width.`,L,$,s,l,u,f,n);var j=!Array.isArray(h)&&Zm(h.type).endsWith("Chart");return Te.Children.map(h,function(V){return Te.isValidElement(V)?M.cloneElement(V,f3({width:L,height:$},j?{style:f3({height:"100%",width:"100%",maxHeight:$,maxWidth:L},V.props.style)}:{})):V})},[n,h,l,d,f,u,k,s]);return Te.createElement("div",{id:m?"".concat(m):void 0,className:Re("recharts-responsive-container",v),style:f3(f3({},w),{},{width:s,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:S},R)}),Got=function(t){return null};Got.displayName="Cell";function iI(e){"@babel/helpers - typeof";return iI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iI(e)}function YDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hoe(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||IS.isSsr)return{width:0,height:0};var r=eHn(n),i=JSON.stringify({text:t,copyStyle:r});if(B_.widthCache[i])return B_.widthCache[i];try{var o=document.getElementById(QDe);o||(o=document.createElement("span"),o.setAttribute("id",QDe),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=hoe(hoe({},JWn),r);Object.assign(o.style,s),o.textContent="".concat(t);var a=o.getBoundingClientRect(),l={width:a.width,height:a.height};return B_.widthCache[i]=l,++B_.cacheCount>ZWn&&(B_.cacheCount=0,B_.widthCache={}),l}catch{return{width:0,height:0}}},tHn=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function oI(e){"@babel/helpers - typeof";return oI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oI(e)}function R4(e,t){return oHn(e)||iHn(e,t)||rHn(e,t)||nHn()}function nHn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rHn(e,t){if(e){if(typeof e=="string")return KDe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KDe(e,t)}}function KDe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bHn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function rLe(e,t){return _Hn(e)||SHn(e,t)||wHn(e,t)||xHn()}function xHn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wHn(e,t){if(e){if(typeof e=="string")return iLe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iLe(e,t)}}function iLe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function($,j){var V=j.word,U=j.width,z=$[$.length-1];if(z&&(i==null||o||z.width+U+rj.width?$:j})};if(!u)return h;for(var g="…",m=function(L){var $=f.slice(0,L),j=Qot({breakAll:c,style:l,children:$+g}).wordsWithComputedWidth,V=d(j),U=V.length>s||p(V).width>Number(i);return[U,V]},v=0,y=f.length-1,b=0,w;v<=y&&b<=f.length-1;){var S=Math.floor((v+y)/2),_=S-1,E=m(_),T=rLe(E,2),k=T[0],P=T[1],I=m(S),R=rLe(I,1),F=R[0];if(!k&&!F&&(v=S+1),k&&F&&(y=S-1),!k&&F){w=P;break}b++}return w||h},oLe=function(t){var n=dr(t)?[]:t.toString().split(Yot);return[{words:n}]},OHn=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,a=t.maxLines;if((n||r)&&!IS.isSsr){var l,c,u=Qot({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return oLe(i);return CHn({breakAll:s,children:i,maxLines:a,style:o},l,c,n,r)}return oLe(i)},sLe="#808080",I4=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.lineHeight,a=s===void 0?"1em":s,l=t.capHeight,c=l===void 0?"0.71em":l,u=t.scaleToFit,f=u===void 0?!1:u,d=t.textAnchor,h=d===void 0?"start":d,p=t.verticalAnchor,g=p===void 0?"end":p,m=t.fill,v=m===void 0?sLe:m,y=nLe(t,vHn),b=M.useMemo(function(){return OHn({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),w=y.dx,S=y.dy,_=y.angle,E=y.className,T=y.breakAll,k=nLe(y,yHn);if(!Fs(r)||!Fs(o))return null;var P=r+(At(w)?w:0),I=o+(At(S)?S:0),R;switch(g){case"start":R=lZ("calc(".concat(c,")"));break;case"middle":R=lZ("calc(".concat((b.length-1)/2," * -").concat(a," + (").concat(c," / 2))"));break;default:R=lZ("calc(".concat(b.length-1," * -").concat(a,")"));break}var F=[];if(f){var A=b[0].width,L=y.width;F.push("scale(".concat((At(L)?L/A:1)/A,")"))}return _&&F.push("rotate(".concat(_,", ").concat(P,", ").concat(I,")")),F.length&&(k.transform=F.join(" ")),Te.createElement("text",poe({},sr(k,!0),{x:P,y:I,className:Re("recharts-text",E),textAnchor:h,fill:v.includes("url")?sLe:v}),b.map(function($,j){var V=$.words.join(T?"":" ");return Te.createElement("tspan",{x:P,dy:j===0?R:a,key:"".concat(V,"-").concat(j)},V)}))};const aLe=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:KA,scaleDiverging:Lue,scaleDivergingLog:Fue,scaleDivergingPow:tV,scaleDivergingSqrt:iHe,scaleDivergingSymlog:$ue,scaleIdentity:_ue,scaleImplicit:yj,scaleLinear:tR,scaleLog:Oue,scaleOrdinal:DD,scalePoint:NM,scalePow:QU,scaleQuantile:kue,scaleQuantize:Mue,scaleRadial:JWe,scaleSequential:ZU,scaleSequentialLog:Iue,scaleSequentialPow:JU,scaleSequentialQuantile:rHe,scaleSequentialSqrt:nHe,scaleSequentialSymlog:Due,scaleSqrt:ZWe,scaleSymlog:Tue,scaleThreshold:Aue,scaleTime:eHe,scaleUtc:tHe,tickFormat:Sue},Symbol.toStringTag,{value:"Module"}));var cZ,lLe;function Kot(){if(lLe)return cZ;lLe=1;var e=xP();function t(n,r,i){for(var o=-1,s=n.length;++on}return uZ=e,uZ}var fZ,uLe;function THn(){if(uLe)return fZ;uLe=1;var e=Kot(),t=EHn(),n=CP();function r(i){return i&&i.length?e(i,n,t):void 0}return fZ=r,fZ}var PHn=THn();const y0=Yn(PHn);var dZ,fLe;function kHn(){if(fLe)return dZ;fLe=1;function e(t,n){return te.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=re.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};ln.decimalPlaces=ln.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*io;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ln.dividedBy=ln.div=function(e){return ev(this,new this.constructor(e))};ln.dividedToIntegerBy=ln.idiv=function(e){var t=this,n=t.constructor;return Ui(ev(t,new n(e),0,1),n.precision)};ln.equals=ln.eq=function(e){return!this.cmp(e)};ln.exponent=function(){return bs(this)};ln.greaterThan=ln.gt=function(e){return this.cmp(e)>0};ln.greaterThanOrEqualTo=ln.gte=function(e){return this.cmp(e)>=0};ln.isInteger=ln.isint=function(){return this.e>this.d.length-2};ln.isNegative=ln.isneg=function(){return this.s<0};ln.isPositive=ln.ispos=function(){return this.s>0};ln.isZero=function(){return this.s===0};ln.lessThan=ln.lt=function(e){return this.cmp(e)<0};ln.lessThanOrEqualTo=ln.lte=function(e){return this.cmp(e)<1};ln.logarithm=ln.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(wu))throw Error(rd+"NaN");if(n.s<1)throw Error(rd+(n.s?"NaN":"-Infinity"));return n.eq(wu)?new r(0):(So=!1,t=ev(sI(n,o),sI(e,o),o),So=!0,Ui(t,i))};ln.minus=ln.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?tst(t,e):Jot(t,(e.s=-e.s,e))};ln.modulo=ln.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(rd+"NaN");return n.s?(So=!1,t=ev(n,e,0,1).times(e),So=!0,n.minus(t)):Ui(new r(n),i)};ln.naturalExponential=ln.exp=function(){return est(this)};ln.naturalLogarithm=ln.ln=function(){return sI(this)};ln.negated=ln.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ln.plus=ln.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Jot(t,e):tst(t,(e.s=-e.s,e))};ln.precision=ln.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(W1+e);if(t=bs(i)+1,r=i.d.length-1,n=r*io+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ln.squareRoot=ln.sqrt=function(){var e,t,n,r,i,o,s,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(rd+"NaN")}for(e=bs(a),So=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=Ap(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=EP((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t)):r=new l(i.toString()),n=l.precision,i=s=n+3;;)if(o=r,r=o.plus(ev(a,o,s+2)).times(.5),Ap(o.d).slice(0,s)===(t=Ap(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Ui(o,n+1,0),o.times(o).eq(a)){r=o;break}}else if(t!="9999")break;s+=4}return So=!0,Ui(r,n)};ln.times=ln.mul=function(e){var t,n,r,i,o,s,a,l,c,u=this,f=u.constructor,d=u.d,h=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,n=u.e+e.e,l=d.length,c=h.length,l=0;){for(t=0,i=l+r;i>r;)a=o[i]+h[r]*d[i-r-1]+t,o[i--]=a%qs|0,t=a/qs|0;o[i]=(o[i]+t)%qs|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,So?Ui(e,f.precision):e};ln.toDecimalPlaces=ln.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(cg(e,0,OP),t===void 0?t=r.rounding:cg(t,0,8),Ui(n,e+bs(n)+1,t))};ln.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=zw(r,!0):(cg(e,0,OP),t===void 0?t=i.rounding:cg(t,0,8),r=Ui(new i(r),e+1,t),n=zw(r,!0,e+1)),n};ln.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?zw(i):(cg(e,0,OP),t===void 0?t=o.rounding:cg(t,0,8),r=Ui(new o(i),e+bs(i)+1,t),n=zw(r.abs(),!1,e+bs(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ln.toInteger=ln.toint=function(){var e=this,t=e.constructor;return Ui(new t(e),bs(e)+1,t.rounding)};ln.toNumber=function(){return+this};ln.toPower=ln.pow=function(e){var t,n,r,i,o,s,a=this,l=a.constructor,c=12,u=+(e=new l(e));if(!e.s)return new l(wu);if(a=new l(a),!a.s){if(e.s<1)throw Error(rd+"Infinity");return a}if(a.eq(wu))return a;if(r=l.precision,e.eq(wu))return Ui(a,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=a.s,s){if((n=u<0?-u:u)<=Zot){for(i=new l(wu),t=Math.ceil(r/io+4),So=!1;n%2&&(i=i.times(a),vLe(i.d,t)),n=EP(n/2),n!==0;)a=a.times(a),vLe(a.d,t);return So=!0,e.s<0?new l(wu).div(i):Ui(i,r)}}else if(o<0)throw Error(rd+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,a.s=1,So=!1,i=e.times(sI(a,r+c)),So=!0,i=est(i),i.s=o,i};ln.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=bs(i),r=zw(i,n<=o.toExpNeg||n>=o.toExpPos)):(cg(e,1,OP),t===void 0?t=o.rounding:cg(t,0,8),i=Ui(new o(i),e,t),n=bs(i),r=zw(i,e<=n||n<=o.toExpNeg,e)),r};ln.toSignificantDigits=ln.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(cg(e,1,OP),t===void 0?t=r.rounding:cg(t,0,8)),Ui(new r(n),e,t)};ln.toString=ln.valueOf=ln.val=ln.toJSON=ln[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=bs(e),n=e.constructor;return zw(e,t<=n.toExpNeg||t>=n.toExpPos)};function Jot(e,t){var n,r,i,o,s,a,l,c,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),So?Ui(t,f):t;if(l=e.d,c=t.d,s=e.e,i=t.e,l=l.slice(),o=s-i,o){for(o<0?(r=l,o=-o,a=c.length):(r=c,i=s,a=l.length),s=Math.ceil(f/io),a=s>a?s+1:a+1,o>a&&(o=a,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(a=l.length,o=c.length,a-o<0&&(o=a,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/qs|0,l[o]%=qs;for(n&&(l.unshift(n),++i),a=l.length;l[--a]==0;)l.pop();return t.d=l,t.e=i,So?Ui(t,f):t}function cg(e,t,n){if(e!==~~e||en)throw Error(W1+e)}function Ap(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;ts?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]1;)r.shift()}return function(r,i,o,s){var a,l,c,u,f,d,h,p,g,m,v,y,b,w,S,_,E,T,k=r.constructor,P=r.s==i.s?1:-1,I=r.d,R=i.d;if(!r.s)return new k(r);if(!i.s)throw Error(rd+"Division by zero");for(l=r.e-i.e,E=R.length,S=I.length,h=new k(P),p=h.d=[],c=0;R[c]==(I[c]||0);)++c;if(R[c]>(I[c]||0)&&--l,o==null?y=o=k.precision:s?y=o+(bs(r)-bs(i))+1:y=o,y<0)return new k(0);if(y=y/io+2|0,c=0,E==1)for(u=0,R=R[0],y++;(c1&&(R=e(R,u),I=e(I,u),E=R.length,S=I.length),w=E,g=I.slice(0,E),m=g.length;m=qs/2&&++_;do u=0,a=t(R,g,E,m),a<0?(v=g[0],E!=m&&(v=v*qs+(g[1]||0)),u=v/_|0,u>1?(u>=qs&&(u=qs-1),f=e(R,u),d=f.length,m=g.length,a=t(f,g,d,m),a==1&&(u--,n(f,E16)throw Error($me+bs(e));if(!e.s)return new u(wu);for(So=!1,a=f,s=new u(.03125);e.abs().gte(.1);)e=e.times(s),c+=5;for(r=Math.log(jx(2,c))/Math.LN10*2+5|0,a+=r,n=i=o=new u(wu),u.precision=a;;){if(i=Ui(i.times(e),a),n=n.times(++l),s=o.plus(ev(i,n,a)),Ap(s.d).slice(0,a)===Ap(o.d).slice(0,a)){for(;c--;)o=Ui(o.times(o),a);return u.precision=f,t==null?(So=!0,Ui(o,f)):o}o=s}}function bs(e){for(var t=e.e*io,n=e.d[0];n>=10;n/=10)t++;return t}function vZ(e,t,n){if(t>e.LN10.sd())throw So=!0,n&&(e.precision=n),Error(rd+"LN10 precision limit exceeded");return Ui(new e(e.LN10),t)}function Jy(e){for(var t="";e--;)t+="0";return t}function sI(e,t){var n,r,i,o,s,a,l,c,u,f=1,d=10,h=e,p=h.d,g=h.constructor,m=g.precision;if(h.s<1)throw Error(rd+(h.s?"NaN":"-Infinity"));if(h.eq(wu))return new g(0);if(t==null?(So=!1,c=m):c=t,h.eq(10))return t==null&&(So=!0),vZ(g,c);if(c+=d,g.precision=c,n=Ap(p),r=n.charAt(0),o=bs(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=Ap(h.d),r=n.charAt(0),f++;o=bs(h),r>1?(h=new g("0."+n),o++):h=new g(r+"."+n.slice(1))}else return l=vZ(g,c+2,m).times(o+""),h=sI(new g(r+"."+n.slice(1)),c-d).plus(l),g.precision=m,t==null?(So=!0,Ui(h,m)):h;for(a=s=h=ev(h.minus(wu),h.plus(wu),c),u=Ui(h.times(h),c),i=3;;){if(s=Ui(s.times(u),c),l=a.plus(ev(s,new g(i),c)),Ap(l.d).slice(0,c)===Ap(a.d).slice(0,c))return a=a.times(2),o!==0&&(a=a.plus(vZ(g,c+2,m).times(o+""))),a=ev(a,new g(f),c),g.precision=m,t==null?(So=!0,Ui(a,m)):a;a=l,i+=2}}function mLe(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=EP(n/io),e.d=[],r=(n+1)%io,n<0&&(r+=io),rD4||e.e<-D4))throw Error($me+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ui(e,t,n){var r,i,o,s,a,l,c,u,f=e.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=io,i=t,c=f[u=0];else{if(u=Math.ceil((r+1)/io),o=f.length,u>=o)return e;for(c=o=f[u],s=1;o>=10;o/=10)s++;r%=io,i=r-io+s}if(n!==void 0&&(o=jx(10,s-i-1),a=c/o%10|0,l=t<0||f[u+1]!==void 0||c%o,l=n<4?(a||l)&&(n==0||n==(e.s<0?3:2)):a>5||a==5&&(n==4||l||n==6&&(r>0?i>0?c/jx(10,s-i):0:f[u-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return l?(o=bs(e),f.length=1,t=t-o-1,f[0]=jx(10,(io-t%io)%io),e.e=EP(-t/io)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=jx(10,io-r),f[u]=i>0?(c/jx(10,s-i)%jx(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==qs&&(f[0]=1,++e.e);break}else{if(f[u]+=o,f[u]!=qs)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(So&&(e.e>D4||e.e<-D4))throw Error($me+bs(e));return e}function tst(e,t){var n,r,i,o,s,a,l,c,u,f,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),So?Ui(t,h):t;if(l=e.d,f=t.d,r=t.e,c=e.e,l=l.slice(),s=c-r,s){for(u=s<0,u?(n=l,s=-s,a=f.length):(n=f,r=c,a=l.length),i=Math.max(Math.ceil(h/io),a)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=l.length,a=f.length,u=i0;--i)l[a++]=0;for(i=f.length;i>s;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+Jy(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Jy(-i-1)+o,n&&(r=n-s)>0&&(o+=Jy(r))):i>=s?(o+=Jy(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Jy(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=Jy(r))),e.s<0?"-"+o:o}function vLe(e,t){if(e.length>t)return e.length=t,!0}function nst(e){var t,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(W1+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return mLe(s,o.toString())}else if(typeof o!="string")throw Error(W1+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,zHn.test(o))mLe(s,o);else throw Error(W1+o)}if(i.prototype=ln,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=nst,i.config=i.set=jHn,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(W1+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(W1+n+": "+r);return this}var Nme=nst(NHn);wu=new Nme(1);const Ri=Nme;function BHn(e){return HHn(e)||WHn(e)||VHn(e)||UHn()}function UHn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VHn(e,t){if(e){if(typeof e=="string")return goe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return goe(e,t)}}function WHn(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function HHn(e){if(Array.isArray(e))return goe(e)}function goe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,i):e(t-s,yLe(function(){for(var a=arguments.length,l=new Array(a),c=0;ce.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function sGn(e){if(Array.isArray(e))return e}function ast(e){var t=aI(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function lst(e,t,n){if(e.lte(0))return new Ri(0);var r=EW.getDigitCount(e.toNumber()),i=new Ri(10).pow(r),o=e.div(i),s=r!==1?.05:.1,a=new Ri(Math.ceil(o.div(s).toNumber())).add(n).mul(s),l=a.mul(i);return t?l:new Ri(Math.ceil(l))}function aGn(e,t,n){var r=1,i=new Ri(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new Ri(10).pow(EW.getDigitCount(e)-1),i=new Ri(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Ri(Math.floor(e)))}else e===0?i=new Ri(Math.floor((t-1)/2)):n||(i=new Ri(Math.floor(e)));var s=Math.floor((t-1)/2),a=YHn(XHn(function(l){return i.add(new Ri(l-s).mul(r)).toNumber()}),moe);return a(0,t)}function cst(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ri(0),tickMin:new Ri(0),tickMax:new Ri(0)};var o=lst(new Ri(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new Ri(0):(s=new Ri(e).add(t).div(2),s=s.sub(new Ri(s).mod(o)));var a=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new Ri(t).sub(s).div(o).toNumber()),c=a+l+1;return c>n?cst(e,t,n,r,i+1):(c0?l+(n-c):l,a=t>0?a:a+(n-c)),{step:o,tickMin:s.sub(new Ri(a).mul(o)),tickMax:s.add(new Ri(l).mul(o))})}function lGn(e){var t=aI(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),a=ast([n,r]),l=aI(a,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(yoe(moe(0,i-1).map(function(){return 1/0}))):[].concat(yoe(moe(0,i-1).map(function(){return-1/0})),[u]);return n>r?voe(f):f}if(c===u)return aGn(c,i,o);var d=cst(c,u,s,o),h=d.step,p=d.tickMin,g=d.tickMax,m=EW.rangeStep(p,g.add(new Ri(.1).mul(h)),h);return n>r?voe(m):m}function cGn(e,t){var n=aI(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=ast([r,i]),a=aI(s,2),l=a[0],c=a[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(t,2),f=lst(new Ri(c).sub(l).div(u-1),o,0),d=[].concat(yoe(EW.rangeStep(new Ri(l),new Ri(c).sub(new Ri(.99).mul(f)),f)),[c]);return r>i?voe(d):d}var uGn=ost(lGn),fGn=ost(cGn),dGn="Invariant failed";function jw(e,t){throw new Error(dGn)}var hGn=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function GE(e){"@babel/helpers - typeof";return GE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},GE(e)}function L4(){return L4=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xGn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wGn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SGn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,a=(n=r?.length)!==null&&n!==void 0?n:0;if(a<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[a-1].coordinate,f=i[c].coordinate,d=c>=a-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(ih(f-u)!==ih(d-f)){var p=[];if(ih(d-f)===ih(l[1]-l[0])){h=d;var g=f+l[1]-l[0];p[0]=Math.min(g,(g+u)/2),p[1]=Math.max(g,(g+u)/2)}else{h=u;var m=d+l[1]-l[0];p[0]=Math.min(f,(m+f)/2),p[1]=Math.max(f,(m+f)/2)}var v=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(t>v[0]&&t<=v[1]||t>=p[0]&&t<=p[1]){s=i[c].index;break}}else{var y=Math.min(u,d),b=Math.max(u,d);if(t>(y+f)/2&&t<=(b+f)/2){s=i[c].index;break}}}else for(var w=0;w0&&w(r[w].coordinate+r[w-1].coordinate)/2&&t<=(r[w].coordinate+r[w+1].coordinate)/2||w===a-1&&t>(r[w].coordinate+r[w-1].coordinate)/2){s=r[w].index;break}return s},zme=function(t){var n,r=t,i=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?zo(zo({},t.type.defaultProps),t.props):t.props,s=o.stroke,a=o.fill,l;switch(i){case"Line":l=s;break;case"Area":case"Radar":l=s&&s!=="none"?s:a;break;default:l=a;break}return l},zGn=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},a=Object.keys(o),l=0,c=a.length;l=0});if(v&&v.length){var y=v[0].type.defaultProps,b=y!==void 0?zo(zo({},y),v[0].props):v[0].props,w=b.barSize,S=b[m];s[S]||(s[S]=[]);var _=dr(w)?n:w;s[S].push({item:v[0],stackList:v.slice(1),barSize:dr(_)?void 0:Nw(_,r,0)})}}return s},jGn=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,o=t.sizeList,s=o===void 0?[]:o,a=t.maxBarSize,l=s.length;if(l<1)return null;var c=Nw(n,i,0,!0),u,f=[];if(s[0].barSize===+s[0].barSize){var d=!1,h=i/l,p=s.reduce(function(w,S){return w+S.barSize||0},0);p+=(l-1)*c,p>=i&&(p-=(l-1)*c,c=0),p>=i&&h>0&&(d=!0,h*=.9,p=l*h);var g=(i-p)/2>>0,m={offset:g-c,size:0};u=s.reduce(function(w,S){var _={item:S.item,position:{offset:m.offset+m.size+c,size:d?h:S.barSize}},E=[].concat(wLe(w),[_]);return m=E[E.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(T){E.push({item:T,position:m})}),E},f)}else{var v=Nw(r,i,0,!0);i-2*v-(l-1)*c<=0&&(c=0);var y=(i-2*v-(l-1)*c)/l;y>1&&(y>>=0);var b=a===+a?Math.min(y,a):y;u=s.reduce(function(w,S,_){var E=[].concat(wLe(w),[{item:S.item,position:{offset:v+(y+c)*_+(y-b)/2,size:b}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(T){E.push({item:T,position:E[E.length-1].position})}),E},f)}return u},BGn=function(t,n,r,i){var o=r.children,s=r.width,a=r.margin,l=s-(a.left||0)-(a.right||0),c=hst({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,g=c.layout;if((g==="vertical"||g==="horizontal"&&p==="middle")&&h!=="center"&&At(t[h]))return zo(zo({},t),{},TO({},h,t[h]+(f||0)));if((g==="horizontal"||g==="vertical"&&h==="center")&&p!=="middle"&&At(t[p]))return zo(zo({},t),{},TO({},p,t[p]+(d||0)))}return t},UGn=function(t,n,r){return dr(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},pst=function(t,n,r,i,o){var s=n.props.children,a=Uf(s,TP).filter(function(c){return UGn(i,o,c.props.direction)});if(a&&a.length){var l=a.map(function(c){return c.props.dataKey});return t.reduce(function(c,u){var f=Ql(u,r);if(dr(f))return c;var d=Array.isArray(f)?[CW(f),y0(f)]:[f,f],h=l.reduce(function(p,g){var m=Ql(u,g,0),v=d[0]-Math.abs(Array.isArray(m)?m[0]:m),y=d[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(v,p[0]),Math.max(y,p[1])]},[1/0,-1/0]);return[Math.min(h[0],c[0]),Math.max(h[1],c[1])]},[1/0,-1/0])}return null},VGn=function(t,n,r,i,o){var s=n.map(function(a){return pst(t,a,r,o,i)}).filter(function(a){return!dr(a)});return s&&s.length?s.reduce(function(a,l){return[Math.min(a[0],l[0]),Math.max(a[1],l[1])]},[1/0,-1/0]):null},gst=function(t,n,r,i,o){var s=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&pst(t,l,c,i)||hA(t,c,r,o)});if(r==="number")return s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var a={};return s.reduce(function(l,c){for(var u=0,f=c.length;u=2?ih(a[0]-a[1])*2*c:c,n&&(t.ticks||t.niceTicks)){var u=(t.ticks||t.niceTicks).map(function(f){var d=o?o.indexOf(f):f;return{coordinate:i(d)+c,value:f,offset:c}});return u.filter(function(f){return!SP(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,d){return{coordinate:i(f)+c,value:f,index:d,offset:c}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,d){return{coordinate:i(f)+c,value:o?o[f]:f,index:d,offset:c}})},yZ=new WeakMap,h3=function(t,n){if(typeof n!="function")return t;yZ.has(t)||yZ.set(t,new WeakMap);var r=yZ.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},WGn=function(t,n,r){var i=t.scale,o=t.type,s=t.layout,a=t.axisType;if(i==="auto")return s==="radial"&&a==="radiusAxis"?{scale:KA(),realScaleType:"band"}:s==="radial"&&a==="angleAxis"?{scale:tR(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:NM(),realScaleType:"point"}:o==="category"?{scale:KA(),realScaleType:"band"}:{scale:tR(),realScaleType:"linear"};if($w(i)){var l="scale".concat(xW(i));return{scale:(aLe[l]||NM)(),realScaleType:aLe[l]?l:"point"}}return tr(i)?{scale:i}:{scale:NM(),realScaleType:"point"}},_Le=1e-4,HGn=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),o=Math.min(i[0],i[1])-_Le,s=Math.max(i[0],i[1])+_Le,a=t(n[0]),l=t(n[r-1]);(as||ls)&&t.domain([n[0],n[r-1]])}},GGn=function(t,n){if(!t)return null;for(var r=0,i=t.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(t[a][r][0]=o,t[a][r][1]=o+l,o=t[a][r][1]):(t[a][r][0]=s,t[a][r][1]=s+l,s=t[a][r][1])}},YGn=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r=0?(t[s][r][0]=o,t[s][r][1]=o+a,o=t[s][r][1]):(t[s][r][0]=0,t[s][r][1]=0)}},QGn={sign:XGn,expand:BHt,none:JO,silhouette:UHt,wiggle:VHt,positive:YGn},KGn=function(t,n,r){var i=n.map(function(a){return a.props.dataKey}),o=QGn[r],s=jHt().keys(i).value(function(a,l){return+Ql(a,l,0)}).order(Pte).offset(o);return s(t)},ZGn=function(t,n,r,i,o,s){if(!t)return null;var a=s?n.reverse():n,l={},c=a.reduce(function(f,d){var h,p=(h=d.type)!==null&&h!==void 0&&h.defaultProps?zo(zo({},d.type.defaultProps),d.props):d.props,g=p.stackId,m=p.hide;if(m)return f;var v=p[r],y=f[v]||{hasStack:!1,stackGroups:{}};if(Fs(g)){var b=y.stackGroups[g]||{numericAxisId:r,cateAxisId:i,items:[]};b.items.push(d),y.hasStack=!0,y.stackGroups[g]=b}else y.stackGroups[_P("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return zo(zo({},f),{},TO({},v,y))},l),u={};return Object.keys(c).reduce(function(f,d){var h=c[d];if(h.hasStack){var p={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(g,m){var v=h.stackGroups[m];return zo(zo({},g),{},TO({},m,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:KGn(t,v.items,o)}))},p)}return zo(zo({},f),{},TO({},d,h))},u)},JGn=function(t,n){var r=n.realScaleType,i=n.type,o=n.tickCount,s=n.originalDomain,a=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=t.domain();if(!c.length)return null;var u=uGn(c,o,a);return t.domain([CW(u),y0(u)]),{niceTicks:u}}if(o&&i==="number"){var f=t.domain(),d=fGn(f,o,a);return{niceTicks:d}}return null};function $4(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,o=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!dr(i[t.dataKey])){var a=O4(n,"value",i[t.dataKey]);if(a)return a.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Ql(i,dr(s)?t.dataKey:s);return dr(l)?null:t.scale(l)}var CLe=function(t){var n=t.axis,r=t.ticks,i=t.offset,o=t.bandSize,s=t.entry,a=t.index;if(n.type==="category")return r[a]?r[a].coordinate+i:null;var l=Ql(s,n.dataKey,n.domain[a]);return dr(l)?null:n.scale(l)-o/2+i},e9n=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},t9n=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?zo(zo({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(Fs(o)){var s=n[o];if(s){var a=s.items.indexOf(t);return a>=0?s.stackedData[a]:null}}return null},n9n=function(t){return t.reduce(function(n,r){return[CW(r.concat([n[0]]).filter(At)),y0(r.concat([n[1]]).filter(At))]},[1/0,-1/0])},yst=function(t,n,r){return Object.keys(t).reduce(function(i,o){var s=t[o],a=s.stackedData,l=a.reduce(function(c,u){var f=n9n(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},OLe=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ELe=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Soe=function(t,n,r){if(tr(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(At(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(OLe.test(t[0])){var o=+OLe.exec(t[0])[1];i[0]=n[0]-o}else tr(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(At(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(ELe.test(t[1])){var s=+ELe.exec(t[1])[1];i[1]=n[1]+s}else tr(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},N4=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var o=Lme(n,function(f){return f.coordinate}),s=1/0,a=1,l=o.length;as&&(c=2*Math.PI-c),{radius:a,angle:s9n(c),angleInRadian:c}},c9n=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(i,o);return{startAngle:n-s*360,endAngle:r-s*360}},u9n=function(t,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),s=Math.floor(i/360),a=Math.min(o,s);return t+a*360},MLe=function(t,n){var r=t.x,i=t.y,o=l9n({x:r,y:i},n),s=o.radius,a=o.angle,l=n.innerRadius,c=n.outerRadius;if(sc)return!1;if(s===0)return!0;var u=c9n(n),f=u.startAngle,d=u.endAngle,h=a,p;if(f<=d){for(;h>d;)h-=360;for(;h=f&&h<=d}else{for(;h>f;)h-=360;for(;h=d&&h<=f}return p?kLe(kLe({},n),{},{radius:s,angle:u9n(h,n)}):null};function fI(e){"@babel/helpers - typeof";return fI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fI(e)}var f9n=["offset"];function d9n(e){return m9n(e)||g9n(e)||p9n(e)||h9n()}function h9n(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p9n(e,t){if(e){if(typeof e=="string")return _oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _oe(e,t)}}function g9n(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function m9n(e){if(Array.isArray(e))return _oe(e)}function _oe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function y9n(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ALe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ts(e){for(var t=1;t=0?1:-1,b,w;i==="insideStart"?(b=h+y*s,w=g):i==="insideEnd"?(b=p-y*s,w=!g):i==="end"&&(b=p+y*s,w=g),w=v<=0?w:!w;var S=Ra(c,u,m,b),_=Ra(c,u,m,b+(w?1:-1)*359),E="M".concat(S.x,",").concat(S.y,` A`).concat(m,",").concat(m,",0,1,").concat(w?0:1,`, - `).concat(_.x,",").concat(_.y),T=fr(t.id)?MP("recharts-radial-line-"):t.id;return Te.createElement("text",_I({},r,{dominantBaseline:"central",className:Re("recharts-radial-bar-label",a)}),Te.createElement("defs",null,Te.createElement("path",{id:T,d:E})),Te.createElement("textPath",{xlinkHref:"#".concat(T)},n))},EXn=function(t){var n=t.viewBox,r=t.offset,i=t.position,o=n,s=o.cx,a=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,f=o.endAngle,d=(u+f)/2;if(i==="outside"){var h=Da(s,a,c+r,d),p=h.x,g=h.y;return{x:p,y:g,textAnchor:p>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"end"};var m=(l+c)/2,v=Da(s,a,m,d),y=v.x,b=v.y;return{x:y,y:b,textAnchor:"middle",verticalAnchor:"middle"}},TXn=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,o=t.position,s=n,a=s.x,l=s.y,c=s.width,u=s.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",g=c>=0?1:-1,m=g*i,v=g>0?"end":"start",y=g>0?"start":"end";if(o==="top"){var b={x:a+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return Es(Es({},b),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var w={x:a+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return Es(Es({},w),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var S={x:a-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return Es(Es({},S),r?{width:Math.max(S.x-r.x,0),height:u}:{})}if(o==="right"){var _={x:a+c+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return Es(Es({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:u}:{})}var E=r?{width:c,height:u}:{};return o==="insideLeft"?Es({x:a+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},E):o==="insideRight"?Es({x:a+c-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},E):o==="insideTop"?Es({x:a+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},E):o==="insideBottom"?Es({x:a+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},E):o==="insideTopLeft"?Es({x:a+m,y:l+d,textAnchor:y,verticalAnchor:p},E):o==="insideTopRight"?Es({x:a+c-m,y:l+d,textAnchor:v,verticalAnchor:p},E):o==="insideBottomLeft"?Es({x:a+m,y:l+u-d,textAnchor:y,verticalAnchor:h},E):o==="insideBottomRight"?Es({x:a+c-m,y:l+u-d,textAnchor:v,verticalAnchor:h},E):PP(o)&&(At(o.x)||S1(o.x))&&(At(o.y)||S1(o.y))?Es({x:a+Gw(o.x,c),y:l+Gw(o.y,u),textAnchor:"end",verticalAnchor:"end"},E):Es({x:a+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},E)},PXn=function(t){return"cx"in t&&At(t.cx)};function sl(e){var t=e.offset,n=t===void 0?5:t,r=yXn(e,dXn),i=Es({offset:n},r),o=i.viewBox,s=i.position,a=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||fr(a)&&fr(l)&&!M.isValidElement(c)&&!er(c))return null;if(M.isValidElement(c))return M.cloneElement(c,i);var h;if(er(c)){if(h=M.createElement(c,i),M.isValidElement(h))return h}else h=_Xn(i);var p=PXn(o),g=sr(i,!0);if(p&&(s==="insideStart"||s==="insideEnd"||s==="end"))return OXn(i,h,g);var m=p?EXn(i):TXn(i);return Te.createElement(n6,_I({className:Re("recharts-label",f)},g,m,{breakAll:d}),h)}sl.displayName="Label";var Flt=function(t){var n=t.cx,r=t.cy,i=t.angle,o=t.startAngle,s=t.endAngle,a=t.r,l=t.radius,c=t.innerRadius,u=t.outerRadius,f=t.x,d=t.y,h=t.top,p=t.left,g=t.width,m=t.height,v=t.clockWise,y=t.labelViewBox;if(y)return y;if(At(g)&&At(m)){if(At(f)&&At(d))return{x:f,y:d,width:g,height:m};if(At(h)&&At(p))return{x:h,y:p,width:g,height:m}}return At(f)&&At(d)?{x:f,y:d,width:0,height:0}:At(n)&&At(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:s||i||0,innerRadius:c||0,outerRadius:u||l||a||0,clockWise:v}:t.viewBox?t.viewBox:{}},kXn=function(t,n){return t?t===!0?Te.createElement(sl,{key:"label-implicit",viewBox:n}):Fs(t)?Te.createElement(sl,{key:"label-implicit",viewBox:n,value:t}):M.isValidElement(t)?t.type===sl?M.cloneElement(t,{key:"label-implicit",viewBox:n}):Te.createElement(sl,{key:"label-implicit",content:t,viewBox:n}):er(t)?Te.createElement(sl,{key:"label-implicit",content:t,viewBox:n}):PP(t)?Te.createElement(sl,_I({viewBox:n},t,{key:"label-implicit"})):null:null},MXn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,o=Flt(t),s=Vf(i,sl).map(function(l,c){return M.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return s;var a=kXn(t.label,n||o);return[a].concat(hXn(s))};sl.parseViewBox=Flt;sl.renderCallByParent=MXn;var CJ,R$e;function AXn(){if(R$e)return CJ;R$e=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return CJ=e,CJ}var RXn=AXn();const IXn=Vn(RXn);function CI(e){"@babel/helpers - typeof";return CI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},CI(e)}var DXn=["valueAccessor"],LXn=["data","dataKey","clockWise","id","textBreakAll"];function FXn(e){return jXn(e)||zXn(e)||NXn(e)||$Xn()}function $Xn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NXn(e,t){if(e){if(typeof e=="string")return Ise(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ise(e,t)}}function zXn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jXn(e){if(Array.isArray(e))return Ise(e)}function Ise(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WXn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var HXn=function(t){return Array.isArray(t.value)?IXn(t.value):t.value};function ov(e){var t=e.valueAccessor,n=t===void 0?HXn:t,r=L$e(e,DXn),i=r.data,o=r.dataKey,s=r.clockWise,a=r.id,l=r.textBreakAll,c=L$e(r,LXn);return!i||!i.length?null:Te.createElement(Ki,{className:"recharts-label-list"},i.map(function(u,f){var d=fr(o)?n(u,f):Zl(u&&u.payload,o),h=fr(a)?{}:{id:"".concat(a,"-").concat(f)};return Te.createElement(sl,c6({},sr(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:sl.parseViewBox(fr(s)?u:D$e(D$e({},u),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}ov.displayName="LabelList";function GXn(e,t){return e?e===!0?Te.createElement(ov,{key:"labelList-implicit",data:t}):Te.isValidElement(e)||er(e)?Te.createElement(ov,{key:"labelList-implicit",data:t,content:e}):PP(e)?Te.createElement(ov,c6({data:t},e,{key:"labelList-implicit"})):null:null}function qXn(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Vf(r,ov).map(function(s,a){return M.cloneElement(s,{data:t,key:"labelList-".concat(a)})});if(!n)return i;var o=GXn(e.label,t);return[o].concat(FXn(i))}ov.renderCallByParent=qXn;function OI(e){"@babel/helpers - typeof";return OI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},OI(e)}function Dse(){return Dse=Object.assign?Object.assign.bind():function(e){for(var t=1;t=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"end"};var m=(l+c)/2,v=Ra(s,a,m,d),y=v.x,b=v.y;return{x:y,y:b,textAnchor:"middle",verticalAnchor:"middle"}},E9n=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,o=t.position,s=n,a=s.x,l=s.y,c=s.width,u=s.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",g=c>=0?1:-1,m=g*i,v=g>0?"end":"start",y=g>0?"start":"end";if(o==="top"){var b={x:a+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return Ts(Ts({},b),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var w={x:a+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return Ts(Ts({},w),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var S={x:a-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return Ts(Ts({},S),r?{width:Math.max(S.x-r.x,0),height:u}:{})}if(o==="right"){var _={x:a+c+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return Ts(Ts({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:u}:{})}var E=r?{width:c,height:u}:{};return o==="insideLeft"?Ts({x:a+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},E):o==="insideRight"?Ts({x:a+c-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},E):o==="insideTop"?Ts({x:a+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},E):o==="insideBottom"?Ts({x:a+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},E):o==="insideTopLeft"?Ts({x:a+m,y:l+d,textAnchor:y,verticalAnchor:p},E):o==="insideTopRight"?Ts({x:a+c-m,y:l+d,textAnchor:v,verticalAnchor:p},E):o==="insideBottomLeft"?Ts({x:a+m,y:l+u-d,textAnchor:y,verticalAnchor:h},E):o==="insideBottomRight"?Ts({x:a+c-m,y:l+u-d,textAnchor:v,verticalAnchor:h},E):wP(o)&&(At(o.x)||p1(o.x))&&(At(o.y)||p1(o.y))?Ts({x:a+Nw(o.x,c),y:l+Nw(o.y,u),textAnchor:"end",verticalAnchor:"end"},E):Ts({x:a+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},E)},T9n=function(t){return"cx"in t&&At(t.cx)};function sl(e){var t=e.offset,n=t===void 0?5:t,r=v9n(e,f9n),i=Ts({offset:n},r),o=i.viewBox,s=i.position,a=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||dr(a)&&dr(l)&&!M.isValidElement(c)&&!tr(c))return null;if(M.isValidElement(c))return M.cloneElement(c,i);var h;if(tr(c)){if(h=M.createElement(c,i),M.isValidElement(h))return h}else h=S9n(i);var p=T9n(o),g=sr(i,!0);if(p&&(s==="insideStart"||s==="insideEnd"||s==="end"))return C9n(i,h,g);var m=p?O9n(i):E9n(i);return Te.createElement(I4,dI({className:Re("recharts-label",f)},g,m,{breakAll:d}),h)}sl.displayName="Label";var xst=function(t){var n=t.cx,r=t.cy,i=t.angle,o=t.startAngle,s=t.endAngle,a=t.r,l=t.radius,c=t.innerRadius,u=t.outerRadius,f=t.x,d=t.y,h=t.top,p=t.left,g=t.width,m=t.height,v=t.clockWise,y=t.labelViewBox;if(y)return y;if(At(g)&&At(m)){if(At(f)&&At(d))return{x:f,y:d,width:g,height:m};if(At(h)&&At(p))return{x:h,y:p,width:g,height:m}}return At(f)&&At(d)?{x:f,y:d,width:0,height:0}:At(n)&&At(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:s||i||0,innerRadius:c||0,outerRadius:u||l||a||0,clockWise:v}:t.viewBox?t.viewBox:{}},P9n=function(t,n){return t?t===!0?Te.createElement(sl,{key:"label-implicit",viewBox:n}):Fs(t)?Te.createElement(sl,{key:"label-implicit",viewBox:n,value:t}):M.isValidElement(t)?t.type===sl?M.cloneElement(t,{key:"label-implicit",viewBox:n}):Te.createElement(sl,{key:"label-implicit",content:t,viewBox:n}):tr(t)?Te.createElement(sl,{key:"label-implicit",content:t,viewBox:n}):wP(t)?Te.createElement(sl,dI({viewBox:n},t,{key:"label-implicit"})):null:null},k9n=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,o=xst(t),s=Uf(i,sl).map(function(l,c){return M.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return s;var a=P9n(t.label,n||o);return[a].concat(d9n(s))};sl.parseViewBox=xst;sl.renderCallByParent=k9n;var bZ,RLe;function M9n(){if(RLe)return bZ;RLe=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return bZ=e,bZ}var A9n=M9n();const R9n=Yn(A9n);function hI(e){"@babel/helpers - typeof";return hI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hI(e)}var I9n=["valueAccessor"],D9n=["data","dataKey","clockWise","id","textBreakAll"];function L9n(e){return z9n(e)||N9n(e)||$9n(e)||F9n()}function F9n(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $9n(e,t){if(e){if(typeof e=="string")return Coe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Coe(e,t)}}function N9n(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function z9n(e){if(Array.isArray(e))return Coe(e)}function Coe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function V9n(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var W9n=function(t){return Array.isArray(t.value)?R9n(t.value):t.value};function tv(e){var t=e.valueAccessor,n=t===void 0?W9n:t,r=LLe(e,I9n),i=r.data,o=r.dataKey,s=r.clockWise,a=r.id,l=r.textBreakAll,c=LLe(r,D9n);return!i||!i.length?null:Te.createElement(Zi,{className:"recharts-label-list"},i.map(function(u,f){var d=dr(o)?n(u,f):Ql(u&&u.payload,o),h=dr(a)?{}:{id:"".concat(a,"-").concat(f)};return Te.createElement(sl,j4({},sr(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:sl.parseViewBox(dr(s)?u:DLe(DLe({},u),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}tv.displayName="LabelList";function H9n(e,t){return e?e===!0?Te.createElement(tv,{key:"labelList-implicit",data:t}):Te.isValidElement(e)||tr(e)?Te.createElement(tv,{key:"labelList-implicit",data:t,content:e}):wP(e)?Te.createElement(tv,j4({data:t},e,{key:"labelList-implicit"})):null:null}function G9n(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Uf(r,tv).map(function(s,a){return M.cloneElement(s,{data:t,key:"labelList-".concat(a)})});if(!n)return i;var o=H9n(e.label,t);return[o].concat(L9n(i))}tv.renderCallByParent=G9n;function pI(e){"@babel/helpers - typeof";return pI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pI(e)}function Ooe(){return Ooe=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(s>c),`, `).concat(f.x,",").concat(f.y,` - `);if(i>0){var h=Da(n,r,i,s),p=Da(n,r,i,c);d+="L ".concat(p.x,",").concat(p.y,` + `);if(i>0){var h=Ra(n,r,i,s),p=Ra(n,r,i,c);d+="L ".concat(p.x,",").concat(p.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(s<=c),`, - `).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},ZXn=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.cornerRadius,a=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,u=t.endAngle,f=oh(u-c),d=L3({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:s,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,g=d.theta,m=L3({cx:n,cy:r,radius:o,angle:u,sign:-f,cornerRadius:s,cornerIsExternal:l}),v=m.circleTangency,y=m.lineTangency,b=m.theta,w=l?Math.abs(c-u):Math.abs(c-u)-g-b;if(w<0)return a?"M ".concat(p.x,",").concat(p.y,` + `).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},K9n=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.cornerRadius,a=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,u=t.endAngle,f=ih(u-c),d=p3({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:s,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,g=d.theta,m=p3({cx:n,cy:r,radius:o,angle:u,sign:-f,cornerRadius:s,cornerIsExternal:l}),v=m.circleTangency,y=m.lineTangency,b=m.theta,w=l?Math.abs(c-u):Math.abs(c-u)-g-b;if(w<0)return a?"M ".concat(p.x,",").concat(p.y,` a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 - `):$lt({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var S="M ".concat(p.x,",").concat(p.y,` + `):wst({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var S="M ".concat(p.x,",").concat(p.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,` A`).concat(o,",").concat(o,",0,").concat(+(w>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,` - `);if(i>0){var _=L3({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),E=_.circleTangency,T=_.lineTangency,k=_.theta,P=L3({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),R=P.circleTangency,I=P.lineTangency,F=P.theta,A=l?Math.abs(c-u):Math.abs(c-u)-k-F;if(A<0&&s===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(I.x,",").concat(I.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(R.x,",").concat(R.y,` + `);if(i>0){var _=p3({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),E=_.circleTangency,T=_.lineTangency,k=_.theta,P=p3({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),I=P.circleTangency,R=P.lineTangency,F=P.theta,A=l?Math.abs(c-u):Math.abs(c-u)-k-F;if(A<0&&s===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(R.x,",").concat(R.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,` A`).concat(i,",").concat(i,",0,").concat(+(A>180),",").concat(+(f>0),",").concat(E.x,",").concat(E.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(T.x,",").concat(T.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},JXn={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Nlt=function(t){var n=$$e($$e({},JXn),t),r=n.cx,i=n.cy,o=n.innerRadius,s=n.outerRadius,a=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(s0&&Math.abs(u-f)<360?m=ZXn({cx:r,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(g,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=$lt({cx:r,cy:i,innerRadius:o,outerRadius:s,startAngle:u,endAngle:f}),Te.createElement("path",Dse({},sr(n,!0),{className:h,d:m,role:"img"}))};function EI(e){"@babel/helpers - typeof";return EI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EI(e)}function Lse(){return Lse=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function pYn(e,t){return US(e.getTime(),t.getTime())}function gYn(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function mYn(e,t){return e===t}function H$e(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var i=new Array(r),o=e.entries(),s,a,l=0;(s=o.next())&&!s.done;){for(var c=t.entries(),u=!1,f=0;(a=c.next())&&!a.done;){if(i[f]){f++;continue}var d=s.value,h=a.value;if(n.equals(d[0],h[0],l,f,e,t,n)&&n.equals(d[1],h[1],d[0],h[0],e,t,n)){u=i[f]=!0;break}f++}if(!u)return!1;l++}return!0}var vYn=US;function yYn(e,t,n){var r=W$e(e),i=r.length;if(W$e(t).length!==i)return!1;for(;i-- >0;)if(!zlt(e,t,n,r[i]))return!1;return!0}function A2(e,t,n){var r=U$e(e),i=r.length;if(U$e(t).length!==i)return!1;for(var o,s,a;i-- >0;)if(o=r[i],!zlt(e,t,n,o)||(s=V$e(e,o),a=V$e(t,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function bYn(e,t){return US(e.valueOf(),t.valueOf())}function xYn(e,t){return e.source===t.source&&e.flags===t.flags}function G$e(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var i=new Array(r),o=e.values(),s,a;(s=o.next())&&!s.done;){for(var l=t.values(),c=!1,u=0;(a=l.next())&&!a.done;){if(!i[u]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function wYn(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function SYn(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function zlt(e,t,n,r){return(r===dYn||r===fYn||r===uYn)&&(e.$$typeof||t.$$typeof)?!0:cYn(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var _Yn="[object Arguments]",CYn="[object Boolean]",OYn="[object Date]",EYn="[object Error]",TYn="[object Map]",PYn="[object Number]",kYn="[object Object]",MYn="[object RegExp]",AYn="[object Set]",RYn="[object String]",IYn="[object URL]",DYn=Array.isArray,q$e=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,X$e=Object.assign,LYn=Object.prototype.toString.call.bind(Object.prototype.toString);function FYn(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,i=e.areFunctionsEqual,o=e.areMapsEqual,s=e.areNumbersEqual,a=e.areObjectsEqual,l=e.arePrimitiveWrappersEqual,c=e.areRegExpsEqual,u=e.areSetsEqual,f=e.areTypedArraysEqual,d=e.areUrlsEqual,h=e.unknownTagComparators;return function(g,m,v){if(g===m)return!0;if(g==null||m==null)return!1;var y=typeof g;if(y!==typeof m)return!1;if(y!=="object")return y==="number"?s(g,m,v):y==="function"?i(g,m,v):!1;var b=g.constructor;if(b!==m.constructor)return!1;if(b===Object)return a(g,m,v);if(DYn(g))return t(g,m,v);if(q$e!=null&&q$e(g))return f(g,m,v);if(b===Date)return n(g,m,v);if(b===RegExp)return c(g,m,v);if(b===Map)return o(g,m,v);if(b===Set)return u(g,m,v);var w=LYn(g);if(w===OYn)return n(g,m,v);if(w===MYn)return c(g,m,v);if(w===TYn)return o(g,m,v);if(w===AYn)return u(g,m,v);if(w===kYn)return typeof g.then!="function"&&typeof m.then!="function"&&a(g,m,v);if(w===IYn)return d(g,m,v);if(w===EYn)return r(g,m,v);if(w===_Yn)return a(g,m,v);if(w===CYn||w===PYn||w===RYn)return l(g,m,v);if(h){var S=h[w];if(!S){var _=lYn(g);_&&(S=h[_])}if(S)return S(g,m,v)}return!1}}function $Yn(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?A2:hYn,areDatesEqual:pYn,areErrorsEqual:gYn,areFunctionsEqual:mYn,areMapsEqual:r?B$e(H$e,A2):H$e,areNumbersEqual:vYn,areObjectsEqual:r?A2:yYn,arePrimitiveWrappersEqual:bYn,areRegExpsEqual:xYn,areSetsEqual:r?B$e(G$e,A2):G$e,areTypedArraysEqual:r?A2:wYn,areUrlsEqual:SYn,unknownTagComparators:void 0};if(n&&(i=X$e({},i,n(i))),t){var o=$3(i.areArraysEqual),s=$3(i.areMapsEqual),a=$3(i.areObjectsEqual),l=$3(i.areSetsEqual);i=X$e({},i,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:l})}return i}function NYn(e){return function(t,n,r,i,o,s,a){return e(t,n,a)}}function zYn(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(l,c){var u=r(),f=u.cache,d=f===void 0?t?new WeakMap:void 0:f,h=u.meta;return n(l,c,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var s={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,s)}}var jYn=Qb();Qb({strict:!0});Qb({circular:!0});Qb({circular:!0,strict:!0});Qb({createInternalComparator:function(){return US}});Qb({strict:!0,createInternalComparator:function(){return US}});Qb({circular:!0,createInternalComparator:function(){return US}});Qb({circular:!0,createInternalComparator:function(){return US},strict:!0});function Qb(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,s=o===void 0?!1:o,a=$Yn(e),l=FYn(a),c=r?r(l):NYn(l);return zYn({circular:n,comparator:l,createState:i,equals:c,strict:s})}function BYn(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Y$e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>t?(e(o),n=-1):BYn(i)};requestAnimationFrame(r)}function Fse(e){"@babel/helpers - typeof";return Fse=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fse(e)}function UYn(e){return GYn(e)||HYn(e)||WYn(e)||VYn()}function VYn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WYn(e,t){if(e){if(typeof e=="string")return Q$e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q$e(e,t)}}function Q$e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:v<0?0:v},g=function(v){for(var y=v>1?1:v,b=y,w=0;w<8;++w){var S=f(b)-y,_=h(b);if(Math.abs(S-y)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,o=i===void 0?8:i,s=t.dt,a=s===void 0?17:s,l=function(u,f,d){var h=-(u-f)*r,p=d*o,g=d+(h-p)*a/1e3,m=d*a/1e3+u;return Math.abs(m-f)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Qn(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function OJ(e){return TQn(e)||EQn(e)||OQn(e)||CQn()}function CQn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OQn(e,t){if(e){if(typeof e=="string")return Bse(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bse(e,t)}}function EQn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TQn(e){if(Array.isArray(e))return Bse(e)}function Bse(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function d6(e){return d6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},d6(e)}var dg=(function(e){RQn(n,e);var t=IQn(n);function n(r,i){var o;PQn(this,n),o=t.call(this,r,i);var s=o.props,a=s.isActive,l=s.attributeName,c=s.from,u=s.to,f=s.steps,d=s.children,h=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(Wse(o)),o.changeStyle=o.changeStyle.bind(Wse(o)),!a||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),Vse(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},Vse(o);o.state={style:l?$M({},l,c):c}}else o.state={style:{}};return o}return MQn(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,a=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(a){if(!s){var h={style:l?$M({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(jYn(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=p||c?f:i.to;if(this.state&&d){var m={style:l?$M({},l,g):g};(l&&d[l]!==g||!l&&d!==g)&&this.setState(m)}this.runAnimation(Pd(Pd({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,a=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=xQn(s,a,cQn(c),l,this.changeStyle),p=function(){o.stopJSAnimation=h()};this.manager.start([d,u,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,a=i.begin,l=i.onAnimationStart,c=s[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(g,m,v){if(v===0)return g;var y=m.duration,b=m.easing,w=b===void 0?"ease":b,S=m.style,_=m.properties,E=m.onAnimationEnd,T=v>0?s[v-1]:m,k=_||Object.keys(S);if(typeof w=="function"||w==="spring")return[].concat(OJ(g),[o.runJSAnimation.bind(o,{from:T.style,to:S,duration:y,easing:w}),y]);var P=J$e(k,y,w),R=Pd(Pd(Pd({},T.style),S),{},{transition:P});return[].concat(OJ(g),[R,y,E]).filter(KYn)};return this.manager.start([l].concat(OJ(s.reduce(h,[u,Math.max(d,a)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=qYn());var o=i.begin,s=i.duration,a=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,h=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof c=="function"||typeof h=="function"||c==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var g=a?$M({},a,l):l,m=J$e(Object.keys(g),s,c);p.start([u,o,Pd(Pd({},g),{},{transition:m}),s,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var a=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=SQn(i,wQn),c=M.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!a||c===0||s<=0)return o;var f=function(h){var p=h.props,g=p.style,m=g===void 0?{}:g,v=p.className,y=M.cloneElement(h,Pd(Pd({},l),{},{style:Pd(Pd({},m),u),className:v}));return y};return c===1?f(M.Children.only(o)):Te.createElement("div",null,M.Children.map(o,function(d){return f(d)}))}}]),n})(M.PureComponent);dg.displayName="Animate";dg.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};dg.propTypes={from:le.oneOfType([le.object,le.string]),to:le.oneOfType([le.object,le.string]),attributeName:le.string,duration:le.number,begin:le.number,easing:le.oneOfType([le.string,le.func]),steps:le.arrayOf(le.shape({duration:le.number.isRequired,style:le.object.isRequired,easing:le.oneOfType([le.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),le.func]),properties:le.arrayOf("string"),onAnimationEnd:le.func})),children:le.oneOfType([le.node,le.func]),isActive:le.bool,canBegin:le.bool,onAnimationEnd:le.func,shouldReAnimate:le.bool,onAnimationStart:le.func,onAnimationReStart:le.func};function kI(e){"@babel/helpers - typeof";return kI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kI(e)}function h6(){return h6=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(s>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;ds?s:o[d];u="M".concat(t,",").concat(n+a*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(t+l*f[0],",").concat(n)),u+="L ".concat(t+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, + A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(T.x,",").concat(T.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},Z9n={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Sst=function(t){var n=$Le($Le({},Z9n),t),r=n.cx,i=n.cy,o=n.innerRadius,s=n.outerRadius,a=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(s0&&Math.abs(u-f)<360?m=K9n({cx:r,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(g,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=wst({cx:r,cy:i,innerRadius:o,outerRadius:s,startAngle:u,endAngle:f}),Te.createElement("path",Ooe({},sr(n,!0),{className:h,d:m,role:"img"}))};function gI(e){"@babel/helpers - typeof";return gI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gI(e)}function Eoe(){return Eoe=Object.assign?Object.assign.bind():function(e){for(var t=1;ts7n.call(e,t));function DS(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const c7n="__v",u7n="__o",f7n="_owner",{getOwnPropertyDescriptor:ULe,keys:VLe}=Object;function d7n(e,t){return e.byteLength===t.byteLength&&B4(new Uint8Array(e),new Uint8Array(t))}function h7n(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function p7n(e,t){return e.byteLength===t.byteLength&&B4(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function g7n(e,t){return DS(e.getTime(),t.getTime())}function m7n(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function v7n(e,t){return e===t}function WLe(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,a,l=0;for(;(s=o.next())&&!s.done;){const c=t.entries();let u=!1,f=0;for(;(a=c.next())&&!a.done;){if(i[f]){f++;continue}const d=s.value,h=a.value;if(n.equals(d[0],h[0],l,f,e,t,n)&&n.equals(d[1],h[1],d[0],h[0],e,t,n)){u=i[f]=!0;break}f++}if(!u)return!1;l++}return!0}const y7n=DS;function b7n(e,t,n){const r=VLe(e);let i=r.length;if(VLe(t).length!==i)return!1;for(;i-- >0;)if(!_st(e,t,n,r[i]))return!1;return!0}function w2(e,t,n){const r=BLe(e);let i=r.length;if(BLe(t).length!==i)return!1;let o,s,a;for(;i-- >0;)if(o=r[i],!_st(e,t,n,o)||(s=ULe(e,o),a=ULe(t,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function x7n(e,t){return DS(e.valueOf(),t.valueOf())}function w7n(e,t){return e.source===t.source&&e.flags===t.flags}function HLe(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,a;for(;(s=o.next())&&!s.done;){const l=t.values();let c=!1,u=0;for(;(a=l.next())&&!a.done;){if(!i[u]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function B4(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function S7n(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function _st(e,t,n,r){return(r===f7n||r===u7n||r===c7n)&&(e.$$typeof||t.$$typeof)?!0:l7n(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const _7n="[object ArrayBuffer]",C7n="[object Arguments]",O7n="[object Boolean]",E7n="[object DataView]",T7n="[object Date]",P7n="[object Error]",k7n="[object Map]",M7n="[object Number]",A7n="[object Object]",R7n="[object RegExp]",I7n="[object Set]",D7n="[object String]",L7n={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},F7n="[object URL]",$7n=Object.prototype.toString;function N7n({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:f,areTypedArraysEqual:d,areUrlsEqual:h,unknownTagComparators:p}){return function(m,v,y){if(m===v)return!0;if(m==null||v==null)return!1;const b=typeof m;if(b!==typeof v)return!1;if(b!=="object")return b==="number"?a(m,v,y):b==="function"?o(m,v,y):!1;const w=m.constructor;if(w!==v.constructor)return!1;if(w===Object)return l(m,v,y);if(Array.isArray(m))return t(m,v,y);if(w===Date)return r(m,v,y);if(w===RegExp)return u(m,v,y);if(w===Map)return s(m,v,y);if(w===Set)return f(m,v,y);const S=$7n.call(m);if(S===T7n)return r(m,v,y);if(S===R7n)return u(m,v,y);if(S===k7n)return s(m,v,y);if(S===I7n)return f(m,v,y);if(S===A7n)return typeof m.then!="function"&&typeof v.then!="function"&&l(m,v,y);if(S===F7n)return h(m,v,y);if(S===P7n)return i(m,v,y);if(S===C7n)return l(m,v,y);if(L7n[S])return d(m,v,y);if(S===_7n)return e(m,v,y);if(S===E7n)return n(m,v,y);if(S===O7n||S===M7n||S===D7n)return c(m,v,y);if(p){let _=p[S];if(!_){const E=a7n(m);E&&(_=p[E])}if(_)return _(m,v,y)}return!1}}function z7n({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:d7n,areArraysEqual:n?w2:h7n,areDataViewsEqual:p7n,areDatesEqual:g7n,areErrorsEqual:m7n,areFunctionsEqual:v7n,areMapsEqual:n?xZ(WLe,w2):WLe,areNumbersEqual:y7n,areObjectsEqual:n?w2:b7n,arePrimitiveWrappersEqual:x7n,areRegExpsEqual:w7n,areSetsEqual:n?xZ(HLe,w2):HLe,areTypedArraysEqual:n?xZ(B4,w2):B4,areUrlsEqual:S7n,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=m3(r.areArraysEqual),o=m3(r.areMapsEqual),s=m3(r.areObjectsEqual),a=m3(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:a})}return r}function j7n(e){return function(t,n,r,i,o,s,a){return e(t,n,a)}}function B7n({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,l){const{cache:c=e?new WeakMap:void 0,meta:u}=n();return t(a,l,{cache:c,equals:r,meta:u,strict:i})};if(e)return function(a,l){return t(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return t(a,l,o)}}const U7n=Gb();Gb({strict:!0});Gb({circular:!0});Gb({circular:!0,strict:!0});Gb({createInternalComparator:()=>DS});Gb({strict:!0,createInternalComparator:()=>DS});Gb({circular:!0,createInternalComparator:()=>DS});Gb({circular:!0,createInternalComparator:()=>DS,strict:!0});function Gb(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=z7n(e),s=N7n(o),a=n?n(s):j7n(s);return B7n({circular:t,comparator:s,createState:r,equals:a,strict:i})}function V7n(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function GLe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>t?(e(o),n=-1):V7n(i)};requestAnimationFrame(r)}function Toe(e){"@babel/helpers - typeof";return Toe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Toe(e)}function W7n(e){return X7n(e)||q7n(e)||G7n(e)||H7n()}function H7n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G7n(e,t){if(e){if(typeof e=="string")return qLe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qLe(e,t)}}function qLe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:v<0?0:v},g=function(v){for(var y=v>1?1:v,b=y,w=0;w<8;++w){var S=f(b)-y,_=h(b);if(Math.abs(S-y)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,o=i===void 0?8:i,s=t.dt,a=s===void 0?17:s,l=function(u,f,d){var h=-(u-f)*r,p=d*o,g=d+(h-p)*a/1e3,m=d*a/1e3+u;return Math.abs(m-f)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Oqn(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function wZ(e){return kqn(e)||Pqn(e)||Tqn(e)||Eqn()}function Eqn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tqn(e,t){if(e){if(typeof e=="string")return Roe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Roe(e,t)}}function Pqn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kqn(e){if(Array.isArray(e))return Roe(e)}function Roe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function W4(e){return W4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},W4(e)}var ug=(function(e){Dqn(n,e);var t=Lqn(n);function n(r,i){var o;Mqn(this,n),o=t.call(this,r,i);var s=o.props,a=s.isActive,l=s.attributeName,c=s.from,u=s.to,f=s.steps,d=s.children,h=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(Loe(o)),o.changeStyle=o.changeStyle.bind(Loe(o)),!a||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),Doe(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},Doe(o);o.state={style:l?OM({},l,c):c}}else o.state={style:{}};return o}return Rqn(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,a=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(a){if(!s){var h={style:l?OM({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(U7n(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=p||c?f:i.to;if(this.state&&d){var m={style:l?OM({},l,g):g};(l&&d[l]!==g||!l&&d!==g)&&this.setState(m)}this.runAnimation(Ed(Ed({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,a=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=Sqn(s,a,fqn(c),l,this.changeStyle),p=function(){o.stopJSAnimation=h()};this.manager.start([d,u,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,a=i.begin,l=i.onAnimationStart,c=s[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(g,m,v){if(v===0)return g;var y=m.duration,b=m.easing,w=b===void 0?"ease":b,S=m.style,_=m.properties,E=m.onAnimationEnd,T=v>0?s[v-1]:m,k=_||Object.keys(S);if(typeof w=="function"||w==="spring")return[].concat(wZ(g),[o.runJSAnimation.bind(o,{from:T.style,to:S,duration:y,easing:w}),y]);var P=QLe(k,y,w),I=Ed(Ed(Ed({},T.style),S),{},{transition:P});return[].concat(wZ(g),[I,y,E]).filter(J7n)};return this.manager.start([l].concat(wZ(s.reduce(h,[u,Math.max(d,a)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Y7n());var o=i.begin,s=i.duration,a=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,h=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof c=="function"||typeof h=="function"||c==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var g=a?OM({},a,l):l,m=QLe(Object.keys(g),s,c);p.start([u,o,Ed(Ed({},g),{},{transition:m}),s,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var a=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Cqn(i,_qn),c=M.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!a||c===0||s<=0)return o;var f=function(h){var p=h.props,g=p.style,m=g===void 0?{}:g,v=p.className,y=M.cloneElement(h,Ed(Ed({},l),{},{style:Ed(Ed({},m),u),className:v}));return y};return c===1?f(M.Children.only(o)):Te.createElement("div",null,M.Children.map(o,function(d){return f(d)}))}}]),n})(M.PureComponent);ug.displayName="Animate";ug.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ug.propTypes={from:le.oneOfType([le.object,le.string]),to:le.oneOfType([le.object,le.string]),attributeName:le.string,duration:le.number,begin:le.number,easing:le.oneOfType([le.string,le.func]),steps:le.arrayOf(le.shape({duration:le.number.isRequired,style:le.object.isRequired,easing:le.oneOfType([le.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),le.func]),properties:le.arrayOf("string"),onAnimationEnd:le.func})),children:le.oneOfType([le.node,le.func]),isActive:le.bool,canBegin:le.bool,onAnimationEnd:le.func,shouldReAnimate:le.bool,onAnimationStart:le.func,onAnimationReStart:le.func};function yI(e){"@babel/helpers - typeof";return yI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yI(e)}function H4(){return H4=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(s>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;ds?s:o[d];u="M".concat(t,",").concat(n+a*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(t+l*f[0],",").concat(n)),u+="L ".concat(t+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, `).concat(t+r,",").concat(n+a*f[1])),u+="L ".concat(t+r,",").concat(n+i-a*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, `).concat(t+r-l*f[2],",").concat(n+i)),u+="L ".concat(t+l*f[3],",").concat(n+i),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, `).concat(t,",").concat(n+i-a*f[3])),u+="Z"}else if(s>0&&o===+o&&o>0){var p=Math.min(s,o);u="M ".concat(t,",").concat(n+a*p,` @@ -578,17 +612,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+r,",").concat(n+i-a*p,` A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(t+r-l*p,",").concat(n+i,` L `).concat(t+l*p,",").concat(n+i,` - A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(t,",").concat(n+i-a*p," Z")}else u="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},VQn=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,o=n.x,s=n.y,a=n.width,l=n.height;if(Math.abs(a)>0&&Math.abs(l)>0){var c=Math.min(o,o+a),u=Math.max(o,o+a),f=Math.min(s,s+l),d=Math.max(s,s+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},WQn={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Gve=function(t){var n=aNe(aNe({},WQn),t),r=M.useRef(),i=M.useState(-1),o=LQn(i,2),s=o[0],a=o[1];M.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&a(w)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,g=n.animationDuration,m=n.animationBegin,v=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var b=Re("recharts-rectangle",h);return y?Te.createElement(dg,{canBegin:s>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:g,animationEasing:p,isActive:y},function(w){var S=w.width,_=w.height,E=w.x,T=w.y;return Te.createElement(dg,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,isActive:v,easing:p},Te.createElement("path",h6({},sr(n,!0),{className:b,d:lNe(E,T,S,_,d),ref:r})))}):Te.createElement("path",h6({},sr(n,!0),{className:b,d:lNe(l,c,u,f,d)}))};function Hse(){return Hse=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KQn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ZQn=function(t,n,r,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},JQn=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.top,a=s===void 0?0:s,l=t.left,c=l===void 0?0:l,u=t.width,f=u===void 0?0:u,d=t.height,h=d===void 0?0:d,p=t.className,g=QQn(t,HQn),m=GQn({x:r,y:o,top:a,left:c,width:f,height:h},g);return!At(r)||!At(o)||!At(f)||!At(h)||!At(a)||!At(c)?null:Te.createElement("path",Gse({},sr(m,!0),{className:Re("recharts-cross",p),d:ZQn(r,o,f,h,a,c)}))},EJ,uNe;function eKn(){if(uNe)return EJ;uNe=1;var e=Vat(),t=e(Object.getPrototypeOf,Object);return EJ=t,EJ}var TJ,fNe;function tKn(){if(fNe)return TJ;fNe=1;var e=Uv(),t=eKn(),n=Vv(),r="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,a=o.hasOwnProperty,l=s.call(Object);function c(u){if(!n(u)||e(u)!=r)return!1;var f=t(u);if(f===null)return!0;var d=a.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&s.call(d)==l}return TJ=c,TJ}var nKn=tKn();const rKn=Vn(nKn);var PJ,dNe;function iKn(){if(dNe)return PJ;dNe=1;var e=Uv(),t=Vv(),n="[object Boolean]";function r(i){return i===!0||i===!1||t(i)&&e(i)==n}return PJ=r,PJ}var oKn=iKn();const sKn=Vn(oKn);function AI(e){"@babel/helpers - typeof";return AI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},AI(e)}function p6(){return p6=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:g,animationEasing:p,isActive:v},function(b){var w=b.upperWidth,S=b.lowerWidth,_=b.height,E=b.x,T=b.y;return Te.createElement(dg,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,easing:p},Te.createElement("path",p6({},sr(n,!0),{className:y,d:mNe(E,T,w,S,_),ref:r})))}):Te.createElement("g",null,Te.createElement("path",p6({},sr(n,!0),{className:y,d:mNe(l,c,u,f,d)})))},vKn=["option","shapeType","propTransformer","activeClassName","isActive"];function RI(e){"@babel/helpers - typeof";return RI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},RI(e)}function yKn(e,t){if(e==null)return{};var n=bKn(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bKn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vNe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function g6(e){for(var t=1;t0&&r.handleDrag(i.changedTouches[0])}),fu(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,a=i.startIndex;s?.({endIndex:o,startIndex:a})}),r.detachDragEndListener()}),fu(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),fu(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),fu(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),fu(r,"handleSlideDragStart",function(i){var o=TNe(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return qKn(t,e),VKn(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,a=this.props,l=a.gap,c=a.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=t.getIndexInRange(s,f),p=t.getIndexInRange(s,d);return{startIndex:h-h%l,endIndex:p===u?u:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,a=i.dataKey,l=Zl(o[r],a,r);return er(s)?s(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,a=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,g=r.pageX-o;g>0?g=Math.min(g,c+u-f-a,c+u-f-s):g<0&&(g=Math.max(g,c-s,c-a));var m=this.getIndex({startX:s+g,endX:a+g});(m.startIndex!==d||m.endIndex!==h)&&p&&p(m),this.setState({startX:s+g,endX:a+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=TNe(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,a=i.endX,l=i.startX,c=this.state[s],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,g=u.gap,m=u.data,v={startX:this.state.startX,endX:this.state.endX},y=r.pageX-o;y>0?y=Math.min(y,f+d-h-c):y<0&&(y=Math.max(y,f-c)),v[s]=c+y;var b=this.getIndex(v),w=b.startIndex,S=b.endIndex,_=function(){var T=m.length-1;return s==="startX"&&(a>l?w%g===0:S%g===0)||al?S%g===0:w%g===0)||a>l&&S===T};this.setState(fu(fu({},s,c+y),"brushMoveStartX",r.pageX),function(){p&&_()&&p(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,a=s.scaleValues,l=s.startX,c=s.endX,u=this.state[i],f=a.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=a.length)){var h=a[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(fu({},i,h),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.fill,c=r.stroke;return Te.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:s,height:a})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.data,c=r.children,u=r.padding,f=M.Children.only(c);return f?Te.cloneElement(f,{x:i,y:o,width:s,height:a,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,a=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,g=l.startIndex,m=l.endIndex,v=Math.max(r,this.props.x),y=IJ(IJ({},sr(this.props,!1)),{},{x:v,y:c,width:u,height:f}),b=h||"Min value: ".concat((o=p[g])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=p[m])===null||s===void 0?void 0:s.name);return Te.createElement(Ki,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),a.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(d,y))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,a=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return Te.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:s,width:f,height:a})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,a=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,d=u.endX,h=5,p={pointerEvents:"none",fill:c};return Te.createElement(Ki,{className:"recharts-brush-texts"},Te.createElement(n6,v6({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:s+a/2},p),this.getTextOfTick(i)),Te.createElement(n6,v6({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:s+a/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,a=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,g=d.isTextActive,m=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!At(a)||!At(l)||!At(c)||!At(u)||c<=0||u<=0)return null;var b=Re("recharts-brush",o),w=Te.Children.count(s)===1,S=BKn("userSelect","none");return Te.createElement(Ki,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),w&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(g||m||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,a=r.height,l=r.stroke,c=Math.floor(o+a/2)-1;return Te.createElement(Te.Fragment,null,Te.createElement("rect",{x:i,y:o,width:s,height:a,fill:l,stroke:"none"}),Te.createElement("line",{x1:i+1,y1:c,x2:i+s-1,y2:c,fill:"none",stroke:"#fff"}),Te.createElement("line",{x1:i+1,y1:c+2,x2:i+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return Te.isValidElement(r)?o=Te.cloneElement(r,i):er(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,a=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return IJ({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s},o&&o.length?YKn({data:o,width:s,x:a,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||a!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([a,a+s-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,a=o-1;a-s>1;){var l=Math.floor((s+a)/2);r[l]>i?a=l:s=l}return i>=r[a]?a:s}}])})(M.PureComponent);fu(Yw,"displayName","Brush");fu(Yw,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var DJ,PNe;function QKn(){if(PNe)return DJ;PNe=1;var e=jve();function t(n,r){var i;return e(n,function(o,s,a){return i=r(o,s,a),!i}),!!i}return DJ=t,DJ}var LJ,kNe;function KKn(){if(kNe)return LJ;kNe=1;var e=Fat(),t=Yb(),n=QKn(),r=Yc(),i=qW();function o(s,a,l){var c=r(s)?e:n;return l&&i(s,a,l)&&(a=void 0),c(s,t(a,3))}return LJ=o,LJ}var ZKn=KKn();const JKn=Vn(ZKn);var Kp=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},FJ,MNe;function eZn(){if(MNe)return FJ;MNe=1;var e=elt();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return FJ=t,FJ}var $J,ANe;function tZn(){if(ANe)return $J;ANe=1;var e=eZn(),t=Zat(),n=Yb();function r(i,o){var s={};return o=n(o,3),t(i,function(a,l,c){e(s,l,o(a,l,c))}),s}return $J=r,$J}var nZn=tZn();const rZn=Vn(nZn);var NJ,RNe;function iZn(){if(RNe)return NJ;RNe=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hZn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function pZn(e,t){var n=e.x,r=e.y,i=dZn(e,lZn),o="".concat(n),s=parseInt(o,10),a="".concat(r),l=parseInt(a,10),c="".concat(t.height||i.height),u=parseInt(c,10),f="".concat(t.width||i.width),d=parseInt(f,10);return R2(R2(R2(R2(R2({},t),i),s?{x:s}:{}),l?{y:l}:{}),{},{height:u,width:d,name:t.name,radius:t.radius})}function FNe(e){return Te.createElement(EKn,Xse({shapeType:"rectangle",propTransformer:pZn,activeClassName:"recharts-active-bar"},e))}var gZn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=At(r)||LWn(r);return o?t(r,i):(o||Xw(),n)}},mZn=["value","background"],Klt;function rT(e){"@babel/helpers - typeof";return rT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rT(e)}function vZn(e,t){if(e==null)return{};var n=yZn(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yZn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function b6(){return b6=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(L)0&&Math.abs(A)0&&(F=Math.min((Q||0)-(A[Y-1]||0),F))}),Number.isFinite(F)){var L=F/I,$=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(E=L*$/2),g.padding==="no-gap"){var j=Gw(t.barCategoryGap,L*$),V=L*$/2;E=V-j-(V-j)/$*j}}}i==="xAxis"?T=[r.left+(b.left||0)+(E||0),r.left+r.width-(b.right||0)-(E||0)]:i==="yAxis"?T=l==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(E||0),r.top+r.height-(b.bottom||0)-(E||0)]:T=g.range,S&&(T=[T[1],T[0]]);var U=Hqn(g,o,d),z=U.scale,N=U.realScaleType;z.domain(v).range(T),Gqn(z);var B=eXn(z,Vd(Vd({},g),{},{realScaleType:N}));i==="xAxis"?(R=m==="top"&&!w||m==="bottom"&&w,k=r.left,P=f[_]-R*g.height):i==="yAxis"&&(R=m==="left"&&!w||m==="right"&&w,k=f[_]-R*g.width,P=r.top);var H=Vd(Vd(Vd({},g),B),{},{realScaleType:N,x:k,y:P,scale:z,width:i==="xAxis"?r.width:g.width,height:i==="yAxis"?r.height:g.height});return H.bandSize=a6(H,B),!g.hide&&i==="xAxis"?f[_]+=(R?-1:1)*H.height:g.hide||(f[_]+=(R?-1:1)*H.width),Vd(Vd({},h),{},eH({},p,H))},{})},tct=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},kZn=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return tct({x:n,y:r},{x:i,y:o})},nct=(function(){function e(t){EZn(this,e),this.scale=t}return TZn(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(n)+a}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])})();eH(nct,"EPS",1e-4);var Xve=function(t){var n=Object.keys(t).reduce(function(r,i){return Vd(Vd({},r),{},eH({},i,nct.create(t[i])))},{});return Vd(Vd({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,a=o.position;return rZn(i,function(l,c){return n[c].apply(l,{bandAware:s,position:a})})},isInRange:function(i){return Qlt(i,function(o,s){return n[s].isInRange(o)})}})};function MZn(e){return(e%180+180)%180}var AZn=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=MZn(i),s=o*Math.PI/180,a=Math.atan(r/n),l=s>a&&s-1?l[c?o[u]:u]:void 0}}return BJ=r,BJ}var UJ,UNe;function IZn(){if(UNe)return UJ;UNe=1;var e=Glt();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return UJ=t,UJ}var VJ,VNe;function DZn(){if(VNe)return VJ;VNe=1;var e=qat(),t=Yb(),n=IZn(),r=Math.max;function i(o,s,a){var l=o==null?0:o.length;if(!l)return-1;var c=a==null?0:n(a);return c<0&&(c=r(l+c,0)),e(o,t(s,3),c)}return VJ=i,VJ}var WJ,WNe;function LZn(){if(WNe)return WJ;WNe=1;var e=RZn(),t=DZn(),n=e(t);return WJ=n,WJ}var FZn=LZn();const $Zn=Vn(FZn);var NZn=Cat();const zZn=Vn(NZn);var jZn=zZn(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Yve=M.createContext(void 0),Qve=M.createContext(void 0),rct=M.createContext(void 0),ict=M.createContext({}),oct=M.createContext(void 0),sct=M.createContext(0),act=M.createContext(0),HNe=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=t.clipPathId,a=t.children,l=t.width,c=t.height,u=jZn(o);return Te.createElement(Yve.Provider,{value:r},Te.createElement(Qve.Provider,{value:i},Te.createElement(ict.Provider,{value:o},Te.createElement(rct.Provider,{value:u},Te.createElement(oct.Provider,{value:s},Te.createElement(sct.Provider,{value:c},Te.createElement(act.Provider,{value:l},a)))))))},BZn=function(){return M.useContext(oct)},lct=function(t){var n=M.useContext(Yve);n==null&&Xw();var r=n[t];return r==null&&Xw(),r},UZn=function(){var t=M.useContext(Yve);return l0(t)},VZn=function(){var t=M.useContext(Qve),n=$Zn(t,function(r){return Qlt(r.domain,Number.isFinite)});return n||l0(t)},cct=function(t){var n=M.useContext(Qve);n==null&&Xw();var r=n[t];return r==null&&Xw(),r},WZn=function(){var t=M.useContext(rct);return t},HZn=function(){return M.useContext(ict)},Kve=function(){return M.useContext(act)},Zve=function(){return M.useContext(sct)};function iT(e){"@babel/helpers - typeof";return iT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iT(e)}function GZn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qZn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function PJn(e,t){return mct(e,t+1)}function kJn(e,t,n,r,i){for(var o=(r||[]).slice(),s=t.start,a=t.end,l=0,c=1,u=s,f=function(){var p=r?.[l];if(p===void 0)return{v:mct(r,c)};var g=l,m,v=function(){return m===void 0&&(m=n(p,g)),m},y=p.coordinate,b=l===0||C6(e,y,v,u,a);b||(l=0,u=s,c+=1),b&&(u=y+e*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function $I(e){"@babel/helpers - typeof";return $I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$I(e)}function JNe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t0?h.coordinate-m*e:h.coordinate})}else o[d]=h=el(el({},h),{},{tickCoord:h.coordinate});var v=C6(e,h.tickCoord,g,a,l);v&&(l=h.tickCoord-e*(g()/2+i),o[d]=el(el({},h),{},{isShow:!0}))},u=s-1;u>=0;u--)c(u);return o}function DJn(e,t,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=t.start,c=t.end;if(o){var u=r[a-1],f=n(u,a-1),d=e*(u.coordinate+e*f/2-c);s[a-1]=u=el(el({},u),{},{tickCoord:d>0?u.coordinate-d*e:u.coordinate});var h=C6(e,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-e*(f/2+i),s[a-1]=el(el({},u),{},{isShow:!0}))}for(var p=o?a-1:a,g=function(y){var b=s[y],w,S=function(){return w===void 0&&(w=n(b,y)),w};if(y===0){var _=e*(b.coordinate-e*S()/2-l);s[y]=b=el(el({},b),{},{tickCoord:_<0?b.coordinate-_*e:b.coordinate})}else s[y]=b=el(el({},b),{},{tickCoord:b.coordinate});var E=C6(e,b.tickCoord,S,l,c);E&&(l=b.tickCoord+e*(S()/2+i),s[y]=el(el({},b),{},{isShow:!0}))},m=0;m=2?oh(i[1].coordinate-i[0].coordinate):1,v=TJn(o,m,h);return l==="equidistantPreserveStart"?kJn(m,v,g,i,s):(l==="preserveStart"||l==="preserveStartEnd"?d=DJn(m,v,g,i,s,l==="preserveStartEnd"):d=IJn(m,v,g,i,s),d.filter(function(y){return y.isShow}))}var LJn=["viewBox"],FJn=["viewBox"],$Jn=["ticks"];function aT(e){"@babel/helpers - typeof";return aT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aT(e)}function rO(){return rO=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function NJn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function zJn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t3e(e,t){for(var n=0;n0?l(this.props):l(h)),s<=0||a<=0||!p||!p.length?null:Te.createElement(Ki,{className:Re("recharts-cartesian-axis",c),ref:function(m){r.layerReference=m}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),sl.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s,a=Re(i.className,"recharts-cartesian-axis-tick-value");return Te.isValidElement(r)?s=Te.cloneElement(r,Cs(Cs({},i),{},{className:a})):er(r)?s=r(Cs(Cs({},i),{},{className:a})):s=Te.createElement(n6,rO({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])})(M.Component);tye(FP,"displayName","CartesianAxis");tye(FP,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var GJn=["x1","y1","x2","y2","key"],qJn=["offset"];function Qw(e){"@babel/helpers - typeof";return Qw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qw(e)}function n3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function al(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KJn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ZJn=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,o=t.y,s=t.width,a=t.height,l=t.ry;return Te.createElement("rect",{x:i,y:o,ry:l,width:s,height:a,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function bct(e,t){var n;if(Te.isValidElement(e))n=Te.cloneElement(e,t);else if(er(e))n=e(t);else{var r=t.x1,i=t.y1,o=t.x2,s=t.y2,a=t.key,l=r3e(t,GJn),c=sr(l,!1);c.offset;var u=r3e(c,qJn);n=Te.createElement("line",_1({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:a}))}return n}function JJn(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var c=al(al({},e),{},{x1:t,y1:a,x2:t+n,y2:a,key:"line-".concat(l),index:l});return bct(i,c)});return Te.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function eer(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,o=e.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var c=al(al({},e),{},{x1:a,y1:t,x2:a,y2:t+n,key:"line-".concat(l),index:l});return bct(i,c)});return Te.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function ter(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,o=e.width,s=e.height,a=e.horizontalPoints,l=e.horizontal,c=l===void 0?!0:l;if(!c||!t||!t.length)return null;var u=a.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],g=p?i+s-d:u[h+1]-d;if(g<=0)return null;var m=h%t.length;return Te.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:g,width:o,stroke:"none",fill:t[m],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return Te.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function ner(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,o=e.x,s=e.y,a=e.width,l=e.height,c=e.verticalPoints;if(!n||!r||!r.length)return null;var u=c.map(function(d){return Math.round(d+o-o)}).sort(function(d,h){return d-h});o!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],g=p?o+a-d:u[h+1]-d;if(g<=0)return null;var m=h%r.length;return Te.createElement("rect",{key:"react-".concat(h),x:d,y:s,width:g,height:l,stroke:"none",fill:r[m],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return Te.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var rer=function(t,n){var r=t.xAxis,i=t.width,o=t.height,s=t.offset;return Ilt(eye(al(al(al({},FP.defaultProps),r),{},{ticks:Bm(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},ier=function(t,n){var r=t.yAxis,i=t.width,o=t.height,s=t.offset;return Ilt(eye(al(al(al({},FP.defaultProps),r),{},{ticks:Bm(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},K_={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function nye(e){var t,n,r,i,o,s,a=Kve(),l=Zve(),c=HZn(),u=al(al({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:K_.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:K_.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:K_.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:K_.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:K_.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:K_.verticalFill,x:At(e.x)?e.x:c.left,y:At(e.y)?e.y:c.top,width:At(e.width)?e.width:c.width,height:At(e.height)?e.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,g=u.syncWithTicks,m=u.horizontalValues,v=u.verticalValues,y=UZn(),b=VZn();if(!At(h)||h<=0||!At(p)||p<=0||!At(f)||f!==+f||!At(d)||d!==+d)return null;var w=u.verticalCoordinatesGenerator||rer,S=u.horizontalCoordinatesGenerator||ier,_=u.horizontalPoints,E=u.verticalPoints;if((!_||!_.length)&&er(S)){var T=m&&m.length,k=S({yAxis:b?al(al({},b),{},{ticks:T?m:b.ticks}):void 0,width:a,height:l,offset:c},T?!0:g);rv(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Qw(k),"]")),Array.isArray(k)&&(_=k)}if((!E||!E.length)&&er(w)){var P=v&&v.length,R=w({xAxis:y?al(al({},y),{},{ticks:P?v:y.ticks}):void 0,width:a,height:l,offset:c},P?!0:g);rv(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Qw(R),"]")),Array.isArray(R)&&(E=R)}return Te.createElement("g",{className:"recharts-cartesian-grid"},Te.createElement(ZJn,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height,ry:u.ry}),Te.createElement(JJn,_1({},u,{offset:c,horizontalPoints:_,xAxis:y,yAxis:b})),Te.createElement(eer,_1({},u,{offset:c,verticalPoints:E,xAxis:y,yAxis:b})),Te.createElement(ter,_1({},u,{horizontalPoints:_})),Te.createElement(ner,_1({},u,{verticalPoints:E})))}nye.displayName="CartesianGrid";var oer=["type","layout","connectNulls","ref"],ser=["key"];function lT(e){"@babel/helpers - typeof";return lT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lT(e)}function i3e(e,t){if(e==null)return{};var n=aer(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aer(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function EA(){return EA=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nf){h=[].concat(Z_(l.slice(0,p)),[f-g]);break}var m=h.length%2===0?[0,d]:[d];return[].concat(Z_(t.repeat(l,u)),Z_(h),m).map(function(v){return"".concat(v,"px")}).join(", ")}),Wd(n,"id",MP("recharts-line-")),Wd(n,"pathRef",function(s){n.mainCurve=s}),Wd(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Wd(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return ver(t,e),her(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,a=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=Vf(u,DP);if(!f)return null;var d=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Zl(g.payload,m)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Te.createElement(Ki,h,f.map(function(p){return Te.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:s,xAxis:a,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,c=a.points,u=a.dataKey,f=sr(this.props,!1),d=sr(l,!0),h=c.map(function(g,m){var v=cu(cu(cu({key:"dot-".concat(m),r:3},f),d),{},{index:m,cx:g.x,cy:g.y,value:g.value,dataKey:u,payload:g.payload,points:c});return t.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return Te.createElement(Ki,EA({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,s){var a=this.props,l=a.type,c=a.layout,u=a.connectNulls;a.ref;var f=i3e(a,oer),d=cu(cu(cu({},sr(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:l,layout:c,connectNulls:u});return Te.createElement(FO,EA({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,c=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,d=s.animationEasing,h=s.animationId,p=s.animateNewValues,g=s.width,m=s.height,v=this.state,y=v.prevPoints,b=v.totalLength;return Te.createElement(dg,{begin:u,duration:f,isActive:c,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(w){var S=w.t;if(y){var _=y.length/a.length,E=a.map(function(I,F){var A=Math.floor(F*_);if(y[A]){var L=y[A],$=Ta(L.x,I.x),j=Ta(L.y,I.y);return cu(cu({},I),{},{x:$(S),y:j(S)})}if(p){var V=Ta(g*2,I.x),U=Ta(m/2,I.y);return cu(cu({},I),{},{x:V(S),y:U(S)})}return cu(cu({},I),{},{x:I.x,y:I.y})});return o.renderCurveStatically(E,r,i)}var T=Ta(0,b),k=T(S),P;if(l){var R="".concat(l).split(/[,\s]+/gim).map(function(I){return parseFloat(I)});P=o.getStrokeDasharray(k,b,R)}else P=o.generateSimpleStrokeDasharray(b,k);return o.renderCurveStatically(a,r,i,{strokeDasharray:P})})}},{key:"renderCurve",value:function(r,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return a&&s&&s.length&&(!c&&u>0||!JE(c,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,b=Re("recharts-line",l),w=c&&c.allowDataOverflow,S=u&&u.allowDataOverflow,_=w||S,E=fr(m)?this.id:m,T=(r=sr(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=T.r,P=k===void 0?3:k,R=T.strokeWidth,I=R===void 0?2:R,F=kat(s)?s:{},A=F.clipDot,L=A===void 0?!0:A,$=P*2+I;return Te.createElement(Ki,{className:b},w||S?Te.createElement("defs",null,Te.createElement("clipPath",{id:"clipPath-".concat(E)},Te.createElement("rect",{x:w?d:d-h/2,y:S?f:f-p/2,width:w?h:h*2,height:S?p:p*2})),!L&&Te.createElement("clipPath",{id:"clipPath-dots-".concat(E)},Te.createElement("rect",{x:d-$/2,y:f-$/2,width:h+$,height:p+$}))):null,!y&&this.renderCurve(_,E),this.renderErrorBar(_,E),(y||s)&&this.renderDots(_,L,E),(!g||v)&&ov.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(Z_(r),[0]):r,s=[],a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wer(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function C1(){return C1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!JE(u,s)||!JE(f,a))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,b=Re("recharts-area",l),w=f&&f.allowDataOverflow,S=d&&d.allowDataOverflow,_=w||S,E=fr(m)?this.id:m,T=(r=sr(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=T.r,P=k===void 0?3:k,R=T.strokeWidth,I=R===void 0?2:R,F=kat(s)?s:{},A=F.clipDot,L=A===void 0?!0:A,$=P*2+I;return Te.createElement(Ki,{className:b},w||S?Te.createElement("defs",null,Te.createElement("clipPath",{id:"clipPath-".concat(E)},Te.createElement("rect",{x:w?u:u-h/2,y:S?c:c-p/2,width:w?h:h*2,height:S?p:p*2})),!L&&Te.createElement("clipPath",{id:"clipPath-dots-".concat(E)},Te.createElement("rect",{x:u-$/2,y:c-$/2,width:h+$,height:p+$}))):null,y?null:this.renderArea(_,E),(s||y)&&this.renderDots(_,L,E),(!g||v)&&ov.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])})(M.PureComponent);Sct=Kb;Ip(Kb,"displayName","Area");Ip(Kb,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!BS.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ip(Kb,"getBaseValue",function(e,t,n,r){var i=e.layout,o=e.baseValue,s=t.props.baseValue,a=s??o;if(At(a)&&typeof a=="number")return a;var l=i==="horizontal"?r:n,c=l.scale.domain();if(l.type==="number"){var u=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]});Ip(Kb,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,o=e.xAxisTicks,s=e.yAxisTicks,a=e.bandSize,l=e.dataKey,c=e.stackedData,u=e.dataStartIndex,f=e.displayedData,d=e.offset,h=t.layout,p=c&&c.length,g=Sct.getBaseValue(t,n,r,i),m=h==="horizontal",v=!1,y=f.map(function(w,S){var _;p?_=c[u+S]:(_=Zl(w,l),Array.isArray(_)?v=!0:_=[g,_]);var E=_[1]==null||p&&Zl(w,l)==null;return m?{x:s6({axis:r,ticks:o,bandSize:a,entry:w,index:S}),y:E?null:i.scale(_[1]),value:_,payload:w}:{x:E?null:r.scale(_[1]),y:s6({axis:i,ticks:s,bandSize:a,entry:w,index:S}),value:_,payload:w}}),b;return p||v?b=y.map(function(w){var S=Array.isArray(w.value)?w.value[0]:null;return m?{x:w.x,y:S!=null&&w.y!=null?i.scale(S):null}:{x:S!=null?r.scale(S):null,y:w.y}}):b=m?i.scale(g):r.scale(g),zy({points:y,baseLine:b,layout:h,isRange:v},d)});Ip(Kb,"renderDotItem",function(e,t){var n;if(Te.isValidElement(e))n=Te.cloneElement(e,t);else if(er(e))n=e(t);else{var r=Re("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,o=_ct(t,xer);n=Te.createElement(KW,C1({},o,{key:i,className:r}))}return n});function uT(e){"@babel/helpers - typeof";return uT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uT(e)}function ker(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mer(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vtr(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ytr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function btr(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?s:t&&t.length&&At(i)&&At(o)?t.slice(i,o+1):[]};function Nct(e){return e==="number"?[0,"auto"]:void 0}var pae=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,a=iH(n,t);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var d;if(s.dataKey&&!s.allowDuplicatedCategory){var h=f===void 0?a:f;d=X4(h,s.dataKey,i)}else d=f&&f[r]||a[r];return d?[].concat(hT(l),[Llt(c,d)]):l},[])},g3e=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=Atr(o,r),a=t.orderedTooltipTicks,l=t.tooltipAxis,c=t.tooltipTicks,u=zqn(s,a,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=pae(t,n,u,f),h=Rtr(r,a,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},Itr=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.layout,f=t.children,d=t.stackOffset,h=Rlt(u,o);return r.reduce(function(p,g){var m,v=g.type.defaultProps!==void 0?rt(rt({},g.type.defaultProps),g.props):g.props,y=v.type,b=v.dataKey,w=v.allowDataOverflow,S=v.allowDuplicatedCategory,_=v.scale,E=v.ticks,T=v.includeHidden,k=v[s];if(p[k])return p;var P=iH(t.data,{graphicalItems:i.filter(function(B){var H,Q=s in B.props?B.props[s]:(H=B.type.defaultProps)===null||H===void 0?void 0:H[s];return Q===k}),dataStartIndex:l,dataEndIndex:c}),R=P.length,I,F,A;otr(v.domain,w,y)&&(I=Ase(v.domain,null,w),h&&(y==="number"||_!=="auto")&&(A=CA(P,b,"category")));var L=Nct(y);if(!I||I.length===0){var $,j=($=v.domain)!==null&&$!==void 0?$:L;if(b){if(I=CA(P,b,y),y==="category"&&h){var V=$Wn(I);S&&V?(F=I,I=m6(0,R)):S||(I=T$e(j,I,g).reduce(function(B,H){return B.indexOf(H)>=0?B:[].concat(hT(B),[H])},[]))}else if(y==="category")S?I=I.filter(function(B){return B!==""&&!fr(B)}):I=T$e(j,I,g).reduce(function(B,H){return B.indexOf(H)>=0||H===""||fr(H)?B:[].concat(hT(B),[H])},[]);else if(y==="number"){var U=Wqn(P,i.filter(function(B){var H,Q,Y=s in B.props?B.props[s]:(H=B.type.defaultProps)===null||H===void 0?void 0:H[s],Z="hide"in B.props?B.props.hide:(Q=B.type.defaultProps)===null||Q===void 0?void 0:Q.hide;return Y===k&&(T||!Z)}),b,o,u);U&&(I=U)}h&&(y==="number"||_!=="auto")&&(A=CA(P,b,"category"))}else h?I=m6(0,R):a&&a[k]&&a[k].hasStack&&y==="number"?I=d==="expand"?[0,1]:Dlt(a[k].stackGroups,l,c):I=Alt(P,i.filter(function(B){var H=s in B.props?B.props[s]:B.type.defaultProps[s],Q="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return H===k&&(T||!Q)}),y,u,!0);if(y==="number")I=fae(f,I,k,o,E),j&&(I=Ase(j,I,w));else if(y==="category"&&j){var z=j,N=I.every(function(B){return z.indexOf(B)>=0});N&&(I=z)}}return rt(rt({},p),{},Ln({},k,rt(rt({},v),{},{axisType:o,domain:I,categoricalDomain:A,duplicateDomain:F,originalDomain:(m=v.domain)!==null&&m!==void 0?m:L,isCategorical:h,layout:u})))},{})},Dtr=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.layout,f=t.children,d=iH(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=Rlt(u,o),g=-1;return r.reduce(function(m,v){var y=v.type.defaultProps!==void 0?rt(rt({},v.type.defaultProps),v.props):v.props,b=y[s],w=Nct("number");if(!m[b]){g++;var S;return p?S=m6(0,h):a&&a[b]&&a[b].hasStack?(S=Dlt(a[b].stackGroups,l,c),S=fae(f,S,b,o)):(S=Ase(w,Alt(d,r.filter(function(_){var E,T,k=s in _.props?_.props[s]:(E=_.type.defaultProps)===null||E===void 0?void 0:E[s],P="hide"in _.props?_.props.hide:(T=_.type.defaultProps)===null||T===void 0?void 0:T.hide;return k===b&&!P}),"number",u),i.defaultProps.allowDataOverflow),S=fae(f,S,b,o)),rt(rt({},m),{},Ln({},b,rt(rt({axisType:o},i.defaultProps),{},{hide:!0,orientation:Uf(ktr,"".concat(o,".").concat(g%2),null),domain:S,originalDomain:w,isCategorical:p,layout:u})))}return m},{})},Ltr=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.children,f="".concat(i,"Id"),d=Vf(u,o),h={};return d&&d.length?h=Itr(t,{axes:d,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(h=Dtr(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c})),h},Ftr=function(t){var n=l0(t),r=Bm(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Bve(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:a6(n,r)}},m3e=function(t){var n=t.children,r=t.defaultShowTooltip,i=mu(n,Yw),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},$tr=function(t){return!t||!t.length?!1:t.some(function(n){var r=nv(n&&n.type);return r&&r.indexOf("Bar")>=0})},v3e=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Ntr=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,a=t.yAxisMap,l=a===void 0?{}:a,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=mu(f,Yw),p=mu(f,K1),g=Object.keys(l).reduce(function(S,_){var E=l[_],T=E.orientation;return!E.mirror&&!E.hide?rt(rt({},S),{},Ln({},T,S[T]+E.width)):S},{left:d.left||0,right:d.right||0}),m=Object.keys(s).reduce(function(S,_){var E=s[_],T=E.orientation;return!E.mirror&&!E.hide?rt(rt({},S),{},Ln({},T,Uf(S,"".concat(T))+E.height)):S},{top:d.top||0,bottom:d.bottom||0}),v=rt(rt({},m),g),y=v.bottom;h&&(v.bottom+=h.props.height||Yw.defaultProps.height),p&&n&&(v=Uqn(v,i,r,n));var b=c-v.left-v.right,w=u-v.top-v.bottom;return rt(rt({brushBottom:y},v),{},{width:Math.max(b,0),height:Math.max(w,0)})},ztr=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},rye=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,a=s===void 0?["axis"]:s,l=t.axisComponents,c=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,d=function(v,y){var b=y.graphicalItems,w=y.stackGroups,S=y.offset,_=y.updateId,E=y.dataStartIndex,T=y.dataEndIndex,k=v.barSize,P=v.layout,R=v.barGap,I=v.barCategoryGap,F=v.maxBarSize,A=v3e(P),L=A.numericAxisName,$=A.cateAxisName,j=$tr(b),V=[];return b.forEach(function(U,z){var N=iH(v.data,{graphicalItems:[U],dataStartIndex:E,dataEndIndex:T}),B=U.type.defaultProps!==void 0?rt(rt({},U.type.defaultProps),U.props):U.props,H=B.dataKey,Q=B.maxBarSize,Y=B["".concat(L,"Id")],Z=B["".concat($,"Id")],pe={},ie=l.reduce(function(Pe,ee){var oe=y["".concat(ee.axisType,"Map")],Se=B["".concat(ee.axisType,"Id")];oe&&oe[Se]||ee.axisType==="zAxis"||Xw();var ye=oe[Se];return rt(rt({},Pe),{},Ln(Ln({},ee.axisType,ye),"".concat(ee.axisType,"Ticks"),Bm(ye)))},pe),ne=ie[$],fe=ie["".concat($,"Ticks")],me=w&&w[Y]&&w[Y].hasStack&&nXn(U,w[Y].stackGroups),se=nv(U.type).indexOf("Bar")>=0,ue=a6(ne,fe),G=[],ce=j&&jqn({barSize:k,stackGroups:w,totalSize:ztr(ie,$)});if(se){var he,J,te=fr(Q)?F:Q,ae=(he=(J=a6(ne,fe,!0))!==null&&J!==void 0?J:te)!==null&&he!==void 0?he:0;G=Bqn({barGap:R,barCategoryGap:I,bandSize:ae!==ue?ae:ue,sizeList:ce[Z],maxBarSize:te}),ae!==ue&&(G=G.map(function(Pe){return rt(rt({},Pe),{},{position:rt(rt({},Pe.position),{},{offset:Pe.position.offset-ae/2})})}))}var we=U&&U.type&&U.type.getComposedData;we&&V.push({props:rt(rt({},we(rt(rt({},ie),{},{displayedData:N,props:v,dataKey:H,item:U,bandSize:ue,barPosition:G,offset:S,stackedData:me,layout:P,dataStartIndex:E,dataEndIndex:T}))),{},Ln(Ln(Ln({key:U.key||"item-".concat(z)},L,ie[L]),$,ie[$]),"animationId",_)),childIndex:YWn(U,v.children),item:U})}),V},h=function(v,y){var b=v.props,w=v.dataStartIndex,S=v.dataEndIndex,_=v.updateId;if(!kDe({props:b}))return null;var E=b.children,T=b.layout,k=b.stackOffset,P=b.data,R=b.reverseStackOrder,I=v3e(T),F=I.numericAxisName,A=I.cateAxisName,L=Vf(E,r),$=Jqn(P,L,"".concat(F,"Id"),"".concat(A,"Id"),k,R),j=l.reduce(function(B,H){var Q="".concat(H.axisType,"Map");return rt(rt({},B),{},Ln({},Q,Ltr(b,rt(rt({},H),{},{graphicalItems:L,stackGroups:H.axisType===F&&$,dataStartIndex:w,dataEndIndex:S}))))},{}),V=Ntr(rt(rt({},j),{},{props:b,graphicalItems:L}),y?.legendBBox);Object.keys(j).forEach(function(B){j[B]=u(b,j[B],V,B.replace("Map",""),n)});var U=j["".concat(A,"Map")],z=Ftr(U),N=d(b,rt(rt({},j),{},{dataStartIndex:w,dataEndIndex:S,updateId:_,graphicalItems:L,stackGroups:$,offset:V}));return rt(rt({formattedGraphicalItems:N,graphicalItems:L,offset:V,stackGroups:$},z),j)},p=(function(m){function v(y){var b,w,S;return ytr(this,v),S=wtr(this,v,[y]),Ln(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ln(S,"accessibilityManager",new itr),Ln(S,"handleLegendBBoxUpdate",function(_){if(_){var E=S.state,T=E.dataStartIndex,k=E.dataEndIndex,P=E.updateId;S.setState(rt({legendBBox:_},h({props:S.props,dataStartIndex:T,dataEndIndex:k,updateId:P},rt(rt({},S.state),{},{legendBBox:_}))))}}),Ln(S,"handleReceiveSyncEvent",function(_,E,T){if(S.props.syncId===_){if(T===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(E)}}),Ln(S,"handleBrushChange",function(_){var E=_.startIndex,T=_.endIndex;if(E!==S.state.dataStartIndex||T!==S.state.dataEndIndex){var k=S.state.updateId;S.setState(function(){return rt({dataStartIndex:E,dataEndIndex:T},h({props:S.props,dataStartIndex:E,dataEndIndex:T,updateId:k},S.state))}),S.triggerSyncEvent({dataStartIndex:E,dataEndIndex:T})}}),Ln(S,"handleMouseEnter",function(_){var E=S.getMouseInfo(_);if(E){var T=rt(rt({},E),{},{isTooltipActive:!0});S.setState(T),S.triggerSyncEvent(T);var k=S.props.onMouseEnter;er(k)&&k(T,_)}}),Ln(S,"triggeredAfterMouseMove",function(_){var E=S.getMouseInfo(_),T=E?rt(rt({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(T),S.triggerSyncEvent(T);var k=S.props.onMouseMove;er(k)&&k(T,_)}),Ln(S,"handleItemMouseEnter",function(_){S.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Ln(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Ln(S,"handleMouseMove",function(_){_.persist(),S.throttleTriggeredAfterMouseMove(_)}),Ln(S,"handleMouseLeave",function(_){S.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};S.setState(E),S.triggerSyncEvent(E);var T=S.props.onMouseLeave;er(T)&&T(E,_)}),Ln(S,"handleOuterEvent",function(_){var E=XWn(_),T=Uf(S.props,"".concat(E));if(E&&er(T)){var k,P;/.*touch.*/i.test(E)?P=S.getMouseInfo(_.changedTouches[0]):P=S.getMouseInfo(_),T((k=P)!==null&&k!==void 0?k:{},_)}}),Ln(S,"handleClick",function(_){var E=S.getMouseInfo(_);if(E){var T=rt(rt({},E),{},{isTooltipActive:!0});S.setState(T),S.triggerSyncEvent(T);var k=S.props.onClick;er(k)&&k(T,_)}}),Ln(S,"handleMouseDown",function(_){var E=S.props.onMouseDown;if(er(E)){var T=S.getMouseInfo(_);E(T,_)}}),Ln(S,"handleMouseUp",function(_){var E=S.props.onMouseUp;if(er(E)){var T=S.getMouseInfo(_);E(T,_)}}),Ln(S,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Ln(S,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.handleMouseDown(_.changedTouches[0])}),Ln(S,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.handleMouseUp(_.changedTouches[0])}),Ln(S,"handleDoubleClick",function(_){var E=S.props.onDoubleClick;if(er(E)){var T=S.getMouseInfo(_);E(T,_)}}),Ln(S,"handleContextMenu",function(_){var E=S.props.onContextMenu;if(er(E)){var T=S.getMouseInfo(_);E(T,_)}}),Ln(S,"triggerSyncEvent",function(_){S.props.syncId!==void 0&&qJ.emit(XJ,S.props.syncId,_,S.eventEmitterSymbol)}),Ln(S,"applySyncEvent",function(_){var E=S.props,T=E.layout,k=E.syncMethod,P=S.state.updateId,R=_.dataStartIndex,I=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)S.setState(rt({dataStartIndex:R,dataEndIndex:I},h({props:S.props,dataStartIndex:R,dataEndIndex:I,updateId:P},S.state)));else if(_.activeTooltipIndex!==void 0){var F=_.chartX,A=_.chartY,L=_.activeTooltipIndex,$=S.state,j=$.offset,V=$.tooltipTicks;if(!j)return;if(typeof k=="function")L=k(V,_);else if(k==="value"){L=-1;for(var U=0;U=0){var me,se;if(F.dataKey&&!F.allowDuplicatedCategory){var ue=typeof F.dataKey=="function"?fe:"payload.".concat(F.dataKey.toString());me=X4(U,ue,L),se=z&&N&&X4(N,ue,L)}else me=U?.[A],se=z&&N&&N[A];if(Z||Y){var G=_.props.activeIndex!==void 0?_.props.activeIndex:A;return[M.cloneElement(_,rt(rt(rt({},k.props),ie),{},{activeIndex:G})),null,null]}if(!fr(me))return[ne].concat(hT(S.renderActivePoints({item:k,activePoint:me,basePoint:se,childIndex:A,isRange:z})))}else{var ce,he=(ce=S.getItemByXY(S.state.activeCoordinate))!==null&&ce!==void 0?ce:{graphicalItem:ne},J=he.graphicalItem,te=J.item,ae=te===void 0?_:te,we=J.childIndex,Pe=rt(rt(rt({},k.props),ie),{},{activeIndex:we});return[M.cloneElement(ae,Pe),null,null]}return z?[ne,null,null]:[ne,null]}),Ln(S,"renderCustomized",function(_,E,T){return M.cloneElement(_,rt(rt({key:"recharts-customized-".concat(T)},S.props),S.state))}),Ln(S,"renderMap",{CartesianGrid:{handler:z3,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:z3},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:z3},YAxis:{handler:z3},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((b=y.id)!==null&&b!==void 0?b:MP("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=slt(S.triggeredAfterMouseMove,(w=y.throttleDelay)!==null&&w!==void 0?w:1e3/60),S.state={},S}return Ctr(v,m),xtr(v,[{key:"componentDidMount",value:function(){var b,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,w=b.children,S=b.data,_=b.height,E=b.layout,T=mu(w,sp);if(T){var k=T.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var P=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,R=pae(this.state,S,k,P),I=this.state.tooltipTicks[k].coordinate,F=(this.state.offset.top+_)/2,A=E==="horizontal",L=A?{x:I,y:F}:{y:I,x:F},$=this.state.formattedGraphicalItems.find(function(V){var U=V.item;return U.type.name==="Scatter"});$&&(L=rt(rt({},L),$.props.points[k].tooltipPosition),R=$.props.points[k].tooltipPayload);var j={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:P,activePayload:R,activeCoordinate:L};this.setState(j),this.renderCursor(T),this.accessibilityManager.setIndex(k)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var S,_;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(b){use([mu(b.children,sp)],[mu(this.props.children,sp)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=mu(this.props.children,sp);if(b&&typeof b.props.shared=="boolean"){var w=b.props.shared?"axis":"item";return a.indexOf(w)>=0?w:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var w=this.container,S=w.getBoundingClientRect(),_=n7n(S),E={chartX:Math.round(b.pageX-_.left),chartY:Math.round(b.pageY-_.top)},T=S.width/w.offsetWidth||1,k=this.inRange(E.chartX,E.chartY,T);if(!k)return null;var P=this.state,R=P.xAxisMap,I=P.yAxisMap,F=this.getTooltipEventType(),A=g3e(this.state,this.props.data,this.props.layout,k);if(F!=="axis"&&R&&I){var L=l0(R).scale,$=l0(I).scale,j=L&&L.invert?L.invert(E.chartX):null,V=$&&$.invert?$.invert(E.chartY):null;return rt(rt({},E),{},{xValue:j,yValue:V},A)}return A?rt(rt({},E),A):null}},{key:"inRange",value:function(b,w){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,E=b/S,T=w/S;if(_==="horizontal"||_==="vertical"){var k=this.state.offset,P=E>=k.left&&E<=k.left+k.width&&T>=k.top&&T<=k.top+k.height;return P?{x:E,y:T}:null}var R=this.state,I=R.angleAxisMap,F=R.radiusAxisMap;if(I&&F){var A=l0(I);return M$e({x:E,y:T},A)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,w=this.getTooltipEventType(),S=mu(b,sp),_={};S&&w==="axis"&&(S.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var E=Y4(this.props,this.handleOuterEvent);return rt(rt({},E),_)}},{key:"addListener",value:function(){qJ.on(XJ,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){qJ.removeListener(XJ,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,w,S){for(var _=this.state.formattedGraphicalItems,E=0,T=_.length;E!Lr(e)||!Number.isFinite(e)?"":WA(e),Wtr=e=>e.toPrecision(3),QJ={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function Htr({payload:e,removeTimeSeries:t,datasetTitle:n}){return!e||e.length===0||!n?null:O.jsx(bt,{sx:QJ.legendContainer,children:e.map((r,i)=>O.jsxs(bt,{sx:{...QJ.legendItem,color:r.color},children:[O.jsxs("span",{children:[n,":",r.value]}),t&&O.jsx(bt,{component:"span",sx:QJ.legendCloseIcon,onMouseUp:()=>t(i),children:O.jsx(dW,{fontSize:"small"})})]},r.value))})}const KJ={toolTipContainer:e=>({backgroundColor:"black",opacity:.8,color:"white",border:"2px solid black",borderRadius:e.spacing(2),padding:e.spacing(1.5)}),toolTipValue:{fontWeight:"bold"},toolTipLabel:e=>({fontWeight:"bold",paddingBottom:e.spacing(1)})},Gtr="#00000000",qtr="#FAFFDD";function Xtr({active:e,label:t,payload:n}){if(!e||!Lr(t)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:s,value:a,unit:l,dataKey:c}=i;let u=i.color;if(!Lr(a))return null;const f=s||"?",d=a.toFixed(3);u===Gtr&&(u=qtr);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),O.jsxs("div",{children:[O.jsxs("span",{children:[f,": "]}),O.jsx(bt,{component:"span",sx:KJ.toolTipValue,style:{color:u},children:d}),O.jsxs("span",{children:[" ",p]})]},o)});return r?O.jsxs(bt,{sx:KJ.toolTipContainer,children:[O.jsx(bt,{component:"span",sx:KJ.toolTipLabel,children:`${ET(t)} UTC`}),r]}):null}function y3e({cx:e,cy:t,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:s}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(s==="diamond"){const g=1024*(n/c);f=O.jsx("polygon",{points:`${512-g},512 512,${512-g} ${512+g},512 512,${512+g}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=O.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return Lr(e)&&Lr(t)?O.jsx("svg",{x:e-l,y:t-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function Ytr({timeSeriesGroup:e,timeSeriesIndex:t,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:s,paletteMode:a,chartType:l,stdevBars:c}){const u=e.timeSeriesArray[t],f=u.source,d=()=>{n&&n(e.id,t,u),i(u.source.placeId,r,!0)};let h=f.variableName,p="red";if(f.placeId===null){h=`${f.datasetTitle}/${h}`;let b=null;s.forEach(w=>{if(b===null&&w.placeGroup.id===f.datasetId){const S=w.placeGroup.features;S.length>0&&S[0].properties&&(b=S[0].properties.color||null)}}),p=b||"red"}else if(o){const b=o[f.placeId];if(b){const{place:w,label:S,color:_}=b;if(w.geometry.type==="Point"){const E=w.geometry.coordinates[0],T=w.geometry.coordinates[1];h+=` (${S}: ${T.toFixed(5)},${E.toFixed(5)})`}else h+=` (${S})`;p=_}}const g=wBe(p,a);let m,v;u.source.placeId===null?(m=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(m=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&O.jsx(DP,{dataKey:`ev${t}`,width:4,strokeWidth:1,stroke:g,strokeOpacity:.5});return l==="bar"?O.jsx(VS,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${t}`,fill:g,fillOpacity:m,isAnimationActive:!1,onClick:d,children:y},t):O.jsx(oF,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${t}`,dot:O.jsx(y3e,{...v,stroke:g,fill:"white"}),activeDot:O.jsx(y3e,{...v,stroke:"white",fill:g}),stroke:g,strokeOpacity:m,isAnimationActive:!1,onClick:d,children:y},t)}const Qtr=ot(O.jsx("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatio"),Ktr=ot(O.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart"),Ztr=ot(O.jsx("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Comment"),Jtr=ot(O.jsx("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand"),enr=ot(O.jsx("path",{d:"M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zM18 8H6v8h12z"}),"FitScreen"),zct=ot(O.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M5.5 7.5h2v-2H9v2h2V9H9v2H7.5V9h-2zM19 19H5L19 5zm-2-2v-1.5h-5V17z"}),"Iso"),tnr=ot([O.jsx("circle",{cx:"7",cy:"14",r:"3"},"0"),O.jsx("circle",{cx:"11",cy:"6",r:"3"},"1"),O.jsx("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot"),nnr=ot(O.jsx("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart"),jct=({children:e,initialOpacity:t,sx:n,...r})=>O.jsx(bt,{id:"data-hover-invisible-box",...r,sx:{...n,"&:hover > *":{opacity:1,visibility:"visible"},"& > *":{opacity:t||0,visibility:t?void 0:"hidden",transition:"opacity 0.5s ease, visibility 0.5s ease"}},children:e});function Bct({elementRef:e,postMessage:t,exportResolution:n,hiddenElementItems:r=[]}){const o={postMessage:t,exportResolution:n,hiddenElements:a=>Wet(a,r)},{onSnapshotClick:s}=iit(e,o);return O.jsx(Wl,{tooltipText:Ce.get("Copy snapshot to clipboard"),onClick:s,icon:O.jsx(Xrt,{fontSize:"inherit"})})}function rnr({sx:e,timeSeriesGroupId:t,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=Te.useState(null),s=f=>{o(f.currentTarget)},a=()=>{o(null)},l=f=>{o(null),r(t,f)},c=[];n.forEach(f=>{Object.getOwnPropertyNames(f.timeSeries).forEach(d=>{const h=`${f.placeGroup.title} / ${d}`;c.push(O.jsx(tr,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return O.jsxs(O.Fragment,{children:[O.jsx(Mn,{size:"small",sx:e,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:s,disabled:c.length===0,children:O.jsx(_n,{arrow:!0,title:Ce.get("Add time-series from places"),children:O.jsx(SW,{fontSize:"inherit"})})}),O.jsx(iS,{id:"basic-menu",anchorEl:i,open:u,onClose:a,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const j3={container:e=>({padding:e.spacing(1),display:"flex",flexDirection:"column",gap:e.spacing(1)}),minMaxBox:e=>({display:"flex",justifyContent:"center",gap:e.spacing(1)}),minTextField:{maxWidth:"8em"},maxTextField:{maxWidth:"8em"}};function inr({anchorEl:e,valueRange:t,setValueRange:n}){const[r,i]=M.useState(t?[t[0]+"",t[1]+""]:["0","1"]);if(!e)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],s=Number.isFinite(o[0])&&Number.isFinite(o[1])&&o[0]{const d=f.target.value;i([d,r[1]])},l=f=>{const d=f.target.value;i([r[0],d])},c=()=>{n(o)},u=()=>{n(void 0)};return O.jsx(rS,{anchorEl:e,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:O.jsxs(bt,{sx:j3.container,children:[O.jsxs(bt,{component:"form",sx:j3.minMaxBox,children:[O.jsx(Ri,{sx:j3.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!s,onChange:f=>a(f)}),O.jsx(Ri,{sx:j3.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!s,onChange:f=>l(f)})]}),O.jsx(_W,{onDone:c,doneDisabled:!s,onCancel:u,size:"medium"})]})})}const B3="stddev",Sy={headerContainer:{display:"flex",flexDirection:"row",justifyContent:"right"},actionsContainer:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",gap:"1px"},responsiveContainer:{flexGrow:"1px"},actionButton:{zIndex:1e3,opacity:.8},chartTitle:{fontSize:"inherit",fontWeight:"normal"},chartTypes:e=>({paddingLeft:e.spacing(1),paddingRight:e.spacing(1)})};function onr({timeSeriesGroup:e,placeGroupTimeSeries:t,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:s,zoomMode:a,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:g,valueRange:m,setValueRange:v,chartElement:y,postMessage:b,exportResolution:w}){const S=M.useRef(null),[_,E]=M.useState(!1),T=()=>{E(!_)},k=R=>{E(!1),R&&v(R)},P=(R,I)=>{const F=new Set(I),A=F.has(B3);F.delete(B3),F.delete(f),I=Array.from(F),d(I.length===1?I[0]:f),g(A)};return O.jsx(bt,{sx:Sy.headerContainer,children:O.jsxs(bt,{sx:Sy.actionsContainer,children:[O.jsxs(jct,{sx:Sy.actionsContainer,initialOpacity:.05,children:[s&&O.jsx(_n,{arrow:!0,title:Ce.get("Zoom to full range"),children:O.jsx(Mn,{sx:Sy.actionButton,onClick:i,size:"small",children:O.jsx(enr,{fontSize:"inherit"})},"zoomOutButton")}),O.jsx(_n,{arrow:!0,title:Ce.get("Toggle zoom mode (or press CTRL key)"),children:O.jsx(oo,{value:"zoomMode",selected:a,onClick:()=>l(!a),size:"small",children:O.jsx(Qtr,{fontSize:"inherit"})})}),O.jsx(inr,{anchorEl:_?S.current:null,valueRange:m,setValueRange:k}),O.jsx(_n,{arrow:!0,title:Ce.get("Enter fixed y-range"),children:O.jsx(oo,{ref:S,value:"valueRange",selected:_,onClick:T,size:"small",children:O.jsx(Jtr,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Toggle showing info popup on hover"),children:O.jsx(oo,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:O.jsx(Ztr,{fontSize:"inherit"})})}),O.jsxs(rD,{value:p?[f,B3]:[f],onChange:P,size:"small",sx:Sy.chartTypes,children:[O.jsx(_n,{arrow:!0,title:Ce.get("Show points"),children:O.jsx(oo,{value:"point",size:"small",children:O.jsx(tnr,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Show lines"),children:O.jsx(oo,{value:"line",size:"small",children:O.jsx(nnr,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Show bars"),children:O.jsx(oo,{value:"bar",size:"small",children:O.jsx(Ktr,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Show standard deviation (if any)"),children:O.jsx(oo,{value:B3,size:"small",disabled:h,children:O.jsx(zct,{fontSize:"inherit"})})})]}),O.jsx(Bct,{elementRef:y,postMessage:b,exportResolution:w}),O.jsx(rnr,{sx:Sy.actionButton,timeSeriesGroupId:e.id,placeGroupTimeSeries:t,addPlaceGroupTimeSeries:n})]}),o?O.jsx(Eh,{size:24,sx:Sy.actionButton,color:"secondary"}):O.jsx(Mn,{sx:Sy.actionButton,"aria-label":"Close",onClick:()=>r(e.id),size:"small",children:O.jsx(yP,{fontSize:"inherit"})})]})})}const snr=Qn("div")(({theme:e})=>({userSelect:"none",marginTop:e.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),anr={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function lnr({timeSeriesGroup:e,selectTimeSeries:t,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:s,selectPlace:a,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,postMessage:m,selectedDatasetTitle:v,exportResolution:y}){const b=tS(),[w,S]=M.useState(!1),[_,E]=M.useState(!0),[T,k]=M.useState(u),[P,R]=M.useState(f),[I,F]=M.useState({}),A=M.useRef(),L=M.useRef(),$=M.useRef(),j=M.useRef(null),V=M.useRef(null),U=M.useMemo(()=>{const be=new Map;e.timeSeriesArray.forEach((xe,re)=>{const Ee=`v${re}`,ke=`ev${re}`,je=xe.source.valueDataKey,De=xe.source.errorDataKey;xe.data.forEach(ze=>{const Je=be.get(ze.time);let mt;Je===void 0?(mt={time:ze.time},be.set(ze.time,mt)):mt=Je;const Me=ze[je];if(Lr(Me)&&isFinite(Me)&&(mt[Ee]=Me),De){const st=ze[De];Lr(st)&&isFinite(st)&&(mt[ke]=st)}})});const ge=Array.from(be.values());return ge.sort((xe,re)=>xe.time-re.time),ge},[e]),z=M.useMemo(()=>e.timeSeriesArray.map(be=>be.dataProgress?be.dataProgress:0),[e]);M.useEffect(te,[]);const N=z.reduce((be,ge)=>be+ge,0)/z.length,B=N>0&&N<1,H=!!i&&!FDt(i,c||null);e.timeSeriesArray.forEach(be=>{be.source.valueDataKey});const Q=e.variableUnits||Ce.get("unknown units"),Y=`${Ce.get("Quantity")} (${Q})`,Z=b.palette.primary.light,pe=b.palette.primary.main,ie=b.palette.text.primary,ne=()=>{Lr(I.x1)&&F({})},fe=be=>{if(!be)return;const{chartX:ge,chartY:xe}=be;if(!Lr(ge)||!Lr(xe))return;const re=ee(ge,xe);if(re){const[Ee,ke]=re;F({x1:Ee,y1:ke})}},me=(be,ge)=>{const{x1:xe,y1:re}=I;if(!Lr(xe)||!Lr(re)||!be)return;const{chartX:Ee,chartY:ke}=be;if(!Lr(Ee)||!Lr(ke))return;const je=ee(Ee,ke);if(je){const[De,ze]=je;ge.ctrlKey||w?De!==xe&&ze!==re&&F({x1:xe,y1:re,x2:De,y2:ze}):De!==xe&&F({x1:xe,y1:re,x2:De})}},se=be=>{const[ge,xe]=b3e(I);ne(),ge&&ge[0]{ne()},G=()=>{ne()},ce=be=>{d(e.id,be)},he=()=>{ne(),o(c||null,e.id,null)},J=be=>{be&&o(i,e.id,be)};function te(){if(j.current){const be=j.current.getElementsByClassName("recharts-legend-wrapper");be.length!==0&&(V.current=be.item(0))}}const ae=(be,ge)=>{$.current=[be,ge],te()},we=([be,ge])=>{const xe=(ge-be)*.1;return i?A.current=i:A.current=[be-xe,ge+xe],A.current},Pe=([be,ge])=>{const xe=(ge-be)*.1;if(e.variableRange)L.current=e.variableRange;else{const re=be-xe;L.current=[re<0&&be-1e-6>0?0:re,ge+xe]}return L.current},ee=(be,ge)=>{if(!$.current||!A.current||!L.current)return;const xe=65,re=5,Ee=5,ke=38,je=20,[De,ze]=A.current,[Je,mt]=L.current,[Me,st]=$.current,Fe=V.current,ht=Fe?Fe.clientHeight:je,gt=Me-xe-Ee,St=st-re-ke-ht,on=(be-xe)/gt,Dn=(ge-re)/St;return[De+on*(ze-De),mt-Dn*(mt-Je)]},[oe,Se]=b3e(I),ye=T==="bar"?Btr:jtr;return O.jsxs(snr,{children:[O.jsx(onr,{timeSeriesGroup:e,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,removeTimeSeriesGroup:h,resetZoom:he,loading:B,zoomed:H,zoomMode:w,setZoomMode:S,showTooltips:_,setShowTooltips:E,chartType:T,setChartType:k,stdevBarsDisabled:!f,stdevBars:P,setStdevBars:R,valueRange:L.current,setValueRange:J,chartElement:j,postMessage:m,exportResolution:y}),O.jsx(alt,{width:"98%",onResize:ae,ref:j,children:O.jsxs(ye,{onMouseDown:fe,onMouseMove:me,onMouseUp:se,onMouseEnter:ue,onMouseLeave:G,syncId:"anyId",style:{color:ie,fontSize:"0.7rem"},data:U,barGap:1,barSize:30,maxBarSize:30,children:[O.jsx(WS,{dataKey:"time",type:"number",tickCount:6,domain:we,tickFormatter:Vtr,stroke:ie,allowDataOverflow:!0}),O.jsx(HS,{type:"number",tickCount:5,domain:Pe,tickFormatter:Wtr,stroke:ie,allowDataOverflow:!0,label:{...anr,value:Y}}),O.jsx(nye,{strokeDasharray:"3 3"}),_&&!Lr(I.x1)&&O.jsx(sp,{content:O.jsx(Xtr,{})}),O.jsx(K1,{content:O.jsx(Htr,{removeTimeSeries:ce,datasetTitle:v})}),e.timeSeriesArray.map((be,ge)=>Ytr({timeSeriesGroup:e,timeSeriesIndex:ge,selectTimeSeries:t,places:s,selectPlace:a,placeGroupTimeSeries:p,placeInfos:l,chartType:T,stdevBars:P,paletteMode:b.palette.mode})),oe&&O.jsx(LP,{x1:oe[0],y1:Se?Se[0]:void 0,x2:oe[1],y2:Se?Se[1]:void 0,strokeOpacity:.3,fill:Z,fillOpacity:.3}),n!==null&&O.jsx(iF,{isFront:!0,x:n,stroke:pe,strokeWidth:3,strokeOpacity:.5})]})})]})}function b3e(e){const{x1:t,x2:n,y1:r,y2:i}=e;let o,s;return Lr(t)&&Lr(n)&&(o=tO.jsx(lnr,{timeSeriesGroup:u,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,selectedDatasetTitle:a,exportResolution:l,...c},u.id))]})}const hnr=e=>({locale:e.controlState.locale,timeSeriesGroups:e.dataState.timeSeriesGroups,selectedTime:e.controlState.selectedTime,selectedTimeRange:e.controlState.selectedTimeRange,dataTimeRange:RLt(e),chartTypeDefault:e.controlState.timeSeriesChartTypeDefault,includeStdev:e.controlState.timeSeriesIncludeStdev,placeInfos:zLt(e),places:OD(e),placeGroupTimeSeries:VDt(e),canAddTimeSeries:yUe(e),selectedDatasetTitle:xce(e),exportResolution:e.controlState.exportResolution}),pnr={selectTime:cW,selectTimeRange:Att,removeTimeSeries:GOn,removeTimeSeriesGroup:qOn,selectPlace:lW,addPlaceGroupTimeSeries:HOn,addTimeSeries:aW,postMessage:aa},gnr=dr(hnr,pnr)(dnr),mnr=ot(O.jsx("path",{d:"M22 18v-2H8V4h2L7 1 4 4h2v2H2v2h4v8c0 1.1.9 2 2 2h8v2h-2l3 3 3-3h-2v-2zM10 8h6v6h2V8c0-1.1-.9-2-2-2h-6z"}),"Transform");function vnr(e){return e.count===0}function ynr(e){return e.count===1}function bnr(e){return e.count>1}function xnr({statisticsRecord:e}){const t=e.statistics;return O.jsx(sU,{size:"small",children:O.jsx(lU,{children:vnr(t)?O.jsxs(pf,{children:[O.jsx(mi,{children:Ce.get("Value")}),O.jsx(mi,{align:"right",children:"NaN"})]}):ynr(t)?O.jsxs(pf,{children:[O.jsx(mi,{children:Ce.get("Value")}),O.jsx(mi,{align:"right",children:I2(t.mean)})]}):O.jsxs(O.Fragment,{children:[O.jsxs(pf,{children:[O.jsx(mi,{children:Ce.get("Count")}),O.jsx(mi,{align:"right",children:t.count})]}),O.jsxs(pf,{children:[O.jsx(mi,{children:Ce.get("Minimum")}),O.jsx(mi,{align:"right",children:I2(t.minimum)})]}),O.jsxs(pf,{children:[O.jsx(mi,{children:Ce.get("Maximum")}),O.jsx(mi,{align:"right",children:I2(t.maximum)})]}),O.jsxs(pf,{children:[O.jsx(mi,{children:Ce.get("Mean")}),O.jsx(mi,{align:"right",children:I2(t.mean)})]}),O.jsxs(pf,{children:[O.jsx(mi,{children:Ce.get("Deviation")}),O.jsx(mi,{align:"right",children:I2(t.deviation)})]})]})})})}function I2(e){return jf(e,3)}function wnr({statisticsRecord:e,showBrush:t,showDetails:n}){const r=is(),i=e.statistics,o=M.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:b}=i.histogram;return y.map((w,S)=>({x:.5*(b[S]+b[S+1]),y:w,i:S}))},[i]),[s,a]=M.useState([0,o?o.length-1:-1]);if(M.useEffect(()=>{o&&a([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=e.source,[c,u]=s,f=o[c]?o[c].x:NaN,d=o[u]?o[u].x:NaN,h=Math.max(i.mean-i.deviation,i.minimum,f),p=Math.min(i.mean+i.deviation,i.maximum,d),g=r.palette.text.primary,m=r.palette.text.primary,v=({startIndex:y,endIndex:b})=>{Lr(y)&&Lr(b)&&a([y,b])};return O.jsx(alt,{width:"100%",height:"100%",children:O.jsxs(Utr,{data:o,margin:{top:0,right:t?30:5,bottom:1,left:2},style:{color:m,fontSize:"0.8rem"},children:[O.jsx(nye,{strokeDasharray:"3 3"}),O.jsx(WS,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>jf(y,2)}),O.jsx(HS,{}),O.jsx(Kb,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&O.jsx(iF,{x:i.mean,isFront:!0,stroke:g,strokeWidth:2,strokeOpacity:.5}),n&&O.jsx(LP,{x1:h,x2:p,isFront:!1,stroke:g,strokeWidth:1,strokeOpacity:.3,fill:g,fillOpacity:.05}),t&&O.jsx(Yw,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>jf(o[y].x,1),onChange:v})]})})}const U3={container:{padding:0,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function V3({phrase:e}){return O.jsx("span",{style:{color:"red"},children:`<${Ce.get(e)} ?>`})}function Uct({dataset:e,variable:t,time:n,placeInfo:r,actions:i,body:o,containerRef:s}){const a=e?e.title:O.jsx(V3,{phrase:"Dataset"}),l=t?t.name:O.jsx(V3,{phrase:"Variable"}),c=e?.dimensions.some(d=>d.name=="time"),u=n?b4e(n):c?O.jsx(V3,{phrase:"Time"}):null,f=r?r.label:O.jsx(V3,{phrase:"Place"});return O.jsxs(bt,{sx:U3.container,ref:s,children:[O.jsxs(bt,{sx:U3.header,children:[O.jsxs(yn,{fontSize:"small",variant:"inherit",component:"span",children:[a," / ",l,u&&`, ${u}`,", ",f]}),O.jsx(bt,{id:"statistics-row-buttons",sx:U3.actions,children:i})]}),o&&O.jsx(bt,{sx:U3.body,children:o})]})}const ZJ={table:{flexGrow:0},chart:{flexGrow:1},hoverVisibleBox:{display:"flex",gap:.1}};function Snr({locale:e,statisticsRecord:t,rowIndex:n,removeStatistics:r,postMessage:i,exportResolution:o}){const s=M.useRef(null),[a,l]=M.useState(!1),[c,u]=M.useState(!1),{dataset:f,variable:d,time:h,placeInfo:p}=t.source,g=bnr(t.statistics),m=()=>{u(!c)},v=()=>{l(!a)},y=()=>{r(n)};return O.jsx(Uct,{dataset:f,variable:d,time:h,placeInfo:p,containerRef:s,actions:O.jsxs(O.Fragment,{children:[O.jsxs(jct,{sx:ZJ.hoverVisibleBox,initialOpacity:.05,children:[g&&O.jsxs(rD,{size:"small",children:[O.jsx(_n,{arrow:!0,title:Ce.get("Toggle adjustable x-range"),children:O.jsx(oo,{selected:a,onClick:v,value:"brush",size:"small",children:O.jsx(mnr,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Show standard deviation (if any)"),children:O.jsx(oo,{selected:c,onClick:m,value:"details",size:"small",children:O.jsx(zct,{fontSize:"inherit"})})})]}),g&&O.jsx(Bct,{elementRef:s,postMessage:i,exportResolution:o,hiddenElementItems:["#statistics-row-buttons"]})]}),O.jsx(Mn,{size:"small",onClick:y,children:O.jsx(yP,{fontSize:"inherit"})})]}),body:O.jsxs(O.Fragment,{children:[O.jsx(bt,{sx:ZJ.table,children:O.jsx(xnr,{locale:e,statisticsRecord:t})}),O.jsx(bt,{sx:ZJ.chart,children:O.jsx(wnr,{showBrush:a,showDetails:c,statisticsRecord:t})})]})})}const _nr={progress:{color:"primary"}};function Cnr({selectedDataset:e,selectedVariable:t,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:s}){return O.jsx(Uct,{dataset:e,variable:t,time:n,placeInfo:r,actions:s?O.jsx(Eh,{size:20,sx:_nr.progress}):O.jsx(Mn,{size:"small",disabled:!i,onClick:o,color:"primary",children:O.jsx(SW,{})})})}const Onr={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function Enr({selectedDataset:e,selectedVariable:t,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:s,addStatistics:a,removeStatistics:l,postMessage:c,exportResolution:u}){return O.jsxs(bt,{sx:Onr.container,children:[O.jsx(Cnr,{selectedDataset:e,selectedVariable:t,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:s,addStatistics:a,statisticsLoading:i}),o.map((f,d)=>O.jsx(Snr,{statisticsRecord:f,rowIndex:d,removeStatistics:l,postMessage:c,exportResolution:u},d))]})}const Tnr=e=>({selectedDataset:Co(e),selectedVariable:nc(e),selectedTime:gS(e),selectedPlaceInfo:ED(e),statisticsLoading:BDt(e),statisticsRecords:jLt(e),canAddStatistics:bUe(e),exportResolution:e.controlState.exportResolution}),Pnr={addStatistics:Jet,removeStatistics:VOn,postMessage:aa},knr=dr(Tnr,Pnr)(Enr);const iye="144",J_={ROTATE:0,DOLLY:1,PAN:2},eC={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Mnr=0,x3e=1,Anr=2,Vct=1,Rnr=2,NM=3,pT=0,Fu=1,Um=2,V0=0,$O=1,w3e=2,S3e=3,_3e=4,Inr=5,IC=100,Dnr=101,Lnr=102,C3e=103,O3e=104,Fnr=200,$nr=201,Nnr=202,znr=203,Wct=204,Hct=205,jnr=206,Bnr=207,Unr=208,Vnr=209,Wnr=210,Hnr=0,Gnr=1,qnr=2,gae=3,Xnr=4,Ynr=5,Qnr=6,Knr=7,Gct=0,Znr=1,Jnr=2,sv=0,err=1,trr=2,nrr=3,rrr=4,irr=5,qct=300,gT=301,mT=302,mae=303,vae=304,oH=306,yae=1e3,wf=1001,bae=1002,_c=1003,E3e=1004,T3e=1005,Cc=1006,orr=1007,sH=1008,Kw=1009,srr=1010,arr=1011,Xct=1012,lrr=1013,O1=1014,E0=1015,jI=1016,crr=1017,urr=1018,NO=1020,frr=1021,drr=1022,Dp=1023,hrr=1024,prr=1025,J1=1026,vT=1027,Yct=1028,grr=1029,mrr=1030,vrr=1031,yrr=1033,JJ=33776,eee=33777,tee=33778,nee=33779,P3e=35840,k3e=35841,M3e=35842,A3e=35843,brr=36196,R3e=37492,I3e=37496,D3e=37808,L3e=37809,F3e=37810,$3e=37811,N3e=37812,z3e=37813,j3e=37814,B3e=37815,U3e=37816,V3e=37817,W3e=37818,H3e=37819,G3e=37820,q3e=37821,X3e=36492,Zw=3e3,Lo=3001,xrr=3200,wrr=3201,Srr=0,_rr=1,vm="srgb",E1="srgb-linear",ree=7680,Crr=519,Y3e=35044,Q3e="300 es",xae=1035;class GS{addEventListener(t,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[t]===void 0&&(r[t]=[]),r[t].indexOf(n)===-1&&r[t].push(n)}hasEventListener(t,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[t]!==void 0&&r[t].indexOf(n)!==-1}removeEventListener(t,n){if(this._listeners===void 0)return;const i=this._listeners[t];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const r=this._listeners[t.type];if(r!==void 0){t.target=this;const i=r.slice(0);for(let o=0,s=i.length;o>8&255]+Xa[e>>16&255]+Xa[e>>24&255]+"-"+Xa[t&255]+Xa[t>>8&255]+"-"+Xa[t>>16&15|64]+Xa[t>>24&255]+"-"+Xa[n&63|128]+Xa[n>>8&255]+"-"+Xa[n>>16&255]+Xa[n>>24&255]+Xa[r&255]+Xa[r>>8&255]+Xa[r>>16&255]+Xa[r>>24&255]).toLowerCase()}function Oc(e,t,n){return Math.max(t,Math.min(n,e))}function Orr(e,t){return(e%t+t)%t}function oee(e,t,n){return(1-n)*e+n*t}function Z3e(e){return(e&e-1)===0&&e!==0}function wae(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function W3(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function iu(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw new Error("Invalid component type.")}}class Sr{constructor(t=0,n=0){Sr.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,n){return this.x=t,this.y=n,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const n=this.x,r=this.y,i=t.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y;return n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this}rotateAround(t,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-t.x,s=this.y-t.y;return this.x=o*r-s*i+t.x,this.y=o*i+s*r+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Pu{constructor(){Pu.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,n,r,i,o,s,a,l,c){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const n=this.elements,r=t.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(t,n,r){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const n=t.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const r=t.elements,i=n.elements,o=this.elements,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],g=i[0],m=i[3],v=i[6],y=i[1],b=i[4],w=i[7],S=i[2],_=i[5],E=i[8];return o[0]=s*g+a*y+l*S,o[3]=s*m+a*b+l*_,o[6]=s*v+a*w+l*E,o[1]=c*g+u*y+f*S,o[4]=c*m+u*b+f*_,o[7]=c*v+u*w+f*E,o[2]=d*g+h*y+p*S,o[5]=d*m+h*b+p*_,o[8]=d*v+h*w+p*E,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this}determinant(){const t=this.elements,n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return n*s*u-n*a*c-r*o*u+r*a*l+i*o*c-i*s*l}invert(){const t=this.elements,n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],f=u*s-a*c,d=a*l-u*o,h=c*o-s*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return t[0]=f*g,t[1]=(i*c-u*r)*g,t[2]=(a*r-i*s)*g,t[3]=d*g,t[4]=(u*n-i*l)*g,t[5]=(i*o-a*n)*g,t[6]=h*g,t[7]=(r*l-c*n)*g,t[8]=(s*n-r*o)*g,this}transpose(){let t;const n=this.elements;return t=n[1],n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const n=this.elements;return t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8],this}setUvTransform(t,n,r,i,o,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*s+c*a)+s+t,-i*c,i*l,-i*(-c*s+l*a)+a+n,0,0,1),this}scale(t,n){const r=this.elements;return r[0]*=t,r[3]*=t,r[6]*=t,r[1]*=n,r[4]*=n,r[7]*=n,this}rotate(t){const n=Math.cos(t),r=Math.sin(t),i=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*s+r*c,i[6]=n*a+r*u,i[1]=-r*o+n*l,i[4]=-r*s+n*c,i[7]=-r*a+n*u,this}translate(t,n){const r=this.elements;return r[0]+=t*r[2],r[3]+=t*r[5],r[6]+=t*r[8],r[1]+=n*r[2],r[4]+=n*r[5],r[7]+=n*r[8],this}equals(t){const n=this.elements,r=t.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(t,n=0){for(let r=0;r<9;r++)this.elements[r]=t[r+n];return this}toArray(t=[],n=0){const r=this.elements;return t[n]=r[0],t[n+1]=r[1],t[n+2]=r[2],t[n+3]=r[3],t[n+4]=r[4],t[n+5]=r[5],t[n+6]=r[6],t[n+7]=r[7],t[n+8]=r[8],t}clone(){return new this.constructor().fromArray(this.elements)}}function Qct(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function BI(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function ew(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function M5(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}const see={[vm]:{[E1]:ew},[E1]:{[vm]:M5}},kd={legacyMode:!0,get workingColorSpace(){return E1},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,n){if(this.legacyMode||t===n||!t||!n)return e;if(see[t]&&see[t][n]!==void 0){const r=see[t][n];return e.r=r(e.r),e.g=r(e.g),e.b=r(e.b),e}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}},Kct={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Os={r:0,g:0,b:0},Md={h:0,s:0,l:0},H3={h:0,s:0,l:0};function aee(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}function G3(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}class yo{constructor(t,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,n===void 0&&r===void 0?this.set(t):this.setRGB(t,n,r)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,n=vm){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,kd.toWorkingColorSpace(this,n),this}setRGB(t,n,r,i=E1){return this.r=t,this.g=n,this.b=r,kd.toWorkingColorSpace(this,i),this}setHSL(t,n,r,i=E1){if(t=Orr(t,1),n=Oc(n,0,1),r=Oc(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=aee(s,o,t+1/3),this.g=aee(s,o,t),this.b=aee(s,o,t-1/3)}return kd.toWorkingColorSpace(this,i),this}setStyle(t,n=vm){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let o;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,kd.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,kd.toWorkingColorSpace(this,n),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const l=parseFloat(o[1])/360,c=parseFloat(o[2])/100,u=parseFloat(o[3])/100;return r(o[4]),this.setHSL(l,c,u,n)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const o=i[1],s=o.length;if(s===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,kd.toWorkingColorSpace(this,n),this;if(s===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,kd.toWorkingColorSpace(this,n),this}return t&&t.length>0?this.setColorName(t,n):this}setColorName(t,n=vm){const r=Kct[t.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=ew(t.r),this.g=ew(t.g),this.b=ew(t.b),this}copyLinearToSRGB(t){return this.r=M5(t.r),this.g=M5(t.g),this.b=M5(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=vm){return kd.fromWorkingColorSpace(G3(this,Os),t),Oc(Os.r*255,0,255)<<16^Oc(Os.g*255,0,255)<<8^Oc(Os.b*255,0,255)<<0}getHexString(t=vm){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,n=E1){kd.fromWorkingColorSpace(G3(this,Os),n);const r=Os.r,i=Os.g,o=Os.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const f=s-a;switch(c=u<=.5?f/(s+a):f/(2-s-a),s){case r:l=(i-o)/f+(i"u")return t.src;let n;if(t instanceof HTMLCanvasElement)n=t;else{tC===void 0&&(tC=BI("canvas")),tC.width=t.width,tC.height=t.height;const r=tC.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),n=tC}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const n=BI("canvas");n.width=t.width,n.height=t.height;const r=n.getContext("2d");r.drawImage(t,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height),o=i.data;for(let s=0;s1)switch(this.wrapS){case yae:t.x=t.x-Math.floor(t.x);break;case wf:t.x=t.x<0?0:1;break;case bae:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case yae:t.y=t.y-Math.floor(t.y);break;case wf:t.y=t.y<0?0:1;break;case bae:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}}Wu.DEFAULT_IMAGE=null;Wu.DEFAULT_MAPPING=qct;class La{constructor(t=0,n=0,r=0,i=1){La.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,n,r,i){return this.x=t,this.y=n,this.z=r,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this.w=t.w+n.w,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this.w+=t.w*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this.w=t.w-n.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const n=this.x,r=this.y,i=this.z,o=this.w,s=t.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*o,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const n=Math.sqrt(1-t.w*t.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/n,this.y=t.y/n,this.z=t.z/n),this}setAxisAngleFromRotationMatrix(t){let n,r,i,o;const l=t.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-g)<.01&&Math.abs(p-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+g)<.1&&Math.abs(p+m)<.1&&Math.abs(c+h+v-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,w=(h+1)/2,S=(v+1)/2,_=(u+d)/4,E=(f+g)/4,T=(p+m)/4;return b>w&&b>S?b<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(b),i=_/r,o=E/r):w>S?w<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(w),r=_/i,o=T/i):S<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(S),r=E/o,i=T/o),this.set(r,i,o,n),this}let y=Math.sqrt((m-p)*(m-p)+(f-g)*(f-g)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-p)/y,this.y=(f-g)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+v-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this.w=Math.max(t.w,Math.min(n.w,this.w)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this.w=Math.max(t,Math.min(n,this.w)),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this.w+=(t.w-this.w)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this.z=t.z+(n.z-t.z)*r,this.w=t.w+(n.w-t.w)*r,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this.w=t[n+3],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t[n+3]=this.w,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this.w=t.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Jw extends GS{constructor(t,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=n,this.depth=1,this.scissor=new La(0,0,t,n),this.scissorTest=!1,this.viewport=new La(0,0,t,n);const i={width:t,height:n,depth:1};this.texture=new Wu(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:Cc,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(t,n,r=1){(this.width!==t||this.height!==n||this.depth!==r)&&(this.width=t,this.height=n,this.depth=r,this.texture.image.width=t,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,t,n),this.scissor.set(0,0,t,n)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},t.texture.image);return this.texture.source=new Jct(n),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class eut extends Wu{constructor(t=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:n,height:r,depth:i},this.magFilter=_c,this.minFilter=_c,this.wrapR=wf,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class tut extends Wu{constructor(t=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:n,height:r,depth:i},this.magFilter=_c,this.minFilter=_c,this.wrapR=wf,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class eS{constructor(t=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=t,this._y=n,this._z=r,this._w=i}static slerpFlat(t,n,r,i,o,s,a){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[s+0],h=o[s+1],p=o[s+2],g=o[s+3];if(a===0){t[n+0]=l,t[n+1]=c,t[n+2]=u,t[n+3]=f;return}if(a===1){t[n+0]=d,t[n+1]=h,t[n+2]=p,t[n+3]=g;return}if(f!==g||l!==d||c!==h||u!==p){let m=1-a;const v=l*d+c*h+u*p+f*g,y=v>=0?1:-1,b=1-v*v;if(b>Number.EPSILON){const S=Math.sqrt(b),_=Math.atan2(S,v*y);m=Math.sin(m*_)/S,a=Math.sin(a*_)/S}const w=a*y;if(l=l*m+d*w,c=c*m+h*w,u=u*m+p*w,f=f*m+g*w,m===1-a){const S=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=S,c*=S,u*=S,f*=S}}t[n]=l,t[n+1]=c,t[n+2]=u,t[n+3]=f}static multiplyQuaternionsFlat(t,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[s],d=o[s+1],h=o[s+2],p=o[s+3];return t[n]=a*p+u*f+l*h-c*d,t[n+1]=l*p+u*d+c*f-a*h,t[n+2]=c*p+u*h+a*d-l*f,t[n+3]=u*p-a*f-l*d-c*h,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,n,r,i){return this._x=t,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,n){const r=t._x,i=t._y,o=t._z,s=t._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(s){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const r=n/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+a+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(o-c)*h,this._z=(s-i)*h}else if(r>a&&r>f){const h=2*Math.sqrt(1+r-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+s)/h,this._z=(o+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-r-f);this._w=(o-c)/h,this._x=(i+s)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-a);this._w=(s-i)/h,this._x=(o+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let r=t.dot(n)+1;return rMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=r),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Oc(this.dot(t),-1,1)))}rotateTowards(t,n){const r=this.angleTo(t);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,n){const r=t._x,i=t._y,o=t._z,s=t._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-i*l-o*c,this._onChangeCallback(),this}slerp(t,n){if(n===0)return this;if(n===1)return this.copy(t);const r=this._x,i=this._y,o=this._z,s=this._w;let a=s*t._w+r*t._x+i*t._y+o*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*s+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=s*f+this._w*d,this._x=r*f+this._x*d,this._y=i*f+this._y*d,this._z=o*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,n,r){return this.copy(t).slerp(n,r)}random(){const t=Math.random(),n=Math.sqrt(1-t),r=Math.sqrt(t),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t}fromBufferAttribute(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ne{constructor(t=0,n=0,r=0){Ne.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(t,n,r){return r===void 0&&(r=this.z),this.x=t,this.y=n,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(J3e.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(J3e.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,r=this.y,i=this.z,o=t.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(t){const n=this.x,r=this.y,i=this.z,o=t.x,s=t.y,a=t.z,l=t.w,c=l*n+s*i-a*r,u=l*r+a*n-o*i,f=l*i+o*r-s*n,d=-o*n-s*r-a*i;return this.x=c*l+d*-o+u*-a-f*-s,this.y=u*l+d*-s+f*-o-c*-a,this.z=f*l+d*-a+c*-s-u*-o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this.z=t.z+(n.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const r=t.x,i=t.y,o=t.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const r=t.dot(this)/n;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return cee.copy(this).projectOnVector(t),this.sub(cee)}reflect(t){return this.sub(cee.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(t)/n;return Math.acos(Oc(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return n*n+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,n,r){const i=Math.sin(n)*t;return this.x=i*Math.sin(r),this.y=Math.cos(n)*t,this.z=i*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,n,r){return this.x=t*Math.sin(n),this.y=r,this.z=t*Math.cos(n),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-t**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const cee=new Ne,J3e=new eS;class $P{constructor(t=new Ne(1/0,1/0,1/0),n=new Ne(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=n}set(t,n){return this.min.copy(t),this.max.copy(n),this}setFromArray(t){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=t.length;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromBufferAttribute(t){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=t.count;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromPoints(t){this.makeEmpty();for(let n=0,r=t.length;nthis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,n){return n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,$x),$x.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let n,r;return t.normal.x>0?(n=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(n=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(n+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(n+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),n<=-t.constant&&r>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(D2),q3.subVectors(this.max,D2),nC.subVectors(t.a,D2),rC.subVectors(t.b,D2),iC.subVectors(t.c,D2),_y.subVectors(rC,nC),Cy.subVectors(iC,rC),Nx.subVectors(nC,iC);let n=[0,-_y.z,_y.y,0,-Cy.z,Cy.y,0,-Nx.z,Nx.y,_y.z,0,-_y.x,Cy.z,0,-Cy.x,Nx.z,0,-Nx.x,-_y.y,_y.x,0,-Cy.y,Cy.x,0,-Nx.y,Nx.x,0];return!fee(n,nC,rC,iC,q3)||(n=[1,0,0,0,1,0,0,0,1],!fee(n,nC,rC,iC,q3))?!1:(X3.crossVectors(_y,Cy),n=[X3.x,X3.y,X3.z],fee(n,nC,rC,iC,q3))}clampPoint(t,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return $x.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=this.getSize($x).length()*.5,t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(nm[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),nm[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),nm[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),nm[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),nm[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),nm[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),nm[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),nm[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(nm),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const nm=[new Ne,new Ne,new Ne,new Ne,new Ne,new Ne,new Ne,new Ne],$x=new Ne,uee=new $P,nC=new Ne,rC=new Ne,iC=new Ne,_y=new Ne,Cy=new Ne,Nx=new Ne,D2=new Ne,q3=new Ne,X3=new Ne,zx=new Ne;function fee(e,t,n,r,i){for(let o=0,s=e.length-3;o<=s;o+=3){zx.fromArray(e,o);const a=i.x*Math.abs(zx.x)+i.y*Math.abs(zx.y)+i.z*Math.abs(zx.z),l=t.dot(zx),c=n.dot(zx),u=r.dot(zx);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const Trr=new $P,eze=new Ne,Y3=new Ne,dee=new Ne;class aH{constructor(t=new Ne,n=-1){this.center=t,this.radius=n}set(t,n){return this.center.copy(t),this.radius=n,this}setFromPoints(t,n){const r=this.center;n!==void 0?r.copy(n):Trr.setFromPoints(t).getCenter(r);let i=0;for(let o=0,s=t.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){dee.subVectors(t,this.center);const n=dee.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(dee.multiplyScalar(i/r)),this.radius+=i}return this}union(t){return this.center.equals(t.center)===!0?Y3.set(0,0,1).multiplyScalar(t.radius):Y3.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(eze.copy(t.center).add(Y3)),this.expandByPoint(eze.copy(t.center).sub(Y3)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const rm=new Ne,hee=new Ne,Q3=new Ne,Oy=new Ne,pee=new Ne,K3=new Ne,gee=new Ne;class nut{constructor(t=new Ne,n=new Ne(0,0,-1)){this.origin=t,this.direction=n}set(t,n){return this.origin.copy(t),this.direction.copy(n),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,n){return n.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,rm)),this}closestPointToPoint(t,n){n.subVectors(t,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const n=rm.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(rm.copy(this.direction).multiplyScalar(n).add(this.origin),rm.distanceToSquared(t))}distanceSqToSegment(t,n,r,i){hee.copy(t).add(n).multiplyScalar(.5),Q3.copy(n).sub(t).normalize(),Oy.copy(this.origin).sub(hee);const o=t.distanceTo(n)*.5,s=-this.direction.dot(Q3),a=Oy.dot(this.direction),l=-Oy.dot(Q3),c=Oy.lengthSq(),u=Math.abs(1-s*s);let f,d,h,p;if(u>0)if(f=s*l-a,d=s*a-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const g=1/u;f*=g,d*=g,h=f*(f+s*d+2*a)+d*(s*f+d+2*l)+c}else d=o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-s*o+a)),d=f>0?-o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-o,-l),o),h=d*(d+2*l)+c):(f=Math.max(0,-(s*o+a)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=s>0?-o:o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(Q3).multiplyScalar(d).add(hee),h}intersectSphere(t,n){rm.subVectors(t.center,this.origin);const r=rm.dot(this.direction),i=rm.dot(rm)-r*r,o=t.radius*t.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return a<0&&l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const n=t.normal.dot(this.direction);if(n===0)return t.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(t.normal)+t.constant)/n;return r>=0?r:null}intersectPlane(t,n){const r=this.distanceToPlane(t);return r===null?null:this.at(r,n)}intersectsPlane(t){const n=t.distanceToPoint(this.origin);return n===0||t.normal.dot(this.direction)*n<0}intersectBox(t,n){let r,i,o,s,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(r=(t.min.x-d.x)*c,i=(t.max.x-d.x)*c):(r=(t.max.x-d.x)*c,i=(t.min.x-d.x)*c),u>=0?(o=(t.min.y-d.y)*u,s=(t.max.y-d.y)*u):(o=(t.max.y-d.y)*u,s=(t.min.y-d.y)*u),r>s||o>i||((o>r||r!==r)&&(r=o),(s=0?(a=(t.min.z-d.z)*f,l=(t.max.z-d.z)*f):(a=(t.max.z-d.z)*f,l=(t.min.z-d.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(t){return this.intersectBox(t,rm)!==null}intersectTriangle(t,n,r,i,o){pee.subVectors(n,t),K3.subVectors(r,t),gee.crossVectors(pee,K3);let s=this.direction.dot(gee),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;Oy.subVectors(this.origin,t);const l=a*this.direction.dot(K3.crossVectors(Oy,K3));if(l<0)return null;const c=a*this.direction.dot(pee.cross(Oy));if(c<0||l+c>s)return null;const u=-a*Oy.dot(gee);return u<0?null:this.at(u/s,o)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Zi{constructor(){Zi.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,n,r,i,o,s,a,l,c,u,f,d,h,p,g,m){const v=this.elements;return v[0]=t,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=s,v[9]=a,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Zi().fromArray(this.elements)}copy(t){const n=this.elements,r=t.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(t){const n=this.elements,r=t.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(t){const n=t.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(t,n,r){return t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(t,n,r){return this.set(t.x,n.x,r.x,0,t.y,n.y,r.y,0,t.z,n.z,r.z,0,0,0,0,1),this}extractRotation(t){const n=this.elements,r=t.elements,i=1/oC.setFromMatrixColumn(t,0).length(),o=1/oC.setFromMatrixColumn(t,1).length(),s=1/oC.setFromMatrixColumn(t,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(t){const n=this.elements,r=t.x,i=t.y,o=t.z,s=Math.cos(r),a=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(t.order==="XYZ"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-g*c,n[9]=-a*l,n[2]=g-d*c,n[6]=p+h*c,n[10]=s*l}else if(t.order==="YXZ"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d+g*a,n[4]=p*a-h,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-a,n[2]=h*a-p,n[6]=g+d*a,n[10]=s*l}else if(t.order==="ZXY"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d-g*a,n[4]=-s*f,n[8]=p+h*a,n[1]=h+p*a,n[5]=s*u,n[9]=g-d*a,n[2]=-s*c,n[6]=a,n[10]=s*l}else if(t.order==="ZYX"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+g,n[1]=l*f,n[5]=g*c+d,n[9]=h*c-p,n[2]=-c,n[6]=a*l,n[10]=s*l}else if(t.order==="YZX"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=g-d*f,n[8]=p*f+h,n[1]=f,n[5]=s*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-g*f}else if(t.order==="XZY"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+g,n[5]=s*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=a*u,n[10]=g*f+d}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Prr,t,krr)}lookAt(t,n,r){const i=this.elements;return ou.subVectors(t,n),ou.lengthSq()===0&&(ou.z=1),ou.normalize(),Ey.crossVectors(r,ou),Ey.lengthSq()===0&&(Math.abs(r.z)===1?ou.x+=1e-4:ou.z+=1e-4,ou.normalize(),Ey.crossVectors(r,ou)),Ey.normalize(),Z3.crossVectors(ou,Ey),i[0]=Ey.x,i[4]=Z3.x,i[8]=ou.x,i[1]=Ey.y,i[5]=Z3.y,i[9]=ou.y,i[2]=Ey.z,i[6]=Z3.z,i[10]=ou.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const r=t.elements,i=n.elements,o=this.elements,s=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],g=r[6],m=r[10],v=r[14],y=r[3],b=r[7],w=r[11],S=r[15],_=i[0],E=i[4],T=i[8],k=i[12],P=i[1],R=i[5],I=i[9],F=i[13],A=i[2],L=i[6],$=i[10],j=i[14],V=i[3],U=i[7],z=i[11],N=i[15];return o[0]=s*_+a*P+l*A+c*V,o[4]=s*E+a*R+l*L+c*U,o[8]=s*T+a*I+l*$+c*z,o[12]=s*k+a*F+l*j+c*N,o[1]=u*_+f*P+d*A+h*V,o[5]=u*E+f*R+d*L+h*U,o[9]=u*T+f*I+d*$+h*z,o[13]=u*k+f*F+d*j+h*N,o[2]=p*_+g*P+m*A+v*V,o[6]=p*E+g*R+m*L+v*U,o[10]=p*T+g*I+m*$+v*z,o[14]=p*k+g*F+m*j+v*N,o[3]=y*_+b*P+w*A+S*V,o[7]=y*E+b*R+w*L+S*U,o[11]=y*T+b*I+w*$+S*z,o[15]=y*k+b*F+w*j+S*N,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this}determinant(){const t=this.elements,n=t[0],r=t[4],i=t[8],o=t[12],s=t[1],a=t[5],l=t[9],c=t[13],u=t[2],f=t[6],d=t[10],h=t[14],p=t[3],g=t[7],m=t[11],v=t[15];return p*(+o*l*f-i*c*f-o*a*d+r*c*d+i*a*h-r*l*h)+g*(+n*l*h-n*c*d+o*s*d-i*s*h+i*c*u-o*l*u)+m*(+n*c*f-n*a*h-o*s*f+r*s*h+o*a*u-r*c*u)+v*(-i*a*u-n*l*f+n*a*d+i*s*f-r*s*d+r*l*u)}transpose(){const t=this.elements;let n;return n=t[1],t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this}setPosition(t,n,r){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=n,i[14]=r),this}invert(){const t=this.elements,n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],g=t[13],m=t[14],v=t[15],y=f*m*c-g*d*c+g*l*h-a*m*h-f*l*v+a*d*v,b=p*d*c-u*m*c-p*l*h+s*m*h+u*l*v-s*d*v,w=u*g*c-p*f*c+p*a*h-s*g*h-u*a*v+s*f*v,S=p*f*l-u*g*l-p*a*d+s*g*d+u*a*m-s*f*m,_=n*y+r*b+i*w+o*S;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/_;return t[0]=y*E,t[1]=(g*d*o-f*m*o-g*i*h+r*m*h+f*i*v-r*d*v)*E,t[2]=(a*m*o-g*l*o+g*i*c-r*m*c-a*i*v+r*l*v)*E,t[3]=(f*l*o-a*d*o-f*i*c+r*d*c+a*i*h-r*l*h)*E,t[4]=b*E,t[5]=(u*m*o-p*d*o+p*i*h-n*m*h-u*i*v+n*d*v)*E,t[6]=(p*l*o-s*m*o-p*i*c+n*m*c+s*i*v-n*l*v)*E,t[7]=(s*d*o-u*l*o+u*i*c-n*d*c-s*i*h+n*l*h)*E,t[8]=w*E,t[9]=(p*f*o-u*g*o-p*r*h+n*g*h+u*r*v-n*f*v)*E,t[10]=(s*g*o-p*a*o+p*r*c-n*g*c-s*r*v+n*a*v)*E,t[11]=(u*a*o-s*f*o-u*r*c+n*f*c+s*r*h-n*a*h)*E,t[12]=S*E,t[13]=(u*g*i-p*f*i+p*r*d-n*g*d-u*r*m+n*f*m)*E,t[14]=(p*a*i-s*g*i-p*r*l+n*g*l+s*r*m-n*a*m)*E,t[15]=(s*f*i-u*a*i+u*r*l-n*f*l-s*r*d+n*a*d)*E,this}scale(t){const n=this.elements,r=t.x,i=t.y,o=t.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const t=this.elements,n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(t,n,r){return this.set(1,0,0,t,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(t){const n=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(t){const n=Math.cos(t),r=Math.sin(t);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(t){const n=Math.cos(t),r=Math.sin(t);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,s=t.x,a=t.y,l=t.z,c=o*s,u=o*a;return this.set(c*s+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*s,0,c*l-i*a,u*l+i*s,o*l*l+r,0,0,0,0,1),this}makeScale(t,n,r){return this.set(t,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,n,r,i,o,s){return this.set(1,r,o,0,t,1,s,0,n,i,1,0,0,0,0,1),this}compose(t,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,c=o+o,u=s+s,f=a+a,d=o*c,h=o*u,p=o*f,g=s*u,m=s*f,v=a*f,y=l*c,b=l*u,w=l*f,S=r.x,_=r.y,E=r.z;return i[0]=(1-(g+v))*S,i[1]=(h+w)*S,i[2]=(p-b)*S,i[3]=0,i[4]=(h-w)*_,i[5]=(1-(d+v))*_,i[6]=(m+y)*_,i[7]=0,i[8]=(p+b)*E,i[9]=(m-y)*E,i[10]=(1-(d+g))*E,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,n,r){const i=this.elements;let o=oC.set(i[0],i[1],i[2]).length();const s=oC.set(i[4],i[5],i[6]).length(),a=oC.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),t.x=i[12],t.y=i[13],t.z=i[14],Ad.copy(this);const c=1/o,u=1/s,f=1/a;return Ad.elements[0]*=c,Ad.elements[1]*=c,Ad.elements[2]*=c,Ad.elements[4]*=u,Ad.elements[5]*=u,Ad.elements[6]*=u,Ad.elements[8]*=f,Ad.elements[9]*=f,Ad.elements[10]*=f,n.setFromRotationMatrix(Ad),r.x=o,r.y=s,r.z=a,this}makePerspective(t,n,r,i,o,s){const a=this.elements,l=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-(s+o)/(s-o),h=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=f,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,n,r,i,o,s){const a=this.elements,l=1/(n-t),c=1/(r-i),u=1/(s-o),f=(n+t)*l,d=(r+i)*c,h=(s+o)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-f,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const n=this.elements,r=t.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(t,n=0){for(let r=0;r<16;r++)this.elements[r]=t[r+n];return this}toArray(t=[],n=0){const r=this.elements;return t[n]=r[0],t[n+1]=r[1],t[n+2]=r[2],t[n+3]=r[3],t[n+4]=r[4],t[n+5]=r[5],t[n+6]=r[6],t[n+7]=r[7],t[n+8]=r[8],t[n+9]=r[9],t[n+10]=r[10],t[n+11]=r[11],t[n+12]=r[12],t[n+13]=r[13],t[n+14]=r[14],t[n+15]=r[15],t}}const oC=new Ne,Ad=new Zi,Prr=new Ne(0,0,0),krr=new Ne(1,1,1),Ey=new Ne,Z3=new Ne,ou=new Ne,tze=new Zi,nze=new eS;class aF{constructor(t=0,n=0,r=0,i=aF.DefaultOrder){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,n,r,i=this._order){return this._x=t,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,n=this._order,r=!0){const i=t.elements,o=i[0],s=i[4],a=i[8],l=i[1],c=i[5],u=i[9],f=i[2],d=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Oc(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Oc(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(Oc(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Oc(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(Oc(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Oc(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(t,n,r){return tze.makeRotationFromQuaternion(t),this.setFromRotationMatrix(tze,n,r)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){return nze.setFromEuler(this),this.setFromQuaternion(nze,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}aF.DefaultOrder="XYZ";aF.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class rut{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),d.length>0&&(r.skeletons=d),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function s(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(t,n,r,i,o){Rd.subVectors(i,n),om.subVectors(r,n),mee.subVectors(t,n);const s=Rd.dot(Rd),a=Rd.dot(om),l=Rd.dot(mee),c=om.dot(om),u=om.dot(mee),f=s*c-a*a;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-a*u)*d,p=(s*u-a*l)*d;return o.set(1-h-p,p,h)}static containsPoint(t,n,r,i){return this.getBarycoord(t,n,r,i,sm),sm.x>=0&&sm.y>=0&&sm.x+sm.y<=1}static getUV(t,n,r,i,o,s,a,l){return this.getBarycoord(t,n,r,i,sm),l.set(0,0),l.addScaledVector(o,sm.x),l.addScaledVector(s,sm.y),l.addScaledVector(a,sm.z),l}static isFrontFacing(t,n,r,i){return Rd.subVectors(r,n),om.subVectors(t,n),Rd.cross(om).dot(i)<0}set(t,n,r){return this.a.copy(t),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(t,n,r,i){return this.a.copy(t[n]),this.b.copy(t[r]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,n,r,i){return this.a.fromBufferAttribute(t,n),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Rd.subVectors(this.c,this.b),om.subVectors(this.a,this.b),Rd.cross(om).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Am.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return Am.getBarycoord(t,this.a,this.b,this.c,n)}getUV(t,n,r,i,o){return Am.getUV(t,this.a,this.b,this.c,n,r,i,o)}containsPoint(t){return Am.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Am.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,n){const r=this.a,i=this.b,o=this.c;let s,a;aC.subVectors(i,r),lC.subVectors(o,r),vee.subVectors(t,r);const l=aC.dot(vee),c=lC.dot(vee);if(l<=0&&c<=0)return n.copy(r);yee.subVectors(t,i);const u=aC.dot(yee),f=lC.dot(yee);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(r).addScaledVector(aC,s);bee.subVectors(t,o);const h=aC.dot(bee),p=lC.dot(bee);if(p>=0&&h<=p)return n.copy(o);const g=h*c-l*p;if(g<=0&&c>=0&&p<=0)return a=c/(c-p),n.copy(r).addScaledVector(lC,a);const m=u*p-h*f;if(m<=0&&f-u>=0&&h-p>=0)return lze.subVectors(o,i),a=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(lze,a);const v=1/(m+g+d);return s=g*v,a=d*v,n.copy(r).addScaledVector(aC,s).addScaledVector(lC,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Drr=0;class lF extends GS{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Drr++}),this.uuid=sF(),this.name="",this.type="Material",this.blending=$O,this.side=pT,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Wct,this.blendDst=Hct,this.blendEquation=IC,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=gae,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Crr,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ree,this.stencilZFail=ree,this.stencilZPass=ree,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const n in t){const r=t[n];if(r===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}const i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(t){const n=t===void 0||typeof t=="string";n&&(t={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==$O&&(r.blending=this.blending),this.side!==pT&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(t.textures),s=i(t.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const n=t.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class oye extends lF{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new yo(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Gct,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const as=new Ne,ez=new Sr;class Wf{constructor(t,n,r){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=n,this.count=t!==void 0?t.length/n:0,this.normalized=r===!0,this.usage=Y3e,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,n,r){t*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const n=this.index;n!==null&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];t.data.attributes[l]=c.toJSON(t.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(i[l]=u,o=!0)}o&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=t.name;const r=t.index;r!==null&&this.setIndex(r.clone(n));const i=t.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=t.morphAttributes;for(const c in o){const u=[],f=o[c];for(let d=0,h=f.length;d0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;on.far?null:{distance:c,point:az.clone(),object:e}}function lz(e,t,n,r,i,o,s,a,l,c,u,f){Ty.fromBufferAttribute(i,c),Py.fromBufferAttribute(i,u),ky.fromBufferAttribute(i,f);const d=e.morphTargetInfluences;if(o&&d){tz.set(0,0,0),nz.set(0,0,0),rz.set(0,0,0);for(let p=0,g=o.length;p0?1:-1,u.push(U.x,U.y,U.z),f.push(B/E),f.push(1-z/T),j+=1}}for(let z=0;z0&&Math.abs(l)>0){var c=Math.min(o,o+a),u=Math.max(o,o+a),f=Math.min(s,s+l),d=Math.max(s,s+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},Gqn={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},jme=function(t){var n=iFe(iFe({},Gqn),t),r=M.useRef(),i=M.useState(-1),o=$qn(i,2),s=o[0],a=o[1];M.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&a(w)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,g=n.animationDuration,m=n.animationBegin,v=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var b=Re("recharts-rectangle",h);return y?Te.createElement(ug,{canBegin:s>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:g,animationEasing:p,isActive:y},function(w){var S=w.width,_=w.height,E=w.x,T=w.y;return Te.createElement(ug,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,isActive:v,easing:p},Te.createElement("path",H4({},sr(n,!0),{className:b,d:oFe(E,T,S,_,d),ref:r})))}):Te.createElement("path",H4({},sr(n,!0),{className:b,d:oFe(l,c,u,f,d)}))};function Foe(){return Foe=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jqn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var eXn=function(t,n,r,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},tXn=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.top,a=s===void 0?0:s,l=t.left,c=l===void 0?0:l,u=t.width,f=u===void 0?0:u,d=t.height,h=d===void 0?0:d,p=t.className,g=Zqn(t,qqn),m=Xqn({x:r,y:o,top:a,left:c,width:f,height:h},g);return!At(r)||!At(o)||!At(f)||!At(h)||!At(a)||!At(c)?null:Te.createElement("path",$oe({},sr(m,!0),{className:Re("recharts-cross",p),d:eXn(r,o,f,h,a,c)}))},SZ,aFe;function nXn(){if(aFe)return SZ;aFe=1;var e=Tot(),t=e(Object.getPrototypeOf,Object);return SZ=t,SZ}var _Z,lFe;function rXn(){if(lFe)return _Z;lFe=1;var e=Nv(),t=nXn(),n=zv(),r="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,a=o.hasOwnProperty,l=s.call(Object);function c(u){if(!n(u)||e(u)!=r)return!1;var f=t(u);if(f===null)return!0;var d=a.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&s.call(d)==l}return _Z=c,_Z}var iXn=rXn();const oXn=Yn(iXn);var CZ,cFe;function sXn(){if(cFe)return CZ;cFe=1;var e=Nv(),t=zv(),n="[object Boolean]";function r(i){return i===!0||i===!1||t(i)&&e(i)==n}return CZ=r,CZ}var aXn=sXn();const lXn=Yn(aXn);function xI(e){"@babel/helpers - typeof";return xI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xI(e)}function G4(){return G4=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:g,animationEasing:p,isActive:v},function(b){var w=b.upperWidth,S=b.lowerWidth,_=b.height,E=b.x,T=b.y;return Te.createElement(ug,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,easing:p},Te.createElement("path",G4({},sr(n,!0),{className:y,d:hFe(E,T,w,S,_),ref:r})))}):Te.createElement("g",null,Te.createElement("path",G4({},sr(n,!0),{className:y,d:hFe(l,c,u,f,d)})))},bXn=["option","shapeType","propTransformer","activeClassName","isActive"];function wI(e){"@babel/helpers - typeof";return wI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wI(e)}function xXn(e,t){if(e==null)return{};var n=wXn(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wXn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function pFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function q4(e){for(var t=1;t0&&r.handleDrag(i.changedTouches[0])}),uu(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,a=i.startIndex;s?.({endIndex:o,startIndex:a})}),r.detachDragEndListener()}),uu(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),uu(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),uu(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),uu(r,"handleSlideDragStart",function(i){var o=CFe(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return YXn(t,e),HXn(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,a=this.props,l=a.gap,c=a.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=t.getIndexInRange(s,f),p=t.getIndexInRange(s,d);return{startIndex:h-h%l,endIndex:p===u?u:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,a=i.dataKey,l=Ql(o[r],a,r);return tr(s)?s(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,a=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,g=r.pageX-o;g>0?g=Math.min(g,c+u-f-a,c+u-f-s):g<0&&(g=Math.max(g,c-s,c-a));var m=this.getIndex({startX:s+g,endX:a+g});(m.startIndex!==d||m.endIndex!==h)&&p&&p(m),this.setState({startX:s+g,endX:a+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=CFe(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,a=i.endX,l=i.startX,c=this.state[s],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,g=u.gap,m=u.data,v={startX:this.state.startX,endX:this.state.endX},y=r.pageX-o;y>0?y=Math.min(y,f+d-h-c):y<0&&(y=Math.max(y,f-c)),v[s]=c+y;var b=this.getIndex(v),w=b.startIndex,S=b.endIndex,_=function(){var T=m.length-1;return s==="startX"&&(a>l?w%g===0:S%g===0)||al?S%g===0:w%g===0)||a>l&&S===T};this.setState(uu(uu({},s,c+y),"brushMoveStartX",r.pageX),function(){p&&_()&&p(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,a=s.scaleValues,l=s.startX,c=s.endX,u=this.state[i],f=a.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=a.length)){var h=a[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(uu({},i,h),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.fill,c=r.stroke;return Te.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:s,height:a})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.data,c=r.children,u=r.padding,f=M.Children.only(c);return f?Te.cloneElement(f,{x:i,y:o,width:s,height:a,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,a=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,g=l.startIndex,m=l.endIndex,v=Math.max(r,this.props.x),y=kZ(kZ({},sr(this.props,!1)),{},{x:v,y:c,width:u,height:f}),b=h||"Min value: ".concat((o=p[g])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=p[m])===null||s===void 0?void 0:s.name);return Te.createElement(Zi,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),a.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(d,y))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,a=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return Te.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:s,width:f,height:a})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,a=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,d=u.endX,h=5,p={pointerEvents:"none",fill:c};return Te.createElement(Zi,{className:"recharts-brush-texts"},Te.createElement(I4,Y4({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:s+a/2},p),this.getTextOfTick(i)),Te.createElement(I4,Y4({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:s+a/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,a=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,g=d.isTextActive,m=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!At(a)||!At(l)||!At(c)||!At(u)||c<=0||u<=0)return null;var b=Re("recharts-brush",o),w=Te.Children.count(s)===1,S=VXn("userSelect","none");return Te.createElement(Zi,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),w&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(g||m||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,a=r.height,l=r.stroke,c=Math.floor(o+a/2)-1;return Te.createElement(Te.Fragment,null,Te.createElement("rect",{x:i,y:o,width:s,height:a,fill:l,stroke:"none"}),Te.createElement("line",{x1:i+1,y1:c,x2:i+s-1,y2:c,fill:"none",stroke:"#fff"}),Te.createElement("line",{x1:i+1,y1:c+2,x2:i+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return Te.isValidElement(r)?o=Te.cloneElement(r,i):tr(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,a=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return kZ({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s},o&&o.length?KXn({data:o,width:s,x:a,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||a!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([a,a+s-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,a=o-1;a-s>1;){var l=Math.floor((s+a)/2);r[l]>i?a=l:s=l}return i>=r[a]?a:s}}])})(M.PureComponent);uu(Bw,"displayName","Brush");uu(Bw,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var MZ,OFe;function ZXn(){if(OFe)return MZ;OFe=1;var e=Dme();function t(n,r){var i;return e(n,function(o,s,a){return i=r(o,s,a),!i}),!!i}return MZ=t,MZ}var AZ,EFe;function JXn(){if(EFe)return AZ;EFe=1;var e=xot(),t=Hb(),n=ZXn(),r=Xc(),i=_W();function o(s,a,l){var c=r(s)?e:n;return l&&i(s,a,l)&&(a=void 0),c(s,t(a,3))}return AZ=o,AZ}var eYn=JXn();const tYn=Yn(eYn);var Qp=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},RZ,TFe;function nYn(){if(TFe)return RZ;TFe=1;var e=Not();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return RZ=t,RZ}var IZ,PFe;function rYn(){if(PFe)return IZ;PFe=1;var e=nYn(),t=Fot(),n=Hb();function r(i,o){var s={};return o=n(o,3),t(i,function(a,l,c){e(s,l,o(a,l,c))}),s}return IZ=r,IZ}var iYn=rYn();const oYn=Yn(iYn);var DZ,kFe;function sYn(){if(kFe)return DZ;kFe=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gYn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function mYn(e,t){var n=e.x,r=e.y,i=pYn(e,uYn),o="".concat(n),s=parseInt(o,10),a="".concat(r),l=parseInt(a,10),c="".concat(t.height||i.height),u=parseInt(c,10),f="".concat(t.width||i.width),d=parseInt(f,10);return S2(S2(S2(S2(S2({},t),i),s?{x:s}:{}),l?{y:l}:{}),{},{height:u,width:d,name:t.name,radius:t.radius})}function IFe(e){return Te.createElement(PXn,zoe({shapeType:"rectangle",propTransformer:mYn,activeClassName:"recharts-active-bar"},e))}var vYn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=At(r)||DUn(r);return o?t(r,i):(o||jw(),n)}},yYn=["value","background"],Lst;function YE(e){"@babel/helpers - typeof";return YE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},YE(e)}function bYn(e,t){if(e==null)return{};var n=xYn(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xYn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function K4(){return K4=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(L)0&&Math.abs(A)0&&(F=Math.min((Q||0)-(A[Y-1]||0),F))}),Number.isFinite(F)){var L=F/R,$=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(E=L*$/2),g.padding==="no-gap"){var j=Nw(t.barCategoryGap,L*$),V=L*$/2;E=V-j-(V-j)/$*j}}}i==="xAxis"?T=[r.left+(b.left||0)+(E||0),r.left+r.width-(b.right||0)-(E||0)]:i==="yAxis"?T=l==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(E||0),r.top+r.height-(b.bottom||0)-(E||0)]:T=g.range,S&&(T=[T[1],T[0]]);var U=WGn(g,o,d),z=U.scale,N=U.realScaleType;z.domain(v).range(T),HGn(z);var B=JGn(z,jd(jd({},g),{},{realScaleType:N}));i==="xAxis"?(I=m==="top"&&!w||m==="bottom"&&w,k=r.left,P=f[_]-I*g.height):i==="yAxis"&&(I=m==="left"&&!w||m==="right"&&w,k=f[_]-I*g.width,P=r.top);var H=jd(jd(jd({},g),B),{},{realScaleType:N,x:k,y:P,scale:z,width:i==="xAxis"?r.width:g.width,height:i==="yAxis"?r.height:g.height});return H.bandSize=N4(H,B),!g.hide&&i==="xAxis"?f[_]+=(I?-1:1)*H.height:g.hide||(f[_]+=(I?-1:1)*H.width),jd(jd({},h),{},MW({},p,H))},{})},zst=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},AYn=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return zst({x:n,y:r},{x:i,y:o})},jst=(function(){function e(t){PYn(this,e),this.scale=t}return kYn(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(n)+a}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])})();MW(jst,"EPS",1e-4);var Ume=function(t){var n=Object.keys(t).reduce(function(r,i){return jd(jd({},r),{},MW({},i,jst.create(t[i])))},{});return jd(jd({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,a=o.position;return oYn(i,function(l,c){return n[c].apply(l,{bandAware:s,position:a})})},isInRange:function(i){return Dst(i,function(o,s){return n[s].isInRange(o)})}})};function RYn(e){return(e%180+180)%180}var IYn=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=RYn(i),s=o*Math.PI/180,a=Math.atan(r/n),l=s>a&&s-1?l[c?o[u]:u]:void 0}}return $Z=r,$Z}var NZ,zFe;function LYn(){if(zFe)return NZ;zFe=1;var e=Mst();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return NZ=t,NZ}var zZ,jFe;function FYn(){if(jFe)return zZ;jFe=1;var e=Aot(),t=Hb(),n=LYn(),r=Math.max;function i(o,s,a){var l=o==null?0:o.length;if(!l)return-1;var c=a==null?0:n(a);return c<0&&(c=r(l+c,0)),e(o,t(s,3),c)}return zZ=i,zZ}var jZ,BFe;function $Yn(){if(BFe)return jZ;BFe=1;var e=DYn(),t=FYn(),n=e(t);return jZ=n,jZ}var NYn=$Yn();const zYn=Yn(NYn);var jYn=lot();const BYn=Yn(jYn);var UYn=BYn(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Vme=M.createContext(void 0),Wme=M.createContext(void 0),Bst=M.createContext(void 0),Ust=M.createContext({}),Vst=M.createContext(void 0),Wst=M.createContext(0),Hst=M.createContext(0),UFe=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=t.clipPathId,a=t.children,l=t.width,c=t.height,u=UYn(o);return Te.createElement(Vme.Provider,{value:r},Te.createElement(Wme.Provider,{value:i},Te.createElement(Ust.Provider,{value:o},Te.createElement(Bst.Provider,{value:u},Te.createElement(Vst.Provider,{value:s},Te.createElement(Wst.Provider,{value:c},Te.createElement(Hst.Provider,{value:l},a)))))))},VYn=function(){return M.useContext(Vst)},Gst=function(t){var n=M.useContext(Vme);n==null&&jw();var r=n[t];return r==null&&jw(),r},WYn=function(){var t=M.useContext(Vme);return r0(t)},HYn=function(){var t=M.useContext(Wme),n=zYn(t,function(r){return Dst(r.domain,Number.isFinite)});return n||r0(t)},qst=function(t){var n=M.useContext(Wme);n==null&&jw();var r=n[t];return r==null&&jw(),r},GYn=function(){var t=M.useContext(Bst);return t},qYn=function(){return M.useContext(Ust)},Hme=function(){return M.useContext(Hst)},Gme=function(){return M.useContext(Wst)};function QE(e){"@babel/helpers - typeof";return QE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},QE(e)}function XYn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YYn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function MQn(e,t){return eat(e,t+1)}function AQn(e,t,n,r,i){for(var o=(r||[]).slice(),s=t.start,a=t.end,l=0,c=1,u=s,f=function(){var p=r?.[l];if(p===void 0)return{v:eat(r,c)};var g=l,m,v=function(){return m===void 0&&(m=n(p,g)),m},y=p.coordinate,b=l===0||n6(e,y,v,u,a);b||(l=0,u=s,c+=1),b&&(u=y+e*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function EI(e){"@babel/helpers - typeof";return EI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EI(e)}function QFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t0?h.coordinate-m*e:h.coordinate})}else o[d]=h=el(el({},h),{},{tickCoord:h.coordinate});var v=n6(e,h.tickCoord,g,a,l);v&&(l=h.tickCoord-e*(g()/2+i),o[d]=el(el({},h),{},{isShow:!0}))},u=s-1;u>=0;u--)c(u);return o}function FQn(e,t,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=t.start,c=t.end;if(o){var u=r[a-1],f=n(u,a-1),d=e*(u.coordinate+e*f/2-c);s[a-1]=u=el(el({},u),{},{tickCoord:d>0?u.coordinate-d*e:u.coordinate});var h=n6(e,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-e*(f/2+i),s[a-1]=el(el({},u),{},{isShow:!0}))}for(var p=o?a-1:a,g=function(y){var b=s[y],w,S=function(){return w===void 0&&(w=n(b,y)),w};if(y===0){var _=e*(b.coordinate-e*S()/2-l);s[y]=b=el(el({},b),{},{tickCoord:_<0?b.coordinate-_*e:b.coordinate})}else s[y]=b=el(el({},b),{},{tickCoord:b.coordinate});var E=n6(e,b.tickCoord,S,l,c);E&&(l=b.tickCoord+e*(S()/2+i),s[y]=el(el({},b),{},{isShow:!0}))},m=0;m=2?ih(i[1].coordinate-i[0].coordinate):1,v=kQn(o,m,h);return l==="equidistantPreserveStart"?AQn(m,v,g,i,s):(l==="preserveStart"||l==="preserveStartEnd"?d=FQn(m,v,g,i,s,l==="preserveStartEnd"):d=LQn(m,v,g,i,s),d.filter(function(y){return y.isShow}))}var $Qn=["viewBox"],NQn=["viewBox"],zQn=["ticks"];function JE(e){"@babel/helpers - typeof";return JE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},JE(e)}function XC(){return XC=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jQn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function BQn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZFe(e,t){for(var n=0;n0?l(this.props):l(h)),s<=0||a<=0||!p||!p.length?null:Te.createElement(Zi,{className:Re("recharts-cartesian-axis",c),ref:function(m){r.layerReference=m}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),sl.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s,a=Re(i.className,"recharts-cartesian-axis-tick-value");return Te.isValidElement(r)?s=Te.cloneElement(r,Os(Os({},i),{},{className:a})):tr(r)?s=r(Os(Os({},i),{},{className:a})):s=Te.createElement(I4,XC({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])})(M.Component);Yme(kP,"displayName","CartesianAxis");Yme(kP,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var XQn=["x1","y1","x2","y2","key"],YQn=["offset"];function Uw(e){"@babel/helpers - typeof";return Uw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uw(e)}function JFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function al(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JQn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var eKn=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,o=t.y,s=t.width,a=t.height,l=t.ry;return Te.createElement("rect",{x:i,y:o,ry:l,width:s,height:a,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function rat(e,t){var n;if(Te.isValidElement(e))n=Te.cloneElement(e,t);else if(tr(e))n=e(t);else{var r=t.x1,i=t.y1,o=t.x2,s=t.y2,a=t.key,l=e$e(t,XQn),c=sr(l,!1);c.offset;var u=e$e(c,YQn);n=Te.createElement("line",g1({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:a}))}return n}function tKn(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var c=al(al({},e),{},{x1:t,y1:a,x2:t+n,y2:a,key:"line-".concat(l),index:l});return rat(i,c)});return Te.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function nKn(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,o=e.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var c=al(al({},e),{},{x1:a,y1:t,x2:a,y2:t+n,key:"line-".concat(l),index:l});return rat(i,c)});return Te.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function rKn(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,o=e.width,s=e.height,a=e.horizontalPoints,l=e.horizontal,c=l===void 0?!0:l;if(!c||!t||!t.length)return null;var u=a.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],g=p?i+s-d:u[h+1]-d;if(g<=0)return null;var m=h%t.length;return Te.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:g,width:o,stroke:"none",fill:t[m],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return Te.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function iKn(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,o=e.x,s=e.y,a=e.width,l=e.height,c=e.verticalPoints;if(!n||!r||!r.length)return null;var u=c.map(function(d){return Math.round(d+o-o)}).sort(function(d,h){return d-h});o!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],g=p?o+a-d:u[h+1]-d;if(g<=0)return null;var m=h%r.length;return Te.createElement("rect",{key:"react-".concat(h),x:d,y:s,width:g,height:l,stroke:"none",fill:r[m],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return Te.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var oKn=function(t,n){var r=t.xAxis,i=t.width,o=t.height,s=t.offset;return vst(Xme(al(al(al({},kP.defaultProps),r),{},{ticks:$m(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},sKn=function(t,n){var r=t.yAxis,i=t.width,o=t.height,s=t.offset;return vst(Xme(al(al(al({},kP.defaultProps),r),{},{ticks:$m(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},U_={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Qme(e){var t,n,r,i,o,s,a=Hme(),l=Gme(),c=qYn(),u=al(al({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:U_.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:U_.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:U_.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:U_.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:U_.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:U_.verticalFill,x:At(e.x)?e.x:c.left,y:At(e.y)?e.y:c.top,width:At(e.width)?e.width:c.width,height:At(e.height)?e.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,g=u.syncWithTicks,m=u.horizontalValues,v=u.verticalValues,y=WYn(),b=HYn();if(!At(h)||h<=0||!At(p)||p<=0||!At(f)||f!==+f||!At(d)||d!==+d)return null;var w=u.verticalCoordinatesGenerator||oKn,S=u.horizontalCoordinatesGenerator||sKn,_=u.horizontalPoints,E=u.verticalPoints;if((!_||!_.length)&&tr(S)){var T=m&&m.length,k=S({yAxis:b?al(al({},b),{},{ticks:T?m:b.ticks}):void 0,width:a,height:l,offset:c},T?!0:g);Jm(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Uw(k),"]")),Array.isArray(k)&&(_=k)}if((!E||!E.length)&&tr(w)){var P=v&&v.length,I=w({xAxis:y?al(al({},y),{},{ticks:P?v:y.ticks}):void 0,width:a,height:l,offset:c},P?!0:g);Jm(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Uw(I),"]")),Array.isArray(I)&&(E=I)}return Te.createElement("g",{className:"recharts-cartesian-grid"},Te.createElement(eKn,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height,ry:u.ry}),Te.createElement(tKn,g1({},u,{offset:c,horizontalPoints:_,xAxis:y,yAxis:b})),Te.createElement(nKn,g1({},u,{offset:c,verticalPoints:E,xAxis:y,yAxis:b})),Te.createElement(rKn,g1({},u,{horizontalPoints:_})),Te.createElement(iKn,g1({},u,{verticalPoints:E})))}Qme.displayName="CartesianGrid";var aKn=["type","layout","connectNulls","ref"],lKn=["key"];function eT(e){"@babel/helpers - typeof";return eT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eT(e)}function t$e(e,t){if(e==null)return{};var n=cKn(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cKn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gA(){return gA=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nf){h=[].concat(V_(l.slice(0,p)),[f-g]);break}var m=h.length%2===0?[0,d]:[d];return[].concat(V_(t.repeat(l,u)),V_(h),m).map(function(v){return"".concat(v,"px")}).join(", ")}),Bd(n,"id",_P("recharts-line-")),Bd(n,"pathRef",function(s){n.mainCurve=s}),Bd(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Bd(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return bKn(t,e),gKn(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,a=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=Uf(u,TP);if(!f)return null;var d=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Ql(g.payload,m)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Te.createElement(Zi,h,f.map(function(p){return Te.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:s,xAxis:a,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,c=a.points,u=a.dataKey,f=sr(this.props,!1),d=sr(l,!0),h=c.map(function(g,m){var v=lu(lu(lu({key:"dot-".concat(m),r:3},f),d),{},{index:m,cx:g.x,cy:g.y,value:g.value,dataKey:u,payload:g.payload,points:c});return t.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return Te.createElement(Zi,gA({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,s){var a=this.props,l=a.type,c=a.layout,u=a.connectNulls;a.ref;var f=t$e(a,aKn),d=lu(lu(lu({},sr(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:l,layout:c,connectNulls:u});return Te.createElement(PO,gA({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,c=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,d=s.animationEasing,h=s.animationId,p=s.animateNewValues,g=s.width,m=s.height,v=this.state,y=v.prevPoints,b=v.totalLength;return Te.createElement(ug,{begin:u,duration:f,isActive:c,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(w){var S=w.t;if(y){var _=y.length/a.length,E=a.map(function(R,F){var A=Math.floor(F*_);if(y[A]){var L=y[A],$=Ea(L.x,R.x),j=Ea(L.y,R.y);return lu(lu({},R),{},{x:$(S),y:j(S)})}if(p){var V=Ea(g*2,R.x),U=Ea(m/2,R.y);return lu(lu({},R),{},{x:V(S),y:U(S)})}return lu(lu({},R),{},{x:R.x,y:R.y})});return o.renderCurveStatically(E,r,i)}var T=Ea(0,b),k=T(S),P;if(l){var I="".concat(l).split(/[,\s]+/gim).map(function(R){return parseFloat(R)});P=o.getStrokeDasharray(k,b,I)}else P=o.generateSimpleStrokeDasharray(b,k);return o.renderCurveStatically(a,r,i,{strokeDasharray:P})})}},{key:"renderCurve",value:function(r,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return a&&s&&s.length&&(!c&&u>0||!HE(c,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,b=Re("recharts-line",l),w=c&&c.allowDataOverflow,S=u&&u.allowDataOverflow,_=w||S,E=dr(m)?this.id:m,T=(r=sr(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=T.r,P=k===void 0?3:k,I=T.strokeWidth,R=I===void 0?2:I,F=hot(s)?s:{},A=F.clipDot,L=A===void 0?!0:A,$=P*2+R;return Te.createElement(Zi,{className:b},w||S?Te.createElement("defs",null,Te.createElement("clipPath",{id:"clipPath-".concat(E)},Te.createElement("rect",{x:w?d:d-h/2,y:S?f:f-p/2,width:w?h:h*2,height:S?p:p*2})),!L&&Te.createElement("clipPath",{id:"clipPath-dots-".concat(E)},Te.createElement("rect",{x:d-$/2,y:f-$/2,width:h+$,height:p+$}))):null,!y&&this.renderCurve(_,E),this.renderErrorBar(_,E),(y||s)&&this.renderDots(_,L,E),(!g||v)&&tv.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(V_(r),[0]):r,s=[],a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Kn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function m1(){return m1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!HE(u,s)||!HE(f,a))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,b=Re("recharts-area",l),w=f&&f.allowDataOverflow,S=d&&d.allowDataOverflow,_=w||S,E=dr(m)?this.id:m,T=(r=sr(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=T.r,P=k===void 0?3:k,I=T.strokeWidth,R=I===void 0?2:I,F=hot(s)?s:{},A=F.clipDot,L=A===void 0?!0:A,$=P*2+R;return Te.createElement(Zi,{className:b},w||S?Te.createElement("defs",null,Te.createElement("clipPath",{id:"clipPath-".concat(E)},Te.createElement("rect",{x:w?u:u-h/2,y:S?c:c-p/2,width:w?h:h*2,height:S?p:p*2})),!L&&Te.createElement("clipPath",{id:"clipPath-dots-".concat(E)},Te.createElement("rect",{x:u-$/2,y:c-$/2,width:h+$,height:p+$}))):null,y?null:this.renderArea(_,E),(s||y)&&this.renderDots(_,L,E),(!g||v)&&tv.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])})(M.PureComponent);sat=qb;Rp(qb,"displayName","Area");Rp(qb,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!IS.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Rp(qb,"getBaseValue",function(e,t,n,r){var i=e.layout,o=e.baseValue,s=t.props.baseValue,a=s??o;if(At(a)&&typeof a=="number")return a;var l=i==="horizontal"?r:n,c=l.scale.domain();if(l.type==="number"){var u=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]});Rp(qb,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,o=e.xAxisTicks,s=e.yAxisTicks,a=e.bandSize,l=e.dataKey,c=e.stackedData,u=e.dataStartIndex,f=e.displayedData,d=e.offset,h=t.layout,p=c&&c.length,g=sat.getBaseValue(t,n,r,i),m=h==="horizontal",v=!1,y=f.map(function(w,S){var _;p?_=c[u+S]:(_=Ql(w,l),Array.isArray(_)?v=!0:_=[g,_]);var E=_[1]==null||p&&Ql(w,l)==null;return m?{x:$4({axis:r,ticks:o,bandSize:a,entry:w,index:S}),y:E?null:i.scale(_[1]),value:_,payload:w}:{x:E?null:r.scale(_[1]),y:$4({axis:i,ticks:s,bandSize:a,entry:w,index:S}),value:_,payload:w}}),b;return p||v?b=y.map(function(w){var S=Array.isArray(w.value)?w.value[0]:null;return m?{x:w.x,y:S!=null&&w.y!=null?i.scale(S):null}:{x:S!=null?r.scale(S):null,y:w.y}}):b=m?i.scale(g):r.scale(g),Ly({points:y,baseLine:b,layout:h,isRange:v},d)});Rp(qb,"renderDotItem",function(e,t){var n;if(Te.isValidElement(e))n=Te.cloneElement(e,t);else if(tr(e))n=e(t);else{var r=Re("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,o=aat(t,SKn);n=Te.createElement(TW,m1({},o,{key:i,className:r}))}return n});function nT(e){"@babel/helpers - typeof";return nT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nT(e)}function AKn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RKn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bZn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function xZn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wZn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?s:t&&t.length&&At(i)&&At(o)?t.slice(i,o+1):[]};function Sat(e){return e==="number"?[0,"auto"]:void 0}var ose=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,a=DW(n,t);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var d;if(s.dataKey&&!s.allowDuplicatedCategory){var h=f===void 0?a:f;d=O4(h,s.dataKey,i)}else d=f&&f[r]||a[r];return d?[].concat(oT(l),[bst(c,d)]):l},[])},d$e=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=IZn(o,r),a=t.orderedTooltipTicks,l=t.tooltipAxis,c=t.tooltipTicks,u=NGn(s,a,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=ose(t,n,u,f),h=DZn(r,a,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},LZn=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.layout,f=t.children,d=t.stackOffset,h=mst(u,o);return r.reduce(function(p,g){var m,v=g.type.defaultProps!==void 0?rt(rt({},g.type.defaultProps),g.props):g.props,y=v.type,b=v.dataKey,w=v.allowDataOverflow,S=v.allowDuplicatedCategory,_=v.scale,E=v.ticks,T=v.includeHidden,k=v[s];if(p[k])return p;var P=DW(t.data,{graphicalItems:i.filter(function(B){var H,Q=s in B.props?B.props[s]:(H=B.type.defaultProps)===null||H===void 0?void 0:H[s];return Q===k}),dataStartIndex:l,dataEndIndex:c}),I=P.length,R,F,A;aZn(v.domain,w,y)&&(R=Soe(v.domain,null,w),h&&(y==="number"||_!=="auto")&&(A=hA(P,b,"category")));var L=Sat(y);if(!R||R.length===0){var $,j=($=v.domain)!==null&&$!==void 0?$:L;if(b){if(R=hA(P,b,y),y==="category"&&h){var V=FUn(R);S&&V?(F=R,R=X4(0,I)):S||(R=TLe(j,R,g).reduce(function(B,H){return B.indexOf(H)>=0?B:[].concat(oT(B),[H])},[]))}else if(y==="category")S?R=R.filter(function(B){return B!==""&&!dr(B)}):R=TLe(j,R,g).reduce(function(B,H){return B.indexOf(H)>=0||H===""||dr(H)?B:[].concat(oT(B),[H])},[]);else if(y==="number"){var U=VGn(P,i.filter(function(B){var H,Q,Y=s in B.props?B.props[s]:(H=B.type.defaultProps)===null||H===void 0?void 0:H[s],Z="hide"in B.props?B.props.hide:(Q=B.type.defaultProps)===null||Q===void 0?void 0:Q.hide;return Y===k&&(T||!Z)}),b,o,u);U&&(R=U)}h&&(y==="number"||_!=="auto")&&(A=hA(P,b,"category"))}else h?R=X4(0,I):a&&a[k]&&a[k].hasStack&&y==="number"?R=d==="expand"?[0,1]:yst(a[k].stackGroups,l,c):R=gst(P,i.filter(function(B){var H=s in B.props?B.props[s]:B.type.defaultProps[s],Q="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return H===k&&(T||!Q)}),y,u,!0);if(y==="number")R=nse(f,R,k,o,E),j&&(R=Soe(j,R,w));else if(y==="category"&&j){var z=j,N=R.every(function(B){return z.indexOf(B)>=0});N&&(R=z)}}return rt(rt({},p),{},Dn({},k,rt(rt({},v),{},{axisType:o,domain:R,categoricalDomain:A,duplicateDomain:F,originalDomain:(m=v.domain)!==null&&m!==void 0?m:L,isCategorical:h,layout:u})))},{})},FZn=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.layout,f=t.children,d=DW(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=mst(u,o),g=-1;return r.reduce(function(m,v){var y=v.type.defaultProps!==void 0?rt(rt({},v.type.defaultProps),v.props):v.props,b=y[s],w=Sat("number");if(!m[b]){g++;var S;return p?S=X4(0,h):a&&a[b]&&a[b].hasStack?(S=yst(a[b].stackGroups,l,c),S=nse(f,S,b,o)):(S=Soe(w,gst(d,r.filter(function(_){var E,T,k=s in _.props?_.props[s]:(E=_.type.defaultProps)===null||E===void 0?void 0:E[s],P="hide"in _.props?_.props.hide:(T=_.type.defaultProps)===null||T===void 0?void 0:T.hide;return k===b&&!P}),"number",u),i.defaultProps.allowDataOverflow),S=nse(f,S,b,o)),rt(rt({},m),{},Dn({},b,rt(rt({axisType:o},i.defaultProps),{},{hide:!0,orientation:Bf(AZn,"".concat(o,".").concat(g%2),null),domain:S,originalDomain:w,isCategorical:p,layout:u})))}return m},{})},$Zn=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.children,f="".concat(i,"Id"),d=Uf(u,o),h={};return d&&d.length?h=LZn(t,{axes:d,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(h=FZn(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c})),h},NZn=function(t){var n=r0(t),r=$m(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Lme(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:N4(n,r)}},h$e=function(t){var n=t.children,r=t.defaultShowTooltip,i=gu(n,Bw),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},zZn=function(t){return!t||!t.length?!1:t.some(function(n){var r=Zm(n&&n.type);return r&&r.indexOf("Bar")>=0})},p$e=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},jZn=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,a=t.yAxisMap,l=a===void 0?{}:a,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=gu(f,Bw),p=gu(f,V1),g=Object.keys(l).reduce(function(S,_){var E=l[_],T=E.orientation;return!E.mirror&&!E.hide?rt(rt({},S),{},Dn({},T,S[T]+E.width)):S},{left:d.left||0,right:d.right||0}),m=Object.keys(s).reduce(function(S,_){var E=s[_],T=E.orientation;return!E.mirror&&!E.hide?rt(rt({},S),{},Dn({},T,Bf(S,"".concat(T))+E.height)):S},{top:d.top||0,bottom:d.bottom||0}),v=rt(rt({},m),g),y=v.bottom;h&&(v.bottom+=h.props.height||Bw.defaultProps.height),p&&n&&(v=BGn(v,i,r,n));var b=c-v.left-v.right,w=u-v.top-v.bottom;return rt(rt({brushBottom:y},v),{},{width:Math.max(b,0),height:Math.max(w,0)})},BZn=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Kme=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,a=s===void 0?["axis"]:s,l=t.axisComponents,c=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,d=function(v,y){var b=y.graphicalItems,w=y.stackGroups,S=y.offset,_=y.updateId,E=y.dataStartIndex,T=y.dataEndIndex,k=v.barSize,P=v.layout,I=v.barGap,R=v.barCategoryGap,F=v.maxBarSize,A=p$e(P),L=A.numericAxisName,$=A.cateAxisName,j=zZn(b),V=[];return b.forEach(function(U,z){var N=DW(v.data,{graphicalItems:[U],dataStartIndex:E,dataEndIndex:T}),B=U.type.defaultProps!==void 0?rt(rt({},U.type.defaultProps),U.props):U.props,H=B.dataKey,Q=B.maxBarSize,Y=B["".concat(L,"Id")],Z=B["".concat($,"Id")],ge={},ne=l.reduce(function(Pe,ee){var re=y["".concat(ee.axisType,"Map")],Se=B["".concat(ee.axisType,"Id")];re&&re[Se]||ee.axisType==="zAxis"||jw();var he=re[Se];return rt(rt({},Pe),{},Dn(Dn({},ee.axisType,he),"".concat(ee.axisType,"Ticks"),$m(he)))},ge),ie=ne[$],fe=ne["".concat($,"Ticks")],ve=w&&w[Y]&&w[Y].hasStack&&t9n(U,w[Y].stackGroups),se=Zm(U.type).indexOf("Bar")>=0,ue=N4(ie,fe),G=[],ce=j&&zGn({barSize:k,stackGroups:w,totalSize:BZn(ne,$)});if(se){var pe,J,te=dr(Q)?F:Q,ae=(pe=(J=N4(ie,fe,!0))!==null&&J!==void 0?J:te)!==null&&pe!==void 0?pe:0;G=jGn({barGap:I,barCategoryGap:R,bandSize:ae!==ue?ae:ue,sizeList:ce[Z],maxBarSize:te}),ae!==ue&&(G=G.map(function(Pe){return rt(rt({},Pe),{},{position:rt(rt({},Pe.position),{},{offset:Pe.position.offset-ae/2})})}))}var we=U&&U.type&&U.type.getComposedData;we&&V.push({props:rt(rt({},we(rt(rt({},ne),{},{displayedData:N,props:v,dataKey:H,item:U,bandSize:ue,barPosition:G,offset:S,stackedData:ve,layout:P,dataStartIndex:E,dataEndIndex:T}))),{},Dn(Dn(Dn({key:U.key||"item-".concat(z)},L,ne[L]),$,ne[$]),"animationId",_)),childIndex:XUn(U,v.children),item:U})}),V},h=function(v,y){var b=v.props,w=v.dataStartIndex,S=v.dataEndIndex,_=v.updateId;if(!kRe({props:b}))return null;var E=b.children,T=b.layout,k=b.stackOffset,P=b.data,I=b.reverseStackOrder,R=p$e(T),F=R.numericAxisName,A=R.cateAxisName,L=Uf(E,r),$=ZGn(P,L,"".concat(F,"Id"),"".concat(A,"Id"),k,I),j=l.reduce(function(B,H){var Q="".concat(H.axisType,"Map");return rt(rt({},B),{},Dn({},Q,$Zn(b,rt(rt({},H),{},{graphicalItems:L,stackGroups:H.axisType===F&&$,dataStartIndex:w,dataEndIndex:S}))))},{}),V=jZn(rt(rt({},j),{},{props:b,graphicalItems:L}),y?.legendBBox);Object.keys(j).forEach(function(B){j[B]=u(b,j[B],V,B.replace("Map",""),n)});var U=j["".concat(A,"Map")],z=NZn(U),N=d(b,rt(rt({},j),{},{dataStartIndex:w,dataEndIndex:S,updateId:_,graphicalItems:L,stackGroups:$,offset:V}));return rt(rt({formattedGraphicalItems:N,graphicalItems:L,offset:V,stackGroups:$},z),j)},p=(function(m){function v(y){var b,w,S;return xZn(this,v),S=_Zn(this,v,[y]),Dn(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Dn(S,"accessibilityManager",new sZn),Dn(S,"handleLegendBBoxUpdate",function(_){if(_){var E=S.state,T=E.dataStartIndex,k=E.dataEndIndex,P=E.updateId;S.setState(rt({legendBBox:_},h({props:S.props,dataStartIndex:T,dataEndIndex:k,updateId:P},rt(rt({},S.state),{},{legendBBox:_}))))}}),Dn(S,"handleReceiveSyncEvent",function(_,E,T){if(S.props.syncId===_){if(T===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(E)}}),Dn(S,"handleBrushChange",function(_){var E=_.startIndex,T=_.endIndex;if(E!==S.state.dataStartIndex||T!==S.state.dataEndIndex){var k=S.state.updateId;S.setState(function(){return rt({dataStartIndex:E,dataEndIndex:T},h({props:S.props,dataStartIndex:E,dataEndIndex:T,updateId:k},S.state))}),S.triggerSyncEvent({dataStartIndex:E,dataEndIndex:T})}}),Dn(S,"handleMouseEnter",function(_){var E=S.getMouseInfo(_);if(E){var T=rt(rt({},E),{},{isTooltipActive:!0});S.setState(T),S.triggerSyncEvent(T);var k=S.props.onMouseEnter;tr(k)&&k(T,_)}}),Dn(S,"triggeredAfterMouseMove",function(_){var E=S.getMouseInfo(_),T=E?rt(rt({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(T),S.triggerSyncEvent(T);var k=S.props.onMouseMove;tr(k)&&k(T,_)}),Dn(S,"handleItemMouseEnter",function(_){S.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Dn(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Dn(S,"handleMouseMove",function(_){_.persist(),S.throttleTriggeredAfterMouseMove(_)}),Dn(S,"handleMouseLeave",function(_){S.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};S.setState(E),S.triggerSyncEvent(E);var T=S.props.onMouseLeave;tr(T)&&T(E,_)}),Dn(S,"handleOuterEvent",function(_){var E=qUn(_),T=Bf(S.props,"".concat(E));if(E&&tr(T)){var k,P;/.*touch.*/i.test(E)?P=S.getMouseInfo(_.changedTouches[0]):P=S.getMouseInfo(_),T((k=P)!==null&&k!==void 0?k:{},_)}}),Dn(S,"handleClick",function(_){var E=S.getMouseInfo(_);if(E){var T=rt(rt({},E),{},{isTooltipActive:!0});S.setState(T),S.triggerSyncEvent(T);var k=S.props.onClick;tr(k)&&k(T,_)}}),Dn(S,"handleMouseDown",function(_){var E=S.props.onMouseDown;if(tr(E)){var T=S.getMouseInfo(_);E(T,_)}}),Dn(S,"handleMouseUp",function(_){var E=S.props.onMouseUp;if(tr(E)){var T=S.getMouseInfo(_);E(T,_)}}),Dn(S,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Dn(S,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.handleMouseDown(_.changedTouches[0])}),Dn(S,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.handleMouseUp(_.changedTouches[0])}),Dn(S,"handleDoubleClick",function(_){var E=S.props.onDoubleClick;if(tr(E)){var T=S.getMouseInfo(_);E(T,_)}}),Dn(S,"handleContextMenu",function(_){var E=S.props.onContextMenu;if(tr(E)){var T=S.getMouseInfo(_);E(T,_)}}),Dn(S,"triggerSyncEvent",function(_){S.props.syncId!==void 0&&VZ.emit(WZ,S.props.syncId,_,S.eventEmitterSymbol)}),Dn(S,"applySyncEvent",function(_){var E=S.props,T=E.layout,k=E.syncMethod,P=S.state.updateId,I=_.dataStartIndex,R=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)S.setState(rt({dataStartIndex:I,dataEndIndex:R},h({props:S.props,dataStartIndex:I,dataEndIndex:R,updateId:P},S.state)));else if(_.activeTooltipIndex!==void 0){var F=_.chartX,A=_.chartY,L=_.activeTooltipIndex,$=S.state,j=$.offset,V=$.tooltipTicks;if(!j)return;if(typeof k=="function")L=k(V,_);else if(k==="value"){L=-1;for(var U=0;U=0){var ve,se;if(F.dataKey&&!F.allowDuplicatedCategory){var ue=typeof F.dataKey=="function"?fe:"payload.".concat(F.dataKey.toString());ve=O4(U,ue,L),se=z&&N&&O4(N,ue,L)}else ve=U?.[A],se=z&&N&&N[A];if(Z||Y){var G=_.props.activeIndex!==void 0?_.props.activeIndex:A;return[M.cloneElement(_,rt(rt(rt({},k.props),ne),{},{activeIndex:G})),null,null]}if(!dr(ve))return[ie].concat(oT(S.renderActivePoints({item:k,activePoint:ve,basePoint:se,childIndex:A,isRange:z})))}else{var ce,pe=(ce=S.getItemByXY(S.state.activeCoordinate))!==null&&ce!==void 0?ce:{graphicalItem:ie},J=pe.graphicalItem,te=J.item,ae=te===void 0?_:te,we=J.childIndex,Pe=rt(rt(rt({},k.props),ne),{},{activeIndex:we});return[M.cloneElement(ae,Pe),null,null]}return z?[ie,null,null]:[ie,null]}),Dn(S,"renderCustomized",function(_,E,T){return M.cloneElement(_,rt(rt({key:"recharts-customized-".concat(T)},S.props),S.state))}),Dn(S,"renderMap",{CartesianGrid:{handler:y3,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:y3},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:y3},YAxis:{handler:y3},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((b=y.id)!==null&&b!==void 0?b:_P("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=Wot(S.triggeredAfterMouseMove,(w=y.throttleDelay)!==null&&w!==void 0?w:1e3/60),S.state={},S}return EZn(v,m),SZn(v,[{key:"componentDidMount",value:function(){var b,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,w=b.children,S=b.data,_=b.height,E=b.layout,T=gu(w,ip);if(T){var k=T.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var P=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,I=ose(this.state,S,k,P),R=this.state.tooltipTicks[k].coordinate,F=(this.state.offset.top+_)/2,A=E==="horizontal",L=A?{x:R,y:F}:{y:R,x:F},$=this.state.formattedGraphicalItems.find(function(V){var U=V.item;return U.type.name==="Scatter"});$&&(L=rt(rt({},L),$.props.points[k].tooltipPosition),I=$.props.points[k].tooltipPayload);var j={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:P,activePayload:I,activeCoordinate:L};this.setState(j),this.renderCursor(T),this.accessibilityManager.setIndex(k)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var S,_;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(b){toe([gu(b.children,ip)],[gu(this.props.children,ip)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=gu(this.props.children,ip);if(b&&typeof b.props.shared=="boolean"){var w=b.props.shared?"axis":"item";return a.indexOf(w)>=0?w:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var w=this.container,S=w.getBoundingClientRect(),_=tHn(S),E={chartX:Math.round(b.pageX-_.left),chartY:Math.round(b.pageY-_.top)},T=S.width/w.offsetWidth||1,k=this.inRange(E.chartX,E.chartY,T);if(!k)return null;var P=this.state,I=P.xAxisMap,R=P.yAxisMap,F=this.getTooltipEventType(),A=d$e(this.state,this.props.data,this.props.layout,k);if(F!=="axis"&&I&&R){var L=r0(I).scale,$=r0(R).scale,j=L&&L.invert?L.invert(E.chartX):null,V=$&&$.invert?$.invert(E.chartY):null;return rt(rt({},E),{},{xValue:j,yValue:V},A)}return A?rt(rt({},E),A):null}},{key:"inRange",value:function(b,w){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,E=b/S,T=w/S;if(_==="horizontal"||_==="vertical"){var k=this.state.offset,P=E>=k.left&&E<=k.left+k.width&&T>=k.top&&T<=k.top+k.height;return P?{x:E,y:T}:null}var I=this.state,R=I.angleAxisMap,F=I.radiusAxisMap;if(R&&F){var A=r0(R);return MLe({x:E,y:T},A)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,w=this.getTooltipEventType(),S=gu(b,ip),_={};S&&w==="axis"&&(S.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var E=E4(this.props,this.handleOuterEvent);return rt(rt({},E),_)}},{key:"addListener",value:function(){VZ.on(WZ,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){VZ.removeListener(WZ,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,w,S){for(var _=this.state.formattedGraphicalItems,E=0,T=_.length;E!Fr(e)||!Number.isFinite(e)?"":IA(e),GZn=e=>e.toPrecision(3),GZ={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function qZn({payload:e,removeTimeSeries:t}){return!e||e.length===0?null:O.jsx(bt,{sx:GZ.legendContainer,children:e.map((n,r)=>O.jsxs(bt,{sx:{...GZ.legendItem,color:n.color},children:[O.jsx("span",{children:n.value}),t&&O.jsx(bt,{component:"span",sx:GZ.legendCloseIcon,onMouseUp:()=>t(r),children:O.jsx(z8,{fontSize:"small"})})]},n.value))})}const qZ={toolTipContainer:e=>({backgroundColor:"black",opacity:.8,color:"white",border:"2px solid black",borderRadius:e.spacing(2),padding:e.spacing(1.5)}),toolTipValue:{fontWeight:"bold"},toolTipLabel:e=>({fontWeight:"bold",paddingBottom:e.spacing(1)})},XZn="#00000000",YZn="#FAFFDD";function QZn({active:e,label:t,payload:n}){if(!e||!Fr(t)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:s,value:a,unit:l,dataKey:c}=i;let u=i.color;if(!Fr(a))return null;const f=s||"?",d=a.toFixed(3);u===XZn&&(u=YZn);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),O.jsxs("div",{children:[O.jsxs("span",{children:[f,": "]}),O.jsx(bt,{component:"span",sx:qZ.toolTipValue,style:{color:u},children:d}),O.jsxs("span",{children:[" ",p]})]},o)});return r?O.jsxs(bt,{sx:qZ.toolTipContainer,children:[O.jsx(bt,{component:"span",sx:qZ.toolTipLabel,children:`${yT(t)} UTC`}),r]}):null}function g$e({cx:e,cy:t,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:s}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(s==="diamond"){const g=1024*(n/c);f=O.jsx("polygon",{points:`${512-g},512 512,${512-g} ${512+g},512 512,${512+g}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=O.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return Fr(e)&&Fr(t)?O.jsx("svg",{x:e-l,y:t-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function KZn({timeSeriesGroup:e,timeSeriesIndex:t,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:s,paletteMode:a,chartType:l,stdevBars:c}){const u=e.timeSeriesArray[t],f=u.source,d=()=>{n&&n(e.id,t,u),i(u.source.placeId,r,!0)};let h=`${f.datasetTitle}:${f.variableName}`,p="red";if(f.placeId===null){let b=null;s.forEach(w=>{if(b===null&&w.placeGroup.id===f.datasetId){const S=w.placeGroup.features;S.length>0&&S[0].properties&&(b=S[0].properties.color||null)}}),p=b||"red"}else if(o){const b=o[f.placeId];if(b){const{place:w,label:S,color:_}=b;if(w.geometry.type==="Point"){const E=w.geometry.coordinates[0],T=w.geometry.coordinates[1];h+=` (${S}: ${T.toFixed(5)},${E.toFixed(5)})`}else h+=` (${S})`;p=_}}const g=p5e(p,a);let m,v;u.source.placeId===null?(m=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(m=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&O.jsx(TP,{dataKey:`ev${t}`,width:4,strokeWidth:1,stroke:g,strokeOpacity:.5});return l==="bar"?O.jsx(LS,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${t}`,fill:g,fillOpacity:m,isAnimationActive:!1,onClick:d,children:y},t):O.jsx(HL,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${t}`,dot:O.jsx(g$e,{...v,stroke:g,fill:"white"}),activeDot:O.jsx(g$e,{...v,stroke:"white",fill:g}),stroke:g,strokeOpacity:m,isAnimationActive:!1,onClick:d,children:y},t)}const ZZn=at(O.jsx("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatio"),JZn=at(O.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart"),eJn=at(O.jsx("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Comment"),tJn=at(O.jsx("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand"),nJn=at(O.jsx("path",{d:"M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zM18 8H6v8h12z"}),"FitScreen"),_at=at(O.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M5.5 7.5h2v-2H9v2h2V9H9v2H7.5V9h-2zM19 19H5L19 5zm-2-2v-1.5h-5V17z"}),"Iso"),rJn=at([O.jsx("circle",{cx:"7",cy:"14",r:"3"},"0"),O.jsx("circle",{cx:"11",cy:"6",r:"3"},"1"),O.jsx("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot"),iJn=at(O.jsx("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart"),Cat=({children:e,initialOpacity:t,sx:n,...r})=>O.jsx(bt,{id:"data-hover-invisible-box",...r,sx:{...n,"&:hover > *":{opacity:1,visibility:"visible"},"& > *":{opacity:t||0,visibility:t?void 0:"hidden",transition:"opacity 0.5s ease, visibility 0.5s ease"}},children:e});function Oat({elementRef:e,postMessage:t,exportResolution:n,hiddenElementItems:r=[]}){const o={postMessage:t,exportResolution:n,hiddenElements:a=>MZe(a,r)},{onSnapshotClick:s}=qtt(e,o);return O.jsx(Vl,{tooltipText:Ce.get("Copy snapshot to clipboard"),onClick:s,icon:O.jsx($tt,{fontSize:"inherit"})})}function oJn({sx:e,timeSeriesGroupId:t,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=Te.useState(null),s=f=>{o(f.currentTarget)},a=()=>{o(null)},l=f=>{o(null),r(t,f)},c=[];n.forEach(f=>{Object.getOwnPropertyNames(f.timeSeries).forEach(d=>{const h=`${f.placeGroup.title} / ${d}`;c.push(O.jsx(nr,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return O.jsxs(O.Fragment,{children:[O.jsx(Mn,{size:"small",sx:e,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:s,disabled:c.length===0,children:O.jsx(_n,{arrow:!0,title:Ce.get("Add time-series from places"),children:O.jsx(Y8,{fontSize:"inherit"})})}),O.jsx(Qw,{id:"basic-menu",anchorEl:i,open:u,onClose:a,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const b3={container:e=>({padding:e.spacing(1),display:"flex",flexDirection:"column",gap:e.spacing(1)}),minMaxBox:e=>({display:"flex",justifyContent:"center",gap:e.spacing(1)}),minTextField:{maxWidth:"8em"},maxTextField:{maxWidth:"8em"}};function sJn({anchorEl:e,valueRange:t,setValueRange:n}){const[r,i]=M.useState(t?[t[0]+"",t[1]+""]:["0","1"]);if(!e)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],s=Number.isFinite(o[0])&&Number.isFinite(o[1])&&o[0]{const d=f.target.value;i([d,r[1]])},l=f=>{const d=f.target.value;i([r[0],d])},c=()=>{n(o)},u=()=>{n(void 0)};return O.jsx(Yw,{anchorEl:e,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:O.jsxs(bt,{sx:b3.container,children:[O.jsxs(bt,{component:"form",sx:b3.minMaxBox,children:[O.jsx(Ii,{sx:b3.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!s,onChange:f=>a(f)}),O.jsx(Ii,{sx:b3.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!s,onChange:f=>l(f)})]}),O.jsx(Q8,{onDone:c,doneDisabled:!s,onCancel:u,size:"medium"})]})})}const x3="stddev",yy={headerContainer:{display:"flex",flexDirection:"row",justifyContent:"right"},actionsContainer:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",gap:"1px"},responsiveContainer:{flexGrow:"1px"},actionButton:{zIndex:1e3,opacity:.8},chartTitle:{fontSize:"inherit",fontWeight:"normal"},chartTypes:e=>({paddingLeft:e.spacing(1),paddingRight:e.spacing(1)})};function aJn({timeSeriesGroup:e,placeGroupTimeSeries:t,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:s,zoomMode:a,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:g,valueRange:m,setValueRange:v,chartElement:y,postMessage:b,exportResolution:w}){const S=M.useRef(null),[_,E]=M.useState(!1),T=()=>{E(!_)},k=I=>{E(!1),I&&v(I)},P=(I,R)=>{const F=new Set(R),A=F.has(x3);F.delete(x3),F.delete(f),R=Array.from(F),d(R.length===1?R[0]:f),g(A)};return O.jsx(bt,{sx:yy.headerContainer,children:O.jsxs(bt,{sx:yy.actionsContainer,children:[O.jsxs(Cat,{sx:yy.actionsContainer,initialOpacity:.05,children:[s&&O.jsx(_n,{arrow:!0,title:Ce.get("Zoom to full range"),children:O.jsx(Mn,{sx:yy.actionButton,onClick:i,size:"small",children:O.jsx(nJn,{fontSize:"inherit"})},"zoomOutButton")}),O.jsx(_n,{arrow:!0,title:Ce.get("Toggle zoom mode (or press CTRL key)"),children:O.jsx(oo,{value:"zoomMode",selected:a,onClick:()=>l(!a),size:"small",children:O.jsx(ZZn,{fontSize:"inherit"})})}),O.jsx(sJn,{anchorEl:_?S.current:null,valueRange:m,setValueRange:k}),O.jsx(_n,{arrow:!0,title:Ce.get("Enter fixed y-range"),children:O.jsx(oo,{ref:S,value:"valueRange",selected:_,onClick:T,size:"small",children:O.jsx(tJn,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Toggle showing info popup on hover"),children:O.jsx(oo,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:O.jsx(eJn,{fontSize:"inherit"})})}),O.jsxs(GI,{value:p?[f,x3]:[f],onChange:P,size:"small",sx:yy.chartTypes,children:[O.jsx(_n,{arrow:!0,title:Ce.get("Show points"),children:O.jsx(oo,{value:"point",size:"small",children:O.jsx(rJn,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Show lines"),children:O.jsx(oo,{value:"line",size:"small",children:O.jsx(iJn,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Show bars"),children:O.jsx(oo,{value:"bar",size:"small",children:O.jsx(JZn,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Show standard deviation (if any)"),children:O.jsx(oo,{value:x3,size:"small",disabled:h,children:O.jsx(_at,{fontSize:"inherit"})})})]}),O.jsx(Oat,{elementRef:y,postMessage:b,exportResolution:w}),O.jsx(oJn,{sx:yy.actionButton,timeSeriesGroupId:e.id,placeGroupTimeSeries:t,addPlaceGroupTimeSeries:n})]}),o?O.jsx(Ch,{size:24,sx:yy.actionButton,color:"secondary"}):O.jsx(Mn,{sx:yy.actionButton,"aria-label":"Close",onClick:()=>r(e.id),size:"small",children:O.jsx(fP,{fontSize:"inherit"})})]})})}const lJn=Qn("div")(({theme:e})=>({userSelect:"none",marginTop:e.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),cJn={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function uJn({timeSeriesGroup:e,selectTimeSeries:t,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:s,selectPlace:a,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,postMessage:m,exportResolution:v}){const y=qw(),[b,w]=M.useState(!1),[S,_]=M.useState(!0),[E,T]=M.useState(u),[k,P]=M.useState(f),[I,R]=M.useState({}),F=M.useRef(),A=M.useRef(),L=M.useRef(),$=M.useRef(null),j=M.useRef(null),V=M.useMemo(()=>{const he=new Map;e.timeSeriesArray.forEach((me,be)=>{const oe=`v${be}`,Ee=`ev${be}`,ke=me.source.valueDataKey,ze=me.source.errorDataKey;me.data.forEach(De=>{const Ve=he.get(De.time);let Ze;Ve===void 0?(Ze={time:De.time},he.set(De.time,Ze)):Ze=Ve;const mt=De[ke];if(Fr(mt)&&isFinite(mt)&&(Ze[oe]=mt),ze){const Me=De[ze];Fr(Me)&&isFinite(Me)&&(Ze[Ee]=Me)}})});const xe=Array.from(he.values());return xe.sort((me,be)=>me.time-be.time),xe},[e]),U=M.useMemo(()=>e.timeSeriesArray.map(he=>he.dataProgress?he.dataProgress:0),[e]);M.useEffect(J,[]);const z=U.reduce((he,xe)=>he+xe,0)/U.length,N=z>0&&z<1,B=!!i&&!xRt(i,c||null);e.timeSeriesArray.forEach(he=>{he.source.valueDataKey});const H=e.variableUnits||Ce.get("unknown units"),Q=`${Ce.get("Quantity")} (${H})`,Y=y.palette.primary.light,Z=y.palette.primary.main,ge=y.palette.text.primary,ne=()=>{Fr(I.x1)&&R({})},ie=he=>{if(!he)return;const{chartX:xe,chartY:me}=he;if(!Fr(xe)||!Fr(me))return;const be=Pe(xe,me);if(be){const[oe,Ee]=be;R({x1:oe,y1:Ee})}},fe=(he,xe)=>{const{x1:me,y1:be}=I;if(!Fr(me)||!Fr(be)||!he)return;const{chartX:oe,chartY:Ee}=he;if(!Fr(oe)||!Fr(Ee))return;const ke=Pe(oe,Ee);if(ke){const[ze,De]=ke;xe.ctrlKey||b?ze!==me&&De!==be&&R({x1:me,y1:be,x2:ze,y2:De}):ze!==me&&R({x1:me,y1:be,x2:ze})}},ve=he=>{const[xe,me]=m$e(I);ne(),xe&&xe[0]{ne()},ue=()=>{ne()},G=he=>{d(e.id,he)},ce=()=>{ne(),o(c||null,e.id,null)},pe=he=>{he&&o(i,e.id,he)};function J(){if($.current){const he=$.current.getElementsByClassName("recharts-legend-wrapper");he.length!==0&&(j.current=he.item(0))}}const te=(he,xe)=>{L.current=[he,xe],J()},ae=([he,xe])=>{const me=(xe-he)*.1;return i?F.current=i:F.current=[he-me,xe+me],F.current},we=([he,xe])=>{const me=(xe-he)*.1;if(e.variableRange)A.current=e.variableRange;else{const be=he-me;A.current=[be<0&&he-1e-6>0?0:be,xe+me]}return A.current},Pe=(he,xe)=>{if(!L.current||!F.current||!A.current)return;const me=65,be=5,oe=5,Ee=38,ke=20,[ze,De]=F.current,[Ve,Ze]=A.current,[mt,Me]=L.current,ct=j.current,Fe=ct?ct.clientHeight:ke,ht=mt-me-oe,gt=Me-be-Ee-Fe,St=(he-me)/ht,on=(xe-be)/gt;return[ze+St*(De-ze),Ze-on*(Ze-Ve)]},[ee,re]=m$e(I),Se=E==="bar"?VZn:UZn;return O.jsxs(lJn,{children:[O.jsx(aJn,{timeSeriesGroup:e,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,removeTimeSeriesGroup:h,resetZoom:ce,loading:N,zoomed:B,zoomMode:b,setZoomMode:w,showTooltips:S,setShowTooltips:_,chartType:E,setChartType:T,stdevBarsDisabled:!f,stdevBars:k,setStdevBars:P,valueRange:A.current,setValueRange:pe,chartElement:$,postMessage:m,exportResolution:v}),O.jsx(Hot,{width:"98%",onResize:te,ref:$,children:O.jsxs(Se,{onMouseDown:ie,onMouseMove:fe,onMouseUp:ve,onMouseEnter:se,onMouseLeave:ue,syncId:"anyId",style:{color:ge,fontSize:"0.7rem"},data:V,barGap:1,barSize:30,maxBarSize:30,children:[O.jsx(FS,{dataKey:"time",type:"number",tickCount:6,domain:ae,tickFormatter:HZn,stroke:ge,allowDataOverflow:!0}),O.jsx($S,{type:"number",tickCount:5,domain:we,tickFormatter:GZn,stroke:ge,allowDataOverflow:!0,label:{...cJn,value:Q}}),O.jsx(Qme,{strokeDasharray:"3 3"}),S&&!Fr(I.x1)&&O.jsx(ip,{content:O.jsx(QZn,{})}),O.jsx(V1,{content:O.jsx(qZn,{removeTimeSeries:G})}),e.timeSeriesArray.map((he,xe)=>KZn({timeSeriesGroup:e,timeSeriesIndex:xe,selectTimeSeries:t,places:s,selectPlace:a,placeGroupTimeSeries:p,placeInfos:l,chartType:E,stdevBars:k,paletteMode:y.palette.mode})),ee&&O.jsx(PP,{x1:ee[0],y1:re?re[0]:void 0,x2:ee[1],y2:re?re[1]:void 0,strokeOpacity:.3,fill:Y,fillOpacity:.3}),n!==null&&O.jsx(WL,{isFront:!0,x:n,stroke:Z,strokeWidth:3,strokeOpacity:.5})]})})]})}function m$e(e){const{x1:t,x2:n,y1:r,y2:i}=e;let o,s;return Fr(t)&&Fr(n)&&(o=tO.jsx(uJn,{timeSeriesGroup:c,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,exportResolution:a,...l},c.id))]})}const gJn=e=>({locale:e.controlState.locale,timeSeriesGroups:e.dataState.timeSeriesGroups,selectedTime:e.controlState.selectedTime,selectedTimeRange:e.controlState.selectedTimeRange,dataTimeRange:mIt(e),chartTypeDefault:e.controlState.timeSeriesChartTypeDefault,includeStdev:e.controlState.timeSeriesIncludeStdev,placeInfos:_It(e),places:pD(e),placeGroupTimeSeries:TRt(e),canAddTimeSeries:d4e(e),exportResolution:e.controlState.exportResolution}),mJn={selectTime:F8,selectTimeRange:vJe,removeTimeSeries:ISn,removeTimeSeriesGroup:DSn,selectPlace:L8,addPlaceGroupTimeSeries:RSn,addTimeSeries:D8,postMessage:la},vJn=hr(gJn,mJn)(pJn),yJn=at(O.jsx("path",{d:"M22 18v-2H8V4h2L7 1 4 4h2v2H2v2h4v8c0 1.1.9 2 2 2h8v2h-2l3 3 3-3h-2v-2zM10 8h6v6h2V8c0-1.1-.9-2-2-2h-6z"}),"Transform");function bJn(e){return e.count===0}function xJn(e){return e.count===1}function wJn(e){return e.count>1}function SJn({statisticsRecord:e}){const t=e.statistics;return O.jsx(N6,{size:"small",children:O.jsx(j6,{children:bJn(t)?O.jsxs(hf,{children:[O.jsx(mi,{children:Ce.get("Value")}),O.jsx(mi,{align:"right",children:"NaN"})]}):xJn(t)?O.jsxs(hf,{children:[O.jsx(mi,{children:Ce.get("Value")}),O.jsx(mi,{align:"right",children:_2(t.mean)})]}):O.jsxs(O.Fragment,{children:[O.jsxs(hf,{children:[O.jsx(mi,{children:Ce.get("Count")}),O.jsx(mi,{align:"right",children:t.count})]}),O.jsxs(hf,{children:[O.jsx(mi,{children:Ce.get("Minimum")}),O.jsx(mi,{align:"right",children:_2(t.minimum)})]}),O.jsxs(hf,{children:[O.jsx(mi,{children:Ce.get("Maximum")}),O.jsx(mi,{align:"right",children:_2(t.maximum)})]}),O.jsxs(hf,{children:[O.jsx(mi,{children:Ce.get("Mean")}),O.jsx(mi,{align:"right",children:_2(t.mean)})]}),O.jsxs(hf,{children:[O.jsx(mi,{children:Ce.get("Deviation")}),O.jsx(mi,{align:"right",children:_2(t.deviation)})]})]})})})}function _2(e){return jf(e,3)}function _Jn({statisticsRecord:e,showBrush:t,showDetails:n}){const r=as(),i=e.statistics,o=M.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:b}=i.histogram;return y.map((w,S)=>({x:.5*(b[S]+b[S+1]),y:w,i:S}))},[i]),[s,a]=M.useState([0,o?o.length-1:-1]);if(M.useEffect(()=>{o&&a([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=e.source,[c,u]=s,f=o[c]?o[c].x:NaN,d=o[u]?o[u].x:NaN,h=Math.max(i.mean-i.deviation,i.minimum,f),p=Math.min(i.mean+i.deviation,i.maximum,d),g=r.palette.text.primary,m=r.palette.text.primary,v=({startIndex:y,endIndex:b})=>{Fr(y)&&Fr(b)&&a([y,b])};return O.jsx(Hot,{width:"100%",height:"100%",children:O.jsxs(WZn,{data:o,margin:{top:0,right:t?30:5,bottom:1,left:2},style:{color:m,fontSize:"0.8rem"},children:[O.jsx(Qme,{strokeDasharray:"3 3"}),O.jsx(FS,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>jf(y,2)}),O.jsx($S,{}),O.jsx(qb,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&O.jsx(WL,{x:i.mean,isFront:!0,stroke:g,strokeWidth:2,strokeOpacity:.5}),n&&O.jsx(PP,{x1:h,x2:p,isFront:!1,stroke:g,strokeWidth:1,strokeOpacity:.3,fill:g,fillOpacity:.05}),t&&O.jsx(Bw,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>jf(o[y].x,1),onChange:v})]})})}const w3={container:{padding:0,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function S3({phrase:e}){return O.jsx("span",{style:{color:"red"},children:`<${Ce.get(e)} ?>`})}function Eat({dataset:e,variable:t,time:n,placeInfo:r,actions:i,body:o,containerRef:s}){const a=e?e.title:O.jsx(S3,{phrase:"Dataset"}),l=t?t.name:O.jsx(S3,{phrase:"Variable"}),c=e?.dimensions.some(d=>d.name=="time"),u=n?dje(n):c?O.jsx(S3,{phrase:"Time"}):null,f=r?r.label:O.jsx(S3,{phrase:"Place"});return O.jsxs(bt,{sx:w3.container,ref:s,children:[O.jsxs(bt,{sx:w3.header,children:[O.jsxs(mn,{fontSize:"small",variant:"inherit",component:"span",children:[a," / ",l,u&&`, ${u}`,", ",f]}),O.jsx(bt,{id:"statistics-row-buttons",sx:w3.actions,children:i})]}),o&&O.jsx(bt,{sx:w3.body,children:o})]})}const XZ={table:{flexGrow:0},chart:{flexGrow:1},hoverVisibleBox:{display:"flex",gap:.1}};function CJn({locale:e,statisticsRecord:t,rowIndex:n,removeStatistics:r,postMessage:i,exportResolution:o}){const s=M.useRef(null),[a,l]=M.useState(!1),[c,u]=M.useState(!1),{dataset:f,variable:d,time:h,placeInfo:p}=t.source,g=wJn(t.statistics),m=()=>{u(!c)},v=()=>{l(!a)},y=()=>{r(n)};return O.jsx(Eat,{dataset:f,variable:d,time:h,placeInfo:p,containerRef:s,actions:O.jsxs(O.Fragment,{children:[O.jsxs(Cat,{sx:XZ.hoverVisibleBox,initialOpacity:.05,children:[g&&O.jsxs(GI,{size:"small",children:[O.jsx(_n,{arrow:!0,title:Ce.get("Toggle adjustable x-range"),children:O.jsx(oo,{selected:a,onClick:v,value:"brush",size:"small",children:O.jsx(yJn,{fontSize:"inherit"})})}),O.jsx(_n,{arrow:!0,title:Ce.get("Show standard deviation (if any)"),children:O.jsx(oo,{selected:c,onClick:m,value:"details",size:"small",children:O.jsx(_at,{fontSize:"inherit"})})})]}),g&&O.jsx(Oat,{elementRef:s,postMessage:i,exportResolution:o,hiddenElementItems:["#statistics-row-buttons"]})]}),O.jsx(Mn,{size:"small",onClick:y,children:O.jsx(fP,{fontSize:"inherit"})})]}),body:O.jsxs(O.Fragment,{children:[O.jsx(bt,{sx:XZ.table,children:O.jsx(SJn,{locale:e,statisticsRecord:t})}),O.jsx(bt,{sx:XZ.chart,children:O.jsx(_Jn,{showBrush:a,showDetails:c,statisticsRecord:t})})]})})}const OJn={progress:{color:"primary"}};function EJn({selectedDataset:e,selectedVariable:t,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:s}){return O.jsx(Eat,{dataset:e,variable:t,time:n,placeInfo:r,actions:s?O.jsx(Ch,{size:20,sx:OJn.progress}):O.jsx(Mn,{size:"small",disabled:!i,onClick:o,color:"primary",children:O.jsx(Y8,{})})})}const TJn={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function PJn({selectedDataset:e,selectedVariable:t,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:s,addStatistics:a,removeStatistics:l,postMessage:c,exportResolution:u}){return O.jsxs(bt,{sx:TJn.container,children:[O.jsx(EJn,{selectedDataset:e,selectedVariable:t,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:s,addStatistics:a,statisticsLoading:i}),o.map((f,d)=>O.jsx(CJn,{statisticsRecord:f,rowIndex:d,removeStatistics:l,postMessage:c,exportResolution:u},d))]})}const kJn=e=>({selectedDataset:Co(e),selectedVariable:ec(e),selectedTime:aS(e),selectedPlaceInfo:gD(e),statisticsLoading:ORt(e),statisticsRecords:CIt(e),canAddStatistics:h4e(e),exportResolution:e.controlState.exportResolution}),MJn={addStatistics:zZe,removeStatistics:MSn,postMessage:la},AJn=hr(kJn,MJn)(PJn);const Zme="144",W_={ROTATE:0,DOLLY:1,PAN:2},H_={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},RJn=0,v$e=1,IJn=2,Tat=1,DJn=2,EM=3,sT=0,Fu=1,Nm=2,$0=0,kO=1,y$e=2,b$e=3,x$e=4,LJn=5,CC=100,FJn=101,$Jn=102,w$e=103,S$e=104,NJn=200,zJn=201,jJn=202,BJn=203,Pat=204,kat=205,UJn=206,VJn=207,WJn=208,HJn=209,GJn=210,qJn=0,XJn=1,YJn=2,sse=3,QJn=4,KJn=5,ZJn=6,JJn=7,Mat=0,eer=1,ter=2,nv=0,ner=1,rer=2,ier=3,oer=4,ser=5,Aat=300,aT=301,lT=302,ase=303,lse=304,LW=306,cse=1e3,xf=1001,use=1002,xc=1003,_$e=1004,C$e=1005,wc=1006,aer=1007,FW=1008,Vw=1009,ler=1010,cer=1011,Rat=1012,uer=1013,v1=1014,x0=1015,kI=1016,fer=1017,der=1018,MO=1020,her=1021,per=1022,Ip=1023,ger=1024,mer=1025,H1=1026,cT=1027,Iat=1028,ver=1029,yer=1030,ber=1031,xer=1033,YZ=33776,QZ=33777,KZ=33778,ZZ=33779,O$e=35840,E$e=35841,T$e=35842,P$e=35843,wer=36196,k$e=37492,M$e=37496,A$e=37808,R$e=37809,I$e=37810,D$e=37811,L$e=37812,F$e=37813,$$e=37814,N$e=37815,z$e=37816,j$e=37817,B$e=37818,U$e=37819,V$e=37820,W$e=37821,H$e=36492,Ww=3e3,Lo=3001,Ser=3200,_er=3201,Cer=0,Oer=1,pm="srgb",y1="srgb-linear",JZ=7680,Eer=519,G$e=35044,q$e="300 es",fse=1035;class NS{addEventListener(t,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[t]===void 0&&(r[t]=[]),r[t].indexOf(n)===-1&&r[t].push(n)}hasEventListener(t,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[t]!==void 0&&r[t].indexOf(n)!==-1}removeEventListener(t,n){if(this._listeners===void 0)return;const i=this._listeners[t];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const r=this._listeners[t.type];if(r!==void 0){t.target=this;const i=r.slice(0);for(let o=0,s=i.length;o>8&255]+Xa[e>>16&255]+Xa[e>>24&255]+"-"+Xa[t&255]+Xa[t>>8&255]+"-"+Xa[t>>16&15|64]+Xa[t>>24&255]+"-"+Xa[n&63|128]+Xa[n>>8&255]+"-"+Xa[n>>16&255]+Xa[n>>24&255]+Xa[r&255]+Xa[r>>8&255]+Xa[r>>16&255]+Xa[r>>24&255]).toLowerCase()}function Sc(e,t,n){return Math.max(t,Math.min(n,e))}function Ter(e,t){return(e%t+t)%t}function tJ(e,t,n){return(1-n)*e+n*t}function Y$e(e){return(e&e-1)===0&&e!==0}function dse(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function _3(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function ru(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw new Error("Invalid component type.")}}class _r{constructor(t=0,n=0){_r.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,n){return this.x=t,this.y=n,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const n=this.x,r=this.y,i=t.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y;return n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this}rotateAround(t,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-t.x,s=this.y-t.y;return this.x=o*r-s*i+t.x,this.y=o*i+s*r+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Pu{constructor(){Pu.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,n,r,i,o,s,a,l,c){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const n=this.elements,r=t.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(t,n,r){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const n=t.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const r=t.elements,i=n.elements,o=this.elements,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],g=i[0],m=i[3],v=i[6],y=i[1],b=i[4],w=i[7],S=i[2],_=i[5],E=i[8];return o[0]=s*g+a*y+l*S,o[3]=s*m+a*b+l*_,o[6]=s*v+a*w+l*E,o[1]=c*g+u*y+f*S,o[4]=c*m+u*b+f*_,o[7]=c*v+u*w+f*E,o[2]=d*g+h*y+p*S,o[5]=d*m+h*b+p*_,o[8]=d*v+h*w+p*E,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this}determinant(){const t=this.elements,n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return n*s*u-n*a*c-r*o*u+r*a*l+i*o*c-i*s*l}invert(){const t=this.elements,n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],f=u*s-a*c,d=a*l-u*o,h=c*o-s*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return t[0]=f*g,t[1]=(i*c-u*r)*g,t[2]=(a*r-i*s)*g,t[3]=d*g,t[4]=(u*n-i*l)*g,t[5]=(i*o-a*n)*g,t[6]=h*g,t[7]=(r*l-c*n)*g,t[8]=(s*n-r*o)*g,this}transpose(){let t;const n=this.elements;return t=n[1],n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const n=this.elements;return t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8],this}setUvTransform(t,n,r,i,o,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*s+c*a)+s+t,-i*c,i*l,-i*(-c*s+l*a)+a+n,0,0,1),this}scale(t,n){const r=this.elements;return r[0]*=t,r[3]*=t,r[6]*=t,r[1]*=n,r[4]*=n,r[7]*=n,this}rotate(t){const n=Math.cos(t),r=Math.sin(t),i=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*s+r*c,i[6]=n*a+r*u,i[1]=-r*o+n*l,i[4]=-r*s+n*c,i[7]=-r*a+n*u,this}translate(t,n){const r=this.elements;return r[0]+=t*r[2],r[3]+=t*r[5],r[6]+=t*r[8],r[1]+=n*r[2],r[4]+=n*r[5],r[7]+=n*r[8],this}equals(t){const n=this.elements,r=t.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(t,n=0){for(let r=0;r<9;r++)this.elements[r]=t[r+n];return this}toArray(t=[],n=0){const r=this.elements;return t[n]=r[0],t[n+1]=r[1],t[n+2]=r[2],t[n+3]=r[3],t[n+4]=r[4],t[n+5]=r[5],t[n+6]=r[6],t[n+7]=r[7],t[n+8]=r[8],t}clone(){return new this.constructor().fromArray(this.elements)}}function Dat(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function MI(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function G1(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function a5(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}const nJ={[pm]:{[y1]:G1},[y1]:{[pm]:a5}},Td={legacyMode:!0,get workingColorSpace(){return y1},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,n){if(this.legacyMode||t===n||!t||!n)return e;if(nJ[t]&&nJ[t][n]!==void 0){const r=nJ[t][n];return e.r=r(e.r),e.g=r(e.g),e.b=r(e.b),e}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}},Lat={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Es={r:0,g:0,b:0},Pd={h:0,s:0,l:0},C3={h:0,s:0,l:0};function rJ(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}function O3(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}class yo{constructor(t,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,n===void 0&&r===void 0?this.set(t):this.setRGB(t,n,r)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,n=pm){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Td.toWorkingColorSpace(this,n),this}setRGB(t,n,r,i=y1){return this.r=t,this.g=n,this.b=r,Td.toWorkingColorSpace(this,i),this}setHSL(t,n,r,i=y1){if(t=Ter(t,1),n=Sc(n,0,1),r=Sc(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=rJ(s,o,t+1/3),this.g=rJ(s,o,t),this.b=rJ(s,o,t-1/3)}return Td.toWorkingColorSpace(this,i),this}setStyle(t,n=pm){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let o;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,Td.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,Td.toWorkingColorSpace(this,n),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const l=parseFloat(o[1])/360,c=parseFloat(o[2])/100,u=parseFloat(o[3])/100;return r(o[4]),this.setHSL(l,c,u,n)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const o=i[1],s=o.length;if(s===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,Td.toWorkingColorSpace(this,n),this;if(s===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,Td.toWorkingColorSpace(this,n),this}return t&&t.length>0?this.setColorName(t,n):this}setColorName(t,n=pm){const r=Lat[t.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=G1(t.r),this.g=G1(t.g),this.b=G1(t.b),this}copyLinearToSRGB(t){return this.r=a5(t.r),this.g=a5(t.g),this.b=a5(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=pm){return Td.fromWorkingColorSpace(O3(this,Es),t),Sc(Es.r*255,0,255)<<16^Sc(Es.g*255,0,255)<<8^Sc(Es.b*255,0,255)<<0}getHexString(t=pm){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,n=y1){Td.fromWorkingColorSpace(O3(this,Es),n);const r=Es.r,i=Es.g,o=Es.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const f=s-a;switch(c=u<=.5?f/(s+a):f/(2-s-a),s){case r:l=(i-o)/f+(i"u")return t.src;let n;if(t instanceof HTMLCanvasElement)n=t;else{G_===void 0&&(G_=MI("canvas")),G_.width=t.width,G_.height=t.height;const r=G_.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),n=G_}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const n=MI("canvas");n.width=t.width,n.height=t.height;const r=n.getContext("2d");r.drawImage(t,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height),o=i.data;for(let s=0;s1)switch(this.wrapS){case cse:t.x=t.x-Math.floor(t.x);break;case xf:t.x=t.x<0?0:1;break;case use:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case cse:t.y=t.y-Math.floor(t.y);break;case xf:t.y=t.y<0?0:1;break;case use:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}}Wu.DEFAULT_IMAGE=null;Wu.DEFAULT_MAPPING=Aat;class Ia{constructor(t=0,n=0,r=0,i=1){Ia.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,n,r,i){return this.x=t,this.y=n,this.z=r,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this.w=t.w+n.w,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this.w+=t.w*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this.w=t.w-n.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const n=this.x,r=this.y,i=this.z,o=this.w,s=t.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*o,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const n=Math.sqrt(1-t.w*t.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/n,this.y=t.y/n,this.z=t.z/n),this}setAxisAngleFromRotationMatrix(t){let n,r,i,o;const l=t.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-g)<.01&&Math.abs(p-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+g)<.1&&Math.abs(p+m)<.1&&Math.abs(c+h+v-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,w=(h+1)/2,S=(v+1)/2,_=(u+d)/4,E=(f+g)/4,T=(p+m)/4;return b>w&&b>S?b<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(b),i=_/r,o=E/r):w>S?w<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(w),r=_/i,o=T/i):S<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(S),r=E/o,i=T/o),this.set(r,i,o,n),this}let y=Math.sqrt((m-p)*(m-p)+(f-g)*(f-g)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-p)/y,this.y=(f-g)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+v-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this.w=Math.max(t.w,Math.min(n.w,this.w)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this.w=Math.max(t,Math.min(n,this.w)),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this.w+=(t.w-this.w)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this.z=t.z+(n.z-t.z)*r,this.w=t.w+(n.w-t.w)*r,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this.w=t[n+3],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t[n+3]=this.w,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this.w=t.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Hw extends NS{constructor(t,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=n,this.depth=1,this.scissor=new Ia(0,0,t,n),this.scissorTest=!1,this.viewport=new Ia(0,0,t,n);const i={width:t,height:n,depth:1};this.texture=new Wu(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:wc,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(t,n,r=1){(this.width!==t||this.height!==n||this.depth!==r)&&(this.width=t,this.height=n,this.depth=r,this.texture.image.width=t,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,t,n),this.scissor.set(0,0,t,n)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},t.texture.image);return this.texture.source=new $at(n),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Nat extends Wu{constructor(t=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:n,height:r,depth:i},this.magFilter=xc,this.minFilter=xc,this.wrapR=xf,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class zat extends Wu{constructor(t=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:n,height:r,depth:i},this.magFilter=xc,this.minFilter=xc,this.wrapR=xf,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Gw{constructor(t=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=t,this._y=n,this._z=r,this._w=i}static slerpFlat(t,n,r,i,o,s,a){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[s+0],h=o[s+1],p=o[s+2],g=o[s+3];if(a===0){t[n+0]=l,t[n+1]=c,t[n+2]=u,t[n+3]=f;return}if(a===1){t[n+0]=d,t[n+1]=h,t[n+2]=p,t[n+3]=g;return}if(f!==g||l!==d||c!==h||u!==p){let m=1-a;const v=l*d+c*h+u*p+f*g,y=v>=0?1:-1,b=1-v*v;if(b>Number.EPSILON){const S=Math.sqrt(b),_=Math.atan2(S,v*y);m=Math.sin(m*_)/S,a=Math.sin(a*_)/S}const w=a*y;if(l=l*m+d*w,c=c*m+h*w,u=u*m+p*w,f=f*m+g*w,m===1-a){const S=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=S,c*=S,u*=S,f*=S}}t[n]=l,t[n+1]=c,t[n+2]=u,t[n+3]=f}static multiplyQuaternionsFlat(t,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[s],d=o[s+1],h=o[s+2],p=o[s+3];return t[n]=a*p+u*f+l*h-c*d,t[n+1]=l*p+u*d+c*f-a*h,t[n+2]=c*p+u*h+a*d-l*f,t[n+3]=u*p-a*f-l*d-c*h,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,n,r,i){return this._x=t,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,n){const r=t._x,i=t._y,o=t._z,s=t._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(s){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const r=n/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+a+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(o-c)*h,this._z=(s-i)*h}else if(r>a&&r>f){const h=2*Math.sqrt(1+r-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+s)/h,this._z=(o+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-r-f);this._w=(o-c)/h,this._x=(i+s)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-a);this._w=(s-i)/h,this._x=(o+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let r=t.dot(n)+1;return rMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=r),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Sc(this.dot(t),-1,1)))}rotateTowards(t,n){const r=this.angleTo(t);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,n){const r=t._x,i=t._y,o=t._z,s=t._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-i*l-o*c,this._onChangeCallback(),this}slerp(t,n){if(n===0)return this;if(n===1)return this.copy(t);const r=this._x,i=this._y,o=this._z,s=this._w;let a=s*t._w+r*t._x+i*t._y+o*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*s+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=s*f+this._w*d,this._x=r*f+this._x*d,this._y=i*f+this._y*d,this._z=o*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,n,r){return this.copy(t).slerp(n,r)}random(){const t=Math.random(),n=Math.sqrt(1-t),r=Math.sqrt(t),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t}fromBufferAttribute(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ne{constructor(t=0,n=0,r=0){Ne.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(t,n,r){return r===void 0&&(r=this.z),this.x=t,this.y=n,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(Q$e.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(Q$e.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,r=this.y,i=this.z,o=t.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(t){const n=this.x,r=this.y,i=this.z,o=t.x,s=t.y,a=t.z,l=t.w,c=l*n+s*i-a*r,u=l*r+a*n-o*i,f=l*i+o*r-s*n,d=-o*n-s*r-a*i;return this.x=c*l+d*-o+u*-a-f*-s,this.y=u*l+d*-s+f*-o-c*-a,this.z=f*l+d*-a+c*-s-u*-o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const n=this.x,r=this.y,i=this.z,o=t.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this}clampScalar(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,r){return this.x=t.x+(n.x-t.x)*r,this.y=t.y+(n.y-t.y)*r,this.z=t.z+(n.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const r=t.x,i=t.y,o=t.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const r=t.dot(this)/n;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return oJ.copy(this).projectOnVector(t),this.sub(oJ)}reflect(t){return this.sub(oJ.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(t)/n;return Math.acos(Sc(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return n*n+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,n,r){const i=Math.sin(n)*t;return this.x=i*Math.sin(r),this.y=Math.cos(n)*t,this.z=i*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,n,r){return this.x=t*Math.sin(n),this.y=r,this.z=t*Math.cos(n),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-t**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const oJ=new Ne,Q$e=new Gw;class MP{constructor(t=new Ne(1/0,1/0,1/0),n=new Ne(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=n}set(t,n){return this.min.copy(t),this.max.copy(n),this}setFromArray(t){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=t.length;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromBufferAttribute(t){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=t.count;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromPoints(t){this.makeEmpty();for(let n=0,r=t.length;nthis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,n){return n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Tx),Tx.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let n,r;return t.normal.x>0?(n=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(n=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(n+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(n+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),n<=-t.constant&&r>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(C2),E3.subVectors(this.max,C2),q_.subVectors(t.a,C2),X_.subVectors(t.b,C2),Y_.subVectors(t.c,C2),by.subVectors(X_,q_),xy.subVectors(Y_,X_),Px.subVectors(q_,Y_);let n=[0,-by.z,by.y,0,-xy.z,xy.y,0,-Px.z,Px.y,by.z,0,-by.x,xy.z,0,-xy.x,Px.z,0,-Px.x,-by.y,by.x,0,-xy.y,xy.x,0,-Px.y,Px.x,0];return!aJ(n,q_,X_,Y_,E3)||(n=[1,0,0,0,1,0,0,0,1],!aJ(n,q_,X_,Y_,E3))?!1:(T3.crossVectors(by,xy),n=[T3.x,T3.y,T3.z],aJ(n,q_,X_,Y_,E3))}clampPoint(t,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Tx.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=this.getSize(Tx).length()*.5,t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Jg[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Jg[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Jg[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Jg[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Jg[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Jg[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Jg[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Jg[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Jg),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Jg=[new Ne,new Ne,new Ne,new Ne,new Ne,new Ne,new Ne,new Ne],Tx=new Ne,sJ=new MP,q_=new Ne,X_=new Ne,Y_=new Ne,by=new Ne,xy=new Ne,Px=new Ne,C2=new Ne,E3=new Ne,T3=new Ne,kx=new Ne;function aJ(e,t,n,r,i){for(let o=0,s=e.length-3;o<=s;o+=3){kx.fromArray(e,o);const a=i.x*Math.abs(kx.x)+i.y*Math.abs(kx.y)+i.z*Math.abs(kx.z),l=t.dot(kx),c=n.dot(kx),u=r.dot(kx);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const ker=new MP,K$e=new Ne,P3=new Ne,lJ=new Ne;class $W{constructor(t=new Ne,n=-1){this.center=t,this.radius=n}set(t,n){return this.center.copy(t),this.radius=n,this}setFromPoints(t,n){const r=this.center;n!==void 0?r.copy(n):ker.setFromPoints(t).getCenter(r);let i=0;for(let o=0,s=t.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){lJ.subVectors(t,this.center);const n=lJ.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(lJ.multiplyScalar(i/r)),this.radius+=i}return this}union(t){return this.center.equals(t.center)===!0?P3.set(0,0,1).multiplyScalar(t.radius):P3.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(K$e.copy(t.center).add(P3)),this.expandByPoint(K$e.copy(t.center).sub(P3)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const em=new Ne,cJ=new Ne,k3=new Ne,wy=new Ne,uJ=new Ne,M3=new Ne,fJ=new Ne;class jat{constructor(t=new Ne,n=new Ne(0,0,-1)){this.origin=t,this.direction=n}set(t,n){return this.origin.copy(t),this.direction.copy(n),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,n){return n.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,em)),this}closestPointToPoint(t,n){n.subVectors(t,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const n=em.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(em.copy(this.direction).multiplyScalar(n).add(this.origin),em.distanceToSquared(t))}distanceSqToSegment(t,n,r,i){cJ.copy(t).add(n).multiplyScalar(.5),k3.copy(n).sub(t).normalize(),wy.copy(this.origin).sub(cJ);const o=t.distanceTo(n)*.5,s=-this.direction.dot(k3),a=wy.dot(this.direction),l=-wy.dot(k3),c=wy.lengthSq(),u=Math.abs(1-s*s);let f,d,h,p;if(u>0)if(f=s*l-a,d=s*a-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const g=1/u;f*=g,d*=g,h=f*(f+s*d+2*a)+d*(s*f+d+2*l)+c}else d=o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-s*o+a)),d=f>0?-o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-o,-l),o),h=d*(d+2*l)+c):(f=Math.max(0,-(s*o+a)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=s>0?-o:o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(k3).multiplyScalar(d).add(cJ),h}intersectSphere(t,n){em.subVectors(t.center,this.origin);const r=em.dot(this.direction),i=em.dot(em)-r*r,o=t.radius*t.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return a<0&&l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const n=t.normal.dot(this.direction);if(n===0)return t.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(t.normal)+t.constant)/n;return r>=0?r:null}intersectPlane(t,n){const r=this.distanceToPlane(t);return r===null?null:this.at(r,n)}intersectsPlane(t){const n=t.distanceToPoint(this.origin);return n===0||t.normal.dot(this.direction)*n<0}intersectBox(t,n){let r,i,o,s,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(r=(t.min.x-d.x)*c,i=(t.max.x-d.x)*c):(r=(t.max.x-d.x)*c,i=(t.min.x-d.x)*c),u>=0?(o=(t.min.y-d.y)*u,s=(t.max.y-d.y)*u):(o=(t.max.y-d.y)*u,s=(t.min.y-d.y)*u),r>s||o>i||((o>r||r!==r)&&(r=o),(s=0?(a=(t.min.z-d.z)*f,l=(t.max.z-d.z)*f):(a=(t.max.z-d.z)*f,l=(t.min.z-d.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(t){return this.intersectBox(t,em)!==null}intersectTriangle(t,n,r,i,o){uJ.subVectors(n,t),M3.subVectors(r,t),fJ.crossVectors(uJ,M3);let s=this.direction.dot(fJ),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;wy.subVectors(this.origin,t);const l=a*this.direction.dot(M3.crossVectors(wy,M3));if(l<0)return null;const c=a*this.direction.dot(uJ.cross(wy));if(c<0||l+c>s)return null;const u=-a*wy.dot(fJ);return u<0?null:this.at(u/s,o)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Ji{constructor(){Ji.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,n,r,i,o,s,a,l,c,u,f,d,h,p,g,m){const v=this.elements;return v[0]=t,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=s,v[9]=a,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ji().fromArray(this.elements)}copy(t){const n=this.elements,r=t.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(t){const n=this.elements,r=t.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(t){const n=t.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(t,n,r){return t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(t,n,r){return this.set(t.x,n.x,r.x,0,t.y,n.y,r.y,0,t.z,n.z,r.z,0,0,0,0,1),this}extractRotation(t){const n=this.elements,r=t.elements,i=1/Q_.setFromMatrixColumn(t,0).length(),o=1/Q_.setFromMatrixColumn(t,1).length(),s=1/Q_.setFromMatrixColumn(t,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(t){const n=this.elements,r=t.x,i=t.y,o=t.z,s=Math.cos(r),a=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(t.order==="XYZ"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-g*c,n[9]=-a*l,n[2]=g-d*c,n[6]=p+h*c,n[10]=s*l}else if(t.order==="YXZ"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d+g*a,n[4]=p*a-h,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-a,n[2]=h*a-p,n[6]=g+d*a,n[10]=s*l}else if(t.order==="ZXY"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d-g*a,n[4]=-s*f,n[8]=p+h*a,n[1]=h+p*a,n[5]=s*u,n[9]=g-d*a,n[2]=-s*c,n[6]=a,n[10]=s*l}else if(t.order==="ZYX"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+g,n[1]=l*f,n[5]=g*c+d,n[9]=h*c-p,n[2]=-c,n[6]=a*l,n[10]=s*l}else if(t.order==="YZX"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=g-d*f,n[8]=p*f+h,n[1]=f,n[5]=s*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-g*f}else if(t.order==="XZY"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+g,n[5]=s*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=a*u,n[10]=g*f+d}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Mer,t,Aer)}lookAt(t,n,r){const i=this.elements;return iu.subVectors(t,n),iu.lengthSq()===0&&(iu.z=1),iu.normalize(),Sy.crossVectors(r,iu),Sy.lengthSq()===0&&(Math.abs(r.z)===1?iu.x+=1e-4:iu.z+=1e-4,iu.normalize(),Sy.crossVectors(r,iu)),Sy.normalize(),A3.crossVectors(iu,Sy),i[0]=Sy.x,i[4]=A3.x,i[8]=iu.x,i[1]=Sy.y,i[5]=A3.y,i[9]=iu.y,i[2]=Sy.z,i[6]=A3.z,i[10]=iu.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const r=t.elements,i=n.elements,o=this.elements,s=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],g=r[6],m=r[10],v=r[14],y=r[3],b=r[7],w=r[11],S=r[15],_=i[0],E=i[4],T=i[8],k=i[12],P=i[1],I=i[5],R=i[9],F=i[13],A=i[2],L=i[6],$=i[10],j=i[14],V=i[3],U=i[7],z=i[11],N=i[15];return o[0]=s*_+a*P+l*A+c*V,o[4]=s*E+a*I+l*L+c*U,o[8]=s*T+a*R+l*$+c*z,o[12]=s*k+a*F+l*j+c*N,o[1]=u*_+f*P+d*A+h*V,o[5]=u*E+f*I+d*L+h*U,o[9]=u*T+f*R+d*$+h*z,o[13]=u*k+f*F+d*j+h*N,o[2]=p*_+g*P+m*A+v*V,o[6]=p*E+g*I+m*L+v*U,o[10]=p*T+g*R+m*$+v*z,o[14]=p*k+g*F+m*j+v*N,o[3]=y*_+b*P+w*A+S*V,o[7]=y*E+b*I+w*L+S*U,o[11]=y*T+b*R+w*$+S*z,o[15]=y*k+b*F+w*j+S*N,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this}determinant(){const t=this.elements,n=t[0],r=t[4],i=t[8],o=t[12],s=t[1],a=t[5],l=t[9],c=t[13],u=t[2],f=t[6],d=t[10],h=t[14],p=t[3],g=t[7],m=t[11],v=t[15];return p*(+o*l*f-i*c*f-o*a*d+r*c*d+i*a*h-r*l*h)+g*(+n*l*h-n*c*d+o*s*d-i*s*h+i*c*u-o*l*u)+m*(+n*c*f-n*a*h-o*s*f+r*s*h+o*a*u-r*c*u)+v*(-i*a*u-n*l*f+n*a*d+i*s*f-r*s*d+r*l*u)}transpose(){const t=this.elements;let n;return n=t[1],t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this}setPosition(t,n,r){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=n,i[14]=r),this}invert(){const t=this.elements,n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],g=t[13],m=t[14],v=t[15],y=f*m*c-g*d*c+g*l*h-a*m*h-f*l*v+a*d*v,b=p*d*c-u*m*c-p*l*h+s*m*h+u*l*v-s*d*v,w=u*g*c-p*f*c+p*a*h-s*g*h-u*a*v+s*f*v,S=p*f*l-u*g*l-p*a*d+s*g*d+u*a*m-s*f*m,_=n*y+r*b+i*w+o*S;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/_;return t[0]=y*E,t[1]=(g*d*o-f*m*o-g*i*h+r*m*h+f*i*v-r*d*v)*E,t[2]=(a*m*o-g*l*o+g*i*c-r*m*c-a*i*v+r*l*v)*E,t[3]=(f*l*o-a*d*o-f*i*c+r*d*c+a*i*h-r*l*h)*E,t[4]=b*E,t[5]=(u*m*o-p*d*o+p*i*h-n*m*h-u*i*v+n*d*v)*E,t[6]=(p*l*o-s*m*o-p*i*c+n*m*c+s*i*v-n*l*v)*E,t[7]=(s*d*o-u*l*o+u*i*c-n*d*c-s*i*h+n*l*h)*E,t[8]=w*E,t[9]=(p*f*o-u*g*o-p*r*h+n*g*h+u*r*v-n*f*v)*E,t[10]=(s*g*o-p*a*o+p*r*c-n*g*c-s*r*v+n*a*v)*E,t[11]=(u*a*o-s*f*o-u*r*c+n*f*c+s*r*h-n*a*h)*E,t[12]=S*E,t[13]=(u*g*i-p*f*i+p*r*d-n*g*d-u*r*m+n*f*m)*E,t[14]=(p*a*i-s*g*i-p*r*l+n*g*l+s*r*m-n*a*m)*E,t[15]=(s*f*i-u*a*i+u*r*l-n*f*l-s*r*d+n*a*d)*E,this}scale(t){const n=this.elements,r=t.x,i=t.y,o=t.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const t=this.elements,n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(t,n,r){return this.set(1,0,0,t,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(t){const n=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(t){const n=Math.cos(t),r=Math.sin(t);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(t){const n=Math.cos(t),r=Math.sin(t);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,s=t.x,a=t.y,l=t.z,c=o*s,u=o*a;return this.set(c*s+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*s,0,c*l-i*a,u*l+i*s,o*l*l+r,0,0,0,0,1),this}makeScale(t,n,r){return this.set(t,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,n,r,i,o,s){return this.set(1,r,o,0,t,1,s,0,n,i,1,0,0,0,0,1),this}compose(t,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,c=o+o,u=s+s,f=a+a,d=o*c,h=o*u,p=o*f,g=s*u,m=s*f,v=a*f,y=l*c,b=l*u,w=l*f,S=r.x,_=r.y,E=r.z;return i[0]=(1-(g+v))*S,i[1]=(h+w)*S,i[2]=(p-b)*S,i[3]=0,i[4]=(h-w)*_,i[5]=(1-(d+v))*_,i[6]=(m+y)*_,i[7]=0,i[8]=(p+b)*E,i[9]=(m-y)*E,i[10]=(1-(d+g))*E,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,n,r){const i=this.elements;let o=Q_.set(i[0],i[1],i[2]).length();const s=Q_.set(i[4],i[5],i[6]).length(),a=Q_.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),t.x=i[12],t.y=i[13],t.z=i[14],kd.copy(this);const c=1/o,u=1/s,f=1/a;return kd.elements[0]*=c,kd.elements[1]*=c,kd.elements[2]*=c,kd.elements[4]*=u,kd.elements[5]*=u,kd.elements[6]*=u,kd.elements[8]*=f,kd.elements[9]*=f,kd.elements[10]*=f,n.setFromRotationMatrix(kd),r.x=o,r.y=s,r.z=a,this}makePerspective(t,n,r,i,o,s){const a=this.elements,l=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-(s+o)/(s-o),h=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=f,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,n,r,i,o,s){const a=this.elements,l=1/(n-t),c=1/(r-i),u=1/(s-o),f=(n+t)*l,d=(r+i)*c,h=(s+o)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-f,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const n=this.elements,r=t.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(t,n=0){for(let r=0;r<16;r++)this.elements[r]=t[r+n];return this}toArray(t=[],n=0){const r=this.elements;return t[n]=r[0],t[n+1]=r[1],t[n+2]=r[2],t[n+3]=r[3],t[n+4]=r[4],t[n+5]=r[5],t[n+6]=r[6],t[n+7]=r[7],t[n+8]=r[8],t[n+9]=r[9],t[n+10]=r[10],t[n+11]=r[11],t[n+12]=r[12],t[n+13]=r[13],t[n+14]=r[14],t[n+15]=r[15],t}}const Q_=new Ne,kd=new Ji,Mer=new Ne(0,0,0),Aer=new Ne(1,1,1),Sy=new Ne,A3=new Ne,iu=new Ne,Z$e=new Ji,J$e=new Gw;class qL{constructor(t=0,n=0,r=0,i=qL.DefaultOrder){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,n,r,i=this._order){return this._x=t,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,n=this._order,r=!0){const i=t.elements,o=i[0],s=i[4],a=i[8],l=i[1],c=i[5],u=i[9],f=i[2],d=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Sc(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Sc(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(Sc(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Sc(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(Sc(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Sc(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(t,n,r){return Z$e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Z$e,n,r)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){return J$e.setFromEuler(this),this.setFromQuaternion(J$e,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}qL.DefaultOrder="XYZ";qL.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Bat{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),d.length>0&&(r.skeletons=d),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function s(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(t,n,r,i,o){Md.subVectors(i,n),nm.subVectors(r,n),dJ.subVectors(t,n);const s=Md.dot(Md),a=Md.dot(nm),l=Md.dot(dJ),c=nm.dot(nm),u=nm.dot(dJ),f=s*c-a*a;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-a*u)*d,p=(s*u-a*l)*d;return o.set(1-h-p,p,h)}static containsPoint(t,n,r,i){return this.getBarycoord(t,n,r,i,rm),rm.x>=0&&rm.y>=0&&rm.x+rm.y<=1}static getUV(t,n,r,i,o,s,a,l){return this.getBarycoord(t,n,r,i,rm),l.set(0,0),l.addScaledVector(o,rm.x),l.addScaledVector(s,rm.y),l.addScaledVector(a,rm.z),l}static isFrontFacing(t,n,r,i){return Md.subVectors(r,n),nm.subVectors(t,n),Md.cross(nm).dot(i)<0}set(t,n,r){return this.a.copy(t),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(t,n,r,i){return this.a.copy(t[n]),this.b.copy(t[r]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,n,r,i){return this.a.fromBufferAttribute(t,n),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Md.subVectors(this.c,this.b),nm.subVectors(this.a,this.b),Md.cross(nm).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Pm.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return Pm.getBarycoord(t,this.a,this.b,this.c,n)}getUV(t,n,r,i,o){return Pm.getUV(t,this.a,this.b,this.c,n,r,i,o)}containsPoint(t){return Pm.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Pm.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,n){const r=this.a,i=this.b,o=this.c;let s,a;Z_.subVectors(i,r),J_.subVectors(o,r),hJ.subVectors(t,r);const l=Z_.dot(hJ),c=J_.dot(hJ);if(l<=0&&c<=0)return n.copy(r);pJ.subVectors(t,i);const u=Z_.dot(pJ),f=J_.dot(pJ);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(r).addScaledVector(Z_,s);gJ.subVectors(t,o);const h=Z_.dot(gJ),p=J_.dot(gJ);if(p>=0&&h<=p)return n.copy(o);const g=h*c-l*p;if(g<=0&&c>=0&&p<=0)return a=c/(c-p),n.copy(r).addScaledVector(J_,a);const m=u*p-h*f;if(m<=0&&f-u>=0&&h-p>=0)return oNe.subVectors(o,i),a=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(oNe,a);const v=1/(m+g+d);return s=g*v,a=d*v,n.copy(r).addScaledVector(Z_,s).addScaledVector(J_,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Fer=0;class XL extends NS{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Fer++}),this.uuid=GL(),this.name="",this.type="Material",this.blending=kO,this.side=sT,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Pat,this.blendDst=kat,this.blendEquation=CC,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=sse,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Eer,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=JZ,this.stencilZFail=JZ,this.stencilZPass=JZ,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const n in t){const r=t[n];if(r===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}const i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(t){const n=t===void 0||typeof t=="string";n&&(t={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==kO&&(r.blending=this.blending),this.side!==sT&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(t.textures),s=i(t.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const n=t.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Jme extends XL{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new yo(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mat,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const us=new Ne,I3=new _r;class Vf{constructor(t,n,r){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=n,this.count=t!==void 0?t.length/n:0,this.normalized=r===!0,this.usage=G$e,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,n,r){t*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const n=this.index;n!==null&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];t.data.attributes[l]=c.toJSON(t.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(i[l]=u,o=!0)}o&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=t.name;const r=t.index;r!==null&&this.setIndex(r.clone(n));const i=t.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=t.morphAttributes;for(const c in o){const u=[],f=o[c];for(let d=0,h=f.length;d0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;on.far?null:{distance:c,point:j3.clone(),object:e}}function B3(e,t,n,r,i,o,s,a,l,c,u,f){_y.fromBufferAttribute(i,c),Cy.fromBufferAttribute(i,u),Oy.fromBufferAttribute(i,f);const d=e.morphTargetInfluences;if(o&&d){D3.set(0,0,0),L3.set(0,0,0),F3.set(0,0,0);for(let p=0,g=o.length;p0?1:-1,u.push(U.x,U.y,U.z),f.push(B/E),f.push(1-z/T),j+=1}}for(let z=0;z0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class aut extends Lc{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Zi,this.projectionMatrix=new Zi,this.projectionMatrixInverse=new Zi}copy(t,n){return super.copy(t,n),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return t.set(-n[8],-n[9],-n[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,n){super.updateWorldMatrix(t,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Xd extends aut{constructor(t=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,n){return super.copy(t,n),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const n=.5*this.getFilmHeight()/t;this.fov=K3e*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(iee*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return K3e*2*Math.atan(Math.tan(iee*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,n,r,i,o,s){this.aspect=t/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let n=t*Math.tan(iee*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;o+=s.offsetX*i/l,n-=s.offsetY*r/c,i*=s.width/l,r*=s.height/c}const a=this.filmOffset;a!==0&&(o+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const fC=90,dC=1;class jrr extends Lc{constructor(t,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new Xd(fC,dC,t,n);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Ne(1,0,0)),this.add(i);const o=new Xd(fC,dC,t,n);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Ne(-1,0,0)),this.add(o);const s=new Xd(fC,dC,t,n);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ne(0,1,0)),this.add(s);const a=new Xd(fC,dC,t,n);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Ne(0,-1,0)),this.add(a);const l=new Xd(fC,dC,t,n);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ne(0,0,1)),this.add(l);const c=new Xd(fC,dC,t,n);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Ne(0,0,-1)),this.add(c)}update(t,n){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,o,s,a,l,c]=this.children,u=t.getRenderTarget(),f=t.toneMapping,d=t.xr.enabled;t.toneMapping=sv,t.xr.enabled=!1;const h=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0),t.render(n,i),t.setRenderTarget(r,1),t.render(n,o),t.setRenderTarget(r,2),t.render(n,s),t.setRenderTarget(r,3),t.render(n,a),t.setRenderTarget(r,4),t.render(n,l),r.texture.generateMipmaps=h,t.setRenderTarget(r,5),t.render(n,c),t.setRenderTarget(u),t.toneMapping=f,t.xr.enabled=d,r.texture.needsPMREMUpdate=!0}}class lut extends Wu{constructor(t,n,r,i,o,s,a,l,c,u){t=t!==void 0?t:[],n=n!==void 0?n:gT,super(t,n,r,i,o,s,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Brr extends Jw{constructor(t,n={}){super(t,t,n),this.isWebGLCubeRenderTarget=!0;const r={width:t,height:t,depth:1},i=[r,r,r,r,r,r];this.texture=new lut(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Cc}fromEquirectangularTexture(t,n){this.texture.type=n.type,this.texture.encoding=n.encoding,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class pb extends XL{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=jer,this.fragmentShader=Ber,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=uT(t.uniforms),this.uniformsGroups=zer(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const n=super.toJSON(t);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const s=this.uniforms[i].value;s&&s.isTexture?n.uniforms[i]={type:"t",value:s.toJSON(t).uuid}:s&&s.isColor?n.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?n.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?n.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?n.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?n.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?n.uniforms[i]={type:"m4",value:s.toArray()}:n.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class Hat extends Ic{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ji,this.projectionMatrix=new Ji,this.projectionMatrixInverse=new Ji}copy(t,n){return super.copy(t,n),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return t.set(-n[8],-n[9],-n[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,n){super.updateWorldMatrix(t,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Hd extends Hat{constructor(t=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,n){return super.copy(t,n),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const n=.5*this.getFilmHeight()/t;this.fov=X$e*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(eJ*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return X$e*2*Math.atan(Math.tan(eJ*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,n,r,i,o,s){this.aspect=t/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let n=t*Math.tan(eJ*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;o+=s.offsetX*i/l,n-=s.offsetY*r/c,i*=s.width/l,r*=s.height/c}const a=this.filmOffset;a!==0&&(o+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const nC=90,rC=1;class Uer extends Ic{constructor(t,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new Hd(nC,rC,t,n);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Ne(1,0,0)),this.add(i);const o=new Hd(nC,rC,t,n);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Ne(-1,0,0)),this.add(o);const s=new Hd(nC,rC,t,n);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ne(0,1,0)),this.add(s);const a=new Hd(nC,rC,t,n);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Ne(0,-1,0)),this.add(a);const l=new Hd(nC,rC,t,n);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ne(0,0,1)),this.add(l);const c=new Hd(nC,rC,t,n);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Ne(0,0,-1)),this.add(c)}update(t,n){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,o,s,a,l,c]=this.children,u=t.getRenderTarget(),f=t.toneMapping,d=t.xr.enabled;t.toneMapping=nv,t.xr.enabled=!1;const h=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0),t.render(n,i),t.setRenderTarget(r,1),t.render(n,o),t.setRenderTarget(r,2),t.render(n,s),t.setRenderTarget(r,3),t.render(n,a),t.setRenderTarget(r,4),t.render(n,l),r.texture.generateMipmaps=h,t.setRenderTarget(r,5),t.render(n,c),t.setRenderTarget(u),t.toneMapping=f,t.xr.enabled=d,r.texture.needsPMREMUpdate=!0}}class Gat extends Wu{constructor(t,n,r,i,o,s,a,l,c,u){t=t!==void 0?t:[],n=n!==void 0?n:aT,super(t,n,r,i,o,s,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Ver extends Hw{constructor(t,n={}){super(t,t,n),this.isWebGLCubeRenderTarget=!0;const r={width:t,height:t,depth:1},i=[r,r,r,r,r,r];this.texture=new Gat(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:wc}fromEquirectangularTexture(t,n){this.texture.type=n.type,this.texture.encoding=n.encoding,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -623,28 +657,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new NP(5,5,5),o=new yb({name:"CubemapFromEquirect",uniforms:yT(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Fu,blending:V0});o.uniforms.tEquirect.value=n;const s=new Lp(i,o),a=n.minFilter;return n.minFilter===sH&&(n.minFilter=Cc),new jrr(1,10,this).update(t,s),n.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,n,r,i){const o=t.getRenderTarget();for(let s=0;s<6;s++)t.setRenderTarget(this,s),t.clear(n,r,i);t.setRenderTarget(o)}}const Eee=new Ne,Urr=new Ne,Vrr=new Pu;class Qx{constructor(t=new Ne(1,0,0),n=0){this.isPlane=!0,this.normal=t,this.constant=n}set(t,n){return this.normal.copy(t),this.constant=n,this}setComponents(t,n,r,i){return this.normal.set(t,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(t,n,r){const i=Eee.subVectors(r,n).cross(Urr.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,n){return n.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,n){const r=t.delta(Eee),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(t.start)===0?n.copy(t.start):null;const o=-(t.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:n.copy(r).multiplyScalar(o).add(t.start)}intersectsLine(t){const n=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return n<0&&r>0||r<0&&n>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,n){const r=n||Vrr.getNormalMatrix(t),i=this.coplanarPoint(Eee).applyMatrix4(t),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const hC=new aH,cz=new Ne;class cut{constructor(t=new Qx,n=new Qx,r=new Qx,i=new Qx,o=new Qx,s=new Qx){this.planes=[t,n,r,i,o,s]}set(t,n,r,i,o,s){const a=this.planes;return a[0].copy(t),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(t){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t){const n=this.planes,r=t.elements,i=r[0],o=r[1],s=r[2],a=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],g=r[11],m=r[12],v=r[13],y=r[14],b=r[15];return n[0].setComponents(a-i,f-l,g-d,b-m).normalize(),n[1].setComponents(a+i,f+l,g+d,b+m).normalize(),n[2].setComponents(a+o,f+c,g+h,b+v).normalize(),n[3].setComponents(a-o,f-c,g-h,b-v).normalize(),n[4].setComponents(a-s,f-u,g-p,b-y).normalize(),n[5].setComponents(a+s,f+u,g+p,b+y).normalize(),this}intersectsObject(t){const n=t.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),hC.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(hC)}intersectsSprite(t){return hC.center.set(0,0,0),hC.radius=.7071067811865476,hC.applyMatrix4(t.matrixWorld),this.intersectsSphere(hC)}intersectsSphere(t){const n=this.planes,r=t.center,i=-t.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?t.max.x:t.min.x,cz.y=i.normal.y>0?t.max.y:t.min.y,cz.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(cz)<0)return!1}return!0}containsPoint(t){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function uut(){let e=null,t=!1,n=null,r=null;function i(o,s){n(o,s),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(o){n=o},setContext:function(o){e=o}}}function Wrr(e,t){const n=t.isWebGL2,r=new WeakMap;function i(c,u){const f=c.array,d=c.usage,h=e.createBuffer();e.bindBuffer(u,h),e.bufferData(u,f,d),c.onUploadCallback();let p;if(f instanceof Float32Array)p=5126;else if(f instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)p=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=5123;else if(f instanceof Int16Array)p=5122;else if(f instanceof Uint32Array)p=5125;else if(f instanceof Int32Array)p=5124;else if(f instanceof Int8Array)p=5120;else if(f instanceof Uint8Array)p=5121;else if(f instanceof Uint8ClampedArray)p=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:h,type:p,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}function o(c,u,f){const d=u.array,h=u.updateRange;e.bindBuffer(f,c),h.count===-1?e.bufferSubData(f,0,d):(n?e.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d,h.offset,h.count):e.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d.subarray(h.offset,h.offset+h.count)),h.count=-1)}function s(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=r.get(c);u&&(e.deleteBuffer(u.buffer),r.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const d=r.get(c);(!d||d.version1?null:n.copy(r).multiplyScalar(o).add(t.start)}intersectsLine(t){const n=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return n<0&&r>0||r<0&&n>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,n){const r=n||Her.getNormalMatrix(t),i=this.coplanarPoint(SJ).applyMatrix4(t),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const iC=new $W,U3=new Ne;class qat{constructor(t=new Bx,n=new Bx,r=new Bx,i=new Bx,o=new Bx,s=new Bx){this.planes=[t,n,r,i,o,s]}set(t,n,r,i,o,s){const a=this.planes;return a[0].copy(t),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(t){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t){const n=this.planes,r=t.elements,i=r[0],o=r[1],s=r[2],a=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],g=r[11],m=r[12],v=r[13],y=r[14],b=r[15];return n[0].setComponents(a-i,f-l,g-d,b-m).normalize(),n[1].setComponents(a+i,f+l,g+d,b+m).normalize(),n[2].setComponents(a+o,f+c,g+h,b+v).normalize(),n[3].setComponents(a-o,f-c,g-h,b-v).normalize(),n[4].setComponents(a-s,f-u,g-p,b-y).normalize(),n[5].setComponents(a+s,f+u,g+p,b+y).normalize(),this}intersectsObject(t){const n=t.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),iC.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(iC)}intersectsSprite(t){return iC.center.set(0,0,0),iC.radius=.7071067811865476,iC.applyMatrix4(t.matrixWorld),this.intersectsSphere(iC)}intersectsSphere(t){const n=this.planes,r=t.center,i=-t.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?t.max.x:t.min.x,U3.y=i.normal.y>0?t.max.y:t.min.y,U3.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(U3)<0)return!1}return!0}containsPoint(t){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Xat(){let e=null,t=!1,n=null,r=null;function i(o,s){n(o,s),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(o){n=o},setContext:function(o){e=o}}}function Ger(e,t){const n=t.isWebGL2,r=new WeakMap;function i(c,u){const f=c.array,d=c.usage,h=e.createBuffer();e.bindBuffer(u,h),e.bufferData(u,f,d),c.onUploadCallback();let p;if(f instanceof Float32Array)p=5126;else if(f instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)p=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=5123;else if(f instanceof Int16Array)p=5122;else if(f instanceof Uint32Array)p=5125;else if(f instanceof Int32Array)p=5124;else if(f instanceof Int8Array)p=5120;else if(f instanceof Uint8Array)p=5121;else if(f instanceof Uint8ClampedArray)p=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:h,type:p,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}function o(c,u,f){const d=u.array,h=u.updateRange;e.bindBuffer(f,c),h.count===-1?e.bufferSubData(f,0,d):(n?e.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d,h.offset,h.count):e.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d.subarray(h.offset,h.offset+h.count)),h.count=-1)}function s(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=r.get(c);u&&(e.deleteBuffer(u.buffer),r.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const d=r.get(c);(!d||d.version 0 +#endif`,itr=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -884,26 +918,26 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,rir=`#if NUM_CLIPPING_PLANES > 0 +#endif`,otr=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,iir=`#if NUM_CLIPPING_PLANES > 0 +#endif`,str=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,oir=`#if NUM_CLIPPING_PLANES > 0 +#endif`,atr=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,sir=`#if defined( USE_COLOR_ALPHA ) +#endif`,ltr=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,air=`#if defined( USE_COLOR_ALPHA ) +#endif`,ctr=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,lir=`#if defined( USE_COLOR_ALPHA ) +#endif`,utr=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,cir=`#if defined( USE_COLOR_ALPHA ) +#endif`,ftr=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -913,7 +947,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,uir=`#define PI 3.141592653589793 +#endif`,dtr=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -985,7 +1019,7 @@ vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); -}`,fir=`#ifdef ENVMAP_TYPE_CUBE_UV +}`,htr=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -1083,7 +1117,7 @@ vec2 equirectUv( in vec3 dir ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,dir=`vec3 transformedNormal = objectNormal; +#endif`,ptr=`vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); @@ -1098,23 +1132,23 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,hir=`#ifdef USE_DISPLACEMENTMAP +#endif`,gtr=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,pir=`#ifdef USE_DISPLACEMENTMAP +#endif`,mtr=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,gir=`#ifdef USE_EMISSIVEMAP +#endif`,vtr=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,mir=`#ifdef USE_EMISSIVEMAP +#endif`,ytr=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,vir="gl_FragColor = linearToOutputTexel( gl_FragColor );",yir=`vec4 LinearToLinear( in vec4 value ) { +#endif`,btr="gl_FragColor = linearToOutputTexel( gl_FragColor );",xtr=`vec4 LinearToLinear( in vec4 value ) { return value; } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,bir=`#ifdef USE_ENVMAP +}`,wtr=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -1145,7 +1179,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,xir=`#ifdef USE_ENVMAP +#endif`,Str=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -1154,7 +1188,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,wir=`#ifdef USE_ENVMAP +#endif`,_tr=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -1165,7 +1199,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,Sir=`#ifdef USE_ENVMAP +#endif`,Ctr=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -1176,7 +1210,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,_ir=`#ifdef USE_ENVMAP +#endif`,Otr=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -1193,18 +1227,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,Cir=`#ifdef USE_FOG +#endif`,Etr=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,Oir=`#ifdef USE_FOG +#endif`,Ttr=`#ifdef USE_FOG varying float vFogDepth; -#endif`,Eir=`#ifdef USE_FOG +#endif`,Ptr=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Tir=`#ifdef USE_FOG +#endif`,ktr=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -1213,7 +1247,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,Pir=`#ifdef USE_GRADIENTMAP +#endif`,Mtr=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -1225,16 +1259,16 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,kir=`#ifdef USE_LIGHTMAP +}`,Atr=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,Mir=`#ifdef USE_LIGHTMAP +#endif`,Rtr=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,Air=`LambertMaterial material; +#endif`,Itr=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,Rir=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Dtr=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -1249,7 +1283,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricCon } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert -#define Material_LightProbeLOD( material ) (0)`,Iir=`uniform bool receiveShadow; +#define Material_LightProbeLOD( material ) (0)`,Ltr=`uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { @@ -1370,7 +1404,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,Dir=`#if defined( USE_ENVMAP ) +#endif`,Ftr=`#if defined( USE_ENVMAP ) vec3 getIBLIrradiance( const in vec3 normal ) { #if defined( ENVMAP_TYPE_CUBE_UV ) vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1391,8 +1425,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi return vec3( 0.0 ); #endif } -#endif`,Lir=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,Fir=`varying vec3 vViewPosition; +#endif`,$tr=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Ntr=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1405,11 +1439,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContex } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,$ir=`BlinnPhongMaterial material; +#define Material_LightProbeLOD( material ) (0)`,ztr=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,Nir=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,jtr=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1427,7 +1461,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in Geometric } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,zir=`PhysicalMaterial material; +#define Material_LightProbeLOD( material ) (0)`,Btr=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -1491,7 +1525,7 @@ material.roughness = min( material.roughness, 1.0 ); #ifdef USE_SHEENROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; #endif -#endif`,jir=`struct PhysicalMaterial { +#endif`,Utr=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1640,7 +1674,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,Bir=` +}`,Vtr=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; @@ -1753,7 +1787,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,Uir=`#if defined( RE_IndirectDiffuse ) +#endif`,Wtr=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1768,25 +1802,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,Vir=`#if defined( RE_IndirectDiffuse ) +#endif`,Htr=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,Wir=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,Gtr=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,Hir=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,qtr=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,Gir=`#ifdef USE_LOGDEPTHBUF +#endif`,Xtr=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,qir=`#ifdef USE_LOGDEPTHBUF +#endif`,Ytr=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1796,15 +1830,15 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,Xir=`#ifdef USE_MAP +#endif`,Qtr=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,Yir=`#ifdef USE_MAP +#endif`,Ktr=`#ifdef USE_MAP uniform sampler2D map; -#endif`,Qir=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,Ztr=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP @@ -1812,7 +1846,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,Kir=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,Jtr=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP @@ -1820,13 +1854,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,Zir=`float metalnessFactor = metalness; +#endif`,enr=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; -#endif`,Jir=`#ifdef USE_METALNESSMAP +#endif`,tnr=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,eor=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,nnr=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1835,7 +1869,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,tor=`#ifdef USE_MORPHNORMALS +#endif`,rnr=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1847,7 +1881,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,nor=`#ifdef USE_MORPHTARGETS +#endif`,inr=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1867,7 +1901,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,ror=`#ifdef USE_MORPHTARGETS +#endif`,onr=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1885,7 +1919,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,ior=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,snr=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); @@ -1907,7 +1941,7 @@ IncidentLight directLight; #endif #endif #endif -vec3 geometryNormal = normal;`,oor=`#ifdef OBJECTSPACE_NORMALMAP +vec3 geometryNormal = normal;`,anr=`#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1926,25 +1960,25 @@ vec3 geometryNormal = normal;`,oor=`#ifdef OBJECTSPACE_NORMALMAP #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,sor=`#ifndef FLAT_SHADED +#endif`,lnr=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,aor=`#ifndef FLAT_SHADED +#endif`,cnr=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,lor=`#ifndef FLAT_SHADED +#endif`,unr=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,cor=`#ifdef USE_NORMALMAP +#endif`,fnr=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1966,9 +2000,9 @@ vec3 geometryNormal = normal;`,oor=`#ifdef OBJECTSPACE_NORMALMAP float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } -#endif`,uor=`#ifdef USE_CLEARCOAT +#endif`,dnr=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = geometryNormal; -#endif`,dor=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,hnr=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT @@ -1976,7 +2010,7 @@ vec3 geometryNormal = normal;`,oor=`#ifdef OBJECTSPACE_NORMALMAP #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif -#endif`,hor=`#ifdef USE_CLEARCOATMAP +#endif`,pnr=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP @@ -1985,18 +2019,18 @@ vec3 geometryNormal = normal;`,oor=`#ifdef OBJECTSPACE_NORMALMAP #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; -#endif`,por=`#ifdef USE_IRIDESCENCEMAP +#endif`,gnr=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,gor=`#ifdef OPAQUE +#endif`,mnr=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha + 0.1; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,mor=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,vnr=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -2031,29 +2065,29 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,vor=`#ifdef PREMULTIPLIED_ALPHA +}`,ynr=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,yor=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,bnr=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,bor=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,xnr=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,xor=`#ifdef DITHERING +#endif`,wnr=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,wor=`float roughnessFactor = roughness; +#endif`,Snr=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; -#endif`,Sor=`#ifdef USE_ROUGHNESSMAP +#endif`,_nr=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,_or=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Cnr=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2232,7 +2266,7 @@ gl_Position = projectionMatrix * mvPosition;`,bor=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,Cor=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Onr=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2270,7 +2304,7 @@ gl_Position = projectionMatrix * mvPosition;`,bor=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,Oor=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,Enr=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; @@ -2302,7 +2336,7 @@ gl_Position = projectionMatrix * mvPosition;`,bor=`#ifdef DITHERING } #pragma unroll_loop_end #endif -#endif`,Eor=`float getShadowMask() { +#endif`,Tnr=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2334,12 +2368,12 @@ gl_Position = projectionMatrix * mvPosition;`,bor=`#ifdef DITHERING #endif #endif return shadow; -}`,Tor=`#ifdef USE_SKINNING +}`,Pnr=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,Por=`#ifdef USE_SKINNING +#endif`,knr=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2358,7 +2392,7 @@ gl_Position = projectionMatrix * mvPosition;`,bor=`#ifdef DITHERING mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } -#endif`,kor=`#ifdef USE_SKINNING +#endif`,Mnr=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2366,7 +2400,7 @@ gl_Position = projectionMatrix * mvPosition;`,bor=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,Mor=`#ifdef USE_SKINNING +#endif`,Anr=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2377,17 +2411,17 @@ gl_Position = projectionMatrix * mvPosition;`,bor=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,Aor=`float specularStrength; +#endif`,Rnr=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,Ror=`#ifdef USE_SPECULARMAP +#endif`,Inr=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,Ior=`#if defined( TONE_MAPPING ) +#endif`,Dnr=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,Dor=`#ifndef saturate +#endif`,Lnr=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2423,7 +2457,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,Lor=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,Fnr=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2444,7 +2478,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Lor=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); -#endif`,For=`#ifdef USE_TRANSMISSION +#endif`,$nr=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2502,37 +2536,37 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Lor=`#ifdef USE_TRANSMIS vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); } -#endif`,$or=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) +#endif`,Nnr=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; -#endif`,Nor=`#ifdef USE_UV +#endif`,znr=`#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; -#endif`,zor=`#ifdef USE_UV +#endif`,jnr=`#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,jor=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,Bnr=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; -#endif`,Bor=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,Unr=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; -#endif`,Uor=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,Vnr=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,Vor=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Wnr=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const Wor=`varying vec2 vUv; +#endif`;const Hnr=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,Hor=`uniform sampler2D t2D; +}`,Gnr=`uniform sampler2D t2D; varying vec2 vUv; void main() { gl_FragColor = texture2D( t2D, vUv ); @@ -2541,14 +2575,14 @@ void main() { #endif #include #include -}`,Gor=`varying vec3 vWorldDirection; +}`,qnr=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,qor=`#include +}`,Xnr=`#include uniform float opacity; varying vec3 vWorldDirection; #include @@ -2559,7 +2593,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,Xor=`#include +}`,Ynr=`#include #include #include #include @@ -2583,7 +2617,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,Yor=`#if DEPTH_PACKING == 3200 +}`,Qnr=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2611,7 +2645,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,Qor=`#define DISTANCE +}`,Knr=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2635,7 +2669,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,Kor=`#define DISTANCE +}`,Znr=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2657,13 +2691,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,Zor=`varying vec3 vWorldDirection; +}`,Jnr=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,Jor=`uniform sampler2D tEquirect; +}`,err=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2672,7 +2706,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,esr=`uniform float scale; +}`,trr=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2691,7 +2725,7 @@ void main() { #include #include #include -}`,tsr=`uniform vec3 diffuse; +}`,nrr=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2716,7 +2750,7 @@ void main() { #include #include #include -}`,nsr=`#include +}`,rrr=`#include #include #include #include @@ -2747,7 +2781,7 @@ void main() { #include #include #include -}`,rsr=`uniform vec3 diffuse; +}`,irr=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2794,7 +2828,7 @@ void main() { #include #include #include -}`,isr=`#define LAMBERT +}`,orr=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2832,7 +2866,7 @@ void main() { #include #include #include -}`,osr=`#define LAMBERT +}`,srr=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2888,7 +2922,7 @@ void main() { #include #include #include -}`,ssr=`#define MATCAP +}`,arr=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2919,7 +2953,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,asr=`#define MATCAP +}`,lrr=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -2963,7 +2997,7 @@ void main() { #include #include #include -}`,lsr=`#define NORMAL +}`,crr=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif @@ -2993,7 +3027,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif -}`,csr=`#define NORMAL +}`,urr=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; @@ -3014,7 +3048,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,usr=`#define PHONG +}`,frr=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3052,7 +3086,7 @@ void main() { #include #include #include -}`,fsr=`#define PHONG +}`,drr=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3110,7 +3144,7 @@ void main() { #include #include #include -}`,dsr=`#define STANDARD +}`,hrr=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3152,7 +3186,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,hsr=`#define STANDARD +}`,prr=`#define STANDARD #ifdef PHYSICAL #define IOR #define SPECULAR @@ -3268,7 +3302,7 @@ void main() { #include #include #include -}`,psr=`#define TOON +}`,grr=`#define TOON varying vec3 vViewPosition; #include #include @@ -3304,7 +3338,7 @@ void main() { #include #include #include -}`,gsr=`#define TOON +}`,mrr=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3356,7 +3390,7 @@ void main() { #include #include #include -}`,msr=`uniform float size; +}`,vrr=`uniform float size; uniform float scale; #include #include @@ -3379,7 +3413,7 @@ void main() { #include #include #include -}`,vsr=`uniform vec3 diffuse; +}`,yrr=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3402,7 +3436,7 @@ void main() { #include #include #include -}`,ysr=`#include +}`,brr=`#include #include #include #include @@ -3420,7 +3454,7 @@ void main() { #include #include #include -}`,bsr=`uniform vec3 color; +}`,xrr=`uniform vec3 color; uniform float opacity; #include #include @@ -3434,7 +3468,7 @@ void main() { #include #include #include -}`,xsr=`uniform float rotation; +}`,wrr=`uniform float rotation; uniform vec2 center; #include #include @@ -3460,7 +3494,7 @@ void main() { #include #include #include -}`,wsr=`uniform vec3 diffuse; +}`,Srr=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3483,7 +3517,7 @@ void main() { #include #include #include -}`,wr={alphamap_fragment:Hrr,alphamap_pars_fragment:Grr,alphatest_fragment:qrr,alphatest_pars_fragment:Xrr,aomap_fragment:Yrr,aomap_pars_fragment:Qrr,begin_vertex:Krr,beginnormal_vertex:Zrr,bsdfs:Jrr,iridescence_fragment:eir,bumpmap_pars_fragment:tir,clipping_planes_fragment:nir,clipping_planes_pars_fragment:rir,clipping_planes_pars_vertex:iir,clipping_planes_vertex:oir,color_fragment:sir,color_pars_fragment:air,color_pars_vertex:lir,color_vertex:cir,common:uir,cube_uv_reflection_fragment:fir,defaultnormal_vertex:dir,displacementmap_pars_vertex:hir,displacementmap_vertex:pir,emissivemap_fragment:gir,emissivemap_pars_fragment:mir,encodings_fragment:vir,encodings_pars_fragment:yir,envmap_fragment:bir,envmap_common_pars_fragment:xir,envmap_pars_fragment:wir,envmap_pars_vertex:Sir,envmap_physical_pars_fragment:Dir,envmap_vertex:_ir,fog_vertex:Cir,fog_pars_vertex:Oir,fog_fragment:Eir,fog_pars_fragment:Tir,gradientmap_pars_fragment:Pir,lightmap_fragment:kir,lightmap_pars_fragment:Mir,lights_lambert_fragment:Air,lights_lambert_pars_fragment:Rir,lights_pars_begin:Iir,lights_toon_fragment:Lir,lights_toon_pars_fragment:Fir,lights_phong_fragment:$ir,lights_phong_pars_fragment:Nir,lights_physical_fragment:zir,lights_physical_pars_fragment:jir,lights_fragment_begin:Bir,lights_fragment_maps:Uir,lights_fragment_end:Vir,logdepthbuf_fragment:Wir,logdepthbuf_pars_fragment:Hir,logdepthbuf_pars_vertex:Gir,logdepthbuf_vertex:qir,map_fragment:Xir,map_pars_fragment:Yir,map_particle_fragment:Qir,map_particle_pars_fragment:Kir,metalnessmap_fragment:Zir,metalnessmap_pars_fragment:Jir,morphcolor_vertex:eor,morphnormal_vertex:tor,morphtarget_pars_vertex:nor,morphtarget_vertex:ror,normal_fragment_begin:ior,normal_fragment_maps:oor,normal_pars_fragment:sor,normal_pars_vertex:aor,normal_vertex:lor,normalmap_pars_fragment:cor,clearcoat_normal_fragment_begin:uor,clearcoat_normal_fragment_maps:dor,clearcoat_pars_fragment:hor,iridescence_pars_fragment:por,output_fragment:gor,packing:mor,premultiplied_alpha_fragment:vor,project_vertex:yor,dithering_fragment:bor,dithering_pars_fragment:xor,roughnessmap_fragment:wor,roughnessmap_pars_fragment:Sor,shadowmap_pars_fragment:_or,shadowmap_pars_vertex:Cor,shadowmap_vertex:Oor,shadowmask_pars_fragment:Eor,skinbase_vertex:Tor,skinning_pars_vertex:Por,skinning_vertex:kor,skinnormal_vertex:Mor,specularmap_fragment:Aor,specularmap_pars_fragment:Ror,tonemapping_fragment:Ior,tonemapping_pars_fragment:Dor,transmission_fragment:Lor,transmission_pars_fragment:For,uv_pars_fragment:$or,uv_pars_vertex:Nor,uv_vertex:zor,uv2_pars_fragment:jor,uv2_pars_vertex:Bor,uv2_vertex:Uor,worldpos_vertex:Vor,background_vert:Wor,background_frag:Hor,cube_vert:Gor,cube_frag:qor,depth_vert:Xor,depth_frag:Yor,distanceRGBA_vert:Qor,distanceRGBA_frag:Kor,equirect_vert:Zor,equirect_frag:Jor,linedashed_vert:esr,linedashed_frag:tsr,meshbasic_vert:nsr,meshbasic_frag:rsr,meshlambert_vert:isr,meshlambert_frag:osr,meshmatcap_vert:ssr,meshmatcap_frag:asr,meshnormal_vert:lsr,meshnormal_frag:csr,meshphong_vert:usr,meshphong_frag:fsr,meshphysical_vert:dsr,meshphysical_frag:hsr,meshtoon_vert:psr,meshtoon_frag:gsr,points_vert:msr,points_frag:vsr,shadow_vert:ysr,shadow_frag:bsr,sprite_vert:xsr,sprite_frag:wsr},zt={common:{diffuse:{value:new yo(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Pu},uv2Transform:{value:new Pu},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Sr(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new yo(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yo(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Pu}},sprite:{diffuse:{value:new yo(16777215)},opacity:{value:1},center:{value:new Sr(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Pu}}},up={basic:{uniforms:Qa([zt.common,zt.specularmap,zt.envmap,zt.aomap,zt.lightmap,zt.fog]),vertexShader:wr.meshbasic_vert,fragmentShader:wr.meshbasic_frag},lambert:{uniforms:Qa([zt.common,zt.specularmap,zt.envmap,zt.aomap,zt.lightmap,zt.emissivemap,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.fog,zt.lights,{emissive:{value:new yo(0)}}]),vertexShader:wr.meshlambert_vert,fragmentShader:wr.meshlambert_frag},phong:{uniforms:Qa([zt.common,zt.specularmap,zt.envmap,zt.aomap,zt.lightmap,zt.emissivemap,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.fog,zt.lights,{emissive:{value:new yo(0)},specular:{value:new yo(1118481)},shininess:{value:30}}]),vertexShader:wr.meshphong_vert,fragmentShader:wr.meshphong_frag},standard:{uniforms:Qa([zt.common,zt.envmap,zt.aomap,zt.lightmap,zt.emissivemap,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.roughnessmap,zt.metalnessmap,zt.fog,zt.lights,{emissive:{value:new yo(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:wr.meshphysical_vert,fragmentShader:wr.meshphysical_frag},toon:{uniforms:Qa([zt.common,zt.aomap,zt.lightmap,zt.emissivemap,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.gradientmap,zt.fog,zt.lights,{emissive:{value:new yo(0)}}]),vertexShader:wr.meshtoon_vert,fragmentShader:wr.meshtoon_frag},matcap:{uniforms:Qa([zt.common,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.fog,{matcap:{value:null}}]),vertexShader:wr.meshmatcap_vert,fragmentShader:wr.meshmatcap_frag},points:{uniforms:Qa([zt.points,zt.fog]),vertexShader:wr.points_vert,fragmentShader:wr.points_frag},dashed:{uniforms:Qa([zt.common,zt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wr.linedashed_vert,fragmentShader:wr.linedashed_frag},depth:{uniforms:Qa([zt.common,zt.displacementmap]),vertexShader:wr.depth_vert,fragmentShader:wr.depth_frag},normal:{uniforms:Qa([zt.common,zt.bumpmap,zt.normalmap,zt.displacementmap,{opacity:{value:1}}]),vertexShader:wr.meshnormal_vert,fragmentShader:wr.meshnormal_frag},sprite:{uniforms:Qa([zt.sprite,zt.fog]),vertexShader:wr.sprite_vert,fragmentShader:wr.sprite_frag},background:{uniforms:{uvTransform:{value:new Pu},t2D:{value:null}},vertexShader:wr.background_vert,fragmentShader:wr.background_frag},cube:{uniforms:Qa([zt.envmap,{opacity:{value:1}}]),vertexShader:wr.cube_vert,fragmentShader:wr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wr.equirect_vert,fragmentShader:wr.equirect_frag},distanceRGBA:{uniforms:Qa([zt.common,zt.displacementmap,{referencePosition:{value:new Ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wr.distanceRGBA_vert,fragmentShader:wr.distanceRGBA_frag},shadow:{uniforms:Qa([zt.lights,zt.fog,{color:{value:new yo(0)},opacity:{value:1}}]),vertexShader:wr.shadow_vert,fragmentShader:wr.shadow_frag}};up.physical={uniforms:Qa([up.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Sr(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new yo(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Sr},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new yo(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new yo(1,1,1)},specularColorMap:{value:null}}]),vertexShader:wr.meshphysical_vert,fragmentShader:wr.meshphysical_frag};function Ssr(e,t,n,r,i,o){const s=new yo(0);let a=i===!0?0:1,l,c,u=null,f=0,d=null;function h(g,m){let v=!1,y=m.isScene===!0?m.background:null;y&&y.isTexture&&(y=t.get(y));const b=e.xr,w=b.getSession&&b.getSession();w&&w.environmentBlendMode==="additive"&&(y=null),y===null?p(s,a):y&&y.isColor&&(p(y,1),v=!0),(e.autoClear||v)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===oH)?(c===void 0&&(c=new Lp(new NP(1,1,1),new yb({name:"BackgroundCubeMaterial",uniforms:yT(up.cube.uniforms),vertexShader:up.cube.vertexShader,fragmentShader:up.cube.fragmentShader,side:Fu,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(S,_,E){this.matrixWorld.copyPosition(E.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,(u!==y||f!==y.version||d!==e.toneMapping)&&(c.material.needsUpdate=!0,u=y,f=y.version,d=e.toneMapping),c.layers.enableAll(),g.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new Lp(new lH(2,2),new yb({name:"BackgroundMaterial",uniforms:yT(up.background.uniforms),vertexShader:up.background.vertexShader,fragmentShader:up.background.fragmentShader,side:pT,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||f!==y.version||d!==e.toneMapping)&&(l.material.needsUpdate=!0,u=y,f=y.version,d=e.toneMapping),l.layers.enableAll(),g.unshift(l,l.geometry,l.material,0,0,null))}function p(g,m){n.buffers.color.setClear(g.r,g.g,g.b,m,o)}return{getClearColor:function(){return s},setClearColor:function(g,m=1){s.set(g),a=m,p(s,a)},getClearAlpha:function(){return a},setClearAlpha:function(g){a=g,p(s,a)},render:h}}function _sr(e,t,n,r){const i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),s=r.isWebGL2||o!==null,a={},l=m(null);let c=l,u=!1;function f(A,L,$,j,V){let U=!1;if(s){const z=g(j,$,L);c!==z&&(c=z,h(c.object)),U=v(A,j,$,V),U&&y(A,j,$,V)}else{const z=L.wireframe===!0;(c.geometry!==j.id||c.program!==$.id||c.wireframe!==z)&&(c.geometry=j.id,c.program=$.id,c.wireframe=z,U=!0)}V!==null&&n.update(V,34963),(U||u)&&(u=!1,T(A,L,$,j),V!==null&&e.bindBuffer(34963,n.get(V).buffer))}function d(){return r.isWebGL2?e.createVertexArray():o.createVertexArrayOES()}function h(A){return r.isWebGL2?e.bindVertexArray(A):o.bindVertexArrayOES(A)}function p(A){return r.isWebGL2?e.deleteVertexArray(A):o.deleteVertexArrayOES(A)}function g(A,L,$){const j=$.wireframe===!0;let V=a[A.id];V===void 0&&(V={},a[A.id]=V);let U=V[L.id];U===void 0&&(U={},V[L.id]=U);let z=U[j];return z===void 0&&(z=m(d()),U[j]=z),z}function m(A){const L=[],$=[],j=[];for(let V=0;V=0){const Q=V[B];let Y=U[B];if(Y===void 0&&(B==="instanceMatrix"&&A.instanceMatrix&&(Y=A.instanceMatrix),B==="instanceColor"&&A.instanceColor&&(Y=A.instanceColor)),Q===void 0||Q.attribute!==Y||Y&&Q.data!==Y.data)return!0;z++}return c.attributesNum!==z||c.index!==j}function y(A,L,$,j){const V={},U=L.attributes;let z=0;const N=$.getAttributes();for(const B in N)if(N[B].location>=0){let Q=U[B];Q===void 0&&(B==="instanceMatrix"&&A.instanceMatrix&&(Q=A.instanceMatrix),B==="instanceColor"&&A.instanceColor&&(Q=A.instanceColor));const Y={};Y.attribute=Q,Q&&Q.data&&(Y.data=Q.data),V[B]=Y,z++}c.attributes=V,c.attributesNum=z,c.index=j}function b(){const A=c.newAttributes;for(let L=0,$=A.length;L<$;L++)A[L]=0}function w(A){S(A,0)}function S(A,L){const $=c.newAttributes,j=c.enabledAttributes,V=c.attributeDivisors;$[A]=1,j[A]===0&&(e.enableVertexAttribArray(A),j[A]=1),V[A]!==L&&((r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](A,L),V[A]=L)}function _(){const A=c.newAttributes,L=c.enabledAttributes;for(let $=0,j=L.length;$=0){let H=V[N];if(H===void 0&&(N==="instanceMatrix"&&A.instanceMatrix&&(H=A.instanceMatrix),N==="instanceColor"&&A.instanceColor&&(H=A.instanceColor)),H!==void 0){const Q=H.normalized,Y=H.itemSize,Z=n.get(H);if(Z===void 0)continue;const pe=Z.buffer,ie=Z.type,ne=Z.bytesPerElement;if(H.isInterleavedBufferAttribute){const fe=H.data,me=fe.stride,se=H.offset;if(fe.isInstancedInterleavedBuffer){for(let ue=0;ue0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";E="mediump"}return E==="mediump"&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&e instanceof WebGL2ComputeRenderingContext;let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=s||t.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,f=e.getParameter(34930),d=e.getParameter(35660),h=e.getParameter(3379),p=e.getParameter(34076),g=e.getParameter(34921),m=e.getParameter(36347),v=e.getParameter(36348),y=e.getParameter(36349),b=d>0,w=s||t.has("OES_texture_float"),S=b&&w,_=s?e.getParameter(36183):0;return{isWebGL2:s,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:b,floatFragmentTextures:w,floatVertexTextures:S,maxSamples:_}}function Esr(e){const t=this;let n=null,r=0,i=!1,o=!1;const s=new Qx,a=new Pu,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d,h){const p=f.length!==0||d||r!==0||i;return i=d,n=u(f,h,0),r=f.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(f,d,h){const p=f.clippingPlanes,g=f.clipIntersection,m=f.clipShadows,v=e.get(f);if(!i||p===null||p.length===0||o&&!m)o?u(null):c();else{const y=o?0:r,b=y*4;let w=v.clippingState||null;l.value=w,w=u(p,d,b,h);for(let S=0;S!==b;++S)w[S]=n[S];v.clippingState=w,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(f,d,h,p){const g=f!==null?f.length:0;let m=null;if(g!==0){if(m=l.value,p!==!0||m===null){const v=h+g*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length0){const c=new Brr(l.height/2);return c.fromEquirectangularTexture(e,s),t.set(s,c),s.addEventListener("dispose",i),n(c.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function o(){t=new WeakMap}return{get:r,dispose:o}}class fut extends aut{constructor(t=-1,n=1,r=1,i=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(t,n){return super.copy(t,n),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,n,r,i,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-t,s=r+t,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const oO=4,uze=[.125,.215,.35,.446,.526,.582],c1=20,Tee=new fut,fze=new yo;let Pee=null;const Kx=(1+Math.sqrt(5))/2,pC=1/Kx,dze=[new Ne(1,1,1),new Ne(-1,1,1),new Ne(1,1,-1),new Ne(-1,1,-1),new Ne(0,Kx,pC),new Ne(0,Kx,-pC),new Ne(pC,0,Kx),new Ne(-pC,0,Kx),new Ne(Kx,pC,0),new Ne(-Kx,pC,0)];class hze{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,n=0,r=.1,i=100){Pee=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(t,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(t,n=null){return this._fromTexture(t,n)}fromCubemap(t,n=null){return this._fromTexture(t,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=mze(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=gze(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),u.setRenderTarget(i),g&&u.render(p,a),u.render(t,a)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,t.background=m}_textureToCubeUV(t,n){const r=this._renderer,i=t.mapping===gT||t.mapping===mT;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=mze()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=gze());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new Lp(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=t;const l=this._cubeSize;uz(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,Tee)}_applyPMREM(t){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;ic1&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${c1}`);const v=[];let y=0;for(let E=0;Eb-oO?i-b+oO:0),_=4*(this._cubeSize-w);uz(n,S,_,3*w,2*w),l.setRenderTarget(n),l.render(f,Tee)}}function Psr(e){const t=[],n=[],r=[];let i=e;const o=e-oO+1+uze.length;for(let s=0;se-oO?l=uze[s-e+oO-1]:s===0&&(l=0),r.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,g=3,m=2,v=1,y=new Float32Array(g*p*h),b=new Float32Array(m*p*h),w=new Float32Array(v*p*h);for(let _=0;_2?0:-1,k=[E,T,0,E+2/3,T,0,E+2/3,T+1,0,E,T,0,E+2/3,T+1,0,E,T+1,0];y.set(k,g*p*_),b.set(d,m*p*_);const P=[_,_,_,_,_,_];w.set(P,v*p*_)}const S=new Wv;S.setAttribute("position",new Wf(y,g)),S.setAttribute("uv",new Wf(b,m)),S.setAttribute("faceIndex",new Wf(w,v)),t.push(S),i>oO&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}function pze(e,t,n){const r=new Jw(e,t,n);return r.texture.mapping=oH,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function uz(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function ksr(e,t,n){const r=new Float32Array(c1),i=new Ne(0,1,0);return new yb({name:"SphericalGaussianBlur",defines:{n:c1,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:sye(),fragmentShader:` +}`,Sr={alphamap_fragment:qer,alphamap_pars_fragment:Xer,alphatest_fragment:Yer,alphatest_pars_fragment:Qer,aomap_fragment:Ker,aomap_pars_fragment:Zer,begin_vertex:Jer,beginnormal_vertex:etr,bsdfs:ttr,iridescence_fragment:ntr,bumpmap_pars_fragment:rtr,clipping_planes_fragment:itr,clipping_planes_pars_fragment:otr,clipping_planes_pars_vertex:str,clipping_planes_vertex:atr,color_fragment:ltr,color_pars_fragment:ctr,color_pars_vertex:utr,color_vertex:ftr,common:dtr,cube_uv_reflection_fragment:htr,defaultnormal_vertex:ptr,displacementmap_pars_vertex:gtr,displacementmap_vertex:mtr,emissivemap_fragment:vtr,emissivemap_pars_fragment:ytr,encodings_fragment:btr,encodings_pars_fragment:xtr,envmap_fragment:wtr,envmap_common_pars_fragment:Str,envmap_pars_fragment:_tr,envmap_pars_vertex:Ctr,envmap_physical_pars_fragment:Ftr,envmap_vertex:Otr,fog_vertex:Etr,fog_pars_vertex:Ttr,fog_fragment:Ptr,fog_pars_fragment:ktr,gradientmap_pars_fragment:Mtr,lightmap_fragment:Atr,lightmap_pars_fragment:Rtr,lights_lambert_fragment:Itr,lights_lambert_pars_fragment:Dtr,lights_pars_begin:Ltr,lights_toon_fragment:$tr,lights_toon_pars_fragment:Ntr,lights_phong_fragment:ztr,lights_phong_pars_fragment:jtr,lights_physical_fragment:Btr,lights_physical_pars_fragment:Utr,lights_fragment_begin:Vtr,lights_fragment_maps:Wtr,lights_fragment_end:Htr,logdepthbuf_fragment:Gtr,logdepthbuf_pars_fragment:qtr,logdepthbuf_pars_vertex:Xtr,logdepthbuf_vertex:Ytr,map_fragment:Qtr,map_pars_fragment:Ktr,map_particle_fragment:Ztr,map_particle_pars_fragment:Jtr,metalnessmap_fragment:enr,metalnessmap_pars_fragment:tnr,morphcolor_vertex:nnr,morphnormal_vertex:rnr,morphtarget_pars_vertex:inr,morphtarget_vertex:onr,normal_fragment_begin:snr,normal_fragment_maps:anr,normal_pars_fragment:lnr,normal_pars_vertex:cnr,normal_vertex:unr,normalmap_pars_fragment:fnr,clearcoat_normal_fragment_begin:dnr,clearcoat_normal_fragment_maps:hnr,clearcoat_pars_fragment:pnr,iridescence_pars_fragment:gnr,output_fragment:mnr,packing:vnr,premultiplied_alpha_fragment:ynr,project_vertex:bnr,dithering_fragment:xnr,dithering_pars_fragment:wnr,roughnessmap_fragment:Snr,roughnessmap_pars_fragment:_nr,shadowmap_pars_fragment:Cnr,shadowmap_pars_vertex:Onr,shadowmap_vertex:Enr,shadowmask_pars_fragment:Tnr,skinbase_vertex:Pnr,skinning_pars_vertex:knr,skinning_vertex:Mnr,skinnormal_vertex:Anr,specularmap_fragment:Rnr,specularmap_pars_fragment:Inr,tonemapping_fragment:Dnr,tonemapping_pars_fragment:Lnr,transmission_fragment:Fnr,transmission_pars_fragment:$nr,uv_pars_fragment:Nnr,uv_pars_vertex:znr,uv_vertex:jnr,uv2_pars_fragment:Bnr,uv2_pars_vertex:Unr,uv2_vertex:Vnr,worldpos_vertex:Wnr,background_vert:Hnr,background_frag:Gnr,cube_vert:qnr,cube_frag:Xnr,depth_vert:Ynr,depth_frag:Qnr,distanceRGBA_vert:Knr,distanceRGBA_frag:Znr,equirect_vert:Jnr,equirect_frag:err,linedashed_vert:trr,linedashed_frag:nrr,meshbasic_vert:rrr,meshbasic_frag:irr,meshlambert_vert:orr,meshlambert_frag:srr,meshmatcap_vert:arr,meshmatcap_frag:lrr,meshnormal_vert:crr,meshnormal_frag:urr,meshphong_vert:frr,meshphong_frag:drr,meshphysical_vert:hrr,meshphysical_frag:prr,meshtoon_vert:grr,meshtoon_frag:mrr,points_vert:vrr,points_frag:yrr,shadow_vert:brr,shadow_frag:xrr,sprite_vert:wrr,sprite_frag:Srr},zt={common:{diffuse:{value:new yo(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Pu},uv2Transform:{value:new Pu},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new _r(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new yo(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yo(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Pu}},sprite:{diffuse:{value:new yo(16777215)},opacity:{value:1},center:{value:new _r(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Pu}}},cp={basic:{uniforms:Qa([zt.common,zt.specularmap,zt.envmap,zt.aomap,zt.lightmap,zt.fog]),vertexShader:Sr.meshbasic_vert,fragmentShader:Sr.meshbasic_frag},lambert:{uniforms:Qa([zt.common,zt.specularmap,zt.envmap,zt.aomap,zt.lightmap,zt.emissivemap,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.fog,zt.lights,{emissive:{value:new yo(0)}}]),vertexShader:Sr.meshlambert_vert,fragmentShader:Sr.meshlambert_frag},phong:{uniforms:Qa([zt.common,zt.specularmap,zt.envmap,zt.aomap,zt.lightmap,zt.emissivemap,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.fog,zt.lights,{emissive:{value:new yo(0)},specular:{value:new yo(1118481)},shininess:{value:30}}]),vertexShader:Sr.meshphong_vert,fragmentShader:Sr.meshphong_frag},standard:{uniforms:Qa([zt.common,zt.envmap,zt.aomap,zt.lightmap,zt.emissivemap,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.roughnessmap,zt.metalnessmap,zt.fog,zt.lights,{emissive:{value:new yo(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Sr.meshphysical_vert,fragmentShader:Sr.meshphysical_frag},toon:{uniforms:Qa([zt.common,zt.aomap,zt.lightmap,zt.emissivemap,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.gradientmap,zt.fog,zt.lights,{emissive:{value:new yo(0)}}]),vertexShader:Sr.meshtoon_vert,fragmentShader:Sr.meshtoon_frag},matcap:{uniforms:Qa([zt.common,zt.bumpmap,zt.normalmap,zt.displacementmap,zt.fog,{matcap:{value:null}}]),vertexShader:Sr.meshmatcap_vert,fragmentShader:Sr.meshmatcap_frag},points:{uniforms:Qa([zt.points,zt.fog]),vertexShader:Sr.points_vert,fragmentShader:Sr.points_frag},dashed:{uniforms:Qa([zt.common,zt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Sr.linedashed_vert,fragmentShader:Sr.linedashed_frag},depth:{uniforms:Qa([zt.common,zt.displacementmap]),vertexShader:Sr.depth_vert,fragmentShader:Sr.depth_frag},normal:{uniforms:Qa([zt.common,zt.bumpmap,zt.normalmap,zt.displacementmap,{opacity:{value:1}}]),vertexShader:Sr.meshnormal_vert,fragmentShader:Sr.meshnormal_frag},sprite:{uniforms:Qa([zt.sprite,zt.fog]),vertexShader:Sr.sprite_vert,fragmentShader:Sr.sprite_frag},background:{uniforms:{uvTransform:{value:new Pu},t2D:{value:null}},vertexShader:Sr.background_vert,fragmentShader:Sr.background_frag},cube:{uniforms:Qa([zt.envmap,{opacity:{value:1}}]),vertexShader:Sr.cube_vert,fragmentShader:Sr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Sr.equirect_vert,fragmentShader:Sr.equirect_frag},distanceRGBA:{uniforms:Qa([zt.common,zt.displacementmap,{referencePosition:{value:new Ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Sr.distanceRGBA_vert,fragmentShader:Sr.distanceRGBA_frag},shadow:{uniforms:Qa([zt.lights,zt.fog,{color:{value:new yo(0)},opacity:{value:1}}]),vertexShader:Sr.shadow_vert,fragmentShader:Sr.shadow_frag}};cp.physical={uniforms:Qa([cp.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new _r(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new yo(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new _r},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new yo(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new yo(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Sr.meshphysical_vert,fragmentShader:Sr.meshphysical_frag};function _rr(e,t,n,r,i,o){const s=new yo(0);let a=i===!0?0:1,l,c,u=null,f=0,d=null;function h(g,m){let v=!1,y=m.isScene===!0?m.background:null;y&&y.isTexture&&(y=t.get(y));const b=e.xr,w=b.getSession&&b.getSession();w&&w.environmentBlendMode==="additive"&&(y=null),y===null?p(s,a):y&&y.isColor&&(p(y,1),v=!0),(e.autoClear||v)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===LW)?(c===void 0&&(c=new Dp(new AP(1,1,1),new pb({name:"BackgroundCubeMaterial",uniforms:uT(cp.cube.uniforms),vertexShader:cp.cube.vertexShader,fragmentShader:cp.cube.fragmentShader,side:Fu,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(S,_,E){this.matrixWorld.copyPosition(E.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,(u!==y||f!==y.version||d!==e.toneMapping)&&(c.material.needsUpdate=!0,u=y,f=y.version,d=e.toneMapping),c.layers.enableAll(),g.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new Dp(new NW(2,2),new pb({name:"BackgroundMaterial",uniforms:uT(cp.background.uniforms),vertexShader:cp.background.vertexShader,fragmentShader:cp.background.fragmentShader,side:sT,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||f!==y.version||d!==e.toneMapping)&&(l.material.needsUpdate=!0,u=y,f=y.version,d=e.toneMapping),l.layers.enableAll(),g.unshift(l,l.geometry,l.material,0,0,null))}function p(g,m){n.buffers.color.setClear(g.r,g.g,g.b,m,o)}return{getClearColor:function(){return s},setClearColor:function(g,m=1){s.set(g),a=m,p(s,a)},getClearAlpha:function(){return a},setClearAlpha:function(g){a=g,p(s,a)},render:h}}function Crr(e,t,n,r){const i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),s=r.isWebGL2||o!==null,a={},l=m(null);let c=l,u=!1;function f(A,L,$,j,V){let U=!1;if(s){const z=g(j,$,L);c!==z&&(c=z,h(c.object)),U=v(A,j,$,V),U&&y(A,j,$,V)}else{const z=L.wireframe===!0;(c.geometry!==j.id||c.program!==$.id||c.wireframe!==z)&&(c.geometry=j.id,c.program=$.id,c.wireframe=z,U=!0)}V!==null&&n.update(V,34963),(U||u)&&(u=!1,T(A,L,$,j),V!==null&&e.bindBuffer(34963,n.get(V).buffer))}function d(){return r.isWebGL2?e.createVertexArray():o.createVertexArrayOES()}function h(A){return r.isWebGL2?e.bindVertexArray(A):o.bindVertexArrayOES(A)}function p(A){return r.isWebGL2?e.deleteVertexArray(A):o.deleteVertexArrayOES(A)}function g(A,L,$){const j=$.wireframe===!0;let V=a[A.id];V===void 0&&(V={},a[A.id]=V);let U=V[L.id];U===void 0&&(U={},V[L.id]=U);let z=U[j];return z===void 0&&(z=m(d()),U[j]=z),z}function m(A){const L=[],$=[],j=[];for(let V=0;V=0){const Q=V[B];let Y=U[B];if(Y===void 0&&(B==="instanceMatrix"&&A.instanceMatrix&&(Y=A.instanceMatrix),B==="instanceColor"&&A.instanceColor&&(Y=A.instanceColor)),Q===void 0||Q.attribute!==Y||Y&&Q.data!==Y.data)return!0;z++}return c.attributesNum!==z||c.index!==j}function y(A,L,$,j){const V={},U=L.attributes;let z=0;const N=$.getAttributes();for(const B in N)if(N[B].location>=0){let Q=U[B];Q===void 0&&(B==="instanceMatrix"&&A.instanceMatrix&&(Q=A.instanceMatrix),B==="instanceColor"&&A.instanceColor&&(Q=A.instanceColor));const Y={};Y.attribute=Q,Q&&Q.data&&(Y.data=Q.data),V[B]=Y,z++}c.attributes=V,c.attributesNum=z,c.index=j}function b(){const A=c.newAttributes;for(let L=0,$=A.length;L<$;L++)A[L]=0}function w(A){S(A,0)}function S(A,L){const $=c.newAttributes,j=c.enabledAttributes,V=c.attributeDivisors;$[A]=1,j[A]===0&&(e.enableVertexAttribArray(A),j[A]=1),V[A]!==L&&((r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](A,L),V[A]=L)}function _(){const A=c.newAttributes,L=c.enabledAttributes;for(let $=0,j=L.length;$=0){let H=V[N];if(H===void 0&&(N==="instanceMatrix"&&A.instanceMatrix&&(H=A.instanceMatrix),N==="instanceColor"&&A.instanceColor&&(H=A.instanceColor)),H!==void 0){const Q=H.normalized,Y=H.itemSize,Z=n.get(H);if(Z===void 0)continue;const ge=Z.buffer,ne=Z.type,ie=Z.bytesPerElement;if(H.isInterleavedBufferAttribute){const fe=H.data,ve=fe.stride,se=H.offset;if(fe.isInstancedInterleavedBuffer){for(let ue=0;ue0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";E="mediump"}return E==="mediump"&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&e instanceof WebGL2ComputeRenderingContext;let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=s||t.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,f=e.getParameter(34930),d=e.getParameter(35660),h=e.getParameter(3379),p=e.getParameter(34076),g=e.getParameter(34921),m=e.getParameter(36347),v=e.getParameter(36348),y=e.getParameter(36349),b=d>0,w=s||t.has("OES_texture_float"),S=b&&w,_=s?e.getParameter(36183):0;return{isWebGL2:s,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:b,floatFragmentTextures:w,floatVertexTextures:S,maxSamples:_}}function Trr(e){const t=this;let n=null,r=0,i=!1,o=!1;const s=new Bx,a=new Pu,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d,h){const p=f.length!==0||d||r!==0||i;return i=d,n=u(f,h,0),r=f.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(f,d,h){const p=f.clippingPlanes,g=f.clipIntersection,m=f.clipShadows,v=e.get(f);if(!i||p===null||p.length===0||o&&!m)o?u(null):c();else{const y=o?0:r,b=y*4;let w=v.clippingState||null;l.value=w,w=u(p,d,b,h);for(let S=0;S!==b;++S)w[S]=n[S];v.clippingState=w,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(f,d,h,p){const g=f!==null?f.length:0;let m=null;if(g!==0){if(m=l.value,p!==!0||m===null){const v=h+g*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length0){const c=new Ver(l.height/2);return c.fromEquirectangularTexture(e,s),t.set(s,c),s.addEventListener("dispose",i),n(c.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function o(){t=new WeakMap}return{get:r,dispose:o}}class Yat extends Hat{constructor(t=-1,n=1,r=1,i=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(t,n){return super.copy(t,n),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,n,r,i,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-t,s=r+t,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const QC=4,aNe=[.125,.215,.35,.446,.526,.582],e1=20,_J=new Yat,lNe=new yo;let CJ=null;const Ux=(1+Math.sqrt(5))/2,oC=1/Ux,cNe=[new Ne(1,1,1),new Ne(-1,1,1),new Ne(1,1,-1),new Ne(-1,1,-1),new Ne(0,Ux,oC),new Ne(0,Ux,-oC),new Ne(oC,0,Ux),new Ne(-oC,0,Ux),new Ne(Ux,oC,0),new Ne(-Ux,oC,0)];class uNe{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,n=0,r=.1,i=100){CJ=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(t,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(t,n=null){return this._fromTexture(t,n)}fromCubemap(t,n=null){return this._fromTexture(t,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=hNe(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=dNe(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),u.setRenderTarget(i),g&&u.render(p,a),u.render(t,a)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,t.background=m}_textureToCubeUV(t,n){const r=this._renderer,i=t.mapping===aT||t.mapping===lT;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=hNe()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=dNe());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new Dp(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=t;const l=this._cubeSize;V3(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,_J)}_applyPMREM(t){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;ie1&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${e1}`);const v=[];let y=0;for(let E=0;Eb-QC?i-b+QC:0),_=4*(this._cubeSize-w);V3(n,S,_,3*w,2*w),l.setRenderTarget(n),l.render(f,_J)}}function krr(e){const t=[],n=[],r=[];let i=e;const o=e-QC+1+aNe.length;for(let s=0;se-QC?l=aNe[s-e+QC-1]:s===0&&(l=0),r.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,g=3,m=2,v=1,y=new Float32Array(g*p*h),b=new Float32Array(m*p*h),w=new Float32Array(v*p*h);for(let _=0;_2?0:-1,k=[E,T,0,E+2/3,T,0,E+2/3,T+1,0,E,T,0,E+2/3,T+1,0,E,T+1,0];y.set(k,g*p*_),b.set(d,m*p*_);const P=[_,_,_,_,_,_];w.set(P,v*p*_)}const S=new jv;S.setAttribute("position",new Vf(y,g)),S.setAttribute("uv",new Vf(b,m)),S.setAttribute("faceIndex",new Vf(w,v)),t.push(S),i>QC&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}function fNe(e,t,n){const r=new Hw(e,t,n);return r.texture.mapping=LW,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function V3(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Mrr(e,t,n){const r=new Float32Array(e1),i=new Ne(0,1,0);return new pb({name:"SphericalGaussianBlur",defines:{n:e1,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:eve(),fragmentShader:` precision mediump float; precision mediump int; @@ -3543,7 +3577,7 @@ void main() { } } - `,blending:V0,depthTest:!1,depthWrite:!1})}function gze(){return new yb({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:sye(),fragmentShader:` + `,blending:$0,depthTest:!1,depthWrite:!1})}function dNe(){return new pb({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:eve(),fragmentShader:` precision mediump float; precision mediump int; @@ -3562,7 +3596,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:V0,depthTest:!1,depthWrite:!1})}function mze(){return new yb({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:sye(),fragmentShader:` + `,blending:$0,depthTest:!1,depthWrite:!1})}function hNe(){return new pb({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:eve(),fragmentShader:` precision mediump float; precision mediump int; @@ -3578,7 +3612,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:V0,depthTest:!1,depthWrite:!1})}function sye(){return` + `,blending:$0,depthTest:!1,depthWrite:!1})}function eve(){return` precision mediump float; precision mediump int; @@ -3633,39 +3667,39 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function Msr(e){let t=new WeakMap,n=null;function r(a){if(a&&a.isTexture){const l=a.mapping,c=l===mae||l===vae,u=l===gT||l===mT;if(c||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let f=t.get(a);return n===null&&(n=new hze(e)),f=c?n.fromEquirectangular(a,f):n.fromCubemap(a,f),t.set(a,f),f.texture}else{if(t.has(a))return t.get(a).texture;{const f=a.image;if(c&&f&&f.height>0||u&&f&&i(f)){n===null&&(n=new hze(e));const d=c?n.fromEquirectangular(a):n.fromCubemap(a);return t.set(a,d),a.addEventListener("dispose",o),d.texture}else return null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ut.maxTextureSize&&(R=Math.ceil(P/t.maxTextureSize),P=t.maxTextureSize);const I=new Float32Array(P*R*4*g),F=new eut(I,P,R,g);F.type=E0,F.needsUpdate=!0;const A=k*4;for(let $=0;$0)return e;const i=t*n;let o=vze[i];if(o===void 0&&(o=new Float32Array(i),vze[i]=o),t!==0){r.toArray(o,0);for(let s=1,a=0;s!==t;++s)a+=n,e[s].toArray(o,a)}return o}function Jl(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n0||u&&f&&i(f)){n===null&&(n=new uNe(e));const d=c?n.fromEquirectangular(a):n.fromCubemap(a);return t.set(a,d),a.addEventListener("dispose",o),d.texture}else return null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ut.maxTextureSize&&(I=Math.ceil(P/t.maxTextureSize),P=t.maxTextureSize);const R=new Float32Array(P*I*4*g),F=new Nat(R,P,I,g);F.type=x0,F.needsUpdate=!0;const A=k*4;for(let $=0;$0)return e;const i=t*n;let o=pNe[i];if(o===void 0&&(o=new Float32Array(i),pNe[i]=o),t!==0){r.toArray(o,0);for(let s=1,a=0;s!==t;++s)a+=n,e[s].toArray(o,a)}return o}function Kl(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n":" "} ${a}: ${n[s]}`)}return r.join(` -`)}function Rar(e){switch(e){case Zw:return["Linear","( value )"];case Lo:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function Cze(e,t,n){const r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const s=parseInt(o[1]);return n.toUpperCase()+` +`)}function Rir(e){switch(e){case Ww:return["Linear","( value )"];case Lo:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function wNe(e,t,n){const r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const s=parseInt(o[1]);return n.toUpperCase()+` `+i+` -`+Aar(e.getShaderSource(t),s)}else return i}function Iar(e,t){const n=Rar(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Dar(e,t){let n;switch(t){case err:n="Linear";break;case trr:n="Reinhard";break;case nrr:n="OptimizedCineon";break;case rrr:n="ACESFilmic";break;case irr:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Lar(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||e.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(zM).join(` -`)}function Far(e){const t=[];for(const n in e){const r=e[n];r!==!1&&t.push("#define "+n+" "+r)}return t.join(` -`)}function $ar(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i/gm;function Sae(e){return e.replace(Nar,zar)}function zar(e,t){const n=wr[t];if(n===void 0)throw new Error("Can not resolve #include <"+t+">");return Sae(n)}const jar=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Tze(e){return e.replace(jar,Bar)}function Bar(e,t,n,r){let i="";for(let o=parseInt(t);o/gm;function hse(e){return e.replace(Nir,zir)}function zir(e,t){const n=Sr[t];if(n===void 0)throw new Error("Can not resolve #include <"+t+">");return hse(n)}const jir=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function CNe(e){return e.replace(jir,Bir)}function Bir(e,t,n,r){let i="";for(let o=parseInt(t);o0&&(m+=` -`),v=[h,p].filter(zM).join(` +`),v=[h,p].filter(TM).join(` `),v.length>0&&(v+=` -`)):(m=[Pze(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(zM).join(` -`),v=[h,Pze(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==sv?"#define TONE_MAPPING":"",n.toneMapping!==sv?wr.tonemapping_pars_fragment:"",n.toneMapping!==sv?Dar("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",wr.encodings_pars_fragment,Iar("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(zM).join(` -`)),s=Sae(s),s=Oze(s,n),s=Eze(s,n),a=Sae(a),a=Oze(a,n),a=Eze(a,n),s=Tze(s),a=Tze(a),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es +`)):(m=[ONe(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(TM).join(` +`),v=[h,ONe(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==nv?"#define TONE_MAPPING":"",n.toneMapping!==nv?Sr.tonemapping_pars_fragment:"",n.toneMapping!==nv?Dir("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Sr.encodings_pars_fragment,Iir("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(TM).join(` +`)),s=hse(s),s=SNe(s,n),s=_Ne(s,n),a=hse(a),a=SNe(a,n),a=_Ne(a,n),s=CNe(s),a=CNe(a),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es `,m=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+m,v=["#define varying in",n.glslVersion===Q3e?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Q3e?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+m,v=["#define varying in",n.glslVersion===q$e?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===q$e?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+v);const b=y+m+s,w=y+v+a,S=_ze(i,35633,b),_=_ze(i,35632,w);if(i.attachShader(g,S),i.attachShader(g,_),n.index0AttributeName!==void 0?i.bindAttribLocation(g,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g),e.debug.checkShaderErrors){const k=i.getProgramInfoLog(g).trim(),P=i.getShaderInfoLog(S).trim(),R=i.getShaderInfoLog(_).trim();let I=!0,F=!0;if(i.getProgramParameter(g,35714)===!1){I=!1;const A=Cze(i,S,"vertex"),L=Cze(i,_,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,35715)+` +`+v);const b=y+m+s,w=y+v+a,S=xNe(i,35633,b),_=xNe(i,35632,w);if(i.attachShader(g,S),i.attachShader(g,_),n.index0AttributeName!==void 0?i.bindAttribLocation(g,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g),e.debug.checkShaderErrors){const k=i.getProgramInfoLog(g).trim(),P=i.getShaderInfoLog(S).trim(),I=i.getShaderInfoLog(_).trim();let R=!0,F=!0;if(i.getProgramParameter(g,35714)===!1){R=!1;const A=wNe(i,S,"vertex"),L=wNe(i,_,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,35715)+` Program Info Log: `+k+` `+A+` -`+L)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(P===""||R==="")&&(F=!1);F&&(this.diagnostics={runnable:I,programLog:k,vertexShader:{log:P,prefix:m},fragmentShader:{log:R,prefix:v}})}i.deleteShader(S),i.deleteShader(_);let E;this.getUniforms=function(){return E===void 0&&(E=new A5(i,g)),E};let T;return this.getAttributes=function(){return T===void 0&&(T=$ar(i,g)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=Mar++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=S,this.fragmentShader=_,this}let Xar=0;class Yar{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const n=t.vertexShader,r=t.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),s=this._getShaderCacheForMaterial(t);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(t){const n=this.materialCache.get(t);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const n=this.materialCache;let r=n.get(t);return r===void 0&&(r=new Set,n.set(t,r)),r}_getShaderStage(t){const n=this.shaderCache;let r=n.get(t);return r===void 0&&(r=new Qar(t),n.set(t,r)),r}}class Qar{constructor(t){this.id=Xar++,this.code=t,this.usedTimes=0}}function Kar(e,t,n,r,i,o,s){const a=new rut,l=new Yar,c=[],u=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(T,k,P,R,I){const F=R.fog,A=I.geometry,L=T.isMeshStandardMaterial?R.environment:null,$=(T.isMeshStandardMaterial?n:t).get(T.envMap||L),j=$&&$.mapping===oH?$.image.height:null,V=p[T.type];T.precision!==null&&(h=i.getMaxPrecision(T.precision),h!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",h,"instead."));const U=A.morphAttributes.position||A.morphAttributes.normal||A.morphAttributes.color,z=U!==void 0?U.length:0;let N=0;A.morphAttributes.position!==void 0&&(N=1),A.morphAttributes.normal!==void 0&&(N=2),A.morphAttributes.color!==void 0&&(N=3);let B,H,Q,Y;if(V){const me=up[V];B=me.vertexShader,H=me.fragmentShader}else B=T.vertexShader,H=T.fragmentShader,l.update(T),Q=l.getVertexShaderID(T),Y=l.getFragmentShaderID(T);const Z=e.getRenderTarget(),pe=T.alphaTest>0,ie=T.clearcoat>0,ne=T.iridescence>0;return{isWebGL2:u,shaderID:V,shaderName:T.type,vertexShader:B,fragmentShader:H,defines:T.defines,customVertexShaderID:Q,customFragmentShaderID:Y,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:h,instancing:I.isInstancedMesh===!0,instancingColor:I.isInstancedMesh===!0&&I.instanceColor!==null,supportsVertexTextures:d,outputEncoding:Z===null?e.outputEncoding:Z.isXRRenderTarget===!0?Z.texture.encoding:Zw,map:!!T.map,matcap:!!T.matcap,envMap:!!$,envMapMode:$&&$.mapping,envMapCubeUVHeight:j,lightMap:!!T.lightMap,aoMap:!!T.aoMap,emissiveMap:!!T.emissiveMap,bumpMap:!!T.bumpMap,normalMap:!!T.normalMap,objectSpaceNormalMap:T.normalMapType===_rr,tangentSpaceNormalMap:T.normalMapType===Srr,decodeVideoTexture:!!T.map&&T.map.isVideoTexture===!0&&T.map.encoding===Lo,clearcoat:ie,clearcoatMap:ie&&!!T.clearcoatMap,clearcoatRoughnessMap:ie&&!!T.clearcoatRoughnessMap,clearcoatNormalMap:ie&&!!T.clearcoatNormalMap,iridescence:ne,iridescenceMap:ne&&!!T.iridescenceMap,iridescenceThicknessMap:ne&&!!T.iridescenceThicknessMap,displacementMap:!!T.displacementMap,roughnessMap:!!T.roughnessMap,metalnessMap:!!T.metalnessMap,specularMap:!!T.specularMap,specularIntensityMap:!!T.specularIntensityMap,specularColorMap:!!T.specularColorMap,opaque:T.transparent===!1&&T.blending===$O,alphaMap:!!T.alphaMap,alphaTest:pe,gradientMap:!!T.gradientMap,sheen:T.sheen>0,sheenColorMap:!!T.sheenColorMap,sheenRoughnessMap:!!T.sheenRoughnessMap,transmission:T.transmission>0,transmissionMap:!!T.transmissionMap,thicknessMap:!!T.thicknessMap,combine:T.combine,vertexTangents:!!T.normalMap&&!!A.attributes.tangent,vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!A.attributes.color&&A.attributes.color.itemSize===4,vertexUvs:!!T.map||!!T.bumpMap||!!T.normalMap||!!T.specularMap||!!T.alphaMap||!!T.emissiveMap||!!T.roughnessMap||!!T.metalnessMap||!!T.clearcoatMap||!!T.clearcoatRoughnessMap||!!T.clearcoatNormalMap||!!T.iridescenceMap||!!T.iridescenceThicknessMap||!!T.displacementMap||!!T.transmissionMap||!!T.thicknessMap||!!T.specularIntensityMap||!!T.specularColorMap||!!T.sheenColorMap||!!T.sheenRoughnessMap,uvsVertexOnly:!(T.map||T.bumpMap||T.normalMap||T.specularMap||T.alphaMap||T.emissiveMap||T.roughnessMap||T.metalnessMap||T.clearcoatNormalMap||T.iridescenceMap||T.iridescenceThicknessMap||T.transmission>0||T.transmissionMap||T.thicknessMap||T.specularIntensityMap||T.specularColorMap||T.sheen>0||T.sheenColorMap||T.sheenRoughnessMap)&&!!T.displacementMap,fog:!!F,useFog:T.fog===!0,fogExp2:F&&F.isFogExp2,flatShading:!!T.flatShading,sizeAttenuation:T.sizeAttenuation,logarithmicDepthBuffer:f,skinning:I.isSkinnedMesh===!0,morphTargets:A.morphAttributes.position!==void 0,morphNormals:A.morphAttributes.normal!==void 0,morphColors:A.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:N,numDirLights:k.directional.length,numPointLights:k.point.length,numSpotLights:k.spot.length,numSpotLightMaps:k.spotLightMap.length,numRectAreaLights:k.rectArea.length,numHemiLights:k.hemi.length,numDirLightShadows:k.directionalShadowMap.length,numPointLightShadows:k.pointShadowMap.length,numSpotLightShadows:k.spotShadowMap.length,numSpotLightShadowsWithMaps:k.numSpotLightShadowsWithMaps,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:T.dithering,shadowMapEnabled:e.shadowMap.enabled&&P.length>0,shadowMapType:e.shadowMap.type,toneMapping:T.toneMapped?e.toneMapping:sv,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===Um,flipSided:T.side===Fu,useDepthPacking:!!T.depthPacking,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:T.extensions&&T.extensions.derivatives,extensionFragDepth:T.extensions&&T.extensions.fragDepth,extensionDrawBuffers:T.extensions&&T.extensions.drawBuffers,extensionShaderTextureLOD:T.extensions&&T.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:T.customProgramCacheKey()}}function m(T){const k=[];if(T.shaderID?k.push(T.shaderID):(k.push(T.customVertexShaderID),k.push(T.customFragmentShaderID)),T.defines!==void 0)for(const P in T.defines)k.push(P),k.push(T.defines[P]);return T.isRawShaderMaterial===!1&&(v(k,T),y(k,T),k.push(e.outputEncoding)),k.push(T.customProgramCacheKey),k.join()}function v(T,k){T.push(k.precision),T.push(k.outputEncoding),T.push(k.envMapMode),T.push(k.envMapCubeUVHeight),T.push(k.combine),T.push(k.vertexUvs),T.push(k.fogExp2),T.push(k.sizeAttenuation),T.push(k.morphTargetsCount),T.push(k.morphAttributeCount),T.push(k.numDirLights),T.push(k.numPointLights),T.push(k.numSpotLights),T.push(k.numSpotLightMaps),T.push(k.numHemiLights),T.push(k.numRectAreaLights),T.push(k.numDirLightShadows),T.push(k.numPointLightShadows),T.push(k.numSpotLightShadows),T.push(k.numSpotLightShadowsWithMaps),T.push(k.shadowMapType),T.push(k.toneMapping),T.push(k.numClippingPlanes),T.push(k.numClipIntersection),T.push(k.depthPacking)}function y(T,k){a.disableAll(),k.isWebGL2&&a.enable(0),k.supportsVertexTextures&&a.enable(1),k.instancing&&a.enable(2),k.instancingColor&&a.enable(3),k.map&&a.enable(4),k.matcap&&a.enable(5),k.envMap&&a.enable(6),k.lightMap&&a.enable(7),k.aoMap&&a.enable(8),k.emissiveMap&&a.enable(9),k.bumpMap&&a.enable(10),k.normalMap&&a.enable(11),k.objectSpaceNormalMap&&a.enable(12),k.tangentSpaceNormalMap&&a.enable(13),k.clearcoat&&a.enable(14),k.clearcoatMap&&a.enable(15),k.clearcoatRoughnessMap&&a.enable(16),k.clearcoatNormalMap&&a.enable(17),k.iridescence&&a.enable(18),k.iridescenceMap&&a.enable(19),k.iridescenceThicknessMap&&a.enable(20),k.displacementMap&&a.enable(21),k.specularMap&&a.enable(22),k.roughnessMap&&a.enable(23),k.metalnessMap&&a.enable(24),k.gradientMap&&a.enable(25),k.alphaMap&&a.enable(26),k.alphaTest&&a.enable(27),k.vertexColors&&a.enable(28),k.vertexAlphas&&a.enable(29),k.vertexUvs&&a.enable(30),k.vertexTangents&&a.enable(31),k.uvsVertexOnly&&a.enable(32),T.push(a.mask),a.disableAll(),k.fog&&a.enable(0),k.useFog&&a.enable(1),k.flatShading&&a.enable(2),k.logarithmicDepthBuffer&&a.enable(3),k.skinning&&a.enable(4),k.morphTargets&&a.enable(5),k.morphNormals&&a.enable(6),k.morphColors&&a.enable(7),k.premultipliedAlpha&&a.enable(8),k.shadowMapEnabled&&a.enable(9),k.physicallyCorrectLights&&a.enable(10),k.doubleSided&&a.enable(11),k.flipSided&&a.enable(12),k.useDepthPacking&&a.enable(13),k.dithering&&a.enable(14),k.specularIntensityMap&&a.enable(15),k.specularColorMap&&a.enable(16),k.transmission&&a.enable(17),k.transmissionMap&&a.enable(18),k.thicknessMap&&a.enable(19),k.sheen&&a.enable(20),k.sheenColorMap&&a.enable(21),k.sheenRoughnessMap&&a.enable(22),k.decodeVideoTexture&&a.enable(23),k.opaque&&a.enable(24),T.push(a.mask)}function b(T){const k=p[T.type];let P;if(k){const R=up[k];P=sut.clone(R.uniforms)}else P=T.uniforms;return P}function w(T,k){let P;for(let R=0,I=c.length;R0?r.push(v):h.transparent===!0?i.push(v):n.push(v)}function l(f,d,h,p,g,m){const v=s(f,d,h,p,g,m);h.transmission>0?r.unshift(v):h.transparent===!0?i.unshift(v):n.unshift(v)}function c(f,d){n.length>1&&n.sort(f||Jar),r.length>1&&r.sort(d||kze),i.length>1&&i.sort(d||kze)}function u(){for(let f=t,d=e.length;f=o.length?(s=new Mze,o.push(s)):s=o[i],s}function n(){e=new WeakMap}return{get:t,dispose:n}}function tlr(){const e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Ne,color:new yo};break;case"SpotLight":n={position:new Ne,direction:new Ne,color:new yo,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ne,color:new yo,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ne,skyColor:new yo,groundColor:new yo};break;case"RectAreaLight":n={color:new yo,position:new Ne,halfWidth:new Ne,halfHeight:new Ne};break}return e[t.id]=n,n}}}function nlr(){const e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Sr};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Sr};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Sr,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}let rlr=0;function ilr(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function olr(e,t){const n=new tlr,r=nlr(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let u=0;u<9;u++)i.probe.push(new Ne);const o=new Ne,s=new Zi,a=new Zi;function l(u,f){let d=0,h=0,p=0;for(let R=0;R<9;R++)i.probe[R].set(0,0,0);let g=0,m=0,v=0,y=0,b=0,w=0,S=0,_=0,E=0,T=0;u.sort(ilr);const k=f!==!0?Math.PI:1;for(let R=0,I=u.length;R0&&(t.isWebGL2||e.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=zt.LTC_FLOAT_1,i.rectAreaLTC2=zt.LTC_FLOAT_2):e.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=zt.LTC_HALF_1,i.rectAreaLTC2=zt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const P=i.hash;(P.directionalLength!==g||P.pointLength!==m||P.spotLength!==v||P.rectAreaLength!==y||P.hemiLength!==b||P.numDirectionalShadows!==w||P.numPointShadows!==S||P.numSpotShadows!==_||P.numSpotMaps!==E)&&(i.directional.length=g,i.spot.length=v,i.rectArea.length=y,i.point.length=m,i.hemi.length=b,i.directionalShadow.length=w,i.directionalShadowMap.length=w,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=_,i.spotShadowMap.length=_,i.directionalShadowMatrix.length=w,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=_+E-T,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=T,P.directionalLength=g,P.pointLength=m,P.spotLength=v,P.rectAreaLength=y,P.hemiLength=b,P.numDirectionalShadows=w,P.numPointShadows=S,P.numSpotShadows=_,P.numSpotMaps=E,i.version=rlr++)}function c(u,f){let d=0,h=0,p=0,g=0,m=0;const v=f.matrixWorldInverse;for(let y=0,b=u.length;y=a.length?(l=new Aze(e,t),a.push(l)):l=a[s],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class alr extends lF{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=xrr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class llr extends lF{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Ne,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const clr=`void main() { +`+L)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(P===""||I==="")&&(F=!1);F&&(this.diagnostics={runnable:R,programLog:k,vertexShader:{log:P,prefix:m},fragmentShader:{log:I,prefix:v}})}i.deleteShader(S),i.deleteShader(_);let E;this.getUniforms=function(){return E===void 0&&(E=new l5(i,g)),E};let T;return this.getAttributes=function(){return T===void 0&&(T=$ir(i,g)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=Mir++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=S,this.fragmentShader=_,this}let Xir=0;class Yir{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const n=t.vertexShader,r=t.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),s=this._getShaderCacheForMaterial(t);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(t){const n=this.materialCache.get(t);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const n=this.materialCache;let r=n.get(t);return r===void 0&&(r=new Set,n.set(t,r)),r}_getShaderStage(t){const n=this.shaderCache;let r=n.get(t);return r===void 0&&(r=new Qir(t),n.set(t,r)),r}}class Qir{constructor(t){this.id=Xir++,this.code=t,this.usedTimes=0}}function Kir(e,t,n,r,i,o,s){const a=new Bat,l=new Yir,c=[],u=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(T,k,P,I,R){const F=I.fog,A=R.geometry,L=T.isMeshStandardMaterial?I.environment:null,$=(T.isMeshStandardMaterial?n:t).get(T.envMap||L),j=$&&$.mapping===LW?$.image.height:null,V=p[T.type];T.precision!==null&&(h=i.getMaxPrecision(T.precision),h!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",h,"instead."));const U=A.morphAttributes.position||A.morphAttributes.normal||A.morphAttributes.color,z=U!==void 0?U.length:0;let N=0;A.morphAttributes.position!==void 0&&(N=1),A.morphAttributes.normal!==void 0&&(N=2),A.morphAttributes.color!==void 0&&(N=3);let B,H,Q,Y;if(V){const ve=cp[V];B=ve.vertexShader,H=ve.fragmentShader}else B=T.vertexShader,H=T.fragmentShader,l.update(T),Q=l.getVertexShaderID(T),Y=l.getFragmentShaderID(T);const Z=e.getRenderTarget(),ge=T.alphaTest>0,ne=T.clearcoat>0,ie=T.iridescence>0;return{isWebGL2:u,shaderID:V,shaderName:T.type,vertexShader:B,fragmentShader:H,defines:T.defines,customVertexShaderID:Q,customFragmentShaderID:Y,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:h,instancing:R.isInstancedMesh===!0,instancingColor:R.isInstancedMesh===!0&&R.instanceColor!==null,supportsVertexTextures:d,outputEncoding:Z===null?e.outputEncoding:Z.isXRRenderTarget===!0?Z.texture.encoding:Ww,map:!!T.map,matcap:!!T.matcap,envMap:!!$,envMapMode:$&&$.mapping,envMapCubeUVHeight:j,lightMap:!!T.lightMap,aoMap:!!T.aoMap,emissiveMap:!!T.emissiveMap,bumpMap:!!T.bumpMap,normalMap:!!T.normalMap,objectSpaceNormalMap:T.normalMapType===Oer,tangentSpaceNormalMap:T.normalMapType===Cer,decodeVideoTexture:!!T.map&&T.map.isVideoTexture===!0&&T.map.encoding===Lo,clearcoat:ne,clearcoatMap:ne&&!!T.clearcoatMap,clearcoatRoughnessMap:ne&&!!T.clearcoatRoughnessMap,clearcoatNormalMap:ne&&!!T.clearcoatNormalMap,iridescence:ie,iridescenceMap:ie&&!!T.iridescenceMap,iridescenceThicknessMap:ie&&!!T.iridescenceThicknessMap,displacementMap:!!T.displacementMap,roughnessMap:!!T.roughnessMap,metalnessMap:!!T.metalnessMap,specularMap:!!T.specularMap,specularIntensityMap:!!T.specularIntensityMap,specularColorMap:!!T.specularColorMap,opaque:T.transparent===!1&&T.blending===kO,alphaMap:!!T.alphaMap,alphaTest:ge,gradientMap:!!T.gradientMap,sheen:T.sheen>0,sheenColorMap:!!T.sheenColorMap,sheenRoughnessMap:!!T.sheenRoughnessMap,transmission:T.transmission>0,transmissionMap:!!T.transmissionMap,thicknessMap:!!T.thicknessMap,combine:T.combine,vertexTangents:!!T.normalMap&&!!A.attributes.tangent,vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!A.attributes.color&&A.attributes.color.itemSize===4,vertexUvs:!!T.map||!!T.bumpMap||!!T.normalMap||!!T.specularMap||!!T.alphaMap||!!T.emissiveMap||!!T.roughnessMap||!!T.metalnessMap||!!T.clearcoatMap||!!T.clearcoatRoughnessMap||!!T.clearcoatNormalMap||!!T.iridescenceMap||!!T.iridescenceThicknessMap||!!T.displacementMap||!!T.transmissionMap||!!T.thicknessMap||!!T.specularIntensityMap||!!T.specularColorMap||!!T.sheenColorMap||!!T.sheenRoughnessMap,uvsVertexOnly:!(T.map||T.bumpMap||T.normalMap||T.specularMap||T.alphaMap||T.emissiveMap||T.roughnessMap||T.metalnessMap||T.clearcoatNormalMap||T.iridescenceMap||T.iridescenceThicknessMap||T.transmission>0||T.transmissionMap||T.thicknessMap||T.specularIntensityMap||T.specularColorMap||T.sheen>0||T.sheenColorMap||T.sheenRoughnessMap)&&!!T.displacementMap,fog:!!F,useFog:T.fog===!0,fogExp2:F&&F.isFogExp2,flatShading:!!T.flatShading,sizeAttenuation:T.sizeAttenuation,logarithmicDepthBuffer:f,skinning:R.isSkinnedMesh===!0,morphTargets:A.morphAttributes.position!==void 0,morphNormals:A.morphAttributes.normal!==void 0,morphColors:A.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:N,numDirLights:k.directional.length,numPointLights:k.point.length,numSpotLights:k.spot.length,numSpotLightMaps:k.spotLightMap.length,numRectAreaLights:k.rectArea.length,numHemiLights:k.hemi.length,numDirLightShadows:k.directionalShadowMap.length,numPointLightShadows:k.pointShadowMap.length,numSpotLightShadows:k.spotShadowMap.length,numSpotLightShadowsWithMaps:k.numSpotLightShadowsWithMaps,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:T.dithering,shadowMapEnabled:e.shadowMap.enabled&&P.length>0,shadowMapType:e.shadowMap.type,toneMapping:T.toneMapped?e.toneMapping:nv,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===Nm,flipSided:T.side===Fu,useDepthPacking:!!T.depthPacking,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:T.extensions&&T.extensions.derivatives,extensionFragDepth:T.extensions&&T.extensions.fragDepth,extensionDrawBuffers:T.extensions&&T.extensions.drawBuffers,extensionShaderTextureLOD:T.extensions&&T.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:T.customProgramCacheKey()}}function m(T){const k=[];if(T.shaderID?k.push(T.shaderID):(k.push(T.customVertexShaderID),k.push(T.customFragmentShaderID)),T.defines!==void 0)for(const P in T.defines)k.push(P),k.push(T.defines[P]);return T.isRawShaderMaterial===!1&&(v(k,T),y(k,T),k.push(e.outputEncoding)),k.push(T.customProgramCacheKey),k.join()}function v(T,k){T.push(k.precision),T.push(k.outputEncoding),T.push(k.envMapMode),T.push(k.envMapCubeUVHeight),T.push(k.combine),T.push(k.vertexUvs),T.push(k.fogExp2),T.push(k.sizeAttenuation),T.push(k.morphTargetsCount),T.push(k.morphAttributeCount),T.push(k.numDirLights),T.push(k.numPointLights),T.push(k.numSpotLights),T.push(k.numSpotLightMaps),T.push(k.numHemiLights),T.push(k.numRectAreaLights),T.push(k.numDirLightShadows),T.push(k.numPointLightShadows),T.push(k.numSpotLightShadows),T.push(k.numSpotLightShadowsWithMaps),T.push(k.shadowMapType),T.push(k.toneMapping),T.push(k.numClippingPlanes),T.push(k.numClipIntersection),T.push(k.depthPacking)}function y(T,k){a.disableAll(),k.isWebGL2&&a.enable(0),k.supportsVertexTextures&&a.enable(1),k.instancing&&a.enable(2),k.instancingColor&&a.enable(3),k.map&&a.enable(4),k.matcap&&a.enable(5),k.envMap&&a.enable(6),k.lightMap&&a.enable(7),k.aoMap&&a.enable(8),k.emissiveMap&&a.enable(9),k.bumpMap&&a.enable(10),k.normalMap&&a.enable(11),k.objectSpaceNormalMap&&a.enable(12),k.tangentSpaceNormalMap&&a.enable(13),k.clearcoat&&a.enable(14),k.clearcoatMap&&a.enable(15),k.clearcoatRoughnessMap&&a.enable(16),k.clearcoatNormalMap&&a.enable(17),k.iridescence&&a.enable(18),k.iridescenceMap&&a.enable(19),k.iridescenceThicknessMap&&a.enable(20),k.displacementMap&&a.enable(21),k.specularMap&&a.enable(22),k.roughnessMap&&a.enable(23),k.metalnessMap&&a.enable(24),k.gradientMap&&a.enable(25),k.alphaMap&&a.enable(26),k.alphaTest&&a.enable(27),k.vertexColors&&a.enable(28),k.vertexAlphas&&a.enable(29),k.vertexUvs&&a.enable(30),k.vertexTangents&&a.enable(31),k.uvsVertexOnly&&a.enable(32),T.push(a.mask),a.disableAll(),k.fog&&a.enable(0),k.useFog&&a.enable(1),k.flatShading&&a.enable(2),k.logarithmicDepthBuffer&&a.enable(3),k.skinning&&a.enable(4),k.morphTargets&&a.enable(5),k.morphNormals&&a.enable(6),k.morphColors&&a.enable(7),k.premultipliedAlpha&&a.enable(8),k.shadowMapEnabled&&a.enable(9),k.physicallyCorrectLights&&a.enable(10),k.doubleSided&&a.enable(11),k.flipSided&&a.enable(12),k.useDepthPacking&&a.enable(13),k.dithering&&a.enable(14),k.specularIntensityMap&&a.enable(15),k.specularColorMap&&a.enable(16),k.transmission&&a.enable(17),k.transmissionMap&&a.enable(18),k.thicknessMap&&a.enable(19),k.sheen&&a.enable(20),k.sheenColorMap&&a.enable(21),k.sheenRoughnessMap&&a.enable(22),k.decodeVideoTexture&&a.enable(23),k.opaque&&a.enable(24),T.push(a.mask)}function b(T){const k=p[T.type];let P;if(k){const I=cp[k];P=Wat.clone(I.uniforms)}else P=T.uniforms;return P}function w(T,k){let P;for(let I=0,R=c.length;I0?r.push(v):h.transparent===!0?i.push(v):n.push(v)}function l(f,d,h,p,g,m){const v=s(f,d,h,p,g,m);h.transmission>0?r.unshift(v):h.transparent===!0?i.unshift(v):n.unshift(v)}function c(f,d){n.length>1&&n.sort(f||Jir),r.length>1&&r.sort(d||ENe),i.length>1&&i.sort(d||ENe)}function u(){for(let f=t,d=e.length;f=o.length?(s=new TNe,o.push(s)):s=o[i],s}function n(){e=new WeakMap}return{get:t,dispose:n}}function tor(){const e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Ne,color:new yo};break;case"SpotLight":n={position:new Ne,direction:new Ne,color:new yo,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ne,color:new yo,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ne,skyColor:new yo,groundColor:new yo};break;case"RectAreaLight":n={color:new yo,position:new Ne,halfWidth:new Ne,halfHeight:new Ne};break}return e[t.id]=n,n}}}function nor(){const e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _r};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _r};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _r,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}let ror=0;function ior(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function oor(e,t){const n=new tor,r=nor(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let u=0;u<9;u++)i.probe.push(new Ne);const o=new Ne,s=new Ji,a=new Ji;function l(u,f){let d=0,h=0,p=0;for(let I=0;I<9;I++)i.probe[I].set(0,0,0);let g=0,m=0,v=0,y=0,b=0,w=0,S=0,_=0,E=0,T=0;u.sort(ior);const k=f!==!0?Math.PI:1;for(let I=0,R=u.length;I0&&(t.isWebGL2||e.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=zt.LTC_FLOAT_1,i.rectAreaLTC2=zt.LTC_FLOAT_2):e.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=zt.LTC_HALF_1,i.rectAreaLTC2=zt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const P=i.hash;(P.directionalLength!==g||P.pointLength!==m||P.spotLength!==v||P.rectAreaLength!==y||P.hemiLength!==b||P.numDirectionalShadows!==w||P.numPointShadows!==S||P.numSpotShadows!==_||P.numSpotMaps!==E)&&(i.directional.length=g,i.spot.length=v,i.rectArea.length=y,i.point.length=m,i.hemi.length=b,i.directionalShadow.length=w,i.directionalShadowMap.length=w,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=_,i.spotShadowMap.length=_,i.directionalShadowMatrix.length=w,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=_+E-T,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=T,P.directionalLength=g,P.pointLength=m,P.spotLength=v,P.rectAreaLength=y,P.hemiLength=b,P.numDirectionalShadows=w,P.numPointShadows=S,P.numSpotShadows=_,P.numSpotMaps=E,i.version=ror++)}function c(u,f){let d=0,h=0,p=0,g=0,m=0;const v=f.matrixWorldInverse;for(let y=0,b=u.length;y=a.length?(l=new PNe(e,t),a.push(l)):l=a[s],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class aor extends XL{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ser,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class lor extends XL{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Ne,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const cor=`void main() { gl_Position = vec4( position, 1.0 ); -}`,ulr=`uniform sampler2D shadow_pass; +}`,uor=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3691,7 +3725,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function flr(e,t,n){let r=new cut;const i=new Sr,o=new Sr,s=new La,a=new alr({depthPacking:wrr}),l=new llr,c={},u=n.maxTextureSize,f={0:Fu,1:pT,2:Um},d=new yb({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Sr},radius:{value:4}},vertexShader:clr,fragmentShader:ulr}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new Wv;p.setAttribute("position",new Wf(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Lp(p,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Vct,this.render=function(w,S,_){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||w.length===0)return;const E=e.getRenderTarget(),T=e.getActiveCubeFace(),k=e.getActiveMipmapLevel(),P=e.state;P.setBlending(V0),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);for(let R=0,I=w.length;Ru||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/L.x),i.x=o.x*L.x,A.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/L.y),i.y=o.y*L.y,A.mapSize.y=o.y)),A.map===null){const j=this.type!==NM?{minFilter:_c,magFilter:_c}:{};A.map=new Jw(i.x,i.y,j),A.map.texture.name=F.name+".shadowMap",A.camera.updateProjectionMatrix()}e.setRenderTarget(A.map),e.clear();const $=A.getViewportCount();for(let j=0;j<$;j++){const V=A.getViewport(j);s.set(o.x*V.x,o.y*V.y,o.x*V.z,o.y*V.w),P.viewport(s),A.updateMatrices(F,j),r=A.getFrustum(),b(S,_,A.camera,F,this.type)}A.isPointLightShadow!==!0&&this.type===NM&&v(A,_),A.needsUpdate=!1}m.needsUpdate=!1,e.setRenderTarget(E,T,k)};function v(w,S){const _=t.update(g);d.defines.VSM_SAMPLES!==w.blurSamples&&(d.defines.VSM_SAMPLES=w.blurSamples,h.defines.VSM_SAMPLES=w.blurSamples,d.needsUpdate=!0,h.needsUpdate=!0),w.mapPass===null&&(w.mapPass=new Jw(i.x,i.y)),d.uniforms.shadow_pass.value=w.map.texture,d.uniforms.resolution.value=w.mapSize,d.uniforms.radius.value=w.radius,e.setRenderTarget(w.mapPass),e.clear(),e.renderBufferDirect(S,null,_,d,g,null),h.uniforms.shadow_pass.value=w.mapPass.texture,h.uniforms.resolution.value=w.mapSize,h.uniforms.radius.value=w.radius,e.setRenderTarget(w.map),e.clear(),e.renderBufferDirect(S,null,_,h,g,null)}function y(w,S,_,E,T,k){let P=null;const R=_.isPointLight===!0?w.customDistanceMaterial:w.customDepthMaterial;if(R!==void 0?P=R:P=_.isPointLight===!0?l:a,e.localClippingEnabled&&S.clipShadows===!0&&Array.isArray(S.clippingPlanes)&&S.clippingPlanes.length!==0||S.displacementMap&&S.displacementScale!==0||S.alphaMap&&S.alphaTest>0){const I=P.uuid,F=S.uuid;let A=c[I];A===void 0&&(A={},c[I]=A);let L=A[F];L===void 0&&(L=P.clone(),A[F]=L),P=L}return P.visible=S.visible,P.wireframe=S.wireframe,k===NM?P.side=S.shadowSide!==null?S.shadowSide:S.side:P.side=S.shadowSide!==null?S.shadowSide:f[S.side],P.alphaMap=S.alphaMap,P.alphaTest=S.alphaTest,P.clipShadows=S.clipShadows,P.clippingPlanes=S.clippingPlanes,P.clipIntersection=S.clipIntersection,P.displacementMap=S.displacementMap,P.displacementScale=S.displacementScale,P.displacementBias=S.displacementBias,P.wireframeLinewidth=S.wireframeLinewidth,P.linewidth=S.linewidth,_.isPointLight===!0&&P.isMeshDistanceMaterial===!0&&(P.referencePosition.setFromMatrixPosition(_.matrixWorld),P.nearDistance=E,P.farDistance=T),P}function b(w,S,_,E,T){if(w.visible===!1)return;if(w.layers.test(S.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&T===NM)&&(!w.frustumCulled||r.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,w.matrixWorld);const R=t.update(w),I=w.material;if(Array.isArray(I)){const F=R.groups;for(let A=0,L=F.length;A=1):V.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),$=j>=2);let U=null,z={};const N=e.getParameter(3088),B=e.getParameter(2978),H=new La().fromArray(N),Q=new La().fromArray(B);function Y(Me,st,Fe){const ht=new Uint8Array(4),gt=e.createTexture();e.bindTexture(Me,gt),e.texParameteri(Me,10241,9728),e.texParameteri(Me,10240,9728);for(let St=0;Stye||ee.height>ye)&&(be=ye/Math.max(ee.width,ee.height)),be<1||oe===!0)if(typeof HTMLImageElement<"u"&&ee instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ee instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ee instanceof ImageBitmap){const ge=oe?wae:Math.floor,xe=ge(be*ee.width),re=ge(be*ee.height);g===void 0&&(g=y(xe,re));const Ee=Se?y(xe,re):g;return Ee.width=xe,Ee.height=re,Ee.getContext("2d").drawImage(ee,0,0,xe,re),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ee.width+"x"+ee.height+") to ("+xe+"x"+re+")."),Ee}else return"data"in ee&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ee.width+"x"+ee.height+")."),ee;return ee}function w(ee){return Z3e(ee.width)&&Z3e(ee.height)}function S(ee){return a?!1:ee.wrapS!==wf||ee.wrapT!==wf||ee.minFilter!==_c&&ee.minFilter!==Cc}function _(ee,oe){return ee.generateMipmaps&&oe&&ee.minFilter!==_c&&ee.minFilter!==Cc}function E(ee){e.generateMipmap(ee)}function T(ee,oe,Se,ye,be=!1){if(a===!1)return oe;if(ee!==null){if(e[ee]!==void 0)return e[ee];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ee+"'")}let ge=oe;return oe===6403&&(Se===5126&&(ge=33326),Se===5131&&(ge=33325),Se===5121&&(ge=33321)),oe===33319&&(Se===5126&&(ge=33328),Se===5131&&(ge=33327),Se===5121&&(ge=33323)),oe===6408&&(Se===5126&&(ge=34836),Se===5131&&(ge=34842),Se===5121&&(ge=ye===Lo&&be===!1?35907:32856),Se===32819&&(ge=32854),Se===32820&&(ge=32855)),(ge===33325||ge===33326||ge===33327||ge===33328||ge===34842||ge===34836)&&t.get("EXT_color_buffer_float"),ge}function k(ee,oe,Se){return _(ee,Se)===!0||ee.isFramebufferTexture&&ee.minFilter!==_c&&ee.minFilter!==Cc?Math.log2(Math.max(oe.width,oe.height))+1:ee.mipmaps!==void 0&&ee.mipmaps.length>0?ee.mipmaps.length:ee.isCompressedTexture&&Array.isArray(ee.image)?oe.mipmaps.length:1}function P(ee){return ee===_c||ee===E3e||ee===T3e?9728:9729}function R(ee){const oe=ee.target;oe.removeEventListener("dispose",R),F(oe),oe.isVideoTexture&&p.delete(oe)}function I(ee){const oe=ee.target;oe.removeEventListener("dispose",I),L(oe)}function F(ee){const oe=r.get(ee);if(oe.__webglInit===void 0)return;const Se=ee.source,ye=m.get(Se);if(ye){const be=ye[oe.__cacheKey];be.usedTimes--,be.usedTimes===0&&A(ee),Object.keys(ye).length===0&&m.delete(Se)}r.remove(ee)}function A(ee){const oe=r.get(ee);e.deleteTexture(oe.__webglTexture);const Se=ee.source,ye=m.get(Se);delete ye[oe.__cacheKey],s.memory.textures--}function L(ee){const oe=ee.texture,Se=r.get(ee),ye=r.get(oe);if(ye.__webglTexture!==void 0&&(e.deleteTexture(ye.__webglTexture),s.memory.textures--),ee.depthTexture&&ee.depthTexture.dispose(),ee.isWebGLCubeRenderTarget)for(let be=0;be<6;be++)e.deleteFramebuffer(Se.__webglFramebuffer[be]),Se.__webglDepthbuffer&&e.deleteRenderbuffer(Se.__webglDepthbuffer[be]);else{if(e.deleteFramebuffer(Se.__webglFramebuffer),Se.__webglDepthbuffer&&e.deleteRenderbuffer(Se.__webglDepthbuffer),Se.__webglMultisampledFramebuffer&&e.deleteFramebuffer(Se.__webglMultisampledFramebuffer),Se.__webglColorRenderbuffer)for(let be=0;be=l&&console.warn("THREE.WebGLTextures: Trying to use "+ee+" texture units while this GPU supports only "+l),$+=1,ee}function U(ee){const oe=[];return oe.push(ee.wrapS),oe.push(ee.wrapT),oe.push(ee.magFilter),oe.push(ee.minFilter),oe.push(ee.anisotropy),oe.push(ee.internalFormat),oe.push(ee.format),oe.push(ee.type),oe.push(ee.generateMipmaps),oe.push(ee.premultiplyAlpha),oe.push(ee.flipY),oe.push(ee.unpackAlignment),oe.push(ee.encoding),oe.join()}function z(ee,oe){const Se=r.get(ee);if(ee.isVideoTexture&&we(ee),ee.isRenderTargetTexture===!1&&ee.version>0&&Se.__version!==ee.version){const ye=ee.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ie(Se,ee,oe);return}}n.activeTexture(33984+oe),n.bindTexture(3553,Se.__webglTexture)}function N(ee,oe){const Se=r.get(ee);if(ee.version>0&&Se.__version!==ee.version){ie(Se,ee,oe);return}n.activeTexture(33984+oe),n.bindTexture(35866,Se.__webglTexture)}function B(ee,oe){const Se=r.get(ee);if(ee.version>0&&Se.__version!==ee.version){ie(Se,ee,oe);return}n.activeTexture(33984+oe),n.bindTexture(32879,Se.__webglTexture)}function H(ee,oe){const Se=r.get(ee);if(ee.version>0&&Se.__version!==ee.version){ne(Se,ee,oe);return}n.activeTexture(33984+oe),n.bindTexture(34067,Se.__webglTexture)}const Q={[yae]:10497,[wf]:33071,[bae]:33648},Y={[_c]:9728,[E3e]:9984,[T3e]:9986,[Cc]:9729,[orr]:9985,[sH]:9987};function Z(ee,oe,Se){if(Se?(e.texParameteri(ee,10242,Q[oe.wrapS]),e.texParameteri(ee,10243,Q[oe.wrapT]),(ee===32879||ee===35866)&&e.texParameteri(ee,32882,Q[oe.wrapR]),e.texParameteri(ee,10240,Y[oe.magFilter]),e.texParameteri(ee,10241,Y[oe.minFilter])):(e.texParameteri(ee,10242,33071),e.texParameteri(ee,10243,33071),(ee===32879||ee===35866)&&e.texParameteri(ee,32882,33071),(oe.wrapS!==wf||oe.wrapT!==wf)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(ee,10240,P(oe.magFilter)),e.texParameteri(ee,10241,P(oe.minFilter)),oe.minFilter!==_c&&oe.minFilter!==Cc&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),t.has("EXT_texture_filter_anisotropic")===!0){const ye=t.get("EXT_texture_filter_anisotropic");if(oe.type===E0&&t.has("OES_texture_float_linear")===!1||a===!1&&oe.type===jI&&t.has("OES_texture_half_float_linear")===!1)return;(oe.anisotropy>1||r.get(oe).__currentAnisotropy)&&(e.texParameterf(ee,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(oe.anisotropy,i.getMaxAnisotropy())),r.get(oe).__currentAnisotropy=oe.anisotropy)}}function pe(ee,oe){let Se=!1;ee.__webglInit===void 0&&(ee.__webglInit=!0,oe.addEventListener("dispose",R));const ye=oe.source;let be=m.get(ye);be===void 0&&(be={},m.set(ye,be));const ge=U(oe);if(ge!==ee.__cacheKey){be[ge]===void 0&&(be[ge]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,Se=!0),be[ge].usedTimes++;const xe=be[ee.__cacheKey];xe!==void 0&&(be[ee.__cacheKey].usedTimes--,xe.usedTimes===0&&A(oe)),ee.__cacheKey=ge,ee.__webglTexture=be[ge].texture}return Se}function ie(ee,oe,Se){let ye=3553;oe.isDataArrayTexture&&(ye=35866),oe.isData3DTexture&&(ye=32879);const be=pe(ee,oe),ge=oe.source;if(n.activeTexture(33984+Se),n.bindTexture(ye,ee.__webglTexture),ge.version!==ge.__currentVersion||be===!0){e.pixelStorei(37440,oe.flipY),e.pixelStorei(37441,oe.premultiplyAlpha),e.pixelStorei(3317,oe.unpackAlignment),e.pixelStorei(37443,0);const xe=S(oe)&&w(oe.image)===!1;let re=b(oe.image,xe,!1,u);re=Pe(oe,re);const Ee=w(re)||a,ke=o.convert(oe.format,oe.encoding);let je=o.convert(oe.type),De=T(oe.internalFormat,ke,je,oe.encoding,oe.isVideoTexture);Z(ye,oe,Ee);let ze;const Je=oe.mipmaps,mt=a&&oe.isVideoTexture!==!0,Me=ge.__currentVersion===void 0||be===!0,st=k(oe,re,Ee);if(oe.isDepthTexture)De=6402,a?oe.type===E0?De=36012:oe.type===O1?De=33190:oe.type===NO?De=35056:De=33189:oe.type===E0&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),oe.format===J1&&De===6402&&oe.type!==Xct&&oe.type!==O1&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),oe.type=O1,je=o.convert(oe.type)),oe.format===vT&&De===6402&&(De=34041,oe.type!==NO&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),oe.type=NO,je=o.convert(oe.type))),Me&&(mt?n.texStorage2D(3553,1,De,re.width,re.height):n.texImage2D(3553,0,De,re.width,re.height,0,ke,je,null));else if(oe.isDataTexture)if(Je.length>0&&Ee){mt&&Me&&n.texStorage2D(3553,st,De,Je[0].width,Je[0].height);for(let Fe=0,ht=Je.length;Fe>=1,ht>>=1}}else if(Je.length>0&&Ee){mt&&Me&&n.texStorage2D(3553,st,De,Je[0].width,Je[0].height);for(let Fe=0,ht=Je.length;Fe0&&Me++,n.texStorage2D(34067,Me,ze,re[0].width,re[0].height));for(let Fe=0;Fe<6;Fe++)if(xe){Je?n.texSubImage2D(34069+Fe,0,0,0,re[Fe].width,re[Fe].height,je,De,re[Fe].data):n.texImage2D(34069+Fe,0,ze,re[Fe].width,re[Fe].height,0,je,De,re[Fe].data);for(let ht=0;ht0&&ae(ee)===!1){const re=ge?oe:[oe];Se.__webglMultisampledFramebuffer=e.createFramebuffer(),Se.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,Se.__webglMultisampledFramebuffer);for(let Ee=0;Ee0&&ae(ee)===!1){const oe=ee.isWebGLMultipleRenderTargets?ee.texture:[ee.texture],Se=ee.width,ye=ee.height;let be=16384;const ge=[],xe=ee.stencilBuffer?33306:36096,re=r.get(ee),Ee=ee.isWebGLMultipleRenderTargets===!0;if(Ee)for(let ke=0;ke0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&oe.__useRenderToTexture!==!1}function we(ee){const oe=s.render.frame;p.get(ee)!==oe&&(p.set(ee,oe),ee.update())}function Pe(ee,oe){const Se=ee.encoding,ye=ee.format,be=ee.type;return ee.isCompressedTexture===!0||ee.isVideoTexture===!0||ee.format===xae||Se!==Zw&&(Se===Lo?a===!1?t.has("EXT_sRGB")===!0&&ye===Dp?(ee.format=xae,ee.minFilter=Cc,ee.generateMipmaps=!1):oe=Zct.sRGBToLinear(oe):(ye!==Dp||be!==Kw)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",Se)),oe}this.allocateTextureUnit=V,this.resetTextureUnits=j,this.setTexture2D=z,this.setTexture2DArray=N,this.setTexture3D=B,this.setTextureCube=H,this.rebindTextures=G,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=he,this.updateMultisampleRenderTarget=J,this.setupDepthRenderbuffer=ue,this.setupFrameBufferTexture=fe,this.useMultisampledRTT=ae}function plr(e,t,n){const r=n.isWebGL2;function i(o,s=null){let a;if(o===Kw)return 5121;if(o===crr)return 32819;if(o===urr)return 32820;if(o===srr)return 5120;if(o===arr)return 5122;if(o===Xct)return 5123;if(o===lrr)return 5124;if(o===O1)return 5125;if(o===E0)return 5126;if(o===jI)return r?5131:(a=t.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===frr)return 6406;if(o===Dp)return 6408;if(o===hrr)return 6409;if(o===prr)return 6410;if(o===J1)return 6402;if(o===vT)return 34041;if(o===Yct)return 6403;if(o===drr)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===xae)return a=t.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===grr)return 36244;if(o===mrr)return 33319;if(o===vrr)return 33320;if(o===yrr)return 36249;if(o===JJ||o===eee||o===tee||o===nee)if(s===Lo)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===JJ)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===eee)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===tee)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===nee)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===JJ)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===eee)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===tee)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===nee)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===P3e||o===k3e||o===M3e||o===A3e)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===P3e)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===k3e)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===M3e)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===A3e)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===brr)return a=t.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===R3e||o===I3e)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(o===R3e)return s===Lo?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===I3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===D3e||o===L3e||o===F3e||o===$3e||o===N3e||o===z3e||o===j3e||o===B3e||o===U3e||o===V3e||o===W3e||o===H3e||o===G3e||o===q3e)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(o===D3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===L3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===F3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===$3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===N3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===z3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===j3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===B3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===U3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===V3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===W3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===H3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===G3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===q3e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===X3e)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(o===X3e)return s===Lo?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===NO?r?34042:(a=t.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):e[o]!==void 0?e[o]:null}return{convert:i}}class glr extends Xd{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class fz extends Lc{constructor(){super(),this.isGroup=!0,this.type="Group"}}const mlr={type:"move"};class Mee{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new fz,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new fz,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ne,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ne),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new fz,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ne,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ne),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,n,r){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(t&&n.session.visibilityState!=="visible-blurred"){if(c&&t.hand){s=!0;for(const g of t.hand.values()){const m=n.getJointPose(g,r);if(c.joints[g.jointName]===void 0){const y=new fz;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[g.jointName]=y,c.add(y)}const v=c.joints[g.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(o=n.getPose(t.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(t.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(mlr)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this}}class vlr extends Wu{constructor(t,n,r,i,o,s,a,l,c,u){if(u=u!==void 0?u:J1,u!==J1&&u!==vT)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===J1&&(r=O1),r===void 0&&u===vT&&(r=NO),super(null,i,o,s,a,l,u,r,c),this.isDepthTexture=!0,this.image={width:t,height:n},this.magFilter=a!==void 0?a:_c,this.minFilter=l!==void 0?l:_c,this.flipY=!1,this.generateMipmaps=!1}}class ylr extends GS{constructor(t,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let g=null,m=null;const v=[],y=[],b=new Xd;b.layers.enable(1),b.viewport=new La;const w=new Xd;w.layers.enable(2),w.viewport=new La;const S=[b,w],_=new glr;_.layers.enable(1),_.layers.enable(2);let E=null,T=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(U){let z=v[U];return z===void 0&&(z=new Mee,v[U]=z),z.getTargetRaySpace()},this.getControllerGrip=function(U){let z=v[U];return z===void 0&&(z=new Mee,v[U]=z),z.getGripSpace()},this.getHand=function(U){let z=v[U];return z===void 0&&(z=new Mee,v[U]=z),z.getHandSpace()};function k(U){const z=y.indexOf(U.inputSource);if(z===-1)return;const N=v[z];N!==void 0&&N.dispatchEvent({type:U.type,data:U.inputSource})}function P(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",P),i.removeEventListener("inputsourceschange",R);for(let U=0;U=0&&(y[B]=null,v[B].dispatchEvent({type:"disconnected",data:N}))}for(let z=0;z=y.length){y.push(N),B=Q;break}else if(y[Q]===null){y[Q]=N,B=Q;break}if(B===-1)break}const H=v[B];H&&H.dispatchEvent({type:"connected",data:N})}}const I=new Ne,F=new Ne;function A(U,z,N){I.setFromMatrixPosition(z.matrixWorld),F.setFromMatrixPosition(N.matrixWorld);const B=I.distanceTo(F),H=z.projectionMatrix.elements,Q=N.projectionMatrix.elements,Y=H[14]/(H[10]-1),Z=H[14]/(H[10]+1),pe=(H[9]+1)/H[5],ie=(H[9]-1)/H[5],ne=(H[8]-1)/H[0],fe=(Q[8]+1)/Q[0],me=Y*ne,se=Y*fe,ue=B/(-ne+fe),G=ue*-ne;z.matrixWorld.decompose(U.position,U.quaternion,U.scale),U.translateX(G),U.translateZ(ue),U.matrixWorld.compose(U.position,U.quaternion,U.scale),U.matrixWorldInverse.copy(U.matrixWorld).invert();const ce=Y+ue,he=Z+ue,J=me-G,te=se+(B-G),ae=pe*Z/he*ce,we=ie*Z/he*ce;U.projectionMatrix.makePerspective(J,te,ae,we,ce,he)}function L(U,z){z===null?U.matrixWorld.copy(U.matrix):U.matrixWorld.multiplyMatrices(z.matrixWorld,U.matrix),U.matrixWorldInverse.copy(U.matrixWorld).invert()}this.updateCamera=function(U){if(i===null)return;_.near=w.near=b.near=U.near,_.far=w.far=b.far=U.far,(E!==_.near||T!==_.far)&&(i.updateRenderState({depthNear:_.near,depthFar:_.far}),E=_.near,T=_.far);const z=U.parent,N=_.cameras;L(_,z);for(let H=0;H0&&(g.alphaTest.value=m.alphaTest);const v=t.get(m).envMap;if(v&&(g.envMap.value=v,g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap){g.lightMap.value=m.lightMap;const w=e.physicallyCorrectLights!==!0?Math.PI:1;g.lightMapIntensity.value=m.lightMapIntensity*w}m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity);let y;m.map?y=m.map:m.specularMap?y=m.specularMap:m.displacementMap?y=m.displacementMap:m.normalMap?y=m.normalMap:m.bumpMap?y=m.bumpMap:m.roughnessMap?y=m.roughnessMap:m.metalnessMap?y=m.metalnessMap:m.alphaMap?y=m.alphaMap:m.emissiveMap?y=m.emissiveMap:m.clearcoatMap?y=m.clearcoatMap:m.clearcoatNormalMap?y=m.clearcoatNormalMap:m.clearcoatRoughnessMap?y=m.clearcoatRoughnessMap:m.iridescenceMap?y=m.iridescenceMap:m.iridescenceThicknessMap?y=m.iridescenceThicknessMap:m.specularIntensityMap?y=m.specularIntensityMap:m.specularColorMap?y=m.specularColorMap:m.transmissionMap?y=m.transmissionMap:m.thicknessMap?y=m.thicknessMap:m.sheenColorMap?y=m.sheenColorMap:m.sheenRoughnessMap&&(y=m.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),g.uvTransform.value.copy(y.matrix));let b;m.aoMap?b=m.aoMap:m.lightMap&&(b=m.lightMap),b!==void 0&&(b.isWebGLRenderTarget&&(b=b.texture),b.matrixAutoUpdate===!0&&b.updateMatrix(),g.uv2Transform.value.copy(b.matrix))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function a(g,m,v,y){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*v,g.scale.value=y*.5,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let b;m.map?b=m.map:m.alphaMap&&(b=m.alphaMap),b!==void 0&&(b.matrixAutoUpdate===!0&&b.updateMatrix(),g.uvTransform.value.copy(b.matrix))}function l(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let v;m.map?v=m.map:m.alphaMap&&(v=m.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),g.uvTransform.value.copy(v.matrix))}function c(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function u(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.roughness.value=m.roughness,g.metalness.value=m.metalness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap),t.get(m).envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,v){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),g.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===Fu&&g.clearcoatNormalScale.value.negate())),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap)),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap)}function h(g,m){m.matcap&&(g.matcap.value=m.matcap)}function p(g,m){g.referencePosition.value.copy(m.referencePosition),g.nearDistance.value=m.nearDistance,g.farDistance.value=m.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function xlr(e,t,n,r){let i={},o={},s=[];const a=n.isWebGL2?e.getParameter(35375):0;function l(y,b){const w=b.program;r.uniformBlockBinding(y,w)}function c(y,b){let w=i[y.id];w===void 0&&(p(y),w=u(y),i[y.id]=w,y.addEventListener("dispose",m));const S=b.program;r.updateUBOMapping(y,S);const _=t.render.frame;o[y.id]!==_&&(d(y),o[y.id]=_)}function u(y){const b=f();y.__bindingPointIndex=b;const w=e.createBuffer(),S=y.__size,_=y.usage;return e.bindBuffer(35345,w),e.bufferData(35345,S,_),e.bindBuffer(35345,null),e.bindBufferBase(35345,b,w),w}function f(){for(let y=0;y0){_=w%S;const R=S-_;_!==0&&R-P.boundary<0&&(w+=S-_,k.__offset=w)}w+=P.storage}return _=w%S,_>0&&(w+=S-_),y.__size=w,y.__cache={},this}function g(y){const b=y.value,w={boundary:0,storage:0};return typeof b=="number"?(w.boundary=4,w.storage=4):b.isVector2?(w.boundary=8,w.storage=8):b.isVector3||b.isColor?(w.boundary=16,w.storage=12):b.isVector4?(w.boundary=16,w.storage=16):b.isMatrix3?(w.boundary=48,w.storage=48):b.isMatrix4?(w.boundary=64,w.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),w}function m(y){const b=y.target;b.removeEventListener("dispose",m);const w=s.indexOf(b.__bindingPointIndex);s.splice(w,1),e.deleteBuffer(i[b.id]),delete i[b.id],delete o[b.id]}function v(){for(const y in i)e.deleteBuffer(i[y]);s=[],i={},o={}}return{bind:l,update:c,dispose:v}}function wlr(){const e=BI("canvas");return e.style.display="block",e}function mut(e={}){this.isWebGLRenderer=!0;const t=e.canvas!==void 0?e.canvas:wlr(),n=e.context!==void 0?e.context:null,r=e.depth!==void 0?e.depth:!0,i=e.stencil!==void 0?e.stencil:!0,o=e.antialias!==void 0?e.antialias:!1,s=e.premultipliedAlpha!==void 0?e.premultipliedAlpha:!0,a=e.preserveDrawingBuffer!==void 0?e.preserveDrawingBuffer:!1,l=e.powerPreference!==void 0?e.powerPreference:"default",c=e.failIfMajorPerformanceCaveat!==void 0?e.failIfMajorPerformanceCaveat:!1;let u;n!==null?u=n.getContextAttributes().alpha:u=e.alpha!==void 0?e.alpha:!1;let f=null,d=null;const h=[],p=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Zw,this.physicallyCorrectLights=!1,this.toneMapping=sv,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const g=this;let m=!1,v=0,y=0,b=null,w=-1,S=null;const _=new La,E=new La;let T=null,k=t.width,P=t.height,R=1,I=null,F=null;const A=new La(0,0,k,P),L=new La(0,0,k,P);let $=!1;const j=new cut;let V=!1,U=!1,z=null;const N=new Zi,B=new Sr,H=new Ne,Q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Y(){return b===null?R:1}let Z=n;function pe(_e,Ue){for(let Qe=0;Qe<_e.length;Qe++){const $e=_e[Qe],Ke=t.getContext($e,Ue);if(Ke!==null)return Ke}return null}try{const _e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${iye}`),t.addEventListener("webglcontextlost",ze,!1),t.addEventListener("webglcontextrestored",Je,!1),t.addEventListener("webglcontextcreationerror",mt,!1),Z===null){const Ue=["webgl2","webgl","experimental-webgl"];if(g.isWebGL1Renderer===!0&&Ue.shift(),Z=pe(Ue,_e),Z===null)throw pe(Ue)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}Z.getShaderPrecisionFormat===void 0&&(Z.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(_e){throw console.error("THREE.WebGLRenderer: "+_e.message),_e}let ie,ne,fe,me,se,ue,G,ce,he,J,te,ae,we,Pe,ee,oe,Se,ye,be,ge,xe,re,Ee,ke;function je(){ie=new Asr(Z),ne=new Osr(Z,ie,e),ie.init(ne),re=new plr(Z,ie,ne),fe=new dlr(Z,ie,ne),me=new Dsr,se=new Zar,ue=new hlr(Z,ie,fe,se,ne,re,me),G=new Tsr(g),ce=new Msr(g),he=new Wrr(Z,ne),Ee=new _sr(Z,ie,he,ne),J=new Rsr(Z,he,me,Ee),te=new Nsr(Z,J,he,me),be=new $sr(Z,ne,ue),oe=new Esr(se),ae=new Kar(g,G,ce,ie,ne,Ee,oe),we=new blr(g,se),Pe=new elr,ee=new slr(ie,ne),ye=new Ssr(g,G,fe,te,u,s),Se=new flr(g,te,ne),ke=new xlr(Z,me,ne,fe),ge=new Csr(Z,ie,me,ne),xe=new Isr(Z,ie,me,ne),me.programs=ae.programs,g.capabilities=ne,g.extensions=ie,g.properties=se,g.renderLists=Pe,g.shadowMap=Se,g.state=fe,g.info=me}je();const De=new ylr(g,Z);this.xr=De,this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.forceContextLoss=function(){const _e=ie.get("WEBGL_lose_context");_e&&_e.loseContext()},this.forceContextRestore=function(){const _e=ie.get("WEBGL_lose_context");_e&&_e.restoreContext()},this.getPixelRatio=function(){return R},this.setPixelRatio=function(_e){_e!==void 0&&(R=_e,this.setSize(k,P,!1))},this.getSize=function(_e){return _e.set(k,P)},this.setSize=function(_e,Ue,Qe){if(De.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}k=_e,P=Ue,t.width=Math.floor(_e*R),t.height=Math.floor(Ue*R),Qe!==!1&&(t.style.width=_e+"px",t.style.height=Ue+"px"),this.setViewport(0,0,_e,Ue)},this.getDrawingBufferSize=function(_e){return _e.set(k*R,P*R).floor()},this.setDrawingBufferSize=function(_e,Ue,Qe){k=_e,P=Ue,R=Qe,t.width=Math.floor(_e*Qe),t.height=Math.floor(Ue*Qe),this.setViewport(0,0,_e,Ue)},this.getCurrentViewport=function(_e){return _e.copy(_)},this.getViewport=function(_e){return _e.copy(A)},this.setViewport=function(_e,Ue,Qe,$e){_e.isVector4?A.set(_e.x,_e.y,_e.z,_e.w):A.set(_e,Ue,Qe,$e),fe.viewport(_.copy(A).multiplyScalar(R).floor())},this.getScissor=function(_e){return _e.copy(L)},this.setScissor=function(_e,Ue,Qe,$e){_e.isVector4?L.set(_e.x,_e.y,_e.z,_e.w):L.set(_e,Ue,Qe,$e),fe.scissor(E.copy(L).multiplyScalar(R).floor())},this.getScissorTest=function(){return $},this.setScissorTest=function(_e){fe.setScissorTest($=_e)},this.setOpaqueSort=function(_e){I=_e},this.setTransparentSort=function(_e){F=_e},this.getClearColor=function(_e){return _e.copy(ye.getClearColor())},this.setClearColor=function(){ye.setClearColor.apply(ye,arguments)},this.getClearAlpha=function(){return ye.getClearAlpha()},this.setClearAlpha=function(){ye.setClearAlpha.apply(ye,arguments)},this.clear=function(_e=!0,Ue=!0,Qe=!0){let $e=0;_e&&($e|=16384),Ue&&($e|=256),Qe&&($e|=1024),Z.clear($e)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",ze,!1),t.removeEventListener("webglcontextrestored",Je,!1),t.removeEventListener("webglcontextcreationerror",mt,!1),Pe.dispose(),ee.dispose(),se.dispose(),G.dispose(),ce.dispose(),te.dispose(),Ee.dispose(),ke.dispose(),ae.dispose(),De.dispose(),De.removeEventListener("sessionstart",St),De.removeEventListener("sessionend",on),z&&(z.dispose(),z=null),Dn.stop()};function ze(_e){_e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function Je(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1;const _e=me.autoReset,Ue=Se.enabled,Qe=Se.autoUpdate,$e=Se.needsUpdate,Ke=Se.type;je(),me.autoReset=_e,Se.enabled=Ue,Se.autoUpdate=Qe,Se.needsUpdate=$e,Se.type=Ke}function mt(_e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",_e.statusMessage)}function Me(_e){const Ue=_e.target;Ue.removeEventListener("dispose",Me),st(Ue)}function st(_e){Fe(_e),se.remove(_e)}function Fe(_e){const Ue=se.get(_e).programs;Ue!==void 0&&(Ue.forEach(function(Qe){ae.releaseProgram(Qe)}),_e.isShaderMaterial&&ae.releaseShaderCache(_e))}this.renderBufferDirect=function(_e,Ue,Qe,$e,Ke,Lt){Ue===null&&(Ue=Q);const rn=Ke.isMesh&&Ke.matrixWorld.determinant()<0,Ge=Nn(_e,Ue,Qe,$e,Ke);fe.setMaterial($e,rn);let Be=Qe.index;const yt=Qe.attributes.position;if(Be===null){if(yt===void 0||yt.count===0)return}else if(Be.count===0)return;let Nt=1;$e.wireframe===!0&&(Be=J.getWireframeAttribute(Qe),Nt=2),Ee.setup(Ke,$e,Ge,Qe,Be);let Xt,Tn=ge;Be!==null&&(Xt=he.get(Be),Tn=xe,Tn.setIndex(Xt));const Jr=Be!==null?Be.count:yt.count,Wo=Qe.drawRange.start*Nt,qu=Qe.drawRange.count*Nt,Ir=Lt!==null?Lt.start*Nt:0,Tr=Lt!==null?Lt.count*Nt:1/0,Qc=Math.max(Wo,Ir),Hi=Math.min(Jr,Wo+qu,Ir+Tr)-1,Fn=Math.max(0,Hi-Qc+1);if(Fn!==0){if(Ke.isMesh)$e.wireframe===!0?(fe.setLineWidth($e.wireframeLinewidth*Y()),Tn.setMode(1)):Tn.setMode(4);else if(Ke.isLine){let Ho=$e.linewidth;Ho===void 0&&(Ho=1),fe.setLineWidth(Ho*Y()),Ke.isLineSegments?Tn.setMode(1):Ke.isLineLoop?Tn.setMode(2):Tn.setMode(3)}else Ke.isPoints?Tn.setMode(0):Ke.isSprite&&Tn.setMode(4);if(Ke.isInstancedMesh)Tn.renderInstances(Qc,Fn,Ke.count);else if(Qe.isInstancedBufferGeometry){const Ho=Math.min(Qe.instanceCount,Qe._maxInstanceCount);Tn.renderInstances(Qc,Fn,Ho)}else Tn.render(Qc,Fn)}},this.compile=function(_e,Ue){function Qe($e,Ke,Lt){$e.transparent===!0&&$e.side===Um?($e.side=Fu,$e.needsUpdate=!0,Ut($e,Ke,Lt),$e.side=pT,$e.needsUpdate=!0,Ut($e,Ke,Lt),$e.side=Um):Ut($e,Ke,Lt)}d=ee.get(_e),d.init(),p.push(d),_e.traverseVisible(function($e){$e.isLight&&$e.layers.test(Ue.layers)&&(d.pushLight($e),$e.castShadow&&d.pushShadow($e))}),d.setupLights(g.physicallyCorrectLights),_e.traverse(function($e){const Ke=$e.material;if(Ke)if(Array.isArray(Ke))for(let Lt=0;Lt0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function wi(_e,Ue,Qe,$e){if(_e.visible===!1)return;if(_e.layers.test(Ue.layers)){if(_e.isGroup)Qe=_e.renderOrder;else if(_e.isLOD)_e.autoUpdate===!0&&_e.update(Ue);else if(_e.isLight)d.pushLight(_e),_e.castShadow&&d.pushShadow(_e);else if(_e.isSprite){if(!_e.frustumCulled||j.intersectsSprite(_e)){$e&&H.setFromMatrixPosition(_e.matrixWorld).applyMatrix4(N);const rn=te.update(_e),Ge=_e.material;Ge.visible&&f.push(_e,rn,Ge,Qe,H.z,null)}}else if((_e.isMesh||_e.isLine||_e.isPoints)&&(_e.isSkinnedMesh&&_e.skeleton.frame!==me.render.frame&&(_e.skeleton.update(),_e.skeleton.frame=me.render.frame),!_e.frustumCulled||j.intersectsObject(_e))){$e&&H.setFromMatrixPosition(_e.matrixWorld).applyMatrix4(N);const rn=te.update(_e),Ge=_e.material;if(Array.isArray(Ge)){const Be=rn.groups;for(let yt=0,Nt=Be.length;yt0&&sn(Ke,Ue,Qe),$e&&fe.viewport(_.copy($e)),Ke.length>0&&br(Ke,Ue,Qe),Lt.length>0&&br(Lt,Ue,Qe),rn.length>0&&br(rn,Ue,Qe),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function sn(_e,Ue,Qe){const $e=ne.isWebGL2;z===null&&(z=new Jw(1,1,{generateMipmaps:!0,type:ie.has("EXT_color_buffer_half_float")?jI:Kw,minFilter:sH,samples:$e&&o===!0?4:0})),g.getDrawingBufferSize(B),$e?z.setSize(B.x,B.y):z.setSize(wae(B.x),wae(B.y));const Ke=g.getRenderTarget();g.setRenderTarget(z),g.clear();const Lt=g.toneMapping;g.toneMapping=sv,br(_e,Ue,Qe),g.toneMapping=Lt,ue.updateMultisampleRenderTarget(z),ue.updateRenderTargetMipmap(z),g.setRenderTarget(Ke)}function br(_e,Ue,Qe){const $e=Ue.isScene===!0?Ue.overrideMaterial:null;for(let Ke=0,Lt=_e.length;Ke0&&ue.useMultisampledRTT(_e)===!1?Ke=se.get(_e).__webglMultisampledFramebuffer:Ke=yt,_.copy(_e.viewport),E.copy(_e.scissor),T=_e.scissorTest}else _.copy(A).multiplyScalar(R).floor(),E.copy(L).multiplyScalar(R).floor(),T=$;if(fe.bindFramebuffer(36160,Ke)&&ne.drawBuffers&&$e&&fe.drawBuffers(_e,Ke),fe.viewport(_),fe.scissor(E),fe.setScissorTest(T),Lt){const Be=se.get(_e.texture);Z.framebufferTexture2D(36160,36064,34069+Ue,Be.__webglTexture,Qe)}else if(rn){const Be=se.get(_e.texture),yt=Ue||0;Z.framebufferTextureLayer(36160,36064,Be.__webglTexture,Qe||0,yt)}w=-1},this.readRenderTargetPixels=function(_e,Ue,Qe,$e,Ke,Lt,rn){if(!(_e&&_e.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ge=se.get(_e).__webglFramebuffer;if(_e.isWebGLCubeRenderTarget&&rn!==void 0&&(Ge=Ge[rn]),Ge){fe.bindFramebuffer(36160,Ge);try{const Be=_e.texture,yt=Be.format,Nt=Be.type;if(yt!==Dp&&re.convert(yt)!==Z.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Xt=Nt===jI&&(ie.has("EXT_color_buffer_half_float")||ne.isWebGL2&&ie.has("EXT_color_buffer_float"));if(Nt!==Kw&&re.convert(Nt)!==Z.getParameter(35738)&&!(Nt===E0&&(ne.isWebGL2||ie.has("OES_texture_float")||ie.has("WEBGL_color_buffer_float")))&&!Xt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Ue>=0&&Ue<=_e.width-$e&&Qe>=0&&Qe<=_e.height-Ke&&Z.readPixels(Ue,Qe,$e,Ke,re.convert(yt),re.convert(Nt),Lt)}finally{const Be=b!==null?se.get(b).__webglFramebuffer:null;fe.bindFramebuffer(36160,Be)}}},this.copyFramebufferToTexture=function(_e,Ue,Qe=0){const $e=Math.pow(2,-Qe),Ke=Math.floor(Ue.image.width*$e),Lt=Math.floor(Ue.image.height*$e);ue.setTexture2D(Ue,0),Z.copyTexSubImage2D(3553,Qe,0,0,_e.x,_e.y,Ke,Lt),fe.unbindTexture()},this.copyTextureToTexture=function(_e,Ue,Qe,$e=0){const Ke=Ue.image.width,Lt=Ue.image.height,rn=re.convert(Qe.format),Ge=re.convert(Qe.type);ue.setTexture2D(Qe,0),Z.pixelStorei(37440,Qe.flipY),Z.pixelStorei(37441,Qe.premultiplyAlpha),Z.pixelStorei(3317,Qe.unpackAlignment),Ue.isDataTexture?Z.texSubImage2D(3553,$e,_e.x,_e.y,Ke,Lt,rn,Ge,Ue.image.data):Ue.isCompressedTexture?Z.compressedTexSubImage2D(3553,$e,_e.x,_e.y,Ue.mipmaps[0].width,Ue.mipmaps[0].height,rn,Ue.mipmaps[0].data):Z.texSubImage2D(3553,$e,_e.x,_e.y,rn,Ge,Ue.image),$e===0&&Qe.generateMipmaps&&Z.generateMipmap(3553),fe.unbindTexture()},this.copyTextureToTexture3D=function(_e,Ue,Qe,$e,Ke=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Lt=_e.max.x-_e.min.x+1,rn=_e.max.y-_e.min.y+1,Ge=_e.max.z-_e.min.z+1,Be=re.convert($e.format),yt=re.convert($e.type);let Nt;if($e.isData3DTexture)ue.setTexture3D($e,0),Nt=32879;else if($e.isDataArrayTexture)ue.setTexture2DArray($e,0),Nt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Z.pixelStorei(37440,$e.flipY),Z.pixelStorei(37441,$e.premultiplyAlpha),Z.pixelStorei(3317,$e.unpackAlignment);const Xt=Z.getParameter(3314),Tn=Z.getParameter(32878),Jr=Z.getParameter(3316),Wo=Z.getParameter(3315),qu=Z.getParameter(32877),Ir=Qe.isCompressedTexture?Qe.mipmaps[0]:Qe.image;Z.pixelStorei(3314,Ir.width),Z.pixelStorei(32878,Ir.height),Z.pixelStorei(3316,_e.min.x),Z.pixelStorei(3315,_e.min.y),Z.pixelStorei(32877,_e.min.z),Qe.isDataTexture||Qe.isData3DTexture?Z.texSubImage3D(Nt,Ke,Ue.x,Ue.y,Ue.z,Lt,rn,Ge,Be,yt,Ir.data):Qe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Z.compressedTexSubImage3D(Nt,Ke,Ue.x,Ue.y,Ue.z,Lt,rn,Ge,Be,Ir.data)):Z.texSubImage3D(Nt,Ke,Ue.x,Ue.y,Ue.z,Lt,rn,Ge,Be,yt,Ir),Z.pixelStorei(3314,Xt),Z.pixelStorei(32878,Tn),Z.pixelStorei(3316,Jr),Z.pixelStorei(3315,Wo),Z.pixelStorei(32877,qu),Ke===0&&$e.generateMipmaps&&Z.generateMipmap(Nt),fe.unbindTexture()},this.initTexture=function(_e){_e.isCubeTexture?ue.setTextureCube(_e,0):_e.isData3DTexture?ue.setTexture3D(_e,0):_e.isDataArrayTexture?ue.setTexture2DArray(_e,0):ue.setTexture2D(_e,0),fe.unbindTexture()},this.resetState=function(){v=0,y=0,b=null,fe.reset(),Ee.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Slr extends mut{}Slr.prototype.isWebGL1Renderer=!0;class _lr extends Lc{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,n){return super.copy(t,n),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const n=super.toJSON(t);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),n}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}class vut extends lF{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new yo(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const Rze=new Ne,Ize=new Ne,Dze=new Zi,Aee=new nut,dz=new aH;class Clr extends Lc{constructor(t=new Wv,n=new vut){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=n,this.updateMorphTargets()}copy(t,n){return super.copy(t,n),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const n=t.attributes.position,r=[0];for(let i=1,o=n.count;il)continue;d.applyMatrix4(this.matrixWorld);const T=t.ray.origin.distanceTo(d);Tt.far||n.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,s.start),y=Math.min(m.count,s.start+s.count);for(let b=v,w=y-1;bl)continue;d.applyMatrix4(this.matrixWorld);const _=t.ray.origin.distanceTo(d);_t.far||n.push({distance:_,point:f.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o{n&&n(o),this.manager.itemEnd(t)},0),o;if(am[t]!==void 0){am[t].push({onLoad:n,onProgress:r,onError:i});return}am[t]=[],am[t].push({onLoad:n,onProgress:r,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=am[t],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let g=0;const m=new ReadableStream({start(v){y();function y(){f.read().then(({done:b,value:w})=>{if(b)v.close();else{g+=w.byteLength;const S=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:h});for(let _=0,E=u.length;_{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{A6.add(t,c);const u=am[t];delete am[t];for(let f=0,d=u.length;f{const u=am[t];if(u===void 0)throw this.manager.itemError(t),c;delete am[t];for(let f=0,d=u.length;f{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Mlr extends uH{constructor(t){super(t)}load(t,n,r,i){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=A6.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){n&&n(s),o.manager.itemEnd(t)},0),s;const a=BI("img");function l(){u(),A6.add(t,this),n&&n(this),o.manager.itemEnd(t)}function c(f){u(),i&&i(f),o.manager.itemError(t),o.manager.itemEnd(t)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(t),a.src=t,a}}class Alr extends uH{constructor(t){super(t)}load(t,n,r,i){const o=new Wu,s=new Mlr(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(a){o.image=a,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class $ze{constructor(t=1,n=0,r=0){return this.radius=t,this.phi=n,this.theta=r,this}set(t,n,r){return this.radius=t,this.phi=n,this.theta=r,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,n,r){return this.radius=Math.sqrt(t*t+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,r),this.phi=Math.acos(Oc(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const hz=new $P;class Rlr extends Olr{constructor(t,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),o=new Wv;o.setIndex(new Wf(r,1)),o.setAttribute("position",new Wf(i,3)),super(o,new vut({color:n,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(t!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&hz.setFromObject(this.object),hz.isEmpty())return;const n=hz.min,r=hz.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,n){return super.copy(t,n),this.object=t.object,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:iye}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=iye);const Nze={type:"change"},Ree={type:"start"},zze={type:"end"};class Ilr extends GS{constructor(t,n){super(),this.object=t,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Ne,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:J_.ROTATE,MIDDLE:J_.DOLLY,RIGHT:J_.PAN},this.touches={ONE:eC.ROTATE,TWO:eC.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(re){re.addEventListener("keydown",Pe),this._domElementKeyEvents=re},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(Nze),r.update(),o=i.NONE},this.update=(function(){const re=new Ne,Ee=new eS().setFromUnitVectors(t.up,new Ne(0,1,0)),ke=Ee.clone().invert(),je=new Ne,De=new eS,ze=2*Math.PI;return function(){const mt=r.object.position;re.copy(mt).sub(r.target),re.applyQuaternion(Ee),a.setFromVector3(re),r.autoRotate&&o===i.NONE&&k(E()),r.enableDamping?(a.theta+=l.theta*r.dampingFactor,a.phi+=l.phi*r.dampingFactor):(a.theta+=l.theta,a.phi+=l.phi);let Me=r.minAzimuthAngle,st=r.maxAzimuthAngle;return isFinite(Me)&&isFinite(st)&&(Me<-Math.PI?Me+=ze:Me>Math.PI&&(Me-=ze),st<-Math.PI?st+=ze:st>Math.PI&&(st-=ze),Me<=st?a.theta=Math.max(Me,Math.min(st,a.theta)):a.theta=a.theta>(Me+st)/2?Math.max(Me,a.theta):Math.min(st,a.theta)),a.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=c,a.radius=Math.max(r.minDistance,Math.min(r.maxDistance,a.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),re.setFromSpherical(a),re.applyQuaternion(ke),mt.copy(r.target).add(re),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,u.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),u.set(0,0,0)),c=1,f||je.distanceToSquared(r.object.position)>s||8*(1-De.dot(r.object.quaternion))>s?(r.dispatchEvent(Nze),je.copy(r.object.position),De.copy(r.object.quaternion),f=!1,!0):!1}})(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",Se),r.domElement.removeEventListener("pointerdown",G),r.domElement.removeEventListener("pointercancel",J),r.domElement.removeEventListener("wheel",we),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",he),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",Pe)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=i.NONE;const s=1e-6,a=new $ze,l=new $ze;let c=1;const u=new Ne;let f=!1;const d=new Sr,h=new Sr,p=new Sr,g=new Sr,m=new Sr,v=new Sr,y=new Sr,b=new Sr,w=new Sr,S=[],_={};function E(){return 2*Math.PI/60/60*r.autoRotateSpeed}function T(){return Math.pow(.95,r.zoomSpeed)}function k(re){l.theta-=re}function P(re){l.phi-=re}const R=(function(){const re=new Ne;return function(ke,je){re.setFromMatrixColumn(je,0),re.multiplyScalar(-ke),u.add(re)}})(),I=(function(){const re=new Ne;return function(ke,je){r.screenSpacePanning===!0?re.setFromMatrixColumn(je,1):(re.setFromMatrixColumn(je,0),re.crossVectors(r.object.up,re)),re.multiplyScalar(ke),u.add(re)}})(),F=(function(){const re=new Ne;return function(ke,je){const De=r.domElement;if(r.object.isPerspectiveCamera){const ze=r.object.position;re.copy(ze).sub(r.target);let Je=re.length();Je*=Math.tan(r.object.fov/2*Math.PI/180),R(2*ke*Je/De.clientHeight,r.object.matrix),I(2*je*Je/De.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(R(ke*(r.object.right-r.object.left)/r.object.zoom/De.clientWidth,r.object.matrix),I(je*(r.object.top-r.object.bottom)/r.object.zoom/De.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function A(re){r.object.isPerspectiveCamera?c/=re:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*re)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function L(re){r.object.isPerspectiveCamera?c*=re:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/re)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function $(re){d.set(re.clientX,re.clientY)}function j(re){y.set(re.clientX,re.clientY)}function V(re){g.set(re.clientX,re.clientY)}function U(re){h.set(re.clientX,re.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const Ee=r.domElement;k(2*Math.PI*p.x/Ee.clientHeight),P(2*Math.PI*p.y/Ee.clientHeight),d.copy(h),r.update()}function z(re){b.set(re.clientX,re.clientY),w.subVectors(b,y),w.y>0?A(T()):w.y<0&&L(T()),y.copy(b),r.update()}function N(re){m.set(re.clientX,re.clientY),v.subVectors(m,g).multiplyScalar(r.panSpeed),F(v.x,v.y),g.copy(m),r.update()}function B(re){re.deltaY<0?L(T()):re.deltaY>0&&A(T()),r.update()}function H(re){let Ee=!1;switch(re.code){case r.keys.UP:F(0,r.keyPanSpeed),Ee=!0;break;case r.keys.BOTTOM:F(0,-r.keyPanSpeed),Ee=!0;break;case r.keys.LEFT:F(r.keyPanSpeed,0),Ee=!0;break;case r.keys.RIGHT:F(-r.keyPanSpeed,0),Ee=!0;break}Ee&&(re.preventDefault(),r.update())}function Q(){if(S.length===1)d.set(S[0].pageX,S[0].pageY);else{const re=.5*(S[0].pageX+S[1].pageX),Ee=.5*(S[0].pageY+S[1].pageY);d.set(re,Ee)}}function Y(){if(S.length===1)g.set(S[0].pageX,S[0].pageY);else{const re=.5*(S[0].pageX+S[1].pageX),Ee=.5*(S[0].pageY+S[1].pageY);g.set(re,Ee)}}function Z(){const re=S[0].pageX-S[1].pageX,Ee=S[0].pageY-S[1].pageY,ke=Math.sqrt(re*re+Ee*Ee);y.set(0,ke)}function pe(){r.enableZoom&&Z(),r.enablePan&&Y()}function ie(){r.enableZoom&&Z(),r.enableRotate&&Q()}function ne(re){if(S.length===1)h.set(re.pageX,re.pageY);else{const ke=xe(re),je=.5*(re.pageX+ke.x),De=.5*(re.pageY+ke.y);h.set(je,De)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const Ee=r.domElement;k(2*Math.PI*p.x/Ee.clientHeight),P(2*Math.PI*p.y/Ee.clientHeight),d.copy(h)}function fe(re){if(S.length===1)m.set(re.pageX,re.pageY);else{const Ee=xe(re),ke=.5*(re.pageX+Ee.x),je=.5*(re.pageY+Ee.y);m.set(ke,je)}v.subVectors(m,g).multiplyScalar(r.panSpeed),F(v.x,v.y),g.copy(m)}function me(re){const Ee=xe(re),ke=re.pageX-Ee.x,je=re.pageY-Ee.y,De=Math.sqrt(ke*ke+je*je);b.set(0,De),w.set(0,Math.pow(b.y/y.y,r.zoomSpeed)),A(w.y),y.copy(b)}function se(re){r.enableZoom&&me(re),r.enablePan&&fe(re)}function ue(re){r.enableZoom&&me(re),r.enableRotate&&ne(re)}function G(re){r.enabled!==!1&&(S.length===0&&(r.domElement.setPointerCapture(re.pointerId),r.domElement.addEventListener("pointermove",ce),r.domElement.addEventListener("pointerup",he)),ye(re),re.pointerType==="touch"?ee(re):te(re))}function ce(re){r.enabled!==!1&&(re.pointerType==="touch"?oe(re):ae(re))}function he(re){be(re),S.length===0&&(r.domElement.releasePointerCapture(re.pointerId),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",he)),r.dispatchEvent(zze),o=i.NONE}function J(re){be(re)}function te(re){let Ee;switch(re.button){case 0:Ee=r.mouseButtons.LEFT;break;case 1:Ee=r.mouseButtons.MIDDLE;break;case 2:Ee=r.mouseButtons.RIGHT;break;default:Ee=-1}switch(Ee){case J_.DOLLY:if(r.enableZoom===!1)return;j(re),o=i.DOLLY;break;case J_.ROTATE:if(re.ctrlKey||re.metaKey||re.shiftKey){if(r.enablePan===!1)return;V(re),o=i.PAN}else{if(r.enableRotate===!1)return;$(re),o=i.ROTATE}break;case J_.PAN:if(re.ctrlKey||re.metaKey||re.shiftKey){if(r.enableRotate===!1)return;$(re),o=i.ROTATE}else{if(r.enablePan===!1)return;V(re),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(Ree)}function ae(re){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;U(re);break;case i.DOLLY:if(r.enableZoom===!1)return;z(re);break;case i.PAN:if(r.enablePan===!1)return;N(re);break}}function we(re){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(re.preventDefault(),r.dispatchEvent(Ree),B(re),r.dispatchEvent(zze))}function Pe(re){r.enabled===!1||r.enablePan===!1||H(re)}function ee(re){switch(ge(re),S.length){case 1:switch(r.touches.ONE){case eC.ROTATE:if(r.enableRotate===!1)return;Q(),o=i.TOUCH_ROTATE;break;case eC.PAN:if(r.enablePan===!1)return;Y(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case eC.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;pe(),o=i.TOUCH_DOLLY_PAN;break;case eC.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ie(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(Ree)}function oe(re){switch(ge(re),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ne(re),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;fe(re),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(re),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ue(re),r.update();break;default:o=i.NONE}}function Se(re){r.enabled!==!1&&re.preventDefault()}function ye(re){S.push(re)}function be(re){delete _[re.pointerId];for(let Ee=0;Eeu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/L.x),i.x=o.x*L.x,A.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/L.y),i.y=o.y*L.y,A.mapSize.y=o.y)),A.map===null){const j=this.type!==EM?{minFilter:xc,magFilter:xc}:{};A.map=new Hw(i.x,i.y,j),A.map.texture.name=F.name+".shadowMap",A.camera.updateProjectionMatrix()}e.setRenderTarget(A.map),e.clear();const $=A.getViewportCount();for(let j=0;j<$;j++){const V=A.getViewport(j);s.set(o.x*V.x,o.y*V.y,o.x*V.z,o.y*V.w),P.viewport(s),A.updateMatrices(F,j),r=A.getFrustum(),b(S,_,A.camera,F,this.type)}A.isPointLightShadow!==!0&&this.type===EM&&v(A,_),A.needsUpdate=!1}m.needsUpdate=!1,e.setRenderTarget(E,T,k)};function v(w,S){const _=t.update(g);d.defines.VSM_SAMPLES!==w.blurSamples&&(d.defines.VSM_SAMPLES=w.blurSamples,h.defines.VSM_SAMPLES=w.blurSamples,d.needsUpdate=!0,h.needsUpdate=!0),w.mapPass===null&&(w.mapPass=new Hw(i.x,i.y)),d.uniforms.shadow_pass.value=w.map.texture,d.uniforms.resolution.value=w.mapSize,d.uniforms.radius.value=w.radius,e.setRenderTarget(w.mapPass),e.clear(),e.renderBufferDirect(S,null,_,d,g,null),h.uniforms.shadow_pass.value=w.mapPass.texture,h.uniforms.resolution.value=w.mapSize,h.uniforms.radius.value=w.radius,e.setRenderTarget(w.map),e.clear(),e.renderBufferDirect(S,null,_,h,g,null)}function y(w,S,_,E,T,k){let P=null;const I=_.isPointLight===!0?w.customDistanceMaterial:w.customDepthMaterial;if(I!==void 0?P=I:P=_.isPointLight===!0?l:a,e.localClippingEnabled&&S.clipShadows===!0&&Array.isArray(S.clippingPlanes)&&S.clippingPlanes.length!==0||S.displacementMap&&S.displacementScale!==0||S.alphaMap&&S.alphaTest>0){const R=P.uuid,F=S.uuid;let A=c[R];A===void 0&&(A={},c[R]=A);let L=A[F];L===void 0&&(L=P.clone(),A[F]=L),P=L}return P.visible=S.visible,P.wireframe=S.wireframe,k===EM?P.side=S.shadowSide!==null?S.shadowSide:S.side:P.side=S.shadowSide!==null?S.shadowSide:f[S.side],P.alphaMap=S.alphaMap,P.alphaTest=S.alphaTest,P.clipShadows=S.clipShadows,P.clippingPlanes=S.clippingPlanes,P.clipIntersection=S.clipIntersection,P.displacementMap=S.displacementMap,P.displacementScale=S.displacementScale,P.displacementBias=S.displacementBias,P.wireframeLinewidth=S.wireframeLinewidth,P.linewidth=S.linewidth,_.isPointLight===!0&&P.isMeshDistanceMaterial===!0&&(P.referencePosition.setFromMatrixPosition(_.matrixWorld),P.nearDistance=E,P.farDistance=T),P}function b(w,S,_,E,T){if(w.visible===!1)return;if(w.layers.test(S.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&T===EM)&&(!w.frustumCulled||r.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,w.matrixWorld);const I=t.update(w),R=w.material;if(Array.isArray(R)){const F=I.groups;for(let A=0,L=F.length;A=1):V.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),$=j>=2);let U=null,z={};const N=e.getParameter(3088),B=e.getParameter(2978),H=new Ia().fromArray(N),Q=new Ia().fromArray(B);function Y(Me,ct,Fe){const ht=new Uint8Array(4),gt=e.createTexture();e.bindTexture(Me,gt),e.texParameteri(Me,10241,9728),e.texParameteri(Me,10240,9728);for(let St=0;Sthe||ee.height>he)&&(xe=he/Math.max(ee.width,ee.height)),xe<1||re===!0)if(typeof HTMLImageElement<"u"&&ee instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ee instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ee instanceof ImageBitmap){const me=re?dse:Math.floor,be=me(xe*ee.width),oe=me(xe*ee.height);g===void 0&&(g=y(be,oe));const Ee=Se?y(be,oe):g;return Ee.width=be,Ee.height=oe,Ee.getContext("2d").drawImage(ee,0,0,be,oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ee.width+"x"+ee.height+") to ("+be+"x"+oe+")."),Ee}else return"data"in ee&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ee.width+"x"+ee.height+")."),ee;return ee}function w(ee){return Y$e(ee.width)&&Y$e(ee.height)}function S(ee){return a?!1:ee.wrapS!==xf||ee.wrapT!==xf||ee.minFilter!==xc&&ee.minFilter!==wc}function _(ee,re){return ee.generateMipmaps&&re&&ee.minFilter!==xc&&ee.minFilter!==wc}function E(ee){e.generateMipmap(ee)}function T(ee,re,Se,he,xe=!1){if(a===!1)return re;if(ee!==null){if(e[ee]!==void 0)return e[ee];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ee+"'")}let me=re;return re===6403&&(Se===5126&&(me=33326),Se===5131&&(me=33325),Se===5121&&(me=33321)),re===33319&&(Se===5126&&(me=33328),Se===5131&&(me=33327),Se===5121&&(me=33323)),re===6408&&(Se===5126&&(me=34836),Se===5131&&(me=34842),Se===5121&&(me=he===Lo&&xe===!1?35907:32856),Se===32819&&(me=32854),Se===32820&&(me=32855)),(me===33325||me===33326||me===33327||me===33328||me===34842||me===34836)&&t.get("EXT_color_buffer_float"),me}function k(ee,re,Se){return _(ee,Se)===!0||ee.isFramebufferTexture&&ee.minFilter!==xc&&ee.minFilter!==wc?Math.log2(Math.max(re.width,re.height))+1:ee.mipmaps!==void 0&&ee.mipmaps.length>0?ee.mipmaps.length:ee.isCompressedTexture&&Array.isArray(ee.image)?re.mipmaps.length:1}function P(ee){return ee===xc||ee===_$e||ee===C$e?9728:9729}function I(ee){const re=ee.target;re.removeEventListener("dispose",I),F(re),re.isVideoTexture&&p.delete(re)}function R(ee){const re=ee.target;re.removeEventListener("dispose",R),L(re)}function F(ee){const re=r.get(ee);if(re.__webglInit===void 0)return;const Se=ee.source,he=m.get(Se);if(he){const xe=he[re.__cacheKey];xe.usedTimes--,xe.usedTimes===0&&A(ee),Object.keys(he).length===0&&m.delete(Se)}r.remove(ee)}function A(ee){const re=r.get(ee);e.deleteTexture(re.__webglTexture);const Se=ee.source,he=m.get(Se);delete he[re.__cacheKey],s.memory.textures--}function L(ee){const re=ee.texture,Se=r.get(ee),he=r.get(re);if(he.__webglTexture!==void 0&&(e.deleteTexture(he.__webglTexture),s.memory.textures--),ee.depthTexture&&ee.depthTexture.dispose(),ee.isWebGLCubeRenderTarget)for(let xe=0;xe<6;xe++)e.deleteFramebuffer(Se.__webglFramebuffer[xe]),Se.__webglDepthbuffer&&e.deleteRenderbuffer(Se.__webglDepthbuffer[xe]);else{if(e.deleteFramebuffer(Se.__webglFramebuffer),Se.__webglDepthbuffer&&e.deleteRenderbuffer(Se.__webglDepthbuffer),Se.__webglMultisampledFramebuffer&&e.deleteFramebuffer(Se.__webglMultisampledFramebuffer),Se.__webglColorRenderbuffer)for(let xe=0;xe=l&&console.warn("THREE.WebGLTextures: Trying to use "+ee+" texture units while this GPU supports only "+l),$+=1,ee}function U(ee){const re=[];return re.push(ee.wrapS),re.push(ee.wrapT),re.push(ee.magFilter),re.push(ee.minFilter),re.push(ee.anisotropy),re.push(ee.internalFormat),re.push(ee.format),re.push(ee.type),re.push(ee.generateMipmaps),re.push(ee.premultiplyAlpha),re.push(ee.flipY),re.push(ee.unpackAlignment),re.push(ee.encoding),re.join()}function z(ee,re){const Se=r.get(ee);if(ee.isVideoTexture&&we(ee),ee.isRenderTargetTexture===!1&&ee.version>0&&Se.__version!==ee.version){const he=ee.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ne(Se,ee,re);return}}n.activeTexture(33984+re),n.bindTexture(3553,Se.__webglTexture)}function N(ee,re){const Se=r.get(ee);if(ee.version>0&&Se.__version!==ee.version){ne(Se,ee,re);return}n.activeTexture(33984+re),n.bindTexture(35866,Se.__webglTexture)}function B(ee,re){const Se=r.get(ee);if(ee.version>0&&Se.__version!==ee.version){ne(Se,ee,re);return}n.activeTexture(33984+re),n.bindTexture(32879,Se.__webglTexture)}function H(ee,re){const Se=r.get(ee);if(ee.version>0&&Se.__version!==ee.version){ie(Se,ee,re);return}n.activeTexture(33984+re),n.bindTexture(34067,Se.__webglTexture)}const Q={[cse]:10497,[xf]:33071,[use]:33648},Y={[xc]:9728,[_$e]:9984,[C$e]:9986,[wc]:9729,[aer]:9985,[FW]:9987};function Z(ee,re,Se){if(Se?(e.texParameteri(ee,10242,Q[re.wrapS]),e.texParameteri(ee,10243,Q[re.wrapT]),(ee===32879||ee===35866)&&e.texParameteri(ee,32882,Q[re.wrapR]),e.texParameteri(ee,10240,Y[re.magFilter]),e.texParameteri(ee,10241,Y[re.minFilter])):(e.texParameteri(ee,10242,33071),e.texParameteri(ee,10243,33071),(ee===32879||ee===35866)&&e.texParameteri(ee,32882,33071),(re.wrapS!==xf||re.wrapT!==xf)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(ee,10240,P(re.magFilter)),e.texParameteri(ee,10241,P(re.minFilter)),re.minFilter!==xc&&re.minFilter!==wc&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),t.has("EXT_texture_filter_anisotropic")===!0){const he=t.get("EXT_texture_filter_anisotropic");if(re.type===x0&&t.has("OES_texture_float_linear")===!1||a===!1&&re.type===kI&&t.has("OES_texture_half_float_linear")===!1)return;(re.anisotropy>1||r.get(re).__currentAnisotropy)&&(e.texParameterf(ee,he.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(re.anisotropy,i.getMaxAnisotropy())),r.get(re).__currentAnisotropy=re.anisotropy)}}function ge(ee,re){let Se=!1;ee.__webglInit===void 0&&(ee.__webglInit=!0,re.addEventListener("dispose",I));const he=re.source;let xe=m.get(he);xe===void 0&&(xe={},m.set(he,xe));const me=U(re);if(me!==ee.__cacheKey){xe[me]===void 0&&(xe[me]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,Se=!0),xe[me].usedTimes++;const be=xe[ee.__cacheKey];be!==void 0&&(xe[ee.__cacheKey].usedTimes--,be.usedTimes===0&&A(re)),ee.__cacheKey=me,ee.__webglTexture=xe[me].texture}return Se}function ne(ee,re,Se){let he=3553;re.isDataArrayTexture&&(he=35866),re.isData3DTexture&&(he=32879);const xe=ge(ee,re),me=re.source;if(n.activeTexture(33984+Se),n.bindTexture(he,ee.__webglTexture),me.version!==me.__currentVersion||xe===!0){e.pixelStorei(37440,re.flipY),e.pixelStorei(37441,re.premultiplyAlpha),e.pixelStorei(3317,re.unpackAlignment),e.pixelStorei(37443,0);const be=S(re)&&w(re.image)===!1;let oe=b(re.image,be,!1,u);oe=Pe(re,oe);const Ee=w(oe)||a,ke=o.convert(re.format,re.encoding);let ze=o.convert(re.type),De=T(re.internalFormat,ke,ze,re.encoding,re.isVideoTexture);Z(he,re,Ee);let Ve;const Ze=re.mipmaps,mt=a&&re.isVideoTexture!==!0,Me=me.__currentVersion===void 0||xe===!0,ct=k(re,oe,Ee);if(re.isDepthTexture)De=6402,a?re.type===x0?De=36012:re.type===v1?De=33190:re.type===MO?De=35056:De=33189:re.type===x0&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),re.format===H1&&De===6402&&re.type!==Rat&&re.type!==v1&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),re.type=v1,ze=o.convert(re.type)),re.format===cT&&De===6402&&(De=34041,re.type!==MO&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),re.type=MO,ze=o.convert(re.type))),Me&&(mt?n.texStorage2D(3553,1,De,oe.width,oe.height):n.texImage2D(3553,0,De,oe.width,oe.height,0,ke,ze,null));else if(re.isDataTexture)if(Ze.length>0&&Ee){mt&&Me&&n.texStorage2D(3553,ct,De,Ze[0].width,Ze[0].height);for(let Fe=0,ht=Ze.length;Fe>=1,ht>>=1}}else if(Ze.length>0&&Ee){mt&&Me&&n.texStorage2D(3553,ct,De,Ze[0].width,Ze[0].height);for(let Fe=0,ht=Ze.length;Fe0&&Me++,n.texStorage2D(34067,Me,Ve,oe[0].width,oe[0].height));for(let Fe=0;Fe<6;Fe++)if(be){Ze?n.texSubImage2D(34069+Fe,0,0,0,oe[Fe].width,oe[Fe].height,ze,De,oe[Fe].data):n.texImage2D(34069+Fe,0,Ve,oe[Fe].width,oe[Fe].height,0,ze,De,oe[Fe].data);for(let ht=0;ht0&&ae(ee)===!1){const oe=me?re:[re];Se.__webglMultisampledFramebuffer=e.createFramebuffer(),Se.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,Se.__webglMultisampledFramebuffer);for(let Ee=0;Ee0&&ae(ee)===!1){const re=ee.isWebGLMultipleRenderTargets?ee.texture:[ee.texture],Se=ee.width,he=ee.height;let xe=16384;const me=[],be=ee.stencilBuffer?33306:36096,oe=r.get(ee),Ee=ee.isWebGLMultipleRenderTargets===!0;if(Ee)for(let ke=0;ke0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&re.__useRenderToTexture!==!1}function we(ee){const re=s.render.frame;p.get(ee)!==re&&(p.set(ee,re),ee.update())}function Pe(ee,re){const Se=ee.encoding,he=ee.format,xe=ee.type;return ee.isCompressedTexture===!0||ee.isVideoTexture===!0||ee.format===fse||Se!==Ww&&(Se===Lo?a===!1?t.has("EXT_sRGB")===!0&&he===Ip?(ee.format=fse,ee.minFilter=wc,ee.generateMipmaps=!1):re=Fat.sRGBToLinear(re):(he!==Ip||xe!==Vw)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",Se)),re}this.allocateTextureUnit=V,this.resetTextureUnits=j,this.setTexture2D=z,this.setTexture2DArray=N,this.setTexture3D=B,this.setTextureCube=H,this.rebindTextures=G,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=pe,this.updateMultisampleRenderTarget=J,this.setupDepthRenderbuffer=ue,this.setupFrameBufferTexture=fe,this.useMultisampledRTT=ae}function gor(e,t,n){const r=n.isWebGL2;function i(o,s=null){let a;if(o===Vw)return 5121;if(o===fer)return 32819;if(o===der)return 32820;if(o===ler)return 5120;if(o===cer)return 5122;if(o===Rat)return 5123;if(o===uer)return 5124;if(o===v1)return 5125;if(o===x0)return 5126;if(o===kI)return r?5131:(a=t.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===her)return 6406;if(o===Ip)return 6408;if(o===ger)return 6409;if(o===mer)return 6410;if(o===H1)return 6402;if(o===cT)return 34041;if(o===Iat)return 6403;if(o===per)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===fse)return a=t.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===ver)return 36244;if(o===yer)return 33319;if(o===ber)return 33320;if(o===xer)return 36249;if(o===YZ||o===QZ||o===KZ||o===ZZ)if(s===Lo)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===YZ)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===QZ)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===KZ)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===ZZ)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===YZ)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===QZ)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===KZ)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===ZZ)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===O$e||o===E$e||o===T$e||o===P$e)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===O$e)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===E$e)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===T$e)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===P$e)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===wer)return a=t.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===k$e||o===M$e)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(o===k$e)return s===Lo?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===M$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===A$e||o===R$e||o===I$e||o===D$e||o===L$e||o===F$e||o===$$e||o===N$e||o===z$e||o===j$e||o===B$e||o===U$e||o===V$e||o===W$e)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(o===A$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===R$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===I$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===D$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===L$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===F$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===$$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===N$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===z$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===j$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===B$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===U$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===V$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===W$e)return s===Lo?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===H$e)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(o===H$e)return s===Lo?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===MO?r?34042:(a=t.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):e[o]!==void 0?e[o]:null}return{convert:i}}class mor extends Hd{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class W3 extends Ic{constructor(){super(),this.isGroup=!0,this.type="Group"}}const vor={type:"move"};class EJ{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new W3,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new W3,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ne,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ne),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new W3,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ne,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ne),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,n,r){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(t&&n.session.visibilityState!=="visible-blurred"){if(c&&t.hand){s=!0;for(const g of t.hand.values()){const m=n.getJointPose(g,r);if(c.joints[g.jointName]===void 0){const y=new W3;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[g.jointName]=y,c.add(y)}const v=c.joints[g.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(o=n.getPose(t.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(t.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(vor)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this}}class yor extends Wu{constructor(t,n,r,i,o,s,a,l,c,u){if(u=u!==void 0?u:H1,u!==H1&&u!==cT)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===H1&&(r=v1),r===void 0&&u===cT&&(r=MO),super(null,i,o,s,a,l,u,r,c),this.isDepthTexture=!0,this.image={width:t,height:n},this.magFilter=a!==void 0?a:xc,this.minFilter=l!==void 0?l:xc,this.flipY=!1,this.generateMipmaps=!1}}class bor extends NS{constructor(t,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let g=null,m=null;const v=[],y=[],b=new Hd;b.layers.enable(1),b.viewport=new Ia;const w=new Hd;w.layers.enable(2),w.viewport=new Ia;const S=[b,w],_=new mor;_.layers.enable(1),_.layers.enable(2);let E=null,T=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(U){let z=v[U];return z===void 0&&(z=new EJ,v[U]=z),z.getTargetRaySpace()},this.getControllerGrip=function(U){let z=v[U];return z===void 0&&(z=new EJ,v[U]=z),z.getGripSpace()},this.getHand=function(U){let z=v[U];return z===void 0&&(z=new EJ,v[U]=z),z.getHandSpace()};function k(U){const z=y.indexOf(U.inputSource);if(z===-1)return;const N=v[z];N!==void 0&&N.dispatchEvent({type:U.type,data:U.inputSource})}function P(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",P),i.removeEventListener("inputsourceschange",I);for(let U=0;U=0&&(y[B]=null,v[B].dispatchEvent({type:"disconnected",data:N}))}for(let z=0;z=y.length){y.push(N),B=Q;break}else if(y[Q]===null){y[Q]=N,B=Q;break}if(B===-1)break}const H=v[B];H&&H.dispatchEvent({type:"connected",data:N})}}const R=new Ne,F=new Ne;function A(U,z,N){R.setFromMatrixPosition(z.matrixWorld),F.setFromMatrixPosition(N.matrixWorld);const B=R.distanceTo(F),H=z.projectionMatrix.elements,Q=N.projectionMatrix.elements,Y=H[14]/(H[10]-1),Z=H[14]/(H[10]+1),ge=(H[9]+1)/H[5],ne=(H[9]-1)/H[5],ie=(H[8]-1)/H[0],fe=(Q[8]+1)/Q[0],ve=Y*ie,se=Y*fe,ue=B/(-ie+fe),G=ue*-ie;z.matrixWorld.decompose(U.position,U.quaternion,U.scale),U.translateX(G),U.translateZ(ue),U.matrixWorld.compose(U.position,U.quaternion,U.scale),U.matrixWorldInverse.copy(U.matrixWorld).invert();const ce=Y+ue,pe=Z+ue,J=ve-G,te=se+(B-G),ae=ge*Z/pe*ce,we=ne*Z/pe*ce;U.projectionMatrix.makePerspective(J,te,ae,we,ce,pe)}function L(U,z){z===null?U.matrixWorld.copy(U.matrix):U.matrixWorld.multiplyMatrices(z.matrixWorld,U.matrix),U.matrixWorldInverse.copy(U.matrixWorld).invert()}this.updateCamera=function(U){if(i===null)return;_.near=w.near=b.near=U.near,_.far=w.far=b.far=U.far,(E!==_.near||T!==_.far)&&(i.updateRenderState({depthNear:_.near,depthFar:_.far}),E=_.near,T=_.far);const z=U.parent,N=_.cameras;L(_,z);for(let H=0;H0&&(g.alphaTest.value=m.alphaTest);const v=t.get(m).envMap;if(v&&(g.envMap.value=v,g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap){g.lightMap.value=m.lightMap;const w=e.physicallyCorrectLights!==!0?Math.PI:1;g.lightMapIntensity.value=m.lightMapIntensity*w}m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity);let y;m.map?y=m.map:m.specularMap?y=m.specularMap:m.displacementMap?y=m.displacementMap:m.normalMap?y=m.normalMap:m.bumpMap?y=m.bumpMap:m.roughnessMap?y=m.roughnessMap:m.metalnessMap?y=m.metalnessMap:m.alphaMap?y=m.alphaMap:m.emissiveMap?y=m.emissiveMap:m.clearcoatMap?y=m.clearcoatMap:m.clearcoatNormalMap?y=m.clearcoatNormalMap:m.clearcoatRoughnessMap?y=m.clearcoatRoughnessMap:m.iridescenceMap?y=m.iridescenceMap:m.iridescenceThicknessMap?y=m.iridescenceThicknessMap:m.specularIntensityMap?y=m.specularIntensityMap:m.specularColorMap?y=m.specularColorMap:m.transmissionMap?y=m.transmissionMap:m.thicknessMap?y=m.thicknessMap:m.sheenColorMap?y=m.sheenColorMap:m.sheenRoughnessMap&&(y=m.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),g.uvTransform.value.copy(y.matrix));let b;m.aoMap?b=m.aoMap:m.lightMap&&(b=m.lightMap),b!==void 0&&(b.isWebGLRenderTarget&&(b=b.texture),b.matrixAutoUpdate===!0&&b.updateMatrix(),g.uv2Transform.value.copy(b.matrix))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function a(g,m,v,y){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*v,g.scale.value=y*.5,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let b;m.map?b=m.map:m.alphaMap&&(b=m.alphaMap),b!==void 0&&(b.matrixAutoUpdate===!0&&b.updateMatrix(),g.uvTransform.value.copy(b.matrix))}function l(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let v;m.map?v=m.map:m.alphaMap&&(v=m.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),g.uvTransform.value.copy(v.matrix))}function c(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function u(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.roughness.value=m.roughness,g.metalness.value=m.metalness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap),t.get(m).envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,v){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),g.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===Fu&&g.clearcoatNormalScale.value.negate())),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap)),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap)}function h(g,m){m.matcap&&(g.matcap.value=m.matcap)}function p(g,m){g.referencePosition.value.copy(m.referencePosition),g.nearDistance.value=m.nearDistance,g.farDistance.value=m.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function wor(e,t,n,r){let i={},o={},s=[];const a=n.isWebGL2?e.getParameter(35375):0;function l(y,b){const w=b.program;r.uniformBlockBinding(y,w)}function c(y,b){let w=i[y.id];w===void 0&&(p(y),w=u(y),i[y.id]=w,y.addEventListener("dispose",m));const S=b.program;r.updateUBOMapping(y,S);const _=t.render.frame;o[y.id]!==_&&(d(y),o[y.id]=_)}function u(y){const b=f();y.__bindingPointIndex=b;const w=e.createBuffer(),S=y.__size,_=y.usage;return e.bindBuffer(35345,w),e.bufferData(35345,S,_),e.bindBuffer(35345,null),e.bindBufferBase(35345,b,w),w}function f(){for(let y=0;y0){_=w%S;const I=S-_;_!==0&&I-P.boundary<0&&(w+=S-_,k.__offset=w)}w+=P.storage}return _=w%S,_>0&&(w+=S-_),y.__size=w,y.__cache={},this}function g(y){const b=y.value,w={boundary:0,storage:0};return typeof b=="number"?(w.boundary=4,w.storage=4):b.isVector2?(w.boundary=8,w.storage=8):b.isVector3||b.isColor?(w.boundary=16,w.storage=12):b.isVector4?(w.boundary=16,w.storage=16):b.isMatrix3?(w.boundary=48,w.storage=48):b.isMatrix4?(w.boundary=64,w.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),w}function m(y){const b=y.target;b.removeEventListener("dispose",m);const w=s.indexOf(b.__bindingPointIndex);s.splice(w,1),e.deleteBuffer(i[b.id]),delete i[b.id],delete o[b.id]}function v(){for(const y in i)e.deleteBuffer(i[y]);s=[],i={},o={}}return{bind:l,update:c,dispose:v}}function Sor(){const e=MI("canvas");return e.style.display="block",e}function elt(e={}){this.isWebGLRenderer=!0;const t=e.canvas!==void 0?e.canvas:Sor(),n=e.context!==void 0?e.context:null,r=e.depth!==void 0?e.depth:!0,i=e.stencil!==void 0?e.stencil:!0,o=e.antialias!==void 0?e.antialias:!1,s=e.premultipliedAlpha!==void 0?e.premultipliedAlpha:!0,a=e.preserveDrawingBuffer!==void 0?e.preserveDrawingBuffer:!1,l=e.powerPreference!==void 0?e.powerPreference:"default",c=e.failIfMajorPerformanceCaveat!==void 0?e.failIfMajorPerformanceCaveat:!1;let u;n!==null?u=n.getContextAttributes().alpha:u=e.alpha!==void 0?e.alpha:!1;let f=null,d=null;const h=[],p=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Ww,this.physicallyCorrectLights=!1,this.toneMapping=nv,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const g=this;let m=!1,v=0,y=0,b=null,w=-1,S=null;const _=new Ia,E=new Ia;let T=null,k=t.width,P=t.height,I=1,R=null,F=null;const A=new Ia(0,0,k,P),L=new Ia(0,0,k,P);let $=!1;const j=new qat;let V=!1,U=!1,z=null;const N=new Ji,B=new _r,H=new Ne,Q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Y(){return b===null?I:1}let Z=n;function ge(_e,Be){for(let Qe=0;Qe<_e.length;Qe++){const $e=_e[Qe],Ke=t.getContext($e,Be);if(Ke!==null)return Ke}return null}try{const _e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Zme}`),t.addEventListener("webglcontextlost",Ve,!1),t.addEventListener("webglcontextrestored",Ze,!1),t.addEventListener("webglcontextcreationerror",mt,!1),Z===null){const Be=["webgl2","webgl","experimental-webgl"];if(g.isWebGL1Renderer===!0&&Be.shift(),Z=ge(Be,_e),Z===null)throw ge(Be)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}Z.getShaderPrecisionFormat===void 0&&(Z.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(_e){throw console.error("THREE.WebGLRenderer: "+_e.message),_e}let ne,ie,fe,ve,se,ue,G,ce,pe,J,te,ae,we,Pe,ee,re,Se,he,xe,me,be,oe,Ee,ke;function ze(){ne=new Rrr(Z),ie=new Err(Z,ne,e),ne.init(ie),oe=new gor(Z,ne,ie),fe=new hor(Z,ne,ie),ve=new Lrr,se=new Zir,ue=new por(Z,ne,fe,se,ie,oe,ve),G=new Prr(g),ce=new Arr(g),pe=new Ger(Z,ie),Ee=new Crr(Z,ne,pe,ie),J=new Irr(Z,pe,ve,Ee),te=new zrr(Z,J,pe,ve),xe=new Nrr(Z,ie,ue),re=new Trr(se),ae=new Kir(g,G,ce,ne,ie,Ee,re),we=new xor(g,se),Pe=new eor,ee=new sor(ne,ie),he=new _rr(g,G,fe,te,u,s),Se=new dor(g,te,ie),ke=new wor(Z,ve,ie,fe),me=new Orr(Z,ne,ve,ie),be=new Drr(Z,ne,ve,ie),ve.programs=ae.programs,g.capabilities=ie,g.extensions=ne,g.properties=se,g.renderLists=Pe,g.shadowMap=Se,g.state=fe,g.info=ve}ze();const De=new bor(g,Z);this.xr=De,this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.forceContextLoss=function(){const _e=ne.get("WEBGL_lose_context");_e&&_e.loseContext()},this.forceContextRestore=function(){const _e=ne.get("WEBGL_lose_context");_e&&_e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(_e){_e!==void 0&&(I=_e,this.setSize(k,P,!1))},this.getSize=function(_e){return _e.set(k,P)},this.setSize=function(_e,Be,Qe){if(De.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}k=_e,P=Be,t.width=Math.floor(_e*I),t.height=Math.floor(Be*I),Qe!==!1&&(t.style.width=_e+"px",t.style.height=Be+"px"),this.setViewport(0,0,_e,Be)},this.getDrawingBufferSize=function(_e){return _e.set(k*I,P*I).floor()},this.setDrawingBufferSize=function(_e,Be,Qe){k=_e,P=Be,I=Qe,t.width=Math.floor(_e*Qe),t.height=Math.floor(Be*Qe),this.setViewport(0,0,_e,Be)},this.getCurrentViewport=function(_e){return _e.copy(_)},this.getViewport=function(_e){return _e.copy(A)},this.setViewport=function(_e,Be,Qe,$e){_e.isVector4?A.set(_e.x,_e.y,_e.z,_e.w):A.set(_e,Be,Qe,$e),fe.viewport(_.copy(A).multiplyScalar(I).floor())},this.getScissor=function(_e){return _e.copy(L)},this.setScissor=function(_e,Be,Qe,$e){_e.isVector4?L.set(_e.x,_e.y,_e.z,_e.w):L.set(_e,Be,Qe,$e),fe.scissor(E.copy(L).multiplyScalar(I).floor())},this.getScissorTest=function(){return $},this.setScissorTest=function(_e){fe.setScissorTest($=_e)},this.setOpaqueSort=function(_e){R=_e},this.setTransparentSort=function(_e){F=_e},this.getClearColor=function(_e){return _e.copy(he.getClearColor())},this.setClearColor=function(){he.setClearColor.apply(he,arguments)},this.getClearAlpha=function(){return he.getClearAlpha()},this.setClearAlpha=function(){he.setClearAlpha.apply(he,arguments)},this.clear=function(_e=!0,Be=!0,Qe=!0){let $e=0;_e&&($e|=16384),Be&&($e|=256),Qe&&($e|=1024),Z.clear($e)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Ve,!1),t.removeEventListener("webglcontextrestored",Ze,!1),t.removeEventListener("webglcontextcreationerror",mt,!1),Pe.dispose(),ee.dispose(),se.dispose(),G.dispose(),ce.dispose(),te.dispose(),Ee.dispose(),ke.dispose(),ae.dispose(),De.dispose(),De.removeEventListener("sessionstart",St),De.removeEventListener("sessionend",on),z&&(z.dispose(),z=null),Ln.stop()};function Ve(_e){_e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function Ze(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1;const _e=ve.autoReset,Be=Se.enabled,Qe=Se.autoUpdate,$e=Se.needsUpdate,Ke=Se.type;ze(),ve.autoReset=_e,Se.enabled=Be,Se.autoUpdate=Qe,Se.needsUpdate=$e,Se.type=Ke}function mt(_e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",_e.statusMessage)}function Me(_e){const Be=_e.target;Be.removeEventListener("dispose",Me),ct(Be)}function ct(_e){Fe(_e),se.remove(_e)}function Fe(_e){const Be=se.get(_e).programs;Be!==void 0&&(Be.forEach(function(Qe){ae.releaseProgram(Qe)}),_e.isShaderMaterial&&ae.releaseShaderCache(_e))}this.renderBufferDirect=function(_e,Be,Qe,$e,Ke,Lt){Be===null&&(Be=Q);const rn=Ke.isMesh&&Ke.matrixWorld.determinant()<0,Ge=Nn(_e,Be,Qe,$e,Ke);fe.setMaterial($e,rn);let je=Qe.index;const yt=Qe.attributes.position;if(je===null){if(yt===void 0||yt.count===0)return}else if(je.count===0)return;let Nt=1;$e.wireframe===!0&&(je=J.getWireframeAttribute(Qe),Nt=2),Ee.setup(Ke,$e,Ge,Qe,je);let Xt,Tn=me;je!==null&&(Xt=pe.get(je),Tn=be,Tn.setIndex(Xt));const Jr=je!==null?je.count:yt.count,qo=Qe.drawRange.start*Nt,qu=Qe.drawRange.count*Nt,Dr=Lt!==null?Lt.start*Nt:0,Pr=Lt!==null?Lt.count*Nt:1/0,Yc=Math.max(qo,Dr),Hi=Math.min(Jr,qo+qu,Dr+Pr)-1,Fn=Math.max(0,Hi-Yc+1);if(Fn!==0){if(Ke.isMesh)$e.wireframe===!0?(fe.setLineWidth($e.wireframeLinewidth*Y()),Tn.setMode(1)):Tn.setMode(4);else if(Ke.isLine){let Xo=$e.linewidth;Xo===void 0&&(Xo=1),fe.setLineWidth(Xo*Y()),Ke.isLineSegments?Tn.setMode(1):Ke.isLineLoop?Tn.setMode(2):Tn.setMode(3)}else Ke.isPoints?Tn.setMode(0):Ke.isSprite&&Tn.setMode(4);if(Ke.isInstancedMesh)Tn.renderInstances(Yc,Fn,Ke.count);else if(Qe.isInstancedBufferGeometry){const Xo=Math.min(Qe.instanceCount,Qe._maxInstanceCount);Tn.renderInstances(Yc,Fn,Xo)}else Tn.render(Yc,Fn)}},this.compile=function(_e,Be){function Qe($e,Ke,Lt){$e.transparent===!0&&$e.side===Nm?($e.side=Fu,$e.needsUpdate=!0,Wt($e,Ke,Lt),$e.side=sT,$e.needsUpdate=!0,Wt($e,Ke,Lt),$e.side=Nm):Wt($e,Ke,Lt)}d=ee.get(_e),d.init(),p.push(d),_e.traverseVisible(function($e){$e.isLight&&$e.layers.test(Be.layers)&&(d.pushLight($e),$e.castShadow&&d.pushShadow($e))}),d.setupLights(g.physicallyCorrectLights),_e.traverse(function($e){const Ke=$e.material;if(Ke)if(Array.isArray(Ke))for(let Lt=0;Lt0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function xi(_e,Be,Qe,$e){if(_e.visible===!1)return;if(_e.layers.test(Be.layers)){if(_e.isGroup)Qe=_e.renderOrder;else if(_e.isLOD)_e.autoUpdate===!0&&_e.update(Be);else if(_e.isLight)d.pushLight(_e),_e.castShadow&&d.pushShadow(_e);else if(_e.isSprite){if(!_e.frustumCulled||j.intersectsSprite(_e)){$e&&H.setFromMatrixPosition(_e.matrixWorld).applyMatrix4(N);const rn=te.update(_e),Ge=_e.material;Ge.visible&&f.push(_e,rn,Ge,Qe,H.z,null)}}else if((_e.isMesh||_e.isLine||_e.isPoints)&&(_e.isSkinnedMesh&&_e.skeleton.frame!==ve.render.frame&&(_e.skeleton.update(),_e.skeleton.frame=ve.render.frame),!_e.frustumCulled||j.intersectsObject(_e))){$e&&H.setFromMatrixPosition(_e.matrixWorld).applyMatrix4(N);const rn=te.update(_e),Ge=_e.material;if(Array.isArray(Ge)){const je=rn.groups;for(let yt=0,Nt=je.length;yt0&&sn(Ke,Be,Qe),$e&&fe.viewport(_.copy($e)),Ke.length>0&&xr(Ke,Be,Qe),Lt.length>0&&xr(Lt,Be,Qe),rn.length>0&&xr(rn,Be,Qe),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function sn(_e,Be,Qe){const $e=ie.isWebGL2;z===null&&(z=new Hw(1,1,{generateMipmaps:!0,type:ne.has("EXT_color_buffer_half_float")?kI:Vw,minFilter:FW,samples:$e&&o===!0?4:0})),g.getDrawingBufferSize(B),$e?z.setSize(B.x,B.y):z.setSize(dse(B.x),dse(B.y));const Ke=g.getRenderTarget();g.setRenderTarget(z),g.clear();const Lt=g.toneMapping;g.toneMapping=nv,xr(_e,Be,Qe),g.toneMapping=Lt,ue.updateMultisampleRenderTarget(z),ue.updateRenderTargetMipmap(z),g.setRenderTarget(Ke)}function xr(_e,Be,Qe){const $e=Be.isScene===!0?Be.overrideMaterial:null;for(let Ke=0,Lt=_e.length;Ke0&&ue.useMultisampledRTT(_e)===!1?Ke=se.get(_e).__webglMultisampledFramebuffer:Ke=yt,_.copy(_e.viewport),E.copy(_e.scissor),T=_e.scissorTest}else _.copy(A).multiplyScalar(I).floor(),E.copy(L).multiplyScalar(I).floor(),T=$;if(fe.bindFramebuffer(36160,Ke)&&ie.drawBuffers&&$e&&fe.drawBuffers(_e,Ke),fe.viewport(_),fe.scissor(E),fe.setScissorTest(T),Lt){const je=se.get(_e.texture);Z.framebufferTexture2D(36160,36064,34069+Be,je.__webglTexture,Qe)}else if(rn){const je=se.get(_e.texture),yt=Be||0;Z.framebufferTextureLayer(36160,36064,je.__webglTexture,Qe||0,yt)}w=-1},this.readRenderTargetPixels=function(_e,Be,Qe,$e,Ke,Lt,rn){if(!(_e&&_e.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ge=se.get(_e).__webglFramebuffer;if(_e.isWebGLCubeRenderTarget&&rn!==void 0&&(Ge=Ge[rn]),Ge){fe.bindFramebuffer(36160,Ge);try{const je=_e.texture,yt=je.format,Nt=je.type;if(yt!==Ip&&oe.convert(yt)!==Z.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Xt=Nt===kI&&(ne.has("EXT_color_buffer_half_float")||ie.isWebGL2&&ne.has("EXT_color_buffer_float"));if(Nt!==Vw&&oe.convert(Nt)!==Z.getParameter(35738)&&!(Nt===x0&&(ie.isWebGL2||ne.has("OES_texture_float")||ne.has("WEBGL_color_buffer_float")))&&!Xt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Be>=0&&Be<=_e.width-$e&&Qe>=0&&Qe<=_e.height-Ke&&Z.readPixels(Be,Qe,$e,Ke,oe.convert(yt),oe.convert(Nt),Lt)}finally{const je=b!==null?se.get(b).__webglFramebuffer:null;fe.bindFramebuffer(36160,je)}}},this.copyFramebufferToTexture=function(_e,Be,Qe=0){const $e=Math.pow(2,-Qe),Ke=Math.floor(Be.image.width*$e),Lt=Math.floor(Be.image.height*$e);ue.setTexture2D(Be,0),Z.copyTexSubImage2D(3553,Qe,0,0,_e.x,_e.y,Ke,Lt),fe.unbindTexture()},this.copyTextureToTexture=function(_e,Be,Qe,$e=0){const Ke=Be.image.width,Lt=Be.image.height,rn=oe.convert(Qe.format),Ge=oe.convert(Qe.type);ue.setTexture2D(Qe,0),Z.pixelStorei(37440,Qe.flipY),Z.pixelStorei(37441,Qe.premultiplyAlpha),Z.pixelStorei(3317,Qe.unpackAlignment),Be.isDataTexture?Z.texSubImage2D(3553,$e,_e.x,_e.y,Ke,Lt,rn,Ge,Be.image.data):Be.isCompressedTexture?Z.compressedTexSubImage2D(3553,$e,_e.x,_e.y,Be.mipmaps[0].width,Be.mipmaps[0].height,rn,Be.mipmaps[0].data):Z.texSubImage2D(3553,$e,_e.x,_e.y,rn,Ge,Be.image),$e===0&&Qe.generateMipmaps&&Z.generateMipmap(3553),fe.unbindTexture()},this.copyTextureToTexture3D=function(_e,Be,Qe,$e,Ke=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Lt=_e.max.x-_e.min.x+1,rn=_e.max.y-_e.min.y+1,Ge=_e.max.z-_e.min.z+1,je=oe.convert($e.format),yt=oe.convert($e.type);let Nt;if($e.isData3DTexture)ue.setTexture3D($e,0),Nt=32879;else if($e.isDataArrayTexture)ue.setTexture2DArray($e,0),Nt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Z.pixelStorei(37440,$e.flipY),Z.pixelStorei(37441,$e.premultiplyAlpha),Z.pixelStorei(3317,$e.unpackAlignment);const Xt=Z.getParameter(3314),Tn=Z.getParameter(32878),Jr=Z.getParameter(3316),qo=Z.getParameter(3315),qu=Z.getParameter(32877),Dr=Qe.isCompressedTexture?Qe.mipmaps[0]:Qe.image;Z.pixelStorei(3314,Dr.width),Z.pixelStorei(32878,Dr.height),Z.pixelStorei(3316,_e.min.x),Z.pixelStorei(3315,_e.min.y),Z.pixelStorei(32877,_e.min.z),Qe.isDataTexture||Qe.isData3DTexture?Z.texSubImage3D(Nt,Ke,Be.x,Be.y,Be.z,Lt,rn,Ge,je,yt,Dr.data):Qe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Z.compressedTexSubImage3D(Nt,Ke,Be.x,Be.y,Be.z,Lt,rn,Ge,je,Dr.data)):Z.texSubImage3D(Nt,Ke,Be.x,Be.y,Be.z,Lt,rn,Ge,je,yt,Dr),Z.pixelStorei(3314,Xt),Z.pixelStorei(32878,Tn),Z.pixelStorei(3316,Jr),Z.pixelStorei(3315,qo),Z.pixelStorei(32877,qu),Ke===0&&$e.generateMipmaps&&Z.generateMipmap(Nt),fe.unbindTexture()},this.initTexture=function(_e){_e.isCubeTexture?ue.setTextureCube(_e,0):_e.isData3DTexture?ue.setTexture3D(_e,0):_e.isDataArrayTexture?ue.setTexture2DArray(_e,0):ue.setTexture2D(_e,0),fe.unbindTexture()},this.resetState=function(){v=0,y=0,b=null,fe.reset(),Ee.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class _or extends elt{}_or.prototype.isWebGL1Renderer=!0;class Cor extends Ic{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,n){return super.copy(t,n),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const n=super.toJSON(t);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),n}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}class tlt extends XL{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new yo(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const kNe=new Ne,MNe=new Ne,ANe=new Ji,TJ=new jat,H3=new $W;class Oor extends Ic{constructor(t=new jv,n=new tlt){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=n,this.updateMorphTargets()}copy(t,n){return super.copy(t,n),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const n=t.attributes.position,r=[0];for(let i=1,o=n.count;il)continue;d.applyMatrix4(this.matrixWorld);const T=t.ray.origin.distanceTo(d);Tt.far||n.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,s.start),y=Math.min(m.count,s.start+s.count);for(let b=v,w=y-1;bl)continue;d.applyMatrix4(this.matrixWorld);const _=t.ray.origin.distanceTo(d);_t.far||n.push({distance:_,point:f.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o{n&&n(o),this.manager.itemEnd(t)},0),o;if(im[t]!==void 0){im[t].push({onLoad:n,onProgress:r,onError:i});return}im[t]=[],im[t].push({onLoad:n,onProgress:r,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=im[t],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let g=0;const m=new ReadableStream({start(v){y();function y(){f.read().then(({done:b,value:w})=>{if(b)v.close();else{g+=w.byteLength;const S=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:h});for(let _=0,E=u.length;_{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{c6.add(t,c);const u=im[t];delete im[t];for(let f=0,d=u.length;f{const u=im[t];if(u===void 0)throw this.manager.itemError(t),c;delete im[t];for(let f=0,d=u.length;f{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Aor extends jW{constructor(t){super(t)}load(t,n,r,i){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const o=this,s=c6.get(t);if(s!==void 0)return o.manager.itemStart(t),setTimeout(function(){n&&n(s),o.manager.itemEnd(t)},0),s;const a=MI("img");function l(){u(),c6.add(t,this),n&&n(this),o.manager.itemEnd(t)}function c(f){u(),i&&i(f),o.manager.itemError(t),o.manager.itemEnd(t)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(t),a.src=t,a}}class Ror extends jW{constructor(t){super(t)}load(t,n,r,i){const o=new Wu,s=new Aor(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(a){o.image=a,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class DNe{constructor(t=1,n=0,r=0){return this.radius=t,this.phi=n,this.theta=r,this}set(t,n,r){return this.radius=t,this.phi=n,this.theta=r,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,n,r){return this.radius=Math.sqrt(t*t+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,r),this.phi=Math.acos(Sc(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const G3=new MP;class Ior extends Eor{constructor(t,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),o=new jv;o.setIndex(new Vf(r,1)),o.setAttribute("position",new Vf(i,3)),super(o,new tlt({color:n,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(t!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&G3.setFromObject(this.object),G3.isEmpty())return;const n=G3.min,r=G3.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,n){return super.copy(t,n),this.object=t.object,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Zme}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Zme);const LNe={type:"change"},PJ={type:"start"},FNe={type:"end"};class Dor extends NS{constructor(t,n){super(),this.object=t,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Ne,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:W_.ROTATE,MIDDLE:W_.DOLLY,RIGHT:W_.PAN},this.touches={ONE:H_.ROTATE,TWO:H_.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(oe){oe.addEventListener("keydown",Pe),this._domElementKeyEvents=oe},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(LNe),r.update(),o=i.NONE},this.update=(function(){const oe=new Ne,Ee=new Gw().setFromUnitVectors(t.up,new Ne(0,1,0)),ke=Ee.clone().invert(),ze=new Ne,De=new Gw,Ve=2*Math.PI;return function(){const mt=r.object.position;oe.copy(mt).sub(r.target),oe.applyQuaternion(Ee),a.setFromVector3(oe),r.autoRotate&&o===i.NONE&&k(E()),r.enableDamping?(a.theta+=l.theta*r.dampingFactor,a.phi+=l.phi*r.dampingFactor):(a.theta+=l.theta,a.phi+=l.phi);let Me=r.minAzimuthAngle,ct=r.maxAzimuthAngle;return isFinite(Me)&&isFinite(ct)&&(Me<-Math.PI?Me+=Ve:Me>Math.PI&&(Me-=Ve),ct<-Math.PI?ct+=Ve:ct>Math.PI&&(ct-=Ve),Me<=ct?a.theta=Math.max(Me,Math.min(ct,a.theta)):a.theta=a.theta>(Me+ct)/2?Math.max(Me,a.theta):Math.min(ct,a.theta)),a.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=c,a.radius=Math.max(r.minDistance,Math.min(r.maxDistance,a.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),oe.setFromSpherical(a),oe.applyQuaternion(ke),mt.copy(r.target).add(oe),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,u.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),u.set(0,0,0)),c=1,f||ze.distanceToSquared(r.object.position)>s||8*(1-De.dot(r.object.quaternion))>s?(r.dispatchEvent(LNe),ze.copy(r.object.position),De.copy(r.object.quaternion),f=!1,!0):!1}})(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",Se),r.domElement.removeEventListener("pointerdown",G),r.domElement.removeEventListener("pointercancel",J),r.domElement.removeEventListener("wheel",we),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",pe),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",Pe)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=i.NONE;const s=1e-6,a=new DNe,l=new DNe;let c=1;const u=new Ne;let f=!1;const d=new _r,h=new _r,p=new _r,g=new _r,m=new _r,v=new _r,y=new _r,b=new _r,w=new _r,S=[],_={};function E(){return 2*Math.PI/60/60*r.autoRotateSpeed}function T(){return Math.pow(.95,r.zoomSpeed)}function k(oe){l.theta-=oe}function P(oe){l.phi-=oe}const I=(function(){const oe=new Ne;return function(ke,ze){oe.setFromMatrixColumn(ze,0),oe.multiplyScalar(-ke),u.add(oe)}})(),R=(function(){const oe=new Ne;return function(ke,ze){r.screenSpacePanning===!0?oe.setFromMatrixColumn(ze,1):(oe.setFromMatrixColumn(ze,0),oe.crossVectors(r.object.up,oe)),oe.multiplyScalar(ke),u.add(oe)}})(),F=(function(){const oe=new Ne;return function(ke,ze){const De=r.domElement;if(r.object.isPerspectiveCamera){const Ve=r.object.position;oe.copy(Ve).sub(r.target);let Ze=oe.length();Ze*=Math.tan(r.object.fov/2*Math.PI/180),I(2*ke*Ze/De.clientHeight,r.object.matrix),R(2*ze*Ze/De.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(I(ke*(r.object.right-r.object.left)/r.object.zoom/De.clientWidth,r.object.matrix),R(ze*(r.object.top-r.object.bottom)/r.object.zoom/De.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function A(oe){r.object.isPerspectiveCamera?c/=oe:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*oe)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function L(oe){r.object.isPerspectiveCamera?c*=oe:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/oe)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function $(oe){d.set(oe.clientX,oe.clientY)}function j(oe){y.set(oe.clientX,oe.clientY)}function V(oe){g.set(oe.clientX,oe.clientY)}function U(oe){h.set(oe.clientX,oe.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const Ee=r.domElement;k(2*Math.PI*p.x/Ee.clientHeight),P(2*Math.PI*p.y/Ee.clientHeight),d.copy(h),r.update()}function z(oe){b.set(oe.clientX,oe.clientY),w.subVectors(b,y),w.y>0?A(T()):w.y<0&&L(T()),y.copy(b),r.update()}function N(oe){m.set(oe.clientX,oe.clientY),v.subVectors(m,g).multiplyScalar(r.panSpeed),F(v.x,v.y),g.copy(m),r.update()}function B(oe){oe.deltaY<0?L(T()):oe.deltaY>0&&A(T()),r.update()}function H(oe){let Ee=!1;switch(oe.code){case r.keys.UP:F(0,r.keyPanSpeed),Ee=!0;break;case r.keys.BOTTOM:F(0,-r.keyPanSpeed),Ee=!0;break;case r.keys.LEFT:F(r.keyPanSpeed,0),Ee=!0;break;case r.keys.RIGHT:F(-r.keyPanSpeed,0),Ee=!0;break}Ee&&(oe.preventDefault(),r.update())}function Q(){if(S.length===1)d.set(S[0].pageX,S[0].pageY);else{const oe=.5*(S[0].pageX+S[1].pageX),Ee=.5*(S[0].pageY+S[1].pageY);d.set(oe,Ee)}}function Y(){if(S.length===1)g.set(S[0].pageX,S[0].pageY);else{const oe=.5*(S[0].pageX+S[1].pageX),Ee=.5*(S[0].pageY+S[1].pageY);g.set(oe,Ee)}}function Z(){const oe=S[0].pageX-S[1].pageX,Ee=S[0].pageY-S[1].pageY,ke=Math.sqrt(oe*oe+Ee*Ee);y.set(0,ke)}function ge(){r.enableZoom&&Z(),r.enablePan&&Y()}function ne(){r.enableZoom&&Z(),r.enableRotate&&Q()}function ie(oe){if(S.length===1)h.set(oe.pageX,oe.pageY);else{const ke=be(oe),ze=.5*(oe.pageX+ke.x),De=.5*(oe.pageY+ke.y);h.set(ze,De)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const Ee=r.domElement;k(2*Math.PI*p.x/Ee.clientHeight),P(2*Math.PI*p.y/Ee.clientHeight),d.copy(h)}function fe(oe){if(S.length===1)m.set(oe.pageX,oe.pageY);else{const Ee=be(oe),ke=.5*(oe.pageX+Ee.x),ze=.5*(oe.pageY+Ee.y);m.set(ke,ze)}v.subVectors(m,g).multiplyScalar(r.panSpeed),F(v.x,v.y),g.copy(m)}function ve(oe){const Ee=be(oe),ke=oe.pageX-Ee.x,ze=oe.pageY-Ee.y,De=Math.sqrt(ke*ke+ze*ze);b.set(0,De),w.set(0,Math.pow(b.y/y.y,r.zoomSpeed)),A(w.y),y.copy(b)}function se(oe){r.enableZoom&&ve(oe),r.enablePan&&fe(oe)}function ue(oe){r.enableZoom&&ve(oe),r.enableRotate&&ie(oe)}function G(oe){r.enabled!==!1&&(S.length===0&&(r.domElement.setPointerCapture(oe.pointerId),r.domElement.addEventListener("pointermove",ce),r.domElement.addEventListener("pointerup",pe)),he(oe),oe.pointerType==="touch"?ee(oe):te(oe))}function ce(oe){r.enabled!==!1&&(oe.pointerType==="touch"?re(oe):ae(oe))}function pe(oe){xe(oe),S.length===0&&(r.domElement.releasePointerCapture(oe.pointerId),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",pe)),r.dispatchEvent(FNe),o=i.NONE}function J(oe){xe(oe)}function te(oe){let Ee;switch(oe.button){case 0:Ee=r.mouseButtons.LEFT;break;case 1:Ee=r.mouseButtons.MIDDLE;break;case 2:Ee=r.mouseButtons.RIGHT;break;default:Ee=-1}switch(Ee){case W_.DOLLY:if(r.enableZoom===!1)return;j(oe),o=i.DOLLY;break;case W_.ROTATE:if(oe.ctrlKey||oe.metaKey||oe.shiftKey){if(r.enablePan===!1)return;V(oe),o=i.PAN}else{if(r.enableRotate===!1)return;$(oe),o=i.ROTATE}break;case W_.PAN:if(oe.ctrlKey||oe.metaKey||oe.shiftKey){if(r.enableRotate===!1)return;$(oe),o=i.ROTATE}else{if(r.enablePan===!1)return;V(oe),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(PJ)}function ae(oe){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;U(oe);break;case i.DOLLY:if(r.enableZoom===!1)return;z(oe);break;case i.PAN:if(r.enablePan===!1)return;N(oe);break}}function we(oe){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(oe.preventDefault(),r.dispatchEvent(PJ),B(oe),r.dispatchEvent(FNe))}function Pe(oe){r.enabled===!1||r.enablePan===!1||H(oe)}function ee(oe){switch(me(oe),S.length){case 1:switch(r.touches.ONE){case H_.ROTATE:if(r.enableRotate===!1)return;Q(),o=i.TOUCH_ROTATE;break;case H_.PAN:if(r.enablePan===!1)return;Y(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case H_.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ge(),o=i.TOUCH_DOLLY_PAN;break;case H_.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ne(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(PJ)}function re(oe){switch(me(oe),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ie(oe),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;fe(oe),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(oe),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ue(oe),r.update();break;default:o=i.NONE}}function Se(oe){r.enabled!==!1&&oe.preventDefault()}function he(oe){S.push(oe)}function xe(oe){delete _[oe.pointerId];for(let Ee=0;Ee>>1|(co&21845)<<1;My=(My&52428)>>>2|(My&13107)<<2,My=(My&61680)>>>4|(My&3855)<<4,_ae[co]=((My&65280)>>>8|(My&255)<<8)>>>1}var TA=(function(e,t,n){for(var r=e.length,i=0,o=new T1(t);i>>l]=c}else for(a=new T1(r),i=0;i>>15-e[i]);return a}),cF=new _u(288);for(var co=0;co<144;++co)cF[co]=8;for(var co=144;co<256;++co)cF[co]=9;for(var co=256;co<280;++co)cF[co]=7;for(var co=280;co<288;++co)cF[co]=8;var Cut=new _u(32);for(var co=0;co<32;++co)Cut[co]=5;var Vlr=TA(cF,9,1),Wlr=TA(Cut,5,1),Iee=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},Id=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Dee=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Hlr=function(e){return(e+7)/8|0},Glr=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?T1:e.BYTES_PER_ELEMENT==4?yut:_u)(n-t);return r.set(e.subarray(t,n)),r},qlr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ym=function(e,t,n){var r=new Error(t||qlr[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,ym),!n)throw r;return r},Xlr=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new _u(0);var i=!t||n,o=!n||n.i;n||(n={}),t||(t=new _u(r*3));var s=function(Z){var pe=t.length;if(Z>pe){var ie=new _u(Math.max(pe*2,Z));ie.set(t),t=ie}},a=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,d=n.m,h=n.n,p=r*8;do{if(!u){a=Id(e,l,1);var g=Id(e,l+1,3);if(l+=3,g)if(g==1)u=Vlr,f=Wlr,d=9,h=5;else if(g==2){var b=Id(e,l,31)+257,w=Id(e,l+10,15)+4,S=b+Id(e,l+5,31)+1;l+=14;for(var _=new _u(S),E=new _u(19),T=0;T>>4;if(m<16)_[T++]=m;else{var F=0,A=0;for(m==16?(A=3+Id(e,l,3),l+=2,F=_[T-1]):m==17?(A=3+Id(e,l,7),l+=3):m==18&&(A=11+Id(e,l,127),l+=7);A--;)_[T++]=F}}var L=_.subarray(0,b),$=_.subarray(b);d=Iee(L),h=Iee($),u=TA(L,d,1),f=TA($,h,1)}else ym(1);else{var m=Hlr(l)+4,v=e[m-4]|e[m-3]<<8,y=m+v;if(y>r){o&&ym(0);break}i&&s(c+v),t.set(e.subarray(m,y),c),n.b=c+=v,n.p=l=y*8,n.f=a;continue}if(l>p){o&&ym(0);break}}i&&s(c+131072);for(var j=(1<>>4;if(l+=F&15,l>p){o&&ym(0);break}if(F||ym(2),z<256)t[c++]=z;else if(z==256){U=l,u=null;break}else{var N=z-254;if(z>264){var T=z-257,B=but[T];N=Id(e,l,(1<>>4;H||ym(3),l+=H&15;var $=Ulr[Q];if(Q>3){var B=xut[Q];$+=Dee(e,l)&(1<p){o&&ym(0);break}i&&s(c+131072);for(var Y=c+N;c>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},Klr=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0};function Zlr(e,t){return Xlr(e.subarray(Qlr(e),-8),new _u(Klr(e)))}var Jlr=typeof TextDecoder<"u"&&new TextDecoder,ecr=0;try{Jlr.decode(Ylr,{stream:!0}),ecr=1}catch{}class tcr{constructor(t,n,r){const i=this;this.volume=t,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(a){return n=a,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new Wu(this.canvas);o.minFilter=Cc,o.wrapS=o.wrapT=wf;const s=new oye({map:o,side:Um,transparent:!0});this.mesh=new Lp(this.geometry,s),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const t=this.iLength,n=this.jLength,r=this.sliceAccess,i=this.volume,o=this.canvasBuffer,s=this.ctxBuffer,a=s.getImageData(0,0,t,n),l=a.data,c=i.data,u=i.upperThreshold,f=i.lowerThreshold,d=i.windowLow,h=i.windowHigh;let p=0;if(i.dataType==="label")for(let g=0;g=this.colorMap.length?v%this.colorMap.length+1:v;const y=this.colorMap[v];l[4*p]=y>>24&255,l[4*p+1]=y>>16&255,l[4*p+2]=y>>8&255,l[4*p+3]=y&255,p++}else for(let g=0;g=v&&f<=v?y:0,v=Math.floor(255*(v-d)/(h-d)),v=v>255?255:v<0?0:v|0,l[4*p]=v,l[4*p+1]=v,l[4*p+2]=v,l[4*p+3]=y,p++}s.putImageData(a,0,0),this.ctx.drawImage(o,0,0,t,n,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const t=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=t.sliceAccess,this.jLength=t.jLength,this.iLength=t.iLength,this.matrix=t.matrix,this.canvas.width=t.planeWidth,this.canvas.height=t.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new lH(t.planeWidth,t.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class ncr{constructor(t,n,r,i,o){if(t!==void 0){switch(this.xLength=Number(t)||1,this.yLength=Number(n)||1,this.zLength=Number(r)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(o);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(o);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(o);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(o);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(o);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(o);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(o);break;case"Float64":case"float64":case"double":this.data=new Float64Array(o);break;default:this.data=new Uint8Array(o)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new Pu,this.matrix.identity();let s=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let a=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return a},set:function(l){a=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}}),this.sliceList=[]}getData(t,n,r){return this.data[r*this.xLength*this.yLength+n*this.xLength+t]}access(t,n,r){return r*this.xLength*this.yLength+n*this.xLength+t}reverseAccess(t){const n=Math.floor(t/(this.yLength*this.xLength)),r=Math.floor((t-n*this.yLength*this.xLength)/this.xLength);return[t-n*this.yLength*this.xLength-r*this.xLength,r,n]}map(t,n){const r=this.data.length;n=n||this;for(let i=0;i.9}),b=[l,c,a].find(function(_){return Math.abs(_.dot(v[1]))>.9}),w=[l,c,a].find(function(_){return Math.abs(_.dot(v[2]))>.9});function S(_,E){const T=y===a?s:y.arglet==="i"?_:E,k=b===a?s:b.arglet==="i"?_:E,P=w===a?s:w.arglet==="i"?_:E,R=y.dot(v[0])>0?T:f.xLength-1-T,I=b.dot(v[1])>0?k:f.yLength-1-k,F=w.dot(v[2])>0?P:f.zLength-1-P;return f.access(R,I,F)}return{iLength:h,jLength:p,sliceAccess:S,matrix:u,planeWidth:g,planeHeight:m}}extractSlice(t,n){const r=new tcr(this,n,t);return this.sliceList.push(r),r}repaintAllSlices(){return this.sliceList.forEach(function(t){t.repaint()}),this}computeMinMax(){let t=1/0,n=-1/0;const r=this.data.length;let i=0;for(i=0;i0,o=!0,s={};function a(T,k){k==null&&(k=1);let P=1,R=Uint8Array;switch(T){case"uchar":break;case"schar":R=Int8Array;break;case"ushort":R=Uint16Array,P=2;break;case"sshort":R=Int16Array,P=2;break;case"uint":R=Uint32Array,P=4;break;case"sint":R=Int32Array,P=4;break;case"float":R=Float32Array,P=4;break;case"complex":R=Float64Array,P=8;break;case"double":R=Float64Array,P=8;break}let I=new R(n.slice(r,r+=k*P));return i!==o&&(I=l(I,P)),k===1?I[0]:I}function l(T,k){const P=new Uint8Array(T.buffer,T.byteOffset,T.byteLength);for(let R=0;RF;I--,F++){const A=P[F];P[F]=P[I],P[I]=A}return T}function c(T){let k,P,R,I,F,A,L,$;const j=T.split(/\r?\n/);for(L=0,$=j.length;L<$;L++)F=j[L],F.match(/NRRD\d+/)?s.isNrrd=!0:!F.match(/^#/)&&(A=F.match(/(.*):(.*)/))&&(P=A[1].trim(),k=A[2].trim(),R=icr[P],R?R.call(s,k):s[P]=k);if(!s.isNrrd)throw new Error("Not an NRRD file");if(s.encoding==="bz2"||s.encoding==="bzip2")throw new Error("Bzip is not supported");if(!s.vectors&&(s.vectors=[],s.vectors.push([1,0,0]),s.vectors.push([0,1,0]),s.vectors.push([0,0,1]),s.spacings)){for(I=0;I<=2;I++)if(!isNaN(s.spacings[I]))for(let V=0;V<=2;V++)s.vectors[I][V]*=s.spacings[I]}}function u(T,k,P){let R="";k=k||0,P=P||T.length;let I;const F=s.sizes.reduce(function(V,U){return V*U},1);let A=10;s.encoding==="hex"&&(A=16);const L=new s.__array(F);let $=0,j=parseInt;(s.__array===Float32Array||s.__array===Float64Array)&&(j=parseFloat);for(let V=k;V13)&&I!==32?R+=String.fromCharCode(I):(R!==""&&(L[$]=j(R,A),$++),R="");return R!==""&&(L[$]=j(R,A),$++),L}const f=a("uchar",t.byteLength),d=f.length;let h=null,p=0,g;for(g=1;gI[0]!==0),k=s.vectors.findIndex(I=>I[1]!==0),P=s.vectors.findIndex(I=>I[2]!==0),R=[];R[T]="x",R[k]="y",R[P]="z",m.axisOrder=R}else m.axisOrder=["x","y","z"];const w=new Ne().fromArray(s.vectors[0]).length(),S=new Ne().fromArray(s.vectors[1]).length(),_=new Ne().fromArray(s.vectors[2]).length();m.spacing=[w,S,_],m.matrix=new Zi;const E=new Zi;if(s.space==="left-posterior-superior"?E.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):s.space==="left-anterior-superior"&&E.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!s.vectors)m.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const T=s.vectors,k=new Zi().set(T[0][0],T[1][0],T[2][0],0,T[0][1],T[1][1],T[2][1],0,T[0][2],T[1][2],T[2][2],0,0,0,0,1);m.matrix=new Zi().multiplyMatrices(k,E)}return m.inverseMatrix=new Zi,m.inverseMatrix.copy(m.matrix).invert(),m.RASDimensions=new Ne(m.xLength,m.yLength,m.zLength).applyMatrix4(m.matrix).round().toArray().map(Math.abs),m.lowerThreshold===-1/0&&(m.lowerThreshold=y),m.upperThreshold===1/0&&(m.upperThreshold=b),m}parseChars(t,n,r){n===void 0&&(n=0),r===void 0&&(r=t.length);let i="",o;for(o=n;o{t.setVolume(u,PA.getVolumeOptions(this.props)),Lee[o]=u,s(o,{status:"ok"})},()=>{},u=>{u.response instanceof Response?u.response.json().then(f=>{const d=f.error,h=!!d&&d.message;d&&d.exception&&console.debug("exception:",d.exception),s(o,{status:"error",message:h||`${u}`})}):s(o,{status:"error",message:`${u}`})})}}}render(){const{volumeId:t}=this.props;let n,r;if(!t)n=[O.jsx(yn,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),O.jsx(yn,{variant:"body2",children:"To display a volume, a variable and a place that represents an area must be selected. Please note that the 3D volume rendering is still an experimental feature."},"body2")];else{const i=this.props.volumeStates[t];(!i||i.status==="error"||!Lee[t])&&(r=[O.jsx(ji,{onClick:this.handleLoadVolume,disabled:!!i&&i.status==="loading",children:Ce.get("Load Volume Data")},"load"),O.jsx(yn,{variant:"body2",children:Ce.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),i&&(i.status==="loading"?n=O.jsx(Eh,{style:{margin:10}}):i.status==="error"&&(n=O.jsx(yn,{variant:"body2",color:"red",children:`Failed loading volume: ${i.message}`})))}return n&&(n=O.jsx("div",{style:jze,children:n})),r&&(r=O.jsx("div",{style:jze,children:r})),O.jsxs("div",{style:lcr,children:[r,n,O.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:ocr}),!n&&!r&&acr]})}updateVolumeScene(){const t=this.canvasRef.current;if(t===null){this.volumeScene=null;return}let n;this.props.volumeId&&(n=Lee[this.props.volumeId]);let r=!1;(this.volumeScene===null||this.volumeScene.canvas!==t)&&(this.volumeScene=new Nlr(t),r=!0),r&&n?this.volumeScene.setVolume(n,PA.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(PA.getVolumeOptions(this.props))}}function Bze(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of e){const s=o[0],a=o[1];t=Math.min(t,s),n=Math.min(n,a),r=Math.max(r,s),i=Math.max(i,a)}return[t,n,r,i]}function ccr(e){let[t,n,r,i]=e[0];for(const o of e.slice(1))t=Math.min(t,o[0]),n=Math.min(n,o[1]),r=Math.max(r,o[2]),i=Math.max(i,o[3]);return[t,n,r,i]}const R6={card:{maxWidth:"100%",marginBottom:1,marginRight:1},cardContent:{padding:.1},isoTextField:{marginLeft:1,flexGrow:1},isoSlider:{minWidth:100}},ucr=({selectedDataset:e,selectedVariable:t,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:s,volumeStates:a,updateVolumeState:l,updateVariableVolume:c,serverUrl:u})=>{let f=.5;t&&(typeof t.volumeIsoThreshold=="number"?f=t.volumeIsoThreshold:f=.5*(t.colorBarMin+t.colorBarMax),typeof t.volumeRenderMode=="string"&&(o=t.volumeRenderMode));const d=p=>{c(e.id,t.name,r,o,p)},h=(p,g)=>{g!==null&&(s(g),t&&c(e.id,t.name,r,g,f))};return O.jsxs(jbt,{sx:R6.card,children:[O.jsx(Wbt,{disableSpacing:!0,children:t&&O.jsxs(O.Fragment,{children:[O.jsxs(rD,{size:"small",exclusive:!0,value:o,onChange:h,children:[O.jsx(oo,{value:"mip",size:"small",children:O.jsx(_n,{arrow:!0,title:"Maximum intensity projection",children:O.jsx("span",{children:"MIP"})})},"mip"),O.jsx(oo,{value:"aip",size:"small",children:O.jsx(_n,{arrow:!0,title:"Average intensity projection",children:O.jsx("span",{children:"AIP"})})},"aip"),O.jsx(oo,{value:"iso",size:"small",children:O.jsx(_n,{arrow:!0,title:"Iso-surface extraction",children:O.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&O.jsx(fcr,{minValue:t.colorBarMin,maxValue:t.colorBarMax,value:f,setValue:d})]})}),O.jsx(Yje,{sx:R6.cardContent,children:O.jsx(PA,{selectedDataset:e,selectedVariable:t,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:a,updateVolumeState:l,serverUrl:u})})]})},fcr=({value:e,minValue:t,maxValue:n,setValue:r,disabled:i})=>{const[o,s]=Te.useState(e),[a,l]=Te.useState(""+e),[c,u]=Te.useState(null);function f(g){const m=g.target.value||"";l(m);const v=parseFloat(m);Number.isNaN(v)?u("Not a number"):vn?u("Out of range"):u(null)}function d(g){if(g.key==="Enter"&&!c){const m=parseFloat(a);s(m),r(m)}}function h(g,m){s(m),l(m.toFixed(2))}function p(g,m){r(m)}return O.jsx(Ri,{sx:R6.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:a,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:O.jsx(oS,{size:"small",sx:R6.isoSlider,min:t,max:n,value:o,step:(n-t)/20,onChange:h,onChangeCommitted:p})}})},dcr=e=>({locale:e.controlState.locale,selectedDataset:Co(e),selectedVariable:nc(e),selectedPlaceInfo:ED(e),variableColorBar:wce(e),volumeRenderMode:e.controlState.volumeRenderMode,volumeId:NLt(e),volumeStates:e.controlState.volumeStates,serverUrl:Vo(e).url}),hcr={setVolumeRenderMode:EEn,updateVolumeState:TEn,updateVariableVolume:rEn},pcr=dr(dcr,hcr)(ucr),gcr=e=>{const t=On.instance.branding.allow3D===!1;return[{id:"details",title:Ce.get("Details"),icon:O.jsx(p3n,{}),content:O.jsx(G8n,{})},{id:"timeSeries",title:Ce.get("Time-Series"),icon:O.jsx(g3n,{}),content:O.jsx(gnr,{})},{id:"stats",title:Ce.get("Statistics"),icon:O.jsx(Cnt,{}),content:O.jsx(knr,{})},{id:"volume",title:Ce.get("Volume"),icon:O.jsx(m3n,{}),content:O.jsx(pcr,{}),hidden:t}]},mcr=e=>({locale:e.controlState.locale,sidebarPanelId:e.controlState.sidePanelId}),vcr={setSidebarPanelId:ome};function ycr({locale:e,sidebarPanelId:t,setSidebarPanelId:n}){const r=QUe(),i=M.useMemo(()=>r.panels||[],[r]),o=M.useMemo(()=>i.map((c,u)=>({...c.container,id:c.name,content:O.jsx(v3n,{contribution:c,panelIndex:u},c.name)})),[i]),s=M.useMemo(()=>{const c=new Map;return o.forEach((u,f)=>{c.set(u.id,f)}),c},[o]);M.useEffect(()=>{if(t&&s.has(t)){const c=s.get(t);o[c].componentRequested||D$t("panels",c,{componentRequested:!0},!0)}},[t,o,s]);const a=M.useMemo(()=>gcr(),[e]),l=M.useMemo(()=>[...a,...o],[a,o]);return O.jsx(T3n,{panels:l,selectedPanelId:t,setSelectedPanelId:n})}const Uze=dr(mcr,vcr)(ycr);function bcr(e,t){const n=M.useRef();M.useEffect(()=>{const r=new ResizeObserver(i=>{for(const o of i)if(o.contentRect){const s=o.contentRect.width,a=o.contentRect.height,l=n.current;if(!l||l.width!==s||l.height!==a){const c={width:s,height:a};n.current=c,l&&e(c)}}});return r.observe(document.documentElement),()=>r.disconnect()},[e,t])}const gC={containerHor:{flexGrow:1,overflow:"hidden"},containerVer:{flexGrow:1,overflowX:"hidden",overflowY:"auto"},noSplitHor:{display:"flex",flexDirection:"row",height:"100%"},noSplitVer:{display:"flex",flexDirection:"column"},viewer:{overflow:"hidden",width:"100%",height:"100%"},sidebarAlone:{flexGrow:0}},xcr=e=>({sidePanelOpen:e.controlState.sidePanelOpen,sidePanelId:e.controlState.sidePanelId,sidePanelSize:e.controlState.sidePanelSize}),wcr={updateSidePanelSize:OEn},Vze=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function Scr({sidePanelOpen:e,sidePanelId:t,sidePanelSize:n,updateSidePanelSize:r}){const[i,o]=M.useState(null),[s,a]=M.useState(Vze()),l=is();M.useEffect(()=>{c()},[]),bcr(()=>{c()}),M.useEffect(()=>{i&&i.updateSize()},[i,n]);const c=()=>{a(Vze())};return e?t?O.jsxs(qFn,{dir:s,childPos:"last",childSize:n,updateChildSize:r,style:s==="hor"?gC.containerHor:gC.containerVer,children:[O.jsx(OY,{onMapRef:o,theme:l}),O.jsx(Uze,{})]}):O.jsxs(bt,{sx:s==="hor"?gC.noSplitHor:gC.noSplitVer,children:[O.jsx(OY,{onMapRef:o,theme:l}),O.jsx("div",{style:gC.sidebarAlone,children:O.jsx(Uze,{})})]}):O.jsx("div",{style:gC.viewer,children:O.jsx(OY,{onMapRef:o,theme:l})})}const _cr=dr(xcr,wcr)(Scr);var $2={exports:{}},Fee={},pz={exports:{}},Wze;function Ccr(){if(Wze)return pz.exports;Wze=1;function e(n){var r,i,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(r=0;r0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const s=window.document?.documentElement?.style;if(!s||o in s)return"";for(let a=0;aT===k.identifier)||E.changedTouches&&(0,e.findInArray)(E.changedTouches,k=>T===k.identifier)}function v(E){if(E.targetTouches&&E.targetTouches[0])return E.targetTouches[0].identifier;if(E.changedTouches&&E.changedTouches[0])return E.changedTouches[0].identifier}function y(E){if(!E)return;let T=E.getElementById("react-draggable-style-el");T||(T=E.createElement("style"),T.type="text/css",T.id="react-draggable-style-el",T.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} + }`};function For(){try{const e=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&e.getContext("webgl2"))}catch{return!1}}class $or{textures;constructor(){this.textures={}}get(t,n){const r=j5(t);let i=this.textures[r];return i||(i=new Ror().load(`data:image/png;base64,${t.imageData}`,n),this.textures[r]=i),i}}const Nor=new $or;class zor{canvas;camera;renderer;scene;material;constructor(t){if(!For())throw new Error("Missing WebGL2");this.render=this.render.bind(this);const n=new elt({canvas:t});n.setPixelRatio(window.devicePixelRatio),n.setSize(t.clientWidth,t.clientHeight);const r=100,i=t.clientWidth/t.clientHeight,o=new Yat(-r*i,r*i,r,-r,-1e3,1e3);o.position.set(0,0,100),o.up.set(0,1,0);const s=new Dor(o,n.domElement);s.target.set(100,50,0),s.minZoom=.1,s.maxZoom=500,s.enablePan=!0,s.update(),this.canvas=t,this.renderer=n,this.camera=o,this.scene=null,this.material=null,s.addEventListener("change",this.render),t.addEventListener("resize",this.onCanvasResize)}setVolume(t,n){const r=new zat(t.data,t.xLength,t.yLength,t.zLength);r.format=Iat,r.type=x0,r.minFilter=r.magFilter=wc,r.unpackAlignment=1,r.needsUpdate=!0;const i=Lor,o=Wat.clone(i.uniforms),[s,a,l]=t.spacing,c=Math.floor(s*t.xLength),u=Math.floor(a*t.yLength),f=Math.floor(l*t.zLength);o.u_data.value=r,o.u_size.value.set(c,u,f);const d=new pb({uniforms:o,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Fu}),h=new AP(c,u,f);h.translate(c/2,u/2,f/2);const p=new Dp(h,d),g=new Cor;g.add(p),g.add(new Ior(p)),this.scene=g,this.material=d,this.setVolumeOptions(n)}setVolumeOptions(t){const n=this.material;if(n!==null){const{value1:r,value2:i,isoThreshold:o,renderMode:s,colorBar:a}=t,l=n.uniforms;l.u_clim.value.set(r,i),l.u_renderthreshold.value=o,l.u_renderstyle.value=s==="mip"?0:s==="aip"?1:2,l.u_cmdata.value=Nor.get(a,this.render),this.render()}}getMaterial(){if(this.material===null)throw new Error("Volume not set!");return this.material}onCanvasResize(){console.warn("Alarm: Canvas resize!");const t=this.renderer.domElement;this.renderer.setSize(t.clientWidth,t.clientHeight);const n=t.clientWidth/t.clientHeight,r=this.camera.top-this.camera.bottom;this.camera.left=-r*n/2,this.camera.right=r*n/2,this.camera.updateProjectionMatrix(),this.render()}render(){this.scene!==null&&this.renderer.render(this.scene,this.camera)}}var Su=Uint8Array,b1=Uint16Array,nlt=Uint32Array,rlt=new Su([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ilt=new Su([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jor=new Su([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),olt=function(e,t){for(var n=new b1(31),r=0;r<31;++r)n[r]=t+=1<>>1|(co&21845)<<1;Ey=(Ey&52428)>>>2|(Ey&13107)<<2,Ey=(Ey&61680)>>>4|(Ey&3855)<<4,pse[co]=((Ey&65280)>>>8|(Ey&255)<<8)>>>1}var mA=(function(e,t,n){for(var r=e.length,i=0,o=new b1(t);i>>l]=c}else for(a=new b1(r),i=0;i>>15-e[i]);return a}),YL=new Su(288);for(var co=0;co<144;++co)YL[co]=8;for(var co=144;co<256;++co)YL[co]=9;for(var co=256;co<280;++co)YL[co]=7;for(var co=280;co<288;++co)YL[co]=8;var llt=new Su(32);for(var co=0;co<32;++co)llt[co]=5;var Wor=mA(YL,9,1),Hor=mA(llt,5,1),kJ=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},Ad=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},MJ=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Gor=function(e){return(e+7)/8|0},qor=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?b1:e.BYTES_PER_ELEMENT==4?nlt:Su)(n-t);return r.set(e.subarray(t,n)),r},Xor=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],gm=function(e,t,n){var r=new Error(t||Xor[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,gm),!n)throw r;return r},Yor=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new Su(0);var i=!t||n,o=!n||n.i;n||(n={}),t||(t=new Su(r*3));var s=function(Z){var ge=t.length;if(Z>ge){var ne=new Su(Math.max(ge*2,Z));ne.set(t),t=ne}},a=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,d=n.m,h=n.n,p=r*8;do{if(!u){a=Ad(e,l,1);var g=Ad(e,l+1,3);if(l+=3,g)if(g==1)u=Wor,f=Hor,d=9,h=5;else if(g==2){var b=Ad(e,l,31)+257,w=Ad(e,l+10,15)+4,S=b+Ad(e,l+5,31)+1;l+=14;for(var _=new Su(S),E=new Su(19),T=0;T>>4;if(m<16)_[T++]=m;else{var F=0,A=0;for(m==16?(A=3+Ad(e,l,3),l+=2,F=_[T-1]):m==17?(A=3+Ad(e,l,7),l+=3):m==18&&(A=11+Ad(e,l,127),l+=7);A--;)_[T++]=F}}var L=_.subarray(0,b),$=_.subarray(b);d=kJ(L),h=kJ($),u=mA(L,d,1),f=mA($,h,1)}else gm(1);else{var m=Gor(l)+4,v=e[m-4]|e[m-3]<<8,y=m+v;if(y>r){o&&gm(0);break}i&&s(c+v),t.set(e.subarray(m,y),c),n.b=c+=v,n.p=l=y*8,n.f=a;continue}if(l>p){o&&gm(0);break}}i&&s(c+131072);for(var j=(1<>>4;if(l+=F&15,l>p){o&&gm(0);break}if(F||gm(2),z<256)t[c++]=z;else if(z==256){U=l,u=null;break}else{var N=z-254;if(z>264){var T=z-257,B=rlt[T];N=Ad(e,l,(1<>>4;H||gm(3),l+=H&15;var $=Vor[Q];if(Q>3){var B=ilt[Q];$+=MJ(e,l)&(1<p){o&&gm(0);break}i&&s(c+131072);for(var Y=c+N;c>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},Zor=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0};function Jor(e,t){return Yor(e.subarray(Kor(e),-8),new Su(Zor(e)))}var esr=typeof TextDecoder<"u"&&new TextDecoder,tsr=0;try{esr.decode(Qor,{stream:!0}),tsr=1}catch{}class nsr{constructor(t,n,r){const i=this;this.volume=t,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(a){return n=a,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new Wu(this.canvas);o.minFilter=wc,o.wrapS=o.wrapT=xf;const s=new Jme({map:o,side:Nm,transparent:!0});this.mesh=new Dp(this.geometry,s),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const t=this.iLength,n=this.jLength,r=this.sliceAccess,i=this.volume,o=this.canvasBuffer,s=this.ctxBuffer,a=s.getImageData(0,0,t,n),l=a.data,c=i.data,u=i.upperThreshold,f=i.lowerThreshold,d=i.windowLow,h=i.windowHigh;let p=0;if(i.dataType==="label")for(let g=0;g=this.colorMap.length?v%this.colorMap.length+1:v;const y=this.colorMap[v];l[4*p]=y>>24&255,l[4*p+1]=y>>16&255,l[4*p+2]=y>>8&255,l[4*p+3]=y&255,p++}else for(let g=0;g=v&&f<=v?y:0,v=Math.floor(255*(v-d)/(h-d)),v=v>255?255:v<0?0:v|0,l[4*p]=v,l[4*p+1]=v,l[4*p+2]=v,l[4*p+3]=y,p++}s.putImageData(a,0,0),this.ctx.drawImage(o,0,0,t,n,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const t=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=t.sliceAccess,this.jLength=t.jLength,this.iLength=t.iLength,this.matrix=t.matrix,this.canvas.width=t.planeWidth,this.canvas.height=t.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new NW(t.planeWidth,t.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class rsr{constructor(t,n,r,i,o){if(t!==void 0){switch(this.xLength=Number(t)||1,this.yLength=Number(n)||1,this.zLength=Number(r)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(o);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(o);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(o);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(o);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(o);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(o);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(o);break;case"Float64":case"float64":case"double":this.data=new Float64Array(o);break;default:this.data=new Uint8Array(o)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new Pu,this.matrix.identity();let s=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let a=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return a},set:function(l){a=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}}),this.sliceList=[]}getData(t,n,r){return this.data[r*this.xLength*this.yLength+n*this.xLength+t]}access(t,n,r){return r*this.xLength*this.yLength+n*this.xLength+t}reverseAccess(t){const n=Math.floor(t/(this.yLength*this.xLength)),r=Math.floor((t-n*this.yLength*this.xLength)/this.xLength);return[t-n*this.yLength*this.xLength-r*this.xLength,r,n]}map(t,n){const r=this.data.length;n=n||this;for(let i=0;i.9}),b=[l,c,a].find(function(_){return Math.abs(_.dot(v[1]))>.9}),w=[l,c,a].find(function(_){return Math.abs(_.dot(v[2]))>.9});function S(_,E){const T=y===a?s:y.arglet==="i"?_:E,k=b===a?s:b.arglet==="i"?_:E,P=w===a?s:w.arglet==="i"?_:E,I=y.dot(v[0])>0?T:f.xLength-1-T,R=b.dot(v[1])>0?k:f.yLength-1-k,F=w.dot(v[2])>0?P:f.zLength-1-P;return f.access(I,R,F)}return{iLength:h,jLength:p,sliceAccess:S,matrix:u,planeWidth:g,planeHeight:m}}extractSlice(t,n){const r=new nsr(this,n,t);return this.sliceList.push(r),r}repaintAllSlices(){return this.sliceList.forEach(function(t){t.repaint()}),this}computeMinMax(){let t=1/0,n=-1/0;const r=this.data.length;let i=0;for(i=0;i0,o=!0,s={};function a(T,k){k==null&&(k=1);let P=1,I=Uint8Array;switch(T){case"uchar":break;case"schar":I=Int8Array;break;case"ushort":I=Uint16Array,P=2;break;case"sshort":I=Int16Array,P=2;break;case"uint":I=Uint32Array,P=4;break;case"sint":I=Int32Array,P=4;break;case"float":I=Float32Array,P=4;break;case"complex":I=Float64Array,P=8;break;case"double":I=Float64Array,P=8;break}let R=new I(n.slice(r,r+=k*P));return i!==o&&(R=l(R,P)),k===1?R[0]:R}function l(T,k){const P=new Uint8Array(T.buffer,T.byteOffset,T.byteLength);for(let I=0;IF;R--,F++){const A=P[F];P[F]=P[R],P[R]=A}return T}function c(T){let k,P,I,R,F,A,L,$;const j=T.split(/\r?\n/);for(L=0,$=j.length;L<$;L++)F=j[L],F.match(/NRRD\d+/)?s.isNrrd=!0:!F.match(/^#/)&&(A=F.match(/(.*):(.*)/))&&(P=A[1].trim(),k=A[2].trim(),I=osr[P],I?I.call(s,k):s[P]=k);if(!s.isNrrd)throw new Error("Not an NRRD file");if(s.encoding==="bz2"||s.encoding==="bzip2")throw new Error("Bzip is not supported");if(!s.vectors&&(s.vectors=[],s.vectors.push([1,0,0]),s.vectors.push([0,1,0]),s.vectors.push([0,0,1]),s.spacings)){for(R=0;R<=2;R++)if(!isNaN(s.spacings[R]))for(let V=0;V<=2;V++)s.vectors[R][V]*=s.spacings[R]}}function u(T,k,P){let I="";k=k||0,P=P||T.length;let R;const F=s.sizes.reduce(function(V,U){return V*U},1);let A=10;s.encoding==="hex"&&(A=16);const L=new s.__array(F);let $=0,j=parseInt;(s.__array===Float32Array||s.__array===Float64Array)&&(j=parseFloat);for(let V=k;V13)&&R!==32?I+=String.fromCharCode(R):(I!==""&&(L[$]=j(I,A),$++),I="");return I!==""&&(L[$]=j(I,A),$++),L}const f=a("uchar",t.byteLength),d=f.length;let h=null,p=0,g;for(g=1;gR[0]!==0),k=s.vectors.findIndex(R=>R[1]!==0),P=s.vectors.findIndex(R=>R[2]!==0),I=[];I[T]="x",I[k]="y",I[P]="z",m.axisOrder=I}else m.axisOrder=["x","y","z"];const w=new Ne().fromArray(s.vectors[0]).length(),S=new Ne().fromArray(s.vectors[1]).length(),_=new Ne().fromArray(s.vectors[2]).length();m.spacing=[w,S,_],m.matrix=new Ji;const E=new Ji;if(s.space==="left-posterior-superior"?E.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):s.space==="left-anterior-superior"&&E.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!s.vectors)m.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const T=s.vectors,k=new Ji().set(T[0][0],T[1][0],T[2][0],0,T[0][1],T[1][1],T[2][1],0,T[0][2],T[1][2],T[2][2],0,0,0,0,1);m.matrix=new Ji().multiplyMatrices(k,E)}return m.inverseMatrix=new Ji,m.inverseMatrix.copy(m.matrix).invert(),m.RASDimensions=new Ne(m.xLength,m.yLength,m.zLength).applyMatrix4(m.matrix).round().toArray().map(Math.abs),m.lowerThreshold===-1/0&&(m.lowerThreshold=y),m.upperThreshold===1/0&&(m.upperThreshold=b),m}parseChars(t,n,r){n===void 0&&(n=0),r===void 0&&(r=t.length);let i="",o;for(o=n;o{t.setVolume(u,vA.getVolumeOptions(this.props)),AJ[o]=u,s(o,{status:"ok"})},()=>{},u=>{u.response instanceof Response?u.response.json().then(f=>{const d=f.error,h=!!d&&d.message;d&&d.exception&&console.debug("exception:",d.exception),s(o,{status:"error",message:h||`${u}`})}):s(o,{status:"error",message:`${u}`})})}}}render(){const{volumeId:t}=this.props;let n,r;if(!t)n=[O.jsx(mn,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),O.jsx(mn,{variant:"body2",children:"To display a volume, a variable and a place that represents an area must be selected. Please note that the 3D volume rendering is still an experimental feature."},"body2")];else{const i=this.props.volumeStates[t];(!i||i.status==="error"||!AJ[t])&&(r=[O.jsx(zi,{onClick:this.handleLoadVolume,disabled:!!i&&i.status==="loading",children:Ce.get("Load Volume Data")},"load"),O.jsx(mn,{variant:"body2",children:Ce.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),i&&(i.status==="loading"?n=O.jsx(Ch,{style:{margin:10}}):i.status==="error"&&(n=O.jsx(mn,{variant:"body2",color:"red",children:`Failed loading volume: ${i.message}`})))}return n&&(n=O.jsx("div",{style:$Ne,children:n})),r&&(r=O.jsx("div",{style:$Ne,children:r})),O.jsxs("div",{style:csr,children:[r,n,O.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:ssr}),!n&&!r&&lsr]})}updateVolumeScene(){const t=this.canvasRef.current;if(t===null){this.volumeScene=null;return}let n;this.props.volumeId&&(n=AJ[this.props.volumeId]);let r=!1;(this.volumeScene===null||this.volumeScene.canvas!==t)&&(this.volumeScene=new zor(t),r=!0),r&&n?this.volumeScene.setVolume(n,vA.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(vA.getVolumeOptions(this.props))}}function NNe(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of e){const s=o[0],a=o[1];t=Math.min(t,s),n=Math.min(n,a),r=Math.max(r,s),i=Math.max(i,a)}return[t,n,r,i]}function usr(e){let[t,n,r,i]=e[0];for(const o of e.slice(1))t=Math.min(t,o[0]),n=Math.min(n,o[1]),r=Math.max(r,o[2]),i=Math.max(i,o[3]);return[t,n,r,i]}const u6={card:{maxWidth:"100%",marginBottom:1,marginRight:1},cardContent:{padding:.1},isoTextField:{marginLeft:1,flexGrow:1},isoSlider:{minWidth:100}},fsr=({selectedDataset:e,selectedVariable:t,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:s,volumeStates:a,updateVolumeState:l,updateVariableVolume:c,serverUrl:u})=>{let f=.5;t&&(typeof t.volumeIsoThreshold=="number"?f=t.volumeIsoThreshold:f=.5*(t.colorBarMin+t.colorBarMax),typeof t.volumeRenderMode=="string"&&(o=t.volumeRenderMode));const d=p=>{c(e.id,t.name,r,o,p)},h=(p,g)=>{g!==null&&(s(g),t&&c(e.id,t.name,r,g,f))};return O.jsxs(Cyt,{sx:u6.card,children:[O.jsx(Pyt,{disableSpacing:!0,children:t&&O.jsxs(O.Fragment,{children:[O.jsxs(GI,{size:"small",exclusive:!0,value:o,onChange:h,children:[O.jsx(oo,{value:"mip",size:"small",children:O.jsx(_n,{arrow:!0,title:"Maximum intensity projection",children:O.jsx("span",{children:"MIP"})})},"mip"),O.jsx(oo,{value:"aip",size:"small",children:O.jsx(_n,{arrow:!0,title:"Average intensity projection",children:O.jsx("span",{children:"AIP"})})},"aip"),O.jsx(oo,{value:"iso",size:"small",children:O.jsx(_n,{arrow:!0,title:"Iso-surface extraction",children:O.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&O.jsx(dsr,{minValue:t.colorBarMin,maxValue:t.colorBarMax,value:f,setValue:d})]})}),O.jsx(Uze,{sx:u6.cardContent,children:O.jsx(vA,{selectedDataset:e,selectedVariable:t,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:a,updateVolumeState:l,serverUrl:u})})]})},dsr=({value:e,minValue:t,maxValue:n,setValue:r,disabled:i})=>{const[o,s]=Te.useState(e),[a,l]=Te.useState(""+e),[c,u]=Te.useState(null);function f(g){const m=g.target.value||"";l(m);const v=parseFloat(m);Number.isNaN(v)?u("Not a number"):vn?u("Out of range"):u(null)}function d(g){if(g.key==="Enter"&&!c){const m=parseFloat(a);s(m),r(m)}}function h(g,m){s(m),l(m.toFixed(2))}function p(g,m){r(m)}return O.jsx(Ii,{sx:u6.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:a,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:O.jsx(Kw,{size:"small",sx:u6.isoSlider,min:t,max:n,value:o,step:(n-t)/20,onChange:h,onChangeCommitted:p})}})},hsr=e=>({locale:e.controlState.locale,selectedDataset:Co(e),selectedVariable:ec(e),selectedPlaceInfo:gD(e),variableColorBar:hle(e),volumeRenderMode:e.controlState.volumeRenderMode,volumeId:SIt(e),volumeStates:e.controlState.volumeStates,serverUrl:Go(e).url}),psr={setVolumeRenderMode:h_n,updateVolumeState:p_n,updateVariableVolume:WSn},gsr=hr(hsr,psr)(fsr),msr=e=>{const t=On.instance.branding.allow3D===!1;return[{id:"details",title:Ce.get("Details"),icon:O.jsx(iFn,{}),content:O.jsx(H6n,{})},{id:"timeSeries",title:Ce.get("Time-Series"),icon:O.jsx(oFn,{}),content:O.jsx(vJn,{})},{id:"stats",title:Ce.get("Statistics"),icon:O.jsx(fet,{}),content:O.jsx(AJn,{})},{id:"volume",title:Ce.get("Volume"),icon:O.jsx(sFn,{}),content:O.jsx(gsr,{}),hidden:t}]},vsr=e=>({locale:e.controlState.locale,sidebarPanelId:e.controlState.sidePanelId}),ysr={setSidebarPanelId:Xpe};function bsr({locale:e,sidebarPanelId:t,setSidebarPanelId:n}){const r=W4e(),i=M.useMemo(()=>r.panels||[],[r]),o=M.useMemo(()=>i.map((c,u)=>({...c.container,id:c.name,content:O.jsx(aFn,{contribution:c,panelIndex:u},c.name)})),[i]),s=M.useMemo(()=>{const c=new Map;return o.forEach((u,f)=>{c.set(u.id,f)}),c},[o]);M.useEffect(()=>{if(t&&s.has(t)){const c=s.get(t);o[c].componentRequested||dLt("panels",c,{componentRequested:!0},!0)}},[t,o,s]);const a=M.useMemo(()=>msr(),[e]),l=M.useMemo(()=>[...a,...o],[a,o]);return O.jsx(gFn,{panels:l,selectedPanelId:t,setSelectedPanelId:n})}const xsr=hr(vsr,ysr)(bsr);function wsr(e,t){const n=M.useRef();M.useEffect(()=>{const r=new ResizeObserver(i=>{for(const o of i)if(o.contentRect){const s=o.contentRect.width,a=o.contentRect.height,l=n.current;if(!l||l.width!==s||l.height!==a){const c={width:s,height:a};n.current=c,l&&e(c)}}});return r.observe(document.documentElement),()=>r.disconnect()},[e,t])}const Mx={containerHor:{flexGrow:1,overflow:"hidden",height:"100%"},containerVer:{flexGrow:1,overflowX:"hidden",overflowY:"auto",height:"100%"},viewer:{overflow:"hidden",width:"100%",height:"100%"},sidePanelSplit:{width:"100%",height:"100%",overflow:"hidden"},sidePanelNoPanelHor:{flexGrow:0,height:"100%"},sidePanelNoPanelVer:{flexGrow:0},sidePanelHidden:{display:"none"}},Ssr=e=>({sidePanelOpen:e.controlState.sidePanelOpen,sidePanelId:e.controlState.sidePanelId,sidePanelSize:e.controlState.sidePanelSize}),_sr={updateSidePanelSize:d_n},zNe=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function Csr({sidePanelOpen:e,sidePanelId:t,sidePanelSize:n,updateSidePanelSize:r}){const[i,o]=M.useState(null),[s,a]=M.useState(zNe()),l=as();M.useEffect(()=>{c()},[]),wsr(()=>{c()}),M.useEffect(()=>{i&&i.updateSize()},[i,n,e,t,s]);const c=()=>{a(zNe())},u=e&&!!t,f=e?u?n:ktt:0;return O.jsxs(DIn,{dir:s,childPos:"last",childSize:f,updateChildSize:u?r:()=>{},resizeable:u,style:s==="hor"?Mx.containerHor:Mx.containerVer,children:[O.jsx("div",{style:Mx.viewer,children:O.jsx(rFn,{onMapRef:o,theme:l})}),O.jsx(bt,{sx:e?u?Mx.sidePanelSplit:s==="hor"?Mx.sidePanelNoPanelHor:Mx.sidePanelNoPanelVer:Mx.sidePanelHidden,children:O.jsx(xsr,{})})]})}const Osr=hr(Ssr,_sr)(Csr);var T2={exports:{}},RJ={},q3={exports:{}},jNe;function Esr(){if(jNe)return q3.exports;jNe=1;function e(n){var r,i,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(r=0;r0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const s=window.document?.documentElement?.style;if(!s||o in s)return"";for(let a=0;aT===k.identifier)||E.changedTouches&&(0,e.findInArray)(E.changedTouches,k=>T===k.identifier)}function v(E){if(E.targetTouches&&E.targetTouches[0])return E.targetTouches[0].identifier;if(E.changedTouches&&E.changedTouches[0])return E.changedTouches[0].identifier}function y(E){if(!E)return;let T=E.getElementById("react-draggable-style-el");T||(T=E.createElement("style"),T.type="text/css",T.id="react-draggable-style-el",T.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,T.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,E.getElementsByTagName("head")[0].appendChild(T)),E.body&&S(E.body,"react-draggable-transparent-selection")}function b(E){window.requestAnimationFrame?window.requestAnimationFrame(()=>{w(E)}):w(E)}function w(E){if(E)try{if(E.body&&_(E.body,"react-draggable-transparent-selection"),E.selection)E.selection.empty();else{const T=(E.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function S(E,T){E.classList?E.classList.add(T):E.className.match(new RegExp(`(?:^|\\s)${T}(?!\\S)`))||(E.className+=` ${T}`)}function _(E,T){E.classList?E.classList.remove(T):E.className=E.className.replace(new RegExp(`(?:^|\\s)${T}(?!\\S)`,"g"),"")}return qo}var Kh={},Xze;function Out(){if(Xze)return Kh;Xze=1,Object.defineProperty(Kh,"__esModule",{value:!0}),Kh.canDragX=i,Kh.canDragY=o,Kh.createCoreData=a,Kh.createDraggableData=l,Kh.getBoundPosition=n,Kh.getControlPosition=s,Kh.snapToGrid=r;var e=fH(),t=aye();function n(f,d,h){if(!f.props.bounds)return[d,h];let{bounds:p}=f.props;p=typeof p=="string"?p:c(p);const g=u(f);if(typeof p=="string"){const{ownerDocument:m}=g,v=m.defaultView;let y;if(p==="parent"?y=g.parentNode:y=g.getRootNode().querySelector(p),!(y instanceof v.HTMLElement))throw new Error('Bounds selector "'+p+'" could not find an element.');const b=y,w=v.getComputedStyle(g),S=v.getComputedStyle(b);p={left:-g.offsetLeft+(0,e.int)(S.paddingLeft)+(0,e.int)(w.marginLeft),top:-g.offsetTop+(0,e.int)(S.paddingTop)+(0,e.int)(w.marginTop),right:(0,t.innerWidth)(b)-(0,t.outerWidth)(g)-g.offsetLeft+(0,e.int)(S.paddingRight)-(0,e.int)(w.marginRight),bottom:(0,t.innerHeight)(b)-(0,t.outerHeight)(g)-g.offsetTop+(0,e.int)(S.paddingBottom)-(0,e.int)(w.marginBottom)}}return(0,e.isNum)(p.right)&&(d=Math.min(d,p.right)),(0,e.isNum)(p.bottom)&&(h=Math.min(h,p.bottom)),(0,e.isNum)(p.left)&&(d=Math.max(d,p.left)),(0,e.isNum)(p.top)&&(h=Math.max(h,p.top)),[d,h]}function r(f,d,h){const p=Math.round(d/f[0])*f[0],g=Math.round(h/f[1])*f[1];return[p,g]}function i(f){return f.props.axis==="both"||f.props.axis==="x"}function o(f){return f.props.axis==="both"||f.props.axis==="y"}function s(f,d,h){const p=typeof d=="number"?(0,t.getTouch)(f,d):null;if(typeof d=="number"&&!p)return null;const g=u(h),m=h.props.offsetParent||g.offsetParent||g.ownerDocument.body;return(0,t.offsetXYFromParent)(p||f,m,h.props.scale)}function a(f,d,h){const p=!(0,e.isNum)(f.lastX),g=u(f);return p?{node:g,deltaX:0,deltaY:0,lastX:d,lastY:h,x:d,y:h}:{node:g,deltaX:d-f.lastX,deltaY:h-f.lastY,lastX:f.lastX,lastY:f.lastY,x:d,y:h}}function l(f,d){const h=f.props.scale;return{node:d.node,x:f.state.x+d.deltaX/h,y:f.state.y+d.deltaY/h,deltaX:d.deltaX/h,deltaY:d.deltaY/h,lastX:f.state.x,lastY:f.state.y}}function c(f){return{left:f.left,top:f.top,right:f.right,bottom:f.bottom}}function u(f){const d=f.findDOMNode();if(!d)throw new Error(": Unmounted during event!");return d}return Kh}var N2={},gz={},Yze;function Eut(){if(Yze)return gz;Yze=1,Object.defineProperty(gz,"__esModule",{value:!0}),gz.default=e;function e(){}return gz}var Qze;function Ecr(){if(Qze)return N2;Qze=1,Object.defineProperty(N2,"__esModule",{value:!0}),N2.default=void 0;var e=l(hg()),t=a(UI()),n=a(D6()),r=aye(),i=Out(),o=fH(),s=a(Eut());function a(g){return g&&g.__esModule?g:{default:g}}function l(g,m){if(typeof WeakMap=="function")var v=new WeakMap,y=new WeakMap;return(l=function(b,w){if(!w&&b&&b.__esModule)return b;var S,_,E={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return E;if(S=w?y:v){if(S.has(b))return S.get(b);S.set(b,E)}for(const T in b)T!=="default"&&{}.hasOwnProperty.call(b,T)&&((_=(S=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,T))&&(_.get||_.set)?S(E,T,_):E[T]=b[T]);return E})(g,m)}function c(g,m,v){return(m=u(m))in g?Object.defineProperty(g,m,{value:v,enumerable:!0,configurable:!0,writable:!0}):g[m]=v,g}function u(g){var m=f(g,"string");return typeof m=="symbol"?m:m+""}function f(g,m){if(typeof g!="object"||!g)return g;var v=g[Symbol.toPrimitive];if(v!==void 0){var y=v.call(g,m);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(g)}const d={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let h=d.mouse,p=class extends e.Component{constructor(){super(...arguments),c(this,"dragging",!1),c(this,"lastX",NaN),c(this,"lastY",NaN),c(this,"touchIdentifier",null),c(this,"mounted",!1),c(this,"handleDragStart",m=>{if(this.props.onMouseDown(m),!this.props.allowAnyClick&&typeof m.button=="number"&&m.button!==0)return!1;const v=this.findDOMNode();if(!v||!v.ownerDocument||!v.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:y}=v;if(this.props.disabled||!(m.target instanceof y.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(m.target,this.props.handle,v)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(m.target,this.props.cancel,v))return;m.type==="touchstart"&&!this.props.allowMobileScroll&&m.preventDefault();const b=(0,r.getTouchIdentifier)(m);this.touchIdentifier=b;const w=(0,i.getControlPosition)(m,b,this);if(w==null)return;const{x:S,y:_}=w,E=(0,i.createCoreData)(this,S,_);(0,s.default)("DraggableCore: handleDragStart: %j",E),(0,s.default)("calling",this.props.onStart),!(this.props.onStart(m,E)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(y),this.dragging=!0,this.lastX=S,this.lastY=_,(0,r.addEvent)(y,h.move,this.handleDrag),(0,r.addEvent)(y,h.stop,this.handleDragStop))}),c(this,"handleDrag",m=>{const v=(0,i.getControlPosition)(m,this.touchIdentifier,this);if(v==null)return;let{x:y,y:b}=v;if(Array.isArray(this.props.grid)){let _=y-this.lastX,E=b-this.lastY;if([_,E]=(0,i.snapToGrid)(this.props.grid,_,E),!_&&!E)return;y=this.lastX+_,b=this.lastY+E}const w=(0,i.createCoreData)(this,y,b);if((0,s.default)("DraggableCore: handleDrag: %j",w),this.props.onDrag(m,w)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const E=document.createEvent("MouseEvents");E.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(E)}return}this.lastX=y,this.lastY=b}),c(this,"handleDragStop",m=>{if(!this.dragging)return;const v=(0,i.getControlPosition)(m,this.touchIdentifier,this);if(v==null)return;let{x:y,y:b}=v;if(Array.isArray(this.props.grid)){let E=y-this.lastX||0,T=b-this.lastY||0;[E,T]=(0,i.snapToGrid)(this.props.grid,E,T),y=this.lastX+E,b=this.lastY+T}const w=(0,i.createCoreData)(this,y,b);if(this.props.onStop(m,w)===!1||this.mounted===!1)return!1;const _=this.findDOMNode();_&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(_.ownerDocument),(0,s.default)("DraggableCore: handleDragStop: %j",w),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,_&&((0,s.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(_.ownerDocument,h.move,this.handleDrag),(0,r.removeEvent)(_.ownerDocument,h.stop,this.handleDragStop))}),c(this,"onMouseDown",m=>(h=d.mouse,this.handleDragStart(m))),c(this,"onMouseUp",m=>(h=d.mouse,this.handleDragStop(m))),c(this,"onTouchStart",m=>(h=d.touch,this.handleDragStart(m))),c(this,"onTouchEnd",m=>(h=d.touch,this.handleDragStop(m)))}componentDidMount(){this.mounted=!0;const m=this.findDOMNode();m&&(0,r.addEvent)(m,d.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const m=this.findDOMNode();if(m){const{ownerDocument:v}=m;(0,r.removeEvent)(v,d.mouse.move,this.handleDrag),(0,r.removeEvent)(v,d.touch.move,this.handleDrag),(0,r.removeEvent)(v,d.mouse.stop,this.handleDragStop),(0,r.removeEvent)(v,d.touch.stop,this.handleDragStop),(0,r.removeEvent)(m,d.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(v)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return N2.default=p,c(p,"displayName","DraggableCore"),c(p,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(g,m){if(g[m]&&g[m].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),c(p,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),N2}var Kze;function Tcr(){return Kze||(Kze=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(hg()),n=u(UI()),r=u(D6()),i=Ccr(),o=aye(),s=Out(),a=fH(),l=u(Ecr()),c=u(Eut());function u(v){return v&&v.__esModule?v:{default:v}}function f(v,y){if(typeof WeakMap=="function")var b=new WeakMap,w=new WeakMap;return(f=function(S,_){if(!_&&S&&S.__esModule)return S;var E,T,k={__proto__:null,default:S};if(S===null||typeof S!="object"&&typeof S!="function")return k;if(E=_?w:b){if(E.has(S))return E.get(S);E.set(S,k)}for(const P in S)P!=="default"&&{}.hasOwnProperty.call(S,P)&&((T=(E=Object.defineProperty)&&Object.getOwnPropertyDescriptor(S,P))&&(T.get||T.set)?E(k,P,T):k[P]=S[P]);return k})(v,y)}function d(){return d=Object.assign?Object.assign.bind():function(v){for(var y=1;y{if((0,c.default)("Draggable: onDragStart: %j",w),this.props.onStart(b,(0,s.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(b,w)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",w);const S=(0,s.createDraggableData)(this,w),_={x:S.x,y:S.y,slackX:0,slackY:0};if(this.props.bounds){const{x:T,y:k}=_;_.x+=this.state.slackX,_.y+=this.state.slackY;const[P,R]=(0,s.getBoundPosition)(this,_.x,_.y);_.x=P,_.y=R,_.slackX=this.state.slackX+(T-_.x),_.slackY=this.state.slackY+(k-_.y),S.x=_.x,S.y=_.y,S.deltaX=_.x-this.state.x,S.deltaY=_.y-this.state.y}if(this.props.onDrag(b,S)===!1)return!1;this.setState(_)}),h(this,"onDragStop",(b,w)=>{if(!this.state.dragging||this.props.onStop(b,(0,s.createDraggableData)(this,w))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",w);const _={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:T,y:k}=this.props.position;_.x=T,_.y=k}this.setState(_)}),this.state={dragging:!1,dragged:!1,x:y.position?y.position.x:y.defaultPosition.x,y:y.position?y.position.y:y.defaultPosition.y,prevPropsPosition:{...y.position},slackX:0,slackY:0,isElementSVG:!1},y.position&&!(y.onDrag||y.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??r.default.findDOMNode(this)}render(){const{axis:y,bounds:b,children:w,defaultPosition:S,defaultClassName:_,defaultClassNameDragging:E,defaultClassNameDragged:T,position:k,positionOffset:P,scale:R,...I}=this.props;let F={},A=null;const $=!!!k||this.state.dragging,j=k||S,V={x:(0,s.canDragX)(this)&&$?this.state.x:j.x,y:(0,s.canDragY)(this)&&$?this.state.y:j.y};this.state.isElementSVG?A=(0,o.createSVGTransform)(V,P):F=(0,o.createCSSTransform)(V,P);const U=(0,i.clsx)(w.props.className||"",_,{[E]:this.state.dragging,[T]:this.state.dragged});return t.createElement(l.default,d({},I,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(w),{className:U,style:{...w.props.style,...F},transform:A}))}}e.default=m,h(m,"displayName","Draggable"),h(m,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),h(m,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Fee)),Fee}var Zze;function lye(){if(Zze)return $2.exports;Zze=1;const{default:e,DraggableCore:t}=Tcr();return $2.exports=e,$2.exports.default=e,$2.exports.DraggableCore=t,$2.exports}var Pcr=lye();const kcr=Vn(Pcr);var z2={exports:{}},j2={},mz={},Jze;function Mcr(){if(Jze)return mz;Jze=1,mz.__esModule=!0,mz.cloneElement=a;var e=t(hg());function t(l){return l&&l.__esModule?l:{default:l}}function n(l,c){var u=Object.keys(l);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(l);c&&(f=f.filter(function(d){return Object.getOwnPropertyDescriptor(l,d).enumerable})),u.push.apply(u,f)}return u}function r(l){for(var c=1;c=0)&&(b[S]=v[S]);return b}function c(v,y){var b=Object.keys(v);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(v);y&&(w=w.filter(function(S){return Object.getOwnPropertyDescriptor(v,S).enumerable})),b.push.apply(b,w)}return b}function u(v){for(var y=1;yMath.abs(F*R)?_=S/R:S=_*R}var A=S,L=_,$=this.slack||[0,0],j=$[0],V=$[1];return S+=j,_+=V,T&&(S=Math.max(T[0],S),_=Math.max(T[1],_)),k&&(S=Math.min(k[0],S),_=Math.min(k[1],_)),this.slack=[j+(A-S),V+(L-_)],[S,_]},b.resizeHandler=function(S,_){var E=this;return function(T,k){var P=k.node,R=k.deltaX,I=k.deltaY;S==="onResizeStart"&&E.resetData();var F=(E.props.axis==="both"||E.props.axis==="x")&&_!=="n"&&_!=="s",A=(E.props.axis==="both"||E.props.axis==="y")&&_!=="e"&&_!=="w";if(!(!F&&!A)){var L=_[0],$=_[_.length-1],j=P.getBoundingClientRect();if(E.lastHandleRect!=null){if($==="w"){var V=j.left-E.lastHandleRect.left;R+=V}if(L==="n"){var U=j.top-E.lastHandleRect.top;I+=U}}E.lastHandleRect=j,$==="w"&&(R=-R),L==="n"&&(I=-I);var z=E.props.width+(F?R/E.props.transformScale:0),N=E.props.height+(A?I/E.props.transformScale:0),B=E.runConstraints(z,N);z=B[0],N=B[1];var H=z!==E.props.width||N!==E.props.height,Q=typeof E.props[S]=="function"?E.props[S]:null,Y=S==="onResize"&&!H;Q&&!Y&&(T.persist==null||T.persist(),Q(T,{node:P,size:{width:z,height:N},handle:_})),S==="onResizeStop"&&E.resetData()}}},b.renderResizeHandle=function(S,_){var E=this.props.handle;if(!E)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+S,ref:_});if(typeof E=="function")return E(S,_);var T=typeof E.type=="string",k=u({ref:_},T?{}:{handleAxis:S});return e.cloneElement(E,k)},b.render=function(){var S=this,_=this.props,E=_.children,T=_.className,k=_.draggableOpts;_.width,_.height,_.handle,_.handleSize,_.lockAspectRatio,_.axis,_.minConstraints,_.maxConstraints,_.onResize,_.onResizeStop,_.onResizeStart;var P=_.resizeHandles;_.transformScale;var R=l(_,i);return(0,n.cloneElement)(E,u(u({},R),{},{className:(T?T+" ":"")+"react-resizable",children:[].concat(E.props.children,P.map(function(I){var F,A=(F=S.handleRefs[I])!=null?F:S.handleRefs[I]=e.createRef();return e.createElement(t.DraggableCore,a({},k,{nodeRef:A,key:"resizableHandle-"+I,onStop:S.resizeHandler("onResizeStop",I),onStart:S.resizeHandler("onResizeStart",I),onDrag:S.resizeHandler("onResize",I)}),S.renderResizeHandle(I,A))}))}))},y})(e.Component);return j2.default=m,m.propTypes=r.resizableProps,m.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},j2}var U2={},n5e;function Acr(){if(n5e)return U2;n5e=1,U2.__esModule=!0,U2.default=void 0;var e=a(hg()),t=o(UI()),n=o(Put()),r=Tut(),i=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(y){return y&&y.__esModule?y:{default:y}}function s(y){if(typeof WeakMap!="function")return null;var b=new WeakMap,w=new WeakMap;return(s=function(_){return _?w:b})(y)}function a(y,b){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var w=s(b);if(w&&w.has(y))return w.get(y);var S={},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in y)if(E!=="default"&&Object.prototype.hasOwnProperty.call(y,E)){var T=_?Object.getOwnPropertyDescriptor(y,E):null;T&&(T.get||T.set)?Object.defineProperty(S,E,T):S[E]=y[E]}return S.default=y,w&&w.set(y,S),S}function l(){return l=Object.assign?Object.assign.bind():function(y){for(var b=1;b=0)&&(w[_]=y[_]);return w}function g(y,b){y.prototype=Object.create(b.prototype),y.prototype.constructor=y,m(y,b)}function m(y,b){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,_){return S.__proto__=_,S},m(y,b)}var v=(function(y){g(b,y);function b(){for(var S,_=arguments.length,E=new Array(_),T=0;T<_;T++)E[T]=arguments[T];return S=y.call.apply(y,[this].concat(E))||this,S.state={width:S.props.width,height:S.props.height,propsWidth:S.props.width,propsHeight:S.props.height},S.onResize=function(k,P){var R=P.size;S.props.onResize?(k.persist==null||k.persist(),S.setState(R,function(){return S.props.onResize&&S.props.onResize(k,P)})):S.setState(R)},S}b.getDerivedStateFromProps=function(_,E){return E.propsWidth!==_.width||E.propsHeight!==_.height?{width:_.width,height:_.height,propsWidth:_.width,propsHeight:_.height}:null};var w=b.prototype;return w.render=function(){var _=this.props,E=_.handle,T=_.handleSize;_.onResize;var k=_.onResizeStart,P=_.onResizeStop,R=_.draggableOpts,I=_.minConstraints,F=_.maxConstraints,A=_.lockAspectRatio,L=_.axis;_.width,_.height;var $=_.resizeHandles,j=_.style,V=_.transformScale,U=p(_,i);return e.createElement(n.default,{axis:L,draggableOpts:R,handle:E,handleSize:T,height:this.state.height,lockAspectRatio:A,maxConstraints:F,minConstraints:I,onResizeStart:k,onResize:this.onResize,onResizeStop:P,resizeHandles:$,transformScale:V,width:this.state.width},e.createElement("div",l({},U,{style:u(u({},j),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},b})(e.Component);return U2.default=v,v.propTypes=u(u({},r.resizableProps),{},{children:t.default.element}),U2}var r5e;function Rcr(){return r5e||(r5e=1,z2.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},z2.exports.Resizable=Put().default,z2.exports.ResizableBox=Acr().default),z2.exports}var Icr=Rcr();const Dcr=ot(O.jsx("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"}),"ArrowForwardIosSharp"),kut=ot(O.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");function Mut({title:e,subtitle:t,disabled:n,dense:r,selected:i,secondaryIcon:o,onClick:s}){return i?O.jsxs(tr,{onClick:s,disabled:n,dense:r,children:[O.jsx(rl,{children:O.jsx(kut,{})}),O.jsx(Yi,{primary:e,secondary:t}),o]}):O.jsxs(tr,{onClick:s,disabled:n,dense:r,children:[O.jsx(Yi,{inset:!0,primary:e,secondary:t}),o]})}function Lcr({layerState:e,setLayerVisibility:t,disableI18n:n}){return e.disabled?null:O.jsx(O.Fragment,{children:O.jsx(Mut,{title:n?e.title:Ce.get(e.title),subtitle:e.subTitle,selected:!!e.visible,secondaryIcon:e.pinned&&O.jsx(v4,{fontSize:"small",color:"disabled"}),onClick:()=>t(e.id,!e.visible),dense:!0})})}function $ee({layerStates:e,setLayerVisibility:t,disableI18n:n,extraItems:r}){return O.jsxs(nS,{dense:!0,disablePadding:!0,children:[e.map(i=>O.jsx(Lcr,{layerState:i,setLayerVisibility:t,disableI18n:n},i.id)),e.length&&r&&O.jsx(oa,{style:{margin:0}}),r]})}const Fcr={x:48,y:128},$cr={width:320,height:520},vz={resizeBox:{position:"absolute",zIndex:1e3},windowPaper:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},windowHeader:e=>({display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"move",padding:1,borderBottom:`1px solid ${e.palette.mode==="dark"?"#FFFFFF3F":"#0000003F"}`}),windowTitle:{fontWeight:"bolder"}},Nee=Oe(e=>O.jsx(Mje,{disableGutters:!0,elevation:0,square:!0,...e}))(({theme:e})=>({border:`1px solid ${e.palette.divider}`,"&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}})),zee=Oe(e=>O.jsx(Rje,{expandIcon:O.jsx(Dcr,{sx:{fontSize:"0.9rem"}}),...e}))(({theme:e})=>({backgroundColor:"rgba(0, 0, 0, .03)",minHeight:32,paddingLeft:e.spacing(1),paddingRight:e.spacing(1),flexDirection:"row-reverse",[`& .${Rm.expandIconWrapper}.${Rm.expanded}`]:{transform:"rotate(90deg)"},[`& .${Rm.content}`]:{marginLeft:e.spacing(1),marginTop:e.spacing(0),marginBottom:e.spacing(0),marginRight:e.spacing(0)},...e.applyStyles("dark",{backgroundColor:"rgba(255, 255, 255, .05)"})})),jee=Oe(Aje)(({theme:e})=>({padding:0,borderTop:"1px solid rgba(0, 0, 0, .125)"}));function Ncr({layerStates:e,layerMenuOpen:t,setLayerMenuOpen:n,openDialog:r,setLayerVisibilities:i,layerGroupStates:o,setLayerGroupStates:s}){const[a,l]=M.useState(Fcr),[c,u]=M.useState($cr),f=M.useCallback((E,T)=>{const k={[E]:T};if(T){const P=e[E];P&&P.type&&P.exclusive&&Object.keys(e).forEach(R=>{const I=e[R];I&&I.type===P.type&&I.exclusive&&I.visible&&(k[R]=!1)})}i(k)},[e,i]),d=M.useCallback((E,T)=>{s({overlays:T})},[s]),h=M.useCallback((E,T)=>{s({baseMaps:T})},[s]),p=M.useCallback((E,T)=>{s({predefined:T})},[s]),g=M.useMemo(()=>i5e(e,"overlays"),[e]),m=M.useMemo(()=>i5e(e,"baseMaps"),[e]),v=M.useMemo(()=>[e.userPlaces,e.datasetPlaces,e.datasetBoundary,e.datasetVariable,e.datasetVariable2,e.datasetRgb,e.datasetRgb2].filter(E=>!!E),[e]);if(!t)return null;const y=()=>{r("userOverlays")},b=()=>{r("userBaseMaps")},w=()=>{n(!1)},S=(E,T)=>{l({...T})},_=(E,T)=>{u({...T.size})};return O.jsx(kcr,{handle:"#layer-select-header",position:a,onStop:S,children:O.jsx(Icr.ResizableBox,{width:c.width,height:c.height,style:vz.resizeBox,onResize:_,children:O.jsxs(fa,{elevation:10,sx:vz.windowPaper,component:"div",children:[O.jsxs(bt,{id:"layer-select-header",sx:vz.windowHeader,children:[O.jsx(bt,{component:"span",sx:vz.windowTitle,children:Ce.get("Layers")}),O.jsx(Mn,{size:"small",onClick:w,children:O.jsx(yP,{fontSize:"inherit"})})]}),O.jsxs(bt,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:[O.jsxs(Nee,{expanded:o.overlays,onChange:d,children:[O.jsx(zee,{id:"overlays",children:O.jsx(yn,{component:"span",children:Ce.get("Overlays")})}),O.jsx(jee,{children:O.jsx($ee,{layerStates:g,setLayerVisibility:f,extraItems:O.jsx(tr,{onClick:y,children:Ce.get("User Overlays")+"..."}),disableI18n:!0})})]}),O.jsxs(Nee,{expanded:o.predefined,onChange:p,children:[O.jsx(zee,{id:"predefines",children:O.jsx(yn,{component:"span",children:Ce.get("Predefined")})}),O.jsx(jee,{children:O.jsx($ee,{layerStates:v,setLayerVisibility:f})})]}),O.jsxs(Nee,{expanded:o.baseMaps,onChange:h,children:[O.jsx(zee,{id:"baseMaps",children:O.jsx(yn,{component:"span",children:Ce.get("Base maps")})}),O.jsx(jee,{children:O.jsx($ee,{layerStates:m,setLayerVisibility:f,extraItems:O.jsx(tr,{onClick:b,children:Ce.get("User Base Maps")+"..."}),disableI18n:!0})})]})]})]})})})}function i5e(e,t){return Object.keys(e).filter(n=>e[n].type===t).map(n=>e[n]).sort((n,r)=>n.title.localeCompare(r.title))}const zcr=e=>({locale:e.controlState.locale,layerMenuOpen:e.controlState.layerMenuOpen,layerStates:mFt(e),layerGroupStates:e.controlState.layerGroupStates}),jcr={openDialog:FS,setLayerMenuOpen:Ftt,setLayerVisibilities:Stt,setLayerGroupStates:vEn},Bcr=dr(zcr,jcr)(Ncr),Ucr=e=>({locale:e.controlState.locale,hasConsent:e.controlState.privacyNoticeAccepted,compact:!!On.instance.branding.compact}),Vcr={},Wcr=Oe("main")(({theme:e})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[e.breakpoints.up("md")]:{overflow:"hidden"}})),Hcr=({hasConsent:e,compact:t})=>O.jsxs(Wcr,{children:[!t&&O.jsx(nD,{variant:"dense"}),e&&O.jsxs(O.Fragment,{children:[O.jsx(BFn,{}),O.jsx(_cr,{}),O.jsx(Bcr,{})]})]}),Gcr=dr(Ucr,Vcr)(Hcr),qcr={icon:e=>({marginRight:e.spacing(2)})};function Xcr({open:e,settings:t,updateSettings:n,syncWithServer:r}){const[i,o]=M.useState(null),{store:s}=M.useContext(L6);if(M.useEffect(()=>{const c=Ce.get("docs/privacy-note.en.md");fetch(c).then(u=>u.text()).then(u=>o(u))}),!e)return null;function a(){n({...t,privacyNoticeAccepted:!0}),r(s)}function l(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(c){console.error(c)}}return O.jsxs(Gu,{open:e,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[O.jsx(gg,{children:Ce.get("Privacy Notice")}),O.jsx(Nc,{children:O.jsx(Jje,{children:i===null?O.jsx(Eh,{}):O.jsx(Hb,{text:i})})}),O.jsxs(Cb,{children:[O.jsxs(ji,{onClick:a,children:[O.jsx(kut,{sx:qcr.icon}),Ce.get("Accept and continue")]}),O.jsx(ji,{onClick:l,children:Ce.get("Leave")})]})]})}const Ycr=e=>({open:!e.controlState.privacyNoticeAccepted,settings:e.controlState}),Qcr={updateSettings:zL,syncWithServer:tme},Kcr=dr(Ycr,Qcr)(Xcr),Zcr=Qn(Eh)(({theme:e})=>({margin:e.spacing(2)})),Jcr=Qn(yn)(({theme:e})=>({margin:e.spacing(1)})),eur=Qn("div")(({theme:e})=>({margin:e.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function tur({messages:e}){const[t]=M.useState(Date.now()),[n,r]=M.useState(!0);return M.useEffect(()=>{let i;if(e.length===0){const s=Date.now()-t;if(s>=3e3)r(!1);else{const a=3e3-s;i=setTimeout(()=>{r(!1)},a)}}else r(!0);return()=>{i&&clearTimeout(i)}},[e,t]),n?O.jsxs(Gu,{open:!0,"aria-labelledby":"loading",children:[On.instance.branding.allowAboutPage&&O.jsx(Nc,{children:O.jsx(ont,{})}),!On.instance.branding.allowAboutPage&&O.jsx(gg,{id:"loading",children:Ce.get("Please wait...")}),O.jsxs(eur,{children:[O.jsx(Zcr,{}),e.map((i,o)=>O.jsx(Jcr,{children:i},o))]})]}):null}const nur=e=>({locale:e.controlState.locale,messages:uFt(e)}),rur={},iur=dr(nur,rur)(tur),our=ot(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),sur=ot(O.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),aur=ot(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),lur=ot(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),cur={success:aur,warning:sur,error:our,info:lur},uur=Qn("span")(()=>({display:"flex",alignItems:"center"})),yz={close:{p:.5},success:e=>({color:e.palette.error.contrastText,backgroundColor:bm[600]}),error:e=>({color:e.palette.error.contrastText,backgroundColor:e.palette.error.dark}),info:e=>({color:e.palette.error.contrastText,backgroundColor:e.palette.primary.dark}),warning:e=>({color:e.palette.error.contrastText,backgroundColor:P5e[700]}),icon:{fontSize:20},iconVariant:e=>({opacity:.9,marginRight:e.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},fur={vertical:"bottom",horizontal:"center"};function dur({className:e,message:t,hideMessage:n}){const r=()=>{n(t.id)};if(!t)return null;const i=cur[t.type];return O.jsx(O_t,{open:!0,anchorOrigin:fur,autoHideDuration:5e3,onClose:r,children:O.jsx(dBe,{sx:yz[t.type],className:e,"aria-describedby":"client-snackbar",message:O.jsxs(uur,{id:"client-snackbar",children:[O.jsx(i,{sx:yz.iconVariant}),t.text]}),action:[O.jsx(Mn,{"aria-label":"Close",color:"inherit",sx:yz.close,onClick:r,size:"large",children:O.jsx(yP,{sx:yz.icon})},"close")]})},t.type+":"+t.text)}const hur=e=>{const t=e.messageLogState.newEntries;return{locale:e.controlState.locale,message:t.length>0?t[0]:null}},pur={hideMessage:cOn},gur=dr(hur,pur)(dur),Cae=ot(O.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),Aut=ot(O.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),mC={formControl:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),width:200}),textField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),width:200}),textField2:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),width:400}),button:e=>({margin:e.spacing(.1)})};function mur({open:e,servers:t,selectedServer:n,closeDialog:r,configureServers:i}){const o=M.useRef(!1),[s,a]=M.useState(t),[l,c]=M.useState(n),[u,f]=M.useState("select");M.useEffect(()=>{o.current&&(a(t),c(n)),o.current=!0},[t,n]);const{store:d}=M.useContext(L6),h=()=>{u==="select"?(r("server"),i(s,l.id,d)):u==="add"?P():u==="edit"&&R()},p=()=>{u==="select"?_():I()},g=()=>{_()},m=V=>{const U=V.target.value,z=s.find(N=>N.id===U);c(z)},v=V=>{const U=V.target.value,z={...l,name:U};c(z)},y=V=>{const U=V.target.value,z={...l,url:U};c(z)},b=()=>{f("add")},w=()=>{f("edit")},S=()=>{F()},_=()=>{r("server")},E=()=>{const V=l.id;return s.findIndex(U=>U.id===V)},T=(V,U)=>{const z=[...s];z[V]=U,a(z),c(U),f("select")},k=(V,U)=>{a(V),c(U),f("select")},P=()=>{const V={...l,id:mh("server-")},U=[...s,V];k(U,V)},R=()=>{T(E(),{...l})},I=()=>{const V=E();T(E(),s[V])},F=()=>{const V=[...s];if(V.length<2)throw new Error("internal error: server list cannot be emptied");const U=E(),z=V[U+(U>0?-1:1)];V.splice(U,1),k(V,z)},A=s.map((V,U)=>O.jsx(tr,{value:V.id,children:V.name},U));let L;u==="add"?L=Ce.get("Add"):u==="edit"?L=Ce.get("Save"):L=Ce.get("OK");let $;u==="add"?$=Ce.get("Add Server"):u==="edit"?$=Ce.get("Edit Server"):$=Ce.get("Select Server");let j;return u==="add"||u==="edit"?j=O.jsxs(Nc,{dividers:!0,children:[O.jsx(Ri,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:mC.textField,margin:"normal",value:l.name,onChange:v}),O.jsx("br",{}),O.jsx(Ri,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:mC.textField2,margin:"normal",value:l.url,onChange:y})]}):j=O.jsx(Nc,{dividers:!0,children:O.jsxs("div",{children:[O.jsxs(ld,{variant:"standard",sx:mC.formControl,children:[O.jsx(_v,{htmlFor:"server-name",children:"Name"}),O.jsx(Th,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:A}),O.jsx(lle,{children:l.url})]}),O.jsx(Mn,{sx:mC.button,"aria-label":"Add",color:"primary",onClick:b,size:"large",children:O.jsx(Cae,{fontSize:"small"})}),O.jsx(Mn,{sx:mC.button,"aria-label":"Edit",onClick:w,size:"large",children:O.jsx(bP,{fontSize:"small"})}),O.jsx(Mn,{sx:mC.button,"aria-label":"Delete",disabled:s.length<2,onClick:S,size:"large",children:O.jsx(Aut,{fontSize:"small"})})]})}),O.jsxs(Gu,{open:e,onClose:g,"aria-labelledby":"server-dialog-title",children:[O.jsx(gg,{id:"server-dialog-title",children:$}),j,O.jsxs(Cb,{children:[O.jsx(ji,{onClick:p,children:Ce.get("Cancel")}),O.jsx(ji,{onClick:h,autoFocus:!0,children:L})]})]})}const vur=e=>({open:!!e.controlState.dialogOpen.server,servers:V6e(e),selectedServer:Vo(e)}),yur={closeDialog:$S,configureServers:YOn},bur=dr(vur,yur)(mur),Bee={settingsPanelTitle:e=>({marginBottom:e.spacing(1)}),settingsPanelPaper:e=>({backgroundColor:(e.palette.mode==="dark"?hh:dh)(e.palette.background.paper,.1),marginBottom:e.spacing(2)}),settingsPanelList:{margin:0}},DC=({title:e,children:t})=>{const n=Te.Children.count(t),r=[];return Te.Children.forEach(t,(i,o)=>{r.push(i),o{let i;t||(i={marginBottom:10});const o=O.jsx(Yi,{primary:e,secondary:t});let s;return r&&(s=O.jsx(NA,{children:r})),n?O.jsxs(rBe,{style:i,onClick:n,children:[o,s]}):O.jsxs(cO,{style:i,children:[o,s]})},fp=({propertyName:e,settings:t,updateSettings:n,disabled:r})=>O.jsx(gle,{checked:!!t[e],onChange:()=>n({...t,[e]:!t[e]}),disabled:r}),xur=({propertyName:e,settings:t,updateSettings:n,options:r,disabled:i})=>{const o=(s,a)=>{n({...t,[e]:a})};return O.jsx(oU,{row:!0,value:t[e],onChange:o,children:r.map(([s,a])=>O.jsx(sh,{control:O.jsx(uO,{}),value:a,label:s,disabled:i},s))})},jx={textField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),fontSize:e.typography.fontSize/2}),intTextField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),fontSize:e.typography.fontSize/2,width:e.spacing(6)})},o5e=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],wur=[["point","Points"],["line","Lines"],["bar","Bars"]],Sur=[[96,"Screen Resolution (96 DPI)"],[150,"Intermediate Resolution (150 DPI)"],[300,"Print Resolution (300 DPI)"],[600,"Professional Print Resolution (600 DPI)"]],_ur=({open:e,closeDialog:t,settings:n,selectedServer:r,userBaseMapLayers:i,userOverlayLayers:o,updateSettings:s,changeLocale:a,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=Te.useState(null),[h,p]=Te.useState(n.timeChunkSize+""),g=is();if(Te.useEffect(()=>{const A=parseInt(h);!Number.isNaN(A)&&A!==n.timeChunkSize&&s({timeChunkSize:A})},[h,n,s]),!e)return null;function m(){t("settings")}function v(){l("server")}function y(A){s({timeAnimationInterval:parseInt(A.target.value)})}function b(A){s({timeSeriesChartTypeDefault:A.target.value})}function w(A){s({datasetLocateMode:A.target.value})}function S(A){s({placeLocateMode:A.target.value})}function _(A){p(A.target.value)}let E=null;f&&(E=Object.getOwnPropertyNames(Ce.languages).map(A=>{const L=Ce.languages[A];return O.jsx(tr,{selected:A===n.locale,onClick:()=>a(A),children:O.jsx(Yi,{primary:L})},A)}));function T(A){d(A.currentTarget)}function k(){d(null)}const P=A=>{A.stopPropagation(),l("userBaseMaps")};function R(A){s({exportResolution:parseInt(A.target.value)})}const I=A=>{A.stopPropagation(),l("userOverlays")};function F(A){s({themeMode:A.target.value})}return O.jsxs("div",{children:[O.jsxs(Gu,{open:e,fullWidth:!0,maxWidth:"sm",onClose:m,scroll:"body",children:[O.jsx(gg,{children:Ce.get("Settings")}),O.jsxs(Nc,{children:[O.jsxs(DC,{title:Ce.get("General"),children:[O.jsx($i,{label:Ce.get("Server"),value:r.name,onClick:v}),O.jsx($i,{label:Ce.get("Language"),value:Ce.languages[n.locale],onClick:T}),O.jsx($i,{label:Ce.get("Time interval of the player"),children:O.jsx(Ri,{variant:"standard",select:!0,sx:jx.textField,value:n.timeAnimationInterval,onChange:y,margin:"normal",children:xPt.map((A,L)=>O.jsx(tr,{value:A,children:A+" ms"},L))})}),O.jsx($i,{label:Ce.get("Image export resolution"),children:O.jsx(Ri,{variant:"standard",select:!0,sx:jx.textField,value:n.exportResolution,onChange:R,margin:"normal",children:Sur.map(([A,L])=>O.jsx(tr,{value:A,children:Ce.get(L)},A))})}),O.jsx($i,{label:Ce.get("Appearance mode"),children:O.jsx(Ri,{variant:"standard",select:!0,sx:jx.textField,value:n.themeMode||g.palette.mode,onChange:F,margin:"normal",children:wPt.map(([A,L])=>O.jsx(tr,{value:A,children:Ce.get(L)},A))})})]}),O.jsxs(DC,{title:Ce.get("Time-Series"),children:[O.jsx($i,{label:Ce.get("Show chart after adding a place"),value:vC(n.autoShowTimeSeries),children:O.jsx(fp,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Default chart type"),children:O.jsx(Ri,{variant:"standard",select:!0,sx:jx.textField,value:n.timeSeriesChartTypeDefault,onChange:b,margin:"normal",children:wur.map(([A,L])=>O.jsx(tr,{value:A,children:Ce.get(L)},A))})}),O.jsx($i,{label:Ce.get("Calculate standard deviation"),value:vC(n.timeSeriesIncludeStdev),children:O.jsx(fp,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Calculate median instead of mean (disables standard deviation)"),value:vC(n.timeSeriesUseMedian),children:O.jsx(fp,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Minimal number of data points in a time series update"),children:O.jsx(Ri,{variant:"standard",sx:jx.intTextField,value:h,onChange:_,margin:"normal",size:"small"})})]}),O.jsxs(DC,{title:Ce.get("Map"),children:[O.jsx($i,{label:Ce.get("User Base Maps")+"...",value:`${i.length} ${Ce.get("defined")}`,onClick:P}),O.jsx($i,{label:Ce.get("User Overlays")+"...",value:`${o.length} ${Ce.get("defined")}`,onClick:I}),O.jsx($i,{label:Ce.get("Projection"),children:O.jsx(xur,{propertyName:"mapProjection",settings:n,updateSettings:s,options:[[Ce.get("Geographic"),aS],[Ce.get("Mercator"),iD]]})}),O.jsx($i,{label:Ce.get("Image smoothing"),value:vC(n.imageSmoothingEnabled),children:O.jsx(fp,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Show tile loading progress"),value:vC(n.showProgressBar),children:O.jsx(fp,{propertyName:"showProgressBar",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Show zoom level indicator"),value:vC(n.showZoomInfoBox),children:O.jsx(fp,{propertyName:"showZoomInfoBox",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("On dataset selection"),children:O.jsx(Ri,{variant:"standard",select:!0,sx:jx.textField,value:n.datasetLocateMode,onChange:w,margin:"normal",children:o5e.map(([A,L])=>O.jsx(tr,{value:A,children:Ce.get(L)},A))})}),O.jsx($i,{label:Ce.get("On place selection"),children:O.jsx(Ri,{variant:"standard",select:!0,sx:jx.textField,value:n.placeLocateMode,onChange:S,margin:"normal",children:o5e.map(([A,L])=>O.jsx(tr,{value:A,children:Ce.get(L)},A))})})]}),O.jsx(DC,{title:Ce.get("Legal Agreement"),children:O.jsx($i,{label:Ce.get("Privacy notice"),value:n.privacyNoticeAccepted?Ce.get("Accepted"):"",children:O.jsx(ji,{disabled:!n.privacyNoticeAccepted,onClick:()=>{s({privacyNoticeAccepted:!1}),window.location.reload()},children:Ce.get("Revoke consent")})})}),O.jsxs(DC,{title:Ce.get("System Information"),children:[O.jsx($i,{label:`xcube Viewer ${Ce.get("version")}`,value:c}),O.jsx($i,{label:`xcube Server ${Ce.get("version")}`,value:u?u.version:Ce.get("Cannot reach server")})]})]})]}),O.jsx(iS,{anchorEl:f,keepMounted:!0,open:!!f,onClose:k,children:E})]})},vC=e=>e?Ce.get("On"):Ce.get("Off"),Cur=e=>({locale:e.controlState.locale,open:e.controlState.dialogOpen.settings,settings:e.controlState,userBaseMapLayers:G6e(e),userOverlayLayers:q6e(e),selectedServer:Vo(e),viewerVersion:Vet,serverInfo:e.dataState.serverInfo}),Our={closeDialog:$S,updateSettings:zL,changeLocale:ame,openDialog:FS},Eur=dr(Cur,Our)(_ur),s5e={separatorTextField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),fontSize:e.typography.fontSize/2,maxWidth:"5rem"}),fileNameTextField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),fontSize:e.typography.fontSize/2})},Tur=({open:e,closeDialog:t,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{t("export")};function s(c){r({exportFileName:c.target.value})}function a(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return O.jsx("div",{children:O.jsxs(Gu,{open:e,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[O.jsx(Nc,{children:O.jsxs(DC,{title:Ce.get("Export Settings"),children:[O.jsx($i,{label:Ce.get("Include time-series data")+" (*.txt)",value:bz(n.exportTimeSeries),children:O.jsx(fp,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),O.jsx($i,{label:Ce.get("Separator for time-series data"),children:O.jsx(Ri,{variant:"standard",sx:s5e.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:a,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),O.jsx($i,{label:Ce.get("Include places data")+" (*.geojson)",value:bz(n.exportPlaces),children:O.jsx(fp,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),O.jsx($i,{label:Ce.get("Combine place data in one file"),value:bz(n.exportPlacesAsCollection),children:O.jsx(fp,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),O.jsx($i,{label:Ce.get("As ZIP archive"),value:bz(n.exportZipArchive),children:O.jsx(fp,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),O.jsx($i,{label:Ce.get("File name"),children:O.jsx(Ri,{variant:"standard",sx:s5e.fileNameTextField,value:n.exportFileName,onChange:s,margin:"normal",size:"small"})})]})}),O.jsx(Cb,{children:O.jsx(ji,{onClick:l,disabled:!Mur(n),children:Ce.get("Download")})})]})})},bz=e=>e?Ce.get("On"):Ce.get("Off"),Pur=e=>/^[0-9a-zA-Z_-]+$/.test(e),kur=e=>e.toUpperCase()==="TAB"||e.length===1,Mur=e=>(e.exportTimeSeries||e.exportPlaces)&&Pur(e.exportFileName)&&(!e.exportTimeSeries||kur(e.exportTimeSeriesSeparator)),Aur=e=>({locale:e.controlState.locale,open:!!e.controlState.dialogOpen.export,settings:e.controlState}),Rur={closeDialog:$S,updateSettings:zL,downloadTimeSeries:iEn},Iur=dr(Aur,Rur)(Tur),Dur=ot(O.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),Lur=({title:e,accept:t,multiple:n,disabled:r,onSelect:i,className:o})=>{const s=M.useRef(null),a=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f{s.current!==null&&s.current.click()};return O.jsxs(O.Fragment,{children:[O.jsx("input",{type:"file",accept:t,multiple:n,ref:s,hidden:!0,onChange:a,disabled:r}),O.jsx(ji,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:e})]})},Uee={parse:e=>e,format:e=>typeof e=="string"?e:`${e}`,validate:e=>!0};function cye(){return e=>{const{options:t,updateOptions:n,optionKey:r,label:i,style:o,className:s,disabled:a,parse:l,format:c,validate:u}=e,f=t[r],d=h=>{const p=h.target.value,g=(l||Uee.parse)(p);n({[r]:g})};return O.jsx(Ri,{label:Ce.get(i),value:(c||Uee.format)(f),error:!(u||Uee.validate)(f),onChange:d,style:o,className:s,disabled:a,size:"small",variant:"standard"})}}const V2=cye(),Fur=Qn("div")(({theme:e})=>({paddingTop:e.spacing(2)})),$ur=({options:e,updateOptions:t})=>O.jsx(Fur,{children:O.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[O.jsx(V2,{optionKey:"timeNames",label:"Time property names",options:e,updateOptions:t}),O.jsx("div",{id:"spareField"}),O.jsx(V2,{label:"Group property names",optionKey:"groupNames",options:e,updateOptions:t}),O.jsx(V2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:e,updateOptions:t}),O.jsx(V2,{label:"Label property names",optionKey:"labelNames",options:e,updateOptions:t}),O.jsx(V2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:e,updateOptions:t})]})}),Tl=cye(),Nur=Qn("div")(({theme:e})=>({paddingTop:e.spacing(2)})),zur=({options:e,updateOptions:t})=>{const n=e.forceGeometry;return O.jsxs(Nur,{children:[O.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[O.jsx(Tl,{optionKey:"xNames",label:"X/longitude column names",options:e,updateOptions:t,disabled:n}),O.jsx(Tl,{optionKey:"yNames",label:"Y/latitude column names",options:e,updateOptions:t,disabled:n}),O.jsxs("span",{children:[O.jsx(FA,{checked:e.forceGeometry,onChange:r=>t({forceGeometry:r.target.checked}),size:"small"}),O.jsx("span",{children:"Use geometry column"})]}),O.jsx(Tl,{optionKey:"geometryNames",label:"Geometry column names",options:e,updateOptions:t,disabled:!n}),O.jsx(Tl,{optionKey:"timeNames",label:"Time column names",options:e,updateOptions:t}),O.jsx("div",{id:"spareField"}),O.jsx(Tl,{optionKey:"groupNames",label:"Group column names",options:e,updateOptions:t}),O.jsx(Tl,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:e,updateOptions:t}),O.jsx(Tl,{optionKey:"labelNames",label:"Label column names",options:e,updateOptions:t}),O.jsx(Tl,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:e,updateOptions:t})]}),O.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[O.jsx(Tl,{optionKey:"separator",label:"Separator character",options:e,updateOptions:t}),O.jsx(Tl,{optionKey:"comment",label:"Comment character",options:e,updateOptions:t}),O.jsx(Tl,{optionKey:"quote",label:"Quote character",options:e,updateOptions:t}),O.jsx(Tl,{optionKey:"escape",label:"Escape character",options:e,updateOptions:t}),O.jsx("div",{}),O.jsxs("span",{children:[O.jsx(FA,{checked:e.trim,onChange:r=>t({trim:r.target.checked}),size:"small"}),O.jsx("span",{children:"Remove whitespaces"})]}),O.jsx(Tl,{optionKey:"nanToken",label:"Not-a-number token",options:e,updateOptions:t}),O.jsx(Tl,{optionKey:"trueToken",label:"True token",options:e,updateOptions:t}),O.jsx(Tl,{optionKey:"falseToken",label:"False token",options:e,updateOptions:t})]})]})},W2=cye(),jur=Qn("div")(({theme:e})=>({paddingTop:e.spacing(2)})),Bur=({options:e,updateOptions:t})=>O.jsx(jur,{children:O.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[O.jsx(W2,{optionKey:"time",label:"Time (UTC, ISO-format)",options:e,updateOptions:t}),O.jsx("div",{id:"spareField"}),O.jsx(W2,{label:"Group",options:e,optionKey:"group",updateOptions:t}),O.jsx(W2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:e,updateOptions:t,disabled:e.group.trim()!==""}),O.jsx(W2,{label:"Label",optionKey:"label",options:e,updateOptions:t}),O.jsx(W2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:e,updateOptions:t,disabled:e.label.trim()!==""})]})}),Vee={csv:{...m4e,codeExt:[]},geojson:{...v4e,codeExt:[xat()]},wkt:{...x4e,codeExt:[]}},Wee={spacer:{flexGrow:1},actionButton:e=>({marginRight:e.spacing(1)}),error:{fontSize:"small"}},Uur=Qn("div")(({theme:e})=>({paddingTop:e.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),Vur=Qn(Lur)(({theme:e})=>({marginRight:e.spacing(1)})),Wur=({open:e,closeDialog:t,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:s,setMapInteraction:a})=>{const[l,c]=M.useState(""),[u,f]=M.useState(null),[d,h]=M.useState(!1),[p,g]=M.useState(!1),[m,v]=M.useState(n),[y,b]=M.useState(r),w=is();if(M.useEffect(()=>{v(n)},[n]),M.useEffect(()=>{b(r)},[r]),!e)return null;const S=()=>{a("Select"),t("addUserPlacesFromText"),i({userPlacesFormatName:m,userPlacesFormatOptions:y}),o(l)},_=()=>{a(s),t("addUserPlacesFromText")},E=()=>{c("")},T=j=>{const V=j[0];h(!0);const U=new FileReader;U.onloadend=()=>{const z=U.result;v(fwe(z)),c(z),h(!1)},U.onabort=U.onerror=()=>{h(!1)},U.readAsText(V,"UTF-8")},k=()=>{c("")},P=()=>{console.debug("pasted text:",l)},R=j=>{let V=m;l===""&&j.length>10&&(V=fwe(j),v(V)),c(j),f(Vee[V].checkError(j))};function I(j){v(j.target.value)}function F(j){b({...y,csv:{...y.csv,...j}})}function A(j){b({...y,geojson:{...y.geojson,...j}})}function L(j){b({...y,wkt:{...y.wkt,...j}})}let $;return m==="csv"?$=O.jsx(zur,{options:y.csv,updateOptions:F}):m==="geojson"?$=O.jsx($ur,{options:y.geojson,updateOptions:A}):$=O.jsx(Bur,{options:y.wkt,updateOptions:L}),O.jsxs(Gu,{fullWidth:!0,open:e,onClose:_,"aria-labelledby":"server-dialog-title",children:[O.jsx(gg,{id:"server-dialog-title",children:Ce.get("Import places")}),O.jsxs(Nc,{dividers:!0,children:[O.jsxs(oU,{row:!0,value:m,onChange:j=>I(j),children:[O.jsx(sh,{value:"csv",label:Ce.get(m4e.name),control:O.jsx(uO,{})},"csv"),O.jsx(sh,{value:"geojson",label:Ce.get(v4e.name),control:O.jsx(uO,{})},"geojson"),O.jsx(sh,{value:"wkt",label:Ce.get(x4e.name),control:O.jsx(uO,{})},"wkt")]}),O.jsx(NW,{theme:w.palette.mode,placeholder:Ce.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:Vee[m].codeExt,value:l,onChange:R,onDrop:k,onPaste:P,onPasteCapture:P}),u&&O.jsx(yn,{color:"error",sx:Wee.error,children:u}),O.jsxs(Uur,{children:[O.jsx(Vur,{title:Ce.get("From File")+"...",accept:Vee[m].fileExt,multiple:!1,onSelect:T,disabled:d}),O.jsx(ji,{onClick:E,disabled:l.trim()===""||d,sx:Wee.actionButton,variant:"outlined",size:"small",children:Ce.get("Clear")}),O.jsx(bt,{sx:Wee.spacer}),O.jsx(ji,{onClick:()=>g(!p),endIcon:p?O.jsx(Dur,{}):O.jsx(wat,{}),variant:"outlined",size:"small",children:Ce.get("Options")})]}),O.jsx($5,{in:p,timeout:"auto",unmountOnExit:!0,children:$})]}),O.jsxs(Cb,{children:[O.jsx(ji,{onClick:_,variant:"text",children:Ce.get("Cancel")}),O.jsx(ji,{onClick:S,disabled:l.trim()===""||u!==null||d,variant:"text",children:Ce.get("OK")})]})]})},Hur=e=>({open:e.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:e.controlState.userPlacesFormatName,userPlacesFormatOptions:e.controlState.userPlacesFormatOptions,nextMapInteraction:e.controlState.lastMapInteraction}),Gur={closeDialog:$S,updateSettings:zL,setMapInteraction:Dtt,addUserPlacesFromText:Yet},qur=dr(Hur,Gur)(Wur),Rut=ot(O.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");function uye(e,t){return Iut(e,t,[]).join("")}function Iut(e,t,n){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)n.push(e.nodeValue);else{var r=void 0;for(r=e.firstChild;r;r=r.nextSibling)Iut(r,t,n)}return n}function Xur(e){return"documentElement"in e}function Yur(e){return new DOMParser().parseFromString(e,"application/xml")}function Dut(e,t){return(function(n,r){var i=e.call(this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}})}function du(e,t,n){return(function(r,i){var o=e.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName,l=void 0;a in s?l=s[a]:(l=[],s[a]=l),l.push(o)}})}function gn(e,t,n){return(function(r,i){var o=e.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName;s[a]=o}})}function ja(e,t,n){var r=n!==void 0?n:{},i,o;for(i=0,o=e.length;i{const n=t.Name,r=t.Title||n;let i;const o=t.Attribution;if(GO(o)){const s=o.Title,a=o.OnlineResource;s&&a?i=`© ${s}`:a?i=`${a}`:s&&(i=`${s}`)}return{name:n,title:r,attribution:i}})}function Nfr(e){const t=Dfr.read(e);if(GO(t)){const n=t.Capability;if(GO(n))return Oae(n,!0)}throw new Error("invalid WMSCapabilities object")}function Oae(e,t){let n,r;if(t)n=e.Layer;else{const{Layer:o,...s}=e;n=o,r=s}let i;return Array.isArray(n)?i=n.flatMap(o=>Oae(o)):GO(n)?i=Oae(n):i=[{}],i.map(o=>zfr(r,o))}function zfr(e,t){if(!e)return t;if(typeof(e.Name||t.Name)!="string")throw new Error("invalid WMSCapabilities: missing Layer/Name");const r=e.Title,i=t.Title,o=r&&i?`${r} / ${i}`:i||r;return{...e,...t,Title:o}}const jfr=({userLayer:e,onChange:t,onCancel:n})=>{const[r,i]=M.useState(e.url),[o,s]=M.useState(null),[a,l]=M.useState(-1);M.useEffect(()=>{Lfr(r).then(f=>{s(f)})},[r]),M.useEffect(()=>{if(o&&e.wms){const{layerName:f}=e.wms;l(o.findIndex(d=>d.name===f))}else l(-1)},[o,e.wms]);const c=()=>o&&o.length&&a!=-1,u=()=>{o&&a!==-1&&t({...e,title:o[a].title,url:r.trim(),attribution:o[a].attribution,wms:{layerName:o[a].name}})};return O.jsxs(bt,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[O.jsx(Ri,{required:!0,label:Ce.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),O.jsx(Th,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:a,size:"small",renderValue:()=>o&&o.length&&a>=0?o[a].title:Ce.get("WMS Layer"),children:(o||[]).map((f,d)=>O.jsx(tr,{value:d,selected:a===d,children:O.jsx(Yi,{primary:f.title})},f.name))}),O.jsx(_W,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:Ce.get("docs/add-layer-wms.en.md")})]})},Bfr=({userLayer:e,onChange:t,onCancel:n})=>{const[r,i]=Te.useState(e.title),[o,s]=Te.useState(e.url),[a,l]=Te.useState(e.attribution||""),c=(d,h)=>{const p=d!=="",g=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&g},u=()=>c(r.trim(),o.trim()),f=()=>t({...e,title:r.trim(),url:o.trim(),attribution:a.trim()});return O.jsxs(bt,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[O.jsx(Ri,{required:!0,label:Ce.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>s(d.currentTarget.value)}),O.jsxs(bt,{sx:{display:"flex",gap:1},children:[O.jsx(Ri,{required:!0,label:Ce.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),O.jsx(Ri,{label:Ce.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:a,onChange:d=>l(d.currentTarget.value)})]}),O.jsx(_W,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:Ce.get("docs/add-layer-xyz.en.md")})]})},Ufr={paper:e=>({backgroundColor:(e.palette.mode==="dark"?hh:dh)(e.palette.background.paper,.1),marginBottom:e.spacing(2)})},a5e=({userLayers:e,setUserLayers:t,selectedId:n,setSelectedId:r})=>{const[i,o]=Te.useState(n),[s,a]=Te.useState(null),[l,c]=Wrt();if(!open)return null;const u=b=>{c(()=>t(e)),a({editId:b.id,editMode:"edit"})},f=b=>{c(void 0);const w=e.findIndex(S=>S.id===b.id);t([...e.slice(0,w+1),{...b,id:mh("user-layer"),title:b.title+" Copy"},...e.slice(w+1)])},d=b=>{c(void 0);const w=e.findIndex(S=>S.id===b.id);b.id===n&&r(i),b.id===i&&o(null),t([...e.slice(0,w),...e.slice(w+1)])},h=b=>{c(()=>t(e));const w=mh("user-layer-");t([...e,{id:w,title:"",url:"",attribution:"",wms:b==="wms"?{layerName:""}:void 0}]),a({editId:w,editMode:"add"})},p=()=>{h("wms")},g=()=>{h("xyz")},m=b=>{c(void 0);const w=e.findIndex(S=>S.id===b.id);n===b.id&&r(i),t([...e.slice(0,w),b,...e.slice(w+1)]),a(null)},v=()=>{if(l(),s&&s.editMode==="add"){const b=e.findIndex(w=>w.id===s.editId);t([...e.slice(0,b),...e.slice(b+1)])}a(null)},y=s!==null;return O.jsx(fa,{sx:Ufr.paper,children:O.jsxs(tD,{component:"nav",dense:!0,children:[e.map(b=>{const w=n===b.id;return s&&s.editId===b.id?b.wms?O.jsx(jfr,{userLayer:b,onChange:m,onCancel:v},b.id):O.jsx(Bfr,{userLayer:b,onChange:m,onCancel:v},b.id):O.jsxs(rBe,{selected:w,onClick:()=>r(w?null:b.id),children:[O.jsx(Yi,{primary:b.title,secondary:b.url}),O.jsxs(NA,{children:[O.jsx(Mn,{onClick:()=>u(b),size:"small",disabled:y,children:O.jsx(bP,{})}),O.jsx(Mn,{onClick:()=>f(b),size:"small",disabled:y,children:O.jsx(Rut,{})}),O.jsx(Mn,{onClick:()=>d(b),size:"small",disabled:y,children:O.jsx(yP,{})})]})]},b.id)}),!y&&O.jsx(cO,{sx:{minHeight:"2rem"},children:O.jsx(NA,{children:O.jsxs(bt,{sx:{display:"flex",gap:2,paddingTop:2},children:[O.jsx(_n,{title:Ce.get("Add layer from a Web Map Service"),children:O.jsx(ji,{onClick:p,startIcon:O.jsx(Cae,{}),children:"WMS"})}),O.jsx(_n,{title:Ce.get("Add layer from a Tiled Web Map"),children:O.jsx(ji,{onClick:g,startIcon:O.jsx(Cae,{}),children:"XYZ"})})]})})})]})})},Vfr=({dialogId:e,open:t,closeDialog:n,settings:r,updateSettings:i,setLayerVisibilities:o})=>{const[s,a]=M.useState(null),[l,c]=M.useState(null),u=M.useCallback((w,S)=>{const _={};w&&(_[w]=!1),S&&(_[S]=!0),o(_)},[o]),f=M.useCallback(w=>{a(w),u(s,w)},[s,u]),d=M.useCallback(w=>{c(w),u(s,w)},[s,u]),[h,p]=M.useState(e==="userBaseMaps"?0:1),g=r.userBaseMaps,m=M.useCallback(w=>{i({userBaseMaps:w})},[i]),v=r.userOverlays,y=M.useCallback(w=>{i({userOverlays:w})},[i]);function b(){n(e)}return t?O.jsxs(Gu,{open:t,fullWidth:!0,maxWidth:"sm",onClose:b,scroll:"body",children:[O.jsx(gg,{children:Ce.get("User Layers")}),O.jsxs(Nc,{children:[O.jsx(bt,{sx:{borderBottom:1,borderColor:"divider"},children:O.jsxs(vle,{value:h,onChange:(w,S)=>p(S),children:[O.jsx(zA,{label:Ce.get("Base Maps")}),O.jsx(zA,{label:Ce.get("Overlays")})]})}),h===0&&O.jsx(a5e,{userLayers:g,setUserLayers:m,selectedId:s,setSelectedId:f},"baseMaps"),h===1&&O.jsx(a5e,{userLayers:v,setUserLayers:y,selectedId:l,setSelectedId:d},"overlays")]})]}):null},Wfr=(e,t)=>({open:e.controlState.dialogOpen[t.dialogId],settings:e.controlState,dialogId:t.dialogId,layerVisibilities:_U(e)}),Hfr={closeDialog:$S,updateSettings:zL,setLayerVisibilities:Stt},l5e=dr(Wfr,Hfr)(Vfr),Gfr=ot(O.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore");function zut({selected:e,title:t,actions:n}){return O.jsxs(nD,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...e&&{background:r=>Bt(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[O.jsx(Qie,{}),O.jsx(yn,{sx:{flex:"1 1 100%",paddingLeft:1},children:t}),n]})}const qfr={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function Xfr({userVariables:e,setUserVariables:t,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?e[n]:null,s=n>=0,a=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:$Pn()})},c=()=>{const d=e[n];t([...e.slice(0,n+1),NPn(d),...e.slice(n+1)]),r(n+1)},u=()=>{i({editMode:"edit",variable:o})},f=()=>{t([...e.slice(0,n),...e.slice(n+1)]),n>=e.length-1&&r(e.length-2)};return O.jsxs(O.Fragment,{children:[O.jsx(zut,{selected:n!==null,title:Ce.get("Manage user variables"),actions:O.jsxs(O.Fragment,{children:[O.jsx(_n,{title:Ce.get("Add user variable"),children:O.jsx(Mn,{color:"primary",onClick:l,children:O.jsx(SW,{})})}),s&&O.jsx(_n,{title:Ce.get("Duplicate user variable"),children:O.jsx(Mn,{onClick:c,children:O.jsx(Rut,{})})}),s&&O.jsx(_n,{title:Ce.get("Edit user variable"),children:O.jsx(Mn,{onClick:u,children:O.jsx(bP,{})})}),s&&O.jsx(_n,{title:Ce.get("Remove user variable"),children:O.jsx(Mn,{onClick:f,children:O.jsx(Aut,{})})})]})}),O.jsx(mle,{sx:qfr.tableContainer,children:O.jsxs(sU,{size:"small",children:[O.jsx(pBe,{children:O.jsxs(pf,{children:[O.jsx(mi,{sx:{width:"15%"},children:Ce.get("Name")}),O.jsx(mi,{sx:{width:"15%"},children:Ce.get("Title")}),O.jsx(mi,{sx:{width:"10%"},children:Ce.get("Units")}),O.jsx(mi,{children:Ce.get("Expression")})]})}),O.jsx(lU,{children:e.map((d,h)=>O.jsxs(pf,{hover:!0,selected:h===n,onClick:()=>a(h),children:[O.jsx(mi,{component:"th",scope:"row",children:d.name}),O.jsx(mi,{children:d.title}),O.jsx(mi,{children:d.units}),O.jsx(mi,{children:d.expression||""})]},d.id))})]})})]})}const Yfr=ot(O.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),Qfr=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function Kfr(e){return Qfr.test(e)}const c5e={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function u5e({part:e,partType:t,onPartClicked:n}){return O.jsx(bt,{component:"span",sx:c5e.expressionPart,children:O.jsx(J6,{label:e,sx:c5e.expressionPartChip,size:"small",variant:"outlined",color:t==="variables"||t==="constants"?"default":t.includes("Functions")?"primary":"secondary",onClick:()=>n(e)})})}function Zfr({anchorEl:e,exprPartTypes:t,setExprPartTypes:n,onClose:r}){const i=o=>{n({...t,[o]:!t[o]})};return O.jsx(iS,{open:!!e,anchorEl:e,onClose:r,children:Ont.map(o=>O.jsx(Mut,{selected:t[o],title:Ce.get(jPn[o]),onClick:()=>i(o),dense:!0},o))})}function Jfr({expression:e,onExpressionChange:t,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=tS(),s=M.useRef(null),a=M.useCallback(c=>{const u=s.current?.view;if(u){const f=u.state.selection.main,d=u.state.sliceDoc(f.from,f.to).trim();d!==""&&c.includes("X")&&(c=c.replace("X",d));const h=u.state.replaceSelection(c);h&&u.dispatch(h)}},[]);M.useEffect(()=>{i.current=a},[i,a]);const l=M.useCallback(c=>{const u=c.matchBefore(/\w*/);return u===null||u.from==u.to&&!c.explicit?null:{from:u.from,options:[...n.map(f=>({label:f,type:"variable"})),...r.namespace.constants.map(f=>({label:f,type:"variable"})),...r.namespace.arrayFunctions.map(f=>({label:f,type:"function"})),...r.namespace.otherFunctions.map(f=>({label:f,type:"function"}))]}},[n,r.namespace]);return O.jsx(NW,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:Ce.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[wst({override:[l]})],value:e,onChange:t,ref:s})}async function edr(e,t,n){if(n.trim()==="")return Ce.get("Must not be empty");const r=`${e}/expressions/validate/${PT(t)}/${encodeURIComponent(n)}`;try{return await xBe(r),null}catch(i){const o=i.message;if(o){const s=o.indexOf("("),a=o.lastIndexOf(")");return o.slice(s>=0?s+1:0,a>=0?a:o.length)}return Ce.get("Invalid expression")}}const xz={container:{display:"flex",flexDirection:"column",height:"100%"},content:{flexGrow:1,display:"flex",flexDirection:"column",gap:2,padding:1},propertiesRow:{display:"flex",gap:1},expressionRow:{flexGrow:1},expressionParts:{paddingTop:1,overflowY:"auto"},expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function tdr({userVariables:e,editedVariable:t,setEditedVariable:n,contextDataset:r,expressionCapabilities:i,serverUrl:o,canCommit:s,setCanCommit:a}){const[l,c]=M.useState(zPn),[u,f]=M.useState(null),d=[...e,...r.variables],h=r.variables.filter(z=>!dD(z)).map(z=>z.name),{id:p,name:g,title:m,units:v,expression:y}=t.variable,b=d.findIndex(z=>z.id!==p&&z.name===g)>=0,w=!Kfr(g),S=b?Ce.get("Already in use"):w?Ce.get("Not a valid identifier"):null,_=!S,[E,T]=M.useState(null);s=_&&!E,M.useEffect(()=>{a(s)},[a,s]);const P=M.useRef(null);M.useEffect(()=>{const z=setTimeout(()=>{edr(o,r.id,t.variable.expression).then(T)},500);return()=>{clearTimeout(z)}},[o,r.id,t.variable.expression]);const R=(z,N)=>{n({...t,variable:{...t.variable,[z]:N}})},I=z=>{R("name",z.target.value)},F=z=>{R("title",z.target.value)},A=z=>{R("units",z.target.value)},L=z=>{R("expression",z)},$=z=>{P.current(z)},j=z=>{f(z.currentTarget)},V=()=>{f(null)},U=[O.jsx(Mn,{size:"small",onClick:j,children:O.jsx(_n,{arrow:!0,title:Ce.get("Display further elements to be used in expressions"),children:O.jsx(Yfr,{})})},"filter")];return Ont.forEach(z=>{l[z]&&(z==="variables"?h.forEach(N=>{U.push(O.jsx(u5e,{part:N,partType:z,onPartClicked:$},`${z}-${N}`))}):i.namespace[z].forEach(N=>{U.push(O.jsx(u5e,{part:N,partType:z,onPartClicked:$},`${z}-${N}`))}))}),O.jsxs(O.Fragment,{children:[O.jsx(Zfr,{anchorEl:u,exprPartTypes:l,setExprPartTypes:c,onClose:V}),O.jsx(zut,{selected:!0,title:t.editMode==="add"?Ce.get("Add user variable"):Ce.get("Edit user variable")}),O.jsxs(bt,{sx:xz.content,children:[O.jsxs(bt,{sx:xz.propertiesRow,children:[O.jsx(Ri,{sx:{flexGrow:.3},error:!_,helperText:S,size:"small",variant:"standard",label:Ce.get("Name"),value:g,onChange:I}),O.jsx(Ri,{sx:{flexGrow:.6},size:"small",variant:"standard",label:Ce.get("Title"),value:m,onChange:F}),O.jsx(Ri,{sx:{flexGrow:.1},size:"small",variant:"standard",label:Ce.get("Units"),value:v,onChange:A})]}),O.jsxs(bt,{sx:xz.expressionRow,children:[O.jsx(yn,{sx:z=>({paddingBottom:1,color:z.palette.text.secondary}),children:Ce.get("Expression")}),O.jsx(Jfr,{expression:y,onExpressionChange:L,variableNames:h,expressionCapabilities:i,handleInsertPartRef:P}),E&&O.jsx(yn,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:E}),O.jsx(bt,{sx:xz.expressionParts,children:U})]})]})]})}const f5e={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function ndr({open:e,closeDialog:t,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:s,expressionCapabilities:a,serverUrl:l}){const[c,u]=M.useState(o),[f,d]=M.useState(c.findIndex(S=>S.name===r)),[h,p]=M.useState(null),[g,m]=M.useState(!1);if(M.useEffect(()=>{u(o)},[o]),!e||!n||!a)return null;function v(){s(n.id,c),t(y4),f>=0&&i(c[f].name)}function y(){u(o),t(y4)}function b(){p(null)}function w(){if(h){if(h.editMode==="add")u([h.variable,...c]);else{const S=c.findIndex(_=>_.id===h.variable.id);if(S>=0){const _=[...c];_[S]=h.variable,u(_)}}p(null)}}return O.jsxs(Gu,{open:e,fullWidth:!0,maxWidth:"md",onClose:y,scroll:"body",children:[O.jsx(gg,{children:Ce.get("User Variables")}),O.jsx(Nc,{dividers:!0,sx:f5e.dialogContent,children:h===null?O.jsx(Xfr,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):O.jsx(tdr,{userVariables:c,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:a,serverUrl:l,canCommit:g,setCanCommit:m})}),O.jsxs(Cb,{sx:f5e.dialogActions,children:[O.jsx(bt,{children:O.jsx(Hrt,{size:"medium",helpUrl:Ce.get("docs/user-variables.en.md")})}),h!==null?O.jsxs(bt,{children:[O.jsx(ji,{onClick:b,startIcon:O.jsx(Gfr,{}),children:Ce.get("Back")}),O.jsx(ji,{onClick:w,disabled:!g,children:Ce.get(h.editMode==="edit"?"Apply":"Add")})]}):O.jsxs(bt,{children:[O.jsx(ji,{onClick:y,children:Ce.get("Cancel")}),O.jsx(ji,{onClick:v,disabled:!rdr(c),children:Ce.get("OK")})]})]})]})}function rdr(e){const t=new Set;return e.forEach(n=>t.add(n.name)),t.size===e.length}const idr=e=>({open:e.controlState.dialogOpen[y4],selectedDataset:Co(e),selectedVariableName:dS(e),userVariables:wLt(e),expressionCapabilities:jDt(e),serverUrl:Vo(e).url,themeMode:e.controlState.themeMode}),odr={closeDialog:$S,selectVariable:Ttt,updateDatasetUserVariables:MOn},sdr=dr(idr,odr)(ndr),adr=e=>({compact:!!On.instance.branding.compact,themeMode:e.controlState.themeMode}),ldr={},cdr=({compact:e,themeMode:t})=>{const n=cle("(prefers-color-scheme: dark)")?"dark":"light",r=M.useMemo(()=>{let o=S4e(t,n)==="dark"?mOt:gOt;const s=On.instance.branding.primaryColor,a=On.instance.branding.secondaryColor;return s&&(o={...o,palette:{...o.palette,primary:{...s}}}),a&&(o={...o,palette:{...o.palette,secondary:{...a}}}),xT({...o})},[t,n]);return O.jsx(qTn,{children:O.jsx(Tpt,{injectFirst:!0,children:O.jsxs(Jmt,{theme:r,children:[O.jsx(Oxt,{}),O.jsx(QTn,{}),!e&&O.jsx(TPn,{}),O.jsx(Gcr,{}),O.jsx(iur,{}),O.jsx(bur,{}),O.jsx(Eur,{}),O.jsx(l5e,{dialogId:"userOverlays"},"userOverlays"),O.jsx(l5e,{dialogId:"userBaseMaps"},"userBaseMaps"),O.jsx(sdr,{}),O.jsx(qur,{}),O.jsx(Iur,{}),O.jsx($En,{}),O.jsx(Kcr,{}),O.jsx(gur,{})]})})})},udr=dr(adr,ldr)(cdr);function fdr(e,t,n){switch(e===void 0&&(e=SPt()),t.type){case Xge:{const{controlState:r}=t.persistedState.state;return{...e,...r}}case lme:{const r={...e,...t.settings};return Gh(r),r}case Xtt:return Gh(e),e;case LR:{let r=e.selectedDatasetId||Om.get("dataset"),i=e.selectedVariableName||Om.get("variable"),o=e.mapInteraction,s=dO(t.datasets,r);const a=s&&jte(s,i)||null;return s?a||(i=s.variables.length?s.variables[0].name:null):(r=null,i=null,t.entrypointDatasetId&&(s=dO(t.datasets,t.entrypointDatasetId)),s=t.datasets.length?s||t.datasets[0]:null,s&&(r=s.id,s.variables.length>0&&(i=s.variables[0].name))),r||(o="Select"),{...e,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case htt:{let r=e.selectedVariableName;const i=dO(t.datasets,t.selectedDatasetId);!jte(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const s=t.selectedDatasetId,a=$4e(i),l=a?a[1]:null;return{...e,selectedDatasetId:s,selectedVariableName:r,selectedTimeRange:a,selectedTime:l}}case vtt:{const{location:r}=t;return e.flyTo!==r?{...e,flyTo:r}:e}case ytt:{const r=t.selectedPlaceGroupIds;return{...e,selectedPlaceGroupIds:r,selectedPlaceId:null}}case btt:{const{placeId:r}=t;return{...e,selectedPlaceId:r}}case Ett:return{...e,selectedVariableName:t.selectedVariableName};case xtt:return{...e,layerVisibilities:{...e.layerVisibilities,datasetVariable:!t.visible,datasetRgb:t.visible}};case wtt:return{...e,layerVisibilities:{...e.layerVisibilities,...t.layerVisibilities}};case _tt:return{...e,layerGroupStates:{...e.layerGroupStates,...t.layerGroupStates}};case Ctt:{const{mapPointInfoBoxEnabled:r}=t;return{...e,mapPointInfoBoxEnabled:r}}case Ott:{const{variableCompareMode:r}=t;return{...e,variableCompareMode:r,variableSplitPos:void 0}}case nme:{const{size:r,isDelta:i}=t;return!i&&e.variableSplitPos!==r?{...e,variableSplitPos:r}:Lr(e.variableSplitPos)&&r!==0?{...e,variableSplitPos:e.variableSplitPos+r}:e}case ktt:{let{selectedTime:r}=t;if(r!==null&&n){const i=ene(n),o=i?w6e(i,r):-1;o>=0&&(r=i[o])}return e.selectedTime!==r?{...e,selectedTime:r}:e}case Mtt:{if(n){let r=CUe(n);if(r>=0){const i=ene(n);r+=t.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const s=e.selectedTimeRange;if(s!==null&&(os[1]&&(o=s[1])),e.selectedTime!==o)return{...e,selectedTime:o}}}return e}case rme:return{...e,selectedTimeRange:t.selectedTimeRange};case _En:return{...e,timeSeriesUpdateMode:t.timeSeriesUpdateMode};case Rtt:return{...e,timeAnimationActive:t.timeAnimationActive,timeAnimationInterval:t.timeAnimationInterval};case Qge:{const{id:r,selected:i}=t;return i?ddr(e,Yd,r):e}case Kge:{const{placeGroups:r}=t;return r.length>0?{...e,selectedPlaceGroupIds:[...e.selectedPlaceGroupIds||[],r[0].id]}:e}case Zge:{const{placeGroupId:r,newName:i}=t;return r===Yd?{...e,userDrawnPlaceGroupName:i}:e}case Jge:{const{placeId:r,places:i}=t;if(r===e.selectedPlaceId){let o=null;const s=i.findIndex(a=>a.id===r);return s>=0&&(s0&&(o=i[s-1].id)),{...e,selectedPlaceId:o}}return e}case Ktt:{const r=t.colorBarId;return{...e,userColorBars:[{id:r,type:"continuous",code:z4e},...e.userColorBars]}}case Ztt:{const r=t.colorBarId,i=e.userColorBars.findIndex(o=>o.id===r);if(i>=0){const o={...e,userColorBars:[...e.userColorBars.slice(0,i),...e.userColorBars.slice(i+1)]};return Gh(o),o}return e}case tnt:{const r=t.userColorBar,i=e.userColorBars.findIndex(o=>o.id===r.id);return i>=0?{...e,userColorBars:[...e.userColorBars.slice(0,i),{...r},...e.userColorBars.slice(i+1)]}:e}case Itt:{let r={...e,mapInteraction:t.mapInteraction,lastMapInteraction:e.mapInteraction};return t.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...e.dialogOpen,addUserPlacesFromText:!0}}),r}case Ltt:{const{layerMenuOpen:r}=t;return e={...e,layerMenuOpen:r},Gh(e),e}case $tt:{const{sidePanelOpen:r}=t;return e={...e,sidePanelOpen:r},Gh(e),e}case Ntt:{const{sidePanelId:r}=t;return e={...e,sidePanelId:r},Gh(e),e}case sme:{const{sizeDelta:r}=t;return r?{...e,sidePanelSize:e.sidePanelSize+r}:e}case ztt:return e={...e,volumeRenderMode:t.volumeRenderMode},Gh(e),e;case jtt:{const{volumeId:r,volumeState:i}=t;return e={...e,volumeStates:{...e.volumeStates,[r]:i}},e}case Btt:{const r={...e.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:t.visibleElements.includes(i)}}),e={...e,infoCardElementStates:r},Gh(e),e}case Utt:{const{elementType:r,viewMode:i}=t,o={...e,infoCardElementStates:{...e.infoCardElementStates,[r]:{...e.infoCardElementStates[r],viewMode:i}}};return Gh(o),o}case Vtt:return{...e,activities:{...e.activities,[t.id]:t.message}};case Wtt:{const r={...e.activities};return delete r[t.id],{...e,activities:r}}case Htt:{const r=t.locale;return Ce.locale=r,r!==e.locale&&(e={...e,locale:r},Gh(e)),e}case Gtt:{const r=t.dialogId;return{...e,dialogOpen:{...e.dialogOpen,[r]:!0}}}case qtt:{const r=t.dialogId;return{...e,dialogOpen:{...e.dialogOpen,[r]:!1}}}case Ptt:{const{selectedDataset2Id:r,selectedVariable2Name:i}=t;return r===e.selectedDataset2Id&&i===e.selectedVariable2Name?{...e,selectedDataset2Id:null,selectedVariable2Name:null,variableCompareMode:!1,variableSplitPos:void 0}:{...e,selectedDataset2Id:r,selectedVariable2Name:i,variableCompareMode:!0}}case ume:return{...e,zoomLevel:t.zoomLevel};case fme:return{...e,datasetZLevel:t.datasetZLevel};case eme:if(e.selectedServerId!==t.selectedServerId)return{...e,selectedServerId:t.selectedServerId}}return e}function ddr(e,t,n){let r=e.selectedPlaceGroupIds;return!e.selectedPlaceGroupIds||e.selectedPlaceGroupIds.length===0?r=[t]:e.selectedPlaceGroupIds.find(i=>i===t)||(r=[...e.selectedPlaceGroupIds,t]),{...e,selectedPlaceGroupIds:r,selectedPlaceId:n}}function hdr(){const e=pPt(),t=[{...On.instance.server}];return e.forEach(n=>{t.find(r=>r.id===n.id)||t.push(n)}),{serverInfo:null,expressionCapabilities:null,datasets:[],colorBars:null,statistics:{loading:!1,records:[]},timeSeriesGroups:[],userPlaceGroups:[],userServers:t}}function pdr(e,t){switch(e===void 0&&(e=hdr()),t.type){case Xge:{const{dataState:n}=t.persistedState.state;return{...e,...n}}case p4:return{...e,serverInfo:t.serverInfo};case att:return{...e,expressionCapabilities:t.expressionCapabilities};case LR:return{...e,datasets:t.datasets};case Xet:{const{datasetId:n,userVariables:r}=t,i=e.datasets.findIndex(l=>l.id===n),o=e.datasets[i],[s,a]=Jle(o);return{...e,datasets:[...e.datasets.slice(0,i),{...o,variables:[...s,...r]},...e.datasets.slice(i+1)]}}case ctt:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:s,opacity:a}=t,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:s,opacity:a};return d5e(e,n,r,l)}case ftt:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=t;return d5e(e,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case Yge:{const n=t.placeGroup,r=e.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(s=>s.id===n.id);if(o>=0){const s=[...i.placeGroups];return s[o]=n,{...i,placeGroups:s}}}return i});return{...e,datasets:r}}case Qge:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=t,s={type:"Feature",id:r,properties:i,geometry:o},a=e.userPlaceGroups,l=a.findIndex(c=>c.id===Yd);if(l>=0){const c=a[l];return{...e,userPlaceGroups:[...a.slice(0,l),{...c,features:[...c.features,s]},...a.slice(l+1)]}}else{const c=n&&n!==""?n:Ce.get("My places");return{...e,userPlaceGroups:[{type:"FeatureCollection",id:Yd,title:c,features:[s]},...a]}}}case Kge:{const{placeGroups:n}=t;return{...e,userPlaceGroups:[...e.userPlaceGroups,...n]}}case Zge:{const{placeGroupId:n,newName:r}=t,i=e.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o];return{...e,userPlaceGroups:[...i.slice(0,o),{...s,title:r},...i.slice(o+1)]}}return e}case Qet:{const{placeGroupId:n,placeId:r,newName:i}=t,o=e.userPlaceGroups,s=p5e(o,n,r,{label:i});return s?{...e,userPlaceGroups:s}:e}case Ket:{const{placeGroupId:n,placeId:r,placeStyle:i}=t,o=e.userPlaceGroups,s=p5e(o,n,r,i);return s?{...e,userPlaceGroups:s}:e}case Jge:{const{placeGroupId:n,placeId:r}=t,i=e.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o],a=s.features.findIndex(l=>l.id===r);if(a>=0){const l=h5e(e.timeSeriesGroups,[r]);let c=e.timeSeriesGroups;return l.forEach(u=>{c=qee(c,u,"remove","append")}),{...e,userPlaceGroups:[...i.slice(0,o),{...s,features:[...s.features.slice(0,a),...s.features.slice(a+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return e}case Zet:{const{placeGroupId:n}=t,r=e.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const s=r[i].features.map(c=>c.id),a=h5e(e.timeSeriesGroups,s);let l=e.timeSeriesGroups;return a.forEach(c=>{l=qee(l,c,"remove","append")}),{...e,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return e}case ltt:return{...e,colorBars:t.colorBars};case rtt:{const{timeSeriesGroupId:n,timeSeries:r}=t,i=e.timeSeriesGroups,o=i.findIndex(l=>l.id===n),s=i[o],a=[...i];return a[o]={...s,timeSeriesArray:[...s.timeSeriesArray,r]},{...e,timeSeriesGroups:a}}case ett:{const n=e.statistics;if(t.statistics===null)return{...e,statistics:{...n,loading:!0}};const r=n.records;return{...e,statistics:{...n,loading:!1,records:[t.statistics,...r]}}}case ttt:{const{index:n}=t,r=e.statistics,i=r.records;return{...e,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case ntt:{const{timeSeries:n,updateMode:r,dataMode:i}=t,o=qee(e.timeSeriesGroups,n,r,i);return o!==e.timeSeriesGroups?{...e,timeSeriesGroups:o}:e}case itt:{const n=e.timeSeriesGroups.findIndex(r=>r.id===t.groupId);if(n>=0){const r=[...e.timeSeriesGroups],i={...r[n]},o=[...i.timeSeriesArray];return o.splice(t.index,1),i.timeSeriesArray=o,r[n]=i,{...e,timeSeriesGroups:r}}return e}case ott:{const n=e.timeSeriesGroups.findIndex(r=>r.id===t.id);if(n>=0){const r=[...e.timeSeriesGroups];return r.splice(n,1),{...e,timeSeriesGroups:r}}return e}case stt:return{...e,timeSeriesGroups:[]};case rme:{const{selectedGroupId:n,selectedValueRange:r}=t;if(!n)return e;const i=e.timeSeriesGroups.findIndex(s=>s.id===n),o=r||void 0;return{...e,timeSeriesGroups:[...e.timeSeriesGroups.slice(0,i),{...e.timeSeriesGroups[i],variableRange:o},...e.timeSeriesGroups.slice(i+1)]}}case eme:return e.userServers!==t.servers?(hPt(t.servers),{...e,userServers:t.servers}):e;default:return e}}function d5e(e,t,n,r){const i=e.datasets.findIndex(o=>o.id===t);if(i>=0){const o=e.datasets[i],s=o.variables.findIndex(a=>a.name===n);if(s>=0){const a=o.variables[s],l=e.datasets.slice(),c=o.variables.slice();return c[s]={...a,...r},l[i]={...o,variables:c},{...e,datasets:l}}}return e}function qee(e,t,n,r){let i=t,o;const s=e.findIndex(a=>a.variableUnits===i.source.variableUnits);if(s>=0){const a=e[s],l=a.timeSeriesArray,c=l.findIndex(f=>f.source.datasetId===i.source.datasetId&&f.source.variableName===i.source.variableName&&f.source.placeId===i.source.placeId);let u;if(c>=0){const f=l[c];r==="append"&&(i={...i,data:[...i.data,...f.data]}),n==="replace"?u=[i]:n==="add"?(u=l.slice(),u[c]=i):(u=l.slice(),u.splice(c,1))}else n==="replace"?u=[i]:n==="add"?u=[i,...l]:u=l;n==="replace"?o=[{...a,timeSeriesArray:u}]:n==="add"?(o=e.slice(),o[s]={...a,timeSeriesArray:u}):u.length>=0?(o=e.slice(),o[s]={...a,timeSeriesArray:u}):(o=e.slice(),o.splice(s,1))}else n==="replace"?o=[{id:mh("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:mh("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...e]:o=e;return o}function h5e(e,t){const n=[];return e.forEach(r=>{r.timeSeriesArray.forEach(i=>{t.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function p5e(e,t,n,r){const i=e.findIndex(o=>o.id===t);if(i>=0){const o=e[i],s=o.features,a=s.findIndex(l=>l.id===n);if(a>=0){const l=s[a];return[...e.slice(0,i),{...o,features:[...s.slice(0,a),{...l,properties:{...l.properties,...r}},...s.slice(a+1)]},...e.slice(i+1)]}}}function gdr(){return{newEntries:[],oldEntries:[]}}let mdr=0;function vdr(e,t){e===void 0&&(e=gdr());const n=e.newEntries;switch(t.type){case Bet:{const r=t.messageType,i=t.messageText;let o=n.length?n[0]:null;return o&&r===o.type&&i===o.text?e:(o={id:++mdr,type:r,text:i},{...e,newEntries:[o,...n]})}case Uet:{const r=n.findIndex(i=>i.id===t.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const s=[i,...e.oldEntries];return{...e,newEntries:o,oldEntries:s}}}}return e}function ydr(){return{accessToken:null}}function bdr(e,t){switch(e===void 0&&(e=ydr()),t.type){case wnt:return{...e,accessToken:t.accessToken}}return e}function xdr(e,t){return{dataState:pdr(e&&e.dataState,t),controlState:fdr(e&&e.controlState,t,e),messageLogState:vdr(e&&e.messageLogState,t),userAuthState:bdr(e&&e.userAuthState,t)}}console.debug("baseUrl:",ST);On.load().then(async()=>{const e=(s,a)=>a.type!==nme&&a.type!==sme&&a.type!==ume&&a.type!==fme,t=Pht.createLogger({collapsed:!0,diff:!1,predicate:e}),n=Oht(w5e,t);let r;r=n;const i=b5e(xdr,r),o=i.dispatch;o(ame(i.getState().controlState.locale)),o(REn()),i.getState().controlState.privacyNoticeAccepted&&o(tme(i,!0)),Adt.createRoot(document.getElementById("root")).render(O.jsx(zdt,{store:i,children:O.jsx(udr,{})}))}); +`,E.getElementsByTagName("head")[0].appendChild(T)),E.body&&S(E.body,"react-draggable-transparent-selection")}function b(E){window.requestAnimationFrame?window.requestAnimationFrame(()=>{w(E)}):w(E)}function w(E){if(E)try{if(E.body&&_(E.body,"react-draggable-transparent-selection"),E.selection)E.selection.empty();else{const T=(E.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function S(E,T){E.classList?E.classList.add(T):E.className.match(new RegExp(`(?:^|\\s)${T}(?!\\S)`))||(E.className+=` ${T}`)}function _(E,T){E.classList?E.classList.remove(T):E.className=E.className.replace(new RegExp(`(?:^|\\s)${T}(?!\\S)`,"g"),"")}return Qo}var Xh={},WNe;function clt(){if(WNe)return Xh;WNe=1,Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.canDragX=i,Xh.canDragY=o,Xh.createCoreData=a,Xh.createDraggableData=l,Xh.getBoundPosition=n,Xh.getControlPosition=s,Xh.snapToGrid=r;var e=BW(),t=tve();function n(f,d,h){if(!f.props.bounds)return[d,h];let{bounds:p}=f.props;p=typeof p=="string"?p:c(p);const g=u(f);if(typeof p=="string"){const{ownerDocument:m}=g,v=m.defaultView;let y;if(p==="parent"?y=g.parentNode:y=g.getRootNode().querySelector(p),!(y instanceof v.HTMLElement))throw new Error('Bounds selector "'+p+'" could not find an element.');const b=y,w=v.getComputedStyle(g),S=v.getComputedStyle(b);p={left:-g.offsetLeft+(0,e.int)(S.paddingLeft)+(0,e.int)(w.marginLeft),top:-g.offsetTop+(0,e.int)(S.paddingTop)+(0,e.int)(w.marginTop),right:(0,t.innerWidth)(b)-(0,t.outerWidth)(g)-g.offsetLeft+(0,e.int)(S.paddingRight)-(0,e.int)(w.marginRight),bottom:(0,t.innerHeight)(b)-(0,t.outerHeight)(g)-g.offsetTop+(0,e.int)(S.paddingBottom)-(0,e.int)(w.marginBottom)}}return(0,e.isNum)(p.right)&&(d=Math.min(d,p.right)),(0,e.isNum)(p.bottom)&&(h=Math.min(h,p.bottom)),(0,e.isNum)(p.left)&&(d=Math.max(d,p.left)),(0,e.isNum)(p.top)&&(h=Math.max(h,p.top)),[d,h]}function r(f,d,h){const p=Math.round(d/f[0])*f[0],g=Math.round(h/f[1])*f[1];return[p,g]}function i(f){return f.props.axis==="both"||f.props.axis==="x"}function o(f){return f.props.axis==="both"||f.props.axis==="y"}function s(f,d,h){const p=typeof d=="number"?(0,t.getTouch)(f,d):null;if(typeof d=="number"&&!p)return null;const g=u(h),m=h.props.offsetParent||g.offsetParent||g.ownerDocument.body;return(0,t.offsetXYFromParent)(p||f,m,h.props.scale)}function a(f,d,h){const p=!(0,e.isNum)(f.lastX),g=u(f);return p?{node:g,deltaX:0,deltaY:0,lastX:d,lastY:h,x:d,y:h}:{node:g,deltaX:d-f.lastX,deltaY:h-f.lastY,lastX:f.lastX,lastY:f.lastY,x:d,y:h}}function l(f,d){const h=f.props.scale;return{node:d.node,x:f.state.x+d.deltaX/h,y:f.state.y+d.deltaY/h,deltaX:d.deltaX/h,deltaY:d.deltaY/h,lastX:f.state.x,lastY:f.state.y}}function c(f){return{left:f.left,top:f.top,right:f.right,bottom:f.bottom}}function u(f){const d=f.findDOMNode();if(!d)throw new Error(": Unmounted during event!");return d}return Xh}var P2={},X3={},HNe;function ult(){if(HNe)return X3;HNe=1,Object.defineProperty(X3,"__esModule",{value:!0}),X3.default=e;function e(){}return X3}var GNe;function Psr(){if(GNe)return P2;GNe=1,Object.defineProperty(P2,"__esModule",{value:!0}),P2.default=void 0;var e=l(fg()),t=a(AI()),n=a(d6()),r=tve(),i=clt(),o=BW(),s=a(ult());function a(g){return g&&g.__esModule?g:{default:g}}function l(g,m){if(typeof WeakMap=="function")var v=new WeakMap,y=new WeakMap;return(l=function(b,w){if(!w&&b&&b.__esModule)return b;var S,_,E={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return E;if(S=w?y:v){if(S.has(b))return S.get(b);S.set(b,E)}for(const T in b)T!=="default"&&{}.hasOwnProperty.call(b,T)&&((_=(S=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,T))&&(_.get||_.set)?S(E,T,_):E[T]=b[T]);return E})(g,m)}function c(g,m,v){return(m=u(m))in g?Object.defineProperty(g,m,{value:v,enumerable:!0,configurable:!0,writable:!0}):g[m]=v,g}function u(g){var m=f(g,"string");return typeof m=="symbol"?m:m+""}function f(g,m){if(typeof g!="object"||!g)return g;var v=g[Symbol.toPrimitive];if(v!==void 0){var y=v.call(g,m);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(g)}const d={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let h=d.mouse,p=class extends e.Component{constructor(){super(...arguments),c(this,"dragging",!1),c(this,"lastX",NaN),c(this,"lastY",NaN),c(this,"touchIdentifier",null),c(this,"mounted",!1),c(this,"handleDragStart",m=>{if(this.props.onMouseDown(m),!this.props.allowAnyClick&&typeof m.button=="number"&&m.button!==0)return!1;const v=this.findDOMNode();if(!v||!v.ownerDocument||!v.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:y}=v;if(this.props.disabled||!(m.target instanceof y.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(m.target,this.props.handle,v)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(m.target,this.props.cancel,v))return;m.type==="touchstart"&&!this.props.allowMobileScroll&&m.preventDefault();const b=(0,r.getTouchIdentifier)(m);this.touchIdentifier=b;const w=(0,i.getControlPosition)(m,b,this);if(w==null)return;const{x:S,y:_}=w,E=(0,i.createCoreData)(this,S,_);(0,s.default)("DraggableCore: handleDragStart: %j",E),(0,s.default)("calling",this.props.onStart),!(this.props.onStart(m,E)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(y),this.dragging=!0,this.lastX=S,this.lastY=_,(0,r.addEvent)(y,h.move,this.handleDrag),(0,r.addEvent)(y,h.stop,this.handleDragStop))}),c(this,"handleDrag",m=>{const v=(0,i.getControlPosition)(m,this.touchIdentifier,this);if(v==null)return;let{x:y,y:b}=v;if(Array.isArray(this.props.grid)){let _=y-this.lastX,E=b-this.lastY;if([_,E]=(0,i.snapToGrid)(this.props.grid,_,E),!_&&!E)return;y=this.lastX+_,b=this.lastY+E}const w=(0,i.createCoreData)(this,y,b);if((0,s.default)("DraggableCore: handleDrag: %j",w),this.props.onDrag(m,w)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const E=document.createEvent("MouseEvents");E.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(E)}return}this.lastX=y,this.lastY=b}),c(this,"handleDragStop",m=>{if(!this.dragging)return;const v=(0,i.getControlPosition)(m,this.touchIdentifier,this);if(v==null)return;let{x:y,y:b}=v;if(Array.isArray(this.props.grid)){let E=y-this.lastX||0,T=b-this.lastY||0;[E,T]=(0,i.snapToGrid)(this.props.grid,E,T),y=this.lastX+E,b=this.lastY+T}const w=(0,i.createCoreData)(this,y,b);if(this.props.onStop(m,w)===!1||this.mounted===!1)return!1;const _=this.findDOMNode();_&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(_.ownerDocument),(0,s.default)("DraggableCore: handleDragStop: %j",w),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,_&&((0,s.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(_.ownerDocument,h.move,this.handleDrag),(0,r.removeEvent)(_.ownerDocument,h.stop,this.handleDragStop))}),c(this,"onMouseDown",m=>(h=d.mouse,this.handleDragStart(m))),c(this,"onMouseUp",m=>(h=d.mouse,this.handleDragStop(m))),c(this,"onTouchStart",m=>(h=d.touch,this.handleDragStart(m))),c(this,"onTouchEnd",m=>(h=d.touch,this.handleDragStop(m)))}componentDidMount(){this.mounted=!0;const m=this.findDOMNode();m&&(0,r.addEvent)(m,d.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const m=this.findDOMNode();if(m){const{ownerDocument:v}=m;(0,r.removeEvent)(v,d.mouse.move,this.handleDrag),(0,r.removeEvent)(v,d.touch.move,this.handleDrag),(0,r.removeEvent)(v,d.mouse.stop,this.handleDragStop),(0,r.removeEvent)(v,d.touch.stop,this.handleDragStop),(0,r.removeEvent)(m,d.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(v)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return P2.default=p,c(p,"displayName","DraggableCore"),c(p,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(g,m){if(g[m]&&g[m].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),c(p,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),P2}var qNe;function ksr(){return qNe||(qNe=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(fg()),n=u(AI()),r=u(d6()),i=Esr(),o=tve(),s=clt(),a=BW(),l=u(Psr()),c=u(ult());function u(v){return v&&v.__esModule?v:{default:v}}function f(v,y){if(typeof WeakMap=="function")var b=new WeakMap,w=new WeakMap;return(f=function(S,_){if(!_&&S&&S.__esModule)return S;var E,T,k={__proto__:null,default:S};if(S===null||typeof S!="object"&&typeof S!="function")return k;if(E=_?w:b){if(E.has(S))return E.get(S);E.set(S,k)}for(const P in S)P!=="default"&&{}.hasOwnProperty.call(S,P)&&((T=(E=Object.defineProperty)&&Object.getOwnPropertyDescriptor(S,P))&&(T.get||T.set)?E(k,P,T):k[P]=S[P]);return k})(v,y)}function d(){return d=Object.assign?Object.assign.bind():function(v){for(var y=1;y{if((0,c.default)("Draggable: onDragStart: %j",w),this.props.onStart(b,(0,s.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(b,w)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",w);const S=(0,s.createDraggableData)(this,w),_={x:S.x,y:S.y,slackX:0,slackY:0};if(this.props.bounds){const{x:T,y:k}=_;_.x+=this.state.slackX,_.y+=this.state.slackY;const[P,I]=(0,s.getBoundPosition)(this,_.x,_.y);_.x=P,_.y=I,_.slackX=this.state.slackX+(T-_.x),_.slackY=this.state.slackY+(k-_.y),S.x=_.x,S.y=_.y,S.deltaX=_.x-this.state.x,S.deltaY=_.y-this.state.y}if(this.props.onDrag(b,S)===!1)return!1;this.setState(_)}),h(this,"onDragStop",(b,w)=>{if(!this.state.dragging||this.props.onStop(b,(0,s.createDraggableData)(this,w))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",w);const _={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:T,y:k}=this.props.position;_.x=T,_.y=k}this.setState(_)}),this.state={dragging:!1,dragged:!1,x:y.position?y.position.x:y.defaultPosition.x,y:y.position?y.position.y:y.defaultPosition.y,prevPropsPosition:{...y.position},slackX:0,slackY:0,isElementSVG:!1},y.position&&!(y.onDrag||y.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??r.default.findDOMNode(this)}render(){const{axis:y,bounds:b,children:w,defaultPosition:S,defaultClassName:_,defaultClassNameDragging:E,defaultClassNameDragged:T,position:k,positionOffset:P,scale:I,...R}=this.props;let F={},A=null;const $=!!!k||this.state.dragging,j=k||S,V={x:(0,s.canDragX)(this)&&$?this.state.x:j.x,y:(0,s.canDragY)(this)&&$?this.state.y:j.y};this.state.isElementSVG?A=(0,o.createSVGTransform)(V,P):F=(0,o.createCSSTransform)(V,P);const U=(0,i.clsx)(w.props.className||"",_,{[E]:this.state.dragging,[T]:this.state.dragged});return t.createElement(l.default,d({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(w),{className:U,style:{...w.props.style,...F},transform:A}))}}e.default=m,h(m,"displayName","Draggable"),h(m,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),h(m,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(RJ)),RJ}var XNe;function nve(){if(XNe)return T2.exports;XNe=1;const{default:e,DraggableCore:t}=ksr();return T2.exports=e,T2.exports.default=e,T2.exports.DraggableCore=t,T2.exports}var Msr=nve();const Asr=Yn(Msr);var k2={exports:{}},M2={},Y3={},YNe;function Rsr(){if(YNe)return Y3;YNe=1,Y3.__esModule=!0,Y3.cloneElement=a;var e=t(fg());function t(l){return l&&l.__esModule?l:{default:l}}function n(l,c){var u=Object.keys(l);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(l);c&&(f=f.filter(function(d){return Object.getOwnPropertyDescriptor(l,d).enumerable})),u.push.apply(u,f)}return u}function r(l){for(var c=1;cMath.abs(I*k)?v=m/k:m=v*k}const[S,_]=[m,v];let[E,T]=this.slack||[0,0];return m+=E,v+=T,y&&(m=Math.max(y[0],m),v=Math.max(y[1],v)),b&&(m=Math.min(b[0],m),v=Math.min(b[1],v)),this.slack=[E+(S-m),T+(_-v)],[m,v]}resizeHandler(m,v){return(y,b)=>{let{node:w,deltaX:S,deltaY:_}=b;m==="onResizeStart"&&this.resetData();const E=(this.props.axis==="both"||this.props.axis==="x")&&v!=="n"&&v!=="s",T=(this.props.axis==="both"||this.props.axis==="y")&&v!=="e"&&v!=="w";if(!E&&!T)return;const k=v[0],P=v[v.length-1],I=w.getBoundingClientRect();if(this.lastHandleRect!=null){if(P==="w"){const j=I.left-this.lastHandleRect.left;S+=j}if(k==="n"){const j=I.top-this.lastHandleRect.top;_+=j}}this.lastHandleRect=I,P==="w"&&(S=-S),k==="n"&&(_=-_);let R=this.props.width+(E?S/this.props.transformScale:0),F=this.props.height+(T?_/this.props.transformScale:0);[R,F]=this.runConstraints(R,F),m==="onResizeStop"&&this.lastSize&&({width:R,height:F}=this.lastSize);const A=R!==this.props.width||F!==this.props.height;m!=="onResizeStop"&&(this.lastSize={width:R,height:F});const L=typeof this.props[m]=="function"?this.props[m]:null;L&&!(m==="onResize"&&!A)&&(y.persist?.(),L(y,{node:w,size:{width:R,height:F},handle:v})),m==="onResizeStop"&&this.resetData()}}renderResizeHandle(m,v){const{handle:y}=this.props;if(!y)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${m}`,ref:v});if(typeof y=="function")return y(m,v);const b=typeof y.type=="string",w=u({ref:v},b?{}:{handleAxis:m});return e.cloneElement(y,w)}render(){const m=this.props,{children:v,className:y,draggableOpts:b,width:w,height:S,handle:_,handleSize:E,lockAspectRatio:T,axis:k,minConstraints:P,maxConstraints:I,onResize:R,onResizeStop:F,onResizeStart:A,resizeHandles:L,transformScale:$}=m,j=a(m,i);return(0,n.cloneElement)(v,u(u({},j),{},{className:`${y?`${y} `:""}react-resizable`,children:[...e.Children.toArray(v.props.children),...L.map(V=>{const U=this.handleRefs[V]??(this.handleRefs[V]=e.createRef());return e.createElement(t.DraggableCore,s({},b,{nodeRef:U,key:`resizableHandle-${V}`,onStop:this.resizeHandler("onResizeStop",V),onStart:this.resizeHandler("onResizeStart",V),onDrag:this.resizeHandler("onResize",V)}),this.renderResizeHandle(V,U))})]}))}};return M2.default=p,p.propTypes=r.resizableProps,p.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},M2}var R2={},ZNe;function Isr(){if(ZNe)return R2;ZNe=1,R2.__esModule=!0,R2.default=void 0;var e=s(fg()),t=o(AI()),n=o(dlt()),r=flt();const i=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(m){return m&&m.__esModule?m:{default:m}}function s(m,v){if(typeof WeakMap=="function")var y=new WeakMap,b=new WeakMap;return(s=function(w,S){if(!S&&w&&w.__esModule)return w;var _,E,T={__proto__:null,default:w};if(w===null||typeof w!="object"&&typeof w!="function")return T;if(_=S?b:y){if(_.has(w))return _.get(w);_.set(w,T)}for(const k in w)k!=="default"&&{}.hasOwnProperty.call(w,k)&&((E=(_=Object.defineProperty)&&Object.getOwnPropertyDescriptor(w,k))&&(E.get||E.set)?_(T,k,E):T[k]=w[k]);return T})(m,v)}function a(){return a=Object.assign?Object.assign.bind():function(m){for(var v=1;v{const{size:b}=y;this.props.onResize?(v.persist?.(),this.setState(b,()=>this.props.onResize&&this.props.onResize(v,y))):this.setState(b)}}static getDerivedStateFromProps(v,y){return y.propsWidth!==v.width||y.propsHeight!==v.height?{width:v.width,height:v.height,propsWidth:v.width,propsHeight:v.height}:null}render(){const v=this.props,{handle:y,handleSize:b,onResize:w,onResizeStart:S,onResizeStop:_,draggableOpts:E,minConstraints:T,maxConstraints:k,lockAspectRatio:P,axis:I,width:R,height:F,resizeHandles:A,style:L,transformScale:$}=v,j=h(v,i);return e.createElement(n.default,{axis:I,draggableOpts:E,handle:y,handleSize:b,height:this.state.height,lockAspectRatio:P,maxConstraints:k,minConstraints:T,onResizeStart:S,onResize:this.onResize,onResizeStop:_,resizeHandles:A,transformScale:$,width:this.state.width},e.createElement("div",a({},j,{style:c(c({},L),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return R2.default=g,g.propTypes=c(c({},r.resizableProps),{},{children:t.default.element}),R2}var JNe;function Dsr(){return JNe||(JNe=1,k2.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},k2.exports.Resizable=dlt().default,k2.exports.ResizableBox=Isr().default),k2.exports}var Lsr=Dsr();const Fsr=at(O.jsx("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"}),"ArrowForwardIosSharp"),hlt=at(O.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");function plt({title:e,subtitle:t,disabled:n,dense:r,selected:i,secondaryIcon:o,onClick:s}){return i?O.jsxs(nr,{onClick:s,disabled:n,dense:r,children:[O.jsx(rl,{children:O.jsx(hlt,{})}),O.jsx(Qi,{primary:e,secondary:t}),o]}):O.jsxs(nr,{onClick:s,disabled:n,dense:r,children:[O.jsx(Qi,{inset:!0,primary:e,secondary:t}),o]})}function $sr({layerState:e,setLayerVisibility:t,disableI18n:n}){return e.disabled?null:O.jsx(O.Fragment,{children:O.jsx(plt,{title:n?e.title:Ce.get(e.title),subtitle:e.subTitle,selected:!!e.visible,secondaryIcon:e.pinned&&O.jsx(GB,{fontSize:"small",color:"disabled"}),onClick:()=>t(e.id,!e.visible),dense:!0})})}function IJ({layerStates:e,setLayerVisibility:t,disableI18n:n,extraItems:r}){return O.jsxs(Xw,{dense:!0,disablePadding:!0,children:[e.map(i=>O.jsx($sr,{layerState:i,setLayerVisibility:t,disableI18n:n},i.id)),e.length&&r&&O.jsx(sa,{style:{margin:0}}),r]})}const Nsr={x:48,y:128},zsr={width:320,height:520},Q3={resizeBox:{position:"absolute",zIndex:1e3},windowPaper:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},windowHeader:e=>({display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"move",padding:1,borderBottom:`1px solid ${e.palette.mode==="dark"?"#FFFFFF3F":"#0000003F"}`}),windowTitle:{fontWeight:"bolder"}},DJ=Oe(e=>O.jsx(Use,{disableGutters:!0,elevation:0,square:!0,...e}))(({theme:e})=>({border:`1px solid ${e.palette.divider}`,"&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}})),LJ=Oe(e=>O.jsx(Wse,{expandIcon:O.jsx(Fsr,{sx:{fontSize:"0.9rem"}}),...e}))(({theme:e})=>({backgroundColor:"rgba(0, 0, 0, .03)",minHeight:32,paddingLeft:e.spacing(1),paddingRight:e.spacing(1),flexDirection:"row-reverse",[`& .${km.expandIconWrapper}.${km.expanded}`]:{transform:"rotate(90deg)"},[`& .${km.content}`]:{marginLeft:e.spacing(1),marginTop:e.spacing(0),marginBottom:e.spacing(0),marginRight:e.spacing(0)},...e.applyStyles("dark",{backgroundColor:"rgba(255, 255, 255, .05)"})})),FJ=Oe(Vse)(({theme:e})=>({padding:0,borderTop:"1px solid rgba(0, 0, 0, .125)"}));function jsr({layerStates:e,layerMenuOpen:t,setLayerMenuOpen:n,openDialog:r,setLayerVisibilities:i,layerGroupStates:o,setLayerGroupStates:s}){const[a,l]=M.useState(Nsr),[c,u]=M.useState(zsr),f=M.useCallback((E,T)=>{const k={[E]:T};if(T){const P=e[E];P&&P.type&&P.exclusive&&Object.keys(e).forEach(I=>{const R=e[I];R&&R.type===P.type&&R.exclusive&&R.visible&&(k[I]=!1)})}i(k)},[e,i]),d=M.useCallback((E,T)=>{s({overlays:T})},[s]),h=M.useCallback((E,T)=>{s({baseMaps:T})},[s]),p=M.useCallback((E,T)=>{s({predefined:T})},[s]),g=M.useMemo(()=>e3e(e,"overlays"),[e]),m=M.useMemo(()=>e3e(e,"baseMaps"),[e]),v=M.useMemo(()=>[e.userPlaces,e.datasetPlaces,e.datasetBoundary,e.datasetVariable,e.datasetVariable2,e.datasetRgb,e.datasetRgb2].filter(E=>!!E),[e]);if(!t)return null;const y=()=>{r("userOverlays")},b=()=>{r("userBaseMaps")},w=()=>{n(!1)},S=(E,T)=>{l({...T})},_=(E,T)=>{u({...T.size})};return O.jsx(Asr,{handle:"#layer-select-header",position:a,onStop:S,children:O.jsx(Lsr.ResizableBox,{width:c.width,height:c.height,style:Q3.resizeBox,onResize:_,children:O.jsxs(fa,{elevation:10,sx:Q3.windowPaper,component:"div",children:[O.jsxs(bt,{id:"layer-select-header",sx:Q3.windowHeader,children:[O.jsx(bt,{component:"span",sx:Q3.windowTitle,children:Ce.get("Layers")}),O.jsx(Mn,{size:"small",onClick:w,children:O.jsx(fP,{fontSize:"inherit"})})]}),O.jsxs(bt,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:[O.jsxs(DJ,{expanded:o.overlays,onChange:d,children:[O.jsx(LJ,{id:"overlays",children:O.jsx(mn,{component:"span",children:Ce.get("Overlays")})}),O.jsx(FJ,{children:O.jsx(IJ,{layerStates:g,setLayerVisibility:f,extraItems:O.jsx(nr,{onClick:y,children:Ce.get("User Overlays")+"..."}),disableI18n:!0})})]}),O.jsxs(DJ,{expanded:o.predefined,onChange:p,children:[O.jsx(LJ,{id:"predefines",children:O.jsx(mn,{component:"span",children:Ce.get("Predefined")})}),O.jsx(FJ,{children:O.jsx(IJ,{layerStates:v,setLayerVisibility:f})})]}),O.jsxs(DJ,{expanded:o.baseMaps,onChange:h,children:[O.jsx(LJ,{id:"baseMaps",children:O.jsx(mn,{component:"span",children:Ce.get("Base maps")})}),O.jsx(FJ,{children:O.jsx(IJ,{layerStates:m,setLayerVisibility:f,extraItems:O.jsx(nr,{onClick:b,children:Ce.get("User Base Maps")+"..."}),disableI18n:!0})})]})]})]})})})}function e3e(e,t){return Object.keys(e).filter(n=>e[n].type===t).map(n=>e[n]).sort((n,r)=>n.title.localeCompare(r.title))}const Bsr=e=>({locale:e.controlState.locale,layerMenuOpen:e.controlState.layerMenuOpen,layerStates:eDt(e),layerGroupStates:e.controlState.layerGroupStates}),Usr={openDialog:PS,setLayerMenuOpen:SJe,setLayerVisibilities:lJe,setLayerGroupStates:i_n},Vsr=hr(Bsr,Usr)(jsr),Wsr=e=>({locale:e.controlState.locale,hasConsent:e.controlState.privacyNoticeAccepted,compact:!!On.instance.branding.compact}),Hsr={},Gsr=Oe("main")(({theme:e})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[e.breakpoints.up("md")]:{overflow:"hidden"}})),qsr=({hasConsent:e,compact:t})=>O.jsxs(Gsr,{children:[!t&&O.jsx(HI,{variant:"dense"}),e&&O.jsxs(O.Fragment,{children:[O.jsx(PIn,{}),O.jsx(Osr,{}),O.jsx(Vsr,{})]})]}),Xsr=hr(Wsr,Hsr)(qsr),Ysr={icon:e=>({marginRight:e.spacing(2)})};function Qsr({open:e,settings:t,updateSettings:n,syncWithServer:r}){const[i,o]=M.useState(null),{store:s}=M.useContext(h6);if(M.useEffect(()=>{const c=Ce.get("docs/privacy-note.en.md");fetch(c).then(u=>u.text()).then(u=>o(u))}),!e)return null;function a(){n({...t,privacyNoticeAccepted:!0}),r(s,!0)}function l(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(c){console.error(c)}}return O.jsxs(Gu,{open:e,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[O.jsx(hg,{children:Ce.get("Privacy Notice")}),O.jsx(Fc,{children:O.jsx(Gze,{children:i===null?O.jsx(Ch,{}):O.jsx(Bb,{text:i})})}),O.jsxs(xb,{children:[O.jsxs(zi,{onClick:a,children:[O.jsx(hlt,{sx:Ysr.icon}),Ce.get("Accept and continue")]}),O.jsx(zi,{onClick:l,children:Ce.get("Leave")})]})]})}const Ksr=e=>({open:!e.controlState.privacyNoticeAccepted,settings:e.controlState}),Zsr={updateSettings:TL,syncWithServer:Wpe},Jsr=hr(Ksr,Zsr)(Qsr),ear=Qn(Ch)(({theme:e})=>({margin:e.spacing(2)})),tar=Qn(mn)(({theme:e})=>({margin:e.spacing(1)})),nar=Qn("div")(({theme:e})=>({margin:e.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function rar({messages:e}){const[t]=M.useState(Date.now()),[n,r]=M.useState(!0);return M.useEffect(()=>{let i;if(e.length===0){const s=Date.now()-t;if(s>=3e3)r(!1);else{const a=3e3-s;i=setTimeout(()=>{r(!1)},a)}}else r(!0);return()=>{i&&clearTimeout(i)}},[e,t]),n?O.jsxs(Gu,{open:!0,"aria-labelledby":"loading",children:[On.instance.branding.allowAboutPage&&O.jsx(Fc,{children:O.jsx(HJe,{})}),!On.instance.branding.allowAboutPage&&O.jsx(hg,{id:"loading",children:Ce.get("Please wait...")}),O.jsxs(nar,{children:[O.jsx(ear,{}),e.map((i,o)=>O.jsx(tar,{children:i},o))]})]}):null}const iar=e=>({locale:e.controlState.locale,messages:XIt(e)}),oar={},sar=hr(iar,oar)(rar),aar=at(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),lar=at(O.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),car=at(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),uar=at(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),far={success:car,warning:lar,error:aar,info:uar},dar=Qn("span")(()=>({display:"flex",alignItems:"center"})),K3={close:{p:.5},success:e=>({color:e.palette.error.contrastText,backgroundColor:mm[600]}),error:e=>({color:e.palette.error.contrastText,backgroundColor:e.palette.error.dark}),info:e=>({color:e.palette.error.contrastText,backgroundColor:e.palette.primary.dark}),warning:e=>({color:e.palette.error.contrastText,backgroundColor:C3e[700]}),icon:{fontSize:20},iconVariant:e=>({opacity:.9,marginRight:e.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},har={vertical:"bottom",horizontal:"center"};function par({className:e,message:t,hideMessage:n}){const r=()=>{n(t.id)};if(!t)return null;const i=far[t.type];return O.jsx(cwt,{open:!0,anchorOrigin:har,autoHideDuration:5e3,onClose:r,children:O.jsx(o5e,{sx:K3[t.type],className:e,"aria-describedby":"client-snackbar",message:O.jsxs(dar,{id:"client-snackbar",children:[O.jsx(i,{sx:K3.iconVariant}),t.text]}),action:[O.jsx(Mn,{"aria-label":"Close",color:"inherit",sx:K3.close,onClick:r,size:"large",children:O.jsx(fP,{sx:K3.icon})},"close")]})},t.type+":"+t.text)}const gar=e=>{const t=e.messageLogState.newEntries;return{locale:e.controlState.locale,message:t.length>0?t[0]:null}},mar={hideMessage:Qwn},yar=hr(gar,mar)(par),gse=at(O.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),glt=at(O.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),sC={formControl:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),width:200}),textField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),width:200}),textField2:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),width:400}),button:e=>({margin:e.spacing(.1)})};function bar({open:e,servers:t,selectedServer:n,closeDialog:r,configureServers:i}){const o=M.useRef(!1),[s,a]=M.useState(t),[l,c]=M.useState(n),[u,f]=M.useState("select");M.useEffect(()=>{o.current&&(a(t),c(n)),o.current=!0},[t,n]);const{store:d}=M.useContext(h6),h=()=>{u==="select"?(r("server"),i(s,l.id,d)):u==="add"?P():u==="edit"&&I()},p=()=>{u==="select"?_():R()},g=()=>{_()},m=V=>{const U=V.target.value,z=s.find(N=>N.id===U);c(z)},v=V=>{const U=V.target.value,z={...l,name:U};c(z)},y=V=>{const U=V.target.value,z={...l,url:U};c(z)},b=()=>{f("add")},w=()=>{f("edit")},S=()=>{F()},_=()=>{r("server")},E=()=>{const V=l.id;return s.findIndex(U=>U.id===V)},T=(V,U)=>{const z=[...s];z[V]=U,a(z),c(U),f("select")},k=(V,U)=>{a(V),c(U),f("select")},P=()=>{const V={...l,id:gh("server-")},U=[...s,V];k(U,V)},I=()=>{T(E(),{...l})},R=()=>{const V=E();T(E(),s[V])},F=()=>{const V=[...s];if(V.length<2)throw new Error("internal error: server list cannot be emptied");const U=E(),z=V[U+(U>0?-1:1)];V.splice(U,1),k(V,z)},A=s.map((V,U)=>O.jsx(nr,{value:V.id,children:V.name},U));let L;u==="add"?L=Ce.get("Add"):u==="edit"?L=Ce.get("Save"):L=Ce.get("OK");let $;u==="add"?$=Ce.get("Add Server"):u==="edit"?$=Ce.get("Edit Server"):$=Ce.get("Select Server");let j;return u==="add"||u==="edit"?j=O.jsxs(Fc,{dividers:!0,children:[O.jsx(Ii,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:sC.textField,margin:"normal",value:l.name,onChange:v}),O.jsx("br",{}),O.jsx(Ii,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:sC.textField2,margin:"normal",value:l.url,onChange:y})]}):j=O.jsx(Fc,{dividers:!0,children:O.jsxs("div",{children:[O.jsxs(sd,{variant:"standard",sx:sC.formControl,children:[O.jsx(bv,{htmlFor:"server-name",children:"Name"}),O.jsx(Oh,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:A}),O.jsx(nae,{children:l.url})]}),O.jsx(Mn,{sx:sC.button,"aria-label":"Add",color:"primary",onClick:b,size:"large",children:O.jsx(gse,{fontSize:"small"})}),O.jsx(Mn,{sx:sC.button,"aria-label":"Edit",onClick:w,size:"large",children:O.jsx(dP,{fontSize:"small"})}),O.jsx(Mn,{sx:sC.button,"aria-label":"Delete",disabled:s.length<2,onClick:S,size:"large",children:O.jsx(glt,{fontSize:"small"})})]})}),O.jsxs(Gu,{open:e,onClose:g,"aria-labelledby":"server-dialog-title",children:[O.jsx(hg,{id:"server-dialog-title",children:$}),j,O.jsxs(xb,{children:[O.jsx(zi,{onClick:p,children:Ce.get("Cancel")}),O.jsx(zi,{onClick:h,autoFocus:!0,children:L})]})]})}const xar=e=>({open:!!e.controlState.dialogOpen.server,servers:FBe(e),selectedServer:Go(e)}),war={closeDialog:kS,configureServers:FSn},Sar=hr(xar,war)(bar),$J={settingsPanelTitle:e=>({marginBottom:e.spacing(1)}),settingsPanelPaper:e=>({backgroundColor:(e.palette.mode==="dark"?dh:fh)(e.palette.background.paper,.1),marginBottom:e.spacing(2)}),settingsPanelList:{margin:0}},OC=({title:e,children:t})=>{const n=Te.Children.count(t),r=[];return Te.Children.forEach(t,(i,o)=>{r.push(i),o{let i;t||(i={marginBottom:10});const o=O.jsx(Qi,{primary:e,secondary:t});let s;return r&&(s=O.jsx(TA,{children:r})),n?O.jsxs(Qze,{style:i,onClick:n,children:[o,s]}):O.jsxs(eO,{style:i,children:[o,s]})},up=({propertyName:e,settings:t,updateSettings:n,disabled:r})=>O.jsx(uae,{checked:!!t[e],onChange:()=>n({...t,[e]:!t[e]}),disabled:r}),_ar=({propertyName:e,settings:t,updateSettings:n,options:r,disabled:i})=>{const o=(s,a)=>{n({...t,[e]:a})};return O.jsx($6,{row:!0,value:t[e],onChange:o,children:r.map(([s,a])=>O.jsx(oh,{control:O.jsx(tO,{}),value:a,label:s,disabled:i},s))})},Ax={textField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),fontSize:e.typography.fontSize/2}),intTextField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),fontSize:e.typography.fontSize/2,width:e.spacing(6)})},t3e=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],Car=[["point","Points"],["line","Lines"],["bar","Bars"]],Oar=[[96,"Screen Resolution (96 DPI)"],[150,"Intermediate Resolution (150 DPI)"],[300,"Print Resolution (300 DPI)"],[600,"Professional Print Resolution (600 DPI)"]],Ear=({open:e,closeDialog:t,settings:n,selectedServer:r,userBaseMapLayers:i,userOverlayLayers:o,updateSettings:s,changeLocale:a,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=Te.useState(null),[h,p]=Te.useState(n.timeChunkSize+""),g=as();if(Te.useEffect(()=>{const A=parseInt(h);!Number.isNaN(A)&&A!==n.timeChunkSize&&s({timeChunkSize:A})},[h,n,s]),!e)return null;function m(){t("settings")}function v(){l("server")}function y(A){s({timeAnimationInterval:parseInt(A.target.value)})}function b(A){s({timeSeriesChartTypeDefault:A.target.value})}function w(A){s({datasetLocateMode:A.target.value})}function S(A){s({placeLocateMode:A.target.value})}function _(A){p(A.target.value)}let E=null;f&&(E=Object.getOwnPropertyNames(Ce.languages).map(A=>{const L=Ce.languages[A];return O.jsx(nr,{selected:A===n.locale,onClick:()=>a(A),children:O.jsx(Qi,{primary:L})},A)}));function T(A){d(A.currentTarget)}function k(){d(null)}const P=A=>{A.stopPropagation(),l("userBaseMaps")};function I(A){s({exportResolution:parseInt(A.target.value)})}const R=A=>{A.stopPropagation(),l("userOverlays")};function F(A){s({themeMode:A.target.value})}return O.jsxs("div",{children:[O.jsxs(Gu,{open:e,fullWidth:!0,maxWidth:"sm",onClose:m,scroll:"body",children:[O.jsx(hg,{children:Ce.get("Settings")}),O.jsxs(Fc,{children:[O.jsxs(OC,{title:Ce.get("General"),children:[O.jsx($i,{label:Ce.get("Server"),value:r.name,onClick:v}),O.jsx($i,{label:Ce.get("Language"),value:Ce.languages[n.locale],onClick:T}),O.jsx($i,{label:Ce.get("Time interval of the player"),children:O.jsx(Ii,{variant:"standard",select:!0,sx:Ax.textField,value:n.timeAnimationInterval,onChange:y,margin:"normal",children:rEt.map((A,L)=>O.jsx(nr,{value:A,children:A+" ms"},L))})}),O.jsx($i,{label:Ce.get("Image export resolution"),children:O.jsx(Ii,{variant:"standard",select:!0,sx:Ax.textField,value:n.exportResolution,onChange:I,margin:"normal",children:Oar.map(([A,L])=>O.jsx(nr,{value:A,children:Ce.get(L)},A))})}),O.jsx($i,{label:Ce.get("Appearance mode"),children:O.jsx(Ii,{variant:"standard",select:!0,sx:Ax.textField,value:n.themeMode||g.palette.mode,onChange:F,margin:"normal",children:iEt.map(([A,L])=>O.jsx(nr,{value:A,children:Ce.get(L)},A))})})]}),O.jsxs(OC,{title:Ce.get("Time-Series"),children:[O.jsx($i,{label:Ce.get("Show chart after adding a place"),value:aC(n.autoShowTimeSeries),children:O.jsx(up,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Default chart type"),children:O.jsx(Ii,{variant:"standard",select:!0,sx:Ax.textField,value:n.timeSeriesChartTypeDefault,onChange:b,margin:"normal",children:Car.map(([A,L])=>O.jsx(nr,{value:A,children:Ce.get(L)},A))})}),O.jsx($i,{label:Ce.get("Calculate standard deviation"),value:aC(n.timeSeriesIncludeStdev),children:O.jsx(up,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Calculate median instead of mean (disables standard deviation)"),value:aC(n.timeSeriesUseMedian),children:O.jsx(up,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Minimal number of data points in a time series update"),children:O.jsx(Ii,{variant:"standard",sx:Ax.intTextField,value:h,onChange:_,margin:"normal",size:"small"})})]}),O.jsxs(OC,{title:Ce.get("Map"),children:[O.jsx($i,{label:Ce.get("User Base Maps")+"...",value:`${i.length} ${Ce.get("defined")}`,onClick:P}),O.jsx($i,{label:Ce.get("User Overlays")+"...",value:`${o.length} ${Ce.get("defined")}`,onClick:R}),O.jsx($i,{label:Ce.get("Projection"),children:O.jsx(_ar,{propertyName:"mapProjection",settings:n,updateSettings:s,options:[[Ce.get("Geographic"),Jw],[Ce.get("Mercator"),qI]]})}),O.jsx($i,{label:Ce.get("Image smoothing"),value:aC(n.imageSmoothingEnabled),children:O.jsx(up,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Show tile loading progress"),value:aC(n.showProgressBar),children:O.jsx(up,{propertyName:"showProgressBar",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("Show zoom level indicator"),value:aC(n.showZoomInfoBox),children:O.jsx(up,{propertyName:"showZoomInfoBox",settings:n,updateSettings:s})}),O.jsx($i,{label:Ce.get("On dataset selection"),children:O.jsx(Ii,{variant:"standard",select:!0,sx:Ax.textField,value:n.datasetLocateMode,onChange:w,margin:"normal",children:t3e.map(([A,L])=>O.jsx(nr,{value:A,children:Ce.get(L)},A))})}),O.jsx($i,{label:Ce.get("On place selection"),children:O.jsx(Ii,{variant:"standard",select:!0,sx:Ax.textField,value:n.placeLocateMode,onChange:S,margin:"normal",children:t3e.map(([A,L])=>O.jsx(nr,{value:A,children:Ce.get(L)},A))})})]}),O.jsx(OC,{title:Ce.get("Legal Agreement"),children:O.jsx($i,{label:Ce.get("Privacy notice"),value:n.privacyNoticeAccepted?Ce.get("Accepted"):"",children:O.jsx(zi,{disabled:!n.privacyNoticeAccepted,onClick:()=>{s({privacyNoticeAccepted:!1}),window.location.reload()},children:Ce.get("Revoke consent")})})}),O.jsxs(OC,{title:Ce.get("System Information"),children:[O.jsx($i,{label:`xcube Viewer ${Ce.get("version")}`,value:c}),O.jsx($i,{label:`xcube Server ${Ce.get("version")}`,value:u?u.version:Ce.get("Cannot reach server")})]})]})]}),O.jsx(Qw,{anchorEl:f,keepMounted:!0,open:!!f,onClose:k,children:E})]})},aC=e=>e?Ce.get("On"):Ce.get("Off"),Tar=e=>({locale:e.controlState.locale,open:e.controlState.dialogOpen.settings,settings:e.controlState,userBaseMapLayers:zBe(e),userOverlayLayers:jBe(e),selectedServer:Go(e),viewerVersion:kZe,serverInfo:e.dataState.serverInfo}),Par={closeDialog:kS,updateSettings:TL,changeLocale:Qpe,openDialog:PS},kar=hr(Tar,Par)(Ear),n3e={separatorTextField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),fontSize:e.typography.fontSize/2,maxWidth:"5rem"}),fileNameTextField:e=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),fontSize:e.typography.fontSize/2})},Mar=({open:e,closeDialog:t,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{t("export")};function s(c){r({exportFileName:c.target.value})}function a(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return O.jsx("div",{children:O.jsxs(Gu,{open:e,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[O.jsx(Fc,{children:O.jsxs(OC,{title:Ce.get("Export Settings"),children:[O.jsx($i,{label:Ce.get("Include time-series data")+" (*.txt)",value:Z3(n.exportTimeSeries),children:O.jsx(up,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),O.jsx($i,{label:Ce.get("Separator for time-series data"),children:O.jsx(Ii,{variant:"standard",sx:n3e.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:a,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),O.jsx($i,{label:Ce.get("Include places data")+" (*.geojson)",value:Z3(n.exportPlaces),children:O.jsx(up,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),O.jsx($i,{label:Ce.get("Combine place data in one file"),value:Z3(n.exportPlacesAsCollection),children:O.jsx(up,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),O.jsx($i,{label:Ce.get("As ZIP archive"),value:Z3(n.exportZipArchive),children:O.jsx(up,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),O.jsx($i,{label:Ce.get("File name"),children:O.jsx(Ii,{variant:"standard",sx:n3e.fileNameTextField,value:n.exportFileName,onChange:s,margin:"normal",size:"small"})})]})}),O.jsx(xb,{children:O.jsx(zi,{onClick:l,disabled:!Iar(n),children:Ce.get("Download")})})]})})},Z3=e=>e?Ce.get("On"):Ce.get("Off"),Aar=e=>/^[0-9a-zA-Z_-]+$/.test(e),Rar=e=>e.toUpperCase()==="TAB"||e.length===1,Iar=e=>(e.exportTimeSeries||e.exportPlaces)&&Aar(e.exportFileName)&&(!e.exportTimeSeries||Rar(e.exportTimeSeriesSeparator)),Dar=e=>({locale:e.controlState.locale,open:!!e.controlState.dialogOpen.export,settings:e.controlState}),Lar={closeDialog:kS,updateSettings:TL,downloadTimeSeries:HSn},Far=hr(Dar,Lar)(Mar),$ar=at(O.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),Nar=({title:e,accept:t,multiple:n,disabled:r,onSelect:i,className:o})=>{const s=M.useRef(null),a=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f{s.current!==null&&s.current.click()};return O.jsxs(O.Fragment,{children:[O.jsx("input",{type:"file",accept:t,multiple:n,ref:s,hidden:!0,onChange:a,disabled:r}),O.jsx(zi,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:e})]})},NJ={parse:e=>e,format:e=>typeof e=="string"?e:`${e}`,validate:e=>!0};function rve(){return e=>{const{options:t,updateOptions:n,optionKey:r,label:i,style:o,className:s,disabled:a,parse:l,format:c,validate:u}=e,f=t[r],d=h=>{const p=h.target.value,g=(l||NJ.parse)(p);n({[r]:g})};return O.jsx(Ii,{label:Ce.get(i),value:(c||NJ.format)(f),error:!(u||NJ.validate)(f),onChange:d,style:o,className:s,disabled:a,size:"small",variant:"standard"})}}const I2=rve(),zar=Qn("div")(({theme:e})=>({paddingTop:e.spacing(2)})),jar=({options:e,updateOptions:t})=>O.jsx(zar,{children:O.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[O.jsx(I2,{optionKey:"timeNames",label:"Time property names",options:e,updateOptions:t}),O.jsx("div",{id:"spareField"}),O.jsx(I2,{label:"Group property names",optionKey:"groupNames",options:e,updateOptions:t}),O.jsx(I2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:e,updateOptions:t}),O.jsx(I2,{label:"Label property names",optionKey:"labelNames",options:e,updateOptions:t}),O.jsx(I2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:e,updateOptions:t})]})}),El=rve(),Bar=Qn("div")(({theme:e})=>({paddingTop:e.spacing(2)})),Uar=({options:e,updateOptions:t})=>{const n=e.forceGeometry;return O.jsxs(Bar,{children:[O.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[O.jsx(El,{optionKey:"xNames",label:"X/longitude column names",options:e,updateOptions:t,disabled:n}),O.jsx(El,{optionKey:"yNames",label:"Y/latitude column names",options:e,updateOptions:t,disabled:n}),O.jsxs("span",{children:[O.jsx(OA,{checked:e.forceGeometry,onChange:r=>t({forceGeometry:r.target.checked}),size:"small"}),O.jsx("span",{children:"Use geometry column"})]}),O.jsx(El,{optionKey:"geometryNames",label:"Geometry column names",options:e,updateOptions:t,disabled:!n}),O.jsx(El,{optionKey:"timeNames",label:"Time column names",options:e,updateOptions:t}),O.jsx("div",{id:"spareField"}),O.jsx(El,{optionKey:"groupNames",label:"Group column names",options:e,updateOptions:t}),O.jsx(El,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:e,updateOptions:t}),O.jsx(El,{optionKey:"labelNames",label:"Label column names",options:e,updateOptions:t}),O.jsx(El,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:e,updateOptions:t})]}),O.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[O.jsx(El,{optionKey:"separator",label:"Separator character",options:e,updateOptions:t}),O.jsx(El,{optionKey:"comment",label:"Comment character",options:e,updateOptions:t}),O.jsx(El,{optionKey:"quote",label:"Quote character",options:e,updateOptions:t}),O.jsx(El,{optionKey:"escape",label:"Escape character",options:e,updateOptions:t}),O.jsx("div",{}),O.jsxs("span",{children:[O.jsx(OA,{checked:e.trim,onChange:r=>t({trim:r.target.checked}),size:"small"}),O.jsx("span",{children:"Remove whitespaces"})]}),O.jsx(El,{optionKey:"nanToken",label:"Not-a-number token",options:e,updateOptions:t}),O.jsx(El,{optionKey:"trueToken",label:"True token",options:e,updateOptions:t}),O.jsx(El,{optionKey:"falseToken",label:"False token",options:e,updateOptions:t})]})]})},D2=rve(),Var=Qn("div")(({theme:e})=>({paddingTop:e.spacing(2)})),War=({options:e,updateOptions:t})=>O.jsx(Var,{children:O.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[O.jsx(D2,{optionKey:"time",label:"Time (UTC, ISO-format)",options:e,updateOptions:t}),O.jsx("div",{id:"spareField"}),O.jsx(D2,{label:"Group",options:e,optionKey:"group",updateOptions:t}),O.jsx(D2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:e,updateOptions:t,disabled:e.group.trim()!==""}),O.jsx(D2,{label:"Label",optionKey:"label",options:e,updateOptions:t}),O.jsx(D2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:e,updateOptions:t,disabled:e.label.trim()!==""})]})}),zJ={csv:{...cje,codeExt:[]},geojson:{...uje,codeExt:[iot()]},wkt:{...hje,codeExt:[]}},jJ={spacer:{flexGrow:1},actionButton:e=>({marginRight:e.spacing(1)}),error:{fontSize:"small"}},Har=Qn("div")(({theme:e})=>({paddingTop:e.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),Gar=Qn(Nar)(({theme:e})=>({marginRight:e.spacing(1)})),qar=({open:e,closeDialog:t,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:s,setMapInteraction:a})=>{const[l,c]=M.useState(""),[u,f]=M.useState(null),[d,h]=M.useState(!1),[p,g]=M.useState(!1),[m,v]=M.useState(n),[y,b]=M.useState(r),w=as();if(M.useEffect(()=>{v(n)},[n]),M.useEffect(()=>{b(r)},[r]),!e)return null;const S=()=>{a("Select"),t("addUserPlacesFromText"),i({userPlacesFormatName:m,userPlacesFormatOptions:y}),o(l)},_=()=>{a(s),t("addUserPlacesFromText")},E=()=>{c("")},T=j=>{const V=j[0];h(!0);const U=new FileReader;U.onloadend=()=>{const z=U.result;v(o1e(z)),c(z),h(!1)},U.onabort=U.onerror=()=>{h(!1)},U.readAsText(V,"UTF-8")},k=()=>{c("")},P=()=>{console.debug("pasted text:",l)},I=j=>{let V=m;l===""&&j.length>10&&(V=o1e(j),v(V)),c(j),f(zJ[V].checkError(j))};function R(j){v(j.target.value)}function F(j){b({...y,csv:{...y.csv,...j}})}function A(j){b({...y,geojson:{...y.geojson,...j}})}function L(j){b({...y,wkt:{...y.wkt,...j}})}let $;return m==="csv"?$=O.jsx(Uar,{options:y.csv,updateOptions:F}):m==="geojson"?$=O.jsx(jar,{options:y.geojson,updateOptions:A}):$=O.jsx(War,{options:y.wkt,updateOptions:L}),O.jsxs(Gu,{fullWidth:!0,open:e,onClose:_,"aria-labelledby":"server-dialog-title",children:[O.jsx(hg,{id:"server-dialog-title",children:Ce.get("Import places")}),O.jsxs(Fc,{dividers:!0,children:[O.jsxs($6,{row:!0,value:m,onChange:j=>R(j),children:[O.jsx(oh,{value:"csv",label:Ce.get(cje.name),control:O.jsx(tO,{})},"csv"),O.jsx(oh,{value:"geojson",label:Ce.get(uje.name),control:O.jsx(tO,{})},"geojson"),O.jsx(oh,{value:"wkt",label:Ce.get(hje.name),control:O.jsx(tO,{})},"wkt")]}),O.jsx(pW,{theme:w.palette.mode,placeholder:Ce.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:zJ[m].codeExt,value:l,onChange:I,onDrop:k,onPaste:P,onPasteCapture:P}),u&&O.jsx(mn,{color:"error",sx:jJ.error,children:u}),O.jsxs(Har,{children:[O.jsx(Gar,{title:Ce.get("From File")+"...",accept:zJ[m].fileExt,multiple:!1,onSelect:T,disabled:d}),O.jsx(zi,{onClick:E,disabled:l.trim()===""||d,sx:jJ.actionButton,variant:"outlined",size:"small",children:Ce.get("Clear")}),O.jsx(bt,{sx:jJ.spacer}),O.jsx(zi,{onClick:()=>g(!p),endIcon:p?O.jsx($ar,{}):O.jsx(oot,{}),variant:"outlined",size:"small",children:Ce.get("Options")})]}),O.jsx(p5,{in:p,timeout:"auto",unmountOnExit:!0,children:$})]}),O.jsxs(xb,{children:[O.jsx(zi,{onClick:_,variant:"text",children:Ce.get("Cancel")}),O.jsx(zi,{onClick:S,disabled:l.trim()===""||u!==null||d,variant:"text",children:Ce.get("OK")})]})]})},Xar=e=>({open:e.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:e.controlState.userPlacesFormatName,userPlacesFormatOptions:e.controlState.userPlacesFormatOptions,nextMapInteraction:e.controlState.lastMapInteraction}),Yar={closeDialog:kS,updateSettings:TL,setMapInteraction:xJe,addUserPlacesFromText:LZe},Qar=hr(Xar,Yar)(qar),mlt=at(O.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");function ive(e,t){return vlt(e,t,[]).join("")}function vlt(e,t,n){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)n.push(e.nodeValue);else{var r=void 0;for(r=e.firstChild;r;r=r.nextSibling)vlt(r,t,n)}return n}function Kar(e){return"documentElement"in e}function Zar(e){return new DOMParser().parseFromString(e,"application/xml")}function ylt(e,t){return(function(n,r){var i=e.call(this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}})}function fu(e,t,n){return(function(r,i){var o=e.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName,l=void 0;a in s?l=s[a]:(l=[],s[a]=l),l.push(o)}})}function gn(e,t,n){return(function(r,i){var o=e.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName;s[a]=o}})}function ja(e,t,n){var r=n!==void 0?n:{},i,o;for(i=0,o=e.length;i{const n=t.Name,r=t.Title||n;let i;const o=t.Attribution;if($O(o)){const s=o.Title,a=o.OnlineResource;s&&a?i=`© ${s}`:a?i=`${a}`:s&&(i=`${s}`)}return{name:n,title:r,attribution:i}})}function Blr(e){const t=$lr.read(e);if($O(t)){const n=t.Capability;if($O(n))return mse(n,!0)}throw new Error("invalid WMSCapabilities object")}function mse(e,t){let n,r;if(t)n=e.Layer;else{const{Layer:o,...s}=e;n=o,r=s}let i;return Array.isArray(n)?i=n.flatMap(o=>mse(o)):$O(n)?i=mse(n):i=[{}],i.map(o=>Ulr(r,o))}function Ulr(e,t){if(!e)return t;if(typeof(e.Name||t.Name)!="string")throw new Error("invalid WMSCapabilities: missing Layer/Name");const r=e.Title,i=t.Title,o=r&&i?`${r} / ${i}`:i||r;return{...e,...t,Title:o}}const Vlr=({userLayer:e,onChange:t,onCancel:n})=>{const[r,i]=M.useState(e.url),[o,s]=M.useState(null),[a,l]=M.useState(-1);M.useEffect(()=>{Nlr(r).then(f=>{s(f)})},[r]),M.useEffect(()=>{if(o&&e.wms){const{layerName:f}=e.wms;l(o.findIndex(d=>d.name===f))}else l(-1)},[o,e.wms]);const c=()=>o&&o.length&&a!=-1,u=()=>{o&&a!==-1&&t({...e,title:o[a].title,url:r.trim(),attribution:o[a].attribution,wms:{layerName:o[a].name}})};return O.jsxs(bt,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[O.jsx(Ii,{required:!0,label:Ce.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),O.jsx(Oh,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:a,size:"small",renderValue:()=>o&&o.length&&a>=0?o[a].title:Ce.get("WMS Layer"),children:(o||[]).map((f,d)=>O.jsx(nr,{value:d,selected:a===d,children:O.jsx(Qi,{primary:f.title})},f.name))}),O.jsx(Q8,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:Ce.get("docs/add-layer-wms.en.md")})]})},Wlr=({userLayer:e,onChange:t,onCancel:n})=>{const[r,i]=Te.useState(e.title),[o,s]=Te.useState(e.url),[a,l]=Te.useState(e.attribution||""),c=(d,h)=>{const p=d!=="",g=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&g},u=()=>c(r.trim(),o.trim()),f=()=>t({...e,title:r.trim(),url:o.trim(),attribution:a.trim()});return O.jsxs(bt,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[O.jsx(Ii,{required:!0,label:Ce.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>s(d.currentTarget.value)}),O.jsxs(bt,{sx:{display:"flex",gap:1},children:[O.jsx(Ii,{required:!0,label:Ce.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),O.jsx(Ii,{label:Ce.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:a,onChange:d=>l(d.currentTarget.value)})]}),O.jsx(Q8,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:Ce.get("docs/add-layer-xyz.en.md")})]})},Hlr={paper:e=>({backgroundColor:(e.palette.mode==="dark"?dh:fh)(e.palette.background.paper,.1),marginBottom:e.spacing(2)})},r3e=({userLayers:e,setUserLayers:t,selectedId:n,setSelectedId:r})=>{const[i,o]=Te.useState(n),[s,a]=Te.useState(null),[l,c]=Itt();if(!open)return null;const u=b=>{c(()=>t(e)),a({editId:b.id,editMode:"edit"})},f=b=>{c(void 0);const w=e.findIndex(S=>S.id===b.id);t([...e.slice(0,w+1),{...b,id:gh("user-layer"),title:b.title+" Copy"},...e.slice(w+1)])},d=b=>{c(void 0);const w=e.findIndex(S=>S.id===b.id);b.id===n&&r(i),b.id===i&&o(null),t([...e.slice(0,w),...e.slice(w+1)])},h=b=>{c(()=>t(e));const w=gh("user-layer-");t([...e,{id:w,title:"",url:"",attribution:"",wms:b==="wms"?{layerName:""}:void 0}]),a({editId:w,editMode:"add"})},p=()=>{h("wms")},g=()=>{h("xyz")},m=b=>{c(void 0);const w=e.findIndex(S=>S.id===b.id);n===b.id&&r(i),t([...e.slice(0,w),b,...e.slice(w+1)]),a(null)},v=()=>{if(l(),s&&s.editMode==="add"){const b=e.findIndex(w=>w.id===s.editId);t([...e.slice(0,b),...e.slice(b+1)])}a(null)},y=s!==null;return O.jsx(fa,{sx:Hlr.paper,children:O.jsxs(WI,{component:"nav",dense:!0,children:[e.map(b=>{const w=n===b.id;return s&&s.editId===b.id?b.wms?O.jsx(Vlr,{userLayer:b,onChange:m,onCancel:v},b.id):O.jsx(Wlr,{userLayer:b,onChange:m,onCancel:v},b.id):O.jsxs(Qze,{selected:w,onClick:()=>r(w?null:b.id),children:[O.jsx(Qi,{primary:b.title,secondary:b.url}),O.jsxs(TA,{children:[O.jsx(Mn,{onClick:()=>u(b),size:"small",disabled:y,children:O.jsx(dP,{})}),O.jsx(Mn,{onClick:()=>f(b),size:"small",disabled:y,children:O.jsx(mlt,{})}),O.jsx(Mn,{onClick:()=>d(b),size:"small",disabled:y,children:O.jsx(fP,{})})]})]},b.id)}),!y&&O.jsx(eO,{sx:{minHeight:"2rem"},children:O.jsx(TA,{children:O.jsxs(bt,{sx:{display:"flex",gap:2,paddingTop:2},children:[O.jsx(_n,{title:Ce.get("Add layer from a Web Map Service"),children:O.jsx(zi,{onClick:p,startIcon:O.jsx(gse,{}),children:"WMS"})}),O.jsx(_n,{title:Ce.get("Add layer from a Tiled Web Map"),children:O.jsx(zi,{onClick:g,startIcon:O.jsx(gse,{}),children:"XYZ"})})]})})})]})})},Glr=({dialogId:e,open:t,closeDialog:n,settings:r,updateSettings:i,setLayerVisibilities:o})=>{const[s,a]=M.useState(null),[l,c]=M.useState(null),u=M.useCallback((w,S)=>{const _={};w&&(_[w]=!1),S&&(_[S]=!0),o(_)},[o]),f=M.useCallback(w=>{a(w),u(s,w)},[s,u]),d=M.useCallback(w=>{c(w),u(s,w)},[s,u]),[h,p]=M.useState(e==="userBaseMaps"?0:1),g=r.userBaseMaps,m=M.useCallback(w=>{i({userBaseMaps:w})},[i]),v=r.userOverlays,y=M.useCallback(w=>{i({userOverlays:w})},[i]);function b(){n(e)}return t?O.jsxs(Gu,{open:t,fullWidth:!0,maxWidth:"sm",onClose:b,scroll:"body",children:[O.jsx(hg,{children:Ce.get("User Layers")}),O.jsxs(Fc,{children:[O.jsx(bt,{sx:{borderBottom:1,borderColor:"divider"},children:O.jsxs(dae,{value:h,onChange:(w,S)=>p(S),children:[O.jsx(PA,{label:Ce.get("Base Maps")}),O.jsx(PA,{label:Ce.get("Overlays")})]})}),h===0&&O.jsx(r3e,{userLayers:g,setUserLayers:m,selectedId:s,setSelectedId:f},"baseMaps"),h===1&&O.jsx(r3e,{userLayers:v,setUserLayers:y,selectedId:l,setSelectedId:d},"overlays")]})]}):null},qlr=(e,t)=>({open:e.controlState.dialogOpen[t.dialogId],settings:e.controlState,dialogId:t.dialogId,layerVisibilities:rU(e)}),Xlr={closeDialog:kS,updateSettings:TL,setLayerVisibilities:lJe},i3e=hr(qlr,Xlr)(Glr),Ylr=at(O.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore");function _lt({selected:e,title:t,actions:n}){return O.jsxs(HI,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...e&&{background:r=>Vt(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[O.jsx(Wre,{}),O.jsx(mn,{sx:{flex:"1 1 100%",paddingLeft:1},children:t}),n]})}const Qlr={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function Klr({userVariables:e,setUserVariables:t,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?e[n]:null,s=n>=0,a=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:COn()})},c=()=>{const d=e[n];t([...e.slice(0,n+1),OOn(d),...e.slice(n+1)]),r(n+1)},u=()=>{i({editMode:"edit",variable:o})},f=()=>{t([...e.slice(0,n),...e.slice(n+1)]),n>=e.length-1&&r(e.length-2)};return O.jsxs(O.Fragment,{children:[O.jsx(_lt,{selected:n!==null,title:Ce.get("Manage user variables"),actions:O.jsxs(O.Fragment,{children:[O.jsx(_n,{title:Ce.get("Add user variable"),children:O.jsx(Mn,{color:"primary",onClick:l,children:O.jsx(Y8,{})})}),s&&O.jsx(_n,{title:Ce.get("Duplicate user variable"),children:O.jsx(Mn,{onClick:c,children:O.jsx(mlt,{})})}),s&&O.jsx(_n,{title:Ce.get("Edit user variable"),children:O.jsx(Mn,{onClick:u,children:O.jsx(dP,{})})}),s&&O.jsx(_n,{title:Ce.get("Remove user variable"),children:O.jsx(Mn,{onClick:f,children:O.jsx(glt,{})})})]})}),O.jsx(fae,{sx:Qlr.tableContainer,children:O.jsxs(N6,{size:"small",children:[O.jsx(a5e,{children:O.jsxs(hf,{children:[O.jsx(mi,{sx:{width:"15%"},children:Ce.get("Name")}),O.jsx(mi,{sx:{width:"15%"},children:Ce.get("Title")}),O.jsx(mi,{sx:{width:"10%"},children:Ce.get("Units")}),O.jsx(mi,{children:Ce.get("Expression")})]})}),O.jsx(j6,{children:e.map((d,h)=>O.jsxs(hf,{hover:!0,selected:h===n,onClick:()=>a(h),children:[O.jsx(mi,{component:"th",scope:"row",children:d.name}),O.jsx(mi,{children:d.title}),O.jsx(mi,{children:d.units}),O.jsx(mi,{children:d.expression||""})]},d.id))})]})})]})}const Zlr=at(O.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),Jlr=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function ecr(e){return Jlr.test(e)}const o3e={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function s3e({part:e,partType:t,onPartClicked:n}){return O.jsx(bt,{component:"span",sx:o3e.expressionPart,children:O.jsx(A6,{label:e,sx:o3e.expressionPartChip,size:"small",variant:"outlined",color:t==="variables"||t==="constants"?"default":t.includes("Functions")?"primary":"secondary",onClick:()=>n(e)})})}function tcr({anchorEl:e,exprPartTypes:t,setExprPartTypes:n,onClose:r}){const i=o=>{n({...t,[o]:!t[o]})};return O.jsx(Qw,{open:!!e,anchorEl:e,onClose:r,children:det.map(o=>O.jsx(plt,{selected:t[o],title:Ce.get(TOn[o]),onClick:()=>i(o),dense:!0},o))})}function ncr({expression:e,onExpressionChange:t,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=qw(),s=M.useRef(null),a=M.useCallback(c=>{const u=s.current?.view;if(u){const f=u.state.selection.main,d=u.state.sliceDoc(f.from,f.to).trim();d!==""&&c.includes("X")&&(c=c.replace("X",d));const h=u.state.replaceSelection(c);h&&u.dispatch(h)}},[]);M.useEffect(()=>{i.current=a},[i,a]);const l=M.useCallback(c=>{const u=c.matchBefore(/\w*/);return u===null||u.from==u.to&&!c.explicit?null:{from:u.from,options:[...n.map(f=>({label:f,type:"variable"})),...r.namespace.constants.map(f=>({label:f,type:"variable"})),...r.namespace.arrayFunctions.map(f=>({label:f,type:"function"})),...r.namespace.otherFunctions.map(f=>({label:f,type:"function"}))]}},[n,r.namespace]);return O.jsx(pW,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:Ce.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[oit({override:[l]})],value:e,onChange:t,ref:s})}async function rcr(e,t,n){if(n.trim()==="")return Ce.get("Must not be empty");const r=`${e}/expressions/validate/${xT(t)}/${encodeURIComponent(n)}`;try{return await h5e(r),null}catch(i){const o=i.message;if(o){const s=o.indexOf("("),a=o.lastIndexOf(")");return o.slice(s>=0?s+1:0,a>=0?a:o.length)}return Ce.get("Invalid expression")}}const J3={container:{display:"flex",flexDirection:"column",height:"100%"},content:{flexGrow:1,display:"flex",flexDirection:"column",gap:2,padding:1},propertiesRow:{display:"flex",gap:1},expressionRow:{flexGrow:1},expressionParts:{paddingTop:1,overflowY:"auto"},expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function icr({userVariables:e,editedVariable:t,setEditedVariable:n,contextDataset:r,expressionCapabilities:i,serverUrl:o,canCommit:s,setCanCommit:a}){const[l,c]=M.useState(EOn),[u,f]=M.useState(null),d=[...e,...r.variables],h=r.variables.filter(z=>!tD(z)).map(z=>z.name),{id:p,name:g,title:m,units:v,expression:y}=t.variable,b=d.findIndex(z=>z.id!==p&&z.name===g)>=0,w=!ecr(g),S=b?Ce.get("Already in use"):w?Ce.get("Not a valid identifier"):null,_=!S,[E,T]=M.useState(null);s=_&&!E,M.useEffect(()=>{a(s)},[a,s]);const P=M.useRef(null);M.useEffect(()=>{const z=setTimeout(()=>{rcr(o,r.id,t.variable.expression).then(T)},500);return()=>{clearTimeout(z)}},[o,r.id,t.variable.expression]);const I=(z,N)=>{n({...t,variable:{...t.variable,[z]:N}})},R=z=>{I("name",z.target.value)},F=z=>{I("title",z.target.value)},A=z=>{I("units",z.target.value)},L=z=>{I("expression",z)},$=z=>{P.current(z)},j=z=>{f(z.currentTarget)},V=()=>{f(null)},U=[O.jsx(Mn,{size:"small",onClick:j,children:O.jsx(_n,{arrow:!0,title:Ce.get("Display further elements to be used in expressions"),children:O.jsx(Zlr,{})})},"filter")];return det.forEach(z=>{l[z]&&(z==="variables"?h.forEach(N=>{U.push(O.jsx(s3e,{part:N,partType:z,onPartClicked:$},`${z}-${N}`))}):i.namespace[z].forEach(N=>{U.push(O.jsx(s3e,{part:N,partType:z,onPartClicked:$},`${z}-${N}`))}))}),O.jsxs(O.Fragment,{children:[O.jsx(tcr,{anchorEl:u,exprPartTypes:l,setExprPartTypes:c,onClose:V}),O.jsx(_lt,{selected:!0,title:t.editMode==="add"?Ce.get("Add user variable"):Ce.get("Edit user variable")}),O.jsxs(bt,{sx:J3.content,children:[O.jsxs(bt,{sx:J3.propertiesRow,children:[O.jsx(Ii,{sx:{flexGrow:.3},error:!_,helperText:S,size:"small",variant:"standard",label:Ce.get("Name"),value:g,onChange:R}),O.jsx(Ii,{sx:{flexGrow:.6},size:"small",variant:"standard",label:Ce.get("Title"),value:m,onChange:F}),O.jsx(Ii,{sx:{flexGrow:.1},size:"small",variant:"standard",label:Ce.get("Units"),value:v,onChange:A})]}),O.jsxs(bt,{sx:J3.expressionRow,children:[O.jsx(mn,{sx:z=>({paddingBottom:1,color:z.palette.text.secondary}),children:Ce.get("Expression")}),O.jsx(ncr,{expression:y,onExpressionChange:L,variableNames:h,expressionCapabilities:i,handleInsertPartRef:P}),E&&O.jsx(mn,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:E}),O.jsx(bt,{sx:J3.expressionParts,children:U})]})]})]})}const a3e={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function ocr({open:e,closeDialog:t,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:s,expressionCapabilities:a,serverUrl:l}){const[c,u]=M.useState(o),[f,d]=M.useState(c.findIndex(S=>S.name===r)),[h,p]=M.useState(null),[g,m]=M.useState(!1);if(M.useEffect(()=>{u(o)},[o]),!e||!n||!a)return null;function v(){s(n.id,c),t(qB),f>=0&&i(c[f].name)}function y(){u(o),t(qB)}function b(){p(null)}function w(){if(h){if(h.editMode==="add")u([h.variable,...c]);else{const S=c.findIndex(_=>_.id===h.variable.id);if(S>=0){const _=[...c];_[S]=h.variable,u(_)}}p(null)}}return O.jsxs(Gu,{open:e,fullWidth:!0,maxWidth:"md",onClose:y,scroll:"body",children:[O.jsx(hg,{children:Ce.get("User Variables")}),O.jsx(Fc,{dividers:!0,sx:a3e.dialogContent,children:h===null?O.jsx(Klr,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):O.jsx(icr,{userVariables:c,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:a,serverUrl:l,canCommit:g,setCanCommit:m})}),O.jsxs(xb,{sx:a3e.dialogActions,children:[O.jsx(bt,{children:O.jsx(Dtt,{size:"medium",helpUrl:Ce.get("docs/user-variables.en.md")})}),h!==null?O.jsxs(bt,{children:[O.jsx(zi,{onClick:b,startIcon:O.jsx(Ylr,{}),children:Ce.get("Back")}),O.jsx(zi,{onClick:w,disabled:!g,children:Ce.get(h.editMode==="edit"?"Apply":"Add")})]}):O.jsxs(bt,{children:[O.jsx(zi,{onClick:y,children:Ce.get("Cancel")}),O.jsx(zi,{onClick:v,disabled:!scr(c),children:Ce.get("OK")})]})]})]})}function scr(e){const t=new Set;return e.forEach(n=>t.add(n.name)),t.size===e.length}const acr=e=>({open:e.controlState.dialogOpen[qB],selectedDataset:Co(e),selectedVariableName:iS(e),userVariables:oIt(e),expressionCapabilities:CRt(e),serverUrl:Go(e).url,themeMode:e.controlState.themeMode}),lcr={closeDialog:kS,selectVariable:hJe,updateDatasetUserVariables:vSn},ccr=hr(acr,lcr)(ocr),ucr=e=>({compact:!!On.instance.branding.compact,themeMode:e.controlState.themeMode}),fcr={},dcr=({compact:e,themeMode:t})=>{const n=rae("(prefers-color-scheme: dark)")?"dark":"light",r=M.useMemo(()=>{let o=gje(t,n)==="dark"?JSt:ZSt;const s=On.instance.branding.primaryColor,a=On.instance.branding.secondaryColor;return s&&(o={...o,palette:{...o.palette,primary:{...s}}}),a&&(o={...o,palette:{...o.palette,secondary:{...a}}}),dT({...o})},[t,n]);return O.jsx(DCn,{children:O.jsx(fdt,{injectFirst:!0,children:O.jsxs($pt,{theme:r,children:[O.jsx(c0t,{}),O.jsx($Cn,{}),!e&&O.jsx(pOn,{}),O.jsx(Xsr,{}),O.jsx(sar,{}),O.jsx(Sar,{}),O.jsx(kar,{}),O.jsx(i3e,{dialogId:"userOverlays"},"userOverlays"),O.jsx(i3e,{dialogId:"userBaseMaps"},"userBaseMaps"),O.jsx(ccr,{}),O.jsx(Qar,{}),O.jsx(Far,{}),O.jsx(C_n,{}),O.jsx(Jsr,{}),O.jsx(yar,{})]})})})},hcr=hr(ucr,fcr)(dcr);function pcr(e,t,n){switch(e===void 0&&(e=oEt()),t.type){case $pe:{const{controlState:r}=t.persistedState.state;return{...e,...r}}case Kpe:{const r={...e,...t.settings};return Vh(r),r}case DJe:return Vh(e),e;case CR:{let r=e.selectedDatasetId||Sm.get("dataset"),i=e.selectedVariableName||Sm.get("variable"),o=e.mapInteraction,s=rO(t.datasets,r);const a=s&&Fee(s,i)||null;return s?a||(i=s.variables.length?s.variables[0].name:null):(r=null,i=null,t.entrypointDatasetId&&(s=rO(t.datasets,t.entrypointDatasetId)),s=t.datasets.length?s||t.datasets[0]:null,s&&(r=s.id,s.variables.length>0&&(i=s.variables[0].name))),r||(o="Select"),{...e,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case JZe:{let r=e.selectedVariableName;const i=rO(t.datasets,t.selectedDatasetId);!Fee(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const s=t.selectedDatasetId,a=Mje(i),l=a?a[1]:null;return{...e,selectedDatasetId:s,selectedVariableName:r,selectedTimeRange:a,selectedTime:l}}case rJe:{const{location:r}=t;return e.flyTo!==r?{...e,flyTo:r}:e}case iJe:{const r=t.selectedPlaceGroupIds;return{...e,selectedPlaceGroupIds:r,selectedPlaceId:null}}case oJe:{const{placeId:r}=t;return{...e,selectedPlaceId:r}}case dJe:return{...e,selectedVariableName:t.selectedVariableName};case sJe:return{...e,layerVisibilities:{...e.layerVisibilities,datasetVariable:!t.visible,datasetRgb:t.visible}};case aJe:return{...e,layerVisibilities:{...e.layerVisibilities,...t.layerVisibilities}};case cJe:return{...e,layerGroupStates:{...e.layerGroupStates,...t.layerGroupStates}};case uJe:{const{mapPointInfoBoxEnabled:r}=t;return{...e,mapPointInfoBoxEnabled:r}}case fJe:{const{variableCompareMode:r}=t;return{...e,variableCompareMode:r,variableSplitPos:void 0}}case Hpe:{const{size:r,isDelta:i}=t;return!i&&e.variableSplitPos!==r?{...e,variableSplitPos:r}:Fr(e.variableSplitPos)&&r!==0?{...e,variableSplitPos:e.variableSplitPos+r}:e}case gJe:{let{selectedTime:r}=t;if(r!==null&&n){const i=Qee(n),o=i?pBe(i,r):-1;o>=0&&(r=i[o])}return e.selectedTime!==r?{...e,selectedTime:r}:e}case mJe:{if(n){let r=y4e(n);if(r>=0){const i=Qee(n);r+=t.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const s=e.selectedTimeRange;if(s!==null&&(os[1]&&(o=s[1])),e.selectedTime!==o)return{...e,selectedTime:o}}}return e}case Gpe:return{...e,selectedTimeRange:t.selectedTimeRange};case u_n:return{...e,timeSeriesUpdateMode:t.timeSeriesUpdateMode};case yJe:return{...e,timeAnimationActive:t.timeAnimationActive,timeAnimationInterval:t.timeAnimationInterval};case zpe:{const{id:r,selected:i}=t;return i?gcr(e,Gd,r):e}case jpe:{const{placeGroups:r}=t;return r.length>0?{...e,selectedPlaceGroupIds:[...e.selectedPlaceGroupIds||[],r[0].id]}:e}case Bpe:{const{placeGroupId:r,newName:i}=t;return r===Gd?{...e,userDrawnPlaceGroupName:i}:e}case Upe:{const{placeId:r,places:i}=t;if(r===e.selectedPlaceId){let o=null;const s=i.findIndex(a=>a.id===r);return s>=0&&(s0&&(o=i[s-1].id)),{...e,selectedPlaceId:o}}return e}case $Je:{const r=t.colorBarId;return{...e,userColorBars:[{id:r,type:"continuous",code:Rje},...e.userColorBars]}}case NJe:{const r=t.colorBarId,i=e.userColorBars.findIndex(o=>o.id===r);if(i>=0){const o={...e,userColorBars:[...e.userColorBars.slice(0,i),...e.userColorBars.slice(i+1)]};return Vh(o),o}return e}case BJe:{const r=t.userColorBar,i=e.userColorBars.findIndex(o=>o.id===r.id);return i>=0?{...e,userColorBars:[...e.userColorBars.slice(0,i),{...r},...e.userColorBars.slice(i+1)]}:e}case bJe:{let r={...e,mapInteraction:t.mapInteraction,lastMapInteraction:e.mapInteraction};return t.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...e.dialogOpen,addUserPlacesFromText:!0}}),r}case wJe:{const{layerMenuOpen:r}=t;return e={...e,layerMenuOpen:r},Vh(e),e}case _Je:{const{sidePanelOpen:r}=t;return e={...e,sidePanelOpen:r},Vh(e),e}case CJe:{const{sidePanelId:r}=t;return e={...e,sidePanelId:r},Vh(e),e}case Ype:{const{sizeDelta:r}=t;return r?{...e,sidePanelSize:e.sidePanelSize+r}:e}case OJe:return e={...e,volumeRenderMode:t.volumeRenderMode},Vh(e),e;case EJe:{const{volumeId:r,volumeState:i}=t;return e={...e,volumeStates:{...e.volumeStates,[r]:i}},e}case TJe:{const r={...e.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:t.visibleElements.includes(i)}}),e={...e,infoCardElementStates:r},Vh(e),e}case PJe:{const{elementType:r,viewMode:i}=t,o={...e,infoCardElementStates:{...e.infoCardElementStates,[r]:{...e.infoCardElementStates[r],viewMode:i}}};return Vh(o),o}case kJe:return{...e,activities:{...e.activities,[t.id]:t.message}};case MJe:{const r={...e.activities};return delete r[t.id],{...e,activities:r}}case AJe:{const r=t.locale;return Ce.locale=r,r!==e.locale&&(e={...e,locale:r},Vh(e)),e}case RJe:{const r=t.dialogId;return{...e,dialogOpen:{...e.dialogOpen,[r]:!0}}}case IJe:{const r=t.dialogId;return{...e,dialogOpen:{...e.dialogOpen,[r]:!1}}}case pJe:{const{selectedDataset2Id:r,selectedVariable2Name:i}=t;return r===e.selectedDataset2Id&&i===e.selectedVariable2Name?{...e,selectedDataset2Id:null,selectedVariable2Name:null,variableCompareMode:!1,variableSplitPos:void 0}:{...e,selectedDataset2Id:r,selectedVariable2Name:i,variableCompareMode:!0}}case Jpe:return{...e,zoomLevel:t.zoomLevel};case ege:return{...e,datasetZLevel:t.datasetZLevel};case Vpe:if(e.selectedServerId!==t.selectedServerId)return{...e,selectedServerId:t.selectedServerId}}return e}function gcr(e,t,n){let r=e.selectedPlaceGroupIds;return!e.selectedPlaceGroupIds||e.selectedPlaceGroupIds.length===0?r=[t]:e.selectedPlaceGroupIds.find(i=>i===t)||(r=[...e.selectedPlaceGroupIds,t]),{...e,selectedPlaceGroupIds:r,selectedPlaceId:n}}function mcr(){const e=KOt(),t=[{...On.instance.server}];return e.forEach(n=>{t.find(r=>r.id===n.id)||t.push(n)}),{serverInfo:null,expressionCapabilities:null,datasets:[],colorBars:null,statistics:{loading:!1,records:[]},timeSeriesGroups:[],userPlaceGroups:[],userServers:t}}function vcr(e,t){switch(e===void 0&&(e=mcr()),t.type){case $pe:{const{dataState:n}=t.persistedState.state;return{...e,...n}}case VB:return{...e,serverInfo:t.serverInfo};case qZe:return{...e,expressionCapabilities:t.expressionCapabilities};case CR:return{...e,datasets:t.datasets};case DZe:{const{datasetId:n,userVariables:r}=t,i=e.datasets.findIndex(l=>l.id===n),o=e.datasets[i],[s,a]=Gae(o);return{...e,datasets:[...e.datasets.slice(0,i),{...o,variables:[...s,...r]},...e.datasets.slice(i+1)]}}case YZe:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:s,opacity:a}=t,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:s,opacity:a};return l3e(e,n,r,l)}case KZe:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=t;return l3e(e,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case Npe:{const n=t.placeGroup,r=e.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(s=>s.id===n.id);if(o>=0){const s=[...i.placeGroups];return s[o]=n,{...i,placeGroups:s}}}return i});return{...e,datasets:r}}case zpe:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=t,s={type:"Feature",id:r,properties:i,geometry:o},a=e.userPlaceGroups,l=a.findIndex(c=>c.id===Gd);if(l>=0){const c=a[l];return{...e,userPlaceGroups:[...a.slice(0,l),{...c,features:[...c.features,s]},...a.slice(l+1)]}}else{const c=n&&n!==""?n:Ce.get("My places");return{...e,userPlaceGroups:[{type:"FeatureCollection",id:Gd,title:c,features:[s]},...a]}}}case jpe:{const{placeGroups:n}=t;return{...e,userPlaceGroups:[...e.userPlaceGroups,...n]}}case Bpe:{const{placeGroupId:n,newName:r}=t,i=e.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o];return{...e,userPlaceGroups:[...i.slice(0,o),{...s,title:r},...i.slice(o+1)]}}return e}case FZe:{const{placeGroupId:n,placeId:r,newName:i}=t,o=e.userPlaceGroups,s=u3e(o,n,r,{label:i});return s?{...e,userPlaceGroups:s}:e}case $Ze:{const{placeGroupId:n,placeId:r,placeStyle:i}=t,o=e.userPlaceGroups,s=u3e(o,n,r,i);return s?{...e,userPlaceGroups:s}:e}case Upe:{const{placeGroupId:n,placeId:r}=t,i=e.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o],a=s.features.findIndex(l=>l.id===r);if(a>=0){const l=c3e(e.timeSeriesGroups,[r]);let c=e.timeSeriesGroups;return l.forEach(u=>{c=VJ(c,u,"remove","append")}),{...e,userPlaceGroups:[...i.slice(0,o),{...s,features:[...s.features.slice(0,a),...s.features.slice(a+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return e}case NZe:{const{placeGroupId:n}=t,r=e.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const s=r[i].features.map(c=>c.id),a=c3e(e.timeSeriesGroups,s);let l=e.timeSeriesGroups;return a.forEach(c=>{l=VJ(l,c,"remove","append")}),{...e,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return e}case XZe:return{...e,colorBars:t.colorBars};case VZe:{const{timeSeriesGroupId:n,timeSeries:r}=t,i=e.timeSeriesGroups,o=i.findIndex(l=>l.id===n),s=i[o],a=[...i];return a[o]={...s,timeSeriesArray:[...s.timeSeriesArray,r]},{...e,timeSeriesGroups:a}}case jZe:{const n=e.statistics;if(t.statistics===null)return{...e,statistics:{...n,loading:!0}};const r=n.records;return{...e,statistics:{...n,loading:!1,records:[t.statistics,...r]}}}case BZe:{const{index:n}=t,r=e.statistics,i=r.records;return{...e,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case UZe:{const{timeSeries:n,updateMode:r,dataMode:i}=t,o=VJ(e.timeSeriesGroups,n,r,i);return o!==e.timeSeriesGroups?{...e,timeSeriesGroups:o}:e}case WZe:{const n=e.timeSeriesGroups.findIndex(r=>r.id===t.groupId);if(n>=0){const r=[...e.timeSeriesGroups],i={...r[n]},o=[...i.timeSeriesArray];return o.splice(t.index,1),i.timeSeriesArray=o,r[n]=i,{...e,timeSeriesGroups:r}}return e}case HZe:{const n=e.timeSeriesGroups.findIndex(r=>r.id===t.id);if(n>=0){const r=[...e.timeSeriesGroups];return r.splice(n,1),{...e,timeSeriesGroups:r}}return e}case GZe:return{...e,timeSeriesGroups:[]};case Gpe:{const{selectedGroupId:n,selectedValueRange:r}=t;if(!n)return e;const i=e.timeSeriesGroups.findIndex(s=>s.id===n),o=r||void 0;return{...e,timeSeriesGroups:[...e.timeSeriesGroups.slice(0,i),{...e.timeSeriesGroups[i],variableRange:o},...e.timeSeriesGroups.slice(i+1)]}}case Vpe:return e.userServers!==t.servers?(QOt(t.servers),{...e,userServers:t.servers}):e;default:return e}}function l3e(e,t,n,r){const i=e.datasets.findIndex(o=>o.id===t);if(i>=0){const o=e.datasets[i],s=o.variables.findIndex(a=>a.name===n);if(s>=0){const a=o.variables[s],l=e.datasets.slice(),c=o.variables.slice();return c[s]={...a,...r},l[i]={...o,variables:c},{...e,datasets:l}}}return e}function VJ(e,t,n,r){let i=t,o;const s=e.findIndex(a=>a.variableUnits===i.source.variableUnits);if(s>=0){const a=e[s],l=a.timeSeriesArray,c=l.findIndex(f=>f.source.datasetId===i.source.datasetId&&f.source.variableName===i.source.variableName&&f.source.placeId===i.source.placeId);let u;if(c>=0){const f=l[c];r==="append"&&(i={...i,data:[...i.data,...f.data]}),n==="replace"?u=[i]:n==="add"?(u=l.slice(),u[c]=i):(u=l.slice(),u.splice(c,1))}else n==="replace"?u=[i]:n==="add"?u=[i,...l]:u=l;n==="replace"?o=[{...a,timeSeriesArray:u}]:n==="add"?(o=e.slice(),o[s]={...a,timeSeriesArray:u}):u.length>=0?(o=e.slice(),o[s]={...a,timeSeriesArray:u}):(o=e.slice(),o.splice(s,1))}else n==="replace"?o=[{id:gh("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:gh("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...e]:o=e;return o}function c3e(e,t){const n=[];return e.forEach(r=>{r.timeSeriesArray.forEach(i=>{t.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function u3e(e,t,n,r){const i=e.findIndex(o=>o.id===t);if(i>=0){const o=e[i],s=o.features,a=s.findIndex(l=>l.id===n);if(a>=0){const l=s[a];return[...e.slice(0,i),{...o,features:[...s.slice(0,a),{...l,properties:{...l.properties,...r}},...s.slice(a+1)]},...e.slice(i+1)]}}}function ycr(){return{newEntries:[],oldEntries:[]}}let bcr=0;function xcr(e,t){e===void 0&&(e=ycr());const n=e.newEntries;switch(t.type){case TZe:{const r=t.messageType,i=t.messageText;let o=n.length?n[0]:null;return o&&r===o.type&&i===o.text?e:(o={id:++bcr,type:r,text:i},{...e,newEntries:[o,...n]})}case PZe:{const r=n.findIndex(i=>i.id===t.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const s=[i,...e.oldEntries];return{...e,newEntries:o,oldEntries:s}}}}return e}function wcr(){return{accessToken:null}}function Scr(e,t){return e===void 0&&(e=wcr()),t.type===aet?{...e,accessToken:t.accessToken}:e}function _cr(e,t){return{dataState:vcr(e&&e.dataState,t),controlState:pcr(e&&e.controlState,t,e),messageLogState:xcr(e&&e.messageLogState,t),userAuthState:Scr(e&&e.userAuthState,t)}}console.debug("baseUrl:",pT);On.load().then(async()=>{const e=(s,a)=>a.type!==Hpe&&a.type!==Ype&&a.type!==Jpe&&a.type!==ege,t=dft.createLogger({collapsed:!0,diff:!1,predicate:e}),n=cft(v3e,t);let r;r=n;const i=g3e(_cr,r),o=i.dispatch;o(Qpe(i.getState().controlState.locale)),o(b_n()),i.getState().controlState.privacyNoticeAccepted&&o(Wpe(i,!0)),gut.createRoot(document.getElementById("root")).render(O.jsx(_ut,{store:i,children:O.jsx(hcr,{})}))}); diff --git a/xcube/webapi/viewer/dist/assets/main-DhxwCNXC.css b/xcube/webapi/viewer/dist/assets/main-DhxwCNXC.css deleted file mode 100644 index 727138207..000000000 --- a/xcube/webapi/viewer/dist/assets/main-DhxwCNXC.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-cyrillic-ext-300-normal-CUPJdUZp.woff2) format("woff2"),url(./roboto-cyrillic-ext-300-normal-DQdcc27I.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-cyrillic-300-normal-BoeCr7ev.woff2) format("woff2"),url(./roboto-cyrillic-300-normal-D568C3aM.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(data:font/woff2;base64,d09GMgABAAAAAA5IABIAAAAAGuQAAA3lAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbHhw0BmA/U1RBVFoAXgiBfgmfBhEMCoJsgnMLFAABNgIkAyQEIAWFDgcgDIVOG5oZsxEVbBxAII6nAfzXB9wYAjW0/xjhZUReItjgvOppioDbX2Nvjwhbwzmvg8YaOKyTn16iEX1dG9v8n64gjJBk1v//78rf51wUR4grYE/oitg96LemArM7cQfGqwf7D/DXm/J7U03SrdK76UgZvEmHtGe3IlItRS0OwE0BREnOHm6p5/Wb3C4fqXRu1ai5BFJEj5cnogLQAwcKrGsjfFHpTKVcEHBbSYjujnuJUKh3n1R8IhPCEgxsUNWacx9C9bHYY3Sq1odZiTPiVPGsJ835mrMEjY/7pvbSWcn6p19KSTFKB6whGEI8s96zZsdy0a9r53yl+i7trkupNrLvB5WK8ngeb62jTgMDMAyg0U0saj/KYKuaxOMW8Wo6uAibFLc9loIAuAgcwWyK2oCNuqtNAwePrGKsJFkWRQCwcYcucn6h+lNXL5mH2jOXTJ8bHZg3edkCTdvB985SlFMZFKBOqo4ANUhnxHuYwQBiH+wTvQjGhsTjQ+a3bTBKowaYYZxkeKBzgl+uhwoBeBCg8hO3FKY+Thl45bRls4iAlTNnLSOA/hXmcxCD0QjF0BBgMLWwytI8QYrKYMg3m2PaBbgkXSi9U2K4y4bZRVMtz4KH86dicQcM6Emjf/F1NPPzJ/ytaTMaKFIhCuNQ9jgGRD+P1vjoH46L8vRPAJ7yrDP3zscdk+aQ9jZPuoW+3EkfeMCJPsfR+cPdyMEmd5232xGPuaEEh7hLrsUuF3w6dMbDkvjyhouIuWc8XhvtVaO9/f0+cMAJdzzg6V6j/+W7IThepXUgH53LXkQobatdDuf8kOrFSpDAVKzCemxmeH/NP/Oiuz70ac2wFjsdcsYVD84e5PrDxf/Hjx3dvm3rls2b0qmNr7/vfe7rPPZtXeZpHPqubeqqLPIsTeIoDHzPdWzLNHRNlSVR4DmvRr/X7bSL99/KtjYbaXTaN3wz32o2kmh30mh7LEqhAwbiqyBuCP7Q6v7I5i2ltVOs4UOSx1NhJlORkavgpDKBFvNy/TH3h6WlXCbNiPZNIIameog3uXPgyB0Gm333Cwzp2NYbSrJh2IsyAQnJzCIE3LivImXeXMXPAeLGMaYY1mzn+lQ0tTOZ+Jtng/tiKbXBQXVuMvU3VZ9zTXOqtPD8wnUqxsEgWjKu0Zm/zX8qD68igoanAysNQW9WsJ0jyy/9UdKQNTlXR89J1x+JdbMRWdexcXpfHv30vrK0dW4C777K/sJp6cZfu9iELzDg+b5X4NAAb3xBMiLtj7zmiFO1L/dTXlXcZ7yqSXC/CQ8hKcfloTKvGbKKc7Ky4FAyZ+Zy0EKZXu6iB3BKcCsGSUTtvNXl1urlxuXm5c7S7pKKBOZfxgv+RUqslPzqpt2UgpQ/Gqkp36efUzUJq36qTA+VzXsT6+7CIncVje/5zIrbJkv7q6vdpFKostfBEzQbeeSl4aZd8OfAEEBj3ikGgWDqY/DHln7UK+1czbXqvxEBCbI8V+xi4QuyKEfccJy89q430tCoeZ3j7PhkIOhWXHgqB4njLpyqbsljijfpKGWFSBpeFTi+F4ojV96JVH0nPU/OIxVrO7Bn82s4s2vsnovkwtNg3AAqff1b55zTK89kKk+J4A/snVq4AK+CzwFydq2i1LXW7pW02aA8YrRpNRv9YfQ/NYOnllwwQ5JpETq78m6ownlZSyvWgn5s41bLcUV5b4eXofKqMHdaJDPxpoM40Az+EBICKjlNypLv60xKK+6fZzy20b+UyVQFRZVTElR+Hmk1G6mDpGd1TDKbXerpjmoRLK29ZOp5Cnx0eP627t3MC2XHknBPpU771JbhnM9UFEdh3k7EyGqauYbyeJGwc0d4dRonCBS0JPcEEhAOPI8i4d028I0t4gs8JE/0lpiE30VjjsI8Z8heKiA1JfEyPuaEFqDa0GaVZFJVAAPd/hBUvbVkp0o7SPeKtLrCQKyk7ZFYYMS+BBNobzUYk9JIDcg78p6BTU2rWKkGLUIDo8HWDmzCcGdpyQWprE8Q9JxRGHsrPjdnjRBcnG+pdkj9h+kBlRaoIxmWML1AUhRkCMrQ7ibxZBYZDnN4XmfkNeJHaVk8RBJnVM7akbjIn+S8sZo1TfxclTQOhPHeQHEg+eIdSfUDxmcJpKtbb1hTRgVVdz0o5JB4WXfCnTQbxKGFlqGjuxjzTRy//g60OJ9aaBg2mV5JQIVFgkyMBdS8xQY8OhSQAxbRtrSQlZVAkNS6vhb8RCsJ4wTeL7F82S57rKAgc9q6wNODZfYdo1h05LtggTmywECWGhJrmDQoV+dPJwwfiHixEWikLiasp2IPaEjmr+KXIBkB4zH4geOXUHX07JqF7zlOnCuCmMqIS4sXOZPR9Di/6Q7CliLPka4ZHSixFzHKjbwxq085v+TBZh096z19NjfCDgme90zT92A6zCrPOOO1UdwRVadJ1XAfI/XUas16XRGKlwZCpZGp9pWfe7bcGyEwuxOlBScF1JZBcQI07qSJkcQDzToYKuUy/AsrbfLhFVoLI6d1UDkgvUK2uyNTWab62dfz/IEFuqlTmhwClrJe2lhhGKiyq2rFXSa0sbJaxSkiGtyQxR+oGN605jwgoHwDNGidwnb+Dc4HIbOhEExxImvNekR6AN54lpcrqdmDTJaXpHPP00L9OpHM8NaI4/d6qXN9wM1/BJsjGJ5Kqv0zu84ACfViQvU1mVhjYqfq6myTnOnl7+aNkDJAi6Kkm6uj6L8bDuMINPrgMSRGAr2tsbCbtojZf7aYi70JDVyKOkf+kgqwaOlCUGWB9GVfZqkGUovU325iV9Sqg23KIDj26ai3YWA16SHa2njXU8AtyWx/B9A29wD4yS7loyIQ4DOB9abZkMxGD7vuBkZ2T6amq7tpQpguMWsHnNiH4aC1ViNY9gSKn/4fd+5F4hxP3QsEpvUKzLEP7DMLDX9gmBHM6r7snNifyFvuf3CsqKGsY6vcRxp1Oz+90Oze8k/aBJtEYnRlomcBMlJOJvm88wJV4NEDnZNMIGzIFg9eoldm0h/tE7/CuLScUXqanB4CxXx08SEsQWJP1ZEDvevoB6l7aElox/Mm4lF2QKfFewT6YKuZgRSG38QEbUrM8D0lGVqyILOzJCPGkD4Oi7Ymb83SYdX9Pm5ILMnIgmY1ZvG32h/zakzg7zQ1j+HRF1b6IsCjGPW6kwzdtvEx1KlbmyICIGjXUNrtz5R4oF4/A8H9FxKmnzq6JWWteyANK3WuIo/Cuu6Z1OwSuqV0dFJp+vFuQOPCIGz0z5dxMoY1C2zN6n9MmQgG2c1QNnt4/EuDwDBhRkAOgk0WwnyENsIqhIfE2T+/aHWAvmHtDgZEri9QXKzttcgmZ3XIOZ5X5/W1q+JoDTqyFqm9dtiZjw8QpT/Z4ez6KKpOESwwSDsgZQVDS6+lsQ6qp5Dz1iIJzdp2R8IuH10kUCH6+MW0o+VrmPn6K+OaFi3rYS2oZbkXHv1Bs1Mn4v8duvfd4/TGNnP03vL/ToA7E/8eCTemC/Ebxv9d0/FMuoew5MCVUbNnXRoVr+0lpM9s6v2/9ABQmzXH/60XH+jxX1D09basrb3fip7unPpp4uJgYOvJ/2J444ot+RNoBjUYZEDX1AGkoOa16GfVUb3rW8113TyxRFtLEIt1yOvYrv3DSmUZzAbadmyb+1aHtuiv/4jgNnlA/j2IdeoEAiB4tL/w0JmJOb3+aSoTAPDiO+gB4IvlhRrkvQoSvgCtMebVuAnUfYoQVQTtDC5jid2YhlP0V5xRc7GBH8GkvOYWkvvhyqDRCxKMXLTFSeBvc5YjNF81Fy8TIGkN3V9xPk8oRU2ekY3f8wJt8HyvpMsrNMNp1lywJZ+NLhidz4WL/hfnwUa3jYRc2UaioJHioLhX8ajmga1avDhQgYWYj8lYgJuvZELn51oK2HS77tLu4iuMaxlf51xt+1hlLYUvPLAEw33VHkaQjY17de2OG90oZqXSyoyJVWt/VUqvRTrv6JhWS12Co7iq2H67gBASORf6fjemnbNqNbpnIblq48mrOC3naMqrU5IqfesBDTU62XE7ypbBdTcJbg3ducHKJU8zgfOcdO14dIreQ82qOpXjXJhc1gZhuNtuqWq59h0zXD9tlb20Ak0Yr44bDAuuDw1XXjD+X+/L/xzF0+PDx+9/i4cnzv2LuzdCbrdxcDfYuwpzrUJf6O/onUL3ROc4oX0IrQPNw0IaxzKpr6jNqM7CzYLrCVcjLsc/XIxVznuc9e84HXAy8DjucNTisMFBLezX2KsnsFthp8R2oSZbhYVs2hM2LNbtH9YcVt07Vgwq2kTK+g8ljaLeoaBNJK+QE8gKmoxEWtKkQDLnkcgRzxCTIhLi2R/DITcJeiYR8NL4vav4vEri9fBwOeM47DQ2axGTMY5ONAKtRk80LonoyIhniWqUEB0pERRUhFD+5cUjli1EvgTZIqSL45C4RNLD0L0oPYxzXvCf44mii59OgQNVfjKvfW4yP8gNsjq5SdVJJt1ABg3kRMk5cqP8TYqcCdlJp5OdNDrpJLVHMjuwAx1s1NRWx/VCLfrqiXqjFgjagtpiIX4jrE5mUnTipBlw0IAnMufwRv6NhfB9RY/S/rAqNuJRI9oYEVqJsSHtCJtuRvTzmlqonw+N5Jix1fcR7Q227tmDev1HhPsrq+8XSKPAzvGAckEoRWrpMsQQi8Vi9I3liJ1pM0gD66WVHpYiQjNtFTOc3bJbEetczc3MHroHthQAAAA=) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAYQAA8AAAAABuwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAABQAAAAUAA8ACEdQT1MAAAFsAAAAHgAAAB5EdEx1R1NVQgAAAYwAAAA0AAAANJMNggJPUy8yAAABwAAAAGAAAABglx7QxlNUQVQAAAIgAAAAWgAAAFpe9kARY21hcAAAAnwAAABUAAAAVADNH/FnYXNwAAAC0AAAAAwAAAAMAAgAGWdseWYAAALcAAABLgAAAS7SK1I/aGVhZAAABAwAAAA2AAAANgkvYTFoaGVhAAAERAAAACQAAAAkCqkFkmhtdHgAAARoAAAAIAAAACAXOQALbG9jYQAABIgAAAASAAAAEgF8AVFtYXhwAAAEnAAAACAAAAAgACgBIW5hbWUAAAS8AAABMwAAAmo2I2JRcG9zdAAABfAAAAAgAAAAIP9tAGQAAQAAAAwAAAAAAAAAAQAHAAEAAQABAAAACgAcABwAAURGTFQACAAEAAAAAP//AAAAAAAAAAEAAAAKADIAMgAEREZMVAAeY3lybAAaZ3JlawAabGF0bgAaAAAAAAAEAAAAAP//AAAAAAAEBHQBLAAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HAEAAAB9NBgD+AABmB5oCACAAAZ8AAAAABDoFsAAAACAAAwABAAEACAADAAAAFAADAAAALAACd2R0aAEBAAB3Z2h0AQAAAWl0YWwBAgACAAYAEgAeAAEAAAACAScAZAAAAAEAAQAAAQUBLAAAAAMAAgACASgAAAAAAAEAAAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAAAAA0AIACgH03//wAAAAAADQAgAKAfTf//AAH/9f/j/2bgugABAAAAAAAAAAAAAAAAAAEAAgAIAAj//wAPAAUAZAAAAygFsAADAAYACQAMAA8AAAERIREFAQElCQMhCQIDKP08Ao7+7wER/agBDf7zASr+/gID/f0BAgEBBbD6UAWwVP18/XwMAngCeP1E/aIFRP2iAl4AAAIAfv/sBO0FxAAVACsAAAEVFA4CIyIuAjU1ND4CMzIeAgM1NC4CIyIOAhUVFB4CMzI+AgTtUJTRgX/Rl1JRltF/gdGWUHs7c6ZpaKRzPT50pGhqpHI7AyabmfiwXl6w+JmbmfewXl6w9/7MnYHOkk5Oks6BnYLQkk5OktAAAAIAYAR6AmMF0QAFAA8AAAE1EzMVAyU1MxUUFhcHJiYBXoZ/v/68cS4wMUtTBIYNAT4V/srsX1lEYicxJIX///7J/+wFMwXQACYABEYAAAcABf5pAAAAAAABAAAAAwJODx2vcF8PPPUAGwgAAAAAAMTwES4AAAAA4dQCb/of/dUJGwhzAAAACQACAAAAAAAAAAEAAAds/gwAAAk4+h/+RQkbAAEAAAAAAAAAAAAAAAAAAAAIA4wAZAAAAAAB8wAAAfMAAAVrAH4CtwBgAfMAAAWx/skAAAAtAC0ALQAtAGwAiwCLAJcAAAABAAAACACpABUAdgAHAAEAAAAAAAAAAAAAAAAAAwABeJx1kM1Kw0AUhb/0R7BIl+IyK62gUasI6qq6KIKoFNF1jTGNaCNJCvoWPokLFz6RT+ATeGYylgSRyyTfnDn33pkLdHmniddaBD68jmOPFb4dN+T5ctwk4NNxq+Jps8qb4wXpL4677HNcsgdL2pXs0WHDcUO677gtfdnxmnR3H68nghEpT4yZci7KLD9yRkLMhIJTLaMkhNzoe6f9RBTNHWYVPJNzyJYiFUeqdy+a6qTMNUqub2C7xLbvrVahtVnpdy1PJmdis312lbGtOOBIu76oz15NHXKhGIr+qzlSzZiZbjJW7arLr7hO7M1f5fhVyn47Cp8rKZH+9exLuVMedBJa/0BdzERS+waf3p/pxKpuHDNVCZRlpm/UVBHrhtF8brn0rPai0L4gt9MJWf8BdQxZtAAAAwAAAAAAAP9qAGQAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-greek-300-normal-Cnub06j7.woff2) format("woff2"),url(./roboto-greek-300-normal-CTj2MfNN.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-math-300-normal-BMxwzQmU.woff2) format("woff2"),url(./roboto-math-300-normal-BU9CUCyj.woff) format("woff");unicode-range:U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE00-1EEFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-symbols-300-normal-BtHl5mYl.woff2) format("woff2"),url(./roboto-symbols-300-normal-kyoSXp-d.woff) format("woff");unicode-range:U+0001-000C,U+000E-001F,U+007F-009F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+2800-28FF,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B00-2BFF,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F000-1F0FF,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F700-1F7FF,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB00-1FBFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-vietnamese-300-normal-CNeuLW5X.woff2) format("woff2"),url(./roboto-vietnamese-300-normal-DXBG9gdz.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-latin-ext-300-normal-BOz0oSmX.woff2) format("woff2"),url(./roboto-latin-ext-300-normal-Tcf9y2tg.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:url(./roboto-latin-300-normal-CztWkFGs.woff2) format("woff2"),url(./roboto-latin-300-normal-KByCBsad.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-cyrillic-ext-400-normal-DzMWdK87.woff2) format("woff2"),url(./roboto-cyrillic-ext-400-normal-DtZHuW6i.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-cyrillic-400-normal-DAIM1_dR.woff2) format("woff2"),url(./roboto-cyrillic-400-normal-DZJji7Rx.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA5cABIAAAAAGtgAAA38AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbHhw0BmA/U1RBVF4AXgiBfgmfBhEMCoJ0gnQLFAABNgIkAyQEIAWEeAcgDIVOG4kZIxHmlLUCwF8V2MbMoa4AxWgkRCthOLSyMZeTQC5uuOJg8u6E3LDs4xbJUqAc5hwClMNy/OePZYQksz9fV/beV6lD19AduEZiD8BOMgHVE619Io7rU3LbKR6I/eb7XiLXiZBIeONoXDeJWimViYW8pUXLJnW3vOum0Jq2rJBTxgHxjUABglAv/FCYGVNlZkz8z7H9YZ5Md+9lxCLcImIaGnXUht+bapJuld5NR8rgTTqoPbsVUTVFbb0AnQKIkp093FLP6ze5XT5S6dxqfBzN+b2dJM29HAELQ0qeMZ3ZbpvZTQo53PYR9R3muDnMU+QOPrARxCzkl19oC6hLwh3l21mn+wJJmOo2nHRQZhKIQpC1L6cDArD4Mkg2C+sAqvWrjvWohAxGMZYzTBMAJA52zcLTbez1tDbA2lFrZX02Z17a3iR4U3Kvz6I6PIQDvktCADCXT9A7qAoBADrABjHUV2d0Ozk6vOamloB5qrIzIejwSPFzlbgDgI7C+pO0Xp57L77IuqK9BhGga1TTjgD4X2E+BBIg3K0kUAQJPFuFmIVTBB7aRy7xaDUPqOACUrCgMT+ViTMLybwW25kL6C7lEludwgFeYb7gp7n522s+z8ckSQFWJA7LoRfvWATMvzvmvfmc4xV1418A8Ia3nT+nvuqk9njVJ73uLvpcZ3zpsdPBb3AivLPbgQajHrhkv+NecdsqR7n1++xz2S8t5z3TxNcecAUxfusd6qNmnbHXfuRLh51232NvBp/g//pNtFNdwgby/sXqGTiMmLDPsZqfqp5plRTlug0YY/hQz6/zige+8kvgDn1mHHXedU/iAxaX406fOnlianJifGx0ZHhocKC/r7enu6uzo72ttaXZ1tTYUF9XW1NdVdmEzKpp8F9/9eUXN6Wzz66fTsbDweefffpJv9fttFsfvpNtrOdp1AJXfDXfaORJVIOlv3mdkkIYSIRPg2RDMIZW90e2aCqtnWINAwwF7A0zKSf6roOTzghCzXP1x9wflpYKKQmIDptgJE9pny5Lh0BMbRBlHldfIDqVrJhUKMayPCMTYCL2WQQnuC5DRSy8Mjc/5yLZOEaZYc12rm+IsmyVJv7qOcbyTCm1QQzVi5NpPFo94xpDQ2mh+1vX6egCBwBOG9fQ5G/LH8hDr4ggwNOBFSfghRVu6sjys1+VOLEm52rznez2DbFu5JHIZXRJ71Ojkd6nl7ZenEC/z7C/ELVw5S9ddOWzDOiOYTsoEcIuLk3i0/7I9rU7VRtyZ9h2affpqmoUvOODBw8lQ4KYMdsdWYtkWLErYbGMnLGupyXbi095AIdKcMt9RRF659XON5bP187Xz7cWthdURDT/cj3tXyiJopJfLWo7pWDYGbXXaOf0dVWjwOXTsvQAm3+PI3K1Mt8ducYPedqKCzNL+6tFtpXKoUpdfj1MIy8iGRke2tl4CAQEYKd3ilFAmbwTxtjyd3ilXfjcrtnICTAhy3PFLi5/SZoLJBuOpSvveyMDjYbXIc4OdwIU3YpbnsuAIXAXbqiuyaPMm7KDspZIqnoVJL4SxCNxvhfR9V56mpxGdKxsQdXzS2j6kjrjLDmzBUjNwLivf+GCC3rtuZTzlAjGwN6pWxegVzA4gOlLFZlcau1eSxs5FRFGptnI+8NofG4GNxYFXEJib9LA0vuhCuczmlqxFvJ9XZpNJ+UXXnech8qrvMIJlczEK0ZyoBmMIRgIMOcyKku5zzIprVgePOOxjca5lFIVFFVOSW7l5/ZmI08DJEOW1ySZ1MJMN6huk9NrPZl6niLvGLq/jXgX+FaZihH3TIq8g3WJ42KmIuiHmaBmZDXNHOf9y4CJnbu0I3YRKAy0yuIjjIt44b4Dcdylpm9UCy71YHgiUkRSfoVGnUKDM2zPFjA8JdEzPuSMUGC1oc28SAxXAQQQ4w9Bq3c+2anSDoxelFGH10FGa7dHk1H7LEzAhdUgaFIjhgfkHXnPwLSsVW7xKt2GAUaLrRq0CdOppSUTJL0/gu3M6YC0sOJDc9YI4bXzLfUOmX8nPcDcAjJiZ3GkWzC0GhIETgh2s7gTzYbDHLq36etG8igNxEOksV8VrB2Ji/xJzuusiUwz31UlLoFQ6A049mSp6AeS8wDHLAFjde0Na8qoRd1dCQqZJ3rW7XZHjZzZUyB0CHAF0Whi4ep72FzYZzMC42SeTYCZRQqbliLwWIsBSewLyAGn4Ky0YJ0VgbKUu74XjEgrDV0Esoghe6mueKiwwDJCuS9b5+vsaNKwFsCxgAJye5MBa5UsSmpSXq8o708xckDDlkbgIHMhUW0eekSVYf7K/QhSI2DcCSMwfBZVm29PLAzPMHKuClo2RlJCvZYzNZoeo8vuIGoB2JruNiNF0mrUUr2Rl80axp1f8GCtNt/2njjLG1FbKF7MTDn3oBJqgplkuLKKG6Jq16ga7mM03FitWa8qwiKnB0K6kfL2BS88G/RWCKwuo7TFSQs8JSCeAHQnzbQnOnCWQbwpTfAvRFIf71/Bf3IkahUYX5CeJ9veknKWcj/7eY4PLKCjjmlyCCiW8uxEp2HAwi6rJXfxBRp0datmjpjyCVl8g6LkTSWHJgHuSCBAUI7C6GuSt4B9zSDIWgNKCWJFugmuPYPFTqr1wLLBgnbuRYo0ryOxL2/VWLgzS42Fe1z8EVQcQIpUU+GfgX4DmJjXMlZco4ltTKh1XQWbJGd6/ffwRsiSQGjFSTdTm+bvLiWkI3DQB7dkkRroraTIbqoWZH+rVsjNJhxgIZBe+QsmQKE4CEOJFdKPfcBaJaYc0V9rYpfUsoNKykBx6FOfnyxhZdkhmuh93+ZAWsW++RtA6fADiJHsUt4hbAX5eGDANHKxr4WpI65R9PZJ9nRpO08EOSUGVAPN7MNw0CplEJzxBBw//b/uXIPBOTa/Biil9TXIax+oB2xG3iVUuTWDx6kT+xN5y/wPkltY5dSQ1b9PWBTjfL/N7N7yT9oIoyox25LoeQAzKUclvmz0QB24xUJnxB4IFYq5gxf/tRn1R/vEzzMuLWeUHifHh0AhH12cYAkMlkgeOOClNv/Irlm0RWjD2ER0yvboRtEfAa+YMNNlmvFHmSDIiRW+9omdl1qQ2FqQ+DEYj8P8jckbs3BYdcOnDIsiHUmgruHD32p/xGo48XeaijF0+sJKnwHwh+GbTux0KpdjqH3XNkcMgFCpKu32ZwoykBvOSAj9BnGk19q862Vtu+kHX1EqyiO7dv+eAkbeZzmwV2n+rg5AVwZhaT8uBZLHmgUMzsZb1kngYGHNwdwftvTsgAiZ/E+LfI1TeEt5Ki+Dd4y3kGexKJiwHUGAacZPs3KlUPtgYaD1pLwock9d6evO/V707fbB8OtXX6n2529+QBz5+PZbbd/T199n3P6zZRn/8ZgDMPyUNf/FGvswX4OcLmqv8u4MzfmBxx1b7FvWAU8xhlcPE3T0MnHP6wVutvYdoxX4ovT0KWei4FoqPX3+TfHEiPWfe5pJr4FzMsjZC29k4q/4zLM08ub/6qj1o8qpI5GFeYciq6a2fjS6Orb145rpQ5F5RYcjK6ZDPl62xnV8SVvoeyt+2d3zf+bN5BivzXMx24Xv0uzSBeCONwEzEH8+0jCY35h/8xT+jaF4iPVLaKtQWsEnH7wkJDDoGecLJEIkCCgELP4iOCAw6CVK/JcALO2AT9EKCICGSbMvPr26tmjXc59HBgCA97/3cgAAvz8SmwX9bQ9pcgE8T5rPW2TAbxUe5BA2/bWREu1XYR/+wATf6oqcoLkspDXqfWe+hF0YYrEAZwD5WtSBUNh6oQcojJWWR8Hq50pkCSxMdO78SirY5yuZ9RwrOXd2FpzbtGKhLbadgQAWvnElgsqZibkrQ2GPguXhquxZPTNAGptGpZokVbq1fLhBrPZnvVa57MUVGNdUXFlztal2iGvtZm12CGCbxys1qWLLwnZ5wnLb0P76dbVFLotWO/shXIlzh55LFZzl3Nqha7UYXUgnB55mu52IH7wwDrdq2YWeljLRks+7Hm2n3TQmza3DW8U9jGy1rAcHnUaXgULlYDXiFDc2dawul6mF6vCWtrXtjnWenqtWq+VC7UAZf+X9QRT8MjbVq1TpU27jhre2RpXXHIdu83aXF+prT2YdVHja/RgcrNyL/j3sa45eb+vP0NPcgasWdrW04qKqRUcT25s2cdo4jpNGttSxuaFma2BT/Sr262uvof5/b319Fjv1TmxXWFNidalWVWZlkRUFlhd+cStsYiPHktwTznkW5SUcsyzIMD/NvFQtN8WclA7ZSWYlmBmPYCaexXR0FVNRpkZ/MYkxOfaEUYSJ4TRGwr/ohxkXnsVgOI2BEKMDjAqcoDfIiOAJusEwv4Sen4aPe73c3Sx1/O9qrqCpqsf2uhM01I2jvi6EuqqEeqkDxcIJ8rkhpFMdiLtUcI8mEC17XMsRtxlhtXvNcshFp0ArAg1O+zKcWfgd3GDnersW68ou75KzYvcuuc+243fH5mqzfyxaimZhKhqFecG4oLNaBLcyYclluZtUa4wsYkPsP0YXFS3M1KyqkKxCYBBk6nPVXJE7JDBAjAuboHvFmhgSFFxehgFgk/2HKlZZUCsRci7J3aRYI2QRGSL/EUoNg+PL6SFkpIf/JHM27FBS8h04Dbd57pMak3kOMQ0Qi/k5c4iz7v3AAfBVhx2H0ucfUXi+o4U5QsJTc+YYnXWn7eDDJ5/+wFjtAJ8zJUmUuKHyjR5KfpkKPvCQLwrpIo5UlOT8TQZbNvimnA==) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAYcAA8AAAAABwQAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAABQAAAAUAA8ACEdQT1MAAAFsAAAAHgAAAB5EdEx1R1NVQgAAAYwAAAA0AAAANJMNggJPUy8yAAABwAAAAGAAAABgl4LQ2VNUQVQAAAIgAAAAXgAAAF5e+0M1Y21hcAAAAoAAAABUAAAAVADNH/FnYXNwAAAC1AAAAAwAAAAMAAgAGWdseWYAAALgAAABNgAAATZng0GjaGVhZAAABBgAAAA2AAAANglAYTFoaGVhAAAEUAAAACQAAAAkCroFqWhtdHgAAAR0AAAAIAAAACAX6f/DbG9jYQAABJQAAAASAAAAEgGEAVltYXhwAAAEqAAAACAAAAAgACgBIW5hbWUAAATIAAABMwAAAng3dGTWcG9zdAAABfwAAAAgAAAAIP9tAGQAAQAAAAwAAAAAAAAAAQAHAAEAAQABAAAACgAcABwAAURGTFQACAAEAAAAAP//AAAAAAAAAAEAAAAKADIAMgAEREZMVAAeY3lybAAaZ3JlawAabGF0bgAaAAAAAAAEAAAAAP//AAAAAAAEBIcBkAAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HAEAAAB9NBgD+AABmB5oCACAAAZ8AAAAABDoFsAAAACAAAwABAAEACAADAAAAFAADAAAALAACd2R0aAEBAAB3Z2h0AQAAAWl0YWwBAgACAAYAEgAiAAEAAAACAScAZAAAAAMAAQACAQYBkAAAArwAAAADAAIAAgEoAAAAAAABAAAAAAAAAAIAAAADAAAAFAADAAEAAAAUAAQAQAAAAAwACAACAAQAAAANACAAoB9N//8AAAAAAA0AIACgH03//wAB//X/4/9m4LoAAQAAAAAAAAAAAAAAAAABAAIACAAI//8ADwAFAGQAAAMoBbAAAwAGAAkADAAPAAABESERBQEBJQkDIQkCAyj9PAKO/u8BEf2oAQ3+8wEq/v4CA/39AQIBAQWw+lAFsFT9fP18DAJ4Anj9RP2iBUT9ogJeAAACAHf/7AUKBcQAFQArAAABFRQCBgYjIiYmAjU1NBI2NjMyFhYSAzU0LgIjIg4CFRUUHgIzMj4CBQpSmteFgdedVlWc14GF15tTvzVmk11akWc4OGmRWl6SZTQDBlyk/vy2YGC2AQSkXKQBA7dgYLf+/f8AXoLIiEZGiMiCXoPJiUZGickAAAIAcARxAskF1wAFAA8AAAE1EzMVAyU1MxUUFhcHJiYBknTD3/6GpyoqSVZcBIQRAUIV/sL+VU9IaC06LY////54/+wFUAXWACYABEYAAAcABf4I//8AAAABAAAAAwJO30PFVF8PPPUAGwgAAAAAAMTwES4AAAAA4dQCb/oa/dUJMQhzAAAACQACAAAAAAAAAAEAAAds/gwAAAlK+hr+SgkxAAEAAAAAAAAAAAAAAAAAAAAIA4wAZAAAAAAB/AAAAfwAAAWBAHcDIQBwAfwAAAXH/ngAAAAtAC0ALQAtAHAAjwCPAJsAAAABAAAACACpABUAdgAHAAEAAAAAAAAAAAAAAAAAAwABeJx9kU0vA1EUht/bVhNN06VYWEwsqISiRJSVWDQ2iAjrGmNU6MjMdOEv+DEifoffJJ45vfRDIif3znPee857P0ZSQ28qy1XmJX24Rc9OdVf3XKLmy3NZbX16rmhJ757ntKJXz1X0geeG9rQ/YifVte7ZqaZlzyX0Bc/V8V5uFb3muQlJF0r0pB7up1Bq/KgT5fbtK9Q18y35PRTBMZTbyPWsTAfaJBI4wuUOGrAy6i2UjLll3rHtdsPIGRtkEdqQ2h6rV2Qp1X1zCLRD1xbR0SFZG2prd8ohmHGY7OjqjOhC/+05m40rj+1GL6g/Nx6dYZsIdIkS2f6TpzmnOtEDK6HVH+FcvFRi9wrU/PNqMe5FxRCXFl3FvyjUhIg5VfT7nhl6OnWT0E6d2YuFWvsGFBtciwAAAwAAAAAAAP9qAGQAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-greek-400-normal-jFM2czAU.woff2) format("woff2"),url(./roboto-greek-400-normal-CcizSnRP.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-math-400-normal-B3wgz80t.woff2) format("woff2"),url(./roboto-math-400-normal-rzxYvyVt.woff) format("woff");unicode-range:U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE00-1EEFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-symbols-400-normal-fF1SLJBj.woff2) format("woff2"),url(./roboto-symbols-400-normal-Tzuungub.woff) format("woff");unicode-range:U+0001-000C,U+000E-001F,U+007F-009F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+2800-28FF,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B00-2BFF,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F000-1F0FF,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F700-1F7FF,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB00-1FBFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-vietnamese-400-normal-CDDxGrUb.woff2) format("woff2"),url(./roboto-vietnamese-400-normal-DmXaN3yE.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-latin-ext-400-normal-ZYmyxeOy.woff2) format("woff2"),url(./roboto-latin-ext-400-normal-eTRLN0Nt.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-latin-400-normal-CNwBRw8h.woff2) format("woff2"),url(./roboto-latin-400-normal-068yxgMN.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-cyrillic-ext-500-normal-B7rQpwPu.woff2) format("woff2"),url(./roboto-cyrillic-ext-500-normal-C927yMrb.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-cyrillic-500-normal-hCeO1jFL.woff2) format("woff2"),url(./roboto-cyrillic-500-normal-BI4HuXre.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(data:font/woff2;base64,d09GMgABAAAAAA5sABIAAAAAGvQAAA4KAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbHhw0BmA/U1RBVFoAXgiBfgmfBhEMCoJ0gnQLFAABNgIkAyQEIAWFFgcgDIVOG6MZsxEVbByAILK7AP7LBG4MBfug7sEH00ksWBAwvcIrw8A1d9ddP5LhKpEo+yhMJYZllANlIsgjEon/D9SMkGTWf54u/XPfvHmDjStNwW3iwlNG2m0zgTZkwbhtVFD7LY697ufrH6EibO70AN2S6gGBMMtsZ90IiFM/2wKa86Tdur1Xm7SmapG2YEHAbSUhujvuJeL3ppqkW6V305EyeJMOac9uRaRailocgJsCiJKcPdxSz+s3uV0+UuncqtXvp4GCQnjtFRCChDMR/qsKw0pH6o2Pn9bstW92k3/7EUoQVRaOlKwxeW8yl30zu4E5nOSI9n5p73iLiUruuxLbemJ2tZUV2lZWTXSd4wxCgcZDMj8espV10cIYISxOP1aCAPhg5QiqCEoAHSNnQstWJLgQzVlW2TYBFo5Qw8cXG71b11CF4aeG4krv2L2gqUbytsi9O5cq6VfIgHxYjgRoDJ6RXkJJCAD6YBPoxGoqepocPb7jmInA/0BJdpjBQCcUv9Jc2QvAIIG2n6TNQOyTTMfWFDWVEQFrTmVNBNC/wnwBYmAYZzABCQyMpnilaZwhhX6lId6cjKILsLJ2Q/h+jjjnB1WN4FrtC8PJItHjFhqom9m/41M7+eE98e6dskwAgxIvBsIgnns62N9O/u/t3zAeFPM3mtznQcfO/Xc7YCZTki73upJ9pcNecYtDwYfYP360S4EDba47qdc+d7lkiD3YeTfoccr7o8fcronPLjiNOfeAu2tdv8Pyzjd7xS6HXHOL+4On6D/9LtrBKmkD8fBE9BK8WnXqsTfm21gvNUQKj7U2aUd4Z80/87TrXvV+MAkbbLfHMefcGvdBLBNpPg8e2L+1q7Ojva21Zcvmfq/babeajXqtWimXioV8LptJp5KJeCwaCYeCAb/P63G7nA67zWo2GQ16nVajVim9HcX7b2Vbm400OoI3fDPfajaSqIfCcLsvSyEMlIyvg2RDMIdW90c2bymtnWINExw5nAsz8WSGroKTSguh5pX6Y+4PS0u55I+Y7ZpQFE/1MF+lhsFM7LDCrFteILpl2SqGZVvsSzIBY+meRbgmYtOmipR4a9n8bCHZOEahYc12zt8UVdkZO/E31zafl0qpDWaoDkim9urqc65p3FRaGH7hOhXTcCYCrBjXaPG36c/kYVREEODpwMpY0JkVbf/I8stflIxlTc7V9kNs/olYNxuRyXUcn96nRjO9Ty9tHZDAuHfZX5hauvHXLk7AiwgYvuk5tBDBK52VxKf9keefcKo26X6L5zbuM13VJHTfDw8BIceiuDFvEqKC5XilLyF4Ts3Z/BShegHLHuBQgltpZSNK5+0ut1YvNy43L3eWdpdUJDL/0l/0L5JEo+RXH7WbQtDijyZqsjfxE1WTQNVTWHoIq947mNxSWeiOkvMdn3lxfXdpf/WRXVIYsvT16kmajTyyoeGqXbTDYACAprxTTAKJSadgji3/pFfamZpr1X8rAsZkea7YxYEvSF2OZMOxYO1db6SiUfUa5ux4ZyChW3HhuRw4DHfTw9UtdVfoTThJWSGUhlEFiR+ERGSudyK530nPk/NIztoOdD2/hkNf5x66SC48AcoIKBHrvzjnnF55Jh6eEsEc2Du1cAFGBZMDuL5Wkcu11u6VtNmgPGJoWs1GfxjNT83gqc0CnUnS3aLFlXdDFc6rWlqxluyHj2+1nFSYa+K9DJVnBbmTKpmBt1zOgWYwh+AgYMahLUu5bzIprfjcecZjG81LKaAqKKqcEquK80Sr2UgNJB2rfZJa9FJLd6gWzsraSKaep8R7h+FvW96NvGC2TJZ7JiXuUyJxnM9YBMMwMpIZWU0zx/noMjC2c7dcmqYJEgyMScAJJU/Ycd+LeO+Wnm90Ac/y4HgiF0tSfjONCoUqZ9heLqBlSmJkfMyIVCDa0GY5yLRUAQwQ9Q+ToreR7FRpB06tSK3DPsRp7Z6oMWpfhgk0txoMLm1Gy4C8I+8RmNS08oXcoEWoYNTZ6oFP6O4vLbkg6fUWm5YzCWVuycNz1hmiGxdbKh0y/1F6wMwCWelm8aYbcBQFGYJMCHZR3Jk6w2EOw9sMDSF5pEYSIdKYqJy1o1mGeFLwpmomU+SXqmR8IOR4AxkHEiTGkWQ84JAl4KxuvWFNGRVU3PWgMieLkXVn3EmzwRxokDokuBlRbWLO+jvU0thfawR2qFxLwNQihc0oE8ipegOWPCRQAJbRtLTghWUhsdS6vhZMq5WGaQKbTzF/6a54rKjAc0K7lad7t9l3KMNGAN8HNFAnagx4qWLRiku9emV6IMXIgRTXO4GNzMWU68mxJzQ45q/SlyA5AeMpmIHhy6jaftBkYXqG1rlNMKoxkpLqjZzJaXqcWA0H5ZaB5zBdN1qyjD4ZZbsRV251ycEvR7BZ2w9GT57VjXJHJTxvmartQTGURTPJeK0Xd0TVblI13MfY9NRqzXpdAYKtDIR0Ix7/oueRjXo9BEY3obTgpIC8ZJBIAN1JkYnEAI0amPakGf6FSary4RW0pZGpdVCiQ3qVbHdHPCweP/t6Tg8s0FWnMAUENKG9PLHaMDC3q2rFXUKRjdYUqyFGTL0LovgFFSWaWh17BGRfAQGCMBpPvCF5J3RvGATVOIDWRtkj3QFuPKPlQmr2wNFoSTv3LE3Urq10d2+NmLPXSp0PD7D0I+g4gmJpS2V8FjcaYGzeqFR5tRPrTOwoujq2Qc745u/qjSmhgDCKk26utu3fXUmoQGCjD27FojTQWysTu6ELyP7WxVhqTdjAh0Brz182ARpNbRiqrJC+7CPWqii1SPpOE7uiVh10UgYJxzEN+WQlV5O5pN2+dz0Z2Jh0b38H0HL8AWImu5T3io0Qnw1sMs2GdG9EcrfcyDG7J1XS1V2cMlSTWNQNHGYfhgNXa5Vg1RPI+On/fudWOILjybcCKWfsFah9H+iDtUY+TyjJl7Wf9k/sTxQt9z+YL6ghU0NW/z5pUdbzgVqze8s/cS3aVKJ3caJnAdykbPN92hmBKnDLjs5JdwB0SJYOXsJXhu2P9olfZVxazig9TU4PgWI+uvgIlsBhT9WRA51r+yvmLpos2jA1EYOyA3izGI9AF3SakeeG6VczQZATI/z0SzcveZDZWZL4MTiPw8KtwVujfFh1uw8aFk06siBd483f6nikahz5Ow2lGAZ9YakvAfwxeN1JN516/DFU/63FiAEIqg2l3f5MWQby3UyE8L8Qb3qp7SuMte2eH3xlqiKP4rziF1U7SztMgj6l+ae7gN4YTCv7acmWTNZM4MKttknSINoE58Pb8/JJiiVsYMNGGxHDaoeGIEigI3AJ9or9fn4xFkHcsHYfA0w8v8jgwULfAD9yrHPZ3/K6uL5hrR+uz37YDWj5vV7Vu1//vE3U+s73DUfPa++3XHf4uhSR8NXjGNDyLkr4hmzeQFkOZGzJ8an1XJyNYfu8M7tnjoDsoo0fxR01r0fSU85lTxzUNLeNQW5KfajUJ1Iebvn4He+tt3a9uz51R4Z8Ljmxip+88651bQU+xIk7V/K/f52uD7k7c3O7mZ7eavrDoXev1zND78luaQXX39tqCblnwNBbOwbWL3xq0EcLtvxZXnQtmViwPyE6aXJWb5AvJpFXgBSI/1UbLPxfZX8re+TXTW2yGBkoNQitAc4yIjAyLPx2WfZVGFMQ2gkNeC4idPz2d0gsJBAImsHZjQIBkFjSffv65+T5z//NP0IFADz6P+gB4KMXq7Vg3ighwy5AG5Sq/3cA+SlGADdRW1cX0KReFOmn/2BGbkdxNAJFaSltSO9Hm05gPg6GAKEOA/vcvzlD4yUDPE4CcW305mD0s0AYHvACgx9+H5cQJtPJ+QoyJjlZEBiuq+CHmVIKAXywjANbbvZ2Qn56gaBjHDPJD+5UZjE5r4spLw2kqVWtQI2kyDTMx6vEasKTch6rJhfluCzi4phLxTVJFC5a3FxFerjQQhPl40rXaTRX6Mm1cVKsRolCjdJLVG70TIjd7lIt3cH6eWXjBr4p1+EMkXUcdro55mXCiIm2OyrHRUt+3d9o8zSLNC6NHlmlQAPvZQ2z1IexdRp8V3Y5/HQGVxaK2+lwKRqUK1DjkWku1hxBU+vLvRumxKlZqpzLNStsxlMqiKDPtXO8SnEEuRHrbvBMe/zAZhpjOz2VhNWV2RUo8qI3i7B57f+9d3QfG3S+P6H9iGi9aL5v1NjG6XOjdiepXkYqF8o7Suew9kThCJA/4qDq+BDZ44wyxzKlV6RmJGcsKFlq8Un+F8ZGRMd/KhyThHuE+gHlDQgMHOV08LXwNvDUQ6uGq56gVQVHCXuxS7bijKw2gMXCbP8pxcHoBpRkoNcnpNP/FK+h0Q7U+oRUCkoBhaggl5DJClIgyTlanEOU4YPh7YUTfT3/5Zae7yapd1/h8d7Iw/023d9xFHkt4uqywsW5hpNjEQcrI8S9Q9q7WVvxmdVZ2hldTfvUCrY232jzcXnRx/IZbSxhfRFscZyyNyvMG94uMm989oL/HG/lffHLMwBteJA7MDzAHWQFWL5RPm45irt9LG6N4Xmc+fMt/Acu+ef6uR1RuluJEm4Khzu3dEtYWwSFimRRK6RFIk9sERKsBigUtX4gaVGqW4pibtVi1hiWx5g/28J+YJJkmjLdSTu9Lmf8nYptifdqKVle2uadmI59VTM10yu2eeFeZWXcRNRvdfb1YdQ43rszPeNmCddHsm5ibGlqxk1c6rcam+DkLJ0PtI1mOM+0qExF66SZHpoAZXOwhFNJtkvuhrN1Vjc1emi/0kMBAAA=) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAYYAA8AAAAABvgAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAABQAAAAUAA8ACEdQT1MAAAFsAAAAHgAAAB5EdEx1R1NVQgAAAYwAAAA0AAAANJMNggJPUy8yAAABwAAAAGAAAABgl+bQ5VNUQVQAAAIgAAAAWgAAAFpe+EDZY21hcAAAAnwAAABUAAAAVADNH/FnYXNwAAAC0AAAAAwAAAAMAAgAGWdseWYAAALcAAABNAAAATRvqViDaGVhZAAABBAAAAA2AAAANgl8YTFoaGVhAAAESAAAACQAAAAkCvYFwWhtdHgAAARsAAAAIAAAACAX6v+ZbG9jYQAABIwAAAASAAAAEgGCAVdtYXhwAAAEoAAAACAAAAAgACgBIW5hbWUAAATAAAABNgAAAnI2oGOwcG9zdAAABfgAAAAgAAAAIP9tAGQAAQAAAAwAAAAAAAAAAQAHAAEAAQABAAAACgAcABwAAURGTFQACAAEAAAAAP//AAAAAAAAAAEAAAAKADIAMgAEREZMVAAeY3lybAAaZ3JlawAabGF0bgAaAAAAAAAEAAAAAP//AAAAAAAEBJMB9AAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HAEAAAB9NBgD+AABmB5oCACAAAZ8AAAAABDoFsAAAACAAAwABAAEACAADAAAAFAADAAAALAACd2R0aAEBAAB3Z2h0AQAAAWl0YWwBAgACAAYAEgAeAAEAAAACAScAZAAAAAEAAQAAAQcB9AAAAAMAAgACASgAAAAAAAEAAAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAAAAA0AIACgH03//wAAAAAADQAgAKAfTf//AAH/9f/j/2bgugABAAAAAAAAAAAAAAAAAAEAAgAIAAj//wAPAAUAZAAAAygFsAADAAYACQAMAA8AAAERIREFAQElCQMhCQIDKP08Ao7+7wER/agBDf7zASr+/gID/f0BAgEBBbD6UAWwVP18/XwMAngCeP1E/aIFRP2iAl4AAAIAZf/sBR0FxAAVACsAAAEVFAIGBiMiJiYCNTU0EjY2MzIWFhIHNTQuAiMiDgIVFRQeAjMyPgIFHVaf3oeG3aJZWKHdhofeoFf7L1uEU1OCWzAwXYJTVIJaLwMAUKX++rhhYbgBBqVQpQEFuWFhuf779VJ6u39BQX+7elJ6vIFBQYG8AAIAZARwAsYF1wAFAA8AAAE1EzMVAyU1MxUUFhcHJiYBi3LJ4v6AqCYqTU9cBIQUAT8V/sL5WlRCYidIKI3///5s/+wFYwXWACYABEYAAAcABf4I//8AAQAAAAMCTs7vnsRfDzz1ABsIAAAAAADE8BEuAAAAAOHUAm/6Jv3VCWEIcwAAAAkAAgAAAAAAAAABAAAHbP4MAAAJbvom/j4JYQABAAAAAAAAAAAAAAAAAAAACAOMAGQAAAAAAf0AAAH9AAAFgwBlAxsAZAH9AAAFyf5sAAAALQAtAC0ALQBvAI4AjgCaAAAAAQAAAAgAqQAVAHYABwABAAAAAAAAAAAAAAAAAAMAAXicdZG7TsNAEEWPk0BEhFJQUFBZFBAKTAgI8ahQkCIKHooQ1OAYYxRiZDsFfAffQUHJJ/EFlFyvF8QKodGuz87emdkZA21eqeM15oA3b8GyxxKflmvSfFiu0+XdcuOXZoYVXizPyv9suc0ORxV7MM+uZY8WgeWa/MuWm+JFy6viluWOCIakPHDNhFNRZnjMCREjEqY6H1MYX0LIlfaRzneiSByLCrMKHsnZZ0OWiiNlvBVNdFPFlp5ce2DqxKbyjVahte5UvBRn0iYm3mdLMV3ZHgc69UQ9th3vgDPZQPR/1qE4Fo3VTebofEfXN+9/kua7v6rmpsznQp5IXzf+XOqUe92ERn+oTOVcUtOHT+fPjGJlLxVTZQkUVf6F0pvKYr0x+pleLn/mdBWaHnIzoZC1L/2vW5AAAAADAAAAAAAA/2oAZAAAAAAAAAAAAAAAAAAAAAAAAAAA) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-greek-500-normal-BJMS0heP.woff2) format("woff2"),url(./roboto-greek-500-normal-BLLWU9W-.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-math-500-normal-CFNaIMFC.woff2) format("woff2"),url(./roboto-math-500-normal-DaFX-ZC8.woff) format("woff");unicode-range:U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE00-1EEFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-symbols-500-normal-BXFTxrNR.woff2) format("woff2"),url(./roboto-symbols-500-normal-CAhAe-ik.woff) format("woff");unicode-range:U+0001-000C,U+000E-001F,U+007F-009F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+2800-28FF,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B00-2BFF,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F000-1F0FF,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F700-1F7FF,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB00-1FBFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-vietnamese-500-normal-HYpufUYk.woff2) format("woff2"),url(./roboto-vietnamese-500-normal-DW96CsrR.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-latin-ext-500-normal-C_ARlJGk.woff2) format("woff2"),url(./roboto-latin-ext-500-normal-FFcS8vBN.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(./roboto-latin-500-normal-CkrA1NAy.woff2) format("woff2"),url(./roboto-latin-500-normal-CC5nhZkh.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-cyrillic-ext-700-normal-UFn0vR9r.woff2) format("woff2"),url(./roboto-cyrillic-ext-700-normal-BuQgZIrO.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-cyrillic-700-normal-BiSG5NnW.woff2) format("woff2"),url(./roboto-cyrillic-700-normal-KqaQ5bNp.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(data:font/woff2;base64,d09GMgABAAAAAA5MABIAAAAAGrwAAA3pAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbHhw0BmA/U1RBVFoAXgiBfgmfBhEMCoJ0gnQLFAABNgIkAyQEIAWEYAcgDIVOG20ZsxEVbBwIgI7nA/wfErghQ6yhf1lCWsMKP1jQwRxxrwhfIu6zeUlWmJNCpZ8KmhJDMxW/Oo5Y9OUvU/DbHYEZIcms//07tXMfSYYgWgF0wi6wFkPoThQsg1MGFxjWi4x/W/HAc7l/Ywkd4IziXuQLF0hC2zwbCygOpA6++jn3kpRApRbfGt2Z82UHrMT3e1NN0q3Sm3SkDN6kQ9qzWxFVt6itF6BTAFGSs7cc+3n9JrfLRyqdW1XYXCqH4XLREl+7+kdzCqQ2Pf6MsAiQcNtPSiB8jKzSk/riIz+A1I90Zu1IsnMKQsVQlFSVaRrNrNfW7Eo+3QbXDpHvQndsBXUVdUmeoCmIbD8BFdWXX9QtoNqwXSkwcerok9TvNWan+WMLIiNxfPUFAdwyS3RxqAY4pc4ajW6vb0eUYOln2wQkrlAtQqP08YvnzUDy5HkTp3sLZowNzBK8GblXF9E09ggkyK2sBKjEU/yCSQwA9MAmMFL2C1Q1NVXBADwNCjdgknaYwQCdAEAMZQiAAY4QHQfEYj9cEdh6QmAKEbBw8pQAATQJjJ1BDEwm4qFwDAvyW6UoHKeCPUJDvJqHCTdgJe2a8JlCrQ2nq1Zc/cMYOFk+bnGGBnGV/R98Y5Nf8HcxplkKxMkQYqEvhi4E7F+O3PD2vxjHxfU/A3jUE47tMx9yQOd9ahs84kr2mQ57290OBV9gf3hrlwIX1rjupK32edAlCdiDrbsUW5zy2YFj7tPEZw84jTn7uIdq7XaH5ZXv8rZdDrnmbo8FL9L/+m0VDlYJG4iHJ6ImQlZbb4u9Md/LapaAZozHIizHWoR31vw6T7vuHZ8FuViKzfY45px74m2INGsPHTywf+OG9evWrlkt2W0369VyMZ9NJ2NJxKPhQOA5lqEp0g8yn03LSfBfffnF5zeFs8+vn41Hg/7TJ48f9bqddqv5yfvZxnotja7hFV/NNuq1JDpHYbjZe6VQCa3i46DJEMyB1b2hzRtKa6dYw4QghyfDVMZXhq6Ck0oDpeaZeiPuDQpLuYwJmB01pkie9v16WdoHlrHF7ea49gZVmeRUZ0K5hqUpE9AswWkEBztmqkiFl5b5s4Um4xjjDGu2M35d1LW1Gvurc4K7WUotsKQqMpnYs+VzrijUFRaGn7t2xTEwAPqMKgzgb8vvycMoiaDgSd9KBujNijZzaLn1R0kGa3Kusp+8274i1vVaZLqMWeldSzTTu7bCVpEJjLt2+wuLhSt/6WI2HiBgeKZbUSKCu1yS1KW9ods/7FRl0r1VbqPd71hZkeheH+59Uo5Fc2NuLqIOy4nyTsIROT1X8vmO7kb2ugeLBI9CZiJ65+XON5bP187Xz7cWthdUJDL/0hv+RUockfzqju0UglXe8HBF5U7+WVWRsOHDKfSCUvxOYrpWWei2QuNHPGvFxf7C/urWdigMWeoye4R6LY9sb3hoB3YfGADQUe8Uk4Az6VGYI8t/xCvtTOIa9Z+KgGayPFPsYuyrMidHk+E4duUjb2Sg0fDax9nhSoHTKbnpuSwEhjvpuvKaPMZ5Ex6hrCmUilEGiS+E+MjqDyM1H6anyWmkamULzs3sEq7NZe2cs+TMVaDtB7W+/olzzunNFzKeJ0Qw+/ZWzV2AUcLkALG5VFHoUmv3ZlqvUR7RaBr1Wm8Qzaemf2OzQItJgg3qXPoolOHar6EVa6m+f1aj4aTCXGuh81B6lp87oZIZeMnbONAU5gACAto4NEUh90nGhRX3n6c8stE8l7FUBkWlU2KVfj7cqNdSA8mI5TVJJrUw0y3l3OlbGcnE84R45zD8Y8zbwHNmJhrumhS4RzWp5XzKIhiGkeI5tJqmjvOBZaDZzlzako4ROAYOSuQRJU/Ycd2JhG5T29eqCZd4CB6KZEzKr9KYpjDDGbZWAasmJEbGh4wIBU4LWiyD1KoygAE1/jDpdIeSnSjtIKxlGXVBx1zJ2h0xy6htwQS6Wg1Gk+qxqk/ekfcInBKtfEdWaB4GGC22qt8mdGcWlmyQtnoDa+YcgXa15H0z1hmi73KuB2g/X1LQBdoskCJBllDaO2gWpAjSUO6guFJzDIcZDG8zNITkkRqJh0hjTeWsHc0w/EnOO1oxTZBvqpSsQOjxBpI9iRbjQDru0ZMlEC6vvWFNGTWpu5OgMuQI1QmJO5ICs+9A6BDgKmOmiT2rH1ILYddsIzBJ90ACWi2a2bQWQXaba8AW+wRyQC86Fxaisww4S9LxtWAarTQcI7BrjMVHdcRjRQWRU8plri7us+eShrUCnhscoCezjASlkkVpTSrqFeXdzUYOeDy3EdjIXEy1row9oSKYfQp/gtQIGB2FGRi2UJX9RNLC9AyNc7ugdWMkJdRruVKj6TW+7g6qLQHXpTvNyFRpZ9TafiMumzVKOr/kwWplP+E9cZUPqj3AeTkz5dyDiTAlmkrGK6u4JSpXlcrBMUbdjdWa9aoCHNY3ENqMjG9f9NKzUXeFwOgKSpucNCFTCvEJkNVOkcOJARoJmLalKf6FKe3z/h0GPSOLVVC7ID1Ltr0l41nG++nfc/e+BQarY5gcAg7H0dpYYBhot8tqyd1ClY0Wdqs2RkzFhCi+QVnzptJDm4D0NFCgCKMw/prkrRBcMwi6dgHlCGJFugVee0eLnVTtQqDRgnbuWoo0r40El7dK7NmZpdbtPaz7Azg5gGZpT4V/OpcZoNk861l5N2PbmNjVdR1sgpzx9d/DG1OOBkorTnrYyra/u5SQjsBGP1ySRWqgr9Iiu6GakP2lmqEwm7CBm0B25S+ZAAfFYRjaWSH92UesVVKSSPpKY7uklh2cpgycQ5+GvrOWS2QoaWrvI1cCOyjBzf8ASl33gJkcUt4pLCE+EVhu6jUJrk1qx1yr0dsX2dPt2zhVyCnR6Uy48hiGA1c5BkG/h5D89P+6cx2Bc1x5HfCag29CX/vAuWe2kc8bJuWnDB9nju1P5C37P5jvUEVaQ1Z/n7Aoxvnu2ebwln/iGqxRid7mRC8CRKZsxviyNQJV4BILnZVgAFQoFk5ewjeH6Q2PiZ9lVFjOKD1Ojk+BYj67eAuWILDH6sCB3pX94507KRpasNtYDMr24HoxHoA+WG9GXmimn2WCMidG+NolQV5qQWprQepGED4PCzcGb4zSadVNHzQsinSkQZsKU/hb7Y9uFXr5Ow11Yxj0uaU2AR5AwztOgrSrrHOoXdcWIwYgKKso7Y5nSjKQNpqJ4P4NEko/lX3ljrXtttWwUJTK8grm9ifTsDN0wwTYqTT/scFA1s5gWtrvLt3SyZoJnH7JfRI0CK9C+OUWVG4Nwuj0Hsxkkxz8aLxnJ6AdwF5AOMANqICSYe0MBjoODeLjlXMpwgPXYpcjLC+OO5Yu8sMl2Te7FKve77zjDL733kdEqz9+/33Xlnff/XDMFb4nARK+sy0AVj0CCd+X+qXU5ULHOHK9khHtnKFl+0IDZaCCdNHGz+CW+pcg3T85150TFxjaDkIuSo1bv5qft7QzD3w1NrhZGp17oFM7f9sFS5198Eo2ByXw30SnKvm5KlBwR8vC/uH19YHhzQvjoYGq+QWhlkX9I5KBJk2L2l9KzJvtaxO/GfZa3Ncj1/9bv9gxMrP7ZEtrVVbXpuht5EKOQRnUv2+DAjfG2b/IgHzPdOSp1Cg+TznmweutiKosK79PyjCNMQ2llaWRr1aUlpXfz1lJFBA9Gl6fDwTgYWNJ5uc1fRHD/+2n6ACAZ757BQC+vLPZFvh9ftWBsTQi0OY33IA8dx9tRM1mGziirZiAXfSDKbnBaJ6AzrKQVsT9nSqCMhwCE4lSHAb2iegHQ4Bw13EUOwDcFSCuIG7/rGB0v6zgivDECiEel1dIuVjHCsvPWh5uIAb3I8CtKKwgOGUyk3x87LBHwcnLOzk/ag7cKG2A1yKIRxrfujghEl6jdRQmd3NMRdyLmRQlQZxrDonMFDzQWo+gr4EXS/JEZbHpP/2atMht60j2l1uZU5vXY7AoJG8JmhpW7tbEkgnVE+1orfwEIstvAxL73Qmw2JJ4lkN79v7gHG6dtMqq3RKyWegNZ98mYZ8ZVHdkqi5jr+hBS+6c8OGhConmQm5X25+O3xFBnwfzEKfnOxax0bgF3Jncalr06rFPx7IdAaOrobPfDNb/yg7Lx/qL70eYP07MXpi+NjTZzsc3SDcJ8UoAXzDaYXj+D04Qjjr4I/a5402wxy9ijitEr0ANIAfm92fS6/K/sNug0/bajUSrQLPsNCrUq6yWoZqgEqEc/ksBiuGi4CHvIGdfUNb+ooyuI60hpfeSBhJmJ64gJr9RVO5FJIRlHiH5jYICAgz8DMPHwcsxPAA3lbkoOAk47sBmkdtq0SKz7tKkxzDqEzDon5BeJ9OonVApMRR/YXx/OfGOWpLw5Obke3IqU5K6s5OjPVkyOak7M8nmxgiPMTgxvtuTWOxJT7BJvL3Ea56UyqTUrkRffGpX8tVN+N2JSxoZf74zpjzaH1Ue6Y+2Iq0wn9svfcLvtoTlEX2CRYiV4nfBI3rD/S6f06/5lJ/K4Q+3nJayVioqVU1qtuKjVJ9aqTisUlCF2fgdL3y6n/uYX7eY5WF9jEWwlex3xrlpSnqAdobavXUPaHa6LuRo7grRplDOCPuoZktnSG0Kwd/Z1XEn0XZr/bZtSLu5LrSzreMujvMtWXcydktLx52Cb7fmB+CF1+u9oa30w3ulJCslbSRt9FJ0mwkvcJMfEbJFGWWU1cWHDC6G31QiAAAA) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAYUAA8AAAAABugAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAABQAAAAUAA8ACEdQT1MAAAFsAAAAHgAAAB5EdEx1R1NVQgAAAYwAAAA0AAAANJMNggJPUy8yAAABwAAAAGAAAABgmK7Q0FNUQVQAAAIgAAAAWgAAAFpe+kGhY21hcAAAAnwAAABUAAAAVADNH/FnYXNwAAAC0AAAAAwAAAAMAAgAGWdseWYAAALcAAABNgAAATZveQfqaGVhZAAABBQAAAA2AAAANgmwYTFoaGVhAAAETAAAACQAAAAkCykF1GhtdHgAAARwAAAAIAAAACAX6P92bG9jYQAABJAAAAASAAAAEgGEAVltYXhwAAAEpAAAACAAAAAgACgBIW5hbWUAAATEAAABLgAAAmA0U2IscG9zdAAABfQAAAAgAAAAIP9tAGQAAQAAAAwAAAAAAAAAAQAHAAEAAQABAAAACgAcABwAAURGTFQACAAEAAAAAP//AAAAAAAAAAEAAAAKADIAMgAEREZMVAAeY3lybAAaZ3JlawAabGF0bgAaAAAAAAAEAAAAAP//AAAAAAAEBJ4CvAAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HACAAAB9NBgD+AABmB5oCACAAAZ8AAAAABDoFsAAAACAAAwABAAEACAADAAAAFAADAAAALAACd2R0aAEBAAB3Z2h0AQAAAWl0YWwBAgACAAYAEgAeAAEAAAACAScAZAAAAAEAAQAAAQkCvAAAAAMAAgACASgAAAAAAAEAAAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAAAAA0AIACgH03//wAAAAAADQAgAKAfTf//AAH/9f/j/2bgugABAAAAAAAAAAAAAAAAAAEAAgAIAAj//wAPAAUAZAAAAygFsAADAAYACQAMAA8AAAERIREFAQElCQMhCQIDKP08Ao7+7wER/agBDf7zASr+/gID/f0BAgEBBbD6UAWwVP18/XwMAngCeP1E/aIFRP2iAl4AAAIAVv/sBS4FxAAVACsAAAEVFAIGBiMiJiYCNTU0EjY2MzIWFhIFNTQuAiMiDgIVFRQeAjMyPgIFLlqk44qJ46ZbWqXjiYrjpVv+0SpSdkxMdVEqKlJ2TEx2UCoC+kWm/vi5YmK5AQimRacBB7piYrr++exHdLB4PT14sHRHc7F5Pj55sQAAAgBaBHACxAXXAAUADwAAATUTMxUDJTUzFRQWFwcmJgGFcc7k/nqoIytSSFwEgxgBPBX+wfZeWD5dIVMkif///mL/7AV0BdYAJgAERgAABwAF/gj//wAAAAEAAAADAk7RiEHAXw889QAbCAAAAAAAxPARLgAAAADh1AJv+jH91QmJCHMAAQAJAAIAAAAAAAAAAQAAB2z+DAAACYz6Mf4zCYkAAQAAAAAAAAAAAAAAAAAAAAgDjABkAAAAAAH9AAAB/QAABYQAVgMXAFoB/QAABcr+YgAAAC0ALQAtAC0AcACPAI8AmwAAAAEAAAAIAKkAFQB2AAcAAQAAAAAAAAAAAAAAAAADAAF4nG2Qzy4DURSHv2lLtGm67HpiQSUUJUKtsGhsEBHWNcaoVEdmpgt7T2Nh4Qk8kKUH8Jszt9WGnNx7v/s7/+49QIN3yniVKvDh4dijzrfjEkt8OS6zzqfjCk3eHC+wwqvjRekjxw322C9YtevKLtijxrLjkvSm4+pvL29Ves1xSwSXxDzRV/UzUWI85JTMzgEBN9rvdH8QheJIlNnKeCaly6YsFoeqci8ayVPk5kqqvW21I+t2q5VpbXCsfaja14pIFDewXJ8dxW/JDjjUrSPqsDuX609zZ2N7nMt6ov/7TM5Z74m9/EX9Jz8rOm7LfK6khDrne18oOuZRnsDijxjbRGL7hU/rz3QiVc8jxqrSVlY+81yNZZHeFE7nlkpP5l4fyN+XntpE134A3PNXvwAAAAMAAAAAAAD/agBkAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-greek-700-normal-BcGn9doz.woff2) format("woff2"),url(./roboto-greek-700-normal-D3kmAf0K.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-math-700-normal-VUAI6Bz2.woff2) format("woff2"),url(./roboto-math-700-normal-pYD1nhov.woff) format("woff");unicode-range:U+0302-0303,U+0305,U+0307-0308,U+0310,U+0312,U+0315,U+031A,U+0326-0327,U+032C,U+032F-0330,U+0332-0333,U+0338,U+033A,U+0346,U+034D,U+0391-03A1,U+03A3-03A9,U+03B1-03C9,U+03D1,U+03D5-03D6,U+03F0-03F1,U+03F4-03F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE00-1EEFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-symbols-700-normal-rJi6RjIy.woff2) format("woff2"),url(./roboto-symbols-700-normal-CuuvBBxy.woff) format("woff");unicode-range:U+0001-000C,U+000E-001F,U+007F-009F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+2800-28FF,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B00-2BFF,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F000-1F0FF,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F700-1F7FF,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB00-1FBFF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-vietnamese-700-normal-iKxYNAzq.woff2) format("woff2"),url(./roboto-vietnamese-700-normal-Dz0HwF-w.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-latin-ext-700-normal-70GS1MYH.woff2) format("woff2"),url(./roboto-latin-ext-700-normal-BS1OuQqR.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(./roboto-latin-700-normal-CXeAXeti.woff2) format("woff2"),url(./roboto-latin-700-normal-DUekQERp.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Material Icons;font-style:normal;font-display:swap;font-weight:400;src:url(./material-icons-latin-400-normal-kAwBdRge.woff2) format("woff2"),url(./material-icons-latin-400-normal-B5tbEuci.woff) format("woff")}body{margin:0;padding:0;width:100vw;height:100vh;overflow:hidden;font-family:Roboto,Segoe UI,"sans-serif"}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid rgb(179,197,219);background-color:#fff6}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:#003c884d;border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-singlebar-even{background-color:#000}.ol-scale-singlebar-odd{background-color:#fff}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:12px;z-index:11;color:#000;text-shadow:-2px 0 #FFFFFF,0 2px #FFFFFF,2px 0 #FFFFFF,0 -2px #FFFFFF}.ol-scale-text{position:absolute;font-size:14px;text-align:center;bottom:25px;color:#000;text-shadow:-2px 0 #FFFFFF,0 2px #FFFFFF,2px 0 #FFFFFF,0 -2px #FFFFFF}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid black}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ol-viewport canvas{all:unset}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:#fff6;border-radius:4px;padding:2px}.ol-control:hover{background-color:#fff9}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:#003c8880;border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;background-color:#003c88b3}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:#003c88b3;text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:#000;text-shadow:0 0 2px #fff;font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:#fffc}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:2px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:#fffc}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.map{height:100%}.ol-control{background-color:var(--mui-palette-background-default)!important;border-radius:4px;padding:0;opacity:.85}.ol-control button{display:block;margin:0;padding:calc(.5 * var(--mui-spacing));text-align:center;font-size:inherit;height:1.9em;width:1.9em;border:solid 1px;border-radius:var(--mui-shape-borderRadius);border-color:var(--mui-palette-divider)!important;background-color:var(--mui-palette-background-default)!important;color:var(--mui-palette-text-primary)}.ol-control button:hover{background-color:rgba(var(--mui-palette-text-primaryChannel) / var(--mui-palette-action-hoverOpacity))!important}.ol-control button .MuiSvgIcon-root{font-size:1rem}.ol-control button[data-selected=true]{background-color:var(--mui-palette-action-selected)!important;color:var(--mui-palette-text-primary)!important}.ol-control button[data-selected=true]:hover{background-color:rgba(var(--mui-palette-text-primaryChannel) / calc(var(--mui-palette-action-selectedOpacity) + var(--mui-palette-action-hoverOpacity)))!important}.layer-panel{border-radius:var(--mui-shape-borderRadius) var(--mui-shape-borderRadius) 0 0!important;border-bottom:none!important}.split-mode{border-radius:0!important;border-bottom:none!important}.info-box{border-radius:0!important}.snapshot-button{border-radius:0 0 var(--mui-shape-borderRadius) var(--mui-shape-borderRadius)!important;border-top:none!important}.ol-scale-line{border:solid 1px;border-color:var(--mui-palette-divider);border-radius:var(--mui-shape-borderRadius);background-color:var(--mui-palette-background-default);opacity:.85}.ol-scale-line-inner{border:1px solid;border-color:var(--mui-palette-action-active);border-top:none;color:var(--mui-palette-text-primary)}.ol-zoom{top:10px}.ol-zoom .ol-zoom-in{border-radius:var(--mui-shape-borderRadius) var(--mui-shape-borderRadius) 0 0;border-bottom:none;cursor:pointer}.ol-zoom .ol-zoom-out{border-radius:0 0 var(--mui-shape-borderRadius) var(--mui-shape-borderRadius);cursor:pointer}.ol-attribution a{color:var(--mui-palette-action-active)}.ol-attribution li{color:var(--mui-palette-action-active);text-shadow:none}@keyframes hint{0%,to{opacity:20%}10%{opacity:100%}90%{opacity:100%}}.hint_wrap{animation:hint 4s linear none;opacity:20%;transition:all .3s ease-in-out;color:orange;position:absolute;bottom:8px;right:16px;z-index:10}.hint_wrap:hover{opacity:100%}.react-resizable{position:relative}.react-resizable-handle{position:absolute;width:20px;height:20px;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+);background-position:bottom right;padding:0 3px 3px 0}.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-resizable-handle-w,.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)} diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-BoeCr7ev.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-BoeCr7ev.woff2 deleted file mode 100644 index 367c13ac3..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-BoeCr7ev.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-D568C3aM.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-D568C3aM.woff deleted file mode 100644 index 08095323a..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-D568C3aM.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-DEFNdjk5.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-DEFNdjk5.woff new file mode 100644 index 000000000..c25e60507 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-DEFNdjk5.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-DzUz0kzv.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-DzUz0kzv.woff2 new file mode 100644 index 000000000..cb84c38b1 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-300-normal-DzUz0kzv.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-DZJji7Rx.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-Bjg-1-sg.woff similarity index 67% rename from xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-DZJji7Rx.woff rename to xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-Bjg-1-sg.woff index e94b00ede..179ff2db4 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-DZJji7Rx.woff and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-Bjg-1-sg.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-CBPI_iaY.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-CBPI_iaY.woff2 new file mode 100644 index 000000000..2d4b6a47c Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-CBPI_iaY.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-DAIM1_dR.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-DAIM1_dR.woff2 deleted file mode 100644 index b0ed6d697..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-400-normal-DAIM1_dR.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-BI4HuXre.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-CBKMylY4.woff similarity index 66% rename from xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-BI4HuXre.woff rename to xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-CBKMylY4.woff index 9a6cc9fd3..fc353cee6 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-BI4HuXre.woff and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-CBKMylY4.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-CLao9AfR.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-CLao9AfR.woff2 new file mode 100644 index 000000000..4ed0e8a15 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-CLao9AfR.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-hCeO1jFL.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-hCeO1jFL.woff2 deleted file mode 100644 index 3f43bf85b..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-500-normal-hCeO1jFL.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-BiSG5NnW.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-BiSG5NnW.woff2 deleted file mode 100644 index 895e1edb4..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-BiSG5NnW.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-C2o7G-SM.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-C2o7G-SM.woff2 new file mode 100644 index 000000000..b595d156a Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-C2o7G-SM.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-KqaQ5bNp.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-DhZFXDSN.woff similarity index 66% rename from xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-KqaQ5bNp.woff rename to xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-DhZFXDSN.woff index 9a881bb7f..3a72cc270 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-KqaQ5bNp.woff and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-700-normal-DhZFXDSN.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-CUPJdUZp.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-CUPJdUZp.woff2 deleted file mode 100644 index c4f017a2a..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-CUPJdUZp.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-D7ank4TF.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-D7ank4TF.woff new file mode 100644 index 000000000..609955b57 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-D7ank4TF.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-DIxttMbC.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-DIxttMbC.woff2 new file mode 100644 index 000000000..fcf044f5a Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-DIxttMbC.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-DQdcc27I.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-DQdcc27I.woff deleted file mode 100644 index 38d5b3585..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-300-normal-DQdcc27I.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-DtZHuW6i.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-CaK1767H.woff similarity index 83% rename from xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-DtZHuW6i.woff rename to xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-CaK1767H.woff index edf8b5d20..bea823dd5 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-DtZHuW6i.woff and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-CaK1767H.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-DzMWdK87.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-DzMWdK87.woff2 deleted file mode 100644 index 1a1ed7c29..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-DzMWdK87.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-qHufge6k.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-qHufge6k.woff2 new file mode 100644 index 000000000..8abc46493 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-400-normal-qHufge6k.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-B7rQpwPu.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-B7rQpwPu.woff2 deleted file mode 100644 index 97ce38268..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-B7rQpwPu.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-BWC_xYeb.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-BWC_xYeb.woff2 new file mode 100644 index 000000000..07e31ef75 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-BWC_xYeb.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-C927yMrb.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-C927yMrb.woff deleted file mode 100644 index 5bd43e5fe..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-C927yMrb.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-DqF2hftb.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-DqF2hftb.woff new file mode 100644 index 000000000..6115c8865 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-500-normal-DqF2hftb.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-BuQgZIrO.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-BuQgZIrO.woff deleted file mode 100644 index 68ef99032..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-BuQgZIrO.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-CI7FH63F.woff b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-CI7FH63F.woff new file mode 100644 index 000000000..2939baed1 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-CI7FH63F.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-DmFxo5wj.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-DmFxo5wj.woff2 new file mode 100644 index 000000000..0e14dd636 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-DmFxo5wj.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-UFn0vR9r.woff2 b/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-UFn0vR9r.woff2 deleted file mode 100644 index da2e498a1..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-cyrillic-ext-700-normal-UFn0vR9r.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-CTj2MfNN.woff b/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-CTj2MfNN.woff deleted file mode 100644 index 21c05cfc5..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-CTj2MfNN.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-C_Dgaih9.woff b/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-C_Dgaih9.woff new file mode 100644 index 000000000..c163855a1 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-C_Dgaih9.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-Cnub06j7.woff2 b/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-Cnub06j7.woff2 deleted file mode 100644 index 9e25a3e5d..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-Cnub06j7.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-DJEM9B4Z.woff2 b/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-DJEM9B4Z.woff2 new file mode 100644 index 000000000..4d9935269 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-greek-300-normal-DJEM9B4Z.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-CcizSnRP.woff b/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-Bb5mj_fZ.woff similarity index 73% rename from xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-CcizSnRP.woff rename to xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-Bb5mj_fZ.woff index cad716529..c2eadbb68 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-CcizSnRP.woff and b/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-Bb5mj_fZ.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-ai2Z1K3C.woff2 b/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-ai2Z1K3C.woff2 new file mode 100644 index 000000000..bfdab5f48 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-ai2Z1K3C.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-jFM2czAU.woff2 b/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-jFM2czAU.woff2 deleted file mode 100644 index de646f8d4..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-greek-400-normal-jFM2czAU.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-BJMS0heP.woff2 b/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-BJMS0heP.woff2 deleted file mode 100644 index 40f04fa05..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-BJMS0heP.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-C9AnhcmC.woff2 b/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-C9AnhcmC.woff2 new file mode 100644 index 000000000..bb116d397 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-C9AnhcmC.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-BLLWU9W-.woff b/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-oCqhoyfc.woff similarity index 72% rename from xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-BLLWU9W-.woff rename to xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-oCqhoyfc.woff index 4698744eb..cfb75ca38 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-BLLWU9W-.woff and b/xcube/webapi/viewer/dist/assets/roboto-greek-500-normal-oCqhoyfc.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-0aHWxGLu.woff2 b/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-0aHWxGLu.woff2 new file mode 100644 index 000000000..dabe55f53 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-0aHWxGLu.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-BcGn9doz.woff2 b/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-BcGn9doz.woff2 deleted file mode 100644 index a026cd650..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-BcGn9doz.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-D3kmAf0K.woff b/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-DjRqqLBV.woff similarity index 72% rename from xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-D3kmAf0K.woff rename to xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-DjRqqLBV.woff index 5294c9bb9..1402c6359 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-D3kmAf0K.woff and b/xcube/webapi/viewer/dist/assets/roboto-greek-700-normal-DjRqqLBV.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-BARJ-h6h.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-BARJ-h6h.woff new file mode 100644 index 000000000..33537ef1f Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-BARJ-h6h.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-CCzlftfr.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-CCzlftfr.woff2 new file mode 100644 index 000000000..fb6526fa1 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-CCzlftfr.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-CztWkFGs.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-CztWkFGs.woff2 deleted file mode 100644 index b3834ad7d..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-CztWkFGs.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-KByCBsad.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-KByCBsad.woff deleted file mode 100644 index 46ddbceb2..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-300-normal-KByCBsad.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-BqEyEoaF.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-BqEyEoaF.woff2 new file mode 100644 index 000000000..77e42594c Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-BqEyEoaF.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-CNwBRw8h.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-CNwBRw8h.woff2 deleted file mode 100644 index 5a5fad1a5..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-CNwBRw8h.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-068yxgMN.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-DyYNIH4P.woff similarity index 70% rename from xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-068yxgMN.woff rename to xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-DyYNIH4P.woff index 5e9dc3d08..b31b96303 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-068yxgMN.woff and b/xcube/webapi/viewer/dist/assets/roboto-latin-400-normal-DyYNIH4P.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-7RbcRiD8.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-7RbcRiD8.woff2 new file mode 100644 index 000000000..171a2f6ab Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-7RbcRiD8.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-CC5nhZkh.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-CC5nhZkh.woff deleted file mode 100644 index 175d5f0dc..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-CC5nhZkh.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-CkrA1NAy.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-CkrA1NAy.woff2 deleted file mode 100644 index d8a648a0e..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-CkrA1NAy.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-DQZyH_nt.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-DQZyH_nt.woff new file mode 100644 index 000000000..7864e6460 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-500-normal-DQZyH_nt.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-BZpUvMxY.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-BZpUvMxY.woff2 new file mode 100644 index 000000000..85b8ace25 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-BZpUvMxY.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-CXeAXeti.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-CXeAXeti.woff2 deleted file mode 100644 index 665cf6aa8..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-CXeAXeti.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-DLgJJpmK.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-DLgJJpmK.woff new file mode 100644 index 000000000..10110ac6e Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-DLgJJpmK.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-DUekQERp.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-DUekQERp.woff deleted file mode 100644 index 028316868..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-700-normal-DUekQERp.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-B90pq-BC.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-B90pq-BC.woff2 new file mode 100644 index 000000000..4d917ed98 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-B90pq-BC.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-BOz0oSmX.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-BOz0oSmX.woff2 deleted file mode 100644 index c5360a279..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-BOz0oSmX.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-CTCCHkZF.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-CTCCHkZF.woff new file mode 100644 index 000000000..2c09262df Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-CTCCHkZF.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-Tcf9y2tg.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-Tcf9y2tg.woff deleted file mode 100644 index bec904ad4..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-300-normal-Tcf9y2tg.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-C3tdtHj3.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-C3tdtHj3.woff2 new file mode 100644 index 000000000..100758e17 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-C3tdtHj3.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-ZYmyxeOy.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-ZYmyxeOy.woff2 deleted file mode 100644 index 47e69cf8a..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-ZYmyxeOy.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-eTRLN0Nt.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-eTRLN0Nt.woff deleted file mode 100644 index 243187758..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-eTRLN0Nt.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-scX0fKtV.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-scX0fKtV.woff new file mode 100644 index 000000000..44e20d7b2 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-400-normal-scX0fKtV.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-C_ARlJGk.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-C_ARlJGk.woff2 deleted file mode 100644 index 887feecac..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-C_ARlJGk.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-Cyc0AKLz.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-Cyc0AKLz.woff new file mode 100644 index 000000000..2bd5a394a Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-Cyc0AKLz.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-FFcS8vBN.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-FFcS8vBN.woff deleted file mode 100644 index a2cd4db52..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-FFcS8vBN.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-pMCM9Ixg.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-pMCM9Ixg.woff2 new file mode 100644 index 000000000..a4e2d08d8 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-500-normal-pMCM9Ixg.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-70GS1MYH.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-70GS1MYH.woff2 deleted file mode 100644 index 164501b58..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-70GS1MYH.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-BS1OuQqR.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-BS1OuQqR.woff deleted file mode 100644 index 9ba4c22b9..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-BS1OuQqR.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-BUhwtWwy.woff b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-BUhwtWwy.woff new file mode 100644 index 000000000..b40671d12 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-BUhwtWwy.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-DSBUz0N1.woff2 b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-DSBUz0N1.woff2 new file mode 100644 index 000000000..2a80739f9 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-latin-ext-700-normal-DSBUz0N1.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-5dF_7mZP.woff2 b/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-5dF_7mZP.woff2 new file mode 100644 index 000000000..3a434fa7d Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-5dF_7mZP.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-BMxwzQmU.woff2 b/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-BMxwzQmU.woff2 deleted file mode 100644 index d2f6aa9e4..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-BMxwzQmU.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-BU9CUCyj.woff b/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-BU9CUCyj.woff deleted file mode 100644 index 948e50644..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-BU9CUCyj.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-Ds0YpBw2.woff b/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-Ds0YpBw2.woff new file mode 100644 index 000000000..02464fe9f Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-math-300-normal-Ds0YpBw2.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-B3wgz80t.woff2 b/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-B3wgz80t.woff2 deleted file mode 100644 index 15e1583a0..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-B3wgz80t.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-BEFej5gc.woff2 b/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-BEFej5gc.woff2 new file mode 100644 index 000000000..f38890d71 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-BEFej5gc.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-rzxYvyVt.woff b/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-C9RxBKAh.woff similarity index 75% rename from xcube/webapi/viewer/dist/assets/roboto-math-400-normal-rzxYvyVt.woff rename to xcube/webapi/viewer/dist/assets/roboto-math-400-normal-C9RxBKAh.woff index 59c94d83a..a50ec81e3 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-rzxYvyVt.woff and b/xcube/webapi/viewer/dist/assets/roboto-math-400-normal-C9RxBKAh.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-DaFX-ZC8.woff b/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-C-7mKPO3.woff similarity index 75% rename from xcube/webapi/viewer/dist/assets/roboto-math-500-normal-DaFX-ZC8.woff rename to xcube/webapi/viewer/dist/assets/roboto-math-500-normal-C-7mKPO3.woff index 7768cbab5..a2fd68f2d 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-DaFX-ZC8.woff and b/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-C-7mKPO3.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-C4NU9gLX.woff2 b/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-C4NU9gLX.woff2 new file mode 100644 index 000000000..6a44f5848 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-C4NU9gLX.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-CFNaIMFC.woff2 b/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-CFNaIMFC.woff2 deleted file mode 100644 index 356456693..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-math-500-normal-CFNaIMFC.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-B8YqGHVc.woff2 b/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-B8YqGHVc.woff2 new file mode 100644 index 000000000..57b8ce98e Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-B8YqGHVc.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-DVoD5t2k.woff b/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-DVoD5t2k.woff new file mode 100644 index 000000000..845d0c3fd Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-DVoD5t2k.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-VUAI6Bz2.woff2 b/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-VUAI6Bz2.woff2 deleted file mode 100644 index 7557ee1da..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-VUAI6Bz2.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-pYD1nhov.woff b/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-pYD1nhov.woff deleted file mode 100644 index d132a6c91..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-math-700-normal-pYD1nhov.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-BCnjhQd_.woff b/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-BCnjhQd_.woff new file mode 100644 index 000000000..299a9e28c Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-BCnjhQd_.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-BtHl5mYl.woff2 b/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-BtHl5mYl.woff2 deleted file mode 100644 index 4b6d9aa2a..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-BtHl5mYl.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-DDU7avhj.woff2 b/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-DDU7avhj.woff2 new file mode 100644 index 000000000..03635221d Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-DDU7avhj.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-kyoSXp-d.woff b/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-kyoSXp-d.woff deleted file mode 100644 index a292a27a4..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-symbols-300-normal-kyoSXp-d.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-CB1Ce4Gk.woff2 b/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-CB1Ce4Gk.woff2 new file mode 100644 index 000000000..cdf432cb4 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-CB1Ce4Gk.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-DLYbZahX.woff b/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-DLYbZahX.woff new file mode 100644 index 000000000..3e603b1b8 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-DLYbZahX.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-Tzuungub.woff b/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-Tzuungub.woff deleted file mode 100644 index da841a4fd..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-Tzuungub.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-fF1SLJBj.woff2 b/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-fF1SLJBj.woff2 deleted file mode 100644 index f9c26fa24..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-symbols-400-normal-fF1SLJBj.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-BXFTxrNR.woff2 b/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-BXFTxrNR.woff2 deleted file mode 100644 index 013a49f60..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-BXFTxrNR.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-B_CZKVJS.woff2 b/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-B_CZKVJS.woff2 new file mode 100644 index 000000000..57afb2531 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-B_CZKVJS.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-CAhAe-ik.woff b/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-CAhAe-ik.woff deleted file mode 100644 index e1d6c4db5..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-CAhAe-ik.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-F7c8nfcH.woff b/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-F7c8nfcH.woff new file mode 100644 index 000000000..870051ccb Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-symbols-500-normal-F7c8nfcH.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-BiFDindJ.woff2 b/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-BiFDindJ.woff2 new file mode 100644 index 000000000..9cd22b275 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-BiFDindJ.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-BoS6HWkc.woff b/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-BoS6HWkc.woff new file mode 100644 index 000000000..7009e80a2 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-BoS6HWkc.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-CuuvBBxy.woff b/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-CuuvBBxy.woff deleted file mode 100644 index 1d5cab0bb..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-CuuvBBxy.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-rJi6RjIy.woff2 b/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-rJi6RjIy.woff2 deleted file mode 100644 index bcf868bd3..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-symbols-700-normal-rJi6RjIy.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-BPvXm_f1.woff2 b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-BPvXm_f1.woff2 new file mode 100644 index 000000000..c5a2df552 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-BPvXm_f1.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-CNeuLW5X.woff2 b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-CNeuLW5X.woff2 deleted file mode 100644 index 69815fba7..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-CNeuLW5X.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-DXBG9gdz.woff b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-DXBG9gdz.woff deleted file mode 100644 index 97c79afa7..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-DXBG9gdz.woff and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-INUupD3o.woff b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-INUupD3o.woff new file mode 100644 index 000000000..d5bc46ba0 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-300-normal-INUupD3o.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-CDDxGrUb.woff2 b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-CDDxGrUb.woff2 deleted file mode 100644 index bc95855cd..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-CDDxGrUb.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-D2PTxGxD.woff2 b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-D2PTxGxD.woff2 new file mode 100644 index 000000000..1cd52dd84 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-D2PTxGxD.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-DmXaN3yE.woff b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-DnpnVwnf.woff similarity index 62% rename from xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-DmXaN3yE.woff rename to xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-DnpnVwnf.woff index 3baa2faf0..bcfb067cc 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-DmXaN3yE.woff and b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-400-normal-DnpnVwnf.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-B3ncpOoB.woff2 b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-B3ncpOoB.woff2 new file mode 100644 index 000000000..aacc7a6fd Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-B3ncpOoB.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-DW96CsrR.woff b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-D380IkQ8.woff similarity index 63% rename from xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-DW96CsrR.woff rename to xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-D380IkQ8.woff index c81200ec0..3974c277f 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-DW96CsrR.woff and b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-D380IkQ8.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-HYpufUYk.woff2 b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-HYpufUYk.woff2 deleted file mode 100644 index bdfaff3bf..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-500-normal-HYpufUYk.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-BEVeWqJt.woff2 b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-BEVeWqJt.woff2 new file mode 100644 index 000000000..6f142f1e6 Binary files /dev/null and b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-BEVeWqJt.woff2 differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-Dz0HwF-w.woff b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-DsFyXAL4.woff similarity index 62% rename from xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-Dz0HwF-w.woff rename to xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-DsFyXAL4.woff index 9a1bd1f9b..ad7a3a588 100644 Binary files a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-Dz0HwF-w.woff and b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-DsFyXAL4.woff differ diff --git a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-iKxYNAzq.woff2 b/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-iKxYNAzq.woff2 deleted file mode 100644 index c28d2659a..000000000 Binary files a/xcube/webapi/viewer/dist/assets/roboto-vietnamese-700-normal-iKxYNAzq.woff2 and /dev/null differ diff --git a/xcube/webapi/viewer/dist/index.html b/xcube/webapi/viewer/dist/index.html index 2649cf2df..79fc1f46c 100644 --- a/xcube/webapi/viewer/dist/index.html +++ b/xcube/webapi/viewer/dist/index.html @@ -20,9 +20,9 @@ xcube Viewer - - - + + +