PageSourceSearch

https://www.placemark.io/assets/index-myUQ0GIh.js

js placemark.io collected 2026-10-03 20:17:06 UTC 3,318,201 bytes, 1,555 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lib-C89Rf5DI.js","assets/rolldown-runtime-CNC7AqOf.js","assets/geojson_to_csv-Cya7ebpp.js","assets/Either-C8_8cLDf.js","assets/exif-YPP4rBMH.js","assets/errors-CduZ7m1S.js","assets/EitherAsync-UmS3w-vm.js","assets/geotiff-BlQLDaDF.js","assets/preload-helper-CZgWQFsJ.js","assets/osmtogeojson-Dcbntauc.js","assets/dist-BrpV89uJ.js","assets/mapshaper-import-C26F3gBW.js","assets/dist-CaNJoUZm.js","assets/mapshaper-projections-Kq6IYFzA.js","assets/mapshaper-json-table-Bsp_Oe2W.js","assets/mapshaper-export-Dj4G7b2T.js","assets/mapshaper-clean-B_5aW72g.js","assets/mapshaper-proj-5MZUkinT.js","assets/xlsx_to_geojson-_9vguEYf.js","assets/xlsx-BRA3X7js.js"])))=>i.map(i=>d[i]);
2import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-CNC7AqOf.js";import{A as a,B as o,C as s,D as c,E as l,F as u,H as d,I as f,L as p,M as m,N as h,O as g,P as _,R as v,S as y,T as b,U as x,V as S,W as C,a as w,b as T,c as E,f as D,g as O,h as k,i as A,j,k as M,m as N,n as P,o as F,p as I,r as L,s as R,t as ee,u as z,v as te,w as ne,x as re,y as ie,z as ae}from"./_overArg-ue5_ExUf.js";import{n as oe,t as se}from"./dist-BrpV89uJ.js";import{a as ce,i as le,n as ue,o as de,r as fe,t as pe}from"./Either-C8_8cLDf.js";import{i as me,n as he,r as ge,t as _e}from"./errors-CduZ7m1S.js";import{t as ve}from"./EitherAsync-UmS3w-vm.js";import{t as ye}from"./preload-helper-CZgWQFsJ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function xe(){throw Error(`setTimeout has not been defined`)}function Se(){throw Error(`clearTimeout has not been defined`)}function Ce(e){if(je===setTimeout)return setTimeout(e,0);if((je===xe||!je)&&setTimeout)return je=setTimeout,setTimeout(e,0);try{return je(e,0)}catch{try{return je.call(null,e,0)}catch{return je.call(this,e,0)}}}function we(e){if(Me===clearTimeout)return clearTimeout(e);if((Me===Se||!Me)&&clearTimeout)return Me=clearTimeout,clearTimeout(e);try{return Me(e)}catch{try{return Me.call(null,e)}catch{return Me.call(this,e)}}}function Te(){!Pe||!Fe||(Pe=!1,Fe.length?Ne=Fe.concat(Ne):Ie=-1,Ne.length&&Ee())}function Ee(){if(!Pe){var e=Ce(Te);Pe=!0;for(var t=Ne.length;t;){for(Fe=Ne,Ne=[];++Ie<t;)Fe&&Fe[Ie].run();Ie=-1,t=Ne.length}Fe=null,Pe=!1,we(e)}}function De(e,t){this.fun=e,this.array=t}function Oe(){}var ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze=n((()=>{ke={exports:{}},Ae=ke.exports={},(function(){try{je=typeof setTimeout==`function`?setTimeout:xe}catch{je=xe}try{Me=typeof clearTimeout==`function`?clearTimeout:Se}catch{Me=Se}})(),Ne=[],Pe=!1,Ie=-1,Ae.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ne.push(new De(e,t)),Ne.length===1&&!Pe&&Ce(Ee)},De.prototype.run=function(){this.fun.apply(null,this.array)},Ae.title=`browser`,Ae.browser=!0,Ae.env={},Ae.argv=[],Ae.version=``,Ae.versions={},Ae.on=Oe,Ae.addListener=Oe,Ae.once=Oe,Ae.off=Oe,Ae.removeListener=Oe,Ae.removeAllListeners=Oe,Ae.emit=Oe,Ae.prependListener=Oe,Ae.prependOnceListener=Oe,Ae.listeners=function(e){return[]},Ae.binding=function(e){throw Error(`process.binding is not supported`)},Ae.cwd=function(){return`/`},Ae.chdir=function(e){throw Error(`process.chdir is not supported`)},Ae.umask=function(){return 0},Le=ke.exports,Re=be(Le)})),Be=i((e=>{ze();var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pen
2ding`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not val
2id as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof Re==`object`&&typeof Re.emit==`function`){Re.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()}
2,e.version=`19.2.3`})),Ve=i(((e,t)=>{t.exports=Be()})),B=e(Ve());function V(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var He=[`color`],Ue=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,He);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.5 0.75L9.75 3H5.25L7.5 0.75ZM7.5 14.25L9.75 12H5.25L7.5 14.25ZM3 5.25L0.75 7.5L3 9.75V5.25ZM14.25 7.5L12 5.25V9.75L14.25 7.5Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),We=[`color`],Ge=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,We);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.5 2C7.77614 2 8 2.22386 8 2.5L8 11.2929L11.1464 8.14645C11.3417 7.95118 11.6583 7.95118 11.8536 8.14645C12.0488 8.34171 12.0488 8.65829 11.8536 8.85355L7.85355 12.8536C7.75979 12.9473 7.63261 13 7.5 13C7.36739 13 7.24021 12.9473 7.14645 12.8536L3.14645 8.85355C2.95118 8.65829 2.95118 8.34171 3.14645 8.14645C3.34171 7.95118 3.65829 7.95118 3.85355 8.14645L7 11.2929L7 2.5C7 2.22386 7.22386 2 7.5 2Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Ke=[`color`],qe=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Ke);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M8.14645 3.14645C8.34171 2.95118 8.65829 2.95118 8.85355 3.14645L12.8536 7.14645C13.0488 7.34171 13.0488 7.65829 12.8536 7.85355L8.85355 11.8536C8.65829 12.0488 8.34171 12.0488 8.14645 11.8536C7.95118 11.6583 7.95118 11.3417 8.14645 11.1464L11.2929 8H2.5C2.22386 8 2 7.77614 2 7.5C2 7.22386 2.22386 7 2.5 7H11.2929L8.14645 3.85355C7.95118 3.65829 7.95118 3.34171 8.14645 3.14645Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Je=[`color`],Ye=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Je);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M11.5 1C11.7761 1 12 1.22386 12 1.5V13.5C12 13.7761 11.7761 14 11.5 14C11.2239 14 11 13.7761 11 13.5V1.5C11 1.22386 11.2239 1 11.5 1ZM9.5 3C9.77614 3 10 3.22386 10 3.5V13.5C10 13.7761 9.77614 14 9.5 14C9.22386 14 9 13.7761 9 13.5V3.5C9 3.22386 9.22386 3 9.5 3ZM13.5 3C13.7761 3 14 3.22386 14 3.5V13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5V3.5C13 3.22386 13.2239 3 13.5 3ZM5.5 4C5.77614 4 6 4.22386 6 4.5V13.5C6 13.7761 5.77614 14 5.5 14C5.22386 14 5 13.7761 5 13.5V4.5C5 4.22386 5.22386 4 5.5 4ZM1.5 5C1.77614 5 2 5.22386 2 5.5V13.5C2 13.7761 1.77614 14 1.5 14C1.22386 14 1 13.7761 1 13.5V5.5C1 5.22386 1.22386 5 1.5 5ZM7.5 5C7.77614 5 8 5.22386 8 5.5V13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5V5.5C7 5.22386 7.22386 5 7.5 5ZM3.5 7C3.77614 7 4 7.22386 4 7.5V13.5C4 13.7761 3.77614 14 3.5 14C3.22386 14 3 13.7761 3 13.5V7.5C3 7.22386 3.22386 7 3.5 7Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Xe=[`color`],Ze=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Xe);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M0 7.5C0 7.22386 0.223858 7 0.5 7H3C3.27614 7 3.5 7.22386 3.5 7.5C3.5 7.77614 3.27614 8 3 8H0.5C0.223858 8 0 7.77614 0 7.5ZM5.75 7.5C5.75 7.22386 5.97386 7 6.25 7H8.75C9.02614 7 9.25 7.22386 9.25 7.5C9.25 7.77614 9.02614 8 8.75 8H6.25C5.97386 8 5.75 7.77614 5.75 7.5ZM12 7C11.7239 7 11.5 7.22386 11.5 7.5C11.5 7.77614 11.7239 8 12 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Qe=[`color`],$e=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Qe);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1.25 7.5C1.25 7.22386 1.47386 7 1.75 7H13.25C13.5261 7 13.75 7.22386 13.75 7.5C13.75 7.77614 13.5261 8 13.25 8H1.75C1.47386 8 1.25 7.77614 1.25 7.5Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),et=[`color`],tt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,et);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1.99998 0.999976C1.44769 0.999976 0.999976 1.44769 0.999976 1.99998V13C0.999976 13.5523 1.44769 14 1.99998 14H13C13.5523 14 14 13.5523 14 13V1.99998C14 1.44769 13.5523 0.999976 13 0.999976H1.99998ZM1.99998 1.99998L13 1.99998V13H1.99998V1.99998ZM4.49996 3.99996C4.22382 3.99996 3.99996 4.22382 3.99996 4.49996V10.5C3.99996 10.7761 4.22382 11 4.49996 11H10.5C10.7761 11 11 10.7761 11 10.5V4.49996C11 4.22382 10.7761 3.99996 10.5 3.99996H4.49996ZM4.99996 9.99996V4.99996H9.99996V9.99996H4.99996Z`,f
2ill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),nt=[`color`],rt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,nt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M2 3.5C2 3.22386 2.22386 3 2.5 3H12.5C12.7761 3 13 3.22386 13 3.5V9.5C13 9.77614 12.7761 10 12.5 10H2.5C2.22386 10 2 9.77614 2 9.5V3.5ZM2 10.9146C1.4174 10.7087 1 10.1531 1 9.5V3.5C1 2.67157 1.67157 2 2.5 2H12.5C13.3284 2 14 2.67157 14 3.5V9.5C14 10.1531 13.5826 10.7087 13 10.9146V11.5C13 12.3284 12.3284 13 11.5 13H3.5C2.67157 13 2 12.3284 2 11.5V10.9146ZM12 11V11.5C12 11.7761 11.7761 12 11.5 12H3.5C3.22386 12 3 11.7761 3 11.5V11H12Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),it=[`color`],at=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,it);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M4.18179 6.18181C4.35753 6.00608 4.64245 6.00608 4.81819 6.18181L7.49999 8.86362L10.1818 6.18181C10.3575 6.00608 10.6424 6.00608 10.8182 6.18181C10.9939 6.35755 10.9939 6.64247 10.8182 6.81821L7.81819 9.81821C7.73379 9.9026 7.61934 9.95001 7.49999 9.95001C7.38064 9.95001 7.26618 9.9026 7.18179 9.81821L4.18179 6.81821C4.00605 6.64247 4.00605 6.35755 4.18179 6.18181Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),ot=[`color`],st=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,ot);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M8.81809 4.18179C8.99383 4.35753 8.99383 4.64245 8.81809 4.81819L6.13629 7.49999L8.81809 10.1818C8.99383 10.3575 8.99383 10.6424 8.81809 10.8182C8.64236 10.9939 8.35743 10.9939 8.1817 10.8182L5.1817 7.81819C5.09731 7.73379 5.0499 7.61933 5.0499 7.49999C5.0499 7.38064 5.09731 7.26618 5.1817 7.18179L8.1817 4.18179C8.35743 4.00605 8.64236 4.00605 8.81809 4.18179Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),ct=[`color`],lt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,ct);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M6.18194 4.18185C6.35767 4.00611 6.6426 4.00611 6.81833 4.18185L9.81833 7.18185C9.90272 7.26624 9.95013 7.3807 9.95013 7.50005C9.95013 7.6194 9.90272 7.73386 9.81833 7.81825L6.81833 10.8182C6.6426 10.994 6.35767 10.994 6.18194 10.8182C6.0062 10.6425 6.0062 10.3576 6.18194 10.1819L8.86374 7.50005L6.18194 4.81825C6.0062 4.64251 6.0062 4.35759 6.18194 4.18185Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),ut=[`color`],dt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,ut);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),ft=[`color`],pt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,ft);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),mt=[`color`],ht=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,mt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579
2L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),gt=[`color`],_t=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,gt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M0.877075 7.49991C0.877075 3.84222 3.84222 0.877075 7.49991 0.877075C11.1576 0.877075 14.1227 3.84222 14.1227 7.49991C14.1227 11.1576 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1576 0.877075 7.49991ZM7.49991 1.82708C4.36689 1.82708 1.82708 4.36689 1.82708 7.49991C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49991C13.1727 4.36689 10.6329 1.82708 7.49991 1.82708Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),vt=[`color`],yt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,vt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H11.5C12.3284 14 13 13.3284 13 12.5V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM11 2V2.25C11 2.66421 10.6642 3 10.25 3H4.75C4.33579 3 4 2.66421 4 2.25V2H3.5C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V2.5C12 2.22386 11.7761 2 11.5 2H11Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),bt=[`color`],xt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,bt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),St=[`color`],Ct=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,St);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M9.94969 7.49989C9.94969 8.85288 8.85288 9.94969 7.49989 9.94969C6.14691 9.94969 5.0501 8.85288 5.0501 7.49989C5.0501 6.14691 6.14691 5.0501 7.49989 5.0501C8.85288 5.0501 9.94969 6.14691 9.94969 7.49989ZM10.8632 8C10.6213 9.64055 9.20764 10.8997 7.49989 10.8997C5.79214 10.8997 4.37847 9.64055 4.13662 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H4.13659C4.37835 5.35935 5.79206 4.1001 7.49989 4.1001C9.20772 4.1001 10.6214 5.35935 10.8632 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H10.8632Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),wt=[`color`],Tt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,wt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Et=[`color`],Dt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Et);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M5.5 2L4.87935 2C4.47687 1.99999 4.14469 1.99999 3.87409 2.0221C3.59304 2.04506 3.33469 2.09434 3.09202 2.21799C2.7157 2.40973 2.40973 2.7157 2.21799 3.09202C2.09434 3.33469 2.04506 3.59304 2.0221 3.87409C1.99999 4.14468 1.99999 4.47686 2 4.87933V4.87935V5.5C2 5.77614 2.22386 6 2.5 6C2.77614 6 3 5.77614 3 5.5V4.9C3 4.47171 3.00039 4.18056 3.01878 3.95552C3.03669 3.73631 3.06915 3.62421 3.10899 3.54601C3.20487 3.35785 3.35785 3.20487 3.54601 3.10899C3.62421 3.06915 3.73631 3.03669 3.95552 3.01878C4.18056 3.00039 4.47171 3 4.9 3H5.5C5.77614 3 6 2.77614 6 2.5C6 2.22386 5.77614 2 5.5 2ZM13 9.5C13 9.22386 12.7761 9 12.5 9C12.2239 9 12 9.22386 12 9.5V10.1C12 10.5283 11.9996 10.8194 11.9812 11.0445C11.9633 11.2637 11.9309 11.3758 11.891 11.454C11.7951 11.6422 11.6422 11.7951 11.454 11.891C11.3758 11.9309 11.2637 11.9633 11.0445 11.9812C10.8194 11.9996 10.5283 12 10.1 12H9.5C9.22386 12 9 12.2239 9 12.5C9 12.7761 9.22386 13 9.5 13H10.1206C10.5231 13 10.8553 13 11.1259 12.9779C11.407 12.9549 11.6653 12.9057 11.908 12.782C12.2843 12.5903 12.5903 12.2843 12.782 11.908C12.9057 11.6653 12.9549 11.407 12.9779 11.1259C13 10.8553 13 10.5232 13 10.1207V10.1207V10.1207V10.1206V9.5ZM2.5 9C2.77614 9 3 9.22386 3 9.5V10.1C3 10.5283 3.00039 10.8194 3.01878 11.0445C3.03669 11.2637 3.06915 11.3758 3.10899 11.454C3.20487 11.6422 3.35785 11.7951 3.54601 11.891C3.62421 11.9309 3.73631 11.9633 3.95552 11.9812C4.18056 11.9996 4.47171 12 4.9 12H5.5C5.77614 12 6 12.2239 6 12.5C6 12.7761 5.77614 13 5.5 13H4.87935C4.47687 13 4.14469 13 3.87409 12.9779C3.59304 12.9549 3.33469 12.9057 3.09202 12.782C2.7157 12.5903 2.40973 12.2843 2.21799 11.908C2.09434 11.6653 2.04506 11.407 2.0221 11.
21259C1.99999 10.8553 1.99999 10.5231 2 10.1207V10.1206V10.1V9.5C2 9.22386 2.22386 9 2.5 9ZM10.1 3C10.5283 3 10.8194 3.00039 11.0445 3.01878C11.2637 3.03669 11.3758 3.06915 11.454 3.10899C11.6422 3.20487 11.7951 3.35785 11.891 3.54601C11.9309 3.62421 11.9633 3.73631 11.9812 3.95552C11.9996 4.18056 12 4.47171 12 4.9V5.5C12 5.77614 12.2239 6 12.5 6C12.7761 6 13 5.77614 13 5.5V4.87935V4.87934C13 4.47686 13 4.14468 12.9779 3.87409C12.9549 3.59304 12.9057 3.33469 12.782 3.09202C12.5903 2.7157 12.2843 2.40973 11.908 2.21799C11.6653 2.09434 11.407 2.04506 11.1259 2.0221C10.8553 1.99999 10.5231 1.99999 10.1206 2L10.1 2H9.5C9.22386 2 9 2.22386 9 2.5C9 2.77614 9.22386 3 9.5 3H10.1Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Ot=[`color`],kt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Ot);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),At=[`color`],jt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,At);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Mt=[`color`],Nt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Mt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Pt=[`color`],Ft=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Pt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M0.877075 7.50207C0.877075 3.84319 3.84319 0.877075 7.50208 0.877075C11.1609 0.877075 14.1271 3.84319 14.1271 7.50207C14.1271 11.1609 11.1609 14.1271 7.50208 14.1271C3.84319 14.1271 0.877075 11.1609 0.877075 7.50207ZM1.84898 7.00003C2.0886 4.26639 4.26639 2.0886 7.00003 1.84898V4.50003C7.00003 4.77617 7.22388 5.00003 7.50003 5.00003C7.77617 5.00003 8.00003 4.77617 8.00003 4.50003V1.84862C10.7356 2.08643 12.9154 4.26502 13.1552 7.00003H10.5C10.2239 7.00003 10 7.22388 10 7.50003C10 7.77617 10.2239 8.00003 10.5 8.00003H13.1555C12.9176 10.7369 10.7369 12.9176 8.00003 13.1555V10.5C8.00003 10.2239 7.77617 10 7.50003 10C7.22388 10 7.00003 10.2239 7.00003 10.5V13.1552C4.26502 12.9154 2.08643 10.7356 1.84862 8.00003H4.50003C4.77617 8.00003 5.00003 7.77617 5.00003 7.50003C5.00003 7.22388 4.77617 7.00003 4.50003 7.00003H1.84898Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),It=[`color`],Lt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,It);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M3.29227 0.048984C3.47033 -0.032338 3.67946 -0.00228214 3.8274 0.125891L12.8587 7.95026C13.0134 8.08432 13.0708 8.29916 13.0035 8.49251C12.9362 8.68586 12.7578 8.81866 12.5533 8.82768L9.21887 8.97474L11.1504 13.2187C11.2648 13.47 11.1538 13.7664 10.9026 13.8808L8.75024 14.8613C8.499 14.9758 8.20255 14.8649 8.08802 14.6137L6.15339 10.3703L3.86279 12.7855C3.72196 12.934 3.50487 12.9817 3.31479 12.9059C3.1247 12.8301 3 12.6461 3 12.4414V0.503792C3 0.308048 3.11422 0.130306 3.29227 0.048984ZM4 1.59852V11.1877L5.93799 9.14425C6.05238 9.02363 6.21924 8.96776 6.38319 8.99516C6.54715 9.02256 6.68677 9.12965 6.75573 9.2809L8.79056 13.7441L10.0332 13.178L8.00195 8.71497C7.93313 8.56376 7.94391 8.38824 8.03072 8.24659C8.11753 8.10494 8.26903 8.01566 8.435 8.00834L11.2549 7.88397L4 1.59852Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Rt=[`color`],zt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Rt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.5 9.125C8.39746 9.125 9.125 8.39746 9.125 7.5C9.125 6.60254 8.39746 5.875 7.5 5.875C6.60254 5.875 5.875 6.60254 5.875 7.5C5.875 8.39746 6.60254 9.125 7.5 9.125ZM7.5 10.125C8.94975 10.125 10.125 8.94975 10.125 7.5C10.125 6.05025 8.94975 4.875 7.5 4.875C6.05025 4.875 4.875 6.05025 4.875 7.5C4.875 8.94975 6.05025 10.125 7.5 10.125Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Bt=[`color`],Vt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Bt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z`,fill:r}))}),Ht=[`color`],Ut=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Ht);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Wt=[`color`],Gt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Wt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M3.85355 2.14645C3.65829 1.95118 3.34171 1.95118 3.14645 2.14645C2.95118 2.34171 2.95118 2.65829 3.14645 2.85355L7.14645 6.85355C7.34171 7.04882 7.65829 7.04882 7.85355 6.85355L11.8536 2.85355C12.0488 2.65829 12.0488 2.34171 11.8536 2.14645C11.6583 1.95118 11.3417 1.95118 11.1464 2.14645L7.5 5.79289L3.85355 2.14645ZM3.85355 8.14645C3.65829 7.95118 3.34171 7.95118 3.14645 8.14645C2.95118 8.34171 2.95118 8.65829 3.14645 8.85355L7.14645 12.8536C7.34171 13.0488 7.65829 13.0488 7.85355 12.8536L11.8536 8.85355C12.0488 8.65829 12.0488 8.34171 11.8536 8.14645C11.6583 7.95118 11.3417 7.95118 11.1464 8.14645L7.5 11.7929L3.85355 8.14645Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Kt=[`color`],qt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Kt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M11.1464 6.85355C11.3417 7.04882 11.6583 7.04882 11.8536 6.85355C12.0488 6.65829 12.0488 6.34171 11.8536 6.14645L7.85355 2.14645C7.65829 1.95118 7.34171 1.95118 7.14645 2.14645L3.14645 6.14645C2.95118 6.34171 2.95118 6.65829 3.14645 6.85355C3.34171 7.04882 3.65829 7.04882 3.85355 6.85355L7.5 3.20711L11.1464 6.85355ZM11.1464 12.8536C11.3417 13.0488 11.6583 13.0488 11.8536 12.8536C12.0488 12.6583 12.0488 12.3417 11.8536 12.1464L7.85355 8.14645C7.65829 7.95118 7.34171 7.95118 7.14645 8.14645L3.14645 12.1464C2.95118 12.3417 2.95118 12.6583 3.14645 12.8536C3.34171 13.0488 3.65829 13.0488 3.85355 12.8536L7.5 9.20711L11.1464 12.8536Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Jt=[`color`],Yt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Jt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.8
21819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Xt=[`color`],Zt=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Xt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M5.5 4.625C6.12132 4.625 6.625 4.12132 6.625 3.5C6.625 2.87868 6.12132 2.375 5.5 2.375C4.87868 2.375 4.375 2.87868 4.375 3.5C4.375 4.12132 4.87868 4.625 5.5 4.625ZM9.5 4.625C10.1213 4.625 10.625 4.12132 10.625 3.5C10.625 2.87868 10.1213 2.375 9.5 2.375C8.87868 2.375 8.375 2.87868 8.375 3.5C8.375 4.12132 8.87868 4.625 9.5 4.625ZM10.625 7.5C10.625 8.12132 10.1213 8.625 9.5 8.625C8.87868 8.625 8.375 8.12132 8.375 7.5C8.375 6.87868 8.87868 6.375 9.5 6.375C10.1213 6.375 10.625 6.87868 10.625 7.5ZM5.5 8.625C6.12132 8.625 6.625 8.12132 6.625 7.5C6.625 6.87868 6.12132 6.375 5.5 6.375C4.87868 6.375 4.375 6.87868 4.375 7.5C4.375 8.12132 4.87868 8.625 5.5 8.625ZM10.625 11.5C10.625 12.1213 10.1213 12.625 9.5 12.625C8.87868 12.625 8.375 12.1213 8.375 11.5C8.375 10.8787 8.87868 10.375 9.5 10.375C10.1213 10.375 10.625 10.8787 10.625 11.5ZM5.5 12.625C6.12132 12.625 6.625 12.1213 6.625 11.5C6.625 10.8787 6.12132 10.375 5.5 10.375C4.87868 10.375 4.375 10.8787 4.375 11.5C4.375 12.1213 4.87868 12.625 5.5 12.625Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Qt=[`color`],$t=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Qt);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),en=[`color`],tn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,en);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),nn=[`color`],rn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,nn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),an=[`color`],on=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,an);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M3.5 2C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V6H8.5C8.22386 6 8 5.77614 8 5.5V2H3.5ZM9 2.70711L11.2929 5H9V2.70711ZM2 2.5C2 1.67157 2.67157 1 3.5 1H8.5C8.63261 1 8.75979 1.05268 8.85355 1.14645L12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5V12.5C13 13.3284 12.3284 14 11.5 14H3.5C2.67157 14 2 13.3284 2 12.5V2.5Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),sn=[`color`],cn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,sn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M3 2.5C3 2.22386 3.22386 2 3.5 2H9.08579C9.21839 2 9.34557 2.05268 9.43934 2.14645L11.8536 4.56066C11.9473 4.65443 12 4.78161 12 4.91421V12.5C12 12.7761 11.7761 13 11.5 13H3.5C3.22386 13 3 12.7761 3 12.5V2.5ZM3.5 1C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H11.5C12.3284 14 13 13.3284 13 12.5V4.91421C13 4.51639 12.842 4.13486 12.5607 3.85355L10.1464 1.43934C9.86514 1.15804 9.48361 1 9.08579 1H3.5ZM4.5 4C4.22386 4 4 4.22386 4 4.5C4 4.77614 4.22386 5 4.5 5H7.5C7.77614 5 8 4.77614 8 4.5C8 4.22386 7.77614 4 7.5 4H4.5ZM4.5 7C4.22386 7 4 7.22386 4 7.5C4 7.77614 4.22386 8 4.5 8H10.5C10.7761 8 11 7.77614 11 7.5C11 7.22386 10.7761 7 10.5 7H4.5ZM4.5 10C4.22386 10 4 10.2239 4 10.5C4 10.7761 4.22386 11 4.5 11H10.5C10.7761 11 11 10.7761 11 10.5C11 10.2239 10.7761 10 10.5 10H4.5Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),ln=[`color`],un=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,ln);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}
2),(0,B.createElement)(`path`,{d:`M7.07095 0.650238C6.67391 0.650238 6.32977 0.925096 6.24198 1.31231L6.0039 2.36247C5.6249 2.47269 5.26335 2.62363 4.92436 2.81013L4.01335 2.23585C3.67748 2.02413 3.23978 2.07312 2.95903 2.35386L2.35294 2.95996C2.0722 3.2407 2.0232 3.6784 2.23493 4.01427L2.80942 4.92561C2.62307 5.2645 2.47227 5.62594 2.36216 6.00481L1.31209 6.24287C0.924883 6.33065 0.650024 6.6748 0.650024 7.07183V7.92897C0.650024 8.32601 0.924883 8.67015 1.31209 8.75794L2.36228 8.99603C2.47246 9.375 2.62335 9.73652 2.80979 10.0755L2.2354 10.9867C2.02367 11.3225 2.07267 11.7602 2.35341 12.041L2.95951 12.6471C3.24025 12.9278 3.67795 12.9768 4.01382 12.7651L4.92506 12.1907C5.26384 12.377 5.62516 12.5278 6.0039 12.6379L6.24198 13.6881C6.32977 14.0753 6.67391 14.3502 7.07095 14.3502H7.92809C8.32512 14.3502 8.66927 14.0753 8.75705 13.6881L8.99505 12.6383C9.37411 12.5282 9.73573 12.3773 10.0748 12.1909L10.986 12.7653C11.3218 12.977 11.7595 12.928 12.0403 12.6473L12.6464 12.0412C12.9271 11.7604 12.9761 11.3227 12.7644 10.9869L12.1902 10.076C12.3768 9.73688 12.5278 9.37515 12.638 8.99596L13.6879 8.75794C14.0751 8.67015 14.35 8.32601 14.35 7.92897V7.07183C14.35 6.6748 14.0751 6.33065 13.6879 6.24287L12.6381 6.00488C12.528 5.62578 12.3771 5.26414 12.1906 4.92507L12.7648 4.01407C12.9766 3.6782 12.9276 3.2405 12.6468 2.95975L12.0407 2.35366C11.76 2.07292 11.3223 2.02392 10.9864 2.23565L10.0755 2.80989C9.73622 2.62328 9.37437 2.47229 8.99505 2.36209L8.75705 1.31231C8.66927 0.925096 8.32512 0.650238 7.92809 0.650238H7.07095ZM4.92053 3.81251C5.44724 3.44339 6.05665 3.18424 6.71543 3.06839L7.07095 1.50024H7.92809L8.28355 3.06816C8.94267 3.18387 9.5524 3.44302 10.0794 3.81224L11.4397 2.9547L12.0458 3.56079L11.1882 4.92117C11.5573 5.44798 11.8164 6.0575 11.9321 6.71638L13.5 7.07183V7.92897L11.932 8.28444C11.8162 8.94342 11.557 9.55301 11.1878 10.0798L12.0453 11.4402L11.4392 12.0462L10.0787 11.1886C9.55192 11.5576 8.94241 11.8166 8.28355 11.9323L7.92809 13.5002H7.07095L6.71543 11.932C6.0569 11.8162 5.44772 11.5572 4.92116 11.1883L3.56055 12.046L2.95445 11.4399L3.81213 10.0794C3.4431 9.55266 3.18403 8.94326 3.06825 8.2845L1.50002 7.92897V7.07183L3.06818 6.71632C3.18388 6.05765 3.44283 5.44833 3.81171 4.92165L2.95398 3.561L3.56008 2.95491L4.92053 3.81251ZM9.02496 7.50008C9.02496 8.34226 8.34223 9.02499 7.50005 9.02499C6.65786 9.02499 5.97513 8.34226 5.97513 7.50008C5.97513 6.65789 6.65786 5.97516 7.50005 5.97516C8.34223 5.97516 9.02496 6.65789 9.02496 7.50008ZM9.92496 7.50008C9.92496 8.83932 8.83929 9.92499 7.50005 9.92499C6.1608 9.92499 5.07513 8.83932 5.07513 7.50008C5.07513 6.16084 6.1608 5.07516 7.50005 5.07516C8.83929 5.07516 9.92496 6.16084 9.92496 7.50008Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),dn=[`color`],fn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,dn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.49933 0.25C3.49635 0.25 0.25 3.49593 0.25 7.50024C0.25 10.703 2.32715 13.4206 5.2081 14.3797C5.57084 14.446 5.70302 14.2222 5.70302 14.0299C5.70302 13.8576 5.69679 13.4019 5.69323 12.797C3.67661 13.235 3.25112 11.825 3.25112 11.825C2.92132 10.9874 2.44599 10.7644 2.44599 10.7644C1.78773 10.3149 2.49584 10.3238 2.49584 10.3238C3.22353 10.375 3.60629 11.0711 3.60629 11.0711C4.25298 12.1788 5.30335 11.8588 5.71638 11.6732C5.78225 11.205 5.96962 10.8854 6.17658 10.7043C4.56675 10.5209 2.87415 9.89918 2.87415 7.12104C2.87415 6.32925 3.15677 5.68257 3.62053 5.17563C3.54576 4.99226 3.29697 4.25521 3.69174 3.25691C3.69174 3.25691 4.30015 3.06196 5.68522 3.99973C6.26337 3.83906 6.8838 3.75895 7.50022 3.75583C8.1162 3.75895 8.73619 3.83906 9.31523 3.99973C10.6994 3.06196 11.3069 3.25691 11.3069 3.25691C11.7026 4.25521 11.4538 4.99226 11.3795 5.17563C11.8441 5.68257 12.1245 6.32925 12.1245 7.12104C12.1245 9.9063 10.4292 10.5192 8.81452 10.6985C9.07444 10.9224 9.30633 11.3648 9.30633 12.0413C9.30633 13.0102 9.29742 13.7922 9.29742 14.0299C9.29742 14.2239 9.42828 14.4496 9.79591 14.3788C12.6746 13.4179 14.75 10.7025 14.75 7.50024C14.75 3.49593 11.5036 0.25 7.49933 0.25Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),pn=[`color`],mn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,pn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.49996 1.80002C4.35194 1.80002 1.79996 4.352 1.79996 7.50002C1.79996 10.648 4.35194 13.2 7.49996 13.2C10.648 13.2 13.2 10.648 13.2 7.50002C13.2 4.352 10.648 1.80002 7.49996 1.80002ZM0.899963 7.50002C0.899963 3.85494 3.85488 0.900024 7.49996 0.900024C11.145 0.900024 14.1 3.85494 14.1 7.50002C14.1 11.1451 11.145 14.1 7.49996 14.1C3.85488 14.1 0.899963 11.1451 0.899963 7.50002Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}),(0,B.createElement)(`path`,{d:`M13.4999 7.89998H1.49994V7.09998H13.4999V7.89998Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}),(0,B.createElement)(`path`,{d:`M7.09991 13.5V1.5H7.89991V13.5H7.09991zM10.375 7.49998C10.375 5.32724 9.59364 3.17778 8.06183 1.75656L8.53793 1.24341C10.2396 2.82218 11.075 5.17273 11.075 7.49998 11.075 9.82724 10.2396 12.1778 8.53793 13.7566L8.06183 13.2434C9.59364 11.8222 10.375 9.67273 10.375 7.49998zM3.99969 7.5C3.99969 5.17611 4.80786 2.82678 6.45768 1.24719L6.94177 1.75281C5.4582 3.17323 4.69969 5.32389 4.69969 7.5 4.6997 9.67611 5.45822 11.8268 6.94179 13.2472L6.45769 13.7528C4.80788 12.1732 3.9997 9.8239 3.99969 7.5z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}),(0,B.createElement)(`path`,{d:`M7.49996 3.95801C9.66928 3.95801 11.8753 4.35915 13.3706 5.19448 13.5394 5.28875 13.5998 5.50197 13.5055 5.67073 13.4113 5.83948 13.198 5.89987 13.0293 5.8056 11.6794 5.05155 9.60799 4.65801 7.49996 4.65801 5.39192 4.65801 3.32052 5.05155 1.97064 5.8056 1.80188 5.89987 1.58866 5.83948 1.49439 5.67073 1.40013 5.50197 1.46051 5.28875 1.62927 5.19448 3.12466 4.35915 5.33063 3.95801 7.49996 3.95801zM7.49996 10.85C9.66928 10.85 11.8753 10.4488 13.3706 9.6135 13.5394 9.51924 13.5998 9.30601 13.5055 9.13726 13.4113 8.9685 13.198 8.90812 13.0293 9.00238 11.6794 9.75643 9.60799 10.15 7.49996 10.15 5.39192 10.15 3.32052 9.75643 1.97064 9.00239 1.80188 8.90812 1.58866 8.9685 1.49439 9.13726 1.40013 9.30601 1.46051 9.51924 1.62927 9.6135 3.12466 10.4488 5.33063 10.85 7.49996 10.85z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),hn=[`color`],gn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,hn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1.44995 0.949951C1.31734 0.949951 1.19016 1.00263 1.0964 1.0964C1.00263 1.19017 0.949951 1.31735 0.949951 1.44995L0.949966 3.44995C0.9499
269 3.7261 1.17383 3.94995 1.44997 3.94995C1.72611 3.94995 1.94997 3.72609 1.94997 3.44995L1.94995 1.94995H3.44997C3.72611 1.94995 3.94997 1.72609 3.94997 1.44995C3.94997 1.17381 3.72611 0.949951 3.44997 0.949951H1.44995ZM5.94995 0.949951C5.67381 0.949951 5.44995 1.17381 5.44995 1.44995C5.44995 1.72609 5.67381 1.94995 5.94995 1.94995H8.94995C9.22609 1.94995 9.44995 1.72609 9.44995 1.44995C9.44995 1.17381 9.22609 0.949951 8.94995 0.949951H5.94995ZM5.44995 13.45C5.44995 13.1738 5.67381 12.95 5.94995 12.95H8.94995C9.22609 12.95 9.44995 13.1738 9.44995 13.45C9.44995 13.7261 9.22609 13.95 8.94995 13.95H5.94995C5.67381 13.95 5.44995 13.7261 5.44995 13.45ZM1.94995 5.94995C1.94995 5.67381 1.72609 5.44995 1.44995 5.44995C1.17381 5.44995 0.949951 5.67381 0.949951 5.94995V8.94995C0.949951 9.22609 1.17381 9.44995 1.44995 9.44995C1.72609 9.44995 1.94995 9.22609 1.94995 8.94995V5.94995ZM13.45 5.44995C13.7261 5.44995 13.95 5.67381 13.95 5.94995V8.94995C13.95 9.22609 13.7261 9.44995 13.45 9.44995C13.1738 9.44995 12.95 9.22609 12.95 8.94995V5.94995C12.95 5.67381 13.1738 5.44995 13.45 5.44995ZM11.45 0.949951C11.1738 0.949951 10.95 1.17381 10.95 1.44995C10.95 1.72609 11.1738 1.94995 11.45 1.94995H12.9499V3.44995C12.9499 3.72609 13.1738 3.94995 13.4499 3.94995C13.7261 3.94995 13.9499 3.72609 13.9499 3.44995V1.44995C13.9499 1.17381 13.7252 0.949951 13.449 0.949951H11.45ZM1.44995 10.95C1.72609 10.95 1.94995 11.1738 1.94995 11.45V12.95H3.44997C3.72611 12.95 3.94997 13.1738 3.94997 13.45C3.94997 13.7261 3.72611 13.95 3.44997 13.95H1.44995C1.17381 13.95 0.949951 13.7261 0.949951 13.45V11.45C0.949951 11.1738 1.17381 10.95 1.44995 10.95ZM13.95 11.45C13.95 11.1738 13.7261 10.95 13.45 10.95C13.1738 10.9499 12.95 11.1738 12.95 11.4499L12.9491 12.95H11.45C11.1738 12.95 10.95 13.1738 10.95 13.45C10.95 13.7261 11.1738 13.95 11.45 13.95H13.4499C13.7261 13.95 13.9499 13.7261 13.9499 13.45L13.95 11.45Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),_n=[`color`],vn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,_n);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),yn=[`color`],bn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,yn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M6.5 1C6.22386 1 6 1.22386 6 1.5C6 1.77614 6.22386 2 6.5 2C7.12671 2 7.45718 2.20028 7.65563 2.47812C7.8781 2.78957 8 3.28837 8 4V11C8 11.7116 7.8781 12.2104 7.65563 12.5219C7.45718 12.7997 7.12671 13 6.5 13C6.22386 13 6 13.2239 6 13.5C6 13.7761 6.22386 14 6.5 14C7.37329 14 8.04282 13.7003 8.46937 13.1031C8.47976 13.0886 8.48997 13.0739 8.5 13.0591C8.51003 13.0739 8.52024 13.0886 8.53063 13.1031C8.95718 13.7003 9.62671 14 10.5 14C10.7761 14 11 13.7761 11 13.5C11 13.2239 10.7761 13 10.5 13C9.87329 13 9.54282 12.7997 9.34437 12.5219C9.1219 12.2104 9 11.7116 9 11V4C9 3.28837 9.1219 2.78957 9.34437 2.47812C9.54282 2.20028 9.87329 2 10.5 2C10.7761 2 11 1.77614 11 1.5C11 1.22386 10.7761 1 10.5 1C9.62671 1 8.95718 1.29972 8.53063 1.89688C8.52024 1.91143 8.51003 1.92611 8.5 1.9409C8.48997 1.92611 8.47976 1.91143 8.46937 1.89688C8.04282 1.29972 7.37329 1 6.5 1ZM14 5H11V4H14C14.5523 4 15 4.44772 15 5V10C15 10.5523 14.5523 11 14 11H11V10H14V5ZM6 4V5H1L1 10H6V11H1C0.447715 11 0 10.5523 0 10V5C0 4.44772 0.447715 4 1 4H6Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),xn=[`color`],Sn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,xn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.5 4H1.5C1.22386 4 1 4.22386 1 4.5V10.5C1 10.7761 1.22386 11 1.5 11H13.5C13.7761 11 14 10.7761 14 10.5V4.5C14 4.22386 13.7761 4 13.5 4ZM1.5 3C0.671573 3 0 3.67157 0 4.5V10.5C0 11.3284 0.671573 12 1.5 12H13.5C14.3284 12 15 11.3284 15 10.5V4.5C15 3.67157 14.3284 3 13.5 3H1.5ZM2 5H3V6H2V5ZM5 5H4V6H5V5ZM6 5H7V6H6V5ZM9 5H8V6H9V5ZM10 5H11V6H10V5ZM13 5H12V6H13V5Z
2M11 7H12V8H11V7ZM13 9H12V10H13V9ZM9 7H10V8H9V7ZM8 7H7V8H8V7ZM5 7H6V8H5V7ZM4 7H3V8H4V7ZM2 9H3V10H2V9ZM11 9H4V10H11V9Z`,fill:r}))}),Cn=[`color`],wn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Cn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.75432 0.819537C7.59742 0.726821 7.4025 0.726821 7.24559 0.819537L1.74559 4.06954C1.59336 4.15949 1.49996 4.32317 1.49996 4.5C1.49996 4.67683 1.59336 4.84051 1.74559 4.93046L7.24559 8.18046C7.4025 8.27318 7.59742 8.27318 7.75432 8.18046L13.2543 4.93046C13.4066 4.84051 13.5 4.67683 13.5 4.5C13.5 4.32317 13.4066 4.15949 13.2543 4.06954L7.75432 0.819537ZM7.49996 7.16923L2.9828 4.5L7.49996 1.83077L12.0171 4.5L7.49996 7.16923ZM1.5695 7.49564C1.70998 7.2579 2.01659 7.17906 2.25432 7.31954L7.49996 10.4192L12.7456 7.31954C12.9833 7.17906 13.2899 7.2579 13.4304 7.49564C13.5709 7.73337 13.4921 8.03998 13.2543 8.18046L7.75432 11.4305C7.59742 11.5232 7.4025 11.5232 7.24559 11.4305L1.74559 8.18046C1.50786 8.03998 1.42901 7.73337 1.5695 7.49564ZM1.56949 10.4956C1.70998 10.2579 2.01658 10.1791 2.25432 10.3195L7.49996 13.4192L12.7456 10.3195C12.9833 10.1791 13.2899 10.2579 13.4304 10.4956C13.5709 10.7334 13.4921 11.04 13.2543 11.1805L7.75432 14.4305C7.59742 14.5232 7.4025 14.5232 7.24559 14.4305L1.74559 11.1805C1.50785 11.04 1.42901 10.7334 1.56949 10.4956Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Tn=[`color`],En=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Tn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M9 2H6V13H9V2ZM10 2V13H12.5C12.7761 13 13 12.7761 13 12.5V2.5C13 2.22386 12.7761 2 12.5 2H10ZM2.5 2H5V13H2.5C2.22386 13 2 12.7761 2 12.5V2.5C2 2.22386 2.22386 2 2.5 2ZM2.5 1C1.67157 1 1 1.67157 1 2.5V12.5C1 13.3284 1.67157 14 2.5 14H12.5C13.3284 14 14 13.3284 14 12.5V2.5C14 1.67157 13.3284 1 12.5 1H2.5Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Dn=[`color`],On=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Dn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M4.50021 0C4.77635 0 5.0002 0.223853 5.0002 0.49999V2.49995C5.0002 2.77609 4.77635 2.99994 4.50021 2.99994C4.22408 2.99994 4.00022 2.77609 4.00022 2.49995V0.49999C4.00022 0.223853 4.22408 0 4.50021 0ZM0.646451 0.64647C0.84171 0.451212 1.15829 0.451212 1.35354 0.64647L2.85351 2.14644C3.04877 2.3417 3.04877 2.65827 2.85351 2.85353C2.65826 3.04879 2.34168 3.04879 2.14642 2.85353L0.646452 1.35356C0.451193 1.1583 0.451193 0.841728 0.646451 0.64647ZM0.00030517 4.49991C0.00030517 4.22377 0.224158 3.99992 0.500295 3.99992H2.50025C2.77639 3.99992 3.00024 4.22377 3.00024 4.49991C3.00024 4.77605 2.77639 4.9999 2.50025 4.9999H0.500295C0.224158 4.9999 0.00030517 4.77605 0.00030517 4.49991ZM12.0001 10.4998C12.0001 10.2236 12.2239 9.9998 12.5001 9.9998H14.5C14.7761 9.9998 15 10.2236 15 10.4998C15 10.7759 14.7761 10.9998 14.5 10.9998H12.5001C12.2239 10.9998 12.0001 10.7759 12.0001 10.4998ZM10.5001 11.9998C10.7762 11.9998 11.0001 12.2236 11.0001 12.4997V14.4997C11.0001 14.7758 10.7762 14.9997 10.5001 14.9997C10.224 14.9997 10.0001 14.7758 10.0001 14.4997V12.4997C10.0001 12.2236 10.224 11.9998 10.5001 11.9998ZM12.1462 12.1462C12.3415 11.951 12.658 11.951 12.8533 12.1462L14.3533 13.6462C14.5485 13.8415 14.5485 14.158 14.3533 14.3533C14.158 14.5485 13.8414 14.5485 13.6462 14.3533L12.1462 12.8533C11.951 12.6581 11.951 12.3415 12.1462 12.1462ZM7.76478 3.69938C8.19177 3.27238 8.35724 3.11008 8.5116 3.00522C9.18794 2.54577 10.0431 2.53677 10.6784 2.95401C10.8227 3.04875 10.9767 3.19911 11.3886 3.61099C11.8005 4.02287 11.9509 4.17694 12.0456 4.3212C12.4628 4.95653 12.4539 5.81168 11.9944 6.48802C11.8895 6.64238 11.7272 6.80785 11.3002 7.23484L10.6815 7.85354C10.4863 8.0488 10.4863 8.36538 10.6815 8.56064C10.8768 8.75589 11.1934 8.75589 11.3886 8.56064L12.0073 7.94193L12.0502 7.89903C12.4199 7.5295 12.6564 7.29303 12.8216 7.04993
2C13.4968 6.05598 13.5316 4.7623 12.8815 3.77228C12.7229 3.53083 12.4918 3.29982 12.1404 2.94853L12.0957 2.9039L12.0511 2.85925C11.6998 2.50782 11.4688 2.27672 11.2273 2.11816C10.2373 1.46798 8.94364 1.50284 7.94968 2.17805C7.70659 2.34319 7.47012 2.57973 7.1006 2.94936L7.1006 2.94937L7.05769 2.99228L6.43898 3.61099C6.24372 3.80625 6.24372 4.12282 6.43898 4.31808C6.63424 4.51334 6.95081 4.51334 7.14607 4.31808L7.76478 3.69938ZM2.99191 7.05807L2.94899 7.10097C2.57935 7.4705 2.34282 7.70697 2.17767 7.95006C1.50246 8.94401 1.4676 10.2377 2.11778 11.2277C2.27634 11.4692 2.50744 11.7002 2.85886 12.0515L2.85888 12.0515L2.90352 12.0961L2.94815 12.1407L2.94815 12.1407L2.94817 12.1408C3.29945 12.4922 3.53045 12.7233 3.7719 12.8818C4.76193 13.532 6.0556 13.4972 7.04956 12.8219C7.29265 12.6568 7.52912 12.4203 7.89865 12.0506L7.94155 12.0077L8.56026 11.389C8.75552 11.1937 8.75552 10.8772 8.56026 10.6819C8.365 10.4867 8.04842 10.4867 7.85317 10.6819L7.23446 11.3006C6.80747 11.7276 6.642 11.8899 6.48764 11.9948C5.8113 12.4542 4.95615 12.4632 4.32082 12.046C4.17656 11.9512 4.02249 11.8009 3.61061 11.389C3.19873 10.9771 3.04837 10.8231 2.95363 10.6788C2.53639 10.0435 2.54539 9.18832 3.00484 8.51198C3.10971 8.35761 3.27201 8.19215 3.699 7.76516L4.3177 7.14645C4.51296 6.95119 4.51296 6.63462 4.3177 6.43936C4.12245 6.2441 3.80587 6.2441 3.61061 6.43936L2.99191 7.05807Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),kn=[`color`],An=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,kn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M10.6788 2.95419C10.0435 2.53694 9.18829 2.54594 8.51194 3.00541C8.35757 3.11027 8.1921 3.27257 7.7651 3.69957L7.14638 4.31829C6.95112 4.51355 6.63454 4.51355 6.43928 4.31829C6.24401 4.12303 6.24401 3.80645 6.43928 3.61119L7.058 2.99247C7.0725 2.97797 7.08679 2.96366 7.1009 2.94955C7.47044 2.57991 7.70691 2.34336 7.95001 2.17822C8.94398 1.50299 10.2377 1.46813 11.2277 2.11832C11.4692 2.27689 11.7002 2.508 12.0515 2.85942C12.0662 2.8741 12.081 2.88898 12.0961 2.90408C12.1112 2.91917 12.1261 2.93405 12.1408 2.94871C12.4922 3.30001 12.7233 3.53102 12.8819 3.77248C13.5321 4.76252 13.4972 6.05623 12.822 7.0502C12.6568 7.2933 12.4203 7.52976 12.0507 7.89929C12.0366 7.9134 12.0222 7.92771 12.0077 7.94221L11.389 8.56093C11.1938 8.7562 10.8772 8.7562 10.6819 8.56093C10.4867 8.36567 10.4867 8.04909 10.6819 7.85383L11.3006 7.23511C11.7276 6.80811 11.8899 6.64264 11.9948 6.48827C12.4543 5.81192 12.4633 4.95675 12.046 4.32141C11.9513 4.17714 11.8009 4.02307 11.389 3.61119C10.9771 3.1993 10.8231 3.04893 10.6788 2.95419ZM4.31796 6.43961C4.51322 6.63487 4.51322 6.95146 4.31796 7.14672L3.69924 7.76544C3.27224 8.19244 3.10993 8.35791 3.00507 8.51227C2.54561 9.18863 2.53661 10.0438 2.95385 10.6791C3.0486 10.8234 3.19896 10.9775 3.61085 11.3894C4.02274 11.8012 4.17681 11.9516 4.32107 12.0464C4.95642 12.4636 5.81158 12.4546 6.48794 11.9951C6.6423 11.8903 6.80777 11.728 7.23477 11.301L7.85349 10.6823C8.04875 10.487 8.36533 10.487 8.5606 10.6823C8.75586 10.8775 8.75586 11.1941 8.5606 11.3894L7.94188 12.0081C7.92738 12.0226 7.91307 12.0369 7.89897 12.051C7.52943 12.4206 7.29296 12.6572 7.04986 12.8223C6.05589 13.4976 4.76219 13.5324 3.77214 12.8822C3.53068 12.7237 3.29967 12.4925 2.94837 12.1411C2.93371 12.1264 2.91883 12.1116 2.90374 12.0965C2.88865 12.0814 2.87377 12.0665 2.8591 12.0518C2.50766 11.7005 2.27656 11.4695 2.11799 11.2281C1.4678 10.238 1.50265 8.94432 2.17788 7.95035C2.34303 7.70724 2.57957 7.47077 2.94922 7.10124C2.96333 7.08713 2.97763 7.07283 2.99213 7.05833L3.61085 6.43961C3.80611 6.24435 4.12269 6.24435 4.31796 6.43961Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),jn=[`color`],Mn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,jn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Nn=[`color`],Pn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Nn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Fn=[`color`],In=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Fn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Ln=[`color`],Rn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Ln);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1 1C0.447715 1 0 1.44772 0 2V13C0 13.5523 0.447715 14 1 14H14C14.5523 14 15 13.5523 15 13V2C15 1.44772 14.5523 1 14 1H1ZM7.5 10.625C9.22589 10.625 10.625 9.22589 10.625 7.5C10.625 5.77411 9.22589 4.375 7.5 4.375C5.77411 4.375 4.375 5.77411 4.375 7.5C4.375 9.22589 5.77411 10.625 7.5 10.625Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),zn=[`color`],Bn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,zn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M2.14921 3.99996C2.14921 2.97778 2.97784 2.14915 4.00002 2.14915C5.02219 2.14915 5.85083 2.97778 5.85083 3.99996C5.85083 5.02213 5.02219 5.85077 4.00002 5.85077C2.97784 5.85077 2.14921 5.02213 2.14921 3.99996ZM4.00002 1.24915C2.48079 1.24915 1.24921 2.48073 1.24921 3.99996C1.24921 5.51919 2.48079 6.75077 4.00002 6.75077C5.51925 6.75077 6.75083 5.51919 6.75083 3.99996C6.75083 2.48073 5.51925 1.24915 4.00002 1.24915ZM5.82034 11.0001L2.49998 12.8369V9.16331L5.82034 11.0001ZM2.63883 8.21159C2.17228 7.9535 1.59998 8.29093 1.59998 8.82411V13.1761C1.59998 13.7093 2.17228 14.0467 2.63883 13.7886L6.57235 11.6126C7.05389 11.3462 7.05389 10.654 6.57235 10.3876L2.63883 8.21159ZM8.30001 9.00003C8.30001 8.61343 8.61341 8.30003 9.00001 8.30003H13C13.3866 8.30003 13.7 8.61343 13.7 9.00003V13C13.7 13.3866 13.3866 13.7 13 13.7H9.00001C8.61341 13.7 8.30001 13.3866 8.30001 13V9.00003ZM9.20001 9.20003V12.8H12.8V9.20003H9.20001ZM13.4432 2.19311C13.6189 2.01737 13.6189 1.73245 13.4432 1.55671C13.2675 1.38098 12.9826 1.38098 12.8068 1.55671L11 3.36353L9.19321 1.55674C9.01748 1.381 8.73255 1.381 8.55682 1.55674C8.38108 1.73247 8.38108 2.0174 8.55682 2.19313L10.3636 3.99992L8.55682 5.80671C8.38108 5.98245 8.38108 6.26737 8.55682 6.44311C8.73255 6.61885 9.01748 6.61885 9.19321 6.44311L11 4.63632L12.8068 6.44314C12.9826 6.61887 13.2675 6.61887 13.4432 6.44314C13.6189 6.2674 13.6189 5.98247 13.4432 5.80674L11.6364 3.99992L13.4432 2.19311Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Vn=[`color`],Hn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Vn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.81819 0.93179C7.64245 0.756054 7.35753 0.756054 7.18179 0.93179L5.43179 2.68179C5.25605 2.85753 5.25605 3.14245 5.43179 3.31819C5.60753 3.49392 5.89245 3.49392 6.06819 3.31819L6.99999 2.38638V5.49999C6.99999 5.77613 7.22385 5.99999 7.49999 5.99999C7.77613 5.99999 7.99999 5.77613 7.99999 5.49999V2.38638L8.93179 3.31819C9.10753 3.49392 9.39245 3.49392 9.56819 3.31819C9.74392 3.14245 9.74392 2.85753 9.56819 2.68179L7.81819 0.93179ZM7.99999 9.49999C7.99999 9.22385 7.77613 8.99999 7.49999 8.99999C7.22385 8.99999 6.99999 9.22385 6.99999 9.49999V12.6136L6.06819 11.6818C5.89245 11.5061 5.60753 11.5061 5.43179 11.6818C5.25605 11.8575 5.25605 12.1424 5.43179 12.3182L7.18179 14.0682C7.35753 14.2439 7.64245 14.2439 7.81819 14.0682L9.56819 12.3182C9.74392 12.1424 9.74392 11.8575 9.56819 11.6818C9.39245 11.5061 9.10753 11.5061 8.93179 11.6818L7.99999 12.6136V9.49999ZM8.99999 7.49999C8.99999 7.22385 9.22385 6.99999 9.49999 6.99999H12.6136L11.6818 6.06819C11.5061 5.89245 11.5061 5.60753 11.6818 5.43179C11.8575 5.25605 12.1424 5.25605 12.3182 5.43179L14.0682 7.18179C14.2439 7.35753 14.2439 7.64245 14.0682 7.81819L12.3182 9.56819C12.1424 9.74392 11.8575 9.74392 11.6818 9.56819C11.5061 9.39245 11.5061 9.10753 11.6818 8.93179L12.6136 7.99999H9.49999C9.22385 7.99999 8.99999 7.77613 8.99999 7.49999ZM3.31819 6.06819
2L2.38638 6.99999H5.49999C5.77613 6.99999 5.99999 7.22385 5.99999 7.49999C5.99999 7.77613 5.77613 7.99999 5.49999 7.99999H2.38638L3.31819 8.93179C3.49392 9.10753 3.49392 9.39245 3.31819 9.56819C3.14245 9.74392 2.85753 9.74392 2.68179 9.56819L0.93179 7.81819C0.756054 7.64245 0.756054 7.35753 0.93179 7.18179L2.68179 5.43179C2.85753 5.25605 3.14245 5.25605 3.31819 5.43179C3.49392 5.60753 3.49392 5.89245 3.31819 6.06819Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Un=[`color`],Wn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Un);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M11.8536 1.14645C11.6583 0.951184 11.3417 0.951184 11.1465 1.14645L3.71455 8.57836C3.62459 8.66832 3.55263 8.77461 3.50251 8.89155L2.04044 12.303C1.9599 12.491 2.00189 12.709 2.14646 12.8536C2.29103 12.9981 2.50905 13.0401 2.69697 12.9596L6.10847 11.4975C6.2254 11.4474 6.3317 11.3754 6.42166 11.2855L13.8536 3.85355C14.0488 3.65829 14.0488 3.34171 13.8536 3.14645L11.8536 1.14645ZM4.42166 9.28547L11.5 2.20711L12.7929 3.5L5.71455 10.5784L4.21924 11.2192L3.78081 10.7808L4.42166 9.28547Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Gn=[`color`],Kn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Gn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M12.1464 1.14645C12.3417 0.951184 12.6583 0.951184 12.8535 1.14645L14.8535 3.14645C15.0488 3.34171 15.0488 3.65829 14.8535 3.85355L10.9109 7.79618C10.8349 7.87218 10.7471 7.93543 10.651 7.9835L6.72359 9.94721C6.53109 10.0435 6.29861 10.0057 6.14643 9.85355C5.99425 9.70137 5.95652 9.46889 6.05277 9.27639L8.01648 5.34897C8.06455 5.25283 8.1278 5.16507 8.2038 5.08907L12.1464 1.14645ZM12.5 2.20711L8.91091 5.79618L7.87266 7.87267L8.12731 8.12732L10.2038 7.08907L13.7929 3.5L12.5 2.20711ZM9.99998 2L8.99998 3H4.9C4.47171 3 4.18056 3.00039 3.95552 3.01877C3.73631 3.03668 3.62421 3.06915 3.54601 3.10899C3.35785 3.20487 3.20487 3.35785 3.10899 3.54601C3.06915 3.62421 3.03669 3.73631 3.01878 3.95552C3.00039 4.18056 3 4.47171 3 4.9V11.1C3 11.5283 3.00039 11.8194 3.01878 12.0445C3.03669 12.2637 3.06915 12.3758 3.10899 12.454C3.20487 12.6422 3.35785 12.7951 3.54601 12.891C3.62421 12.9309 3.73631 12.9633 3.95552 12.9812C4.18056 12.9996 4.47171 13 4.9 13H11.1C11.5283 13 11.8194 12.9996 12.0445 12.9812C12.2637 12.9633 12.3758 12.9309 12.454 12.891C12.6422 12.7951 12.7951 12.6422 12.891 12.454C12.9309 12.3758 12.9633 12.2637 12.9812 12.0445C12.9996 11.8194 13 11.5283 13 11.1V6.99998L14 5.99998V11.1V11.1207C14 11.5231 14 11.8553 13.9779 12.1259C13.9549 12.407 13.9057 12.6653 13.782 12.908C13.5903 13.2843 13.2843 13.5903 12.908 13.782C12.6653 13.9057 12.407 13.9549 12.1259 13.9779C11.8553 14 11.5231 14 11.1207 14H11.1H4.9H4.87934C4.47686 14 4.14468 14 3.87409 13.9779C3.59304 13.9549 3.33469 13.9057 3.09202 13.782C2.7157 13.5903 2.40973 13.2843 2.21799 12.908C2.09434 12.6653 2.04506 12.407 2.0221 12.1259C1.99999 11.8553 1.99999 11.5231 2 11.1207V11.1206V11.1V4.9V4.87935V4.87932V4.87931C1.99999 4.47685 1.99999 4.14468 2.0221 3.87409C2.04506 3.59304 2.09434 3.33469 2.21799 3.09202C2.40973 2.71569 2.7157 2.40973 3.09202 2.21799C3.33469 2.09434 3.59304 2.04506 3.87409 2.0221C4.14468 1.99999 4.47685 1.99999 4.87932 2H4.87935H4.9H9.99998Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),qn=[`color`],Jn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,qn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z`,f
2ill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Yn=[`color`],Xn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Yn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM7.50003 4C7.77617 4 8.00003 4.22386 8.00003 4.5V7H10.5C10.7762 7 11 7.22386 11 7.5C11 7.77614 10.7762 8 10.5 8H8.00003V10.5C8.00003 10.7761 7.77617 11 7.50003 11C7.22389 11 7.00003 10.7761 7.00003 10.5V8H4.50003C4.22389 8 4.00003 7.77614 4.00003 7.5C4.00003 7.22386 4.22389 7 4.50003 7H7.00003V4.5C7.00003 4.22386 7.22389 4 7.50003 4Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Zn=[`color`],Qn=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Zn);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M5.07505 4.10001C5.07505 2.91103 6.25727 1.92502 7.50005 1.92502C8.74283 1.92502 9.92505 2.91103 9.92505 4.10001C9.92505 5.19861 9.36782 5.71436 8.61854 6.37884L8.58757 6.4063C7.84481 7.06467 6.92505 7.87995 6.92505 9.5C6.92505 9.81757 7.18248 10.075 7.50005 10.075C7.81761 10.075 8.07505 9.81757 8.07505 9.5C8.07505 8.41517 8.62945 7.90623 9.38156 7.23925L9.40238 7.22079C10.1496 6.55829 11.075 5.73775 11.075 4.10001C11.075 2.12757 9.21869 0.775024 7.50005 0.775024C5.7814 0.775024 3.92505 2.12757 3.92505 4.10001C3.92505 4.41758 4.18249 4.67501 4.50005 4.67501C4.81761 4.67501 5.07505 4.41758 5.07505 4.10001ZM7.50005 13.3575C7.9833 13.3575 8.37505 12.9657 8.37505 12.4825C8.37505 11.9992 7.9833 11.6075 7.50005 11.6075C7.0168 11.6075 6.62505 11.9992 6.62505 12.4825C6.62505 12.9657 7.0168 13.3575 7.50005 13.3575Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),$n=[`color`],er=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,$n);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),tr=[`color`],nr=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,tr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M4.2 1H4.17741H4.1774C3.86936 0.999988 3.60368 0.999978 3.38609 1.02067C3.15576 1.04257 2.92825 1.09113 2.71625 1.22104C2.51442 1.34472 2.34473 1.51442 2.22104 1.71625C2.09113 1.92825 2.04257 2.15576 2.02067 2.38609C1.99998 2.60367 1.99999 2.86935 2 3.17738V3.1774V3.2V11.8V11.8226V11.8226C1.99999 12.1307 1.99998 12.3963 2.02067 12.6139C2.04257 12.8442 2.09113 13.0717 2.22104 13.2837C2.34473 13.4856 2.51442 13.6553 2.71625 13.779C2.92825 13.9089 3.15576 13.9574 3.38609 13.9793C3.60368 
214 3.86937 14 4.17741 14H4.2H10.8H10.8226C11.1306 14 11.3963 14 11.6139 13.9793C11.8442 13.9574 12.0717 13.9089 12.2837 13.779C12.4856 13.6553 12.6553 13.4856 12.779 13.2837C12.9089 13.0717 12.9574 12.8442 12.9793 12.6139C13 12.3963 13 12.1306 13 11.8226V11.8V3.2V3.17741C13 2.86936 13 2.60368 12.9793 2.38609C12.9574 2.15576 12.9089 1.92825 12.779 1.71625C12.6553 1.51442 12.4856 1.34472 12.2837 1.22104C12.0717 1.09113 11.8442 1.04257 11.6139 1.02067C11.3963 0.999978 11.1306 0.999988 10.8226 1H10.8H4.2ZM3.23875 2.07368C3.26722 2.05623 3.32362 2.03112 3.48075 2.01618C3.64532 2.00053 3.86298 2 4.2 2H10.8C11.137 2 11.3547 2.00053 11.5193 2.01618C11.6764 2.03112 11.7328 2.05623 11.7613 2.07368C11.8285 2.11491 11.8851 2.17147 11.9263 2.23875C11.9438 2.26722 11.9689 2.32362 11.9838 2.48075C11.9995 2.64532 12 2.86298 12 3.2V11.8C12 12.137 11.9995 12.3547 11.9838 12.5193C11.9689 12.6764 11.9438 12.7328 11.9263 12.7613C11.8851 12.8285 11.8285 12.8851 11.7613 12.9263C11.7328 12.9438 11.6764 12.9689 11.5193 12.9838C11.3547 12.9995 11.137 13 10.8 13H4.2C3.86298 13 3.64532 12.9995 3.48075 12.9838C3.32362 12.9689 3.26722 12.9438 3.23875 12.9263C3.17147 12.8851 3.11491 12.8285 3.07368 12.7613C3.05624 12.7328 3.03112 12.6764 3.01618 12.5193C3.00053 12.3547 3 12.137 3 11.8V3.2C3 2.86298 3.00053 2.64532 3.01618 2.48075C3.03112 2.32362 3.05624 2.26722 3.07368 2.23875C3.11491 2.17147 3.17147 2.11491 3.23875 2.07368ZM5 10C4.72386 10 4.5 10.2239 4.5 10.5C4.5 10.7761 4.72386 11 5 11H8C8.27614 11 8.5 10.7761 8.5 10.5C8.5 10.2239 8.27614 10 8 10H5ZM4.5 7.5C4.5 7.22386 4.72386 7 5 7H10C10.2761 7 10.5 7.22386 10.5 7.5C10.5 7.77614 10.2761 8 10 8H5C4.72386 8 4.5 7.77614 4.5 7.5ZM5 4C4.72386 4 4.5 4.22386 4.5 4.5C4.5 4.77614 4.72386 5 5 5H10C10.2761 5 10.5 4.77614 10.5 4.5C10.5 4.22386 10.2761 4 10 4H5Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),rr=[`color`],ir=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,rr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M4.85355 2.14645C5.04882 2.34171 5.04882 2.65829 4.85355 2.85355L3.70711 4H9C11.4853 4 13.5 6.01472 13.5 8.5C13.5 10.9853 11.4853 13 9 13H5C4.72386 13 4.5 12.7761 4.5 12.5C4.5 12.2239 4.72386 12 5 12H9C10.933 12 12.5 10.433 12.5 8.5C12.5 6.567 10.933 5 9 5H3.70711L4.85355 6.14645C5.04882 6.34171 5.04882 6.65829 4.85355 6.85355C4.65829 7.04882 4.34171 7.04882 4.14645 6.85355L2.14645 4.85355C1.95118 4.65829 1.95118 4.34171 2.14645 4.14645L4.14645 2.14645C4.34171 1.95118 4.65829 1.95118 4.85355 2.14645Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),ar=[`color`],or=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,ar);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M0.5 4C0.223858 4 0 4.22386 0 4.5V10.5C0 10.7761 0.223858 11 0.5 11H14.5C14.7761 11 15 10.7761 15 10.5V4.5C15 4.22386 14.7761 4 14.5 4H0.5ZM1 10V5H2.075V7.5C2.075 7.73472 2.26528 7.925 2.5 7.925C2.73472 7.925 2.925 7.73472 2.925 7.5V5H4.075V6.5C4.075 6.73472 4.26528 6.925 4.5 6.925C4.73472 6.925 4.925 6.73472 4.925 6.5V5H6.075V6.5C6.075 6.73472 6.26528 6.925 6.5 6.925C6.73472 6.925 6.925 6.73472 6.925 6.5V5H8.075V7.5C8.075 7.73472 8.26528 7.925 8.5 7.925C8.73472 7.925 8.925 7.73472 8.925 7.5V5H10.075V6.5C10.075 6.73472 10.2653 6.925 10.5 6.925C10.7347 6.925 10.925 6.73472 10.925 6.5V5H12.075V6.5C12.075 6.73472 12.2653 6.925 12.5 6.925C12.7347 6.925 12.925 6.73472 12.925 6.5V5H14V10H1Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),sr=[`color`],cr=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,sr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M6 3.5C6 2.67157 6.67157 2 7.5 2C8.32843 2 9 2.67157 9 3.5C9 4.32843 8.32843 5 7.5 5C6.67157 5 6 4.32843 6 3.5ZM8 5.94999C9.14112 5.71836 10 4.70948 10 3.5C10 2.11929 8.88071 1 7.5 1C6.11929 1 5 2.11929 5 3.5C5 4.70948 5.85888 5.71836 7 5.94999V13.5C7 13.7761 7.22386 14 7.5 14C7.77614 14 8 13.7761 8 13.5V5.94999Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),lr=[`color`],ur=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,lr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M12.3536 1.14645C12.1583 0.951184 11.8417 0.951184 11.6464 1.14645C11.4512 1.34171 11.4512 1.65829 11.6464 1.85355L12.7929 3H12C10.7037 3 9.71111 3.58423 8.87248 4.38931C8.20065 5.03427 7.59349 5.85684 6.99461 6.6682C6.86287 6.84668 6.73154 7.02462 6.6 7.2C5.10874 9.18835 3.49037 11 0.5 11C0.223858 11 0 11.2239 0 11.5C0 11.7761 0.223858 12 0.5 12C4.00963 12 5.89126 9.81165 7.4 7.8C7.54367 7.
260845 7.6832 7.41962 7.81996 7.23454L7.82005 7.23443L7.82006 7.23441C8.41674 6.42695 8.96069 5.69085 9.56502 5.11069C10.2889 4.41577 11.0463 4 12 4H12.7929L11.6464 5.14645C11.4512 5.34171 11.4512 5.65829 11.6464 5.85355C11.8417 6.04882 12.1583 6.04882 12.3536 5.85355L14.3536 3.85355C14.5488 3.65829 14.5488 3.34171 14.3536 3.14645L12.3536 1.14645ZM0.5 3C3.35278 3 5.12992 4.44588 6.50548 6.06746L6.3762 6.24266C6.2483 6.4161 6.12293 6.58609 6 6.75C5.96397 6.79804 5.92798 6.84581 5.892 6.89331C4.57348 5.29306 3.02637 4 0.5 4C0.223858 4 0 3.77614 0 3.5C0 3.22386 0.223858 3 0.5 3ZM8.87248 10.6107C8.37284 10.131 7.90897 9.55314 7.45767 8.95468C7.64688 8.71693 7.82704 8.48061 8 8.25L8.08987 8.12987C8.58412 8.79402 9.05288 9.39766 9.56502 9.88931C10.2889 10.5842 11.0463 11 12 11H12.7929L11.6464 9.85355C11.4512 9.65829 11.4512 9.34171 11.6464 9.14645C11.8417 8.95118 12.1583 8.95118 12.3536 9.14645L14.3536 11.1464C14.5488 11.3417 14.5488 11.6583 14.3536 11.8536L12.3536 13.8536C12.1583 14.0488 11.8417 14.0488 11.6464 13.8536C11.4512 13.6583 11.4512 13.3417 11.6464 13.1464L12.7929 12H12C10.7037 12 9.71111 11.4158 8.87248 10.6107Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),dr=[`color`],fr=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,dr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M11.5 3.04999C11.7485 3.04999 11.95 3.25146 11.95 3.49999V7.49999C11.95 7.74852 11.7485 7.94999 11.5 7.94999C11.2515 7.94999 11.05 7.74852 11.05 7.49999V4.58639L4.58638 11.05H7.49999C7.74852 11.05 7.94999 11.2515 7.94999 11.5C7.94999 11.7485 7.74852 11.95 7.49999 11.95L3.49999 11.95C3.38064 11.95 3.26618 11.9026 3.18179 11.8182C3.0974 11.7338 3.04999 11.6193 3.04999 11.5L3.04999 7.49999C3.04999 7.25146 3.25146 7.04999 3.49999 7.04999C3.74852 7.04999 3.94999 7.25146 3.94999 7.49999L3.94999 10.4136L10.4136 3.94999L7.49999 3.94999C7.25146 3.94999 7.04999 3.74852 7.04999 3.49999C7.04999 3.25146 7.25146 3.04999 7.49999 3.04999L11.5 3.04999Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),pr=[`color`],mr=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,pr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1 1H1.5H13.5H14V1.5V13.5V14H13.5H1.5H1V13.5V1.5V1ZM2 2V13H13V2H2Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),hr=[`color`],gr=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,hr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1.90321 7.29677C1.90321 10.341 4.11041 12.4147 6.58893 12.8439C6.87255 12.893 7.06266 13.1627 7.01355 13.4464C6.96444 13.73 6.69471 13.9201 6.41109 13.871C3.49942 13.3668 0.86084 10.9127 0.86084 7.29677C0.860839 5.76009 1.55996 4.55245 2.37639 3.63377C2.96124 2.97568 3.63034 2.44135 4.16846 2.03202L2.53205 2.03202C2.25591 2.03202 2.03205 1.80816 2.03205 1.53202C2.03205 1.25588 2.25591 1.03202 2.53205 1.03202L5.53205 1.03202C5.80819 1.03202 6.03205 1.25588 6.03205 1.53202L6.03205 4.53202C6.03205 4.80816 5.80819 5.03202 5.53205 5.03202C5.25591 5.03202 5.03205 4.80816 5.03205 4.53202L5.03205 2.68645L5.03054 2.68759L5.03045 2.68766L5.03044 2.68767L5.03043 2.68767C4.45896 3.11868 3.76059 3.64538 3.15554 4.3262C2.44102 5.13021 1.90321 6.10154 1.90321 7.29677ZM13.0109 7.70321C13.0109 4.69115 10.8505 2.6296 8.40384 2.17029C8.12093 2.11718 7.93465 1.84479 7.98776 1.56188C8.04087 1.27898 8.31326 1.0927 8.59616 1.14581C11.4704 1.68541 14.0532 4.12605 14.0532 7.70321C14.0532 9.23988 13.3541 10.4475 12.5377 11.3662C11.9528 12.0243 11.2837 12.5586 10.7456 12.968L12.3821 12.968C12.6582 12.968 12.8821 13.1918 12.8821 13.468C12.8821 13.7441 12.6582 13.968 12.3821 13.968L9.38205 13.968C9.10591 13.968 8.88205 13.7441 8.88205 13.468L8.88205 10.468C8.88205 10.1918 9.10591 9.96796 9.38205 9.96796C9.65819 9.96796 9.88205 10.1918 9.88205 10.468L9.88205 12.3135L9.88362 12.3123C10.4551 11.8813 11.1535 11.3546 11.7585 10.6738C12.4731 9.86976 13.0109 8.89844 13.0109 7.70321Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),_r=[`color`],vr=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,_r);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M3.94993 2.95002L3.94993 4.49998C3.94993 4.74851 3.74845 4.94998 3.49993 4.94998C3.2514 4.94998 3.04993 4.74851 3.04993 4.49998V2.50004C3.04993 2.45246 3.05731 2.40661 3.07099 2.36357C3.12878 2.18175 3.29897 2.05002 3.49993 2.05002H11.4999C11.6553 2.05002 11.7922 2.12872 11.8731 2.24842C11.9216 2.32024 11.9499 2.40682 11.9499 2.50002L11.9499 2.50004V4.49998C11.9499 4.74851 11.7485 4.94998 11.4999 4.94998C11.2514 4.94998 11.0499 4.74851 11.0499 4.49998V2.95002H8.04993V12.05H9.25428C9.50281 12.05 9.70428 12.2515 9.70428 12.5C9.70428 12.7486 9.50281 12.95 9.25428 12.95H5.75428C5.50575 12.95 5.30428 12.7486 5.30428 12.5C5.30428 12.2515 5.50575 12.05 5.75428 12.05H6.94993V2.95002H3.94993Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),yr=[`color`],br=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,yr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L11.9291 2.36383C11.9159 2.32246 11.897 2.28368 11.8732 2.24845C11.7923 2.12875 11.6554 2.05005 11.5001 2.05005H3.50005C3.29909 2.05005 3.1289 2.18178 3.07111 2.3636C3.05743 2.40665 3.05005 2.45249 3.05005 2.50007V4.50001C3.05005 4.74854 3.25152 4.95001 3.50005 4.95001C3.74858 4.95001 3.95005 4.74854 3.95005 4.50001V2.95005H6.95006V7.34284L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L6.95006 8.75705V12.0501H5.7544C5.50587 12.0501 5.3044 12.2515 5.3044 12.5001C5.3044 12.7486 5.50587 12.9501 5.7544 12.9501H9.2544C9.50293 12.9501 9.7044 12.7486 9.7044 12.5001C9.7044 12.2515 9.50293 12.0501 9.2544 12.0501H8.05006V7.65705L13.3536 2.35355ZM8.05006 6.24284L11.0501 3.24283V2.95005H8.05006V6.24284Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),xr=[`color`],Sr=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,xr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Cr=[`color`],wr=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Cr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M6 11L6 4L10.5 7.5L6 11Z`,fill:r}))}),Tr=[`color`],Er=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Tr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1.90321 7.29677C1.90321 10.341 4.11041 12.4147 6.58893 12.8439C6.87255 12.893 7.06266 13.1627 7.01355 13.4464C6.96444 13.73 
26.69471 13.9201 6.41109 13.871C3.49942 13.3668 0.86084 10.9127 0.86084 7.29677C0.860839 5.76009 1.55996 4.55245 2.37639 3.63377C2.96124 2.97568 3.63034 2.44135 4.16846 2.03202L2.53205 2.03202C2.25591 2.03202 2.03205 1.80816 2.03205 1.53202C2.03205 1.25588 2.25591 1.03202 2.53205 1.03202L5.53205 1.03202C5.80819 1.03202 6.03205 1.25588 6.03205 1.53202L6.03205 4.53202C6.03205 4.80816 5.80819 5.03202 5.53205 5.03202C5.25591 5.03202 5.03205 4.80816 5.03205 4.53202L5.03205 2.68645L5.03054 2.68759L5.03045 2.68766L5.03044 2.68767L5.03043 2.68767C4.45896 3.11868 3.76059 3.64538 3.15554 4.3262C2.44102 5.13021 1.90321 6.10154 1.90321 7.29677ZM13.0109 7.70321C13.0109 4.69115 10.8505 2.6296 8.40384 2.17029C8.12093 2.11718 7.93465 1.84479 7.98776 1.56188C8.04087 1.27898 8.31326 1.0927 8.59616 1.14581C11.4704 1.68541 14.0532 4.12605 14.0532 7.70321C14.0532 9.23988 13.3541 10.4475 12.5377 11.3662C11.9528 12.0243 11.2837 12.5586 10.7456 12.968L12.3821 12.968C12.6582 12.968 12.8821 13.1918 12.8821 13.468C12.8821 13.7441 12.6582 13.968 12.3821 13.968L9.38205 13.968C9.10591 13.968 8.88205 13.7441 8.88205 13.468L8.88205 10.468C8.88205 10.1918 9.10591 9.96796 9.38205 9.96796C9.65819 9.96796 9.88205 10.1918 9.88205 10.468L9.88205 12.3135L9.88362 12.3123C10.4551 11.8813 11.1535 11.3546 11.7585 10.6738C12.4731 9.86976 13.0109 8.89844 13.0109 7.70321Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),Dr=[`color`],Or=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,Dr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M7.49985 0.877045C3.84216 0.877045 0.877014 3.84219 0.877014 7.49988C0.877014 9.1488 1.47963 10.657 2.47665 11.8162L1.64643 12.6464C1.45117 12.8417 1.45117 13.1583 1.64643 13.3535C1.8417 13.5488 2.15828 13.5488 2.35354 13.3535L3.18377 12.5233C4.34296 13.5202 5.85104 14.1227 7.49985 14.1227C11.1575 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 5.85107 13.5202 4.34299 12.5233 3.1838L13.3535 2.35354C13.5488 2.15827 13.5488 1.84169 13.3535 1.64643C13.1583 1.45117 12.8417 1.45117 12.6464 1.64643L11.8162 2.47668C10.657 1.47966 9.14877 0.877045 7.49985 0.877045ZM11.1422 3.15066C10.1567 2.32449 8.88639 1.82704 7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.88642 2.32446 10.1568 3.15063 11.1422L11.1422 3.15066ZM3.85776 11.8493C4.84317 12.6753 6.11343 13.1727 7.49985 13.1727C10.6328 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 6.11346 12.6753 4.8432 11.8493 3.85779L3.85776 11.8493Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),kr=[`color`],Ar=(0,B.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=V(e,kr);return(0,B.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i,{ref:t}),(0,B.createElement)(`path`,{d:`M1.5 2H13.5C13.7761 2 14 2.22386 14 2.5V7H1V2.5C1 2.22386 1.22386 2 1.5 2ZM1 8V12.5C1 12.7761 1.22386 13 1.5 13H13.5C13.7761 13 14 12.7761 14 12.5V8H1ZM0 2.5C0 1.67157 0.671573 1 1.5 1H13.5C14.3284 1 15 1.67157 15 2.5V12.5C15 13.3284 14.3284 14 13.5 14H1.5C0.671573 14 0 13.3284 0 12.5V2.5Z`,fill:r,fillRule:`evenodd`,clipRule:`evenodd`}))}),jr=i((e=>{var t=Ve();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()}
2,e.version=`19.2.3`})),Mr=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=jr()}));function Nr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Pr(...e){return t=>{let n=!1,r=e.map(e=>{let r=Nr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Nr(e[t],null)}}}}function Fr(...e){return B.useCallback(Pr(...e),e)}var Ir=i((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),H=i(((e,t)=>{t.exports=Ir()}))();function Lr(e){let t=Rr(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e,a=B.Children.toArray(r),o=a.find(Vr);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,H.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,H.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Rr(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(B.isValidElement(n)){let e=Ur(n),i=Hr(r,n.props);return n.type!==B.Fragment&&(i.ref=t?Pr(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zr=Symbol(`radix.slottable`);function Br(e){let t=({children:e})=>(0,H.jsx)(H.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=zr,t}function Vr(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===zr}function Hr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ur(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wr=e(Mr(),1),Gr=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Lr(`Primitive.${t}`),r=B.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kr(e,t){e&&Wr.flushSync(()=>e.dispatchEvent(t))}var qr=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Jr=`VisuallyHidden`,Yr=B.forwardRef((e,t)=>(0,H.jsx)(Gr.span,{...e,ref:t,style:{...qr,...e.style}}));Yr.displayName=Jr;var Xr=Yr;function Zr(e,t){let n=B.createContext(t),r=e=>{let{children:t,...r}=e,i=B.useMemo(()=>r,Object.values(r));return(0,H.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=B.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Qr(e,t=[]){let n=[];function r(t,r){let i=B.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=B.useMemo(()=>o,Object.values(o));return(0,H.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=B.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>B.createContext(e));return function(n){let r=n?.[e]||t;return B.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,$r(i,...t)]}function $r(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return B.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function ei(e){let t=e+`CollectionProvider`,[n,r]=Qr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=B.useRef(null),a=B.useRef(new Map).current;return(0,H.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Lr(s),l=B.forwardRef((e,t)=>
2{let{scope:n,children:r}=e,i=Fr(t,a(s,n).collectionRef);return(0,H.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Lr(u),p=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),s=Fr(t,o),c=a(u,n);return B.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,H.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return B.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function ti(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var ni=globalThis?.document?B.useLayoutEffect:()=>{},ri=B.useInsertionEffect||ni;function ii({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ai({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=B.useRef(e!==void 0);B.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,B.useCallback(t=>{if(s){let n=oi(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ai({defaultProp:e,onChange:t}){let[n,r]=B.useState(e),i=B.useRef(n),a=B.useRef(t);return ri(()=>{a.current=t},[t]),B.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function oi(e){return typeof e==`function`}function si(e,t){return B.useReducer((e,n)=>t[e][n]??e,e)}var ci=e=>{let{present:t,children:n}=e,r=li(t),i=typeof n==`function`?n({present:r.isPresent}):B.Children.only(n),a=Fr(r.ref,di(i));return typeof n==`function`||r.isPresent?B.cloneElement(i,{ref:a}):null};ci.displayName=`Presence`;function li(e){let[t,n]=B.useState(),r=B.useRef(null),i=B.useRef(e),a=B.useRef(`none`),[o,s]=si(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return B.useEffect(()=>{let e=ui(r.current);a.current=o===`mounted`?e:`none`},[o]),ni(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=ui(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),ni(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=ui(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=ui(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:B.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function ui(e){return e?.animationName||`none`}function di(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fi=B.useId||(()=>void 0),pi=0;function mi(e){let[t,n]=B.useState(fi());return ni(()=>{e||n(e=>e??String(pi++))},[e]),e||(t?`radix-${t}`:``)}var hi=`Collapsible`,[gi,_i]=Qr(hi),[vi,yi]=gi(hi),bi=B.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=ii({prop:r,defaultProp:i??!1,onChange:o,caller:hi});return(0,H.jsx)(vi,{scope:n,disabled:a,contentId:mi(),open:c,onOpenToggle:B.useCallback(()=>l(e=>!e),[l]),children:(0,H.jsx)(Gr.div,{"data-state":Ei(c),"data-disabled":a?``:void 0,...s,ref:t})})});bi.displayName=hi;var xi=`CollapsibleTrigger`,Si=B.forwardRef((e,t)=>
vendor: 4,237 bytes, line 2
2{let{__scopeCollapsible:n,...r}=e,i=yi(xi,n);return(0,H.jsx)(Gr.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ei(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:ti(e.onClick,i.onOpenToggle)})});Si.displayName=xi;var Ci=`CollapsibleContent`,wi=B.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=yi(Ci,e.__scopeCollapsible);return(0,H.jsx)(ci,{present:n||i.open,children:({present:e})=>(0,H.jsx)(Ti,{...r,ref:t,present:e})})});wi.displayName=Ci;var Ti=B.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=yi(Ci,n),[s,c]=B.useState(r),l=B.useRef(null),u=Fr(t,l),d=B.useRef(0),f=d.current,p=B.useRef(0),m=p.current,h=o.open||s,g=B.useRef(h),_=B.useRef(void 0);return B.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),ni(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,H.jsx)(Gr.div,{"data-state":Ei(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Ei(e){return e?`open`:`closed`}var Di=bi,Oi=Si,ki=wi,Ai=B.createContext(void 0);function ji(e){let t=B.useContext(Ai);return e||t||`ltr`}var Mi=`Accordion`,Ni=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[Pi,Fi,Ii]=ei(Mi),[Li,Ri]=Qr(Mi,[Ii,_i]),zi=_i(),Bi=B.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,H.jsx)(Pi.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,H.jsx)(Ki,{...a,ref:t}):(0,H.jsx)(Gi,{...i,ref:t})})});Bi.displayName=Mi;var[Vi,Hi]=Li(Mi),[Ui,Wi]=Li(Mi,{collapsible:!1}),Gi=B.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=ii({prop:n,defaultProp:r??``,onChange:i,caller:Mi});return(0,H.jsx)(Vi,{scope:e.__scopeAccordion,value:B.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:B.useCallback(()=>a&&c(``),[a,c]),children:(0,H.jsx)(Ui,{scope:e.__scopeAccordion,collapsible:a,children:(0,H.jsx)(Yi,{...o,ref:t})})})}),Ki=B.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=ii({prop:n,defaultProp:r??[],onChange:i,caller:Mi}),c=B.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=B.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,H.jsx)(Vi,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,H.jsx)(Ui,{scope:e.__scopeAccordion,collapsible:!0,children:(0,H.jsx)(Yi,{...a,ref:t})})})}),[qi,Ji]=Li(Mi),Yi=B.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=Fr(B.useRef(null),t),c=Fi(n),l=ji(i)===`ltr`,u=ti(e.onKeyDown,e=>{if(!Ni.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,H.jsx)(qi,{scope:n,disabled:r,direction:i,orientation:a,children:(0,H.jsx)(Pi.Slot,{scope:n,children:(0,H.jsx)(Gr.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})}),Xi=`AccordionItem`,[Zi,Qi]=Li(Xi),$i=B.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=Ji(Xi,n),o=Hi(Xi,n),s=zi(n),c=mi(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,H.jsx)(Zi,{scope:n,open:l,disabled:u,triggerId:c,children:(0,H.jsx)(Di,{"data-orientation":a.orientation,"data-state":oa(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});$i.displayName=Xi;var ea=`AccordionHeader`,ta=B.forwardRef((e,t)=>
vendor: 4,784 bytes, line 2
2{let{__scopeAccordion:n,...r}=e,i=Ji(Mi,n),a=Qi(ea,n);return(0,H.jsx)(Gr.h3,{"data-orientation":i.orientation,"data-state":oa(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});ta.displayName=ea;var na=`AccordionTrigger`,ra=B.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=Ji(Mi,n),a=Qi(na,n),o=Wi(na,n),s=zi(n);return(0,H.jsx)(Pi.ItemSlot,{scope:n,children:(0,H.jsx)(Oi,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});ra.displayName=na;var ia=`AccordionContent`,aa=B.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=Ji(Mi,n),a=Qi(ia,n),o=zi(n);return(0,H.jsx)(ki,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});aa.displayName=ia;function oa(e){return e?`open`:`closed`}var sa=Bi,ca=$i,la=ta,ua=ra,da=aa;function fa(e){let t=B.useRef(e);return B.useEffect(()=>{t.current=e}),B.useMemo(()=>(...e)=>t.current?.(...e),[])}function pa(e,t=globalThis?.document){let n=fa(e);B.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ma=`DismissableLayer`,ha=`dismissableLayer.update`,ga=`dismissableLayer.pointerDownOutside`,_a=`dismissableLayer.focusOutside`,va,ya=B.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ba=B.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=B.useContext(ya),[u,d]=B.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=B.useState({}),m=Fr(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Ca(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=wa(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return pa(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),B.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(va=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Ta(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=va)}},[u,f,n,l]),B.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Ta())},[u,l]),B.useEffect(()=>{let e=()=>p({});return document.addEventListener(ha,e),()=>document.removeEventListener(ha,e)},[]),(0,H.jsx)(Gr.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:ti(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ti(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ti(e.onPointerDownCapture,x.onPointerDownCapture)})});ba.displayName=ma;var xa=`DismissableLayerBranch`,Sa=B.forwardRef((e,t)=>{let n=B.useContext(ya),r=B.useRef(null),i=Fr(t,r);return B.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,H.jsx)(Gr.div,{...e,ref:i})});Sa.displayName=xa;function Ca(e,t=globalThis?.document){let n=fa(e),r=B.useRef(!1),i=B.useRef(()=>{});return B.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Ea(ga,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wa(e,t=globalThis?.document){let n=fa(e),r=B.useRef(!1);return B.useEffect(()=>{let e=e=>{e.target&&!r.current&&Ea(_a,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ta(){let e=new CustomEvent(ha);document.dispatchEvent(e)}function Ea(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Kr(i,a):i.dispatchEvent(a)}var Da=`focusScope.autoFocusOnMount`,Oa=`focusScope.autoFocusOnUnmount`,ka={bubbles:!1,cancelable:!0},Aa=`FocusScope`,ja=B.forwardRef((e,t)=>
vendor: 13,305 bytes, lines 2-42
2{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=B.useState(null),l=fa(i),u=fa(a),d=B.useRef(null),f=Fr(t,e=>c(e)),p=B.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;B.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Ra(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Ra(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ra(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),B.useEffect(()=>{if(s){za.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Da,ka);s.addEventListener(Da,l),s.dispatchEvent(t),t.defaultPrevented||(Ma(Ha(Pa(s)),{select:!0}),document.activeElement===e&&Ra(s))}return()=>{s.removeEventListener(Da,l),setTimeout(()=>{let t=new CustomEvent(Oa,ka);s.addEventListener(Oa,u),s.dispatchEvent(t),t.defaultPrevented||Ra(e??document.body,{select:!0}),s.removeEventListener(Oa,u),za.remove(p)},0)}}},[s,l,u,p]);let m=B.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Na(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Ra(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Ra(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,H.jsx)(Gr.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});ja.displayName=Aa;function Ma(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ra(r,{select:t}),document.activeElement!==n)return}function Na(e){let t=Pa(e);return[Fa(t,e),Fa(t.reverse(),e)]}function Pa(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fa(e,t){for(let n of e)if(!Ia(n,{upTo:t}))return n}function Ia(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function La(e){return e instanceof HTMLInputElement&&`select`in e}function Ra(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&La(e)&&t&&e.select()}}var za=Ba();function Ba(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Va(e,t),e.unshift(t)},remove(t){e=Va(e,t),e[0]?.resume()}}}function Va(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ha(e){return e.filter(e=>e.tagName!==`A`)}var Ua=`Portal`,Wa=B.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=B.useState(!1);ni(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Wr.createPortal((0,H.jsx)(Gr.div,{...r,ref:t}),o):null});Wa.displayName=Ua;var Ga=Wa,Ka=0;function qa(){B.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Ja()),document.body.insertAdjacentElement(`beforeend`,e[1]??Ja()),Ka++,()=>{Ka===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Ka--}},[])}function Ja(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Ya=function(){return Ya=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ya.apply(this,arguments)};function Xa(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);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Za(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Qa=`right-scroll-bar-position`,$a=`width-before-scroll-bar`,eo=`with-scroll-bars-hidden`,to=`--removed-body-scroll-bar-size`;function no(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ro(e,t){var n=(0,B.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var io=typeof window<`u`?B.useLayoutEffect:B.useEffect,ao=new WeakMap;function oo(e,t){var n=ro(t||null,function(t){return e.forEach(function(e){return no(e,t)})});return io(function(){var t=ao.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||no(e,null)}),i.forEach(function(e){r.has(e)||no(e,a)})}ao.set(n,e)},[e]),n}function so(e){return e}function co(e,t){t===void 0&&(t=so);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function lo(e){e===void 0&&(e={});var t=co(null);return t.options=Ya({async:!0,ssr:!1},e),t}var uo=function(e){var t=e.sideCar,n=Xa(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return B.createElement(r,Ya({},n))};uo.isSideCarExport=!0;function fo(e,t){return e.useMedium(t),uo}var po=lo(),mo=function(){},ho=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:mo,onWheelCapture:mo,onTouchMoveCapture:mo}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Xa(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=oo([n,t]),C=Ya(Ya({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:po,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),Ya(Ya({},C),{ref:S})):B.createElement(v,Ya({},C,{className:c,ref:S}),s))});ho.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ho.classNames={fullWidth:$a,zeroRight:Qa};var go,_o=function(){if(go)return go;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function vo(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=_o();return t&&e.setAttribute(`nonce`,t),e}function yo(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bo(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var eee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=vo())&&(yo(t,n),bo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xo=function(){var e=eee();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},So=function(){var e=xo();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Co={left:0,top:0,right:0,gap:0},wo=function(e){return parseInt(e||``,10)||0},To=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[wo(n),wo(r),wo(i)]},tee=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Co;var t=To(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Eo=So(),Do=`data-scroll-locked`,Oo=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
3  .${eo} {
4   overflow: hidden ${r};
5   padding-right: ${s}px ${r};
6  }
7  body[${Do}] {
8    overflow: hidden ${r};
9    overscroll-behavior: contain;
10    ${[t&&`position: relative ${r};`,n===`margin`&&`
11    padding-left: ${i}px;
12    padding-top: ${a}px;
13    padding-right: ${o}px;
14    margin-left:0;
15    margin-top:0;
16    margin-right: ${s}px ${r};
17    `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
18  }
19  
20  .${Qa} {
21    right: ${s}px ${r};
22  }
23  
24  .${$a} {
25    margin-right: ${s}px ${r};
26  }
27  
28  .${Qa} .${Qa} {
29    right: 0 ${r};
30  }
31  
32  .${$a} .${$a} {
33    margin-right: 0 ${r};
34  }
35  
36  body[${Do}] {
37    ${to}: ${s}px;
38  }
39`},ko=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ao=function(){B.useEffect(function(){return document.body.setAttribute(Do,(ko()+1).toString()),function(){var e=ko()-1;e<=0?document.body.removeAttribute(Do):document.body.setAttribute(Do,e.toString())}},[])},jo=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ao();var a=B.useMemo(function(){return tee(i)},[i]);return B.createElement(Eo,{styles:Oo(a,!t,i,n?``:`!important`)})},Mo=!1;if(typeof window<`u`)try{var No=Object.defineProperty({},"passive",{get:function(){return Mo=!0,!0}});window.addEventListener(`test`,No,No),window.removeEventListener(`test`,No,No)}catch{Mo=!1}var Po=Mo?{passive:!1}:!1,Fo=function(e){return e.tagName===`TEXTAREA`},Io=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Fo(e)&&n[t]===`visible`)},Lo=function(e){return Io(e,`overflowY`)},Ro=function(e){return Io(e,`overflowX`)},zo=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ho(e,r)){var i=Uo(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bo=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Vo=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ho=function(e,t){return e===`v`?Lo(t):Ro(t)},Uo=function(e,t){return e===`v`?Bo(t):Vo(t)},Wo=function(e,t){return e===`h`&&t===`rtl`?-1:1},Go=function(e,t,n,r,i){var a=Wo(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Uo(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ho(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ko=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qo=function(e){return[e.deltaX,e.deltaY]},Jo=function(e){return e&&`current`in e?e.current:e},Yo=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Xo=function(e){return`
40  .block-interactivity-${e} {pointer-events: none;}
41  .allow-interactivity-${e} {pointer-events: all;}
42`},Zo=0,Qo=[];function $o(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(Zo++)[0],a=B.useState(So)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Za([e.lockRef.current],(e.shards||[]).map(Jo),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ko(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=zo(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=zo(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Go(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(!(!Qo.length||Qo[Qo.length-1]!==a)){var r=`deltaY`in n?qo(n):Ko(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Yo(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}
vendor: 4,340 bytes, line 42
42if(!i){var c=(o.current.shards||[]).map(Jo).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:es(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=Ko(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,qo(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,Ko(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return Qo.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Po),document.addEventListener(`touchmove`,c,Po),document.addEventListener(`touchstart`,u,Po),function(){Qo=Qo.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Po),document.removeEventListener(`touchmove`,c,Po),document.removeEventListener(`touchstart`,u,Po)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:Xo(i)}):null,p?B.createElement(jo,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function es(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ts=fo(po,$o),ns=B.forwardRef(function(e,t){return B.createElement(ho,Ya({},e,{ref:t,sideCar:ts}))});ns.classNames=ho.classNames;var nee=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},rs=new WeakMap,is=new WeakMap,as={},ss=0,cs=function(e){return e&&(e.host||cs(e.parentNode))},ls=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=cs(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},us=function(e,t,n,r){var i=ls(t,Array.isArray(e)?e:[e]);as[n]||(as[n]=new WeakMap);var a=as[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(rs.get(e)||0)+1,l=(a.get(e)||0)+1;rs.set(e,c),a.set(e,l),o.push(e),c===1&&i&&is.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ss++,function(){o.forEach(function(e){var t=rs.get(e)-1,i=a.get(e)-1;rs.set(e,t),a.set(e,i),t||(is.has(e)||e.removeAttribute(r),is.delete(e)),i||e.removeAttribute(n)}),ss--,ss||(rs=new WeakMap,rs=new WeakMap,is=new WeakMap,as={})}},ds=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||nee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),us(r,i,n,`aria-hidden`)):function(){return null}},fs=`Dialog`,[ps,ree]=Qr(fs),[ms,hs]=ps(fs),gs=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=B.useRef(null),c=B.useRef(null),[l,u]=ii({prop:r,defaultProp:i??!1,onChange:a,caller:fs});return(0,H.jsx)(ms,{scope:t,triggerRef:s,contentRef:c,contentId:mi(),titleId:mi(),descriptionId:mi(),open:l,onOpenChange:u,onOpenToggle:B.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};gs.displayName=fs;var _s=`DialogTrigger`,vs=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hs(_s,n),a=Fr(t,i.triggerRef);return(0,H.jsx)(Gr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Is(i.open),...r,ref:a,onClick:ti(e.onClick,i.onOpenToggle)})});vs.displayName=_s;var ys=`DialogPortal`,[bs,xs]=ps(ys,{forceMount:void 0}),Ss=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=hs(ys,t);return(0,H.jsx)(bs,{scope:t,forceMount:n,children:B.Children.map(r,e=>(0,H.jsx)(ci,{present:n||a.open,children:(0,H.jsx)(Wa,{asChild:!0,container:i,children:e})}))})};Ss.displayName=ys;var Cs=`DialogOverlay`,ws=B.forwardRef((e,t)=>{let n=xs(Cs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hs(Cs,e.__scopeDialog);return a.modal?(0,H.jsx)(ci,{present:r||a.open,children:(0,H.jsx)(Es,{...i,ref:t})}):null});ws.displayName=Cs;var Ts=Lr(`DialogOverlay.RemoveScroll`),Es=B.forwardRef((e,t)=>
42{let{__scopeDialog:n,...r}=e,i=hs(Cs,n);return(0,H.jsx)(ns,{as:Ts,allowPinchZoom:!0,shards:[i.contentRef],children:(0,H.jsx)(Gr.div,{"data-state":Is(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Ds=`DialogContent`,Os=B.forwardRef((e,t)=>{let n=xs(Ds,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hs(Ds,e.__scopeDialog);return(0,H.jsx)(ci,{present:r||a.open,children:a.modal?(0,H.jsx)(iee,{...i,ref:t}):(0,H.jsx)(aee,{...i,ref:t})})});Os.displayName=Ds;var iee=B.forwardRef((e,t)=>{let n=hs(Ds,e.__scopeDialog),r=B.useRef(null),i=Fr(t,n.contentRef,r);return B.useEffect(()=>{let e=r.current;if(e)return ds(e)},[]),(0,H.jsx)(ks,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ti(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ti(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ti(e.onFocusOutside,e=>e.preventDefault())})}),aee=B.forwardRef((e,t)=>{let n=hs(Ds,e.__scopeDialog),r=B.useRef(!1),i=B.useRef(!1);return(0,H.jsx)(ks,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ks=B.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=hs(Ds,n),c=B.useRef(null),l=Fr(t,c);return qa(),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ja,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(ba,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Is(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(zs,{titleId:s.titleId}),(0,H.jsx)(Vs,{contentRef:c,descriptionId:s.descriptionId})]})]})}),As=`DialogTitle`,js=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hs(As,n);return(0,H.jsx)(Gr.h2,{id:i.titleId,...r,ref:t})});js.displayName=As;var Ms=`DialogDescription`,Ns=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hs(Ms,n);return(0,H.jsx)(Gr.p,{id:i.descriptionId,...r,ref:t})});Ns.displayName=Ms;var Ps=`DialogClose`,Fs=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hs(Ps,n);return(0,H.jsx)(Gr.button,{type:`button`,...r,ref:t,onClick:ti(e.onClick,()=>i.onOpenChange(!1))})});Fs.displayName=Ps;function Is(e){return e?`open`:`closed`}var Ls=`DialogTitleWarning`,[oee,Rs]=Zr(Ls,{contentName:Ds,titleName:As,docsSlug:`dialog`}),zs=({titleId:e})=>{let t=Rs(Ls),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
43
44If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
45
46For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return B.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Bs=`DialogDescriptionWarning`,Vs=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Rs(Bs).contentName}}.`;return B.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Hs=gs,Us=vs,Ws=Ss,see=ws,Gs=Os,Ks=Fs,qs=i((e=>{var t=Ve();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Js=i(((e,t)=>{t.exports=qs()}));function Ys(e){let[t,n]=B.useState(void 0);return ni(()=>
vendor: 10,488 bytes, line 46
46{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var cee=[`top`,`right`,`bottom`,`left`],Xs=Math.min,Zs=Math.max,Qs=Math.round,$s=Math.floor,ec=e=>({x:e,y:e}),tc={left:`right`,right:`left`,bottom:`top`,top:`bottom`},nc={start:`end`,end:`start`};function rc(e,t,n){return Zs(e,Xs(t,n))}function ic(e,t){return typeof e==`function`?e(t):e}function ac(e){return e.split(`-`)[0]}function oc(e){return e.split(`-`)[1]}function sc(e){return e===`x`?`y`:`x`}function cc(e){return e===`y`?`height`:`width`}var lc=new Set([`top`,`bottom`]);function uc(e){return lc.has(ac(e))?`y`:`x`}function dc(e){return sc(uc(e))}function fc(e,t,n){n===void 0&&(n=!1);let r=oc(e),i=dc(e),a=cc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xc(o)),[o,xc(o)]}function pc(e){let t=xc(e);return[mc(e),t,mc(t)]}function mc(e){return e.replace(/start|end/g,e=>nc[e])}var hc=[`left`,`right`],gc=[`right`,`left`],_c=[`top`,`bottom`],vc=[`bottom`,`top`];function yc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gc:hc:t?hc:gc;case`left`:case`right`:return t?_c:vc;default:return[]}}function bc(e,t,n,r){let i=oc(e),a=yc(ac(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(mc)))),a}function xc(e){return e.replace(/left|right|bottom|top/g,e=>tc[e])}function Sc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Sc(e)}function wc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Tc(e,t,n){let{reference:r,floating:i}=e,a=uc(t),o=dc(t),s=cc(o),c=ac(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(oc(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var Ec=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Tc(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Tc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function Dc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ic(t,e),p=Cc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=wc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Oc=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ic(e,t)||{};if(l==null)return{};let d=Cc(u),f={x:n,y:r},p=dc(i),m=cc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Xs(d[_],T),D=Xs(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=rc(O,A,k),M=!c.arrow&&oc(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),kc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ic(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ac(r),_=uc(o),v=ac(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xc(o)]:pc(o)),x=p!==`none`;!d&&x&&b.push(...bc(o,m,p,y));let S=[o,...b],C=await Dc(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=fc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==uc(t))||T.every(e=>uc(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=uc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ac(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jc(e){return cee.some(t=>e[t]>=0)}var Mc=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=ic(e,t);switch(r){case`referenceHidden`:{let e=Ac(await Dc(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:jc(e)}}}case`escaped`:{let e=Ac(await Dc(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:jc(e)}}}default:return{}}}}},Nc=new Set([`left`,`top`]);async function lee(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ac(n),s=oc(n),c=uc(n)===`y`,l=Nc.has(o)?-1:1,u=a&&c?-1:1,d=ic(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Pc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await lee(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Fc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ic(e,t),l={x:n,y:r},u=await Dc(t,c),d=uc(ac(i)),f=sc(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=rc(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=rc(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Ic=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ic(e,t),u={x:n,y:r},d=uc(i),f=sc(d),p=u[f],m=u[d],h=ic(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Nc.has(ac(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Lc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ic(e,t),u=await Dc(t,l),d=ac(i),f=oc(i),p=uc(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Xs(h-u[g],v),x=Xs(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Zs(u.left,0),t=Zs(u.right,0),n=Zs(u.top,0),r=Zs(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Zs(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Zs(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Rc(){return typeof window<`u`}function zc(e){return Hc(e)?(e.nodeName||``).toLowerCase():`#document`}function Bc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vc(e){return((Hc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Hc(e){return Rc()?e instanceof Node||e instanceof Bc(e).Node:!1}function Uc(e){return Rc()?e instanceof Element||e instanceof Bc(e).Element:!1}function Wc(e){return Rc()?e instanceof HTMLElement||e instanceof Bc(e).HTMLElement:!1}function Gc(e){return!Rc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Bc(e).ShadowRoot}var Kc=new Set([`inline`,`contents`]);function qc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ol(e);
vendor: 8,515 bytes, line 46
46return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Kc.has(i)}var Jc=new Set([`table`,`td`,`th`]);function Yc(e){return Jc.has(zc(e))}var Xc=[`:popover-open`,`:modal`];function Zc(e){return Xc.some(t=>{try{return e.matches(t)}catch{return!1}})}var Qc=[`transform`,`translate`,`scale`,`rotate`,`perspective`],$c=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],el=[`paint`,`layout`,`strict`,`content`];function tl(e){let t=rl(),n=Uc(e)?ol(e):e;return Qc.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||$c.some(e=>(n.willChange||``).includes(e))||el.some(e=>(n.contain||``).includes(e))}function nl(e){let t=cl(e);for(;Wc(t)&&!al(t);){if(tl(t))return t;if(Zc(t))return null;t=cl(t)}return null}function rl(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var il=new Set([`html`,`body`,`#document`]);function al(e){return il.has(zc(e))}function ol(e){return Bc(e).getComputedStyle(e)}function sl(e){return Uc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cl(e){if(zc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Gc(e)&&e.host||Vc(e);return Gc(t)?t.host:t}function ll(e){let t=cl(e);return al(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wc(t)&&qc(t)?t:ll(t)}function ul(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ll(e),i=r===e.ownerDocument?.body,a=Bc(r);if(i){let e=dl(a);return t.concat(a,a.visualViewport||[],qc(r)?r:[],e&&n?ul(e):[])}return t.concat(r,ul(r,[],n))}function dl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fl(e){let t=ol(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qs(n)!==a||Qs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function pl(e){return Uc(e)?e:e.contextElement}function ml(e){let t=pl(e);if(!Wc(t))return ec(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=fl(t),o=(a?Qs(n.width):n.width)/r,s=(a?Qs(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var hl=ec(0);function gl(e){let t=Bc(e);return!rl()||!t.visualViewport?hl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _l(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bc(e)?!1:t}function vl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=pl(e),o=ec(1);t&&(r?Uc(r)&&(o=ml(r)):o=ml(e));let s=_l(a,n,r)?gl(a):ec(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Bc(a),t=r&&Uc(r)?Bc(r):r,n=e,i=dl(n);for(;i&&r&&t!==n;){let e=ml(i),t=i.getBoundingClientRect(),r=ol(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Bc(i),i=dl(n)}}return wc({width:u,height:d,x:c,y:l})}function yl(e,t){let n=sl(e).scrollLeft;return t?t.left+n:vl(Vc(e)).left+n}function bl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-yl(e,n),y:n.top+t.scrollTop}}function xl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Vc(r),s=t?Zc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ec(1),u=ec(0),d=Wc(r);if((d||!d&&!a)&&((zc(r)!==`body`||qc(o))&&(c=sl(r)),Wc(r))){let e=vl(r);l=ml(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?bl(o,c):ec(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Sl(e){return Array.from(e.getClientRects())}function Cl(e){let t=Vc(e),n=sl(e),r=e.ownerDocument.body,i=Zs(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Zs(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+yl(e),s=-n.scrollTop;return ol(r).direction===`rtl`&&(o+=Zs(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var wl=25;function Tl(e,t){let n=Bc(e),r=Vc(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=rl();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=yl(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=wl&&(a-=o)}else l<=wl&&(a+=l);return{width:a,height:o,x:s,y:c}}var El=new Set([`absolute`,`fixed`]);function Dl(e,t){let n=vl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Wc(e)?ml(e):ec(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ol(e,t,n){let r;if(t===`viewport`)r=Tl(e,n);else if(t===`document`)r=Cl(Vc(e));else if(Uc(t))r=Dl(t,n);else{let n=gl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wc(r)}function kl(e,t){let n=cl(e);return n===t||!Uc(n)||al(n)?!1:ol(n).position===`fixed`||kl(n,t)}function Al(e,t){let n=t.get(e);if(n)return n;let r=ul(e,[],!1).filter(e=>Uc(e)&&zc(e)!==`body`),i=null,a=ol(e).position===`fixed`,o=a?cl(e):e;for(;Uc(o)&&!al(o);){let t=ol(o),n=tl(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&El.has(i.position)||qc(o)&&!n&&kl(e,o))?r=r.filter(e=>e!==o):i=t,o=cl(o)}return t.set(e,r),r}function jl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Zc(t)?[]:Al(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Ol(t,n,i);return e.top=Zs(r.top,e.top),e.right=Xs(r.right,e.right),e.bottom=Xs(r.bottom,e.bottom),e.left=Zs(r.left,e.left),e},Ol(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Ml(e){let{width:t,height:n}=fl(e);return{width:t,height:n}}function Nl(e,t,n){let r=Wc(t),i=Vc(t),a=n===`fixed`,o=vl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ec(0);function l(){c.x=yl(i)}if(r||!r&&!a)if((zc(t)!==`body`||qc(i))&&(s=sl(t)),r){let e=vl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?bl(i,s):ec(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Pl(e){return ol(e).position===`static`}function Fl(e,t){if(!Wc(e)||ol(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Vc(e)===n&&(n=n.ownerDocument.body),n}function Il(e,t){let n=Bc(e);if(Zc(e))return n;if(!Wc(e)){let t=cl(e);for(;t&&!al(t);){if(Uc(t)&&!Pl(t))return t;t=cl(t)}return n}let r=Fl(e,t);for(;r&&Yc(r)&&Pl(r);)r=Fl(r,t);return r&&al(r)&&Pl(r)&&!tl(r)?n:r||nl(e)||n}var Ll=async function(e){let t=this.getOffsetParent||Il,n=this.getDimensions,r=await n(e.floating);return{reference:Nl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Rl(e){return ol(e).direction===`rtl`}var zl={convertOffsetParentRelativeRectToViewportRelativeRect:xl,getDocumentElement:Vc,getClippingRect:jl,getOffsetParent:Il,getElementRects:Ll,getClientRects:Sl,getDimensions:Ml,getScale:ml,isElement:Uc,isRTL:Rl};function Bl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vl(e,t){let n=null,r,i=Vc(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=$s(d),h=$s(i.clientWidth-(u+f)),g=$s(i.clientHeight-(d+p)),_=$s(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zs(0,Xs(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Bl(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Hl(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=pl(e),u=i||a?[...l?ul(l):[],...ul(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Vl(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?vl(e):null;c&&g();function g(){let t=vl(e);h&&!Bl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;
vendor: 4,124 bytes, line 46
46u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ul=Dc,Wl=Pc,Gl=Fc,Kl=kc,ql=Lc,Jl=Mc,Yl=Oc,Xl=Ic,Zl=(e,t,n)=>{let r=new Map,i={platform:zl,...n},a={...i.platform,_c:r};return Ec(e,t,{...i,platform:a})},Ql=typeof document<`u`?B.useLayoutEffect:function(){};function $l(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$l(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!$l(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function eu(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tu(e,t){let n=eu(e);return Math.round(t*n)/n}function nu(e){let t=B.useRef(e);return Ql(()=>{t.current=e}),t}function ru(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);$l(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=nu(c),D=nu(i),O=nu(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Zl(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!$l(w.current,t)&&(w.current=t,Wr.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Ql(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);Ql(()=>(A.current=!0,()=>{A.current=!1}),[]),Ql(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=tu(M.floating,u.x),r=tu(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...eu(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var iu=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Yl({element:r.current,padding:i}).fn(n):r?Yl({element:r,padding:i}).fn(n):{}}}},au=(e,t)=>({...Wl(e),options:[e,t]}),ou=(e,t)=>({...Gl(e),options:[e,t]}),su=(e,t)=>({...Xl(e),options:[e,t]}),cu=(e,t)=>({...Kl(e),options:[e,t]}),lu=(e,t)=>({...ql(e),options:[e,t]}),uu=(e,t)=>({...Jl(e),options:[e,t]}),du=(e,t)=>({...iu(e),options:[e,t]}),fu=`Arrow`,pu=B.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,H.jsx)(Gr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,H.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});pu.displayName=fu;var mu=pu,hu=`Popper`,[gu,_u]=Qr(hu),[vu,yu]=gu(hu),bu=e=>{let{__scopePopper:t,children:n}=e,[r,i]=B.useState(null);return(0,H.jsx)(vu,{scope:t,anchor:r,onAnchorChange:i,children:n})};bu.displayName=hu;var xu=`PopperAnchor`,Su=B.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=yu(xu,n),o=B.useRef(null),s=Fr(t,o),c=B.useRef(null);return B.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,H.jsx)(Gr.div,{...i,ref:s})});Su.displayName=xu;var Cu=`PopperContent`,[wu,Tu]=gu(Cu),Eu=B.forwardRef((e,t)=>
vendor: 4,830 bytes, line 46
46{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=yu(Cu,n),[_,v]=B.useState(null),y=Fr(t,e=>v(e)),[b,x]=B.useState(null),S=Ys(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(uee),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=ru({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Hl(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[au({mainAxis:i+w,alignmentAxis:o}),c&&ou({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?su():void 0,...k}),c&&cu({...k}),lu({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&du({element:b,padding:s}),dee({arrowWidth:C,arrowHeight:w}),f&&uu({strategy:`referenceHidden`,...k})]}),[F,I]=Au(M),L=fa(m);ni(()=>{N&&L?.()},[N,L]);let R=P.arrow?.x,ee=P.arrow?.y,z=P.arrow?.centerOffset!==0,[te,ne]=B.useState();return ni(()=>{_&&ne(window.getComputedStyle(_).zIndex)},[_]),(0,H.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:te,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(wu,{scope:n,placedSide:F,onArrowChange:x,arrowX:R,arrowY:ee,shouldHideArrow:z,children:(0,H.jsx)(Gr.div,{"data-side":F,"data-align":I,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});Eu.displayName=Cu;var Du=`PopperArrow`,Ou={top:`bottom`,right:`left`,bottom:`top`,left:`right`},ku=B.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Tu(Du,n),a=Ou[i.placedSide];return(0,H.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,H.jsx)(mu,{...r,ref:t,style:{...r.style,display:`block`}})})});ku.displayName=Du;function uee(e){return e!==null}var dee=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Au(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Au(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var ju=bu,Mu=Su,Nu=Eu,Pu=ku,Fu=`rovingFocusGroup.onEntryFocus`,Iu={bubbles:!1,cancelable:!0},Lu=`RovingFocusGroup`,[Ru,zu,Bu]=ei(Lu),[Vu,Hu]=Qr(Lu,[Bu]),[Uu,Wu]=Vu(Lu),Gu=B.forwardRef((e,t)=>(0,H.jsx)(Ru.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Ru.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Ku,{...e,ref:t})})}));Gu.displayName=Lu;var Ku=B.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=B.useRef(null),p=Fr(t,f),m=ji(a),[h,g]=ii({prop:o,defaultProp:s??null,onChange:c,caller:Lu}),[_,v]=B.useState(!1),y=fa(l),b=zu(n),x=B.useRef(!1),[S,C]=B.useState(0);return B.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Fu,y),()=>e.removeEventListener(Fu,y)},[y]),(0,H.jsx)(Uu,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:B.useCallback(e=>g(e),[g]),onItemShiftTab:B.useCallback(()=>v(!0),[]),onFocusableItemAdd:B.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:B.useCallback(()=>C(e=>e-1),[]),children:(0,H.jsx)(Gr.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:ti(e.onMouseDown,()=>{x.current=!0}),onFocus:ti(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Fu,Iu);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>
46e.focusable);Qu([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:ti(e.onBlur,()=>v(!1))})})}),qu=`RovingFocusGroupItem`,Ju=B.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=mi(),l=a||c,u=Wu(qu,n),d=u.currentTabStopId===l,f=zu(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return B.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,H.jsx)(Ru.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(Gr.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:ti(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:ti(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:ti(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Zu(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?$u(n,r+1):n.slice(r+1)}setTimeout(()=>Qu(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Ju.displayName=qu;var Yu={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Xu(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Zu(e,t,n){let r=Xu(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Yu[r]}function Qu(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function $u(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ed=Gu,td=Ju,nd=[`Enter`,` `],rd=[`ArrowDown`,`PageUp`,`Home`],id=[`ArrowUp`,`PageDown`,`End`],ad=[...rd,...id],od={ltr:[...nd,`ArrowRight`],rtl:[...nd,`ArrowLeft`]},sd={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},cd=`Menu`,[ld,ud,dd]=ei(cd),[fd,pd]=Qr(cd,[dd,_u,Hu]),md=_u(),hd=Hu(),[gd,_d]=fd(cd),[vd,yd]=fd(cd),bd=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=md(t),[c,l]=B.useState(null),u=B.useRef(!1),d=fa(a),f=ji(i);return B.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,H.jsx)(ju,{...s,children:(0,H.jsx)(gd,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(vd,{scope:t,onClose:B.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};bd.displayName=cd;var xd=`MenuAnchor`,Sd=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=md(n);return(0,H.jsx)(Mu,{...i,...r,ref:t})});Sd.displayName=xd;var Cd=`MenuPortal`,[wd,Td]=fd(Cd,{forceMount:void 0}),Ed=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=_d(Cd,t);return(0,H.jsx)(wd,{scope:t,forceMount:n,children:(0,H.jsx)(ci,{present:n||a.open,children:(0,H.jsx)(Wa,{asChild:!0,container:i,children:r})})})};Ed.displayName=Cd;var Dd=`MenuContent`,[Od,kd]=fd(Dd),Ad=B.forwardRef((e,t)=>{let n=Td(Dd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=_d(Dd,e.__scopeMenu),o=yd(Dd,e.__scopeMenu);return(0,H.jsx)(ld.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(ci,{present:r||a.open,children:(0,H.jsx)(ld.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(jd,{...i,ref:t}):(0,H.jsx)(Md,{...i,ref:t})})})})}),jd=B.forwardRef((e,t)=>{let n=_d(Dd,e.__scopeMenu),r=B.useRef(null),i=Fr(t,r);return B.useEffect(()=>{let e=r.current;if(e)return ds(e)},[]),(0,H.jsx)(Pd,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ti(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Md=B.forwardRef((e,t)=>
vendor: 8,499 bytes, line 46
46{let n=_d(Dd,e.__scopeMenu);return(0,H.jsx)(Pd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Nd=Lr(`MenuContent.ScrollLock`),Pd=B.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=_d(Dd,n),_=yd(Dd,n),v=md(n),y=hd(n),b=ud(n),[x,S]=B.useState(null),C=B.useRef(null),w=Fr(t,C,g.onContentChange),T=B.useRef(0),E=B.useRef(``),D=B.useRef(0),O=B.useRef(null),k=B.useRef(`right`),A=B.useRef(0),j=m?ns:B.Fragment,M=m?{as:Nd,allowPinchZoom:!0}:void 0,N=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=pee(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};B.useEffect(()=>()=>window.clearTimeout(T.current),[]),qa();let P=B.useCallback(e=>k.current===O.current?.side&&vf(e,O.current?.area),[]);return(0,H.jsx)(Od,{scope:n,searchRef:E,onItemEnter:B.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:B.useCallback(e=>{P(e)||(C.current?.focus(),S(null))},[P]),onTriggerLeave:B.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:D,onPointerGraceIntentChange:B.useCallback(e=>{O.current=e},[]),children:(0,H.jsx)(j,{...M,children:(0,H.jsx)(ja,{asChild:!0,trapped:i,onMountAutoFocus:ti(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(ba,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,H.jsx)(ed,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:ti(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)(Nu,{role:`menu`,"aria-orientation":`vertical`,"data-state":pf(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:ti(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=C.current;if(e.target!==i||!ad.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);id.includes(e.key)&&a.reverse(),gf(a)}),onBlur:ti(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:ti(e.onPointerMove,yf(e=>{let t=e.target,n=A.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>A.current?`right`:`left`;k.current=t,A.current=e.clientX}}))})})})})})})});Ad.displayName=Dd;var Fd=`MenuGroup`,Id=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Gr.div,{role:`group`,...r,ref:t})});Id.displayName=Fd;var Ld=`MenuLabel`,Rd=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Gr.div,{...r,ref:t})});Rd.displayName=Ld;var zd=`MenuItem`,Bd=`menu.itemSelect`,Vd=B.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=B.useRef(null),o=yd(zd,e.__scopeMenu),s=kd(zd,e.__scopeMenu),c=Fr(t,a),l=B.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Bd,{bubbles:!0,cancelable:!0});e.addEventListener(Bd,e=>r?.(e),{once:!0}),Kr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,H.jsx)(Hd,{...i,ref:c,disabled:n,onClick:ti(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:ti(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:ti(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||nd.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Vd.displayName=zd;var Hd=B.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=kd(zd,n),s=hd(n),c=B.useRef(null),l=Fr(t,c),[u,d]=B.useState(!1),[f,p]=B.useState(``);return B.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,H.jsx)(ld.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,H.jsx)(td,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(Gr.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:ti(e.onPointerMove,yf(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ti(e.onPointerLeave,yf(e=>o.onItemLeave(e))),onFocus:ti(e.onFocus,()=>d(!0)),onBlur:ti(e.onBlur,()=>d(!1))})})})}),Ud=`MenuCheckboxItem`,Wd=B.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,H.jsx)(Qd,{scope:e.__scopeMenu,checked:n,children:(0,H.jsx)(Vd,{role:`menuitemcheckbox`,"aria-checked":mf(n)?`mixed`:n,...i,ref:t,"data-state":hf(n),onSelect:ti(i.onSelect,()=>r?.(mf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Wd.displayName=Ud;var Gd=`MenuRadioGroup`,[Kd,qd]=fd(Gd,{value:void 0,onValueChange:()=>{}}),Jd=B.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=fa(r);return(0,H.jsx)(Kd,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,H.jsx)(Id,{...i,ref:t})})});Jd.displayName=Gd;var Yd=`MenuRadioItem`,Xd=B.forwardRef((e,t)=>{let{value:n,...r}=e,i=qd(Yd,e.__scopeMenu),a=n===i.value;return(0,H.jsx)(Qd,{scope:e.__scopeMenu,checked:a,children:(0,H.jsx)(Vd,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":hf(a),onSelect:ti(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Xd.displayName=Yd;var Zd=`MenuItemIndicator`,[Qd,$d]=fd(Zd,{checked:!1}),ef=B.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=$d(Zd,n);return(0,H.jsx)(ci,{present:r||mf(a.checked)||a.checked===!0,children:(0,H.jsx)(Gr.span,{...i,ref:t,"data-state":hf(a.checked)})})});ef.displayName=Zd;var tf=`MenuSeparator`,nf=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(Gr.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});nf.displayName=tf;var fee=`MenuArrow`,rf=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=md(n);return(0,H.jsx)(Pu,{...i,...r,ref:t})});rf.displayName=fee;var af=`MenuSub`,[of,sf]=fd(af),cf=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=_d(af,t),o=md(t),[s,c]=B.useState(null),[l,u]=B.useState(null),d=fa(i);return B.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,H.jsx)(ju,{...o,children:(0,H.jsx)(gd,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,H.jsx)(of,{scope:t,contentId:mi(),triggerId:mi(),trigger:s,onTriggerChange:c,children:n})})})};cf.displayName=af;var lf=`MenuSubTrigger`,uf=B.forwardRef((e,t)=>{let n=_d(lf,e.__scopeMenu),r=yd(lf,e.__scopeMenu),i=sf(lf,e.__scopeMenu),a=kd(lf,e.__scopeMenu),o=B.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=B.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return B.useEffect(()=>u,[u]),B.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,H.jsx)(Sd,{asChild:!0,...l,children:(0,H.jsx)(Hd,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":pf(n.open),...e,ref:Pr(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ti(e.onPointerMove,yf(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ti(e.onPointerLeave,yf(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:ti(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||od[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});uf.displayName=lf;var df=`MenuSubContent`,ff=B.forwardRef((e,t)=>
46{let n=Td(Dd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=_d(Dd,e.__scopeMenu),o=yd(Dd,e.__scopeMenu),s=sf(df,e.__scopeMenu),c=B.useRef(null),l=Fr(t,c);return(0,H.jsx)(ld.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(ci,{present:r||a.open,children:(0,H.jsx)(ld.Slot,{scope:e.__scopeMenu,children:(0,H.jsx)(Pd,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:ti(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:ti(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:ti(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=sd[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});ff.displayName=df;function pf(e){return e?`open`:`closed`}function mf(e){return e===`indeterminate`}function hf(e){return mf(e)?`indeterminate`:e?`checked`:`unchecked`}function gf(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function _f(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function pee(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=_f(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function mee(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function vf(e,t){return t?mee({x:e.clientX,y:e.clientY},t):!1}function yf(e){return t=>t.pointerType===`mouse`?e(t):void 0}var bf=bd,xf=Sd,Sf=Ed,Cf=Ad,wf=Id,Tf=Rd,Ef=Vd,Df=Wd,Of=Jd,kf=Xd,Af=ef,jf=nf,Mf=rf,Nf=cf,Pf=uf,Ff=ff,If=`ContextMenu`,[Lf,Rf]=Qr(If,[pd]),zf=pd(),[Bf,Vf]=Lf(If),Hf=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=B.useState(!1),c=zf(t),l=fa(r),u=B.useCallback(e=>{s(e),l(e)},[l]);return(0,H.jsx)(Bf,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,H.jsx)(bf,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};Hf.displayName=If;var Uf=`ContextMenuTrigger`,Wf=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=Vf(Uf,n),o=zf(n),s=B.useRef({x:0,y:0}),c=B.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=B.useRef(0),u=B.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return B.useEffect(()=>u,[u]),B.useEffect(()=>void(r&&u()),[r,u]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xf,{...o,virtualRef:c}),(0,H.jsx)(Gr.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:ti(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:ti(e.onPointerDown,mp(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:ti(e.onPointerMove,mp(u)),onPointerCancel:r?e.onPointerCancel:ti(e.onPointerCancel,mp(u)),onPointerUp:r?e.onPointerUp:ti(e.onPointerUp,mp(u))})]})});Wf.displayName=Uf;var hee=`ContextMenuPortal`,Gf=e=>{let{__scopeContextMenu:t,...n}=e,r=zf(t);return(0,H.jsx)(Sf,{...r,...n})};Gf.displayName=hee;var Kf=`ContextMenuContent`,qf=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Vf(Kf,n),a=zf(n),o=B.useRef(!1);return(0,H.jsx)(Cf,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});qf.displayName=Kf;var gee=`ContextMenuGroup`,Jf=B.forwardRef((e,t)=>
vendor: 4,753 bytes, line 46
46{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(wf,{...i,...r,ref:t})});Jf.displayName=gee;var _ee=`ContextMenuLabel`,vee=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(Tf,{...i,...r,ref:t})});vee.displayName=_ee;var yee=`ContextMenuItem`,Yf=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(Ef,{...i,...r,ref:t})});Yf.displayName=yee;var Xf=`ContextMenuCheckboxItem`,Zf=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(Df,{...i,...r,ref:t})});Zf.displayName=Xf;var Qf=`ContextMenuRadioGroup`,$f=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(Of,{...i,...r,ref:t})});$f.displayName=Qf;var ep=`ContextMenuRadioItem`,tp=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(kf,{...i,...r,ref:t})});tp.displayName=ep;var np=`ContextMenuItemIndicator`,rp=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(Af,{...i,...r,ref:t})});rp.displayName=np;var ip=`ContextMenuSeparator`,ap=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(jf,{...i,...r,ref:t})});ap.displayName=ip;var op=`ContextMenuArrow`,sp=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(Mf,{...i,...r,ref:t})});sp.displayName=op;var cp=`ContextMenuSub`,lp=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=zf(t),[s,c]=ii({prop:i,defaultProp:a??!1,onChange:r,caller:cp});return(0,H.jsx)(Nf,{...o,open:s,onOpenChange:c,children:n})};lp.displayName=cp;var up=`ContextMenuSubTrigger`,dp=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(Pf,{...i,...r,ref:t})});dp.displayName=up;var fp=`ContextMenuSubContent`,pp=B.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=zf(n);return(0,H.jsx)(Ff,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});pp.displayName=fp;function mp(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var hp=Hf,gp=Wf,_p=Gf,bee=qf,vp=Yf,yp=lp,bp=dp,xee=pp,xp=`DropdownMenu`,[Sp,Cp]=Qr(xp,[pd]),wp=pd(),[Tp,Ep]=Sp(xp),Dp=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=wp(t),l=B.useRef(null),[u,d]=ii({prop:i,defaultProp:a??!1,onChange:o,caller:xp});return(0,H.jsx)(Tp,{scope:t,triggerId:mi(),triggerRef:l,contentId:mi(),open:u,onOpenChange:d,onOpenToggle:B.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(bf,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Dp.displayName=xp;var Op=`DropdownMenuTrigger`,kp=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Ep(Op,n),o=wp(n);return(0,H.jsx)(xf,{asChild:!0,...o,children:(0,H.jsx)(Gr.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:Pr(t,a.triggerRef),onPointerDown:ti(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:ti(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});kp.displayName=Op;var Ap=`DropdownMenuPortal`,jp=e=>{let{__scopeDropdownMenu:t,...n}=e,r=wp(t);return(0,H.jsx)(Sf,{...r,...n})};jp.displayName=Ap;var Mp=`DropdownMenuContent`,Np=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ep(Mp,n),a=wp(n),o=B.useRef(!1);return(0,H.jsx)(Cf,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:ti(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:ti(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Np.displayName=Mp;var See=`DropdownMenuGroup`,Cee=B.forwardRef((e,t)=>
vendor: 4,260 bytes, line 46
46{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(wf,{...i,...r,ref:t})});Cee.displayName=See;var wee=`DropdownMenuLabel`,Pp=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(Tf,{...i,...r,ref:t})});Pp.displayName=wee;var Tee=`DropdownMenuItem`,Fp=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(Ef,{...i,...r,ref:t})});Fp.displayName=Tee;var Eee=`DropdownMenuCheckboxItem`,Dee=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(Df,{...i,...r,ref:t})});Dee.displayName=Eee;var Oee=`DropdownMenuRadioGroup`,kee=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(Of,{...i,...r,ref:t})});kee.displayName=Oee;var Aee=`DropdownMenuRadioItem`,jee=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(kf,{...i,...r,ref:t})});jee.displayName=Aee;var Mee=`DropdownMenuItemIndicator`,Nee=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(Af,{...i,...r,ref:t})});Nee.displayName=Mee;var Pee=`DropdownMenuSeparator`,Ip=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(jf,{...i,...r,ref:t})});Ip.displayName=Pee;var Fee=`DropdownMenuArrow`,Iee=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(Mf,{...i,...r,ref:t})});Iee.displayName=Fee;var Lee=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=wp(t),[s,c]=ii({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,H.jsx)(Nf,{...o,open:s,onOpenChange:c,children:n})},Ree=`DropdownMenuSubTrigger`,Lp=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(Pf,{...i,...r,ref:t})});Lp.displayName=Ree;var zee=`DropdownMenuSubContent`,Rp=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=wp(n);return(0,H.jsx)(Ff,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Rp.displayName=zee;var zp=Dp,Bp=kp,Bee=jp,Vee=Np,Hee=Pp,Uee=Fp,Wee=Ip,Gee=Lee,Kee=Lp,qee=Rp,Vp=`Popover`,[Jee,Yee]=Qr(Vp,[_u]),Hp=_u(),[Xee,Up]=Jee(Vp),Zee=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Hp(t),c=B.useRef(null),[l,u]=B.useState(!1),[d,f]=ii({prop:r,defaultProp:i??!1,onChange:a,caller:Vp});return(0,H.jsx)(ju,{...s,children:(0,H.jsx)(Xee,{scope:t,contentId:mi(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:B.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:B.useCallback(()=>u(!0),[]),onCustomAnchorRemove:B.useCallback(()=>u(!1),[]),modal:o,children:n})})};Zee.displayName=Vp;var Qee=`PopoverAnchor`,$ee=B.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Up(Qee,n),a=Hp(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return B.useEffect(()=>(o(),()=>s()),[o,s]),(0,H.jsx)(Mu,{...a,...r,ref:t})});$ee.displayName=Qee;var ete=`PopoverTrigger`,tte=B.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Up(ete,n),a=Hp(n),o=Fr(t,i.triggerRef),s=(0,H.jsx)(Gr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mte(i.open),...r,ref:o,onClick:ti(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,H.jsx)(Mu,{asChild:!0,...a,children:s})});tte.displayName=ete;var Wp=`PopoverPortal`,[nte,rte]=Jee(Wp,{forceMount:void 0}),ite=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Up(Wp,t);return(0,H.jsx)(nte,{scope:t,forceMount:n,children:(0,H.jsx)(ci,{present:n||a.open,children:(0,H.jsx)(Wa,{asChild:!0,container:i,children:r})})})};ite.displayName=Wp;var Gp=`PopoverContent`,ate=B.forwardRef((e,t)=>{let n=rte(Gp,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Up(Gp,e.__scopePopover);return(0,H.jsx)(ci,{present:r||a.open,children:a.modal?(0,H.jsx)(ste,{...i,ref:t}):(0,H.jsx)(cte,{...i,ref:t})})});ate.displayName=Gp;var ote=Lr(`PopoverContent.RemoveScroll`),ste=B.forwardRef((e,t)=>
46{let n=Up(Gp,e.__scopePopover),r=B.useRef(null),i=Fr(t,r),a=B.useRef(!1);return B.useEffect(()=>{let e=r.current;if(e)return ds(e)},[]),(0,H.jsx)(ns,{as:ote,allowPinchZoom:!0,children:(0,H.jsx)(lte,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ti(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ti(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:ti(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),cte=B.forwardRef((e,t)=>{let n=Up(Gp,e.__scopePopover),r=B.useRef(!1),i=B.useRef(!1);return(0,H.jsx)(lte,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),lte=B.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Up(Gp,n),p=Hp(n);return qa(),(0,H.jsx)(ja,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(ba,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,H.jsx)(Nu,{"data-state":mte(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),ute=`PopoverClose`,dte=B.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Up(ute,n);return(0,H.jsx)(Gr.button,{type:`button`,...r,ref:t,onClick:ti(e.onClick,()=>i.onOpenChange(!1))})});dte.displayName=ute;var fte=`PopoverArrow`,pte=B.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Hp(n);return(0,H.jsx)(Pu,{...i,...r,ref:t})});pte.displayName=fte;function mte(e){return e?`open`:`closed`}var Kp=Zee,hte=$ee,qp=tte,Jp=ite,gte=ate,Yp=dte,_te=pte,Xp=`Progress`,Zp=100,[vte,yte]=Qr(Xp),[bte,xte]=vte(Xp),Ste=B.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=Tte,...o}=e;(i||i===0)&&!Dte(i)&&console.error(kte(`${i}`,`Progress`));let s=Dte(i)?i:Zp;r!==null&&!Ote(r,s)&&console.error(Ate(`${r}`,`Progress`));let c=Ote(r,s)?r:null,l=Qp(c)?a(c,s):void 0;return(0,H.jsx)(bte,{scope:n,value:c,max:s,children:(0,H.jsx)(Gr.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Qp(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":Ete(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});Ste.displayName=Xp;var Cte=`ProgressIndicator`,wte=B.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=xte(Cte,n);return(0,H.jsx)(Gr.div,{"data-state":Ete(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});wte.displayName=Cte;function Tte(e,t){return`${Math.round(e/t*100)}%`}function Ete(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function Qp(e){return typeof e==`number`}function Dte(e){return Qp(e)&&!isNaN(e)&&e>0}function Ote(e,t){return Qp(e)&&!isNaN(e)&&e<=t&&e>=0}function kte(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Zp}\`.`}function Ate(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
47  - a positive number
48  - less than the value passed to \`max\` (or ${Zp} if no \`max\` prop is set)
49  - \`null\` or \`undefined\` if the progress is indeterminate.
50
51Defaulting to \`null\`.`}var jte=Ste,Mte=wte,$p=`Tabs`,[Nte,Pte]=Qr($p,[Hu]),Fte=Hu(),[Ite,em]=Nte($p),Lte=B.forwardRef((e,t)=>
vendor: 4,152 bytes, line 51
51{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=ji(s),[d,f]=ii({prop:r,onChange:i,defaultProp:a??``,caller:$p});return(0,H.jsx)(Ite,{scope:n,baseId:mi(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,H.jsx)(Gr.div,{dir:u,"data-orientation":o,...l,ref:t})})});Lte.displayName=$p;var Rte=`TabsList`,zte=B.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=em(Rte,n),o=Fte(n);return(0,H.jsx)(ed,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,H.jsx)(Gr.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});zte.displayName=Rte;var Bte=`TabsTrigger`,Vte=B.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=em(Bte,n),s=Fte(n),c=Wte(o.baseId,r),l=Gte(o.baseId,r),u=r===o.value;return(0,H.jsx)(td,{asChild:!0,...s,focusable:!i,active:u,children:(0,H.jsx)(Gr.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:ti(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:ti(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:ti(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});Vte.displayName=Bte;var Hte=`TabsContent`,Ute=B.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=em(Hte,n),c=Wte(s.baseId,r),l=Gte(s.baseId,r),u=r===s.value,d=B.useRef(u);return B.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,H.jsx)(ci,{present:i||u,children:({present:n})=>(0,H.jsx)(Gr.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});Ute.displayName=Hte;function Wte(e,t){return`${e}-trigger-${t}`}function Gte(e,t){return`${e}-content-${t}`}var Kte=Lte,qte=zte,Jte=Vte,tm=Ute,[nm,Yte]=Qr(`Tooltip`,[_u]),rm=_u(),Xte=`TooltipProvider`,Zte=700,im=`tooltip.open`,[Qte,am]=nm(Xte),$te=e=>{let{__scopeTooltip:t,delayDuration:n=Zte,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=B.useRef(!0),s=B.useRef(!1),c=B.useRef(0);return B.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,H.jsx)(Qte,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:B.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:B.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:B.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};$te.displayName=Xte;var om=`Tooltip`,[ene,sm]=nm(om),tne=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=am(om,e.__scopeTooltip),l=rm(t),[u,d]=B.useState(null),f=mi(),p=B.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=B.useRef(!1),[_,v]=ii({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(im))):c.onClose(),a?.(e)},caller:om}),y=B.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=B.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=B.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=B.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return B.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,H.jsx)(ju,{...l,children:(0,H.jsx)(ene,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:B.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:B.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};tne.displayName=om;var cm=`TooltipTrigger`,lm=B.forwardRef((e,t)=>
vendor: 4,797 bytes, line 51
51{let{__scopeTooltip:n,...r}=e,i=sm(cm,n),a=am(cm,n),o=rm(n),s=Fr(t,B.useRef(null),i.onTriggerChange),c=B.useRef(!1),l=B.useRef(!1),u=B.useCallback(()=>c.current=!1,[]);return B.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,H.jsx)(Mu,{asChild:!0,...o,children:(0,H.jsx)(Gr.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:ti(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:ti(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:ti(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:ti(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:ti(e.onBlur,i.onClose),onClick:ti(e.onClick,i.onClose)})})});lm.displayName=cm;var um=`TooltipPortal`,[nne,rne]=nm(um,{forceMount:void 0}),dm=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=sm(um,t);return(0,H.jsx)(nne,{scope:t,forceMount:n,children:(0,H.jsx)(ci,{present:n||a.open,children:(0,H.jsx)(Wa,{asChild:!0,container:i,children:r})})})};dm.displayName=um;var fm=`TooltipContent`,pm=B.forwardRef((e,t)=>{let n=rne(fm,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=sm(fm,e.__scopeTooltip);return(0,H.jsx)(ci,{present:r||o.open,children:o.disableHoverableContent?(0,H.jsx)(mm,{side:i,...a,ref:t}):(0,H.jsx)(ine,{side:i,...a,ref:t})})}),ine=B.forwardRef((e,t)=>{let n=sm(fm,e.__scopeTooltip),r=am(fm,e.__scopeTooltip),i=B.useRef(null),a=Fr(t,i),[o,s]=B.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=B.useCallback(()=>{s(null),d(!1)},[d]),p=B.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=lne(r,cne(r,n.getBoundingClientRect())),a=une(t.getBoundingClientRect()),o=fne([...i,...a]);s(o),d(!0)},[d]);return B.useEffect(()=>()=>f(),[f]),B.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),B.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!dne(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,H.jsx)(mm,{...e,ref:a})}),[ane,one]=nm(om,{isInside:!1}),sne=Br(`TooltipContent`),mm=B.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=sm(fm,n),l=rm(n),{onClose:u}=c;return B.useEffect(()=>(document.addEventListener(im,u),()=>document.removeEventListener(im,u)),[u]),B.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,H.jsx)(ba,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,H.jsxs)(Nu,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,H.jsx)(sne,{children:r}),(0,H.jsx)(ane,{scope:n,isInside:!0,children:(0,H.jsx)(Xr,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});pm.displayName=fm;var hm=`TooltipArrow`,gm=B.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=rm(n);return one(hm,n).isInside?null:(0,H.jsx)(Pu,{...i,...r,ref:t})});gm.displayName=hm;function cne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function lne(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function une(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function dne(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function fne(e){let t=e.slice();return t.sort((e,t)=>
51e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),pne(t)}function pne(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _m=$te,vm=tne,ym=lm,bm=dm,mne=pm,hne=gm;function xm({title:e,titleIcon:t}){return(0,H.jsxs)(`div`,{className:`flex items-center justify-between
52        gap-x-2
53        pb-4 text-lg
54        text-black dark:text-white`,children:[(0,H.jsx)(t,{}),(0,H.jsx)(`div`,{className:`truncate flex-auto`,children:e}),(0,H.jsx)(Ks,{"aria-label":`Close`,className:`text-gray-500 shrink-0
55                  focus:bg-gray-200 dark:focus:bg-black
56                  hover:text-black dark:hover:text-white`,children:(0,H.jsx)(kt,{})})]})}var Sm=i(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r);return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}t.exports=r,t.exports.clsx=r})),gne=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.processClasses=void 0;var t=Sm(),n=e=>Array.isArray(e)&&Object.prototype.hasOwnProperty.call(e,`raw`);e.processClasses=(t,r,i=[])=>n(t)?a(t,r,i):typeof t==`function`?(0,e.processClasses)(t(r),r):Array.isArray(t)?t.map(t=>(0,e.processClasses)(t,r)):t;var r=(n,r)=>n.map(n=>(0,t.clsx)((0,e.processClasses)(n,r))),i=(e,t)=>(e.reduce((e,n,r)=>e+t[r]+n,``)+t[t.length-1]).replace(/\s+/g,` `).trim(),a=(e,t,n)=>i(r(n,t),e)}));function _ne(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var vne=n((()=>{})),yne=r({default:()=>wm}),Cm,wm,bne=n((()=>{vne(),Cm=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackgroun
56d|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,wm=_ne(function(e){return Cm.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),xne=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.filterPropsToForward=e.tags=void 0;var n=(bne(),t(yne));e.tags=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.big.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.foreignObject.g.image.line.linearGradient.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.text.tspan`.split(`.`);var r=t=>typeof t==`string`&&e.tags.includes(t),i=Symbol(`Forward all props`),a=e=>r(e)?n.default:i;e.filterPropsToForward=(e,t)=>{let n=a(e);return n===i?Object.assign({},t):Object.fromEntries(Object.entries(t).filter(([e])=>n(e)))}})),Tm=e(i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.classed=void 0;var t=Sm(),n=Ve(),r=gne(),i=xne(),a=e=>typeof e==`string`?e:e.displayName||e.name,o=e=>(o,...s)=>{let c=(0,n.forwardRef)((a,c)=>{let l=(0,t.clsx)((0,r.processClasses)(o,a,s),a.className),u=(0,i.filterPropsToForward)(e,a);return(0,n.createElement)(e,Object.assign(Object.assign({},u),{ref:c,className:l}))});return c.displayName=`Classed(${a(e)})`,c};
56i.tags.forEach(e=>{o[e]=o(e)}),e.classed=o,e.default=e.classed}))());function Em(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;t<i;t++)e[t]&&(n=Em(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Dm(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Em(e))&&(r&&(r+=` `),r+=t);return r}var Sne=function(e){return Cne(e)&&!wne(e)};function Cne(e){return!!e&&typeof e==`object`}function wne(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||Ene(e)}var Tne=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function Ene(e){return e.$$typeof===Tne}function Dne(e){return Array.isArray(e)?[]:{}}function Om(e,t){return t.clone!==!1&&t.isMergeableObject(e)?km(Dne(e),e,t):e}function One(e,t,n){return e.concat(t).map(function(e){return Om(e,n)})}function kne(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(t){r[t]=Om(e[t],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Om(t[i],n):r[i]=km(e[i],t[i],n)}),r}function km(e,t,n){n||={},n.arrayMerge=n.arrayMerge||One,n.isMergeableObject=n.isMergeableObject||Sne;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):kne(e,t,n):Om(t,n)}km.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return km(e,n,t)},{})};var Am=km;oe();var jm=typeof se==`object`&&se&&se.Object===Object&&se,Ane=typeof self==`object`&&self&&self.Object===Object&&self,Mm=jm||Ane||Function(`return this`)(),Nm=Mm.Symbol,Pm=Object.prototype,jne=Pm.hasOwnProperty,Mne=Pm.toString,Fm=Nm?Nm.toStringTag:void 0;function Nne(e){var t=jne.call(e,Fm),n=e[Fm];try{e[Fm]=void 0;var r=!0}catch{}var i=Mne.call(e);return r&&(t?e[Fm]=n:delete e[Fm]),i}var Pne=Object.prototype.toString;function Fne(e){return Pne.call(e)}var Ine=`[object Null]`,Lne=`[object Undefined]`,Im=Nm?Nm.toStringTag:void 0;function Lm(e){return e==null?e===void 0?Lne:Ine:Im&&Im in Object(e)?Nne(e):Fne(e)}function Rm(e,t){return function(n){return e(t(n))}}var zm=Rm(Object.getPrototypeOf,Object);function Bm(e){return typeof e==`object`&&!!e}var Rne=`[object Object]`,zne=Function.prototype,Bne=Object.prototype,Vm=zne.toString,Vne=Bne.hasOwnProperty,Hne=Vm.call(Object);function Hm(e){if(!Bm(e)||Lm(e)!=Rne)return!1;var t=zm(e);if(t===null)return!0;var n=Vne.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Vm.call(n)==Hne}function Une(){this.__data__=[],this.size=0}function Um(e,t){return e===t||e!==e&&t!==t}function Wm(e,t){for(var n=e.length;n--;)if(Um(e[n][0],t))return n;return-1}var Wne=Array.prototype.splice;function Gne(e){var t=this.__data__,n=Wm(t,e);return n<0?!1:(n==t.length-1?t.pop():Wne.call(t,n,1),--this.size,!0)}function Kne(e){var t=this.__data__,n=Wm(t,e);return n<0?void 0:t[n][1]}function qne(e){return Wm(this.__data__,e)>-1}function Jne(e,t){var n=this.__data__,r=Wm(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Gm(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gm.prototype.clear=Une,Gm.prototype.delete=Gne,Gm.prototype.get=Kne,Gm.prototype.has=qne,Gm.prototype.set=Jne;function Yne(){this.__data__=new Gm,this.size=0}function Xne(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Zne(e){return this.__data__.get(e)}function Qne(e){return this.__data__.has(e)}function Km(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var $ne=`[object AsyncFunction]`,ere=`[object Function]`,tre=`[object GeneratorFunction]`,nre=`[object Proxy]`;function qm(e){if(!Km(e))return!1;var t=Lm(e);return t==ere||t==tre||t==$ne||t==nre}var Jm=Mm[`__core-js_shared__`],Ym=function(){var e=/[^.]+$/.exec(Jm&&Jm.keys&&Jm.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function rre(e){return!!Ym&&Ym in e}var ire=Function.prototype.toString;function Xm(e){if(e!=null){try{return ire.call(e)}catch{}try{return e+``}catch{}}return``}var are=/[\\^$.*+?()[\]{}|]/g,ore=/^\[object .+?Constructor\]$/,sre=Function.prototype,cre=Object.prototype,lre=sre.toString,ure=cre.hasOwnProperty,dre=RegExp(`^`+lre.call(ure).replace(are,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function fre(e){return!Km(e)||rre(e)?!1:(qm(e)?dre:ore).test(Xm(e))}function pre(e,t){return e?.[t]}function Zm(e,t){var n=pre(e,t);return fre(n)?n:void 0}var Qm=Zm(Mm,`Map`),$m=Zm(Object,`create`);function mre(){this.__data__=$m?$m(null):{},this.size=0}function hre(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var gre=`__lodash_hash_undefined__`,_re=Object.prototype.hasOwnProperty;function vre(e){var t=this.__data__;if($m){var n=t[e];return n===gre?void 0:n}return _re.call(t,e)?t[e]:void 0}var yre=Object.prototype.hasOwnProperty;function bre(e){var t=this.__data__;return $m?t[e]!==void 0:yre.call(t,e)}var xre=`__lodash_hash_undefined__`;function Sre(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=$m&&t===void 0?xre:t,this}function eh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}eh.prototype.clear=mre,eh.prototype.delete=hre,eh.prototype.get=vre,eh.prototype.has=bre,eh.prototype.set=Sre;function Cre(){this.size=0,this.__data__={hash:new eh,map:new(Qm||Gm),string:new eh}}function wre(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function th(e,t){var n=e.__data__;return wre(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Tre(e){var t=th(this,e).delete(e);return this.size-=+!!t,t}function Ere(e){return th(this,e).get(e)}function Dre(e){return th(this,e).has(e)}function Ore(e,t){var n=th(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function nh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nh.prototype.clear=Cre,nh.prototype.delete=Tre,nh.prototype.get=Ere,nh.prototype.has=Dre,nh.prototype.set=Ore;var kre=200;function Are(e,t){var n=this.__data__;if(n instanceof Gm){var r=n.__data__;if(!Qm||r.length<kre-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nh(r)}return n.set(e,t),this.size=n.size,this}function rh(e){var t=this.__data__=new Gm(e);this.size=t.size}rh.prototype.clear=Yne,rh.prototype.delete=Xne,rh.prototype.get=Zne,rh.prototype.has=Qne,rh.prototype.set=Are;function jre(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var ih=function(){try{var e=Zm(Object,`defineProperty`);return e({},``,{}),e}catch{}}();function ah(e,t,n){t==`__proto__`&&ih?ih(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Mre=Object.prototype.hasOwnProperty;function oh(e,t,n){var r=e[t];(!(Mre.call(e,t)&&Um(r,n))||n===void 0&&!(t in e))&&ah(e,t,n)}function sh(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?ah(n,s,c):oh(n,s,c)}return n}function Nre(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Pre=`[object Arguments]`;function ch(e){return Bm(e)&&Lm(e)==Pre}var lh=Object.prototype,Fre=lh.hasOwnProperty,Ire=lh.propertyIsEnumerable,Lre=ch(function(){return arguments}())?ch:function(e){return Bm(e)&&Fre.call(e,`callee`)&&!Ire.call(e,`callee`)},uh=Array.isArray;function Rre(){return!1}var dh=typeof exports==`object`&&exports&&!exports.nodeType&&exports,fh=dh&&typeof module==`object`&&module&&!module.nodeType&&module,ph=fh&&fh.exports===dh?Mm.Buffer:void 0,mh=(ph?ph.isBuffer:void 0)||Rre,zre=9007199254740991,Bre=/^(?:0|[1-9]\d*)$/;function Vre(e,t){var n=typeof e;return t??=zre,!!t&&(n==`number`||n!=`symbol`&&Bre.test(e))&&e>-1&&e%1==0&&e<t}var Hre=9007199254740991;function hh(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Hre}var Ure=`[object Arguments]`,Wre=`[object Array]`,Gre=`[object Boolean]`,Kre=`[object Date]`,qre=`[object Error]`,Jre=`[object Function]`,Yre=`[object Map]`,Xre=`[object Number]`,Zre=`[object Object]`,Qre=`[object RegExp]`,$re=`[object Set]`,eie=`[object String]`,tie=`[object WeakMap]`,nie=`[object ArrayBuffer]`,rie=`[object DataView]`,iie=`[object Float32Array]`,aie=`[object Float64Array
56]`,oie=`[object Int8Array]`,sie=`[object Int16Array]`,cie=`[object Int32Array]`,lie=`[object Uint8Array]`,uie=`[object Uint8ClampedArray]`,die=`[object Uint16Array]`,fie=`[object Uint32Array]`,gh={};gh[iie]=gh[aie]=gh[oie]=gh[sie]=gh[cie]=gh[lie]=gh[uie]=gh[die]=gh[fie]=!0,gh[Ure]=gh[Wre]=gh[nie]=gh[Gre]=gh[rie]=gh[Kre]=gh[qre]=gh[Jre]=gh[Yre]=gh[Xre]=gh[Zre]=gh[Qre]=gh[$re]=gh[eie]=gh[tie]=!1;function pie(e){return Bm(e)&&hh(e.length)&&!!gh[Lm(e)]}function _h(e){return function(t){return e(t)}}var vh=typeof exports==`object`&&exports&&!exports.nodeType&&exports,yh=vh&&typeof module==`object`&&module&&!module.nodeType&&module,bh=yh&&yh.exports===vh&&jm.process,xh=function(){try{return yh&&yh.require&&yh.require(`util`).types||bh&&bh.binding&&bh.binding(`util`)}catch{}}(),Sh=xh&&xh.isTypedArray,mie=Sh?_h(Sh):pie,hie=Object.prototype.hasOwnProperty;function Ch(e,t){var n=uh(e),r=!n&&Lre(e),i=!n&&!r&&mh(e),a=!n&&!r&&!i&&mie(e),o=n||r||i||a,s=o?Nre(e.length,String):[],c=s.length;for(var l in e)(t||hie.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Vre(l,c)))&&s.push(l);return s}var gie=Object.prototype;function wh(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||gie)}var _ie=Rm(Object.keys,Object),vie=Object.prototype.hasOwnProperty;function yie(e){if(!wh(e))return _ie(e);var t=[];for(var n in Object(e))vie.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Th(e){return e!=null&&hh(e.length)&&!qm(e)}function Eh(e){return Th(e)?Ch(e):yie(e)}function bie(e,t){return e&&sh(t,Eh(t),e)}function xie(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Sie=Object.prototype.hasOwnProperty;function Cie(e){if(!Km(e))return xie(e);var t=wh(e),n=[];for(var r in e)r==`constructor`&&(t||!Sie.call(e,r))||n.push(r);return n}function Dh(e){return Th(e)?Ch(e,!0):Cie(e)}function wie(e,t){return e&&sh(t,Dh(t),e)}var Tie=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Eie=Tie&&typeof module==`object`&&module&&!module.nodeType&&module,Die=Eie&&Eie.exports===Tie?Mm.Buffer:void 0,Oie=Die?Die.allocUnsafe:void 0;function kie(e,t){if(t)return e.slice();var n=e.length,r=Oie?Oie(n):new e.constructor(n);return e.copy(r),r}function Aie(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function jie(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Mie(){return[]}var Nie=Object.prototype.propertyIsEnumerable,Pie=Object.getOwnPropertySymbols,Oh=Pie?function(e){return e==null?[]:(e=Object(e),jie(Pie(e),function(t){return Nie.call(e,t)}))}:Mie;function Fie(e,t){return sh(e,Oh(e),t)}function Iie(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Lie=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Iie(t,Oh(e)),e=zm(e);return t}:Mie;function Rie(e,t){return sh(e,Lie(e),t)}function zie(e,t,n){var r=t(e);return uh(e)?r:Iie(r,n(e))}function Bie(e){return zie(e,Eh,Oh)}function Vie(e){return zie(e,Dh,Lie)}var kh=Zm(Mm,`DataView`),Ah=Zm(Mm,`Promise`),jh=Zm(Mm,`Set`),Mh=Zm(Mm,`WeakMap`),Hie=`[object Map]`,Uie=`[object Object]`,Wie=`[object Promise]`,Gie=`[object Set]`,Kie=`[object WeakMap]`,qie=`[object DataView]`,Jie=Xm(kh),Yie=Xm(Qm),Xie=Xm(Ah),Zie=Xm(jh),Qie=Xm(Mh),Nh=Lm;(kh&&Nh(new kh(new ArrayBuffer(1)))!=qie||Qm&&Nh(new Qm)!=Hie||Ah&&Nh(Ah.resolve())!=Wie||jh&&Nh(new jh)!=Gie||Mh&&Nh(new Mh)!=Kie)&&(Nh=function(e){var t=Lm(e),n=t==Uie?e.constructor:void 0,r=n?Xm(n):``;if(r)switch(r){case Jie:return qie;case Yie:return Hie;case Xie:return Wie;case Zie:return Gie;case Qie:return Kie}return t});var Ph=Nh,$ie=Object.prototype.hasOwnProperty;function eae(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&$ie.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var tae=Mm.Uint8Array;function Fh(e){var t=new e.constructor(e.byteLength);return new tae(t).set(new tae(e)),t}function nae(e,t){var n=t?Fh(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var rae=/\w*$/;function iae(e){var t=new e.constructor(e.source,rae.exec(e));return t.lastIndex=e.lastIndex,t}var aae=Nm?Nm.prototype:void 0,oae=aae?aae.valueOf:void 0;function sae(e){return oae?Object(oae.call(e)):{}}function cae(e,t){var n=t?Fh(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var lae=`[object Boolean]`,uae=`[object Date]`,dae=`[object Map]`,fae=`[object Number]`,pae=`[object RegExp]`,mae=`[object Set]`,hae=`[object String]`,gae
56=`[object Symbol]`,_ae=`[object ArrayBuffer]`,vae=`[object DataView]`,yae=`[object Float32Array]`,bae=`[object Float64Array]`,xae=`[object Int8Array]`,Sae=`[object Int16Array]`,Cae=`[object Int32Array]`,wae=`[object Uint8Array]`,Tae=`[object Uint8ClampedArray]`,Eae=`[object Uint16Array]`,Dae=`[object Uint32Array]`;function Oae(e,t,n){var r=e.constructor;switch(t){case _ae:return Fh(e);case lae:case uae:return new r(+e);case vae:return nae(e,n);case yae:case bae:case xae:case Sae:case Cae:case wae:case Tae:case Eae:case Dae:return cae(e,n);case dae:return new r;case fae:case hae:return new r(e);case pae:return iae(e);case mae:return new r;case gae:return sae(e)}}var kae=Object.create,Aae=function(){function e(){}return function(t){if(!Km(t))return{};if(kae)return kae(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function jae(e){return typeof e.constructor==`function`&&!wh(e)?Aae(zm(e)):{}}var Mae=`[object Map]`;function Nae(e){return Bm(e)&&Ph(e)==Mae}var Pae=xh&&xh.isMap,Fae=Pae?_h(Pae):Nae,Iae=`[object Set]`;function Lae(e){return Bm(e)&&Ph(e)==Iae}var Rae=xh&&xh.isSet,zae=Rae?_h(Rae):Lae,Bae=1,Vae=2,Hae=4,Uae=`[object Arguments]`,Wae=`[object Array]`,Gae=`[object Boolean]`,Kae=`[object Date]`,qae=`[object Error]`,Jae=`[object Function]`,Yae=`[object GeneratorFunction]`,Xae=`[object Map]`,Zae=`[object Number]`,Qae=`[object Object]`,$ae=`[object RegExp]`,eoe=`[object Set]`,toe=`[object String]`,noe=`[object Symbol]`,roe=`[object WeakMap]`,ioe=`[object ArrayBuffer]`,aoe=`[object DataView]`,ooe=`[object Float32Array]`,soe=`[object Float64Array]`,coe=`[object Int8Array]`,loe=`[object Int16Array]`,uoe=`[object Int32Array]`,doe=`[object Uint8Array]`,foe=`[object Uint8ClampedArray]`,poe=`[object Uint16Array]`,moe=`[object Uint32Array]`,Ih={};Ih[Uae]=Ih[Wae]=Ih[ioe]=Ih[aoe]=Ih[Gae]=Ih[Kae]=Ih[ooe]=Ih[soe]=Ih[coe]=Ih[loe]=Ih[uoe]=Ih[Xae]=Ih[Zae]=Ih[Qae]=Ih[$ae]=Ih[eoe]=Ih[toe]=Ih[noe]=Ih[doe]=Ih[foe]=Ih[poe]=Ih[moe]=!0,Ih[qae]=Ih[Jae]=Ih[roe]=!1;function Lh(e,t,n,r,i,a){var o,s=t&Bae,c=t&Vae,l=t&Hae;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!Km(e))return e;var u=uh(e);if(u){if(o=eae(e),!s)return Aie(e,o)}else{var d=Ph(e),f=d==Jae||d==Yae;if(mh(e))return kie(e,s);if(d==Qae||d==Uae||f&&!i){if(o=c||f?{}:jae(e),!s)return c?Rie(e,wie(o,e)):Fie(e,bie(o,e))}else{if(!Ih[d])return i?e:{};o=Oae(e,d,s)}}a||=new rh;var p=a.get(e);if(p)return p;a.set(e,o),zae(e)?e.forEach(function(r){o.add(Lh(r,t,n,r,e,a))}):Fae(e)&&e.forEach(function(r,i){o.set(i,Lh(r,t,n,i,e,a))});var m=u?void 0:(l?c?Vie:Bie:c?Dh:Eh)(e);return jre(m||e,function(r,i){m&&(i=r,r=e[i]),oh(o,i,Lh(r,t,n,i,e,a))}),o}var hoe=1,goe=4;function Rh(e){return Lh(e,hoe|goe)}var zh=e(i(((e,t)=>{var n=Array.isArray,r=Object.keys,i=Object.prototype.hasOwnProperty,a=typeof Element<`u`;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){var s=n(e),c=n(t),l,u,d;if(s&&c){if(u=e.length,u!=t.length)return!1;for(l=u;l--!==0;)if(!o(e[l],t[l]))return!1;return!0}if(s!=c)return!1;var f=e instanceof Date,p=t instanceof Date;if(f!=p)return!1;if(f&&p)return e.getTime()==t.getTime();var m=e instanceof RegExp,h=t instanceof RegExp;if(m!=h)return!1;if(m&&h)return e.toString()==t.toString();var g=r(e);if(u=g.length,u!==r(t).length)return!1;for(l=u;l--!==0;)if(!i.call(t,g[l]))return!1;if(a&&e instanceof Element&&t instanceof Element)return e===t;for(l=u;l--!==0;)if(d=g[l],!(d===`_owner`&&e.$$typeof)&&!o(e[d],t[d]))return!1;return!0}return e!==e&&t!==t}t.exports=function(e,t){try{return o(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||e.number===-2146828260)return console.warn(`Warning: react-fast-compare does not handle circular references.`,e.name,e.message),!1;throw e}}}))()),_oe=4;function voe(e){return Lh(e,_oe)}function yoe(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var boe=`[object Symbol]`;function Bh(e){return typeof e==`symbol`||Bm(e)&&Lm(e)==boe}var xoe=`Expected a function`;function Vh(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(xoe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Vh.Cache||nh),n}Vh.Cache=nh;var Soe=500;function Coe(e){var t=Vh(e,function(e){return n.size===Soe&&n.clear(),e}),n=t.cache;return t}var woe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Toe=/\\(\\)?/g,Eoe=Coe(function(e){var t=[];
56return e.charCodeAt(0)===46&&t.push(``),e.replace(woe,function(e,n,r,i){t.push(r?i.replace(Toe,`$1`):n||e)}),t}),Doe=1/0;function Ooe(e){if(typeof e==`string`||Bh(e))return e;var t=e+``;return t==`0`&&1/e==-Doe?`-0`:t}var koe=1/0,Aoe=Nm?Nm.prototype:void 0,joe=Aoe?Aoe.toString:void 0;function Moe(e){if(typeof e==`string`)return e;if(uh(e))return yoe(e,Moe)+``;if(Bh(e))return joe?joe.call(e):``;var t=e+``;return t==`0`&&1/e==-koe?`-0`:t}function Noe(e){return e==null?``:Moe(e)}function Poe(e){return uh(e)?yoe(e,Ooe):Bh(e)?[e]:Aie(Eoe(Noe(e)))}var Foe=i((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),Ioe=i(((e,t)=>{t.exports=Foe()})),Loe=e(i(((e,t)=>{var n=Ioe(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=a,s[n.Memo]=o;function c(e){return n.isMemo(e)?o:s[e.$$typeof]||r}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function h(e,t,n){if(typeof t!=`string`){if(m){var r=p(t);r&&r!==m&&h(e,r,n)}var a=u(t);d&&(a=a.concat(d(t)));for(var o=c(e),s=c(t),g=0;g<a.length;++g){var _=a[g];if(!i[_]&&!(n&&n[_])&&!(s&&s[_])&&!(o&&o[_])){var v=f(t,_);try{l(e,_,v)}catch{}}}}return e}t.exports=h}))());function Hh(){return Hh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hh.apply(this,arguments)}function Roe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Uh(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function zoe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var Wh=(0,B.createContext)(void 0);Wh.displayName=`FormikContext`;var Boe=Wh.Provider,Voe=Wh.Consumer;function Gh(){return(0,B.useContext)(Wh)}var Hoe=function(e){return Array.isArray(e)&&e.length===0},Kh=function(e){return typeof e==`function`},qh=function(e){return typeof e==`object`&&!!e},Uoe=function(e){return String(Math.floor(Number(e)))===e},Jh=function(e){return Object.prototype.toString.call(e)===`[object String]`},Woe=function(e){return B.Children.count(e)===0},Yh=function(e){return qh(e)&&Kh(e.then)};function Xh(e,t,n,r){r===void 0&&(r=0);for(var i=Poe(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function Zh(e,t,n){for(var r=voe(e),i=r,a=0,o=Poe(t);a<o.length-1;a++){var s=o[a],c=Xh(e,o.slice(0,a+1));if(c&&(qh(c)||Array.isArray(c)))i=i[s]=voe(c);else{var l=o[a+1];i=i[s]=Uoe(l)&&Number(l)>=0?[]:{}}}return(a===0?e:i)[o[a]]===n?e:(n===void 0?delete i[o[a]]:i[o[a]]=n,a===0&&n===void 0&&delete r[o[a]],r)}
56function Goe(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],s=e[o];qh(s)?n.get(s)||(n.set(s,!0),r[o]=Array.isArray(s)?[]:{},Goe(s,t,n,r[o])):r[o]=t}return r}function Koe(e,t){switch(t.type){case`SET_VALUES`:return Hh({},e,{values:t.payload});case`SET_TOUCHED`:return Hh({},e,{touched:t.payload});case`SET_ERRORS`:return(0,zh.default)(e.errors,t.payload)?e:Hh({},e,{errors:t.payload});case`SET_STATUS`:return Hh({},e,{status:t.payload});case`SET_ISSUBMITTING`:return Hh({},e,{isSubmitting:t.payload});case`SET_ISVALIDATING`:return Hh({},e,{isValidating:t.payload});case`SET_FIELD_VALUE`:return Hh({},e,{values:Zh(e.values,t.payload.field,t.payload.value)});case`SET_FIELD_TOUCHED`:return Hh({},e,{touched:Zh(e.touched,t.payload.field,t.payload.value)});case`SET_FIELD_ERROR`:return Hh({},e,{errors:Zh(e.errors,t.payload.field,t.payload.value)});case`RESET_FORM`:return Hh({},e,t.payload);case`SET_FORMIK_STATE`:return t.payload(e);case`SUBMIT_ATTEMPT`:return Hh({},e,{touched:Goe(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case`SUBMIT_FAILURE`:return Hh({},e,{isSubmitting:!1});case`SUBMIT_SUCCESS`:return Hh({},e,{isSubmitting:!1});default:return e}}var Qh={},$h={};function qoe(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,a=e.validateOnMount,o=a===void 0?!1:a,s=e.isInitialValid,c=e.enableReinitialize,l=c===void 0?!1:c,u=e.onSubmit,d=Uh(e,[`validateOnChange`,`validateOnBlur`,`validateOnMount`,`isInitialValid`,`enableReinitialize`,`onSubmit`]),f=Hh({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:u},d),p=(0,B.useRef)(f.initialValues),m=(0,B.useRef)(f.initialErrors||Qh),h=(0,B.useRef)(f.initialTouched||$h),g=(0,B.useRef)(f.initialStatus),_=(0,B.useRef)(!1),v=(0,B.useRef)({});(0,B.useEffect)(function(){return _.current=!0,function(){_.current=!1}},[]);var y=(0,B.useState)(0)[1],b=(0,B.useRef)({values:Rh(f.initialValues),errors:Rh(f.initialErrors)||Qh,touched:Rh(f.initialTouched)||$h,status:Rh(f.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),x=b.current,S=(0,B.useCallback)(function(e){var t=b.current;b.current=Koe(t,e),t!==b.current&&y(function(e){return e+1})},[]),C=(0,B.useCallback)(function(e,t){return new Promise(function(n,r){var i=f.validate(e,t);i==null?n(Qh):Yh(i)?i.then(function(e){n(e||Qh)},function(e){r(e)}):n(i)})},[f.validate]),w=(0,B.useCallback)(function(e,t){var n=f.validationSchema,r=Kh(n)?n(t):n,i=t&&r.validateAt?r.validateAt(t,e):Yoe(e,r);return new Promise(function(e,t){i.then(function(){e(Qh)},function(n){n.name===`ValidationError`?e(Joe(n)):t(n)})})},[f.validationSchema]),T=(0,B.useCallback)(function(e,t){return new Promise(function(n){return n(v.current[e].validate(t))})},[]),E=(0,B.useCallback)(function(e){var t=Object.keys(v.current).filter(function(e){return Kh(v.current[e].validate)}),n=t.length>0?t.map(function(t){return T(t,Xh(e,t))}):[Promise.resolve(`DO_NOT_DELETE_YOU_WILL_BE_FIRED`)];return Promise.all(n).then(function(e){return e.reduce(function(e,n,r){return n===`DO_NOT_DELETE_YOU_WILL_BE_FIRED`||n&&(e=Zh(e,t[r],n)),e},{})})},[T]),D=(0,B.useCallback)(function(e){return Promise.all([E(e),f.validationSchema?w(e):{},f.validate?C(e):{}]).then(function(e){var t=e[0],n=e[1],r=e[2];return Am.all([t,n,r],{arrayMerge:Xoe})})},[f.validate,f.validationSchema,E,C,w]),O=ng(function(e){return e===void 0&&(e=x.values),S({type:`SET_ISVALIDATING`,payload:!0}),D(e).then(function(e){return _.current&&(S({type:`SET_ISVALIDATING`,payload:!1}),S({type:`SET_ERRORS`,payload:e})),e})});(0,B.useEffect)(function(){o&&_.current===!0&&(0,zh.default)(p.current,f.initialValues)&&O(p.current)},[o,O]);var k=(0,B.useCallback)(function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:m.current?m.current:f.initialErrors||{},r=e&&e.touched?e.touched:h.current?h.current:f.initialTouched||{},i=e&&e.status?e.status:g.current?g.current:f.initialStatus;p.current=t,m.current=n,h.current=r,g.current=i;var a=function(){S({type:`RESET_FORM`,payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&typeof e.submitCount==`number`?e.submitCount:0}})};if(f.onReset){var o=f.onReset(x.values,ce);Yh(o)?o.then(a):a()}else a()},[f.initialErrors,f.initialStatus,f.initialTouched,f.onReset]);(0,B.useEffect)(function(){_.current===!0&&!(0,zh.default)(p.current,f.initialValues)&&l&&(p.current=f.initialValues,k(),o&&O(p.current))},[l,f.initialValues,k,o,O]),(0,B.useEffect)(function(){l&&_.current===!0&&!(0,zh.default)(m.current,f.initialErrors)&&(m.current=f.initialErrors||Qh,S({type:`SET_ERRORS`,payload:f.initialErrors||Qh}))},[l,f.initialErrors]),(0,B.useEffect)(function(){l&&_.current===!0&&!(0,zh.default)(h.current,f.initialTouched)&&(h.current=f.initialTouched||$h,S({type:`SET_TOUCHED`,payload:f.initialTouched||$h}))},[l,f.initialTouched]),(0,B.useEffect)(function(){l&&_.current===!0&&!(0,zh.default)(g.current,f.initialStatus)&&(g.current=f.initialStatus,S({type:`SET_STATUS`,payload:f.initialStatus}))},[l,f.initialStatus,f.initialTouched]);var A=ng(function(e){if(v.current[e]&&Kh(v.current[e].validate)){var t=Xh(x.values,e),n=v.current[e].validate(t);return Yh(n)?(S({type:`SET_ISVALIDATING`,payload:!0}),n.then(function(e){return e}).then(function(t){S({type:`SET_FIELD_ERROR`,payload:{field:e,value:t}}),S({type:`SET_ISVALIDATING`,payload:!1})})):(S({type:`SET_FIELD_ERROR`,payload:{field:e,value:n}}),Promise.resolve(n))}else if(f.validationSchema)return S({type:`SET_ISVALIDATING`,payload:!0}),w(x.values,e).then(function(e){return e}).then(function(t){S({type:`SET_FIELD_ERROR`,payload:{field:e,value:Xh(t,e)}}),S({type:`SET_ISVALIDATING`,payload:!1})});return Promise.resolve()}),j=(0,B.useCallback)(function(e,t){var n=t.validate;v.current[e]={validate:n}},[]),M=(0,B.useCallback)(function(e){delete v.current[e]},[]),N=ng(function(e,t){return S({type:`SET_TOUCHED`,payload:e}),(t===void 0?i:t)?O(x.values):Promise.resolve()}
56),P=(0,B.useCallback)(function(e){S({type:`SET_ERRORS`,payload:e})},[]),F=ng(function(e,t){var r=Kh(e)?e(x.values):e;return S({type:`SET_VALUES`,payload:r}),(t===void 0?n:t)?O(r):Promise.resolve()}),I=(0,B.useCallback)(function(e,t){S({type:`SET_FIELD_ERROR`,payload:{field:e,value:t}})},[]),L=ng(function(e,t,r){var i=Kh(t)?t(Xh(x.values,e)):t;return S({type:`SET_FIELD_VALUE`,payload:{field:e,value:i}}),(r===void 0?n:r)?O(Zh(x.values,e,i)):Promise.resolve()}),R=(0,B.useCallback)(function(e,t){var n=t,r=e,i;if(!Jh(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,s=a.name,c=a.id,l=a.value,u=a.checked;a.outerHTML;var d=a.options,f=a.multiple;n=t||s||c,r=/number|range/.test(o)?(i=parseFloat(l),isNaN(i)?``:i):/checkbox/.test(o)?Qoe(Xh(x.values,n),u,l):d&&f?Zoe(d):l}n&&L(n,r)},[L,x.values]),ee=ng(function(e){if(Jh(e))return function(t){return R(t,e)};R(e)}),z=ng(function(e,t,n){return t===void 0&&(t=!0),S({type:`SET_FIELD_TOUCHED`,payload:{field:e,value:t}}),(n===void 0?i:n)?O(x.values):Promise.resolve()}),te=(0,B.useCallback)(function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id;n.outerHTML,z(t||r||i,!0)},[z]),ne=ng(function(e){if(Jh(e))return function(t){return te(t,e)};te(e)}),re=(0,B.useCallback)(function(e){Kh(e)?S({type:`SET_FORMIK_STATE`,payload:e}):S({type:`SET_FORMIK_STATE`,payload:function(){return e}})},[]),ie=(0,B.useCallback)(function(e){S({type:`SET_STATUS`,payload:e})},[]),ae=(0,B.useCallback)(function(e){S({type:`SET_ISSUBMITTING`,payload:e})},[]),oe=ng(function(){return S({type:`SUBMIT_ATTEMPT`}),O().then(function(e){var t=e instanceof Error;if(!t&&Object.keys(e).length===0){var n;try{if(n=le(),n===void 0)return}catch(e){throw e}return Promise.resolve(n).then(function(e){return _.current&&S({type:`SUBMIT_SUCCESS`}),e}).catch(function(e){if(_.current)throw S({type:`SUBMIT_FAILURE`}),e})}else if(_.current&&(S({type:`SUBMIT_FAILURE`}),t))throw e})}),se=ng(function(e){e&&e.preventDefault&&Kh(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Kh(e.stopPropagation)&&e.stopPropagation(),oe().catch(function(e){console.warn(`Warning: An unhandled error was caught from submitForm()`,e)})}),ce={resetForm:k,validateForm:O,validateField:A,setErrors:P,setFieldError:I,setFieldTouched:z,setFieldValue:L,setStatus:ie,setSubmitting:ae,setTouched:N,setValues:F,setFormikState:re,submitForm:oe},le=ng(function(){return u(x.values,ce)}),ue=ng(function(e){e&&e.preventDefault&&Kh(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Kh(e.stopPropagation)&&e.stopPropagation(),k()}),de=(0,B.useCallback)(function(e){return{value:Xh(x.values,e),error:Xh(x.errors,e),touched:!!Xh(x.touched,e),initialValue:Xh(p.current,e),initialTouched:!!Xh(h.current,e),initialError:Xh(m.current,e)}},[x.errors,x.touched,x.values]),fe=(0,B.useCallback)(function(e){return{setValue:function(t,n){return L(e,t,n)},setTouched:function(t,n){return z(e,t,n)},setError:function(t){return I(e,t)}}},[L,z,I]),pe=(0,B.useCallback)(function(e){var t=qh(e),n=t?e.name:e,r=Xh(x.values,n),i={name:n,value:r,onChange:ee,onBlur:ne};if(t){var a=e.type,o=e.value,s=e.as,c=e.multiple;a===`checkbox`?o===void 0?i.checked=!!r:(i.checked=!!(Array.isArray(r)&&~r.indexOf(o)),i.value=o):a===`radio`?(i.checked=r===o,i.value=o):s===`select`&&c&&(i.value=i.value||[],i.multiple=!0)}return i},[ne,ee,x.values]),me=(0,B.useMemo)(function(){return!(0,zh.default)(p.current,x.values)},[p.current,x.values]),he=(0,B.useMemo)(function(){return s===void 0||me?x.errors&&Object.keys(x.errors).length===0:s!==!1&&Kh(s)?s(f):s},[s,me,x.errors,f]);return Hh({},x,{initialValues:p.current,initialErrors:m.current,initialTouched:h.current,initialStatus:g.current,handleBlur:ne,handleChange:ee,handleReset:ue,handleSubmit:se,resetForm:k,setErrors:P,setFormikState:re,setFieldTouched:z,setFieldValue:L,setFieldError:I,setStatus:ie,setSubmitting:ae,setTouched:N,setValues:F,submitForm:oe,validateForm:O,validateField:A,isValid:he,dirty:me,unregisterField:M,registerField:j,getFieldProps:pe,getFieldMeta:de,getFieldHelpers:fe,validateOnBlur:i,validateOnChange:n,validateOnMount:o})}function eg(e){var t=qoe(e),n=e.component,r=e.children,i=e.render,a=e.innerRef;return(0,B.useImperativeHandle)(a,function(){return t}),(0,B.createElement)(Boe,{value:t},n?(0,B.createElement)(n,t):i?i(t):r?Kh(r)?r(t):Woe(r)?null:B.Children.only(r):null)}function Joe(e){var t={};if(e.inner){if(e.inner.length===0)return Zh(t,e.path,e.message);for(var n=e.inner,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var o=a;Xh(t,o.path)||(t=Zh(t,o.path,o.message))}}return t}function Yoe(e,t,n,r){n===void 0&&(n=!1);var i=tg(e);return t[n?`validateSync`:`validate`](i,{abortEarly:!1,context:r||i})}function tg(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(e){return Array.isArray(e)===!0||Hm(e)?tg(e):e===``?void 0:e}):Hm(e[r])?t[r]=tg(e[r]):t[r]=e[r]===``?void 0:e[r]}return t}function Xoe(e,t,n){var r=e.slice();return t.forEach(function(t,i){r[i]===void 0?r[i]=n.clone!==!1&&n.isMergeableObject(t)?Am(Array.isArray(t)?[]:{},t,n):t:n.isMergeableObject(t)?r[i]=Am(e[i],t,n):e.indexOf(t)===-1&&r.push(t)}),r}function Zoe(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}function Qoe(e,t,n){if(typeof e==`boolean`)return!!t;var r=[],i=!1,a=-1;if(Array.isArray(e))r=e,a=e.indexOf(n),i=a>=0;
56else if(!n||n==`true`||n==`false`)return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,a).concat(r.slice(a+1)):r}var $oe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?B.useLayoutEffect:B.useEffect;function ng(e){var t=(0,B.useRef)(e);return $oe(function(){t.current=e}),(0,B.useCallback)(function(){var e=[...arguments];return t.current.apply(void 0,e)},[])}function ese(e){var t=Gh(),n=t.getFieldProps,r=t.getFieldMeta,i=t.getFieldHelpers,a=t.registerField,o=t.unregisterField,s=qh(e)?e:{name:e},c=s.name,l=s.validate;(0,B.useEffect)(function(){return c&&a(c,{validate:l}),function(){c&&o(c)}},[a,o,c,l]);var u=(0,B.useMemo)(function(){return i(c)},[i,c]);return[n(s),r(c),u]}function rg(e){var t=e.validate,n=e.name,r=e.render,i=e.children,a=e.as,o=e.component,s=e.className,c=Uh(e,[`validate`,`name`,`render`,`children`,`as`,`component`,`className`]),l=Uh(Gh(),[`validate`,`validationSchema`]),u=l.registerField,d=l.unregisterField;(0,B.useEffect)(function(){return u(n,{validate:t}),function(){d(n)}},[u,d,n,t]);var f=l.getFieldProps(Hh({name:n},c)),p=l.getFieldMeta(n),m={field:f,form:l};if(r)return r(Hh({},m,{meta:p}));if(Kh(i))return i(Hh({},m,{meta:p}));if(o){if(typeof o==`string`){var h=c.innerRef,g=Uh(c,[`innerRef`]);return(0,B.createElement)(o,Hh({ref:h},f,g,{className:s}),i)}return(0,B.createElement)(o,Hh({field:f,form:l},c,{className:s}),i)}var _=a||`input`;if(typeof _==`string`){var v=c.innerRef,y=Uh(c,[`innerRef`]);return(0,B.createElement)(_,Hh({ref:v},f,y,{className:s}),i)}return(0,B.createElement)(_,Hh({},f,c,{className:s}),i)}var ig=(0,B.forwardRef)(function(e,t){var n=e.action,r=Uh(e,[`action`]),i=n??`#`,a=Gh(),o=a.handleReset,s=a.handleSubmit;return(0,B.createElement)(`form`,Hh({onSubmit:s,ref:t,onReset:o,action:i},r))});ig.displayName=`Form`;function tse(e){var t=function(t){return(0,B.createElement)(Voe,null,function(n){return(0,B.createElement)(e,Hh({},t,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||`Component`;return t.WrappedComponent=e,t.displayName=`FormikConnect(`+n+`)`,(0,Loe.default)(t,e)}var nse=function(e,t,n){var r=og(e),i=r[t];return r.splice(t,1),r.splice(n,0,i),r},rse=function(e,t,n){var r=og(e),i=r[t];return r[t]=r[n],r[n]=i,r},ag=function(e,t,n){var r=og(e);return r.splice(t,0,n),r},ise=function(e,t,n){var r=og(e);return r[t]=n,r},og=function(e){if(!e)return[];if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map(function(e){return parseInt(e)}).reduce(function(e,t){return t>e?t:e},0);return Array.from(Hh({},e,{length:t+1}))},ase=function(e,t){var n=typeof e==`function`?e:t;return function(e){return Array.isArray(e)||qh(e)?n(og(e)):e}},ose=function(e){Roe(t,e);function t(t){var n=e.call(this,t)||this;return n.updateArrayField=function(e,t,r){var i=n.props,a=i.name,o=i.formik.setFormikState;o(function(n){var i=ase(r,e),o=ase(t,e),s=Zh(n.values,a,e(Xh(n.values,a))),c=r?i(Xh(n.errors,a)):void 0,l=t?o(Xh(n.touched,a)):void 0;return Hoe(c)&&(c=void 0),Hoe(l)&&(l=void 0),Hh({},n,{values:s,errors:r?Zh(n.errors,a,c):n.errors,touched:t?Zh(n.touched,a,l):n.touched})})},n.push=function(e){return n.updateArrayField(function(t){return[].concat(og(t),[Rh(e)])},!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField(function(n){return rse(n,e,t)},!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField(function(n){return nse(n,e,t)},!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField(function(n){return ag(n,e,t)},function(t){return ag(t,e,null)},function(t){return ag(t,e,null)})},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField(function(n){return ise(n,e,t)},!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField(function(n){var r=n?[e].concat(n):[e];return t=r.length,r},function(e){return e?[null].concat(e):[null]},function(e){return e?[null].concat(e):[null]}),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(zoe(n)),n.pop=n.pop.bind(zoe(n)),n}var n=t.prototype;return n.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!(0,zh.default)(Xh(e.formik.values,e.name),Xh(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(e){var t;return this.updateArrayField(function(n){var r=n?og(n):[];return t||=r[e],Kh(r.splice)&&r.splice(e,1),Kh(r.every)&&r.every(function(e){return e===void 0})?[]:r},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var n=t.slice();return e||=n&&n.pop&&n.pop(),n},!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,a=t.name,o=t.formik,s=Uh(o,[`validate`,`validationSchema`]),c=Hh({},e,{form:s,name:a});return n?(0,B.createElement)(n,c):r?r(c):i?typeof i==`function`?i(c):Woe(i)?null:B.Children.only(i):null},t}(B.Component);ose.defaultProps={validateOnChange:!0};var sse=tse(ose),sg=tse(function(e){Roe(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.shouldComponentUpdate=function(e){return Xh(this.props.formik.errors,this.props.name)!==Xh(e.formik.errors,this.props.name)||Xh(this.props.formik.touched,this.props.name)!==Xh(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,i=e.children,a=e.name,o=Uh(e,[`component`,`formik`,`render`,`children`,`name`]),s=Xh(n.touched,a),c=Xh(n.errors,a);return s&&c?r?Kh(r)?r(c):null:i?Kh(i)?i(c):null:t?(0,B.createElement)(t,o,c):c:null},t}(B.Component));function cse(...e){}function lse({children:e}
56){return(0,H.jsxs)(vm,{delayDuration:0,children:[(0,H.jsx)(ym,{className:`dark:text-white align-middle`,children:(0,H.jsx)(er,{})}),(0,H.jsx)(bm,{children:(0,H.jsx)(fg,{children:(0,H.jsx)(`div`,{className:`w-36`,children:e})})})]})}function use({className:e}){let t={r:`17.5`,stroke:`currentColor`,strokeWidth:`15`};return(0,H.jsxs)(`svg`,{viewBox:`0 0 300 300`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:e,children:[(0,H.jsx)(`circle`,{cx:`75`,cy:`75`,...t}),(0,H.jsx)(`circle`,{cx:`225`,cy:`225`,...t}),(0,H.jsx)(`circle`,{cx:`225`,cy:`75`,...t}),(0,H.jsx)(`circle`,{cx:`75`,cy:`225`,...t}),(0,H.jsx)(`line`,{x1:`75`,y1:`95`,x2:`75`,y2:`208`,stroke:`currentColor`,strokeWidth:`20`}),(0,H.jsx)(`line`,{x1:`226`,y1:`95`,x2:`226`,y2:`208`,stroke:`currentColor`,strokeWidth:`20`}),(0,H.jsx)(`line`,{x1:`95`,y1:`75`,x2:`208`,y2:`75`,stroke:`currentColor`,strokeWidth:`20`}),(0,H.jsx)(`line`,{x1:`95`,y1:`225`,x2:`208`,y2:`225`,stroke:`currentColor`,strokeWidth:`20`}),(0,H.jsx)(`rect`,{x:`110`,y:`110`,width:`80`,height:`80`,rx:`5`,fill:`currentColor`})]})}function dse({children:e}){return(0,H.jsx)(`div`,{className:`absolute inset-0 z-50 flex items-center justify-center bg-gray-500 pointer-events-none bg-opacity-75`,children:(0,H.jsx)(`div`,{className:`px-3 py-2 text-white bg-gray-500 rounded-md max-w-36`,children:e})})}function fse(e){return(0,H.jsxs)(`div`,{className:`max-w-xl p-4`,children:[(0,H.jsxs)(Vg,{size:`md`,children:[`Sorry, an unexpected error occurred. The error’s already been automatically reported, but if you can let us know what happened, we can fix it even faster:`,` `,(0,H.jsx)(`a`,{href:`mailto:${y}?subject=Error (ID: ${e.eventId||`?`})`,className:Tg,children:y}),`.`]}),e.resetError?(0,H.jsx)(`div`,{className:`pt-2`,children:(0,H.jsx)(Fg,{onClick:()=>e.resetError(),children:`Retry`})}):null]})}var pse=class extends B.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){t.componentStack}render(){return this.state.hasError&&this.state.error?this.props.fallback(this.state.error):this.props.children}};function cg({children:e}){return(0,H.jsx)(pse,{fallback:fse,children:e})}function lg({size:e=`sm`}){return(0,H.jsxs)(`div`,{className:Dm({"h-32":e===`sm`,"h-16":e===`xs`},`text-gray-500 flex items-center justify-center`),children:[(0,H.jsx)(gr,{className:`animate-spin`}),(0,H.jsx)(`span`,{className:`ml-2`,children:`Loading…`})]})}var mse=Tm.default.label(`block uppercase font-semibold text-gray-500 dark:text-gray-500 text-xs`),hse=(0,Tm.default)(see)(`fixed inset-0 bg-black/20 dark:bg-white/20 z-50 placemark-fadein`),gse=(0,Tm.default)(Gs)(({size:e=`sm`})=>Dm({"p-4":e===`sm`,"p-0":e===`xs`},`fixed inline-block w-full
57      max-h-screen
58      text-left
59      align-bottom
60      bg-white dark:bg-gray-900
61      dark:text-white
62      shadow-md dark:shadow-none dark:border dark:border-black
63      sm:rounded-sm sm:align-middle sm:max-w-lg
64      left-2/4 top-2/4 -translate-x-1/2 -translate-y-1/2
65      overflow-y-auto placemark-scrollbar
66      z-50
67      `)),ug=({variant:e=`default`})=>Dm([Mg(`primary`),{"text-purple-500 focus:ring-purple-500":e===`primary`,"text-gray-500 border-gray-500 hover:border-gray-700 dark:hover:border-gray-300 focus:ring-gray-500":e==="default"},`rounded-sm dark:ring-offset-gray-700`]),dg=(0,Tm.default)(rg)(ug),fg=(0,Tm.default)(mne)(({size:e=`sm`})=>[{"max-w-md":e===`sm`,"w-64":e===`md`},`px-2 py-1 rounded
68  z-50
69  text-sm
70  border
71  shadow-xs
72  text-gray-700          dark:text-white
73  bg-white               dark:bg-gray-900
74  border-gray-200        dark:border-gray-600
75  `]);function pg(e,t=!1){return Dm({"pl-3":e===`left`,"pl-2":e===`right`,"px-2":e===`table`},t?`text-gray-700 dark:text-gray-100 opacity-70`:`text-gray-700 dark:text-gray-100`,`bg-transparent block tabular-nums text-xs border-none pr-1 py-2
76    w-full
77    focus-visible:ring-inset
78    focus-visible:bg-purple-300/10 dark:focus-visible:bg-purple-700/40
79    dark:focus-visible:ring-purple-700 focus-visible:ring-purple-500`)}var mg=`border-gray-200 dark:border-gray-600`,_se=`text-white dark:text-gray-900 fill-current`,vse=(0,H.jsxs)(`svg`,{children:[(0,H.jsx)(`polygon`,{points:`0,0 30,0 15,10`}),(0,H.jsx)(`path`,{d:`M 0 0 L 15 10 L 30 0`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,className:`text-gray-200 dark:text-gray-600`})]}),hg=()=>(0,H.jsx)(_te,{offset:5,width:11,height:5,className:_se,asChild:!0,children:vse}),gg=()=>(0,H.jsx)(hne,{offset:5,width:11,height:5,className:_se,asChild:!0,children:vse}),_g=(0,Tm.default)(gte)(({size:e=`sm`,flush:t=`no`})=>Dm({"w-32":e===`xs`,"w-64":e===`sm`,"w-96":e===`md`,"w-[36em]":e===`lg`},t===`yes`?``:`p-3`,`shadow-lg
80      placemark-appear
81      z-50
82      bg-white dark:bg-gray-900
83      dark:text-white
84      border border-gray-200 dark:border-gray-700 rounded-md`));function vg({children:e,...t}){return(0,H.jsx)(Jp,{children:(0,H.jsxs)(_g,{...t,children:[(0,H.jsx)(hg,{}),e]})})}var yg=`block w-full mt-1 text-sm font-mono border-gray-300 dark:bg-transparent dark:text-white rounded-xs focus-visible:border-gray-300 overflow-auto focus:ring-purple-500`,yse=(0,Tm.default)(rg)(yg),bg=Tm.default.span(({size:e=`sm`})=>Dm({"text-sm":e===`sm`,"text-xs":e===`xs`},`text-gray-700 dark:text-gray-300 select-none`)),xg=`py-1
85    bg-white dark:bg-gray-900
86    rounded-xs
87    shadow-[0_2px_10px_2px_rgba(0,0,0,0.1)]
88    ring-1 ring-gray-200 dark:ring-gray-700
89    content-layout z-50`,Sg=(0,Tm.default)(Vee)(xg),bse=(0,Tm.default)(qee)(xg),xse=(0,Tm.default)(bee)(xg),Sse=(0,Tm.default)(xee)(xg),Cse=`block py-1 pl-3 pr-4 text-xs text-gray-500 dark:text-gray-300`,wse=Tm.default.div(Cse),Cg=(0,Tm.default)(Hee)(Cse),Tse=`border-t border-gray-100 dark:border-gray-700 my-1`,Ese=Tm.default.div(Tse),wg=(0,Tm.default)(Wee)(Tse),Tg=`text-purple-700 underline hover:text-black dark:text-purple-500 dark:hover:text-purple-300`,Eg=({variant:e=`default`})=>Dm([{"text-black dark:text-gray-300":e==="default","text-red-500 dark:text-red-300":e===`destructive`},`cursor-pointer
90    hover:bg-gray-200 dark:hover:bg-gray-700
91    focus-visible:bg-gray-100 dark:focus-visible:bg-gray-700
92    flex items-center
93    w-full
94    py-1 pl-3 pr-3
95    text-sm gap-x-2`]),Dg=(0,Tm.default)(Uee)(Eg),Dse=(0,Tm.default)(Kee)(Eg),Ose=(0,Tm.default)(bp)(`${Eg({variant:`default`})} justify-between`),Og=(0,Tm.default)(vp)(Eg),kg=({title:e})=>(0,H.jsx)(`div`,{className:`flex items-start justify-between pb-2`,children:(0,H.jsx)(bg,{children:e})}),Ag=(e,t=`default`)=>({"p-0 text-xs rounded-xs":e===`xxs`,"py-0.5 px-1.5 text-xs rounded-xs":e===`xs`,"py-1 px-2 text-sm rounded-sm":e===`sm`,"py-1 px-3 text-md rounded-sm":e===`md`,"rounded-l-none":t===`right`,"rounded-r-none":t===`left`,"rounded-none":t===`middle`}),jg=Dm(`text-purple-500 dark:bg-transparent dark:checked:bg-purple-500 focus:ring-purple-500`,Mg(`primary`));function Mg(e,t=!1){return[`
96    outline-hidden
97
98  `,t?``:`focus-visible:ring-1
99    focus-visible:ring-offset-1
100    focus-visible:ring-purple-500
101    dark:focus-visible:ring-purple-500
102    dark:focus-visible:ring-offset-gray-900`,{"border border-purple-500":e===`primary`,"border\n    border-gray-200               dark:border-gray-500\n    shadow-xs\n  ":e==="default","\n    focus-visible:border-gray-200   dark:focus-visible:border-gray-300\n    hover:border-gray-300   dark:hover:border-gray-300\n    ":e==="default"&&!t,"border\n    border-red-200               dark:border-red-300\n  ":e===`destructive`,"\n    focus-visible:border-red-500   dark:focus-visible:border-red-300\n    hover:border-red-300   dark:hover:border-red-300\n  ":e===`destructive`&&!t}]}var kse=(e,t=!1)=>{switch(e){case`primary`:case`code`:return[`bg-purple-500`,!t&&`hover:bg-purple-600 dar
102k:hover:bg-purple-400 hover:shadow-sm`];case`default`:return!t&&`hover:bg-gray-100 dark:hover:bg-gray-800`;case`quiet`:return!t&&`hover:bg-gray-200 dark:hover:bg-gray-700`;case`quiet/mode`:return!t&&`hover:bg-gray-200 dark:hover:bg-gray-700`;case`destructive`:return!t&&`hover:bg-red-500/10 dark:hover:bg-red-500/20`}},Ng=e=>{switch(e){case`quiet`:case`code`:case`quiet/mode`:case`default`:return`font-medium text-gray-700 dark:text-white`;case`primary`:return`font-medium text-white`;case`destructive`:return`font-medium text-red-500 dark:text-red-300`}},Pg=({size:e=`sm`,variant:t=`default`,disabled:n=!1,side:r=`default`})=>Dm(t===`quiet/mode`?`aria-expanded:bg-purple-400 aria-expanded:text-white
103      dark:aria-expanded:bg-purple-600
104    data-state-on:bg-purple-400 dark:data-state-on:bg-gray-900`:t===`primary`?`aria-expanded:bg-purple-600
105    data-state-on:bg-purple-600`:`
106    aria-expanded:bg-gray-200 dark:aria-expanded:bg-black
107    data-state-on:bg-gray-200 dark:data-state-on:bg-gray-600`,`disabled:opacity-50 disabled:cursor-not-allowed`,`transition-colors`,`focus-visible:outline-hidden`,Ag(e===`full-width`?`md`:e,r),`inline-flex items-center gap-x-1`,Ng(t),Mg(t,n),kse(t,n),e===`full-width`&&`flex-auto justify-center`,{}),Ase=({interactive:e=!1})=>Dm(`text-sm
108  w-full
109  text-gray-700 dark:text-gray-300
110  flex justify-between items-center`,`px-3 py-3`,e&&`hover:text-gray-900 dark:hover:text-white`),Fg=Tm.default.button(Pg),Ig=({size:e,variant:t=`default`})=>Dm([Ag(e),Mg(t),Ng(`default`),`
111    pr-8
112    bg-transparent
113
114    focus-visible:bg-white
115    active:bg-white
116
117    dark:focus-visible:bg-black
118    dark:active:bg-black
119    `]),Lg=({_size:e=`sm`,variant:t=`default`})=>Dm([Ag(e),Mg(`default`),{"font-mono":t===`code`},`block w-full
120    dark:bg-transparent dark:text-gray-100`]),Rg=Tm.default.div(({size:e=`sm`})=>[{"text-sm px-2":e===`sm`,"text-xs px-1":e===`xs`},`text-center
121  dark:bg-gray-700/50
122  font-mono rounded
123  ring-1 ring-gray-100 dark:ring-black
124  border border-b-4 border-r-2
125  border-gray-300 dark:border-gray-500`]),zg=Tm.default.input(Lg),Bg=(0,Tm.default)(rg)(Lg),Vg=Tm.default.div(({size:e=`sm`,variant:t=`default`})=>Dm({"text-sm":e===`sm`,"py-2 px-3":(t===`destructive`||t===`primary`)&&e===`sm`,"py-1 px-2":(t===`destructive`||t===`primary`)&&e===`xs`,"text-xs":e===`xs`,"text-gray-700 dark:text-gray-300":t==="default","text-red-700 dark:text-red-100 bg-red-50 dark:bg-red-900 rounded-sm":t===`destructive`,"bg-gray-50 border border-gray-200 dark:bg-gray-900 dark:border-gray-700 rounded-sm":t===`primary`})),jse=(0,Tm.default)(qp)(Dm(`aria-expanded:bg-gray-200 dark:aria-expanded:bg-gray-900
126    data-state-on:bg-gray-200 dark:data-state-on:bg-gray-600`,`disabled:opacity-50 disabled:cursor-not-allowed`,`focus-visible:outline-hidden`,`py-1 px-1 rounded-sm text-sm`,`relative w-full flex items-center gap-x-1`,Ng(`default`),Mg(`default`,!1),kse(`default`,!1),{})),Hg=({visibility:e})=>e?(0,H.jsx)(rn,{}):(0,H.jsx)(tn,{}),Mse=({visibility:e})=>e?(0,H.jsx)(vr,{}):(0,H.jsx)(br,{});function Ug({action:e,onClose:t,fullWidthSubmit:n=!1,secondary:r,variant:i=`md`}){let{isSubmitting:a}=Gh();return(0,H.jsxs)(`div`,{className:Dm(i===`xs`?`pt-2`:`pt-6`,`pb-1 relative`,n?`flex items-stretch justify-stretch`:`pb-1 flex flex-col sm:items-center sm:flex-row-reverse space-y-2 sm:space-y-0 sm:gap-x-3`),children:[e?(0,H.jsx)(Fg,{type:`submit`,disabled:a,variant:`primary`,size:n?`full-width`:`sm`,children:e}):null,r?(0,H.jsx)(Fg,{type:`button`,disabled:a,variant:`default`,onClick:r.onClick,children:r.action}):null,t?(0,H.jsx)(Fg,{type:`button`,onClick:t,children:`Cancel`}):null,(0,H.jsx)(gr,{className:Dm(`animate-spin transition-opacity`,a?`opacity-50`:`opacity-0`,n&&`absolute top-8 right-2.5 text-white`)})]})}function Wg({groups:e}){return(0,H.jsx)(H.Fragment,{children:e.map((e,t)=>(0,H.jsx)(`optgroup`,{label:e.name,children:e.items.map(e=>(0,H.jsx)(`option`,{value:e.key,children:e.name},e.name))},t))})}var Nse=(0,B.memo)(function({onChange:e,value:t,type:n}){return(0,H.jsx)(`select`,{className:`${Ig({size:`sm`})}
126 w-24`,value:t,"aria-label":`Select units`,onChange:t=>{e(t.target.value)},children:(0,H.jsx)(Wg,{groups:k[n]})})}),Pse=Symbol(`Comlink.proxy`),Fse=Symbol(`Comlink.endpoint`),Ise=Symbol(`Comlink.releaseProxy`),Gg=Symbol(`Comlink.finalizer`),Kg=Symbol(`Comlink.thrown`),Lse=e=>typeof e==`object`&&!!e||typeof e==`function`,qg=new Map([[`proxy`,{canHandle:e=>Lse(e)&&e[Pse],serialize(e){let{port1:t,port2:n}=new MessageChannel;return zse(e,t),[n,[n]]},deserialize(e){return e.start(),Hse(e)}}],[`throw`,{canHandle:e=>Lse(e)&&Kg in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(Error(e.value.message),e.value):e.value}}]]);function Rse(e,t){for(let n of e)if(t===n||n===`*`||n instanceof RegExp&&n.test(t))return!0;return!1}function zse(e,t=globalThis,n=[`*`]){t.addEventListener(`message`,function r(i){if(!i||!i.data)return;if(!Rse(n,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}let{id:a,type:o,path:s}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(t_),l;try{let t=s.slice(0,-1).reduce((e,t)=>e[t],e),n=s.reduce((e,t)=>e[t],e);switch(o){case`GET`:l=n;break;case`SET`:t[s.slice(-1)[0]]=t_(i.data.value),l=!0;break;case`APPLY`:l=n.apply(t,c);break;case`CONSTRUCT`:l=$g(new n(...c));break;case`ENDPOINT`:{let{port1:t,port2:n}=new MessageChannel;zse(e,n),l=Qg(t,[t])}break;case`RELEASE`:l=void 0;break;default:return}}catch(e){l={value:e,[Kg]:0}}Promise.resolve(l).catch(e=>({value:e,[Kg]:0})).then(n=>{let[i,s]=e_(n);t.postMessage(Object.assign(Object.assign({},i),{id:a}),s),o===`RELEASE`&&(t.removeEventListener(`message`,r),Vse(t),Gg in e&&typeof e[Gg]==`function`&&e[Gg]())}).catch(e=>{let[n,r]=e_({value:TypeError(`Unserializable return value`),[Kg]:0});t.postMessage(Object.assign(Object.assign({},n),{id:a}),r)})}),t.start&&t.start()}function Bse(e){return e.constructor.name===`MessagePort`}function Vse(e){Bse(e)&&e.close()}function Hse(e,t){let n=new Map;return e.addEventListener(`message`,function(e){let{data:t}=e;if(!t||!t.id)return;let r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}}),Zg(e,n,[],t)}function Jg(e){if(e)throw Error(`Proxy has been released and is not useable`)}function Use(e){return n_(e,new Map,{type:`RELEASE`}).then(()=>{Vse(e)})}var Yg=new WeakMap,Xg=`FinalizationRegistry`in globalThis&&new FinalizationRegistry(e=>{let t=(Yg.get(e)||0)-1;Yg.set(e,t),t===0&&Use(e)});function Wse(e,t){let n=(Yg.get(t)||0)+1;Yg.set(t,n),Xg&&Xg.register(e,t,e)}function Gse(e){Xg&&Xg.unregister(e)}function Zg(e,t,n=[],r=function(){}){let i=!1,a=new Proxy(r,{get(r,o){if(Jg(i),o===Ise)return()=>{Gse(a),Use(e),t.clear(),i=!0};if(o===`then`){if(n.length===0)return{then:()=>a};let r=n_(e,t,{type:`GET`,path:n.map(e=>e.toString())}).then(t_);return r.then.bind(r)}return Zg(e,t,[...n,o])},set(r,a,o){Jg(i);let[s,c]=e_(o);return n_(e,t,{type:`SET`,path:[...n,a].map(e=>e.toString()),value:s},c).then(t_)},apply(r,a,o){Jg(i);let s=n[n.length-1];if(s===Fse)return n_(e,t,{type:`ENDPOINT`}).then(t_);if(s===`bind`)return Zg(e,t,n.slice(0,-1));let[c,l]=qse(o);return n_(e,t,{type:`APPLY`,path:n.map(e=>e.toString()),argumentList:c},l).then(t_)},construct(r,a){Jg(i);let[o,s]=qse(a);return n_(e,t,{type:`CONSTRUCT`,path:n.map(e=>e.toString()),argumentList:o},s).then(t_)}});return Wse(a,e),a}function Kse(e){return Array.prototype.concat.apply([],e)}function qse(e){let t=e.map(e_);return[t.map(e=>e[0]),Kse(t.map(e=>e[1]))]}var Jse=new WeakMap;function Qg(e,t){return Jse.set(e,t),e}function $g(e){return Object.assign(e,{[Pse]:!0})}function e_(e){for(let[t,n]of qg)if(n.canHandle(e)){let[r,i]=n.serialize(e);return[{type:`HANDLER`,name:t,value:r},i]}return[{type:`RAW`,value:e},Jse.get(e)||[]]}function t_(e){switch(e.type){case`HANDLER`:return qg.get(e.name).deserialize(e.value);case`RAW`:return e.value}}function n_(e,t,n,r){return new Promise(i=>{let a=Yse();t.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},n),r)})}function Yse(){return[,,,,].fill(0).map(()=>Math.floor(Math.random()*(2**53-1)).toString(16)).join(`-`)}qg.set(`EITHER`,{canHandle:e=>
126pe.isEither(e),serialize:e=>{let t=e.extract();return e.isRight()&&t?.result?.blob&&[].push(t.result.blob),[{__val:e.extract(),__either:e.isLeft()?`left`:`right`},[]]},deserialize:e=>e.__either===`left`?ue(e.__val):fe(e.__val)});var r_=Hse(new Worker(new URL(`/assets/worker-DmzH4-t_.js`,``+import.meta.url),{type:`module`}));async function Xse(e,t){return r_.bufferFeature(e,t)}var Zse=(0,B.createContext)({});function i_(){return(0,B.useContext)(Zse)}function Qse({modal:e,onClose:t}){let n=i_().useTransact(),{features:r}=e;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Buffer`,titleIcon:Ue}),(0,H.jsx)(eg,{initialValues:{quadrantSegments:8,units:`kilometers`,radius:1},onSubmit:async e=>{let i=await Promise.all(r.map(async t=>({...t,feature:await Xse(t.feature,e)})));n({note:`Buffered features`,putFeatures:i,track:[`operation-buffer`,{count:r.length}]}).catch(e=>void 0).finally(()=>{t()})},children:(0,H.jsxs)(ig,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-x-2`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Radius`})}),(0,H.jsx)(Bg,{name:`radius`,className:`w-full`,type:`number`})]}),(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Units`})}),(0,H.jsx)(rg,{as:`select`,name:`units`,className:`${Ig({size:`sm`})} w-full`,children:(0,H.jsx)(Wg,{groups:k.length})})]}),(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Segments (detail)`})}),(0,H.jsx)(Bg,{name:`quadrantSegments`,className:`w-full`,type:`number`})]})]}),(0,H.jsx)(Vg,{children:`Higher detail adds more vertices to the rounded edges of buffered shapes, at the cost of larger files.`}),(0,H.jsx)(`div`,{className:`flex flex-col sm:flex-row-reverse space-y-2 sm:space-y-0 sm:gap-x-3`,children:(0,H.jsx)(Ug,{variant:`xs`,action:`Buffer`,onClose:t})})]})})]})}var $se=v({tilejson:o(),tiles:a(o()),attribution:o().optional(),bounds:S([p(),p(),p(),p()]).optional(),center:a(p()).optional(),minzoom:p().default(0),maxzoom:p().default(24),name:o().optional(),scheme:g([`xyz`,`tms`]).optional().default(`xyz`)}).strip(),ece=i(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),a_=i(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),o_=i(((e,t)=>{var n=a_();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),tce=i(((e,t)=>{var n=o_(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),nce=i(((e,t)=>{var n=o_();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),rce=i(((e,t)=>{var n=o_();function r(e){return n(this.__data__,e)>-1}t.exports=r})),ice=i(((e,t)=>{var n=o_();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),s_=i(((e,t)=>{var n=ece(),r=tce(),i=nce(),a=rce(),o=ice();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),ace=i(((e,t)=>{var n=s_();function r(){this.__data__=new n,this.size=0}t.exports=r})),oce=i(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),sce=i(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),cce=i(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),c_=i(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),lce=i(((e,t)=>{var n=L(),r=c_(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),uce=i(((e,t)=>{t.exports=w()[`__core-js_shared__`]})),dce=i(((e,t)=>{var n=uce(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),fce=i(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),pce=i(((e,t)=>{var n=lce(),r=dce(),i=c_(),a=fce(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),mce=i(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),l_=i(((e,t)=>{var n=pce(),r=mce();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),u_=i(((e,t)=>{t.exports=l_()(w(),`Map`)})),d_=i(((e,t)=>{t.exports=l_()(Object,`create`)})),hce=i(((e,t)=>{var n=d_();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),gce=i(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),_ce=i(((e,t)=>
vendor: 14,425 bytes, line 126
126{var n=d_(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),vce=i(((e,t)=>{var n=d_(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),yce=i(((e,t)=>{var n=d_(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),bce=i(((e,t)=>{var n=hce(),r=gce(),i=_ce(),a=vce(),o=yce();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),xce=i(((e,t)=>{var n=bce(),r=s_(),i=u_();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Sce=i(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),f_=i(((e,t)=>{var n=Sce();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Cce=i(((e,t)=>{var n=f_();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),wce=i(((e,t)=>{var n=f_();function r(e){return n(this,e).get(e)}t.exports=r})),Tce=i(((e,t)=>{var n=f_();function r(e){return n(this,e).has(e)}t.exports=r})),Ece=i(((e,t)=>{var n=f_();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),p_=i(((e,t)=>{var n=xce(),r=Cce(),i=wce(),a=Tce(),o=Ece();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Dce=i(((e,t)=>{var n=s_(),r=u_(),i=p_(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),m_=i(((e,t)=>{var n=s_(),r=ace(),i=oce(),a=sce(),o=cce(),s=Dce();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),Oce=i(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),kce=i(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),h_=i(((e,t)=>{var n=p_(),r=Oce(),i=kce();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),Ace=i(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),g_=i(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),__=i(((e,t)=>{var n=h_(),r=Ace(),i=g_(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),v_=i(((e,t)=>{t.exports=w().Uint8Array})),jce=i(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),y_=i(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),Mce=i(((e,t)=>{var n=A(),r=v_(),i=a_(),a=__(),o=jce(),s=y_(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),b_=i(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),x_=i(((e,t)=>{t.exports=Array.isArray})),S_=i(((e,t)=>{var n=b_(),r=x_();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),Nce=i(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),C_=i(((e,t)=>{function n(){return[]}t.exports=n})),w_=i(((e,t)=>{var n=Nce(),r=C_(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),Pce=i(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),Fce=i(((e,t)=>{var n=L(),r=P(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),T_=i(((e,t)=>{var n=Fce(),r=P(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),Ice=i(((e,t)=>{function n(){return!1}t.exports=n})),E_=i(((e,t)=>{var n=w(),r=Ice(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),D_=i(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),O_=i(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),Lce=i(((e,t)=>{var n=L(),r=O_(),i=P(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),k_=i(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),A_=i(((e,t)=>{var n=F(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),j_=i(((e,t)=>{var n=Lce(),r=k_(),i=A_(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),M_=i(((e,t)=>{var n=Pce(),r=T_(),i=x_(),a=E_(),o=D_(),s=j_(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),N_=i(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),Rce=i(((e,t)=>{t.exports=ee()(Object.keys,Object)})),zce=i(((e,t)=>{var n=N_(),r=Rce(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),P_=i(((e,t)=>{var n=lce(),r=O_();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),F_=i(((e,t)=>{var n=M_(),r=zce(),i=P_();function a(e){return i(e)?n(e):r(e)}t.exports=a})),I_=i(((e,t)=>{var n=S_(),r=w_(),i=F_();function a(e){return n(e,i,r)}t.exports=a})),Bce=i(((e,t)=>{var n=I_(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),Vce=i(((e,t)=>{t.exports=l_()(w(),`DataView`)})),Hce=i(((e,t)=>{t.exports=l_()(w(),`Promise`)})),L_=i(((e,t)=>{t.exports=l_()(w(),`Set`)})),Uce=i(((e,t)=>{t.exports=l_()(w(),`WeakMap`)})),R_=i(((e,t)=>{var n=Vce(),r=u_(),i=Hce(),a=L_(),o=Uce(),s=L(),c=fce(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),Wce=i(((e,t)=>{var n=m_(),r=__(),i=Mce(),a=Bce(),o=R_(),s=x_(),c=E_(),l=j_(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),z_=i(((e,t)=>{var n=Wce(),r=P();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),Gce=i(((e,t)=>{var n=z_();function r(e,t){return n(e,t)}t.exports=r})),Kce=i(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),qce=i(((e,t)=>{var n=Kce(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),B_=i(((e,t)=>{var n=L(),r=P(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),V_=i(((e,t)=>{var n=qce(),r=c_(),i=B_(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),H_=i(((e,t)=>{var n=V_(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),U_=i(((e,t)=>{var n=H_();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),Jce=i(((e,t)=>{var n=U_(),r=`Expected a function`;function i(e,t){var i;if(typeof t!=`function`)throw TypeError(r);return e=n(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=void 0),i}}t.exports=i})),Yce=i(((e,t)=>{var n=Jce();function r(e){return n(2,e)}t.exports=r})),W_=i(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),Xce=i(((e,t)=>{function n(e){return e!==e}t.exports=n})),Zce=i(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),Qce=i(((e,t)=>{var n=W_(),r=Xce(),i=Zce();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),G_=i(((e,t)=>{var n=Qce();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),K_=i(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),q_=i(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),J_=i(((e,t)=>{var n=h_(),r=G_(),i=K_(),a=q_(),o=k_(),s=g_(),c=200;function l(e,t,l,u){var d=-1,f=r,p=!0,m=e.length,h=[],g=t.length;if(!m)return h;l&&(t=a(t,o(l))),u?(f=i,p=!1):t.length>=c&&(f=s,p=!1,t=new n(t));outer:for(;++d<m;){var _=e[d],v=l==null?_:l(_);if(_=u||_!==0?_:0,p&&v===v){for(var y=g;y--;)if(t[y]===v)continue outer;h.push(_)}else f(t,v,u)||h.push(_)}return h}t.exports=l})),Y_=i(((e,t)=>{function n(e){return e}t.exports=n})),$ce=i(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),X_=i(((e,t)=>{var n=$ce(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),ele=i(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),Z_=i(((e,t)=>{var n=l_();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),tle=i(((e,t)=>{var n=ele(),r=Z_(),i=Y_();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),nle=i(((e,t)=>{var n=Date.now;function r(e){var t=0,r=0;return function(){var i=n(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=r})),Q_=i(((e,t)=>{var n=tle();t.exports=nle()(n)})),$_=i(((e,t)=>{var n=Y_(),r=X_(),i=Q_();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),ev=i(((e,t)=>{var n=P_(),r=P();function i(e){return r(e)&&n(e)}t.exports=i})),rle=i(((e,t)=>{var n=J_(),r=$_(),i=ev();t.exports=r(function(e,t){return i(e)?n(e,t):[]})})),tv=e(Gce()),nv=e(Yce()),rv=e(rle());function ile(e){return`${e} | Placemark`}
126function ale(e,t,n){return e*(1-n)+t*n}var iv=new Set([`INPUT`,`TEXTAREA`]);function av(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ov(e){let t=e.target,n=t instanceof HTMLElement&&t?.tagName||``;return!!(iv.has(n)||window.getSelection()?.toString())}function ole(e){let t=e.target,n=t instanceof HTMLElement&&t?.tagName||``;return!!iv.has(n)}var sv=(0,nv.default)(()=>{try{return/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)}catch{return!1}});function cv(e,t){return e.replace(`Command`,t?`⌘`:`Ctrl`).replace(`Option`,t?`Option`:`Alt`)}async function sle(e){return navigator.clipboard.write([new ClipboardItem({"text/plain":Promise.resolve(e).then(e=>new Blob([e],{type:`text/plain`}))})])}async function cle(e){return navigator.clipboard.writeText(await e)}async function lv(e){return typeof ClipboardItem>`u`?await cle(e):await sle(e)}function uv(e){return ve(({liftEither:t})=>t(e))}function dv(e,t=48){return e.length<t?e:`${e.substring(0,t)}…`}function fv(e,t){return e.includes(t)?(0,rv.default)(e,t):e.concat(t)}function lle(e,t){let n=!1;return e=e.filter(e=>(0,tv.default)(e,t)?(n=!0,!1):!0),n?e:e.concat(t)}var pv={geometry:`geometries`};function mv(e,t,n=!0,r=void 0){!r&&e in pv&&(r=pv[e]);let i=t===1?e:r||`${e}s`;return(n?`${t.toLocaleString()} `:``)+i}var hv=1*1e3*60*60*24;hv*365,hv*30,hv*7;var ule=e=>new Intl.NumberFormat(`en-US`,{}).format(e);function dle(e){return e.success?ce(e.data):de}var gv=new Map;async function _v(e){let t=gv.get(e);if(t)return t;let n=await vv(e,$se);return gv.set(e,n),n}async function vv(e,t){let n=await(await fetch(e)).json();return t.parse(n)}var yv=function(e){return e.Number=`number`,e.Boolean=`boolean`,e.String=`string`,e.JSON=`JSON`,e.HTML=`Rich text`,e}({}),fle={number:`number`,boolean:`boolean`,object:`JSON`};function ple(e){return me(e).isRight()}function bv(e){return e.match(/\s*[[{]/)?ple(e):!1}var mle=new Map([[`true`,`boolean`],[`false`,`boolean`],[`null`,`null`]]);function hle(e){if(typeof e!=`string`||e===``)return`none`;let t=mle.get(e);return t===void 0?Sv(e)?`number`:bv(e)?`JSON`:`none`:t}var xv={true:!0,false:!1,null:null};function Sv(e){return!Number.isNaN(+e)&&!e.match(/^0\d+$/)}function Cv(e){return e in xv?xv[e]:Sv(e)?+e:bv(e)?JSON.parse(e):e}function wv(e){let t=Ev(e);if(t.isJust())return t.extract().value;if(e==null)return``;if(typeof e==`object`||Array.isArray(e))try{return JSON.stringify(e)}catch{return String(e)}return String(e)}var gle={number:e=>{if(e===void 0)return 0;let t=e===null?0:+e;return Number.isNaN(t)?e:t},boolean:e=>e===`false`?!1:!!e,string:wv,JSON:e=>e===void 0?``:typeof e==`string`?me(e).orDefault(e):e,"Rich text":e=>Ev(e).orDefaultLazy(()=>({"@type":`html`,value:wv(e)}))};function Tv(e,t){return gle[t](e)}function _le(e,t){return e===fle[typeof t]||t===null&&e===`null`}function vle(e,t){return typeof t==`string`&&_le(hle(t),e)?Cv(t):t}var yle=v({"@type":_(`html`),value:o()});function Ev(e){return dle(yle.safeParse(e))}function Dv(e){return`init`in e}function Ov(e){return!!e.write}function kv(e){return`v`in e||`e`in e}function Av(e){if(`e`in e)throw e.e;return e.v}var jv=new WeakMap;function Mv(e){return Pv(e)&&!!jv.get(e)?.[0]}function ble(e){let t=jv.get(e);t?.[0]&&(t[0]=!1,t[1].forEach(e=>e()))}function Nv(e,t){let n=jv.get(e);if(!n){n=[!0,new Set],jv.set(e,n);let t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function Pv(e){return typeof e?.then==`function`}function Fv(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function Iv(e,t,n){let r=new Set;for(let t of n.get(e)?.t||[])r.add(t);for(let e of t.p)r.add(e);return r}var xle=(e,t,...n)=>t.read(...n),Sle=(e,t,...n)=>t.write(...n),Cle=(e,t)=>{if(t.INTERNAL_onInit)return t.INTERNAL_onInit(e);if(t.unstable_onInit)return console.warn(`[DEPRECATED] atom.unstable_onInit is renamed to atom.INTERNAL_onInit.`),t.unstable_onInit(e)},wle=(e,t,n)=>t.onMount?.call(t,n),Tle=(e,t)=>{var n;let r=Rv(e),i=r[0],a=r[6],o=r[9],s=i.get(t);return s||(s={d:new Map,p:new Set,n:0},i.set(t,s),(n=a.i)==null||n.call(a,t),o?.(e,t)),s},Ele=e=>{let t=Rv(e),n=t[1],r=t[3],i=t[4],a=t[5],o=t[6],s=t[13],c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let t=new Set,c=t.add.bind(t);
126r.forEach(e=>n.get(e)?.l.forEach(c)),r.clear(),a.forEach(c),a.clear(),i.forEach(c),i.clear(),t.forEach(l),r.size&&s(e)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},Dle=e=>{let t=Rv(e),n=t[1],r=t[2],i=t[3],a=t[11],o=t[14],s=t[17],c=[],l=new WeakSet,u=new WeakSet,d=Array.from(i);for(;d.length;){let t=d[d.length-1],i=a(e,t);if(u.has(t)){d.pop();continue}if(l.has(t)){r.get(t)===i.n&&c.push([t,i]),u.add(t),d.pop();continue}l.add(t);for(let e of Iv(t,i,n))l.has(e)||d.push(e)}for(let t=c.length-1;t>=0;--t){let[n,a]=c[t],l=!1;for(let e of a.d.keys())if(e!==n&&i.has(e)){l=!0;break}l&&(o(e,n),s(e,n)),r.delete(n)}},Ole=(e,t)=>{var n,r;let i=Rv(e),a=i[1],o=i[2],s=i[3],c=i[6],l=i[7],u=i[11],d=i[12],f=i[13],p=i[14],m=i[16],h=i[17],g=i[20],_=u(e,t);if(kv(_)){if(a.has(t)&&o.get(t)!==_.n)return _;let n=!1;for(let[t,r]of _.d)if(p(e,t).n!==r){n=!0;break}if(!n)return _}_.d.clear();let v=!0;function y(){a.has(t)&&(h(e,t),f(e),d(e))}function b(n){var r;if(n===t){let t=u(e,n);if(!kv(t))if(Dv(n))g(e,n,n.init);else throw Error(`no atom init`);return Av(t)}let i=p(e,n);try{return Av(i)}finally{_.d.set(n,i.n),Mv(_.v)&&Fv(t,_.v,i),a.has(t)&&((r=a.get(n))==null||r.t.add(t)),v||y()}}let x,S,C={get signal(){return x||=new AbortController,x.signal},get setSelf(){return!S&&Ov(t)&&(S=(...n)=>{if(!v)try{return m(e,t,...n)}finally{f(e),d(e)}}),S}},w=_.n;try{let r=l(e,t,b,C);return g(e,t,r),Pv(r)&&(Nv(r,()=>x?.abort()),r.then(y,y)),(n=c.r)==null||n.call(c,t),_}catch(e){return delete _.v,_.e=e,++_.n,_}finally{v=!1,w!==_.n&&o.get(t)===w&&(o.set(t,_.n),s.add(t),(r=c.c)==null||r.call(c,t))}},kle=(e,t)=>{let n=Rv(e),r=n[1],i=n[2],a=n[11],o=[t];for(;o.length;){let t=o.pop(),n=a(e,t);for(let s of Iv(t,n,r)){let t=a(e,s);i.set(s,t.n),o.push(s)}}},Ale=(e,t,...n)=>{let r=Rv(e),i=r[3],a=r[6],o=r[8],s=r[11],c=r[12],l=r[13],u=r[14],d=r[15],f=r[16],p=r[17],m=r[20],h=!0,g=t=>Av(u(e,t)),_=(n,...r)=>{var o;let u=s(e,n);try{if(n===t){if(!Dv(n))throw Error(`atom not writable`);let t=u.n,s=r[0];m(e,n,s),p(e,n),t!==u.n&&(i.add(n),d(e,n),(o=a.c)==null||o.call(a,n));return}else return f(e,n,...r)}finally{h||(l(e),c(e))}};try{return o(e,t,g,_,...n)}finally{h=!1}},jle=(e,t)=>{var n;let r=Rv(e),i=r[1],a=r[3],o=r[6],s=r[11],c=r[15],l=r[18],u=r[19],d=s(e,t),f=i.get(t);if(f&&!Mv(d.v)){for(let[r,i]of d.d)if(!f.d.has(r)){let u=s(e,r);l(e,r).t.add(t),f.d.add(r),i!==u.n&&(a.add(r),c(e,r),(n=o.c)==null||n.call(o,r))}for(let n of f.d)d.d.has(n)||(f.d.delete(n),u(e,n)?.t.delete(t))}},Mle=(e,t)=>{var n;let r=Rv(e),i=r[1],a=r[4],o=r[6],s=r[10],c=r[11],l=r[12],u=r[13],d=r[14],f=r[16],p=r[18],m=c(e,t),h=i.get(t);if(!h){d(e,t);for(let n of m.d.keys())p(e,n).t.add(t);h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(t,h),Ov(t)&&a.add(()=>{let n=!0,r=(...r)=>{try{return f(e,t,...r)}finally{n||(u(e),l(e))}};try{let i=s(e,t,r);i&&(h.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}}),(n=o.m)==null||n.call(o,t)}return h},Nle=(e,t)=>{var n;let r=Rv(e),i=r[1],a=r[5],o=r[6],s=r[11],c=r[19],l=s(e,t),u=i.get(t);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(t)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(t);for(let n of l.d.keys())c(e,n)?.t.delete(t);(n=o.u)==null||n.call(o,t);return}return u},Ple=(e,t,n)=>{let r=Rv(e)[11],i=r(e,t),a=`v`in i,o=i.v;if(Pv(n))for(let a of i.d.keys())Fv(t,n,r(e,a));i.v=n,delete i.e,(!a||!Object.is(o,i.v))&&(++i.n,Pv(o)&&ble(o))},Fle=(e,t)=>{let n=Rv(e)[14];return Av(n(e,t))},Ile=(e,t,...n)=>{let r=Rv(e),i=r[12],a=r[13],o=r[16];try{return o(e,t,...n)}finally{a(e),i(e)}},Lle=(e,t,n)=>{let r=Rv(e),i=r[12],a=r[18],o=r[19],s=a(e,t).l;return s.add(n),i(e),()=>{s.delete(n),o(e,t),i(e)}},Lv=new WeakMap,Rv=e=>Lv.get(e);function Rle(...e){let t={get(e){let n=Rv(t)[21];return n(t,e)},set(e,...n){let r=Rv(t)[22];return r(t,e,...n)},sub(e,n){let r=Rv(t)[23];return r(t,e,n)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},xle,Sle,Cle,wle,Tle,Ele,Dle,Ole,kle,Ale,jle,Mle,Nle,Ple,Fle,Ile,Lle,void 0].map((t,n)=>e[n]||t);return Lv.set(t,Object.freeze(n)),t}var zle=0;function zv(e,t){let n=`atom${++zle}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=Ble,r.write=Vle),t&&(r.write=t),r}function Ble(e){return e(this)}function Vle(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var Bv;function Vv(){return Bv?Bv():Rle()}var Hv;function Hle(){return Hv||=Vv(),Hv}var Uv=(0,B.createContext)(void 0);function Wv(e){let t=(0,B.useContext)(Uv);return e?.store||t||Hle()}function Ule({children:e,store:t}){let n=(0,B.useRef)(null);return t?(0,B.createElement)(Uv.Provider,{value:t}
126,e):(n.current===null&&(n.current=Vv()),(0,B.createElement)(Uv.Provider,{value:n.current},e))}var Gv=e=>typeof e?.then==`function`,Kv=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},Wle=B.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(Kv(e),e)}),qv=new WeakMap,Jv=(e,t)=>{let n=qv.get(e);return n||(n=new Promise((r,i)=>{let a=e,o=e=>t=>{a===e&&r(t)},s=e=>t=>{a===e&&i(t)},c=()=>{try{let e=t();Gv(e)?(qv.set(e,n),a=e,e.then(o(e),s(e)),Nv(e,c)):r(e)}catch(e){i(e)}};e.then(o(e),s(e)),Nv(e,c)}),qv.set(e,n)),n};function Yv(e,t){let{delay:n,unstable_promiseStatus:r=!B.use}=t||{},i=Wv(t),[[a,o,s],c]=(0,B.useReducer)(t=>{let n=i.get(e);return Object.is(t[0],n)&&t[1]===i&&t[2]===e?t:[n,i,e]},void 0,()=>[i.get(e),i,e]),l=a;if((o!==i||s!==e)&&(c(),l=i.get(e)),(0,B.useEffect)(()=>{let t=i.sub(e,()=>{if(r)try{let t=i.get(e);Gv(t)&&Kv(Jv(t,()=>i.get(e)))}catch{}if(typeof n==`number`){setTimeout(c,n);return}c()});return c(),t},[i,e,n,r]),(0,B.useDebugValue)(l),Gv(l)){let t=Jv(l,()=>i.get(e));return r&&Kv(t),Wle(t)}return l}function Xv(e,t){let n=Wv(t);return(0,B.useCallback)((...t)=>n.set(e,...t),[n,e])}function Zv(e,t){return[Yv(e,t),Xv(e,t)]}var Qv=Symbol(``);function Gle(e){let t=zv(e,(n,r,i)=>{let a=typeof i==`function`?i(n(t)):i;r(t,a===Qv?e:a)});return t}var $v=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),Kle=new WeakMap,qle=(e,t,n,r)=>$v(e,$v(()=>new WeakMap,$v(()=>new WeakMap,Kle,t),n),r);function Jle(e,t,n=Object.is){return qle(()=>{let r=Symbol(),i=([e,i])=>{if(i===r)return t(e);let a=t(e,i);return n(i,a)?i:a},a=zv(t=>{let n=t(a),r=t(e);return i([r,n])});return a.init=r,a},e,t,n)}var ey=e=>typeof e?.then==`function`;function Yle(e=()=>{try{return window.localStorage}catch{return}},t){let n,r,i={getItem:(i,a)=>{let o=e=>{if(e||=``,n!==e){try{r=JSON.parse(e,t?.reviver)}catch{return a}n=e}return r},s=e()?.getItem(i)??null;return ey(s)?s.then(o):o(s)},setItem:(n,r)=>e()?.setItem(n,JSON.stringify(r,t?.replacer)),removeItem:t=>e()?.removeItem(t)},a=e=>(t,n,r)=>e(t,e=>{let t;try{t=JSON.parse(e||``)}catch{t=r}n(t)}),o;try{o=e()?.subscribe}catch{}return!o&&typeof window<`u`&&typeof window.addEventListener==`function`&&window.Storage&&(o=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};let r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener(`storage`,r),()=>{window.removeEventListener(`storage`,r)}}),o&&(i.subscribe=a(o)),i}var Xle=Yle();function ty(e,t,n=Xle,r){let i=zv(r?.getOnInit?n.getItem(e,t):t);return i.onMount=r=>{r(n.getItem(e,t));let i;return n.subscribe&&(i=n.subscribe(e,r,t)),i},zv(e=>e(i),(r,a,o)=>{let s=typeof o==`function`?o(r(i)):o;return s===Qv?(a(i,t),n.removeItem(e)):ey(s)?s.then(t=>(a(i,t),n.setItem(e,t))):(a(i,s),n.setItem(e,s))})}function ny(e,t){return Xv((0,B.useMemo)(()=>zv(null,(t,n,...r)=>e(t,n,...r)),[e]),t)}var ry={GEOCODE_EARTH_TOKEN:`ge-d71db422a36601b9`,ROUTING_PROVIDER:`openrouteservice`,ROUTING_API_KEY:`eyJvcmciOiI1YjNjZTM1OTc4NTExMTAwMDFjZjYyNDgiLCJpZCI6IjliZGVhYTRiZmI1NTQwOTNhOWE0MDQzMGJiYjlkODI3IiwiaCI6Im11cm11cjY0In0=`,ROUTING_URL:void 0,OSRM_DRIVING_URL:void 0,OSRM_WALKING_URL:void 0,OSRM_CYCLING_URL:void 0,VITE_PUBLIC_MAPTILER_TOKEN:`Mi3sDWKm1PJvdwEK6KGF`},iy={POSITRON:{name:`Positron`,url:`https://tiles.openfreemap.org/styles/positron`,provider:`OpenFreeMap`,type:`STYLE`},BRIGHT:{name:`Bright`,url:`https://tiles.openfreemap.org/styles/bright`,provider:`OpenFreeMap`,type:`STYLE`},LIBERTY:{name:`Liberty`,url:`https://tiles.openfreemap.org/styles/liberty`,provider:`OpenFreeMap`,type:`STYLE`},DARK:{name:`Dark`,url:`https://tiles.openfreemap.org/styles/dark`,provider:`OpenFreeMap`,type:`STYLE`},FIORD:{name:`Fiord`,url:`https://tiles.openfreemap.org/styles/fiord`,provider:`OpenFreeMap`,type:`STYLE`},...ry.VITE_PUBLIC_MAPTILER_TOKEN?{SATELLITE:{name:`Satellite`,url:`https://api.maptiler.com/maps/hybrid-v4/style.json?key=${ry.VITE_PUBLIC_MAPTILER_TOKEN}`,provider:`MapTiler`,type:`STYLE`}}:{}};function ay(e){return{note:e,putFeatures:[],deleteFeatures:[],putFolders:[],deleteFolders:[],putLayerConfigs:[],deleteLayerConfigs:[]}}var oy={putFolders:[],deleteFolders:[],putFeatures:[],deleteFeatures:[],putLayerConfigs:[],deleteLayerConfigs:[]},sy=100,Zle=class{undo;redo;paused;constructor(){this.undo=[],this.redo=[],this.paused=!1}},Qle={undo:`redo`,redo:`undo`},cy=new class{merge(...e){let t=e[0],n={note:t.note,putFeatures:t.putFeatures.slice(),deleteFeatures:t.deleteFeatures.slice(),putFolders:t.putFolders.slice(),deleteFolders:t.deleteFolders.slice(),putLayerConfigs:t.putLayerConfigs.slice(),deleteLayerConfigs:t.deleteLayerConfigs.slice()};for(let t of e.slice(1))n.putFeatures=n.putFeatures.concat(t.putFeatures),n.deleteFeatures=n.deleteFeatures.concat(t.deleteFeatures),n.deleteFolders=n.deleteFolders.concat(t.deleteFolders),n.putFolders=n.putFolders.concat(t.putFolders),n.deleteLayerConfigs=n.deleteLayerConfigs.concat(t.deleteLayerConfigs),n.putLayerConfigs=n.putLayerConfigs.concat(t.putLayerConfigs);return n}isEmpty(e){return e.putFolders.length===0&&e.deleteFolders.length===0&&e.putFeatures.length===0&&e.deleteFeatures.length===0&&e.putLayerConfigs.length===0&&e.deleteLayerConfigs.length===0}},ly=new class{shallowCopy(e){return{undo:e.undo.slice(),redo:e.redo.slice(),paused:e.paused}}hasUndo(e){return e.undo.length>0}hasRedo(e){return e.redo.length>0}popMoment(e,t=1){let n=this.shallowCopy(e);for(let e=0;e<t;e++)n.undo.shift();return n}startSnapshot(e,t){let n=this.shallowCopy(e);if(n.paused=!0,t){let e=ay(`Drag`);Array.isArray(t)?e.putFeatures=e.putFeatures.concat(t):e.putFeatures.push(t),n.undo=[e].concat(n.undo).slice(0,sy)}return n}
126endSnapshot(e){let t=this.shallowCopy(e);return t.paused=!1,t}pushMoment(e,t){if(cy.isEmpty(t))return e;let n=this.shallowCopy(e);return n.redo.length&&(n.redo=[]),n.undo=[t].concat(n.undo).slice(0,sy),n}},uy=e=>e,dy=e=>({_tag:`Left`,value:e}),fy=e=>({_tag:`Right`,value:e}),$le=(e,t,n)=>n._tag===`Left`?e(n.value):t(n.value),py={dimap:(e,t,n)=>r=>t(n(e(r))),first:e=>([t,n])=>[e(t),n],right:e=>t=>t._tag===`Left`?t:fy(e(t.value)),wander:e=>t=>t.map(e)},eue={empty:()=>void 0,foldMap:(e,t)=>{for(let n=0;n<t.length;n++){let r=e(t[n]);if(r!=null)return r}}},tue={empty:()=>[],foldMap:(e,t)=>{let n=[];return t.forEach(t=>{n=n.concat(e(t))}),n}},my=e=>({dimap:(e,t,n)=>t=>n(e(t)),first:e=>([t,n])=>e(t),right:t=>n=>n._tag===`Left`?e.empty():t(n.value),wander:t=>n=>e.foldMap(t,n)}),hy={Equivalence:{Equivalence:`Equivalence`,Iso:`Iso`,Lens:`Lens`,Prism:`Prism`,Traversal:`Traversal`,Getter:`Getter`,AffineFold:`AffineFold`,Fold:`Fold`,Setter:`Setter`},Iso:{Equivalence:`Iso`,Iso:`Iso`,Lens:`Lens`,Prism:`Prism`,Traversal:`Traversal`,Getter:`Getter`,AffineFold:`AffineFold`,Fold:`Fold`,Setter:`Setter`},Lens:{Equivalence:`Lens`,Iso:`Lens`,Lens:`Lens`,Prism:`Prism`,Traversal:`Traversal`,Getter:`Getter`,AffineFold:`AffineFold`,Fold:`Fold`,Setter:`Setter`},Prism:{Equivalence:`Prism`,Iso:`Prism`,Lens:`Prism`,Prism:`Prism`,Traversal:`Traversal`,Getter:`AffineFold`,AffineFold:`AffineFold`,Fold:`Fold`,Setter:`Setter`},Traversal:{Equivalence:`Traversal`,Iso:`Traversal`,Lens:`Traversal`,Prism:`Traversal`,Traversal:`Traversal`,Getter:`Fold`,AffineFold:`Fold`,Fold:`Fold`,Setter:`Setter`},Getter:{Equivalence:`Getter`,Iso:`Getter`,Lens:`Getter`,Prism:`AffineFold`,Traversal:`Fold`,Getter:`Getter`,AffineFold:`AffineFold`,Fold:`Fold`,Setter:void 0},AffineFold:{Equivalence:`AffineFold`,Iso:`AffineFold`,Lens:`AffineFold`,Prism:`AffineFold`,Traversal:`Fold`,Getter:`AffineFold`,AffineFold:`AffineFold`,Fold:`Fold`,Setter:void 0},Fold:{Equivalence:`Fold`,Iso:`Fold`,Lens:`Fold`,Prism:`Fold`,Traversal:`Fold`,Getter:`Fold`,AffineFold:`Fold`,Fold:`Fold`,Setter:void 0},Setter:{Equivalence:void 0,Iso:void 0,Lens:void 0,Prism:void 0,Traversal:void 0,Getter:void 0,AffineFold:void 0,Fold:void 0,Setter:void 0}},gy=(e,t)=>{let n=t;return n._tag=e,n},_y=e=>(e._removable=!0,e);function vy(e,t,n){switch(arguments.length){case 2:{let n=(n,r)=>e(n,t(n,r));return n._tag=hy[e._tag][t._tag],n._removable=t._removable||!1,n}default:{let r=hy[e._tag][t._tag],i=(r,i)=>e(r,t(r,n(r,i)));return i._tag=hy[r][n._tag],i._removable=n._removable||!1,i}}}var nue=gy(`Equivalence`,(e,t)=>t),yy=(e,t)=>gy(`Iso`,(n,r)=>n.dimap(e,t,r)),by=(e,t)=>gy(`Lens`,(n,r)=>n.dimap(t=>[e(t),t],t,n.first(r))),xy=(e,t)=>gy(`Prism`,(n,r)=>n.dimap(e,e=>$le(uy,t,e),n.right(r))),Sy=gy(`Traversal`,(e,t)=>e.dimap(uy,uy,e.wander(t))),rue=e=>gy(`Getter`,(t,n)=>t.dimap(e,uy,n)),Cy=(e,t,n)=>e(py,t)(n),iue=(e,t,n)=>e(py,()=>t)(n),aue=(e,t)=>e(my({}),uy)(t),oue=(e,t)=>e(my(eue),uy)(t),wy=(e,t)=>e(my(tue),e=>[e])(t),sue=yy(e=>e.map((e,t)=>[t,e]),e=>{let t=[...e].sort((e,t)=>e[0]-t[0]),n=[];for(let e=0;e<t.length;++e)(e===t.length-1||t[e][0]!==t[e+1][0])&&n.push(t[e][1]);return n}),Ty=e=>by(t=>t[e],([t,n])=>Object.assign(Object.assign({},n),{[e]:t})),cue=e=>by(t=>{let n={};for(let r of e)n[r]=t[r];return n},([t,n])=>{let r=Object.assign({},n);for(let t of e)delete r[t];return Object.assign(r,t)}),Ey=e=>by(t=>t[e],([t,n])=>{let r=n.slice();return r[e]=t,r}),Dy=Ey(0),Oy=e=>xy(t=>e(t)?fy(t):dy(t),uy),ky=Symbol(`__no_match__`),Ay=Oy(e=>e!==ky),jy=Symbol(`__remove_me__`),My=e=>_y(vy(by(t=>0<=e&&e<t.length?t[e]:ky,([t,n])=>{if(t===ky)return n;if(t===jy)return typeof n==`string`?n.substring(0,e)+n.substring(e+1):[...n.slice(0,e),...n.slice(e+1)];if(typeof n==`string`)return e===0?t+n.substring(1):e===n.length?n.substring(0,e-1)+t:n.substring(0,e)+t+n.substring(e+1);{let r=n.slice();return r[e]=t,r}}),Ay)),lue=xy(e=>e===void 0?dy(void 0):fy(e),uy),uue=e=>xy(t=>e(t)?fy(t):dy(t),uy),due=e=>_y(vy(by(t=>{let n=t.findIndex(e);return n===-1?[ky,-1]:[t[n],n]},([[e,t],n])=>{if(e===ky)return n;if(e===jy)return[...n.slice(0,t),...n.slice(t+1)];let r=n.slice();return r[t]=e,r}),Dy,Ay)),fue=e=>vy(by(t=>{let n=t.map((t,n)=>e(t)?n:null).filter(e=>e!=null);return[n.map(e=>t[e]),n]},([[e,t],n])=>{let r=n.length,i=e.length,a=0,o=0,s=0,c=[];for(;a<r;)t[o]===a?(++o,s<i&&(c.push(e[s]),++s)):c.push(n[a]),++a;for(;s<i;)c.push(e[s++]);return c}),Dy),pue=e=>by(t=>t===void 0?e:t,([e,t])=>e),mue=e=>vy(by(t=>{let n=wy(e,t);return[n,n.length]},([[t,n],r])=>
126{if(t.length!==n)throw Error(`cannot add/remove elements through partsOf`);let i=0;return Cy(e,()=>t[i++],r)}),Dy),hue=e=>by(t=>e(t),([e,t])=>e),gue=e=>by(e=>e,([t,n])=>e(t)),_ue=by(e=>void 0,([e,t])=>e===void 0?t:[e,...t]),vue=by(e=>void 0,([e,t])=>e===void 0?t:[...t,e]),yue=vy(yy(e=>e.split(``),e=>e.join(``)),Sy),bue=vy(yy(e=>e.split(/\b/),e=>e.join(``)),Sy,Oy(e=>!/\s+/.test(e))),Ny=new class e{constructor(e){this._ref=e}get _tag(){return this._ref._tag}get _removable(){return this._ref._removable}compose(t){return new e(vy(this._ref,t._ref))}iso(t,n){return new e(vy(this._ref,yy(t,n)))}lens(t,n){return new e(vy(this._ref,by(t,([e,t])=>n(t,e))))}indexed(){return new e(vy(this._ref,sue))}prop(t){return new e(vy(this._ref,Ty(t)))}path(...t){return t.length===1&&(t=t[0].split(`.`)),new e(t.reduce((e,t)=>vy(e,Ty(t)),this._ref))}pick(t){return new e(vy(this._ref,cue(t)))}nth(t){return new e(vy(this._ref,Ey(t)))}filter(t){return new e(vy(this._ref,fue(t)))}valueOr(t){return new e(vy(this._ref,pue(t)))}partsOf(t){let n=typeof t==`function`?t(Ny):t;return new e(vy(this._ref,mue(n._ref)))}reread(t){return new e(vy(this._ref,hue(t)))}rewrite(t){return new e(vy(this._ref,gue(t)))}optional(){return new e(vy(this._ref,lue))}guard_(){return e=>this.guard(e)}guard(t){return new e(vy(this._ref,uue(t)))}at(t){return new e(vy(this._ref,My(t)))}head(){return new e(vy(this._ref,My(0)))}index(t){return new e(vy(this._ref,My(t)))}find(t){return new e(vy(this._ref,due(t)))}elems(){return new e(vy(this._ref,Sy))}to(t){return new e(vy(this._ref,rue(t)))}when(t){return new e(vy(this._ref,Oy(t)))}chars(){return new e(vy(this._ref,yue))}words(){return new e(vy(this._ref,bue))}prependTo(){return new e(vy(this._ref,_ue))}appendTo(){return new e(vy(this._ref,vue))}}(nue);function xue(){return Ny}function Sue(e){return t=>aue(e._ref,t)}function Cue(e){return t=>oue(e._ref,t)}function wue(e){return t=>wy(e._ref,t)}function Tue(e){return t=>n=>Cy(e._ref,t,n)}function Eue(e){return t=>n=>iue(e._ref,t,n)}var Py=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),Due=new WeakMap,Oue=(e,t,n)=>Py(e,Py(()=>new WeakMap,Due,t),n),kue=e=>typeof e==`function`;function Aue(e,t){return Oue(()=>{let n=t(xue());return zv(t=>{let r=t(e);return r instanceof Promise?r.then(e=>Fy(n,e)):Fy(n,r)},(t,r,i)=>{let a=kue(i)?Tue(n)(i):Eue(n)(i),o=t(e);return r(e,o instanceof Promise?o.then(a):a(o))})},e,t)}var Fy=(e,t)=>e._tag===`Traversal`?wue(e)(t):e._tag===`Prism`?Cue(e)(t):Sue(e)(t),Iy=function(){return Iy=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Iy.apply(this,arguments)};function Ly(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);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ry(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function zy(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function By(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Vy;(function(e){e.Start=`xstate.start`,e.Stop=`xstate.stop`,e.Raise=`xstate.raise`,e.Send=`xstate.send`,e.Cancel=`xstate.cancel`,e.NullEvent=``,e.Assign=`xstate.assign`,e.After=`xstate.after`,e.DoneState=`done.state`,e.DoneInvoke=`done.invoke`,e.Log=`xstate.log`,e.Init=`xstate.init`,e.Invoke=`xstate.invoke`,e.ErrorExecution=`error.execution`,e.ErrorCommunication=`error.communication`,e.ErrorPlatform=`error.platform`,e.ErrorCustom=`xstate.error`,e.Update=`xstate.update`,e.Pure=`xstate.pure`,e.Choose=`xstate.choose`})(Vy||={});var Hy;(function(e){e.Parent=`#_parent`,e.Internal=`#_internal`})(Hy||={});var Uy=Vy.Start,Wy=Vy.Stop,Gy=Vy.Raise,Ky=Vy.Send,qy=Vy.Cancel,jue=Vy.NullEvent,Jy=Vy.Assign;Vy.After,Vy.DoneState;var Yy=Vy.Log,Mue=Vy.Init,Xy=Vy.Invoke;Vy.ErrorExecution;var Zy=Vy.ErrorPlatform,Nue=Vy.ErrorCustom,Qy=Vy.Update,Pue=Vy.Choose,Fue=Vy.Pure,$y={},eb=`xstate.guard`,tb;function nb(e,t,n){n===void 0&&(n=`.`);var r=ab(e,n),i=ab(t,n);
126return yb(i)?yb(r)?i===r:!1:yb(r)?r in i:Object.keys(r).every(function(e){return e in i?nb(r[e],i[e]):!1})}function rb(e){try{return yb(e)||typeof e==`number`?`${e}`:e.type}catch{throw Error(`Events must be strings or objects with a string event.type property.`)}}function ib(e,t){try{return _b(e)?e:e.toString().split(t)}catch{throw Error(`'${e}' is not a valid state path.`)}}function Iue(e){return typeof e==`object`&&`value`in e&&`context`in e&&`event`in e&&`_event`in e}function ab(e,t){return Iue(e)?e.value:_b(e)?ob(e):typeof e==`string`?ob(ib(e,t)):e}function ob(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function sb(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var a=r[i];n[a]=t(e[a],a,e,i)}return n}function cb(e,t,n){var r,i,a={};try{for(var o=Ry(Object.keys(e)),s=o.next();!s.done;s=o.next()){var c=s.value,l=e[c];n(l)&&(a[c]=t(l,c,e))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}var Lue=function(e){return function(t){var n,r,i=t;try{for(var a=Ry(e),o=a.next();!o.done;o=a.next()){var s=o.value;i=i[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}};function Rue(e,t){return function(n){var r,i,a=n;try{for(var o=Ry(e),s=o.next();!s.done;s=o.next()){var c=s.value;a=a[t][c]}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}}function lb(e){return e?yb(e)?[[e]]:ub(Object.keys(e).map(function(t){var n=e[t];return typeof n!=`string`&&(!n||!Object.keys(n).length)?[[t]]:lb(e[t]).map(function(e){return[t].concat(e)})})):[[]]}function ub(e){var t;return(t=[]).concat.apply(t,By([],zy(e),!1))}function db(e){return _b(e)?e:[e]}function fb(e){return e===void 0?[]:db(e)}function pb(e,t,n){var r,i;if(vb(e))return e(t,n.data);var a={};try{for(var o=Ry(Object.keys(e)),s=o.next();!s.done;s=o.next()){var c=s.value,l=e[c];vb(l)?a[c]=l(t,n.data):a[c]=l}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function zue(e){return/^(done|error)\./.test(e)}function mb(e){return!!(e instanceof Promise||e!==null&&(vb(e)||typeof e==`object`)&&vb(e.then))}function Bue(e){return typeof e==`object`&&!!e&&`transition`in e&&typeof e.transition==`function`}function Vue(e,t){var n,r,i=zy([[],[]],2),a=i[0],o=i[1];try{for(var s=Ry(e),c=s.next();!c.done;c=s.next()){var l=c.value;t(l)?a.push(l):o.push(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[a,o]}function hb(e,t){return sb(e.states,function(e,n){if(e){var r=(yb(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:hb(e,r)}}})}function Hue(e,t){return{current:t,states:hb(e,t)}}function gb(e,t,n,r){return e&&n.reduce(function(e,n){var i,a,o=n.assignment,s={state:r,action:n,_event:t},c={};if(vb(o))c=o(e,t.data,s);else try{for(var l=Ry(Object.keys(o)),u=l.next();!u.done;u=l.next()){var d=u.value,f=o[d];c[d]=vb(f)?f(e,t.data,s):f}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return Object.assign({},e,c)},e)}function _b(e){return Array.isArray(e)}function vb(e){return typeof e==`function`}function yb(e){return typeof e==`string`}function bb(e,t){if(e)return yb(e)?{type:eb,name:e,predicate:t?t[e]:void 0}:vb(e)?{type:eb,name:e.name,predicate:e}:e}function Uue(e){try{return`subscribe`in e&&vb(e.subscribe)}catch{return!1}}var xb=function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`}();tb={},tb[xb]=function(){return this},tb[Symbol.observable]=function(){return this};function Sb(e){return!!e&&`__xstatenode`in e}function Wue(e){return!!e&&typeof e.send==`function`}function Cb(e,t){return yb(e)||typeof e==`number`?Iy({type:e},t):e}function wb(e,t){if(!yb(e)&&`$$type`in e&&e.$$type===`scxml`)return e;var n=Cb(e);return Iy({name:n.type,data:n,$$type:`scxml`,type:`external`},t)}function Tb(e,t){return db(t).map(function(t){return t===void 0||typeof t==`string`||Sb(t)?{target:t,event:e}:Iy(Iy({},t),{event:e})})}function Gue(e){if(!(e===void 0||e===``))return fb(e)}function Eb(e,t,n,r,i){var a=e.options.guards,o={state:i,cond:t,_event:r};
126if(t.type===`xstate.guard`)return(a?.[t.name]||t.predicate)(n,r.data,o);var s=a?.[t.type];if(!s)throw Error(`Guard '${t.type}' is not implemented on machine '${e.id}'.`);return s(n,r.data,o)}function Db(e){return typeof e==`string`?{type:e}:e}function Ob(e,t,n){var r=function(){},i=typeof e==`object`,a=i?e:null;return{next:((i?e.next:e)||r).bind(a),error:((i?e.error:t)||r).bind(a),complete:((i?e.complete:n)||r).bind(a)}}function kb(e,t){return`${e}:invocation[${t}]`}function Ab(e){return(e.type===Gy||e.type===Ky&&e.to===Hy.Internal)&&typeof e.delay!=`number`}var jb=wb({type:Mue});function Mb(e,t){return t&&t[e]||void 0}function Nb(e,t){var n;if(yb(e)||typeof e==`number`){var r=Mb(e,t);n=vb(r)?{type:e,exec:r}:r||{type:e,exec:void 0}}else if(vb(e))n={type:e.name||e.toString(),exec:e};else{var r=Mb(e.type,t);if(vb(r))n=Iy(Iy({},e),{exec:r});else if(r){var i=r.type||e.type;n=Iy(Iy(Iy({},r),e),{type:i})}else n=e}return n}var Pb=function(e,t){return e?(_b(e)?e:[e]).map(function(e){return Nb(e,t)}):[]};function Fb(e){var t=Nb(e);return Iy(Iy({id:yb(e)?e:t.id},t),{type:t.type})}function Kue(e,t){return{type:Gy,event:typeof e==`function`?e:Cb(e),delay:t?t.delay:void 0,id:t?.id}}function que(e,t,n,r){var i={_event:n},a=wb(vb(e.event)?e.event(t,n.data,i):e.event),o;if(yb(e.delay)){var s=r&&r[e.delay];o=vb(s)?s(t,n.data,i):s}else o=vb(e.delay)?e.delay(t,n.data,i):e.delay;return Iy(Iy({},e),{type:Gy,_event:a,delay:o})}function Jue(e,t){return{to:t?t.to:void 0,type:Ky,event:vb(e)?e:Cb(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:vb(e)?e.name:rb(e)}}function Yue(e,t,n,r){var i={_event:n},a=wb(vb(e.event)?e.event(t,n.data,i):e.event),o;if(yb(e.delay)){var s=r&&r[e.delay];o=vb(s)?s(t,n.data,i):s}else o=vb(e.delay)?e.delay(t,n.data,i):e.delay;var c=vb(e.to)?e.to(t,n.data,i):e.to;return Iy(Iy({},e),{to:c,_event:a,event:a.data,delay:o})}var Xue=function(e,t,n){return Iy(Iy({},e),{value:yb(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Zue=function(e){return{type:qy,sendId:e}};function Que(e){var t=Fb(e);return{type:Vy.Start,activity:t,exec:void 0}}function $ue(e){var t=vb(e)?e:Fb(e);return{type:Vy.Stop,activity:t,exec:void 0}}function ede(e,t,n){var r=vb(e.activity)?e.activity(t,n.data):e.activity,i=typeof r==`string`?{id:r}:r;return{type:Vy.Stop,activity:i}}var tde=function(e){return{type:Jy,assignment:e}};function nde(e,t){var n=t?`#${t}`:``;return`${Vy.After}(${e})${n}`}function Ib(e,t){var n=`${Vy.DoneState}.${e}`,r={type:n,data:t};return r.toString=function(){return n},r}function Lb(e,t){var n=`${Vy.DoneInvoke}.${e}`,r={type:n,data:t};return r.toString=function(){return n},r}function Rb(e,t){var n=`${Vy.ErrorPlatform}.${e}`,r={type:n,data:t};return r.toString=function(){return n},r}var rde=function(e){var t,n,r=[];try{for(var i=Ry(e),a=i.next();!a.done;a=i.next())for(var o=a.value,s=0;s<o.actions.length;){if(o.actions[s].type===Jy){r.push(o.actions[s]),o.actions.splice(s,1);continue}s++}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function zb(e,t,n,r,i,a,o){o===void 0&&(o=!1);var s=o?[]:rde(i),c=s.length?gb(n,r,s,t):n,l=o?[n]:void 0,u=[];function d(i,s){switch(s.type){case Gy:var d=que(s,c,r,e.options.delays);return a&&typeof d.delay==`number`&&a(d,c,r),d;case Ky:var f=Yue(s,c,r,e.options.delays);return a&&f.to!==Hy.Internal&&(i===`entry`?u.push(f):a(f,c,r)),f;case Yy:var p=Xue(s,c,r);return a?.(p,c,r),p;case Pue:var m=s.conds.find(function(n){var i=bb(n.cond,e.options.guards);return!i||Eb(e,i,c,r,a?void 0:t)})?.actions;if(!m)return[];var h=zy(zb(e,t,c,r,[{type:i,actions:Pb(fb(m),e.options.actions)}],a,o),2),g=h[0];return c=h[1],l?.push(c),g;case Fue:var m=s.get(c,r.data);if(!m)return[];var _=zy(zb(e,t,c,r,[{type:i,actions:Pb(fb(m),e.options.actions)}],a,o),2),v=_[0];return c=_[1],l?.push(c),v;case Wy:var p=ede(s,c,r);return a?.(p,n,r),p;case Jy:c=gb(c,r,[s],a?void 0:t),l?.push(c);break;default:var y=Nb(s,e.options.actions),b=y.exec;if(a)a(y,c,r);else if(b&&l){var x=l.length-1;y=Iy(Iy({},y),{exec:function(e){var t=[...arguments].slice(1);b.apply(void 0,By([l[x]],zy(t),!1))}})}return y}}function f(e){var t,n,i=[];try{for(var o=Ry(e.actions),s=o.next();!s.done;s=o.next()){var l=s.value,f=d(e.type,l);f&&(i=i.concat(f))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return u.forEach(function(e){a(e,c,r)}),u.length=0,i}return[ub(i.map(f)),c]}var Bb=[],Vb=function(e,t){Bb.push(e);var n=t(e);return Bb.pop(),n};function Hb(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[xb]=function(){return this},t}function ide(e,t,n,r){var i=Db(e.src),a=t?.options.services?.[i.type],o=e.data?pb(e.data,n,r):void 0,s=a?Ub(a,e.id,o):Hb(e.id);return s.meta=e,s}function Ub(e,t,n){var r=Hb(t);if(r.deferred=!0,Sb(e)){var i=r.state=Vb(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function ade(e){try{return typeof e.send==`function`}catch{return!1}}function ode(e){return ade(e)&&`id`in e}function sde(e){var t;return Iy((t={subscribe:function(){return{unsubscribe:function(){}}},id:`anonymous`,getSnapshot:function(){}},t[xb]=function(){return this},t),e)}var Wb=function(e){return e.type===`atomic`||e.type===`final`};function Gb(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Kb(e){return Gb(e).filter(function(e){return e.type!==`history`})}function qb(e){var t=[e];return Wb(e)?t:t.concat(ub(Kb(e).map(qb)))}function Jb(e,t){var n,r,i,a,o,s,c,l,u=Xb(new Set(e)),d=new Set(t);try{for(var f=Ry(d),p=f.next();!p.done;p=f.next())for(var m=p.value,h=m.parent;
126h&&!d.has(h);)d.add(h),h=h.parent}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}var g=Xb(d);try{for(var _=Ry(d),v=_.next();!v.done;v=_.next()){var m=v.value;if(m.type===`compound`&&(!g.get(m)||!g.get(m).length))u.get(m)?u.get(m).forEach(function(e){return d.add(e)}):m.initialStateNodes.forEach(function(e){return d.add(e)});else if(m.type===`parallel`)try{for(var y=(o=void 0,Ry(Kb(m))),b=y.next();!b.done;b=y.next()){var x=b.value;d.has(x)||(d.add(x),u.get(x)?u.get(x).forEach(function(e){return d.add(e)}):x.initialStateNodes.forEach(function(e){return d.add(e)}))}}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}}}catch(e){i={error:e}}finally{try{v&&!v.done&&(a=_.return)&&a.call(_)}finally{if(i)throw i.error}}try{for(var S=Ry(d),C=S.next();!C.done;C=S.next())for(var m=C.value,h=m.parent;h&&!d.has(h);)d.add(h),h=h.parent}catch(e){c={error:e}}finally{try{C&&!C.done&&(l=S.return)&&l.call(S)}finally{if(c)throw c.error}}return d}function Yb(e,t){var n=t.get(e);if(!n)return{};if(e.type===`compound`){var r=n[0];if(r){if(Wb(r))return r.key}else return{}}var i={};return n.forEach(function(e){i[e.key]=Yb(e,t)}),i}function Xb(e){var t,n,r=new Map;try{for(var i=Ry(e),a=i.next();!a.done;a=i.next()){var o=a.value;r.has(o)||r.set(o,[]),o.parent&&(r.has(o.parent)||r.set(o.parent,[]),r.get(o.parent).push(o))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function cde(e,t){return Yb(e,Xb(Jb([e],t)))}function Zb(e,t){return Array.isArray(e)?e.some(function(e){return e===t}):e instanceof Set?e.has(t):!1}function lde(e){return By([],zy(new Set(ub(By([],zy(e.map(function(e){return e.ownEvents})),!1)))),!1)}function Qb(e,t){return t.type===`compound`?Kb(t).some(function(t){return t.type===`final`&&Zb(e,t)}):t.type===`parallel`?Kb(t).every(function(t){return Qb(e,t)}):!1}function ude(e){return e===void 0&&(e=[]),e.reduce(function(e,t){return t.meta!==void 0&&(e[t.id]=t.meta),e},{})}function $b(e){return new Set(ub(e.map(function(e){return e.tags})))}function ex(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(yb(e)||yb(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(n){return ex(e[n],t[n])})}function dde(e){return typeof e!=`object`||!e?!1:`value`in e&&`_event`in e}function fde(e,t){var n=e.exec;return Iy(Iy({},e),{exec:n===void 0?void 0:function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}})}var tx=function(){function e(e){var t=this;this.actions=[],this.activities=$y,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||$y,this.meta=ude(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=(Array.isArray(e.tags)?new Set(e.tags):e.tags)??new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return lde(t.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context===n?t:new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):new e({value:t,context:n,_event:jb,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=jb;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(e===void 0&&(e=this.value),t===void 0&&(t=`.`),yb(e))return[e];var r=Object.keys(e);return r.concat.apply(r,By([],zy(r.map(function(r){return n.toStrings(e[r],t).map(function(e){return r+t+e})})),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;return e.machine,Iy(Iy({},Ly(e,[`configuration`,`transitions`,`tags`,`machine`])),{tags:Array.from(t)})},e.prototype.matches=function(e){return nb(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){this.machine;var t=this.machine?.getTransitionData(this,e);return!!t?.transitions.length&&t.transitions.some(function(e){return e.target!==void 0||e.actions.length})},e}(),pde={deferEvents:!1},nx=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=Iy(Iy({},pde),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents){this.schedule(e);return}this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(!this.initialized||this.processingEvent){this.queue.push(e);return}if(this.queue.length!==0)throw Error(`Event queue should be empty when it is not processing events`);this.process(e),this.flushEvents()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),rx=new Map,mde=0,ix={bookId:function(){return`x:${mde++}`},register:function(e,t){return rx.set(e,t),e},get:function(e){return rx.get(e)},free:function(e){rx.delete(e)}};oe();function ax(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(se!==void 0)return se}function hde(){var e=ax();if(e&&`__xstate__`in e)return e.__xstate__}function gde(e){if(ax()){var t=hde();t&&t.register(e)}}function _de(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],a=!1,o=function(){if(!a){for(a=!0;i.length>0;){var t=i.shift();n=e.transition(n,t,c),r.forEach(function(e){return e.next(n)})}a=!1}}
126,s=sde({id:t.id,send:function(e){i.push(e),o()},getSnapshot:function(){return n},subscribe:function(e,t,i){var a=Ob(e,t,i);return r.add(a),a.next(n),{unsubscribe:function(){r.delete(a)}}}}),c={parent:t.parent,self:s,id:t.id||`anonymous`,observers:r};return n=e.start?e.start(c):n,s}var vde={sync:!1,autoForward:!1},ox;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(ox||={});var yde=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=ox.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if(_b(e))return r.batch(e),r.state;var n=wb(Cb(e,t));if(r.status===ox.Stopped)return r.state;if(r.status!==ox.Running&&!r.options.deferEvents)throw Error(`Event "${n.name}" was sent to uninitialized service "${r.machine.id}". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
127Event: ${JSON.stringify(n.data)}`);return r.scheduler.schedule(function(){r.forward(n);var e=r._nextState(n);r.update(e,n)}),r._state},this.sendTo=function(e,t,n){var i=r.parent&&(t===Hy.Parent||r.parent.id===t),a=i?r.parent:yb(t)?t===Hy.Internal?r:r.children.get(t)||ix.get(t):Wue(t)?t:void 0;if(!a){if(!i)throw Error(`Unable to send event to child '${t}' from service '${r.id}'.`);return}if(`machine`in a){if(r.status!==ox.Stopped||r.parent!==a||r.state.done){var o=Iy(Iy({},e),{name:e.name===Nue?`${Rb(r.id)}`:e.name,origin:r.sessionId});!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,o]):a.send(o)}}else!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,e.data]):a.send(e.data)},this._exec=function(e,t,n,i){i===void 0&&(i=r.machine.options.actions);var a=e.exec||Mb(e.type,i),o=vb(a)?a:a?a.exec:e.exec;if(o)try{return o(t,n.data,r.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:r.state,_event:n})}catch(e){throw r.parent&&r.parent.send({type:`xstate.error`,data:e}),e}switch(e.type){case Gy:var s=e;r.defer(s);break;case Ky:var c=e;if(typeof c.delay==`number`){r.defer(c);return}else c.to?r.sendTo(c._event,c.to,n===jb):r.send(c._event);break;case qy:r.cancel(e.sendId);break;case Uy:if(r.status!==ox.Running)return;var l=e.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[l.id||l.type])break;if(l.type===Vy.Invoke){var u=Db(l.src),d=r.machine.options.services?r.machine.options.services[u.type]:void 0,f=l.id,p=l.data,m=`autoForward`in l?l.autoForward:!!l.forward;if(!d)return;var h=p?pb(p,t,n):void 0;if(typeof d==`string`)return;var g=vb(d)?d(t,n.data,{data:h,src:u,meta:l.meta}):d;if(!g)return;var _=void 0;
127Sb(g)&&(g=h?g.withContext(h):g,_={autoForward:m}),r.spawn(g,f,_)}else r.spawnActivity(l);break;case Wy:r.stopChild(e.activity.id);break;case Yy:var v=e,y=v.label,b=v.value;y?r.logger(y,b):r.logger(b);break;default:break}};var i=Iy(Iy({},e.defaultOptions),n),a=i.clock,o=i.logger,s=i.parent,c=i.id,l=c===void 0?t.id:c;this.id=l,this.logger=o,this.clock=a,this.parent=s,this.options=i,this.scheduler=new nx({deferEvents:this.options.deferEvents}),this.sessionId=ix.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:Vb(this,function(){return e._initialState=e.machine.initialState,e._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var i=Ry(e.actions),a=i.next();!a.done;a=i.next()){var o=a.value;this.exec(o,e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,i,a,o,s,c,l,u=this;if(e._sessionid=this.sessionId,this._state=e,(!this.machine.config.predictableActionArguments||t===jb)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(e){u.state.children[e.id]=e}),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var f=Ry(this.eventListeners),p=f.next();!p.done;p=f.next()){var m=p.value;m(e.event)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}try{for(var h=Ry(this.listeners),g=h.next();!g.done;g=h.next()){var m=g.value;m(e,e.event)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}try{for(var _=Ry(this.contextListeners),v=_.next();!v.done;v=_.next()){var y=v.value;y(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=_.return)&&s.call(_)}finally{if(o)throw o.error}}if(this.state.done){var b=e.configuration.find(function(e){return e.type===`final`&&e.parent===u.machine}),x=b&&b.doneData?pb(b.doneData,e.context,t):void 0;this._doneEvent=Lb(this.id,x);try{for(var S=Ry(this.doneListeners),C=S.next();!C.done;C=S.next()){var m=C.value;m(this._doneEvent)}}catch(e){c={error:e}}finally{try{C&&!C.done&&(l=S.return)&&l.call(S)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),ix.free(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===ox.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,i=Ob(e,t,n);this.listeners.add(i.next),this.status!==ox.NotStarted&&i.next(this.state);var a=function(){r.doneListeners.delete(a),r.stopListeners.delete(a),i.complete()};return this.status===ox.Stopped?i.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){r.listeners.delete(i.next),r.doneListeners.delete(a),r.stopListeners.delete(a)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===ox.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===ox.Running)return this;this.machine._init(),ix.register(this.sessionId,this),this.initialized=!0,this.status=ox.Running;var n=e===void 0?this.initialState:Vb(this,function(){return dde(e)?t.machine.resolveState(e):t.machine.resolveState(tx.from(e,t.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){t.update(n,jb)}),this}
127,e.prototype._stopChildren=function(){this.children.forEach(function(e){vb(e.stop)&&e.stop()}),this.children.clear()},e.prototype._stop=function(){var e,t,n,r,i,a,o,s,c,l;try{for(var u=Ry(this.listeners),d=u.next();!d.done;d=u.next()){var f=d.value;this.listeners.delete(f)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}try{for(var p=Ry(this.stopListeners),m=p.next();!m.done;m=p.next()){var f=m.value;f(),this.stopListeners.delete(f)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{for(var h=Ry(this.contextListeners),g=h.next();!g.done;g=h.next()){var f=g.value;this.contextListeners.delete(f)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}try{for(var _=Ry(this.doneListeners),v=_.next();!v.done;v=_.next()){var f=v.value;this.doneListeners.delete(f)}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=_.return)&&s.call(_)}finally{if(o)throw o.error}}if(!this.initialized)return this;this.initialized=!1,this.status=ox.Stopped,this._initialState=void 0;try{for(var y=Ry(Object.keys(this.delayedEventsMap)),b=y.next();!b.done;b=y.next()){var x=b.value;this.clock.clearTimeout(this.delayedEventsMap[x])}}catch(e){c={error:e}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new nx({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule(function(){if(!e._state?.done){var t=wb({type:`xstate.stop`}),n=Vb(e,function(){var n=ub(By([],zy(e.state.configuration),!1).sort(function(e,t){return t.order-e.order}).map(function(t){return Pb(t.onExit,e.machine.options.actions)})),r=zy(zb(e.machine,e.state,e.state.context,t,[{type:`exit`,actions:n}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),i=r[0],a=r[1],o=new tx({value:e.state.value,context:a,_event:t,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:i.filter(function(e){return!Ab(e)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return o.changed=!0,o});e.update(n,t),e._stopChildren(),ix.free(e.sessionId)}}),this},e.prototype.batch=function(e){var t=this;if(!(this.status===ox.NotStarted&&this.options.deferEvents)&&this.status!==ox.Running)throw Error(`${e.length} event(s) were sent to uninitialized service "${this.machine.id}". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.`);if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var r,i,a=t.state,o=!1,s=[],c=function(e){var r=wb(e);t.forward(r),a=Vb(t,function(){return t.machine.transition(a,r,void 0,n||void 0)}),s.push.apply(s,By([],zy(t.machine.config.predictableActionArguments?a.actions:a.actions.map(function(e){return fde(e,a)})),!1)),o||=!!a.changed};try{for(var l=Ry(e),u=l.next();!u.done;u=l.next()){var d=u.value;c(d)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}a.changed=o,a.actions=s,t.update(a,wb(e[e.length-1]))})}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;t===void 0&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=wb(e);if(r.name.indexOf(Zy)===0&&!this.state.nextEvents.some(function(e){return e.indexOf(Zy)===0}))throw r.data.data;return Vb(this,function(){return n.machine.transition(n.state,r,void 0,t||void 0)})},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var r=Ry(this.forwardTo),i=r.next();!i.done;i=r.next()){var a=i.value,o=this.children.get(a);if(!o)throw Error(`Unable to forward event '${e}' from interpreter '${this.id}' to nonexistant child '${a}'.`);o.send(e)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,n=this.clock.setTimeout(function(){`to`in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)},e.delay);e.id&&(this.delayedEventsMap[e.id]=n)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){n===void 0&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),(t=this.state)==null||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);
127t&&(this.removeChild(e),vb(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==ox.Running)return Ub(e,t);if(mb(e))return this.spawnPromise(Promise.resolve(e),t);if(vb(e))return this.spawnCallback(e,t);if(ode(e))return this.spawnActor(e,t);if(Uue(e))return this.spawnObservable(e,t);if(Sb(e))return this.spawnMachine(e,Iy(Iy({},n),{id:t}));if(Bue(e))return this.spawnBehavior(e,t);throw Error(`Unable to spawn entity "${t}" of type "${typeof e}".`)},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var i=new e(t,Iy(Iy({},this.options),{parent:this,id:n.id||t.id})),a=Iy(Iy({},vde),n);a.sync&&i.onTransition(function(e){r.send(Qy,{state:e,id:i.id})});var o=i;return this.children.set(i.id,o),a.autoForward&&this.forwardTo.add(i.id),i.onDone(function(e){r.removeChild(i.id),r.send(wb(e,{origin:i.id}))}).start(),o},e.prototype.spawnBehavior=function(e,t){var n=_de(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r=this,i=!1,a;e.then(function(e){i||(a=e,r.removeChild(t),r.send(wb(Lb(t,e),{origin:t})))},function(e){if(!i){r.removeChild(t);var n=Rb(t,e);try{r.send(wb(n,{origin:t}))}catch{r.devTools&&r.devTools.send(n,r.state),r.machine.strict&&r.stop()}}});var o=(n={id:t,send:function(){},subscribe:function(t,n,r){var i=Ob(t,n,r),a=!1;return e.then(function(e){a||(i.next(e),!a&&i.complete())},function(e){a||i.error(e)}),{unsubscribe:function(){return a=!0}}},stop:function(){i=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return a}},n[xb]=function(){return this},n);return this.children.set(t,o),o},e.prototype.spawnCallback=function(e,t){var n,r=this,i=!1,a=new Set,o=new Set,s,c=function(e){s=e,o.forEach(function(t){return t(e)}),!i&&r.send(wb(e,{origin:t}))},l;try{l=e(c,function(e){a.add(e)})}catch(e){this.send(Rb(t,e))}if(mb(l))return this.spawnPromise(l,t);var u=(n={id:t,send:function(e){return a.forEach(function(t){return t(e)})},subscribe:function(e){var t=Ob(e);return o.add(t.next),{unsubscribe:function(){o.delete(t.next)}}},stop:function(){i=!0,vb(l)&&l()},toJSON:function(){return{id:t}},getSnapshot:function(){return s}},n[xb]=function(){return this},n);return this.children.set(t,u),u},e.prototype.spawnObservable=function(e,t){var n,r=this,i,a=e.subscribe(function(e){i=e,r.send(wb(e,{origin:t}))},function(e){r.removeChild(t),r.send(wb(Rb(t,e),{origin:t}))},function(){r.removeChild(t),r.send(wb(Lb(t),{origin:t}))}),o=(n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return i},toJSON:function(){return{id:t}}},n[xb]=function(){return this},n);return this.children.set(t,o),o},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,(n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}},n[xb]=function(){return this},n))},e.prototype.attachDev=function(){var e=ax();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t=typeof this.options.devTools==`object`?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(Iy(Iy({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:Iy({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}gde(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[xb]=function(){return this},e.prototype.getSnapshot=function(){return this.status===ox.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=sx,e}();function sx(e,t){return new yde(e,t)}function bde(e){if(typeof e==`string`){var t={type:e};return t.toString=function(){return e},t}return e}function cx(e){return Iy(Iy({type:Xy},e),{toJSON:function(){return e.onDone,e.onError,Iy(Iy({},Ly(e,[`onDone`,`onError`])),{type:Xy,src:bde(e.src)})}})}var lx=``,ux=`#`,dx=`*`,fx={},px=function(e){return e[0]===ux},xde=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},Sde=function(){function e(t,n,r,i){r===void 0&&(r=`context`in t?t.context:void 0);var a=this;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(xde(),n),this.parent=i?.parent,this.key=this.config.key||i?.key||this.config.id||`(machine)`,this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:`.`),this.id=this.config.id||By([this.machine.key],zy(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?`parallel`:this.config.states&&Object.keys(this.config.states).length?`compound`:this.config.history?`history`:`atomic`),this.schema=this.parent?this.machine.schema:this.config.schema??{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?sb(this.config.states,function(t,n){var r,i=new e(t,{},void 0,{parent:a,key:n});return Object.assign(a.idMap,Iy((r={},r[i.id]=i,r),i.idMap)),i}):fx;var o=0;function s(e){var t,n;e.order=o++;try{for(var r=Ry(Gb(e)),i=r.next();!i.done;i=r.next()){var a=i.value;s(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}s(this),this.history=this.config.history===!0?`shallow`:this.config.history||
127!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(e){return e.event===lx}):lx in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=fb(this.config.entry||this.config.onEntry).map(function(e){return Nb(e)}),this.onExit=fb(this.config.exit||this.config.onExit).map(function(e){return Nb(e)}),this.meta=this.config.meta,this.doneData=this.type===`final`?this.config.data:void 0,this.invoke=fb(this.config.invoke).map(function(e,t){var n,r;if(Sb(e)){var i=kb(a.id,t);return a.machine.options.services=Iy((n={},n[i]=e,n),a.machine.options.services),cx({src:i,id:i})}else if(yb(e.src)){var i=e.id||kb(a.id,t);return cx(Iy(Iy({},e),{id:i,src:e.src}))}else if(Sb(e.src)||vb(e.src)){var i=e.id||kb(a.id,t);return a.machine.options.services=Iy((r={},r[i]=e.src,r),a.machine.options.services),cx(Iy(Iy({id:i},e),{src:i}))}else{var o=e.src;return cx(Iy(Iy({id:kb(a.id,t)},e),{src:o}))}}),this.activities=fb(this.config.activities).concat(this.invoke).map(function(e){return Fb(e)}),this.transition=this.transition.bind(this),this.tags=fb(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||qb(this).forEach(function(e){return e.on})},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,a=r.activities,o=r.guards,s=r.services,c=r.delays;return new e(this.config,{actions:Iy(Iy({},i),t.actions),activities:Iy(Iy({},a),t.activities),guards:Iy(Iy({},o),t.guards),services:Iy(Iy({},s),t.services),delays:Iy(Iy({},c),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return vb(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:sb(this.states,function(e){return e.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce(function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===lx,n=this.transitions.filter(function(n){var r=n.eventType===e;return t?r:r||n.eventType===dx});return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=nde(vb(t)?`${e.id}:delay[${n}]`:t,e.id);return e.onEntry.push(Jue(r,{delay:t})),e.onExit.push(Zue(r)),r};return(_b(t)?t.map(function(e,t){var r=n(e.delay,t);return Iy(Iy({},e),{event:r})}):ub(Object.keys(t).map(function(e,r){var i=t[e],a=yb(i)?{target:i}:i,o=isNaN(+e)?e:+e,s=n(o,r);return fb(a).map(function(e){return Iy(Iy({},e),{event:s,delay:o})})}))).map(function(t){var n=t.delay;return Iy(Iy({},e.formatTransition(t)),{delay:n})})},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof tx?e.value:ab(e,this.delimiter);if(yb(r)){var i=this.getStateNode(r).initial;return i===void 0?[this,this.states[r]]:this.getStateNodes((t={},t[r]=i,t))}var a=Object.keys(r),o=[this];return o.push.apply(o,By([],zy(ub(a.map(function(e){return n.getStateNode(e).getStateNodes(r[e])}))),!1)),o},e.prototype.handles=function(e){var t=rb(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof tx?e:tx.create(e),n=Array.from(Jb([],this.get
127StateNodes(t.value)));return new tx(Iy(Iy({},t),{value:this.resolve(t.value),configuration:n,done:Qb(n,this),tags:$b(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return!r||!r.transitions.length?this.next(t,n):r},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),i=this.getStateNode(r[0])._transition(e[r[0]],t,n);return!i||!i.transitions.length?this.next(t,n):i},e.prototype.transitionParallelNode=function(e,t,n){var r,i,a={};try{for(var o=Ry(Object.keys(e)),s=o.next();!s.done;s=o.next()){var c=s.value,l=e[c];if(l){var u=this.getStateNode(c)._transition(l,t,n);u&&(a[c]=u)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}var d=Object.keys(a).map(function(e){return a[e]}),f=ub(d.map(function(e){return e.transitions}));if(!d.some(function(e){return e.transitions.length>0}))return this.next(t,n);var p=ub(Object.keys(a).map(function(e){return a[e].configuration}));return{transitions:f,exitSet:ub(d.map(function(e){return e.exitSet})),configuration:p,source:t,actions:ub(Object.keys(a).map(function(e){return a[e].actions}))}},e.prototype._transition=function(e,t,n){return yb(e)?this.transitionLeafNode(e,t,n):Object.keys(e).length===1?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,wb(t))},e.prototype.next=function(e,t){var n,r,i=this,a=t.name,o=[],s=[],c;try{for(var l=Ry(this.getCandidates(a)),u=l.next();!u.done;u=l.next()){var d=u.value,f=d.cond,p=d.in,m=e.context,h=p?yb(p)&&px(p)?e.matches(ab(this.getStateNodeById(p).path,this.delimiter)):nb(ab(p,this.delimiter),Lue(this.path.slice(0,-2))(e.value)):!0,g=!1;try{g=!f||Eb(this.machine,f,m,t,e)}catch(e){throw Error(`Unable to evaluate guard '${f.name||f.type}' in transition for event '${a}' in state node '${this.id}':
128${e.message}`)}if(g&&h){d.target!==void 0&&(s=d.target),o.push.apply(o,By([],zy(d.actions),!1)),c=d;break}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}if(c){if(!s.length)return{transitions:[c],exitSet:[],configuration:e.value?[this]:[],source:e,actions:o};var _=ub(s.map(function(t){return i.getRelativeStateNodes(t,e.historyValue)})),v=!!c.internal;return{transitions:[c],exitSet:v?[]:ub(s.map(function(e){return i.getPotentiallyReenteringNodes(e)})),configuration:_,source:e,actions:o}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var t=[],n=this,r=e;n&&n!==r;)t.push(n),n=n.parent;return n===r?(t.push(r),t):[]},e.prototype.getActions=function(e,t,n,r,i,a,o){var s,c,l,u,d=this,f=a?Jb([],this.getStateNodes(a.value)):[],p=new Set;try{for(var m=Ry(Array.from(e).sort(function(e,t){return e.order-t.order})),h=m.next();!h.done;h=m.next()){var g=h.value;(!Zb(f,g)||Zb(n.exitSet,g)||g.parent&&p.has(g.parent))&&p.add(g)}}catch(e){s={error:e}}finally{try{h&&!h.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}try{for(var _=Ry(f),v=_.next();!v.done;v=_.next()){var g=v.value;(!Zb(e,g)||Zb(n.exitSet,g.parent))&&n.exitSet.push(g)}}catch(e){l={error:e}}finally{try{v&&!v.done&&(u=_.return)&&u.call(_)}finally{if(l)throw l.error}}n.exitSet.sort(function(e,t){return t.order-e.order});var y=Array.from(p).sort(function(e,t){return e.order-t.order}),b=new Set(n.exitSet),x=ub(y.map(function(e){var t=[];if(e.type!==`final`)return t;var a=e.parent;if(!a.parent)return t;
vendor: 4,374 bytes, line 128
128t.push(Ib(e.id,e.doneData),Ib(a.id,e.doneData?pb(e.doneData,r,i):void 0));var o=a.parent;return o.type===`parallel`&&Kb(o).every(function(e){return Qb(n.configuration,e)})&&t.push(Ib(o.id)),t})),S=y.map(function(e){var t=e.onEntry,n=e.activities.map(function(e){return Que(e)});return{type:`entry`,actions:Pb(o?By(By([],zy(t),!1),zy(n),!1):By(By([],zy(n),!1),zy(t),!1),d.machine.options.actions)}}).concat({type:`state_done`,actions:x.map(function(e){return Kue(e)})}),C=Array.from(b).map(function(e){return{type:`exit`,actions:Pb(By(By([],zy(e.onExit),!1),zy(e.activities.map(function(e){return $ue(e)})),!1),d.machine.options.actions)}}).concat({type:`transition`,actions:Pb(n.actions,this.machine.options.actions)}).concat(S);if(t){var w=Pb(ub(By([],zy(e),!1).sort(function(e,t){return t.order-e.order}).map(function(e){return e.onExit})),this.machine.options.actions).filter(function(e){return!Ab(e)});return C.concat({type:`stop`,actions:w})}return C},e.prototype.transition=function(e,t,n,r){e===void 0&&(e=this.initialState);var i=wb(t),a;if(e instanceof tx)a=n===void 0?e:this.resolveState(tx.from(e,n));else{var o=yb(e)?this.resolve(ob(this.getResolvedPath(e))):this.resolve(e),s=n??this.machine.context;a=this.resolveState(tx.from(o,s))}if(this.strict&&!this.events.includes(i.name)&&!zue(i.name))throw Error(`Machine '${this.id}' does not accept event '${i.name}'`);var c=this._transition(a.value,a,i)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=Jb([],this.getStateNodes(a.value));return c.configuration=By([],zy(c.configuration.length?Jb(l,c.configuration):l),!1),this.resolveTransition(c,a,a.context,r,i)},e.prototype.resolveRaisedTransition=function(e,t,n,r){var i,a=e.actions;return e=this.transition(e,t,void 0,r),e._event=n,e.event=n.data,(i=e.actions).unshift.apply(i,By([],zy(a),!1)),e},e.prototype.resolveTransition=function(e,t,n,r,i){var a,o,s,c,l=this;i===void 0&&(i=jb);var u=e.configuration,d=!t||e.transitions.length>0,f=d?e.configuration:t?t.configuration:[],p=Qb(f,this),m=d?cde(this.machine,u):void 0,h=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,g=this.getActions(new Set(f),p,e,n,i,t,r),_=t?Iy({},t.activities):{};try{for(var v=Ry(g),y=v.next();!y.done;y=v.next()){var b=y.value;try{for(var x=(s=void 0,Ry(b.actions)),S=x.next();!S.done;S=x.next()){var C=S.value;C.type===Uy?_[C.activity.id||C.activity.type]=C:C.type===Wy&&(_[C.activity.id||C.activity.type]=!1)}}catch(e){s={error:e}}finally{try{S&&!S.done&&(c=x.return)&&c.call(x)}finally{if(s)throw s.error}}}}catch(e){a={error:e}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}var w=zy(zb(this,t,n,i,g,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),T=w[0],E=w[1],D=zy(Vue(T,Ab),2),O=D[0],k=D[1],A=T.filter(function(e){return e.type===Uy&&e.activity?.type===Xy}).reduce(function(e,t){return e[t.activity.id]=ide(t.activity,l.machine,E,i),e},t?Iy({},t.children):{}),j=new tx({value:m||t.value,context:E,_event:i,_sessionid:t?t._sessionid:null,historyValue:m?h?Hue(h,m):void 0:t?t.historyValue:void 0,history:!m||e.source?t:void 0,actions:m?k:[],activities:m?_:t?t.activities:{},events:[],configuration:f,transitions:e.transitions,children:A,done:p,tags:$b(f),machine:this}),M=n!==E;j.changed=i.name===Qy||M;var N=j.history;N&&delete N.history;var P=!p&&(this._transient||u.some(function(e){return e._transient}));if(!d&&(!P||i.name===lx))return j;var F=j;if(!p)for(P&&(F=this.resolveRaisedTransition(F,{type:jue},i,r));O.length;){var I=O.shift();F=this.resolveRaisedTransition(F,I._event,i,r)}var L=F.changed||(N?!!F.actions.length||M||typeof N.value!=typeof F.value||!ex(F.value,N.value):void 0);return F.changed=L,F.history=N,F},e.prototype.getStateNode=function(e){if(px(e))return this.machine.getStateNodeById(e);if(!this.states)throw Error(`Unable to retrieve child state '${e}' from '${this.id}'; no child states exist.`);var t=this.states[e];if(!t)throw Error(`Child state '${e}' does not exist on '${this.id}'`);return t},e.prototype.getStateNodeById=function(e){var t=px(e)?e.slice(ux.length):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw Error(`Child state node '#${t}' does not exist on machine '${this.id}'`);return n},e.prototype.getStateNodeByPath=function(e){if(typeof e==`string`&&px(e))try{return this.get
128StateNodeById(e.slice(1))}catch{}for(var t=ib(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||fx;switch(this.type){case`parallel`:return sb(this.initialStateValue,function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):fx});case`compound`:if(yb(e)){var r=this.getStateNode(e);return r.type===`parallel`||r.type===`compound`?(t={},t[e]=r.initialStateValue,t):e}return Object.keys(e).length?sb(e,function(e,t){return e?n.getStateNode(t).resolve(e):fx}):this.initialStateValue||{};default:return e||fx}},e.prototype.getResolvedPath=function(e){if(px(e)){var t=this.machine.idMap[e.slice(ux.length)];if(!t)throw Error(`Unable to find state node '${e}'`);return t.path}return ib(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var t;if(this.type===`parallel`)t=cb(this.states,function(e){return e.initialStateValue||fx},function(e){return e.type!==`history`});else if(this.initial!==void 0){if(!this.states[this.initial])throw Error(`Initial state '${this.initial}' not found on '${this.key}'`);t=Wb(this.states[this.initial])?this.initial:(e={},e[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,t??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw Error(`Cannot retrieve initial state from simple state '${this.id}'.`);return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if(this.type===`history`){var t=this.config;e=yb(t.target)&&px(t.target)?ob(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return n===void 0&&(n=!0),n?e.type===`history`?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return Wb(this)||this.type===`compound`&&!this.initial?[this]:ub(lb(this.initialStateValue).map(function(t){return e.getFromRelativePath(t)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=zy(e),n=t[0],r=t.slice(1);if(!this.states)throw Error(`Cannot retrieve subPath '${n}' from node with no states`);var i=this.getStateNode(n);if(i.type===`history`)return i.resolveHistory();if(!this.states[n])throw Error(`Child state '${n}' does not exist on '${this.id}'`);return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:cb(this.states,function(t,n){if(!e)return t.historyValue();var r=yb(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)},function(e){return!e.history})}},e.prototype.resolveHistory=function(e){var t=this;if(this.type!==`history`)return[this];var n=this.parent;if(!e){var r=this.target;return r?ub(lb(r).map(function(e){return n.getFromRelativePath(e)})):n.initialStateNodes}var i=Rue(n.path,`states`)(e).current;return yb(i)?[n.getStateNode(i)]:ub(lb(i).map(function(e){return t.history===`deep`?n.getFromRelativePath(e):[n.states[e[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=ub(Object.keys(this.states).map(function(t){return e.states[t].stateIds}));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var i=this.states,a=new Set(this.ownEvents);if(i)try{for(var o=Ry(Object.keys(i)),s=o.next();!s.done;s=o.next()){var c=i[s.value];if(c.states)try{for(var l=(n=void 0,Ry(c.events)),u=l.next();!u.done;u=l.next()){var d=u.value;a.add(`${d}`)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)}
128,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter(function(e){return!(!e.target&&!e.actions.length&&e.internal)}).map(function(e){return e.eventType}));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(e!==void 0)return e.map(function(e){if(!yb(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(t.parent)try{return t.parent.getStateNodeByPath(r)}catch(e){throw Error(`Invalid transition definition for state node '${t.id}':
129${e.message}`)}else return t.getStateNodeByPath(r)})},e.prototype.formatTransition=function(e){var t=this,n=Gue(e.target),r=`internal`in e?e.internal:n?n.some(function(e){return yb(e)&&e[0]===t.delimiter}):!0,i=this.machine.options.guards,a=this.resolveTarget(n),o=Iy(Iy({},e),{actions:Pb(fb(e.actions)),cond:bb(e.cond,i),target:a,source:this,internal:r,eventType:e.event,toJSON:function(){return Iy(Iy({},o),{target:o.target?o.target.map(function(e){return`#${e.id}`}):void 0,source:`#${t.id}`})}});return o},e.prototype.formatTransitions=function(){var e,t,n=this,r;if(!this.config.on)r=[];else if(Array.isArray(this.config.on))r=this.config.on;else{var i=this.config.on,a=dx,o=i[a],s=o===void 0?[]:o,c=Ly(i,[typeof a==`symbol`?a:a+``]);r=ub(Object.keys(c).map(function(e){return Tb(e,c[e])}).concat(Tb(dx,s)))}var l=this.config.always?Tb(``,this.config.always):[],u=this.config.onDone?Tb(String(Ib(this.id)),this.config.onDone):[],d=ub(this.invoke.map(function(e){var t=[];return e.onDone&&t.push.apply(t,By([],zy(Tb(String(Lb(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,By([],zy(Tb(String(Rb(e.id)),e.onError)),!1)),t})),f=this.after,p=ub(By(By(By(By([],zy(u),!1),zy(d),!1),zy(r),!1),zy(l),!1).map(function(e){return fb(e).map(function(e){return n.formatTransition(e)})}));try{for(var m=Ry(f),h=m.next();!h.done;h=m.next()){var g=h.value;p.push(g)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=m.return)&&t.call(m)}finally{if(e)throw e.error}}return p},e}();function mx(e,t){return new Sde(e,t)}var hx=tde;function gx(){return gx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gx.apply(this,arguments)}var Cde=[`guards`,`actions`,`services`,`delays`,`context`],wde=Symbol();function _x(e,t){let n=zv(null),r=zv(r=>{let i=r(n);if(i)return i;let a=!0,o=(...e)=>{if(a)return r(...e);throw Error(`get not allowed after initialization`)},s=vx(e)?e(o):e,c=vx(t)?t(o):t;a=!1;let l=c||{},{guards:u,actions:d,services:f,delays:p,context:m}=l,h=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}(l,Cde),g=gx({},u&&{guards:u},d&&{actions:d},f&&{services:f},p&&{delays:p}),_=s.withConfig(g,()=>gx({},s.context,m));return{machine:_,service:sx(_,h)}},(e,t)=>{t(n,e(r))});r.onMount=e=>{e()};let i=zv(null),a=zv(e=>e(i)??e(r).machine.initialState,(e,t,n)=>{let{service:a}=e(r);a.onTransition(e=>{t(i,e)}),a.start(),n(()=>{let{service:t}=e(r);t.stop()})});return a.onMount=e=>{let t;return e(e=>{!1===t?e():t=e}),()=>{t&&t(),t=!1}},zv(e=>e(a),(e,t,a)=>{let{service:o}=e(r);if(a===wde){o.stop(),t(n,null),t(r);let{service:a}=e(r);a.onTransition(e=>{t(i,e)}),a.start()}else o.send(a)})}var vx=e=>typeof e==`function`,yx=function(e){return e.NONE=`NONE`,e.LASSO=`LASSO`,e.DRAW_POINT=`DRAW_POINT`,e.DRAW_LINE=`DRAW_LINE`,e.DRAW_RECTANGLE=`DRAW_RECTANGLE`,e.DRAW_POLYGON=`DRAW_POLYGON`,e.DRAW_CIRCLE=`DRAW_CIRCLE`,e.DRAW_ROUTE=`DRAW_ROUTE`,e}({}),bx=function(e){return e.MERCATOR=`Mercator`,e.GEODESIC=`Geodesic`,e.DEGREES=`Degrees`,e}({}),xx=function(e){return e.DRIVING=`driving`,e.WALKING=`walking`,e.CYCLING=`cycling`,e}({}),Tde={NONE:{label:`Select`},DRAW_POINT:{label:`Point`},DRAW_LINE:{label:`Line`},DRAW_RECTANGLE:{label:`Rectangle`},DRAW_POLYGON:{label:`Polygon`},DRAW_CIRCLE:{label:`Circle`},LASSO:{label:`Lasso`},DRAW_ROUTE:{label:`Route`}},Sx=zv({mode:`NONE`});function Cx(e,t,n){for(let r of t.get(e)??[])n.add(r.id),Cx(r.id,t,n);return n}function wx(e){let t=Tx(e),n=new Set;for(let r of e.values())r.visibility===!1&&(n.add(r.id),Cx(r.id,t,n));return n}var Tx=e=>{let t=new Map;for(let n of e.values()){let e=t.get(n.folderId)||[];e.push(n),t.set(n.folderId,e)}return t},Ede=e=>{let t=Tx(e),n=new Set;for(let r of e.values())r.locked&&(n.add(r.id),Cx(r.id,t,n));return n};function Ex(e,t){let n=new Set([t]);return Cx(t,Tx(e),n),n}function Dde(e,t){if(!e.folderId)return!1;let n=t.get(e.folderId);for(;n;){if(n.locked)return!0;
129if(!n.folderId)return!1;n=t.get(n.folderId)}return!1}function Dx({featureMap:e,folderMap:t}){let n=Ede(t),r=wx(t),i=[];for(let t of e.values())t.feature.properties?.visibility!==!1&&(!t.folderId||!r.has(t.folderId)&&!n.has(t.folderId))&&i.push(t);return i}var Ode=i(((e,t)=>{function n(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}t.exports=n})),Ox=e(i(((e,t)=>{var n=Ode(),r=V_();function i(e,t,i){return i===void 0&&(i=t,t=void 0),i!==void 0&&(i=r(i),i=i===i?i:0),t!==void 0&&(t=r(t),t=t===t?t:0),n(r(e),t,i)}t.exports=i}))()),kx=v({id:o(),at:o(),name:o(),opacity:p().transform(e=>(0,Ox.default)(e,0,1)),tms:ae(j()).default(!1),visibility:j(),labelVisibility:j()}),Ax=o().url(),jx=m(`type`,[kx.extend({type:_(`XYZ`),token:o(),url:Ax}),kx.extend({type:_(`STYLE`),provider:o().optional(),url:Ax}),kx.extend({type:_(`TILEJSON`),token:o(),url:Ax})]);v({bearing:p(),pitch:p(),minx:p(),miny:p(),maxx:p(),maxy:p(),userName:o(),userId:p(),updatedAt:o(),cursorLatitude:p(),cursorLongitude:p(),wrappedFeatureCollectionId:o().length(21),replicacheClientId:o()}),v({id:o(),at:o(),name:o(),expanded:j(),locked:j(),folderId:f(o()),visibility:j()});var Mx={filterMapByFolder(e,t,n){if(!n)return{filteredFeatures:e,filteredFolders:t};let r=new Map,i=Ex(t,n);for(let t of e.values())t.folderId&&i.has(t.folderId)&&r.set(t.id,t);let a=new Map(Array.from(t.entries()).filter(([e])=>i.has(e)));return a.set(n,{...a.get(n),folderId:null}),{filteredFeatures:r,filteredFolders:a}},mapToFeatureCollection(e,t,n){let r=n&&Ex(t,n),i=[];for(let t of e.values())(!r||t.folderId&&r.has(t.folderId))&&i.push(t.feature);return{type:`FeatureCollection`,features:i}},toFeatureCollection(e){return{type:`FeatureCollection`,features:e.map(e=>e.feature)}}},Nx=v({simplestyle:j(),defaultColor:o().default(l),defaultOpacity:p().default(.3).transform(e=>(0,Ox.default)(e,0,1))}),kde=Nx.extend({type:_(`categorical`),stops:a(v({input:d([o(),p().int()]),output:o()})).min(1).transform(e=>Px(e)),property:o()});v({type:_(`ramp`),min:v({input:p(),output:o()}),max:v({input:p(),output:o()}),property:o()}),v({type:_(`simplestyle`)});function Px(e){let t=new Set,n=[];for(let r of e)t.has(r.input)||(t.add(r.input),n.push(r));return n}var Ade=Nx.extend({type:_(`ramp`),property:o(),rampName:o(),interpolate:g([`step`,`linear`]),stops:a(v({input:p(),output:o()})).transform(e=>Px(e).sort((e,t)=>e.input-t.input))}),Fx=d([Nx.extend({type:_(`none`)}),kde,Ade]),Ix={type:`none`,simplestyle:!0,defaultColor:l,defaultOpacity:.3},jde=`00000000-0000-0000-0000-000000000000`,Lx=[];for(let e=0;e<256;++e)Lx.push((e+256).toString(16).slice(1));function Mde(e,t=0){return(Lx[e[t+0]]+Lx[e[t+1]]+Lx[e[t+2]]+Lx[e[t+3]]+`-`+Lx[e[t+4]]+Lx[e[t+5]]+`-`+Lx[e[t+6]]+Lx[e[t+7]]+`-`+Lx[e[t+8]]+Lx[e[t+9]]+`-`+Lx[e[t+10]]+Lx[e[t+11]]+Lx[e[t+12]]+Lx[e[t+13]]+Lx[e[t+14]]+Lx[e[t+15]]).toLowerCase()}var Rx,Nde=new Uint8Array(16);function zx(){if(!Rx){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Rx=crypto.getRandomValues.bind(crypto)}return Rx(Nde)}var Bx={};function Pde(e,t,n){let r,i=e?._v6??!1;if(e){let t=Object.keys(e);t.length===1&&t[0]===`_v6`&&(e=void 0)}if(e)r=Vx(e.random??e.rng?.()??zx(),e.msecs,e.nsecs,e.clockseq,e.node,t,n);else{let e=Date.now(),a=zx();Fde(Bx,e,a),r=Vx(a,Bx.msecs,Bx.nsecs,i?void 0:Bx.clockseq,i?void 0:Bx.node,t,n)}return t??Mde(r)}function Fde(e,t,n){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=n.slice(10,16),e.node[0]|=1,e.clockseq=(n[8]<<8|n[9])&16383),e.msecs=t,e}function Vx(e,t,n,r,i,a,o=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!a)a=new Uint8Array(16),o=0;else if(o<0||o+16>a.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);t??=Date.now(),n??=0,r??=(e[8]<<8|e[9])&16383,i??=e.slice(10,16),t+=0xb1d069b5400;let s=((t&268435455)*1e4+n)%4294967296;a[o++]=s>>>24&255,a[o++]=s>>>16&255,a[o++]=s>>>8&255,a[o++]=s&255;let c=t/4294967296*1e4&268435455;a[o++]=c>>>8&255,a[o++]=c&255,a[o++]=c>>>24&15|16,a[o++]=c>>>16&255,a[o++]=r>>>8|128,a[o++]=r&255;for(let e=0;e<6;++e)a[o++]=i[e];return a}var U={selectionToFolder(e){let{selection:t}=e;switch(t.type){case`none`:return Hx;case`folder`:return t;case`multi`:case`single`:{let t=U.getSelectedFeatures(e)[0];return t?.folderId?U.folder(t.folderId):Hx}}},reduce(e){return e.type===`single`&&e.parts.length?U.single(e.id):U.none()},toIds(e){switch(e.type){case`none`:case`folder`:return[];case`single`:return[e.id];case`multi`:return e.ids}},getVertexIds(e){return e.type===`single`&&e.parts.length?e.parts.flatMap(e=>e.type===`vertex`?[e]:[]):E},asSingle(e){if(e.type===`none`||e.type===`folder`)throw Error(`Given a none selection`);return e.type===`single`?e:{type:`single`,id:e.ids[0],parts:[]}},fromIds(e){return e.length===0?{type:`none`}:e.length===1?this.single(e[0]):{type:`multi`,ids:e}},getSelectedFeatures({selection:e,featureMap:t,folderMap:n}){switch(e.type){case`none`:return E;case`folder`:{let r=Ex(n,e.id),i=[];for(let e of t.values())e.folderId&&r.has(e.folderId)&&i.push(e);return i}default:{let n=[];for(let r of this.toIds(e)){let e=t.get(r);e&&n.push(e)}return n}}},isSelected(e,t){switch(e.type){case`none`:case`folder`:return!1;case`single`:return e.id===t;case`multi`:return e.ids.includes(t)}},isFolderSelected(e,t){return e.type===`folder`&&e.id===t},isVertexSelected(e,t,n){return e.type===`single`&&e.id===t&&e.parts.length===1&&e.parts[0].vertex===n.vertex},toggleSelectionId(e,t){let n=fv(this.toIds(e),t);return this.fromIds(n)},toggleSingleSelectionId(e,t){return e.type===`single`&&this.isSelected(e,t)?this.none():this.single(t)},addSelectionId(e,t){let n=this.toIds(e);return n.includes(t)?e:this.fromIds(n.concat(t))},removeFeatureFromSelection(e,t){switch(e.type){case`folder`:case`none`:return e;case`single`:return e.id===t?Hx:e;case`multi`:return e.ids.includes(t)&&(e.ids=e.ids.filter(e=>e!==t)),e}},none(){return Hx},folderId(e){return e.type===`folder`?e.id:null},folder(e){return{type:`folder`,id:e}},single(e){return{type:`single`,id:e,parts:[]}}},Hx={type:`none`},Ux=Gle(null),Wx=zv({featureMap:new Map,folderMap:new Map,selection:{type:`none`}}),Gx=jde,Kx=zv(new Map([[Gx,{...iy.POSITRON,at:`a0`,opacity:1,tms:!1,visibility:!0,labelVisibility:!0,id:Gx}]])),qx=Jle(Wx,e=>U.getSelectedFeatures(e),av),Jx=Aue(Wx,e=>e.prop(`selection`)),Ide=zv({symbolization:Ix,label:null,layer:null}),Lde=zv([]),Rde={left:`right`,right:`left`},Yx={left:100,right:200},Xx=zv({layout:`AUTO`,bottom:500,rightOpen:!0,right:320,leftOpen:!0,left:200}),zde=zv(!0),Zx=ty(`showAll`,!0),Bde=ty(`panelIdOpen`,!1),Vde=ty(`panelRawOpen`,!1),Hde=ty(`panelExportOpen`,!1),Ude=ty(`panelNullOpen`,!0),Wde=ty(`panelCircleOpen`,!0),Qx=ty(`panelStyleOpen`,!1),Gde=ty(`panelSymbolizationExportOpen`,!0),Kde=ty(`hideHints`,[]),qde=ty(`scaleUnit`,`imperial`),Jde=ty(`addMetadataWithGeocoder`,!1),$x=zv(new Zle),eS=zv(`default`),tS=zv({type:`none`}),nS=zv(null),rS=zv(null),Yde=mx({predictableActionArguments:!0,id:`fileInfo`,initial:`idle`,states:{idle:{on:{show:`visible`}},visible:{after:{2e3:{target:`idle`}}}}}),iS=_x(()=>Yde),aS=function(e){return e.Feature=`Feature`,e.Table=`Table`,e.List=`List`,e.Symbolization=`Symbolization`,e}({}),oS=zv(`Feature`),sS=zv([]),cS={column:``,search:``,isCaseSensitive:!1,geometryType:null,folderId:null,exact:!1,sort:null},lS=zv(cS),uS=ty(`circleType`,bx.MERCATOR),dS=ty(`routeType`,xx.WALKING),fS=ty(`theme`,`light`);function Xde(e){let{track:t}=e;t&&delete e.track}function Zde(e,{featureMap:t}){let n=ay(`Update features`);for(let r of e){let e=t.get(r);e&&n.putFeatures.push(e)}return n}function Qde(e,t){let n=ay(`Update layers`);for(let r of e){let e=t.get(r);e&&n.putLayerConfigs.push(e)}return n}function $de(e,{folderMap:t}){let n=ay(`Update folders`);for(let r of e){let e=t.get(r);e&&n.putFolders.push(e)}return n}function pS(e){let t=`a0`;for(let n of e.values())t=n.at;return t}function mS(e){let t=pS(e.featureMap),n=pS(e.folderMap);return t>n?t:n}function efe(){return ny((0,B.useCallback)((e,t)=>{t($x,e=>
129ly.endSnapshot(e))},[]))}function tfe(){return ny((0,B.useCallback)((e,t,n)=>{t($x,e=>ly.startSnapshot(e,n))},[]))}function hS(){return ny((0,B.useCallback)((e,t,n)=>{t($x,e=>ly.popMoment(e,n))},[]))}function gS(){return Yv(Wx).featureMap}var nfe={[yv.Number]:(0,H.jsx)(H.Fragment,{children:`Casting to a number will apply the + operator to each value, which will parse most kinds of numbers.`}),[yv.Boolean]:`Casting to a boolean will transform zero values, null values, empty strings, and strings that are
130      equal to "false" to false, and transform everything else to true.`,[yv.HTML]:`Casting to rich text will reinterpret the given values to be compatible with Placemark’s
131      rich text editor.`,[yv.JSON]:`Useful only in very peculiar scenarios, this will parse all string values
132      of this property into JSON objects, if they can be parsed.`,[yv.String]:`This will reinterpret all other values as strings: for example,
133      a value of 100 will become a string "100", rather than the number 100.`};function rfe({onClose:e,modal:t}){let n=i_().useTransact(),r=gS();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Cast property`,titleIcon:Wn}),(0,H.jsx)(eg,{onSubmit:async i=>{await n({track:`feature-cast-property`,putFeatures:Array.from(r.values(),e=>{let n={...e.feature.properties};n[t.column]=Tv(n[t.column],i.castTarget);let r={...e.feature,properties:n};return{...e,feature:r}})}),e()},initialValues:{castTarget:yv.Number},children:(0,H.jsxs)(ig,{children:[(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{children:[`You are casting the property`,` `,(0,H.jsx)(`code`,{className:`bg-purple-100 bg-opacity-10 p-1`,children:t.column}),`, for all features. This will change the property’s type from a string to another type.`]}),(0,H.jsx)(rg,{as:`select`,name:`castTarget`,className:`${Ig({size:`md`})} w-full`,children:Object.values(yv).map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))}),(0,H.jsx)(`div`,{children:(0,H.jsx)(rg,{name:`castTarget`,children:({field:{value:e}})=>(0,H.jsx)(`div`,{children:nfe[e]})})})]}),(0,H.jsx)(Ug,{onClose:e,action:`Cast`})]})})]})}var _S=`Command+k`,ife={"?":`Help`,1:`Select`,2:`Draw point`,3:`Draw line`,4:`Draw polygon`,5:`Draw rectangle`,Esc:`Exit drawing / clear selection`,"]":`Next panel`,"[":`Previous panel`,[_S]:`Search`,"Command+o":`Open`,"Command+s":`Save`,"Command+a":`Select all`,"Command+z":`Undo`,"Command+y":`Redo`};function afe(){let e=sv();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Cheatsheet`,titleIcon:er}),(0,H.jsx)(`div`,{className:`font-bold pb-2`,children:`Keyboard shortcuts`}),(0,H.jsx)(`div`,{className:`p-1 pb-10`,children:(0,H.jsx)(`div`,{className:`grid gap-x-3 gap-y-2`,style:{gridTemplateColumns:`min-content 1fr`},children:Object.entries(ife).map(([t,n])=>(0,H.jsxs)(B.Fragment,{children:[(0,H.jsx)(`div`,{className:``,children:(0,H.jsx)(Rg,{children:cv(t,e)})}),(0,H.jsx)(`div`,{children:n})]},t))})}),(0,H.jsxs)(`div`,{className:`p-1 pb-10`,children:[(0,H.jsx)(`div`,{className:`font-bold pb-2`,children:`Mouse controls`}),(0,H.jsxs)(`ul`,{className:`space-y-2`,children:[(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`font-bold`,children:`Click`}),` to select a feature.`]}),(0,H.jsxs)(`li`,{children:[`Hold down `,(0,H.jsx)(`span`,{className:`font-bold`,children:`Shift`}),` while drawing lines or polygons to draw with right angles.`]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`font-bold`,children:`Shift-click`}),` to select additional features.`]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`font-bold`,children:`Shift-click and drag`}),` to select features using the rectangular lasso tool.`]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`font-bold`,children:`Right-click`}),` on a feature to transform, delete, or inspect it.`]}),(0,H.jsxs)(`li`,{children:[`Hold down the `,(0,H.jsx)(`span`,{className:`font-bold`,children:`Space bar`}),` and drag to move features.`]}),(0,H.jsx)(`li`,{children:`When a feature is already selected, shift-click and shift-click-drag will select vertexes from that feature.`})]})]})]})}var vS=6371008.8,yS={centimeters:vS*100,centimetres:vS*100,degrees:360/(2*Math.PI),feet:vS*3.28084,inches:vS*39.37,kilometers:vS/1e3,kilometres:vS/1e3,meters:vS,metres:vS,miles:vS/1609.344,millimeters:vS*1e3,millimetres:vS*1e3,nauticalmiles:vS/1852,radians:1,yards:vS*1.0936},bS={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function xS(e,t,n={}){let r={type:`Feature`};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function SS(e,t,n={}){if(!e)throw Error(`coordinates is required`);if(!Array.isArray(e))throw Error(`coordinates must be an Array`);if(e.length<2)throw Error(`coordinates must be at least 2 numbers long`);if(!OS(e[0])||!OS(e[1]))throw Error(`coordinates must contain numbers`);return xS({type:`Point`,coordinates:e},t,n)}function ofe(e,t,n={}){for(let t of e){if(t.length<4)throw Error(`Each LinearRing of a Polygon must have 4 or more Positions.`);if(t[t.length-1].length!==t[0].length)throw Error(`First and last Position are not equivalent.`);for(let e=0;e<t[t.length-1].length;e++)if(t[t.length-1][e]!==t[0][e])throw Error(`First and last Position are not equivalent.`)}return xS({type:`Polygon`,coordinates:e},t,n)}function CS(e,t,n={}){if(e.length<2)throw Error(`coordinates must be an array of two or more positions`);return xS({type:`LineString`,coordinates:e},t,n)}function sfe(e,t={}){let n={type:`FeatureCollection`};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function cfe(e,t,n={}){return xS({type:`MultiLineString`,coordinates:e},t,n)}function wS(e,t=`kilometers`){let n=yS[t];
133if(!n)throw Error(t+` units is invalid`);return e*n}function lfe(e,t=`kilometers`){let n=yS[t];if(!n)throw Error(t+` units is invalid`);return e/n}function TS(e){return e%(2*Math.PI)*180/Math.PI}function ES(e){return e%360*Math.PI/180}function DS(e,t=`kilometers`,n=`kilometers`){if(!(e>=0))throw Error(`length must be a positive number`);return wS(lfe(e,t),n)}function ufe(e,t=`meters`,n=`kilometers`){if(!(e>=0))throw Error(`area must be a positive number`);let r=bS[t];if(!r)throw Error(`invalid original units`);let i=bS[n];if(!i)throw Error(`invalid final units`);return e/r*i}function OS(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}var kS=(0,B.createContext)(null);function AS(e,t,n){if(e!==null)for(var r,i,a,o,s,c,l,u=0,d=0,f,p=e.type,m=p===`FeatureCollection`,h=p===`Feature`,g=m?e.features.length:1,_=0;_<g;_++){l=m?e.features[_].geometry:h?e.geometry:e,f=l?l.type===`GeometryCollection`:!1,s=f?l.geometries.length:1;for(var v=0;v<s;v++){var y=0,b=0;if(o=f?l.geometries[v]:l,o!==null){c=o.coordinates;var x=o.type;switch(u=n&&(x===`Polygon`||x===`MultiPolygon`)?1:0,x){case null:break;case`Point`:if(t(c,d,_,y,b)===!1)return!1;d++,y++;break;case`LineString`:case`MultiPoint`:for(r=0;r<c.length;r++){if(t(c[r],d,_,y,b)===!1)return!1;d++,x===`MultiPoint`&&y++}
133x===`LineString`&&y++;break;case`Polygon`:case`MultiLineString`:for(r=0;r<c.length;r++){for(i=0;i<c[r].length-u;i++){if(t(c[r][i],d,_,y,b)===!1)return!1;d++}x===`MultiLineString`&&y++,x===`Polygon`&&b++}x===`Polygon`&&y++;break;case`MultiPolygon`:for(r=0;r<c.length;r++){for(b=0,i=0;i<c[r].length;i++){for(a=0;a<c[r][i].length-u;a++){if(t(c[r][i][a],d,_,y,b)===!1)return!1;d++}b++}y++}break;case`GeometryCollection`:for(r=0;r<o.geometries.length;r++)if(AS(o.geometries[r],t,n)===!1)return!1;break;default:throw Error(`Unknown Geometry Type`)}}}}}function jS(e,t){var n,r,i,a,o,s,c,l,u,d,f=0,p=e.type===`FeatureCollection`,m=e.type===`Feature`,h=p?e.features.length:1;for(n=0;n<h;n++){for(s=p?e.features[n].geometry:m?e.geometry:e,l=p?e.features[n].properties:m?e.properties:{},u=p?e.features[n].bbox:m?e.bbox:void 0,d=p?e.features[n].id:m?e.id:void 0,c=s?s.type===`GeometryCollection`:!1,o=c?s.geometries.length:1,i=0;i<o;i++){if(a=c?s.geometries[i]:s,a===null){if(t(null,f,l,u,d)===!1)return!1;continue}switch(a.type){case`Point`:case`LineString`:case`MultiPoint`:case`Polygon`:case`MultiLineString`:case`MultiPolygon`:if(t(a,f,l,u,d)===!1)return!1;break;case`GeometryCollection`:for(r=0;r<a.geometries.length;r++)if(t(a.geometries[r],f,l,u,d)===!1)return!1;break;default:throw Error(`Unknown Geometry Type`)}}f++}}function dfe(e,t,n){var r=n;return jS(e,function(e,i,a,o,s){r=i===0&&n===void 0?e:t(r,e,i,a,o,s)}),r}function MS(e,t){jS(e,function(e,n,r,i,a){var o=e===null?null:e.type;switch(o){case null:case`Point`:case`LineString`:case`Polygon`:return t(xS(e,r,{bbox:i,id:a}),n,0)===!1?!1:void 0}var s;switch(o){case`MultiPoint`:s=`Point`;break;case`MultiLineString`:s=`LineString`;break;case`MultiPolygon`:s=`Polygon`;break}for(var c=0;c<e.coordinates.length;c++){var l=e.coordinates[c];if(t(xS({type:s,coordinates:l},r),n,c)===!1)return!1}})}function ffe(e,t){MS(e,function(e,n,r){var i=0;if(e.geometry){var a=e.geometry.type;if(!(a===`Point`||a===`MultiPoint`)){var o,s=0,c=0,l=0;if(AS(e,function(a,u,d,f,p){if(o===void 0||n>s||f>c||p>l){o=a,s=n,c=f,l=p,i=0;return}if(t(CS([o,a],e.properties),n,r,p,i)===!1)return!1;i++,o=a})===!1)return!1}}})}function pfe(e,t,n){var r=n,i=!1;return ffe(e,function(e,a,o,s,c){r=i===!1&&n===void 0?e:t(r,e,a,o,s,c),i=!0}),r}function NS(e,t={}){if(e.bbox!=null&&!0!==t.recompute)return e.bbox;let n=[1/0,1/0,-1/0,-1/0];return AS(e,e=>{n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}var mfe=NS,PS=i(((e,t)=>{function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}t.exports=n})),hfe=i(((e,t)=>{var n=m_(),r=z_(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),FS=i(((e,t)=>{var n=c_();function r(e){return e===e&&!n(e)}t.exports=r})),gfe=i(((e,t)=>{var n=FS(),r=F_();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),IS=i(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),_fe=i(((e,t)=>{var n=hfe(),r=gfe(),i=IS();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),LS=i(((e,t)=>{var n=x_(),r=B_(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),vfe=i(((e,t)=>{var n=p_(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}
133i.Cache=n,t.exports=i})),yfe=i(((e,t)=>{var n=vfe(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),bfe=i(((e,t)=>{var n=yfe(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),xfe=i(((e,t)=>{var n=A(),r=q_(),i=x_(),a=B_(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),Sfe=i(((e,t)=>{var n=xfe();function r(e){return e==null?``:n(e)}t.exports=r})),RS=i(((e,t)=>{var n=x_(),r=LS(),i=bfe(),a=Sfe();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),zS=i(((e,t)=>{var n=B_(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),BS=i(((e,t)=>{var n=RS(),r=zS();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Cfe=i(((e,t)=>{var n=BS();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),wfe=i(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Tfe=i(((e,t)=>{var n=RS(),r=T_(),i=x_(),a=D_(),o=O_(),s=zS();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),VS=i(((e,t)=>{var n=wfe(),r=Tfe();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),Efe=i(((e,t)=>{var n=z_(),r=Cfe(),i=VS(),a=LS(),o=FS(),s=IS(),c=zS(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),Dfe=i(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),Ofe=i(((e,t)=>{var n=BS();function r(e){return function(t){return n(t,e)}}t.exports=r})),kfe=i(((e,t)=>{var n=Dfe(),r=Ofe(),i=LS(),a=zS();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),HS=i(((e,t)=>{var n=_fe(),r=Efe(),i=Y_(),a=x_(),o=kfe();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Afe=i(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),jfe=i(((e,t)=>{var n=BS(),r=Afe();function i(e,t){return t.length<2?e:n(e,r(t,0,-1))}t.exports=i})),US=i(((e,t)=>{var n=RS(),r=PS(),i=jfe(),a=zS(),o=Object.prototype.hasOwnProperty;function s(e,t){t=n(t,e);var s=-1,c=t.length;if(!c)return!0;for(;++s<c;){var l=a(t[s]);if(l===`__proto__`&&!o.call(e,`__proto__`)||(l===`constructor`||l===`prototype`)&&s<c-1)return!1}var u=i(e,t);return u==null||delete u[a(r(t))]}t.exports=s})),Mfe=i(((e,t)=>{var n=US(),r=D_(),i=Array.prototype.splice;function a(e,t){for(var a=e?t.length:0,o=a-1;a--;){var s=t[a];if(a==o||s!==c){var c=s;r(s)?i.call(e,s,1):n(e,s)}}return e}t.exports=a})),Nfe=i(((e,t)=>{var n=HS(),r=Mfe();function i(e,t){var i=[];if(!(e&&e.length))return i;var a=-1,o=[],s=e.length;for(t=n(t,3);++a<s;){var c=e[a];t(c,a,e)&&(i.push(c),o.push(a))}return r(e,o),i}t.exports=i})),WS=i(((e,t)=>{function n(){}t.exports=n})),Pfe=i(((e,t)=>{var n=L_(),r=WS(),i=y_();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),Ffe=i(((e,t)=>{var n=h_(),r=G_(),i=K_(),a=g_(),o=Pfe(),s=y_(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),Ife=i(((e,t)=>{var n=Ffe();function r(e){return e&&e.length?n(e):[]}t.exports=r})),GS=e(PS()),KS=e(Nfe()),qS=e(Ife());function Lfe(e){function t(e){return(+Math.abs(e).toPrecision(4)).toString()}function n(e,t){switch(Math.sign(e)){case-1:return t[0];case 1:return t[1];default:return t[0]}}return`${t(e[1])}${n(e[1],`SN`)}, ${t(e[0])}${n(e[0],`WE`)}`}function JS(e,t){let n=e.trim().replace(/[^\-\d,.\s]/g,``);if(!n)return ue(new _e(`Empty input`));let r=n.split(/[\s|,]+/).map(e=>parseFloat(e)).filter(e=>!Number.isNaN(e));return r.length===t?fe(r):ue(new _e(`Failed to parse: need ${t} valid numbers, found ${r.length}`))}function YS(e){return JS(e,2)}function XS(e){return JS(e,4)}function Rfe(e,t){return[[e,[e[0],t[1]],t,[t[0],e[1]],e]]}function zfe(e,t){return{type:`Polygon`,coordinates:Rfe(e,t)}}function Bfe(e,t){let n=(180+e[0])/360,r=(180+t[0])/360,i=e[1]<-90?-90:e[1]>90?90:e[1],a=t[1]<-90?-90:t[1]>90?90:t[1],o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360,c=(n+r)/2,l=180-(o+s)/2*360;
133return[c*360-180,360/Math.PI*Math.atan(Math.exp(l*Math.PI/180))-90]}function ZS(e){if(e.geometry?.type!==`Polygon`)return!1;let[t]=e.geometry.coordinates;return!((0,qS.default)(t.map(e=>e[0])).length===1&&(0,qS.default)(t.map(e=>e[1])).length===1)}function QS(e){let t=mfe(e);return Number.isFinite(t[0])?ce(t):de}function Vfe(e,t){let n=le.catMaybes([e,t]);switch(n.length){case 0:return de;case 1:return e.alt(t);default:{let[e,t,r,i]=n[0],[a,o,s,c]=n[1];return $S(ce([Math.min(a,e),Math.min(o,t),Math.max(s,r),Math.max(c,i)]))}}}function Hfe(e){return e[0]===e[2]&&e[1]===e[3]}function $S(e){return e.map(([e,t,n,r])=>[(0,Ox.default)(e,-180,180),(0,Ox.default)(t,-90,90),(0,Ox.default)(n,-180,180),(0,Ox.default)(r,-90,90)])}function Ufe(e){return Array.isArray(e)?{type:`FeatureCollection`,features:e.length!==0&&`at`in e[0]?e.map(e=>e.feature):e}:e}function Wfe(e){return e.geometry?.type?eC(e.geometry):E}function eC(e){switch(e.type){case`Point`:{let t=e.coordinates;return[[t[0],t[1],t[0],t[1]]]}case`MultiPoint`:return e.coordinates.map(e=>[e[0],e[1],e[0],e[1]]);case`Polygon`:case`LineString`:return QS(e).map(e=>[e]).orDefault([]);case`MultiPolygon`:return le.catMaybes(e.coordinates.map(e=>QS({type:`Polygon`,coordinates:e})));case`MultiLineString`:return le.catMaybes(e.coordinates.map(e=>QS({type:`LineString`,coordinates:e})));case`GeometryCollection`:return e.geometries.flatMap(e=>eC(e))}}function tC(e,t){let n=QS(Ufe(e));return t?n:$S(n)}function Gfe(e){return QS(e).mapOrDefault(t=>({...e,bbox:t}),e)}function nC(e){let[t,n,r,i]=e;return{type:`Polygon`,bbox:e,coordinates:[[[t,n],[t,i],[r,i],[r,n],[t,n]]]}}function Kfe(e){return[[e.x-10,e.y-10],[e.x+10,e.y+10]]}function rC(e,t=6){return Math.round(e*10**t)/10**t}function iC(e,t=6){return e.map(e=>rC(e,t)).join(`,`)}function aC(e,t=6){return e.map(e=>rC(e,t))}function qfe(e,t=6){return{type:`MultiPolygon`,coordinates:e.coordinates.map(e=>e.map(e=>e.map(e=>aC(e,t))))}}function oC(e,t=6){return{...e,coordinates:e.coordinates.map(e=>e.map(e=>aC(e,t)))}}function sC(e,t=6){return{...e,coordinates:e.coordinates.map(e=>aC(e,t))}}function Jfe(e,t=6){return{...e,features:e.features.map(e=>lC(e,t))}}function Yfe(e,t=6){return{type:`GeometryCollection`,geometries:e.geometries.map(e=>lC(e,t))}}function cC(e,t=6){return{...e,geometry:e.geometry==null?null:lC(e.geometry,t)}}function Xfe(e,t=6){return{type:`Point`,coordinates:aC(e.coordinates,t)}}function lC(e,t=6){switch(e.type){case`MultiPolygon`:return qfe(e,t);case`Polygon`:return oC(e,t);case`MultiLineString`:return oC(e,t);case`MultiPoint`:return sC(e,t);case`LineString`:return sC(e,t);case`Point`:return Xfe(e,t);case`Feature`:return cC(e,t);case`FeatureCollection`:return Jfe(e,t);case`GeometryCollection`:return Yfe(e,t)}}function Zfe(e){return(0,tv.default)(e[0],(0,GS.default)(e))?e:e.slice().concat([e[0]])}function uC(e){if(e.length===0)return null;let[t,...n]=e;return t.length<3?null:t.length===3?{type:`LineString`,coordinates:t.slice(0,2)}:((0,KS.default)(n,e=>e.length>2),{type:`Polygon`,coordinates:[Zfe(t),...n]})}function dC(e){switch(e.type){case`LineString`:if(e.coordinates.length<2)return null;break;case`MultiLineString`:{let t=e.coordinates.filter(e=>e.length>2);return t.length===0?null:{type:`MultiLineString`,coordinates:t}}case`Polygon`:return uC(e.coordinates);case`MultiPolygon`:{let t=e.coordinates.flatMap(e=>{let t=uC(e);return t?[t]:[]});return t.length===0?null:t.every(e=>e.type===`Polygon`)?{type:`MultiPolygon`,coordinates:t.map(e=>e.coordinates)}:{type:`GeometryCollection`,geometries:t}}case`MultiPoint`:if(e.coordinates.length===0)return null;break;case`Point`:return e.coordinates?e:null;case`GeometryCollection`:{let t=e.geometries.map(e=>dC(e)).flatMap(e=>e?e.type===`GeometryCollection`?e.geometries:[e]:[]);return t.length===0?null:{type:`GeometryCollection`,geometries:t}}}return e}function fC(){let e=(0,B.useContext)(kS);return ny((0,B.useCallback)((t,n,r)=>{let i=t(Wx),a;a=le.isMaybe(r)?r:tC({type:`FeatureCollection`,features:Array.isArray(r)?r.map(e=>e.feature):U.getSelectedFeatures({...i,selection:r}).map(e=>e.feature)}),a.ifJust(t=>{e?.map.fitBounds(t,{padding:e?.map.getCanvas().getBoundingClientRect().width/10,animate:!1,maxZoom:Hfe(t)?14:1/0})})},[e]))}var pC=Math.PI/180,mC=20037508.342789244,hC=180/Math.PI,gC=6378137,Qfe=v({"@circle":v({type:u(bx),center:S([p(),p()])})}).passthrough();function $fe(e){return e<0?-1:+(e>0)}function _C(e){let[t,n]=e,r=Math.abs(t)<=180?t:t-$fe(t)*360;return[(0,Ox.default)(gC*r*pC,-20037508.342789244,mC),(0,Ox.default)(gC*Math.log(Math.tan(Math.PI*.25+.5*n*pC)),-20037508.342789244,mC)]}function epe(e){return[e[0]*hC/gC,(Math.PI*.5-2*Math.atan(Math.exp(-e[1]/gC)))*hC]}function vC(e){return e%360*Math.PI/180}function tpe(e){return e%(2*Math.PI)*180/Math.PI}function npe(e,t,n){return n.map(n=>[e[0]+Math.cos(n)*t,e[1]+Math.sin(n)*t])}function rpe(e,t,n){let[r,i]=[vC(e[0]),vC(e[1])];return n.map(e=>{let n=Math.asin(Math.sin(i)*Math.cos(t)+Math.cos(i)*Math.sin(t)*Math.cos(e));
133return[tpe(r+Math.atan2(Math.sin(e)*Math.sin(t)*Math.cos(i),Math.cos(t)-Math.sin(i)*Math.sin(n))),tpe(n)]})}function ipe(e,t){let n=vC(t[1]-e[1]),r=vC(t[0]-e[0]),i=vC(e[1]),a=vC(t[1]),o=Math.sin(n/2)**2+Math.sin(r/2)**2*Math.cos(i)*Math.cos(a);return 2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))}function ape(e,t,n){let r=_C(e);return n.map(e=>epe([r[0]+Math.cos(e)*t,r[1]+Math.sin(e)*t]))}function ope(e,t){return{type:`Polygon`,coordinates:[rpe(e,t,Array.from({length:99},(e,t)=>t/100*Math.PI*2).concat([0]))]}}function spe(e,t){return{type:`Polygon`,coordinates:[npe(e,t,Array.from({length:99},(e,t)=>t/100*Math.PI*2).concat([0]))]}}function cpe(e,t){return{type:`Polygon`,coordinates:[ape(e,t,Array.from({length:99},(e,t)=>t/100*Math.PI*2).concat([0]))]}}function lpe(e,t){let n=_C(e),r=_C(t);return Math.sqrt((n[0]-r[0])**2+(n[1]-r[1])**2)}function upe(e,t){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2)}function yC({center:e,value:t,type:n}){switch(n){case bx.MERCATOR:return cpe(e,t);case bx.GEODESIC:return ope(e,t);case bx.DEGREES:return spe(e,t)}}function dpe({center:e,mouse:t,type:n}){switch(n){case bx.MERCATOR:return cpe(e,lpe(e,t));case bx.GEODESIC:return ope(e,ipe(e,t));case bx.DEGREES:return spe(e,upe(e,t))}}function bC(e){if(e.geometry?.type!==`Polygon`)return null;let t=Qfe.safeParse(e.properties);if(!t.success)return null;let n=e.geometry.coordinates[0]?.[0];if(n===void 0)return null;let{type:r,center:i}=t.data[`@circle`];switch(r){case bx.DEGREES:return upe(i,n);case bx.MERCATOR:return lpe(i,n);case bx.GEODESIC:return ipe(i,n)}}function xC(e){if(e.geometry?.type!==`Polygon`)return null;let t=Qfe.safeParse(e.properties);return t.success?t.data[`@circle`]:null}var fpe=e=>crypto.getRandomValues(new Uint8Array(e)),ppe=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(1.6*256*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}},mpe=(e,t=21)=>ppe(e,t|0,fpe),SC=Symbol.for(`@ts-pattern/matcher`),hpe=Symbol.for(`@ts-pattern/isVariadic`),CC=`@ts-pattern/anonymous-select-key`,wC=e=>!!(e&&typeof e==`object`),TC=e=>e&&!!e[SC],EC=(e,t,n)=>{if(TC(e)){let{matched:r,selections:i}=e[SC]().match(t);
133return r&&i&&Object.keys(i).forEach(e=>n(e,i[e])),r}if(wC(e)){if(!wC(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let r=[],i=[],a=[];for(let t of e.keys()){let n=e[t];TC(n)&&n[hpe]?a.push(n):a.length?i.push(n):r.push(n)}if(a.length){if(a.length>1)throw Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;let e=t.slice(0,r.length),o=i.length===0?[]:t.slice(-i.length),s=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((t,r)=>EC(t,e[r],n))&&i.every((e,t)=>EC(e,o[t],n))&&(a.length===0||EC(a[0],s,n))}return e.length===t.length&&e.every((e,r)=>EC(e,t[r],n))}return Reflect.ownKeys(e).every(r=>{let i=e[r];return(r in t||TC(a=i)&&a[SC]().matcherType===`optional`)&&EC(i,t[r],n);var a})}return Object.is(t,e)},DC=e=>{var t;return wC(e)?TC(e)?(t=e[SC]()).getSelectionKeys?.call(t)??[]:OC(Array.isArray(e)?e:Object.values(e),DC):[]},OC=(e,t)=>e.reduce((e,n)=>e.concat(t(n)),[]);function kC(e){return Object.assign(e,{optional:()=>_pe(e),and:t=>AC(e,t),or:t=>vpe(e,t),select:t=>t===void 0?MC(e):MC(t,e)})}function gpe(e){return Object.assign((e=>Object.assign(e,{[Symbol.iterator](){let t=0,n=[{value:Object.assign(e,{[hpe]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>n[t++]??n.at(-1)}}}))(e),{optional:()=>gpe(_pe(e)),select:t=>gpe(t===void 0?MC(e):MC(t,e))})}function _pe(e){return kC({[SC]:()=>({match:t=>{let n={},r=(e,t)=>{n[e]=t};return t===void 0?(DC(e).forEach(e=>r(e,void 0)),{matched:!0,selections:n}):{matched:EC(e,t,r),selections:n}},getSelectionKeys:()=>DC(e),matcherType:`optional`})})}function AC(...e){return kC({[SC]:()=>({match:t=>{let n={},r=(e,t)=>{n[e]=t};return{matched:e.every(e=>EC(e,t,r)),selections:n}},getSelectionKeys:()=>OC(e,DC),matcherType:`and`})})}function vpe(...e){return kC({[SC]:()=>({match:t=>{let n={},r=(e,t)=>{n[e]=t};return OC(e,DC).forEach(e=>r(e,void 0)),{matched:e.some(e=>EC(e,t,r)),selections:n}},getSelectionKeys:()=>OC(e,DC),matcherType:`or`})})}function jC(e){return{[SC]:()=>({match:t=>({matched:!!e(t)})})}}function MC(...e){let t=typeof e[0]==`string`?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]==`string`?void 0:e[0];return kC({[SC]:()=>({match:e=>{let r={[t??CC]:e};return{matched:n===void 0||EC(n,e,(e,t)=>{r[e]=t}),selections:r}},getSelectionKeys:()=>[t??CC].concat(n===void 0?[]:DC(n))})})}function ype(e){return!0}function NC(e){return typeof e==`number`}function PC(e){return typeof e==`string`}function FC(e){return typeof e==`bigint`}kC(jC(ype)),kC(jC(ype));var IC=e=>Object.assign(kC(e),{startsWith:t=>{return IC(AC(e,(n=t,jC(e=>PC(e)&&e.startsWith(n)))));var n},endsWith:t=>{return IC(AC(e,(n=t,jC(e=>PC(e)&&e.endsWith(n)))));var n},minLength:t=>IC(AC(e,(e=>jC(t=>PC(t)&&t.length>=e))(t))),length:t=>IC(AC(e,(e=>jC(t=>PC(t)&&t.length===e))(t))),maxLength:t=>IC(AC(e,(e=>jC(t=>PC(t)&&t.length<=e))(t))),includes:t=>{return IC(AC(e,(n=t,jC(e=>PC(e)&&e.includes(n)))));var n},regex:t=>{return IC(AC(e,(n=t,jC(e=>PC(e)&&!!e.match(n)))));var n}});IC(jC(PC));var LC=e=>Object.assign(kC(e),{between:(t,n)=>LC(AC(e,((e,t)=>jC(n=>NC(n)&&e<=n&&t>=n))(t,n))),lt:t=>LC(AC(e,(e=>jC(t=>NC(t)&&t<e))(t))),gt:t=>LC(AC(e,(e=>jC(t=>NC(t)&&t>e))(t))),lte:t=>LC(AC(e,(e=>jC(t=>NC(t)&&t<=e))(t))),gte:t=>LC(AC(e,(e=>jC(t=>NC(t)&&t>=e))(t))),int:()=>LC(AC(e,jC(e=>NC(e)&&Number.isInteger(e)))),finite:()=>LC(AC(e,jC(e=>NC(e)&&Number.isFinite(e)))),positive:()=>LC(AC(e,jC(e=>NC(e)&&e>0))),negative:()=>LC(AC(e,jC(e=>NC(e)&&e<0)))});LC(jC(NC));var RC=e=>Object.assign(kC(e),{between:(t,n)=>RC(AC(e,((e,t)=>jC(n=>FC(n)&&e<=n&&t>=n))(t,n))),lt:t=>RC(AC(e,(e=>jC(t=>FC(t)&&t<e))(t))),gt:t=>RC(AC(e,(e=>jC(t=>FC(t)&&t>e))(t))),lte:t=>RC(AC(e,(e=>jC(t=>FC(t)&&t<=e))(t))),gte:t=>RC(AC(e,(e=>jC(t=>FC(t)&&t>=e))(t))),positive:()=>RC(AC(e,jC(e=>FC(e)&&e>0))),negative:()=>RC(AC(e,jC(e=>FC(e)&&e<0)))});RC(jC(FC)),kC(jC(function(e){return typeof e==`boolean`})),kC(jC(function(e){return typeof e==`symbol`})),kC(jC(function(e){return e==null})),kC(jC(function(e){return e!=null}));var bpe=class extends Error{constructor(e){let t;try{t=JSON.stringify(e)}catch{t=e}super(`Pattern matching error: no pattern matches value ${t}`),this.input=void 0,this.input=e}},zC={matched:!1,value:void 0};function BC(e){return new xpe(e,zC)}var xpe=class e{constructor(e,t){this.input=void 0,this.state=void 0,this.input=e,this.state=t}with(...t){if(this.state.matched)return this;let n=t[t.length-1],r=[t[0]],i;t.length===3&&typeof t[1]==`function`?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let a=!1,o={},s=(e,t)=>{a=!0,o[e]=t},c=!r.some(e=>
133EC(e,this.input,s))||i&&!i(this.input)?zC:{matched:!0,value:n(a?CC in o?o[CC]:o:this.input,this.input)};return new e(this.input,c)}when(t,n){if(this.state.matched)return this;let r=!!t(this.input);return new e(this.input,r?{matched:!0,value:n(this.input,this.input)}:zC)}otherwise(e){return this.state.matched?this.state.value:e(this.input)}exhaustive(e=Spe){return this.state.matched?this.state.value:e(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}};function Spe(e){throw new bpe(e)}function VC(){return Pde()}mpe(`useandom26T198340PX75pxJACKVERYMINDBUSHWOLFGQZbfghjklqvwyzrict`,21);var HC=1e9;function Cpe(e){return e}function UC(e,t){return(e+1)*HC+t*2}function wpe(e,t){return(e+1)*HC+t*2+1}var Tpe=class e{type=`feature`;featureId;constructor(e){this.featureId=e}static from(t){return new e(t.featureId)}},WC=class e{type=`vertex`;featureId;vertex;constructor(e,t){this.featureId=e,this.vertex=t}static fromMidpoint(t){return new e(t.featureId,t.vertex)}},Epe=class{type=`midpoint`;featureId;vertex;constructor(e,t){this.featureId=e,this.vertex=t}};function Dpe(e){switch(e.type){case`feature`:return Cpe(e.featureId);case`vertex`:return UC(e.featureId,e.vertex);case`midpoint`:return wpe(e.featureId,e.vertex)}}function GC(e){if(e<HC)return new Tpe(e);let t=Math.floor(e/HC)-1,n=e%HC;return n%2==0?new WC(t,n/2):new Epe(t,(n-1)/2)}function Ope(e){return`/${e.vertex}`}function kpe(e,t,n){let r=0;for(let i=0;i<t.length;i++){let a=t[i],o=a.length-+!!n+r;if(e.vertex>=r&&e.vertex<o){let t=e.vertex-r,o=`/${i}/${t}`;return n&&t===0?[o,`/${i}/${a.length-1}`]:[o]}r=o}throw Error(`Bad index encountered`)}function Ape(e,t){let n=0;for(let r=0;r<t.length;r++){let i=t[r];for(let t=0;t<i.length;t++){let a=i[t],o=a.length-1+n;if(e.vertex>=n&&e.vertex<o){let i=e.vertex-n,o=`/${r}/${t}/${i}`;return i===0?[o,`/${r}/${t}/${a.length-1}`]:[o]}n=o}}throw Error(`Bad index encountered`)}function jpe(e,t){let n=0;for(let r=0;r<t.length;r++){let i=t[r];if(!i)continue;let a=KC(i);if(e.vertex>=n&&e.vertex<n+a){let t=`/${r}/coordinates`;return Mpe(new WC(e.featureId,e.vertex-n),i).map(e=>t+e)}n+=a}throw Error(`Bad index encountered`)}function KC(e){return BC(e).with({type:`Point`},()=>1).with({type:`LineString`},{type:`MultiPoint`},e=>e.coordinates.length).with({type:`Polygon`},e=>{let t=0;for(let n of e.coordinates)t+=n.length-1;return t}).with({type:`MultiLineString`},e=>{let t=0;for(let n of e.coordinates)t+=n.length;return t}).with({type:`MultiPolygon`},e=>{let t=0;for(let n of e.coordinates)for(let e of n)t+=e.length-1;return t}).with({type:`GeometryCollection`},e=>{let t=0;for(let n of e.geometries)n&&(t+=KC(n));return t}).exhaustive()}function Mpe(e,t){return BC(t).with({type:`Point`},()=>[``]).with({type:`LineString`},{type:`MultiPoint`},()=>[Ope(e)]).with({type:`Polygon`},t=>kpe(e,t.coordinates,!0)).with({type:`MultiLineString`},t=>kpe(e,t.coordinates,!1)).with({type:`MultiPolygon`},t=>Ape(e,t.coordinates)).with({type:`GeometryCollection`},t=>jpe(e,t.geometries)).exhaustive()}function Npe(e,t){let n=t.type===`GeometryCollection`?`/geometry/geometries`:`/geometry/coordinates`;return Mpe(e,t).map(e=>n+e)}function qC(e,t){let n=t.geometry;if(n===null)throw Error(`An id of a null geometry was encountered.`);switch(e.type){case`vertex`:return Npe(e,n);case`midpoint`:return[Npe(WC.fromMidpoint(e),n)[0]]}}function Ppe({modal:e,onClose:t}){let n=i_().useTransact(),{position:r}=e,i=fC(),a=Xv(Ux);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Circle`,titleIcon:_t}),(0,H.jsx)(eg,{initialValues:{units:`meters`,type:bx.GEODESIC,radius:1},onSubmit:async e=>{let a={"@circle":{type:e.type,center:r}},o=VC(),s=yC({center:r,value:e.type===bx.GEODESIC?DS(e.radius,e.units,`radians`):e.radius,type:e.type});await n({note:`Drew a feature`,putFeatures:[{id:o,folderId:null,feature:{type:`Feature`,properties:a,geometry:s}}],track:`create-circle-dialog`}).catch(e=>void 0).then(()=>i(U.single(o))).finally(()=>{t()})},children:({values:e})=>(0,H.jsxs)(ig,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-x-2`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(bg,{children:[`Type`,(0,H.jsx)(`span`,{className:`w-2 inline-flex`}),(0,H.jsxs)(lse,{children:[`Geodesic circles have a real-world radius. Mercator circles look like circles on the map. Degrees circles have a radius in decimal degrees.`,(0,H.jsx)(`span`,{onClick:()=>{a({type:`circle_types`})},className:Tg,children:`More documentation.`})]})]})}),(0,H.jsx)(rg,{as:`select`,name:`type`,className:`${Ig({size:`sm`})} w-full`,children:Object.values(bx).map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))})]}),(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Radius`})}),(0,H.jsx)(Bg,{name:`radius`,className:`w-full`,type:`number`})]}),e.type===bx.DEGREES?(0,H.jsx)(`div`,{className:`pt-7 text-sm`,children:`Decimal degrees`}):e.type===bx.MERCATOR?(0,H.jsx)(`div`,{className:`pt-7 text-sm`,children:`Mercator meters`}):(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Units`})}),(0,H.jsx)(rg,{as:`select`,name:`units`,className:`${Ig({size:`sm`})} w-full`,children:(0,H.jsx)(Wg,{groups:k.length})})]})]}),(0,H.jsx)(`div`,{className:`flex flex-col sm:flex-row-reverse space-y-2 sm:space-y-0 sm:gap-x-3`,children:(0,H.jsx)(Ug,{variant:`xs`,action:`Draw circle`,onClose:t})})]})})]})}function Fpe(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Circle types`,titleIcon:_t}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{children:`Placemark supports three different kinds of circles: Mercator, Geodesic, and Degrees. How are these different, and when might you want to use each of them?`}),(0,H.jsx)(`div`,{className:`font-bold pb-1 pt-4`,children:`Mercator circles`}),(0,H.jsx)(`i`,{children:`A circle that looks like a circle`}),(0,H.jsxs)(`p`,{children:[`These are circles that will `,(0,H.jsx)(`em`,{children:`look like circles`}),` on the map. They won't be ovals or semicircles: they’ll look like circles. This is because they’re drawn according to the`,` `,(0,H.jsx)(`a`,{href:`https://en.wikipedia.org/wiki/Web_Mercator_projection`,className:Tg,children:`web mercator projection`}
133),`. These circles will also look like circles on standard Mapbox, Google, and other kinds of web maps.`]}),(0,H.jsxs)(`p`,{className:`pt-2`,children:[`Use this kind:`,` `,(0,H.jsx)(`i`,{children:`when you want a circle that looks like a circle on a web map.`})]}),(0,H.jsx)(`div`,{className:`font-bold pb-1 pt-4`,children:`Geodesic circles`}),(0,H.jsx)(`i`,{children:`A circle with a radius`}),(0,H.jsx)(`p`,{children:`These are circles with real-world radiuses. You can draw a geodesic circle with a radius of "100 miles" or "1,000 meters" and it'll cover that geographical area. On a web mercator map, and on most other kinds of web maps, these circles will look elliptical, depending on where they're located.`}),(0,H.jsxs)(`p`,{className:`pt-2`,children:[`Use this kind:`,` `,(0,H.jsx)(`i`,{children:`when you want a circle with a real-world definition.`})]}),(0,H.jsx)(`div`,{className:`font-bold pb-1 pt-4`,children:`Degree circles`}),(0,H.jsx)(`p`,{children:`These are circles with radiuses set in degrees longitude & latitude units.`}),(0,H.jsxs)(`p`,{className:`pt-2`,children:[`Use this kind:`,` `,(0,H.jsx)(`i`,{children:`when you want a circle that looks circular on an equirectangular map, or if you’re trying to make a circle according to a decimal degrees measurement..`})]})]})]})}var JC=i(((e,t)=>{t.exports=ee()(Object.getPrototypeOf,Object)})),Ipe=i(((e,t)=>{var n=L(),r=JC(),i=P(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),Lpe=e(Ipe());function YC(e){return ve(function(){return Promise.resolve(new TextDecoder().decode(e))})}function XC(e){let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r).toLowerCase()}async function ZC(t){return new(await(ye(()=>import(`./lib-C89Rf5DI.js`).then(t=>e(t.default)),__vite__mapDeps([0,1])))).DOMParser().parseFromString(t,`text/xml`)}function QC(e){return new Blob([e],{type:`text/plain`})}function $C(e){return{type:`geojson`,geojson:e,notes:[]}}var Rpe=r({BBOX:()=>zpe}),zpe=new class{id=`bbox`;label=`BBOX`;extensions=[];filenames=[];mimes=[];forwardString(e,t){return uv(XS(e).map(e=>$C({type:`FeatureCollection`,features:[{type:`Feature`,geometry:nC(e),properties:{}}]})))}featureToString(e){return ve(function(){let{geometry:t}=e,n=le.fromNullable(t).chain(tC);return Promise.resolve(n.mapOrDefault(iC,``))})}forwardBinary(e,t){return YC(e).chain(e=>this.forwardString(e,t))}},Bpe=new class{id=`coordinate-string`;label=`Coordinate string`;extensions=[];filenames=[];mimes=[];forwardString(e,t){return uv(YS(e).map(e=>(t.coordinateStringOptions.order===`LATLON`&&e.reverse(),$C({type:`FeatureCollection`,features:[{type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{}}]}))))}featureToString(e){return ve(function({throwE:t}){return e.geometry?.type===`Point`?Promise.resolve(aC(e.geometry.coordinates).join(`,`)):t(new _e(`Only Point features can be copied as a coordinate string`))})}forwardBinary(e,t){return YC(e).chain(e=>this.forwardString(e,t))}},Vpe=new class{id=`csv`;label=`CSV`;extensions=[`.csv`,`.tsv`];filenames=[];mimes=[];forwardBinary(e,t,n){return YC(e).chain(e=>Vpe.forwardString(e,t,n))}forwardString(e,t,n){return ve(async function(){let{csvToGeoJSON:r}=await ye(async()=>{let{csvToGeoJSON:e}=await Promise.resolve().then(()=>ZEe);return{csvToGeoJSON:e}},void 0);return $C(await r(e,t.csvOptions,n))})}back({geojson:e},t){return ve(async function(){let{geojsonToCSV:n}=await ye(async()=>{let{geojsonToCSV:e}=await import(`./geojson_to_csv-Cya7ebpp.js`);return{geojsonToCSV:e}},__vite__mapDeps([2,3]));return{blob:QC(n(e,t)),name:`features.csv`}})}featureToString(e,t){return ve(async function(){let{geojsonToCSV:n}=await ye(async()=>{let{geojsonToCSV:e}=await import(`./geojson_to_csv-Cya7ebpp.js`);return{geojsonToCSV:e}},__vite__mapDeps([2,3]));return n({type:`FeatureCollection`,features:[e]},t)})}},Hpe=new class{id=`exif`;label=`EXIF (JPEG)`;extensions=[`.jpg`,`.jpeg`];filenames=[];mimes=[];
133forwardBinary(e,t){return ve(async function({fromPromise:t}){return $C(await t((await ye(()=>import(`./exif-YPP4rBMH.js`),__vite__mapDeps([4,3,5,6]))).toGeoJSON(e)))})}};function Upe(e){let t=[];for(let n of e.features)n.geometry&&t.push({...n,properties:n.properties?Object.fromEntries(Object.entries(n.properties).map(([e,t])=>typeof t==`object`&&t?[e,JSON.stringify(t)]:[e,t])):null});return{type:`FeatureCollection`,features:t}}var Wpe=new class{id=`flatgeobuf`;label=`FlatGeobuf`;extensions=[`.fgb`];filenames=[];mimes=[];forwardBinary(e,t){return ve(async function(){let t=await ye(()=>import(`./geojson-B433J_k0.js`),[]),n=[],r=t.deserialize(new Uint8Array(e));for await(let e of r)n.push(e);return $C({type:`FeatureCollection`,features:n})})}back({geojson:e},t){return ve(async function(){let t=(await ye(()=>import(`./geojson-B433J_k0.js`),[])).serialize(Upe(e));return{blob:new Blob([t]),name:`features.fgb`}})}};function ew(e){return(0,Lpe.default)(e)}function Gpe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function tw(e,t){if(!e._options.removeCoincidents)return t;let n=!1;for(let e=t.length-1;e>=1;e--)Gpe(t[e],t[e-1])&&(n||=(t=t.slice(),!0),t.splice(e,1));return t}function Kpe(e){return{type:`geojson`,notes:[],_state:{featureIndex:0},_options:e}}var qpe={removeCoincidents:!0};function nw(e,t=qpe){let n=Kpe(t);if(ew(e))Jpe(n,e);else if(Array.isArray(e)){let t=Xpe(n,e);t.length&&(n.geojson={type:`FeatureCollection`,features:t})}else n.notes.push(`GeoJSON has neither an object or an array at its root`);return n.geojson?.features.length?fe({type:`geojson`,notes:n.notes,geojson:n.geojson}):ue(new _e(`No features were importable in this GeoJSON file`))}function Jpe(e,t){let n=t.type;if(n===`Feature`){let n=Zpe(e,t);n&&(e.geojson={type:`FeatureCollection`,features:[n]})}else if(n===`FeatureCollection`){let n=Ype(e,t);n&&(e.geojson=n)}else{let n=aw(e,t);n&&(e.geojson={type:`FeatureCollection`,features:[{type:`Feature`,properties:{},geometry:n}]})}}function Ype(e,t){let{features:n,...r}=t;return{type:`FeatureCollection`,features:Xpe(e,n),...r}}function Xpe(e,t){return Array.isArray(t)?t.flatMap((t,n)=>{if(e._state.featureIndex=n,!ew(t))return e.notes.push(`Rejected invalid feature #${e._state.featureIndex}: not an object`),[];let r=Zpe(e,t);return r?[r]:[]}):(e.notes.push(`Expected an array of features, another type was found`),[])}function Zpe(e,t){if(!(t.type===`Feature`||t.geometry||t.properties))return e.notes.push(`Rejected invalid feature #${e._state.featureIndex}: does not appear to be a feature`),null;let{geometry:n,properties:r,type:i,...a}=t;return{type:`Feature`,geometry:ew(n)?aw(e,n):iw(e),properties:ome(e,r),...a}}function Qpe(e){return typeof e==`string`&&b.includes(e)}function rw(e){return Array.isArray(e)&&typeof e[0]==`number`&&typeof e[1]==`number`?e:null}function iw(e){return e.notes.push(`Feature #${e._state.featureIndex}'s invalid geometry removed`),null}function $pe(e,t){let n=rw(t);return n===null?iw(e):{type:`Point`,coordinates:n}}function eme(e,t){let n=t.flatMap(e=>{let t=rw(e);return t?[t]:[]});return n.length===0?iw(e):{type:`MultiPoint`,coordinates:n}}function tme(e,t){let n=tw(e,t.flatMap(e=>{let t=rw(e);return t?[t]:[]}));return n.length<2?iw(e):{type:`LineString`,coordinates:n}}function nme(e,t){let n=t.flatMap(t=>{if(!Array.isArray(t))return[];let n=tw(e,t.flatMap(e=>{let t=rw(e);return t?[t]:[]}));return n.length?[n]:[]});return n.length===0?iw(e):{type:`MultiLineString`,coordinates:n}}function rme(e,t){let n=t.flatMap(t=>{if(!Array.isArray(t))return[];let n=tw(e,t.flatMap(e=>{let t=rw(e);return t?[t]:[]}));return n.length>2?[n]:[]});return n.length===0?iw(e):{type:`Polygon`,coordinates:n}}function ime(e,t){let n=t.flatMap(t=>{if(!Array.isArray(t))return[];let n=t.flatMap(t=>{if(!Array.isArray(t))return[];let n=tw(e,t.flatMap(e=>{let t=rw(e);return t?[t]:[]}));return n.length>2?[n]:[]});return n.length?[n]:[]});return n.length===0?iw(e):{type:`MultiPolygon`,coordinates:n}}function ame(e,t){if(!Array.isArray(t.geometries))return iw(e);let n=t.geometries.flatMap(t=>{let n=ew(t)&&aw(e,t);return n?[n]:[]});return n.length===0?iw(e):{type:`GeometryCollection`,geometries:n}}function aw(e,t){let n=t.type;if(!Qpe(n))return e.notes.push(`Feature #${e._state.featureIndex}
133's geometry type was not valid`),null;if(n===`GeometryCollection`)return ame(e,t);let{coordinates:r}=t;if(!Array.isArray(r))return iw(e);switch(n){case`Point`:return $pe(e,r);case`MultiPoint`:return eme(e,r);case`LineString`:return tme(e,r);case`MultiLineString`:return nme(e,r);case`Polygon`:return rme(e,r);case`MultiPolygon`:return ime(e,r)}}function ome(e,t){return t==null?{}:ew(t)?t:(e.notes.push(`Feature #${e._state.featureIndex}'s properties were not an object: transformed into one`),{value:t})}function ow(e,t=!1){switch(e.type){case`Polygon`:return e.coordinates?{...e,coordinates:sme(e.coordinates,t)}:e;case`MultiPolygon`:return e.coordinates?{...e,coordinates:e.coordinates.map(e=>sme(e,t))}:e;case`GeometryCollection`:return{...e,geometries:e.geometries.map(e=>ow(e,t))};default:return e}}function sme(e,t){if(e.length===0)return e;let n=[];for(let r=0;r<e.length;r++)n.push(cme(e[r],r===0?t:!t));return n}function cme(e,t){let n=0,r=0;for(let t=0,i=e.length,a=i-1;t<i;a=t++){let i=(e[t][0]-e[a][0])*(e[a][1]+e[t][1]),o=n+i;r+=Math.abs(n)>=Math.abs(i)?n-o+i:i-o+n,n=o}return n+r>=0==!!t?e:e.slice().reverse()}function lme(e,t=`RFC7946`){let n=e.geometry;if(!n)return e;let r=ow(n,t===`d3`);return r===n?e:{...e,geometry:r}}var ume=i(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=n})),sw=i(((e,t)=>{var n=Z_();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),cw=i(((e,t)=>{var n=sw(),r=a_(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),lw=i(((e,t)=>{var n=cw(),r=sw();function i(e,t,i,a){var o=!i;i||={};for(var s=-1,c=t.length;++s<c;){var l=t[s],u=a?a(i[l],e[l],l,i,e):void 0;u===void 0&&(u=e[l]),o?r(i,l,u):n(i,l,u)}return i}t.exports=i})),dme=i(((e,t)=>{var n=lw(),r=F_();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),fme=i(((e,t)=>{function n(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}t.exports=n})),pme=i(((e,t)=>{var n=c_(),r=N_(),i=fme(),a=Object.prototype.hasOwnProperty;function o(e){if(!n(e))return i(e);var t=r(e),o=[];for(var s in e)s==`constructor`&&(t||!a.call(e,s))||o.push(s);return o}t.exports=o})),uw=i(((e,t)=>{var n=M_(),r=pme(),i=P_();function a(e){return i(e)?n(e,!0):r(e)}t.exports=a})),mme=i(((e,t)=>{var n=lw(),r=uw();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),hme=i(((e,t)=>{var n=w(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(e,t){if(t)return e.slice();var n=e.length,r=o?o(n):new e.constructor(n);return e.copy(r),r}t.exports=s})),gme=i(((e,t)=>{function n(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}t.exports=n})),_me=i(((e,t)=>{var n=lw(),r=w_();function i(e,t){return n(e,r(e),t)}t.exports=i})),vme=i(((e,t)=>{var n=b_(),r=JC(),i=w_(),a=C_();t.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=r(e);return t}:a})),yme=i(((e,t)=>{var n=lw(),r=vme();function i(e,t){return n(e,r(e),t)}t.exports=i})),bme=i(((e,t)=>{var n=S_(),r=vme(),i=uw();function a(e){return n(e,i,r)}t.exports=a})),xme=i(((e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]==`string`&&n.call(e,`index`)&&(r.index=e.index,r.input=e.input),r}t.exports=r})),dw=i(((e,t)=>{var n=v_();function r(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}t.exports=r})),Sme=i(((e,t)=>{var n=dw();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}t.exports=r})),Cme=i(((e,t)=>{var n=/\w*$/;function r(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}t.exports=r})),wme=i(((e,t)=>{var n=A(),r=n?n.prototype:void 0,i=r?r.valueOf:void 0;function a(e){return i?Object(i.call(e)):{}}t.exports=a})),Tme=i(((e,t)=>{var n=dw();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}t.exports=r})),Eme=i(((e,t)=>{var n=dw(),r=Sme(),i=Cme(),a=wme(),o=Tme(),s=`[object Boolean]`,c=`[object Date]`,l=`[object Map]`,u=`[object Number]`,d=`[object RegExp]`,f=`[object Set]`,p=`[object String]`,m=`[object Symbol]`,h=`[object ArrayBuffer]`,g=`[object DataView]`,_=`[object Float32Array]`,v=`[object Float64Array
133]`,y=`[object Int8Array]`,b=`[object Int16Array]`,x=`[object Int32Array]`,S=`[object Uint8Array]`,C=`[object Uint8ClampedArray]`,w=`[object Uint16Array]`,T=`[object Uint32Array]`;function E(e,t,E){var D=e.constructor;switch(t){case h:return n(e);case s:case c:return new D(+e);case g:return r(e,E);case _:case v:case y:case b:case x:case S:case C:case w:case T:return o(e,E);case l:return new D;case u:case p:return new D(e);case d:return i(e);case f:return new D;case m:return a(e)}}t.exports=E})),Dme=i(((e,t)=>{var n=c_(),r=Object.create;t.exports=function(){function e(){}return function(t){if(!n(t))return{};if(r)return r(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}()})),Ome=i(((e,t)=>{var n=Dme(),r=JC(),i=N_();function a(e){return typeof e.constructor==`function`&&!i(e)?n(r(e)):{}}t.exports=a})),kme=i(((e,t)=>{var n=R_(),r=P(),i=`[object Map]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),Ame=i(((e,t)=>{var n=kme(),r=k_(),i=A_(),a=i&&i.isMap;t.exports=a?r(a):n})),jme=i(((e,t)=>{var n=R_(),r=P(),i=`[object Set]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),Mme=i(((e,t)=>{var n=jme(),r=k_(),i=A_(),a=i&&i.isSet;t.exports=a?r(a):n})),Nme=i(((e,t)=>{var n=m_(),r=ume(),i=cw(),a=dme(),o=mme(),s=hme(),c=gme(),l=_me(),u=yme(),d=I_(),f=bme(),p=R_(),m=xme(),h=Eme(),g=Ome(),_=x_(),v=E_(),y=Ame(),b=c_(),x=Mme(),S=F_(),C=uw(),w=1,T=2,E=4,D=`[object Arguments]`,O=`[object Array]`,k=`[object Boolean]`,A=`[object Date]`,j=`[object Error]`,M=`[object Function]`,N=`[object GeneratorFunction]`,P=`[object Map]`,F=`[object Number]`,I=`[object Object]`,L=`[object RegExp]`,R=`[object Set]`,ee=`[object String]`,z=`[object Symbol]`,te=`[object WeakMap]`,ne=`[object ArrayBuffer]`,re=`[object DataView]`,ie=`[object Float32Array]`,ae=`[object Float64Array]`,oe=`[object Int8Array]`,se=`[object Int16Array]`,ce=`[object Int32Array]`,le=`[object Uint8Array]`,ue=`[object Uint8ClampedArray]`,de=`[object Uint16Array]`,fe=`[object Uint32Array]`,pe={};pe[D]=pe[O]=pe[ne]=pe[re]=pe[k]=pe[A]=pe[ie]=pe[ae]=pe[oe]=pe[se]=pe[ce]=pe[P]=pe[F]=pe[I]=pe[L]=pe[R]=pe[ee]=pe[z]=pe[le]=pe[ue]=pe[de]=pe[fe]=!0,pe[j]=pe[M]=pe[te]=!1;function me(e,t,O,k,A,j){var P,F=t&w,L=t&T,R=t&E;if(O&&(P=A?O(e,k,A,j):O(e)),P!==void 0)return P;if(!b(e))return e;var ee=_(e);if(ee){if(P=m(e),!F)return c(e,P)}else{var z=p(e),te=z==M||z==N;if(v(e))return s(e,F);if(z==I||z==D||te&&!A){if(P=L||te?{}:g(e),!F)return L?u(e,o(P,e)):l(e,a(P,e))}else{if(!pe[z])return A?e:{};P=h(e,z,F)}}j||=new n;var ne=j.get(e);if(ne)return ne;j.set(e,P),x(e)?e.forEach(function(n){P.add(me(n,t,O,n,e,j))}):y(e)&&e.forEach(function(n,r){P.set(r,me(n,t,O,r,e,j))});var re=ee?void 0:(R?L?f:d:L?C:S)(e);return r(re||e,function(n,r){re&&(r=n,n=e[r]),i(P,r,me(n,t,O,r,e,j))}),P}t.exports=me})),fw=e(i(((e,t)=>{var n=Nme(),r=1,i=4;function a(e){return n(e,r|i)}t.exports=a}))());function Pme(e,t){let n=(0,fw.default)(e.feature),{id:r,folderId:i}=e;return n=t?.truncate?cC(n):n,t?.addBboxes&&(n=Gfe(n)),t?.includeId&&(n.properties||={},n.properties[`@id`]=r,i&&(n.properties[ie]=i)),n}function Fme(e,t){let n={type:`FeatureCollection`,features:Array.from(e.values(),e=>lme(Pme(e,t),t?.winding))};return t?.indent?JSON.stringify(n,null,4):JSON.stringify(n)}var Ime=new class{id=`geojson`;label=`GeoJSON`;extensions=[`.geojson`,`.json`];filenames=[];mimes=[];forwardBinary(e,t){return YC(e).chain(e=>this.forwardString(e,t))}forwardString(e,t){return ve(async function({liftEither:n}){return await n(nw(await n(me(e)),{removeCoincidents:t?.removeCoincidents!==!1}))})}back({featureMap:e},t){return ve.liftEither(fe({blob:QC(Fme(e,t.geojsonOptions)),name:`features.geojson`}))}};function Lme(e){return e.features.map(e=>JSON.stringify(e)).join(`
134`)}function Rme(e){try{let t=[];for(let n of e.split(/[\n|\r]+/))me(n).chain(e=>nw(e)).ifRight(e=>{t=t.concat(e.geojson.features)});return fe({type:`FeatureCollection`,features:t})}catch{return ue(new _e(`Some GeoJSON data in GeoJSONL was invalid`))}}var zme=new class{id=`geojsonl`;label=`GeoJSONL (newline-delimited GeoJSON)`;extensions=[`.geojsonl`,`.geojsons`,`.ld`];filenames=[];mimes=[];
134forwardString(e){return ve(async function({liftEither:t}){return await t(nw(await t(Rme(e))))})}forwardBinary(e,t){return YC(e).chain(e=>this.forwardString(e))}back({geojson:e}){return ve.liftEither(fe({blob:QC(Lme(e)),name:`features.geojsonl`}))}featureToString(e){return ve.liftEither(fe(Lme({type:`FeatureCollection`,features:[e]})))}},Bme=new class{id=`geotiff`;label=`GeoTIFF`;extensions=[`.tif`,`.tiff`];filenames=[];mimes=[];forwardBinary(e,t){return ve(async function(){let{getGeotiffExtent:t}=await ye(async()=>{let{getGeotiffExtent:e}=await import(`./geotiff-BlQLDaDF.js`);return{getGeotiffExtent:e}},__vite__mapDeps([7,8]));return $C(await t(e))})}},Vme=new class{id=`gpx`;label=`GPX`;extensions=[`.gpx`];mimes=[];filenames=[];forwardBinary(e,t){return YC(e).chain(e=>Vme.forwardString(e))}forwardString(e){return ve(async function(){return $C((await ye(()=>import(`./togeojson.es-ZYLubihA.js`).then(e=>e.gpx),[]))(await ZC(e)))})}},Hme=new class{id=`gtfs`;label=`GTFS shapes.txt`;filenames=[`shapes.txt`];extensions=[];mimes=[];forwardBinary(e){return YC(e).chain(e=>this.forwardString(e))}forwardString(e){return ve(async function(){return $C((await ye(()=>import(`./gtfs-CuwLF-B-.js`),[])).GTFSLinesToGeoJSON(e))})}};function Ume(){var e=[...arguments];return(0,B.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var pw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function mw(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function hw(e){return`nodeType`in e}function gw(e){return e?mw(e)?e:hw(e)?e.ownerDocument?.defaultView??window:window:window}function _w(e){let{Document:t}=gw(e);return e instanceof t}function vw(e){return mw(e)?!1:e instanceof gw(e).HTMLElement}function Wme(e){return e instanceof gw(e).SVGElement}function yw(e){return e?mw(e)?e.document:hw(e)?_w(e)?e:vw(e)||Wme(e)?e.ownerDocument:document:document:document}var bw=pw?B.useLayoutEffect:B.useEffect;function xw(e){let t=(0,B.useRef)(e);return bw(()=>{t.current=e}),(0,B.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Gme(){let e=(0,B.useRef)(null);return[(0,B.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,B.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function Sw(e,t){t===void 0&&(t=[e]);let n=(0,B.useRef)(e);return bw(()=>{n.current!==e&&(n.current=e)},t),n}function Cw(e,t){let n=(0,B.useRef)();return(0,B.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function ww(e){let t=xw(e),n=(0,B.useRef)(null);return[n,(0,B.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Tw(e){let t=(0,B.useRef)();return(0,B.useEffect)(()=>{t.current=e},[e]),t.current}var Ew={};function Dw(e,t){return(0,B.useMemo)(()=>{if(t)return t;let n=Ew[e]==null?0:Ew[e]+1;return Ew[e]=n,e+`-`+n},[e,t])}function Kme(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Ow=Kme(1),kw=Kme(-1);function qme(e){return`clientX`in e&&`clientY`in e}function Aw(e){if(!e)return!1;let{KeyboardEvent:t}=gw(e.target);return t&&e instanceof t}function Jme(e){if(!e)return!1;let{TouchEvent:t}=gw(e.target);return t&&e instanceof t}function jw(e){if(Jme(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return qme(e)?{x:e.clientX,y:e.clientY}:null}var Mw=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[Mw.Translate.toString(e),Mw.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Yme=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Xme(e){return e.matches(Yme)?e:e.querySelector(Yme)}var Zme={display:`none`};function Qme(e){let{id:t,value:n}=e;return B.createElement(`div`,{id:t,style:Zme},n)}function $me(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return B.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function ehe(){let[e,t]=(0,B.useState)(``);return{announce:(0,B.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var the=(0,B.createContext)(null);function nhe(e){let t=(0,B.useContext)(the);(0,B.useEffect)(()=>
vendor: 43,616 bytes, lines 134-138
134{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function rhe(){let[e]=(0,B.useState)(()=>new Set),t=(0,B.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,B.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var ihe={draggable:`
135    To pick up a draggable item, press the space bar.
136    While dragging, use the arrow keys to move the item.
137    Press space again to drop the item in its new position, or press escape to cancel.
138  `},ahe={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function ohe(e){let{announcements:t=ahe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=ihe}=e,{announce:a,announcement:o}=ehe(),s=Dw(`DndLiveRegion`),[c,l]=(0,B.useState)(!1);if((0,B.useEffect)(()=>{l(!0)},[]),nhe((0,B.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=B.createElement(B.Fragment,null,B.createElement(Qme,{id:r,value:i.draggable}),B.createElement($me,{id:s,announcement:o}));return n?(0,Wr.createPortal)(u,n):u}var Nw;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(Nw||={});function Pw(){}function Fw(e,t){return(0,B.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Iw(){var e=[...arguments];return(0,B.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var Lw=Object.freeze({x:0,y:0});function she(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function che(e,t){let n=jw(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function lhe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function uhe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function dhe(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function fhe(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function phe(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var mhe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=phe(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=she(phe(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(lhe)},hhe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=dhe(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=dhe(r),o=i.reduce((e,t,r)=>e+she(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(lhe)};function ghe(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var _he=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=ghe(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(uhe)};function vhe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function yhe(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Lw}function bhe(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var xhe=bhe(1);function She(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Che(e,t,n){let r=She(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var whe={ignoreTransform:!1};function Rw(e,t){t===void 0&&(t=whe);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=gw(e).getComputedStyle(e);t&&(n=Che(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function The(e){return Rw(e,{ignoreTransform:!0})}function Ehe(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Dhe(e,t){return t===void 0&&(t=gw(e).getComputedStyle(e)),t.position===`fixed`}function Ohe(e,t){t===void 0&&(t=gw(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function zw(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(_w(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!vw(i)||Wme(i)||n.includes(i))return n;let a=gw(e).getComputedStyle(i);return i!==e&&Ohe(i,a)&&n.push(i),Dhe(i,a)?n:r(i.parentNode)}return e?r(e):n}function khe(e){let[t]=zw(e,1);return t??null}function Bw(e){return!pw||!e?null:mw(e)?e:hw(e)?_w(e)||e===yw(e).scrollingElement?window:vw(e)?e:null:null}function Ahe(e){return mw(e)?e.scrollX:e.scrollLeft}function jhe(e){return mw(e)?e.scrollY:e.scrollTop}function Vw(e){return{x:Ahe(e),y:jhe(e)}}var Hw;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Hw||={});function Mhe(e){return!pw||!e?!1:e===document.scrollingElement}function Nhe(e){let t={x:0,y:0},n=Mhe(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Phe={x:.2,y:.2};function Fhe(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Phe);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Nhe(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=Hw.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Hw.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Hw.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Hw.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Ihe(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Lhe(e){return e.reduce((e,t)=>Ow(e,Vw(t)),Lw)}function Rhe(e){return e.reduce((e,t)=>e+Ahe(t),0)}function zhe(e){return e.reduce((e,t)=>e+jhe(t),0)}function Bhe(e,t){if(t===void 0&&(t=Rw),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);khe(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Vhe=[[`x`,[`left`,`right`],Rhe],[`y`,[`top`,`bottom`],zhe]],Uw=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=zw(t),r=Lhe(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Vhe)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Ww=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Hhe(e){let{EventTarget:t}=gw(e);return e instanceof t?e:yw(e)}function Gw(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var Kw;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Kw||={});function Uhe(e){e.preventDefault()}function Whe(e){e.stopPropagation()}var qw;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(qw||={});var Ghe={start:[qw.Space,qw.Enter],cancel:[qw.Esc],end:[qw.Space,qw.Enter,qw.Tab]},Khe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case qw.Right:return{...n,x:n.x+25};case qw.Left:return{...n,x:n.x-25};case qw.Down:return{...n,y:n.y+25};case qw.Up:return{...n,y:n.y-25}}},Jw=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Ww(yw(t)),this.windowListeners=new Ww(gw(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Kw.Resize,this.handleCancel),this.windowListeners.add(Kw.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Kw.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Bhe(n),t(Lw)}handleKeyDown(e){if(Aw(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Ghe,coordinateGetter:a=Khe,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Lw;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=kw(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Nhe(n),p=Ihe(n),m={x:Math.min(i===qw.Right?p.right-p.width/2:p.right,Math.max(i===qw.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===qw.Down?p.bottom-p.height/2:p.bottom,Math.max(i===qw.Down?p.top:p.top+p.height/2,u.y))},h=i===qw.Right&&!s||i===qw.Left&&!c,g=i===qw.Down&&!l||i===qw.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===qw.Right&&e<=d.x||i===qw.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===qw.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===qw.Down&&e<=d.y||i===qw.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===qw.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Ow(kw(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Jw.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Ghe,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function qhe(e){return!!(e&&`distance`in e)}function Jhe(e){return!!(e&&`delay`in e)}var Yw=class{constructor(e,t,n){n===void 0&&(n=Hhe(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=yw(i),this.documentListeners=new Ww(this.document),this.listeners=new Ww(n),this.windowListeners=new Ww(gw(i)),this.initialCoordinates=jw(r)??Lw,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Kw.Resize,this.handleCancel),this.windowListeners.add(Kw.DragStart,Uhe),this.windowListeners.add(Kw.VisibilityChange,this.handleCancel),this.windowListeners.add(Kw.ContextMenu,Uhe),this.documentListeners.add(Kw.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Jhe(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(qhe(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Kw.Click,Whe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Kw.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=jw(e)??Lw,s=kw(n,o);if(!t&&a){if(qhe(a)){if(a.tolerance!=null&&Gw(s,a.tolerance))return this.handleCancel();if(Gw(s,a.distance))return this.handleStart()}if(Jhe(a)&&Gw(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===qw.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Yhe={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Xw=class extends Yw{constructor(e){let{event:t}=e,n=yw(t.target);super(e,Yhe,n)}};Xw.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Xhe={move:{name:`mousemove`},end:{name:`mouseup`}},Zhe;(function(e){e[e.RightClick=2]=`RightClick`})(Zhe||={});var Qhe=class extends Yw{constructor(e){super(e,Xhe,yw(e.event.target))}};Qhe.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Zhe.RightClick?!1:(r?.({event:n}),!0)}}];var Zw={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},$he=class extends Yw{constructor(e){super(e,Zw)}static setup(){return window.addEventListener(Zw.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Zw.move.name,e)};function e(){}}};$he.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Qw;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Qw||={});var $w;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})($w||={});function ege(e){let{acceleration:t,activator:n=Qw.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=$w.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=nge({delta:d,disabled:!a}),[m,h]=Gme(),g=(0,B.useRef)({x:0,y:0}),_=(0,B.useRef)({x:0,y:0}),v=(0,B.useMemo)(()=>{switch(n){case Qw.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Qw.DraggableRect:return i}},[n,i,c]),y=(0,B.useRef)(null),b=(0,B.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,B.useMemo)(()=>s===$w.TreeOrder?[...l].reverse():l,[s,l]);(0,B.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=Fhe(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var tge={x:{[Hw.Backward]:!1,[Hw.Forward]:!1},y:{[Hw.Backward]:!1,[Hw.Forward]:!1}};function nge(e){let{delta:t,disabled:n}=e,r=Tw(t);return Cw(e=>{if(n||!r||!e)return tge;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Hw.Backward]:e.x[Hw.Backward]||i.x===-1,[Hw.Forward]:e.x[Hw.Forward]||i.x===1},y:{[Hw.Backward]:e.y[Hw.Backward]||i.y===-1,[Hw.Forward]:e.y[Hw.Forward]||i.y===1}}},[n,t,r])}function rge(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Cw(e=>t==null?null:r??e??null,[r,t])}function ige(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var eT;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(eT||={});var age;(function(e){e.Optimized=`optimized`})(age||={});var oge=new Map;function sge(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,B.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,B.useRef)(e),d=g(),f=Sw(d),p=(0,B.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,B.useRef)(null),h=Cw(t=>{if(d&&!n)return oge;if(!t||t===oge||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Uw(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,B.useEffect)(()=>{u.current=e},[e]),(0,B.useEffect)(()=>{d||p()},[n,d]),(0,B.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,B.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case eT.Always:return!1;case eT.BeforeDragging:return n;default:return!n}}}function tT(e,t){return Cw(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function cge(e,t){return tT(e,t)}function lge(e){let{callback:t,disabled:n}=e,r=xw(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function nT(e){let{callback:t,disabled:n}=e,r=xw(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function uge(e){return new Uw(Rw(e),e)}function dge(e,t,n){t===void 0&&(t=uge);let[r,i]=(0,B.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=lge({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=nT({callback:a});return bw(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function fge(e){return yhe(e,tT(e))}var pge=[];function mge(e){let t=(0,B.useRef)(e),n=Cw(n=>e?n&&n!==pge&&e&&t.current&&e.parentNode===t.current.parentNode?n:zw(e):pge,[e]);return(0,B.useEffect)(()=>{t.current=e},[e]),n}function hge(e){let[t,n]=(0,B.useState)(null),r=(0,B.useRef)(e),i=(0,B.useCallback)(e=>{let t=Bw(e.target);t&&n(e=>e?(e.set(t,Vw(t)),new Map(e)):null)},[]);return(0,B.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=Bw(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,Vw(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{Bw(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,B.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Ow(e,t),Lw):Lhe(e):Lw,[e,t])}function gge(e,t){t===void 0&&(t=[]);let n=(0,B.useRef)(null);return(0,B.useEffect)(()=>{n.current=null},t),(0,B.useEffect)(()=>{let t=e!==Lw;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?kw(e,n.current):Lw}function _ge(e){(0,B.useEffect)(()=>{if(!pw)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function vge(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function yge(e){return(0,B.useMemo)(()=>e?Ehe(e):null,[e])}var bge=[];function xge(e,t){t===void 0&&(t=Rw);let[n]=e,r=yge(n?gw(n):null),[i,a]=(0,B.useState)(bge);function o(){a(()=>e.length?e.map(e=>Mhe(e)?r:new Uw(t(e),e)):bge)}let s=nT({callback:o});return bw(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function Sge(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return vw(t)?t:e}function Cge(e){let{measure:t}=e,[n,r]=(0,B.useState)(null),i=nT({callback:(0,B.useCallback)(e=>{for(let{target:n}of e)if(vw(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=ww((0,B.useCallback)(e=>{let n=Sge(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,B.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var wge=[{sensor:Xw,options:{}},{sensor:Jw,options:{}}],Tge={current:{}},rT={draggable:{measure:The},droppable:{measure:The,strategy:eT.WhileDragging,frequency:age.Optimized},dragOverlay:{measure:Rw}},iT=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Ege={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new iT,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pw},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:rT,measureDroppableContainers:Pw,windowRect:null,measuringScheduled:!1},Dge={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Pw,draggableNodes:new Map,over:null,measureDroppableContainers:Pw},aT=(0,B.createContext)(Dge),Oge=(0,B.createContext)(Ege);function kge(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new iT}}}function Age(e,t){switch(t.type){case Nw.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Nw.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Nw.DragEnd:case Nw.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Nw.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new iT(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Nw.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new iT(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Nw.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new iT(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function jge(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,B.useContext)(aT),a=Tw(r),o=Tw(n?.id);return(0,B.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!Aw(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Xme(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Mge(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Nge(e){return(0,B.useMemo)(()=>({draggable:{...rT.draggable,...e?.draggable},droppable:{...rT.droppable,...e?.droppable},dragOverlay:{...rT.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Pge(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,B.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;bw(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=yhe(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=khe(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var oT=(0,B.createContext)({...Lw,scaleX:1,scaleY:1}),sT;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(sT||={});var cT=(0,B.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=wge,collisionDetection:o=_he,measuring:s,modifiers:c,...l}=e,[u,d]=(0,B.useReducer)(Age,void 0,kge),[f,p]=rhe(),[m,h]=(0,B.useState)(sT.Uninitialized),g=m===sT.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,B.useRef)({initial:null,translated:null}),C=(0,B.useMemo)(()=>_==null?null:{id:_,data:x?.data??Tge,rect:S},[_,x]),w=(0,B.useRef)(null),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(null),k=Sw(l,Object.values(l)),A=Dw(`DndDescribedBy`,t),j=(0,B.useMemo)(()=>b.getEnabled(),[b]),M=Nge(s),{droppableRects:N,measureDroppableContainers:P,measuringScheduled:F}=sge(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),I=rge(v,_),L=(0,B.useMemo)(()=>D?jw(D):null,[D]),R=ke(),ee=cge(I,M.draggable.measure);Pge({activeNode:_==null?null:v.get(_),config:R.layoutShiftCompensation,initialRect:ee,measure:M.draggable.measure});let z=dge(I,M.draggable.measure,ee),te=dge(I?I.parentElement:null),ne=(0,B.useRef)({activatorEvent:null,active:null,activeNode:I,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=b.getNodeFor(ne.current.over?.id),ie=Cge({measure:M.dragOverlay.measure}),ae=ie.nodeRef.current??I,oe=g?ie.rect??z:null,se=!!(ie.nodeRef.current&&ie.rect),ce=fge(se?null:z),le=yge(ae?gw(ae):null),ue=mge(g?re??I:null),de=xge(ue),fe=Mge(c,{transform:{x:y.x-ce.x,y:y.y-ce.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:z,containerNodeRect:te,draggingNodeRect:oe,over:ne.current.over,overlayNodeRect:ie.rect,scrollableAncestors:ue,scrollableAncestorRects:de,windowRect:le}),pe=L?Ow(L,y):null,me=hge(ue),he=gge(me),ge=gge(me,[z]),_e=Ow(fe,he),ve=oe?xhe(oe,fe):null,ye=C&&ve?o({active:C,collisionRect:ve,droppableRects:N,droppableContainers:j,pointerCoordinates:pe}):null,be=fhe(ye,`id`),[xe,Se]=(0,B.useState)(null),Ce=vhe(se?fe:Ow(fe,ge),xe?.rect??null,z),we=(0,B.useRef)(null),Te=(0,B.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:ne,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Wr.unstable_batchedUpdates)(()=>{r?.(i),h(sT.Initializing),d({type:Nw.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(we.current),O(a)})},onMove(e){d({type:Nw.DragMove,coordinates:e})},onEnd:s(Nw.DragEnd),onCancel:s(Nw.DragCancel)});we.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=ne.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Nw.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Nw.DragCancel)}w.current=null,(0,Wr.unstable_batchedUpdates)(()=>{d({type:e}),h(sT.Uninitialized),Se(null),E(null),O(null),we.current=null;let t=e===Nw.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ee=ige(a,(0,B.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,Te(n,t))},[v,Te]));_ge(a),bw(()=>{z&&m===sT.Initializing&&h(sT.Initialized)},[z,m]),(0,B.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=ne.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:_e.x,y:_e.y},over:i};(0,Wr.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[_e.x,_e.y]),(0,B.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=ne.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(be),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Wr.unstable_batchedUpdates)(()=>{Se(s),a?.(c),f({type:`onDragOver`,event:c})})},[be]),bw(()=>{ne.current={activatorEvent:D,active:C,activeNode:I,collisionRect:ve,collisions:ye,droppableRects:N,draggableNodes:v,draggingNode:ae,draggingNodeRect:oe,droppableContainers:b,over:xe,scrollableAncestors:ue,scrollAdjustedTranslate:_e},S.current={initial:oe,translated:ve}},[C,I,ye,ve,v,ae,oe,N,b,xe,ue,_e]),ege({...R,delta:y,draggingRect:ve,pointerCoordinates:pe,scrollableAncestors:ue,scrollableAncestorRects:de});let De=(0,B.useMemo)(()=>({active:C,activeNode:I,activeNodeRect:z,activatorEvent:D,collisions:ye,containerNodeRect:te,dragOverlay:ie,draggableNodes:v,droppableContainers:b,droppableRects:N,over:xe,measureDroppableContainers:P,scrollableAncestors:ue,scrollableAncestorRects:de,measuringConfiguration:M,measuringScheduled:F,windowRect:le}),[C,I,z,D,ye,te,ie,v,b,N,xe,P,ue,de,M,F,le]),Oe=(0,B.useMemo)(()=>({activatorEvent:D,activators:Ee,active:C,activeNodeRect:z,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:xe,measureDroppableContainers:P}),[D,Ee,C,z,d,A,v,xe,P]);return B.createElement(the.Provider,{value:p},B.createElement(aT.Provider,{value:Oe},B.createElement(Oge.Provider,{value:De},B.createElement(oT.Provider,{value:Ce},i)),B.createElement(jge,{disabled:n?.restoreFocus===!1})),B.createElement(ohe,{...n,hiddenTextDescribedById:A}));function ke(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Fge=(0,B.createContext)(null),Ige=`button`,Lge=`Draggable`;function Rge(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Dw(Lge),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,B.useContext)(aT),{role:p=Ige,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,B.useContext)(g?oT:Fge),[v,y]=ww(),[b,x]=ww(),S=vge(o,t),C=Sw(n);return bw(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,B.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Ige?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function zge(){return(0,B.useContext)(Oge)}var Bge=`Droppable`,Vge={timeout:25};function Hge(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Dw(Bge),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,B.useContext)(aT),u=(0,B.useRef)({disabled:n}),d=(0,B.useRef)(!1),f=(0,B.useRef)(null),p=(0,B.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Vge,...i},_=Sw(h??r),v=nT({callback:(0,B.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=ww((0,B.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=Sw(t);return(0,B.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,B.useEffect)(()=>(s({type:Nw.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Nw.UnregisterDroppable,key:a,id:r})),[r]),(0,B.useEffect)(()=>{n!==u.current.disabled&&(s({type:Nw.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Uge(e){let{animation:t,children:n}=e,[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null),s=Tw(n);return!n&&!r&&s&&i(s),bw(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),B.createElement(B.Fragment,null,n,r?(0,B.cloneElement)(r,{ref:o}):null)}var Wge={x:0,y:0,scaleX:1,scaleY:1};function Gge(e){let{children:t}=e;return B.createElement(aT.Provider,{value:Dge},B.createElement(oT.Provider,{value:Wge},t))}var Kge={position:`fixed`,touchAction:`none`},qge=e=>Aw(e)?`transform 250ms ease`:void 0,Jge=(0,B.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=qge}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Kge,width:s.width,height:s.height,top:s.top,left:s.left,transform:Mw.Transform.toString(d),transformOrigin:i&&r?che(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return B.createElement(n,{className:o,style:f,ref:t},a)}),Yge={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Mw.Transform.toString(t)},{transform:Mw.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function Xge(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return xw((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=Sge(a);if(!c)return;let{transform:l}=gw(a).getComputedStyle(a),u=She(l);if(!u)return;let d=typeof t==`function`?t:Zge(t);return Bhe(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function Zge(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Yge,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var Qge=0;function $ge(e){return(0,B.useMemo)(()=>{if(e!=null)return Qge++,Qge},[e])}var e_e=B.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=zge(),S=(0,B.useContext)(oT),C=$ge(d?.id),w=Mge(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=tT(f),E=Xge({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return B.createElement(Gge,null,B.createElement(Uge,{animation:E},d&&C?B.createElement(Jge,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))});function lT(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function t_e(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function uT(e){return e!==null&&e>=0}function n_e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function r_e(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var i_e=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=lT(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},dT={scaleX:1,scaleY:1},a_e=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...dT}:null}let s=o_e(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...dT}:r<t&&r>=a?{x:0,y:o.height+s,...dT}:{x:0,y:0,...dT}};function o_e(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var s_e=`Sortable`,c_e=B.createContext({activeIndex:-1,containerId:s_e,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:i_e,disabled:{draggable:!1,droppable:!1}});function l_e(e){let{children:t,id:n,items:r,strategy:i=i_e,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=zge(),d=Dw(s_e,n),f=s.rect!==null,p=(0,B.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,B.useRef)(p),v=!n_e(p,_.current),y=g!==-1&&h===-1||v,b=r_e(a);bw(()=>{v&&m&&u(p)},[v,p,m,u]),(0,B.useEffect)(()=>{_.current=p},[p]);let x=(0,B.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:t_e(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return B.createElement(c_e.Provider,{value:x},t)}var u_e=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return lT(n,r,i).indexOf(t)},d_e=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},f_e={duration:200,easing:`ease`},p_e=`transform`,m_e=Mw.Transition.toString({property:p_e,duration:0,easing:`linear`}),h_e={roleDescription:`sortable`};function g_e(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,B.useState)(null),s=(0,B.useRef)(n);return bw(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=Rw(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,B.useEffect)(()=>{a&&o(null)},[a]),a}function __e(e){let{animateLayoutChanges:t=d_e,attributes:n,disabled:r,data:i,getNewIndex:a=u_e,id:o,strategy:s,resizeObserverConfig:c,transition:l=f_e}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,B.useContext)(c_e),y=v_e(r,p),b=u.indexOf(o),x=(0,B.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,B.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=Hge({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:P,setActivatorNodeRef:F,transform:I}=Rge({id:o,data:x,attributes:{...h_e,...n},disabled:y.draggable}),L=Ume(E,j),R=!!D,ee=R&&!m&&uT(f)&&uT(g),z=!_&&N,te=ee?(z&&ee?I:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,ne=uT(f)&&uT(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,re=D?.id,ie=(0,B.useRef)({activeId:re,items:u,newIndex:ne,containerId:d}),ae=u!==ie.current.items,oe=t({active:D,containerId:d,isDragging:N,isSorting:R,id:o,index:b,items:u,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:l,wasDragging:ie.current.activeId!=null}),se=g_e({disabled:!oe,index:b,node:w,rect:C});return(0,B.useEffect)(()=>{R&&ie.current.newIndex!==ne&&(ie.current.newIndex=ne),d!==ie.current.containerId&&(ie.current.containerId=d),u!==ie.current.items&&(ie.current.items=u)},[R,ne,d,u]),(0,B.useEffect)(()=>{if(re===ie.current.activeId)return;if(re&&!ie.current.activeId){ie.current.activeId=re;return}let e=setTimeout(()=>{ie.current.activeId=re},50);return()=>clearTimeout(e)},[re]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:ne,items:u,isOver:T,isSorting:R,isDragging:N,listeners:M,node:w,overIndex:g,over:P,setNodeRef:L,setActivatorNodeRef:F,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:se??te,transition:ce()};
138function ce(){if(se||ae&&ie.current.newIndex===b)return m_e;if(!(z&&!Aw(O)||!l)&&(R||oe))return Mw.Transition.toString({...l,property:p_e})}}function v_e(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function fT(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var y_e=[qw.Down,qw.Right,qw.Up,qw.Left],b_e=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(y_e.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case qw.Down:r.top<a.top&&t.push(n);break;case qw.Up:r.top>a.top&&t.push(n);break;case qw.Left:r.left>a.left&&t.push(n);break;case qw.Right:r.left<a.left&&t.push(n);break}});let c=hhe({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=fhe(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=zw(c).some((e,t)=>s[t]!==e),i=x_e(e,t),a=S_e(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:kw(u,l)}}}};function x_e(e,t){return!fT(e)||!fT(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function S_e(e,t){return!fT(e)||!fT(t)||!x_e(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function pT(e,t){return e.at>t.at?1:e.at<t.at?-1:e.id>t.id?1:-1}function C_e(e){return e.sort((e,t)=>e.at>t.at?1:e.at<t.at?-1:e.id>t.id?1:-1)}function w_e(e,t){return{at:e.at,id:e.id,kind:`folder`,depth:t,data:e}}function T_e(e,t){return{at:e.at,id:e.id,kind:`feature`,depth:t,data:e}}function E_e(e){let t=new Map;for(let n of e.values()){let e=t.get(n.folderId)||[];e.push(n),t.set(n.folderId,e)}return t}function mT(e,t){let n=E_e(e),r=Tx(t);function i(e){let t=(n.get(e)??[]).map(e=>({id:e.id,at:e.at,data:e.feature})),a=(r.get(e)??[]).map(e=>{let t=i(e.id),n=t.filter(e=>e.type===`Feature`).length;return{at:e.at,id:e.id,data:{type:`folder`,meta:{id:e.id,count:n,name:e.name},children:t}}});return C_e([...t,...a]).map(e=>e.data)}return{type:`root`,children:i(null)}}function D_e({folderMap:e,featureMap:t}){return(0,B.useMemo)(()=>mT(t,e),[t,t.version,e,e.version])}function O_e(e,t,n,r,i){let a=[],o=r.get(e)??[],s=n.get(e)??[];function c(e,t){a.push(T_e(e,t)),d++}function l(e,t){a.push(w_e(e,t)),u++}let u=0,d=0;for(;u<o.length||d<s.length;){let e=o[u],n=s[d];e?n&&n.at<e.at?c(n,t):l(e,t):c(n,t)}for(let e=a.length-1;e>=0;e--){let o=a[e];if(o.kind!==`folder`)continue;let s=o.data;if(!(!s.expanded||i===s.id)){let o=O_e(s.id,t+1,n,r,i);o.length&&(a=a.slice(0,e+1).concat(o).concat(a.slice(e+1)))}}return a}function k_e({data:e,activeId:t}){return(0,B.useMemo)(()=>O_e(null,0,E_e(e.featureMap),Tx(e.folderMap),t),[e,t])}function A_e({featureMap:e,root:t}){return(0,B.useMemo)(()=>{let n=[{type:`folder`,children:Array.from(e.values()).map(e=>e.feature),meta:{count:e.size,id:null,name:`All`}}];function r(e){switch(e.type){case`Feature`:break;case`folder`:{let t=e.children.filter(e=>e.type===`Feature`);n.push({...e,meta:{...e.meta,count:t.length},children:t});for(let t of e.children)r(t);break}}}for(let e of t.children)r(e);return n},[t,e])}function j_e(e,t){return Math.round(e/t)}function M_e({tree:e,activeId:t,overId:n,offsetLeft:r,indentationWidth:i,dropIntoFolder:
138a}){let o=e.findIndex(({id:e})=>e===n),s=e.findIndex(({id:e})=>e===t),c=e[s],l=lT(e,s,o),u=l[o-1],d=l[o+1],f=j_e(r,i),p=c.depth+f,m=N_e({previousItem:u}),h=P_e({nextItem:d}),g=p;p>=m?g=m:p<h&&(g=h);function _(){return g===0||!u?null:g===u.depth?u.data.folderId:g>u.depth?u.id:l.slice(0,o).reverse().find(e=>e.depth===g)?.data.folderId??null}return a?{depth:g,maxDepth:m,minDepth:h,folderId:String(n)}:{depth:g,maxDepth:m,minDepth:h,folderId:_()}}function N_e({previousItem:e}){return e?.kind===`folder`?e.depth+1:e?.kind===`feature`?e.depth:0}function P_e({nextItem:e}){return e?e.depth:0}function F_e(e,t){let n=[],r=t.featureMap.get(e.id);if(!r)return n;let i=r.folderId;for(;i!==null;){let e=t.folderMap.get(i);if(!e)return n;e.expanded||n.push(e),i=e.folderId}return n}var hT=new class{id=`kml`;label=`KML`;extensions=[`.kml`];filenames=[];mimes=[`application/vnd.google-earth.kml+xml`];forwardBinary(e,t){return YC(e).chain(e=>hT.forwardString(e))}forwardString(e){return ve(async function(){let t=await ye(()=>import(`./togeojson.es-ZYLubihA.js`),[]),n=await ZC(e);return{type:`root`,notes:[],root:t.kmlWithFolders(n)}})}back({geojson:e,featureMap:t,folderMap:n},r){return ve(async({throwE:e})=>{let{foldersToKML:r}=await ye(async()=>{let{foldersToKML:e}=await import(`./tokml.es-WpfWs46Q.js`);return{foldersToKML:e}},[]);try{return{blob:QC(r(mT(t,n))),name:`features.kml`}}catch{return e(new _e(`Could not convert to KML`))}})}},gT=r({decode:()=>R_e,encode:()=>z_e,geoJSONToPolyline:()=>B_e,polylineToGeoJSON:()=>V_e});function I_e(e){return Math.floor(Math.abs(e)+.5)*(e>=0?1:-1)}function _T(e,t,n){e=I_e(e*n),t=I_e(t*n);let r=e-t;r<<=1,e-t<0&&(r=~r);let i=``;for(;r>=32;)i+=String.fromCharCode((32|r&31)+63),r>>=5;return i+=String.fromCharCode(r+63),i}function L_e(e){return e&1?~(e>>1):e>>1}function R_e(e,t=5){let n=10**t,r=0,i=0,a=0,o=[],s=0,c=0,l=null,u,d;for(;r<e.length;){l=null,s=0,c=0;do l=e.charCodeAt(r++)-63,c|=(l&31)<<s,s+=5;while(l>=32);u=L_e(c),s=c=0;do l=e.charCodeAt(r++)-63,c|=(l&31)<<s,s+=5;while(l>=32);d=L_e(c),i+=u,a+=d,o.push([a/n,i/n])}return o}function z_e(e,t=5){if(!e.length)return``;let n=10**t,r=_T(e[0][1],0,n)+_T(e[0][0],0,n);for(let t=1;t<e.length;t++){let i=e[t],a=e[t-1];r+=_T(i[1],a[1],n),r+=_T(i[0],a[0],n)}return r}function B_e(e,t=5){return z_e(e.coordinates,t)}function V_e(e,t=5){return{type:`LineString`,coordinates:R_e(e,t)}}function vT(e){return Array.isArray?Array.isArray(e):J_e(e)===`[object Array]`}function H_e(e){if(typeof e==`string`)return e;let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function U_e(e){return e==null?``:H_e(e)}function yT(e){return typeof e==`string`}function W_e(e){return typeof e==`number`}function G_e(e){return e===!0||e===!1||q_e(e)&&J_e(e)==`[object Boolean]`}function K_e(e){return typeof e==`object`}function q_e(e){return K_e(e)&&e!==null}function bT(e){return e!=null}function xT(e){return!e.trim().length}function J_e(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Y_e=`Incorrect 'index' type`,X_e=e=>`Invalid value for key ${e}`,Z_e=e=>`Pattern length exceeds max of ${e}.`,Q_e=e=>`Missing ${e} property in key`,$_e=e=>`Property 'weight' in key '${e}' must be a positive integer`,eve=Object.prototype.hasOwnProperty,tve=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=nve(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function nve(e){let t=null,n=null,r=null,i=1,a=null;if(yT(e)||vT(e))r=e,t=rve(e),n=ST(e);else{if(!eve.call(e,`name`))throw Error(Q_e(`name`));let o=e.name;if(r=o,eve.call(e,`weight`)&&(i=e.weight,i<=0))throw Error($_e(o));t=rve(o),n=ST(o),a=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:a}}function rve(e){return vT(e)?e:e.split(`.`)}function ST(e){return vT(e)?e.join(`.`):e}function ive(e,t){let n=[],r=!1,i=(e,t,a)=>{if(bT(e))if(!t[a])n.push(e);else{let o=e[t[a]];if(!bT(o))return;if(a===t.length-1&&(yT(o)||W_e(o)||G_e(o)))n.push(U_e(o));else if(vT(o)){r=!0;for(let e=0,n=o.length;e<n;e+=1)i(o[e],t,a+1)}else t.length&&i(o,t,a+1)}};return i(e,yT(t)?t.split(`.`):t,0),r?n:n[0]}var ave={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},ove={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},sve={location:0,threshold:.6,distance:100},cve={useExtendedSearch:!1,getFn:ive,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},CT={...ove,...ave,...sve,...cve},lve=/[^ ]+/g;function uve(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=t.match(lve).length;if(n.has(i))return n.get(i);let a=1/i**(.5*e),o=parseFloat(Math.round(a*r)/r);return n.set(i,o),o},clear(){n.clear()}}}var wT=class{constructor({getFn:e=CT.getFn,fieldNormWeight:t=CT.fieldNormWeight}={}){this.norm=uve(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,yT(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();yT(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)--this.records[t].i}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!bT(e)||xT(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(e,t){let n={i:t,$:{}};this.keys.forEach((t,r)=>{let i=t.getFn?t.getFn(e):this.getFn(e,t.path);
vendor: 10,693 bytes, line 138
138if(bT(i)){if(vT(i)){let e=[],t=[{nestedArrIndex:-1,value:i}];for(;t.length;){let{nestedArrIndex:n,value:r}=t.pop();if(bT(r))if(yT(r)&&!xT(r)){let t={v:r,i:n,n:this.norm.get(r)};e.push(t)}else vT(r)&&r.forEach((e,n)=>{t.push({nestedArrIndex:n,value:e})})}n.$[r]=e}else if(yT(i)&&!xT(i)){let e={v:i,n:this.norm.get(i)};n.$[r]=e}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function dve(e,t,{getFn:n=CT.getFn,fieldNormWeight:r=CT.fieldNormWeight}={}){let i=new wT({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(nve)),i.setSources(t),i.create(),i}function fve(e,{getFn:t=CT.getFn,fieldNormWeight:n=CT.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new wT({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function TT(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=CT.distance,ignoreLocation:a=CT.ignoreLocation}={}){let o=t/e.length;if(a)return o;let s=Math.abs(r-n);return i?o+s/i:s?1:o}function pve(e=[],t=CT.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}var ET=32;function mve(e,t,n,{location:r=CT.location,distance:i=CT.distance,threshold:a=CT.threshold,findAllMatches:o=CT.findAllMatches,minMatchCharLength:s=CT.minMatchCharLength,includeMatches:c=CT.includeMatches,ignoreLocation:l=CT.ignoreLocation}={}){if(t.length>ET)throw Error(Z_e(ET));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=s>1||c,g=h?Array(d):[],_;for(;(_=e.indexOf(t,m))>-1;){let e=TT(t,{currentLocation:_,expectedLocation:f,distance:i,ignoreLocation:l});if(p=Math.min(e,p),m=_+u,h){let e=0;for(;e<u;)g[_+e]=1,e+=1}}m=-1;let v=[],y=1,b=u+d,x=1<<u-1;for(let r=0;r<u;r+=1){let a=0,s=b;for(;a<s;)TT(t,{errors:r,currentLocation:f+s,expectedLocation:f,distance:i,ignoreLocation:l})<=p?a=s:b=s,s=Math.floor((b-a)/2+a);b=s;let c=Math.max(1,f-s+1),_=o?d:Math.min(f+s,d)+u,S=Array(_+2);S[_+1]=(1<<r)-1;for(let a=_;a>=c;--a){let o=a-1,s=n[e.charAt(o)];if(h&&(g[o]=+!!s),S[a]=(S[a+1]<<1|1)&s,r&&(S[a]|=(v[a+1]|v[a])<<1|1|v[a+1]),S[a]&x&&(y=TT(t,{errors:r,currentLocation:o,expectedLocation:f,distance:i,ignoreLocation:l}),y<=p)){if(p=y,m=o,m<=f)break;c=Math.max(1,2*f-m)}}if(TT(t,{errors:r+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:l})>p)break;v=S}let S={isMatch:m>=0,score:Math.max(.001,y)};if(h){let e=pve(g,s);e.length?c&&(S.indices=e):S.isMatch=!1}return S}function hve(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var DT=String.prototype.normalize?(e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``)):(e=>e),gve=class{constructor(e,{location:t=CT.location,threshold:n=CT.threshold,distance:r=CT.distance,includeMatches:i=CT.includeMatches,findAllMatches:a=CT.findAllMatches,minMatchCharLength:o=CT.minMatchCharLength,isCaseSensitive:s=CT.isCaseSensitive,ignoreDiacritics:c=CT.ignoreDiacritics,ignoreLocation:l=CT.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?DT(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:hve(e),startIndex:t})},d=this.pattern.length;if(d>ET){let e=0,t=d%ET,n=d-t;for(;e<n;)u(this.pattern.substr(e,ET),e),e+=ET;if(t){let e=d-ET;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?DT(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=mve(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&(u=[...u,...g])});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=u),p}},OT=class{constructor(e){this.pattern=e}static isMultiMatch(e){return _ve(e,this.multiRegex)}static isSingleMatch(e){return _ve(e,this.singleRegex)}search(){}};function _ve(e,t){let n=e.match(t);return n?n[1]:null}var vve=class extends OT{constructor(e){super(e)}static get type(){return`exact`}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},yve=class extends OT{constructor(e){super(e)}static get type(){return`inverse-exact`}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=e.indexOf(this.pattern)===-1;return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},bve=class extends OT{constructor(e){super(e)}static get type(){return`prefix-exact`}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},xve=class extends OT{constructor(e){super(e)}static get type(){return`inverse-prefix-exact`}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},Sve=class extends OT{constructor(e){super(e)}static get type(){return`suffix-exact`}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}},Cve=class extends OT{constructor(e){super(e)}static get type(){return`inverse-suffix-exact`}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},wve=class extends OT{constructor(e,{location:t=CT.location,threshold:n=CT.threshold,distance:r=CT.distance,includeMatches:i=CT.includeMatches,findAllMatches:a=CT.findAllMatches,minMatchCharLength:o=CT.minMatchCharLength,isCaseSensitive:s=CT.isCaseSensitive,ignoreDiacritics:c=CT.ignoreDiacritics,ignoreLocation:l=CT.ignoreLocation}={}){super(e),this._bitapSearch=new gve(e,{location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l})}static get type(){return`fuzzy`}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},Tve=class extends OT{constructor(e){super(e)}static get type(){return`include`}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,n,r=[],i=this.pattern.length;for(;(n=e.indexOf(this.pattern,t))>-1;)t=n+i,r.push([n,t-1]);let a=!!r.length;return{isMatch:a,score:+!a,indices:r}}},kT=[vve,Tve,bve,xve,Cve,Sve,yve,wve],Eve=kT.length,Dve=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Ove=`|`;function kve(e,t={}){return e.split(Ove).map(e=>{let n=e.trim().split(Dve).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<Eve;){let e=kT[o],n=e.isMultiMatch(i);n&&(r.push(new e(n,t)),a=!0)}if(!a)for(o=-1;++o<Eve;){let e=kT[o],n=e.isSingleMatch(i);if(n){r.push(new e(n,t));break}}}return r})}var Ave=new Set([wve.type,Tve.type]),jve=class{constructor(e,{isCaseSensitive:t=CT.isCaseSensitive,ignoreDiacritics:n=CT.ignoreDiacritics,includeMatches:r=CT.includeMatches,minMatchCharLength:i=CT.minMatchCharLength,ignoreLocation:a=CT.ignoreLocation,findAllMatches:o=CT.findAllMatches,location:s=CT.location,threshold:c=CT.threshold,distance:l=CT.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?DT(e):e,this.pattern=e,this.query=kve(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?DT(e):e;let a=0,o=[],s=0;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:c,indices:l,score:u}=r.search(e);if(c){if(a+=1,s+=u,n){let e=r.constructor.type;Ave.has(e)?o=[...o,...l]:o.push(l)}}else{s=0,a=0,o.length=0;break}}
138if(a){let e={isMatch:!0,score:s/a};return n&&(e.indices=o),e}}return{isMatch:!1,score:1}}},AT=[];function Mve(...e){AT.push(...e)}function jT(e,t){for(let n=0,r=AT.length;n<r;n+=1){let r=AT[n];if(r.condition(e,t))return new r(e,t)}return new gve(e,t)}var MT={AND:`$and`,OR:`$or`},NT={PATH:`$path`,PATTERN:`$val`},PT=e=>!!(e[MT.AND]||e[MT.OR]),Nve=e=>!!e[NT.PATH],Pve=e=>!vT(e)&&K_e(e)&&!PT(e),Fve=e=>({[MT.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ive(e,t,{auto:n=!0}={}){let r=e=>{let i=Object.keys(e),a=Nve(e);if(!a&&i.length>1&&!PT(e))return r(Fve(e));if(Pve(e)){let r=a?e[NT.PATH]:i[0],o=a?e[NT.PATTERN]:e[r];if(!yT(o))throw Error(X_e(r));let s={keyId:ST(r),pattern:o};return n&&(s.searcher=jT(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];vT(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return PT(e)||(e=Fve(e)),r(e)}function Lve(e,{ignoreFieldNorm:t=CT.ignoreFieldNorm}){e.forEach(e=>{let n=1;e.matches.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),e.score=n})}function Rve(e,t){let n=e.matches;t.matches=[],bT(n)&&n.forEach(e=>{if(!bT(e.indices)||!e.indices.length)return;let{indices:n,value:r}=e,i={indices:n,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function zve(e,t){t.score=e.score}function Bve(e,t,{includeMatches:n=CT.includeMatches,includeScore:r=CT.includeScore}={}){let i=[];return n&&i.push(Rve),r&&i.push(zve),e.map(e=>{let{idx:n}=e,r={item:t[n],refIndex:n};return i.length&&i.forEach(t=>{t(e,r)}),r})}var FT=class{constructor(e,t={},n){this.options={...CT,...t},this.options.useExtendedSearch,this._keyStore=new tve(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof wT))throw Error(Y_e);this._myIndex=t||dve(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){bT(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let n=0,r=this._docs.length;n<r;n+=1){let i=this._docs[n];e(i,n)&&(this.removeAt(n),--n,--r,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:n,includeScore:r,shouldSort:i,sortFn:a,ignoreFieldNorm:o}=this.options,s=yT(e)?yT(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Lve(s,{ignoreFieldNorm:o}),i&&s.sort(a),W_e(t)&&t>-1&&(s=s.slice(0,t)),Bve(s,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){let t=jT(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:e,i:n,n:i})=>{if(!bT(e))return;let{isMatch:a,score:o,indices:s}=t.searchIn(e);a&&r.push({item:e,idx:n,matches:[{score:o,value:e,norm:i,indices:s}]})}),r}_searchLogical(e){let t=Ive(e,this.options),n=(e,t,r)=>{if(!e.children){let{keyId:n,searcher:i}=e,a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i});return a&&a.length?[{idx:r,item:t,matches:a}]:[]}let i=[];for(let a=0,o=e.children.length;a<o;a+=1){let o=e.children[a],s=n(o,t,r);if(s.length)i.push(...s);else if(e.operator===MT.AND)return[]}return i},r=this._myIndex.records,i={},a=[];return r.forEach(({$:e,i:r})=>{if(bT(e)){let o=n(t,e,r);o.length&&(i[r]||(i[r]={idx:r,item:e,matches:[]},a.push(i[r])),o.forEach(({matches:e})=>{i[r].matches.push(...e)}))}}),a}_searchObjectList(e){let t=jT(e,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach(({$:e,i:r})=>{if(!bT(e))return;let a=[];n.forEach((n,r)=>{a.push(...this._findMatches({key:n,value:e[r],searcher:t}))}),a.length&&i.push({idx:r,item:e,matches:a})}),i}_findMatches({key:e,value:t,searcher:n}){if(!bT(t))return[];let r=[];if(vT(t))t.forEach(({v:t,i,n:a})=>{if(!bT(t))return;let{isMatch:o,score:s,indices:c}=n.searchIn(t);o&&r.push({score:s,key:e,value:t,idx:i,norm:a,indices:c})});else{let{v:i,n:a}=t,{isMatch:o,score:s,indices:c}=n.searchIn(i);o&&r.push({score:s,key:e,value:i,norm:a,indices:c})}return r}};FT.version=`7.1.0`,FT.createIndex=dve,FT.parseIndex=fve,FT.config=CT,FT.parseQuery=Ive,Mve(jve);var Vve=i(((e,t)=>{var n=cw(),r=RS(),i=D_(),a=c_(),o=zS();function s(e,t,s,c){if(!a(e))return e;t=r(t,e);for(var l=-1,u=t.length,d=u-1,f=e;f!=null&&++l<u;){var p=o(t[l]),m=s;if(p===`__proto__`||p===`constructor`||p===`prototype`)return e;if(l!=d){var h=f[p];m=c?c(h,p,f):void 0,m===void 0&&(m=a(h)?h:i(t[l+1])?[]:{})}n(f,p,m),f=f[p]}return e}t.exports=s})),Hve=i(((e,t)=>
138{var n=BS(),r=Vve(),i=RS();function a(e,t,a){for(var o=-1,s=t.length,c={};++o<s;){var l=t[o],u=n(e,l);a(u,l)&&r(c,i(l,e),u)}return c}t.exports=a})),Uve=i(((e,t)=>{var n=Hve(),r=VS();function i(e,t){return n(e,t,function(t,n){return r(e,n)})}t.exports=i})),Wve=i(((e,t)=>{var n=A(),r=T_(),i=x_(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),IT=i(((e,t)=>{var n=b_(),r=Wve();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),Gve=i(((e,t)=>{var n=IT();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r})),Kve=i(((e,t)=>{var n=Gve(),r=X_(),i=Q_();function a(e){return i(r(e,void 0,n),e+``)}t.exports=a})),qve=e(i(((e,t)=>{var n=Uve();t.exports=Kve()(function(e,t){return e==null?{}:n(e,t)})}))()),Jve=S([p(),p(),p(),p()]),Yve=v({id:o(),label:o()}).passthrough(),Xve=h(()=>v({type:_(`Point`),coordinates:a(p()).min(2)})),Zve=v({type:_(`Feature`),geometry:Xve,bbox:ae(Jve),properties:Yve}),Qve=h(()=>v({bbox:ae(Jve),geocoding:M(),type:_(`FeatureCollection`),features:a(Zve)}));function $ve(e,t=!1){return t&&(e=e.slice().reverse()),e[1]>90||e[1]<-90?ue(new _e(`Coordinate out of bounds`)):fe({type:`coordinate`,name:`${Lfe(e)}`,coordinates:e})}function eye(e){return{type:`extent`,name:`${e.join(`,`)}`,coordinates:e}}function LT(e){switch(e.type){case`Feature`:return dv(e.properties.label,24);case`extent`:return e.name;case`coordinate`:return e.name}}function tye(e,t=!1){return t||!e?e:(0,qve.default)(e,[`name`,`label`])}function nye(e,t=!1){switch(e.type){case`coordinate`:return null;case`Feature`:return e.bbox?{type:`Feature`,geometry:nC(e.bbox),properties:tye(e.properties,t)}:null;case`extent`:return{type:`Feature`,geometry:nC(e.coordinates),properties:{}}}}function rye(e,t=!1){switch(e.type){case`Feature`:return{...e,properties:tye(e.properties,t)};case`extent`:return{type:`Feature`,geometry:nC(e.coordinates),properties:{}};case`coordinate`:return{type:`Feature`,geometry:{coordinates:e.coordinates,type:`Point`},properties:{}}}}function iye(e){let t=YS(e),n=t.chain(e=>$ve(e)),r=t.chain(e=>$ve(e,!0)),i=XS(e).map(eye);return pe.rights([i,n,r])}function aye(e,t){return new FT(t,{keys:[`label`],isCaseSensitive:!1,threshold:.2,ignoreLocation:!0}).search(e,{limit:5}).map(e=>({type:`action`,action:e.item}))}function oye(e,t){return t.search(e,{limit:5}).map(e=>({type:`wrappedFeature`,result:e}))}async function sye({query:e,center:t,zoom:n,signal:r,searchIndex:i,actions:a}){if(!e)return{literal:[],features:[],geocoder:[],actions:[]};let o={api_key:ry.GEOCODE_EARTH_TOKEN,text:e,limit:`5`,...n!==void 0&&n>4&&t?{"focus.point.lon":t.lng.toString(),"focus.point.lat":t.lat.toString()}:{}},s=new URLSearchParams(o).toString(),c=Qve.parse(await(await fetch(`https://api.geocode.earth/v1/autocomplete?${s}`,{signal:r||null})).json());return{literal:iye(e),actions:aye(e,a),features:oye(e,i),geocoder:c.features}}var cye=r({geoJSONToWkt:()=>VT,wktToGeoJSON:()=>Aye}),lye=Object.defineProperty,uye=(e,t,n)=>t in e?lye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dye=(e,t,n)=>(uye(e,typeof t==`symbol`?t:t+``,n),n),fye=[`Point`,`LineString`,`Polygon`,`MultiPoint`,`MultiLineString`,`MultiPolygon`,`GeometryCollection`],pye=[`ZM`,`Z`,`M`],RT=`EMPTY`,mye=class{constructor(e){dye(this,`value`),dye(this,`position`),this.value=e.toUpperCase(),this.position=0}match(e){this.skipWhitespaces();for(let t of e){let e=t.toUpperCase();if(this.value.startsWith(e,this.position))return this.position+=e.length,t}return null}matchRegex(e){this.skipWhitespaces();for(let t of e){let e=this.value.substring(this.position).match(t);if(e)return this.position+=e[0].length,e}return null}isMatch(e){return this.skipWhitespaces(),this.value.startsWith(e,this.position)?(this.position+=e.length,!0):!1}matchType(){let e=this.match(fye);if(!e)throw Error(`Expected geometry type`);return e}matchDimension(){switch(this.match(pye)){case`ZM`:return{hasZ:!0,hasM:!0};case`Z`:return{hasZ:!0,hasM:!1};case`M`:return{hasZ:!1,hasM:!0};default:return{hasZ:!1,hasM:!1}}}
138expectGroupStart(){if(!this.isMatch(`(`))throw Error(`Expected group start`)}expectGroupEnd(){if(!this.isMatch(`)`))throw Error(`Expected group end`)}matchCoordinate(e){let t;if(t=e.hasZ&&e.hasM?this.matchRegex([/^(\S*)\s+(\S*)\s+(\S*)\s+([^\s,)]*)/i]):e.hasZ||e.hasM?this.matchRegex([/^(\S*)\s+(\S*)\s+([^\s,)]*)/i]):this.matchRegex([/^(\S*)\s+([^\s,)]*)/i]),!t)throw Error(`Expected coordinates`);let n=e.hasZ&&e.hasM?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4])]:e.hasZ?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]:(e.hasM,[parseFloat(t[1]),parseFloat(t[2])]);if(!e.srid||e.srid===4326)return n;if(e.srid===`http://www.opengis.net/def/crs/epsg/0/4326`)return n.length===3?[n[1],n[0],n[2]]:[n[1],n[0]];if(!e.proj)throw Error(`EWKT data in an unknown SRID (${e.srid}) was provided, but a proj function was not`);return e.proj(typeof e.srid==`string`?e.srid:`EPSG:${e.srid}`,`EPSG:4326`,n)}matchCoordinates(e){let t=[];do{let n=this.isMatch(`(`);t.push(this.matchCoordinate(e)),n&&this.expectGroupEnd()}while(this.isMatch(`,`));return t}skipWhitespaces(){for(;this.position<this.value.length&&this.value[this.position]===` `;)this.position++}},hye=(e,t)=>{if(e.isMatch(RT))return t.emptyAsNull?null:{type:`Point`,coordinates:[]};e.expectGroupStart();let n=e.matchCoordinate(t);return e.expectGroupEnd(),{type:`Point`,coordinates:n}},gye=(e,t)=>{if(e.isMatch(RT))return t.emptyAsNull?null:{type:`LineString`,coordinates:[]};e.expectGroupStart();let n=e.matchCoordinates(t);return e.expectGroupEnd(),{type:`LineString`,coordinates:n}},_ye=(e,t)=>{if(e.isMatch(RT))return t.emptyAsNull?null:{type:`Polygon`,coordinates:[]};let n=[];for(e.expectGroupStart(),e.expectGroupStart(),n.push(e.matchCoordinates(t)),e.expectGroupEnd();e.isMatch(`,`);)e.expectGroupStart(),n.push(e.matchCoordinates(t)),e.expectGroupEnd();return e.expectGroupEnd(),{type:`Polygon`,coordinates:n}},vye=(e,t)=>{if(e.isMatch(RT))return t.emptyAsNull?null:{type:`MultiPoint`,coordinates:[]};e.expectGroupStart();let n=e.matchCoordinates(t);return e.expectGroupEnd(),{type:`MultiPoint`,coordinates:n}},yye=(e,t)=>{if(e.isMatch(RT))return t.emptyAsNull?null:{type:`MultiLineString`,coordinates:[]};e.expectGroupStart();let n=[];do e.expectGroupStart(),n.push(e.matchCoordinates(t)),e.expectGroupEnd();while(e.isMatch(`,`));return e.expectGroupEnd(),{type:`MultiLineString`,coordinates:n}},bye=(e,t)=>{if(e.isMatch(RT))return t.emptyAsNull?null:{type:`MultiPolygon`,coordinates:[]};e.expectGroupStart();let n=[];do{e.expectGroupStart();let r=[],i=[];for(e.expectGroupStart(),r.push.apply(r,e.matchCoordinates(t)),e.expectGroupEnd();e.isMatch(`,`);)e.expectGroupStart(),i.push(e.matchCoordinates(t)),e.expectGroupEnd();n.push([r,...i]),e.expectGroupEnd()}while(e.isMatch(`,`));return e.expectGroupEnd(),{type:`MultiPolygon`,coordinates:n}},xye=(e,t)=>{if(e.isMatch(RT))return t.emptyAsNull?null:{type:`GeometryCollection`,geometries:[]};e.expectGroupStart();let n=[];do{let r=kye(e,t);r&&n.push(r)}while(e.isMatch(`,`));return e.expectGroupEnd(),{type:`GeometryCollection`,geometries:n}};function zT(e){return e.join(` `)}function BT(e){if(e===void 0)return` `;switch(e.length){case 3:return` Z `;default:return` `}}function Sye(e){return e.coordinates.length===0?`POINT EMPTY`:`POINT${BT(e.coordinates)}(${zT(e.coordinates)})`}function Cye(e,t){return e.coordinates.length===0?`MULTIPOINT EMPTY`:`MULTIPOINT${BT(e.coordinates[0])}(${e.coordinates.map(e=>t.version===`1.2.0`?`(${zT(e)})`:zT(e)).join(`,`)})`}function wye(e){if(e.coordinates.length===0)return`LINESTRING EMPTY`;let t=`(${e.coordinates.map(e=>zT(e)).join(`,`)})`;return`LINESTRING${BT(e.coordinates[0])}${t}`}function Tye(e,t){return e.geometries.length===0?`GEOMETRYCOLLECTION EMPTY`:`GEOMETRYCOLLECTION${`(${e.geometries.map(e=>VT(e,t)).join(`,`)})`}`}function Eye(e){if(e.coordinates.length===0)return`MULTILINESTRING EMPTY`;let t=`(${e.coordinates.map(e=>`(${e.map(e=>zT(e))})`)})`;return`MULTILINESTRING${BT(e.coordinates[0][0])}${t}`}function Dye(e){if(e.coordinates.length===0)return`POLYGON EMPTY`;let t=`(${e.coordinates.map(e=>`(${e.map(e=>zT(e))})`)})`;
138return`POLYGON${BT(e.coordinates[0]?.[0])}${t}`}function Oye(e){if(e.coordinates.length===0)return`MULTIPOLYGON EMPTY`;let t=`(${e.coordinates.map(e=>`(${e.map(e=>`(${e.map(e=>zT(e))})`)})`)})`;return`MULTIPOLYGON${BT(e.coordinates[0]?.[0]?.[0])}${t}`}function kye(e,t){let n=null,r=e.matchRegex([/^SRID=(\d+);/i]);if(r)n=parseInt(r[1],10);else{let t=e.matchRegex([/^<([^>]+)>/i]);t&&(n=t[1].toLowerCase())}let i=e.matchType(),a=e.matchDimension(),o={...t,srid:n,hasZ:a.hasZ,hasM:a.hasM};switch(i){case`Point`:return hye(e,o);case`LineString`:return gye(e,o);case`Polygon`:return _ye(e,o);case`MultiPoint`:return vye(e,o);case`MultiLineString`:return yye(e,o);case`MultiPolygon`:return bye(e,o);case`GeometryCollection`:return xye(e,o)}}function VT(e,t={version:`1.1.0`}){switch(e.type){case`Point`:return Sye(e);case`LineString`:return wye(e);case`MultiPoint`:return Cye(e,t);case`GeometryCollection`:return Tye(e,t);case`Polygon`:return Dye(e);case`MultiPolygon`:return Oye(e);case`MultiLineString`:return Eye(e)}}function Aye(e,t={emptyAsNull:!0}){return kye(new mye(e),t)}var jye=v({zipHeader:o()});async function Mye(e){let t=await ye(()=>import(`./browser-DEYugRT4.js`),[]);return await new Promise((n,r)=>{t.unzip(new Uint8Array(e),(e,t)=>{if(e)return r(e);n(t)})})}var Nye=v({h3Header:o()}),HT=v({geometryHeader:o()}),Pye=v({latitudeHeader:o(),longitudeHeader:o(),autoType:j()});function Fye(e,t){let n=t.geocodingHeaders.text;if(!n)throw Error(`A column must be provided for single-column geocoding.`);let r=String(e[n]);if(!r)return null;let i={api_key:ry.GEOCODE_EARTH_TOKEN,text:r};return`https://api.geocode.earth/v1/search?${new URLSearchParams(i).toString()}`}function Iye(e,t){let n={api_key:ry.GEOCODE_EARTH_TOKEN},r=!1;for(let[i,a]of Object.entries(t.geocodingHeaders))i!==`text`&&a&&(r=!0,e[a]&&(n[i]=String(e[a])));if(!r)throw Error(`For structured geocoding, at least one column must be selected.`);return`https://api.geocode.earth/v1/search/structured?${new URLSearchParams(n).toString()}`}async function Lye(e,t){let n=t.geocodingType===`search`?Fye(e,t):Iye(e,t),r={type:`Feature`,properties:e,geometry:null};if(!n)return r;let i=null;for(let e=0;e<3&&(i=await fetch(n),!i.ok);e++)await new Promise(e=>setTimeout(e,500));if(!i?.ok)return r;let a=await i.json(),o=Qve.parse(a);return o.features.length?{type:`Feature`,properties:e,geometry:o.features[0].geometry}:r}function Rye(e,t,n){let{zipHeader:r}=n,i=String(e[r]).padStart(5,`0`);return delete e[``],i&&i in t?{type:`Feature`,properties:e,geometry:{type:`Point`,coordinates:t[i]}}:null}async function zye(e,t){let{cellToBoundary:n,isValidCell:r}=await ye(async()=>{let{cellToBoundary:e,isValidCell:t}=await import(`./h3-js.es-ChjxAA4r.js`);return{cellToBoundary:e,isValidCell:t}},[]),{h3Header:i}=t,a=String(e[i]);if(delete e[``],!r(a))return null;let o=n(a,!0);return le.fromNullable(o).mapOrDefault(t=>({type:`Feature`,properties:e,geometry:{type:`Polygon`,coordinates:[t]}}),null)}function Bye(e){return typeof e==`number`?e:typeof e==`string`?parseFloat(e):NaN}function Vye(e,t){let{geometryHeader:n}=t;return delete e[``],le.fromNullable(Aye(String(e[n]))).mapOrDefault(t=>(delete e[n],{type:`Feature`,properties:e,geometry:t}),null)}function Hye(e,t){let{geometryHeader:n}=t;return delete e[``],pe.encase(()=>V_e(String(e[n]))).caseOf({Left(){return null},Right(t){return delete e[n],{type:`Feature`,properties:e,geometry:t}}})}function Uye(e,t){let{geometryHeader:n}=t;return delete e[``],me(String(e[n])).chain(e=>nw(e)).caseOf({Left(){return null},Right(t){let r=t.geojson.features[0]?.geometry;return delete e[n],{type:`Feature`,properties:e,geometry:r}}})}function Wye(e,t){let{latitudeHeader:n,longitudeHeader:r}=t,i=Bye(e[r]),a=Bye(e[n]);return delete e[``],Number.isNaN(i)||Number.isNaN(a)?null:(delete e[r],delete e[n],{type:`Feature`,properties:e,geometry:{type:`Point`,coordinates:[i,a]}})}var Gye=new class{id=`kmz`;label=`KMZ`;extensions=[`.kmz`];filenames=[];mimes=[];forwardBinary(e,t){return ve(async function({throwE:t,liftEither:n}){let r=await Mye(e),i=Object.entries(r).find(([e])=>XC(e)===`.kml`);if(!i)return t(new ge(`No KML file found within KMZ`));let a=await n(await YC(i[1]));return n(await hT.forwardString(a))})}back({geojson:e,featureMap:t,folderMap:n}
138,r){return ve(async({throwE:e})=>{let{foldersToKML:r}=await ye(async()=>{let{foldersToKML:e}=await import(`./tokml.es-WpfWs46Q.js`);return{foldersToKML:e}},[]);try{let e=mT(t,n),i=await ye(()=>import(`./browser-DEYugRT4.js`),[]),a=r(e),o=new TextEncoder().encode(a),s=await new Promise((e,t)=>{i.zip({"doc.kml":o},(n,r)=>{if(n)return t(n);e(r)})});return{blob:new Blob([s],{type:`application/octet-stream`}),name:`features.kmz`}}catch{return e(new _e(`Could not convert to KMZ`))}})}},Kye=new class{id=`osm`;label=`OpenStreetMap XML`;extensions=[`.osm`,`.xml`];filenames=[];mimes=[];forwardString(t){return ve(async function(){return $C((await ye(()=>import(`./osmtogeojson-Dcbntauc.js`).then(t=>e(t.default)).then(e=>e.default),__vite__mapDeps([9,1,10])))(await ZC(t)))})}forwardBinary(e,t){return YC(e).chain(e=>Kye.forwardString(e))}},qye=r({Polyline:()=>UT}),UT=new class{id=`polyline`;label=`Google encoded polyline`;extensions=[];filenames=[];mimes=[];forwardBinary(e,t){return YC(e).chain(e=>UT.forwardString(e))}forwardString(e){return ve(async function(){return $C({type:`FeatureCollection`,features:[{type:`Feature`,properties:{},geometry:(await ye(()=>Promise.resolve().then(()=>gT),void 0)).polylineToGeoJSON(e)}]})})}back({geojson:e},t){return ve(async function({throwE:t}){let n=e.features.find(e=>e.geometry?.type===`LineString`);return n?{blob:QC((await ye(()=>Promise.resolve().then(()=>gT),void 0)).geoJSONToPolyline(n.geometry)),name:`line.poly`}:t(new _e(`Data does not contain a LineString to convert`))})}featureToString(e){return ve(async function({throwE:t}){let n=await ye(()=>Promise.resolve().then(()=>gT),void 0),{geometry:r}=e;return r?.type===`LineString`?n.geoJSONToPolyline(r):t(new _e(`Can only convert lines to polylines`))})}},Jye=i(((e,t)=>{function n(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}t.exports=n})),Yye=i(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),Xye=i(((e,t)=>{t.exports=Yye()()})),Zye=i(((e,t)=>{var n=Xye(),r=F_();function i(e,t){return e&&n(e,t,r)}t.exports=i})),Qye=i(((e,t)=>{var n=P_();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),$ye=i(((e,t)=>{var n=Zye();t.exports=Qye()(n)})),ebe=i(((e,t)=>{var n=$ye();function r(e,t,r,i){return n(e,function(e,n,a){t(i,e,r(e),a)}),i}t.exports=r})),tbe=i(((e,t)=>{var n=Jye(),r=ebe(),i=HS(),a=x_();function o(e,t){return function(o,s){var c=a(o)?n:r,l=t?t():{};return c(o,e,i(s,2),l)}}t.exports=o})),nbe=e(i(((e,t)=>{var n=sw(),r=tbe(),i=Object.prototype.hasOwnProperty;t.exports=r(function(e,t,r){i.call(e,r)?e[r].push(t):n(e,r,[t])})}))()),rbe={params:{init:{used:!0,param:`epsg:4326`},proj:{used:!0,param:`longlat`},datum:{used:!0,param:`WGS84`},no_defs:{used:!0,param:!0},ellps:{used:!0,param:`WGS84`},towgs84:{used:!0,param:`0,0,0`},a:{used:!0,param:`6378137.0`},rf:{used:!0,param:`298.257223563`}},is_latlong:!0,is_geocent:!1,is_long_wrap_set:!1,long_wrap_center:0,axis:`enu`,gridlist:null,gridlist_count:0,vgridlist_geoid:null,vgridlist_geoid_count:0,datum_params:[0,0,0,0,0,0,0],datum_type:1,es:.0066943799901413165,a:6378137,a_orig:6378137,es_orig:.0066943799901413165,e:.08181919084262149,ra:1.567855942887398e-7,one_es:.9933056200098587,rone_es:1.0067394967422765,geoc:!1,over:!1,has_geoid_vgrids:!1,lam0:0,phi0:0,x0:0,y0:0,k0:1,fr_meter:1,to_meter:1,vto_meter:1,vfr_meter:1,from_greenwich:0};function ibe(e){return typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}async function abe(e){let{importContent:t}=await ye(async()=>{let{importContent:e}=await import(`./mapshaper-import-C26F3gBW.js`).then(e=>e.n);return{importContent:e}},__vite__mapDeps([11,1,12,13,10,14])),{exportFileContent:n}=await ye(async()=>{let{exportFileContent:e}=await import(`./mapshaper-export-Dj4G7b2T.js`);return{exportFileContent:e}},__vite__mapDeps([15,12,13,1,10,14,16])),{projectDataset:r}=await ye(async()=>{let{projectDataset:e}=await import(`./mapshaper-proj-5MZUkinT.js`);return{projectDataset:e}},__vite__mapDeps([17,1,13,10,12,14,16,11])),{parsePrj:i}=await ye(async()=>{let{parsePrj:e}=await import(`./mapshaper-projections-Kq6IYFzA.js`).then(e=>e.c);return{parsePrj:e}},__vite__mapDeps([13,1,10,12])),a=t(e);return a.info?.prj&&r(a,i(a.info.prj),rbe,{}),me(n(a,{format:`geojson`})[0]?.content?.toString(`utf8`))}function obe(e){return e.type===`GeometryCollection`?{type:`FeatureCollection`,features:e.geometries.map(e=>({type:`Feature`,properties:{},geometry:e}))}:e}
138var sbe=new class{id=`shapefile`;label=[`ESRI Shapefile`];extensions=[`.zip`];filenames=[];mimes=[];forwardLoose(e,t){return ve(async function({fromPromise:t}){return $C(obe(await t(abe({shp:await e.files.shp.arrayBuffer().then(e=>({content:e})),shx:await e.files.shx?.arrayBuffer().then(e=>({content:e})),prj:await e.files.prj?.text().then(e=>({content:e})),cpg:await e.files.cpg?.text().then(e=>({content:e.trim()})),dbf:await e.files.dbf?.arrayBuffer().then(e=>({content:e}))}))))})}forwardBinary(e,t){return ve(async function({fromPromise:t}){let n=await Mye(e),{shp:r=[],cpg:i=[],shx:a=[],prj:o=[],dbf:s=[]}=(0,nbe.default)(Object.keys(n),e=>XC(e).replace(/^\./,``));function c(e){if(!e.length)return;let t=e.sort((e,t)=>e.length-t.length)[0];return{content:n[t].buffer}}function l(e){if(!e.length)return;let t=e.sort((e,t)=>e.length-t.length)[0],r=n[t];return{content:new TextDecoder().decode(r.buffer)}}return $C(obe(await t(abe({shp:c(r),shx:c(a),dbf:c(s),cpg:l(i),prj:l(o)}))))})}back({geojson:e},t){return ve(async function(){let{importContent:t}=await ye(async()=>{let{importContent:e}=await import(`./mapshaper-import-C26F3gBW.js`).then(e=>e.n);return{importContent:e}},__vite__mapDeps([11,1,12,13,10,14])),{exportFileContent:n}=await ye(async()=>{let{exportFileContent:e}=await import(`./mapshaper-export-Dj4G7b2T.js`);return{exportFileContent:e}},__vite__mapDeps([15,12,13,1,10,14,16])),r=await ye(()=>import(`./browser-DEYugRT4.js`),[]),i=n(t({json:{content:JSON.stringify(e),filename:`input.geojson`}}),{format:`shapefile`}),a=Object.fromEntries(i.map(e=>[e.filename,ibe(e.content)])),o=await new Promise((e,t)=>{r.zip(a,{},(n,r)=>{if(n)return t(n);e(r)})});return{blob:new Blob([o]),name:`shapefile.zip`}})}},cbe=new class{id=`tcx`;label=`TCX`;extensions=[`.tcx`];filenames=[];mimes=[];forwardBinary(e){return YC(e).chain(e=>cbe.forwardString(e))}forwardString(e){return ve(async function(){return $C((await ye(()=>import(`./togeojson.es-ZYLubihA.js`).then(e=>e.tcx),[]))(await ZC(e)))})}},WT=new class{id=`topojson`;label=`TopoJSON`;extensions=[`.topojson`,`.json`];filenames=[];mimes=[];forwardBinary(e,t){return YC(e).chain(e=>WT.forwardString(e))}forwardString(e,t){return ve(async function({liftEither:t,throwE:n}){let{feature:r}=await ye(async()=>{let{feature:e}=await import(`./src-CEmmLVNh.js`);return{feature:e}},[]),i=await t(me(e)),a=Object.keys(i.objects),o={type:`root`,root:{type:`root`,children:[]},notes:[]};try{for(let e of a){let t={type:`folder`,meta:{name:e},children:[]};o.root.children.push(t);let n=r(i,i.objects[e]);switch(n.type){case`Feature`:t.children.push(n);break;case`FeatureCollection`:for(let e of n.features)t.children.push(e)}}return o}catch{return n(new _e(`Could not read TopoJSON file`))}})}back({geojson:e}){return ve(async function({throwE:t}){let{topology:n}=await ye(async()=>{let{topology:e}=await import(`./src-DfUD_b4Y.js`);return{topology:e}},[]);try{return{blob:QC(JSON.stringify(n({objects:e}))),name:`features.json`}}catch{return t(new _e(`Could not convert GeoJSON to TopoJSON`))}})}},lbe=r({WKT:()=>ube}),ube=new class{id=`wkt`;label=`WKT`;extensions=[];filenames=[];mimes=[];forwardBinary(e){return YC(e).chain(e=>this.forwardString(e))}forwardString(e){return ve(async function({liftEither:t}){let n=await ye(()=>Promise.resolve().then(()=>cye).then(e=>e.wktToGeoJSON),void 0),r=await ye(()=>import(`./lib-DUWaNblE.js`),[]);return await t(le.encase(()=>n(e,{proj:(e,t,n)=>r.default(e,t,n)})).chainNullable(e=>e).toEither(new _e(`Could not convert WKT`)).chain(e=>nw(e)))})}featureToString(e){return ve(async function(){let t=await ye(()=>Promise.resolve().then(()=>cye).then(e=>e.geoJSONToWkt),void 0);return e.geometry===null?``:le.fromNullable(t(e.geometry)).orDefault(``)})}},dbe=new class{id=`xls`;label=`Excel (.xls, .xlsx)`;extensions=[`.xls`,`.xlsx`];filenames=[];mimes=[];forwardBinary(e,t){return ve(async function(){let{xlsxToGeoJSON:n}=await ye(async()=>{let{xlsxToGeoJSON:e}=await import(`./xlsx_to_geojson-_9vguEYf.js`);return{xlsxToGeoJSON:e}},__vite__mapDeps([18,19,12]));return $C(await n(e,t.csvOptions))})}},fbe=function(e){return e[e.NULL_GEOMETRY=0]=`NULL_GEOMETRY`,e}({}),pbe=[{value:`,`,label:`,`},{value:`;`,label:`;`},{value:`	`,label:`Tab`}],mbe=[{value:`lonlat`,label:`Coordinates`},{value:`zip`,label:`ZIP Codes`},{value:`h3`,label:`H3 Column`},{value:`wkt`,label:`WKT Column`},{value:`geojson`,label:`GeoJSON Column`},{value:`join`,label:`Join to geodata`},{value:`addresses`,label:`Addresses`},{value:`polyline`,label:`Encoded polylines`}],GT={coordinateStringOptions:{order:`LONLAT`},removeCoincidents:!0,csvOptions:{sheet:``,longitudeHeader:``,latitudeHeader:``,joinSourceHeader:``,joinTargetHeader:``,geometryHeader:``,zipHeader:``,h3Header:``,kind:`lonlat`,autoType:!0,delimiter:`,`,geocodingType:`search`,geocodingBehavior:0,geocodingHeaders:{text:``,address:``,neighbourhood:``,borough:``,locality:``,county:``,regi
138on:``,postalcode:``,country:``}}},hbe=[{value:`LONLAT`,label:`Longitude, Latitude`},{value:`LATLON`,label:`Latitude, longitude`}],gbe={winding:`RFC7946`,truncate:!0,addBboxes:!1,indent:!1,includeId:!1},KT=[Ime,hT,Gye,cbe,Vme,Vpe,dbe,UT,Bme,Hpe,ube,Hme,WT,zme,zpe,sbe,Wpe,Bpe,Kye];function _be(e){return(0,Lpe.default)(e)}async function vbe(e){return await ve(async function({liftEither:t,throwE:n}){let r=await t(me(await e.text()));return _be(r)?r.type===`Topology`?{...GT,type:WT.id}:typeof r.type==`string`&&N.has(r.type)?{...GT,type:Ime.id}:n(new ge(`Could not determine JSON type`)):n(new ge(`Could not determine JSON type`))}).run()}function qT(e){let t=KT.find(t=>t.id===e);if(!t)throw Error(`Type not found`);return t}async function ybe(e){return await ve(async({throwE:t,fromPromise:n})=>{let{name:r}=e,i=XC(r);if(i===`.json`)return await n(vbe(e));for(let t of KT)if(i&&t.extensions.includes(i)||t.mimes.includes(e.type)||t.filenames?.includes(r))return{...GT,type:t.id};return t(new ge(`Could not detect file type`))}).run()}async function bbe(...e){let t=qT(e[1].type);return`forwardString`in t?await t.forwardString(...e).run():ue(new _e(`Unsupported driver`))}function xbe(e){return`back`in qT(e.type)?{type:e.type,folderId:null}:null}function JT({featureMap:e,folderMap:t},n){return ve(async({throwE:r,fromPromise:i})=>{let a=qT(n.type);if(!(`back`in a))return r(new _e(`Unexpected missing type`));let{filteredFeatures:o,filteredFolders:s}=Mx.filterMapByFolder(e,t,n.folderId),c=Mx.toFeatureCollection(Array.from(o.values()));return{result:await i(a.back({geojson:c,featureMap:o,folderMap:s},n)),extensions:a.extensions}})}function YT({children:e}){return(0,H.jsxs)(`div`,{role:`alert`,className:`pt-1 text-sm flex items-start gap-x-1 text-red-700 dark:text-red-300`,children:[(0,H.jsx)(vn,{className:`shrink-0`,style:{marginTop:2}}),Array.isArray(e)?e.join(`, `):e]})}function XT({name:e,exportable:t=!1,textOnly:n=!1}){let r=KT.filter(e=>t&&!(`back`in e)?!1:n?`forwardString`in e:!0);return(0,H.jsx)(rg,{as:`select`,name:e,"aria-label":`File format`,className:`${Ig({size:`md`})}w-full`,children:r.map(e=>[e.label].flat().map((t,n)=>(0,H.jsx)(`option`,{value:e.id,children:t},`${e.id}-${n}`)))})}function ZT({exportable:e=!1,textOnly:t=!1}){let n=`type`;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`label`,{className:`block pt-2 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`text-sm text-gray-700 dark:text-gray-300 flex items-center justify-between`,children:[`File format`,(0,H.jsxs)(`a`,{target:`_blank`,className:`focus:underline hover:underline`,rel:`noreferrer`,href:`https://www.placemark.io/documentation-index`,children:[(0,H.jsx)(er,{className:`mr-1 inline-block`}),`Help`]})]}),(0,H.jsx)(XT,{name:n,exportable:e,textOnly:t})]}),(0,H.jsx)(sg,{name:n,component:YT})]})}function Sbe({root:e,featureMap:t}){let n=A_e({root:e,featureMap:t});return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`label`,{className:`block pt-2 space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-sm text-gray-700 dark:text-gray-300 flex items-center justify-between`,children:`Choose features`}),(0,H.jsx)(rg,{as:`select`,name:`folderId`,"aria-label":`File format`,className:`${Ig({size:`md`})}w-full`,children:n.map((e,t)=>(0,H.jsxs)(`option`,{value:e.meta.id,children:[e.meta.name,` (`,mv(`feature`,e.meta.count),`)`]},t))})]}),(0,H.jsx)(sg,{name:`folderId`,component:YT})]})}var Cbe={data:``},wbe=e=>{if(typeof window==`object`){let t=(e?e.querySelector(`#_goober`):window._goober)||Object.assign(document.createElement(`style`),{innerHTML:` `,id:`_goober`});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Cbe},Tbe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ebe=/\/\*[^]*?\*\/|  +/g,Dbe=/\n+/g,QT=(e,t)=>{let n=``,r=``,i=``;for(let a in e){let o=e[a];a[0]==`@`?a[1]==`i`?n=a+` `+o+`;`:r+=a[1]==`f`?QT(o,a):a+`{`+QT(o,a[1]==`k`?``:t)+`}`:typeof o==`object`?r+=QT(o,t?t.replace(/([^,])+/g,e=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+` `+t:t)):a):o!=null&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,`-$&`).toLowerCase(),i+=QT.p?QT.p(a,o):a+`:`+o+`;`)}return n+(t&&i?t+`{`+i+`}`:i)+r},$T={},Obe=e=>{if(typeof e==`object`){let t=``;for(let n in e)t+=n+Obe(e[n]);return t}return e},kbe=(e,t,n,r,i)=>{let a=Obe(e),o=$T[a]||($T[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return`go`+n})(a));if(!$T[o]){let t=a===e?(e=>{let t,n,r=[{}];for(;t=Tbe.exec(e.replace(Ebe,``));)t[4]?r.shift():t[3]?(n=t[3].replace(Dbe,` `).trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(Dbe,` `).trim();return r[0]})(e):e;$T[o]=QT(i?{[`@keyframes `+o]:t}:t,n?``:`.`+o)}let s=n&&$T.g?$T.g:null;return n&&($T.g=$T[o]),((e,t,n,r)=>{r?t.data=t.data.replace(r,e):t.data.indexOf(e)===-1&&(t.data=n?e+t.data:t.data+e)})($T[o],t,r,s),o}
138,Abe=(e,t,n)=>e.reduce((e,r,i)=>{let a=t[i];if(a&&a.call){let e=a(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?`.`+t:e&&typeof e==`object`?e.props?``:QT(e,``):!1===e?``:e}return e+r+(a??``)},``);function eE(e){let t=this||{},n=e.call?e(t.p):e;return kbe(n.unshift?n.raw?Abe(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,wbe(t.target),t.g,t.o,t.k)}var jbe,tE,nE;eE.bind({g:1});var rE=eE.bind({k:1});function Mbe(e,t,n,r){QT.p=t,jbe=e,tE=n,nE=r}function iE(e,t){let n=this||{};return function(){let r=arguments;function i(a,o){let s=Object.assign({},a),c=s.className||i.className;n.p=Object.assign({theme:tE&&tE()},s),n.o=/ *go\d+/.test(c),s.className=eE.apply(n,r)+(c?` `+c:``),t&&(s.ref=o);let l=e;return e[0]&&(l=s.as||e,delete s.as),nE&&l[0]&&nE(s),jbe(l,s)}return t?t(i):i}}var Nbe=e=>typeof e==`function`,aE=(e,t)=>Nbe(e)?e(t):e,Pbe=(()=>{let e=0;return()=>(++e).toString()})(),Fbe=(()=>{let e;return()=>{if(e===void 0&&typeof window<`u`){let t=matchMedia(`(prefers-reduced-motion: reduce)`);e=!t||t.matches}return e}})(),Ibe=20,oE=`default`,Lbe=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return Lbe(e,{type:+!!e.toasts.find(e=>e.id===r.id),toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(e=>e.id===i||i===void 0?{...e,dismissed:!0,visible:!1}:e)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+a}))}}},sE=[],Rbe={toasts:[],pausedAt:void 0,settings:{toastLimit:Ibe}},cE={},zbe=(e,t=oE)=>{cE[t]=Lbe(cE[t]||Rbe,e),sE.forEach(([e,n])=>{e===t&&n(cE[t])})},Bbe=e=>
138Object.keys(cE).forEach(t=>zbe(e,t)),Vbe=e=>Object.keys(cE).find(t=>cE[t].toasts.some(t=>t.id===e)),lE=(e=oE)=>t=>{zbe(t,e)},Hbe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Ube=(e={},t=oE)=>{let[n,r]=(0,B.useState)(cE[t]||Rbe),i=(0,B.useRef)(cE[t]);(0,B.useEffect)(()=>(i.current!==cE[t]&&r(cE[t]),sE.push([t,r]),()=>{let e=sE.findIndex(([e])=>e===t);e>-1&&sE.splice(e,1)}),[t]);let a=n.toasts.map(t=>({...e,...e[t.type],...t,removeDelay:t.removeDelay||e[t.type]?.removeDelay||e?.removeDelay,duration:t.duration||e[t.type]?.duration||e?.duration||Hbe[t.type],style:{...e.style,...e[t.type]?.style,...t.style}}));return{...n,toasts:a}},Wbe=(e,t=`blank`,n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:`status`,"aria-live":`polite`},message:e,pauseDuration:0,...n,id:n?.id||Pbe()}),uE=e=>(t,n)=>{let r=Wbe(t,e,n);return lE(r.toasterId||Vbe(r.id))({type:2,toast:r}),r.id},dE=(e,t)=>uE(`blank`)(e,t);dE.error=uE(`error`),dE.success=uE(`success`),dE.loading=uE(`loading`),dE.custom=uE(`custom`),dE.dismiss=(e,t)=>{let n={type:3,toastId:e};t?lE(t)(n):Bbe(n)},dE.dismissAll=e=>dE.dismiss(void 0,e),dE.remove=(e,t)=>{let n={type:4,toastId:e};t?lE(t)(n):Bbe(n)},dE.removeAll=e=>dE.remove(void 0,e),dE.promise=(e,t,n)=>{let r=dE.loading(t.loading,{...n,...n?.loading});return typeof e==`function`&&(e=e()),e.then(e=>{let i=t.success?aE(t.success,e):void 0;return i?dE.success(i,{id:r,...n,...n?.success}):dE.dismiss(r),e}).catch(e=>{let i=t.error?aE(t.error,e):void 0;i?dE.error(i,{id:r,...n,...n?.error}):dE.dismiss(r)}),e};var Gbe=1e3,Kbe=(e,t=`default`)=>{let{toasts:n,pausedAt:r}=Ube(e,t),i=(0,B.useRef)(new Map).current,a=(0,B.useCallback)((e,t=Gbe)=>{if(i.has(e))return;let n=setTimeout(()=>{i.delete(e),o({type:4,toastId:e})},t);i.set(e,n)},[]);(0,B.useEffect)(()=>{if(r)return;let e=Date.now(),i=n.map(n=>{if(n.duration===1/0)return;let r=(n.duration||0)+n.pauseDuration-(e-n.createdAt);if(r<0){n.visible&&dE.dismiss(n.id);return}return setTimeout(()=>dE.dismiss(n.id,t),r)});return()=>{i.forEach(e=>e&&clearTimeout(e))}},[n,r,t]);let o=(0,B.useCallback)(lE(t),[t]),s=(0,B.useCallback)(()=>{o({type:5,time:Date.now()})},[o]),c=(0,B.useCallback)((e,t)=>{o({type:1,toast:{id:e,height:t}})},[o]),l=(0,B.useCallback)(()=>{r&&o({type:6,time:Date.now()})},[r,o]),u=(0,B.useCallback)((e,t)=>{let{reverseOrder:r=!1,gutter:i=8,defaultPosition:a}=t||{},o=n.filter(t=>(t.position||a)===(e.position||a)&&t.height),s=o.findIndex(t=>t.id===e.id),c=o.filter((e,t)=>t<s&&e.visible).length;return o.filter(e=>e.visible).slice(...r?[c+1]:[0,c]).reduce((e,t)=>e+(t.height||0)+i,0)},[n]);return(0,B.useEffect)(()=>{n.forEach(e=>{if(e.dismissed)a(e.id,e.removeDelay);else{let t=i.get(e.id);t&&(clearTimeout(t),i.delete(e.id))}})},[n,a]),{toasts:n,handlers:{updateHeight:c,startPause:s,endPause:l,calculateOffset:u}}},qbe=rE`
139from {
140  transform: scale(0) rotate(45deg);
141	opacity: 0;
142}
143to {
144 transform: scale(1) rotate(45deg);
145  opacity: 1;
146}`,Jbe=rE`
147from {
148  transform: scale(0);
149  opacity: 0;
150}
151to {
152  transform: scale(1);
153  opacity: 1;
154}`,Ybe=rE`
155from {
156  transform: scale(0) rotate(90deg);
157	opacity: 0;
158}
159to {
160  transform: scale(1) rotate(90deg);
161	opacity: 1;
162}`,Xbe=iE(`div`)`
163  width: 20px;
164  opacity: 0;
165  height: 20px;
166  border-radius: 10px;
167  background: ${e=>e.primary||`#ff4b4b`};
168  position: relative;
169  transform: rotate(45deg);
170
171  animation: ${qbe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
172    forwards;
173  animation-delay: 100ms;
174
175  &:after,
176  &:before {
177    content: '';
178    animation: ${Jbe} 0.15s ease-out forwards;
179    animation-delay: 150ms;
180    position: absolute;
181    border-radius: 3px;
182    opacity: 0;
183    background: ${e=>e.secondary||`#fff`};
184    bottom: 9px;
185    left: 4px;
186    height: 2px;
187    width: 12px;
188  }
189
190  &:before {
191    animation: ${Ybe} 0.15s ease-out forwards;
192    animation-delay: 180ms;
193    transform: rotate(90deg);
194  }
195`,Zbe=rE`
196  from {
197    transform: rotate(0deg);
198  }
199  to {
200    transform: rotate(360deg);
201  }
202`,Qbe=iE(`div`)`
203  width: 12px;
204  height: 12px;
205  box-sizing: border-box;
206  border: 2px solid;
207  border-radius: 100%;
208  border-color: ${e=>e.secondary||`#e0e0e0`};
209  border-right-color: ${e=>e.primary||`#616161`};
210  animation: ${Zbe} 1s linear infinite;
211`,$be=rE`
212from {
213  transform: scale(0) rotate(45deg);
214	opacity: 0;
215}
216to {
217  transform: scale(1) rotate(45deg);
218	opacity: 1;
219}`,exe=rE`
2200% {
221	height: 0;
222	width: 0;
223	opacity: 0;
224}
22540% {
226  height: 0;
227	width: 6px;
228	opacity: 1;
229}
230100% {
231  opacity: 1;
232  height: 10px;
233}`,txe=iE(`div`)`
234  width: 20px;
235  opacity: 0;
236  height: 20px;
237  border-radius: 10px;
238  background: ${e=>e.primary||`#61d345`};
239  position: relative;
240  transform: rotate(45deg);
241
242  animation: ${$be} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
243    forwards;
244  animation-delay: 100ms;
245  &:after {
246    content: '';
247    box-sizing: border-box;
248    animation: ${exe} 0.2s ease-out forwards;
249    opacity: 0;
250    animation-delay: 200ms;
251    position: absolute;
252    border-right: 2px solid;
253    border-bottom: 2px solid;
254    border-color: ${e=>e.secondary||`#fff`};
255    bottom: 6px;
256    left: 6px;
257    height: 10px;
258    width: 6px;
259  }
260`,nxe=iE(`div`)`
261  position: absolute;
262`,rxe=iE(`div`)`
263  position: relative;
264  display: flex;
265  justify-content: center;
266  align-items: center;
267  min-width: 20px;
268  min-height: 20px;
269`,ixe=rE`
270from {
271  transform: scale(0.6);
272  opacity: 0.4;
273}
274to {
275  transform: scale(1);
276  opacity: 1;
277}`,axe=iE(`div`)`
278  position: relative;
279  transform: scale(0.6);
280  opacity: 0.4;
281  min-width: 20px;
282  animation: ${ixe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
283    forwards;
284`,oxe=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t===void 0?n===`blank`?null:B.createElement(rxe,null,B.createElement(Qbe,{...r}),n!==`loading`&&B.createElement(nxe,null,n===`error`?B.createElement(Xbe,{...r}):B.createElement(txe,{...r}))):typeof t==`string`?B.createElement(axe,null,t):t},sxe=e=>`
2850% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
286100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
287`,cxe=e=>`
2880% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
289100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
290`,lxe=`0%{opacity:0;} 100%{opacity:1;}`,uxe=`0%{opacity:1;} 100%{opacity:0;}`,dxe=iE(`div`)`
291  display: flex;
292  align-items: center;
293  background: #fff;
294  color: #363636;
295  line-height: 1.3;
296  will-change: transform;
297  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
298  max-width: 350px;
299  pointer-events: auto;
300  padding: 8px 10px;
301  border-radius: 8px;
302`,fxe=iE(`div`)`
303  display: flex;
304  justify-content: center;
305  margin: 4px 10px;
306  color: inherit;
307  flex: 1 1 auto;
308  white-space: pre-line;
309`,pxe=(e,t)=>{let n=e.includes(`top`)?1:-1,[r,i]=Fbe()?[lxe,uxe]:[sxe(n),cxe(n)];return{animation:t?`${rE(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${rE(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},mxe=B.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?pxe(e.position||t||`top-center`,e.visible):{opacity:0},a=B.createElement(oxe,{toast:e}),o=B.createElement(fxe,{...e.ariaProps},aE(e.message,e));return B.createElement(dxe,{className:e.className,style:{...i,...n,...e.style}},typeof r==`function`?r({icon:a,message:o}):B.createElement(B.Fragment,null,a,o))});Mbe(B.createElement);var hxe=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let a=B.useCallback(t=>{if(t){let n=()=>{let n=t.getBoundingClientRect().height;r(e,n)};n(),new MutationObserver(n).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return B.createElement(`div`,{ref:a,className:t,style:n},i)},gxe=(e,t)=>{let n=e.includes(`top`),r=n?{top:0}:{bottom:0},i=e.includes(`center`)?{justifyContent:`center`}:e.includes(`right`)?{justifyContent:`flex-end`}:{};return{left:0,right:0,display:`flex`,position:`absolute`,transition:Fbe()?void 0:`all 230ms cubic-bezier(.21,1.02,.73,1)`,transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},_xe=eE`
310  z-index: 9999;
311  > * {
312    pointer-events: auto;
313  }
314`,fE=16,vxe=({reverseOrder:e,position:t=`top-center`,toastOptions:n,gutter:r,children:i,toasterId:a,containerStyle:o,containerClassName:s})=>{let{toasts:c,handlers:l}=Kbe(n,a);return B.createElement(`div`,{"data-rht-toaster":a||``,style:{position:`fixed`,zIndex:9999,top:fE,left:fE,right:fE,bottom:fE,pointerEvents:`none`,...o},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},c.map(n=>{let a=n.position||t,o=gxe(a,l.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return B.createElement(hxe,{id:n.id,key:n.id,onHeightUpdate:l.updateHeight,className:n.visible?_xe:``,style:o},n.type===`custom`?aE(n.message,n):i?i(n):B.createElement(mxe,{toast:n,position:a}))}))},pE=dE;function yxe(e,t){let n=document.createElement(`a`);n.download=`untitled${t.extensions[0]||``}`,n.href=URL.createObjectURL(e.result.blob),n.addEventListener(`click`,()=>{setTimeout(()=>URL.revokeObjectURL(n.href),30*1e3)}),n.click()}function bxe({root:e,featureMap:t,values:n}){let r=A_e({root:e,featureMap:t}).find(e=>e.meta.id===(n.folderId||null)),i=0,a=new Set([`Point`,`MultiPoint`]);if(r)for(let e of r.children)e.type===`Feature`&&(!e.geometry?.type||!a.has(e.geometry?.type))&&i++;return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Geometry representation`})}),(0,H.jsxs)(rg,{as:`select`,className:Ig({size:`sm`}),name:`csvOptions.kind`,children:[(0,H.jsx)(`option`,{value:`lonlat`,children:`Longitude & latitude columns`}),(0,H.jsx)(`option`,{value:`wkt`,children:`WKT Column`}),(0,H.jsx)(`option`,{value:`geojson`,children:`GeoJSON Column`}),(0,H.jsx)(`option`,{value:`polyline`,children:`Polyline Column`})]})]}),n.csvOptions?.kind===`lonlat`&&i?(0,H.jsxs)(Vg,{variant:`destructive`,children:[`CSV exports as "Longitude & latitude columns" will only include Point & MultiPoint features. This export will be missing`,` `,mv(`feature`,i),`. To export those features as well, choose a different Geometry representation.`]}):null,n.csvOptions?.kind===`polyline`?(0,H.jsx)(Vg,{variant:`destructive`,children:`Exporting as polyline will only include LineString geometries, because other geometries don’t have a representation as encoded polylines.`}):null]})}function xxe(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`label`,{className:`flex items-center`,children:[(0,H.jsx)(dg,{type:`checkbox`,name:`geojsonOptions.truncate`}),(0,H.jsx)(`div`,{className:`pl-2 text-sm`,children:`Truncate coordinates`})]}),(0,H.jsx)(Vg,{children:`Limits coordinate precision to 6 decimal places, 10cm precision.`})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`label`,{className:`flex items-center`,children:[(0,H.jsx)(dg,{type:`checkbox`,name:`geojsonOptions.indent`}),(0,H.jsx)(`div`,{className:`pl-2 text-sm`,children:`Indent & format`})]}),(0,H.jsx)(Vg,{children:`Make this file more readable by indenting objects and adding linebreaks.`})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`label`,{className:`flex items-center`,children:[(0,H.jsx)(dg,{type:`checkbox`,name:`geojsonOptions.addBboxes`}),(0,H.jsx)(`div`,{className:`pl-2 text-sm`,children:`Add BBOX to features`})]}),(0,H.jsxs)(Vg,{children:[`Adds a `,(0,H.jsx)(`code`,{children:`bbox`}),` property to each Feature. This can be useful if another application wants to speed up search and indexing.`]})]}),(0,H.jsxs)(Di,{children:[(0,H.jsx)(Oi,{asChild:!0,children:(0,H.jsx)(Fg,{size:`xs`,children:`Advanced options`})}),(0,H.jsxs)(ki,{className:`space-y-2 pl-2 pt-4`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`label`,{className:`flex items-center`,children:[(0,H.jsxs)(rg,{as:`select`,className:Ig({size:`sm`}),name:`geojsonOptions.winding`,children:[(0,H.jsx)(`option`,{value:`RFC7946`,children:`RFC7946`}),(0,H.jsx)(`option`,{value:`d3`,children:`D3`})]}),(0,H.jsx)(`div`,{className:`pl-2 text-sm`,children:`Winding order`})]}),(0,H.jsxs)(Vg,{children:[`Advanced option: use the default for GeoJSON’s standard winding order. You can use the opposite for compatibility with d3-geo, which expects the opposite. You almost certainly want the default, unless you are having issues using exported files with d3-geo.`,(0,H.jsx)(`br`,{}),(0,H.jsxs)(`a`,{target:`_blank`,className:`underline`,rel:`noreferrer`,href:`https://www.placemark.io/documentation/winding-order`,children:[(0,H.jsx)(er,{className:`mr-1 inline-block`}),`Winding order documentation`]})]})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`label`,{className:`flex items-center`,children:[(0,H.jsx)(dg,{type:`checkbox`,name:`geojsonOptions.includeId`}),(0,H.jsx)(`div`,{className:`pl-2 text-sm`,children:`Include @id`})]}),(0,H.jsxs)(Vg,{children:[`Adds an `,(0,H.jsx)(`code`,{children:`@id`}),` property to each Feature.`]})]})]})]})]})}function Sxe({onClose:e}){let t=Yv(Wx),n=D_e(t),r=Xv(rS);async function i(n,i){let{fileSave:a,supported:o}=await ye(async()=>{let{fileSave:e,supported:t}=await Promise.resolve().then(()=>J9);return{fileSave:e,supported:t}},void 0);try{let s=qT(n.type);if(o){let e=await r_.fromGeoJSON(t,n);if(e.isLeft()){e.ifLeft(e=>{i.setErrors({type:e.message})});return}let o=e.map(e=>e.result.blob).orDefaultLazy(()=>new Blob);try{let e=await a(o,{extensions:s.extensions,description:`Save file`,mimeTypes:[`application/octet-stream`]},null);e&&r({handle:e,options:n})}catch{}}else await JT(t,n).ifRight(e=>{yxe(e,qT(n.type))}).ifLeft(e=>{i.setErrors({type:e.message})}).run();pE.success(`Saved`),e()}catch{}}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Export`,titleIcon:Yt}),(0,H.jsx)(eg,{onSubmit:i,initialValues:{type:`geojson`,folderId:``,geojsonOptions:gbe,csvOptions:GT.csvOptions},children:({values:r})=>(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(Sbe,{root:n,featureMap:t.featureMap}),(0,H.jsx)(ZT,{exportable:!0}),r.type===`geojson`?(0,H.jsx)(xxe,{}):null,r.type===`csv`?(0,H.jsx)(bxe,{root:n,featureMap:t.featureMap,values:r}):null]}),(0,H.jsx)(Ug,{onClose:e,action:`Export`})]})})})]})}var Cxe=(0,nv.default)(()=>{dE.error(`Offline: falling back to blank background`)}),wxe={version:8,name:`Empty`,glyphs:`https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf`,sources:{},layers:[]};async function Txe(e){return fetch(e).then(e=>{if(!e.ok)throw Error(`Could not fetch layer`);return e.json()}).catch(()=>(Cxe(),wxe))}async function Exe(e,t){return Dxe(await Txe(t.url),{labelVisibility:t.labelVisibility,rasterOpacity:t.opacity,visibility:t.visibility})}function Dxe(e,t){let{labelVisibility:n=!0,rasterOpacity:r,visibility:i=!0}=t;
314if(!e.layers)return e;let a=e.layers.map(e=>{let t=e.type===`symbol`&&e.layout?.[`text-field`]!==void 0;return!n&&t?null:i?e.type===`raster`&&r!==void 0?{...e,paint:{...e.paint||{},"raster-opacity":r}}:e:{...e,layout:{...e.layout,visibility:`none`}}}).filter(Boolean);return{...e,layers:a}}function Oxe(e){return{type:`raster`,paint:{"raster-opacity":e.opacity},layout:{visibility:e.visibility?`visible`:`none`}}}async function kxe(e,t,n){let r=`placemarkInternalSource${n}`,i=`placemarkInternalLayer${n}`;try{let n=await _v(t.url);e.sources[r]={type:`raster`,tiles:n.tiles,scheme:n.scheme||`xyz`,tileSize:256,minzoom:n.minzoom,maxzoom:n.maxzoom};let a={id:i,source:r,...Oxe(t)};e.layers.push(a)}catch{dE.error(`A TileJSON layer failed to load: the server it depends on may be down`)}return e}function Axe(e,t,n){let r=`placemarkInternalSource${n}`,i=`placemarkInternalLayer${n}`;e.sources[r]={type:`raster`,tiles:[t.url],scheme:t.tms?`tms`:`xyz`,tileSize:256};let a={id:i,source:r,...Oxe(t)};return e.layers.push(a),e}function jxe(){return{version:8,name:`XYZ Layer`,glyphs:`https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf`,sources:{},layers:[]}}var Mxe={},mE=`features`,hE=`lasso`,gE=`ephemeral`,_E=`synthetic`,Nxe=`ephemeral-line`,Pxe=`ephemeral-fill`,Fxe=`features-symbol-halo`,vE=`features-symbol`,Ixe=`features-point-label`,Lxe=`features-fill-label`,Rxe=`features-line-label`,yE=`features-line`,bE=`features-fill`,zxe=`lasso-layer`,xE=`synthetic-points`,SE={type:`geojson`,data:s,buffer:4,tolerance:0},CE={[yE]:[`any`,[`==`,`$type`,`LineString`],[`==`,`$type`,`Polygon`]],[bE]:[`==`,`$type`,`Polygon`],[vE]:[`all`,[`==`,`$type`,`Point`]]};function wE(e,t){return t?[`all`,e,[`has`,t]]:e}async function Bxe({layerConfigs:e,symbolization:t,previewProperty:n}){let r=jxe(),i=0,a=[...e.values()].reverse();for(let e of a)switch(i++,e.type){case`STYLE`:r=await Exe(r,e);break;case`XYZ`:r=Axe(r,e,i);break;case`TILEJSON`:r=await kxe(r,e,i);break}return Vxe({style:r,symbolization:t,previewProperty:n}),r}function Vxe({style:e,symbolization:t,previewProperty:n}){if(e.sources[mE]=SE,e.sources[gE]=SE,e.sources[hE]=SE,e.sources[_E]=SE,!e.layers)throw Error(`Style unexpectedly had no layers`);e.layers=e.layers.concat(Hxe({symbolization:t,previewProperty:n}))}function Hxe({symbolization:e,previewProperty:t}){return[{id:bE,type:`fill`,source:mE,filter:CE[bE],paint:AE(e)},{id:yE,type:`line`,source:mE,filter:CE[yE],paint:jE(e)},{id:Pxe,type:`fill`,source:gE,filter:[`==`,`$type`,`Polygon`],paint:AE(e)},{id:Nxe,type:`line`,source:gE,filter:[`any`,[`==`,`$type`,`LineString`],[`==`,`$type`,`Polygon`]],paint:jE(e)},{id:Fxe,type:`circle`,source:mE,layout:Mxe,filter:CE[vE],paint:kE(e,!0)},{id:vE,type:`circle`,source:mE,layout:Mxe,filter:CE[vE],paint:kE(e)},{id:zxe,type:`fill`,source:hE,filter:[`==`,`$type`,`Polygon`],paint:{"fill-opacity":.5,"fill-color":`#FDE68A`,"fill-outline-color":`#905803`}},{id:xE,type:`circle`,source:_E,paint:{"circle-color":[`case`,[`get`,`selected`],`#ffffff`,O],"circle-stroke-color":[`case`,[`get`,`selected`],O,`#ffffff`],"circle-stroke-width":1.5,"circle-radius":[`case`,[`has`,`fp`],10,[`==`,[`%`,[`id`],2],0],5,3.5]}},...typeof t==`string`?[{id:Ixe,type:`symbol`,source:mE,paint:DE(e,t),layout:OE(t,`point`),filter:wE(CE[vE],t)},{id:Rxe,type:`symbol`,source:mE,paint:DE(e,t),layout:OE(t,`line`),filter:wE(CE[yE],t)},{id:Lxe,type:`symbol`,source:mE,paint:DE(e,t),layout:OE(t,`point`),filter:wE(CE[bE],t)}]:[]]}function TE({symbolization:e,defaultValue:t=2,part:n}){return e.simplestyle?[`coalesce`,[`get`,n],t]:t}function EE({symbolization:e,part:t=`fill`}){let n=Uxe({symbolization:e});return e.simplestyle?[`coalesce`,[`get`,t],n]:n}function Uxe({symbolization:e}){let{defaultColor:t}=e;switch(e.type){case`none`:return t;case`categorical`:return[`match`,[`get`,e.property],...e.stops.flatMap(e=>[e.input,e.output]),t];case`ramp`:return[`match`,[`typeof`,[`get`,e.property]],`number`,e.interpolate===`linear`?[`interpolate-lab`,[`linear`],[`get`,e.property],...e.stops.flatMap(e=>[e.input,e.output])]:[`step`,[`get`,e.property],t,...e.stops.flatMap(e=>[e.input,e.output])],t]}}function DE(e,t){return{"text-halo-color":`#fff`,"text-halo-width":1,"text-halo-blur":.8}}function OE(e,t){return{"text-field":[`get`,e],"text-variable-anchor":[`top`,`bottom`,`left`,`right`],"text-radial-offset":.5,"symbol-placement":t,"icon-optional":!0,"text-size":13,"text-justify":`auto`}}function kE(e,t=!1){let n=t?2:0;
314return t?{"circle-color":[`match`,[`feature-state`,`state`],`selected`,`white`,EE({symbolization:e,part:`stroke`})],"circle-radius":[`match`,[`feature-state`,`state`],`selected`,6+n,4+n]}:{"circle-stroke-color":[`match`,[`feature-state`,`state`],`selected`,O,`white`],"circle-stroke-width":1,"circle-radius":[`match`,[`feature-state`,`state`],`selected`,6,4],"circle-opacity":1,"circle-color":[`match`,[`feature-state`,`state`],`selected`,`white`,EE({symbolization:e,part:`stroke`})]}}function Wxe(e,t=!1,n){return t?e:[`match`,[`feature-state`,`state`],`selected`,n,e]}function AE(e,t=!1){return{"fill-opacity":TE({symbolization:e,part:`fill-opacity`,defaultValue:typeof e.defaultOpacity==`number`?e.defaultOpacity:.3}),"fill-color":Wxe(EE({symbolization:e,part:`fill`}),t,O)}}function jE(e,t=!1){return{"line-opacity":TE({symbolization:e,part:`stroke-opacity`,defaultValue:1}),"line-width":TE({symbolization:e,part:`stroke-width`,defaultValue:2}),"line-color":Wxe(EE({symbolization:e,part:`stroke`}),t,O)}}var ME=[vE,bE,yE,Pxe,xE];function Gxe({symbolization:e}){return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`textarea`,{className:yg,rows:10,value:JSON.stringify(EE({symbolization:e}),null,2)}),(0,H.jsxs)(Vg,{children:[`This code can be used as a`,` `,(0,H.jsx)(`a`,{href:`https://maplibre.org/maplibre-style-spec/expressions/`,target:`_blank`,className:Tg,rel:`nofollow noreferrer`,children:`MapLibre Style Expression`}),`, in a raw JSON style for MapLibre.`]})]})}function Kxe({onClose:e}){let[t]=i_().useMetadata(),{symbolization:n}=t;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Export style expression`,titleIcon:Yt}),n?(0,H.jsx)(Gxe,{symbolization:n}):(0,H.jsx)(`div`,{children:`There is no symbolization to copy for this feature.`}),(0,H.jsx)(`div`,{className:`pt-6 pb-1 flex flex-col sm:flex-row-reverse space-y-2 sm:space-y-0 sm:gap-x-3`,children:(0,H.jsx)(Fg,{type:`button`,onClick:e,children:`Done`})})]})}var qxe={$version:8,$root:{version:{required:!0,type:`enum`,values:[8]},name:{type:`string`},metadata:{type:`*`},center:{type:`array`,value:`number`,length:2},centerAltitude:{type:`number`},zoom:{type:`number`},bearing:{type:`number`,default:0,period:360,units:`degrees`},pitch:{type:`number`,default:0,units:`degrees`},roll:{type:`number`,default:0,units:`degrees`},state:{type:`state`,default:{}},light:{type:`light`},sky:{type:`sky`},projection:{type:`projection`},terrain:{type:`terrain`},sources:{required:!0,type:`sources`},sprite:{type:`sprite`},glyphs:{type:`string`},"font-faces":{type:`fontFaces`},transition:{type:`transition`},layers:{required:!0,type:`array`,value:`layer`}},sources:{"*":{type:`source`}},source:[`source_vector`,`source_raster`,`source_raster_dem`,`source_geojson`,`source_video`,`source_image`],source_vector:{type:{required:!0,type:`enum`,values:{vector:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},attribution:{type:`string`},promoteId:{type:`promoteId`},volatile:{type:`boolean`,default:!1},encoding:{type:`enum`,values:{mvt:{},mlt:{}},default:`mvt`},"*":{type:`*`}},source_raster:{type:{required:!0,type:`enum`,values:{raster:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},attribution:{type:`string`},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_raster_dem:{type:{required:!0,type:`enum`,values:{"raster-dem":{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},attribution:{type:`string`},encoding:{type:`enum`,values:{terrarium:{},mapbox:{},custom:{}},default:`mapbox`},redFactor:{type:`number`,default:1},blueFactor:{type:`number`,default:1},greenFactor:{type:`number`,default:1},baseShift:{type:`number`,default:0},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_geojson:{type:{required:!0,type:`enum`,values:{geojson:{}}},data:{required:!0,type:`*`},maxzoom:{type:`number`,default:18},attribution:{type:`string`},buffer:{type:`number`,default:128,maximum:512,minimum:0},filter:{type:`filter`},tolerance:{type:`number`,default:.375},cluster:{type:`boolean`,default:!1},clusterRadius:{type:`number`,default:50,minimum:0}
vendor: 5,100 bytes, line 314
314,clusterMaxZoom:{type:`number`},clusterMinPoints:{type:`number`},clusterProperties:{type:`*`},lineMetrics:{type:`boolean`,default:!1},generateId:{type:`boolean`,default:!1},promoteId:{type:`promoteId`}},source_video:{type:{required:!0,type:`enum`,values:{video:{}}},urls:{required:!0,type:`array`,value:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},source_image:{type:{required:!0,type:`enum`,values:{image:{}}},url:{required:!0,type:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},layer:{id:{type:`string`,required:!0},type:{type:`enum`,values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:`*`},source:{type:`string`},"source-layer":{type:`string`},minzoom:{type:`number`,minimum:0,maximum:24},maxzoom:{type:`number`,minimum:0,maximum:24},filter:{type:`filter`},layout:{type:`layout`},paint:{type:`paint`}},layout:[`layout_fill`,`layout_line`,`layout_circle`,`layout_heatmap`,`layout_fill-extrusion`,`layout_symbol`,`layout_raster`,`layout_hillshade`,`layout_color-relief`,`layout_background`],layout_background:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_fill:{"fill-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_circle:{"circle-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_heatmap:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},"layout_fill-extrusion":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`},"fill-extrusion-rounded-corner-distance":{type:`number`,default:0,minimum:0,units:`meters`,"property-type":`constant`}},layout_line:{"line-cap":{type:`enum`,values:{butt:{},round:{},square:{}},default:`butt`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-join":{type:`enum`,values:{bevel:{},round:{},miter:{}},default:`miter`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-miter-limit":{type:`number`,default:2,requires:[{"line-join":`miter`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-round-limit":{type:`number`,default:1.05,requires:[{"line-join":`round`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_symbol:{"symbol-placement":{type:`enum`,values:{point:{},line:{},"line-center":{}},default:`point`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-spacing":{type:`number`,default:250,minimum:1,units:`pixels`,requires:[{"symbol-placement":`line`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-avoid-edges":{type:`boolean`,default:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"symbol-z-order":{type:`enum`,values:{auto:{},"viewport-y":{},source:{}},default:`auto`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-allow-overlap":{type:`boolean`,default:!1,requires:[`icon-image`,{"!":`icon-overlap`}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-overlap":{type:`enum`,values:{never:{},always:{},cooperative:{}},requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-ignore-placement":{type:`boolean`,default:!1,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-optional":{type:`boolean`,default:!1,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant
vendor: 13,264 bytes, line 314
314`},"icon-size":{type:`number`,default:1,minimum:0,units:`factor of the original icon size`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-text-fit":{type:`enum`,values:{none:{},width:{},height:{},both:{}},default:`none`,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-text-fit-padding":{type:`array`,value:`number`,length:4,default:[0,0,0,0],units:`pixels`,requires:[`icon-image`,`text-field`,{"icon-text-fit":[`both`,`width`,`height`]}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-image":{type:`resolvedImage`,tokens:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-rotate":{type:`number`,default:0,period:360,units:`degrees`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-padding":{type:`padding`,default:[2],units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-keep-upright":{type:`boolean`,default:!1,requires:[`icon-image`,{"icon-rotation-alignment":`map`},{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-offset":{type:`array`,value:`number`,length:2,default:[0,0],requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-anchor":{type:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:`center`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-pitch-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-pitch-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:`auto`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-field":{type:`formatted`,default:``,tokens:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-font":{type:`array`,value:`string`,default:[`Open Sans Regular`,`Arial Unicode MS Regular`],requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-size":{type:`number`,default:16,minimum:0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-max-width":{type:`number`,default:10,minimum:0,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-line-height":{type:`number`,default:1.2,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-letter-spacing":{type:`number`,default:0,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-justify":{type:`enum`,values:{auto:{},left:{},center:{},right:{}},default:`center`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-radial-offset":{type:`number`,units:`ems`,default:0,requires:[`text-field`],"property-type":`data-driven`,expression:{interpolated:!0,parameters:[`zoom`,`feature`]}},"text-variable-anchor":{type:`array`,value:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-variable-anchor-offset":{type:`variableAnchorOffsetCollection`,requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-anchor":{type:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:`center`,requires:[`text-field`,{"!":`text-variable-anchor`}],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-max-angle":{type:`number`,default:45,units:`degrees`,requires:[`text-field`,{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-writing-mode":{type:`array`,value:`enum`,values:{horizontal:{},vertical:{}},requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-rotate":{type:`number`,default:0,period:360,units:`degrees`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-padding":{type:`number`,default:2,minimum:0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-keep-upright":{type:`boolean`,default:!0,requires:[`text-field`,{"text-rotation-alignment":`map`},{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-transform":{type:`enum`,values:{none:{},uppercase:{},lowercase:{}},default:`none`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-offset":{type:`array`,value:`number`,units:`ems`,length:2,default:[0,0],requires:[`text-field`,{"!":`text-radial-offset`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-allow-overlap":{type:`boolean`,default:!1,requires:[`text-field`,{"!":`text-overlap`}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-overlap":{type:`enum`,values:{never:{},always:{},cooperative:{}},requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-ignore-placement":{type:`boolean`,default:!1,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-optional":{type:`boolean`,default:!1,requires:[`text-field`,`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-height-offset":{type:`number`,default:0,units:`meters`,requires:[{"symbol-placement":[`point`]}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"symbol-height-anchor":{type:`enum`,values:{ground:{},absolute:{}},default:`ground`,requires:[`symbol-height-offset`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_raster:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_hillshade:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},"layout_color-relief":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},filter:{type:`boolean`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},filter_operator:{type:`enum`,values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:`enum`,values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:`expression`},stops:{type:`array`,value:`function_stop`},base:{type:`number`,default:1,minimum:0},property:{type:`string`,default:`$zoom`},type:{type:`enum`,values:{identity:{},exponential:{},interval:{},categorical:{}},default:`exponential`},colorSpace:{type:`enum`,values:{rgb:{},lab:{},hcl:{}},default:`rgb`},default:{type:`*`,required:!1}},function_stop:{type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2},expression:{type:`array`,value:`expression_name`,minimum:1},light:{anchor:{type:`enum`,default:`viewport`,values:{map:{},viewport:{}},"property-type":`data-constant`,transition:!1,expression:{interpolated:!1,parameters:[`zoom`]}},position:{type:`array`,default:[1.15,210,30],length:3,value:`number`,"property-type":`data-constant`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]}},color:{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},intensity:{type:`number`,"property-type":`data-constant`,default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0}},sky:{"sky-color":{type:`color`,"property-type":`data-constant`,default:`#88C6FC`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"horizon-color":{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"fog-color":{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"fog-ground-blend":{type:`number`,"property-type":`data-constant`,default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"horizon-fog-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"sky-horizon-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"atmosphere-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0}},terrain:{source:{type:`string`,required:!0},exaggeration:{type:`number`,minimum:0,default:1}},projection:{type:{type:`projectionDefinition`,default:`mercator`,"property-type":`data-constant`,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]}}},paint:[`paint_fill`,`paint_line`,`paint_circle`,`paint_heatmap`,`paint_fill-extrusion`,`paint_symbol`,`paint_raster`,`paint_hillshade`,`paint_color-relief`,`paint_background`],paint_fill:{"fill-antialias":{type:`boolean`,default:!0,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-layer-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`global-state`]},"property-type":`data-constant`},"fill-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-outline-color":{type:`color`,transition:!0,requires:[{"!":`fill-pattern`},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`fill-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`fill-extrusion-pattern`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`fill-extrusion-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"fill-extrusion-height":{type:`number`,default:0,
vendor: 897 bytes, line 314
314minimum:0,units:`meters`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-base":{type:`number`,default:0,minimum:0,units:`meters`,transition:!0,requires:[`fill-extrusion-height`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-vertical-gradient":{type:`boolean`,default:!0,transition:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_line:{"line-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-layer-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`global-state`]},"property-type":`data-constant
vendor: 12,722 bytes, line 314
314`},"line-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`line-pattern`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"line-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`line-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"line-width":{type:`number`,default:1,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-gap-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-offset":{type:`number`,default:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-dasharray":{type:`array`,value:`number`,minimum:0,transition:!0,units:`line widths`,requires:[{"!":`line-pattern`}],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"line-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"line-gradient":{type:`color`,transition:!1,requires:[{"!":`line-dasharray`},{"!":`line-pattern`},{source:`geojson`,has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[`line-progress`]},"property-type":`color-ramp`}},paint_circle:{"circle-radius":{type:`number`,default:5,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-blur":{type:`number`,default:0,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"circle-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`circle-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-pitch-scale":{type:`enum`,values:{map:{},viewport:{}},default:`map`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-pitch-alignment":{type:`enum`,values:{map:{},viewport:{}},default:`viewport`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-stroke-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-stroke-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-stroke-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`}},paint_heatmap:{"heatmap-radius":{type:`number`,default:30,minimum:1,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"heatmap-weight":{type:`number`,default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"heatmap-intensity":{type:`number`,default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"heatmap-color":{type:`color`,default:[`interpolate`,[`linear`],[`heatmap-density`],0,`rgba(0, 0, 255, 0)`,.1,`royalblue`,.3,`cyan`,.5,`lime`,.7,`yellow`,1,`red`],transition:!1,expression:{interpolated:!0,parameters:[`heatmap-density`]},"property-type":`color-ramp`},"heatmap-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_symbol:{"icon-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-color":{type:`color`,default:`#000000`,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-color":{type:`color`,default:`rgba(0, 0, 0, 0)`,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`icon-image`,`icon-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-color":{type:`color`,default:`#000000`,transition:!0,overridable:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-color":{type:`color`,default:`rgba(0, 0, 0, 0)`,transition:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`text-field`,`text-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_raster:{"raster-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-hue-rotate":{type:`number`,default:0,period:360,transition:!0,units:`degrees`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-brightness-min":{type:`number`,default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-brightness-max":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-saturation":{type:`number`,default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-contrast":{type:`number`,default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-resampling":{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-fade-duration":{type:`number`,default:300,minimum:0,transition:!1,units:`milliseconds`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_hillshade:{"hillshade-illumination-direction":{type:`numberArray`,default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-altitude":{type:`numberArray`,default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`viewport`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-exaggeration":{type:`number`,default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-shadow-color":{type:`colorArray`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-highlight-color":{type:`colorArray`,default:`#FFFFFF`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-accent-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-method":{type:`enum`,values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:`standard`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},"paint_color-relief":{"color-relief-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"color-relief-color":{type:`color`,transition:!1,expression:{interpolated:!0,parameters:[`elevation`]},"property-type":`color-ramp`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_background:{"background-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`background-pattern`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"background-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`cross-faded`},"background-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},transition:{duration:{type:`number`,default:300,minimum:0,units:`milliseconds`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`}},"property-type":{"data-driven":{type:`property-type`},"cross-faded":{type:`property-type`},"cross-faded-data-driven":{type:`property-type`},"color-ramp":{type:`property-type`},"data-constant":{type:`property-type`},constant:{type:`property-type`}},promoteId:{"*":{type:`string`}},interpolation:{type:`array`,value:`interpolation_name`,minimum:1},interpolation_name:{type:`enum`,values:{linear:{syntax:{overloads:[{parameters:[],"output-type":`interpolation`}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[`base`],"output-type":`interpolation`}],parameters:[{name:`base`,type:`number literal`}]}},"cubic-bezier":{syntax:{overloads:[{parameters:[`x1`,`y1`,`x2`,`y2`],"output-type":`interpolation`}],parameters:[{name:`x1`,type:`number literal`},{name:`y1`,type:`number literal`},{name:`x2`,type:`number literal`},{name:`y2`,type:`number literal`}]}}}}}
314,W=class{constructor(e,t,n,r,i=`error`){this.message=(e?`${e}: `:``)+n,r&&(this.identifier=r),this.severity=i,t!=null&&t.__line__&&(this.line=t.__line__)}}
vendor: 11,552 bytes, line 314
314,NE=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},Jxe=class e{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,n]of t)this.bindings[e]=n}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},PE={kind:`null`},G={kind:`number`},FE={kind:`string`},IE={kind:`boolean`},LE={kind:`color`},RE={kind:`projectionDefinition`},zE={kind:`object`},BE={kind:`value`},Yxe={kind:`error`},VE={kind:`collator`},HE={kind:`formatted`},UE={kind:`padding`},WE={kind:`colorArray`},GE={kind:`numberArray`},KE={kind:`resolvedImage`},qE={kind:`variableAnchorOffsetCollection`};function JE(e,t){return{kind:`array`,itemType:e,N:t}}function YE(e){if(e.kind===`array`){let t=YE(e.itemType);return typeof e.N==`number`?`array<${t}, ${e.N}>`:e.itemType.kind===`value`?`array`:`array<${t}>`}else return e.kind}var Xxe=[PE,G,FE,IE,LE,RE,HE,zE,JE(BE),UE,GE,WE,KE,qE];function XE(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!XE(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else if(e.kind===t.kind)return null;else if(e.kind===`value`){for(let e of Xxe)if(!XE(e,t))return null}return`Expected ${YE(e)} but found ${YE(t)} instead.`}function ZE(e,t){return t.some(t=>t.kind===e.kind)}function QE(e,t){return t.some(t=>t===`null`?e===null:t===`array`?Array.isArray(e):t===`object`?e&&!Array.isArray(e)&&typeof e==`object`:t===typeof e)}function $E(e,t){return e.kind===`array`&&t.kind===`array`?e.itemType.kind===t.itemType.kind&&typeof e.N==`number`:e.kind===t.kind}var Zxe=.96422,Qxe=1,$xe=.82521,eSe=4/29,eD=6/29,tSe=3*eD*eD,nSe=eD*eD*eD,rSe=Math.PI/180,iSe=180/Math.PI;function aSe(e){return e%=360,e<0&&(e+=360),e}function oSe([e,t,n,r]){e=tD(e),t=tD(t),n=tD(n);let i,a,o=nD((.2225045*e+.7168786*t+.0606169*n)/Qxe);e===t&&t===n?i=a=o:(i=nD((.4360747*e+.3850649*t+.1430804*n)/Zxe),a=nD((.0139322*e+.0971045*t+.7141733*n)/$xe));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),r]}function tD(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function nD(e){return e>nSe?e**(1/3):e/tSe+eSe}function sSe([e,t,n,r]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,o=isNaN(n)?i:i-n/200;return i=Qxe*iD(i),a=Zxe*iD(a),o=$xe*iD(o),[rD(3.1338561*a-1.6168667*i-.4906146*o),rD(-.9787684*a+1.9161415*i+.033454*o),rD(.0719453*a-.2289914*i+1.4052427*o),r]}function rD(e){return e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055,e<0?0:e>1?1:e}function iD(e){return e>eD?e*e*e:tSe*(e-eSe)}function cSe(e){let[t,n,r,i]=oSe(e),a=Math.sqrt(n*n+r*r);return[Math.round(a*1e4)?aSe(Math.atan2(r,n)*iSe):NaN,a,t,i]}function lSe([e,t,n,r]){return e=isNaN(e)?0:e*rSe,sSe([n,Math.cos(e)*t,Math.sin(e)*t,r])}function uSe([e,t,n,r]){e=aSe(e),t/=100,n/=100;function i(r){let i=(r+e/30)%12,a=t*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4),r]}var dSe=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function aD(e,t){return dSe(e,t)?e[t]:void 0}function fSe(e){if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t=aD(hSe,e);if(t){let[e,n,r]=t;return[e/255,n/255,r/255,1]}if(e.startsWith(`#`)&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,n=1;return[oD(e.slice(n,n+=t)),oD(e.slice(n,n+=t)),oD(e.slice(n,n+=t)),oD(e.slice(n,n+t)||`ff`)]}if(e.startsWith(`rgb`)){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,n,r,i,a,o,s,c,l,u,d,f]=t,p=[i||` `,s||` `,u].join(``);if(p===`  `||p===`  /`||p===`,,`||p===`,,,`){let e=[r,o,l].join(``),t=e===`%%%`?100:e===``?255:0;if(t){let e=[sD(+n/t,0,1),sD(+a/t,0,1),sD(+c/t,0,1),d?pSe(+d,f):1];if(mSe(e))return e}}return}}let n=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[e,t,r,i,a,o,s,c,l]=n,u=[r||` `,a||` `,s].join(``);if(u===`  `||u===`  /`||u===`,,`||u===`,,,`){let e=[+t,sD(+i,0,100),sD(+o,0,100),c?pSe(+c,l):1];if(mSe(e))return uSe(e)}}}function oD(e){return parseInt(e.padEnd(2,e),16)/255}function pSe(e,t){return sD(t?e/100:e,0,1)}function sD(e,t,n){return Math.min(Math.max(t,e),n)}function mSe(e){return!e.some(Number.isNaN)}var hSe={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]};function cD(e,t,n){return e+n*(t-e)}function lD(e,t,n){return e.map((e,r)=>cD(e,t[r],n))}var uD=class e{constructor(e,t,n,r=1,i=!0){this.r=e,this.g=t,this.b=n,this.a=r,i||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter(`rgb`,[e,t,n,r]))}static{this.black=new e(0,0,0,1)}static{this.white=new e(1,1,1,1)}static{this.transparent=new e(0,0,0,0)}static{this.red=new e(1,0,0,1)}static parse(t){if(t instanceof e)return t;if(typeof t!=`string`)return;let n=fSe(t);if(n)return new e(...n,!1)}get rgb(){let{r:e,g:t,b:n,a:r}=this,i=r||1/0;return this.overwriteGetter(`rgb`,[e/i,t/i,n/i,r])}get hcl(){return this.overwriteGetter(`hcl`,cSe(this.rgb))}get lab(){return this.overwriteGetter(`lab`,oSe(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,n,r]=this.rgb;return`rgba(${[e,t,n].map(e=>Math.round(e*255)).join(`,`)},${r})`}static interpolate(t,n,r,i=`rgb`){switch(i){case`rgb`:{let[i,a,o,s]=lD(t.rgb,n.rgb,r);return new e(i,a,o,s,!1)}case`hcl`:{let[i,a,o,s]=t.hcl,[c,l,u,d]=n.hcl,f,p;if(!isNaN(i)&&!isNaN(c)){let e=c-i;c>i&&e>180?e-=360:c<i&&i-c>180&&(e+=360),f=i+r*e}else isNaN(i)?isNaN(c)?f=NaN:(f=c,(o===1||o===0)&&(p=l)):(f=i,(u===1||u===0)&&(p=a));let[m,h,g,_]=lSe([f,p??cD(a,l,r),cD(o,u,r),cD(s,d,r)]);return new e(m,h,g,_,!1)}case`lab`:{let[i,a,o,s]=sSe(lD(t.lab,n.lab,r));return new e(i,a,o,s,!1)}}}},dD=class{constructor(e,t,n){e?this.sensitivity=t?`variant`:`case`:this.sensitivity=t?`accent`:`base`,this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:`search`})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},gSe=[`bottom`,`center`,`top`],fD=class{constructor(e,t,n,r,i,a){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i,this.verticalAlign=a}},pD=class e{constructor(e){this.sections=e}static fromString(t){return new e([new fD(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return this.sections.length===0?``:this.sections.map(e=>e.text).join(``)}},mD=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if(typeof e!=`number`)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(lD(t.values,n.values,r))}},hD=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t]);if(Array.isArray(t)){for(let e of t)if(typeof e!=`number`)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(lD(t.values,n.values,r))}},gD=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`string`){let n=uD.parse(t);return n?new e([n]):void 0}if(!Array.isArray(t))return;let n=[];for(let e of t){if(typeof e!=`string`)return;let t=uD.parse(e);if(!t)return;n.push(t)}return new e(n)}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r,i=`rgb`){let a=[];if(t.values.length!=n.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${n.values.length}), cannot interpolate.`);for(let e=0;e<t.values.length;e++)a.push(uD.interpolate(t.values[e],n.values[e],r,i));return new e(a)}}
vendor: 9,871 bytes, line 314
314,_D=class extends Error{constructor(e,t){super(e),this.name=`RuntimeError`,this.path=t}toJSON(){return this.message}},_Se=new Set([`center`,`left`,`right`,`top`,`bottom`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]),vD=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let e=0;e<t.length;e+=2){let n=t[e],r=t[e+1];if(typeof n!=`string`||!_Se.has(n)||!Array.isArray(r)||r.length!==2||typeof r[0]!=`number`||typeof r[1]!=`number`)return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r,i){let a=t.values,o=n.values;if(a.length!==o.length)throw new _D(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`,i);let s=[];for(let e=0;e<a.length;e+=2){if(a[e]!==o[e])throw new _D(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${a[e]}, to[${e}]: ${o[e]}`,i);s.push(a[e]);let[t,n]=a[e+1],[c,l]=o[e+1];s.push([cD(t,c,r),cD(n,l,r)])}return new e(s)}},yD=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},bD=class e{constructor(e,t,n){this.from=e,this.to=t,this.transition=n}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,n,r){return new e(t,n,r)}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]==`string`&&typeof t[1]==`string`&&typeof t[2]==`number`)return new e(t[0],t[1],t[2]);if(typeof t==`object`&&typeof t.from==`string`&&typeof t.to==`string`&&typeof t.transition==`number`)return new e(t.from,t.to,t.transition);if(typeof t==`string`)return new e(t,t,1)}};function vSe(e,t,n,r){return typeof e==`number`&&e>=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(`, `)}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)}]: 'r', 'g', and 'b' must be between 0 and 255.`}function xD(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof bD||e instanceof uD||e instanceof dD||e instanceof pD||e instanceof mD||e instanceof hD||e instanceof gD||e instanceof vD||e instanceof yD)return!0;if(Array.isArray(e)){for(let t of e)if(!xD(t))return!1;return!0}else if(typeof e==`object`){for(let t in e)if(!xD(e[t]))return!1;return!0}else return!1}function SD(e){if(e===null)return PE;if(typeof e==`string`)return FE;if(typeof e==`boolean`)return IE;if(typeof e==`number`)return G;if(e instanceof uD)return LE;if(e instanceof bD)return RE;if(e instanceof dD)return VE;if(e instanceof pD)return HE;if(e instanceof mD)return UE;if(e instanceof hD)return GE;if(e instanceof gD)return WE;if(e instanceof vD)return qE;if(e instanceof yD)return KE;if(Array.isArray(e)){let t=e.length,n;for(let t of e){let e=SD(t);if(!n)n=e;else if(n===e)continue;else{n=BE;break}}return JE(n||BE,t)}else return zE}function CD(e){let t=typeof e;return e===null?``:t===`string`||t===`number`||t===`boolean`?String(e):e instanceof uD||e instanceof bD||e instanceof pD||e instanceof mD||e instanceof hD||e instanceof gD||e instanceof vD||e instanceof yD?e.toString():JSON.stringify(e)}var wD=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,n){if(t.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!xD(t[1]))return n.error(`invalid value of type "${typeof t[1]}"`);let r=t[1],i=SD(r),a=n.expectedType;return i.kind===`array`&&i.N===0&&a&&a.kind===`array`&&(typeof a.N!=`number`||a.N===0)&&(i=a),new e(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},TD={string:FE,number:G,boolean:IE,object:zE},ED=class e{constructor(e,t,n){this.type=e,this.args=t,this.key=n}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=1,i,a=t[0];if(a===`array`){let e;if(t.length>2){let i=t[1];if(typeof i!=`string`||!(i in TD)||i===`object`)return n.error(`The item type argument of "array" must be one of string, number, boolean`,1);e=TD[i],r++}else e=BE;let a;if(t.length>3){if(t[2]!==null&&(typeof t[2]!=`number`||t[2]<0||t[2]!==Math.floor(t[2])))return n.error(`The length argument to "array" must be a positive integer literal`,2);a=t[2],r++}i=JE(e,a)}else{if(!TD[a])throw Error(`Types doesn't contain name = ${a}`);i=TD[a]}let o=[];for(;r<t.length;r++){let e=n.parse(t[r],r,BE);if(!e)return null;o.push(e)}return new e(i,o,n.key)}evaluate(e){for(let t=0;t<this.args.length;t++){let n=this.args[t].evaluate(e);if(!XE(this.type,SD(n)))return n;if(t===this.args.length-1)throw new _D(`Expected value to be of type ${YE(this.type)}, but found ${YE(SD(n))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},ySe={"to-boolean":IE,"to-color":LE,"to-number":G,"to-string":FE},DD=class e{constructor(e,t,n){this.type=e,this.args=t,this.key=n}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[0];if(!ySe[r])throw Error(`Can't parse ${r} as it is not part of the known types`);if((r===`to-boolean`||r===`to-string`)&&t.length!==2)return n.error(`Expected one argument.`);let i=ySe[r],a=[];for(let e=1;e<t.length;e++){let r=n.parse(t[e],e,BE);if(!r)return null;a.push(r)}return new e(i,a,n.key)}evaluate(e){switch(this.type.kind){case`boolean`:return!!this.args[0].evaluate(e);case`color`:{let t,n;for(let r of this.args){if(t=r.evaluate(e),n=null,t instanceof uD)return t;if(typeof t==`string`){let n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:vSe(t[0],t[1],t[2],t[3]),!n))return new uD(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new _D(n||`Could not parse color from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`padding`:{let t;for(let n of this.args){t=n.evaluate(e);let r=mD.parse(t);if(r)return r}throw new _D(`Could not parse padding from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`numberArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=hD.parse(t);if(r)return r}throw new _D(`Could not parse numberArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`colorArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=gD.parse(t);if(r)return r}throw new _D(`Could not parse colorArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`variableAnchorOffsetCollection`:{let t;for(let n of this.args){t=n.evaluate(e);let r=vD.parse(t);if(r)return r}throw new _D(`Could not parse variableAnchorOffsetCollection from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`number`:{let t=null;for(let n of this.args){if(t=n.evaluate(e),t===null)return 0;let r=Number(t);if(!isNaN(r))return r}throw new _D(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case`formatted`:return pD.fromString(CD(this.args[0].evaluate(e)));case`resolvedImage`:return yD.fromString(CD(this.args[0].evaluate(e)));case`projectionDefinition`:{let t=this.args[0].evaluate(e);if(bD.parse(t))return t;throw new _D(`Could not parse projectionDefinition from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}default:return CD(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},bSe=[`Unknown`,`Point`,`LineString`,`Polygon`],xSe=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&`id`in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type==`number`?bSe[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&`geometry`in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=uD.parse(e),this._parseColorCache.set(e,t)),t}},SSe=class e{constructor(e,t,n=[],r,i=new Jxe,a=[]){this.registry=e,this.path=n,this.key=n.map(e=>`[${e}]`).join(``),this.scope=i,this.errors=a,this.expectedType=r,this._isConstant=t}parse(e,t,n,r,i={}){return t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)}_parse(e,t){(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`)&&(e=[`literal`,e]);let n=this.key;function r(e,t,r){return r===`assert`?new ED(t,[e],n):r===`coerce`?new DD(t,[e],n):e}if(Array.isArray(e)){if(e.length===0)return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`);let n=e[0];if(typeof n!=`string`)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[n];if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){let e=this.expectedType,i=n.type;if((e.kind===`string`||e.kind===`number`||e.kind===`boolean`||e.kind===`object`||e.kind===`array`)&&i.kind===`value`)n=r(n,e,t.typeAnnotation||`assert`);else if(e.kind===`projectionDefinition`&&[`string`,`array`,`value`].includes(i.kind)||[`color`,`formatted`,`resolvedImage`].includes(e.kind)&&[`value`,`string`].includes(i.kind)||[`padding`,`numberArray`].includes(e.kind)&&[`value`,`number`,`array`].includes(i.kind)||e.kind===`colorArray`&&[`value`,`string`,`array`].includes(i.kind)||e.kind===`variableAnchorOffsetCollection`&&[`value`,`array`].includes(i.kind))n=r(n,e,t.typeAnnotation||`c
314oerce`);else if(this.checkSubtype(e,i))return null}if(!(n instanceof wD)&&n.type.kind!==`resolvedImage`&&this._isConstant(n)){let e=new xSe;try{n=new wD(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}else if(e===void 0)return this.error(`'undefined' value invalid. Use null instead.`);else if(typeof e==`object`)return this.error(`Bare objects invalid. Use ["literal", {...}] instead.`);else return this.error(`Expected an array, but found ${typeof e} instead.`)}concat(t,n,r){let i=typeof t==`number`?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new e(this.registry,this._isConstant,i,n||null,a,this.errors)}error(e,...t){let n=`${this.key}${t.map(e=>`[${e}]`).join(``)}`;this.errors.push(new NE(n,e))}checkSubtype(e,t){let n=XE(e,t);return n&&this.error(n),n}},CSe=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let r=[];for(let e=1;e<t.length-1;e+=2){let i=t[e];if(typeof i!=`string`)return n.error(`Expected string, but found ${typeof i} instead.`,e);if(/[^a-zA-Z0-9_]/.test(i))return n.error(`Variable names must contain only alphanumeric characters or '_'.`,e);let a=n.parse(t[e+1],e+1);if(!a)return null;r.push([i,a])}let i=n.parse(t[t.length-1],t.length-1,n.expectedType,r);return i?new e(r,i):null}outputDefined(){return this.result.outputDefined()}},wSe=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,n){if(t.length!==2||typeof t[1]!=`string`)return n.error(`'var' expression requires exactly one string literal argument.`);let r=t[1];return n.scope.has(r)?new e(r,n.scope.get(r)):n.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},TSe=class e{constructor(e,t,n,r){this.type=e,this.index=t,this.input=n,this.key=r}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,G),i=n.parse(t[2],2,JE(n.expectedType||BE));if(!r||!i)return null;let a=i.type;return new e(a.itemType,r,i,n.key)}evaluate(e){let t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new _D(`Array index out of bounds: ${t} < 0.`,this.key);if(t>=n.length)throw new _D(`Array index out of bounds: ${t} > ${n.length-1}.`,this.key);if(t!==Math.floor(t))throw new _D(`Array index must be an integer, but found ${t} instead.`,this.key);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},ESe=class e{constructor(e,t,n){this.needle=e,this.haystack=t,this.key=n,this.type=IE}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,BE),i=n.parse(t[2],2,BE);return!r||!i?null:ZE(r.type,[IE,FE,G,PE,BE])?new e(r,i,n.key):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${YE(r.type)} instead`)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!QE(t,[`boolean`,`string`,`number`,`null`]))throw new _D(`Expected first argument to be of type boolean, string, number or null, but found ${YE(SD(t))} instead.`,this.key);if(!QE(n,[`string`,`array`]))throw new _D(`Expected second argument to be of type array or string, but found ${YE(SD(n))} instead.`,this.key);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},DSe=class e{constructor(e,t,n,r){this.needle=e,this.haystack=t,this.key=n,this.fromIndex=r,this.type=G}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,BE),i=n.parse(t[2],2,BE);if(!r||!i)return null;if(!ZE(r.type,[IE,FE,G,PE,BE]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${YE(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,G);return a?new e(r,i,n.key,a):null}else return new e(r,i,n.key)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!QE(t,[`boolean`,`string`,`number`,`null`]))throw new _D(`Expected first argument to be of type boolean, string, number or null, but found ${YE(SD(t))} instead.`,this.key);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),QE(n,[`string`])){let e=n.indexOf(t,r);return e===-1?-1:[...n.slice(0,e)].length}else if(QE(n,[`array`]))return n.indexOf(t,r);else throw new _D(`Expected second argument to be of type array or string, but found ${YE(SD(n))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},OSe=class e{constructor(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error(`Expected an even number of arguments.`);let r,i;n.expectedType&&n.expectedType.kind!==`value`&&(i=n.expectedType);let a={},o=[];for(let e=2;e<t.length-1;e+=2){let s=t[e],c=t[e+1];Array.isArray(s)||(s=[s]);let l=n.concat(e);
vendor: 21,866 bytes, line 314
314if(s.length===0)return l.error(`Expected at least one branch label.`);for(let e of s){if(typeof e!=`number`&&typeof e!=`string`)return l.error(`Branch labels must be numbers or strings.`);if(typeof e==`number`&&Math.abs(e)>2**53-1)return l.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof e==`number`&&Math.floor(e)!==e)return l.error(`Numeric branch labels must be integer values.`);if(!r)r=SD(e);else if(l.checkSubtype(r,SD(e)))return null;if(a[String(e)]!==void 0)return l.error(`Branch labels must be unique.`);a[String(e)]=o.length}let u=n.parse(c,e,i);if(!u)return null;i||=u.type,o.push(u)}let s=n.parse(t[1],1,BE);if(!s)return null;let c=n.parse(t[t.length-1],t.length-1,i);return!c||s.type.kind!==`value`&&n.concat(1).checkSubtype(r,s.type)?null:new e(r,i,s,a,o,c)}evaluate(e){let t=this.input.evaluate(e);return(SD(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},kSe=class e{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error(`Expected an odd number of arguments.`);let r;n.expectedType&&n.expectedType.kind!==`value`&&(r=n.expectedType);let i=[];for(let e=1;e<t.length-1;e+=2){let a=n.parse(t[e],e,IE);if(!a)return null;let o=n.parse(t[e+1],e+1,r);if(!o)return null;i.push([a,o]),r||=o.type}let a=n.parse(t[t.length-1],t.length-1,r);if(!a)return null;if(!r)throw Error(`Can't infer output type`);return new e(r,i,a)}evaluate(e){for(let[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}},ASe=class e{constructor(e,t,n,r,i){this.type=e,this.input=t,this.beginIndex=n,this.key=r,this.endIndex=i}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,BE),i=n.parse(t[2],2,G);if(!r||!i)return null;if(!ZE(r.type,[JE(BE),FE,BE]))return n.error(`Expected first argument to be of type array or string, but found ${YE(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,G);return a?new e(r.type,r,i,n.key,a):null}else return new e(r.type,r,i,n.key)}evaluate(e){let t=this.input.evaluate(e),n=this.beginIndex.evaluate(e),r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),QE(t,[`string`]))return[...t].slice(n,r).join(``);if(QE(t,[`array`]))return t.slice(n,r);throw new _D(`Expected first argument to be of type array or string, but found ${YE(SD(t))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function jSe(e,t,n){let r=e.length-1,i=0,a=r,o=0,s,c;for(;i<=a;)if(o=Math.floor((i+a)/2),s=e[o],c=e[o+1],s<=t){if(o===r||t<c)return o;i=o+1}else if(s>t)a=o-1;else throw new _D(`Input is not a number.`,n);return 0}var MSe=class e{constructor(e,t,n,r){this.type=e,this.input=t,this.key=r,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);let r=n.parse(t[1],1,G);if(!r)return null;let i=[],a=null;n.expectedType&&n.expectedType.kind!==`value`&&(a=n.expectedType);for(let e=1;e<t.length;e+=2){let r=e===1?-1/0:t[e],o=t[e+1],s=e,c=e+1;if(typeof r!=`number`)return n.error(`Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,s);if(i.length&&i[i.length-1][0]>=r)return n.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,s);let l=n.parse(o,c,a);if(!l)return null;a||=l.type,i.push([r,l])}return new e(a,r,i,n.key)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[jSe(t,r,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function NSe(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let n=e;for(let r=0;r<8;r++){let r=((o*n+a)*n+i)*n-e;if(Math.abs(r)<t)return((l*n+c)*n+s)*n;let u=(3*o*n+2*a)*n+i;if(Math.abs(u)<1e-6)break;n-=r/u}let r=0,u=1;n=e;for(let s=0;s<20;s++){let s=((o*n+a)*n+i)*n;if(Math.abs(s-e)<t)break;e>s?r=n:u=n,n=(r+u)*.5}return((l*n+c)*n+s)*n}}var OD=class e{constructor(e,t,n,r,i,a){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.key=a,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,r){let i=0;if(e.name===`exponential`)i=kD(t,e.base,n,r);else if(e.name===`linear`)i=kD(t,1,n,r);else if(e.name===`cubic-bezier`){let a=e.controlPoints;i=NSe(a[0],a[1],a[2],a[3])(kD(t,1,n,r))}return i}static parse(t,n){let[r,i,a,...o]=t;if(!Array.isArray(i)||i.length===0)return n.error(`Expected an interpolation type expression.`,1);if(i[0]===`linear`)i={name:`linear`};else if(i[0]===`exponential`){let e=i[1];if(typeof e!=`number`)return n.error(`Exponential interpolation requires a numeric base.`,1,1);i={name:`exponential`,base:e}}else if(i[0]===`cubic-bezier`){let e=i.slice(1);if(e.length!==4||e.some(e=>typeof e!=`number`||e<0||e>1))return n.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);i={name:`cubic-bezier`,controlPoints:e}}else return n.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);if(a=n.parse(a,2,G),!a)return null;let s=[],c=null;(r===`interpolate-hcl`||r===`interpolate-lab`)&&n.expectedType!=WE?c=LE:n.expectedType&&n.expectedType.kind!==`value`&&(c=n.expectedType);for(let e=0;e<o.length;e+=2){let t=o[e],r=o[e+1],i=e+3,a=e+4;if(typeof t!=`number`)return n.error(`Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,i);if(s.length&&s[s.length-1][0]>=t)return n.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,i);let l=n.parse(r,a,c);if(!l)return null;c||=l.type,s.push([t,l])}return!$E(c,G)&&!$E(c,RE)&&!$E(c,LE)&&!$E(c,UE)&&!$E(c,GE)&&!$E(c,WE)&&!$E(c,qE)&&!$E(c,JE(G))?n.error(`Type ${YE(c)} is not interpolatable.`):new e(c,r,i,a,s,n.key)}evaluate(t){let n=this.labels,r=this.outputs;if(n.length===1)return r[0].evaluate(t);let i=this.input.evaluate(t);if(i<=n[0])return r[0].evaluate(t);let a=n.length;if(i>=n[a-1])return r[a-1].evaluate(t);let o=jSe(n,i,this.key),s=n[o],c=n[o+1],l=e.interpolationFactor(this.interpolation,i,s,c),u=r[o].evaluate(t),d=r[o+1].evaluate(t);switch(this.operator){case`interpolate`:switch(this.type.kind){case`number`:return cD(u,d,l);case`color`:return uD.interpolate(u,d,l);case`padding`:return mD.interpolate(u,d,l);case`colorArray`:return gD.interpolate(u,d,l);case`numberArray`:return hD.interpolate(u,d,l);case`variableAnchorOffsetCollection`:return vD.interpolate(u,d,l,this.key);case`array`:return lD(u,d,l);case`projectionDefinition`:return bD.interpolate(u,d,l)}case`interpolate-hcl`:switch(this.type.kind){case`color`:return uD.interpolate(u,d,l,`hcl`);case`colorArray`:return gD.interpolate(u,d,l,`hcl`)}case`interpolate-lab`:switch(this.type.kind){case`color`:return uD.interpolate(u,d,l,`lab`);case`colorArray`:return gD.interpolate(u,d,l,`lab`)}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function kD(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}uD.interpolate,mD.interpolate,hD.interpolate,gD.interpolate,vD.interpolate;var PSe=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=null,i=n.expectedType;i&&i.kind!==`value`&&(r=i);let a=[];for(let e of t.slice(1)){let t=n.parse(e,1+a.length,r,void 0,{typeAnnotation:`omit`});if(!t)return null;r||=t.type,a.push(t)}if(!r)throw Error(`No output type`);return i&&a.some(e=>XE(i,e.type))?new e(BE,a):new e(r,a)}evaluate(e){let t=null,n=0,r;for(let i of this.args)if(n++,t=i.evaluate(e),t&&t instanceof yD&&!t.available&&(r||=t.name,t=null,n===this.args.length&&(t=r)),t!==null)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function FSe(e,t){return e===`==`||e===`!=`?t.kind===`boolean`||t.kind===`string`||t.kind===`number`||t.kind===`null`||t.kind===`value`:t.kind===`string`||t.kind===`number`||t.kind===`value`}function ISe(e,t,n){return t===n}function LSe(e,t,n){return t!==n}function RSe(e,t,n){return t<n}function zSe(e,t,n){return t>n}function BSe(e,t,n){return t<=n}function VSe(e,t,n){return t>=n}function HSe(e,t,n,r){return r.compare(t,n)===0}function USe(e,t,n,r){return!HSe(e,t,n,r)}function WSe(e,t,n,r){return r.compare(t,n)<0}function GSe(e,t,n,r){return r.compare(t,n)>0}function KSe(e,t,n,r){return r.compare(t,n)<=0}function qSe(e,t,n,r){return r.compare(t,n)>=0}function AD(e,t,n){let r=e!==`==`&&e!==`!=`;return class i{constructor(e,t,n,r){this.lhs=e,this.rhs=t,this.key=n,this.collator=r,this.type=IE,this.hasUntypedArgument=e.type.kind===`value`||t.type.kind===`value`}static parse(e,t){if(e.length!==3&&e.length!==4)return t.error(`Expected two or three arguments.`);let n=e[0],a=t.parse(e[1],1,BE);if(!a)return null;if(!FSe(n,a.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${YE(a.type)}'.`);let o=t.parse(e[2],2,BE);if(!o)return null;if(!FSe(n,o.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${YE(o.type)}'.`);if(a.type.kind!==o.type.kind&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot compare types '${YE(a.type)}' and '${YE(o.type)}'.`);r&&(a.type.kind===`value`&&o.type.kind!==`value`?a=new ED(o.type,[a],t.key):a.type.kind!==`value`&&o.type.kind===`value`&&(o=new ED(a.type,[o],t.key)));let s=null;if(e.length===4){if(a.type.kind!==`string`&&o.type.kind!==`string`&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot use collator to compare non-string types.`);if(s=t.parse(e[3],3,VE),!s)return null}return new i(a,o,t.key,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){let t=SD(a),n=SD(o);if(t.kind!==n.kind||!(t.kind===`string`||t.kind===`number`))throw new _D(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`,this.key)}if(this.collator&&!r&&this.hasUntypedArgument){let e=SD(a),n=SD(o);if(e.kind!==`string`||n.kind!==`string`)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}var JSe=AD(`==`,ISe,HSe),YSe=AD(`!=`,LSe,USe),XSe=AD(`<`,RSe,WSe),ZSe=AD(`>`,zSe,GSe),QSe=AD(`<=`,BSe,KSe),$Se=AD(`>=`,VSe,qSe),eCe=class e{constructor(e,t,n){this.type=VE,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,n){if(t.length!==2)return n.error(`Expected one argument.`);let r=t[1];if(typeof r!=`object`||Array.isArray(r))return n.error(`Collator options argument must be an object.`);let i=n.parse(r[`case-sensitive`]===void 0?!1:r[`case-sensitive`],1,IE);if(!i)return null;let a=n.parse(r[`diacritic-sensitive`]===void 0?!1:r[`diacritic-sensitive`],1,IE);if(!a)return null;let o=null;return r.locale&&(o=n.parse(r.locale,1,FE),!o)?null:new e(i,a,o)}evaluate(e){return new dD(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},tCe=class e{constructor(e,t,n,r,i,a){this.type=FE,this.number=e,this.locale=t,this.currency=n,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=a}static parse(t,n){if(t.length!==3)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,G);if(!r)return null;let i=t[2];if(typeof i!=`object`||Array.isArray(i))return n.error(`NumberFormat options argument must be an object.`);let a=null;if(i.locale&&(a=n.parse(i.locale,1,FE),!a))return null;let o=null;if(i.currency&&(o=n.parse(i.currency,1,FE),!o))return null;let s=null;if(i.unit&&(s=n.parse(i.unit,1,FE),!s))return null;if(o&&s)return n.error("NumberFormat options `currency` and `unit` are mutually exclusive");let c=null;if(i[`min-fraction-digits`]&&(c=n.parse(i[`min-fraction-digits`],1,G),!c))return null;let l=null;return i[`max-fraction-digits`]&&(l=n.parse(i[`max-fraction-digits`],1,G),!l)?null:new e(r,a,o,s,c,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?`currency`:this.unit?`unit`:`decimal`,currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},nCe=class e{constructor(e){this.type=HE,this.sections=e}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[1];if(!Array.isArray(r)&&typeof r==`object`)return n.error(`First argument must be an image or text section.`);let i=[],a=!1;for(let e=1;e<=t.length-1;++e){let r=t[e];if(a&&typeof r==`object`&&!Array.isArray(r)){a=!1;let e=null;if(r[`font-scale`]&&(e=n.parse(r[`font-scale`],1,G),!e))return null;let t=null;if(r[`text-font`]&&(t=n.parse(r[`text-font`],1,JE(FE)),!t))return null;let o=null;if(r[`text-color`]&&(o=n.parse(r[`text-color`],1,LE),!o))return null;let s=null;if(r[`vertical-align`]){if(typeof r[`vertical-align`]==`string`&&!gSe.includes(r[`vertical-align`]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${r[`vertical-align`]}' instead.`);if(s=n.parse(r[`vertical-align`],1,FE),!s)return null}let c=i[i.length-1];c.scale=e,c.font=t,c.textColor=o,c.verticalAlign=s}else{let r=n.parse(t[e],1,BE);if(!r)return null;let o=r.type.kind;if(o!==`string`&&o!==`value`&&o!==`null`&&o!==`resolvedImage`)return n.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);a=!0,i.push({content:r,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(i)}evaluate(e){return new pD(this.sections.map(t=>{let n=t.content.evaluate(e);return SD(n)===KE?new fD(``,n,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new fD(CD(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}},rCe=class e{constructor(e){this.type=KE,this.input=e}static parse(t,n){if(t.length!==2)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,FE);return r?new e(r):n.error(`No image name provided.`)}evaluate(e){let t=this.input.evaluate(e),n=yD.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},iCe=class e{constructor(e,t){this.input=e,this.key=t,this.type=G}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=n.parse(t[1],1);return r?r.type.kind!==`array`&&r.type.kind!==`string`&&r.type.kind!==`value`?n.error(`Expected argument of type string or array, but found ${YE(r.type)} instead.`):new e(r,n.key):null}evaluate(e){let t=this.input.evaluate(e);if(typeof t==`string`)return[...t].length;if(Array.isArray(t))return t.length;throw new _D(`Expected value to be of type string or array, but found ${YE(SD(t))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},jD=8192;function aCe(e,t){let n=oCe(e[0]),r=cCe(e[1]),i=2**t.z;return[Math.round(n*i*jD),Math.round(r*i*jD)]}function MD(e,t){let n=2**t.z,r=(e[0]/jD+t.x)/n,i=(e[1]/jD+t.y)/n;return[sCe(r),lCe(i)]}function oCe(e){return(180+e)/360}function sCe(e){return e*360-180}function cCe(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function lCe(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function ND(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function PD(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function uCe(e,t,n){return t[1]>e[1]!=n[1]>e[1]&&e[0]<(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1])+t[0]}function dCe(e,t,n){let r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i===0&&r*a<=0&&i*o<=0}function FD(e,t,n,r){let i=[t[0]-e[0],t[1]-e[1]];return gCe([r[0]-n[0],r[1]-n[1]],i)===0?!1:!!(_Ce(e,t,n,r)&&_Ce(n,r,e,t))}function fCe(e,t,n){for(let r of n)for(let n=0;n<r.length-1;++n)if(FD(e,t,r[n],r[n+1]))return!0;return!1}function ID(e,t,n=!1){let r=!1;for(let i of t)for(let t=0;t<i.length-1;t++){if(dCe(e,i[t],i[t+1]))return n;uCe(e,i[t],i[t+1])&&(r=!r)}return r}function pCe(e,t){for(let n of t)if(ID(e,n))return!0;return!1}function mCe(e,t){for(let n of e)if(!ID(n,t))return!1;for(let n=0;n<e.length-1;++n)if(fCe(e[n],e[n+1],t))return!1;return!0}function hCe(e,t){for(let n of t)if(mCe(e,n))return!0;return!1}function gCe(e,t){return e[0]*t[1]-e[1]*t[0]}function _Ce(e,t,n,r){let i=e[0]-n[0],a=e[1]-n[1],o=t[0]-n[0],s=t[1]-n[1],c=r[0]-n[0],l=r[1]-n[1],u=i*l-c*a,d=o*l-c*s;return u>0&&d<0||u<0&&d>0}function LD(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=[];for(let r=0;r<e[i].length;r++){let o=aCe(e[i][r],n);ND(t,o),a.push(o)}r.push(a)}return r}function vCe(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=LD(e[i],t,n);r.push(a)}return r}function yCe(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){let t=r*.5,i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;i===0&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}ND(t,e)}function bCe(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function xCe(e,t,n,r){let i=2**r.z*jD,a=[r.x*jD,r.y*jD],o=[];for(let r of e)for(let e of r){let r=[e.x+a[0],e.y+a[1]];yCe(r,t,n,i),o.push(r)}return o}function SCe(e,t,n,r){let i=2**r.z*jD,a=[r.x*jD,r.y*jD],o=[];for(let n of e){let e=[];for(let r of n){let n=[r.x+a[0],r.y+a[1]];ND(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){bCe(t);for(let e of o)for(let r of e)yCe(r,t,n,i)}return o}function CCe(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=LD(t.coordinates,r,i),o=xCe(e.geometry(),n,r,i);if(!PD(n,r))return!1;for(let e of o)if(!ID(e,a))return!1}if(t.type===`MultiPolygon`){let a=vCe(t.coordinates,r,i),o=xCe(e.geometry(),n,r,i);if(!PD(n,r))return!1;for(let e of o)if(!pCe(e,a))return!1}return!0}function wCe(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=LD(t.coordinates,r,i),o=SCe(e.geometry(),n,r,i);if(!PD(n,r))return!1;for(let e of o)if(!mCe(e,a))return!1}if(t.type===`MultiPolygon`){let a=vCe(t.coordinates,r,i),o=SCe(e.geometry(),n,r,i);if(!PD(n,r))return!1;for(let e of o)if(!hCe(e,a))return!1}return!0}var RD=class e{constructor(e,t){this.type=IE,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(xD(t[1])){let n=t[1];if(n.type===`FeatureCollection`){let t=[];for(let e of n.features){let{type:n,coordinates:r}=e.geometry;n===`Polygon`&&t.push(r),n===`MultiPolygon`&&t.push(...r)}if(t.length)return new e(n,{type:`MultiPolygon`,coordinates:t})}else if(n.type===`Feature`){let t=n.geometry.type;if(t===`Polygon`||t===`MultiPolygon`)return new e(n,n.geometry)}else if(n.type===`Polygon`||n.type===`MultiPolygon`)return new e(n,n)}return n.error(`'within' expression requires valid geojson object that contains polygon geometry type.`)}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return CCe(e,this.geometries);if(e.geometryType()===`LineString`)return wCe(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},TCe=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=(e<<1)+1,a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}};function ECe(e,t,n=0,r=e.length-1,i=DCe){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/
vendor: 5,801 bytes, line 314
314a)*(o-a/2<0?-1:1);ECe(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(zD(e,n,t),i(e[r],a)>0&&zD(e,n,r);o<s;){for(zD(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?zD(e,n,s):(s++,zD(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function zD(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function DCe(e,t){return e<t?-1:+(e>t)}function OCe(e,t){if(e.length<=1)return[e];let n=[],r,i;for(let t of e){let e=ACe(t);e!==0&&(t.area=Math.abs(e),i===void 0&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(ECe(n[e],t,1,n[e].length-1,kCe),n[e]=n[e].slice(0,t));return n}function kCe(e,t){return t.area-e.area}function ACe(e){let t=0;for(let n=0,r=e.length,i=r-1,a,o;n<r;i=n++)a=e[n],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}var jCe=6378.137,MCe=.0066943799901413165,NCe=Math.PI/180,BD=class{constructor(e){let t=NCe*jCe*1e3,n=Math.cos(e*NCe),r=1/(1-MCe*(1-n*n)),i=Math.sqrt(r);this.kx=t*i*n,this.ky=t*i*r*.9933056200098587}distance(e,t){let n=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(n*n+r*r)}pointOnLine(e,t){let n=1/0,r,i,a,o;for(let s=0;s<e.length-1;s++){let c=e[s][0],l=e[s][1],u=this.wrap(e[s+1][0]-c)*this.kx,d=(e[s+1][1]-l)*this.ky,f=0;(u!==0||d!==0)&&(f=(this.wrap(t[0]-c)*this.kx*u+(t[1]-l)*this.ky*d)/(u*u+d*d),f>1?(c=e[s+1][0],l=e[s+1][1]):f>0&&(c+=u/this.kx*f,l+=d/this.ky*f)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-l)*this.ky;let p=u*u+d*d;p<n&&(n=p,r=c,i=l,a=s,o=f)}return{point:[r,i],index:a,t:Math.max(0,Math.min(1,o))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},VD=100,HD=50;function PCe(e,t){return t[0]-e[0]}function UD(e){return e[1]-e[0]+1}function WD(e,t){return e[1]>=e[0]&&e[1]<t}function GD(e,t){if(e[0]>e[1])return[null,null];let n=UD(e);if(t){if(n===2)return[e,null];let t=Math.floor(n/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(n===1)return[e,null];let r=Math.floor(n/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function KD(e,t){if(!WD(t,e.length))return[1/0,1/0,-1/0,-1/0];let n=[1/0,1/0,-1/0,-1/0];for(let r=t[0];r<=t[1];++r)ND(n,e[r]);return n}function qD(e){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)for(let e of n)ND(t,e);return t}function FCe(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function JD(e,t,n){if(!FCe(e)||!FCe(t))return NaN;let r=0,i=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),n.distance([0,0],[r,i])}function YD(e,t,n){let r=n.pointOnLine(t,e);return n.distance(e,r.point)}function XD(e,t,n,r,i){let a=Math.min(YD(e,[n,r],i),YD(t,[n,r],i)),o=Math.min(YD(n,[e,t],i),YD(r,[e,t],i));return Math.min(a,o)}function ICe(e,t,n,r,i){if(!(WD(t,e.length)&&WD(r,n.length)))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],s=e[o+1];for(let e=r[0];e<r[1];++e){let r=n[e],o=n[e+1];if(FD(t,s,r,o))return 0;a=Math.min(a,XD(t,s,r,o,i))}}return a}function LCe(e,t,n,r,i){if(!(WD(t,e.length)&&WD(r,n.length)))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=r[0];t<=r[1];++t)if(a=Math.min(a,i.distance(e[o],n[t])),a===0)return a;return a}function RCe(e,t,n){if(ID(e,t,!0))return 0;let r=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&(r=Math.min(r,YD(e,[a,t],n)),r===0))return r;let o=n.pointOnLine(i,e);if(r=Math.min(r,n.distance(e,o.point)),r===0)return r}return r}function zCe(e,t,n,r){if(!WD(t,e.length))return NaN;for(let r=t[0];r<=t[1];++r)if(ID(e[r],n,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],o=e[a+1];for(let e of n)for(let n=0,a=e.length,s=a-1;n<a;s=n++){let a=e[s],c=e[n];if(FD(t,o,a,c))return 0;i=Math.min(i,XD(t,o,a,c,r))}}return i}function BCe(e,t){for(let n of e)for(let e of n)if(ID(e,t,!0))return!0;return!1}function VCe(e,t,n,r=1/0){let i=qD(e),a=qD(t);if(r!==1/0&&JD(i,a,n)>=r)return r;if(PD(i,a)){if(BCe(e,t))return 0}else if(BCe(t,e))return 0;let o=1/0;for(let r of e)for(let e=0,i=r.length,a=i-1;e<i;a=e++){let i=r[a],s=r[e];for(let e of t)for(let t=0,r=e.length,a=r-1;t<r;a=t++){let r=e[a],c=e[t];if(FD(i,s,r,c))return 0;o=Math.min(o,XD(i,s,r,c,n))}}return o}function HCe(e,t,n,r,i,a){if(!a)return;let o=JD(KD(r,a),i,n);o<t&&e.push([o,a,[0,0]])}function ZD(e,t,n,r,i,a,o){if(!a||!o)return;let s=JD(KD(r,a),KD(i,o),n);s<t&&e.push([s,a,o])}function QD(e,t,n,r,i=1/0){let a=Math.min(r.distance(e[0],n[0][0]),i);if(a===0)return a;let o=new TCe([[0,[0,e.length-1],[0,0]]],PCe),s=qD(n);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let c=i[1],l=t?HD:VD;if(UD(c)<=l){if(!WD(c,e.length))return NaN;if(t){let t=zCe(e,c,n,r);if(isNaN(t)||t===0)return t;a=Math.min(a,t)}else for(let t=c[0];t<=c[1];++t){let i=RCe(e[t],n,r);if(a=Math.min(a,i),a===0)return 0}}else{let n=GD(c,t);HCe(o,a,r,e,s,n[0]),HCe(o,a,r,e,s,n[1])}}return a}function $D(e,t,n,r,i,a=1/0){let o=Math.min(a,i.distance(e[0],n[0]));if(o===0)return o;let s=new TCe([[0,[0,e.length-1],[0,n.length-1]]],PCe);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let c=a[1],l=a[2],u=t?HD:VD,d=r?HD:VD;if(UD(c)<=u&&UD(l)<=d){if(!WD(c,e.length)&&WD(l,n.length))return NaN;let a;if(t&&r)a=ICe(e,c,n,l,i),o=Math.min(o,a);else if(t&&!r){let t=e.slice(c[0],c[1]+1);for(let e=l[0];e<=l[1];++e)if(a=YD(n[e],t,i),o=Math.min(o,a),o===0)return o}else if(!t&&r){let t=n.slice(l[0],l[1]+1);for(let n=c[0];n<=c[1];++n)if(a=YD(e[n],t,i),o=Math.min(o,a),o===0)return o}else a=LCe(e,c,n,l,i),o=Math.min(o,a)}else{let a=GD(c,t),u=GD(l,r);ZD(s,o,i,e,n,a[0],u[0]),ZD(s,o,i,e,n,a[0],u[1]),ZD(s,o,i,e,n,a[1],u[0]),ZD(s,o,i,e,n,a[1],u[1])}}return o}function UCe(e,t){let n=e.geometry(),r=n.flat().map(t=>MD([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new BD(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,$D(r,!1,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,$D(r,!1,e.coordinates,!0,i,a));break;
vendor: 8,155 bytes, line 314
314case`Polygon`:a=Math.min(a,QD(r,!1,e.coordinates,i,a))}if(a===0)return a}return a}function WCe(e,t){let n=e.geometry(),r=n.flat().map(t=>MD([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new BD(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,$D(r,!0,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,$D(r,!0,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,QD(r,!0,e.coordinates,i,a))}if(a===0)return a}return a}function GCe(e,t){let n=e.geometry();if(n.length===0||n[0].length===0)return NaN;let r=OCe(n,0).map(t=>t.map(t=>t.map(t=>MD([t.x,t.y],e.canonical)))),i=new BD(r[0][0][0][1]),a=1/0;for(let e of t)for(let t of r){switch(e.type){case`Point`:a=Math.min(a,QD([e.coordinates],!1,t,i,a));break;case`LineString`:a=Math.min(a,QD(e.coordinates,!0,t,i,a));break;case`Polygon`:a=Math.min(a,VCe(t,e.coordinates,i,a))}if(a===0)return a}return a}function eO(e){return e.type===`MultiPolygon`?e.coordinates.map(e=>({type:`Polygon`,coordinates:e})):e.type===`MultiLineString`?e.coordinates.map(e=>({type:`LineString`,coordinates:e})):e.type===`MultiPoint`?e.coordinates.map(e=>({type:`Point`,coordinates:e})):[e]}var tO=class e{constructor(e,t){this.type=G,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(xD(t[1])){let n=t[1];if(n.type===`FeatureCollection`)return new e(n,n.features.map(e=>eO(e.geometry)).flat());if(n.type===`Feature`)return new e(n,eO(n.geometry));if(`type`in n&&`coordinates`in n)return new e(n,eO(n))}return n.error(`'distance' expression requires valid geojson object that contains polygon geometry type.`)}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return UCe(e,this.geometries);if(e.geometryType()===`LineString`)return WCe(e,this.geometries);if(e.geometryType()===`Polygon`)return GCe(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},KCe=class e{constructor(e){let t=null;for(let n of e)if(!t)t=n.type;else if(t===n.type)continue;else{t=BE;break}this.type=JE(t??BE,e.length),this.arr=e}static parse(t,n){if(t.length!==2)return n.error(`'semiliteral' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!xD(t[1]))return n.error(`invalid value of type "${typeof t[1]}"`);let r=t[1],i=SD(r);if(i.kind===`array`){let t=r.map(e=>n.parse(e,null,BE));return new e(t)}else return new wD(i,r)}evaluate(e){return this.arr.map(t=>t.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},nO=class e{constructor(e){this.key=e,this.type=BE}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=t[1];return r==null?n.error(`Global state property must be defined.`):typeof r==`string`?new e(r):n.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(e){let t=e.globals?.globalState;return!t||Object.keys(t).length===0?null:aD(t,this.key)??null}eachChild(){}outputDefined(){return!1}},rO={"==":JSe,"!=":YSe,">":ZSe,"<":XSe,">=":$Se,"<=":QSe,array:ED,at:TSe,boolean:ED,case:kSe,coalesce:PSe,collator:eCe,format:nCe,image:rCe,in:ESe,"index-of":DSe,interpolate:OD,"interpolate-hcl":OD,"interpolate-lab":OD,length:iCe,let:CSe,literal:wD,match:OSe,number:ED,"number-format":tCe,object:ED,semiliteral:KCe,slice:ASe,step:MSe,string:ED,"to-boolean":DD,"to-color":DD,"to-number":DD,"to-string":DD,var:wSe,within:RD,distance:tO,"global-state":nO},iO=class e{constructor(e,t,n,r,i){this.name=e,this.type=t,this._evaluate=n,this.args=r,this.key=i}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,n){let r=t[0],i=e.definitions[r];if(!i)return n.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),c=null;for(let[i,o]of s){c=new SSe(n.registry,sO,n.path,null,n.scope);let s=[],l=!1;for(let e=1;e<t.length;e++){let n=t[e],r=Array.isArray(i)?i[e-1]:i.type,a=c.parse(n,1+s.length,r);if(!a){l=!0;break}s.push(a)}if(!l){if(Array.isArray(i)&&i.length!==s.length){c.error(`Expected ${i.length} arguments, but found ${s.length} instead.`);continue}for(let e=0;e<s.length;e++){let t=Array.isArray(i)?i[e]:i.type,n=s[e];c.concat(e+1).checkSubtype(t,n.type)}if(c.errors.length===0)return new e(r,a,o,s,n.key)}}if(s.length===1)n.errors.push(...c.errors);else{let e=(s.length?s:o).map(([e])=>XCe(e)).join(` | `),r=[];for(let e=1;e<t.length;e++){let i=n.parse(t[e],1+r.length);if(!i)return null;r.push(YE(i.type))}n.error(`Expected arguments of type ${e}, but found (${r.join(`, `)}) instead.`)}return null}static register(t,n){e.definitions=n;for(let r in n)t[r]=e}};function qCe(e,[t,n,r,i],a){t=t.evaluate(e),n=n.evaluate(e),r=r.evaluate(e);let o=i?i.evaluate(e):1,s=vSe(t,n,r,o);if(s)throw new _D(s,a);return new uD(t/255,n/255,r/255,o,!1)}function JCe(e,t){return e in t&&t[e]!==void 0}function aO(e,t){let n=t[e];return n===void 0?null:n}function YCe(e,t,n,r){for(;n<=r;){let i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}function oO(e){return{type:e}}iO.register(rO,{error:[Yxe,[FE],(e,[t],n)=>{throw new _D(t.evaluate(e),n)}],typeof:[FE,[BE],(e,[t])=>YE(SD(t.evaluate(e)))],"to-rgba":[JE(G,4),[LE],(e,[t])=>{let[n,r,i,a]=t.evaluate(e).rgb;return[n*255,r*255,i*255,a]}],rgb:[LE,[G,G,G],qCe],rgba:[LE,[G,G,G,G],qCe],has:{type:IE,overloads:[[[FE],(e,[t])=>JCe(t.evaluate(e),e.properties())],[[FE,zE],(e,[t,n])=>JCe(t.evaluate(e),n.evaluate(e))]]},get:{type:BE,overloads:[[[FE],(e,[t])=>aO(t.evaluate(e),e.properties())],[[FE,zE],(e,[t,n])=>aO(t.evaluate(e),n.evaluate(e))]]},"feature-state":[BE,[FE],(e,[t])=>aO(t.evaluate(e),e.featureState||{})],properties:[zE,[],e=>e.properties()],"geometry-type":[FE,[],e=>e.geometryType()],id:[BE,[],e=>e.id()],zoom:[G,[],e=>e.globals.zoom],"heatmap-density":[G,[],e=>e.globals.heatmapDensity||0],elevation:[G,[],e=>e.globals.elevation||0],"line-progress":[G,[],e=>e.globals.lineProgress||0],accumulated:[BE,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[G,oO(G),(e,t)=>{let n=0;for(let r of t)n+=r.evaluate(e);return n}],"*":[G,oO(G),(e,t)=>{let n=1;for(let r of t)n*=r.evaluate(e);return n}],"-":{type:G,overloads:[[[G,G],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[G],(e,[t])=>-t.evaluate(e)]]},"/":[G,[G,G],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[G,[G,G],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[G,[],()=>Math.LN2],pi:[G,[],()=>Math.PI],e:[G,[],()=>Math.E],"^":[G,[G,G],(e,[t,n])=>t.evaluate(e)**+n.evaluate(e)],sqrt:[G,[G],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[G,[G],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[G,[G],(e,[t])=>Math.log(t.evaluate(e))],log2:[G,[G],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[G,[G],(e,[t])=>Math.sin(t.evaluate(e))],cos:[G,[G],(e,[t])=>Math.cos(t.evaluate(e))],tan:[G,[G],(e,[t])=>Math.tan(t.evaluate(e))],asin:[G,[G],(e,[t])=>Math.asin(t.evaluate(e))],acos:[G,[G],(e,[t])=>Math.acos(t.evaluate(e))],atan:[G,[G],(e,[t])=>Math.atan(t.evaluate(e))],min:[G,oO(G),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[G,oO(G),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[G,[G],(e,[t])=>Math.abs(t.evaluate(e))],round:[G,[G],(e,[t])=>{let n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[G,[G],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[G,[G],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[IE,[FE,BE],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[IE,[BE],(e,[t])=>e.id()===t.value],"filter-type-==":[IE,[FE],(e,[t])=>e.geometryType()===t.value],"filter-<":[IE,[FE,BE],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[IE,[BE],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<r}],"filter->":[IE,[FE,BE],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[IE,[BE],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>r}
vendor: 25,648 bytes, line 314
314],"filter-<=":[IE,[FE,BE],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[IE,[BE],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<=r}],"filter->=":[IE,[FE,BE],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[IE,[BE],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>=r}],"filter-has":[IE,[BE],(e,[t])=>{let n=t.value,r=e.properties();return n in r&&r[n]!==void 0}],"filter-has-id":[IE,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[IE,[JE(FE)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[IE,[JE(BE)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[IE,[FE,JE(BE)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[IE,[FE,JE(BE)],(e,[t,n])=>YCe(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:IE,overloads:[[[IE,IE],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[oO(IE),(e,t)=>{for(let n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:IE,overloads:[[[IE,IE],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[oO(IE),(e,t)=>{for(let n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[IE,[IE],(e,[t])=>!t.evaluate(e)],"is-supported-script":[IE,[FE],(e,[t])=>{let n=e.globals&&e.globals.isSupportedScript;return n?n(t.evaluate(e)):!0}],upcase:[FE,[FE],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[FE,[FE],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[FE,oO(BE),(e,t)=>t.map(t=>CD(t.evaluate(e))).join(``)],split:[JE(FE),[FE,FE],(e,[t,n])=>t.evaluate(e).split(n.evaluate(e))],join:[FE,[JE(FE),FE],(e,[t,n])=>t.evaluate(e).join(n.evaluate(e))],"resolved-locale":[FE,[VE],(e,[t])=>t.evaluate(e).resolvedLocale()]});function XCe(e){return Array.isArray(e)?`(${e.map(YE).join(`, `)})`:`(${YE(e.type)}...)`}function sO(e){if(e instanceof wSe)return sO(e.boundExpression);if(e instanceof iO&&e.name===`error`||e instanceof eCe||e instanceof RD||e instanceof tO||e instanceof nO)return!1;let t=e instanceof DD||e instanceof ED,n=!0;return e.eachChild(e=>{t?n&&=sO(e):n&&=e instanceof wD}),n?cO(e)&&uO(e,[`zoom`,`heatmap-density`,`elevation`,`line-progress`,`accumulated`,`is-supported-script`]):!1}function cO(e){if(e instanceof iO&&(e.name===`get`&&e.args.length===1||e.name===`feature-state`||e.name===`has`&&e.args.length===1||e.name===`properties`||e.name===`geometry-type`||e.name===`id`||/^filter-/.test(e.name))||e instanceof RD||e instanceof tO)return!1;let t=!0;return e.eachChild(e=>{t&&!cO(e)&&(t=!1)}),t}function lO(e){if(e instanceof iO&&e.name===`feature-state`)return!1;let t=!0;return e.eachChild(e=>{t&&!lO(e)&&(t=!1)}),t}function uO(e,t){if(e instanceof iO&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild(e=>{n&&!uO(e,t)&&(n=!1)}),n}function dO(e){return{result:`success`,value:e}}function fO(e){return{result:`error`,value:e}}function pO(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function ZCe(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function QCe(e){return!!e.expression&&e.expression.interpolated}function mO(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}function hO(e){return e instanceof Number?`number`:e instanceof String?`string`:e instanceof Boolean?`boolean`:Array.isArray(e)?`array`:e===null?`null`:typeof e}function gO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&SD(e)===zE}var $Ce=class{constructor(e,t,n,r){this.expression=e,this._warningHistory={},this._evaluator=new xSe,this._defaultValue=n?swe(n):null,this._enumValues=n&&n.type===`enum`?n.values:null,this._globalState=r,this._rootKey=t}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=bO(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,a){this._globalState&&(e=bO(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(e==null||typeof e==`number`&&e!==e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new _D(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(`, `)}, but found ${JSON.stringify(e)} instead.`,``);return e}catch(e){let t=e instanceof _D?e.path:``,n=`${t}|${e.message}`;return this._warningHistory[n]||(this._warningHistory[n]=!0,typeof console<`u`&&console.warn(ewe(this._rootKey,t,e.message,this._defaultValue))),this._defaultValue}}};function ewe(e,t,n,r){return`${e}${t}: ${n}${r==null?``:` Falling back to ${String(r)}.`}`}function twe(e){if(!e)throw Error(`rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".`)}function nwe(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`string`&&e[0]in rO}function _O(e,t,n,r){twe(t);let i=new SSe(rO,sO,[],n?owe(n):void 0),a=i.parse(e,void 0,void 0,void 0,n&&n.type===`string`?{typeAnnotation:`coerce`}:void 0);return a?dO(new $Ce(a,t,n,r)):fO(i.errors)}var rwe=class{constructor(e,t,n){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!lO(t.expression),this.globalStateRefs=yO(t.expression),this._globalState=n}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=bO(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._globalState&&(e=bO(e,this._globalState)),this._styleExpression.evaluate(e,t,n,r,i,a)}},iwe=class{constructor(e,t,n,r,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!lO(t.expression),this.globalStateRefs=yO(t.expression),this.interpolationType=r,this._globalState=i}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=bO(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._globalState&&(e=bO(e,this._globalState)),this._styleExpression.evaluate(e,t,n,r,i,a)}interpolationFactor(e,t,n){return this.interpolationType?OD.interpolationFactor(this.interpolationType,e,t,n):0}};function awe(e,t,n,r){let i=_O(e,t,n,r);if(i.result===`error`)return i;let a=i.value.expression,o=cO(a);if(!o&&!pO(n))return fO([new NE(``,`data expressions not supported`)]);let s=uO(a,[`zoom`]);if(!s&&!ZCe(n))return fO([new NE(``,`zoom expressions not supported`)]);let c=vO(a);if(!c&&!s)return fO([new NE(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`)]);if(c instanceof NE)return fO([c]);if(c instanceof OD&&!QCe(n))return fO([new NE(``,`"interpolate" expressions cannot be used with this property`)]);if(!c)return dO(o?new rwe(`constant`,i.value,r):new rwe(`source`,i.value,r));let l=c instanceof OD?c.interpolation:void 0;return dO(o?new iwe(`camera`,i.value,c.labels,l,r):new iwe(`composite`,i.value,c.labels,l,r))}function vO(e){let t=null;if(e instanceof CSe)t=vO(e.result);else if(e instanceof PSe){for(let n of e.args)if(t=vO(n),t)break}else(e instanceof MSe||e instanceof OD)&&e.input instanceof iO&&e.input.name===`zoom`&&(t=e);return t instanceof NE||e.eachChild(e=>{let n=vO(e);n instanceof NE?t=n:!t&&n?t=new NE(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`):t&&n&&t!==n&&(t=new NE(``,`Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.`))}),t}function yO(e,t=new Set){return e instanceof nO&&t.add(e.key),e.eachChild(e=>{yO(e,t)}),t}function owe(e){let t={color:LE,string:FE,number:G,enum:FE,boolean:IE,formatted:HE,padding:UE,numberArray:GE,colorArray:WE,projectionDefinition:RE,resolvedImage:KE,variableAnchorOffsetCollection:qE};return e.type===`array`?JE(t[e.value]||BE,e.length):t[e.type]}function swe(e){if(e.type===`color`&&gO(e.default))return new uD(0,0,0,0);switch(e.type){case`color`:return uD.parse(e.default)||null;case`padding`:return mD.parse(e.default)||null;case`numberArray`:return hD.parse(e.default)||null;case`colorArray`:return gD.parse(e.default)||null;case`variableAnchorOffsetCollection`:return vD.parse(e.default)||null;case`projectionDefinition`:return bD.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function bO(e,t){let{zoom:n,heatmapDensity:r,elevation:i,lineProgress:a,isSupportedScript:o,accumulated:s}=e??{};return{zoom:n,heatmapDensity:r,elevation:i,lineProgress:a,isSupportedScript:o,accumulated:s,globalState:t}}function cwe(e){let t=!1;for(let n of e){let e=lwe(n);if(e===`expression`)return`expression`;e===`legacy`&&(t=!0)}return t?`legacy`:`neutral`}function lwe(e){if(typeof e==`boolean`)return`neutral`;if(!Array.isArray(e)||e.length===0)return`legacy`;switch(e[0]){case`has`:return e.length<2||e[1]===`$id`||e[1]===`$type`?`legacy`:e.length===2?`neutral`:`expression`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]))?`expression`:`legacy`;case`!in`:case`!has`:return`legacy`;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?`expression`:`legacy`;case`none`:return`legacy`;case`any`:case`all`:return cwe(e.slice(1));default:return`expression`}}function uwe(e){return lwe(e)!==`legacy`}function dwe(e){return e===`$type`?[`geometry-type`]:e===`$id`?[`id`]:[`get`,e]}function fwe(e){switch(e[0]){case`==`:case`!=`:case`<`:case`<=`:case`>`:case`>=`:return e.length!==3||typeof e[1]!=`string`?null:[e[0],dwe(e[1]),e[2]];case`in`:case`!in`:{if(e.length<2||typeof e[1]!=`string`)return null;let t=[`in`,dwe(e[1]),[`literal`,e.slice(2)]];return e[0]===`!in`?[`!`,t]:t}case`has`:case`!has`:{if(e.length!==2||typeof e[1]!=`string`||e[1]===`$type`||e[1]===`$id`)return null;let t=[`has`,e[1]];return e[0]===`!has`?[`!`,t]:t}default:return null}}function pwe(e){if((e[0]===`<`||e[0]===`<=`||e[0]===`>`||e[0]===`>=`)&&e[1]===`$type`)return`"$type" cannot be use with operator "${e[0]}"`;let t=fwe(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function xO(e,t,n){let r=n[e];return Array.isArray(r)?uwe(r)?mwe(r,t.concat(e)):{path:t.concat(e),legacyFilter:r}:null}function mwe(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case`all`:case`any`:case`none`:for(let n=1;n<e.length;n++){let r=xO(n,t,e);if(r)return r}break;case`!`:{let n=xO(1,t,e);if(n)return n;break}case`case`:for(let n=1;n<e.length-1;n+=2){let r=xO(n,t,e);if(r)return r}}return null}function hwe(e){let t=e.key,n=e.value;return n?[new W(t,n,`constants have been deprecated as of v8`)]:[]}function SO(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function CO(e){if(Array.isArray(e))return e.map(CO);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let n in e)t[n]=CO(e[n]);return t}return SO(e)}function wO(e){let t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,c=[],l=hO(n);if(l!==`object`)return[new W(t,n,`object expected, ${l} found`)];for(let e in n){let l=e.split(`.`)[0],u=aD(r,l)||r[`*`],d;if(aD(i,l))d=i[l];else if(aD(r,l)){if(n[e]===void 0)continue;d=s}else if(i[`*`])d=i[`*`];else if(r[`*`])d=s;else{c.push(new W(t,n[e],`unknown property "${e}"`));continue}c=c.concat(d({key:(t&&`${t}.`)+e,value:n[e],valueSpec:u,style:a,styleSpec:o,object:n,objectKey:e,validateSpec:s},n))}for(let e in r)i[e]||r[e].required&&r[e].default===void 0&&n[e]===void 0&&c.push(new W(t,n,`missing required property "${e}"`));return c}function TO(e){let t=e.value,n=e.valueSpec,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.key,s=e.arrayElementValidator||r;if(hO(t)!==`array`)return[new W(o,t,`array expected, ${hO(t)} found`)];if(n.length&&t.length!==n.length)return[new W(o,t,`array length ${n.length} expected, length ${t.length} found`)];let c={type:n.value,values:n.values};a.$version<7&&(c.function=n.function),hO(n.value)===`object`&&(c=n.value);let l=[];for(let n=0;n<t.length;n++)l=l.concat(s({array:t,arrayIndex:n,value:t[n],valueSpec:c,validateSpec:e.validateSpec,style:i,styleSpec:a,key:`${o}[${n}]`}));return l}function EO(e){let t=e.key,n=e.value,r=e.valueSpec,i=hO(n);return i===`number`&&n!==n&&(i=`NaN`),i===`number`?`minimum`in r&&n<r.minimum?[new W(t,n,`${n} is less than the minimum value ${r.minimum}`)]:`maximum`in r&&n>r.maximum?[new W(t,n,`${n} is greater than the maximum value ${r.maximum}`)]:[]:[new W(t,n,`number expected, ${i} found`)]}function gwe(e){let t=e.valueSpec,n=SO(e.value.type),r,i={},a,o,s=n!==`categorical`&&e.value.property===void 0,c=!s,l=hO(e.value.stops)===`array`&&hO(e.value.stops[0])===`array`&&hO(e.value.stops[0][0])===`object`,u=wO({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:d,default:m}});return n===`identity`&&s&&u.push(new W(e.key,e.value,`missing required property "property"`)),n!==`identity`&&!e.value.stops&&u.push(new W(e.key,e.value,`missing required property "stops"`)),n===`exponential`&&e.valueSpec.expression&&!QCe(e.valueSpec)&&u.push(new W(e.key,e.value,`exponential functions not supported`)),e.styleSpec.$version>=8&&(c&&!pO(e.valueSpec)?u.push(new W(e.key,e.value,`property functions not supported`)):s&&!ZCe(e.valueSpec)&&u.push(new W(e.key,e.value,`zoom functions not supported`))),(n===`categorical`||l)&&e.value.property===void 0&&u.push(new W(e.key,e.value,`"property" property is required`)),u;function d(e){if(n===`identity`)return[new W(e.key,e.value,`identity function may not have a "stops" property`)];let t=[],r=e.value;return t=t.concat(TO({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:f})),hO(r)===`array`&&r.length===0&&t.push(new W(e.key,r,`array must have at least one stop`)),t}function f(e){let n=[],r=e.value,s=e.key;if(hO(r)!==`array`)return[new W(s,r,`array expected, ${hO(r)} found`)];if(r.length!==2)return[new W(s,r,`array length 2 expected, length ${r.length} found`)];if(l){if(hO(r[0])!==`object`)return[new W(s,r,`object expected, ${hO(r[0])} found`)];if(r[0].zoom===void 0)return[new W(s,r,`object stop key must have zoom`)];if(r[0].value===void 0)return[new W(s,r,`object stop key must have value`)];if(o&&o>SO(r[0].zoom))return[new W(s,r[0].zoom,`stop zoom values must appear in ascending order`)];SO(r[0].zoom)!==o&&(o=SO(r[0].zoom),a=void 0,i={}),n=n.concat(wO({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:EO,value:p}}))}else n=n.concat(p({key:`${s}[0]`,value:r[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},r));return nwe(CO(r[1]))?n.concat([new W(`${s}[1]`,r[1],`expressions are not allowed in function stops.`)]):n.concat(e.validateSpec({key:`${s}[1]`,value:r[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,o){let s=hO(e.value),c=SO(e.value),l=e.value===null?o:e.value;if(!r)r=s;else if(s!==r)return[new W(e.key,l,`${s} stop domain type must match previous stop domain type ${r}`)];if(s!==`number`&&s!==`string`&&s!==`boolean`)return[new W(e.key,l,`stop domain value must be a number, string, or boolean`)];if(s!==`number`&&n!==`categorical`){let r=`number expected, ${s} found`;return pO(t)&&n===void 0&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new W(e.key,l,r)]}return n===`categorical`&&s===`number`&&(!isFinite(c)||Math.floor(c)!==c)?[new W(e.key,l,`integer expected, found ${c}`)]:n!==`categorical`&&s===`number`&&a!==void 0&&c<a?[new W(e.key,l,`stop domain values must appear in ascending order`)]:(a=c,n===`categorical`&&c in i?[new W(e.key,l,`stop domain values must be unique`)]:(i[c]=!0,[]))}function m(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}function DO(e){let t=(e.expressionContext===`property`?awe:_O)(CO(e.value),e.key,e.valueSpec);if(t.result===`error`)return t.value.map(t=>new W(`${e.key}${t.key}`,e.value,t.message));let n=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext===`property`&&e.propertyKey===`text-font`&&!n.outputDefined())return[new W(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext===`property`&&e.propertyType===`layout`&&!lO(n))return[new W(e.key,e.value,`"feature-state" data expressions are not supported with layout properties.`)];if(e.expressionContext===`filter`&&!lO(n))return[new W(e.key,e.value,`"feature-state" data expressions are not supported with filters.`)];if(e.expressionContext&&e.expressionContext.indexOf(`cluster`)===0){if(!uO(n,[`zoom`,`feature-state`]))return[new W(e.key,e.value,`"zoom" and "feature-state" expressions are not supported with cluster properties.`)];if(e.expressionContext===`cluster-initial`&&!cO(n))return[new W(e.key,e.value,`Feature data expressions are not supported with initial expression part of cluster properties.`)]}return[]}function _we(e){let t=e.value,n=e.key,r=hO(t);return r===`boolean`?[]:[new W(n,t,`boolean expected, ${r} found`)]}function OO(e){let t=e.key,n=e.value,r=hO(n);return r===`string`?uD.parse(String(n))?[]:[new W(t,n,`color expected, "${n}" found`)]:[new W(t,n,`color expected, ${r} found`)]}function kO(e){let t=e.key,n=e.value,r=e.valueSpec,i=[];return Array.isArray(r.values)?r.values.indexOf(SO(n))===-1&&i.push(new W(t,n,`expected one of [${r.values.join(`, `)}], ${JSON.stringify(n)} found`)):Object.keys(r.values).indexOf(SO(n))===-1&&i.push(new W(t,n,`expected one of [${Object.keys(r.values).join(`, `)}], ${JSON.stringify(n)} found`)),i}function vwe(e,t){let n=e;for(let e of t)n=n[e];return n}function ywe(e,t){let n=mwe(t);return n?[new W(`${e.key}${n.path.map(e=>`[${e}]`).join(``)}`,vwe(e.value,n.path),pwe(n.legacyFilter),null,`warning`)]:[]}function AO(e){let t=CO(e.value);return uwe(t)?[...ywe(e,t),...DO(mO({},e,{expressionContext:`filter`,valueSpec:{value:`boolean`}}))]:bwe(e)}function bwe(e){let t=e.value,n=e.key;if(hO(t)!==`array`)return[new W(n,t,`array expected, ${hO(t)} found`)];let r=e.styleSpec,i,a=[];if(t.length<1)return[new W(n,t,`filter array must have at least 1 element`)];switch(a=a.concat(kO({key:`${n}[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),SO(t[0])){case`<`:case`<=`:case`>`:case`>=`:t.length>=2&&SO(t[1])===`$type`&&a.push(new W(n,t,`"$type" cannot be use with operator "${t[0]}"`));case`==`:case`!=`:t.length!==3&&a.push(new W(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case`in`:case`!in`:t.length>=2&&(i=hO(t[1]),i!==`string`&&a.push(new W(`${n}[1]`,t[1],`string expected, ${i} found`)));for(let o=2;o<t.length;o++)i=hO(t[o]),SO(t[1])===`$type`?a=a.concat(kO({key:`${n}[${o}]`,value:t[o],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):i!==`string`&&i!==`number`&&i!==`boolean`&&a.push(new W(`${n}[${o}]`,t[o],`string, number, or boolean expected, ${i} found`));break;case`any`:case`all`:case`none`:for(let r=1;r<t.length;r++)a=a.concat(bwe({key:`${n}[${r}]`,value:t[r],style:e.style,styleSpec:e.styleSpec}));break;case`has`:case`!has`:i=hO(t[1]),t.length===2?i!==`string`&&a.push(new W(`${n}[1]`,t[1],`string expected, ${i} found`)):a.push(new W(n,t,`filter array for "${t[0]}" operator must have 2 elements`))}return a}function xwe(e,t){let n=e.key,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,c=a[`${t}_${e.layerType}`];if(!c)return[];let l=s.match(/^(.*)-transition$/);if(t===`paint`&&l&&c[l[1]]&&c[l[1]].transition)return r({key:n,value:o,valueSpec:a.transition,style:i,styleSpec:a});let u=e.valueSpec||c[s];if(!u)return[new W(n,o,`unknown property "${s}"`)];let d;if(hO(o)===`string`&&pO(u)&&!u.tokens&&(d=/^{([^}]+)}$/.exec(o)))return[new W(n,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(d[1])} }\`.`)];let f=[];return e.layerType===`symbol`&&s===`text-font`&&gO(CO(o))&&SO(o.type)===`identity`&&f.push(new W(n,o,`"text-font" does not support identity functions`)),f.concat(r({key:e.key,value:o,valueSpec:u,style:i,styleSpec:a,expressionContext:`property`,propertyType:t,propertyKey:s}))}function Swe(e){return xwe(e,`paint`)}function Cwe(e){return xwe(e,`layout`)}function wwe(e){let t=[],n=e.value,r=e.key,i=e.style,a=e.styleSpec;if(hO(n)!==`object`)return[new W(r,n,`object expected, ${hO(n)} found`)];!n.type&&!n.ref&&t.push(new W(r,n,`either "type" or "ref" is required`));let o=SO(n.type),s=SO(n.ref);if(n.id){let a=SO(n.id);for(let o=0;o<e.arrayIndex;o++){let e=i.layers[o];SO(e.id)===a&&t.push(new W(r,n.id,`duplicate layer id "${n.id}", previously used at line ${e.id.__line__}`))}}if(`ref`in n){[`type`,`source`,`source-layer`,`filter`,`layout`].forEach(e=>{e in n&&t.push(new W(r,n[e],`"${e}" is prohibited for ref layers`))});let e;i.layers.forEach(t=>{SO(t.id)===s&&(e=t)}),e?e.ref?t.push(new W(r,n.ref,`ref cannot reference another ref layer`)):o=SO(e.type):t.push(new W(r,n.ref,`ref layer "${s}" not found`))}else if(o!==`background`)if(!n.source)t.push(new W(r,n,`missing required property "source"`));else{let e=i.sources&&i.sources[n.source],a=e&&SO(e.type);e?a===`vector`&&o===`raster`?t.push(new W(r,n.source,`layer "${n.id}" requires a raster source`)):a!==`raster-dem`&&o===`hillshade`||a!==`raster-dem`&&o===`color-relief`?t.push(new W(r,n.source,`layer "${n.id}" requires a raster-dem source`)):a===`raster`&&o!==`raster`?t.push(new W(r,n.source,`layer "${n.id}" requires a vector source`)):a===`vector`&&!n[`source-layer`]?t.push(new W(r,n,`layer "${n.id}" must specify a "source-layer"`)):a===`raster-dem`&&o!==`hillshade`&&o!==`color-relief`?t.push(new W(r,n.source,`raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.`)):o===`line`&&n.paint&&n.paint[`line-gradient`]&&(a!==`geojson`||!e.lineMetrics)&&t.push(new W(r,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new W(r,n.source,`source "${n.source}" not found`))}return o===`raster`&&n.paint?.resampling&&n.paint?.[`raster-resampling`]&&t.push(new W(r,n.paint,`layer "${n.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),t=t.concat(wO({key:r,value:n,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${r}.type`,value:n.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:n,objectKey:`type`})},filter:AO,layout(e){return wO({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return Cwe(mO({layerType:o},e))}}})},paint(e){return wO({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return Swe(mO({layerType:o},e))}}})}}})),t}function jO(e){let t=e.value,n=e.key,r=hO(t);return r===`string`?[]:[new W(n,t,`string expected, ${r} found`)]}function Twe(e){let t=e.sourceName??``,n=e.value,r=e.styleSpec,i=r.source_raster_dem,a=e.style,o=[],s=hO(n);if(n===void 0)return o;if(s!==`object`)return o.push(new W(`source_raster_dem`,n,`object expected, ${s} found`)),o;let c=SO(n.encoding)===`custom`,l=[`redFactor`,`greenFactor`,`blueFactor`,`baseShift`],u=e.value.encoding?`"${e.value.encoding}"`:`Default`;for(let s in n)!c&&l.includes(s)?o.push(new W(s,n[s],`In "${t}": "${s}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):i[s]?o=o.concat(e.validateSpec({key:s,value:n[s],valueSpec:i[s],validateSpec:e.validateSpec,style:a,styleSpec:r})):o.push(new W(s,n[s],`unknown property "${s}"`));return o}var Ewe={promoteId:Owe};function Dwe(e){let t=e.value,n=e.key,r=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new W(n,t,`"type" is required`)];let o=SO(t.type),s;switch(o){case`vector`:case`raster`:return s=wO({key:n,value:t,valueSpec:r[`source_${o.replace(`-`,`_`)}`],style:e.style,styleSpec:r,objectElementValidators:Ewe,validateSpec:a}),s;case`raster-dem`:return s=Twe({sourceName:n,value:t,style:e.style,styleSpec:r,validateSpec:a}),s;case`geojson`:if(s=wO({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,validateSpec:a,objectElementValidators:Ewe}),t.cluster)for(let e in t.clusterProperties){let[r,i]=t.clusterProperties[e],o=typeof r==`string`?[r,[`accumulated`],[`get`,e]]:r;s.push(...DO({key:`${n}.${e}.map`,value:i,validateSpec:a,expressionContext:`cluster-map`})),s.push(...DO({key:`${n}.${e}.reduce`,value:o,validateSpec:a,expressionContext:`cluster-reduce`}))}return s;case`video`:return wO({key:n,value:t,valueSpec:r.source_video,style:i,validateSpec:a,styleSpec:r});case`image`:return wO({key:n,value:t,valueSpec:r.source_image,style:i,validateSpec:a,styleSpec:r});case`canvas`:return[new W(n,null,`Please use runtime APIs to add canvas sources, rather than 
314including them in stylesheets.`,`source.canvas`)];default:return kO({key:`${n}.type`,value:t.type,valueSpec:{values:[`vector`,`raster`,`raster-dem`,`geojson`,`video`,`image`]},style:i,validateSpec:a,styleSpec:r})}}function Owe({key:e,value:t}){if(hO(t)===`string`)return jO({key:e,value:t});{let n=[];for(let r in t)n.push(...jO({key:`${e}.${r}`,value:t[r]}));return n}}function kwe(e){let t=e.value,n=e.styleSpec,r=n.light,i=e.style,a=[],o=hO(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new W(`light`,t,`object expected, ${o} found`)]),a;for(let o in t){let s=o.match(/^(.*)-transition$/);a=s&&r[s[1]]&&r[s[1]].transition?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:n.transition,validateSpec:e.validateSpec,style:i,styleSpec:n})):r[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n})):a.concat([new W(o,t[o],`unknown property "${o}"`)])}return a}function Awe(e){let t=e.value,n=e.styleSpec,r=n.sky,i=e.style,a=hO(t);if(t===void 0)return[];if(a!==`object`)return[new W(`sky`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n})):o.concat([new W(a,t[a],`unknown property "${a}"`)]);return o}function jwe(e){let t=e.value,n=e.styleSpec,r=n.terrain,i=e.style,a=[],o=hO(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new W(`terrain`,t,`object expected, ${o} found`)]),a;for(let o in t)a=r[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n})):a.concat([new W(o,t[o],`unknown property "${o}"`)]);return a}function Mwe(e){return jO(e).length===0?[]:DO(e)}function Nwe(e){return jO(e).length===0?[]:DO(e)}function Pwe(e){let t=e.key,n=e.value;if(hO(n)===`array`){if(n.length<1||n.length>4)return[new W(t,n,`padding requires 1 to 4 values; ${n.length} values found`)];let r={type:`number`},i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}else return EO({key:t,value:n,valueSpec:{}})}function Fwe(e){let t=e.key,n=e.value;if(hO(n)===`array`){let r={type:`number`};if(n.length<1)return[new W(t,n,`array length at least 1 expected, length 0 found`)];let i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}else return EO({key:t,value:n,valueSpec:{}})}function Iwe(e){let t=e.key,n=e.value;if(hO(n)===`array`){if(n.length<1)return[new W(t,n,`array length at least 1 expected, length 0 found`)];let e=[];for(let r=0;r<n.length;r++)e=e.concat(OO({key:`${t}[${r}]`,value:n[r],valueSpec:{}}));return e}else return OO({key:t,value:n,valueSpec:{}})}function Lwe(e){let t=e.key,n=e.value,r=hO(n),i=e.styleSpec;if(r!==`array`||n.length<1||n.length%2!=0)return[new W(t,n,`variableAnchorOffsetCollection requires a non-empty array of even length`)];let a=[];for(let r=0;r<n.length;r+=2)a=a.concat(kO({key:`${t}[${r}]`,value:n[r],valueSpec:i.layout_symbol[`text-anchor`]})),a=a.concat(TO({key:`${t}[${r+1}]`,value:n[r+1],valueSpec:{length:2,value:`number`},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a}function Rwe(e){let t=[],n=e.value,r=e.key;if(Array.isArray(n)){let i=[],a=[];for(let o in n)n[o].id&&i.includes(n[o].id)&&t.push(new W(r,n,`all the sprites' ids must be unique, but ${n[o].id} is duplicated`)),i.push(n[o].id),n[o].url&&a.includes(n[o].url)&&t.push(new W(r,n,`all the sprites' URLs must be unique, but ${n[o].url} is duplicated`)),a.push(n[o].url),t=t.concat(wO({key:`${r}[${o}]`,value:n[o],valueSpec:{id:{type:`string`,required:!0},url:{type:`string`,required:!0}},validateSpec:e.validateSpec}));return t}else return jO({key:r,value:n})}function zwe(e){let t=e.value,n=e.styleSpec,r=n.projection,i=e.style,a=hO(t);if(t===void 0)return[];if(a!==`object`)return[new W(`projection`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n})):o.concat([new W(a,t[a],`unknown property "${a}"`)]);return o}function Bwe(e){let t=e.key,n=e.value;n=n instanceof String?n.valueOf():n;let r=hO(n);return r===`array`&&!Hwe(n)&&!Vwe(n)?[new W(t,n,`projection expected, invalid array ${JSON.stringify(n)} found`)]:[`array`,`string`].includes(r)?[]:[new W(t,n,`projection expected, invalid type "${r}" found`)]}function Vwe(e){return!![`interpolate`,`step`,`literal`].includes(e[0])}function Hwe(e){return Array.isArray(e)&&e.length===3&&typeof e[0]==`string`&&typeof e[1]==`string`&&typeof e[2]==`number`}function Uwe(e){return!!e&&e.constructor===Object}function Wwe(e){return Uwe(e.value)?[]:[new W(e.key,e.value,`object expected, ${hO(e.value)} found`)]}function Gwe(e){let t=e.key,n=e.value,r=e.validateSpec,i=e.styleSpec,a=e.style;if(!Uwe(n))return[new W(t,n,`object expected, ${hO(n)} found`)];let o=[];for(let e in n){let s=n[e],c=hO(s);if(c===`string`)o.push(...jO({key:`${t}.${e}`,value:s}));else if(c===`array`){let n={url:{type:`string`,required:!0}
314,"unicode-range":{type:`array`,value:`string`}};for(let[c,l]of s.entries())o.push(...wO({key:`${t}.${e}[${c}]`,value:l,valueSpec:n,styleSpec:i,style:a,validateSpec:r}))}else o.push(new W(`${t}.${e}`,s,`string or array expected, ${c} found`))}return o}var Kwe={"*"(){return[]},array:TO,boolean:_we,number:EO,color:OO,constants:hwe,enum:kO,filter:AO,function:gwe,layer:wwe,object:wO,source:Dwe,light:kwe,sky:Awe,terrain:jwe,projection:zwe,projectionDefinition:Bwe,string:jO,formatted:Mwe,resolvedImage:Nwe,padding:Pwe,numberArray:Fwe,colorArray:Iwe,variableAnchorOffsetCollection:Lwe,sprite:Rwe,state:Wwe,fontFaces:Gwe};function MO(e){let t=e.value,n=e.valueSpec,r=e.styleSpec;return e.validateSpec=MO,n.expression&&gO(SO(t))?gwe(e):n.expression&&nwe(CO(t))?DO(e):n.type&&Kwe[n.type]?Kwe[n.type](e):wO(mO({},e,{valueSpec:n.type?r[n.type]:n}))}function qwe(e){let t=e.value,n=e.key,r=jO(e);return r.length?r:(t.indexOf(`{fontstack}`)===-1&&r.push(new W(n,t,`"glyphs" url must include a "{fontstack}" token`)),t.indexOf(`{range}`)===-1&&r.push(new W(n,t,`"glyphs" url must include a "{range}" token`)),r)}function NO(e,t=qxe){let n=[];return n=n.concat(MO({key:``,value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:MO,objectElementValidators:{glyphs:qwe,"*"(){return[]}}})),e.constants&&(n=n.concat(hwe({key:`constants`,value:e.constants,style:e,styleSpec:t,validateSpec:MO}))),Jwe(n)}NO.source=FO(PO(Dwe)),NO.sprite=FO(PO(Rwe)),NO.glyphs=FO(PO(qwe)),NO.light=FO(PO(kwe)),NO.sky=FO(PO(Awe)),NO.terrain=FO(PO(jwe)),NO.state=FO(PO(Wwe)),NO.layer=FO(PO(wwe)),NO.filter=FO(PO(AO)),NO.paintProperty=FO(PO(Swe)),NO.layoutProperty=FO(PO(Cwe));function PO(e){return function(t){return e(Object.assign({},t,{validateSpec:MO}))}}function Jwe(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function FO(e){return function(...t){return Jwe(e.apply(this,t))}}function Ywe(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function*Xwe(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}function Zwe(e,t){let n,r;if(t===void 0)for(let t of e)t!=null&&(n===void 0?t>=t&&(n=r=t):(n>t&&(n=t),r<t&&(r=t)));else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}var IO=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let t=this._partials,n=0;for(let r=0;r<this._n&&r<32;r++){let i=t[r],a=e+i,o=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);o&&(t[n++]=o),e=a}return t[n]=e,this._n=n+1,this}valueOf(){let e=this._partials,t=this._n,n,r,i,a=0;if(t>0){for(a=e[--t];t>0&&(n=a,r=e[--t],a=n+r,i=r-(a-n),!i););t>0&&(i<0&&e[t-1]<0||i>0&&e[t-1]>0)&&(r=i*2,n=a+r,r==n-a&&(a=n))}return a}};function Qwe(e=Ywe){if(e===Ywe)return $we;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function $we(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}function eTe(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);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 tTe(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);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 nTe(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?$we:Qwe(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));nTe(e,t,u,d,i)}let a=e[t],o=n,s=r;for(LO(e,n,t),i(e[r],a)>0&&LO(e,n,r);o<s;){for(LO(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?LO(e,n,s):(++s,LO(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function LO(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function rTe(e,t,n){if(e=Float64Array.from(Xwe(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return tTe(e);if(t>=1)return eTe(e);var r,i=(r-1)*t,a=Math.floor(i),o=eTe(nTe(e,a).subarray(0,a+1));return o+(tTe(e.subarray(a+1))-o)*(i-a)}}function*iTe(e){for(let t of e)yield*t}function aTe(e){return Array.from(iTe(e))}function oTe(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,a=Array(i);++r<i;)a[r]=e+r*n;return a}var RO=1e-6,zO=Math.PI,BO=zO/2,sTe=zO/4,VO=zO*2,HO=180/zO,UO=zO/180,WO=Math.abs,cTe=Math.atan,GO=Math.atan2,KO=Math.cos,lTe=Math.exp,uTe=Math.log,qO=Math.sin,JO=Math.sign||function(e){return e>0?1:e<0?-1:0},YO=Math.sqrt,dTe=Math.tan;function fTe(e){return e>1?0:e<-1?zO:Math.acos(e)}function XO(e){return e>1?BO:e<-1?-BO:Math.asin(e)}function ZO(){}
vendor: 21,650 bytes, line 314
314function QO(e,t){e&&ek.hasOwnProperty(e.type)&&ek[e.type](e,t)}var $O={Feature:function(e,t){QO(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)QO(n[r].geometry,t)}},ek={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){tk(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)tk(n[r],t,0)},Polygon:function(e,t){nk(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)nk(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)QO(n[r],t)}};function tk(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function nk(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)tk(e[n],t,1);t.polygonEnd()}function rk(e,t){e&&$O.hasOwnProperty(e.type)?$O[e.type](e,t):QO(e,t)}function ik(e){return[GO(e[1],e[0]),XO(e[2])]}function ak(e){var t=e[0],n=e[1],r=KO(n);return[r*KO(t),r*qO(t),qO(n)]}function ok(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function sk(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 ck(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function lk(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function uk(e){var t=YO(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function dk(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function fk(e,t){return WO(e)>zO&&(e-=Math.round(e/VO)*VO),[e,t]}fk.invert=fk;function pk(e,t,n){return(e%=VO)?t||n?dk(hk(e),gk(t,n)):hk(e):t||n?gk(t,n):fk}function mk(e){return function(t,n){return t+=e,WO(t)>zO&&(t-=Math.round(t/VO)*VO),[t,n]}}function hk(e){var t=mk(e);return t.invert=mk(-e),t}function gk(e,t){var n=KO(e),r=qO(e),i=KO(t),a=qO(t);function o(e,t){var o=KO(t),s=KO(e)*o,c=qO(e)*o,l=qO(t),u=l*n+s*r;return[GO(c*i-u*a,s*n-l*r),XO(u*i+c*a)]}return o.invert=function(e,t){var o=KO(t),s=KO(e)*o,c=qO(e)*o,l=qO(t),u=l*i-c*a;return[GO(c*i+l*a,s*n+u*r),XO(u*n-s*r)]},o}function pTe(e){e=pk(e[0]*UO,e[1]*UO,e.length>2?e[2]*UO:0);function t(t){return t=e(t[0]*UO,t[1]*UO),t[0]*=HO,t[1]*=HO,t}return t.invert=function(t){return t=e.invert(t[0]*UO,t[1]*UO),t[0]*=HO,t[1]*=HO,t},t}function mTe(e,t,n,r,i,a){if(n){var o=KO(t),s=qO(t),c=r*n;i==null?(i=t+r*VO,a=t-c/2):(i=_k(o,i),a=_k(o,a),(r>0?i<a:i>a)&&(i+=r*VO));for(var l,u=i;r>0?u>a:u<a;u-=c)l=ik([o,-s*KO(u),-s*qO(u)]),e.point(l[0],l[1])}}function _k(e,t){t=ak(t),t[0]-=e,uk(t);var n=fTe(-t[1]);return((-t[2]<0?-n:n)+VO-RO)%VO}function vk(){var e=[],t;return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:ZO,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function yk(e,t){return WO(e[0]-t[0])<1e-6&&WO(e[1]-t[1])<1e-6}function bk(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function xk(e,t,n,r,i){var a=[],o=[],s,c;if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t],c;if(yk(n,r)){if(!n[2]&&!r[2]){for(i.lineStart(),s=0;s<t;++s)i.point((n=e[s])[0],n[1]);i.lineEnd();return}r[0]+=2*RO}a.push(c=new bk(n,e,null,!0)),o.push(c.o=new bk(n,null,c,!1)),a.push(c=new bk(r,e,null,!1)),o.push(c.o=new bk(r,null,c,!0))}}),a.length){for(o.sort(t),Sk(a),Sk(o),s=0,c=o.length;s<c;++s)o[s].e=n=!n;for(var l=a[0],u,d;;){for(var f=l,p=!0;f.v;)if((f=f.n)===l)return;u=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(s=0,c=u.length;s<c;++s)i.point((d=u[s])[0],d[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(u=f.p.z,s=u.length-1;s>=0;--s)i.point((d=u[s])[0],d[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,u=f.z,p=!p}while(!f.v);i.lineEnd()}}}function Sk(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function Ck(e){return WO(e[0])<=zO?e[0]:JO(e[0])*((WO(e[0])+zO)%VO-zO)}function hTe(e,t){var n=Ck(t),r=t[1],i=qO(r),a=[qO(n),-KO(n),0],o=0,s=0,c=new IO;i===1?r=BO+RO:i===-1&&(r=-BO-RO);for(var l=0,u=e.length;l<u;++l)if(f=(d=e[l]).length)for(var d,f,p=d[f-1],m=Ck(p),h=p[1]/2+sTe,g=qO(h),_=KO(h),v=0;v<f;++v,m=b,g=S,_=C,p=y){var y=d[v],b=Ck(y),x=y[1]/2+sTe,S=qO(x),C=KO(x),w=b-m,T=w>=0?1:-1,E=T*w,D=E>zO,O=g*S;if(c.add(GO(O*T*qO(E),_*C+O*KO(E))),o+=D?w+T*VO:w,D^m>=n^b>=n){var k=sk(ak(p),ak(y));uk(k);var A=sk(a,k);uk(A);var j=(D^w>=0?-1:1)*XO(A[2]);(r>j||r===j&&(k[0]||k[1]))&&(s+=D^w>=0?1:-1)}}return(o<-1e-6||o<1e-6&&c<-1e-12)^s&1}function wk(e,t,n,r){return function(i){var a=t(i),o=vk(),s=t(o),c=!1,l,u,d,f={point:p,lineStart:h,lineEnd:g,polygonStart:function(){f.point=_,f.lineStart=v,f.lineEnd=y,u=[],l=[]},polygonEnd:function(){f.point=p,f.lineStart=h,f.lineEnd=g,u=aTe(u);var e=hTe(l,r);u.length?(c||=(i.polygonStart(),!0),xk(u,_Te,e,n,i)):e&&(c||=(i.polygonStart(),!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&=(i.polygonEnd(),!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(t,n){e(t,n)&&i.point(t,n)}function m(e,t){a.point(e,t)}function h(){f.point=m,a.lineStart()}function g(){f.point=p,a.lineEnd()}function _(e,t){d.push([e,t]),s.point(e,t)}function v(){s.lineStart(),d=[]}function y(){_(d[0][0],d[0][1]),s.lineEnd();var e=s.clean(),t=o.result(),n,r=t.length,a,f,p;if(d.pop(),l.push(d),d=null,r){if(e&1){if(f=t[0],(a=f.length-1)>0){for(c||=(i.polygonStart(),!0),i.lineStart(),n=0;n<a;++n)i.point((p=f[n])[0],p[1]);i.lineEnd()}return}r>1&&e&2&&t.push(t.pop().concat(t.shift())),u.push(t.filter(gTe))}}return f}}function gTe(e){return e.length>1}function _Te(e,t){return((e=e.x)[0]<0?e[1]-BO-RO:BO-e[1])-((t=t.x)[0]<0?t[1]-BO-RO:BO-t[1])}var Tk=wk(function(){return!0},vTe,bTe,[-zO,-BO]);function vTe(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,o){var s=a>0?zO:-zO,c=WO(a-t);WO(c-zO)<1e-6?(e.point(t,n=(n+o)/2>0?BO:-BO),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(a,n),i=0):r!==s&&c>=zO&&(WO(t-r)<1e-6&&(t-=r*RO),WO(a-s)<1e-6&&(a-=s*RO),n=yTe(t,n,a,o),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),i=0),e.point(t=a,n=o),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function yTe(e,t,n,r){var i,a,o=qO(e-n);return WO(o)>1e-6?cTe((qO(t)*(a=KO(r))*qO(n)-qO(r)*(i=KO(t))*qO(e))/(i*a*o)):(t+r)/2}function bTe(e,t,n,r){var i;if(e==null)i=n*BO,r.point(-zO,i),r.point(0,i),r.point(zO,i),r.point(zO,0),r.point(zO,-i),r.point(0,-i),r.point(-zO,-i),r.point(-zO,0),r.point(-zO,i);else if(WO(e[0]-t[0])>1e-6){var a=e[0]<t[0]?zO:-zO;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(t[0],t[1])}function xTe(e){var t=KO(e),n=2*UO,r=t>0,i=WO(t)>RO;function a(t,r,i,a){mTe(a,e,n,i,t,r)}function o(e,n){return KO(e)*KO(n)>t}function s(e){var t,n,a,s,u;return{lineStart:function(){s=a=!1,u=1},point:function(d,f){var p=[d,f],m,h=o(d,f),g=r?h?0:l(d,f):h?l(d+(d<0?zO:-zO),f):0;if(!t&&(s=a=h)&&e.lineStart(),h!==a&&(m=c(t,p),(!m||yk(t,m)||yk(p,m))&&(p[2]=1)),h!==a)u=0,h?(e.lineStart(),m=c(p,t),e.point(m[0],m[1])):(m=c(t,p),e.point(m[0],m[1],2),e.lineEnd()),t=m;else if(i&&t&&r^h){var _;!(g&n)&&(_=c(p,t,!0))&&(u=0,r?(e.lineStart(),e.point(_[0][0],_[0][1]),e.point(_[1][0],_[1][1]),e.lineEnd()):(e.point(_[1][0],_[1][1]),e.lineEnd(),e.lineStart(),e.point(_[0][0],_[0][1],3)))}h&&(!t||!yk(t,p))&&e.point(p[0],p[1]),t=p,a=h,n=g},lineEnd:function(){a&&e.lineEnd(),t=null},clean:function(){return u|(s&&a)<<1}}}function c(e,n,r){var i=ak(e),a=ak(n),o=[1,0,0],s=sk(i,a),c=ok(s,s),l=s[0],u=c-l*l;if(!u)return!r&&e;var d=t*c/u,f=-t*l/u,p=sk(o,s),m=lk(o,d);ck(m,lk(s,f));var h=p,g=ok(m,h),_=ok(h,h),v=g*g-_*(ok(m,m)-1);if(!(v<0)){var y=YO(v),b=lk(h,(-g-y)/_);if(ck(b,m),b=ik(b),!r)return b;var x=e[0],S=n[0],C=e[1],w=n[1],T;S<x&&(T=x,x=S,S=T);var E=S-x,D=WO(E-zO)<RO,O=D||E<1e-6;if(!D&&w<C&&(T=C,C=w,w=T),O?D?C+w>0^b[1]<(WO(b[0]-x)<1e-6?C:w):C<=b[1]&&b[1]<=w:E>zO^(x<=b[0]&&b[0]<=S)){var k=lk(h,(-g+y)/_);return ck(k,m),[b,ik(k)]}}}function l(t,n){var i=r?e:zO-e,a=0;return t<-i?a|=1:t>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return wk(o,s,a,r?[0,-e]:[-zO,e-zO])}function STe(e,t,n,r,i,a){var o=e[0],s=e[1],c=t[0],l=t[1],u=0,d=1,f=c-o,p=l-s,m=n-o;if(!(!f&&m>0)){if(m/=f,f<0){if(m<u)return;m<d&&(d=m)}else if(f>0){if(m>d)return;m>u&&(u=m)}if(m=i-o,!(!f&&m<0)){if(m/=f,f<0){if(m>d)return;m>u&&(u=m)}else if(f>0){if(m<u)return;m<d&&(d=m)}if(m=r-s,!(!p&&m>0)){if(m/=p,p<0){if(m<u)return;m<d&&(d=m)}else if(p>0){if(m>d)return;m>u&&(u=m)}if(m=a-s,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=o+u*f,e[1]=s+u*p),d<1&&(t[0]=o+d*f,t[1]=s+d*p),!0}}}}}var Ek=1e9,Dk=-Ek;function CTe(e,t,n,r){function i(i,a){return e<=i&&i<=n&&t<=a&&a<=r}function a(i,a,s,l){var u=0,d=0;if(i==null||(u=o(i,s))!==(d=o(a,s))||c(i,a)<0^s>0)do l.point(u===0||u===3?e:n,u>1?r:t);while((u=(u+s+4)%4)!==d);else l.point(a[0],a[1])}function o(r,i){return WO(r[0]-e)<1e-6?i>0?0:3:WO(r[0]-n)<1e-6?i>0?2:1:WO(r[1]-t)<1e-6?+(i>0):i>0?3:2}function s(e,t){return c(e.x,t.x)}function c(e,t){var n=o(e,1),r=o(t,1);return n===r?n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]:n-r}return function(o){var c=o,l=vk(),u,d,f,p,m,h,g,_,v,y,b,x={point:S,lineStart:E,lineEnd:D,polygonStart:w,polygonEnd:T};function S(e,t){i(e,t)&&c.point(e,t)}function C(){for(var t=0,n=0,i=d.length;n<i;++n)for(var a=d[n],o=1,s=a.length,c=a[0],l,u,f=c[0],p=c[1];o<s;++o)l=f,u=p,c=a[o],f=c[0],p=c[1],u<=r?p>r&&(f-l)*(r-u)>(p-u)*(e-l)&&++t:p<=r&&(f-l)*(r-u)<(p-u)*(e-l)&&--t;return t}function w(){c=l,u=[],d=[],b=!0}function T(){var e=C(),t=b&&e,n=(u=aTe(u)).length;(t||n)&&(o.polygonStart(),t&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),n&&xk(u,s,e,a,o),o.polygonEnd()),c=o,u=d=f=null}function E(){x.point=O,d&&d.push(f=[]),y=!0,v=!1,g=_=NaN}function D(){u&&(O(p,m),h&&v&&l.rejoin(),u.push(l.result())),x.point=S,v&&c.lineEnd()}function O(a,o){var s=i(a,o);if(d&&f.push([a,o]),y)p=a,m=o,h=s,y=!1,s&&(c.lineStart(),c.point(a,o));else if(s&&v)c.point(a,o);else{var l=[g=Math.max(Dk,Math.min(Ek,g)),_=Math.max(Dk,Math.min(Ek,_))],u=[a=Math.max(Dk,Math.min(Ek,a)),o=Math.max(Dk,Math.min(Ek,o))];STe(l,u,e,t,n,r)?(v||(c.lineStart(),c.point(l[0],l[1])),c.point(u[0],u[1]),s||c.lineEnd(),b=!1):s&&(c.lineStart(),c.point(a,o),b=!1)}g=a,_=o,v=s}return x}}var Ok=e=>e,kk=new IO,Ak=new IO,jk,Mk,Nk,Pk,Fk={point:ZO,lineStart:ZO,lineEnd:ZO,polygonStart:function(){Fk.lineStart=wTe,Fk.lineEnd=ETe},polygonEnd:function(){Fk.lineStart=Fk.lineEnd=Fk.point=ZO,kk.add(WO(Ak)),Ak=new IO},result:function(){var e=kk/2;return kk=new IO,e}};function wTe(){Fk.point=TTe}function TTe(e,t){Fk.point=Ik,jk=Nk=e,Mk=Pk=t}function Ik(e,t){Ak.add(Pk*e-Nk*t),Nk=e,Pk=t}function ETe(){Ik(jk,Mk)}var Lk=1/0,Rk=Lk,zk=-Lk,Bk=zk,Vk={point:DTe,lineStart:ZO,lineEnd:ZO,polygonStart:ZO,polygonEnd:ZO,result:function(){var e=[[Lk,Rk],[zk,Bk]];return zk=Bk=-(Rk=Lk=1/0),e}};function DTe(e,t){e<Lk&&(Lk=e),e>zk&&(zk=e),t<Rk&&(Rk=t),t>Bk&&(Bk=t)}var Hk=0,Uk=0,Wk=0,Gk=0,Kk=0,qk=0,Jk=0,Yk=0,Xk=0,Zk,Qk,$k,eA,tA={point:nA,lineStart:rA,lineEnd:iA,polygonStart:function(){tA.lineStart=ATe,tA.lineEnd=jTe},polygonEnd:function(){tA.point=nA,tA.lineStart=rA,tA.lineEnd=iA},result:function(){var e=Xk?[Jk/Xk,Yk/Xk]:qk?[Gk/qk,Kk/qk]:Wk?[Hk/Wk,Uk/Wk]:[NaN,NaN];return Hk=Uk=Wk=Gk=Kk=qk=Jk=Yk=Xk=0,e}};function nA(e,t){Hk+=e,Uk+=t,++Wk}function rA(){tA.point=OTe}function OTe(e,t){tA.point=kTe,nA($k=e,eA=t)}function kTe(e,t){var n=e-$k,r=t-eA,i=YO(n*n+r*r);Gk+=i*($k+e)/2,Kk+=i*(eA+t)/2,qk+=i,nA($k=e,eA=t)}function iA(){tA.point=nA}function ATe(){tA.point=MTe}function jTe(){aA(Zk,Qk)}function MTe(e,t){tA.point=aA,nA(Zk=$k=e,Qk=eA=t)}function aA(e,t){var n=e-$k,r=t-eA,i=YO(n*n+r*r);Gk+=i*($k+e)/2,Kk+=i*(eA+t)/2,qk+=i,i=eA*e-$k*t,Jk+=i*($k+e),Yk+=i*(eA+t),Xk+=i*3,nA($k=e,eA=t)}function oA(e){this._context=e}oA.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,VO);break}},result:ZO};var sA=new IO,cA,lA,uA,dA,fA,pA={point:ZO,lineStart:function(){pA.point=NTe},lineEnd:function(){cA&&mA(lA,uA),pA.point=ZO},polygonStart:function(){cA=!0},polygonEnd:function(){cA=null},result:function(){var e=+sA;return sA=new IO,e}};function NTe(e,t){pA.point=mA,lA=dA=e,uA=fA=t}function mA(e,t){dA-=e,fA-=t,sA.add(YO(dA*dA+fA*fA)),dA=e,fA=t}var hA,gA,_A,vA,yA=class{constructor(e){this._append=e==null?bA:PTe(e),this._radius=4.5,this._=``}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+=`Z`),this._point=NaN}point(e,t){switch(this._point){case 0:this._append`M${e},${t}`,this._point=1;break;case 1:this._append`L${e},${t}`;break;default:if(this._append`M${e},${t}`,this._radius!==_A||this._append!==gA){let e=this._radius,t=this._;this._=``,this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,_A=e,gA=this._append,vA=this._,this._=t}this._+=vA;break}}result(){let e=this._;return this._=``,e.length?e:null}};function bA(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function PTe(e){let t=Math.floor(e);if(!(t>=0))throw RangeError(`invalid digits: ${e}`);if(t>15)return bA;if(t!==hA){let e=10**t;hA=t,gA=function(t){let n=1;this._+=t[0];for(let r=t.length;n<r;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return gA}function FTe(e,t){let n=3,r=4.5,i,a;function o(e){return e&&(typeof r==`function`&&a.pointRadius(+r.apply(this,arguments)),rk(e,i(a))),a.result()}return o.area=function(e){return rk(e,i(Fk)),Fk.result()},o.measure=function(e){return rk(e,i(pA)),pA.result()},o.bounds=function(e){return rk(e,i(Vk)),Vk.result()},o.centroid=function(e){return rk(e,i(tA)),tA.result()},o.projection=function(t){return arguments.length?(i=t==null?(e=null,Ok):(e=t).stream,o):e},o.context=function(e){return arguments.length?(a=e==null?(t=null,new yA(n)):new oA(t=e),typeof r!=`function`&&a.pointRadius(r),o):t},o.pointRadius=function(e){return arguments.length?(r=typeof e==`function`?e:(a.pointRadius(+e),+e),o):r},o.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let t=Math.floor(e);if(!(t>=0))throw RangeError(`invalid digits: ${e}`);n=t}return t===null&&(a=new yA(n)),o},o.projection(e).digits(n).context(t)}function xA(e){return function(t){var n=new SA;for(var r in e)n[r]=e[r];return n.stream=t,n}}function SA(){}SA.prototype={constructor:SA,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 CA(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),rk(n,e.stream(Vk)),t(Vk.result()),r!=null&&e.clipExtent(r),e}function wA(e,t,n){return CA(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+t[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-a*(n[1][1]+n[0][1]))/2;e.scale(150*a).translate([o,s])},n)}function ITe(e,t,n){return wA(e,[[0,0],t],n)}function LTe(e,t,n){return CA(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];e.scale(150*i).translate([a,o])},n)}function RTe(e,t,n){return CA(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([a,o])},n)}var TA=16,zTe=KO(30*UO);function EA(e,t){return+t?VTe(e,t):BTe(e)}function BTe(e){return xA({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function VTe(e,t){function n(r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=l-r,v=u-i,y=_*_+v*v;if(y>4*t&&h--){var b=o+f,x=s+p,S=c+m,C=YO(b*b+x*x+S*S),w=XO(S/=C),T=WO(WO(S)-1)<1e-6||WO(a-d)<1e-6?(a+d)/2:GO(x,b),E=e(T,w),D=E[0],O=E[1],k=D-r,A=O-i,j=v*k-_*A;(j*j/y>t||WO((_*k+v*A)/y-.5)>.3||o*f+s*p+c*m<zTe)&&(n(r,i,a,o,s,c,D,O,T,b/=C,x/=C,S,h,g),g.point(D,O),n(D,O,T,b,x,S,l,u,d,f,p,m,h,g))}}return function(t){var r,i,a,o,s,c,l,u,d,f,p,m,h={point:g,lineStart:_,lineEnd:y,polygonStart:function(){t.polygonStart(),h.lineStart=b},polygonEnd:function(){t.polygonEnd(),h.lineStart=_}};function g(n,r){n=e(n,r),t.point(n[0],n[1])}function _(){u=NaN,h.point=v,t.lineStart()}function v(r,i){var a=ak([r,i]),o=e(r,i);n(u,d,l,f,p,m,u=o[0],d=o[1],l=r,f=a[0],p=a[1],m=a[2],TA,t),t.point(u,d)}function y(){h.point=g,t.lineEnd()}function b(){_(),h.point=x,h.lineEnd=S}function x(e,t){v(r=e,t),i=u,a=d,o=f,s=p,c=m,h.point=v}function S(){n(u,d,l,f,p,m,i,a,r,o,s,c,TA,t),h.lineEnd=y,y()}return h}}var HTe=xA({point:function(e,t){this.stream.point(e*UO,t*UO)}});function UTe(e){return xA({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function WTe(e,t,n,r,i){function a(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return a.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},a}function DA(e,t,n,r,i,a){if(!a)return WTe(e,t,n,r,i);var o=KO(a),s=qO(a),c=o*e,l=s*e,u=o/e,d=s/e,f=(s*n-o*t)/e,p=(s*t+o*n)/e;function m(e,a){return e*=r,a*=i,[c*e-l*a+t,n-l*e-c*a]}return m.invert=function(e,t){return[r*(u*e-d*t+f),i*(p-d*e-u*t)]},m}function OA(e){return kA(function(){return e})()}function kA(e){var t,n=150,r=480,i=250,a=0,o=0,s=0,c=0,l=0,u,d=0,f=1,p=1,m=null,h=Tk,g=null,_,v,y,b=Ok,x=.5,S,C,w,T,E;function D(e){return w(e[0]*UO,e[1]*UO)}function O(e){return e=w.invert(e[0],e[1]),e&&[e[0]*HO,e[1]*HO]}D.stream=function(e){return T&&E===e?T:T=HTe(UTe(u)(h(S(b(E=e)))))},D.preclip=function(e){return arguments.length?(h=e,m=void 0,A()):h},D.postclip=function(e){return arguments.length?(b=e,g=_=v=y=null,A()):b},D.clipAngle=function(e){return arguments.length?(h=+e?xTe(m=e*UO):(m=null,Tk),A()):m*HO},D.clipExtent=function(e){return arguments.length?(b=e==null?(g=_=v=y=null,Ok):CTe(g=+e[0][0],_=+e[0][1],v=+e[1][0],y=+e[1][1]),A()):g==null?null:[[g,_],[v,y]]},D.scale=function(e){return arguments.length?(n=+e,k()):n},D.translate=function(e){return arguments.length?(r=+e[0],i=+e[1],k()):[r,i]},D.center=function(e){return arguments.length?(a=e[0]%360*UO,o=e[1]%360*UO,k()):[a*HO,o*HO]},D.rotate=function(e){return arguments.length?(s=e[0]%360*UO,c=e[1]%360*UO,l=e.length>2?e[2]%360*UO:0,k()):[s*HO,c*HO,l*HO]},D.angle=function(e){return arguments.length?(d=e%360*UO,k()):d*HO},D.reflectX=function(e){return arguments.length?(f=e?-1:1,k()):f<0},D.reflectY=function(e){return arguments.length?(p=e?-1:1,k()):p<0},D.precision=function(e){return arguments.length?(S=EA(C,x=e*e),A()):YO(x)},D.fitExtent=function(e,t){return wA(D,e,t)},D.fitSize=function(e,t){return ITe(D,e,t)},D.fitWidth=function(e,t){return LTe(D,e,t)},D.fitHeight=function(e,t){return RTe(D,e,t)};function k(){var e=DA(n,0,0,f,p,d).apply(null,t(a,o)),m=DA(n,r-e[0],i-e[1],f,p,d);return u=pk(s,c,l),C=dk(t,m),w=dk(u,C),S=EA(C,x),A()}function A(){return T=E=null,D}return function(){return t=e.apply(this,arguments),D.invert=t.invert&&O,k()}}function AA(e){var t=0,n=zO/3,r=kA(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*UO,n=e[1]*UO):[t*HO,n*HO]},i}function GTe(e){var t=KO(e);function n(e,n){return[e*t,qO(n)/t]}return n.invert=function(e,n){return[e/t,XO(n*t)]},n}function KTe(e,t){var n=qO(e),r=(n+qO(t))/2;if(WO(r)<1e-6)return GTe(e);var i=1+n*(2*r-n),a=YO(i)/r;function o(e,t){var n=YO(i-2*r*qO(t))/r;return[n*qO(e*=r),a-n*KO(e)]}return o.invert=function(e,t){var n=a-t,o=GO(e,WO(n))*JO(n);return n*r<0&&(o-=zO*JO(e)*JO(n)),[o/r,XO((i-(e*e+n*n)*r*r)/(2*r))]},o}function qTe(){return AA(KTe).scale(155.424).center([0,33.6442])}function JTe(){return qTe().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function YTe(e){return function(t,n){var r=KO(t),i=KO(n),a=e(r*i);return a===1/0?[2,0]:[a*i*qO(t),a*qO(n)]}}function XTe(e){return function(t,n){var r=YO(t*t+n*n),i=e(r),a=qO(i),o=KO(i);return[GO(t*a,r*o),XO(r&&n*a/r)]}}var jA=YTe(function(e){return YO(2/(1+e))});jA.invert=XTe(function(e){return 2*XO(e/2)});function ZTe(){return OA(jA).scale(124.75).clipAngle(179.999)}function MA(e,t){return[e,uTe(dTe((BO+t)/2))]}MA.invert=function(e,t){return[e,2*cTe(lTe(t))-BO]};function QTe(){return $Te(MA).scale(961/VO)}function $Te(e){var t=OA(e),n=t.center,r=t.scale,i=t.translate,a=t.clipExtent,o=null,s,c,l;t.scale=function(e){return arguments.length?(r(e),u()):r()},t.translate=function(e){return arguments.length?(i(e),u()):i()},t.center=function(e){return arguments.length?(n(e),u()):n()},t.clipExtent=function(e){return arguments.length?(e==null?o=s=c=l=null:(o=+e[0][0],s=+e[0][1],c=+e[1][0],l=+e[1][1]),u()):o==null?null:[[o,s],[c,l]]};function u(){var n=zO*r(),i=t(pTe(t.rotate()).invert([0,0]));return a(o==null?[[i[0]-n,i[1]-n],[i[0]+n,i[1]+n]]:e===MA?[[Math.max(i[0]-n,o),s],[Math.min(i[0]+n,c),l]]:[[o,Math.max(i[1]-n,s)],[c,Math.min(i[1]+n,l)]])}return u()}function NA(e,t){return[e,t]}NA.invert=NA;function eEe(){return OA(NA).scale(152.63)}function tEe(e,t){var n=KO(e),r=e===t?qO(e):(n-KO(t))/(t-e),i=n/r+e;if(WO(r)<1e-6)return NA;function a(e,t){var n=i-t,a=r*e;return[n*qO(a),i-n*KO(a)]}return a.invert=function(e,t){var n=i-t,a=GO(e,WO(n))*JO(n);return n*r<0&&(a-=zO*JO(e)*JO(n)),[a/r,i-JO(r)*YO(e*e+n*n)]},a}function nEe(){return AA(tEe).scale(131.154).center([0,13.9389])}
314var PA=1.340264,FA=-.081106,IA=893e-6,LA=.003796,RA=YO(3)/2,rEe=12;function zA(e,t){var n=XO(RA*qO(t)),r=n*n,i=r*r*r;return[e*KO(n)/(RA*(PA+3*FA*r+i*(7*IA+9*LA*r))),n*(PA+FA*r+i*(IA+LA*r))]}zA.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,a=0,o,s,c;a<rEe&&(s=n*(PA+FA*r+i*(IA+LA*r))-t,c=PA+3*FA*r+i*(7*IA+9*LA*r),n-=o=s/c,r=n*n,i=r*r*r,!(WO(o)<1e-12));++a);return[RA*e*(PA+3*FA*r+i*(7*IA+9*LA*r))/KO(n),XO(qO(n)/RA)]};function iEe(){return OA(zA).scale(177.158)}var BA=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function aEe(e,t){return!!(e===t||BA(e)&&BA(t))}function oEe(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!aEe(e[n],t[n]))return!1;return!0}function VA(e,t){t===void 0&&(t=oEe);var n=null;function r(){var r=[...arguments];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}var sEe=i((e=>{var t=Ve(),n=Mr();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=Symbol.for(`react.transitional.element`),a=Symbol.for(`react.portal`),o=Symbol.for(`react.fragment`),s=Symbol.for(`react.strict_mode`),c=Symbol.for(`react.profiler`),l=Symbol.for(`react.consumer`),u=Symbol.for(`react.context`),d=Symbol.for(`react.forward_ref`),f=Symbol.for(`react.suspense`),p=Symbol.for(`react.suspense_list`),m=Symbol.for(`react.memo`),h=Symbol.for(`react.lazy`),g=Symbol.for(`react.scope`),_=Symbol.for(`react.activity`),v=Symbol.for(`react.legacy_hidden`),y=Symbol.for(`react.memo_cache_sentinel`),b=Symbol.for(`react.view_transition`),x=Symbol.iterator;function S(e){return typeof e!=`object`||!e?null:(e=x&&e[x]||e[`@@iterator`],typeof e==`function`?e:null)}var C=Array.isArray;function w(e,t){var n=e.length&3,r=e.length-n,i=t;for(t=0;t<r;){var a=e.charCodeAt(t)&255|(e.charCodeAt(++t)&255)<<8|(e.charCodeAt(++t)&255)<<16|(e.charCodeAt(++t)&255)<<24;++t,a=3432918353*(a&65535)+((3432918353*(a>>>16)&65535)<<16)&4294967295,a=a<<15|a>>>17,a=461845907*(a&65535)+((461845907*(a>>>16)&65535)<<16)&4294967295,i^=a,i=i<<13|i>>>19,i=5*(i&65535)+((5*(i>>>16)&65535)<<16)&4294967295,i=(i&65535)+27492+(((i>>>16)+58964&65535)<<16)}switch(a=0,n){case 3:a^=(e.charCodeAt(t+2)&255)<<16;case 2:a^=(e.charCodeAt(t+1)&255)<<8;case 1:a^=e.charCodeAt(t)&255,a=3432918353*(a&65535)+((3432918353*(a>>>16)&65535)<<16)&4294967295,a=a<<15|a>>>17,i^=461845907*(a&65535)+((461845907*(a>>>16)&65535)<<16)&4294967295}return i^=e.length,i^=i>>>16,i=2246822507*(i&65535)+((2246822507*(i>>>16)&65535)<<16)&4294967295,i^=i>>>13,i=3266489909*(i&65535)+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^i>>>16)>>>0}var T=Object.assign,E=Object.prototype.hasOwnProperty,D=RegExp(`^[: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]*$`),O={},k={};function A(e){return E.call(k,e)?!0:E.call(O,e)?!1:D.test(e)?k[e]=!0:(O[e]=!0,!1)}var j=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `)),M=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`
314clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),N=/["'&<>]/;function P(e){if(typeof e==`boolean`||typeof e==`number`||typeof e==`bigint`)return``+e;e=``+e;var t=N.exec(e);if(t){var n=``,r,i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=`&quot;`;break;case 38:t=`&amp;`;break;case 39:t=`&#x27;`;break;case 60:t=`&lt;`;break;case 62:t=`&gt;`;break;default:continue}i!==r&&(n+=e.slice(i,r)),i=r+1,n+=t}e=i===r?n:n+e.slice(i,r)}return e}var F=/([A-Z])/g,I=/^ms-/,L=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function R(e){return L.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}var ee=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=z.d;z.d={f:ne.f,r:ne.r,D:lt,C:ut,L:dt,m:ft,X:mt,S:pt,M:ht};var re=[],ie=null,ae=/(<\/|<)(s)(cript)/gi;function oe(e,t,n,r){return``+t+(n===`s`?`\\u0073`:`\\u0053`)+r}function se(e,t,n,r,i){return{idPrefix:e===void 0?``:e,nextFormID:0,streamingFormat:0,bootstrapScriptContent:n,bootstrapScripts:r,bootstrapModules:i,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function ce(e,t,n,r){return{insertionMode:e,selectedValue:t,tagScope:n,viewTransition:r}}function le(e,t,n){var r=e.tagScope&-25;switch(t){case`noscript`:return ce(2,null,r|1,null);case`select`:return ce(2,n.value==null?n.defaultValue:n.value,r,null);case`svg`:return ce(4,null,r,null);case`picture`:return ce(2,null,r|2,null);case`math`:return ce(5,null,r,null);case`foreignObject`:return ce(2,null,r,null);case`table`:return ce(6,null,r,null);case`thead`:case`tbody`:case`tfoot`:return ce(7,null,r,null);case`colgroup`:return ce(9,null,r,null);case`tr`:return ce(8,null,r,null);case`head`:if(2>e.insertionMode)return ce(3,null,r,null);break;case`html`:if(e.insertionMode===0)return ce(1,null,r,null)}return 6<=e.insertionMode||2>e.insertionMode?ce(2,null,r,null):e.tagScope===r?e:ce(e.insertionMode,e.selectedValue,r,null)}function ue(e){return e===null?null:{update:e.update,enter:`none`,exit:`none`,share:e.update,name:e.autoName,autoName:e.autoName,nameIdx:0}}function de(e,t){return t.tagScope&32&&(e.instructions|=128),ce(t.insertionMode,t.selectedValue,t.tagScope|12,ue(t.viewTransition))}function fe(e,t){e=ue(t.viewTransition);var n=t.tagScope|16;return e!==null&&e.share!==`none`&&(n|=64),ce(t.insertionMode,t.selectedValue,n,e)}var pe=new Map;function me(e,t){if(typeof t!=`object`)throw Error(r(62));var n=!0,i;for(i in t)if(E.call(t,i)){var a=t[i];if(a!=null&&typeof a!=`boolean`&&a!==``){if(i.indexOf(`--`)===0){var o=P(i);a=P((``+a).trim())}else o=pe.get(i),o===void 0&&(o=P(i.replace(F,`-$1`).toLowerCase().replace(I,`-ms-`)),pe.set(i,o)),a=typeof a==`number`?a===0||j.has(i)?``+a:a+`px`:P((``+a).trim());n?(n=!1,e.push(` style="`,o,`:`,a)):e.push(`;`,o,`:`,a)}}n||e.push(`"`)}function he(e,t,n){n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(` `,t,`=""`)}function ge(e,t,n){typeof n!=`function`&&typeof n!=`symbol`&&typeof n!=`boolean`&&e.push(` `,t,`="`,P(n),`"`)}var _e=P(`javascript:throw new Error('React form unexpectedly submitted.')`);function ve(e,t){this.push(`<input type="hidden"`),ye(e),ge(this,`name`,t),ge(this,`value`,e),this.push(`/>`)}function ye(e){if(typeof e!=`string`)throw Error(r(480))}function be(e,t){if(typeof t.$$FORM_ACTION==`function`){var n=e.nextFormID++;e=e.idPrefix+n;try{var r=t.$$FORM_ACTION(e);return r&&r.data?.forEach(ye),r}catch(e){if(typeof e==`object`&&e&&typeof e.then==`function`)throw e}}return null}function xe(e,t,n,r,i,a,o,s){var c=null;if(typeof r==`function`){var l=be(t,r);l===null?(e.push(` `,`formAction`,`="`,_e,`"`),o=a=i=r=s=null,Te(t,n)):(s=l.name,r=l.action||``,i=l.encType,a=l.method,o=l.target,c=l.data)}return s!=null&&Se(e,`name`,s),r!=null&&Se(e,`formAction`,r),i!=null&&Se(e,`formEncType`,i),a!=null&&Se(e,`formMethod`,a),o!=null&&Se(e,`formTarget`,o),c}
vendor: 7,489 bytes, lines 314-316
314function Se(e,t,n){switch(t){case`className`:ge(e,`class`,n);break;case`tabIndex`:ge(e,`tabindex`,n);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:ge(e,t,n);break;case`style`:me(e,n);break;case`src`:case`href`:if(n===``)break;case`action`:case`formAction`:if(n==null||typeof n==`function`||typeof n==`symbol`||typeof n==`boolean`)break;n=R(``+n),e.push(` `,t,`="`,P(n),`"`);break;case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`ref`:break;case`autoFocus`:case`multiple`:case`muted`:he(e,t.toLowerCase(),n);break;case`xlinkHref`:if(typeof n==`function`||typeof n==`symbol`||typeof n==`boolean`)break;n=R(``+n),e.push(` `,`xlink:href`,`="`,P(n),`"`);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:typeof n!=`function`&&typeof n!=`symbol`&&e.push(` `,t,`="`,P(n),`"`);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(` `,t,`=""`);break;case`capture`:case`download`:!0===n?e.push(` `,t,`=""`):!1!==n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(` `,t,`="`,P(n),`"`);break;case`cols`:case`rows`:case`size`:case`span`:typeof n!=`function`&&typeof n!=`symbol`&&!isNaN(n)&&1<=n&&e.push(` `,t,`="`,P(n),`"`);break;case`rowSpan`:case`start`:typeof n==`function`||typeof n==`symbol`||isNaN(n)||e.push(` `,t,`="`,P(n),`"`);break;case`xlinkActuate`:ge(e,`xlink:actuate`,n);break;case`xlinkArcrole`:ge(e,`xlink:arcrole`,n);break;case`xlinkRole`:ge(e,`xlink:role`,n);break;case`xlinkShow`:ge(e,`xlink:show`,n);break;case`xlinkTitle`:ge(e,`xlink:title`,n);break;case`xlinkType`:ge(e,`xlink:type`,n);break;case`xmlBase`:ge(e,`xml:base`,n);break;case`xmlLang`:ge(e,`xml:lang`,n);break;case`xmlSpace`:ge(e,`xml:space`,n);break;default:if((!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`)&&(t=M.get(t)||t,A(t))){switch(typeof n){case`function`:case`symbol`:return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`)return}e.push(` `,t,`="`,P(n),`"`)}}}function Ce(e,t,n){if(t!=null){if(n!=null)throw Error(r(60));if(typeof t!=`object`||!(`__html`in t))throw Error(r(61));t=t.__html,t!=null&&e.push(``+t)}}function we(e){var n=``;return t.Children.forEach(e,function(e){e!=null&&(n+=e)}),n}function Te(e,t){if(!(e.instructions&16)){e.instructions|=16;var n=t.preamble,r=t.bootstrapChunks;(n.htmlChunks||n.headChunks)&&r.length===0?(r.push(t.startInlineScript),at(r,e),r.push(`>`,`addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});`,`<\/script>`)):r.unshift(t.startInlineScript,`>`,`addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});`,`<\/script>`)}}function Ee(e,t){for(var n in e.push(Ie(`link`)),t)if(E.call(t,n)){var i=t[n];if(i!=null)switch(n){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`link`));default:Se(e,n,i)}}return e.push(`/>`),null}var De=/(<\/|<)(s)(tyle)/gi;function Oe(e,t,n,r){return``+t+(n===`s`?`\\73 `:`\\53 `)+r}function ke(e,t,n){for(var i in e.push(Ie(n)),t)if(E.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,n));default:Se(e,i,a)}}return e.push(`/>`),null}function Ae(e,t){e.push(Ie(`title`));var n=null,r=null,i;for(i in t)if(E.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:Se(e,i,a)}}return e.push(`>`),t=Array.isArray(n)?2>n.length?n[0]:null:n,typeof t!=`function`&&typeof t!=`symbol`&&t!=null&&e.push(P(``+t)),Ce(e,r,n),e.push(ze(`title`)),null}function je(e,t){e.push(Ie(`script`));var n=null,r=null,i;for(i in t)if(E.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:Se(e,i,a)}}return e.push(`>`),Ce(e,r,n),typeof n==`string`&&e.push((``+n).replace(ae,oe)),e.push(ze(`script`)),null}function Me(e,t,n){e.push(Ie(n));var r=n=null,i;for(i in t)if(E.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:Se(e,i,a)}}return e.push(`>`),Ce(e,r,n),n}function Ne(e,t,n){e.push(Ie(n));var r=n=null,i;for(i in t)if(E.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:Se(e,i,a)}}return e.push(`>`),Ce(e,r,n),typeof n==`string`?(e.push(P(n)),null):n}var Pe=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Fe=new Map;function Ie(e){var t=Fe.get(e);if(t===void 0){if(!Pe.test(e))throw Error(r(65,e));t=`<`+e,Fe.set(e,t)}return t}function Le(e,t,n,i,a,o,s,c,l){switch(t){case`div`:case`span`:case`svg`:case`path`:break;case`a`:e.push(Ie(`a`));var u=null,d=null,f;for(f in n)if(E.call(n,f)){var p=n[f];if(p!=null)switch(f){case`children`:u=p;break;case`dangerouslySetInnerHTML`:d=p;break;case`href`:p===``?ge(e,`href`,``):Se(e,f,p);break;default:Se(e,f,p)}}if(e.push(`>`),Ce(e,d,u),typeof u==`string`){e.push(P(u));var m=null}else m=u;return m;case`g`:case`p`:case`li`:break;case`select`:e.push(Ie(`select`));var h=null,g=null,_;for(_ in n)if(E.call(n,_)){var v=n[_];if(v!=null)switch(_){case`children`:h=v;break;case`dangerouslySetInnerHTML`:g=v;break;case`defaultValue`:case`value`:break;default:Se(e,_,v)}}return e.push(`>`),Ce(e,g,h),h;case`option`:var y=c.selectedValue;e.push(Ie(`option`));var b=null,x=null,S=null,w=null,D;for(D in n)if(E.call(n,D)){var O=n[D];if(O!=null)switch(D){case`children`:b=O;break;case`selected`:S=O;break;case`dangerouslySetInnerHTML`:w=O;break;case`value`:x=O;default:Se(e,D,O)}}if(y!=null){var k=x===null?we(b):``+x;if(C(y)){for(var j=0;j<y.length;j++)if(``+y[j]===k){e.push(` selected=""`);break}}else``+y===k&&e.push(` selected=""`)}else S&&e.push(` selected=""`);return e.push(`>`),Ce(e,w,b),b;case`textarea`:e.push(Ie(`textarea`));var M=null,N=null,F=null,I;for(I in n)if(E.call(n,I)){var L=n[I];if(L!=null)switch(I){case`children`:F=L;break;case`value`:M=L;break;case`defaultValue`:N=L;break;case`dangerouslySetInnerHTML`:throw Error(r(91));default:Se(e,I,L)}}if(M===null&&N!==null&&(M=N),e.push(`>`),F!=null){if(M!=null)throw Error(r(92));if(C(F)){if(1<F.length)throw Error(r(93));M=``+F[0]}M=``+F}return typeof M==`string`&&M[0]===`
315`&&e.push(`
316`),M!==null&&e.push(P(``+M)),null;
316case`input`:e.push(Ie(`input`));var ee=null,z=null,te=null,ne=null,ie=null,ae=null,oe=null,se=null,ce=null,le;for(le in n)if(E.call(n,le)){var ue=n[le];if(ue!=null)switch(le){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`input`));case`name`:ee=ue;break;case`formAction`:z=ue;break;case`formEncType`:te=ue;break;case`formMethod`:ne=ue;break;case`formTarget`:ie=ue;break;case`defaultChecked`:ce=ue;break;case`defaultValue`:oe=ue;break;case`checked`:se=ue;break;case`value`:ae=ue;break;default:Se(e,le,ue)}}var de=xe(e,i,a,z,te,ne,ie,ee);return se===null?ce!==null&&he(e,`checked`,ce):he(e,`checked`,se),ae===null?oe!==null&&Se(e,`value`,oe):Se(e,`value`,ae),e.push(`/>`),de?.forEach(ve,e),null;case`button`:e.push(Ie(`button`));var fe=null,pe=null,ye=null,Pe=null,Fe=null,Le=null,Re=null,Be;for(Be in n)if(E.call(n,Be)){var Ve=n[Be];if(Ve!=null)switch(Be){case`children`:fe=Ve;break;case`dangerouslySetInnerHTML`:pe=Ve;break;case`name`:ye=Ve;break;case`formAction`:Pe=Ve;break;case`formEncType`:Fe=Ve;break;case`formMethod`:Le=Ve;break;case`formTarget`:Re=Ve;break;default:Se(e,Be,Ve)}}var B=xe(e,i,a,Pe,Fe,Le,Re,ye);if(e.push(`>`),B?.forEach(ve,e),Ce(e,pe,fe),typeof fe==`string`){e.push(P(fe));var V=null}else V=fe;return V;case`form`:e.push(Ie(`form`));var He=null,Ue=null,We=null,Ge=null,Ke=null,qe=null,Je;for(Je in n)if(E.call(n,Je)){var Ye=n[Je];if(Ye!=null)switch(Je){case`children`:He=Ye;break;case`dangerouslySetInnerHTML`:Ue=Ye;break;case`action`:We=Ye;break;case`encType`:Ge=Ye;break;case`method`:Ke=Ye;break;case`target`:qe=Ye;break;default:Se(e,Je,Ye)}}var Xe=null,Ze=null;if(typeof We==`function`){var Qe=be(i,We);Qe===null?(e.push(` `,`action`,`="`,_e,`"`),qe=Ke=Ge=We=null,Te(i,a)):(We=Qe.action||``,Ge=Qe.encType,Ke=Qe.method,qe=Qe.target,Xe=Qe.data,Ze=Qe.name)}if(We!=null&&Se(e,`action`,We),Ge!=null&&Se(e,`encType`,Ge),Ke!=null&&Se(e,`method`,Ke),qe!=null&&Se(e,`target`,qe),e.push(`>`),Ze!==null&&(e.push(`<input type="hidden"`),ge(e,`name`,Ze),e.push(`/>`),Xe?.forEach(ve,e)),Ce(e,Ue,He),typeof He==`string`){e.push(P(He));var $e=null}else $e=He;return $e;case`menuitem`:for(var et in e.push(Ie(`menuitem`)),n)if(E.call(n,et)){var tt=n[et];if(tt!=null)switch(et){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(400));default:Se(e,et,tt)}}return e.push(`>`),null;case`object`:e.push(Ie(`object`));var nt=null,rt=null,it;for(it in n)if(E.call(n,it)){var at=n[it];if(at!=null)switch(it){case`children`:nt=at;break;case`dangerouslySetInnerHTML`:rt=at;break;case`data`:var ot=R(``+at);if(ot===``)break;e.push(` `,`data`,`="`,P(ot),`"`);break;default:Se(e,it,at)}}if(e.push(`>`),Ce(e,rt,nt),typeof nt==`string`){e.push(P(nt));var st=null}else st=nt;return st;case`title`:var ct=c.tagScope&1,lt=c.tagScope&4;if(c.insertionMode===4||ct||n.itemProp!=null)var ut=Ae(e,n);else lt?ut=null:(Ae(a.hoistableChunks,n),ut=void 0);return ut;case`link`:var dt=c.tagScope&1,ft=c.tagScope&4,pt=n.rel,mt=n.href,ht=n.precedence;if(c.insertionMode===4||dt||n.itemProp!=null||typeof pt!=`string`||typeof mt!=`string`||mt===``){Ee(e,n);var vt=null}else if(n.rel===`stylesheet`)if(typeof ht!=`string`||n.disabled!=null||n.onLoad||n.onError)vt=Ee(e,n);else{var yt=a.styles.get(ht),bt=i.styleResources.hasOwnProperty(mt)?i.styleResources[mt]:void 0;if(bt!==null){i.styleResources[mt]=null,yt||(yt={precedence:P(ht),rules:[],hrefs:[],sheets:new Map},a.styles.set(ht,yt));var xt={state:0,props:T({},n,{"data-precedence":n.precedence,precedence:null})};if(bt){bt.length===2&&gt(xt.props,bt);var St=a.preloads.stylesheets.get(mt);St&&0<St.length?St.length=0:xt.state=1}yt.sheets.set(mt,xt),s&&s.stylesheets.add(xt)}else if(yt){var Ct=yt.sheets.get(mt);Ct&&s&&s.stylesheets.add(Ct)}l&&e.push(`<!-- -->`),vt=null}else n.onLoad||n.onError?vt=Ee(e,n):(l&&e.push(`<!-- -->`),vt=ft?null:Ee(a.hoistableChunks,n));return vt;case`script`:var wt=c.tagScope&1,Tt=n.async;if(typeof n.src!=`string`||!n.src||!Tt||typeof Tt==`function`||typeof Tt==`symbol`||n.onLoad||n.onError||c.insertionMode===4||wt||n.itemProp!=null)var Et=je(e,n);else{var Dt=n.src;if(n.type===`module`)var Ot=i.moduleScriptResources,kt=a.preloads.moduleScripts;else Ot=i.scriptResources,kt=a.preloads.scripts;var At=Ot.hasOwnProperty(Dt)?Ot[Dt]:void 0;if(At!==null){Ot[Dt]=null;var jt=n;
vendor: 21,588 bytes, lines 316-324
316if(At){At.length===2&&(jt=T({},n),gt(jt,At));var Mt=kt.get(Dt);Mt&&(Mt.length=0)}var Nt=[];a.scripts.add(Nt),je(Nt,jt)}l&&e.push(`<!-- -->`),Et=null}return Et;case`style`:var Pt=c.tagScope&1,Ft=n.precedence,It=n.href,Lt=n.nonce;if(c.insertionMode===4||Pt||n.itemProp!=null||typeof Ft!=`string`||typeof It!=`string`||It===``){e.push(Ie(`style`));var Rt=null,zt=null,Bt;for(Bt in n)if(E.call(n,Bt)){var Vt=n[Bt];if(Vt!=null)switch(Bt){case`children`:Rt=Vt;break;case`dangerouslySetInnerHTML`:zt=Vt;break;default:Se(e,Bt,Vt)}}e.push(`>`);var Ht=Array.isArray(Rt)?2>Rt.length?Rt[0]:null:Rt;typeof Ht!=`function`&&typeof Ht!=`symbol`&&Ht!=null&&e.push((``+Ht).replace(De,Oe)),Ce(e,zt,Rt),e.push(ze(`style`));var Ut=null}else{var Wt=a.styles.get(Ft);if((i.styleResources.hasOwnProperty(It)?i.styleResources[It]:void 0)!==null){i.styleResources[It]=null,Wt||(Wt={precedence:P(Ft),rules:[],hrefs:[],sheets:new Map},a.styles.set(Ft,Wt));var Gt=a.nonce.style;if(!Gt||Gt===Lt){Wt.hrefs.push(P(It));var Kt=Wt.rules,qt=null,Jt=null,Yt;for(Yt in n)if(E.call(n,Yt)){var Xt=n[Yt];if(Xt!=null)switch(Yt){case`children`:qt=Xt;break;case`dangerouslySetInnerHTML`:Jt=Xt}}var Zt=Array.isArray(qt)?2>qt.length?qt[0]:null:qt;typeof Zt!=`function`&&typeof Zt!=`symbol`&&Zt!=null&&Kt.push((``+Zt).replace(De,Oe)),Ce(Kt,Jt,qt)}}Wt&&s&&s.styles.add(Wt),l&&e.push(`<!-- -->`),Ut=void 0}return Ut;case`meta`:var Qt=c.tagScope&1,$t=c.tagScope&4;if(c.insertionMode===4||Qt||n.itemProp!=null)var en=ke(e,n,`meta`);else l&&e.push(`<!-- -->`),en=$t?null:typeof n.charSet==`string`?ke(a.charsetChunks,n,`meta`):n.name===`viewport`?ke(a.viewportChunks,n,`meta`):ke(a.hoistableChunks,n,`meta`);return en;case`listing`:case`pre`:e.push(Ie(t));var tn=null,nn=null,rn;for(rn in n)if(E.call(n,rn)){var an=n[rn];if(an!=null)switch(rn){case`children`:tn=an;break;case`dangerouslySetInnerHTML`:nn=an;break;default:Se(e,rn,an)}}if(e.push(`>`),nn!=null){if(tn!=null)throw Error(r(60));if(typeof nn!=`object`||!(`__html`in nn))throw Error(r(61));var on=nn.__html;on!=null&&(typeof on==`string`&&0<on.length&&on[0]===`
317`?e.push(`
318`,on):e.push(``+on))}return typeof tn==`string`&&tn[0]===`
319`&&e.push(`
320`),tn;case`img`:var sn=c.tagScope&3,cn=n.src,ln=n.srcSet;if(!(n.loading===`lazy`||!cn&&!ln||typeof cn!=`string`&&cn!=null||typeof ln!=`string`&&ln!=null||n.fetchPriority===`low`||sn)&&(typeof cn!=`string`||cn[4]!==`:`||cn[0]!==`d`&&cn[0]!==`D`||cn[1]!==`a`&&cn[1]!==`A`||cn[2]!==`t`&&cn[2]!==`T`||cn[3]!==`a`&&cn[3]!==`A`)&&(typeof ln!=`string`||ln[4]!==`:`||ln[0]!==`d`&&ln[0]!==`D`||ln[1]!==`a`&&ln[1]!==`A`||ln[2]!==`t`&&ln[2]!==`T`||ln[3]!==`a`&&ln[3]!==`A`)){s!==null&&c.tagScope&64&&(s.suspenseyImages=!0);var un=typeof n.sizes==`string`?n.sizes:void 0,dn=ln?ln+`
321`+(un||``):cn,fn=a.preloads.images,pn=fn.get(dn);if(pn)(n.fetchPriority===`high`||10>a.highImagePreloads.size)&&(fn.delete(dn),a.highImagePreloads.add(pn));else if(!i.imageResources.hasOwnProperty(dn)){i.imageResources[dn]=re;var mn=n.crossOrigin,hn=typeof mn==`string`?mn===`use-credentials`?mn:``:void 0,gn=a.headers,_n;gn&&0<gn.remainingCapacity&&typeof n.srcSet!=`string`&&(n.fetchPriority===`high`||500>gn.highImagePreloads.length)&&(_n=_t(cn,`image`,{imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:hn,integrity:n.integrity,nonce:n.nonce,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.refererPolicy}),0<=(gn.remainingCapacity-=_n.length+2))?(a.resets.image[dn]=re,gn.highImagePreloads&&(gn.highImagePreloads+=`, `),gn.highImagePreloads+=_n):(pn=[],Ee(pn,{rel:`preload`,as:`image`,href:ln?void 0:cn,imageSrcSet:ln,imageSizes:un,crossOrigin:hn,integrity:n.integrity,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.referrerPolicy}),n.fetchPriority===`high`||10>a.highImagePreloads.size?a.highImagePreloads.add(pn):(a.bulkPreloads.add(pn),fn.set(dn,pn)))}}return ke(e,n,`img`);case`base`:case`area`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`param`:case`source`:case`track`:case`wbr`:return ke(e,n,t);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`:break;case`head`:if(2>c.insertionMode){var vn=o||a.preamble;if(vn.headChunks)throw Error(r(545,"`<head>`"));o!==null&&e.push(`<!--head-->`),vn.headChunks=[];var yn=Me(vn.headChunks,n,`head`)}else yn=Ne(e,n,`head`);return yn;case`body`:if(2>c.insertionMode){var bn=o||a.preamble;if(bn.bodyChunks)throw Error(r(545,"`<body>`"));o!==null&&e.push(`<!--body-->`),bn.bodyChunks=[];var xn=Me(bn.bodyChunks,n,`body`)}else xn=Ne(e,n,`body`);return xn;case`html`:if(c.insertionMode===0){var Sn=o||a.preamble;if(Sn.htmlChunks)throw Error(r(545,"`<html>`"));o!==null&&e.push(`<!--html-->`),Sn.htmlChunks=[``];var Cn=Me(Sn.htmlChunks,n,`html`)}else Cn=Ne(e,n,`html`);return Cn;default:if(t.indexOf(`-`)!==-1){e.push(Ie(t));var wn=null,Tn=null,En;for(En in n)if(E.call(n,En)){var Dn=n[En];if(Dn!=null){var On=En;switch(En){case`children`:wn=Dn;break;case`dangerouslySetInnerHTML`:Tn=Dn;break;case`style`:me(e,Dn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`ref`:break;case`className`:On=`class`;default:if(A(En)&&typeof Dn!=`function`&&typeof Dn!=`symbol`&&!1!==Dn){if(!0===Dn)Dn=``;else if(typeof Dn==`object`)continue;e.push(` `,On,`="`,P(Dn),`"`)}}}}return e.push(`>`),Ce(e,Tn,wn),wn}}return Ne(e,n,t)}var Re=new Map;function ze(e){var t=Re.get(e);return t===void 0&&(t=`</`+e+`>`,Re.set(e,t)),t}function Be(e,t){e=e.preamble,e.htmlChunks===null&&t.htmlChunks&&(e.htmlChunks=t.htmlChunks),e.headChunks===null&&t.headChunks&&(e.headChunks=t.headChunks),e.bodyChunks===null&&t.bodyChunks&&(e.bodyChunks=t.bodyChunks)}function B(e,t){t=t.bootstrapChunks;for(var n=0;n<t.length-1;n++)e.push(t[n]);return n<t.length?(n=t[n],t.length=0,e.push(n)):!0}function V(e,t,n){if(e.push(`<!--$?--><template id="`),n===null)throw Error(r(395));return e.push(t.boundaryPrefix),t=n.toString(16),e.push(t),e.push(`"></template>`)}function He(e,t,n,i){switch(n.insertionMode){case 0:case 1:case 3:case 2:return e.push(`<div hidden id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 4:return e.push(`<svg aria-hidden="true" style="display:none" id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 5:return e.push(`<math aria-hidden="true" style="display:none" id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 6:return e.push(`<table hidden id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 7:return e.push(`<table hidden><tbody id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 8:return e.push(`<table hidden><tr id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 9:return e.push(`<table hidden><colgroup id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);default:throw Error(r(397))}}function Ue(e,t){switch(t.insertionMode){case 0:case 1:case 3:case 2:return e.push(`</div>`);case 4:return e.push(`</svg>`);case 5:return e.push(`</math>`);case 6:return e.push(`</table>`);case 7:return e.push(`</tbody></table>`);case 8:return e.push(`</tr></table>`);case 9:return e.push(`</colgroup></table>`);default:throw Error(r(397))}}var We=/[<\u2028\u2029]/g;function Ge(e){return JSON.stringify(e).replace(We,function(e){switch(e){case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var Ke=/[&><\u2028\u2029]/g;function qe(e){return JSON.stringify(e).replace(Ke,function(e){switch(e){case`&`:return`\\u0026`;case`>`:return`\\u003e`;case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var Je=!1,Ye=!0;function Xe(e){var t=e.rules,n=e.hrefs,r=0;if(n.length){for(this.push(ie.startInlineStyle),this.push(` media="not all" data-precedence="`),this.push(e.precedence),this.push(`" data-href="`);r<n.length-1;r++)this.push(n[r]),this.push(` `);for(this.push(n[r]),this.push(`">`),r=0;r<t.length;r++)this.push(t[r]);Ye=this.push(`</style>`),Je=!0,t.length=0,n.length=0}}function Ze(e){return e.state===2?!1:Je=!0}function Qe(e,t,n){return Je=!1,Ye=!0,ie=n,t.styles.forEach(Xe,e),ie=null,t.stylesheets.forEach(Ze),Je&&(n.stylesToHoist=!0),Ye}function $e(e){for(var t=0;t<e.length;t++)this.push(e[t]);e.length=0}var et=[];function tt(e){Ee(et,e.props);for(var t=0;t<et.length;t++)this.push(et[t]);et.length=0,e.state=2}function nt(e){var t=0<e.sheets.size;e.sheets.forEach(tt,this),e.sheets.clear();var n=e.rules,r=e.hrefs;if(!t||r.length){if(this.push(ie.startInlineStyle),this.push(` data-precedence="`),this.push(e.precedence),e=0,r.length){for(this.push(`" data-href="`);e<r.length-1;e++)this.push(r[e]),this.push(` `);this.push(r[e])}for(this.push(`">`),e=0;e<n.length;e++)this.push(n[e]);this.push(`</style>`),n.length=0,r.length=0}}function rt(e){if(e.state===0){e.state=1;var t=e.props;for(Ee(et,{rel:`preload`,as:`style`,href:e.props.href,crossOrigin:t.crossOrigin,fetchPriority:t.fetchPriority,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy}),e=0;e<et.length;e++)this.push(et[e]);et.length=0}}function it(e){e.sheets.forEach(rt,this),e.sheets.clear()}function at(e,t){!(t.instructions&32)&&(t.instructions|=32,e.push(` id="`,P(`_`+t.idPrefix+`R_`),`"`))}function ot(e,t){e.push(`[`);var n=`[`;t.stylesheets.forEach(function(t){if(t.state!==2)if(t.state===3)e.push(n),t=qe(``+t.props.href),e.push(t),e.push(`]`),n=`,[`;else{e.push(n);var i=t.props[`data-precedence`],a=t.props,o=R(``+t.props.href);for(var s in o=qe(o),e.push(o),i=``+i,e.push(`,`),i=qe(i),e.push(i),a)if(E.call(a,s)&&(i=a[s],i!=null))switch(s){case`href`:case`rel`:case`precedence`:case`data-precedence`:break;case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`link`));default:st(e,s,i)}e.push(`]`),n=`,[`,t.state=3}}),e.push(`]`)}function st(e,t,n){var r=t.toLowerCase();switch(typeof n){case`function`:case`symbol`:return}switch(t){case`innerHTML`:case`dangerouslySetInnerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`style`:case`ref`:return;case`className`:r=`class`,t=``+n;break;case`hidden`:if(!1===n)return;t=``;break;case`src`:case`href`:n=R(n),t=``+n;break;default:if(2<t.length&&(t[0]===`o`||t[0]===`O`)&&(t[1]===`n`||t[1]===`N`)||!A(t))return;t=``+n}e.push(`,`),r=qe(r),e.push(r),e.push(`,`),r=qe(t),e.push(r)}function ct(){return{styles:new Set,stylesheets:new Set,suspenseyImages:!1}}function lt(e){var t=Un||null;if(t){var n=t.resumableState,r=t.renderState;if(typeof e==`string`&&e){if(!n.dnsResources.hasOwnProperty(e)){n.dnsResources[e]=null,n=r.headers;var i,a;(a=n&&0<n.remainingCapacity)&&(a=(i=`<`+(``+e).replace(vt,yt)+`>; rel=dns-prefetch`,0<=(n.remainingCapacity-=i.length+2))),a?(r.resets.dns[e]=null,n.preconnects&&(n.preconnects+=`, `),n.preconnects+=i):(i=[],Ee(i,{href:e,rel:`dns-prefetch`}),r.preconnects.add(i))}Rr(t)}}else ne.D(e)}function ut(e,t){var n=Un||null;if(n){var r=n.resumableState,i=n.renderState;if(typeof e==`string`&&e){var a=t===`use-credentials`?`credentials`:typeof t==`string`?`anonymous`:`default`;if(!r.connectResources[a].hasOwnProperty(e)){r.connectResources[a][e]=null,r=i.headers;var o,s;if(s=r&&0<r.remainingCapacity){if(s=`<`+(``+e).replace(vt,yt)+`>; rel=preconnect`,typeof t==`string`){var c=(``+t).replace(bt,xt);s+=`; crossorigin="`+c+`"`}s=(o=s,0<=(r.remainingCapacity-=o.length+2))}s?(i.resets.connect[a][e]=null,r.preconnects&&(r.preconnects+=`, `),r.preconnects+=o):(a=[],Ee(a,{rel:`preconnect`,href:e,crossOrigin:t}),i.preconnects.add(a))}Rr(n)}}else ne.C(e,t)}function dt(e,t,n){var r=Un||null;if(r){var i=r.resumableState,a=r.renderState;if(t&&e){switch(t){case`image`:if(n)var o=n.imageSrcSet,s=n.imageSizes,c=n.fetchPriority;var l=o?o+`
322`+(s||``):e;if(i.imageResources.hasOwnProperty(l))return;i.imageResources[l]=re,i=a.headers;var u;i&&0<i.remainingCapacity&&typeof o!=`string`&&c===`high`&&(u=_t(e,t,n),0<=(i.remainingCapacity-=u.length+2))?(a.resets.image[l]=re,i.highImagePreloads&&(i.highImagePreloads+=`, `),i.highImagePreloads+=u):(i=[],Ee(i,T({rel:`preload`,href:o?void 0:e,as:t},n)),c===`high`?a.highImagePreloads.add(i):(a.bulkPreloads.add(i),a.preloads.images.set(l,i)));break;case`style`:if(i.styleResources.hasOwnProperty(e))return;o=[],Ee(o,T({rel:`preload`,href:e,as:t},n)),i.styleResources[e]=!n||typeof n.crossOrigin!=`string`&&typeof n.integrity!=`string`?re:[n.crossOrigin,n.integrity],a.preloads.stylesheets.set(e,o),a.bulkPreloads.add(o);break;case`script`:if(i.scriptResources.hasOwnProperty(e))return;o=[],a.preloads.scripts.set(e,o),a.bulkPreloads.add(o),Ee(o,T({rel:`preload`,href:e,as:t},n)),i.scriptResources[e]=!n||typeof n.crossOrigin!=`string`&&typeof n.integrity!=`string`?re:[n.crossOrigin,n.integrity];break;default:if(i.unknownResources.hasOwnProperty(t)){if(o=i.unknownResources[t],o.hasOwnProperty(e))return}else o={},i.unknownResources[t]=o;if(o[e]=re,(i=a.headers)&&0<i.remainingCapacity&&t===`font`&&(l=_t(e,t,n),0<=(i.remainingCapacity-=l.length+2)))a.resets.font[e]=re,i.fontPreloads&&(i.fontPreloads+=`, `),i.fontPreloads+=l;else switch(i=[],e=T({rel:`preload`,href:e,as:t},n),Ee(i,e),t){case`font`:a.fontPreloads.add(i);break;default:a.bulkPreloads.add(i)}}Rr(r)}}else ne.L(e,t,n)}function ft(e,t){var n=Un||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=t&&typeof t.as==`string`?t.as:`script`;switch(a){case`script`:if(r.moduleScriptResources.hasOwnProperty(e))return;a=[],r.moduleScriptResources[e]=!t||typeof t.crossOrigin!=`string`&&typeof t.integrity!=`string`?re:[t.crossOrigin,t.integrity],i.preloads.moduleScripts.set(e,a);break;default:if(r.moduleUnknownResources.hasOwnProperty(a)){var o=r.unknownResources[a];if(o.hasOwnProperty(e))return}else o={},r.moduleUnknownResources[a]=o;a=[],o[e]=re}Ee(a,T({rel:`modulepreload`,href:e},t)),i.bulkPreloads.add(a),Rr(n)}}else ne.m(e,t)}function pt(e,t,n){var r=Un||null;if(r){var i=r.resumableState,a=r.renderState;if(e){t||=`default`;var o=a.styles.get(t),s=i.styleResources.hasOwnProperty(e)?i.styleResources[e]:void 0;s!==null&&(i.styleResources[e]=null,o||(o={precedence:P(t),rules:[],hrefs:[],sheets:new Map},a.styles.set(t,o)),t={state:0,props:T({rel:`stylesheet`,href:e,"data-precedence":t},n)},s&&(s.length===2&&gt(t.props,s),(a=a.preloads.stylesheets.get(e))&&0<a.length?a.length=0:t.state=1),o.sheets.set(e,t),Rr(r))}}else ne.S(e,t,n)}function mt(e,t){var n=Un||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=r.scriptResources.hasOwnProperty(e)?r.scriptResources[e]:void 0;a!==null&&(r.scriptResources[e]=null,t=T({src:e,async:!0},t),a&&(a.length===2&&gt(t,a),e=i.preloads.scripts.get(e))&&(e.length=0),e=[],i.scripts.add(e),je(e,t),Rr(n))}}else ne.X(e,t)}function ht(e,t){var n=Un||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=r.moduleScriptResources.hasOwnProperty(e)?r.moduleScriptResources[e]:void 0;a!==null&&(r.moduleScriptResources[e]=null,t=T({src:e,type:`module`,async:!0},t),a&&(a.length===2&&gt(t,a),e=i.preloads.moduleScripts.get(e))&&(e.length=0),e=[],i.scripts.add(e),je(e,t),Rr(n))}}else ne.M(e,t)}function gt(e,t){e.crossOrigin??=t[0],e.integrity??=t[1]}function _t(e,t,n){for(var r in e=(``+e).replace(vt,yt),t=(``+t).replace(bt,xt),t=`<`+e+`>; rel=preload; as="`+t+`"`,n)E.call(n,r)&&(e=n[r],typeof e==`string`&&(t+=`; `+r.toLowerCase()+`="`+(``+e).replace(bt,xt)+`"`));return t}var vt=/[<>\r\n]/g;function yt(e){switch(e){case`<`:return`%3C`;case`>`:return`%3E`;case`
323`:return`%0A`;case`\r`:return`%0D`;default:throw Error(`escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}}var bt=/["';,\r\n]/g;function xt(e){switch(e){case`"`:return`%22`;case`'`:return`%27`;case`;`:return`%3B`;case`,`:return`%2C`;case`
324`:return`%0A`;case`\r`:return`%0D`;default:throw Error(`escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}}function St(e){this.styles.add(e)}function Ct(e){this.stylesheets.add(e)}function wt(e,t){t.styles.forEach(St,e),t.stylesheets.forEach(Ct,e),t.suspenseyImages&&(e.suspenseyImages=!0)}function Tt(e,t){var n=e.idPrefix,r=[],i=e.bootstrapScriptContent,a=e.bootstrapScripts,o=e.bootstrapModules;i!==void 0&&(r.push(`<script`),at(r,e),r.push(`>`,(``+i).replace(ae,oe),`<\/script>`)),i=n+`P:`;var s=n+`S:`;n+=`B:`;var c=new Set,l=new Set,u=new Set,d=new Map,f=new Set,p=new Set,m=new Set,h={images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map};if(a!==void 0)for(var g=0;g<a.length;g++){var _=a[g],v,y=void 0,b=void 0,x={rel:`preload`,as:`script`,fetchPriority:`low`,nonce:void 0};typeof _==`string`?x.href=v=_:(x.href=v=_.src,x.integrity=b=typeof _.integrity==`string`?_.integrity:void 0,x.crossOrigin=y=typeof _==`string`||_.crossOrigin==null?void 0:_.crossOrigin===`use-credentials`?`use-credentials`:``),_=e;var S=v;_.scriptResources[S]=null,_.moduleScriptResources[S]=null,_=[],Ee(_,x),f.add(_),r.push(`<script src="`,P(v),`"`),typeof b==`string`&&r.push(` integrity="`,P(b),`"`),typeof y==`string`&&r.push(` crossorigin="`,P(y),`"`),at(r,e),r.push(` async=""><\/script>`)}if(o!==void 0)for(a=0;a<o.length;a++)x=o[a],y=v=void 0,b={rel:`modulepreload`,fetchPriority:`low`,nonce:void 0},typeof x==`string`?b.href=g=x:(b.href=g=x.src,b.integrity=y=typeof x.integrity==`string`?x.integrity:void 0,b.crossOrigin=v=typeof x==`string`||x.crossOrigin==null?void 0:x.crossOrigin===`use-credentials`?`use-credentials`:``),x=e,_=g,x.scriptResources[_]=null,x.moduleScriptResources[_]=null,x=[],Ee(x,b),f.add(x),r.push(`<script type="module" src="`,P(g),`"`),typeof y==`string`&&r.push(` integrity="`,P(y),`"`),typeof v==`string`&&r.push(` crossorigin="`,P(v),`"`),at(r,e),r.push(` async=""><\/script>`);return{placeholderPrefix:i,segmentPrefix:s,boundaryPrefix:n,startInlineScript:`<script`,startInlineStyle:`<style`,preamble:{htmlChunks:null,headChunks:null,bodyChunks:null},externalRuntimeScript:null,bootstrapChunks:r,importMapChunks:[],onHeaders:void 0,headers:null,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:c,fontPreloads:l,highImagePreloads:u,styles:d,bootstrapScripts:f,scripts:p,bulkPreloads:m,preloads:h,nonce:{script:void 0,style:void 0},stylesToHoist:!1,generateStaticMarkup:t}}function Et(e,t,n,r){return n.generateStaticMarkup?(e.push(P(t)),!1):(t===``?e=r:(r&&e.push(`<!-- -->`),e.push(P(t)),e=!0),e)}function Dt(e,t,n,r){t.generateStaticMarkup||n&&r&&e.push(`<!-- -->`)}var Ot=Function.prototype.bind,kt=Symbol.for(`react.client.reference`);function At(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===kt?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case o:return`Fragment`;case c:return`Profiler`;case s:return`StrictMode`;case f:return`Suspense`;case p:return`SuspenseList`;case _:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case a:return`Portal`;case u:return e.displayName||`Context`;case l:return(e._context.displayName||`Context`)+`.Consumer`;case d:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case m:return t=e.displayName||null,t===null?At(e.type)||`Memo`:t;case h:t=e._payload,e=e._init;try{return At(e(t))}catch{}}return null}var jt={},Mt=null;function Nt(e,t){if(e!==t){e.context._currentValue2=e.parentValue,e=e.parent;var n=t.parent;if(e===null){if(n!==null)throw Error(r(401))}else{if(n===null)throw Error(r(401));Nt(e,n)}t.context._currentValue2=t.value}}function Pt(e){e.context._currentValue2=e.parentValue,e=e.parent,e!==null&&Pt(e)}function Ft(e){var t=e.parent;t!==null&&Ft(t),e.context._currentValue2=e.value}function It(e,t){if(e.context._currentValue2=e.parentValue,e=e.parent,e===null)throw Error(r(402));e.depth===t.depth?Nt(e,t):It(e,t)}function Lt(e,t){var n=t.parent;if(n===null)throw Error(r(402));e.depth===n.depth?Nt(e,n):Lt(e,n),t.context._currentValue2=t.value}function Rt(e){var t=Mt;t!==e&&(t===null?Ft(e):e===null?Pt(t):t.depth===e.depth?Nt(t,e):t.depth>e.depth?It(t,e):Lt(t,e),Mt=e)}var zt={enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}},Bt={id:1,overflow:``};function Vt(e,t,n){var r=e.id;e=e.overflow;var i=32-Ht(r)-1;r&=~(1<<i),n+=1;var a=32-Ht(t)+i;if(30<a){var o=i-i%5;return a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,{id:1<<32-Ht(t)+i|n<<i|r,overflow:a+e}}return{id:1<<a|n<<i|r,overflow:e}}var Ht=Math.clz32?Math.clz32:Gt,Ut=Math.log,Wt=Math.LN2;function Gt(e){return e>>>=0,e===0?32:31-(Ut(e)/Wt|0)|0}function Kt(){}var qt=Error(r(460));function Jt(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kt,Kt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw t.reason;default:switch(typeof t.status==`string`?t.then(Kt,Kt):(e=t,e.status=`pending`,e.then(function(e){if(t.status===`pen
324ding`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})),t.status){case`fulfilled`:return t.value;case`rejected`:throw t.reason}throw Yt=t,qt}}var Yt=null;function Xt(){if(Yt===null)throw Error(r(459));var e=Yt;return Yt=null,e}function Zt(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Qt=typeof Object.is==`function`?Object.is:Zt,$t=null,en=null,tn=null,nn=null,rn=null,an=null,on=!1,sn=!1,cn=0,ln=0,un=-1,dn=0,fn=null,pn=null,mn=0;function hn(){if($t===null)throw Error(r(321));return $t}function gn(){if(0<mn)throw Error(r(312));return{memoizedState:null,queue:null,next:null}}function _n(){return an===null?rn===null?(on=!1,rn=an=gn()):(on=!0,an=rn):an.next===null?(on=!1,an=an.next=gn()):(on=!0,an=an.next),an}function vn(){var e=fn;return fn=null,e}function yn(){nn=tn=en=$t=null,sn=!1,rn=null,mn=0,an=pn=null}function bn(e,t){return typeof t==`function`?t(e):t}function xn(e,t,n){if($t=hn(),an=_n(),on){var r=an.queue;if(t=r.dispatch,pn!==null&&(n=pn.get(r),n!==void 0)){pn.delete(r),r=an.memoizedState;do r=e(r,n.action),n=n.next;while(n!==null);return an.memoizedState=r,[r,t]}return[an.memoizedState,t]}return e=e===bn?typeof t==`function`?t():t:n===void 0?t:n(t),an.memoizedState=e,e=an.queue={last:null,dispatch:null},e=e.dispatch=Cn.bind(null,$t,e),[an.memoizedState,e]}function Sn(e,t){if($t=hn(),an=_n(),t=t===void 0?null:t,an!==null){var n=an.memoizedState;if(n!==null&&t!==null){var r=n[1];a:if(r===null)r=!1;else{for(var i=0;i<r.length&&i<t.length;i++)if(!Qt(t[i],r[i])){r=!1;break a}r=!0}if(r)return n[0]}}return e=e(),an.memoizedState=[e,t],e}function Cn(e,t,n){if(25<=mn)throw Error(r(301));if(e===$t)if(sn=!0,e={action:n,next:null},pn===null&&(pn=new Map),n=pn.get(t),n===void 0)pn.set(t,e);else{for(t=n;t.next!==null;)t=t.next;t.next=e}}function wn(){throw Error(r(440))}function Tn(){throw Error(r(394))}function En(){throw Error(r(479))}function Dn(e,t,n){hn();var r=ln++,i=tn;if(typeof e.$$FORM_ACTION==`function`){var a=null,o=nn;i=i.formState;var s=e.$$IS_SIGNATURE_EQUAL;if(i!==null&&typeof s==`function`){var c=i[1];s.call(e,i[2],i[3])&&(a=n===void 0?`k`+w(JSON.stringify([o,null,r]),0):`p`+n,c===a&&(un=r,t=i[0]))}var l=e.bind(null,t);return e=function(e){l(e)},typeof l.$$FORM_ACTION==`function`&&(e.$$FORM_ACTION=function(e){e=l.$$FORM_ACTION(e),n!==void 0&&(n+=``,e.action=n);var t=e.data;return t&&(a===null&&(a=n===void 0?`k`+w(JSON.stringify([o,null,r]),0):`p`+n),t.append(`$ACTION_KEY`,a)),e}),[t,e,!1]}var u=e.bind(null,t);return[t,function(e){u(e)},!1]}function On(e){var t=dn;return dn+=1,fn===null&&(fn=[]),Jt(fn,e,t)}function kn(){throw Error(r(393))}var An={readContext:function(e){return e._currentValue2},use:function(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return On(e);if(e.$$typeof===u)return e._currentValue2}throw Error(r(438,String(e)))},useContext:function(e){return hn(),e._currentValue2},useMemo:Sn,useReducer:xn,useRef:function(e){$t=hn(),an=_n();var t=an.memoizedState;return t===null?(e={current:e},an.memoizedState=e):t},useState:function(e){return xn(bn,e)},useInsertionEffect:Kt,useLayoutEffect:Kt,useCallback:function(e,t){return Sn(function(){return e},t)},useImperativeHandle:Kt,useEffect:Kt,useDebugValue:Kt,useDeferredValue:function(e,t){return hn(),t===void 0?e:t},useTransition:function(){return hn(),[!1,Tn]},useId:function(){var e=en.treeContext,t=e.overflow;e=e.id,e=(e&~(1<<32-Ht(e)-1)).toString(32)+t;var n=jn;if(n===null)throw Error(r(404));return t=cn++,e=`_`+n.idPrefix+`R_`+e,0<t&&(e+=`H`+t.toString(32)),e+`_`},useSyncExternalStore:function(e,t,n){if(n===void 0)throw Error(r(407));return n()},useOptimistic:function(e){return hn(),[e,En]},useActionState:Dn,useFormState:Dn,useHostTransitionStatus:function(){return hn(),te},useMemoCache:function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=y;return t},useCacheRefresh:function(){return kn},useEffectEvent:function(){return wn}},jn=null,Mn={getCacheForType:function(){throw Error(r(248))},cacheSignal:function(){throw Error(r(248))}},Nn,Pn;function Fn(e){if(Nn===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Nn=t&&t[1]||``,Pn=-1<e.stack.indexOf(`
325    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
326`+Nn+e+Pn}var In=!1;function Ln(e,t){if(!e||In)return``;In=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}
vendor: 33,387 bytes, lines 326-338
326else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
327`),l=s.split(`
328`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
329`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{In=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Fn(n):``}function Rn(e){if(typeof e==`string`)return Fn(e);if(typeof e==`function`)return e.prototype&&e.prototype.isReactComponent?Ln(e,!0):Ln(e,!1);if(typeof e==`object`&&e){switch(e.$$typeof){case d:return Ln(e.render,!1);case m:return Ln(e.type,!1);case h:var t=e,n=t._payload;t=t._init;try{e=t(n)}catch{return Fn(`Lazy`)}return Rn(e)}if(typeof e.name==`string`){a:{n=e.name,t=e.env;var r=e.debugLocation;if(r!=null&&(e=Error.prepareStackTrace,Error.prepareStackTrace=void 0,r=r.stack,Error.prepareStackTrace=e,r.startsWith(`Error: react-stack-top-frame
330`)&&(r=r.slice(29)),e=r.indexOf(`
331`),e!==-1&&(r=r.slice(e+1)),e=r.indexOf(`react_stack_bottom_frame`),e!==-1&&(e=r.lastIndexOf(`
332`,e)),e=e===-1?``:r=r.slice(0,e),r=e.lastIndexOf(`
333`),e=r===-1?e:e.slice(r+1),e.indexOf(n)!==-1)){n=`
334`+e;break a}n=Fn(n+(t?` [`+t+`]`:``))}return n}}switch(e){case p:return Fn(`SuspenseList`);case f:return Fn(`Suspense`)}return``}function zn(e,t){return(500<t.byteSize||!1)&&t.contentPreamble===null}function Bn(e){if(typeof e==`object`&&e&&typeof e.environmentName==`string`){var t=e.environmentName;e=[e].slice(0),typeof e[0]==`string`?e.splice(0,1,`[%s] `+e[0],` `+t+` `):e.splice(0,0,`[%s]`,` `+t+` `),e.unshift(console),t=Ot.apply(console.error,e),t()}else console.error(e);return null}function Vn(e,t,n,r,i,a,o,s,c,l,u){var d=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=e,this.renderState=t,this.rootFormatContext=n,this.progressiveChunkSize=r===void 0?12800:r,this.status=10,this.fatalError=null,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedPreambleSegments=this.completedRootSegment=null,this.byteSize=0,this.abortableTasks=d,this.pingedTasks=[],this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.trackedPostpones=null,this.onError=i===void 0?Bn:i,this.onPostpone=l===void 0?Kt:l,this.onAllReady=a===void 0?Kt:a,this.onShellReady=o===void 0?Kt:o,this.onShellError=s===void 0?Kt:s,this.onFatalError=c===void 0?Kt:c,this.formState=u===void 0?null:u}function Hn(e,t,n,r,i,a,o,s,c,l,u,d){return t=new Vn(t,n,r,i,a,o,s,c,l,u,d),n=Jn(t,0,null,r,!1,!1),n.parentFlushed=!0,e=Kn(t,null,e,-1,null,n,null,null,t.abortableTasks,null,r,null,Bt,null,null),Yn(e),t.pingedTasks.push(e),t}var Un=null;function Wn(e,t){e.pingedTasks.push(t),e.pingedTasks.length===1&&(e.flushScheduled=e.destination!==null,Er(e))}function Gn(e,t,n,r,i){return n={status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,row:t,completedSegments:[],byteSize:0,fallbackAbortableTasks:n,errorDigest:null,contentState:ct(),fallbackState:ct(),contentPreamble:r,fallbackPreamble:i,trackedContentKeyPath:null,trackedFallbackNode:null},t!==null&&(t.pendingTasks++,r=t.boundaries,r!==null&&(e.allPendingTasks++,n.pendingTasks++,r.push(n)),e=t.inheritedHoistables,e!==null&&wt(n.contentState,e)),n}function Kn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){e.allPendingTasks++,i===null?e.pendingRootTasks++:i.pendingTasks++,p!==null&&p.pendingTasks++;var h={replay:null,node:n,childIndex:r,ping:function(){return Wn(e,h)},blockedBoundary:i,blockedSegment:a,blockedPreamble:o,hoistableState:s,abortSet:c,keyPath:l,formatContext:u,context:d,treeContext:f,row:p,componentStack:m,thenableState:t};return c.add(h),h}function qn(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.allPendingTasks++,a===null?e.pendingRootTasks++:a.pendingTasks++,f!==null&&f.pendingTasks++,n.pendingTasks++;var m={replay:n,node:r,childIndex:i,ping:function(){return Wn(e,m)},blockedBoundary:a,blockedSegment:null,blockedPreamble:null,hoistableState:o,abortSet:s,keyPath:c,formatContext:l,context:u,treeContext:d,row:f,componentStack:p,thenableState:t};return s.add(m),m}function Jn(e,t,n,r,i,a){return{status:0,parentFlushed:!1,id:-1,index:t,chunks:[],children:[],preambleChildren:[],parentFormatContext:r,boundary:n,lastPushedText:i,textEmbedded:a}}function Yn(e){var t=e.node;if(typeof t==`object`&&t)switch(t.$$typeof){case i:e.componentStack={parent:e.componentStack,type:t.type}}}function Xn(e){return e===null?null:{parent:e.parent,type:`Suspense Fallback`}}function Zn(e){var t={};return e&&Object.defineProperty(t,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var n=``,r=e;do n+=Rn(r.type),r=r.parent;while(r);var i=n}catch(e){i=`
335Error generating stack: `+e.message+`
336`+e.stack}return Object.defineProperty(t,"componentStack",{value:i}),i}}),t}function Qn(e,t,n){if(e=e.onError,t=e(t,n),t==null||typeof t==`string`)return t}function $n(e,t){var n=e.onShellError,r=e.onFatalError;n(t),r(t),e.destination===null?(e.status=13,e.fatalError=t):(e.status=14,e.destination.destroy(t))}function er(e,t){tr(e,t.next,t.hoistables)}function tr(e,t,n){for(;t!==null;){n!==null&&(wt(t.hoistables,n),t.inheritedHoistables=n);var r=t.boundaries;if(r!==null){t.boundaries=null;for(var i=0;i<r.length;i++){var a=r[i];n!==null&&wt(a.contentState,n),Tr(e,a,null,null)}}if(t.pendingTasks--,0<t.pendingTasks)break;n=t.hoistables,t=t.next}}function nr(e,t){var n=t.boundaries;if(n!==null&&t.pendingTasks===n.length){for(var r=!0,i=0;i<n.length;i++){var a=n[i];if(a.pendingTasks!==1||a.parentFlushed||zn(e,a)){r=!1;break}}r&&tr(e,t,t.hoistables)}}function rr(e){var t={pendingTasks:1,boundaries:null,hoistables:ct(),inheritedHoistables:null,together:!1,next:null};return e!==null&&0<e.pendingTasks&&(t.pendingTasks++,t.boundaries=[],e.next=t),t}function ir(e,t,n,r,i){var a=t.keyPath,o=t.treeContext,s=t.row;t.keyPath=n,n=r.length;var c=null;if(t.replay!==null){var l=t.replay.slots;if(typeof l==`object`&&l)for(var u=0;u<n;u++){var d=i!==`backwards`&&i!==`unstable_legacy-backwards`?u:n-1-u,f=r[d];t.row=c=rr(c),t.treeContext=Vt(o,n,d);var p=l[d];typeof p==`number`?(cr(e,t,p,f,d),delete l[d]):_r(e,t,f,d),--c.pendingTasks===0&&er(e,c)}else for(l=0;l<n;l++)u=i!==`backwards`&&i!==`unstable_legacy-backwards`?l:n-1-l,d=r[u],t.row=c=rr(c),t.treeContext=Vt(o,n,u),_r(e,t,d,u),--c.pendingTasks===0&&er(e,c)}else if(i!==`backwards`&&i!==`unstable_legacy-backwards`)for(i=0;i<n;i++)l=r[i],t.row=c=rr(c),t.treeContext=Vt(o,n,i),_r(e,t,l,i),--c.pendingTasks===0&&er(e,c);else{for(i=t.blockedSegment,l=i.children.length,u=i.chunks.length,d=n-1;0<=d;d--){f=r[d],t.row=c=rr(c),t.treeContext=Vt(o,n,d),p=Jn(e,u,null,t.formatContext,d===0?i.lastPushedText:!0,!0),i.children.splice(l,0,p),t.blockedSegment=p;try{_r(e,t,f,d),Dt(p.chunks,e.renderState,p.lastPushedText,p.textEmbedded),p.status=1,--c.pendingTasks===0&&er(e,c)}catch(t){throw p.status=e.status===12?3:4,t}}t.blockedSegment=i,i.lastPushedText=!1}s!==null&&c!==null&&0<c.pendingTasks&&(s.pendingTasks++,c.next=s),t.treeContext=o,t.row=s,t.keyPath=a}function ar(e,t,n,r,i,a){var o=t.thenableState;for(t.thenableState=null,$t={},en=t,tn=e,nn=n,ln=cn=0,un=-1,dn=0,fn=o,e=r(i,a);sn;)sn=!1,ln=cn=0,un=-1,dn=0,mn+=1,an=null,e=r(i,a);return yn(),e}function or(e,t,n,r,i,a,o){var s=!1;if(a!==0&&e.formState!==null){var c=t.blockedSegment;if(c!==null){s=!0,c=c.chunks;for(var l=0;l<a;l++)l===o?c.push(`<!--F!-->`):c.push(`<!--F-->`)}}a=t.keyPath,t.keyPath=n,i?(n=t.treeContext,t.treeContext=Vt(n,1,0),_r(e,t,r,-1),t.treeContext=n):s?_r(e,t,r,-1):lr(e,t,r,-1),t.keyPath=a}function sr(e,t,n,i,a,y){if(typeof i==`function`)if(i.prototype&&i.prototype.isReactComponent){var x=a;if(`ref`in a)for(var w in x={},a)w!==`ref`&&(x[w]=a[w]);var E=i.defaultProps;if(E)for(var D in x===a&&(x=T({},x,a)),E)x[D]===void 0&&(x[D]=E[D]);a=x,x=jt,E=i.contextType,typeof E==`object`&&E&&(x=E._currentValue2),x=new i(a,x);var O=x.state===void 0?null:x.state;if(x.updater=zt,x.props=a,x.state=O,E={queue:[],replace:!1},x._reactInternals=E,y=i.contextType,x.context=typeof y==`object`&&y?y._currentValue2:jt,y=i.getDerivedStateFromProps,typeof y==`function`&&(y=y(a,O),O=y==null?O:T({},O,y),x.state=O),typeof i.getDerivedStateFromProps!=`function`&&typeof x.getSnapshotBeforeUpdate!=`function`&&(typeof x.UNSAFE_componentWillMount==`function`||typeof x.componentWillMount==`function`))if(i=x.state,typeof x.componentWillMount==`function`&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount==`function`&&x.UNSAFE_componentWillMount(),i!==x.state&&zt.enqueueReplaceState(x,x.state,null),E.queue!==null&&0<E.queue.length)if(i=E.queue,y=E.replace,E.queue=null,E.replace=!1,y&&i.length===1)x.state=i[0];else{for(E=y?i[0]:x.state,O=!0,y=+!!y;y<i.length;y++)D=i[y],D=typeof D==`function`?D.call(x,E,a,void 0):D,D!=null&&(O?(O=!1,E=T({},E,D)):T(E,D));x.state=E}else E.queue=null;if(i=x.render(),e.status===12)throw null;a=t.keyPath,t.keyPath=n,lr(e,t,i,-1),t.keyPath=a}else{if(i=ar(e,t,n,i,a,void 0),e.status===12)throw null;or(e,t,n,i,cn!==0,ln,un)}else if(typeof i==`string`)if(x=t.blockedSegment,x===null)x=a.children,E=t.formatContext,O=t.keyPath,t.formatContext=le(E,i,a),t.keyPath=n,_r(e,t,x,-1),t.formatContext=E,t.keyPath=O;else{if(O=Le(x.chunks,i,a,e.resumableState,e.renderState,t.blockedPreamble,t.hoistableState,t.formatContext,x.lastPushedText),x.lastPushedText=!1,E=t.formatContext,y=t.keyPath,t.keyPath=n,(t.formatContext=le(E,i,a)).insertionMode===3){n=Jn(e,0,null,t.formatContext,!1,!1),x.preambleChildren.push(n),t.blockedSegment=n;try{n.status=6,_r(e,t,O,-1),Dt(n.chunks,e.renderState,n.lastPushedText,n.textEmbedded),n.status=1}finally{t.blockedSegment=x}}else _r(e,t,O,-1);t.formatContext=E,t.keyPath=y;a:{switch(t=x.chunks,e=e.resumableState,i){case`title`:case`style`:case`script`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`input`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:break a;case`body`:if(1>=E.insertionMode){e.hasBody=!0;break a}break;case`html`:if(E.insertionMode===0){e.hasHtml=!0;break a}break;case`head`:if(1>=E.insertionMode)break a}t.push(ze(i))}x.lastPushedText=!1}else{switch(i){case v:case s:case c:case o:i=t.keyPath,t.keyPath=n,lr(e,t,a.children,-1),t.keyPath=i;return;case _:i=t.blockedSegment,i===null?a.mode!==`hidden`&&(i=t.keyPath,t.keyPath=n,_r(e,t,a.children,-1),t.keyPath=i):a.mode!==`hidden`&&(e.renderState.generateStaticMarkup||i.chunks.push(`<!--&-->`),i.lastPushedText=!1,x=t.keyPath,t.keyPath=n,_r(e,t,a.children,-1),t.keyPath=x,e.renderState.generateStaticMarkup||i.chunks.push(`<!--/&-->`),i.lastPushedText=!1);return;case p:a:{if(i=a.children,a=a.revealOrder,a===`forwards`||a===`backwards`||a===`unstable_legacy-backwards`){if(C(i)){ir(e,t,n,i,a);break a}if((x=S(i))&&(x=x.call(i))){if(E=x.next(),!E.done){do E=x.next();while(!E.done);ir(e,t,n,i,a)}break a}}a===`together`?(a=t.keyPath,x=t.row,E=t.row=rr(null),E.boundaries=[],E.together=!0,t.keyPath=n,lr(e,t,i,-1),--E.pendingTasks===0&&er(e,E),t.keyPath=a,t.row=x,x!==null&&0<E.pendingTasks&&(x.pendingTasks++,E.next=x)):(a=t.keyPath,t.keyPath=n,lr(e,t,i,-1),t.keyPath=a)}return;case b:case g:throw Error(r(343));case f:a:if(t.replay!==null){i=t.keyPath,x=t.formatContext,E=t.row,t.keyPath=n,t.formatContext=fe(e.resumableState,x),t.row=null,n=a.children;try{_r(e,t,n,-1)}finally{t.keyPath=i,t.formatContext=x,t.row=E}}else{i=t.keyPath,y=t.formatContext;var k=t.row,A=t.blockedBoundary;D=t.blockedPreamble;var j=t.hoistableState;w=t.blockedSegment;var M=a.fallback;a=a.children;var N=new Set,P=Gn(e,t.row,N,null,null);e.trackedPostpones!==null&&(P.trackedContentKeyPath=n);var F=Jn(e,w.chunks.length,P,t.formatContext,!1,!1);w.children.push(F),w.lastPushedText=!1;var I=Jn(e,0,null,t.formatContext,!1,!1);if(I.parentFlushed=!0,e.trackedPostpones!==null){x=t.componentStack,E=[n[0],`Suspense Fallback`,n[2]],O=[E[1],E[2],[],null],e.trackedPostpones.workingMap.set(E,O),P.trackedFallbackNode=O,t.blockedSegment=F,t.blockedPreamble=P.fallbackPreamble,t.keyPath=E,t.formatContext=de(e.resumableState,y),t.componentStack=Xn(x),F.status=6;try{_r(e,t,M,-1),Dt(F.chunks,e.renderState,F.lastPushedText,F.textEmbedded),F.status=1}catch(t){throw F.status=e.status===12?3:4,t}finally{t.blockedSegment=w,t.blockedPreamble=D,t.keyPath=i,t.formatContext=y}t=Kn(e,null,a,-1,P,I,P.contentPreamble,P.contentState,t.abortSet,n,fe(e.resumableState,t.formatContext),t.context,t.treeContext,null,x),Yn(t),e.pingedTasks.push(t)}else{t.blockedBoundary=P,t.blockedPreamble=P.contentPreamble,t.hoistableState=P.contentState,t.blockedSegment=I,t.keyPath=n,t.formatContext=fe(e.resumableState,y),t.row=null,I.status=6;try{if(_r(e,t,a,-1),Dt(I.chunks,e.renderState,I.lastPushedText,I.textEmbedded),I.status=1,wr(P,I),P.pendingTasks===0&&P.status===0){if(P.status=1,!zn(e,P)){k!==null&&--k.pendingTasks===0&&er(e,k),e.pendingRootTasks===0&&t.blockedPreamble&&kr(e);break a}}else k!==null&&k.together&&nr(e,k)}catch(n){P.status=4,e.status===12?(I.status=3,x=e.fatalError):(I.status=4,x=n),E=Zn(t.componentStack),O=Qn(e,x,E),P.errorDigest=O,mr(e,P)}finally{t.blockedBoundary=A,t.blockedPreamble=D,t.hoistableState=j,t.blockedSegment=w,t.keyPath=i,t.formatContext=y,t.row=k}t=Kn(e,null,M,-1,A,F,P.fallbackPreamble,P.fallbackState,N,[n[0],`Suspense Fallback`,n[2]],de(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,Xn(t.componentStack)),Yn(t),e.pingedTasks.push(t)}}return}if(typeof i==`object`&&i)switch(i.$$typeof){case d:if(`ref`in a)for(M in x={},a)M!==`ref`&&(x[M]=a[M]);else x=a;i=ar(e,t,n,i.render,x,y),or(e,t,n,i,cn!==0,ln,un);return;case m:sr(e,t,n,i.type,a,y);return;case u:if(E=a.children,x=t.keyPath,a=a.value,O=i._currentValue2,i._currentValue2=a,y=Mt,Mt=i={parent:y,depth:y===null?0:y.depth+1,context:i,parentValue:O,value:a},t.context=i,t.keyPath=n,lr(e,t,E,-1),e=Mt,e===null)throw Error(r(403));e.context._currentValue2=e.parentValue,e=Mt=e.parent,t.context=e,t.keyPath=x;return;case l:a=a.children,i=a(i._context._currentValue2),a=t.keyPath,t.keyPath=n,lr(e,t,i,-1),t.keyPath=a;return;case h:if(x=i._init,i=x(i._payload),e.status===12)throw null;sr(e,t,n,i,a,y);return}throw Error(r(130,i==null?i:typeof i,``))}}function cr(e,t,n,r,i){var a=t.replay,o=t.blockedBoundary,s=Jn(e,0,null,t.formatContext,!1,!1);s.id=n,s.parentFlushed=!0;try{t.replay=null,t.blockedSegment=s,_r(e,t,r,i),s.status=1,o===null?e.completedRootSegment=s:(wr(o,s),o.parentFlushed&&e.partialBoundaries.push(o))}finally{t.replay=a,t.blockedSegment=null}}function lr(e,t,n,r){t.replay!==null&&typeof t.replay.slots==`number`?cr(e,t,t.replay.slots,n,r):(t.node=n,t.childIndex=r,n=t.componentStack,Yn(t),ur(e,t),t.componentStack=n)}function ur(e,t){var n=t.node,o=t.childIndex;if(n!==null){if(typeof n==`object`){switch(n.$$typeof){case i:var s=n.type,c=n.key,l=n.props;n=l.ref;var d=n===void 0?null:n,p=At(s),m=c??(o===-1?0:o);if(c=[t.keyPath,p,m],t.replay!==null)a:{var g=t.replay;for(o=g.nodes,n=0;n<o.length;n++){var _=o[n];if(m===_[1]){if(_.length===4){if(p!==null&&p!==_[0])throw Error(r(490,_[0],p));var v=_[2];p=_[3],m=t.node,t.replay={nodes:v,slots:p,pendingTasks:1};try{if(sr(e,t,c,s,l,d),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));t.replay.pendingTasks--}catch(r){if(typeof r==`object`&&r&&(r===qt||typeof r.then==`function`))throw t.node===m?t.replay=g:o.splice(n,1),r;t.replay.pendingTasks--,l=Zn(t.componentStack),c=e,e=t.blockedBoundary,s=r,l=Qn(c,s,l),yr(c,e,v,p,s,l)}t.replay=g}else{if(s!==f)throw Error(r(490,`Suspense`,At(s)||`Unknown`));b:{g=void 0,s=_[5],d=_[2],p=_[3],m=_[4]===null?[]:_[4][2],_=_[4]===null?null:_[4][3];var y=t.keyPath,b=t.formatContext,x=t.row,w=t.replay,T=t.blockedBoundary,E=t.hoistableState,D=l.children,O=l.fallback,k=new Set;l=Gn(e,t.row,k,null,null),l.parentFlushed=!0,l.rootSegmentID=s,t.blockedBoundary=l,t.hoistableState=l.contentState,t.keyPath=c,t.formatContext=fe(e.resumableState,b),t.row=null,t.replay={nodes:d,slots:p,pendingTasks:1};try{if(_r(e,t,D,-1),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));if(t.replay.pendingTasks--,l.pendingTasks===0&&l.status===0){l.status=1,e.completedBoundaries.push(l);break b}}catch(n){l.status=4,v=Zn(t.componentStack),g=Qn(e,n,v),l.errorDigest=g,t.replay.pendingTasks--,e.clientRenderedBoundaries.push(l)}finally{t.blockedBoundary=T,t.hoistableState=E,t.replay=w,t.keyPath=y,t.formatContext=b,t.row=x}v=qn(e,null,{nodes:m,slots:_,pendingTasks:0},O,-1,T,l.fallbackState,k,[c[0],`Suspense Fallback`,c[2]],de(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,Xn(t.componentStack)),Yn(v),e.pingedTasks.push(v)}}o.splice(n,1);break a}}}else sr(e,t,c,s,l,d);return;case a:throw Error(r(257));case h:if(v=n._init,n=v(n._payload),e.status===12)throw null;lr(e,t,n,o);return}if(C(n)){dr(e,t,n,o);return}if((v=S(n))&&(v=v.call(n))){if(n=v.next(),!n.done){l=[];do l.push(n.value),n=v.next();while(!n.done);dr(e,t,l,o)}return}if(typeof n.then==`function`)return t.thenableState=null,lr(e,t,On(n),o);if(n.$$typeof===u)return lr(e,t,n._currentValue2,o);throw o=Object.prototype.toString.call(n),Error(r(31,o===`[object Object]`?`object with keys {`+Object.keys(n).join(`, `)+`}`:o))}typeof n==`string`?(o=t.blockedSegment,o!==null&&(o.lastPushedText=Et(o.chunks,n,e.renderState,o.lastPushedText))):(typeof n==`number`||typeof n==`bigint`)&&(o=t.blockedSegment,o!==null&&(o.lastPushedText=Et(o.chunks,``+n,e.renderState,o.lastPushedText)))}}function dr(e,t,n,i){var a=t.keyPath;if(i!==-1&&(t.keyPath=[t.keyPath,`Fragment`,i],t.replay!==null)){for(var o=t.replay,s=o.nodes,c=0;c<s.length;c++){var l=s[c];if(l[1]===i){i=l[2],l=l[3],t.replay={nodes:i,slots:l,pendingTasks:1};try{if(dr(e,t,n,-1),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));t.replay.pendingTasks--}catch(r){if(typeof r==`object`&&r&&(r===qt||typeof r.then==`function`))throw r;t.replay.pendingTasks--,n=Zn(t.componentStack);var u=t.blockedBoundary,d=r;n=Qn(e,d,n),yr(e,u,i,l,d,n)}t.replay=o,s.splice(c,1);break}}t.keyPath=a;return}if(o=t.treeContext,s=n.length,t.replay!==null&&(c=t.replay.slots,typeof c==`object`&&c)){for(i=0;i<s;i++)l=n[i],t.treeContext=Vt(o,s,i),u=c[i],typeof u==`number`?(cr(e,t,u,l,i),delete c[i]):_r(e,t,l,i);t.treeContext=o,t.keyPath=a;return}for(c=0;c<s;c++)i=n[c],t.treeContext=Vt(o,s,c),_r(e,t,i,c);t.treeContext=o,t.keyPath=a}function fr(e,t,n){if(n.status=5,n.rootSegmentID=e.nextSegmentId++,e=n.trackedContentKeyPath,e===null)throw Error(r(486));var i=n.trackedFallbackNode,a=[],o=t.workingMap.get(e);return o===void 0?(n=[e[1],e[2],a,null,i,n.rootSegmentID],t.workingMap.set(e,n),Vr(n,e[0],t),n):(o[4]=i,o[5]=n.rootSegmentID,o)}function pr(e,t,n,i){i.status=5;var a=n.keyPath,o=n.blockedBoundary;if(o===null)i.id=e.nextSegmentId++,t.rootSlots=i.id,e.completedRootSegment!==null&&(e.completedRootSegment.status=5);else{if(o!==null&&o.status===0){var s=fr(e,t,o);if(o.trackedContentKeyPath===a&&n.childIndex===-1){i.id===-1&&(i.id=i.parentFlushed?o.rootSegmentID:e.nextSegmentId++),s[3]=i.id;return}}if(i.id===-1&&(i.id=i.parentFlushed&&o!==null?o.rootSegmentID:e.nextSegmentId++),n.childIndex===-1)a===null?t.rootSlots=i.id:(n=t.workingMap.get(a),n===void 0?(n=[a[1],a[2],[],i.id],Vr(n,a[0],t)):n[3]=i.id);else{if(a===null){if(e=t.rootSlots,e===null)e=t.rootSlots={};else if(typeof e==`number`)throw Error(r(491))}else if(o=t.workingMap,s=o.get(a),s===void 0)e={},s=[a[1],a[2],[],e],o.set(a,s),Vr(s,a[0],t);else if(e=s[3],e===null)e=s[3]={};else if(typeof e==`number`)throw Error(r(491));e[n.childIndex]=i.id}}}function mr(e,t){e=e.trackedPostpones,e!==null&&(t=t.trackedContentKeyPath,t!==null&&(t=e.workingMap.get(t),t!==void 0&&(t.length=4,t[2]=[],t[3]=null)))}function hr(e,t,n){return qn(e,n,t.replay,t.node,t.childIndex,t.blockedBoundary,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function gr(e,t,n){var r=t.blockedSegment,i=Jn(e,r.chunks.length,null,t.formatContext,r.lastPushedText,!0);return r.children.push(i),r.lastPushedText=!1,Kn(e,n,t.node,t.childIndex,t.blockedBoundary,i,t.blockedPreamble,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function _r(e,t,n,r){var i=t.formatContext,a=t.context,o=t.keyPath,s=t.treeContext,c=t.componentStack,l=t.blockedSegment;if(l===null){l=t.replay;try{return lr(e,t,n,r)}catch(u){if(yn(),n=u===qt?Xt():u,e.status!==12&&typeof n==`object`&&n){if(typeof n.then==`function`){r=u===qt?vn():null,e=hr(e,t,r).ping,n.then(e,e),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,t.replay=l,Rt(a);return}if(n.message===`Maximum call stack size exceeded`){n=u===qt?vn():null,n=hr(e,t,n),e.pingedTasks.push(n),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,t.replay=l,Rt(a);return}}}}else{var u=l.children.length,d=l.chunks.length;try{return lr(e,t,n,r)}catch(r){if(yn(),l.children.length=u,l.chunks.length=d,n=r===qt?Xt():r,e.status!==12&&typeof n==`object`&&n){if(typeof n.then==`function`){l=n,n=r===qt?vn():null,e=gr(e,t,n).ping,l.then(e,e),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,Rt(a);return}if(n.message===`Maximum call stack size exceeded`){l=r===qt?vn():null,l=gr(e,t,l),e.pingedTasks.push(l),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,Rt(a);return}}}}throw t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,Rt(a),n}function vr(e){var t=e.blockedBoundary,n=e.blockedSegment;n!==null&&(n.status=3,Tr(this,t,e.row,n))}function yr(e,t,n,i,a,o){for(var s=0;s<n.length;s++){var c=n[s];if(c.length===4)yr(e,t,c[2],c[3],a,o);else{c=c[5];var l=e,u=o,d=Gn(l,null,new Set,null,null);d.parentFlushed=!0,d.rootSegmentID=c,d.status=4,d.errorDigest=u,d.parentFlushed&&l.clientRenderedBoundaries.push(d)}}if(n.length=0,i!==null){if(t===null)throw Error(r(487));if(t.status!==4&&(t.status=4,t.errorDigest=o,t.parentFlushed&&e.clientRenderedBoundaries.push(t)),typeof i==`object`)for(var f in i)delete i[f]}}function br(e,t,n){var r=e.blockedBoundary,i=e.blockedSegment;if(i!==null){if(i.status===6)return;i.status=3}var a=Zn(e.componentStack);if(r===null){if(t.status!==13&&t.status!==14){if(r=e.replay,r===null){t.trackedPostpones!==null&&i!==null?(r=t.trackedPostpones,Qn(t,n,a),pr(t,r,e,i),Tr(t,null,e.row,i)):(Qn(t,n,a),$n(t,n));return}r.pendingTasks--,r.pendingTasks===0&&0<r.nodes.length&&(i=Qn(t,n,a),yr(t,null,r.nodes,r.slots,n,i)),t.pendingRootTasks--,t.pendingRootTasks===0&&Sr(t)}}else{var o=t.trackedPostpones;if(r.status!==4){if(o!==null&&i!==null)return Qn(t,n,a),pr(t,o,e,i),r.fallbackAbortableTasks.forEach(function(e){return br(e,t,n)}),r.fallbackAbortableTasks.clear(),Tr(t,r,e.row,i);r.status=4,i=Qn(t,n,a),r.status=4,r.errorDigest=i,mr(t,r),r.parentFlushed&&t.clientRenderedBoundaries.push(r)}r.pendingTasks--,i=r.row,i!==null&&--i.pendingTasks===0&&er(t,i),r.fallbackAbortableTasks.forEach(function(e){return br(e,t,n)}),r.fallbackAbortableTasks.clear()}e=e.row,e!==null&&--e.pendingTasks===0&&er(t,e),t.allPendingTasks--,t.allPendingTasks===0&&Cr(t)}function xr(e,t){try{var n=e.renderState,r=n.onHeaders;if(r){var i=n.headers;if(i){n.headers=null;var a=i.preconnects;if(i.fontPreloads&&(a&&(a+=`, `),a+=i.fontPreloads),i.highImagePreloads&&(a&&(a+=`, `),a+=i.highImagePreloads),!t){var o=n.styles.values(),s=o.next();b:for(;0<i.remainingCapacity&&!s.done;s=o.next())for(var c=s.value.sheets.values(),l=c.next();0<i.remainingCapacity&&!l.done;l=c.next()){var u=l.value,d=u.props,f=d.href,p=u.props,m=_t(p.href,`style`,{crossOrigin:p.crossOrigin,integrity:p.integrity,nonce:p.nonce,type:p.type,fetchPriority:p.fetchPriority,referrerPolicy:p.referrerPolicy,media:p.media});if(0<=(i.remainingCapacity-=m.length+2))n.resets.style[f]=re,a&&(a+=`, `),a+=m,n.resets.style[f]=typeof d.crossOrigin==`string`||typeof d.integrity==`string`?[d.crossOrigin,d.integrity]:re;else break b}}r(a?{Link:a}:{})}}}catch(t){Qn(e,t,{})}}function Sr(e){e.trackedPostpones===null&&xr(e,!0),e.trackedPostpones===null&&kr(e),e.onShellError=Kt,e=e.onShellReady,e()}function Cr(e){xr(e,e.trackedPostpones===null?!0:e.completedRootSegment===null||e.completedRootSegment.status!==5),kr(e),e=e.onAllReady,e()}function wr(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null&&t.children[0].id===-1){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,n.status!==1&&n.status!==3&&n.status!==4||wr(e,n)}else e.completedSegments.push(t)}function Tr(e,t,n,i){if(n!==null&&(--n.pendingTasks===0?er(e,n):n.together&&nr(e,n)),e.allPendingTasks--,t===null){if(i!==null&&i.parentFlushed){if(e.completedRootSegment!==null)throw Error(r(389));e.completedRootSegment=i}e.pendingRootTasks--,e.pendingRootTasks===0&&Sr(e)}else if(t.pendingTasks--,t.status!==4)if(t.pendingTasks===0){if(t.status===0&&(t.status=1),i!==null&&i.parentFlushed&&(i.status===1||i.status===3)&&wr(t,i),t.parentFlushed&&e.completedBoundaries.push(t),t.status===1)n=t.row,n!==null&&wt(n.hoistables,t.contentState),zn(e,t)||(t.fallbackAbortableTasks.forEach(vr,e),t.fallbackAbortableTasks.clear(),n!==null&&--n.pendingTasks===0&&er(e,n)),e.pendingRootTasks===0&&e.trackedPostpones===null&&t.contentPreamble!==null&&kr(e);else if(t.status===5&&(t=t.row,t!==null)){if(e.trackedPostpones!==null){n=e.trackedPostpones;var a=t.next;if(a!==null&&(i=a.boundaries,i!==null))for(a.boundaries=null,a=0;a<i.length;a++){var o=i[a];fr(e,n,o),Tr(e,o,null,null)}}--t.pendingTasks===0&&er(e,t)}}else i===null||!i.parentFlushed||i.status!==1&&i.status!==3||(wr(t,i),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)),t=t.row,t!==null&&t.together&&nr(e,t);e.allPendingTasks===0&&Cr(e)}function Er(e){if(e.status!==14&&e.status!==13){var t=Mt,n=ee.H;ee.H=An;var i=ee.A;ee.A=Mn;var a=Un;Un=e;var o=jn;jn=e.resumableState;try{var s=e.pingedTasks,c;for(c=0;c<s.length;c++){var l=s[c],u=e,d=l.blockedSegment;if(d===null){var f=u;if(l.replay.pendingTasks!==0){Rt(l.context);try{if(typeof l.replay.slots==`number`?cr(f,l,l.replay.slots,l.node,l.childIndex):ur(f,l),l.replay.pendingTasks===1&&0<l.replay.nodes.length)throw Error(r(488));l.replay.pendingTasks--,l.abortSet.delete(l),Tr(f,l.blockedBoundary,l.row,null)}catch(e){yn();var p=e===qt?Xt():e;if(typeof p==`object`&&p&&typeof p.then==`function`){var m=l.ping;p.then(m,m),l.thenableState=e===qt?vn():null}else{l.replay.pendingTasks--,l.abortSet.delete(l);var h=Zn(l.componentStack);u=void 0;var g=f,_=l.blockedBoundary,v=f.status===12?f.fatalError:p,y=l.replay.nodes,b=l.replay.slots;u=Qn(g,v,h),yr(g,_,y,b,v,u),f.pendingRootTasks--,f.pendingRootTasks===0&&Sr(f),f.allPendingTasks--,f.allPendingTasks===0&&Cr(f)}}}}else if(f=void 0,g=d,g.status===0){g.status=6,Rt(l.context);var x=g.children.length,S=g.chunks.length;try{ur(u,l),Dt(g.chunks,u.renderState,g.lastPushedText,g.textEmbedded),l.abortSet.delete(l),g.status=1,Tr(u,l.blockedBoundary,l.row,g)}catch(e){yn(),g.children.length=x,g.chunks.length=S;var C=e===qt?Xt():u.status===12?u.fatalError:e;if(u.status===12&&u.trackedPostpones!==null){var w=u.trackedPostpones,T=Zn(l.componentStack);l.abortSet.delete(l),Qn(u,C,T),pr(u,w,l,g),Tr(u,l.blockedBoundary,l.row,g)}else if(typeof C==`object`&&C&&typeof C.then==`function`){g.status=0,l.thenableState=e===qt?vn():null;var E=l.ping;C.then(E,E)}else{var D=Zn(l.componentStack);l.abortSet.delete(l),g.status=4;var O=l.blockedBoundary,k=l.row;if(k!==null&&--k.pendingTasks===0&&er(u,k),u.allPendingTasks--,f=Qn(u,C,D),O===null)$n(u,C);else if(O.pendingTasks--,O.status!==4){O.status=4,O.errorDigest=f,mr(u,O);var A=O.row;A!==null&&--A.pendingTasks===0&&er(u,A),O.parentFlushed&&u.clientRenderedBoundaries.push(O),u.pendingRootTasks===0&&u.trackedPostpones===null&&O.contentPreamble!==null&&kr(u)}u.allPendingTasks===0&&Cr(u)}}}}s.splice(0,c),e.destination!==null&&Lr(e,e.destination)}catch(t){Qn(e,t,{}),$n(e,t)}finally{jn=o,ee.H=n,ee.A=i,n===An&&Rt(t),Un=a}}}function Dr(e,t,n){t.preambleChildren.length&&n.push(t.preambleChildren);for(var r=!1,i=0;i<t.children.length;i++)r=Or(e,t.children[i],n)||r;return r}function Or(e,t,n){var i=t.boundary;if(i===null)return Dr(e,t,n);var a=i.contentPreamble,o=i.fallbackPreamble;if(a===null||o===null)return!1;switch(i.status){case 1:if(Be(e.renderState,a),e.byteSize+=i.byteSize,t=i.completedSegments[0],!t)throw Error(r(391));return Dr(e,t,n);case 5:if(e.trackedPostpones!==null)return!0;case 4:if(t.status===1)return Be(e.renderState,o),Dr(e,t,n);default:return!0}}function kr(e){if(e.completedRootSegment&&e.completedPreambleSegments===null){var t=[],n=e.byteSize,r=Or(e,e.completedRootSegment,t),i=e.renderState.preamble;!1===r||i.headChunks&&i.bodyChunks?e.completedPreambleSegments=t:e.byteSize=n}}function Ar(e,t,n,i){switch(n.parentFlushed=!0,n.status){case 0:n.id=e.nextSegmentId++;case 5:return i=n.id,n.lastPushedText=!1,n.textEmbedded=!1,e=e.renderState,t.push(`<template id="`),t.push(e.placeholderPrefix),e=i.toString(16),t.push(e),t.push(`"></template>`);case 1:n.status=2;var a=!0,o=n.chunks,s=0;n=n.children;for(var c=0;c<n.length;c++){for(a=n[c];s<a.index;s++)t.push(o[s]);a=Nr(e,t,a,i)}for(;s<o.length-1;s++)t.push(o[s]);return s<o.length&&(a=t.push(o[s])),a;case 3:return!0;default:throw Error(r(390))}}var jr=0;function Nr(e,t,n,i){var a=n.boundary;if(a===null)return Ar(e,t,n,i);if(a.parentFlushed=!0,a.status===4){var o=a.row;return o!==null&&--o.pendingTasks===0&&er(e,o),e.renderState.generateStaticMarkup||(a=a.errorDigest,t.push(`<!--$!-->`),t.push(`<template`),a&&(t.push(` data-dgst="`),a=P(a),t.push(a),t.push(`"`)),t.push(`></template>`)),Ar(e,t,n,i),e=e.renderState.generateStaticMarkup?!0:t.push(`<!--/$-->`),e}if(a.status!==1)return a.status===0&&(a.rootSegmentID=e.nextSegmentId++),0<a.completedSegments.length&&e.partialBoundaries.push(a),V(t,e.renderState,a.rootSegmentID),i&&wt(i,a.fallbackState),Ar(e,t,n,i),t.push(`<!--/$-->`);if(!H&&zn(e,a)&&jr+a.byteSize>e.progressiveChunkSize)return a.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(a),V(t,e.renderState,a.rootSegmentID),Ar(e,t,n,i),t.push(`<!--/$-->`);if(jr+=a.byteSize,i&&wt(i,a.contentState),n=a.row,n!==null&&zn(e,a)&&--n.pendingTasks===0&&er(e,n),e.renderState.generateStaticMarkup||t.push(`<!--$-->`),n=a.completedSegments,n.length!==1)throw Error(r(391));return Nr(e,t,n[0],i),e=e.renderState.generateStaticMarkup?!0:t.push(`<!--/$-->`),e}function Pr(e,t,n,r){return He(t,e.renderState,n.parentFormatContext,n.id),Nr(e,t,n,r),Ue(t,n.parentFormatContext)}function Fr(e,t,n){jr=n.byteSize;for(var r=n.completedSegments,i=0;i<r.length;i++)Ir(e,t,n,r[i]);r.length=0,r=n.row,r!==null&&zn(e,n)&&--r.pendingTasks===0&&er(e,r),Qe(t,n.contentState,e.renderState),r=e.resumableState,e=e.renderState,i=n.rootSegmentID,n=n.contentState;var a=e.stylesToHoist;return e.stylesToHoist=!1,t.push(e.startInlineScript),t.push(`>`),a?(!(r.instructions&4)&&(r.instructions|=4,t.push(`$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};`)),!(r.instructions&2)&&(r.instructions|=2,t.push(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
337$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`)),r.instructions&8?t.push(`$RR("`):(r.instructions|=8,t.push(`$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=
338"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);
338if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=
339"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("`))):(!(r.instructions&2)&&(r.instructions|=2,t.push(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
340$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`)),t.push(`$RC("`)),r=i.toString(16),t.push(e.boundaryPrefix),t.push(r),t.push(`","`),t.push(e.segmentPrefix),t.push(r),a?(t.push(`",`),ot(t,n)):t.push(`"`),n=t.push(`)<\/script>`),B(t,e)&&n}function Ir(e,t,n,i){if(i.status===2)return!0;var a=n.contentState,o=i.id;if(o===-1){if((i.id=n.rootSegmentID)===-1)throw Error(r(392));return Pr(e,t,i,a)}return o===n.rootSegmentID?Pr(e,t,i,a):(Pr(e,t,i,a),n=e.resumableState,e=e.renderState,t.push(e.startInlineScript),t.push(`>`),n.instructions&1?t.push(`$RS("`):(n.instructions|=1,t.push(`$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("`)),t.push(e.segmentPrefix),o=o.toString(16),t.push(o),t.push(`","`),t.push(e.placeholderPrefix),t.push(o),t=t.push(`")<\/script>`),t)}var H=!1;function Lr(e,t){try{if(!(0<e.pendingRootTasks)){var n,r=e.completedRootSegment;if(r!==null){if(r.status===5)return;var i=e.completedPreambleSegments;if(i===null)return;jr=e.byteSize;var a=e.resumableState,o=e.renderState,s=o.preamble,c=s.htmlChunks,l=s.headChunks,u;if(c){for(u=0;u<c.length;u++)t.push(c[u]);if(l)for(u=0;u<l.length;u++)t.push(l[u]);else{var d=Ie(`head`);t.push(d),t.push(`>`)}}else if(l)for(u=0;u<l.length;u++)t.push(l[u]);var f=o.charsetChunks;for(u=0;u<f.length;u++)t.push(f[u]);f.length=0,o.preconnects.forEach($e,t),o.preconnects.clear();var p=o.viewportChunks;for(u=0;u<p.length;u++)t.push(p[u]);p.length=0,o.fontPreloads.forEach($e,t),o.fontPreloads.clear(),o.highImagePreloads.forEach($e,t),o.highImagePreloads.clear(),ie=o,o.styles.forEach(nt,t),ie=null;var m=o.importMapChunks;for(u=0;u<m.length;u++)t.push(m[u]);m.length=0,o.bootstrapScripts.forEach($e,t),o.scripts.forEach($e,t),o.scripts.clear(),o.bulkPreloads.forEach($e,t),o.bulkPreloads.clear(),a.instructions|=32;var h=o.hoistableChunks;for(u=0;u<h.length;u++)t.push(h[u]);for(a=h.length=0;a<i.length;a++){var g=i[a];for(o=0;o<g.length;o++)Nr(e,t,g[o],null)}var _=e.renderState.preamble,v=_.headChunks;if(_.htmlChunks||v){var y=ze(`head`);t.push(y)}var b=_.bodyChunks;if(b)for(i=0;i<b.length;i++)t.push(b[i]);Nr(e,t,r,null),e.completedRootSegment=null;var x=e.renderState;if(e.allPendingTasks!==0||e.clientRenderedBoundaries.length!==0||e.completedBoundaries.length!==0||e.trackedPostpones!==null&&(e.trackedPostpones.rootNodes.length!==0||e.trackedPostpones.rootSlots!==null)){var S=e.resumableState;if(!(S.instructions&64)){if(S.instructions|=64,t.push(x.startInlineScript),!(S.instructions&32)){S.instructions|=32;var C=`_`+S.idPrefix+`R_`;t.push(` id="`);var w=P(C);t.push(w),t.push(`"`)}t.push(`>`),t.push(`requestAnimationFrame(function(){$RT=performance.now()});`),t.push(`<\/script>`)}}B(t,x)}var T=e.renderState;r=0;var E=T.viewportChunks;for(r=0;r<E.length;r++)t.push(E[r]);
vendor: 7,048 bytes, line 340
340E.length=0,T.preconnects.forEach($e,t),T.preconnects.clear(),T.fontPreloads.forEach($e,t),T.fontPreloads.clear(),T.highImagePreloads.forEach($e,t),T.highImagePreloads.clear(),T.styles.forEach(it,t),T.scripts.forEach($e,t),T.scripts.clear(),T.bulkPreloads.forEach($e,t),T.bulkPreloads.clear();var D=T.hoistableChunks;for(r=0;r<D.length;r++)t.push(D[r]);D.length=0;var O=e.clientRenderedBoundaries;for(n=0;n<O.length;n++){var k=O[n];T=t;var A=e.resumableState,j=e.renderState,M=k.rootSegmentID,N=k.errorDigest;T.push(j.startInlineScript),T.push(`>`),A.instructions&4?T.push(`$RX("`):(A.instructions|=4,T.push(`$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("`)),T.push(j.boundaryPrefix);var F=M.toString(16);if(T.push(F),T.push(`"`),N){T.push(`,`);var I=Ge(N||``);T.push(I)}var L=T.push(`)<\/script>`);if(!L){e.destination=null,n++,O.splice(0,n);return}}O.splice(0,n);var R=e.completedBoundaries;for(n=0;n<R.length;n++)if(!Fr(e,t,R[n])){e.destination=null,n++,R.splice(0,n);return}R.splice(0,n),H=!0;var ee=e.partialBoundaries;for(n=0;n<ee.length;n++){var z=ee[n];a:{O=e,k=t,jr=z.byteSize;var te=z.completedSegments;for(L=0;L<te.length;L++)if(!Ir(O,k,z,te[L])){L++,te.splice(0,L);var ne=!1;break a}te.splice(0,L);var re=z.row;re!==null&&re.together&&z.pendingTasks===1&&(re.pendingTasks===1?tr(O,re,re.hoistables):re.pendingTasks--),ne=Qe(k,z.contentState,O.renderState)}if(!ne){e.destination=null,n++,ee.splice(0,n);return}}ee.splice(0,n),H=!1;var ae=e.completedBoundaries;for(n=0;n<ae.length;n++)if(!Fr(e,t,ae[n])){e.destination=null,n++,ae.splice(0,n);return}ae.splice(0,n)}}finally{H=!1,e.allPendingTasks===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0&&(e.flushScheduled=!1,n=e.resumableState,n.hasBody&&(ee=ze(`body`),t.push(ee)),n.hasHtml&&(n=ze(`html`),t.push(n)),e.status=14,t.push(null),e.destination=null)}}function Rr(e){if(!1===e.flushScheduled&&e.pingedTasks.length===0&&e.destination!==null){e.flushScheduled=!0;var t=e.destination;t?Lr(e,t):e.flushScheduled=!1}}function zr(e,t){if(e.status===13)e.status=14,t.destroy(e.fatalError);else if(e.status!==14&&e.destination===null){e.destination=t;try{Lr(e,t)}catch(t){Qn(e,t,{}),$n(e,t)}}}function Br(e,t){(e.status===11||e.status===10)&&(e.status=12);try{var n=e.abortableTasks;if(0<n.size){var i=t===void 0?Error(r(432)):typeof t==`object`&&t&&typeof t.then==`function`?Error(r(530)):t;e.fatalError=i,n.forEach(function(t){return br(t,e,i)}),n.clear()}e.destination!==null&&Lr(e,e.destination)}catch(t){Qn(e,t,{}),$n(e,t)}}function Vr(e,t,n){if(t===null)n.rootNodes.push(e);else{var r=n.workingMap,i=r.get(t);i===void 0&&(i=[t[1],t[2],[],null],r.set(t,i),Vr(i,t[0],n)),i[2].push(e)}}function Hr(){}function Ur(e,t,n,i){var a=!1,o=null,s=``,c=!1;if(t=se(t?t.identifierPrefix:void 0),e=Hn(e,t,Tt(t,n),ce(0,null,0,null),1/0,Hr,void 0,function(){c=!0},void 0,void 0,void 0),e.flushScheduled=e.destination!==null,Er(e),e.status===10&&(e.status=11),e.trackedPostpones===null&&xr(e,e.pendingRootTasks===0),Br(e,i),zr(e,{push:function(e){return e!==null&&(s+=e),!0},destroy:function(e){a=!0,o=e}}),a&&o!==i)throw o;if(!c)throw Error(r(426));return s}e.renderToStaticMarkup=function(e,t){return Ur(e,t,!0,`The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server`)},e.renderToString=function(e,t){return Ur(e,t,!1,`The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server`)},e.version=`19.2.3`})),cEe=i((e=>{var t=Ve(),n=Mr();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=Symbol.for(`react.transitional.element`),a=Symbol.for(`react.portal`),o=Symbol.for(`react.fragment`),s=Symbol.for(`react.strict_mode`),c=Symbol.for(`react.profiler`),l=Symbol.for(`react.consumer`),u=Symbol.for(`react.context`),d=Symbol.for(`react.forward_ref`),f=Symbol.for(`react.suspense`),p=Symbol.for(`react.suspense_list`),m=Symbol.for(`react.memo`),h=Symbol.for(`react.lazy`),g=Symbol.for(`react.scope`),_=Symbol.for(`react.activity`),v=Symbol.for(`react.legacy_hidden`),y=Symbol.for(`react.memo_cache_sentinel`),b=Symbol.for(`react.view_transition`),x=Symbol.iterator;function S(e){return typeof e!=`object`||!e?null:(e=x&&e[x]||e[`@@iterator`],typeof e==`function`?e:null)}var C=Array.isArray;function w(e,t){var n=e.length&3,r=e.length-n,i=t;for(t=0;t<r;){var a=e.charCodeAt(t)&255|(e.charCodeAt(++t)&255)<<8|(e.charCodeAt(++t)&255)<<16|(e.charCodeAt(++t)&255)<<24;++t,a=3432918353*(a&65535)+((3432918353*(a>>>16)&65535)<<16)&4294967295,a=a<<15|a>>>17,a=461845907*(a&65535)+((461845907*(a>>>16)&65535)<<16)&4294967295,i^=a,i=i<<13|i>>>19,i=5*(i&65535)+((5*(i>>>16)&65535)<<16)&4294967295,i=(i&65535)+27492+(((i>>>16)+58964&65535)<<16)}switch(a=0,n){case 3:a^=(e.charCodeAt(t+2)&255)<<16;case 2:a^=(e.charCodeAt(t+1)&255)<<8;case 1:a^=e.charCodeAt(t)&255,a=3432918353*(a&65535)+((3432918353*(a>>>16)&65535)<<16)&4294967295,a=a<<15|a>>>17,i^=461845907*(a&65535)+((461845907*(a>>>16)&65535)<<16)&4294967295}return i^=e.length,i^=i>>>16,i=2246822507*(i&65535)+((2246822507*(i>>>16)&65535)<<16)&4294967295,i^=i>>>13,i=3266489909*(i&65535)+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^i>>>16)>>>0}var T=new MessageChannel,E=[];T.port1.onmessage=function(){var e=E.shift();e&&e()};function D(e){E.push(e),T.port2.postMessage(null)}function O(e){setTimeout(function(){throw e})}var k=Promise,A=typeof queueMicrotask==`function`?queueMicrotask:function(e){k.resolve(null).then(e).catch(O)},j=null,M=0;function N(e,t){if(t.byteLength!==0)if(2048<t.byteLength)0<M&&(e.enqueue(new Uint8Array(j.buffer,0,M)),j=new Uint8Array(2048),M=0),e.enqueue(t);else{var n=j.length-M;n<t.byteLength&&(n===0?e.enqueue(j):(j.set(t.subarray(0,n),M),e.enqueue(j),t=t.subarray(n)),j=new Uint8Array(2048),M=0),j.set(t,M),M+=t.byteLength}}function P(e,t){return N(e,t),!0}function F(e){j&&0<M&&(e.enqueue(new Uint8Array(j.buffer,0,M)),j=null,M=0)}var I=new TextEncoder;function L(e){return I.encode(e)}function R(e){return I.encode(e)}function ee(e){return e.byteLength}function z(e,t){typeof e.error==`function`?e.error(t):e.close()}var te=Object.assign,ne=Object.prototype.hasOwnProperty,re=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
340037D\\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]*$`),ie={},ae={};function oe(e){return ne.call(ae,e)?!0:ne.call(ie,e)?!1:re.test(e)?ae[e]=!0:(ie[e]=!0,!1)}var se=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `)),ce=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),le=/["'&<>]/;function ue(e){if(typeof e==`boolean`||typeof e==`number`||typeof e==`bigint`)return``+e;e=``+e;var t=le.exec(e);if(t){var n=``,r,i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=`&quot;`;break;case 38:t=`&amp;`;break;case 39:t=`&#x27;`;break;case 60:t=`&lt;`;break;case 62:t=`&gt;`;break;default:continue}i!==r&&(n+=e.slice(i,r)),i=r+1,n+=t}e=i===r?n:n+e.slice(i,r)}return e}
vendor: 9,676 bytes, line 340
340var de=/([A-Z])/g,fe=/^ms-/,pe=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function me(e){return pe.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}var he=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ve=ge.d;ge.d={f:ve.f,r:ve.r,D:br,C:xr,L:Sr,m:Cr,X:Tr,S:wr,M:Er};var ye=[],be=null;R(`"></template>`);var xe=R(`<script`),Se=R(`<\/script>`),Ce=R(`<script src="`),we=R(`<script type="module" src="`),Te=R(` nonce="`),Ee=R(` integrity="`),De=R(` crossorigin="`),Oe=R(` async=""><\/script>`),ke=R(`<style`),Ae=/(<\/|<)(s)(cript)/gi;function je(e,t,n,r){return``+t+(n===`s`?`\\u0073`:`\\u0053`)+r}var Me=R(`<script type="importmap">`),Ne=R(`<\/script>`);function Pe(e,t,n,r,i,a){n=typeof t==`string`?t:t&&t.script;var o=n===void 0?xe:R(`<script nonce="`+ue(n)+`"`),s=typeof t==`string`?void 0:t&&t.style,c=s===void 0?ke:R(`<style nonce="`+ue(s)+`"`),l=e.idPrefix,u=[],d=e.bootstrapScriptContent,f=e.bootstrapScripts,p=e.bootstrapModules;if(d!==void 0&&(u.push(o),fr(u,e),u.push(ct,L((``+d).replace(Ae,je)),Se)),d=[],r!==void 0&&(d.push(Me),d.push(L((``+JSON.stringify(r)).replace(Ae,je))),d.push(Ne)),r=i?{preconnects:``,fontPreloads:``,highImagePreloads:``,remainingCapacity:2+(typeof a==`number`?a:2e3)}:null,i={placeholderPrefix:R(l+`P:`),segmentPrefix:R(l+`S:`),boundaryPrefix:R(l+`B:`),startInlineScript:o,startInlineStyle:c,preamble:Ie(),externalRuntimeScript:null,bootstrapChunks:u,importMapChunks:d,onHeaders:i,headers:r,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:new Set,fontPreloads:new Set,highImagePreloads:new Set,styles:new Map,bootstrapScripts:new Set,scripts:new Set,bulkPreloads:new Set,preloads:{images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map},nonce:{script:n,style:s},hoistableState:null,stylesToHoist:!1},f!==void 0)for(r=0;r<f.length;r++)l=f[r],s=o=void 0,c={rel:`preload`,as:`script`,fetchPriority:`low`,nonce:t},typeof l==`string`?c.href=a=l:(c.href=a=l.src,c.integrity=s=typeof l.integrity==`string`?l.integrity:void 0,c.crossOrigin=o=typeof l==`string`||l.crossOrigin==null?void 0:l.crossOrigin===`use-credentials`?`use-credentials`:``),l=e,d=a,l.scriptResources[d]=null,l.moduleScriptResources[d]=null,l=[],_t(l,c),i.bootstrapScripts.add(l),u.push(Ce,L(ue(a)),Ze),n&&u.push(Te,L(ue(n)),Ze),typeof s==`string`&&u.push(Ee,L(ue(s)),Ze),typeof o==`string`&&u.push(De,L(ue(o)),Ze),fr(u,e),u.push(Oe);if(p!==void 0)for(t=0;t<p.length;t++)s=p[t],a=r=void 0,o={rel:`modulepreload`,fetchPriority:`low`,nonce:n},typeof s==`string`?o.href=f=s:(o.href=f=s.src,o.integrity=a=typeof s.integrity==`string`?s.integrity:void 0,o.crossOrigin=r=typeof s==`string`||s.crossOrigin==null?void 0:s.crossOrigin===`use-credentials`?`use-credentials`:``),s=e,c=f,s.scriptResources[c]=null,s.moduleScriptResources[c]=null,s=[],_t(s,o),i.bootstrapScripts.add(s),u.push(we,L(ue(f)),Ze),n&&u.push(Te,L(ue(n)),Ze),typeof a==`string`&&u.push(Ee,L(ue(a)),Ze),typeof r==`string`&&u.push(De,L(ue(r)),Ze),fr(u,e),u.push(Oe);return i}function Fe(e,t,n,r,i){return{idPrefix:e===void 0?``:e,nextFormID:0,streamingFormat:0,bootstrapScriptContent:n,bootstrapScripts:r,bootstrapModules:i,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function Ie(){return{htmlChunks:null,headChunks:null,bodyChunks:null}}function Le(e,t,n,r){return{insertionMode:e,selectedValue:t,tagScope:n,viewTransition:r}}function Re(e){return Le(e===`http://www.w3.org/2000/svg`?4:e===`http://www.w3.org/1998/Math/MathML`?5:0,null,0,null)}function ze(e,t,n){var r=e.tagScope&-25;switch(t){case`noscript`:return Le(2,null,r|1,null);case`select`:return Le(2,n.value==null?n.defaultValue:n.value,r,null);case`svg`:return Le(4,null,r,null);case`picture`:return Le(2,null,r|2,null);case`math`:return Le(5,null,r,null);case`foreignObject`:return Le(2,null,r,null);case`table`:return Le(6,null,r,null);case`thead`:case`tbody`:case`tfoot`:return Le(7,null,r,null);case`colgroup`:return Le(9,null,r,null);case`tr`:return Le(8,null,r,null);case`head`:if(2>e.insertionMode)return Le(3,null,r,null);break;case`html`:if(e.insertionMode===0)return Le(1,null,r,null)}return 6<=e.insertionMode||2>e.insertionMode?Le(2,null,r,null):e.tagScope===r?e:Le(e.insertionMode,e.selectedValue,r,null)}function Be(e){return e===null?null:{update:e.update,enter:`none`,exit:`none`,share:e.update,name:e.autoName,autoName:e.autoName,nameIdx:0}}function B(e,t){return t.tagScope&32&&(e.instructions|=128),Le(t.insertionMode,t.selectedValue,t.tagScope|12,Be(t.viewTransition))}function V(e,t){e=Be(t.viewTransition);var n=t.tagScope|16;return e!==null&&e.share!==`none`&&(n|=64),Le(t.insertionMode,t.selectedValue,n,e)}var He=R(`<!-- -->`);function Ue(e,t,n,r){return t===``?r:(r&&e.push(He),e.push(L(ue(t))),!0)}var We=new Map,Ge=R(` style="`),Ke=R(`:`),qe=R(`;`);function Je(e,t){if(typeof t!=`object`)throw Error(r(62));var n=!0,i;for(i in t)if(ne.call(t,i)){var a=t[i];if(a!=null&&typeof a!=`boolean`&&a!==``){if(i.indexOf(`--`)===0){var o=L(ue(i));a=L(ue((``+a).trim()))}else o=We.get(i),o===void 0&&(o=R(ue(i.replace(de,`-$1`).toLowerCase().replace(fe,`-ms-`))),We.set(i,o)),a=typeof a==`number`?a===0||se.has(i)?L(``+a):L(a+`px`):L(ue((``+a).trim()));n?(n=!1,e.push(Ge,o,Ke,a)):e.push(qe,o,Ke,a)}}n||e.push(Ze)}var Ye=R(` `),Xe=R(`="`),Ze=R(`"`),Qe=R(`=""`);function $e(e,t,n){n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(Ye,L(t),Qe)}function et(e,t,n){typeof n!=`function`&&typeof n!=`symbol`&&typeof n!=`boolean`&&e.push(Ye,L(t),Xe,L(ue(n)),Ze)}var tt=R(ue(`javascript:throw new Error('React form unexpectedly submitted.')`)),nt=R(`<input type="hidden"`);function rt(e,t){this.push(nt),it(e),et(this,`name`,t),et(this,`value`,e),this.push(lt)}function it(e){if(typeof e!=`string`)throw Error(r(480))}function at(e,t){if(typeof t.$$FORM_ACTION==`function`){var n=e.nextFormID++;e=e.idPrefix+n;try{var r=t.$$FORM_ACTION(e);return r&&r.data?.forEach(it),r}catch(e){if(typeof e==`object`&&e&&typeof e.then==`function`)throw e}}return null}function ot(e,t,n,r,i,a,o,s){var c=null;if(typeof r==`function`){var l=at(t,r);l===null?(e.push(Ye,L(`formAction`),Xe,tt,Ze),o=a=i=r=s=null,mt(t,n)):(s=l.name,r=l.action||``,i=l.encType,a=l.method,o=l.target,c=l.data)}return s!=null&&st(e,`name`,s),r!=null&&st(e,`formAction`,r),i!=null&&st(e,`formEncType`,i),a!=null&&st(e,`formMethod`,a),o!=null&&st(e,`formTarget`,o),c}function st(e,t,n){switch(t){case`className`:et(e,`class`,n);break;case`tabIndex`:et(e,`tabindex`,n);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:et(e,t,n);break;case`style`:Je(e,n);break;case`src`:case`href`:if(n===``)break;case`action`:case`formAction`:if(n==null||typeof n==`function`||typeof n==`symbol`||typeof n==`boolean`)break;n=me(``+n),e.push(Ye,L(t),Xe,L(ue(n)),Ze);break;case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`ref`:break;case`autoFocus`:case`multiple`:case`muted`:$e(e,t.toLowerCase(),n);break;case`xlinkHref`:if(typeof n==`function`||typeof n==`symbol`||typeof n==`boolean`)break;n=me(``+n),e.push(Ye,L(`xlink:href`),Xe,L(ue(n)),Ze);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:typeof n!=`function`&&typeof n!=`symbol`&&e.push(Ye,L(t),Xe,L(ue(n)),Ze);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(Ye,L(t),Qe);break;case`capture`:case`download`:!0===n?e.push(Ye,L(t),Qe):!1!==n&&typeof n!=`function`&&typeof n!=`symbol`&&e.push(Ye,L(t),Xe,L(ue(n)),Ze);break;case`cols`:case`rows`:case`size`:case`span`:typeof n!=`function`&&typeof n!=`symbol`&&!isNaN(n)&&1<=n&&e.push(Ye,L(t),Xe,L(ue(n)),Ze);break;case`rowSpan`:case`start`:typeof n==`function`||typeof n==`symbol`||isNaN(n)||e.push(Ye,L(t),Xe,L(ue(n)),Ze);break;case`xlinkActuate`:et(e,`xlink:actuate`,n);break;case`xlinkArcrole`:et(e,`xlink:arcrole`,n);break;case`xlinkRole`:et(e,`xlink:role`,n);break;case`xlinkShow`:et(e,`xlink:show`,n);break;case`xlinkTitle`:et(e,`xlink:title`,n);break;case`xlinkType`:et(e,`xlink:type`,n);break;case`xmlBase`:et(e,`xml:base`,n);break;case`xmlLang`:et(e,`xml:lang`,n);break;case`xmlSpace`:et(e,`xml:space`,n);break;default:if((!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`)&&(t=ce.get(t)||t,oe(t))){switch(typeof n){case`function`:case`symbol`:return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`)return}e.push(Ye,L(t),Xe,L(ue(n)),Ze)}}}var ct=R(`>`),lt=R(`/>`);function ut(e,t,n){if(t!=null){if(n!=null)throw Error(r(60));if(typeof t!=`object`||!(`__html`in t))throw Error(r(61));t=t.__html,t!=null&&e.push(L(``+t))}}function dt(e){var n=``;return t.Children.forEach(e,function(e){e!=null&&(n+=e)}),n}var ft=R(` selected=""`),pt=R(`addEventListener("submit",function(a){if
340(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});`);function mt(e,t){if(!(e.instructions&16)){e.instructions|=16;var n=t.preamble,r=t.bootstrapChunks;(n.htmlChunks||n.headChunks)&&r.length===0?(r.push(t.startInlineScript),fr(r,e),r.push(ct,pt,Se)):r.unshift(t.startInlineScript,ct,pt,Se)}}var ht=R(`<!--F!-->`),gt=R(`<!--F-->`);function _t(e,t){for(var n in e.push(jt(`link`)),t)if(ne.call(t,n)){var i=t[n];if(i!=null)switch(n){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`link`));default:st(e,n,i)}}return e.push(lt),null}var vt=/(<\/|<)(s)(tyle)/gi;function yt(e,t,n,r){return``+t+(n===`s`?`\\73 `:`\\53 `)+r}function bt(e,t,n){for(var i in e.push(jt(n)),t)if(ne.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,n));default:st(e,i,a)}}return e.push(lt),null}function xt(e,t){e.push(jt(`title`));var n=null,r=null,i;for(i in t)if(ne.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:st(e,i,a)}}return e.push(ct),t=Array.isArray(n)?2>n.length?n[0]:null:n,typeof t!=`function`&&typeof t!=`symbol`&&t!=null&&e.push(L(ue(``+t))),ut(e,r,n),e.push(Ft(`title`)),null}var St=R(`<!--head-->`),Ct=R(`<!--body-->`),wt=R(`<!--html-->`);function Tt(e,t){e.push(jt(`script`));var n=null,r=null,i;for(i in t)if(ne.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:st(e,i,a)}}return e.push(ct),ut(e,r,n),typeof n==`string`&&e.push(L((``+n).replace(Ae,je))),e.push(Ft(`script`)),null}function Et(e,t,n){e.push(jt(n));var r=n=null,i;for(i in t)if(ne.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:st(e,i,a)}}return e.push(ct),ut(e,r,n),n}function Dt(e,t,n){e.push(jt(n));var r=n=null,i;for(i in t)if(ne.call(t,i)){var a=t[i];if(a!=null)switch(i){case`children`:n=a;break;case`dangerouslySetInnerHTML`:r=a;break;default:st(e,i,a)}}return e.push(ct),ut(e,r,n),typeof n==`string`?(e.push(L(ue(n))),null):n}var Ot=R(`
341`),kt=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,At=new Map;function jt(e){var t=At.get(e);if(t===void 0){if(!kt.test(e))throw Error(r(65,e));t=R(`<`+e),At.set(e,t)}return t}var Mt=R(`<!DOCTYPE html>`);function Nt(e,t,n,i,a,o,s,c,l){switch(t){case`div`:case`span`:case`svg`:case`path`:break;case`a`:e.push(jt(`a`));var u=null,d=null,f;for(f in n)if(ne.call(n,f)){var p=n[f];if(p!=null)switch(f){case`children`:u=p;break;case`dangerouslySetInnerHTML`:d=p;break;case`href`:p===``?et(e,`href`,``):st(e,f,p);break;default:st(e,f,p)}}if(e.push(ct),ut(e,d,u),typeof u==`string`){e.push(L(ue(u)));var m=null}else m=u;return m;case`g`:case`p`:case`li`:break;case`select`:e.push(jt(`select`));var h=null,g=null,_;for(_ in n)if(ne.call(n,_)){var v=n[_];if(v!=null)switch(_){case`children`:h=v;break;case`dangerouslySetInnerHTML`:g=v;break;case`defaultValue`:case`value`:break;default:st(e,_,v)}}return e.push(ct),ut(e,g,h),h;case`option`:var y=c.selectedValue;e.push(jt(`option`));var b=null,x=null,S=null,w=null,T;for(T in n)if(ne.call(n,T)){var E=n[T];if(E!=null)switch(T){case`children`:b=E;break;case`selected`:S=E;break;case`dangerouslySetInnerHTML`:w=E;break;case`value`:x=E;default:st(e,T,E)}}if(y!=null){var D=x===null?dt(b):``+x;if(C(y)){for(var O=0;O<y.length;O++)if(``+y[O]===D){e.push(ft);break}}else``+y===D&&e.push(ft)}else S&&e.push(ft);return e.push(ct),ut(e,w,b),b;case`textarea`:e.push(jt(`textarea`));var k=null,A=null,j=null,M;for(M in n)if(ne.call(n,M)){var N=n[M];if(N!=null)switch(M){case`children`:j=N;break;case`value`:k=N;break;case`defaultValue`:A=N;break;case`dangerouslySetInnerHTML`:throw Error(r(91));default:st(e,M,N)}}if(k===null&&A!==null&&(k=A),e.push(ct),j!=null){if(k!=null)throw Error(r(92));if(C(j)){if(1<j.length)throw Error(r(93));k=``+j[0]}k=``+j}
341return typeof k==`string`&&k[0]===`
342`&&e.push(Ot),k!==null&&e.push(L(ue(``+k))),null;case`input`:e.push(jt(`input`));var P=null,F=null,I=null,R=null,ee=null,z=null,re=null,ie=null,ae=null,se;for(se in n)if(ne.call(n,se)){var ce=n[se];if(ce!=null)switch(se){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`input`));case`name`:P=ce;break;case`formAction`:F=ce;break;case`formEncType`:I=ce;break;case`formMethod`:R=ce;break;case`formTarget`:ee=ce;break;case`defaultChecked`:ae=ce;break;case`defaultValue`:re=ce;break;case`checked`:ie=ce;break;case`value`:z=ce;break;default:st(e,se,ce)}}var le=ot(e,i,a,F,I,R,ee,P);return ie===null?ae!==null&&$e(e,`checked`,ae):$e(e,`checked`,ie),z===null?re!==null&&st(e,`value`,re):st(e,`value`,z),e.push(lt),le?.forEach(rt,e),null;case`button`:e.push(jt(`button`));var de=null,fe=null,pe=null,he=null,ge=null,_e=null,ve=null,be;for(be in n)if(ne.call(n,be)){var xe=n[be];if(xe!=null)switch(be){case`children`:de=xe;break;case`dangerouslySetInnerHTML`:fe=xe;break;case`name`:pe=xe;break;case`formAction`:he=xe;break;case`formEncType`:ge=xe;break;case`formMethod`:_e=xe;break;case`formTarget`:ve=xe;break;default:st(e,be,xe)}}var Se=ot(e,i,a,he,ge,_e,ve,pe);if(e.push(ct),Se?.forEach(rt,e),ut(e,fe,de),typeof de==`string`){e.push(L(ue(de)));var Ce=null}else Ce=de;return Ce;case`form`:e.push(jt(`form`));var we=null,Te=null,Ee=null,De=null,Oe=null,ke=null,Ae;for(Ae in n)if(ne.call(n,Ae)){var je=n[Ae];if(je!=null)switch(Ae){case`children`:we=je;break;case`dangerouslySetInnerHTML`:Te=je;break;case`action`:Ee=je;break;case`encType`:De=je;break;case`method`:Oe=je;break;case`target`:ke=je;break;default:st(e,Ae,je)}}var Me=null,Ne=null;if(typeof Ee==`function`){var Pe=at(i,Ee);Pe===null?(e.push(Ye,L(`action`),Xe,tt,Ze),ke=Oe=De=Ee=null,mt(i,a)):(Ee=Pe.action||``,De=Pe.encType,Oe=Pe.method,ke=Pe.target,Me=Pe.data,Ne=Pe.name)}if(Ee!=null&&st(e,`action`,Ee),De!=null&&st(e,`encType`,De),Oe!=null&&st(e,`method`,Oe),ke!=null&&st(e,`target`,ke),e.push(ct),Ne!==null&&(e.push(nt),et(e,`name`,Ne),e.push(lt),Me?.forEach(rt,e)),ut(e,Te,we),typeof we==`string`){e.push(L(ue(we)));var Fe=null}else Fe=we;return Fe;case`menuitem`:for(var Ie in e.push(jt(`menuitem`)),n)if(ne.call(n,Ie)){var Le=n[Ie];if(Le!=null)switch(Ie){case`children`:case`dangerouslySetInnerHTML`:throw Error(r(400));default:st(e,Ie,Le)}}return e.push(ct),null;case`object`:e.push(jt(`object`));var Re=null,ze=null,Be;for(Be in n)if(ne.call(n,Be)){var Ve=n[Be];if(Ve!=null)switch(Be){case`children`:Re=Ve;break;case`dangerouslySetInnerHTML`:ze=Ve;break;case`data`:var B=me(``+Ve);if(B===``)break;e.push(Ye,L(`data`),Xe,L(ue(B)),Ze);break;default:st(e,Be,Ve)}}if(e.push(ct),ut(e,ze,Re),typeof Re==`string`){e.push(L(ue(Re)));var V=null}else V=Re;return V;case`title`:var Ue=c.tagScope&1,We=c.tagScope&4;if(c.insertionMode===4||Ue||n.itemProp!=null)var Ge=xt(e,n);else We?Ge=null:(xt(a.hoistableChunks,n),Ge=void 0);return Ge;case`link`:var Ke=c.tagScope&1,qe=c.tagScope&4,Qe=n.rel,it=n.href,pt=n.precedence;if(c.insertionMode===4||Ke||n.itemProp!=null||typeof Qe!=`string`||typeof it!=`string`||it===``){_t(e,n);var ht=null}else if(n.rel===`stylesheet`)if(typeof pt!=`string`||n.disabled!=null||n.onLoad||n.onError)ht=_t(e,n);else{var gt=a.styles.get(pt),kt=i.styleResources.hasOwnProperty(it)?i.styleResources[it]:void 0;if(kt!==null){i.styleResources[it]=null,gt||(gt={precedence:L(ue(pt)),rules:[],hrefs:[],sheets:new Map},a.styles.set(pt,gt));var At={state:0,props:te({},n,{"data-precedence":n.precedence,precedence:null})};if(kt){kt.length===2&&Dr(At.props,kt);var Nt=a.preloads.stylesheets.get(it);Nt&&0<Nt.length?Nt.length=0:At.state=1}gt.sheets.set(it,At),s&&s.stylesheets.add(At)}else if(gt){var Pt=gt.sheets.get(it);Pt&&s&&s.stylesheets.add(Pt)}l&&e.push(He),ht=null}else n.onLoad||n.onError?ht=_t(e,n):(l&&e.push(He),ht=qe?null:_t(a.hoistableChunks,n));return ht;case`script`:var It=c.tagScope&1,Lt=n.async;if(typeof n.src!=`string`||!n.src||!Lt||typeof Lt==`function`||typeof Lt==`symbol`||n.onLoad||n.onError||c.insertionMode===4||It||n.itemProp!=null)var Rt=Tt(e,n);else{var zt=n.src;if(n.type===`module`)var Bt=i.moduleScriptResources,Vt=a.preloads.moduleScripts;else Bt=i.scriptResources,Vt=a.preloads.scripts;var Ht=Bt.hasOwnProperty(zt)?Bt[zt]:void 0;if(Ht!==null){Bt[zt]=null;var Ut=n;if(Ht){Ht.length===2&&(Ut=te({},n),Dr(Ut,Ht));var Wt=Vt.get(zt);Wt&&(Wt.length=0)}var Gt=[];a.scripts.add(Gt),Tt(Gt,Ut)}l&&e.push(He),Rt=null}return Rt;case`style`:var Kt=c.tagScope&1,qt=n.precedence,Jt=n.href,Yt=n.nonce;if(c.insertionMode===4||Kt||n.itemProp!=null||typeof qt!=`string`||typeof Jt!=`string`||Jt===``){e.push(jt(`style`));var Xt=null,Zt=null,Qt;for(Qt in n)if(ne.call(n,Qt)){var $t=n[Qt];if($t!=null)switch(Qt){case`children`:Xt=$t;break;case`dangerouslySetInnerHTML`:Zt=$t;break;default:st(e,Qt,$t)}}e.push(ct);var en=Array.isArray(Xt)?2>Xt.length?Xt[0]:null:Xt;typeof en!=`function`&&typeof en!=`symbol`&&en!=null&&e.push(L((``+en).replace(vt,yt))),ut(e,Zt,Xt),e.push(Ft(`style`));var tn=null}else{var nn=a.styles.get(qt);if((i.styleResources.hasOwnProperty(Jt)?i.styleResources[Jt]:void 0)!==null){i.styleResources[Jt]=null,nn||(nn={precedence:L(ue(qt)),rules:[],hrefs:[],sheets:new Map},a.styles.set(qt,nn));
vendor: 6,522 bytes, lines 342-345
342var rn=a.nonce.style;if(!rn||rn===Yt){nn.hrefs.push(L(ue(Jt)));var an=nn.rules,on=null,sn=null,cn;for(cn in n)if(ne.call(n,cn)){var ln=n[cn];if(ln!=null)switch(cn){case`children`:on=ln;break;case`dangerouslySetInnerHTML`:sn=ln}}var un=Array.isArray(on)?2>on.length?on[0]:null:on;typeof un!=`function`&&typeof un!=`symbol`&&un!=null&&an.push(L((``+un).replace(vt,yt))),ut(an,sn,on)}}nn&&s&&s.styles.add(nn),l&&e.push(He),tn=void 0}return tn;case`meta`:var dn=c.tagScope&1,fn=c.tagScope&4;if(c.insertionMode===4||dn||n.itemProp!=null)var pn=bt(e,n,`meta`);else l&&e.push(He),pn=fn?null:typeof n.charSet==`string`?bt(a.charsetChunks,n,`meta`):n.name===`viewport`?bt(a.viewportChunks,n,`meta`):bt(a.hoistableChunks,n,`meta`);return pn;case`listing`:case`pre`:e.push(jt(t));var mn=null,hn=null,gn;for(gn in n)if(ne.call(n,gn)){var _n=n[gn];if(_n!=null)switch(gn){case`children`:mn=_n;break;case`dangerouslySetInnerHTML`:hn=_n;break;default:st(e,gn,_n)}}if(e.push(ct),hn!=null){if(mn!=null)throw Error(r(60));if(typeof hn!=`object`||!(`__html`in hn))throw Error(r(61));var vn=hn.__html;vn!=null&&(typeof vn==`string`&&0<vn.length&&vn[0]===`
343`?e.push(Ot,L(vn)):e.push(L(``+vn)))}return typeof mn==`string`&&mn[0]===`
344`&&e.push(Ot),mn;case`img`:var yn=c.tagScope&3,bn=n.src,xn=n.srcSet;if(!(n.loading===`lazy`||!bn&&!xn||typeof bn!=`string`&&bn!=null||typeof xn!=`string`&&xn!=null||n.fetchPriority===`low`||yn)&&(typeof bn!=`string`||bn[4]!==`:`||bn[0]!==`d`&&bn[0]!==`D`||bn[1]!==`a`&&bn[1]!==`A`||bn[2]!==`t`&&bn[2]!==`T`||bn[3]!==`a`&&bn[3]!==`A`)&&(typeof xn!=`string`||xn[4]!==`:`||xn[0]!==`d`&&xn[0]!==`D`||xn[1]!==`a`&&xn[1]!==`A`||xn[2]!==`t`&&xn[2]!==`T`||xn[3]!==`a`&&xn[3]!==`A`)){s!==null&&c.tagScope&64&&(s.suspenseyImages=!0);var Sn=typeof n.sizes==`string`?n.sizes:void 0,Cn=xn?xn+`
345`+(Sn||``):bn,wn=a.preloads.images,Tn=wn.get(Cn);if(Tn)(n.fetchPriority===`high`||10>a.highImagePreloads.size)&&(wn.delete(Cn),a.highImagePreloads.add(Tn));else if(!i.imageResources.hasOwnProperty(Cn)){i.imageResources[Cn]=ye;var En=n.crossOrigin,Dn=typeof En==`string`?En===`use-credentials`?En:``:void 0,On=a.headers,kn;On&&0<On.remainingCapacity&&typeof n.srcSet!=`string`&&(n.fetchPriority===`high`||500>On.highImagePreloads.length)&&(kn=Or(bn,`image`,{imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:Dn,integrity:n.integrity,nonce:n.nonce,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.refererPolicy}),0<=(On.remainingCapacity-=kn.length+2))?(a.resets.image[Cn]=ye,On.highImagePreloads&&(On.highImagePreloads+=`, `),On.highImagePreloads+=kn):(Tn=[],_t(Tn,{rel:`preload`,as:`image`,href:xn?void 0:bn,imageSrcSet:xn,imageSizes:Sn,crossOrigin:Dn,integrity:n.integrity,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.referrerPolicy}),n.fetchPriority===`high`||10>a.highImagePreloads.size?a.highImagePreloads.add(Tn):(a.bulkPreloads.add(Tn),wn.set(Cn,Tn)))}}return bt(e,n,`img`);case`base`:case`area`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`param`:case`source`:case`track`:case`wbr`:return bt(e,n,t);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`:break;case`head`:if(2>c.insertionMode){var An=o||a.preamble;if(An.headChunks)throw Error(r(545,"`<head>`"));o!==null&&e.push(St),An.headChunks=[];var jn=Et(An.headChunks,n,`head`)}else jn=Dt(e,n,`head`);return jn;case`body`:if(2>c.insertionMode){var Mn=o||a.preamble;if(Mn.bodyChunks)throw Error(r(545,"`<body>`"));o!==null&&e.push(Ct),Mn.bodyChunks=[];var Nn=Et(Mn.bodyChunks,n,`body`)}else Nn=Dt(e,n,`body`);return Nn;case`html`:if(c.insertionMode===0){var Pn=o||a.preamble;if(Pn.htmlChunks)throw Error(r(545,"`<html>`"));o!==null&&e.push(wt),Pn.htmlChunks=[Mt];var Fn=Et(Pn.htmlChunks,n,`html`)}else Fn=Dt(e,n,`html`);return Fn;default:if(t.indexOf(`-`)!==-1){e.push(jt(t));var In=null,Ln=null,Rn;for(Rn in n)if(ne.call(n,Rn)){var zn=n[Rn];if(zn!=null){var Bn=Rn;switch(Rn){case`children`:In=zn;break;case`dangerouslySetInnerHTML`:Ln=zn;break;case`style`:Je(e,zn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`ref`:break;case`className`:Bn=`class`;default:if(oe(Rn)&&typeof zn!=`function`&&typeof zn!=`symbol`&&!1!==zn){if(!0===zn)zn=``;else if(typeof zn==`object`)continue;e.push(Ye,L(Bn),Xe,L(ue(zn)),Ze)}}}}return e.push(ct),ut(e,Ln,In),In}}return Dt(e,n,t)}var Pt=new Map;function Ft(e){var t=Pt.get(e);return t===void 0&&(t=R(`</`+e+`>`),Pt.set(e,t)),t}function It(e,t){e=e.preamble,e.htmlChunks===null&&t.htmlChunks&&(e.htmlChunks=t.htmlChunks),e.headChunks===null&&t.headChunks&&(e.headChunks=t.headChunks),e.bodyChunks===null&&t.bodyChunks&&(e.bodyChunks=t.bodyChunks)}function Lt(e,t){t=t.bootstrapChunks;for(var n=0;n<t.length-1;n++)N(e,t[n]);return n<t.length?(n=t[n],t.length=0,P(e,n)):!0}var Rt=R(`requestAnimationFrame(function(){$RT=performance.now()});`),zt=R(`<template id="`),Bt=R(`"></template>`),Vt=R(`<!--&-->`),Ht=R(`<!--/&-->`),Ut=R(`<!--$-->`),Wt=R(`<!--$?--><template id="`),Gt=R(`"></template>`),Kt=R(`<!--$!-->`),qt=R(`<!--/$-->`),Jt=R(`<template`),Yt=R(`"`),Xt=R(` data-dgst="`);R(` data-msg="`),R(` data-stck="`),R(` data-cstck="`);var Zt=R(`></template>`);function Qt(e,t,n){if(N(e,Wt),n===null)throw Error(r(395));return N(e,t.boundaryPrefix),N(e,L(n.toString(16))),P(e,Gt)}var $t=R(`<div hidden id="`),en=R(`">`),tn=R(`</div>`),nn=R(`<svg aria-hidden="true" style="display:none" id="`),rn=R(`">`),an=R(`</svg>`),on=R(`<math aria-hidden="true" style="display:none" id="`),sn=R(`">`),cn=R(`</math>`),ln=R(`<table hidden id="`),un=R(`">`),dn=R(`</table>`),fn=R(`<table hidden><tbody id="`),pn=R(`">`),mn=R(`</tbody></table>`),hn=R(`<table hidden><tr id="`),gn=R(`">`),_n=R(`</tr></table>`),vn=R(`<table hidden><colgroup id="`),yn=R(`">`),bn=R(`</colgroup></table>`);function xn(e,t,n,i){switch(n.insertionMode){case 0:case 1:case 3:case 2:return N(e,$t),N(e,t.segmentPrefix),N(e,L(i.toString(16))),P(e,en);case 4:return N(e,nn),N(e,t.segmentPrefix),N(e,L(i.toString(16))),P(e,rn);case 5:return N(e,on),N(e,t.segmentPrefix),N(e,L(i.toString(16))),P(e,sn);case 6:return N(e,ln),N(e,t.segmentPrefix),N(e,L(i.toString(16))),P(e,un);case 7:return N(e,fn),N(e,t.segmentPrefix),N(e,L(i.toString(16))),P(e,pn);case 8:return N(e,hn),N(e,t.segmentPrefix),N(e,L(i.toString(16))),P(e,gn);case 9:return N(e,vn),N(e,t.segmentPrefix),N(e,L(i.toString(16))),P(e,yn);default:throw Error(r(397))}}function Sn(e,t){switch(t.insertionMode){case 0:case 1:case 3:case 2:return P(e,t
345n);case 4:return P(e,an);case 5:return P(e,cn);case 6:return P(e,dn);case 7:return P(e,mn);case 8:return P(e,_n);case 9:return P(e,bn);default:throw Error(r(397))}}var Cn=R(`$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("`),wn=R(`$RS("`),Tn=R(`","`),En=R(`")<\/script>`);R(`<template data-rsi="" data-sid="`),R(`" data-pid="`);var Dn=R(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
346$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`);L(`$RV=function(A,g){function k(a,b){var e=a.getAttribute(b);e&&(b=a.style,l.push(a,b.viewTransitionName,b.viewTransitionClass),"auto"!==e&&(b.viewTransitionClass=e),(a=a.getAttribute("vt-name"))||(a="_T_"+K++ +"_"),b.viewTransitionName=a,B=!0)}var B=!1,K=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var h=g[f].querySelectorAll("[vt-share]"),d=0;d<h.length;d++){var c=h[d];m.set(c.getAttribute("vt-name"),c)}var u=[];for(h=0;h<g.length;h+=2){var C=g[h],x=C.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){c=C;for(f=0;c;){if(8===c.nodeType){var r=c.data;if("/$"===r)if(0===f)break;else f--;else"$"!==r&&"$?"!==r&&"$~"!==r&&"$!"!==r||f++}else if(1===c.nodeType){d=c;var D=d.getAttribute("vt-name"),y=m.get(D);k(d,y?"vt-share":"vt-exit");y&&(k(y,"vt-share"),m.set(D,null));var E=d.querySelectorAll("[vt-share]");for(d=0;d<E.length;d++){var F=E[d],G=F.getAttribute("vt-name"),
347H=m.get(G);H&&(k(F,"vt-share"),k(H,"vt-share"),m.set(G,null))}}c=c.nextSibling}for(var I=g[h+1],t=I.firstElementChild;t;)null!==m.get(t.getAttribute("vt-name"))&&k(t,"vt-enter"),t=t.nextElementSibling;c=x;do for(var n=c.firstElementChild;n;){var J=n.getAttribute("vt-update");J&&"none"!==J&&!l.includes(n)&&k(n,"vt-update");n=n.nextElementSibling}while((c=c.parentNode)&&1===c.nodeType&&"none"!==c.getAttribute("vt-update"));u.push.apply(u,I.querySelectorAll('img[src]:not([loading="lazy"])'))}}}if(B){var z=
348document.__reactViewTransition=document.startViewTransition({update:function(){A(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],b={},e=0;e<u.length;b={g:b.g},e++)if(b.g=u[e],!b.g.complete){var p=b.g.getBoundingClientRect();0<p.bottom&&0<p.right&&p.top<window.innerHeight&&p.left<window.innerWidth&&(p=new Promise(function(w){return function(q){w.g.addEventListener("load",q);w.g.addEventListener("error",q)}}(b)),a.push(p))}return Promise.race([Promise.all(a),new Promise(function(w){var q=
349performance.now();setTimeout(w,2300>q&&2E3<q?2300-q:500)})])},types:[]});z.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var b=l[a],e=b.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];""===b.getAttribute("style")&&b.removeAttribute("style")}});z.finished.finally(function(){document.__reactViewTransition===z&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}A(g)}.bind(null,$RV);`);var On=R(`$RC("`),kn=R(`$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=
350"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);
350if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=
351"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("`),An=R(`$RR("`),jn=R(`","`),Mn=R(`",`),Nn=R(`"`),Pn=R(`)<\/script>`);R(`<template data-rci="" data-bid="`),R(`<template data-rri="" data-bid="`),R(`" data-sid="`),R(`" data-sty="`);var Fn=R(`$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};`),In=R(`$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("`),Ln=R(`$RX("`),Rn=R(`"`),zn=R(`,`),Bn=R(`)<\/script>`);R(`<template data-rxi="" data-bid="`),R(`" data-dgst="`),R(`" data-msg="`),R(`" data-stck="`),R(`" data-cstck="`);var Vn=/[<\u2028\u2029]/g;function Hn(e){return JSON.stringify(e).replace(Vn,function(e){switch(e){case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var Un=/[&><\u2028\u2029]/g;function Wn(e){return JSON.stringify(e).replace(Un,function(e){switch(e){case`&`:return`\\u0026`;case`>`:return`\\u003e`;case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var Gn=R(` media="not all" data-precedence="`),Kn=R(`" data-href="`),qn=R(`">`),Jn=R(`</style>
351`),Yn=!1,Xn=!0;function Zn(e){var t=e.rules,n=e.hrefs,r=0;if(n.length){for(N(this,be.startInlineStyle),N(this,Gn),N(this,e.precedence),N(this,Kn);r<n.length-1;r++)N(this,n[r]),N(this,ar);for(N(this,n[r]),N(this,qn),r=0;r<t.length;r++)N(this,t[r]);Xn=P(this,Jn),Yn=!0,t.length=0,n.length=0}}function Qn(e){return e.state===2?!1:Yn=!0}function $n(e,t,n){return Yn=!1,Xn=!0,be=n,t.styles.forEach(Zn,e),be=null,t.stylesheets.forEach(Qn),Yn&&(n.stylesToHoist=!0),Xn}function er(e){for(var t=0;t<e.length;t++)N(this,e[t]);e.length=0}var tr=[];function nr(e){_t(tr,e.props);for(var t=0;t<tr.length;t++)N(this,tr[t]);tr.length=0,e.state=2}var rr=R(` data-precedence="`),ir=R(`" data-href="`),ar=R(` `),or=R(`">`),sr=R(`</style>`);function cr(e){var t=0<e.sheets.size;e.sheets.forEach(nr,this),e.sheets.clear();var n=e.rules,r=e.hrefs;if(!t||r.length){if(N(this,be.startInlineStyle),N(this,rr),N(this,e.precedence),e=0,r.length){for(N(this,ir);e<r.length-1;e++)N(this,r[e]),N(this,ar);N(this,r[e])}for(N(this,or),e=0;e<n.length;e++)N(this,n[e]);N(this,sr),n.length=0,r.length=0}}function lr(e){if(e.state===0){e.state=1;var t=e.props;for(_t(tr,{rel:`preload`,as:`style`,href:e.props.href,crossOrigin:t.crossOrigin,fetchPriority:t.fetchPriority,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy}),e=0;e<tr.length;e++)N(this,tr[e]);tr.length=0}}function ur(e){e.sheets.forEach(lr,this),e.sheets.clear()}R(`<link rel="expect" href="#`),R(`" blocking="render"/>`);var dr=R(` id="`);function fr(e,t){!(t.instructions&32)&&(t.instructions|=32,e.push(dr,L(ue(`_`+t.idPrefix+`R_`)),Ze))}var pr=R(`[`),mr=R(`,[`),hr=R(`,`),gr=R(`]`);function _r(e,t){N(e,pr);var n=pr;t.stylesheets.forEach(function(t){if(t.state!==2)if(t.state===3)N(e,n),N(e,L(Wn(``+t.props.href))),N(e,gr),n=mr;else{N(e,n);var i=t.props[`data-precedence`],a=t.props;for(var o in N(e,L(Wn(me(``+t.props.href)))),i=``+i,N(e,hr),N(e,L(Wn(i))),a)if(ne.call(a,o)&&(i=a[o],i!=null))switch(o){case`href`:case`rel`:case`precedence`:case`data-precedence`:break;case`children`:case`dangerouslySetInnerHTML`:throw Error(r(399,`link`));default:vr(e,o,i)}N(e,gr),n=mr,t.state=3}}),N(e,gr)}function vr(e,t,n){var r=t.toLowerCase();switch(typeof n){case`function`:case`symbol`:return}switch(t){case`innerHTML`:case`dangerouslySetInnerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`style`:case`ref`:return;case`className`:r=`class`,t=``+n;break;case`hidden`:if(!1===n)return;t=``;break;case`src`:case`href`:n=me(n),t=``+n;break;default:if(2<t.length&&(t[0]===`o`||t[0]===`O`)&&(t[1]===`n`||t[1]===`N`)||!oe(t))return;t=``+n}N(e,hr),N(e,L(Wn(r))),N(e,hr),N(e,L(Wn(t)))}function yr(){return{styles:new Set,stylesheets:new Set,suspenseyImages:!1}}function br(e){var t=ea||null;if(t){var n=t.resumableState,r=t.renderState;if(typeof e==`string`&&e){if(!n.dnsResources.hasOwnProperty(e)){n.dnsResources[e]=null,n=r.headers;var i,a;(a=n&&0<n.remainingCapacity)&&(a=(i=`<`+(``+e).replace(kr,Ar)+`>; rel=dns-prefetch`,0<=(n.remainingCapacity-=i.length+2))),a?(r.resets.dns[e]=null,n.preconnects&&(n.preconnects+=`, `),n.preconnects+=i):(i=[],_t(i,{href:e,rel:`dns-prefetch`}),r.preconnects.add(i))}Za(t)}}else ve.D(e)}function xr(e,t){var n=ea||null;if(n){var r=n.resumableState,i=n.renderState;if(typeof e==`string`&&e){var a=t===`use-credentials`?`credentials`:typeof t==`string`?`anonymous`:`default`;if(!r.connectResources[a].hasOwnProperty(e)){r.connectResources[a][e]=null,r=i.headers;var o,s;if(s=r&&0<r.remainingCapacity){if(s=`<`+(``+e).replace(kr,Ar)+`>; rel=preconnect`,typeof t==`string`){var c=(``+t).replace(jr,Nr);s+=`; crossorigin="`+c+`"`}s=(o=s,0<=(r.remainingCapacity-=o.length+2))}s?(i.resets.connect[a][e]=null,r.preconnects&&(r.preconnects+=`, `),r.preconnects+=o):(a=[],_t(a,{rel:`preconnect`,href:e,crossOrigin:t}),i.preconnects.add(a))}Za(n)}}else ve.C(e,t)}function Sr(e,t,n){var r=ea||null;if(r){var i=r.resumableState,a=r.renderState;if(t&&e){switch(t){case`image`:if(n)var o=n.imageSrcSet,s=n.imageSizes,c=n.fetchPriority;var l=o?o+`
352`+(s||``):e;if(i.imageResources.hasOwnProperty(l))return;i.imageResources[l]=ye,i=a.headers;var u;i&&0<i.remainingCapacity&&typeof o!=`string`&&c===`high`&&(u=Or(e,t,n),0<=(i.remainingCapacity-=u.length+2))?(a.resets.image[l]=ye,i.highImagePreloads&&(i.highImagePreloads+=`, `),i.highImagePreloads+=u):(i=[],_t(i,te({rel:`preload`,href:o?void 0:e,as:t},n)),c===`high`?a.highImagePreloads.add(i):(a.bulkPreloads.add(i),a.preloads.images.set(l,i
vendor: 6,629 bytes, lines 352-354
352)));break;case`style`:if(i.styleResources.hasOwnProperty(e))return;o=[],_t(o,te({rel:`preload`,href:e,as:t},n)),i.styleResources[e]=!n||typeof n.crossOrigin!=`string`&&typeof n.integrity!=`string`?ye:[n.crossOrigin,n.integrity],a.preloads.stylesheets.set(e,o),a.bulkPreloads.add(o);break;case`script`:if(i.scriptResources.hasOwnProperty(e))return;o=[],a.preloads.scripts.set(e,o),a.bulkPreloads.add(o),_t(o,te({rel:`preload`,href:e,as:t},n)),i.scriptResources[e]=!n||typeof n.crossOrigin!=`string`&&typeof n.integrity!=`string`?ye:[n.crossOrigin,n.integrity];break;default:if(i.unknownResources.hasOwnProperty(t)){if(o=i.unknownResources[t],o.hasOwnProperty(e))return}else o={},i.unknownResources[t]=o;if(o[e]=ye,(i=a.headers)&&0<i.remainingCapacity&&t===`font`&&(l=Or(e,t,n),0<=(i.remainingCapacity-=l.length+2)))a.resets.font[e]=ye,i.fontPreloads&&(i.fontPreloads+=`, `),i.fontPreloads+=l;else switch(i=[],e=te({rel:`preload`,href:e,as:t},n),_t(i,e),t){case`font`:a.fontPreloads.add(i);break;default:a.bulkPreloads.add(i)}}Za(r)}}else ve.L(e,t,n)}function Cr(e,t){var n=ea||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=t&&typeof t.as==`string`?t.as:`script`;switch(a){case`script`:if(r.moduleScriptResources.hasOwnProperty(e))return;a=[],r.moduleScriptResources[e]=!t||typeof t.crossOrigin!=`string`&&typeof t.integrity!=`string`?ye:[t.crossOrigin,t.integrity],i.preloads.moduleScripts.set(e,a);break;default:if(r.moduleUnknownResources.hasOwnProperty(a)){var o=r.unknownResources[a];if(o.hasOwnProperty(e))return}else o={},r.moduleUnknownResources[a]=o;a=[],o[e]=ye}_t(a,te({rel:`modulepreload`,href:e},t)),i.bulkPreloads.add(a),Za(n)}}else ve.m(e,t)}function wr(e,t,n){var r=ea||null;if(r){var i=r.resumableState,a=r.renderState;if(e){t||=`default`;var o=a.styles.get(t),s=i.styleResources.hasOwnProperty(e)?i.styleResources[e]:void 0;s!==null&&(i.styleResources[e]=null,o||(o={precedence:L(ue(t)),rules:[],hrefs:[],sheets:new Map},a.styles.set(t,o)),t={state:0,props:te({rel:`stylesheet`,href:e,"data-precedence":t},n)},s&&(s.length===2&&Dr(t.props,s),(a=a.preloads.stylesheets.get(e))&&0<a.length?a.length=0:t.state=1),o.sheets.set(e,t),Za(r))}}else ve.S(e,t,n)}function Tr(e,t){var n=ea||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=r.scriptResources.hasOwnProperty(e)?r.scriptResources[e]:void 0;a!==null&&(r.scriptResources[e]=null,t=te({src:e,async:!0},t),a&&(a.length===2&&Dr(t,a),e=i.preloads.scripts.get(e))&&(e.length=0),e=[],i.scripts.add(e),Tt(e,t),Za(n))}}else ve.X(e,t)}function Er(e,t){var n=ea||null;if(n){var r=n.resumableState,i=n.renderState;if(e){var a=r.moduleScriptResources.hasOwnProperty(e)?r.moduleScriptResources[e]:void 0;a!==null&&(r.moduleScriptResources[e]=null,t=te({src:e,type:`module`,async:!0},t),a&&(a.length===2&&Dr(t,a),e=i.preloads.moduleScripts.get(e))&&(e.length=0),e=[],i.scripts.add(e),Tt(e,t),Za(n))}}else ve.M(e,t)}function Dr(e,t){e.crossOrigin??=t[0],e.integrity??=t[1]}function Or(e,t,n){for(var r in e=(``+e).replace(kr,Ar),t=(``+t).replace(jr,Nr),t=`<`+e+`>; rel=preload; as="`+t+`"`,n)ne.call(n,r)&&(e=n[r],typeof e==`string`&&(t+=`; `+r.toLowerCase()+`="`+(``+e).replace(jr,Nr)+`"`));return t}var kr=/[<>\r\n]/g;function Ar(e){switch(e){case`<`:return`%3C`;case`>`:return`%3E`;case`
353`:return`%0A`;case`\r`:return`%0D`;default:throw Error(`escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}}var jr=/["';,\r\n]/g;function Nr(e){switch(e){case`"`:return`%22`;case`'`:return`%27`;case`;`:return`%3B`;case`,`:return`%2C`;case`
354`:return`%0A`;case`\r`:return`%0D`;default:throw Error(`escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}}function Pr(e){this.styles.add(e)}function Fr(e){this.stylesheets.add(e)}function Ir(e,t){t.styles.forEach(Pr,e),t.stylesheets.forEach(Fr,e),t.suspenseyImages&&(e.suspenseyImages=!0)}function H(e){return 0<e.stylesheets.size||e.suspenseyImages}var Lr=Function.prototype.bind,Rr=Symbol.for(`react.client.reference`);function zr(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===Rr?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case o:return`Fragment`;case c:return`Profiler`;case s:return`StrictMode`;case f:return`Suspense`;case p:return`SuspenseList`;case _:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case a:return`Portal`;case u:return e.displayName||`Context`;case l:return(e._context.displayName||`Context`)+`.Consumer`;case d:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case m:return t=e.displayName||null,t===null?zr(e.type)||`Memo`:t;case h:t=e._payload,e=e._init;try{return zr(e(t))}catch{}}return null}var Br={},Vr=null;function Hr(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var n=t.parent;if(e===null){if(n!==null)throw Error(r(401))}else{if(n===null)throw Error(r(401));Hr(e,n)}t.context._currentValue=t.value}}function Ur(e){e.context._currentValue=e.parentValue,e=e.parent,e!==null&&Ur(e)}function Wr(e){var t=e.parent;t!==null&&Wr(t),e.context._currentValue=e.value}function Gr(e,t){if(e.context._currentValue=e.parentValue,e=e.parent,e===null)throw Error(r(402));e.depth===t.depth?Hr(e,t):Gr(e,t)}function Kr(e,t){var n=t.parent;if(n===null)throw Error(r(402));e.depth===n.depth?Hr(e,n):Kr(e,n),t.context._currentValue=t.value}function qr(e){var t=Vr;t!==e&&(t===null?Wr(e):e===null?Ur(t):t.depth===e.depth?Hr(t,e):t.depth>e.depth?Gr(t,e):Kr(t,e),Vr=e)}var Jr={enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}},Yr={id:1,overflow:``};function Xr(e,t,n){var r=e.id;e=e.overflow;var i=32-Zr(r)-1;r&=~(1<<i),n+=1;var a=32-Zr(t)+i;if(30<a){var o=i-i%5;return a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,{id:1<<32-Zr(t)+i|n<<i|r,overflow:a+e}}return{id:1<<a|n<<i|r,overflow:e}}var Zr=Math.clz32?Math.clz32:ei,Qr=Math.log,$r=Math.LN2;function ei(e){return e>>>=0,e===0?32:31-(Qr(e)/$r|0)|0}function ti(){}var ni=Error(r(460));function ri(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ti,ti),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw t.reason;default:switch(typeof t.status==`string`?t.then(ti,ti):(e=t,e.status=`pending`,e.then(function(e){if(t.status===`pen
354ding`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})),t.status){case`fulfilled`:return t.value;case`rejected`:throw t.reason}throw ii=t,ni}}var ii=null;function ai(){if(ii===null)throw Error(r(459));var e=ii;return ii=null,e}function oi(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var si=typeof Object.is==`function`?Object.is:oi,ci=null,li=null,ui=null,di=null,fi=null,pi=null,mi=!1,hi=!1,gi=0,_i=0,vi=-1,yi=0,bi=null,xi=null,Si=0;function Ci(){if(ci===null)throw Error(r(321));return ci}function wi(){if(0<Si)throw Error(r(312));return{memoizedState:null,queue:null,next:null}}function Ti(){return pi===null?fi===null?(mi=!1,fi=pi=wi()):(mi=!0,pi=fi):pi.next===null?(mi=!1,pi=pi.next=wi()):(mi=!0,pi=pi.next),pi}function Ei(){var e=bi;return bi=null,e}function Di(){di=ui=li=ci=null,hi=!1,fi=null,Si=0,pi=xi=null}function Oi(e,t){return typeof t==`function`?t(e):t}function ki(e,t,n){if(ci=Ci(),pi=Ti(),mi){var r=pi.queue;if(t=r.dispatch,xi!==null&&(n=xi.get(r),n!==void 0)){xi.delete(r),r=pi.memoizedState;do r=e(r,n.action),n=n.next;while(n!==null);return pi.memoizedState=r,[r,t]}return[pi.memoizedState,t]}return e=e===Oi?typeof t==`function`?t():t:n===void 0?t:n(t),pi.memoizedState=e,e=pi.queue={last:null,dispatch:null},e=e.dispatch=ji.bind(null,ci,e),[pi.memoizedState,e]}function Ai(e,t){if(ci=Ci(),pi=Ti(),t=t===void 0?null:t,pi!==null){var n=pi.memoizedState;if(n!==null&&t!==null){var r=n[1];a:if(r===null)r=!1;else{for(var i=0;i<r.length&&i<t.length;i++)if(!si(t[i],r[i])){r=!1;break a}r=!0}if(r)return n[0]}}return e=e(),pi.memoizedState=[e,t],e}function ji(e,t,n){if(25<=Si)throw Error(r(301));if(e===ci)if(hi=!0,e={action:n,next:null},xi===null&&(xi=new Map),n=xi.get(t),n===void 0)xi.set(t,e);else{for(t=n;t.next!==null;)t=t.next;t.next=e}}function Mi(){throw Error(r(440))}function Ni(){throw Error(r(394))}function Pi(){throw Error(r(479))}function Fi(e,t,n){Ci();var r=_i++,i=ui;if(typeof e.$$FORM_ACTION==`function`){var a=null,o=di;i=i.formState;var s=e.$$IS_SIGNATURE_EQUAL;if(i!==null&&typeof s==`function`){var c=i[1];s.call(e,i[2],i[3])&&(a=n===void 0?`k`+w(JSON.stringify([o,null,r]),0):`p`+n,c===a&&(vi=r,t=i[0]))}var l=e.bind(null,t);return e=function(e){l(e)},typeof l.$$FORM_ACTION==`function`&&(e.$$FORM_ACTION=function(e){e=l.$$FORM_ACTION(e),n!==void 0&&(n+=``,e.action=n);var t=e.data;return t&&(a===null&&(a=n===void 0?`k`+w(JSON.stringify([o,null,r]),0):`p`+n),t.append(`$ACTION_KEY`,a)),e}),[t,e,!1]}var u=e.bind(null,t);return[t,function(e){u(e)},!1]}function Ii(e){var t=yi;return yi+=1,bi===null&&(bi=[]),ri(bi,e,t)}function Li(){throw Error(r(393))}var Ri={readContext:function(e){return e._currentValue},use:function(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ii(e);if(e.$$typeof===u)return e._currentValue}throw Error(r(438,String(e)))},useContext:function(e){return Ci(),e._currentValue},useMemo:Ai,useReducer:ki,useRef:function(e){ci=Ci(),pi=Ti();var t=pi.memoizedState;return t===null?(e={current:e},pi.memoizedState=e):t},useState:function(e){return ki(Oi,e)},useInsertionEffect:ti,useLayoutEffect:ti,useCallback:function(e,t){return Ai(function(){return e},t)},useImperativeHandle:ti,useEffect:ti,useDebugValue:ti,useDeferredValue:function(e,t){return Ci(),t===void 0?e:t},useTransition:function(){return Ci(),[!1,Ni]},useId:function(){var e=li.treeContext,t=e.overflow;e=e.id,e=(e&~(1<<32-Zr(e)-1)).toString(32)+t;var n=zi;if(n===null)throw Error(r(404));return t=gi++,e=`_`+n.idPrefix+`R_`+e,0<t&&(e+=`H`+t.toString(32)),e+`_`},useSyncExternalStore:function(e,t,n){if(n===void 0)throw Error(r(407));return n()},useOptimistic:function(e){return Ci(),[e,Pi]},useActionState:Fi,useFormState:Fi,useHostTransitionStatus:function(){return Ci(),_e},useMemoCache:function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=y;return t},useCacheRefresh:function(){return Li},useEffectEvent:function(){return Mi}},zi=null,Bi={getCacheForType:function(){throw Error(r(248))},cacheSignal:function(){throw Error(r(248))}},Vi,Hi;function Ui(e){if(Vi===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Vi=t&&t[1]||``,Hi=-1<e.stack.indexOf(`
355    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
356`+Vi+e+Hi}var Wi=!1;function Gi(e,t){if(!e||Wi)return``;Wi=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}
vendor: 41,957 bytes, lines 356-366
356else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
357`),l=s.split(`
358`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
359`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Wi=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ui(n):``}function Ki(e){if(typeof e==`string`)return Ui(e);if(typeof e==`function`)return e.prototype&&e.prototype.isReactComponent?Gi(e,!0):Gi(e,!1);if(typeof e==`object`&&e){switch(e.$$typeof){case d:return Gi(e.render,!1);case m:return Gi(e.type,!1);case h:var t=e,n=t._payload;t=t._init;try{e=t(n)}catch{return Ui(`Lazy`)}return Ki(e)}if(typeof e.name==`string`){a:{n=e.name,t=e.env;var r=e.debugLocation;if(r!=null&&(e=Error.prepareStackTrace,Error.prepareStackTrace=void 0,r=r.stack,Error.prepareStackTrace=e,r.startsWith(`Error: react-stack-top-frame
360`)&&(r=r.slice(29)),e=r.indexOf(`
361`),e!==-1&&(r=r.slice(e+1)),e=r.indexOf(`react_stack_bottom_frame`),e!==-1&&(e=r.lastIndexOf(`
362`,e)),e=e===-1?``:r=r.slice(0,e),r=e.lastIndexOf(`
363`),e=r===-1?e:e.slice(r+1),e.indexOf(n)!==-1)){n=`
364`+e;break a}n=Ui(n+(t?` [`+t+`]`:``))}return n}}switch(e){case p:return Ui(`SuspenseList`);case f:return Ui(`Suspense`)}return``}function qi(e,t){return(500<t.byteSize||H(t.contentState))&&t.contentPreamble===null}function Ji(e){if(typeof e==`object`&&e&&typeof e.environmentName==`string`){var t=e.environmentName;e=[e].slice(0),typeof e[0]==`string`?e.splice(0,1,`%c%s%c `+e[0],`background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px`,` `+t+` `,``):e.splice(0,0,`%c%s%c`,`background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px`,` `+t+` `,``),e.unshift(console),t=Lr.apply(console.error,e),t()}else console.error(e);return null}function Yi(e,t,n,r,i,a,o,s,c,l,u){var d=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=e,this.renderState=t,this.rootFormatContext=n,this.progressiveChunkSize=r===void 0?12800:r,this.status=10,this.fatalError=null,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedPreambleSegments=this.completedRootSegment=null,this.byteSize=0,this.abortableTasks=d,this.pingedTasks=[],this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.trackedPostpones=null,this.onError=i===void 0?Ji:i,this.onPostpone=l===void 0?ti:l,this.onAllReady=a===void 0?ti:a,this.onShellReady=o===void 0?ti:o,this.onShellError=s===void 0?ti:s,this.onFatalError=c===void 0?ti:c,this.formState=u===void 0?null:u}function Xi(e,t,n,r,i,a,o,s,c,l,u,d){return t=new Yi(t,n,r,i,a,o,s,c,l,u,d),n=aa(t,0,null,r,!1,!1),n.parentFlushed=!0,e=ra(t,null,e,-1,null,n,null,null,t.abortableTasks,null,r,null,Yr,null,null),oa(e),t.pingedTasks.push(e),t}function Zi(e,t,n,r,i,a,o,s,c,l,u){return e=Xi(e,t,n,r,i,a,o,s,c,l,u,void 0),e.trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},e}function Qi(e,t,n,r,i,a,o,s,c){return n=new Yi(t.resumableState,n,t.rootFormatContext,t.progressiveChunkSize,r,i,a,o,s,c,null),n.nextSegmentId=t.nextSegmentId,typeof t.replaySlots==`number`?(r=aa(n,0,null,t.rootFormatContext,!1,!1),r.parentFlushed=!0,e=ra(n,null,e,-1,null,r,null,null,n.abortableTasks,null,t.rootFormatContext,null,Yr,null,null),oa(e),n.pingedTasks.push(e),n):(e=ia(n,null,{nodes:t.replayNodes,slots:t.replaySlots,pendingTasks:0},e,-1,null,null,n.abortableTasks,null,t.rootFormatContext,null,Yr,null,null),oa(e),n.pingedTasks.push(e),n)}function $i(e,t,n,r,i,a,o,s,c){return e=Qi(e,t,n,r,i,a,o,s,c),e.trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},e}var ea=null;function ta(e,t){e.pingedTasks.push(t),e.pingedTasks.length===1&&(e.flushScheduled=e.destination!==null,e.trackedPostpones!==null||e.status===10?A(function(){return Ra(e)}):D(function(){return Ra(e)}))}function na(e,t,n,r,i){return n={status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,row:t,completedSegments:[],byteSize:0,fallbackAbortableTasks:n,errorDigest:null,contentState:yr(),fallbackState:yr(),contentPreamble:r,fallbackPreamble:i,trackedContentKeyPath:null,trackedFallbackNode:null},t!==null&&(t.pendingTasks++,r=t.boundaries,r!==null&&(e.allPendingTasks++,n.pendingTasks++,r.push(n)),e=t.inheritedHoistables,e!==null&&Ir(n.contentState,e)),n}function ra(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){e.allPendingTasks++,i===null?e.pendingRootTasks++:i.pendingTasks++,p!==null&&p.pendingTasks++;var h={replay:null,node:n,childIndex:r,ping:function(){return ta(e,h)},blockedBoundary:i,blockedSegment:a,blockedPreamble:o,hoistableState:s,abortSet:c,keyPath:l,formatContext:u,context:d,treeContext:f,row:p,componentStack:m,thenableState:t};return c.add(h),h}function ia(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.allPendingTasks++,a===null?e.pendingRootTasks++:a.pendingTasks++,f!==null&&f.pendingTasks++,n.pendingTasks++;var m={replay:n,node:r,childIndex:i,ping:function(){return ta(e,m)},blockedBoundary:a,blockedSegment:null,blockedPreamble:null,hoistableState:o,abortSet:s,keyPath:c,formatContext:l,context:u,treeContext:d,row:f,componentStack:p,thenableState:t};return s.add(m),m}function aa(e,t,n,r,i,a){return{status:0,parentFlushed:!1,id:-1,index:t,chunks:[],children:[],preambleChildren:[],parentFormatContext:r,boundary:n,lastPushedText:i,textEmbedded:a}}function oa(e){var t=e.node;if(typeof t==`object`&&t)switch(t.$$typeof){case i:e.componentStack={parent:e.componentStack,type:t.type}}}function sa(e){return e===null?null:{parent:e.parent,type:`Suspense Fallback`}}function ca(e){var t={};return e&&Object.defineProperty(t,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var n=``,r=e;do n+=Ki(r.type),r=r.parent;while(r);var i=n}catch(e){i=`
365Error generating stack: `+e.message+`
366`+e.stack}return Object.defineProperty(t,"componentStack",{value:i}),i}}),t}function la(e,t,n){if(e=e.onError,t=e(t,n),t==null||typeof t==`string`)return t}function ua(e,t){var n=e.onShellError,r=e.onFatalError;n(t),r(t),e.destination===null?(e.status=13,e.fatalError=t):(e.status=14,z(e.destination,t))}function da(e,t){fa(e,t.next,t.hoistables)}function fa(e,t,n){for(;t!==null;){n!==null&&(Ir(t.hoistables,n),t.inheritedHoistables=n);var r=t.boundaries;if(r!==null){t.boundaries=null;for(var i=0;i<r.length;i++){var a=r[i];n!==null&&Ir(a.contentState,n),La(e,a,null,null)}}if(t.pendingTasks--,0<t.pendingTasks)break;n=t.hoistables,t=t.next}}function pa(e,t){var n=t.boundaries;if(n!==null&&t.pendingTasks===n.length){for(var r=!0,i=0;i<n.length;i++){var a=n[i];if(a.pendingTasks!==1||a.parentFlushed||qi(e,a)){r=!1;break}}r&&fa(e,t,t.hoistables)}}function ma(e){var t={pendingTasks:1,boundaries:null,hoistables:yr(),inheritedHoistables:null,together:!1,next:null};return e!==null&&0<e.pendingTasks&&(t.pendingTasks++,t.boundaries=[],e.next=t),t}function ha(e,t,n,r,i){var a=t.keyPath,o=t.treeContext,s=t.row;t.keyPath=n,n=r.length;var c=null;if(t.replay!==null){var l=t.replay.slots;if(typeof l==`object`&&l)for(var u=0;u<n;u++){var d=i!==`backwards`&&i!==`unstable_legacy-backwards`?u:n-1-u,f=r[d];t.row=c=ma(c),t.treeContext=Xr(o,n,d);var p=l[d];typeof p==`number`?(ya(e,t,p,f,d),delete l[d]):Oa(e,t,f,d),--c.pendingTasks===0&&da(e,c)}else for(l=0;l<n;l++)u=i!==`backwards`&&i!==`unstable_legacy-backwards`?l:n-1-l,d=r[u],t.row=c=ma(c),t.treeContext=Xr(o,n,u),Oa(e,t,d,u),--c.pendingTasks===0&&da(e,c)}else if(i!==`backwards`&&i!==`unstable_legacy-backwards`)for(i=0;i<n;i++)l=r[i],t.row=c=ma(c),t.treeContext=Xr(o,n,i),Oa(e,t,l,i),--c.pendingTasks===0&&da(e,c);else{for(i=t.blockedSegment,l=i.children.length,u=i.chunks.length,d=n-1;0<=d;d--){f=r[d],t.row=c=ma(c),t.treeContext=Xr(o,n,d),p=aa(e,u,null,t.formatContext,d===0?i.lastPushedText:!0,!0),i.children.splice(l,0,p),t.blockedSegment=p;try{Oa(e,t,f,d),p.lastPushedText&&p.textEmbedded&&p.chunks.push(He),p.status=1,Ia(e,t.blockedBoundary,p),--c.pendingTasks===0&&da(e,c)}catch(t){throw p.status=e.status===12?3:4,t}}t.blockedSegment=i,i.lastPushedText=!1}s!==null&&c!==null&&0<c.pendingTasks&&(s.pendingTasks++,c.next=s),t.treeContext=o,t.row=s,t.keyPath=a}function ga(e,t,n,r,i,a){var o=t.thenableState;for(t.thenableState=null,ci={},li=t,ui=e,di=n,_i=gi=0,vi=-1,yi=0,bi=o,e=r(i,a);hi;)hi=!1,_i=gi=0,vi=-1,yi=0,Si+=1,pi=null,e=r(i,a);return Di(),e}function _a(e,t,n,r,i,a,o){var s=!1;if(a!==0&&e.formState!==null){var c=t.blockedSegment;if(c!==null){s=!0,c=c.chunks;for(var l=0;l<a;l++)l===o?c.push(ht):c.push(gt)}}a=t.keyPath,t.keyPath=n,i?(n=t.treeContext,t.treeContext=Xr(n,1,0),Oa(e,t,r,-1),t.treeContext=n):s?Oa(e,t,r,-1):ba(e,t,r,-1),t.keyPath=a}function va(e,t,n,i,a,y){if(typeof i==`function`)if(i.prototype&&i.prototype.isReactComponent){var x=a;if(`ref`in a)for(var w in x={},a)w!==`ref`&&(x[w]=a[w]);var T=i.defaultProps;if(T)for(var E in x===a&&(x=te({},x,a)),T)x[E]===void 0&&(x[E]=T[E]);a=x,x=Br,T=i.contextType,typeof T==`object`&&T&&(x=T._currentValue),x=new i(a,x);var D=x.state===void 0?null:x.state;if(x.updater=Jr,x.props=a,x.state=D,T={queue:[],replace:!1},x._reactInternals=T,y=i.contextType,x.context=typeof y==`object`&&y?y._currentValue:Br,y=i.getDerivedStateFromProps,typeof y==`function`&&(y=y(a,D),D=y==null?D:te({},D,y),x.state=D),typeof i.getDerivedStateFromProps!=`function`&&typeof x.getSnapshotBeforeUpdate!=`function`&&(typeof x.UNSAFE_componentWillMount==`function`||typeof x.componentWillMount==`function`))if(i=x.state,typeof x.componentWillMount==`function`&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount==`function`&&x.UNSAFE_componentWillMount(),i!==x.state&&Jr.enqueueReplaceState(x,x.state,null),T.queue!==null&&0<T.queue.length)if(i=T.queue,y=T.replace,T.queue=null,T.replace=!1,y&&i.length===1)x.state=i[0];else{for(T=y?i[0]:x.state,D=!0,y=+!!y;y<i.length;y++)E=i[y],E=typeof E==`function`?E.call(x,T,a,void 0):E,E!=null&&(D?(D=!1,T=te({},T,E)):te(T,E));x.state=T}else T.queue=null;if(i=x.render(),e.status===12)throw null;a=t.keyPath,t.keyPath=n,ba(e,t,i,-1),t.keyPath=a}else{if(i=ga(e,t,n,i,a,void 0),e.status===12)throw null;_a(e,t,n,i,gi!==0,_i,vi)}else if(typeof i==`string`)if(x=t.blockedSegment,x===null)x=a.children,T=t.formatContext,D=t.keyPath,t.formatContext=ze(T,i,a),t.keyPath=n,Oa(e,t,x,-1),t.formatContext=T,t.keyPath=D;else{if(D=Nt(x.chunks,i,a,e.resumableState,e.renderState,t.blockedPreamble,t.hoistableState,t.formatContext,x.lastPushedText),x.lastPushedText=!1,T=t.formatContext,y=t.keyPath,t.keyPath=n,(t.formatContext=ze(T,i,a)).insertionMode===3){n=aa(e,0,null,t.formatContext,!1,!1),x.preambleChildren.push(n),t.blockedSegment=n;try{n.status=6,Oa(e,t,D,-1),n.lastPushedText&&n.textEmbedded&&n.chunks.push(He),n.status=1,Ia(e,t.blockedBoundary,n)}finally{t.blockedSegment=x}}else Oa(e,t,D,-1);t.formatContext=T,t.keyPath=y;a:{switch(t=x.chunks,e=e.resumableState,i){case`title`:case`style`:case`script`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`input`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:break a;case`body`:if(1>=T.insertionMode){e.hasBody=!0;break a}break;case`html`:if(T.insertionMode===0){e.hasHtml=!0;break a}break;case`head`:if(1>=T.insertionMode)break a}t.push(Ft(i))}x.lastPushedText=!1}else{switch(i){case v:case s:case c:case o:i=t.keyPath,t.keyPath=n,ba(e,t,a.children,-1),t.keyPath=i;return;case _:i=t.blockedSegment,i===null?a.mode!==`hidden`&&(i=t.keyPath,t.keyPath=n,Oa(e,t,a.children,-1),t.keyPath=i):a.mode!==`hidden`&&(i.chunks.push(Vt),i.lastPushedText=!1,x=t.keyPath,t.keyPath=n,Oa(e,t,a.children,-1),t.keyPath=x,i.chunks.push(Ht),i.lastPushedText=!1);return;case p:a:{if(i=a.children,a=a.revealOrder,a===`forwards`||a===`backwards`||a===`unstable_legacy-backwards`){if(C(i)){ha(e,t,n,i,a);break a}if((x=S(i))&&(x=x.call(i))){if(T=x.next(),!T.done){do T=x.next();while(!T.done);ha(e,t,n,i,a)}break a}}a===`together`?(a=t.keyPath,x=t.row,T=t.row=ma(null),T.boundaries=[],T.together=!0,t.keyPath=n,ba(e,t,i,-1),--T.pendingTasks===0&&da(e,T),t.keyPath=a,t.row=x,x!==null&&0<T.pendingTasks&&(x.pendingTasks++,T.next=x)):(a=t.keyPath,t.keyPath=n,ba(e,t,i,-1),t.keyPath=a)}return;case b:case g:throw Error(r(343));case f:a:if(t.replay!==null){i=t.keyPath,x=t.formatContext,T=t.row,t.keyPath=n,t.formatContext=V(e.resumableState,x),t.row=null,n=a.children;try{Oa(e,t,n,-1)}finally{t.keyPath=i,t.formatContext=x,t.row=T}}else{i=t.keyPath,y=t.formatContext;var O=t.row;E=t.blockedBoundary,w=t.blockedPreamble;var k=t.hoistableState,A=t.blockedSegment,j=a.fallback;a=a.children;var M=new Set,N=2>t.formatContext.insertionMode?na(e,t.row,M,Ie(),Ie()):na(e,t.row,M,null,null);e.trackedPostpones!==null&&(N.trackedContentKeyPath=n);var P=aa(e,A.chunks.length,N,t.formatContext,!1,!1);A.children.push(P),A.lastPushedText=!1;var F=aa(e,0,null,t.formatContext,!1,!1);if(F.parentFlushed=!0,e.trackedPostpones!==null){x=t.componentStack,T=[n[0],`Suspense Fallback`,n[2]],D=[T[1],T[2],[],null],e.trackedPostpones.workingMap.set(T,D),N.trackedFallbackNode=D,t.blockedSegment=P,t.blockedPreamble=N.fallbackPreamble,t.keyPath=T,t.formatContext=B(e.resumableState,y),t.componentStack=sa(x),P.status=6;try{Oa(e,t,j,-1),P.lastPushedText&&P.textEmbedded&&P.chunks.push(He),P.status=1,Ia(e,E,P)}catch(t){throw P.status=e.status===12?3:4,t}finally{t.blockedSegment=A,t.blockedPreamble=w,t.keyPath=i,t.formatContext=y}t=ra(e,null,a,-1,N,F,N.contentPreamble,N.contentState,t.abortSet,n,V(e.resumableState,t.formatContext),t.context,t.treeContext,null,x),oa(t),e.pingedTasks.push(t)}else{t.blockedBoundary=N,t.blockedPreamble=N.contentPreamble,t.hoistableState=N.contentState,t.blockedSegment=F,t.keyPath=n,t.formatContext=V(e.resumableState,y),t.row=null,F.status=6;try{if(Oa(e,t,a,-1),F.lastPushedText&&F.textEmbedded&&F.chunks.push(He),F.status=1,Ia(e,N,F),Fa(N,F),N.pendingTasks===0&&N.status===0){if(N.status=1,!qi(e,N)){O!==null&&--O.pendingTasks===0&&da(e,O),e.pendingRootTasks===0&&t.blockedPreamble&&Va(e);break a}}else O!==null&&O.together&&pa(e,O)}catch(n){N.status=4,e.status===12?(F.status=3,x=e.fatalError):(F.status=4,x=n),T=ca(t.componentStack),D=la(e,x,T),N.errorDigest=D,Ta(e,N)}finally{t.blockedBoundary=E,t.blockedPreamble=w,t.hoistableState=k,t.blockedSegment=A,t.keyPath=i,t.formatContext=y,t.row=O}t=ra(e,null,j,-1,E,P,N.fallbackPreamble,N.fallbackState,M,[n[0],`Suspense Fallback`,n[2]],B(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,sa(t.componentStack)),oa(t),e.pingedTasks.push(t)}}return}if(typeof i==`object`&&i)switch(i.$$typeof){case d:if(`ref`in a)for(A in x={},a)A!==`ref`&&(x[A]=a[A]);else x=a;i=ga(e,t,n,i.render,x,y),_a(e,t,n,i,gi!==0,_i,vi);return;case m:va(e,t,n,i.type,a,y);return;case u:if(T=a.children,x=t.keyPath,a=a.value,D=i._currentValue,i._currentValue=a,y=Vr,Vr=i={parent:y,depth:y===null?0:y.depth+1,context:i,parentValue:D,value:a},t.context=i,t.keyPath=n,ba(e,t,T,-1),e=Vr,e===null)throw Error(r(403));e.context._currentValue=e.parentValue,e=Vr=e.parent,t.context=e,t.keyPath=x;return;case l:a=a.children,i=a(i._context._currentValue),a=t.keyPath,t.keyPath=n,ba(e,t,i,-1),t.keyPath=a;return;case h:if(x=i._init,i=x(i._payload),e.status===12)throw null;va(e,t,n,i,a,y);return}throw Error(r(130,i==null?i:typeof i,``))}}function ya(e,t,n,r,i){var a=t.replay,o=t.blockedBoundary,s=aa(e,0,null,t.formatContext,!1,!1);s.id=n,s.parentFlushed=!0;try{t.replay=null,t.blockedSegment=s,Oa(e,t,r,i),s.status=1,Ia(e,o,s),o===null?e.completedRootSegment=s:(Fa(o,s),o.parentFlushed&&e.partialBoundaries.push(o))}finally{t.replay=a,t.blockedSegment=null}}function ba(e,t,n,r){t.replay!==null&&typeof t.replay.slots==`number`?ya(e,t,t.replay.slots,n,r):(t.node=n,t.childIndex=r,n=t.componentStack,oa(t),xa(e,t),t.componentStack=n)}function xa(e,t){var n=t.node,o=t.childIndex;if(n!==null){if(typeof n==`object`){switch(n.$$typeof){case i:var s=n.type,c=n.key,l=n.props;n=l.ref;var d=n===void 0?null:n,p=zr(s),m=c??(o===-1?0:o);if(c=[t.keyPath,p,m],t.replay!==null)a:{var g=t.replay;for(o=g.nodes,n=0;n<o.length;n++){var _=o[n];if(m===_[1]){if(_.length===4){if(p!==null&&p!==_[0])throw Error(r(490,_[0],p));var v=_[2];p=_[3],m=t.node,t.replay={nodes:v,slots:p,pendingTasks:1};try{if(va(e,t,c,s,l,d),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));t.replay.pendingTasks--}catch(r){if(typeof r==`object`&&r&&(r===ni||typeof r.then==`function`))throw t.node===m?t.replay=g:o.splice(n,1),r;t.replay.pendingTasks--,l=ca(t.componentStack),c=e,e=t.blockedBoundary,s=r,l=la(c,s,l),Aa(c,e,v,p,s,l)}t.replay=g}else{if(s!==f)throw Error(r(490,`Suspense`,zr(s)||`Unknown`));b:{g=void 0,s=_[5],d=_[2],p=_[3],m=_[4]===null?[]:_[4][2],_=_[4]===null?null:_[4][3];var y=t.keyPath,b=t.formatContext,x=t.row,w=t.replay,T=t.blockedBoundary,E=t.hoistableState,D=l.children,O=l.fallback,k=new Set;l=2>t.formatContext.insertionMode?na(e,t.row,k,Ie(),Ie()):na(e,t.row,k,null,null),l.parentFlushed=!0,l.rootSegmentID=s,t.blockedBoundary=l,t.hoistableState=l.contentState,t.keyPath=c,t.formatContext=V(e.resumableState,b),t.row=null,t.replay={nodes:d,slots:p,pendingTasks:1};try{if(Oa(e,t,D,-1),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));if(t.replay.pendingTasks--,l.pendingTasks===0&&l.status===0){l.status=1,e.completedBoundaries.push(l);break b}}catch(n){l.status=4,v=ca(t.componentStack),g=la(e,n,v),l.errorDigest=g,t.replay.pendingTasks--,e.clientRenderedBoundaries.push(l)}finally{t.blockedBoundary=T,t.hoistableState=E,t.replay=w,t.keyPath=y,t.formatContext=b,t.row=x}v=ia(e,null,{nodes:m,slots:_,pendingTasks:0},O,-1,T,l.fallbackState,k,[c[0],`Suspense Fallback`,c[2]],B(e.resumableState,t.formatContext),t.context,t.treeContext,t.row,sa(t.componentStack)),oa(v),e.pingedTasks.push(v)}}o.splice(n,1);break a}}}else va(e,t,c,s,l,d);return;case a:throw Error(r(257));case h:if(v=n._init,n=v(n._payload),e.status===12)throw null;ba(e,t,n,o);return}if(C(n)){Sa(e,t,n,o);return}if((v=S(n))&&(v=v.call(n))){if(n=v.next(),!n.done){l=[];do l.push(n.value),n=v.next();while(!n.done);Sa(e,t,l,o)}return}if(typeof n.then==`function`)return t.thenableState=null,ba(e,t,Ii(n),o);if(n.$$typeof===u)return ba(e,t,n._currentValue,o);throw o=Object.prototype.toString.call(n),Error(r(31,o===`[object Object]`?`object with keys {`+Object.keys(n).join(`, `)+`}`:o))}typeof n==`string`?(o=t.blockedSegment,o!==null&&(o.lastPushedText=Ue(o.chunks,n,e.renderState,o.lastPushedText))):(typeof n==`number`||typeof n==`bigint`)&&(o=t.blockedSegment,o!==null&&(o.lastPushedText=Ue(o.chunks,``+n,e.renderState,o.lastPushedText)))}}function Sa(e,t,n,i){var a=t.keyPath;if(i!==-1&&(t.keyPath=[t.keyPath,`Fragment`,i],t.replay!==null)){for(var o=t.replay,s=o.nodes,c=0;c<s.length;c++){var l=s[c];if(l[1]===i){i=l[2],l=l[3],t.replay={nodes:i,slots:l,pendingTasks:1};try{if(Sa(e,t,n,-1),t.replay.pendingTasks===1&&0<t.replay.nodes.length)throw Error(r(488));t.replay.pendingTasks--}catch(r){if(typeof r==`object`&&r&&(r===ni||typeof r.then==`function`))throw r;t.replay.pendingTasks--,n=ca(t.componentStack);var u=t.blockedBoundary,d=r;n=la(e,d,n),Aa(e,u,i,l,d,n)}t.replay=o,s.splice(c,1);break}}t.keyPath=a;return}if(o=t.treeContext,s=n.length,t.replay!==null&&(c=t.replay.slots,typeof c==`object`&&c)){for(i=0;i<s;i++)l=n[i],t.treeContext=Xr(o,s,i),u=c[i],typeof u==`number`?(ya(e,t,u,l,i),delete c[i]):Oa(e,t,l,i);t.treeContext=o,t.keyPath=a;return}for(c=0;c<s;c++)i=n[c],t.treeContext=Xr(o,s,c),Oa(e,t,i,c);t.treeContext=o,t.keyPath=a}function Ca(e,t,n){if(n.status=5,n.rootSegmentID=e.nextSegmentId++,e=n.trackedContentKeyPath,e===null)throw Error(r(486));var i=n.trackedFallbackNode,a=[],o=t.workingMap.get(e);return o===void 0?(n=[e[1],e[2],a,null,i,n.rootSegmentID],t.workingMap.set(e,n),eo(n,e[0],t),n):(o[4]=i,o[5]=n.rootSegmentID,o)}function wa(e,t,n,i){i.status=5;var a=n.keyPath,o=n.blockedBoundary;if(o===null)i.id=e.nextSegmentId++,t.rootSlots=i.id,e.completedRootSegment!==null&&(e.completedRootSegment.status=5);else{if(o!==null&&o.status===0){var s=Ca(e,t,o);if(o.trackedContentKeyPath===a&&n.childIndex===-1){i.id===-1&&(i.id=i.parentFlushed?o.rootSegmentID:e.nextSegmentId++),s[3]=i.id;return}}if(i.id===-1&&(i.id=i.parentFlushed&&o!==null?o.rootSegmentID:e.nextSegmentId++),n.childIndex===-1)a===null?t.rootSlots=i.id:(n=t.workingMap.get(a),n===void 0?(n=[a[1],a[2],[],i.id],eo(n,a[0],t)):n[3]=i.id);else{if(a===null){if(e=t.rootSlots,e===null)e=t.rootSlots={};else if(typeof e==`number`)throw Error(r(491))}else if(o=t.workingMap,s=o.get(a),s===void 0)e={},s=[a[1],a[2],[],e],o.set(a,s),eo(s,a[0],t);else if(e=s[3],e===null)e=s[3]={};else if(typeof e==`number`)throw Error(r(491));e[n.childIndex]=i.id}}}function Ta(e,t){e=e.trackedPostpones,e!==null&&(t=t.trackedContentKeyPath,t!==null&&(t=e.workingMap.get(t),t!==void 0&&(t.length=4,t[2]=[],t[3]=null)))}function Ea(e,t,n){return ia(e,n,t.replay,t.node,t.childIndex,t.blockedBoundary,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function Da(e,t,n){var r=t.blockedSegment,i=aa(e,r.chunks.length,null,t.formatContext,r.lastPushedText,!0);return r.children.push(i),r.lastPushedText=!1,ra(e,n,t.node,t.childIndex,t.blockedBoundary,i,t.blockedPreamble,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.row,t.componentStack)}function Oa(e,t,n,r){var i=t.formatContext,a=t.context,o=t.keyPath,s=t.treeContext,c=t.componentStack,l=t.blockedSegment;if(l===null){l=t.replay;try{return ba(e,t,n,r)}catch(u){if(Di(),n=u===ni?ai():u,e.status!==12&&typeof n==`object`&&n){if(typeof n.then==`function`){r=u===ni?Ei():null,e=Ea(e,t,r).ping,n.then(e,e),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,t.replay=l,qr(a);return}if(n.message===`Maximum call stack size exceeded`){n=u===ni?Ei():null,n=Ea(e,t,n),e.pingedTasks.push(n),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,t.replay=l,qr(a);return}}}}else{var u=l.children.length,d=l.chunks.length;try{return ba(e,t,n,r)}catch(r){if(Di(),l.children.length=u,l.chunks.length=d,n=r===ni?ai():r,e.status!==12&&typeof n==`object`&&n){if(typeof n.then==`function`){l=n,n=r===ni?Ei():null,e=Da(e,t,n).ping,l.then(e,e),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,qr(a);return}if(n.message===`Maximum call stack size exceeded`){l=r===ni?Ei():null,l=Da(e,t,l),e.pingedTasks.push(l),t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,t.componentStack=c,qr(a);return}}}}throw t.formatContext=i,t.context=a,t.keyPath=o,t.treeContext=s,qr(a),n}function ka(e){var t=e.blockedBoundary,n=e.blockedSegment;n!==null&&(n.status=3,La(this,t,e.row,n))}function Aa(e,t,n,i,a,o){for(var s=0;s<n.length;s++){var c=n[s];if(c.length===4)Aa(e,t,c[2],c[3],a,o);else{c=c[5];var l=e,u=o,d=na(l,null,new Set,null,null);d.parentFlushed=!0,d.rootSegmentID=c,d.status=4,d.errorDigest=u,d.parentFlushed&&l.clientRenderedBoundaries.push(d)}}if(n.length=0,i!==null){if(t===null)throw Error(r(487));if(t.status!==4&&(t.status=4,t.errorDigest=o,t.parentFlushed&&e.clientRenderedBoundaries.push(t)),typeof i==`object`)for(var f in i)delete i[f]}}function ja(e,t,n){var r=e.blockedBoundary,i=e.blockedSegment;if(i!==null){if(i.status===6)return;i.status=3}var a=ca(e.componentStack);if(r===null){if(t.status!==13&&t.status!==14){if(r=e.replay,r===null){t.trackedPostpones!==null&&i!==null?(r=t.trackedPostpones,la(t,n,a),wa(t,r,e,i),La(t,null,e.row,i)):(la(t,n,a),ua(t,n));return}r.pendingTasks--,r.pendingTasks===0&&0<r.nodes.length&&(i=la(t,n,a),Aa(t,null,r.nodes,r.slots,n,i)),t.pendingRootTasks--,t.pendingRootTasks===0&&Na(t)}}else{var o=t.trackedPostpones;if(r.status!==4){if(o!==null&&i!==null)return la(t,n,a),wa(t,o,e,i),r.fallbackAbortableTasks.forEach(function(e){return ja(e,t,n)}),r.fallbackAbortableTasks.clear(),La(t,r,e.row,i);r.status=4,i=la(t,n,a),r.status=4,r.errorDigest=i,Ta(t,r),r.parentFlushed&&t.clientRenderedBoundaries.push(r)}r.pendingTasks--,i=r.row,i!==null&&--i.pendingTasks===0&&da(t,i),r.fallbackAbortableTasks.forEach(function(e){return ja(e,t,n)}),r.fallbackAbortableTasks.clear()}e=e.row,e!==null&&--e.pendingTasks===0&&da(t,e),t.allPendingTasks--,t.allPendingTasks===0&&Pa(t)}function Ma(e,t){try{var n=e.renderState,r=n.onHeaders;if(r){var i=n.headers;if(i){n.headers=null;var a=i.preconnects;if(i.fontPreloads&&(a&&(a+=`, `),a+=i.fontPreloads),i.highImagePreloads&&(a&&(a+=`, `),a+=i.highImagePreloads),!t){var o=n.styles.values(),s=o.next();b:for(;0<i.remainingCapacity&&!s.done;s=o.next())for(var c=s.value.sheets.values(),l=c.next();0<i.remainingCapacity&&!l.done;l=c.next()){var u=l.value,d=u.props,f=d.href,p=u.props,m=Or(p.href,`style`,{crossOrigin:p.crossOrigin,integrity:p.integrity,nonce:p.nonce,type:p.type,fetchPriority:p.fetchPriority,referrerPolicy:p.referrerPolicy,media:p.media});if(0<=(i.remainingCapacity-=m.length+2))n.resets.style[f]=ye,a&&(a+=`, `),a+=m,n.resets.style[f]=typeof d.crossOrigin==`string`||typeof d.integrity==`string`?[d.crossOrigin,d.integrity]:ye;else break b}}r(a?{Link:a}:{})}}}catch(t){la(e,t,{})}}function Na(e){e.trackedPostpones===null&&Ma(e,!0),e.trackedPostpones===null&&Va(e),e.onShellError=ti,e=e.onShellReady,e()}function Pa(e){Ma(e,e.trackedPostpones===null?!0:e.completedRootSegment===null||e.completedRootSegment.status!==5),Va(e),e=e.onAllReady,e()}function Fa(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null&&t.children[0].id===-1){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,n.status!==1&&n.status!==3&&n.status!==4||Fa(e,n)}else e.completedSegments.push(t)}function Ia(e,t,n){if(ee!==null){n=n.chunks;for(var r=0,i=0;i<n.length;i++)r+=n[i].byteLength;t===null?e.byteSize+=r:t.byteSize+=r}}function La(e,t,n,i){if(n!==null&&(--n.pendingTasks===0?da(e,n):n.together&&pa(e,n)),e.allPendingTasks--,t===null){if(i!==null&&i.parentFlushed){if(e.completedRootSegment!==null)throw Error(r(389));e.completedRootSegment=i}e.pendingRootTasks--,e.pendingRootTasks===0&&Na(e)}else if(t.pendingTasks--,t.status!==4)if(t.pendingTasks===0){if(t.status===0&&(t.status=1),i!==null&&i.parentFlushed&&(i.status===1||i.status===3)&&Fa(t,i),t.parentFlushed&&e.completedBoundaries.push(t),t.status===1)n=t.row,n!==null&&Ir(n.hoistables,t.contentState),qi(e,t)||(t.fallbackAbortableTasks.forEach(ka,e),t.fallbackAbortableTasks.clear(),n!==null&&--n.pendingTasks===0&&da(e,n)),e.pendingRootTasks===0&&e.trackedPostpones===null&&t.contentPreamble!==null&&Va(e);else if(t.status===5&&(t=t.row,t!==null)){if(e.trackedPostpones!==null){n=e.trackedPostpones;var a=t.next;if(a!==null&&(i=a.boundaries,i!==null))for(a.boundaries=null,a=0;a<i.length;a++){var o=i[a];Ca(e,n,o),La(e,o,null,null)}}--t.pendingTasks===0&&da(e,t)}}else i===null||!i.parentFlushed||i.status!==1&&i.status!==3||(Fa(t,i),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)),t=t.row,t!==null&&t.together&&pa(e,t);e.allPendingTasks===0&&Pa(e)}function Ra(e){if(e.status!==14&&e.status!==13){var t=Vr,n=he.H;he.H=Ri;var i=he.A;he.A=Bi;var a=ea;ea=e;var o=zi;zi=e.resumableState;try{var s=e.pingedTasks,c;for(c=0;c<s.length;c++){var l=s[c],u=e,d=l.blockedSegment;if(d===null){var f=u;if(l.replay.pendingTasks!==0){qr(l.context);try{if(typeof l.replay.slots==`number`?ya(f,l,l.replay.slots,l.node,l.childIndex):xa(f,l),l.replay.pendingTasks===1&&0<l.replay.nodes.length)throw Error(r(488));l.replay.pendingTasks--,l.abortSet.delete(l),La(f,l.blockedBoundary,l.row,null)}catch(e){Di();var p=e===ni?ai():e;if(typeof p==`object`&&p&&typeof p.then==`function`){var m=l.ping;p.then(m,m),l.thenableState=e===ni?Ei():null}else{l.replay.pendingTasks--,l.abortSet.delete(l);var h=ca(l.componentStack);u=void 0;var g=f,_=l.blockedBoundary,v=f.status===12?f.fatalError:p,y=l.replay.nodes,b=l.replay.slots;u=la(g,v,h),Aa(g,_,y,b,v,u),f.pendingRootTasks--,f.pendingRootTasks===0&&Na(f),f.allPendingTasks--,f.allPendingTasks===0&&Pa(f)}}}}else if(f=void 0,g=d,g.status===0){g.status=6,qr(l.context);var x=g.children.length,S=g.chunks.length;try{xa(u,l),g.lastPushedText&&g.textEmbedded&&g.chunks.push(He),l.abortSet.delete(l),g.status=1,Ia(u,l.blockedBoundary,g),La(u,l.blockedBoundary,l.row,g)}catch(e){Di(),g.children.length=x,g.chunks.length=S;var C=e===ni?ai():u.status===12?u.fatalError:e;if(u.status===12&&u.trackedPostpones!==null){var w=u.trackedPostpones,T=ca(l.componentStack);l.abortSet.delete(l),la(u,C,T),wa(u,w,l,g),La(u,l.blockedBoundary,l.row,g)}else if(typeof C==`object`&&C&&typeof C.then==`function`){g.status=0,l.thenableState=e===ni?Ei():null;var E=l.ping;C.then(E,E)}else{var D=ca(l.componentStack);l.abortSet.delete(l),g.status=4;var O=l.blockedBoundary,k=l.row;if(k!==null&&--k.pendingTasks===0&&da(u,k),u.allPendingTasks--,f=la(u,C,D),O===null)ua(u,C);else if(O.pendingTasks--,O.status!==4){O.status=4,O.errorDigest=f,Ta(u,O);var A=O.row;A!==null&&--A.pendingTasks===0&&da(u,A),O.parentFlushed&&u.clientRenderedBoundaries.push(O),u.pendingRootTasks===0&&u.trackedPostpones===null&&O.contentPreamble!==null&&Va(u)}u.allPendingTasks===0&&Pa(u)}}}}s.splice(0,c),e.destination!==null&&Ya(e,e.destination)}catch(t){la(e,t,{}),ua(e,t)}finally{zi=o,he.H=n,he.A=i,n===Ri&&qr(t),ea=a}}}function za(e,t,n){t.preambleChildren.length&&n.push(t.preambleChildren);for(var r=!1,i=0;i<t.children.length;i++)r=Ba(e,t.children[i],n)||r;return r}function Ba(e,t,n){var i=t.boundary;if(i===null)return za(e,t,n);var a=i.contentPreamble,o=i.fallbackPreamble;if(a===null||o===null)return!1;switch(i.status){case 1:if(It(e.renderState,a),e.byteSize+=i.byteSize,t=i.completedSegments[0],!t)throw Error(r(391));return za(e,t,n);case 5:if(e.trackedPostpones!==null)return!0;case 4:if(t.status===1)return It(e.renderState,o),za(e,t,n);default:return!0}}function Va(e){if(e.completedRootSegment&&e.completedPreambleSegments===null){var t=[],n=e.byteSize,r=Ba(e,e.completedRootSegment,t),i=e.renderState.preamble;!1===r||i.headChunks&&i.bodyChunks?e.completedPreambleSegments=t:e.byteSize=n}}function Ha(e,t,n,i){switch(n.parentFlushed=!0,n.status){case 0:n.id=e.nextSegmentId++;case 5:return i=n.id,n.lastPushedText=!1,n.textEmbedded=!1,e=e.renderState,N(t,zt),N(t,e.placeholderPrefix),e=L(i.toString(16)),N(t,e),P(t,Bt);case 1:n.status=2;var a=!0,o=n.chunks,s=0;n=n.children;for(var c=0;c<n.length;c++){for(a=n[c];s<a.index;s++)N(t,o[s]);a=Wa(e,t,a,i)}for(;s<o.length-1;s++)N(t,o[s]);return s<o.length&&(a=P(t,o[s])),a;case 3:return!0;default:throw Error(r(390))}}var Ua=0;function Wa(e,t,n,i){var a=n.boundary;if(a===null)return Ha(e,t,n,i);if(a.parentFlushed=!0,a.status===4){var o=a.row;o!==null&&--o.pendingTasks===0&&da(e,o),a=a.errorDigest,P(t,Kt),N(t,Jt),a&&(N(t,Xt),N(t,L(ue(a))),N(t,Yt)),P(t,Zt),Ha(e,t,n,i)}else if(a.status!==1)a.status===0&&(a.rootSegmentID=e.nextSegmentId++),0<a.completedSegments.length&&e.partialBoundaries.push(a),Qt(t,e.renderState,a.rootSegmentID),i&&Ir(i,a.fallbackState),Ha(e,t,n,i);else if(!Ja&&qi(e,a)&&(Ua+a.byteSize>e.progressiveChunkSize||H(a.contentState)))a.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(a),Qt(t,e.renderState,a.rootSegmentID),Ha(e,t,n,i);else{if(Ua+=a.byteSize,i&&Ir(i,a.contentState),n=a.row,n!==null&&qi(e,a)&&--n.pendingTasks===0&&da(e,n),P(t,Ut),n=a.completedSegments,n.length!==1)throw Error(r(391));Wa(e,t,n[0],i)}return P(t,qt)}function Ga(e,t,n,r){return xn(t,e.renderState,n.parentFormatContext,n.id),Wa(e,t,n,r),Sn(t,n.parentFormatContext)}function Ka(e,t,n){Ua=n.byteSize;for(var r=n.completedSegments,i=0;i<r.length;i++)qa(e,t,n,r[i]);r.length=0,r=n.row,r!==null&&qi(e,n)&&--r.pendingTasks===0&&da(e,r),$n(t,n.contentState,e.renderState),r=e.resumableState,e=e.renderState,i=n.rootSegmentID,n=n.contentState;var a=e.stylesToHoist;return e.stylesToHoist=!1,N(t,e.startInlineScript),N(t,ct),a?(!(r.instructions&4)&&(r.instructions|=4,N(t,Fn)),!(r.instructions&2)&&(r.instructions|=2,N(t,Dn)),r.instructions&8?N(t,An):(r.instructions|=8,N(t,kn))):(!(r.instructions&2)&&(r.instructions|=2,N(t,Dn)),N(t,On)),r=L(i.toString(16)),N(t,e.boundaryPrefix),N(t,r),N(t,jn),N(t,e.segmentPrefix),N(t,r),a?(N(t,Mn),_r(t,n)):N(t,Nn),n=P(t,Pn),Lt(t,e)&&n}function qa(e,t,n,i){if(i.status===2)return!0;var a=n.contentState,o=i.id;if(o===-1){if((i.id=n.rootSegmentID)===-1)throw Error(r(392));return Ga(e,t,i,a)}return o===n.rootSegmentID?Ga(e,t,i,a):(Ga(e,t,i,a),n=e.resumableState,e=e.renderState,N(t,e.startInlineScript),N(t,ct),n.instructions&1?N(t,wn):(n.instructions|=1,N(t,Cn)),N(t,e.segmentPrefix),o=L(o.toString(16)),N(t,o),N(t,Tn),N(t,e.placeholderPrefix),N(t,o),t=P(t,En),t)}var Ja=!1;function Ya(e,t){j=new Uint8Array(2048),M=0;try{if(!(0<e.pendingRootTasks)){var n,r=e.completedRootSegment;if(r!==null){if(r.status===5)return;var i=e.completedPreambleSegments;if(i===null)return;Ua=e.byteSize;var a=e.resumableState,o=e.renderState,s=o.preamble,c=s.htmlChunks,l=s.headChunks,u;if(c){for(u=0;u<c.length;u++)N(t,c[u]);if(l)for(u=0;u<l.length;u++)N(t,l[u]);else N(t,jt(`head`)),N(t,ct)}else if(l)for(u=0;u<l.length;u++)N(t,l[u]);var d=o.charsetChunks;for(u=0;u<d.length;u++)N(t,d[u]);d.length=0,o.preconnects.forEach(er,t),o.preconnects.clear();var f=o.viewportChunks;for(u=0;u<f.length;u++)N(t,f[u]);f.length=0,o.fontPreloads.forEach(er,t),o.fontPreloads.clear(),o.highImagePreloads.forEach(er,t),o.highImagePreloads.clear(),be=o,o.styles.forEach(cr,t),be=null;var p=o.importMapChunks;for(u=0;u<p.length;u++)N(t,p[u]);p.length=0,o.bootstrapScripts.forEach(er,t),o.scripts.forEach(er,t),o.scripts.clear(),o.bulkPreloads.forEach(er,t),o.bulkPreloads.clear(),c||l||(a.instructions|=32);var m=o.hoistableChunks;for(u=0;u<m.length;u++)N(t,m[u]);for(a=m.length=0;a<i.length;a++){var h=i[a];for(o=0;o<h.length;o++)Wa(e,t,h[o],null)}var g=e.renderState.preamble,_=g.headChunks;(g.htmlChunks||_)&&N(t,Ft(`head`));var v=g.bodyChunks;if(v)for(i=0;i<v.length;i++)N(t,v[i]);Wa(e,t,r,null),e.completedRootSegment=null;var y=e.renderState;if(e.allPendingTasks!==0||e.clientRenderedBoundaries.length!==0||e.completedBoundaries.length!==0||e.trackedPostpones!==null&&(e.trackedPostpones.rootNodes.length!==0||e.trackedPostpones.rootSlots!==null)){var b=e.resumableState;if(!(b.instructions&64)){if(b.instructions|=64,N(t,y.startInlineScript),!(b.instructions&32)){b.instructions|=32;var x=`_`+b.idPrefix+`R_`;N(t,dr),N(t,L(ue(x))),N(t,Ze)}N(t,ct),N(t,Rt),P(t,Se)}}Lt(t,y)}var S=e.renderState;r=0;var C=S.viewportChunks;for(r=0;r<C.length;r++)N(t,C[r]);C.length=0,S.preconnects.forEach(er,t),S.preconnects.clear(),S.fontPreloads.forEach(er,t),S.fontPreloads.clear(),S.highImagePreloads.forEach(er,t),S.highImagePreloads.clear(),S.styles.forEach(ur,t),S.scripts.forEach(er,t),S.scripts.clear(),S.bulkPreloads.forEach(er,t),S.bulkPreloads.clear();var w=S.hoistableChunks;for(r=0;r<w.length;r++)N(t,w[r]);w.length=0;var T=e.clientRenderedBoundaries;for(n=0;n<T.length;n++){var E=T[n];S=t;var D=e.resumableState,O=e.renderState,k=E.rootSegmentID,A=E.errorDigest;N(S,O.startInlineScript),N(S,ct),D.instructions&4?N(S,Ln):(D.instructions|=4,N(S,In)),N(S,O.boundaryPrefix),N(S,L(k.toString(16))),N(S,Rn),A&&(N(S,zn),N(S,L(Hn(A||``))));var I=P(S,Bn);if(!I){e.destination=null,n++,T.splice(0,n);return}}T.splice(0,n);var R=e.completedBoundaries;for(n=0;n<R.length;n++)if(!Ka(e,t,R[n])){e.destination=null,n++,R.splice(0,n);return}R.splice(0,n),F(t),j=new Uint8Array(2048),M=0,Ja=!0;var ee=e.partialBoundaries;for(n=0;n<ee.length;n++){var z=ee[n];a:{T=e,E=t,Ua=z.byteSize;var te=z.completedSegments;for(I=0;I<te.length;I++)if(!qa(T,E,z,te[I])){I++,te.splice(0,I);var ne=!1;break a}te.splice(0,I);var re=z.row;re!==null&&re.together&&z.pendingTasks===1&&(re.pendingTasks===1?fa(T,re,re.hoistables):re.pendingTasks--),ne=$n(E,z.contentState,T.renderState)}if(!ne){e.destination=null,n++,ee.splice(0,n);return}}ee.splice(0,n),Ja=!1;var ie=e.completedBoundaries;for(n=0;n<ie.length;n++)if(!Ka(e,t,ie[n])){e.destination=null,n++,ie.splice(0,n);return}ie.splice(0,n)}}finally{Ja=!1,e.allPendingTasks===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0?(e.flushScheduled=!1,n=e.resumableState,n.hasBody&&N(t,Ft(`body`)),n.hasHtml&&N(t,Ft(`html`)),F(t),e.status=14,t.close(),e.destination=null):F(t)}}function Xa(e){e.flushScheduled=e.destination!==null,A(function(){return Ra(e)}),D(function(){e.status===10&&(e.status=11),e.trackedPostpones===null&&Ma(e,e.pendingRootTasks===0)})}function Za(e){!1===e.flushScheduled&&e.pingedTasks.length===0&&e.destination!==null&&(e.flushScheduled=!0,D(function(){var t=e.destination;t?Ya(e,t):e.flushScheduled=!1}))}function Qa(e,t){if(e.status===13)e.status=14,z(t,e.fatalError);else if(e.status!==14&&e.destination===null){e.destination=t;try{Ya(e,t)}catch(t){la(e,t,{}),ua(e,t)}}}function $a(e,t){(e.status===11||e.status===10)&&(e.status=12);try{var n=e.abortableTasks;if(0<n.size){var i=t===void 0?Error(r(432)):typeof t==`object`&&t&&typeof t.then==`function`?Error(r(530)):t;e.fatalError=i,n.forEach(function(t){return ja(t,e,i)}),n.clear()}e.destination!==null&&Ya(e,e.destination)}catch(t){la(e,t,{}),ua(e,t)}}function eo(e,t,n){if(t===null)n.rootNodes.push(e);else{var r=n.workingMap,i=r.get(t);i===void 0&&(i=[t[1],t[2],[],null],r.set(t,i),eo(i,t[0],n)),i[2].push(e)}}function to(e){var t=e.trackedPostpones;if(t===null||t.rootNodes.length===0&&t.rootSlots===null)return e.trackedPostpones=null;if(e.completedRootSegment===null||e.completedRootSegment.status!==5&&e.completedPreambleSegments!==null){var n=e.nextSegmentId,r=t.rootSlots,i=e.resumableState;i.bootstrapScriptContent=void 0,i.bootstrapScripts=void 0,i.bootstrapModules=void 0}else{n=0,r=-1,i=e.resumableState;var a=e.renderState;i.nextFormID=0,i.hasBody=!1,i.hasHtml=!1,i.unknownResources={font:a.resets.font},i.dnsResources=a.resets.dns,i.connectResources=a.resets.connect,i.imageResources=a.resets.image,i.styleResources=a.resets.style,i.scriptResources={},i.moduleUnknownResources={},i.moduleScriptResources={},i.instructions=0}return{nextSegmentId:n,rootFormatContext:e.rootFormatContext,progressiveChunkSize:e.progressiveChunkSize,resumableState:e.resumableState,replayNodes:t.rootNodes,replaySlots:r}}function no(){var e=t.version;if(e!==`19.2.3`)throw Error(r(527,e,`19.2.3`))}no(),no(),e.prerender=function(e,t){return new Promise(function(n,r){var i=t?t.onHeaders:void 0,a;i&&(a=function(e){i(new Headers(e))});var o=Fe(t?t.identifierPrefix:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),s=Zi(e,o,Pe(o,void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,a,t?t.maxHeadersLength:void 0),Re(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){Qa(s,e)},cancel:function(e){s.destination=null,$a(s,e)}},{highWaterMark:0});e={postponed:to(s),prelude:e},n(e)},void 0,void 0,r,t?t.onPostpone:void 0);if(t&&t.signal){var c=t.signal;if(c.aborted)$a(s,c.reason);else{var l=function(){$a(s,c.reason),c.removeEventListener(`abort`,l)};c.addEventListener(`abort`,l)}}Xa(s)})},e.renderToReadableStream=function(e,t){return new Promise(function(n,r){var i,a,o=new Promise(function(e,t){a=e,i=t}),s=t?t.onHeaders:void 0,c;s&&(c=function(e){s(new Headers(e))});var l=Fe(t?t.identifierPrefix:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),u=Xi(e,l,Pe(l,t?t.nonce:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,c,t?t.maxHeadersLength:void 0),Re(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,a,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){Qa(u,e)},cancel:function(e){u.destination=null,$a(u,e)}},{highWaterMark:0});e.allReady=o,n(e)},function(e){o.catch(function(){}),r(e)},i,t?t.onPostpone:void 0,t?t.formState:void 0);if(t&&t.signal){var d=t.signal;if(d.aborted)$a(u,d.reason);else{var f=function(){$a(u,d.reason),d.removeEventListener(`abort`,f)};d.addEventListener(`abort`,f)}}Xa(u)})},e.resume=function(e,t,n){return new Promise(function(r,i){var a,o,s=new Promise(function(e,t){o=e,a=t}),c=Qi(e,t,Pe(t.resumableState,n?n.nonce:void 0,void 0,void 0,void 0,void 0),n?n.onError:void 0,o,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){Qa(c,e)},cancel:function(e){c.destination=null,$a(c,e)}},{highWaterMark:0});e.allReady=s,r(e)},function(e){s.catch(function(){}),i(e)},a,n?n.onPostpone:void 0);if(n&&n.signal){var l=n.signal;if(l.aborted)$a(c,l.reason);else{var u=function(){$a(c,l.reason),l.removeEventListener(`abort`,u)};l.addEventListener(`abort`,u)}}Xa(c)})},e.resumeAndPrerender=function(e,t,n){return new Promise(function(r,i){var a=$i(e,t,Pe(t.resumableState,void 0,void 0,void 0,void 0,void 0),n?n.onError:void 0,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){Qa(a,e)},cancel:function(e){a.destination=null,$a(a,e)}},{highWaterMark:0});e={postponed:to(a),prelude:e},r(e)},void 0,void 0,i,n?n.onPostpone:void 0);if(n&&n.signal){var o=n.signal;if(o.aborted)$a(a,o.reason);else{var s=function(){$a(a,o.reason),o.removeEventListener(`abort`,s)};o.addEventListener(`abort`,s)}}Xa(a)})}
366,e.version=`19.2.3`})),lEe=i((e=>{var t=sEe(),n=cEe();e.version=t.version,e.renderToString=t.renderToString,e.renderToStaticMarkup=t.renderToStaticMarkup,e.renderToReadableStream=n.renderToReadableStream,e.resume=n.resume}))(),uEe=VA(e=>{let t=EE({symbolization:e});if(typeof t==`string`)return()=>t;let n=_O(t,`symbolization`);if(n.result===`error`)throw Error(`Could not parse symbolization expression`);return e=>n.value.evaluate({zoom:0},e)});function dEe(e,t){try{return uEe(e)(t)}catch{return l}}var HA=[`Features`,`World`,`Viewport`],UA=[{id:`geoMercator`,fn:QTe,label:`Web Mercator`},{id:`geoEquirectangular`,fn:eEe,label:`Equirectangular`},{id:`geoAzimuthalEqualArea`,fn:ZTe,label:`Azimuthal Equal Area`},{id:`geoConicEquidistant`,fn:nEe,label:`Conic Equidistant`},{id:`geoAlbers`,fn:JTe,label:`Albers`},{id:`geoEqualEarth`,fn:iEe,label:`Equal Earth`}];function WA({child:e,path:t,symbolization:n}){switch(e.type){case`folder`:{let r=e.meta.name;return(0,H.jsx)(`g`,{...typeof r==`string`?{id:r}:{},children:e.children.map((e,r)=>(0,H.jsx)(WA,{child:e,path:t,symbolization:n},r))})}case`Feature`:{let r=e.geometry;if(!r)return null;let i=t(ow(r,!0));if(!i)return null;let a={d:i},o=dEe(n,e)||`black`;return(r.type===`LineString`||r.type===`MultiLineString`)&&(a.stroke=o),(r.type===`Polygon`||r.type===`MultiPolygon`||r.type===`Point`)&&(a.fill=o,a.fillOpacity=.2),(0,H.jsx)(`path`,{...a})}}}function GA({config:e,root:t,path:n,symbolization:r,exporting:i=!1}){let a={className:`border border-gray-200 bg-white w-full`,style:{aspectRatio:`${e.chartWidth} / ${e.chartHeight}`}};return(0,H.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 ${e.chartWidth} ${e.chartHeight}`,...i?{}:a,children:[e.sphere?(0,H.jsx)(`path`,{d:n({type:`Sphere`}),fill:`none`,stroke:`black`}):null,t.children.map((e,t)=>(0,H.jsx)(WA,{child:e,path:n,symbolization:r},t))]})}function fEe(){let e=Yv(Wx),t=(0,B.useContext)(kS),[n]=i_().useMetadata(),{featureMap:r}=e,i=D_e(e),[a,o]=(0,B.useState)({padding:10,pointRadius:4.5,chartWidth:800,chartHeight:800,projection:UA[0].id,sphere:!1,extent:HA[0]}),s=(0,B.useMemo)(()=>{let e=t?.map.getBounds();if(!e)return{type:`Sphere`};let n=e.toArray();return{type:`LineString`,coordinates:[n[0],n[1]]}},[t]),c=(0,B.useMemo)(()=>{let e={type:`FeatureCollection`,features:[]};for(let{feature:t}of r.values()){let n=t.geometry;if(!n)continue;let r=ow(n,!0);e.features.push({type:`Feature`,geometry:r,properties:t.properties})}let t=UA.find(e=>e.id===a.projection);if(!t)throw Error(`Projection unexpectedly not found`);return FTe(t.fn().fitExtent([[a.padding,a.padding],[a.chartWidth-a.padding,a.chartHeight-a.padding]],a.extent===`Features`?e:a.extent===`World`?{type:`Sphere`}:s)).pointRadius(a.pointRadius)},[r,a,s]);async function l(){let{fileSave:e}=await ye(async()=>{let{fileSave:e}=await Promise.resolve().then(()=>J9);return{fileSave:e}},void 0),t=`<?xml version="1.0" encoding="UTF-8" standalone="no"?>
367    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
368  ${(0,lEe.renderToStaticMarkup)((0,H.jsx)(GA,{root:i,path:c,config:a,symbolization:n.symbolization}))}`;await e(new Blob([t]),{description:`Save file`,extensions:[`.svg`]})}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Export SVG`,titleIcon:Yt}),(0,H.jsxs)(Vg,{children:[`SVG Export is a specialized option: what you get here won’t be a finished product, but a basic element that you can use when you import it into a drawing tool.`,(0,H.jsx)(`br`,{}),(0,H.jsx)(`br`,{}),`This tool is in Beta: please submit feedback to help us improve it!`]}),(0,H.jsx)(`div`,{className:`h-2`}),(0,H.jsx)(`div`,{className:`flex items-center justify-center border border-gray-200 p-2 bg-gray-200`,children:(0,H.jsx)(GA,{root:i,path:c,config:a,symbolization:n.symbolization})}),(0,H.jsx)(eg,{initialValues:a,onSubmit:e=>{o(e)},children:(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{className:`pt-4 space-y-2 text-sm`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 p-2 border border-gray-200 rounded-sm`,children:[(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{type:`number`,className:`${Lg({_size:`sm`})} w-32`,name:`chartWidth`}),(0,H.jsx)(bg,{children:`Width`})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{type:`number`,className:`${Lg({_size:`sm`})} w-32`,name:`chartHeight`}),(0,H.jsx)(bg,{children:`Height`})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{type:`number`,className:`${Lg({_size:`sm`})} w-32`,name:`padding`}),(0,H.jsx)(bg,{children:`Padding`})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{type:`number`,className:`${Lg({_size:`sm`})} w-32`,name:`pointRadius`}),(0,H.jsx)(bg,{children:`Point radius`})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{type:`checkbox`,className:ug({variant:`default`}),name:`sphere`}),(0,H.jsx)(bg,{children:`Sphere outline`})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{as:`select`,className:`${Lg({_size:`sm`})} w-32`,name:`extent`,children:HA.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))}),(0,H.jsx)(bg,{children:`Extent`})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{as:`select`,className:`${Lg({_size:`sm`})} w-32`,name:`projection`,children:UA.map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,H.jsx)(bg,{children:`Projection`})]})]}),(0,H.jsx)(Fg,{type:`submit`,children:`Update settings`})]})})}),(0,H.jsx)(`div`,{className:`pt-6 pb-1 flex flex-col sm:flex-row-reverse space-y-2 sm:space-y-0 sm:gap-x-3`,children:(0,H.jsx)(Fg,{type:`button`,onClick:l,variant:`primary`,children:`Export`})})]})}function pEe({result:e}){let t=Xv(Ux);return(0,H.jsxs)(`div`,{className:`flex items-center justify-between flex-auto gap-x-4`,children:[(0,H.jsx)(`div`,{className:`text-md`,children:`Imported`}),e.notes.length?(0,H.jsx)(Fg,{type:`button`,onClick:()=>{t({type:`import_notes`,result:e})},children:mv(`issue`,e.notes.length)}):null]})}function mEe(e){return dE.success(()=>(0,H.jsx)(pEe,{result:e}),{duration:e.notes.length?1e4:5e3})}function KA(){let{values:e}=Gh(),{type:t}=e;return t===`coordinate-string`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`flex items-center gap-x-4`,children:hbe.map(({value:e,label:t})=>(0,H.jsxs)(`label`,{className:`flex items-center gap-x-1`,children:[(0,H.jsx)(rg,{className:jg,type:`radio`,name:`coordinateStringOptions.order`,value:e}),(0,H.jsx)(bg,{children:t})]},e))}),(0,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`pt-2 text-sm text-gray-700 dark:text-gray-300`,children:[`Decimal coordinate strings, like `,(0,H.jsx)(`code`,{children:`-72.00, 40.00`}),` are supported.`]})})]}):null}var qA=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hEe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},JA=new class{#e=hEe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function gEe(e){setTimeout(e,0)}var YA=typeof window>`u`||`Deno`in globalThis;function XA(){}function _Ee(e,t){return typeof e==`function`?e(t):e}function ZA(e){return typeof e==`number`&&e>=0&&e!==1/0}function QA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $A(e,t){return typeof e==`function`?e(t):e}function ej(e,t){return typeof e==`function`?e(t):e}function tj(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==rj(o,t.options))return!1}else if(!aj(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function nj(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ij(t.options.mutationKey)!==ij(a))return!1}else if(!aj(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function rj(e,t){return(t?.queryKeyHashFn||ij)(e)}function ij(e){return JSON.stringify(e,(e,t)=>lj(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function aj(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>aj(e[n],t[n])):!1}var vEe=Object.prototype.hasOwnProperty;function oj(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=cj(e)&&cj(t);if(!r&&!(lj(e)&&lj(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:vEe.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=oj(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function sj(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function cj(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lj(e){if(!uj(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!uj(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function uj(e){return Object.prototype.toString.call(e)===`[object Object]`}function yEe(e){return new Promise(t=>{JA.setTimeout(t,e)})}function dj(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:oj(e,t)}function bEe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function xEe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var fj=Symbol();function pj(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===fj?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mj(e,t){return typeof e==`function`?e(...t):!!e}function SEe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var hj=new class extends qA{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!YA&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();
368this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function gj(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var CEe=gEe;function wEe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=CEe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var _j=wEe(),vj=new class extends qA{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!YA&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function TEe(e){return Math.min(1e3*2**e,3e4)}function yj(e){return(e??`online`)===`online`?vj.isOnline():!0}var bj=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xj(e){let t=!1,n=0,r,i=gj(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new bj(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>hj.isFocused()&&(e.networkMode===`always`||vj.isOnline())&&e.canRun(),u=()=>yj(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(YA?0:3),o=e.retryDelay??TEe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),yEe(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Sj=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ZA(this.gcTime)&&(this.#e=JA.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(YA?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(JA.clearTimeout(this.#e),void 0)}},EEe=class extends Sj{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Tj(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Tj(this.options);e.data!==void 0&&(this.setState(wj(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=dj(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(XA).catch(XA):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ej(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fj||this.state.dataUpdateCount+this.state.errorUpdate
368Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>$A(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!QA(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=pj(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=xj({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof bj&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof bj){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Cj(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...wj(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),_j.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Cj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yj(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function wj(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Tj(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdate
vendor: 1,511 bytes, line 368
368Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ej=class extends qA{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=gj(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Dj(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Oj(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Oj(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof ej(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!sj(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&kj(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||ej(this.options.enabled,this.#t)!==e
368j(t.enabled,this.#t)||$A(this.options.staleTime,this.#t)!==$A(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||ej(this.options.enabled,this.#t)!==ej(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return OEe(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(XA)),t}#g(){this.#b();let e=$A(this.options.staleTime,this.#t);if(YA||this.#r.isStale||!ZA(e))return;let t=QA(this.#r.dataUpdatedAt,e)+1;this.#d=JA.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(YA||ej(this.options.enabled,this.#t)===!1||!ZA(this.#p)||this.#p===0)&&(this.#f=JA.setInterval(()=>{(this.options.refetchIntervalInBackground||hj.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(JA.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(JA.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Dj(e,t),o=i&&kj(e,n,t,r);(a||o)&&(l={...l,...Cj(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=dj(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=dj(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Aj(e,t),refetch:this.refetch,promise:this.#o,isEnabled:ej(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=gj();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!sj(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){_j.batch(()=>
368{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function DEe(e,t){return ej(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function Dj(e,t){return DEe(e,t)||e.state.data!==void 0&&Oj(e,t,t.refetchOnMount)}function Oj(e,t,n){if(ej(t.enabled,e)!==!1&&$A(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Aj(e,t)}return!1}function kj(e,t,n,r){return(e!==t||ej(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Aj(e,n)}function Aj(e,t){return ej(t.enabled,e)!==!1&&e.isStaleByTime($A(t.staleTime,e))}function OEe(e,t){return!sj(e.getCurrentResult(),t)}function jj(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{SEe(e,()=>t.signal,()=>n=!0)},u=pj(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?xEe:bEe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?kEe:Mj,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Mj(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Mj(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function kEe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var AEe=class extends Sj{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||jEe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=xj({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPau
368sed:!1,status:`error`}}};this.state=t(this.state),_j.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function jEe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var MEe=class extends qA{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new AEe({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Nj(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Nj(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Nj(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Nj(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>
vendor: 4,186 bytes, line 368
368t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_j.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>nj(t,e))}findAll(e={}){return this.getAll().filter(t=>nj(e,t))}notify(e){_j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _j.batch(()=>Promise.all(e.map(e=>e.continue().catch(XA))))}};function Nj(e){return e.options.scope?.id}var NEe=class extends qA{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??rj(r,t),a=this.get(i);return a||(a=new EEe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_j.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>tj(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>tj(e,t)):t}notify(e){_j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_j.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_j.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},PEe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new NEe,this.#t=e.mutationCache||new MEe,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=hj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=vj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime($A(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=_Ee(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _j.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;_j.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _j.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=_j.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(XA).catch(XA)}invalidateQueries(e,t={}){return _j.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=_j.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(XA)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(XA)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime($A(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(XA).catch(XA)}
368fetchInfiniteQuery(e){return e.behavior=jj(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(XA).catch(XA)}ensureInfiniteQueryData(e){return e.behavior=jj(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vj.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ij(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{aj(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ij(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{aj(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=rj(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===fj&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Pj=B.createContext(void 0),FEe=e=>{let t=B.useContext(Pj);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},IEe=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,H.jsx)(Pj.Provider,{value:e,children:t})),Fj=B.createContext(!1),LEe=()=>B.useContext(Fj);Fj.Provider;function REe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var zEe=B.createContext(REe()),BEe=()=>B.useContext(zEe),VEe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?mj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},HEe=e=>{B.useEffect(()=>{e.clearReset()},[e])},UEe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||mj(n,[e.error,r])),WEe=(e,t)=>t.state.data===void 0,GEe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},KEe=(e,t)=>e.isLoading&&e.isFetching&&!t,qEe=(e,t)=>e?.suspense&&t.isPending,Ij=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Lj(e,t,n){let r=LEe(),i=BEe(),a=FEe(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,GEe(o),VEe(o,i,s),HEe(i);let c=!a.getQueryCache().get(o.queryHash),[l]=B.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(B.useSyncExternalStore(B.useCallback(e=>{let t=d?l.subscribe(_j.batchCalls(e)):XA;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),B.useEffect(()=>{l.setOptions(o)},[o,l]),qEe(o,u))throw Ij(o,l,i);if(UEe({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!YA&&KEe(u,r)&&(c?Ij(o,l,i):s?.promise)?.catch(XA).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Rj(e,t){return Lj(e,Ej,t)}function zj(e,t){return Lj({...e,enabled:!0,suspense:!0,throwOnError:WEe,placeholderData:void 0},Ej,t)}function Bj({label:e,name:t,columns:n,noDefault:r}){return(0,H.jsxs)(`label`,{className:`flex flex-col justify-stretch gap-y-2`,children:[(0,H.jsx)(bg,{children:e}),n.length===0?(0,H.jsx)(`div`,{className:`block w-full p-1 text-sm text-gray-700 dark:text-white dark:bg-transparent truncate bg-gray-100 border border-gray-300 rounded-xs cursor-not-allowed`,children:`No columns detected`}):(0,H.jsxs)(rg,{component:`select`,name:t,required:!0,className:Ig({size:`sm`}),children:[r?(0,H.jsx)(`option`,{value:``,children:`Select…`}):null,n.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))]})]})}var Vj=(0,nv.default)(async function(){let e=await fetch(`/zip-lookup.json`);if(!e.ok)throw Error(`Could not load ZIP Database`);return await e.json()}),Hj={},Uj={},Wj=34,Gj=10,Kj=13;function qj(e){return Function(`d`,`return {`+e.map(function(e,t){return JSON.stringify(e)+`: d[`+t+`] || ""`}).join(`,`)+`}`)}function JEe(e,t){var n=qj(e);return function(r,i){return t(n(r),i,e)}}function Jj(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var r in e)r in t||n.push(t[r]=r)}),n}function Yj(e,t){var n=e+``,r=n.length;
368return r<t?Array(t-r+1).join(0)+n:n}function YEe(e){return e<0?`-`+Yj(-e,6):e>9999?`+`+Yj(e,6):Yj(e,4)}function XEe(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?`Invalid Date`:YEe(e.getUTCFullYear(),4)+`-`+Yj(e.getUTCMonth()+1,2)+`-`+Yj(e.getUTCDate(),2)+(i?`T`+Yj(t,2)+`:`+Yj(n,2)+`:`+Yj(r,2)+`.`+Yj(i,3)+`Z`:r?`T`+Yj(t,2)+`:`+Yj(n,2)+`:`+Yj(r,2)+`Z`:n||t?`T`+Yj(t,2)+`:`+Yj(n,2)+`Z`:``)}function Xj(e){var t=RegExp(`["`+e+`
369\r]`),n=e.charCodeAt(0);function r(e,t){var n,r,a=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?JEe(e,t):qj(e)});return a.columns=r||[],a}function i(e,t){var r=[],i=e.length,a=0,o=0,s,c=i<=0,l=!1;e.charCodeAt(i-1)===Gj&&--i,e.charCodeAt(i-1)===Kj&&--i;function u(){if(c)return Uj;if(l)return l=!1,Hj;var t,r=a,o;if(e.charCodeAt(r)===Wj){for(;a++<i&&e.charCodeAt(a)!==Wj||e.charCodeAt(++a)===Wj;);return(t=a)>=i?c=!0:(o=e.charCodeAt(a++))===Gj?l=!0:o===Kj&&(l=!0,e.charCodeAt(a)===Gj&&++a),e.slice(r+1,t-1).replace(/""/g,`"`)}for(;a<i;){if((o=e.charCodeAt(t=a++))===Gj)l=!0;else if(o===Kj)l=!0,e.charCodeAt(a)===Gj&&++a;else if(o!==n)continue;return e.slice(r,t)}return c=!0,e.slice(r,i)}for(;(s=u())!==Uj;){for(var d=[];s!==Hj&&s!==Uj;)d.push(s),s=u();t&&(d=t(d,o++))==null||r.push(d)}return r}function a(t,n){return t.map(function(t){return n.map(function(e){return u(t[e])}).join(e)})}function o(t,n){return n??=Jj(t),[n.map(u).join(e)].concat(a(t,n)).join(`
370`)}function s(e,t){return t??=Jj(e),a(e,t).join(`
371`)}function c(e){return e.map(l).join(`
372`)}function l(t){return t.map(u).join(e)}function u(e){return e==null?``:e instanceof Date?XEe(e):t.test(e+=``)?`"`+e.replace(/"/g,`""`)+`"`:e}return{parse:r,parseRows:i,format:o,formatBody:s,formatRows:c,formatRow:l,formatValue:u}}var ZEe=r({autoType:()=>Zj,csvToGeoJSON:()=>$Ee,detectColumns:()=>$j});function Zj(e,t){let n=e;for(let e in n){let r=n[e].trim();if(t.kind===`zip`&&e===t.zipHeader){n[e]=r;continue}let i;if(!r)r=null;else if(r===`true`)r=!0;else if(r===`false`)r=!1;else if(!Number.isNaN(i=+r))r=i;else continue;n[e]=r}return n}function Qj(e,t){let[n]=e.filter(e=>e[t]>0).sort((e,n)=>n[t]-e[t]);return n}var QEe=new Set([`zip`,`zip code`]);function $j(e){let t=e.map(e=>({column:e,latitudeScore:eM(e,/(Lat)(itude)?/gi),longitudeScore:eM(e,/(L)(on|ng)(gitude)?/gi),addressScore:eM(e,/address?/gi),countryScore:eM(e,/country?/gi),localityScore:eM(e,/city?/gi),countyScore:eM(e,/county?/gi),postalcodeScore:eM(e,/(postalcode|postcode|post)?/gi),zipScore:eM(e,/zip/gi),h3Score:eM(e,/h3/gi)})),n=e.includes(`polyline`),r=e.includes(`wkt`),i=Qj(t,`latitudeScore`),a=Qj(t,`longitudeScore`),o=Qj(t,`zipScore`),s=Qj(t,`h3Score`),c=Qj(t,`addressScore`),l=Qj(t,`localityScore`),u=Qj(t,`countryScore`),d=Qj(t,`postalcodeScore`),f=e.length===1&&e[0]||``;return{kind:n?`polyline`:r?`wkt`:s?.column?`h3`:i?.column===a?.column||QEe.has(o?.column?.toLowerCase())?`zip`:`lonlat`,delimiter:`,`,latitudeHeader:i?.column||f,longitudeHeader:a?.column||f,geometryHeader:n?`polyline`:r?`wkt`:f,joinTargetHeader:f,joinSourceHeader:f,sheet:``,autoType:!0,zipHeader:o?.column||f,h3Header:s?.column||f,geocodingBehavior:fbe.NULL_GEOMETRY,geocodingType:u?`structured`:`search`,geocodingHeaders:{...GT.csvOptions.geocodingHeaders,country:u?.column||f,address:c?.column||f,locality:l?.column||f,text:c?.column||f,postalcode:d?.column||f}}}function eM(e,t){let n=t.exec(e);return n?n[0].length:0}async function $Ee(e,t,n){if(!t)throw Error(`Options should not be undefined`);let{kind:r,delimiter:i}=t,a,o=0,s=Xj(i).parse(e),c=[];switch(r){case`zip`:a=await Vj();break;case`addresses`:if(s.length>100)throw Error(`Up to 100 rows are supported for the address type`);break;case`geojson`:case`wkt`:case`join`:case`polyline`:case`h3`:case`lonlat`:break}n({total:s.length,done:0});for(let e of s){let i=t.autoType?Zj(e,t):e;switch(r){case`lonlat`:{let e=Wye(i,Pye.parse(t));e&&c.push(e);break}case`wkt`:{let e=Vye(i,HT.parse(t));e&&c.push(e);break}case`geojson`:{let e=Uye(i,HT.parse(t));e&&c.push(e);break}case`polyline`:{let e=Hye(i,HT.parse(t));e&&c.push(e);break}case`zip`:{let e=Rye(i,a,jye.parse(t));e&&c.push(e);break}case`h3`:{let e=await zye(i,Nye.parse(t));e&&c.push(e);break}case`addresses`:{await new Promise(e=>setTimeout(e,100));let e=await Lye(i,t);e&&c.push(e);break}case`join`:c.push({type:`Feature`,geometry:null,properties:i});break}n({total:s.length,done:++o})}return{type:`FeatureCollection`,features:c}}var tM=e(c_());function nM(e){let t=new Set;for(let n of e.values())if(n.feature.properties)for(let e in n.feature.properties)t.add(e);return Array.from(t)}function eDe(e){let t=new Map;for(let n of e)if(n.feature.properties)for(let e in n.feature.properties){let r=n.feature.properties[e];t.has(e)||t.set(e,new Map);let i=t.get(e);if((0,tM.default)(r)){let e=!1;for(let[t,n]of i.entries())if((0,tv.default)(t,r)){i.set(t,n+1),e=!0;break}e||i.set(r,1)}else i.set(r,(i.get(r)||0)+1)}return t}function rM({geocoder:e}){return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Kind`})}),(0,H.jsx)(`div`,{className:`grid grid-cols-3 items-center gap-2`,children:mbe.filter(t=>e?!0:t.value!==`addresses`).map(({value:e,label:t})=>(0,H.jsxs)(`label`,{className:`flex items-center gap-x-1`,children:[(0,H.jsx)(rg,{type:`radio`,name:`csvOptions.kind`,className:jg,value:e}),(0,H.jsx)(bg,{children:t})]},e))})]})}function iM(e,t){t.kind&&e(`csvOptions.kind`,t.kind),t.geometryHeader&&e(`csvOptions.geometryHeader`,t.geometryHeader),e(`csvOptions.longitudeHeader`,t.longitudeHeader),e(`csvOptions.latitudeHeader`,t.latitudeHeader),e(`csvOptions.zipHeader`,t.zipHeader),e(`csvOptions.h3Header`,t.h3Header),e(`csvOptions.geocodingType`,t.geocodingType),e(`csvOptions.geocodingHeaders.text`,t.geocodingHeaders.text),e(`csvOptions.geocodingHeaders.address`,t.geocodingHeaders.address),e(`csvOptions.geocodingHeaders.postalcode`,t.geocodingHeaders.postalcode),e(`csvOptions.geocodingHeaders.country`,t.geocodingHeaders.country),e(`csvOptions.geocodingHeaders.locality`,t.geocodingHeaders.locality)}var tDe=[{value:`address`,label:`Address`},{value:`neighbourhood`,label:`Neighborhood`},{value:`borough`,label:`Borough`},{value:`locality`,label:`Locality (City)`},{value:`county`,label:`County`},{value:`region`,label:`Region (State, Province)`},{value:`postalcode`,label:`Postcode`},{value:`country`,label:`Country`}];function nDe({columns:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Bj,{label:`Latitude column`,name:`csvOptions.latitudeHeader`,columns:e}),(0,H.jsx)(Bj,{label:`Longitude column`,name:`csvOptions.longitudeHeader`,columns:e})]})}function rDe({columns:e}){return(0,H.jsx)(`div`,{className:`col-span-2`,children:(0,H.jsx)(Bj,{label:`ZIP c
372ode column`,name:`csvOptions.zipHeader`,columns:e})})}function iDe({columns:e}){return(0,H.jsx)(`div`,{className:`col-span-2`,children:(0,H.jsx)(Bj,{label:`H3 column`,name:`csvOptions.h3Header`,columns:e})})}function aM({kind:e,columns:t}){return(0,H.jsx)(`div`,{className:`col-span-2`,children:(0,H.jsx)(Bj,{label:`${e} column`,name:`csvOptions.geometryHeader`,columns:t})})}function aDe({columns:e}){return(0,H.jsxs)(`div`,{className:`col-span-3`,children:[(0,H.jsxs)(`table`,{className:`divide-y divide-gray-200`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:`font-bold text-xs`,children:`Column`}),(0,H.jsx)(`th`,{className:`font-bold text-xs`,children:`Interpretation`})]})}),(0,H.jsx)(`tbody`,{children:tDe.map((t,n)=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{className:`text-xs py-1 w-full truncate`,children:t.label}),(0,H.jsx)(`td`,{className:`py-1`,children:(0,H.jsxs)(rg,{component:`select`,name:`csvOptions.geocodingHeaders.${t.value}`,className:Ig({size:`xs`}),children:[(0,H.jsx)(`option`,{value:``,children:`Select…`}),(0,H.jsx)(`option`,{disabled:!0,children:`---------------`}),e.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))]})})]},n))})]}),(0,H.jsx)(`div`,{className:`pt-2`,children:(0,H.jsxs)(Vg,{children:[`For files with location data in multiple columns. Match as many columns as you can for best results.`,(0,H.jsx)(`br`,{}),`Geocoded files are limited to `,100,` rows. See`,` `,(0,H.jsx)(`a`,{href:`https://www.placemark.io/documentation/importing-addresses`,target:`_blank`,className:Tg,rel:`noreferrer`,children:`more important documentation on importing addresses`}),`.`]})})]})}function oDe({columns:e,values:t}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`label`,{className:`flex flex-col justify-stretch gap-y-2 col-span-2`,children:[(0,H.jsx)(bg,{children:`Geocoding strategy`}),(0,H.jsx)(rg,{name:`csvOptions.geocodingType`,component:`select`,className:Ig({size:`sm`}),children:[{value:`search`,label:`All information in a single column`},{value:`structured`,label:`Location information in multiple columns`}].map(({value:e,label:t})=>(0,H.jsx)(`option`,{value:e,children:t},e))})]}),t.csvOptions.geocodingType===`search`?(0,H.jsxs)(`div`,{className:`col-span-3 space-y-2`,children:[(0,H.jsx)(Bj,{label:`Address column`,name:`csvOptions.geocodingHeaders.text`,noDefault:!0,columns:e}),(0,H.jsxs)(Vg,{children:[`For files that have all of their location data in a single column.`,(0,H.jsx)(`br`,{}),`Geocoded files are limited to `,100,` rows. See`,` `,(0,H.jsx)(`a`,{href:`https://www.placemark.io/documentation/importing-addresses`,target:`_blank`,className:Tg,rel:`noreferrer`,children:`more important documentation on importing addresses`}),`.`]})]}):(0,H.jsx)(aDe,{columns:e})]})}function sDe({columns:e}){let t=Yv(Wx).featureMap,n=nM(t);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Bj,{noDefault:!0,label:`Column in this file`,name:`csvOptions.joinSourceHeader`,columns:e}),(0,H.jsx)(Bj,{noDefault:!0,label:`Column in map data`,name:`csvOptions.joinTargetHeader`,columns:n}),(0,H.jsx)(`div`,{className:`col-span-3 space-y-2`,children:(0,H.jsxs)(Vg,{children:[`Join this spreadsheet against existing data on the map. This requires a column that matches exactly between the two datasets, ideally an ID or well-established code, like a FIPS code, state abbreviation, or ZIP code.`,(0,H.jsx)(`br`,{}),(0,H.jsxs)(`a`,{href:`https://www.placemark.io/documentation/joining-data`,className:`underline`,rel:`noreferrer`,target:`_blank`,children:[(0,H.jsx)(er,{className:`inline-block mr-1`}),`Documentation for joining data`]})]})})]})}function oM({values:e,columns:t}){switch(e.csvOptions.kind){case`geojson`:return(0,H.jsx)(aM,{kind:`GeoJSON`,columns:t});case`polyline`:return(0,H.jsx)(aM,{kind:`Polyline`,columns:t});case`wkt`:return(0,H.jsx)(aM,{kind:`WKT`,columns:t});case`lonlat`:return(0,H.jsx)(nDe,{columns:t});case`zip`:return(0,H.jsx)(rDe,{columns:t});case`h3`:return(0,H.jsx)(iDe,{columns:t});case`addresses`:return(0,H.jsx)(oDe,{columns:t,values:e});case`join`:return(0,H.jsx)(sDe,{columns:t})}}function sM({file:e,geocoder:t=!1}){let{values:n,setFieldValue:r}=Gh(),[i,a]=(0,B.useState)([]),{csvOptions:{delimiter:o},type:s}=n,c=s!==`csv`;return(0,B.useEffect)(()=>
372{if(c)return;let t=e.slice(0,512);(typeof t==`string`?Promise.resolve(t):t.text()).then(e=>{let t=Xj(o).parse(e).columns.filter(Boolean),n=$j(t);a(t),iM(r,n)}).catch(e=>void 0)},[e,o,r,c]),c?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rM,{geocoder:t}),(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-x-3 gap-y-3`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`label`,{className:`flex flex-col justify-stretch gap-y-2`,children:[(0,H.jsx)(bg,{children:`Delimiter`}),(0,H.jsxs)(rg,{name:`csvOptions.delimiter`,component:`select`,className:Ig({size:`sm`}),children:[(0,H.jsx)(`option`,{value:`none`,children:`Select…`}),pbe.map(({value:e,label:t})=>(0,H.jsx)(`option`,{value:e,children:t},e))]})]})}),(0,H.jsx)(oM,{columns:i,values:n})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(dg,{type:`checkbox`,name:`csvOptions.autoType`}),(0,H.jsx)(bg,{children:`Infer types`})]}),(0,H.jsx)(Vg,{children:`CSV files technically only contain string values. You can choose to infer number, boolean, and null values.`})]})]})}function cM(e){let{data:t}=zj({queryKey:[`xlsx`],queryFn:async()=>ye(()=>import(`./xlsx-BRA3X7js.js`),__vite__mapDeps([19,12]))});return(0,H.jsx)(cDe,{...e,xlsx:t})}function cDe({file:e,geocoder:t=!1,xlsx:n}){let{values:r,setFieldValue:i}=Gh(),[a,o]=(0,B.useState)([]),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(null),{csvOptions:{sheet:d},type:f}=r,p=f!==`xls`;if((0,B.useEffect)(()=>{p||e.arrayBuffer().then(e=>{let t=n.read(e,{type:`array`});c(t);let r=Object.keys(t.Sheets)[0];i(`csvOptions.sheet`,r),u(null)}).catch(e=>{u(`Could not parse spreadsheet`)})},[e,i,p,n]),(0,B.useEffect)(()=>{if(p||!s)return;let e=n.utils.sheet_to_json(s.Sheets[d]);if(!e[0])return;let t=Object.keys(e[0]).filter(Boolean),r=$j(t);o(t),iM(i,r)},[s,d,i,p,n]),l&&!p)return(0,H.jsx)(YT,{children:l});if(p||!s)return null;let m=Object.keys(s.Sheets);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rM,{geocoder:t}),(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-x-3 gap-y-3`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`label`,{className:`flex flex-col justify-stretch gap-y-2`,children:[(0,H.jsx)(bg,{children:`Sheet`}),(0,H.jsxs)(rg,{name:`csvOptions.sheet`,component:`select`,className:Ig({size:`sm`}),children:[(0,H.jsx)(`option`,{value:`none`,children:`Select…`}),m.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))]})]})}),(0,H.jsx)(oM,{columns:a,values:r})]})]})}var lM=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;function uM(e,t,n){let r=n[0];if(t!=null&&e>=t)throw Error(e+` >= `+t);if(e.slice(-1)===r||t&&t.slice(-1)===r)throw Error(`trailing zero`);if(t){let i=0;for(;(e[i]||r)===t[i];)i++;if(i>0)return t.slice(0,i)+uM(e.slice(i),t.slice(i),n)}let i=e?n.indexOf(e[0]):0,a=t==null?n.length:n.indexOf(t[0]);return a-i>1?n[Math.round(.5*(i+a))]:t&&t.length>1?t.slice(0,1):n[i]+uM(e.slice(1),null,n)}function dM(e){if(e.length!==fM(e[0]))throw Error(`invalid integer part of order key: `+e)}function fM(e){if(e>=`a`&&e<=`z`)return e.charCodeAt(0)-97+2;if(e>=`A`&&e<=`Z`)return 90-e.charCodeAt(0)+2;throw Error(`invalid order key head: `+e)}function pM(e){let t=fM(e[0]);if(t>e.length)throw Error(`invalid order key: `+e);return e.slice(0,t)}function mM(e,t){if(e===`A`+t[0].repeat(26))throw Error(`invalid order key: `+e);let n=pM(e);if(e.slice(n.length).slice(-1)===t[0])throw Error(`invalid order key: `+e)}function hM(e,t){dM(e);let[n,...r]=e.split(``),i=!0;for(let e=r.length-1;i&&e>=0;e--){let n=t.indexOf(r[e])+1;n===t.length?r[e]=t[0]:(r[e]=t[n],i=!1)}if(i){if(n===`Z`)return`a`+t[0];if(n===`z`)return null;let e=String.fromCharCode(n.charCodeAt(0)+1);return e>`a`?r.push(t[0]):r.pop(),e+r.join(``)}else return n+r.join(``)}function lDe(e,t){dM(e);let[n,...r]=e.split(``),i=!0;for(let e=r.length-1;i&&e>=0;e--){let n=t.indexOf(r[e])-1;n===-1?r[e]=t.slice(-1):(r[e]=t[n],i=!1)}if(i){if(n===`a`)return`Z`+t.slice(-1);if(n===`A`)return null;let e=String.fromCharCode(n.charCodeAt(0)-1);return e<`Z`?r.push(t.slice(-1)):r.pop(),e+r.join(``)}else return n+r.join(``)}function gM(e,t,n=lM){if(e!=null&&mM(e,n),t!=null&&mM(t,n),e!=null&&t!=null&&e>=t)throw Error(e+` >= `+t);if(e==null){if(t==null)return`a`+n[0];let e=pM(t),r=t.slice(e.length);if(e===`A`+n[0].repeat(26))return e+uM(``,r,n);if(e<t)return e;let i=lDe(e,n);if(i==null)throw Error(`cannot decrement any more`);return i}if(t==null){let t=pM(e),r=e.slice(t.length);return hM(t,n)??t+uM(r,null,n)}let r=pM(e),i=e.slice(r.length),a=pM(t),o=t.slice(a.length);if(r===a)return r+uM(i,o,n);let s=hM(r,n);if(s==null)throw Error(`cannot increment any more`);return s<t?s:r+uM(i,null,n)}function _M(e,t,n,r=lM){if(n===0)return[];if(n===1)return[gM(e,t,r)];if(t==null){let i=gM(e,t,r),a=[i];for(let e=0;e<n-1;e++)i=gM(i,t,r),a.push(i);return a}if(e==null){let i=gM(e,t,r),a=[i];for(let t=0;t<n-1;t++)i=gM(e,i,r),a.push(i);return a.reverse(),a}let i=Math.floor(n/2),a=gM(e,t,r);return[..._M(e,a,i,r),a,..._M(a,t,n-i-1,r)]}function vM({result:e,file:t,track:n,existingFolderId:r}){let i=VC(),a=r?[]:[{name:t?.name||`Imported file`,visibility:!0,id:i,expanded:!0,locked:!1,folderId:null}];switch(e.type){case`geojson`:{let{features:o}=e.geojson,s=_M(null,null,o.length);return{note:`Imported ${t?.name?t.name:`a file`}`,track:n,putFolders:a,putFeatures:e.geojson.features.map((e,t)=>({at:s[t],folderId:r||i,id:VC(),feature:e}))}}case`root`:return yM(e.root,[],[],null)}}function yM(e,t,n,r){let i=_M(null,null,e.children.length);for(let a=0;a<e.children.length;a++){let o=e.children[a];switch(o.type){case`Feature`:t.push({at:i[a],folderId:r,id:VC(),feature:o});break;case`folder`:{let e=VC();n.push({at:i[a],folderId:r,id:e,expanded:o.meta.visibility!==`0`,locked:!1,visibility:!0,name:o.meta.name||`Folder`}),yM(o,t,n,e);break}}}return{note:`Imported a file`,putFolders:n,putFeatures:t}}function bM(){let e=i_().useTransact();return(0,B.useCallback)(async(t,n,r,i=`Imported text`,a)=>(await bbe(t,n,$g(r))).map(async t=>(await e(vM({result:t,file:{name:i},track:[`import-string`,{format:`geojson`}],existingFolderId:a})),t)).mapLeft(e=>(console.error(e),e)),[e])}function uDe({featureMap:e},t){let n=new Map,r=0;for(let i of e.values()){let e=i.feature.properties?.[t];if(e!==void 0){let t=String(e),r=n.get(t);
372r?n.set(t,[i].concat(r)):n.set(t,[i])}else r++}return{targetMap:n,sourceMissingFieldCount:r}}function dDe(e,t,n,r){let i={...ay(`Joined data`),track:`import-data-join`};for(let a of e){let e=a.properties?.[n];if(e===void 0)continue;let o=t.get(String(e));if(!o){r.notes.push(`No feature on the map found for ${dv(n)} = "${dv(String(e))}"`);continue}for(let e of o)i.putFeatures.push({...e,feature:{...e.feature,properties:{...e.feature.properties||{},...a.properties||{}}}})}return i}function fDe(){return ny((0,B.useCallback)((e,t,{options:n,geojson:r,result:i})=>{let{features:a}=r,{joinTargetHeader:o,joinSourceHeader:s}=n.csvOptions,{targetMap:c,sourceMissingFieldCount:l}=uDe(e(Wx),o);return l>0&&i.notes.push(`${mv(`feature`,l)} in existing map data missing the join column.`),dDe(a,c,s,i)},[]))}function xM(){let e=i_(),t=Xv(rS),n=e.useTransact(),r=fDe();return(0,B.useCallback)(async(e,i,a)=>{let o=await e.arrayBuffer();return(await r_.fileToGeoJSON(Qg(o,[o]),i,$g(a))).bimap(e=>e,async a=>{if(i.csvOptions.kind===`join`&&(i.type===`csv`||i.type===`xls`)&&a.type===`geojson`){let{geojson:e}=a,t=r({options:i,geojson:e,result:a});return await n(t),a}else{let r=xbe(i);e.handle&&r&&t({handle:e.handle,options:r});let o=vM({result:a,file:e,track:[`import`,{format:i.type}]});return await n(o),a}})},[t,n,r])}function pDe(){let e=i_().useTransact();return(0,B.useCallback)(async(t,n)=>(await sbe.forwardLoose(t,n)).map(async n=>(await e(vM({result:n,file:t.files.shp,track:[`import`,{format:`shapefile`}]})),n)),[e])}var mDe={type:`geojson`,toast:!0,secondary:!1,...GT};function SM({file:e}){let{setValues:t}=Gh();return(0,B.useEffect)(()=>{ybe(e).then(e=>t(t=>({...t,...e.orDefault(mDe)}))).catch(e=>void 0)},[e,t]),null}function hDe(e){switch(e.type){case`file`:return e.file.size;case`shapefile`:return(e.files.shp?.size||0)+(e.files.dbf?.size||0)}}function CM({file:e,children:t}){let[n]=i_().useMetadata(),r=hDe(e),i=r>1/0?`block`:r>1/0?`warn`:`ok`;if(n.type===`memory`)return(0,H.jsx)(`div`,{children:t});switch(i){case`ok`:return(0,H.jsx)(`div`,{children:t});case`warn`:return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`pt-4 pb-2`,children:(0,H.jsxs)(Vg,{children:[`This file exceeds the soft limit of `,D,`MB. You may notice decreased performance.`]})}),t]});case`block`:return(0,H.jsx)(`div`,{className:`pt-4`,children:(0,H.jsxs)(Vg,{variant:`destructive`,children:[`This file exceeds the hard limit of `,z,`MB and can’t be imported.`]})})}}var gDe=(0,Tm.default)(jte)(`relative h-2 rounded-full overflow-hidden bg-gray-100`),_De=(0,Tm.default)(Mte)(`bg-purple-500 h-2 w-100 transition-transform`);function wM({progress:e}){return e?(0,H.jsxs)(`div`,{className:`pt-4`,children:[(0,H.jsx)(gDe,{value:e.done,max:e.total,children:(0,H.jsx)(_De,{style:{transform:`translateX(-${~~((1-e.done/e.total)*100)}%)`}})}),(0,H.jsxs)(`div`,{className:`text-center text-xs pt-2`,children:[e.done,` / `,e.total]})]}):null}function vDe(){return(0,H.jsxs)(Di,{children:[(0,H.jsx)(Oi,{asChild:!0,children:(0,H.jsx)(Fg,{size:`xs`,children:`Advanced options`})}),(0,H.jsx)(ki,{className:`space-y-2 pl-2 pt-4`,children:(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`label`,{className:`flex items-center`,children:[(0,H.jsx)(dg,{type:`checkbox`,name:`removeCoincidents`}),(0,H.jsx)(`div`,{className:`pl-2 text-sm`,children:`Remove coincident vertices`})]}),(0,H.jsx)(Vg,{children:`Removes consecutive vertices with the same coordinate values that can be generated by other tools.`})]})})]})}function yDe({onNext:e,hasNext:t,onClose:n,secondary:r,file:i}){let{file:a}=i,o=xM(),[s,c]=(0,B.useState)(null);return(0,H.jsx)(eg,{onSubmit:async function(n,r){try{n={...n,toast:!t},(await o(a,n,e=>{c(e)})).caseOf({Left(e){c(null),r.setErrors({type:e.message})},Right:async t=>e(await t)})}catch(e){r.setErrors({type:e.message})}},initialValues:{...GT,type:`geojson`,text:``,toast:!0,secondary:!1},children:(0,H.jsxs)(ig,{children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(ZT,{}),(0,H.jsx)(KA,{}),(0,H.jsx)(sM,{file:a,geocoder:!0}),(0,H.jsx)(vDe,{}),(0,H.jsx)(cM,{file:a,geocoder:!0})]}),(0,H.jsx)(CM,{file:i,children:(0,H.jsx)(Ug,{secondary:r,onClose:n,action:`Import`})}),(0,H.jsx)(wM,{progress:s})]}),(0,H.jsx)(SM,{file:a})]})})}function bDe({file:e}){let t=[];return e.files.dbf||t.push((0,H.jsx)(`li`,{children:`Missing DBF file: imported data will not include attributes.`},`missing-dbf`)),e.files.prj||t.push((0,H.jsx)(`li`,{children:`Missing PRJ file: imported geometry is assumed to be in EPSG:4326.`},`missing-prj`)),t.length?(0,H.jsx)(`div`,{className:`pt-4`,children:(0,H.jsx)(Vg,{variant:`destructive`,children:(0,H.jsx)(`ul`,{children:t})})}):null}function xDe({onNext:e,hasNext:t,onClose:n,secondary:r,file:i}){let a=pDe();return(0,H.jsx)(eg,{onSubmit:async function(n,r){try{n={...n,toast:!t},(await a(i,n)).caseOf({Left(e){r.setErrors({type:e.message})},Right:async t=>e(await t)})}catch(e){r.setErrors({type:e.message})}},initialValues:{...GT,type:`shapefile`,toast:!0,secondary:!1},children:(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`space-y-4`,children:(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`font-bold`,children:`Shapefile components`}
372),Object.values(i.files).filter(Boolean).map((e,t)=>(0,H.jsx)(`div`,{className:`text-sm`,children:e.name},t))]})}),(0,H.jsx)(bDe,{file:i}),(0,H.jsx)(sg,{name:`type`,component:YT}),(0,H.jsx)(CM,{file:i,children:(0,H.jsx)(Ug,{secondary:r,onClose:n,action:`Import`})})]})})})}function TM(e,t=[]){for(let n of e.children)switch(n.type){case`Feature`:t.push(n);break;case`folder`:TM(n,t);break}return t}function EM(e){switch(e.type){case`geojson`:return e.geojson;case`root`:return{type:`FeatureCollection`,features:TM(e.root)}}}function SDe({modal:e,onClose:t}){let{files:n}=e,r=(0,B.useContext)(kS),[i,a]=(0,B.useState)(0),[o,s]=(0,B.useState)(de),c=n[i],l=n.length>1?`(${i}/${n.length})`:``,u=i<n.length-1,d={hasNext:u,onClose:t,onNext:e=>{let n=o;if(e&&(n=Vfe(tC(EM(e)),o)),u)s(n),a(e=>e+1);else return n.map(e=>{r?.map.fitBounds(e,{padding:100})}),e&&mEe(e),t()},secondary:u?{action:`Skip`,onClick:()=>{d.onNext(null)}}:void 0};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Import ${dv(c.type===`file`?c.file.name:`Shapefile`)} ${l}`,titleIcon:Xn}),c.type===`file`?(0,H.jsx)(yDe,{...d,file:c}):(0,H.jsx)(xDe,{...d,file:c})]})}var CDe=a(o());function wDe(e){let t=e.split(`.`)[0].replace(/^ne_(\d+)m_/,``);return t=t.toLowerCase().replace(/[_-]+/g,` `).replace(/\s{2,}/g,` `).trim(),t=t.charAt(0).toUpperCase()+t.slice(1),t}function TDe({onClose:e}){let t=bM(),{data:n}=zj({queryKey:[`import-examples`],queryFn:()=>fetch(`https://data-library.placemark.io/`).then(e=>e.json()).then(e=>CDe.parse(e))});return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Data library`,titleIcon:yt}),(0,H.jsx)(Vg,{children:`The data library includes commonly-used datasets ready to add to your map.`}),(0,H.jsx)(`div`,{className:`overflow-y-auto placemark-scrollbar max-h-48 mt-4 border border-gray-200 dark:border-gray-700 rounded-sm`,children:(0,H.jsx)(`div`,{className:`grid gap-1 p-1`,children:n?.map(n=>{let r=wDe(n);return(0,H.jsxs)(`button`,{type:`button`,className:`text-left text-sm group rounded-sm hover:bg-gray-200 dark:hover:bg-gray-700 p-1`,onClick:async()=>{await pE.promise(fetch(`https://data-library.placemark.io/${n}`).then(e=>e.text()).then(e=>t(e,{...GT,type:`geojson`},()=>{},r)),{loading:`Loading…`,success:`Loaded`,error:`Error loading from the data library`}),e()},children:[(0,H.jsx)(Yt,{className:`inline-flex mr-2`}),r]},n)})})}),(0,H.jsx)(`div`,{className:`h-3`}),(0,H.jsxs)(Vg,{size:`xs`,children:[`Some data from`,` `,(0,H.jsx)(`a`,{className:Tg,href:`https://naturalearthdata.com/`,children:`naturalearthdata.com`}),`.`]})]})}function EDe({modal:e,onClose:t}){let{result:{notes:n}}=e;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`${mv(`issue`,n.length)} detected on import`,titleIcon:$t}),(0,H.jsx)(`div`,{className:`max-h-48 overflow-y-auto text-sm`,children:n.map((e,t)=>(0,H.jsx)(`div`,{children:e},t))}),(0,H.jsx)(`div`,{className:`pt-6 pb-1 flex flex-col sm:flex-row-reverse space-y-2 sm:space-y-0 sm:gap-x-3`,children:(0,H.jsx)(Fg,{type:`button`,onClick:t,children:`Done`})})]})}function DDe({modal:e,onClose:t}){let n=bM(),[r,i]=(0,B.useState)(null);async function a(e,r){try{let{text:a,...o}=e;(await n(a,o,$g(e=>{i(e)}))).caseOf({Left(e){r.setErrors({type:e.message})},Right(){t()}})}catch(e){r.setErrors({type:e.message})}}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Import text`,titleIcon:yt}),(0,H.jsx)(eg,{onSubmit:a,initialValues:{...GT,type:`geojson`,text:e.initialValue||``,toast:!0},children:({values:e})=>(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(yse,{"aria-label":`Data`,as:`textarea`,name:`text`,autoFocus:!0}),(0,H.jsx)(ZT,{textOnly:!0}),(0,H.jsx)(KA,{}),(0,H.jsx)(sM,{file:e.text,geocoder:!0})]})}),(0,H.jsx)(Ug,{onClose:t,action:`Import`}),(0,H.jsx)(wM,{progress:r})]})})})]})}var DM=(0,B.forwardRef)(({name:e,label:t,_size:n=`sm`,outerProps:r,...i},a)=>{let[o]=ese(e),{isSubmitting:s}=Gh();return(0,H.jsxs)(`div`,{className:`pb-2 space-y-2`,...r,children:[(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`div`,{className:`pb-1`,children:(0,H.jsx)(bg,{size:n,children:t})}),(0,H.jsx)(zg,{spellCheck:`false`,autoCapitalize:`false`,disabled:s,_size:n,...o,...i,ref:a})]}),(0,H.jsx)(sg,{name:e,component:YT})]})}),OM=5;function ODe({onClose:e}){let[t,n]=(0,B.useState)(null),r=Xv(Ux);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Import from URL`,titleIcon:mn}),(0,H.jsx)(eg,{onSubmit:async function({url:e}){try{let t=await fetch(e),i=await t.arrayBuffer();if(i.byteLength>1e6*OM){n(`Files over ${OM}MB are not supported for URL input.`);return}r({type:`import`,files:[{type:`file`,file:new File([i],e.split(`/`).pop()||``,{type:t.headers.get(`Content-Type`)||``})}]})}catch{n(`Could not load data from that URL.`)}},initialValues:{url:``},children:(0,H.jsxs)(ig,{children:[(0,H.jsx)(DM,{type:`url`,label:`U
372RL`,name:`url`}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[t&&(0,H.jsx)(YT,{children:t}),(0,H.jsxs)(Vg,{children:[`Load data from a URL. URLs must be public and need to support`,` `,(0,H.jsx)(`a`,{className:Tg,href:`https://enable-cors.org/`,target:`_blank`,rel:`noreferrer`,children:`CORS`}),`.`]}),(0,H.jsxs)(Vg,{children:[`You can use `,(0,H.jsx)(`code`,{children:`?load=URL`}),` to skip this dialog.`]})]}),(0,H.jsx)(Ug,{onClose:e,action:`Load`})]})})]})}var kM=typeof document<`u`?B.useLayoutEffect:()=>{},AM=e=>e?.ownerDocument??document,jM=e=>e&&`window`in e&&e.window===e?e:AM(e).defaultView||window;function kDe(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function ADe(e){return kDe(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}var jDe=!1;function MM(){return jDe}function NM(e,t){if(!MM())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName===`SLOT`&&n.assignedSlot?n.assignedSlot.parentNode:ADe(n)?n.host:n.parentNode}return!1}var PM=(e=document)=>{if(!MM())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function FM(e){return MM()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function MDe(e){if(NDe())e.focus({preventScroll:!0});else{let t=PDe(e);e.focus(),FDe(t)}}var IM=null;function NDe(){if(IM==null){IM=!1;try{document.createElement(`div`).focus({get preventScroll(){return IM=!0,!0}})}catch{}}return IM}function PDe(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function FDe(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function LM(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function RM(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function zM(e){let t=null;return()=>(t??=e(),t)}var BM=zM(function(){return RM(/^Mac/i)}),IDe=zM(function(){return RM(/^iPhone/i)}),VM=zM(function(){return RM(/^iPad/i)||BM()&&navigator.maxTouchPoints>1}),HM=zM(function(){return IDe()||VM()}
372),LDe=zM(function(){return LM(/AppleWebKit/i)&&!RDe()}),RDe=zM(function(){return LM(/Chrome/i)}),zDe=zM(function(){return LM(/Android/i)}),BDe=zM(function(){return LM(/Firefox/i)});function UM(e,t,n=!0){var r;let{metaKey:i,ctrlKey:a,altKey:o,shiftKey:s}=t;BDe()&&(r=window.event)!=null&&r.type?.startsWith(`key`)&&e.target===`_blank`&&(BM()?i=!0:a=!0);let c=LDe()&&BM()&&!VM()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:i,ctrlKey:a,altKey:o,shiftKey:s}):new MouseEvent(`click`,{metaKey:i,ctrlKey:a,altKey:o,shiftKey:s,detail:1,bubbles:!0,cancelable:!0});UM.isOpening=n,MDe(e),e.dispatchEvent(c),UM.isOpening=!1}UM.isOpening=!1;var WM=new Map,GM=new Set;function KM(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{if(!e(t)||!t.target)return;let r=WM.get(t.target);r||(r=new Set,WM.set(t.target,r),t.target.addEventListener(`transitioncancel`,n,{once:!0})),r.add(t.propertyName)},n=t=>{if(!e(t)||!t.target)return;let r=WM.get(t.target);if(r&&(r.delete(t.propertyName),r.size===0&&(t.target.removeEventListener(`transitioncancel`,n),WM.delete(t.target)),WM.size===0)){for(let e of GM)e();GM.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,KM):KM());function VDe(){for(let[e]of WM)`isConnected`in e&&!e.isConnected&&WM.delete(e)}function HDe(e){requestAnimationFrame(()=>{VDe(),WM.size===0?e():GM.add(e)})}function qM(){let e=(0,B.useRef)(new Map),t=(0,B.useCallback)((t,n,r,i)=>{let a=i?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:a,options:i}),t.addEventListener(n,a,i)},[]),n=(0,B.useCallback)((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=(0,B.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,B.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}var UDe=B.useInsertionEffect??kM;function JM(e){let t=(0,B.useRef)(null);return UDe(()=>{t.current=e},[e]),(0,B.useCallback)((...e)=>{let n=t.current;return n?.(...e)},[])}function WDe(e){return e.pointerType===``&&e.isTrusted?!0:zDe()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function YM(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function GDe(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function XM(e){let t=(0,B.useRef)({isFocused:!1,observer:null});return kM(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),(0,B.useCallback)(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=n.target;r.addEventListener(`focusout`,n=>{if(t.current.isFocused=!1,r.disabled){let t=YM(n);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var e;(e=t.current.observer)==null||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:n})),r.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:n}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:[`disabled`]})}},[e])}var ZM=`default`,QM=``,$M=new WeakMap;function KDe(e){if(HM()){if(ZM==="default"){let t=AM(e);QM=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}ZM=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;$M.set(e,e.style[t]),e.style[t]=`none`}}function qDe(e){if(HM()){if(ZM!==`disabled`)return;ZM=`restoring`,setTimeout(()=>{HDe(()=>{if(ZM===`restoring`){let t=AM(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=QM||``),QM=``,ZM=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&$M.has(e)){let t=$M.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),$M.delete(e)}}var eN=null,tN=new Set,nN=new Map,rN=!1,iN=!1,JDe={Tab:!0,Escape:!0};function aN(e,t){for(let n of tN)n(e,t)}function YDe(e){return!(e.metaKey||!BM()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function oN(e){rN=!0,!UM.isOpening&&YDe(e)&&(eN=`keyboard`,aN(`keyboard`,e))}function sN(e){eN=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(rN=!0,aN(`pointer`,e))}function cN(e){!UM.isOpening&&WDe(e)&&(rN=!0,eN=`virtual`)}function lN(e){e.target===window||e.target===document||!e.isTrusted||(!rN&&!iN&&(eN=`virtual`,aN(`virtual`,e)),rN=!1,iN=!1)}function uN(){rN=!1,iN=!0}function dN(e){if(typeof window>`u`||typeof document>`u`||nN.get(jM(e)))return;
372let t=jM(e),n=AM(e),r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){rN=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,oN,!0),n.addEventListener(`keyup`,oN,!0),n.addEventListener(`click`,cN,!0),t.addEventListener(`focus`,lN,!0),t.addEventListener(`blur`,uN,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,sN,!0),n.addEventListener(`pointermove`,sN,!0),n.addEventListener(`pointerup`,sN,!0)),t.addEventListener(`beforeunload`,()=>{fN(e)},{once:!0}),nN.set(t,{focus:r})}var fN=(e,t)=>{let n=jM(e),r=AM(e);t&&r.removeEventListener(`DOMContentLoaded`,t),nN.has(n)&&(n.HTMLElement.prototype.focus=nN.get(n).focus,r.removeEventListener(`keydown`,oN,!0),r.removeEventListener(`keyup`,oN,!0),r.removeEventListener(`click`,cN,!0),n.removeEventListener(`focus`,lN,!0),n.removeEventListener(`blur`,uN,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,sN,!0),r.removeEventListener(`pointermove`,sN,!0),r.removeEventListener(`pointerup`,sN,!0)),nN.delete(n))};function XDe(e){let t=AM(e),n;return t.readyState===`loading`?(n=()=>{dN(e)},t.addEventListener(`DOMContentLoaded`,n)):dN(e),()=>fN(e,n)}typeof document<`u`&&XDe();function pN(){return eN!==`pointer`}var ZDe=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function QDe(e,t,n){let r=AM(n?.target),i=typeof window<`u`?jM(n?.target).HTMLInputElement:HTMLInputElement,a=typeof window<`u`?jM(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<`u`?jM(n?.target).HTMLElement:HTMLElement,s=typeof window<`u`?jM(n?.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof i&&!ZDe.has(r.activeElement.type)||r.activeElement instanceof a||r.activeElement instanceof o&&r.activeElement.isContentEditable,!(e&&t===`keyboard`&&n instanceof s&&!JDe[n.key])}function $De(e,t,n){dN(),(0,B.useEffect)(()=>{let t=(t,r)=>{QDe(!!n?.isTextInput,t,r)&&e(pN())};return tN.add(t),()=>{tN.delete(t)}},t)}function eOe(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=(0,B.useCallback)(e=>{if(e.target===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),o=XM(a),s=(0,B.useCallback)(e=>{let t=AM(e.target),r=t?PM(t):PM();e.target===e.currentTarget&&r===FM(e.nativeEvent)&&(n&&n(e),i&&i(!0),o(e))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?s:void 0,onBlur:!t&&(r||i)?a:void 0}}}function tOe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=(0,B.useRef)({isFocusWithin:!1}),{addGlobalListener:o,removeAllGlobalListeners:s}=qM(),c=(0,B.useCallback)(e=>{e.currentTarget.contains(e.target)&&a.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(a.current.isFocusWithin=!1,s(),n&&n(e),i&&i(!1))},[n,i,a,s]),l=XM(c),u=(0,B.useCallback)(e=>{if(!e.currentTarget.contains(e.target))return;let t=AM(e.target),n=PM(t);if(!a.current.isFocusWithin&&n===FM(e.nativeEvent)){r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,l(e);let n=e.currentTarget;o(t,`focus`,e=>{if(a.current.isFocusWithin&&!NM(n,e.target)){let r=new t.defaultView.FocusEvent(`blur`,{relatedTarget:e.target});GDe(r,n);let i=YM(r);c(i)}},{capture:!0})}},[r,i,l,o,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:c}}}var mN=!1,hN=0;function nOe(){mN=!0,setTimeout(()=>{mN=!1},50)}function gN(e){e.pointerType===`touch`&&nOe()}function rOe(){if(!(typeof document>`u`))return hN===0&&typeof PointerEvent<`u`&&document.addEventListener(`pointerup`,gN),hN++,()=>{hN--,!(hN>0)&&typeof PointerEvent<`u`&&document.removeEventListener(`pointerup`,gN)}}function _N(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,o]=(0,B.useState)(!1),s=(0,B.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;(0,B.useEffect)(rOe,[]);let{addGlobalListener:c,removeAllGlobalListeners:l}=qM(),{hoverProps:u,triggerHoverEnd:d}=(0,B.useMemo)(()=>{let e=(e,r)=>{if(s.pointerType=r,i||r===`touch`||s.isHovered||!e.currentTarget.contains(e.target))return;s.isHovered=!0;let l=e.currentTarget;s.target=l,c(AM(e.target),`pointerover`,e=>{s.isHovered&&s.target&&!NM(s.target,e.target)&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:l,pointerType:r}),n&&n(!0),o(!0)},a=(e,t)=>{let i=s.target;s.pointerType=``,s.target=null,!(t===`touch`||!s.isHovered||!i)&&(s.isHovered=!1,l(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),o(!1))},u={};return typeof PointerEvent<`u`&&(u.onPointerEnter=t=>{mN&&t.pointerType===`mouse`||e(t,t.pointerType)},u.onPointerLeave=e=>{!i&&e.currentTarget.contains(e.target)&&a(e,e.pointerType)}),{hoverProps:u,triggerHoverEnd:a}},[t,n,r,i,s,c,l]);return(0,B.useEffect)(()=>{i&&d({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:u,isHovered:a}}function vN(e){let{onMoveStart:t,onMove:n,onMoveEnd:r}=e,i=(0,B.useRef)({didMove:!1,lastPosition:null,id:null}),{addGlobalListener:a,removeGlobalListener:o}=qM(),s=(0,B.useCallback)((e,r,a,o)=>{a===0&&o===0||(i.current.didMove||(i.current.didMove=!0,t?.({type:`movestart`,pointerType:r,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})),n?.({type:`move`,pointerType:r,deltaX:a,deltaY:o,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey}))},[t,n,i]),c=JM(s),l=(0,B.useCallback)((e,t)=>{qDe(),i.current.didMove&&r?.({type:`moveend`,pointerType:t,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},[r,i]),u=JM(l),[d,f]=(0,B.useState)(null);return kM(()=>
372{if(d===`pointer`){let e=e=>{if(e.pointerId===i.current.id){let t=e.pointerType||`mouse`;c(e,t,e.pageX-(i.current.lastPosition?.pageX??0),e.pageY-(i.current.lastPosition?.pageY??0)),i.current.lastPosition={pageX:e.pageX,pageY:e.pageY}}},t=n=>{if(n.pointerId===i.current.id){let r=n.pointerType||`mouse`;u(n,r),i.current.id=null,o(window,`pointermove`,e,!1),o(window,`pointerup`,t,!1),o(window,`pointercancel`,t,!1),f(null)}};return a(window,`pointermove`,e,!1),a(window,`pointerup`,t,!1),a(window,`pointercancel`,t,!1),()=>{o(window,`pointermove`,e,!1),o(window,`pointerup`,t,!1),o(window,`pointercancel`,t,!1)}}},[d,a,o]),{moveProps:(0,B.useMemo)(()=>{let e={},t=()=>{KDe(),i.current.didMove=!1};e.onPointerDown=e=>{e.button===0&&i.current.id==null&&(t(),e.stopPropagation(),e.preventDefault(),i.current.lastPosition={pageX:e.pageX,pageY:e.pageY},i.current.id=e.pointerId,f(`pointer`))};let n=(e,n,r)=>{t(),s(e,`keyboard`,n,r),l(e,`keyboard`)};return e.onKeyDown=e=>{switch(e.key){case`Left`:case`ArrowLeft`:e.preventDefault(),e.stopPropagation(),n(e,-1,0);break;case`Right`:case`ArrowRight`:e.preventDefault(),e.stopPropagation(),n(e,1,0);break;case`Up`:case`ArrowUp`:e.preventDefault(),e.stopPropagation(),n(e,0,-1);break;case`Down`:case`ArrowDown`:e.preventDefault(),e.stopPropagation(),n(e,0,1);break}},e},[i,s,l])}}function yN(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=(0,B.useRef)({isFocused:!1,isFocusVisible:t||pN()}),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(()=>i.current.isFocused&&i.current.isFocusVisible),l=(0,B.useCallback)(()=>
372c(i.current.isFocused&&i.current.isFocusVisible),[]),u=(0,B.useCallback)(e=>{i.current.isFocused=e,o(e),l()},[l]);$De(e=>{i.current.isFocusVisible=e,l()},[],{isTextInput:n});let{focusProps:d}=eOe({isDisabled:r,onFocusChange:u}),{focusWithinProps:f}=tOe({isDisabled:!r,onFocusWithinChange:u});return{isFocused:a,isFocusVisible:s,focusProps:r?f:d}}var iOe=Object.defineProperty,aOe=(e,t,n)=>t in e?iOe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bN=(e,t,n)=>(aOe(e,typeof t==`symbol`?t:t+``,n),n),xN=new class{constructor(){bN(this,`current`,this.detect()),bN(this,`handoffState`,`pending`),bN(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}};function SN(e){return xN.isServer?null:e==null?document:e?.ownerDocument??document}function oOe(e){return xN.isServer?null:e==null?document:(e?.getRootNode)?.call(e)??document}function sOe(e){return oOe(e)?.activeElement??null}function CN(e){return sOe(e)===e}function wN(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function TN(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return wN(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=TN();return e(t),this.add(()=>t.dispose())},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function EN(){let[e]=(0,B.useState)(TN);return(0,B.useEffect)(()=>()=>e.dispose(),[e]),e}var DN=(e,t)=>{xN.isServer?(0,B.useEffect)(e,t):(0,B.useLayoutEffect)(e,t)};function ON(e){let t=(0,B.useRef)(e);return DN(()=>{t.current=e},[e]),t}var kN=function(e){let t=ON(e);return B.useCallback((...e)=>t.current(...e),[t])};function cOe(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function lOe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function uOe({disabled:e=!1}={}){let t=(0,B.useRef)(null),[n,r]=(0,B.useState)(!1),i=EN(),a=kN(()=>{t.current=null,r(!1),i.dispose()}),o=kN(e=>{if(i.dispose(),t.current===null){t.current=e.currentTarget,r(!0);{let n=SN(e.currentTarget);i.addEventListener(n,`pointerup`,a,!1),i.addEventListener(n,`pointermove`,e=>{if(t.current){let n=cOe(e);r(lOe(n,t.current.getBoundingClientRect()))}},!1),i.addEventListener(n,`pointercancel`,a,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:o,onPointerUp:a,onClick:a}}}function AN(e){return(0,B.useMemo)(()=>e,Object.values(e))}var dOe=(0,B.createContext)(void 0);function jN(){return(0,B.useContext)(dOe)}function MN(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}function NN(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,NN),r}var PN=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(PN||{}),fOe=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(fOe||{});function FN(){let e=mOe();return(0,B.useCallback)(t=>pOe({mergeRefs:e,...t}),[e])}function pOe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=hOe;let c=LN(t,e);if(a)return IN(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return IN(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return NN(+!e,{0(){return null},1(){return IN({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return IN(c,n,r,o,s)}function IN(e,t={},n,r,i){let{as:a=n,children:o,refName:s=`ref`,...c}=VN(e,[`unmount`,`static`]),l=e.ref===void 0?{}:{[s]:e.ref},u=typeof o==`function`?o(t):o;`className`in c&&c.className&&typeof c.className==`function`&&(c.className=c.className(t)),c[`aria-labelledby`]&&c[`aria-labelledby`]===c.id&&(c[`aria-labelledby`]=void 0);let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){d[`data-headlessui-state`]=n.join(` `);for(let e of n)d[`data-${e}`]=``}}if(HN(a)&&(Object.keys(BN(c)).length>0||Object.keys(BN(d)).length>0))if(!(0,B.isValidElement)(u)||Array.isArray(u)&&u.length>1||_Oe(u)){if(Object.keys(BN(c)).length>0)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(BN(c)).concat(Object.keys(BN(d))).map(e=>`  - ${e}`).join(`
373`),``,`You can apply a few solutions:`,['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',`Render a single element as the child so that we can forward the props onto that element.`].map(e=>`  - ${e}`).join(`
374`)].join(`
375`))}else{let e=u.props?.className,t=typeof e==`function`?(...t)=>MN(e(...t),c.className):MN(e,c.className),n=t?{className:t}:{},r=LN(u.props,BN(VN(c,[`ref`])));for(let e in d)e in r&&delete d[e];return(0,B.cloneElement)(u,Object.assign({},r,d,l,{ref:i(gOe(u),l.ref)},n))}return(0,B.createElement)(a,Object.assign({},VN(c,[`ref`]),!HN(a)&&l,!HN(a)&&d),u)}function mOe(){let e=(0,B.useRef)([]),t=(0,B.useCallback)(t=>{for(let n of e.current)n!=null&&(typeof n==`function`?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>e==null))return e.current=n,t}}function hOe(...e){return e.every(e=>e==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n==`function`?n(t):n.current=t)}}function LN(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>(e?.preventDefault)?.call(e)]);for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function RN(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)e?.(...t)}});return t}function zN(e){return Object.assign((0,B.forwardRef)(e),{displayName:e.displayName??e.name})}function BN(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function VN(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function gOe(e){return`19.2.3`.split(`.`)[0]>=`19`?e.props.ref:e.ref}function HN(e){return e===B.Fragment||e===Symbol.for(`react.fragment`)}function _Oe(e){return HN(e.type)}function vOe(e,t,n){let[r,i]=(0,B.useState)(n),a=e!==void 0,o=(0,B.useRef)(a),s=(0,B.useRef)(!1),c=(0,B.useRef)(!1);return a&&!o.current&&!s.current?(s.current=!0,o.current=a,console.error(`A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.`)):!a&&o.current&&!c.current&&(c.current=!0,o.current=a,console.error(`A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.`)),[a?e:r,kN(e=>(a||(0,Wr.flushSync)(()=>i(e)),t?.(e)))]}function yOe(e){let[t]=(0,B.useState)(e);return t}function UN(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))GN(n,WN(t,r),i);return n}function WN(e,t){return e?e+`[`+t+`]`:t}function GN(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())GN(e,WN(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n==`boolean`?e.push([t,n?`1`:`0`]):typeof n==`string`?e.push([t,n]):typeof n==`
375number`?e.push([t,`${n}`]):n==null?e.push([t,``]):bOe(n)&&!(0,B.isValidElement)(n)&&UN(n,t,e)}function bOe(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var xOe=`span`,KN=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(KN||{});function SOe(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4?!0:void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return FN()({ourProps:i,theirProps:r,slot:{},defaultTag:xOe,name:`Hidden`})}var qN=zN(SOe),COe=(0,B.createContext)(null);function wOe({children:e}){let t=(0,B.useContext)(COe);if(!t)return B.createElement(B.Fragment,null,e);let{target:n}=t;return n?(0,Wr.createPortal)(B.createElement(B.Fragment,null,e),n):null}function TOe({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[a,o]=(0,B.useState)(null),s=EN();return(0,B.useEffect)(()=>{if(r&&a)return s.addEventListener(a,`reset`,r)},[a,t,r]),B.createElement(wOe,null,B.createElement(EOe,{setForm:o,formId:t}),UN(e).map(([e,r])=>B.createElement(qN,{features:KN.Hidden,...BN({key:e,as:`input`,type:`hidden`,hidden:!0,readOnly:!0,form:t,disabled:n,name:e,value:r,...i})})))}function EOe({setForm:e,formId:t}){return(0,B.useEffect)(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:B.createElement(qN,{features:KN.Hidden,as:`input`,type:`hidden`,hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let n=t.closest(`form`);n&&e(n)}})}var DOe=(0,B.createContext)(void 0);function JN(){return(0,B.useContext)(DOe)}function YN(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function XN(e){return YN(e)&&`tagName`in e}function ZN(e){return XN(e)&&`accessKey`in e}function QN(e){return XN(e)&&`tabIndex`in e}function OOe(e){return XN(e)&&`style`in e}function kOe(e){return ZN(e)&&e.nodeName===`IFRAME`}function $N(e){return ZN(e)&&e.nodeName===`INPUT`}function eP(e){return ZN(e)&&e.nodeName===`LABEL`}function AOe(e){return ZN(e)&&e.nodeName===`FIELDSET`}function tP(e){return ZN(e)&&e.nodeName===`LEGEND`}function jOe(e){return XN(e)?e.matches(`a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]`):!1}function nP(e){let t=e.parentElement,n=null;for(;t&&!AOe(t);)tP(t)&&(n=t),t=t.parentElement;let r=t?.getAttribute(`disabled`)===``;return r&&MOe(n)?!1:r}function MOe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(tP(t))return!1;t=t.previousElementSibling}return!0}var rP=Symbol();function NOe(e,t=!0){return Object.assign(e,{[rP]:t})}function iP(...e){let t=(0,B.useRef)(e);(0,B.useEffect)(()=>{t.current=e},[e]);let n=kN(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[rP])?void 0:n}var aP=(0,B.createContext)(null);aP.displayName=`DescriptionContext`;function oP(){let e=(0,B.useContext)(aP);if(e===null){let e=Error(`You used a <Description /> component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,oP),e}return e}function POe(){return(0,B.useContext)(aP)?.value??void 0}var FOe=`p`;function IOe(e,t){let n=(0,B.useId)(),r=jN(),{id:i=`headlessui-description-${n}`,...a}=e,o=oP(),s=iP(t);DN(()=>o.register(i),[i,o.register]);let c=AN({...o.slot,disabled:r||!1}),l={ref:s,...o.props,id:i};return FN()({ourProps:l,theirProps:a,slot:c,defaultTag:FOe,name:o.name||`Description`})}var LOe=zN(IOe);Object.assign(LOe,{});var sP=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(sP||{}),cP=(0,B.createContext)(null);cP.displayName=`LabelContext`;function lP(){let e=(0,B.useContext)(cP);if(e===null){let e=Error(`You used a <Label /> component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,lP),e}return e}function uP(e){let t=(0,B.useContext)(cP)?.value??void 0;return(e?.length??0)>
3750?[t,...e].filter(Boolean).join(` `):t}function ROe({inherit:e=!1}={}){let t=uP(),[n,r]=(0,B.useState)([]),i=e?[t,...n].filter(Boolean):n;return[i.length>0?i.join(` `):void 0,(0,B.useMemo)(()=>function(e){let t=kN(e=>(r(t=>[...t,e]),()=>r(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),n=(0,B.useMemo)(()=>({register:t,slot:e.slot,name:e.name,props:e.props,value:e.value}),[t,e.slot,e.name,e.props,e.value]);return B.createElement(cP.Provider,{value:n},e.children)},[r])]}var zOe=`label`;function BOe(e,t){let n=(0,B.useId)(),r=lP(),i=JN(),a=jN(),{id:o=`headlessui-label-${n}`,htmlFor:s=i??r.props?.htmlFor,passive:c=!1,...l}=e,u=iP(t);DN(()=>r.register(o),[o,r.register]);let d=kN(e=>{let t=e.currentTarget;if(!(e.target!==e.currentTarget&&jOe(e.target))&&(eP(t)&&e.preventDefault(),r.props&&`onClick`in r.props&&typeof r.props.onClick==`function`&&r.props.onClick(e),eP(t))){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute(`disabled`);if(t===`true`||t===``)return;let n=e.getAttribute(`aria-disabled`);if(n===`true`||n===``)return;($N(e)&&(e.type===`file`||e.type===`radio`||e.type===`checkbox`)||e.role===`radio`||e.role===`checkbox`||e.role===`switch`)&&e.click(),e.focus({preventScroll:!0})}}}),f=AN({...r.slot,disabled:a||!1}),p={ref:u,...r.props,id:o,htmlFor:s,onClick:d};return c&&(`onClick`in p&&(delete p.htmlFor,delete p.onClick),`onClick`in l&&delete l.onClick),FN()({ourProps:p,theirProps:l,slot:f,defaultTag:s?zOe:`div`,name:r.name||`Label`})}var VOe=zN(BOe),HOe=Object.assign(VOe,{}),dP=e(WS());function fP(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
376            font-size: .6rem;
377            font-weight: bold;
378            color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function pP(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var UOe=(e,t)=>Math.abs(e-t)<1.01,WOe=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},mP=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},GOe=e=>e,KOe=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},qOe=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(mP(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(mP(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},hP={passive:!0},gP=typeof window>`u`?!0:`onscrollend`in window,JOe=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&gP?()=>void 0:WOe(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,hP);let l=e.options.useScrollendEvent&&gP;return l&&n.addEventListener(`scrollend`,c,hP),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}}
vendor: 3,158 bytes, line 378
378,YOe=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},XOe=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},ZOe=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:GOe,rangeExtractor:KOe,onChange:()=>{},measureElement:YOe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=fP(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}}
vendor: 3,081 bytes, line 378
378,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=fP(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,n,r,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=fP(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let s=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let c=this.measurementsCache.slice(0,s),l=Array(a).fill(void 0);for(let e=0;e<s;e++){let t=c[e];t&&(l[t.lane]=e)}for(let i=s;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,u;if(a!==void 0&&this.options.lanes>1){s=a;let e=l[s],r=e===void 0?void 0:c[e];u=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?c[i-1]:this.getFurthestMeasurement(c,i);u=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(i,s)}let d=o.get(e),f=typeof d==`number`?d:this.options.estimateSize(i),p=u+f;c[i]={index:i,start:u,size:f,end:p,key:e,lane:s},l[s]=i}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=fP(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?QOe({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}
vendor: 1,587 bytes, line 378
378),this.getVirtualIndexes=fP(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{let n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;let i=r.key,a=this.elementsCache.get(i);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}this._measureElement(e,void 0)},this.getVirtualItems=fP(()=>
378[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return pP(t[_P(0,t.length-1,e=>pP(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.measurementsCache[e];if(!n)return;let r=this.getSize(),i=this.getScrollOffset();if(t===`auto`)if(n.end>=i+r-this.options.scrollPaddingEnd)t=`end`;else if(n.start<=i+this.options.scrollPaddingStart)t=`start`;else return[i,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t=`start`,behavior:n}={})=>{n===`smooth`&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t=`auto`,behavior:n}={})=>{n===`smooth`&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let r=0,i=t=>{if(!this.targetWindow)return;let r=this.getOffsetForIndex(e,t);if(!r){console.warn(`Failed to get offset for index:`,e);return}let[i,o]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame(()=>{let t=()=>{if(this.currentScrollToIndex!==e)return;let t=this.getScrollOffset(),n=this.getOffsetForIndex(e,o);if(!n){console.warn(`Failed to get offset for index:`,e);return}UOe(n[0],t)||a(o)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},a=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(r++,r<10?this.targetWindow.requestAnimationFrame(()=>i(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};i(t)},this.scrollBy=(e,{behavior:t}={})=>{t===`smooth`&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adju
378stments:void 0,behavior:t})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}},_P=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function QOe({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=_P(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var vP=typeof document<`u`?B.useLayoutEffect:B.useEffect;function $Oe({useFlushSync:e=!0,...t}){let n=B.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,Wr.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=B.useState(()=>new ZOe(r));return i.setOptions(r),vP(()=>i._didMount(),[]),vP(()=>i._willUpdate()),i}function yP(e){return $Oe({observeElementRect:qOe,observeElementOffset:JOe,scrollToFn:XOe,...e})}function eke(e,t){return e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&`id`in e&&`id`in t?e.id===t.id:e===t}function tke(e=eke){return(0,B.useCallback)((t,n)=>{if(typeof e==`string`){let r=e;return t?.[r]===n?.[r]}return e(t,n)},[e])}function bP(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function xP(e,t,n=!1){let[r,i]=(0,B.useState)(()=>bP(t));return DN(()=>{if(!t||!e)return;let n=TN();return n.requestAnimationFrame(function e(){n.requestAnimationFrame(e),i(e=>{let n=bP(t);return n.width===e.width&&n.height===e.height?e:n})}),()=>{n.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var SP=(e=>(e[e.Left=0]=`Left`,e[e.Right=2]=`Right`,e))(SP||{});function nke(e){let t=(0,B.useRef)(null);return{onPointerDown:kN(n=>{t.current=n.pointerType,!nP(n.currentTarget)&&n.pointerType===`mouse`&&n.button===SP.Left&&(n.preventDefault(),e(n))}),onClick:kN(n=>{t.current!==`mouse`&&(nP(n.currentTarget)||e(n))})}}var CP=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}},rke=Object.defineProperty,ike=(e,t,n)=>t in e?rke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ake=(e,t,n)=>
378(ike(e,typeof t==`symbol`?t:t+``,n),n),wP=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},TP=(e,t,n)=>(wP(e,t,`read from private field`),n?n.call(e):t.get(e)),EP=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},DP=(e,t,n,r)=>(wP(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),OP,kP,AP,jP=class{constructor(e){EP(this,OP,{}),EP(this,kP,new CP(()=>new Set)),EP(this,AP,new Set),ake(this,`disposables`,TN()),DP(this,OP,e),xN.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return TP(this,OP)}subscribe(e,t){if(xN.isServer)return()=>{};let n={selector:e,callback:t,current:e(TP(this,OP))};return TP(this,AP).add(n),this.disposables.add(()=>{TP(this,AP).delete(n)})}on(e,t){return xN.isServer?()=>{}:(TP(this,kP).get(e).add(t),this.disposables.add(()=>{TP(this,kP).get(e).delete(t)}))}send(e){let t=this.reduce(TP(this,OP),e);if(t!==TP(this,OP)){DP(this,OP,t);for(let e of TP(this,AP)){let t=e.selector(TP(this,OP));MP(e.current,t)||(e.current=t,e.callback(t))}for(let t of TP(this,kP).get(e.type))t(TP(this,OP),e)}}};OP=new WeakMap,kP=new WeakMap,AP=new WeakMap;function MP(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length?NP(e[Symbol.iterator](),t[Symbol.iterator]()):!1:e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size?NP
vendor: 4,864 bytes, line 378
378(e.entries(),t.entries()):!1:PP(e)&&PP(t)?NP(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function NP(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function PP(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var oke=Object.defineProperty,ske=(e,t,n)=>t in e?oke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FP=(e,t,n)=>(ske(e,typeof t==`symbol`?t:t+``,n),n),IP=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(IP||{}),cke={0(e,t){let n=t.id,r=e.stack,i=e.stack.indexOf(n);if(i!==-1){let t=e.stack.slice();return t.splice(i,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let i=e.stack.slice();return i.splice(r,1),{...e,stack:i}}},lke=class e extends jP{constructor(){super(...arguments),FP(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),FP(this,`selectors`,{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return NN(t.type,cke,e,t)}},LP=new CP(()=>lke.new()),uke=i((e=>{var t=Ve();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useSyncExternalStore,a=t.useRef,o=t.useEffect,s=t.useMemo,c=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,l,u){var d=a(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,a=e,e=l(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,r(a,e))return t;var n=l(e);return u!==void 0&&u(t,n)?(a=e,t):(a=e,o=n)}var i=!1,a,o,s=n===void 0?null:n;return[function(){return e(t())},s===null?void 0:function(){return e(s())}]},[t,n,l,u]);var p=i(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),c(p),p}})),dke=i(((e,t)=>{t.exports=uke()}))();function RP(e,t,n=MP){return(0,dke.useSyncExternalStoreWithSelector)(kN(t=>e.subscribe(fke,t)),kN(()=>e.state),kN(()=>e.state),kN(t),n)}function fke(e){return e}function zP(e,t){let n=(0,B.useId)(),r=LP.get(t),[i,a]=RP(r,(0,B.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return DN(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?a?i:!0:!1}var BP=new Map,VP=new Map;function HP(e){let t=VP.get(e)??0;return VP.set(e,t+1),t===0?(BP.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0,()=>UP(e)):()=>UP(e)}function UP(e){let t=VP.get(e)??1;if(t===1?VP.delete(e):VP.set(e,t-1),t!==1)return;let n=BP.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,BP.delete(e))}function pke(e,{allowed:t,disallowed:n}={}){let r=zP(e,`inert-others`);DN(()=>{if(!r)return;let e=TN();for(let t of n?.()??[])t&&e.add(HP(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=SN(t);if(!n)continue;let r=t.parentElement;for(;r&&r!==n.body;){for(let t of r.children)i.some(e=>t.contains(e))||e.add(HP(t));r=r.parentElement}}return e.dispose},[r,t,n])}function mke(e,t,n){let r=ON(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,B.useEffect)(()=>{if(!e)return;let n=t===null?null:ZN(t)?t:t.current;if(!n)return;let i=TN();if(typeof ResizeObserver<`u`){let e=new ResizeObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}if(typeof IntersectionObserver<`u`){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}return()=>i.dispose()},[t,r,e])}var WP=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`);[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`);var hke=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(hke||{}),gke=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(gke||{}),_ke=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(_ke||{}),GP=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(GP||{});function vke(e,t=0){return e===SN(e)?.body?!1:NN(t,{0(){return e.matches(WP)},1(){let t=e;for(;t!==null;){if(t.matches(WP))return!0;t=t.parentElement}return!1}})}var yke=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(yke||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`ke
378ydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0)),[`textarea`,`input`].join(`,`);function bke(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function KP(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function xke(){return/Android/gi.test(window.navigator.userAgent)}function qP(){return KP()||xke()}function JP(e,t,n,r){let i=ON(n);(0,B.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r)},[e,t,r])}function Ske(e,t,n,r){let i=ON(n);(0,B.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r)},[e,t,r])}var YP=30;function Cke(e,t,n){let r=ON(n),i=(0,B.useCallback)(function(e,n){if(e.defaultPrevented)return;let i=n(e);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let a=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of a)if(t!==null&&(t.contains(i)||e.composed&&e.composedPath().includes(t)))return;return!vke(i,GP.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),a=(0,B.useRef)(null);JP(e,`pointerdown`,e=>{qP()||(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),JP(e,`pointerup`,e=>{if(qP()||!a.current)return;let t=a.current;return a.current=null,i(e,()=>t)},!0);let o=(0,B.useRef)({x:0,y:0});JP(e,`touchstart`,e=>{o.current.x=e.touches[0].clientX,o.current.y=e.touches[0].clientY},!0),JP(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-o.current.x)>=YP||Math.abs(t.y-o.current.y)>=YP))return i(e,()=>QN(e.target)?e.target:null)},!0),Ske(e,`blur`,e=>i(e,()=>kOe(window.document.activeElement)?window.document.activeElement:null),!0)}function XP(...e){return(0,B.useMemo)(()=>SN(...e),[...e])}var wke=(e=>(e[e.Ignore=0]=`Ignore`,e[e.Select=1]=`Select`,e[e.Close=2]=`Close`,e))(wke||{}),ZP={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Tke=200,QP=5;function Eke(e,{trigger:t,action:n,close:r,select:i}){let a=(0,B.useRef)(null),o=(0,B.useRef)(null),s=(0,B.useRef)(null);JP(e&&t!==null,`pointerdown`,e=>{YN(e?.target)&&t!=null&&t.contains(e.target)&&(o.current=e.x,s.current=e.y,a.current=e.timeStamp)}),JP(e&&t!==null,`pointerup`,e=>{let t=a.current;if(t===null||(a.current=null,!QN(e.target))||Math.abs(e.x-(o.current??e.x))<QP&&Math.abs(e.y-(s.current??e.y))<QP)return;let c=n(e);switch(c.kind){case 0:return;case 1:e.timeStamp-t>Tke&&(i(c.target),r());break;case 2:r();break}},{capture:!0})}function Dke(e,t,n,r){let i=ON(n);(0,B.useEffect)(()=>{e??=window;function n(e){i.current(e)}return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function $P(e){let t=(0,B.useRef)({value:``,selectionStart:null,selectionEnd:null});return Dke(e,`blur`,e=>{let n=e.target;$N(n)&&(t.current={value:n.value,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})}),kN(()=>{if(!CN(e)&&$N(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;n!==null&&r!==null&&e.setSelectionRange(n,r)}t.current={value:``,selectionStart:null,selectionEnd:null}}})}function Oke(e,t){return(0,B.useMemo)(()=>{if(e.type)return e.type;let n=e.as??`button`;if(typeof n==`string`&&n.toLowerCase()===`button`||t?.tagName===`BUTTON`&&!t.hasAttribute(`type`))return`button`},[e.type,e.as,t])}function kke(e){return(0,B.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ake(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(e){return r.add(e),()=>r.delete(e)},dispatch(e,...i){let a=t[e].call(n,...i);
378a&&(n=a,r.forEach(e=>e()))}}}function jke(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,`paddingRight`,`${a}px`)}}}function Mke(){return KP()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!==`auto`){let n=TN();n.style(e.documentElement,`scrollBehavior`,`auto`),t.add(()=>t.microTask(()=>n.dispose()))}let n=window.scrollY??window.pageYOffset,i=null;t.addEventListener(e,`click`,t=>{if(QN(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);QN(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),QN(e.target)&&OOe(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,`overscrollBehavior`,`contain`)}else n.style(e.target,`touchAction`,`none`)})}),t.addEventListener(e,`touchmove`,e=>{if(QN(e.target)){if($N(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.headlessuiPortal!==``&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.headlessuiPortal===``&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{let e=window.scrollY??window.pageYOffset;n!==e&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function Nke(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function eF(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var tF=Ake(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:TN(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=eF(n.meta),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=eF(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[Mke(),jke(),Nke()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});tF.subscribe(()=>{let e=tF.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e=t.get(n.doc)===`hidden`,r=n.count!==0;(r&&!e||!r&&e)&&tF.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&tF.dispatch(`TEARDOWN`,n)}});function Pke(e,t,n=()=>({containers:[]})){let r=kke(tF),i=t?r.get(t):void 0,a=i?i.count>0:!1;return DN(()=>{if(!(!t||!e))return tF.dispatch(`PUSH`,t,n),()=>tF.dispatch(`POP`,t,n)},[e,t]),a}function Fke(e,t,n=()=>[document.body]){Pke(zP(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function nF(e){return[e.screenX,e.screenY]}function Ike(){let e=(0,B.useRef)([-1,-1]);return{wasMoved(t){let n=nF(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=nF(t)}}}function Lke(e=0){let[t,n]=(0,B.useState)(e);return{flags:t,setFlag:(0,B.useCallback)(e=>n(e),[]),addFlag:(0,B.useCallback)(e=>n(t=>t|e),[]),hasFlag:(0,B.useCallback)(e=>(t&e)===e,[t]),removeFlag:(0,B.useCallback)(e=>n(t=>t&~e),[]),toggleFlag:(0,B.useCallback)(e=>n(t=>t^e),[])}}ze(),Re!==void 0&&typeof globalThis<`u`&&typeof Element<`u`&&(Re==null?void 0:{})?.NODE_ENV===`test`&&(Element==null?void 0:Element.prototype)?.getAnimations===void 0&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.",``,`Example usage:`,"```js",`import { mockAnimationsApi } from 'jsdom-testing-mocks'`,`mockAnimationsApi()`,"```"].join(`
379`)),[]});var Rke=(e=>(e[e.None=0]=`None`,e[e.Closed=1]=`Closed`,e[e.Enter=2]=`Enter`,e[e.Leave=4]=`Leave`,e))(Rke||{});function zke(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]=``);return t}function Bke(e,t,n,r){let[i,a]=(0,B.useState)(n),{hasFlag:o,addFlag:s,removeFlag:c}=Lke(e&&i?3:0),l=(0,B.useRef)(!1),u=(0,B.useRef)(!1);return DN(()=>{var i;if(e){if(n&&a(!0),!t){n&&s(3);return}return(i=r?.start)==null||i.call(r,n),Vke(t,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(s(3),c(4)):(s(4),c(2)))},run(){u.current?n?(c(3),s(4)):(c(4),s(3)):n?c(1):s(1)},done(){var e;u.current&&Wke(t)||(l.current=!1,c(7),n||a(!1),(e=r?.end)==null||e.call(r,n))}})}},[e,n,t,EN()]),e?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Vke(e,{prepare:t,run:n,done:r,inFlight:i}){let a=TN();return Uke(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(Hke(e,r))})}),a.dispose}function Hke(e,t){let n=TN();if(!e)return n.dispose;let r=!1;n.add(()=>{r=!0});let i=e.getAnimations?.call(e).filter(e=>e instanceof CSSTransition)??[];return i.length===0?(t(),n.dispose):(Promise.allSettled(i.map(e=>e.finished)).then(()=>{r||t()}),n.dispose)}function Uke(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition=`none`,n(),e.offsetHeight,e.style.transition=r}function Wke(e){return(e.getAnimations?.call(e)??[]).some(e=>e instanceof CSSTransition&&e.playState!==`finished`)}function Gke(e,{container:t,accept:n,walk:r}){let i=(0,B.useRef)(n),a=(0,B.useRef)(r);(0,B.useEffect)(()=>{i.current=n,a.current=r},[n,r]),DN(()=>
379{if(!t||!e)return;let n=SN(t);if(!n)return;let r=i.current,o=a.current,s=Object.assign(e=>r(e),{acceptNode:r}),c=n.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,s,!1);for(;c.nextNode();)o(c.currentNode)},[t,e,i,a])}function rF(e,t){let n=(0,B.useRef)([]),r=kN(e);(0,B.useEffect)(()=>{let e=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let i=r(t,e);return n.current=t,i}},[r,...t])}function Kke(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}var iF={...B},qke=iF.useInsertionEffect||(e=>e());function aF(e){let t=B.useRef(()=>{});return qke(()=>{t.current=e}),B.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var Jke=`ArrowUp`,Yke=`ArrowDown`,Xke=`ArrowLeft`,Zke=`ArrowRight`,oF=typeof document<`u`?B.useLayoutEffect:B.useEffect,Qke=[Xke,Zke],$ke=[Jke,Yke];[...Qke,...$ke];var sF=!1,eAe=0,cF=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+eAe++;function tAe(){let[e,t]=B.useState(()=>sF?cF():void 0);return oF(()=>{e??t(cF())},[]),B.useEffect(()=>{sF=!0},[]),e}var nAe=iF.useId||tAe;function rAe(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,e.get(t)?.filter(e=>e!==n)||[])}}}var iAe=B.createContext(null),aAe=B.createContext(null),oAe=()=>B.useContext(iAe)?.id||null,sAe=()=>B.useContext(aAe),cAe=`data-floating-ui-focusable`;function lAe(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=nAe(),a=B.useRef({}),[o]=B.useState(()=>rAe()),s=oAe()!=null,[c,l]=B.useState(r.reference),u=aF((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=B.useMemo(()=>({setPositionReference:l}),[]),f=B.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return B.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function uAe(e){e===void 0&&(e={});let{nodeId:t}=e,n=lAe({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=B.useState(null),[s,c]=B.useState(null),l=i?.domReference||a,u=B.useRef(null),d=sAe();oF(()=>{l&&(u.current=l)},[l]);let f=ru({...e,elements:{...i,...s&&{reference:s}}}),p=B.useCallback(e=>{let t=Uc(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=B.useCallback(e=>{(Uc(e)||e===null)&&(u.current=e,o(e)),(Uc(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!Uc(e))&&f.refs.setReference(e)},[f.refs]),h=B.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=B.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),_=B.useMemo(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return oF(()=>{r.dataRef.current.floatingContext=_;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=_)}),B.useMemo(()=>({...f,context:_,refs:h,elements:g}),[f,h,g,_])}var lF=`active`,uF=`selected`;function dF(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[lF]:t,[uF]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[cAe]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[lF,uF].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function dAe(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=B.useCallback(t=>dF(t,e,`reference`),t),a=B.useCallback(t=>dF(t,e,`floating`),n),o=B.useCallback(t=>dF(t,e,`item`),r);return B.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}function fF(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}var fAe=e=>({name:`inner`,options:e,async fn(t){let{listRef:n,overflowRef:r,onFallbackChange:i,offset:a=0,index:o=0,minItemsVisible:s=4,referenceOverflowThreshold:c=0,scrollRef:l,...u}=ic(e,t),{rects:d,elements:{floating:f}}=t,p=n.current[o],m=l?.current||f,h=f.clientTop||m.clientTop,g=f.clientTop!==0,_=m.clientTop!==0,v=f===m;if(!p)return{};let y={...t,...await au(-p.offsetTop-f.clientTop-d.reference.height/2-p.offsetHeight/2-a).fn(t)},b=await Ul(fF(y,m.scrollHeight+h+f.clientTop),u),x=await Ul(y,{...u,elementContext:`reference`}),S=Zs(0,b.top),C=y.y+S,w=(m.scrollHeight>m.clientHeight?e=>e:Qs)(Zs(0,m.scrollHeight+(g&&v||_?h*2:0)-S-Zs(0,b.bottom)));
379if(m.style.maxHeight=w+`px`,m.scrollTop=S,i){let e=m.offsetHeight<p.offsetHeight*Xs(s,n.current.length)-1||x.top>=-c||x.bottom>=-c;Wr.flushSync(()=>i(e))}return r&&(r.current=await Ul(fF({...y,y:C},m.offsetHeight+h+f.clientTop),u)),{y:C}}});function pAe(e,t){let{open:n,elements:r}=e,{enabled:i=!0,overflowRef:a,scrollRef:o,onChange:s}=t,c=aF(s),l=B.useRef(!1),u=B.useRef(null),d=B.useRef(null);B.useEffect(()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||a.current==null)return;let n=e.deltaY,r=a.current.top>=-.5,i=a.current.bottom>=-.5,o=t.scrollHeight-t.clientHeight,s=n<0?-1:1,l=n<0?`max`:`min`;t.scrollHeight<=t.clientHeight||(!r&&n>0||!i&&n<0?(e.preventDefault(),Wr.flushSync(()=>{c(e=>e+Math[l](n,o*s))})):/firefox/i.test(Kke())&&(t.scrollTop+=n))}let t=o?.current||r.floating;if(n&&t)return t.addEventListener(`wheel`,e),requestAnimationFrame(()=>{u.current=t.scrollTop,a.current!=null&&(d.current={...a.current})}),()=>{u.current=null,d.current=null,t.removeEventListener(`wheel`,e)}},[i,n,r.floating,a,o,c]);let f=B.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){let e=o?.current||r.floating;if(!(!a.current||!e||!l.current)){if(u.current!==null){let t=e.scrollTop-u.current;(a.current.bottom<-.5&&t<-1||a.current.top<-.5&&t>1)&&Wr.flushSync(()=>c(e=>e+t))}requestAnimationFrame(()=>{u.current=e.scrollTop})}}}),[r.floating,c,a,o]);return B.useMemo(()=>i?{floating:f}:{},[i,f])}var pF=(0,B.createContext)({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});pF.displayName=`FloatingContext`;var mF=(0,B.createContext)(null);mF.displayName=`PlacementContext`;function mAe(e){return(0,B.useMemo)(()=>e?typeof e==`string`?{to:e}:e:null,[e])}function hAe(){return(0,B.useContext)(pF).setReference}function gAe(){let{getFloatingProps:e,slot:t}=(0,B.useContext)(pF);return(0,B.useCallback)((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function _Ae(e=null){e===!1&&(e=null),typeof e==`string`&&(e={to:e});let t=(0,B.useContext)(mF),n=(0,B.useMemo)(()=>e,[JSON.stringify(e,(e,t)=>t?.outerHTML??t)]);DN(()=>{t?.(n??null)},[t,n]);let r=(0,B.useContext)(pF);return(0,B.useMemo)(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}var hF=4;function vAe({children:e,enabled:t=!0}){let[n,r]=(0,B.useState)(null),[i,a]=(0,B.useState)(0),o=(0,B.useRef)(null),[s,c]=(0,B.useState)(null);yAe(s);let l=t&&n!==null&&s!==null,{to:u=`bottom`,gap:d=0,offset:f=0,padding:p=0,inner:m}=bAe(n,s),[h,g=`center`]=u.split(` `);DN(()=>{l&&a(0)},[l]);let{refs:_,floatingStyles:v,context:y}=uAe({open:l,placement:h===`selection`?g===`center`?`bottom`:`bottom-${g}`:g===`center`?`${h}`:`${h}-${g}`,strategy:`absolute`,transform:!1,middleware:[au({mainAxis:h===`selection`?0:d,crossAxis:f}),ou({padding:p}),h!==`selection`&&cu({padding:p}),h===`selection`&&m?fAe({...m,padding:p,overflowRef:o,offset:i,minItemsVisible:hF,referenceOverflowThreshold:p,onFallbackChange(e){if(!e)return;let t=y.elements.floating;if(!t)return;let n=parseFloat(getComputedStyle(t).scrollPaddingBottom)||0,r=Math.min(hF,t.childElementCount),i=0,o=0;for(let e of y.elements.floating?.childNodes??[])if(ZN(e)){let a=e.offsetTop,s=a+e.clientHeight+n,c=t.scrollTop,l=c+t.clientHeight;if(a>=c&&s<=l)r--;else{o=Math.max(0,Math.min(s,l)-Math.max(a,c)),i=e.clientHeight;break}}r>=1&&a(e=>{let t=i*r-o+n;return e>=t?e:t})}}):null,lu({padding:p,apply({availableWidth:e,availableHeight:t,elements:n}){Object.assign(n.floating.style,{overflow:`auto`,maxWidth:`${e}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${t}px)`})}})].filter(Boolean),whileElementsMounted:Hl}),[b=h,x=g]=y.placement.split(`-`);h===`selection`&&(b=`selection`);let S=(0,B.useMemo)(()=>({anchor:[b,x].filter(Boolean).join(` `)}),[b,x]),{getReferenceProps:C,getFloatingProps:w}=dAe([pAe(y,{overflowRef:o,onChange:a})]),T=kN(e=>{c(e),_.setFloating(e)});return B.createElement(mF.Provider,{value:r},B.createElement(pF.Provider,{value:{setFloating:T,setReference:_.setReference,styles:v,getReferenceProps:C,getFloatingProps:w,slot:S}
379},e))}function yAe(e){DN(()=>{if(!e)return;let t=new MutationObserver(()=>{let t=window.getComputedStyle(e).maxHeight,n=parseFloat(t);if(isNaN(n))return;let r=parseInt(t);isNaN(r)||n!==r&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:[`style`]}),()=>{t.disconnect()}},[e])}function bAe(e,t){let n=gF(e?.gap??`var(--anchor-gap, 0)`,t),r=gF(e?.offset??`var(--anchor-offset, 0)`,t),i=gF(e?.padding??`var(--anchor-padding, 0)`,t);return{...e,gap:n,offset:r,padding:i}}function gF(e,t,n=void 0){let r=EN(),i=kN((e,t)=>{if(e==null)return[n,null];if(typeof e==`number`)return[e,null];if(typeof e==`string`){if(!t)return[n,null];let i=vF(e,t);return[i,n=>{let a=_F(e);{let o=a.map(e=>window.getComputedStyle(t).getPropertyValue(e));r.requestAnimationFrame(function s(){r.nextFrame(s);let c=!1;for(let[e,n]of a.entries()){let r=window.getComputedStyle(t).getPropertyValue(n);if(o[e]!==r){o[e]=r,c=!0;break}}if(!c)return;let l=vF(e,t);i!==l&&(n(l),i=l)})}return r.dispose}]}return[n,null]}),a=(0,B.useMemo)(()=>i(e,t)[0],[e,t]),[o=a,s]=(0,B.useState)();return DN(()=>{let[n,r]=i(e,t);if(s(n),r)return r(s)},[e,t]),o}function _F(e){let t=/var\((.*)\)/.exec(e);if(t){let e=t[1].indexOf(`,`);if(e===-1)return[t[1]];let n=t[1].slice(0,e).trim(),r=t[1].slice(e+1).trim();return r?[n,..._F(r)]:[n]}return[]}function vF(e,t){let n=document.createElement(`div`);t.appendChild(n),n.style.setProperty(`margin-top`,`0px`,`important`),n.style.setProperty(`margin-top`,e,`important`);let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function xAe({children:e,freeze:t},n){let r=yF(t,e);return(0,B.isValidElement)(r)?(0,B.cloneElement)(r,{ref:n}):B.createElement(B.Fragment,null,r)}var SAe=B.forwardRef(xAe);function yF(e,t){let[n,r]=(0,B.useState)(t);return!e&&n!==t&&r(t),e?n:t}var bF=(0,B.createContext)(null);bF.displayName=`OpenClosedContext`;var xF=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(xF||{});function CAe(){return(0,B.useContext)(bF)}function wAe({value:e,children:t}){return B.createElement(bF.Provider,{value:e},t)}function TAe(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var SF=[];TAe(()=>{function e(e){if(!QN(e.target)||e.target===document.body||SF[0]===e.target)return;let t=e.target;t=t.closest(WP),SF.unshift(t??e.target),SF=SF.filter(e=>e!=null&&e.isConnected),SF.splice(10)}window.addEventListener(`click`,e,{capture:!0}),window.addEventListener(`mousedown`,e,{capture:!0}),window.addEventListener(`focus`,e,{capture:!0}),document.body.addEventListener(`click`,e,{capture:!0}),document.body.addEventListener(`mousedown`,e,{capture:!0}),document.body.addEventListener(`focus`,e,{capture:!0})});function EAe(e){throw Error(`Unexpected object: `+e)}var CF=(e=>(e[e.First=0]=`First`,e[e.Previous=1]=`Previous`,e[e.Next=2]=`Next`,e[e.Last=3]=`Last`,e[e.Specific=4]=`Specific`,e[e.Nothing=5]=`Nothing`,e))(CF||{});function wF(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:for(let e=0;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 1:i===-1&&(i=n.length);for(let e=i-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 2:for(let e=i+1;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 3:for(let e=n.length-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 4:for(let r=0;r<n.length;++r)if(t.resolveId(n[r],r,n)===e.id)return r;return r;case 5:return null;default:EAe(e)}}function TF(e){let t=kN(e),n=(0,B.useRef)(!1);(0,B.useEffect)(()=>(n.current=!1,()=>{n.current=!0,wN(()=>{n.current&&t()})}),[t])}var DAe=(0,B.createContext)(!1);function OAe(){return(0,B.useContext)(DAe)}function kAe(e){let t=OAe(),n=(0,B.useContext)(DF),[r,i]=(0,B.useState)(()=>{if(!t&&n!==null)return n.current??null;if(xN.isServer)return null;let r=e?.getElementById(`headlessui-portal-root`);if(r)return r;if(e===null)return null;let i=e.createElement(`div`);return i.setAttribute(`id`,`headlessui-portal-root`),e.body.appendChild(i)});return(0,B.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,B.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var EF=B.Fragment,AAe=zN(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,B.useRef)(null),a=iP(NOe(e=>{i.current=e}),t),o=XP(i.current),s=kAe(n??o),c=(0,B.useContext)(PAe),l=EN(),u=FN();return TF(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),s?(0,Wr.createPortal)(B.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{l.dispose(),c&&e&&l.add(c.register(e))}},u({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:EF,name:`Portal`})),s):null});function jAe(e,t){let n=iP(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=FN();return r?B.createElement(AAe,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:EF,name:`Portal`})}var MAe=B.Fragment,DF=(0,B.createContext)(null);function NAe(e,t){let{target:n,...r}=e,i={ref:iP(t)},a=FN();return B.createElement(DF.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:MAe,name:`Popover.Group`}))}var PAe=(0,B.createContext)(null),FAe=zN(jAe),IAe=zN(NAe),LAe=Object.assign(FAe,{Group:IAe}),OF={Idle:{kind:`Idle`},Tracked:e=>({kind:`Tracked`,position:e}),Moved:{kind:`Moved`}};function kF(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function RAe(e,t,n){let r=TN();if(t.kind===`Tracked`){let i=function(){a!==kF(e)&&(r.dispose(),n())},{position:a}=t,o=new ResizeObserver(i);o.observe(e),r.add(()=>o.disconnect()),r.addEventListener(window,`scroll`,i,{passive:!0}),r.addEventListener(window,`resize`,i)}return()=>r.dispose()}
vendor: 3,905 bytes, line 379
379var zAe=Object.defineProperty,BAe=(e,t,n)=>t in e?zAe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,AF=(e,t,n)=>(BAe(e,typeof t==`symbol`?t:t+``,n),n),jF=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(jF||{}),MF=(e=>(e[e.Single=0]=`Single`,e[e.Multi=1]=`Multi`,e))(MF||{}),NF=(e=>(e[e.Pointer=0]=`Pointer`,e[e.Focus=1]=`Focus`,e[e.Other=2]=`Other`,e))(NF||{}),PF=(e=>(e[e.OpenCombobox=0]=`OpenCombobox`,e[e.CloseCombobox=1]=`CloseCombobox`,e[e.GoToOption=2]=`GoToOption`,e[e.SetTyping=3]=`SetTyping`,e[e.RegisterOption=4]=`RegisterOption`,e[e.UnregisterOption=5]=`UnregisterOption`,e[e.DefaultToFirstOption=6]=`DefaultToFirstOption`,e[e.SetActivationTrigger=7]=`SetActivationTrigger`,e[e.UpdateVirtualConfiguration=8]=`UpdateVirtualConfiguration`,e[e.SetInputElement=9]=`SetInputElement`,e[e.SetButtonElement=10]=`SetButtonElement`,e[e.SetOptionsElement=11]=`SetOptionsElement`,e[e.MarkInputAsMoved=12]=`MarkInputAsMoved`,e))(PF||{});function FF(e,t=e=>e){let n=e.activeOptionIndex===null?null:e.options[e.activeOptionIndex],r=t(e.options.slice()),i=r.length>0&&r[0].dataRef.current.order!==null?r.sort((e,t)=>e.dataRef.current.order-t.dataRef.current.order):bke(r,e=>e.dataRef.current.domRef.current),a=n?i.indexOf(n):null;return a===-1&&(a=null),{options:i,activeOptionIndex:a}}var VAe={1(e){var t;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1)return e;let n=e.inputElement?OF.Tracked(kF(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:n,__demoMode:!1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let t=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(t!==-1)return{...e,activeOptionIndex:t,comboboxState:0,__demoMode:!1,inputPositionState:OF.Idle}}return{...e,comboboxState:0,inputPositionState:OF.Idle,__demoMode:!1}},3(e,t){return e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping}},2(e,t){var n,r;if((n=e.dataRef.current)!=null&&n.disabled||e.optionsElement&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:n,disabled:r}=e.virtual,i=t.focus===CF.Specific?t.idx:wF(t,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex??n.findIndex(e=>!r(e))??null,resolveDisabled:r,resolveId(){throw Error(`Function not implemented.`)}}),a=t.trigger??2;return e.activeOptionIndex===i&&e.activationTrigger===a?e:{...e,activeOptionIndex:i,activationTrigger:a,isTyping:!1,__demoMode:!1}}let i=FF(e);if(i.activeOptionIndex===null){let e=i.options.findIndex(e=>!e.dataRef.current.disabled);e!==-1&&(i.activeOptionIndex=e)}let a=t.focus===CF.Specific?t.idx:wF(t,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),o=t.trigger??2;return e.activeOptionIndex===a&&e.activationTrigger===o?e:{...e,...i,isTyping:!1,activeOptionIndex:a,activationTrigger:o,__demoMode:!1}},4:(e,t)=>{var n,r,i,a;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,s=FF(e,e=>(e.push(o),e));e.activeOptionIndex===null&&(i=(r=e.dataRef.current).isSelected)!=null&&i.call(r,t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let c={...e,...s,activationTrigger:2};return(a=e.dataRef.current)!=null&&a.__demoMode&&e.dataRef.current.value===void 0&&(c.activeOptionIndex=0),c},5:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(e=>e.id!==t.id)};let r=FF(e,e=>{let n=e.findIndex(e=>e.id===t.id);return n!==-1&&e.splice(n,1),e});return{...e,...r,activationTrigger:2}},6:(e,t)=>e.defaultToFirstOption===t.value?e:{...e,defaultToFirstOption:t.value},7:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},8:(e,t)=>
379{if(e.virtual===null)return{...e,virtual:{options:t.options,disabled:t.disabled??(()=>!1)}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let n=e.activeOptionIndex;if(e.activeOptionIndex!==null){let r=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);n=r===-1?null:r}return{...e,activeOptionIndex:n,virtual:{options:t.options,disabled:t.disabled??(()=>!1)}}},9:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},10:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},11:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},12(e){return e.inputPositionState.kind===`Tracked`?{...e,inputPositionState:OF.Moved}:e}},HAe=class e extends jP{constructor(e){super(e),AF(this,`actions`,{onChange:e=>{let{onChange:t,compare:n,mode:r,value:i}=this.state.dataRef.current;return NN(r,{0:()=>t?.(e),1:()=>{let r=i.slice(),a=r.findIndex(t=>n(t,e));return a===-1?r.push(e):r.splice(a,1),t?.(r)}})},registerOption:(e,t)=>(this.send({type:4,payload:{id:e,dataRef:t}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(t.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:e})}),goToOption:(e,t)=>(this.send({type:6,value:!1}),this.send({type:2,...e,trigger:t})),setIsTyping:e=>{this.send({type:3,isTyping:e})},closeCombobox:()=>{var e,t;this.send({type:1}),this.send({type:6,value:!1}),(t=(e=this.state.dataRef.current).onClose)==null||t.call(e)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:e=>{this.send({type:7,trigger:e})},selectActiveOption:()=>{let e=this.selectors.activeOptionIndex(this.state);if(e!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[e]);else{let{dataRef:t}=this.state.options[e];this.actions.onChange(t.current.value)}this.actions.goToOption({focus:CF.Specific,idx:e})}},setInputElement:e=>{this.send({type:9,element:e})},setButtonElement:e=>{this.send({type:10,element:e})},setOptionsElement:e=>{this.send({type:11,element:e})}}),AF(this,`selectors`,{activeDescendantId:e=>{let t=this.selectors.activeOptionIndex(e);if(t!==null)return e.virtual?e.options.find(n=>!n.dataRef.current.disabled&&e.dataRef.current.compare(n.dataRef.current.value,e.virtual.options[t]))?.id:e.options[t]?.id},activeOptionIndex:e=>{if(e.defaultToFirstOption&&e.activeOptionIndex===null&&(e.virtual?e.virtual.options.length>0:e.options.length>0)){if(e.virtual){let{options:t,disabled:n}=e.virtual,r=t.findIndex(e=>{var t;return!((t=n?.(e))!=null&&t)});if(r!==-1)return r}let t=e.options.findIndex(e=>!e.dataRef.current.disabled);if(t!==-1)return t}return e.activeOptionIndex},activeOption:e=>{let t=this.selectors.activeOptionIndex(e);return t===null?null:e.virtual?e.virtual.options[t??0]:e.options[t]?.dataRef.current.value??null},isActive:(e,t,n)=>{let r=this.selectors.activeOptionIndex(e);return r===null?!1:e.virtual?r===e.dataRef.current.calculateIndex(t):e.options[r]?.id===n},shouldScrollIntoView:(e,t,n)=>!(e.virtual||e.__demoMode||e.comboboxState!==0||e.activationTrigger===0||!this.selectors.isActive(e,t,n)),didInputMove(e){return e.inputPositionState.kind===`Moved`}});{let e=this.state.id,t=LP.get(null);this.disposables.add(t.on(IP.Push,n=>{!t.selectors.isTop(n,e)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}this.disposables.group(e=>{this.on(1,t=>{t.inputElement&&(e.dispose(),e.add(RAe(t.inputElement,t.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:t,virtual:n=null,__demoMode:r=!1}){return new e({id:t,dataRef:{current:{}},comboboxState:+!r,isTyping:!1,options:[],virtual:n?{options:n.options,disabled:n.disabled??(()=>!1)}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:r,inputPositionState:OF.Idle})}reduce(e,t){return NN(t.type,VAe,e,t)}},IF=(0,B.createContext)(null);function LF(e){let t=(0,B.useContext)(IF);if(t===null){let t=Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,RF),t}return t}function RF({id:e,virtual:t=null,__demoMode:n=!1}){let r=(0,B.useMemo)(()=>HAe.new({id:e,virtual:t,__demoMode:n}),[]);return TF(()=>r.dispose()),r}var zF=(0,B.createContext)(null);zF.displayName=`ComboboxDataContext`;function BF(e){let t=(0,B.useContext)(zF);if(t===null){let t=Error(`<${e} /> is missing a parent <Combobox /> component.`);
379throw Error.captureStackTrace&&Error.captureStackTrace(t,BF),t}return t}var VF=(0,B.createContext)(null);function UAe(e){let t=LF(`VirtualProvider`),{options:n}=BF(`VirtualProvider`).virtual,r=RP(t,e=>e.optionsElement),[i,a]=(0,B.useMemo)(()=>{let e=r;if(!e)return[0,0];let t=window.getComputedStyle(e);return[parseFloat(t.paddingBlockStart||t.paddingTop),parseFloat(t.paddingBlockEnd||t.paddingBottom)]},[r]),o=yP({enabled:n.length!==0,scrollPaddingStart:i,scrollPaddingEnd:a,count:n.length,estimateSize(){return 40},getScrollElement(){return t.state.optionsElement},overscan:12}),[s,c]=(0,B.useState)(0);DN(()=>{c(e=>e+1)},[n]);let l=o.getVirtualItems(),u=RP(t,e=>e.activationTrigger===NF.Pointer),d=RP(t,t.selectors.activeOptionIndex);return l.length===0?null:B.createElement(VF.Provider,{value:o},B.createElement(`div`,{style:{position:`relative`,width:`100%`,height:`${o.getTotalSize()}px`},ref:e=>{e&&(u||d!==null&&n.length>d&&o.scrollToIndex(d))}},l.map(t=>B.createElement(B.Fragment,{key:t.key},B.cloneElement(e.children?.call(e,{...e.slot,option:n[t.index]}),{key:`${s}-${t.key}`,"data-index":t.index,"aria-setsize":n.length,"aria-posinset":t.index+1,style:{position:`absolute`,top:0,left:0,transform:`translateY(${t.start}px)`,overflowAnchor:`none`}})))))}var WAe=B.Fragment;function GAe(e,t){let n=(0,B.useId)(),r=jN(),{value:i,defaultValue:a,onChange:o,form:s,name:c,by:l,invalid:u=!1,disabled:d=r||!1,onClose:f,__demoMode:p=!1,multiple:m=!1,immediate:h=!1,virtual:g=null,nullable:_,...v}=e,y=yOe(a),[b=m?[]:void 0,x]=vOe(i,o,y),S=RF({id:n,virtual:g,__demoMode:p}),C=(0,B.useRef)({static:!1,hold:!1}),w=tke(l),T=kN(e=>g?l===null?g.options.indexOf(e):g.options.findIndex(t=>w(t,e)):S.state.options.findIndex(t=>w(t.dataRef.current.value,e))),E=(0,B.useCallback)(e=>NN(k.mode,{[MF.Multi]:()=>b.some(t=>w(t,e)),[MF.Single]:()=>w(b,e)}),[b]),D=RP(S,e=>e.virtual),O=kN(()=>f?.()),k=(0,B.useMemo)(()=>({__demoMode:p,immediate:h,optionsPropsRef:C,value:b,defaultValue:y,disabled:d,invalid:u,mode:m?MF.Multi:MF.Single,virtual:g?D:null,onChange:x,isSelected:E,calculateIndex:T,compare:w,onClose:O}),[p,h,C,b,y,d,u,m,g,D,x,E,T,w,O]);DN(()=>{g&&S.send({type:PF.UpdateVirtualConfiguration,options:g.options,disabled:g.disabled??null})},[g,g?.options,g?.disabled]),DN(()=>{S.state.dataRef.current=k},[k]);let[A,j,M,N]=RP(S,e=>[e.comboboxState,e.buttonElement,e.inputElement,e.optionsElement]),P=LP.get(null);Cke(RP(P,(0,B.useCallback)(e=>P.selectors.isTop(e,n),[P,n])),[j,M,N],()=>S.actions.closeCombobox());let F=RP(S,S.selectors.activeOptionIndex),I=RP(S,S.selectors.activeOption),L=AN({open:A===jF.Open,disabled:d,invalid:u,activeIndex:F,activeOption:I,value:b}),[R,ee]=ROe(),z=t===null?{}:{ref:t},te=(0,B.useCallback)(()=>{if(y!==void 0)return x?.(y)},[x,y]),ne=FN();return B.createElement(ee,{value:R,props:{htmlFor:M?.id},slot:{open:A===jF.Open,disabled:d}},B.createElement(vAe,null,B.createElement(zF.Provider,{value:k},B.createElement(IF.Provider,{value:S},B.createElement(wAe,{value:NN(A,{[jF.Open]:xF.Open,[jF.Closed]:xF.Closed})},c!=null&&B.createElement(TOe,{disabled:d,data:b==null?{}:{[c]:b},form:s,onReset:te}),ne({ourProps:z,theirProps:v,slot:L,defaultTag:WAe,name:`Combobox`}))))))}var KAe=`input`;function qAe(e,t){let n=LF(`Combobox.Input`),r=BF(`Combobox.Input`),i=(0,B.useId)(),a=JN(),{id:o=a||`headlessui-combobox-input-${i}`,onChange:s,displayValue:c,disabled:l=r.disabled||!1,autoFocus:u=!1,type:d=`text`,...f}=e,p=(0,B.useRef)(null),m=iP(p,t,hAe(),n.actions.setInputElement),[h,g]=RP(n,e=>[e.comboboxState,e.isTyping]),_=EN(),v=kN(()=>{n.actions.onChange(null),n.state.optionsElement&&(n.state.optionsElement.scrollTop=0),n.actions.goToOption({focus:CF.Nothing})});rF(([e,t],[r,i])=>{if(n.state.isTyping)return;let a=p.current;a&&((i===jF.Open&&t===jF.Closed||e!==r)&&(a.value=e),requestAnimationFrame(()=>{if(n.state.isTyping||!a||CN(a))return;let{selectionStart:e,selectionEnd:t}=a;Math.abs((t??0)-(e??0))===0&&e===0&&a.setSelectionRange(a.value.length,a.value.length)}))},[(0,B.useMemo)(()=>typeof c==`function`&&r.value!==void 0?c(r.value)??``:typeof r.value==`string`?r.value:``,[r.value,c]),h,g]),rF(([e],[t])=>
379{if(e===jF.Open&&t===jF.Closed){if(n.state.isTyping)return;let e=p.current;if(!e)return;let t=e.value,{selectionStart:r,selectionEnd:i,selectionDirection:a}=e;e.value=``,e.value=t,a===null?e.setSelectionRange(r,i):e.setSelectionRange(r,i,a)}},[h]);let y=(0,B.useRef)(!1),b=kN(()=>{y.current=!0}),x=kN(()=>{_.nextFrame(()=>{y.current=!1})}),S=kN(e=>{switch(n.actions.setIsTyping(!0),e.key){case sP.Enter:if(n.state.comboboxState!==jF.Open||y.current)return;if(e.preventDefault(),e.stopPropagation(),n.selectors.activeOptionIndex(n.state)===null){n.actions.closeCombobox();return}n.actions.selectActiveOption(),r.mode===MF.Single&&n.actions.closeCombobox();break;case sP.ArrowDown:return e.preventDefault(),e.stopPropagation(),NN(n.state.comboboxState,{[jF.Open]:()=>n.actions.goToOption({focus:CF.Next}),[jF.Closed]:()=>n.actions.openCombobox()});case sP.ArrowUp:return e.preventDefault(),e.stopPropagation(),NN(n.state.comboboxState,{[jF.Open]:()=>n.actions.goToOption({focus:CF.Previous}),[jF.Closed]:()=>{(0,Wr.flushSync)(()=>n.actions.openCombobox()),r.value||n.actions.goToOption({focus:CF.Last})}});case sP.Home:if(n.state.comboboxState===jF.Closed||e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),n.actions.goToOption({focus:CF.First});case sP.PageUp:return e.preventDefault(),e.stopPropagation(),n.actions.goToOption({focus:CF.First});case sP.End:if(n.state.comboboxState===jF.Closed||e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),n.actions.goToOption({focus:CF.Last});case sP.PageDown:return e.preventDefault(),e.stopPropagation(),n.actions.goToOption({focus:CF.Last});case sP.Escape:return n.state.comboboxState===jF.Open?(e.preventDefault(),n.state.optionsElement&&!r.optionsPropsRef.current.static&&e.stopPropagation(),r.mode===MF.Single&&r.value===null&&v(),n.actions.closeCombobox()):void 0;case sP.Tab:if(n.actions.setIsTyping(!1),n.state.comboboxState!==jF.Open)return;r.mode===MF.Single&&n.state.activationTrigger!==NF.Focus&&n.actions.selectActiveOption(),n.actions.closeCombobox();break}}),C=kN(e=>{s?.(e),r.mode===MF.Single&&e.target.value===``&&v(),n.actions.openCombobox()}),w=kN(e=>{var t,i;let a=e.relatedTarget??SF.find(t=>t!==e.currentTarget);if(!((t=n.state.optionsElement)!=null&&t.contains(a))&&!((i=n.state.buttonElement)!=null&&i.contains(a))&&n.state.comboboxState===jF.Open)return e.preventDefault(),r.mode===MF.Single&&r.value===null&&v(),n.actions.closeCombobox()}),T=kN(e=>{var t,i;let a=e.relatedTarget??SF.find(t=>t!==e.currentTarget);(t=n.state.buttonElement)!=null&&t.contains(a)||(i=n.state.optionsElement)!=null&&i.contains(a)||r.disabled||r.immediate&&n.state.comboboxState!==jF.Open&&_.microTask(()=>{(0,Wr.flushSync)(()=>n.actions.openCombobox()),n.actions.setActivationTrigger(NF.Focus)})}),E=uP(),D=POe(),{isFocused:O,focusProps:k}=yN({autoFocus:u}),{isHovered:A,hoverProps:j}=_N({isDisabled:l}),M=RP(n,e=>e.optionsElement),N=AN({open:h===jF.Open,disabled:l,invalid:r.invalid,hover:A,focus:O,autofocus:u}),P=RN({ref:m,id:o,role:`combobox`,type:d,"aria-controls":M?.id,"aria-expanded":h===jF.Open,"aria-activedescendant":RP(n,n.selectors.activeDescendantId),"aria-labelledby":E,"aria-describedby":D,"aria-autocomplete":`list`,defaultValue:e.defaultValue??(r.defaultValue===void 0?null:c?.(r.defaultValue))??r.defaultValue,disabled:l||void 0,autoFocus:u,onCompositionStart:b,onCompositionEnd:x,onKeyDown:S,onChange:C,onFocus:T,onBlur:w},k,j);return FN()({ourProps:P,theirProps:f,slot:N,defaultTag:KAe,name:`Combobox.Input`})}var JAe=`button`;function YAe(e,t){let n=LF(`Combobox.Button`),r=BF(`Combobox.Button`),[i,a]=(0,B.useState)(null),o=iP(t,a,n.actions.setButtonElement),s=(0,B.useId)(),{id:c=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:u=!1,...d}=e,[f,p,m]=RP(n,e=>[e.comboboxState,e.inputElement,e.optionsElement]),h=$P(p);Eke(f===jF.Open,{trigger:i,action:(0,B.useCallback)(e=>{if(i!=null&&i.contains(e.target)||p!=null&&p.contains(e.target))return ZP.Ignore;let t=e.target.closest(`[role="option"]:not([data-disabled])`);return ZN(t)?ZP.Select(t):m!=null&&m.contains(e.target)?ZP.Ignore:ZP.Close},[i,p,m]),close:n.actions.closeCombobox,select:n.actions.selectActiveOption});let g=kN(e=>{switch(e.key){case sP.Space:case sP.Enter:e.preventDefault(),e.stopPropagation(),n.state.comboboxState===jF.Closed&&(0,Wr.flushSync)(()=>n.actions.openCombobox()),h();return;case sP.ArrowDown:e.preventDefault(),e.stopPropagation(),n.state.comboboxState===jF.Closed&&((0,Wr.flushSync)(()=>n.actions.openCombobox()),n.state.dataRef.current.value||n.actions.goToOption({focus:CF.First})),h();return;case sP.ArrowUp:e.preventDefault(),e.stopPropagation(),n.state.comboboxState===jF.Closed&&((0,Wr.flushSync)(()=>n.actions.openCombobox()),n.state.dataRef.current.value||n.actions.goToOption({focus:CF.Last})),h();return;case sP.Escape:if(n.state.comboboxState!==jF.Open)return;e.preventDefault(),n.state.optionsElement&&!r.optionsPropsRef.current.static&&e.stopPropagation(),(0,Wr.flushSync)(()=>n.actions.closeCombobox()),h();return;default:return}}),_=nke(()=>{n.state.comboboxState===jF.Open?n.actions.closeCombobox():n.actions.openCombobox(),h()}),v=uP([c]),{isFocusVisible:y,focusProps:b}=yN({autoFocus:u}),{isHovered:x,hoverProps:S}=_N({isDisabled:l}),{pressed:C,pressProps:w}=uOe({disabled:l}),T=AN({open:f===jF.Open,active:C||f===jF.Open,disabled:l,invalid:r.invali
379d,value:r.value,hover:x,focus:y}),E=RN({ref:o,id:c,type:Oke(e,i),tabIndex:-1,"aria-haspopup":`listbox`,"aria-controls":m?.id,"aria-expanded":f===jF.Open,"aria-labelledby":v,disabled:l||void 0,autoFocus:u,onKeyDown:g},_,b,S,w);return FN()({ourProps:E,theirProps:d,slot:T,defaultTag:JAe,name:`Combobox.Button`})}var XAe=`div`,ZAe=PN.RenderStrategy|PN.Static;function QAe(e,t){let n=(0,B.useId)(),{id:r=`headlessui-combobox-options-${n}`,hold:i=!1,anchor:a,portal:o=!1,modal:s=!0,transition:c=!1,...l}=e,u=LF(`Combobox.Options`),d=BF(`Combobox.Options`),f=mAe(a);f&&(o=!0);let[p,m]=_Ae(f),[h,g]=(0,B.useState)(null),_=gAe(),v=iP(t,f?p:null,u.actions.setOptionsElement,g),[y,b,x,S,C]=RP(u,e=>[e.comboboxState,e.inputElement,e.buttonElement,e.optionsElement,e.activationTrigger]),w=XP(b||x),T=XP(S),E=CAe(),[D,O]=Bke(c,h,E===null?y===jF.Open:(E&xF.Open)===xF.Open);mke(D,b,u.actions.closeCombobox),Fke(d.__demoMode?!1:s&&y===jF.Open,T),pke(d.__demoMode?!1:s&&y===jF.Open,{allowed:(0,B.useCallback)(()=>[b,x,S],[b,x,S])});let k=RP(u,u.selectors.didInputMove)?!1:D;DN(()=>{d.optionsPropsRef.current.static=e.static??!1},[d.optionsPropsRef,e.static]),DN(()=>{d.optionsPropsRef.current.hold=i},[d.optionsPropsRef,i]),Gke(y===jF.Open,{container:S,accept(e){return e.getAttribute(`role`)===`option`?NodeFilter.FILTER_REJECT:e.hasAttribute(`role`)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(e){e.setAttribute(`role`,`none`)}});let A=uP([x?.id]),j=AN({open:y===jF.Open,option:void 0}),M=kN(()=>{u.actions.setActivationTrigger(NF.Pointer)}),N=kN(e=>{e.preventDefault(),u.actions.setActivationTrigger(NF.Pointer)}),P=RN(f?_():{},{"aria-labelledby":A,role:`listbox`,"aria-multiselectable":d.mode===MF.Multi?!0:void 0,id:r,ref:v,style:{...l.style,...m,"--input-width":xP(D,b,!0).width,"--button-width":xP(D,x,!0).width},onWheel:C===NF.Pointer?void 0:M,onMouseDown:N,...zke(O)}),F=D&&y===jF.Closed&&!e.static,I=yF(F,d.virtual?.options),L=yF(F,d.value),R=(0,B.useCallback)(e=>d.compare(L,e),[d.compare,L]),ee=(0,B.useMemo)(()=>{if(!d.virtual)return d;if(I===void 0)throw Error("Missing `options` in virtual mode");return I===d.virtual.options?d:{...d,virtual:{...d.virtual,options:I}}},[d,I,d.virtual?.options]);d.virtual&&Object.assign(l,{children:B.createElement(zF.Provider,{value:ee},B.createElement(UAe,{slot:j},l.children))});let z=FN(),te=(0,B.useMemo)(()=>d.mode===MF.Multi?d:{...d,isSelected:R},[d,R]);return B.createElement(LAe,{enabled:o?e.static||D:!1,ownerDocument:w},B.createElement(zF.Provider,{value:te},z({ourProps:P,theirProps:{...l,children:B.createElement(SAe,{freeze:F},typeof l.children==`function`?l.children?.call(l,j):l.children)},slot:j,defaultTag:XAe,features:ZAe,visible:k,name:`Combobox.Options`})))}var $Ae=`div`;function eje(e,t){var n;let r=BF(`Combobox.Option`),i=LF(`Combobox.Option`),a=(0,B.useId)(),{id:o=`headlessui-combobox-option-${a}`,value:s,disabled:c=((n=r.virtual)?.disabled)?.call(n,s)??!1,order:l=null,...u}=e,[d]=RP(i,e=>[e.inputElement]),f=$P(d),p=RP(i,(0,B.useCallback)(e=>i.selectors.isActive(e,s,o),[s,o])),m=r.isSelected(s),h=(0,B.useRef)(null),g=ON({disabled:c,value:s,domRef:h,order:l}),_=(0,B.useContext)(VF),v=iP(t,h,_?_.measureElement:null),y=kN(()=>{i.actions.setIsTyping(!1),i.actions.onChange(s)});DN(()=>i.actions.registerOption(o,g),[g,o]);let b=RP(i,(0,B.useCallback)(e=>i.selectors.shouldScrollIntoView(e,s,o),[s,o]));DN(()=>{if(b)return TN().requestAnimationFrame(()=>{var e,t;(t=(e=h.current)?.scrollIntoView)==null||t.call(e,{block:`nearest`})})},[b,h]);let x=kN(e=>{e.preventDefault(),e.button===SP.Left&&(c||(y(),qP()||requestAnimationFrame(()=>f()),r.mode===MF.Single&&i.actions.closeCombobox()))}),S=kN(()=>{if(c)return i.actions.goToOption({focus:CF.Nothing});let e=r.calculateIndex(s);i.actions.goToOption({focus:CF.Specific,idx:e})}),C=Ike(),w=kN(e=>C.update(e)),T=kN(e=>{if(!C.wasMoved(e)||c||p&&i.state.activationTrigger===NF.Pointer)return;let t=r.calculateIndex(s);i.actions.goToOption({focus:CF.Specific,idx:t},NF.Pointer)}),E=kN(e=>{C.wasMoved(e)&&(c||p&&(r.optionsPropsRef.current.hold||i.state.activationTrigger===NF.Pointer&&i.actions.goToOption({focus:CF.Nothing})))}),D=AN({active:p,focus:p,selected:m,disabled:c}
379),O={id:o,ref:v,role:`option`,tabIndex:c===!0?void 0:-1,"aria-disabled":c===!0?!0:void 0,"aria-selected":m,disabled:void 0,onMouseDown:x,onFocus:S,onPointerEnter:w,onMouseEnter:w,onPointerMove:T,onMouseMove:T,onPointerLeave:E,onMouseLeave:E};return FN()({ourProps:O,theirProps:u,slot:D,defaultTag:$Ae,name:`Combobox.Option`})}var tje=zN(GAe),nje=zN(YAe),rje=zN(qAe),ije=HOe,aje=zN(QAe),oje=zN(eje),HF=Object.assign(tje,{Input:rje,Button:nje,Label:ije,Options:aje,Option:oje}),sje={width:`1em`,height:`1em`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function cje(){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 32 32`,fill:`currentColor`,children:(0,H.jsx)(`path`,{d:`M28,10H22V4a2,2,0,0,0-2-2H4A2,2,0,0,0,2,4V20a2,2,0,0,0,2,2h6v6a2.0023,2.0023,0,0,0,2,2H28a2.0023,2.0023,0,0,0,2-2V12A2.0023,2.0023,0,0,0,28,10ZM12,28V12H28l.0015,16Z`})})}function lje(){return(0,H.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 32 32`,children:[(0,H.jsx)(`polygon`,{fill:`currentColor`,points:`26,20 24,20 24,24 20,24 20,26 24,26 24,30 26,30 26,26 30,26 30,24 26,24 `}),(0,H.jsx)(`path`,{fill:`currentColor`,d:`M28,8H16l-3.4-3.4C12.2,4.2,11.7,4,11.2,4H4C2.9,4,2,4.9,2,6v20c0,1.1,0.9,2,2,2h14v-2H4V6h7.2l3.4,3.4l0.6,0.6H28v8h2v-8
380	C30,8.9,29.1,8,28,8z`}),(0,H.jsx)(`rect`,{fill:`none`,width:`32`,height:`32`})]})}function uje(e){return(0,H.jsx)(`svg`,{width:`16`,height:`16`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,...e,children:(0,H.jsx)(`path`,{fill:`currentColor`,d:`M11.17,6l3.42,3.41.58.59H28V26H4V6h7.17m0-2H4A2,2,0,0,0,2,6V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2H16L12.59,4.59A2,2,0,0,0,11.17,4Z`})})}function dje(){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 32 32`,fill:`currentColor`,children:(0,H.jsx)(`path`,{d:`M28,10H22V4a2.0025,2.0025,0,0,0-2-2H4A2.0025,2.0025,0,0,0,2,4V20a2.0025,2.0025,0,0,0,2,2h6v6a2.0025,2.0025,0,0,0,2,2H28a2.0025,2.0025,0,0,0,2-2V12A2.0025,2.0025,0,0,0,28,10ZM4,20V4H20v6H12a2.0025,2.0025,0,0,0-2,2v8Zm8,8V22h8a2.0025,2.0025,0,0,0,2-2V12h6V28Z`})})}function UF(){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 32 32`,fill:`currentColor`,children:(0,H.jsx)(`path`,{d:`M28,10H22V4a2,2,0,0,0-2-2H4A2,2,0,0,0,2,4V20a2,2,0,0,0,2,2h6v6a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V12A2,2,0,0,0,28,10Z`})})}var fje=(0,B.memo)(function(e){return(0,H.jsxs)(`svg`,{...sje,...e,children:[(0,H.jsx)(`path`,{d:`M9.82901 13.1824C9.89298 13.2424 9.98369 13.2644 10.0681 13.2406C10.1524 13.2167 10.2181 13.1504 10.2412 13.0658L13.2412 2.06578C13.2617 1.99061 13.246 1.91017 13.1987 1.84825C13.1514 1.78633 13.0779 1.75 13 1.75H6C5.93944 1.75 5.88095 1.77198 5.83537 1.81186L1.83537 5.31186C1.78225 5.35834 1.75125 5.42513 1.75004 5.49571C1.74883 5.56629 1.77751 5.6341 1.82901 5.68238L9.82901 13.1824Z`,stroke:`currentColor`,strokeWidth:`0.5`,strokeLinejoin:`round`}),(0,H.jsx)(`mask`,{id:`path-2-inside-1`,fill:`white`,children:(0,H.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 13L13 2H6L2 5.5L10 13ZM4.5 5.5C4.5 5.91421 4.16421 6.25 3.75 6.25C3.33579 6.25 3 5.91421 3 5.5C3 5.08579 3.33579 4.7
3805 3.75 4.75C4.16421 4.75 4.5 5.08579 4.5 5.5ZM11.75 3.75C12.1642 3.75 12.5 3.41421 12.5 3C12.5 2.58579 12.1642 2.25 11.75 2.25C11.3358 2.25 11 2.58579 11 3C11 3.41421 11.3358 3.75 11.75 3.75ZM7.25 3C7.25 3.41421 6.91421 3.75 6.5 3.75C6.08579 3.75 5.75 3.41421 5.75 3C5.75 2.58579 6.08579 2.25 6.5 2.25C6.91421 2.25 7.25 2.58579 7.25 3ZM9.25 11.5C9.66421 11.5 10 11.1642 10 10.75C10 10.3358 9.66421 10 9.25 10C8.83579 10 8.5 10.3358 8.5 10.75C8.5 11.1642 8.83579 11.5 9.25 11.5Z`})}),(0,H.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 13L13 2H6L2 5.5L10 13ZM4.5 5.5C4.5 5.91421 4.16421 6.25 3.75 6.25C3.33579 6.25 3 5.91421 3 5.5C3 5.08579 3.33579 4.75 3.75 4.75C4.16421 4.75 4.5 5.08579 4.5 5.5ZM11.75 3.75C12.1642 3.75 12.5 3.41421 12.5 3C12.5 2.58579 12.1642 2.25 11.75 2.25C11.3358 2.25 11 2.58579 11 3C11 3.41421 11.3358 3.75 11.75 3.75ZM7.25 3C7.25 3.41421 6.91421 3.75 6.5 3.75C6.08579 3.75 5.75 3.41421 5.75 3C5.75 2.58579 6.08579 2.25 6.5 2.25C6.91421 2.25 7.25 2.58579 7.25 3ZM9.25 11.5C9.66421 11.5 10 11.1642 10 10.75C10 10.3358 9.66421 10 9.25 10C8.83579 10 8.5 10.3358 8.5 10.75C8.5 11.1642 8.83579 11.5 9.25 11.5Z`,fill:`currentColor`}),(0,H.jsx)(`path`,{d:`M13 2L13.9648 2.26312L14.3093 1H13V2ZM10 13L9.31606 13.7295L10.5278 14.8655L10.9648 13.2631L10 13ZM6 2V1H5.62426L5.3415 1.24742L6 2ZM2 5.5L1.3415 4.74742L0.510621 5.47444L1.31606 6.22954L2 5.5ZM12.0352 1.73688L9.03524 12.7369L10.9648 13.2631L13.9648 2.26312L12.0352 1.73688ZM6 3H13V1H6V3ZM2.6585 6.25258L6.6585 2.75258L5.3415 1.24742L1.3415 4.74742L2.6585 6.25258ZM10.6839 12.2705L2.68394 4.77046L1.31606 6.22954L9.31606 13.7295L10.6839 12.2705ZM3.75 7.25C4.7165 7.25 5.5 6.4665 5.5 5.5H3.5C3.5 5.36193 3.61193 5.25 3.75 5.25V7.25ZM2 5.5C2 6.4665 2.7835 7.25 3.75 7.25V5.25C3.88807 5.25 4 5.36193 4 5.5H2ZM3.75 3.75C2.7835 3.75 2 4.5335 2 5.5H4C4 5.63807 3.88807 5.75 3.75 5.75V3.75ZM5.5 5.5C5.5 4.5335 4.7165 3.75 3.75 3.75V5.75C3.61193 5.75 3.5 5.63807 3.5 5.5H5.5ZM11.5 3C11.5 2.86193 11.6119 2.75 11.75 2.75V4.75C12.7165 4.75 13.5 3.9665 13.5 3H11.5ZM11.75 3.25C11.6119 3.25 11.5 3.13807 11.5 3H13.5C13.5 2.0335 12.7165 1.25 11.75 1.25V3.25ZM12 3C12 3.13807 11.8881 3.25 11.75 3.25V1.25C10.7835 1.25 10 2.0335 10 3H12ZM11.75 2.75C11.8881 2.75 12 2.86193 12 3H10C10 3.9665 10.7835 4.75 11.75 4.75V2.75ZM6.5 4.75C7.4665 4.75 8.25 3.9665 8.25 3H6.25C6.25 2.86193 6.36193 2.75 6.5 2.75V4.75ZM4.75 3C4.75 3.9665 5.5335 4.75 6.5 4.75V2.75C6.63807 2.75 6.75 2.86193 6.75 3H4.75ZM6.5 1.25C5.5335 1.25 4.75 2.0335 4.75 3H6.75C6.75 3.13807 6.63807 3.25 6.5 3.25V1.25ZM8.25 3C8.25 2.0335 7.4665 1.25 6.5 1.25V3.25C6.36193 3.25 6.25 3.13807 6.25 3H8.25ZM9 10.75C9 10.6119 9.11193 10.5 9.25 10.5V12.5C10.2165 12.5 11 11.7165 11 10.75H9ZM9.25 11C9.11193 11 9 10.8881 9 10.75H11C11 9.7835 10.2165 9 9.25 9V11ZM9.5 10.75C9.5 10.8881 9.38807 11 9.25 11V9C8.2835 9 7.5 9.7835 7.5 10.75H9.5ZM9.25 10.5C9.38807 10.5 9.5 10.6119 9.5 10.75H7.5C7.5 11.7165 8.2835 12.5 9.25 12.5V10.5Z`,fill:`currentColor`,mask:`url(#path-2-inside-1)`})]})});function WF(e,t){return{...e,geometry:{...e.geometry,coordinates:t}}}var{difference:pje}=e(i(((e,t)=>{ze(),(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.polygonClipping=r())})(e,(function(){function e(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}var t=function(){function e(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return e}();function n(e,t){return e>t?1:e<t?-1:0}function r(e,n,r){for(var i=new t(null,null),a=i,o=i;;){var s=r(e,n.key);
380if(s<0){if(n.left===null)break;if(r(e,n.left.key)<0){var c=n.left;if(n.left=c.right,c.right=n,n=c,n.left===null)break}o.left=n,o=n,n=n.left}else if(s>0){if(n.right===null)break;if(r(e,n.right.key)>0){var c=n.right;if(n.right=c.left,c.left=n,n=c,n.right===null)break}a.right=n,a=n,n=n.right}else break}return a.right=n.left,o.left=n.right,n.left=i.right,n.right=i.left,n}function i(e,n,i,a){var o=new t(e,n);if(i===null)return o.left=o.right=null,o;i=r(e,i,a);var s=a(e,i.key);return s<0?(o.left=i.left,o.right=i,i.left=null):s>=0&&(o.right=i.right,o.left=i,i.right=null),o}function a(e,t,n){var i=null,a=null;if(t){t=r(e,t,n);var o=n(t.key,e);o===0?(i=t.left,a=t.right):o<0?(a=t.right,t.right=null,i=t):(i=t.left,t.left=null,a=t)}return{left:i,right:a}}function o(e,t,n){return t===null?e:e===null?t:(t=r(e.key,t,n),t.left=e,t)}function s(e,t,n,r,i){if(e){r(``+t+(n?`└── `:`├── `)+i(e)+`
381`);var a=t+(n?`    `:`│   `);e.left&&s(e.left,a,!1,r,i),e.right&&s(e.right,a,!0,r,i)}}var c=function(){function c(e){e===void 0&&(e=n),this._root=null,this._size=0,this._comparator=e}return c.prototype.insert=function(e,t){return this._size++,this._root=i(e,t,this._root,this._comparator)},c.prototype.add=function(e,n){var i=new t(e,n);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var a=this._comparator,o=r(e,this._root,a),s=a(e,o.key);return s===0?this._root=o:(s<0?(i.left=o.left,i.right=o,o.left=null):s>0&&(i.right=o.right,i.left=o,o.right=null),this._size++,this._root=i),this._root},c.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},c.prototype._remove=function(e,t,n){var i;return t===null?null:(t=r(e,t,n),n(e,t.key)===0?(t.left===null?i=t.right:(i=r(e,t.left,n),i.right=t.right),this._size--,i):t)},c.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=r(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},c.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return t;t=r<0?t.left:t.right}return null},c.prototype.find=function(e){return this._root&&(this._root=r(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},c.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return!0;t=r<0?t.left:t.right}return!1},c.prototype.forEach=function(e,t){for(var n=this._root,r=[],i=!1;!i;)n===null?r.length===0?i=!0:(n=r.pop(),e.call(t,n),n=n.right):(r.push(n),n=n.left);return this},c.prototype.range=function(e,t,n,r){for(var i=[],a=this._comparator,o=this._root,s;i.length!==0||o;)if(o)i.push(o),o=o.left;else{if(o=i.pop(),s=a(o.key,t),s>0)break;if(a(o.key,e)>=0&&n.call(r,o))return this;o=o.right}return this},c.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},c.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},c.prototype.min=function(){return this._root?this.minNode(this._root).key:null},c.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},c.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},c.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},c.prototype.at=function(e){for(var t=this._root,n=!1,r=0,i=[];!n;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},c.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(i===0)break;i<0?(n=t,t=t.left):t=t.right}return n},c.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var i=r(e.key,t.key);if(i===0)break;i<0?t=t.left:(n=t,t=t.right)}return n},c.prototype.clear=function(){return this._root=null,this._size=0,this},c.prototype.toList=function(){return d(this._root)},c.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var r=e.length,i=this._comparator;if(n&&m(e,t,0,r-1,i),this._root===null)this._root=l(e,t,0,r),this._size=r;else{var a=p(this.toList(),u(e,t),i);r=this._size+r,this._root=f({head:a},0,r)}return this},c.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(c.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),c.prototype.toString=function(e){e===void 0&&(e=function(e){return String(e.key)});var t=[];return s(this._root,``,!0,function(e){return t.push(e)},e),t.join(``)},c.prototype.update=function(e,t,n){var r=this._comparator,s=a(e,this._root,r),c=s.left,l=s.right;r(e,t)<0?l=i(t,n,l,r):c=i(t,n,c,r),this._root=o(c,l,r)},c.prototype.split=function(e){return a(e,this._root,this._comparator)},c.prototype[Symbol.iterator]=function(){var t,n,r;return e(this,function(e){switch(e.label){case 0:t=this._root,n=[],r=!1,e.label=1;case 1:return r?[3,6]:t===null?[3,2]:(n.push(t),t=t.left,[3,5]);case 2:return n.length===0?[3,4]:(t=n.pop(),[4,t]);case 3:return e.sent(),t=t.right,[3,5];case 4:r=!0,e.label=5;case 5:return[3,1];case 6:return[2]}})},c}();function l(e,n,r,i){var a=i-r;if(a>0){var o=r+Math.floor(a/2),s=e[o],c=n[o],u=new t(s,c);return u.left=l(e,n,r,o),u.right=l(e,n,o+1,i),u}return null}function u(e,n){for(var r=new t(null,null),i=r,a=0;a<e.length;a++)i=i.next=new t(e[a],n[a]);return i.next=null,r.next}function d(e){for(var n=e,r=[],i=!1,a=new t(null,null),o=a;!i;)n?(r.push(n),n=n.left):r.length>0?(n=o=o.next=r.pop(),n=n.right):i=!0;return o.next=null,a.next}function f(e,t,n){var r=n-t;if(r>0){var i=t+Math.floor(r/2),a=f(e,t,i),o=e.head;return o.left=a,e.head=e.head.next,o.right=f(e,i+1,n),o}return null}function p(e,n,r){for(var i=new t(null,null),a=i,o=e,s=n;o!==null&&s!==null;)r(o.key,s.key)<0?(a.next=o,o=o.next):(a.next=s,s=s.next),a=a.next;return o===null?s!==null&&(a.next=s):a.next=o,i.next}function m(e,t,n,r,i){if(!(n>=r)){for(var a=e[n+r>>1],o=n-1,s=r+1;;){do o++;while(i(e[o],a)<0);do s--;while(i(e[s],a)>0);if(o>=s)break;var c=e[o];e[o]=e[s],e[s]=c,c=t[o],t[o]=t[s],t[s]=c}m(e,t,n,s,i),m(e,t,s+1,r,i)}}let h=(e,t)=>e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y,g=(e,t)=>{if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;let n=e.ll.x<t.ll.x?t.ll.x:e.ll.x,r=e.ur.x<t.ur.x?e.ur.x:t.ur.x,i=e.ll.y<t.ll.y?t.ll.y:e.ll.y,a=e.ur.y<t.ur.y?e.ur.y:t.ur.y;return{ll:{x:n,y:i},ur:{x:r,y:a}}},_=2**-52;_===void 0&&(_=2**-52);let v=_*_,y=(e,t)=>{if(-_<e&&e<_&&-_<t&&t<_)return 0;let n=e-t;return n*n<v*e*t?0:e<t?-1:1};class b{constructor(){this.reset()}reset(){this.xRounder=new x,this.yRounder=new x}
381round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class x{constructor(){this.tree=new c,this.round(0)}round(e){let t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&y(t.key,n.key)===0)return this.tree.remove(e),n.key;let r=this.tree.next(t);return r!==null&&y(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}let S=new b,C=134217729;function w(e,t,n,r,i){let a,o,s,c,l=t[0],u=r[0],d=0,f=0;u>l==u>-l?(a=l,l=t[++d]):(a=u,u=r[++f]);let p=0;if(d<e&&f<n)for(u>l==u>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[p++]=s);d<e&&f<n;)u>l==u>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f]),a=o,s!==0&&(i[p++]=s);for(;d<e;)o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d],a=o,s!==0&&(i[p++]=s);for(;f<n;)o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f],a=o,s!==0&&(i[p++]=s);return(a!==0||p===0)&&(i[p++]=a),p}function T(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function E(e){return new Float64Array(e)}let D=E(4),O=E(8),k=E(12),A=E(16),j=E(4);function M(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,E,M,N=e-i,P=n-i,F=t-a,I=r-a;b=N*I,f=C*N,p=f-(f-N),m=N-p,f=C*I,h=f-(f-I),g=I-h,x=m*g-(b-p*h-m*h-p*g),S=F*P,f=C*F,p=f-(f-F),m=F-p,f=C*P,h=f-(f-P),g=P-h,E=m*g-(S-p*h-m*h-p*g),_=x-E,d=x-_,D[0]=x-(_+d)+(d-E),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,D[1]=y-(_+d)+(d-S),M=v+_,d=M-v,D[2]=v-(M-d)+(_-d),D[3]=M;let L=T(4,D),R=22204460492503146e-32*o;if(L>=R||-L>=R||(d=e-N,s=e-(N+d)+(d-i),d=n-P,l=n-(P+d)+(d-i),d=t-F,c=t-(F+d)+(d-a),d=r-I,u=r-(I+d)+(d-a),s===0&&c===0&&l===0&&u===0)||(R=11093356479670487e-47*o+33306690738754706e-32*Math.abs(L),L+=N*u+I*s-(F*l+P*c),L>=R||-L>=R))return L;b=s*I,f=C*s,p=f-(f-s),m=s-p,f=C*I,h=f-(f-I),g=I-h,x=m*g-(b-p*h-m*h-p*g),S=c*P,f=C*c,p=f-(f-c),m=c-p,f=C*P,h=f-(f-P),g=P-h,E=m*g-(S-p*h-m*h-p*g),_=x-E,d=x-_,j[0]=x-(_+d)+(d-E),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,j[1]=y-(_+d)+(d-S),M=v+_,d=M-v,j[2]=v-(M-d)+(_-d),j[3]=M;let ee=w(4,D,4,j,O);b=N*u,f=C*N,p=f-(f-N),m=N-p,f=C*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=F*l,f=C*F,p=f-(f-F),m=F-p,f=C*l,h=f-(f-l),g=l-h,E=m*g-(S-p*h-m*h-p*g),_=x-E,d=x-_,j[0]=x-(_+d)+(d-E),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,j[1]=y-(_+d)+(d-S),M=v+_,d=M-v,j[2]=v-(M-d)+(_-d),j[3]=M;let z=w(ee,O,4,j,k);b=s*u,f=C*s,p=f-(f-s),m=s-p,f=C*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=c*l,f=C*c,p=f-(f-c),m=c-p,f=C*l,h=f-(f-l),g=l-h,E=m*g-(S-p*h-m*h-p*g),_=x-E,d=x-_,j[0]=x-(_+d)+(d-E),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,j[1]=y-(_+d)+(d-S),M=v+_,d=M-v,j[2]=v-(M-d)+(_-d),j[3]=M;let te=w(z,k,4,j,A);return A[te-1]}function N(e,t,n,r,i,a){let o=(t-a)*(n-i),s=(e-i)*(r-a),c=o-s,l=Math.abs(o+s);return Math.abs(c)>=33306690738754716e-32*l?c:-M(e,t,n,r,i,a,l)}let P=(e,t)=>e.x*t.y-e.y*t.x,F=(e,t)=>e.x*t.x+e.y*t.y,I=(e,t,n)=>{let r=N(e.x,e.y,t.x,t.y,n.x,n.y);return r>0?-1:+(r<0)},L=e=>Math.sqrt(F(e,e)),R=(e,t,n)=>{let r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return P(i,r)/L(i)/L(r)},ee=(e,t,n)=>{let r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return F(i,r)/L(i)/L(r)},z=(e,t,n)=>t.y===0?null:{x:e.x+t.x/t.y*(n-e.y),y:n},te=(e,t,n)=>t.x===0?null:{x:n,y:e.y+t.y/t.x*(n-e.x)},ne=(e,t,n,r)=>{if(t.x===0)return te(n,r,e.x);if(r.x===0)return te(e,t,n.x);if(t.y===0)return z(n,r,e.y);if(r.y===0)return z(e,t,n.y);let i=P(t,r);if(i==0)return null;let a={x:n.x-e.x,y:n.y-e.y},o=P(a,t)/i,s=P(a,r)/i,c=e.x+s*t.x,l=n.x+o*r.x,u=e.y+s*t.y,d=n.y+o*r.y;return{x:(c+l)/2,y:(u+d)/2}};class re{static compare(e,t){let n=re.comparePoints(e.point,t.point);return n===0?(e.point!==t.point&&e.link(t),e.isLeft===t.isLeft?ae.compare(e.segment,t.segment):e.isLeft?1:-1):n}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw Error(`Tried to link already linked events`);let t=e.point.events;for(let e=0,n=t.length;e<n;e++){let n=t[e];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){let e=this.point.events.length;for(let t=0;t<e;t++){let n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){let e=this.point.events[r];e.consumedBy===void 0&&n.otherSE.point.events===e.otherSE.point.events&&n.segment.consume(e.segment)}}}getAvailableLinkedEvents(){let e=[];for(let t=0,n=this.point.events.length;t<n;t++){let n=this.point.events[t];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&e.push(n)}return e}getLeftmostComparator(e){let t=new Map,n=n=>{let r=n.otherSE;t.set(n,{sine:R(this.point,e.point,r.point),cosine:ee(this.point,e.point,r.point)})};return(e,r)=>{t.has(e)||n(e),t.has(r)||n(r);let{sine:i,cosine:a}=t.get(e),{sine:o,cosine:s}=t.get(r);return i>=0&&o>=0?a<s?1:a>s?-1:0:i<0&&o<0?a<s?-1:+(a>s):o<i?-1:+(o>i)}}}let ie=0;class ae{static compare(e,t){let n=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,a=t.rightSE.point.x;if(a<n)return 1;if(i<r)return-1;let o=e.leftSE.point.y,s=t.leftSE.point.y,c=e.rightSE.point.y,l=t.rightSE.point.y;if(n<r){if(s<o&&s<c)return 1;if(s>o&&s>c)return-1;let n=e.comparePoint(t.leftSE.point);if(n<0)return 1;if(n>0)return-1;let r=t.comparePoint(e.rightSE.point);return r===0?-1:r}if(n>r){if(o<s&&o<l)return-1;if(o>s&&o>l)return 1;let n=t.comparePoint(e.leftSE.point);if(n!==0)return n;let r=e.comparePoint(t.rightSE.point);return r<0?1:r>0?-1:1}if(o<s)return-1;if(o>s)return 1;if(i<a){let n=t.comparePoint(e.rightSE.point);if(n!==0)return n}if(i>a){let n=e.comparePoint(t.rightSE.point);if(n<0)return 1;if(n>0)return-1}if(i!==a){let e=c-o,t=i-n,u=l-s,d=a-r;if(e>t&&u<d)return 1;if(e<t&&u>d)return-1}return i>a?1:i<a||c<l?-1:c>l?1:e.id<t.id?-1:+(e.id>t.id)}constructor(e,t,n,r){this.id=++ie,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static fromRing(e,t,n){let r,i,a,o=re.comparePoints(e,t);if(o<0)r=e,i=t,a=1;else if(o>0)r=t,i=e,a=-1;else throw Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);let s=new re(r,!0),c=new re(i,!1);return new ae(s,c,[n],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;
381let t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;let i=(e.y-t.y)/r.y,a=t.x+i*r.x;if(e.x===a)return 0;let o=(e.x-t.x)/r.x,s=t.y+o*r.y;return e.y===s?0:e.y<s?-1:1}getIntersection(e){let t=this.bbox(),n=e.bbox(),r=g(t,n);if(r===null)return null;let i=this.leftSE.point,a=this.rightSE.point,o=e.leftSE.point,s=e.rightSE.point,c=h(t,o)&&this.comparePoint(o)===0,l=h(n,i)&&e.comparePoint(i)===0,u=h(t,s)&&this.comparePoint(s)===0,d=h(n,a)&&e.comparePoint(a)===0;if(l&&c)return d&&!u?a:!d&&u?s:null;if(l)return u&&i.x===s.x&&i.y===s.y?null:i;if(c)return d&&a.x===o.x&&a.y===o.y?null:o;if(d&&u)return null;if(d)return a;if(u)return s;let f=ne(i,this.vector(),o,e.vector());return f===null||!h(r,f)?null:S.round(f.x,f.y)}split(e){let t=[],n=e.events!==void 0,r=new re(e,!0),i=new re(e,!1),a=this.rightSE;this.replaceRightSE(i),t.push(i),t.push(r);let o=new ae(r,a,this.rings.slice(),this.windings.slice());return re.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),i.checkForConsuming()),t}swapEvents(){let e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,t=this.windings.length;e<t;e++)this.windings[e]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;let r=ae.compare(t,n);if(r!==0){if(r>0){let e=t;t=n,n=e}if(t.prev===n){let e=t;t=n,n=e}for(let e=0,r=n.rings.length;e<r;e++){let r=n.rings[e],i=n.windings[e],a=t.rings.indexOf(r);a===-1?(t.rings.push(r),t.windings.push(i)):t.windings[a]+=i}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult===void 0&&(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};let t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let e=0,r=this.rings.length;e<r;e++){let r=this.rings[e],i=this.windings[e],a=t.indexOf(r);a===-1?(t.push(r),n.push(i)):n[a]+=i}let i=[],a=[];for(let e=0,r=t.length;e<r;e++){if(n[e]===0)continue;let r=t[e],o=r.poly;if(a.indexOf(o)===-1)if(r.isExterior)i.push(o);else{a.indexOf(o)===-1&&a.push(o);let e=i.indexOf(r.poly);e!==-1&&i.splice(e,1)}}for(let e=0,t=i.length;e<t;e++){let t=i[e].multiPoly;r.indexOf(t)===-1&&r.push(t)}return this._afterState}
381isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ge.type){case`union`:{let n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case`intersection`:{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===ge.numMultiPolys&&n<r;break}case`xor`:{let n=Math.abs(e.length-t.length);this._isInResult=n%2==1;break}case`difference`:{let n=e=>e.length===1&&e[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw Error(`Unrecognized operation type found ${ge.type}`)}return this._isInResult}}class oe{constructor(e,t,n){if(!Array.isArray(e)||e.length===0||(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!=`number`||typeof e[0][1]!=`number`))throw Error(`Input geometry is not a valid Polygon or MultiPolygon`);let r=S.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let t=1,n=e.length;t<n;t++){if(typeof e[t][0]!=`number`||typeof e[t][1]!=`number`)throw Error(`Input geometry is not a valid Polygon or MultiPolygon`);let n=S.round(e[t][0],e[t][1]);n.x===i.x&&n.y===i.y||(this.segments.push(ae.fromRing(i,n,this)),n.x<this.bbox.ll.x&&(this.bbox.ll.x=n.x),n.y<this.bbox.ll.y&&(this.bbox.ll.y=n.y),n.x>this.bbox.ur.x&&(this.bbox.ur.x=n.x),n.y>this.bbox.ur.y&&(this.bbox.ur.y=n.y),i=n)}(r.x!==i.x||r.y!==i.y)&&this.segments.push(ae.fromRing(i,r,this))}getSweepEvents(){let e=[];for(let t=0,n=this.segments.length;t<n;t++){let n=this.segments[t];e.push(n.leftSE),e.push(n.rightSE)}return e}}class se{constructor(e,t){if(!Array.isArray(e))throw Error(`Input geometry is not a valid Polygon or MultiPolygon`);this.exteriorRing=new oe(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let t=1,n=e.length;t<n;t++){let n=new oe(e[t],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=t}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){let n=this.interiorRings[t].getSweepEvents();for(let t=0,r=n.length;t<r;t++)e.push(n[t])}return e}}class ce{constructor(e,t){if(!Array.isArray(e))throw Error(`Input geometry is not a valid Polygon or MultiPolygon`);try{typeof e[0][0][0]==`number`&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:1/0,y:1/0},ur:{x:-1/0,y:-1/0}};for(let t=0,n=e.length;t<n;t++){let n=new se(e[t],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=t}getSweepEvents(){let e=[];for(let t=0,n=this.polys.length;t<n;t++){let n=this.polys[t].getSweepEvents();for(let t=0,r=n.length;t<r;t++)e.push(n[t])}return e}}class le{static factory(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];if(!r.isInResult()||r.ringOut)continue;let i=null,a=r.leftSE,o=r.rightSE,s=[a],c=a.point,l=[];for(;i=a,a=o,s.push(a),a.point!==c;)for(;;){let e=a.getAvailableLinkedEvents();if(e.length===0){let e=s[0].point,t=s[s.length-1].point;throw Error(`Unable to complete output ring starting at [${e.x}, ${e.y}]. Last matching segment found ends at [${t.x}, ${t.y}].`)}if(e.length===1){o=e[0].otherSE;break}let n=null;for(let e=0,t=l.length;e<t;e++)if(l[e].point===a.point){n=e;break}if(n!==null){let e=l.splice(n)[0],r=s.splice(e.index);r.unshift(r[0].otherSE),t.push(new le(r.reverse()));continue}l.push({index:s.length,point:a.point});let r=a.getLeftmostComparator(i);o=e.sort(r)[0].otherSE;break}t.push(new le(s))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point,t=[e];for(let n=1,r=this.events.length-1;n<r;n++){let r=this.events[n].point,i=this.events[n+1].point;I(r,e,i)!==0&&(t.push(r),e=r)}if(t.length===1)return null;let n=t[0],r=t[1];I(n,e,r)===0&&t.shift(),t.push(t[0]);let i=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,o=this.isExteriorRing()?t.length:-1,s=[];for(let e=a;e!=o;e+=i)s.push([t[e].x,t[e].y]);return s}isExteriorRing(){if(this._isExteriorRing===void 0){let e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let t=1,n=this.events.length;t<n;t++){let n=this.events[t];re.compare(e,n)>0&&(e=n)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()===t.ringOut?t.ringOut.enclosingRing():t.ringOut;t=n.prevInResult(),n=t?t.prevInResult():null}}}class ue{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){let e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,n=this.interiorRings.length;t<n;t++){let n=this.interiorRings[t].getGeom();n!==null&&e.push(n)}return e}}class de{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){let e=[];for(let t=0,n=this.polys.length;t<n;t++){let n=this.polys[t].getGeom();n!==null&&e.push(n)}return e}_composePolys(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];if(!r.poly)if(r.isExteriorRing())t.push(new ue(r));else{let e=r.enclosingRing();
381e.poly||t.push(new ue(e)),e.poly.addInterior(r)}}return t}}class fe{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae.compare;this.queue=e,this.tree=new c(t),this.segments=[]}process(e){let t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;let r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let i=r,a=r,o,s;for(;o===void 0;)i=this.tree.prev(i),i===null?o=null:i.key.consumedBy===void 0&&(o=i.key);for(;s===void 0;)a=this.tree.next(a),a===null?s=null:a.key.consumedBy===void 0&&(s=a.key);if(e.isLeft){let r=null;if(o){let e=o.getIntersection(t);if(e!==null&&(t.isAnEndpoint(e)||(r=e),!o.isAnEndpoint(e))){let t=this._splitSafely(o,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}let i=null;if(s){let e=s.getIntersection(t);if(e!==null&&(t.isAnEndpoint(e)||(i=e),!s.isAnEndpoint(e))){let t=this._splitSafely(s,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}if(r!==null||i!==null){let e=null;e=r===null?i:i===null||re.comparePoints(r,i)<=0?r:i,this.queue.remove(t.rightSE),n.push(t.rightSE);let a=t.split(e);for(let e=0,t=a.length;e<t;e++)n.push(a[e])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=o)}else{if(o&&s){let e=o.getIntersection(s);if(e!==null){if(!o.isAnEndpoint(e)){let t=this._splitSafely(o,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}if(!s.isAnEndpoint(e)){let t=this._splitSafely(s,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);let n=e.rightSE;this.queue.remove(n);let r=e.split(t);return r.push(n),e.consumedBy===void 0&&this.tree.add(e),r}}let pe=Re!==void 0&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,me=Re!==void 0&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class he{run(e,t,n){ge.type=e,S.reset();let r=[new ce(t,!0)];for(let e=0,t=n.length;e<t;e++)r.push(new ce(n[e],!1));if(ge.numMultiPolys=r.length,ge.type===`difference`){let e=r[0],t=1;for(;t<r.length;)g(r[t].bbox,e.bbox)===null?r.splice(t,1):t++}if(ge.type===`intersection`)for(let e=0,t=r.length;e<t;e++){let t=r[e];for(let n=e+1,i=r.length;n<i;n++)if(g(t.bbox,r[n].bbox)===null)return[]}let i=new c(re.compare);for(let e=0,t=r.length;e<t;e++){let t=r[e].getSweepEvents();for(let e=0,n=t.length;e<n;e++)if(i.insert(t[e]),i.size>pe)throw Error(`Infinite loop when putting segment endpoints in a priority queue (queue size too big).`)}let a=new fe(i),o=i.size,s=i.pop();for(;s;){let e=s.key;if(i.size===o){let t=e.segment;throw Error(`Unable to pop() ${e.isLeft?`left`:`right`} SweepEvent [${e.point.x}, ${e.point.y}] from segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] from queue.`)}if(i.size>pe)throw Error(`Infinite loop when passing sweep line over endpoints (queue size too big).`);if(a.segments.length>me)throw Error(`Infinite loop when passing sweep line over endpoints (too many sweep line segments).`);let t=a.process(e);for(let e=0,n=t.length;e<n;e++){let n=t[e];n.consumedBy===void 0&&i.insert(n)}o=i.size,s=i.pop()}S.reset();let l=le.factory(a.segments);return new de(l).getGeom()}}let ge=new he;return{union:function(e){var t=[...arguments].slice(1);return ge.run(`union`,e,t)},intersection:function(e){var t=[...arguments].slice(1);return ge.run(`intersection`,e,t)},xor:function(e){var t=[...arguments].slice(1);return ge.run(`xor`,e,t)},difference:function(e){var t=[...arguments].slice(1);return ge.run(`difference`,e,t)}}}))}))());function GF(e,t){return pje(e.geometry.coordinates,t.geometry.coordinates).length===0}var mje=function(e){return e[e.Yes=0]=`Yes`,e[e.No=1]=`No`,e}({});function hje(e){return e.length===2&&e[0].geometry?.type===`Polygon`&&e[1].geometry?.type===`Polygon`?0:1}function gje(e,t){let n,r;if(GF(e,t))r=e,n=t;else if(GF(t,e))r=t,n=e;else return ue(new he(`Inner ring-3 is outside the outer ring-3`));let[i,...a]=r.geometry.coordinates;n=WF(n,n.geometry.coordinates.concat([i])),n.properties!==null&&r.properties!==null&&(n={...n,properties:{...n.properties,...r.properties}});let o=[];if(a.length)for(let e of a)o.push({...r,geometry:{type:`Polygon`,coordinates:[e]}});return o.push(n),fe(o)}function _je(e){let t=e.geometry.coordinates[0][0],n=e.geometry.coordinates[0];return n.length>4&&(n=n.slice(0,-2)),WF(e,[n.concat([t])])}var vje=e=>{let{geometry:t}=e;if(t===null)return null;let n=[];return AS(t,e=>{n.push(e)},!0),n.length===0?null:n.length===1?{...e,geometry:{type:`Point`,coordinates:n[0]}}:{...e,geometry:{type:`MultiPoint`,coordinates:n}}}
381,yje=/~/,bje=/~[01]/g;function xje(e){switch(e){case`~1`:return`/`;case`~0`:return`~`}throw Error(`Invalid tilde escape: ${e}`)}function KF(e){return yje.test(e)?e.replace(bje,xje):e}function Sje(e,t,n){let r,i;if(t[1]===`constructor`&&t[2]===`prototype`||t[1]===`__proto__`)return e;for(let n=1,a=t.length;n<a&&(r=KF(t[n++]),i=a>n,e[r]===void 0&&(Array.isArray(e)&&r===`-`&&(r=e.length),i&&(t[n]!==``&&t[n]<1/0||t[n]===`-`?e[r]=[]:e[r]={})),i);)e=e[r];let a=e[r];return n===void 0?delete e[r]:e[r]=n,a}function qF(e){if(typeof e==`string`){if(e=e.split(`/`),e[0]===``)return e;throw Error(`Invalid JSON pointer.`)}else if(Array.isArray(e))return e;throw Error(`Invalid JSON pointer.`)}function JF(e,t){if(typeof e!=`object`)throw Error(`Invalid input object.`);t=qF(t);let n=t.length;if(n===1)return e;for(let r=1;r<n;){if(e=e[KF(t[r++])],n===r)return e;if(typeof e!=`object`)return}}function YF(e,t){if(typeof e!=`object`)throw Error(`Invalid input object.`);t=qF(t);let n=t.length;if(n===1)return e;let r=Object.assign({},e),i=r;for(let e=1;e<n-1;){let a=KF(t[e++]);if(Array.isArray(i[a])?i[a]=i[a].slice():i[a]!==null&&typeof i[a]==`object`&&(i[a]=Object.assign({},i[a])),i=i[a],n===e)return r}return r}function XF(e,t,n){if(typeof e!=`object`)throw Error(`Invalid input object.`);if(t=qF(t),t.length===0)throw Error(`Invalid JSON pointer for set.`);return Sje(e,t,n)}function ZF(e){return typeof e==`number`&&!Number.isNaN(e)?e:0}function QF(e,t){let[n]=qC(t,e),r=JF(e,n);if(!r||!Array.isArray(r))throw Error(`Unexpected: bad ID, cannot get position`);let[i,a,o]=r;return o===void 0?[ZF(i),ZF(a)]:[ZF(i),ZF(a),ZF(o)]}function Cje(e,t){return le.encase(()=>QF(e,t))}function $F(e,t,n=0,r=e.length-1,i=wje){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);$F(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(eI(e,n,t),i(e[r],a)>0&&eI(e,n,r);o<s;){for(eI(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?eI(e,n,s):(s++,eI(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function eI(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function wje(e,t){return e<t?-1:+(e>t)}var tI=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!cI(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;cI(e,s)&&(t.leaf?n.push(o):sI(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!cI(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(cI(e,a)){if(t.leaf||sI(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=lI([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=Tje(e,n.children,t);if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&sI(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=lI(e.slice(t,n+1)),nI(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=lI([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));uI(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);uI(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return nI(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=aI(o),c=Oje(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),iI(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=lI(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,nI(n,this.toBBox),nI(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=lI([e,t]),this.data.height=e.height+1,this.data.leaf=!1,nI(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=rI(e,0,o,this.toBBox),s=rI(e,o,n,this.toBBox),c=kje(t,s),l=aI(t)+aI(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:Eje,i=e.leaf?this.compareMinY:Dje;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=rI(e,0,t,i),o=rI(e,n-t,n,i),s=oI(a)+oI(o);for(let r=t;r<n-t;r++){let t=e.children[r];iI(a,e.leaf?i(t):t),s+=oI(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];iI(o,e.leaf?i(t):t),s+=oI(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)iI(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():nI(e[t],this.toBBox)}};function Tje(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function nI(e,t){rI(e,0,e.children.length,t,e)}function rI(e,t,n,r,i){i||=lI(null),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];iI(i,e.leaf?r(t):t)}return i}function iI(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Eje(e,t){return e.minX-t.minX}function Dje(e,t){return e.minY-t.minY}function aI(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function oI(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Oje(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function kje(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function sI(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function cI(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function lI(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function uI(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;$F(e,o,t,n,i),a.push(t,o,o,n)}}var Aje=class{data;length;compare;constructor(e=[],t){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=(e<<1)+1,a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}},dI=11102230246251565e-32,fI=134217729,jje=3.000000000000001*dI;function pI(e,t,n,r,i){let a,o,s,c,l=t[0],u=r[0],d=0,f=0;u>l==u>-l?(a=l,l=t[++d]):(a=u,u=r[++f]);let p=0;if(d<e&&f<n)for(u>l==u>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[p++]=s);d<e&&f<n;)u>l==u>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f]),a=o,s!==0&&(i[p++]=s);for(;d<e;)o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d],a=o,s!==0&&(i[p++]=s);for(;f<n;)o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f],a=o,s!==0&&(i[p++]=s);return(a!==0||p===0)&&(i[p++]=a),p}function Mje(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function mI(e){return new Float64Array(e)}var Nje=(3+16*dI)*dI,Pje=(2+12*dI)*dI,Fje=(9+64*dI)*dI*dI,hI=mI(4),gI=mI(8),_I=mI(12),vI=mI(16),yI=mI(4);function Ije(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e-i,E=n-i,D=t-a,O=r-a;b=T*O,f=fI*T,p=f-(f-T),m=T-p,f=fI*O,h=f-(f-O),g=O-h,x=m*g-(b-p*h-m*h-p*g),S=D*E,f=fI*D,p=f-(f-D),m=D-p,f=fI*E,h=f-(f-E),g=E-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,hI[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,hI[1]=y-(_+d)+(d-S),w=v+_,d=w-v,hI[2]=v-(w-d)+(_-d),hI[3]=w;let k=Mje(4,hI),A=Pje*o;if(k>=A||-k>=A||(d=e-T,s=e-(T+d)+(d-i),d=n-E,l=n-(E+d)+(d-i),d=t-D,c=t-(D+d)+(d-a),d=r-O,u=r-(O+d)+(d-a),s===0&&c===0&&l===0&&u===0)||(A=Fje*o+jje*Math.abs(k),k+=T*u+O*s-(D*l+E*c),k>=A||-k>=A))return k;b=s*O,f=fI*s,p=f-(f-s),m=s-p,f=fI*O,h=f-(f-O),g=O-h,x=m*g-(b-p*h-m*h-p*g),S=c*E,f=fI*c,p=f-(f-c),m=c-p,f=fI*E,h=f-(f-E),g=E-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,yI[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,yI[1]=y-(_+d)+(d-S),w=v+_,d=w-v,yI[2]=v-(w-d)+(_-d),yI[3]=w;let j=pI(4,hI,4,yI,gI);b=T*u,f=fI*T,p=f-(f-T),m=T-p,f=fI*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=D*l,f=fI*D,p=f-(f-D),m=D-p,f=fI*l,h=f-(f-l),g=l-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,yI[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,yI[1]=y-(_+d)+(d-S),w=v+_,d=w-v,yI[2]=v-(w-d)+(_-d),yI[3]=w;let M=pI(j,gI,4,yI,_I);return b=s*u,f=fI*s,p=f-(f-s),m=s-p,f=fI*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=c*l,f=fI*c,p=f-(f-c),m=c-p,f=fI*l,h=f-(f-l),g=l-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,yI[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,yI[1]=y-(_+d)+(d-S),w=v+_,d=w-v,yI[2]=v-(w-d)+(_-d),yI[3]=w,vI[pI(M,_I,4,yI,vI)-1]}
381function Lje(e,t,n,r,i,a){let o=(t-a)*(n-i),s=(e-i)*(r-a),c=o-s;if(o===0||s===0||o>0!=s>0)return c;let l=Math.abs(o+s);return Math.abs(c)>=Nje*l?c:-Ije(e,t,n,r,i,a,l)}var bI=new he(`Could not generate convex hull: three points are required`);function Rje(e){let t=[];if(AS(e,function(e){t.push([e[0],e[1]])}),!t.length)return ue(bI);try{let e=Hje(t,1/0);if(e.length>3)return fe(ofe([e]))}catch{return ue(bI)}return ue(bI)}function zje(e,t,n,r){let i=e[0],a=e[1],o=!1;n===void 0&&(n=0),r===void 0&&(r=t.length);let s=(r-n)/2;for(let e=0,r=s-1;e<s;r=e++){let s=t[n+e*2+0],c=t[n+e*2+1],l=t[n+r*2+0],u=t[n+r*2+1];c>a!=u>a&&i<(l-s)*(a-c)/(u-c)+s&&(o=!o)}return o}function Bje(e,t,n,r){let i=e[0],a=e[1],o=!1;n===void 0&&(n=0),r===void 0&&(r=t.length);let s=r-n;for(let e=0,r=s-1;e<s;r=e++){let s=t[e+n][0],c=t[e+n][1],l=t[r+n][0],u=t[r+n][1];c>a!=u>a&&i<(l-s)*(a-c)/(u-c)+s&&(o=!o)}return o}function Vje(e,t,n,r){return t.length>0&&Array.isArray(t[0])?Bje(e,t,n,r):zje(e,t,n,r)}function Hje(e,t,n){t=Math.max(0,t===void 0?2:t),n||=0;let r=qje(e),i=new tI(16);i.toBBox=function(e){return{minX:e[0],minY:e[1],maxX:e[0],maxY:e[1]}},i.compareMinX=function(e,t){return e[0]-t[0]},i.compareMinY=function(e,t){return e[1]-t[1]},i.load(e);let a,o=[];for(let e=0;e<r.length;e++){let t=r[e];i.remove(t),a=TI(t,a),o.push(a)}let s=new tI(16);for(let e=0;e<o.length;e++)s.insert(wI(o[e]));let c=t*t,l=n*n;for(;o.length;){let e=o.shift();if(e==null)throw Error(`This should never happen`);let t=e.p,n=e.next?.p,r=EI(t,n);if(r<l)continue;let a=r/c,u=Uje(i,e.prev.p,t,n,e.next.next.p,a,s);u&&Math.min(EI(u,t),EI(u,n))<=a&&(o.push(e),o.push(TI(u,e)),i.remove(u),s.remove(e),s.insert(wI(e)),s.insert(wI(e.next)))}let u=a,d=[];do{if(!u)throw Error(`This should never happen`);d.push(u.p),u=u.next}while(u!==a);if(!u)throw Error(`This should never happen`);return d.push(u.p),d}function Uje(e,t,n,r,i,a,o){let s=new Aje([],Wje),c=e.data;for(;c;){for(let e=0;e<c.children.length;e++){let t=c.children[e],i=c.leaf?DI(t,n,r):Gje(n,r,t);i>a||s.push({node:t,dist:i})}for(;s.length&&!s.peek().node.children;){let e=s.pop(),a=e.node,c=DI(a,t,n),l=DI(a,r,i);
381if(e.dist<c&&e.dist<l&&SI(n,a,o)&&SI(r,a,o))return a}c=s.pop(),c&&=c.node}return null}function Wje(e,t){return e.dist-t.dist}function Gje(e,t,n){if(xI(e,n)||xI(t,n))return 0;let r=OI(e[0],e[1],t[0],t[1],n.minX,n.minY,n.maxX,n.minY);if(r===0)return 0;let i=OI(e[0],e[1],t[0],t[1],n.minX,n.minY,n.minX,n.maxY);if(i===0)return 0;let a=OI(e[0],e[1],t[0],t[1],n.maxX,n.minY,n.maxX,n.maxY);if(a===0)return 0;let o=OI(e[0],e[1],t[0],t[1],n.minX,n.maxY,n.maxX,n.maxY);return o===0?0:Math.min(r,i,a,o)}function xI(e,t){return e[0]>=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function SI(e,t,n){let r=Math.min(e[0],t[0]),i=Math.min(e[1],t[1]),a=Math.max(e[0],t[0]),o=Math.max(e[1],t[1]),s=n.search({minX:r,minY:i,maxX:a,maxY:o});for(let n=0;n<s.length;n++)if(Kje(s[n].p,s[n].next.p,e,t))return!1;return!0}function CI(e,t,n){return Lje(e[0],e[1],t[0],t[1],n[0],n[1])}function Kje(e,t,n,r){return e!==r&&t!==n&&CI(e,t,n)>0!=CI(e,t,r)>0&&CI(n,r,e)>0!=CI(n,r,t)>0}function wI(e){let t=e.p,n=e.next.p;return e.minX=Math.min(t[0],n[0]),e.minY=Math.min(t[1],n[1]),e.maxX=Math.max(t[0],n[0]),e.maxY=Math.max(t[1],n[1]),e}function qje(e){let t=e[0],n=e[0],r=e[0],i=e[0];for(let a=0;a<e.length;a++){let o=e[a];o[0]<t[0]&&(t=o),o[0]>r[0]&&(r=o),o[1]<n[1]&&(n=o),o[1]>i[1]&&(i=o)}let a=[t,n,r,i],o=a.slice();for(let t=0;t<e.length;t++)Vje(e[t],a)||o.push(e[t]);return Yje(o)}function TI(e,t){let n={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(n.next=t.next,n.prev=t,t.next.prev=n,t.next=n):(n.prev=n,n.next=n),n}function EI(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function DI(e,t,n){let r=t[0],i=t[1],a=n[0]-r,o=n[1]-i;if(a!==0||o!==0){let t=((e[0]-r)*a+(e[1]-i)*o)/(a*a+o*o);t>1?(r=n[0],i=n[1]):t>0&&(r+=a*t,i+=o*t)}return a=e[0]-r,o=e[1]-i,a*a+o*o}function OI(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=o-i,d=s-a,f=e-i,p=t-a,m=c*c+l*l,h=c*u+l*d,g=u*u+d*d,_=c*f+l*p,v=u*f+d*p,y=m*g-h*h,b,x,S=y,C=y;y===0?(b=0,S=1,x=v,C=g):(b=h*v-g*_,x=m*v-h*_,b<0?(b=0,x=v,C=g):b>S&&(b=S,x=v+h,C=g)),x<0?(x=0,-_<0?b=0:-_>m?b=S:(b=-_,S=m)):x>C&&(x=C,-_+h<0?b=0:-_+h>m?b=S:(b=-_+h,S=m));let w=b===0?0:b/S,T=x===0?0:x/C,E=(1-w)*e+w*n,D=(1-w)*t+w*r,O=(1-T)*i+T*o,k=(1-T)*a+T*s,A=O-E,j=k-D;return A*A+j*j}function Jje(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}function Yje(e){e.sort(Jje);let t=[];for(let n=0;n<e.length;n++){for(;t.length>=2&&CI(t[t.length-2],t[t.length-1],e[n])<=0;)t.pop();t.push(e[n])}let n=[];for(let t=e.length-1;t>=0;t--){for(;n.length>=2&&CI(n[n.length-2],n[n.length-1],e[t])<=0;)n.pop();n.push(e[t])}return n.pop(),t.pop(),t.concat(n)}var Xje=e=>Rje({type:`FeatureCollection`,features:e}),Zje=e(i(((e,t)=>{var n=J_(),r=IT(),i=$_(),a=ev();t.exports=i(function(e,t){return a(e)?n(e,r(t,1,a,!0)):[]})}))());function Qje(e){let t={type:`Feature`,properties:{},geometry:{type:`GeometryCollection`,geometries:[]}};for(let n of e){switch(n.geometry?.type){case`GeometryCollection`:t.geometry.geometries.push(...n.geometry.geometries);break;default:if(n.geometry===null)break;t.geometry.geometries.push(n.geometry);break}kI(t,n)}return t}function kI(e,t){e.properties||={},t.properties&&Object.assign(e.properties,t.properties)}function $je(e){let t={type:`Feature`,properties:{},geometry:{type:`MultiPoint`,coordinates:[]}};for(let n of e){switch(n.geometry?.type){case`Point`:t.geometry.coordinates.push(n.geometry.coordinates);break;case`MultiPoint`:t.geometry.coordinates.push(...n.geometry.coordinates);break;default:break}kI(t,n)}return t}function eMe(e){let t={type:`Feature`,properties:{},geometry:{type:`MultiPolygon`,coordinates:[]}};for(let n of e){switch(n.geometry?.type){case`Polygon`:t.geometry.coordinates.push(n.geometry.coordinates);break;case`MultiPolygon`:t.geometry.coordinates.push(...n.geometry.coordinates);break;default:break}kI(t,n)}return t}function tMe(e){let t={type:`Feature`,properties:{},geometry:{type:`MultiLineString`,coordinates:[]}};for(let n of e){switch(n.geometry?.type){case`LineString`:t.geometry.coordinates.push(n.geometry.coordinates);break;case`MultiLineString`:t.geometry.coordinates.push(...n.geometry.coordinates);break;default:break}kI(t,n)}return t}
381function nMe(e,t){switch(t){case`Polygon`:return eMe(e);case`Point`:return $je(e);case`LineString`:return tMe(e)}}function AI(e,t){return(0,Zje.default)(e,t).length===0}function jI(e){let t=(0,qS.default)(e.map(e=>e.geometry?.type));return AI(t,[`Polygon`,`MultiPolygon`])?`Polygon`:AI(t,[`LineString`,`MultiLineString`])?`LineString`:AI(t,[`Point`,`MultiPoint`])?`Point`:null}function rMe(e){if(e.length<2)return``;let t=jI(e);return t?`Merge into Multi${t}`:`Merge into GeometryCollection`}function iMe(e){let t=jI(e);return t===null?Qje(e):nMe(e,t)}function MI(e){return e>=-90&&e<=90}function aMe(e,t,n){let r=(0,fw.default)(e.geometry),i=!0;if(r){let a=xC(e),o=bC(e);if(a&&o){let r=[a.center[0]-t,a.center[1]-n],i=yC({center:r,type:a.type,value:o});return{...e,properties:{...e.properties,"@circle":{...a,center:r}},geometry:i}}let s=new Set;AS(r,e=>{let[r,a]=e;s.has(e)||(s.add(e),e[0]=r-t,e[1]=a-n,MI(a)===!0&&MI(e[1])===!1&&(i=!1))})}return i?{...e,geometry:r}:e}function NI(e,t){return t.length===1?{...e,geometry:{type:`LineString`,coordinates:t[0]}}:{...e,geometry:{type:`MultiLineString`,coordinates:t}}}var oMe=e=>BC(e).with({geometry:{type:`Polygon`}},e=>NI(e,e.geometry.coordinates)).with({geometry:{type:`MultiPolygon`}},e=>NI(e,e.geometry.coordinates.flat())).exhaustive();function sMe(e,t={}){let n=NS(e);return SS([(n[0]+n[2])/2,(n[1]+n[3])/2],t.properties,t)}var cMe=sMe;function lMe(e){return[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]}function uMe(e){return e/180*Math.PI}function PI(e,t,n){let r=uMe(t||0);return!n||n[0]===0&&n[1]===0?FI(e,r):FI(e.map((e,t)=>e-n[t]),r).map((e,t)=>e+n[t])}function FI(e,t){return[e[0]*Math.cos(t)-e[1]*Math.sin(t),e[0]*Math.sin(t)+e[1]*Math.cos(t)]}function II(e,t,n){return e.map(r=>PI(r,t,n||lMe(e)))}function LI(e,t,n){let r=[];for(let i=0,a=e.length;i<a;i++)r[i]=PI(e[i],t,n);return r}function dMe(e,t,n){if(!t)return e;let r=cMe({type:`FeatureCollection`,features:e.filter(e=>e).map(e=>e.feature).filter(e=>e.geometry)}).geometry.coordinates,i=(Math.atan2(r[0]-t.lng,r[1]-t.lat)-Math.atan2(r[0]-n.lng,r[1]-n.lat))*(180/Math.PI);return e.map(e=>{function t(e){if(e)switch(e.type){case`Point`:e.coordinates=PI(e.coordinates,i,r);break;case`GeometryCollection`:e.geometries.forEach(e=>{t(e)});break;case`MultiPoint`:e.coordinates=e.coordinates.map(e=>PI(e,i,r));break;case`MultiPolygon`:e.coordinates=e.coordinates.map(e=>e.map(e=>LI(e,i,r)));break;case`Polygon`:e.coordinates=e.coordinates.map(e=>LI(e,i,r));break;case`LineString`:e.coordinates=II(e.coordinates,i,r);break;case`MultiLineString`:e.coordinates=e.coordinates.map(e=>II(e,i,r));break}return e}return{...e,feature:{...e.feature,geometry:e.feature.geometry?t((0,fw.default)(e.feature.geometry)):null}}})}var fMe=i(((e,t)=>{var n=Ipe();function r(e){return n(e)?void 0:e}t.exports=r})),pMe=e(i(((e,t)=>{var n=q_(),r=Nme(),i=US(),a=RS(),o=lw(),s=fMe(),c=Kve(),l=bme(),u=1,d=2,f=4;t.exports=c(function(e,t){var c={};if(e==null)return c;var p=!1;t=n(t,function(t){return t=a(t,e),p||=t.length>1,t}),o(e,l(e),c),p&&(c=r(c,u|d|f,s));for(var m=t.length;m--;)i(c,t[m]);return c})}))());function RI(e,{key:t}){return{...e,properties:(0,pMe.default)(e.properties,t)}}function zI({feature:e,position:t,vertexId:n,breakRectangle:r=!1}){let i=(0,fw.default)(e),a=!r&&hMe({feature:i,position:t,vertexId:n});if(a)return{feature:a,wasRectangle:!0,wasCircle:!1};let o=xC(i),s=!r&&mMe({feature:i,position:t,vertexId:n});if(s)return{feature:s,wasRectangle:!1,wasCircle:!0};o&&r&&(i=RI(i,{key:`@circle`}));let c=qC(n,i);for(let e of c)i=YF(i,e);for(let e of c)XF(i,e,t);return{feature:i,wasRectangle:!1,wasCircle:!1}}function mMe({feature:e,position:t,vertexId:n}){let r=xC(e);return r?{...e,geometry:dpe({center:r.center,type:r.type,mouse:t})}:null}function hMe({feature:e,position:t,vertexId:n}){let r=e.geometry?.type;if(!(r===`Polygon`||r===`MultiPolygon`))return null;let i=qC(n,e),a=i[0].split(`/`).slice(0,-1).join(`/`),o=JF(e,a);if(!o||!gMe(o))return null;let s=JF(e,i[0]),c=(0,fw.default)(o.slice()).slice(0,4),l=o.indexOf(s),u=c.at(l-1),d=c.at((l+1)%c.length);return c[l]=t,BI(u,s,t),BI(d,s,t),c.push((0,fw.default)(c[0].slice())),XF(e,a,c),e}
381function BI(e,t,n){e&&(e[0]===t[0]?e[0]=n[0]:e[1]===t[1]&&(e[1]=n[1]))}function gMe(e){if(e.length!==5)return!1;let[t,n,r,i]=e;for(let e of[!0,!1]){let a=+(e===!0),o=e===!0?0:1;if(t[a]===n[a]&&n[o]===r[o]&&r[a]===i[a]&&i[o]===t[o])return!0}return!1}var _Me=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},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)}})(),vMe=Object.prototype.hasOwnProperty;function VI(e,t){return vMe.call(e,t)}function HI(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<t.length;n++)t[n]=``+n;return t}if(Object.keys)return Object.keys(e);var r=[];for(var i in e)VI(e,i)&&r.push(i);return r}function UI(e){switch(typeof e){case`object`:return JSON.parse(JSON.stringify(e));case`undefined`:return null;default:return e}}function WI(e){for(var t=0,n=e.length,r;t<n;){if(r=e.charCodeAt(t),r>=48&&r<=57){t++;continue}return!1}return!0}function GI(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function KI(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function qI(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(qI(e[t]))return!0}else if(typeof e==`object`){for(var r=HI(e),i=r.length,a=0;a<i;a++)if(qI(e[r[a]]))return!0}}return!1}function JI(e,t){var n=[e];for(var r in t){var i=typeof t[r]==`object`?JSON.stringify(t[r],null,2):t[r];i!==void 0&&n.push(r+`: `+i)}return n.join(`
382`)}var YI=function(e){_Me(t,e);function t(t,n,r,i,a){var o=this.constructor,s=e.call(this,JI(t,{name:n,index:r,operation:i,tree:a}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=a,Object.setPrototypeOf(s,o.prototype),s.message=JI(t,{name:n,index:r,operation:i,tree:a}),s}return t}(Error),yMe=r({JsonPatchError:()=>XI,_areEquals:()=>rL,applyOperation:()=>$I,applyPatch:()=>eL,applyReducer:()=>SMe,deepClone:()=>bMe,getValueByPointer:()=>
vendor: 5,801 bytes, line 382
382QI,validate:()=>nL,validator:()=>tL}),XI=YI,bMe=UI,ZI={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=QI(n,this.path);r&&=UI(r);var i=$I(n,{op:`remove`,path:this.from}).removed;return $I(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=QI(n,this.from);return $I(n,{op:`add`,path:this.path,value:UI(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:rL(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},xMe={add:function(e,t,n){return WI(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:ZI.move,copy:ZI.copy,test:ZI.test,_get:ZI._get};function QI(e,t){if(t==``)return e;var n={op:`_get`,path:t};return $I(e,n),n.value}function $I(e,t,n,r,i,a){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),a===void 0&&(a=0),n&&(typeof n==`function`?n(t,0,e,t.path):tL(t,0)),t.path===``){var o={newDocument:e};if(t.op===`add`)return o.newDocument=t.value,o;if(t.op===`replace`)return o.newDocument=t.value,o.removed=e,o;if(t.op===`move`||t.op===`copy`)return o.newDocument=QI(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=rL(e,t.value),o.test===!1)throw new XI(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o.newDocument=e,o}else if(t.op===`remove`)return o.removed=e,o.newDocument=null,o;else if(t.op===`_get`)return t.value=e,o;else if(n)throw new XI("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);else return o}else{r||(e=UI(e));var s=(t.path||``).split(`/`),c=e,l=1,u=s.length,d=void 0,f=void 0,p=void 0;for(p=typeof n==`function`?n:tL;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=KI(f)),i&&(f==`__proto__`||f==`prototype`&&l>0&&s[l-1]==`constructor`))throw 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[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!WI(f))throw new XI(`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`,a,t,e);else WI(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new XI(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=xMe[t.op].call(t,c,f,e);if(o.test===!1)throw new XI(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=ZI[t.op].call(t,c,f,e);if(o.test===!1)throw new XI(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l<u&&(!c||typeof c!=`object`))throw new XI(`Cannot perform operation at the desired path`,`OPERATION_PATH_UNRESOLVABLE`,a,t,e)}}}function eL(e,t,n,r,i){if(r===void 0&&(r=!0),i===void 0&&(i=!0),n&&!Array.isArray(t))throw new XI(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);r||(e=UI(e));for(var a=Array(t.length),o=0,s=t.length;o<s;o++)a[o]=$I(e,t[o],n,!0,i,o),e=a[o].newDocument;return a.newDocument=e,a}function SMe(e,t,n){var r=$I(e,t);if(r.test===!1)throw new XI(`Test operation failed`,`TEST_OPERATION_FAILED`,n,t,e);return r.newDocument}function tL(e,t,n,r){if(typeof e!=`object`||!e||Array.isArray(e))throw new XI(`Operation is not an object`,`OPERATION_NOT_AN_OBJECT`,t,e,n);if(!ZI[e.op])throw new XI("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,t,e,n);if(typeof e.path!=`string`)throw new XI("Operation `path` property is not a string",`OPERATION_PATH_INVALID`,t,e,n);if(e.path.indexOf(`/`)!==0&&e.path.length>0)throw new XI('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 XI("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 XI("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`)&&qI(e.value))throw new XI("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,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new XI("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 XI(`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 o=nL([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new XI(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function nL(e,t,n){try{if(!Array.isArray(e))throw new XI(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)eL(UI(t),UI(e),n||!0);else{n||=tL;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(e){if(e instanceof XI)return e;throw e}}function rL(e,t){if(e===t)return!0;
382if(e&&t&&typeof e==`object`&&typeof t==`object`){var n=Array.isArray(e),r=Array.isArray(t),i,a,o;if(n&&r){if(a=e.length,a!=t.length)return!1;for(i=a;i--!==0;)if(!rL(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=Object.keys(e);if(a=s.length,a!==Object.keys(t).length)return!1;for(i=a;i--!==0;)if(!t.hasOwnProperty(s[i]))return!1;for(i=a;i--!==0;)if(o=s[i],!rL(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var CMe=r({compare:()=>jMe,generate:()=>aL,observe:()=>AMe,unobserve:()=>kMe}),iL=new WeakMap,wMe=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),TMe=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function EMe(e){return iL.get(e)}function DMe(e,t){return e.observers.get(t)}function OMe(e,t){e.observers.delete(t.callback)}function kMe(e,t){t.unobserve()}function AMe(e,t){var n=[],r,i=EMe(e);if(!i)i=new wMe(e),iL.set(e,i);else{var a=DMe(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=UI(e),t){r.callback=t,r.next=null;var o=function(){aL(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<`u`&&(window.addEventListener(`mouseup`,s),window.addEventListener(`keyup`,s),window.addEventListener(`mousedown`,s),window.addEventListener(`keydown`,s),window.addEventListener(`change`,s))}return r.patches=n,r.object=e,r.unobserve=function(){aL(r),clearTimeout(r.next),OMe(i,r),typeof window<`u`&&(window.removeEventListener(`mouseup`,s),window.removeEventListener(`keyup`,s),window.removeEventListener(`mousedown`,s),window.removeEventListener(`keydown`,s),window.removeEventListener(`change`,s))},i.observers.set(t,new TMe(t,r)),r}function aL(e,t){t===void 0&&(t=!1);var n=iL.get(e.object);oL(n.value,e.object,e.patches,``,t),e.patches.length&&eL(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function oL(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=HI(t),o=HI(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(VI(t,l)&&!(t[l]===void 0&&u!==void 0&&Array.isArray(t)===!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?oL(u,d,n,r+`/`+GI(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+GI(l),value:UI(u)}),n.push({op:`replace`,path:r+`/`+GI(l),value:UI(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+GI(l),value:UI(u)}),n.push({op:`remove`,path:r+`/`+GI(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(!(!s&&a.length==o.length))for(var c=0;c<a.length;c++){var l=a[c];!VI(e,l)&&t[l]!==void 0&&n.push({op:`add`,path:r+`/`+GI(l),value:UI(t[l])})}}}function jMe(e,t,n){n===void 0&&(n=!1);var r=[];return oL(e,t,r,``,n),r}Object.assign({},yMe,CMe,{JsonPatchError:YI,deepClone:UI,escapePathComponent:GI,unescapePathComponent:KI});function MMe(e){return e.replace(/(\d+)$/,e=>(parseInt(e,10)+1).toString())}function NMe({feature:e,id:t,position:n}){let[r]=qC(t,e),i={op:`add`,path:MMe(r),value:n},a=YF(e,r);return eL(a,[i]),a}function PMe({feature:e,sel:t}){if(t.type!==`single`||t.parts.length===0)return[];let n=[],r=e.geometry.coordinates,i=0;for(let{vertex:a}of t.parts){let t=r.slice(i,a+1);i=a,t.length>1&&n.push({...e,geometry:{type:`LineString`,coordinates:t}})}if(i!==r.length-1){let t=r.slice(i);n.push({...e,geometry:{type:`LineString`,coordinates:t}})}return n}function sL({action:{icon:e,label:t,onSelect:n,variant:r=`default`},as:i,...a}){return i===`dropdown-item`?(0,H.jsxs)(Dg,{onSelect:n,...a,variant:r,children:[e,` `,t]}):i===`context-item`?(0,H.jsxs)(Og,{onSelect:n,...a,variant:r,children:[e,` `,t]}):(0,H.jsxs)(vm,{children:[(0,H.jsx)(`div`,{className:`h-10 w-10 p-1
383          group bn
384          flex items-stretch justify-center focus:outline-hidden`,children:(0,H.jsx)(ym,{onClick:e=>n(e),asChild:!0,children:(0,H.jsx)(Fg,{variant:`quiet`,children:e})})}),(0,H.jsxs)(fg,{side:`bottom`,children:[(0,H.jsx)(gg,{}),(0,H.jsx)(`div`,{className:`whitespace-nowrap`,children:t})]})]})}function cL(e){let t=i_().useTransact();if(e.length===0)return[];let n=e.map(e=>e.feature);function r(r,i,a){return{label:i,icon:a,applicable:!0,onSelect:async()=>{let i=r_.booleanFeatures(n,{op:r}).then(n=>n.caseOf({Left(e){return Promise.reject(e.message)},Right(n){return t({note:`Computed ${r} of features`,track:`operation-boolean-op-${r}`,deleteFeatures:e.map(e=>e.id),putFeatures:n.map(t=>({id:VC(),folderId:e[0].folderId,feature:t}))})}}));return pE.promise(i,{loading:`Calculating`,success:`Done`,error:`Failed to compute`},{loading:{duration:1/0},success:{duration:2e3},error:{duration:2e3}})}}}return[{applicable:!0,label:rMe(n),icon:(0,H.jsx)(An,{}),onSelect:async function(){let[r,...i]=e,a=iMe(n);await t({deleteFeatures:i.map(e=>e.id),putFeatures:[{...r,feature:a}]})}},r(`union`,`Union`,(0,H.jsx)(UF,{})),r(`intersection`,`Intersection`,(0,H.jsx)(dje,{})),r(`difference`,`Subtract`,(0,H.jsx)(cje,{}))]}function FMe({as:e,selectedWrappedFeatures:t}){return(0,H.jsx)(H.Fragment,{children:cL(t).filter(e=>e.applicable).map((t,n)=>(0,H.jsx)(sL,{as:e,action:t},n))})}function IMe(e){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zm-7-3v3m0 0v3m0-3h3m-3 0H7`})})}function LMe({geometry:e,wrappedFeature:t}){let n=i_().useTransact(),r=(0,B.useContext)(kS),i=new WC(0,0);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-xs`,children:[`GeometryCollection`,` `,(0,H.jsx)(`span`,{className:`uppercase opacity-30 ml-2 font-bold `,children:mv(`geometry`,e.geometries.length)})]}
384),(0,H.jsx)(`div`,{className:`divide-y divide-gray-200`,children:e.geometries.map((e,a)=>{let o=i;return i={type:`vertex`,featureId:i.featureId,vertex:i.vertex+KC(e)},(0,H.jsxs)(`div`,{className:`py-2`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center pb-2`,children:[(0,H.jsxs)(`div`,{className:`font-bold text-xs flex-auto`,children:[`#`,a+1,` `,e.type]}),(0,H.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),t.preventDefault(),tC(e).ifJust(e=>{r?.map.fitBounds(e,{padding:100,animate:!1})})},title:`Zoom & select`,className:`text-black opacity-20 dark:text-white group-hover:opacity-100 pr-1`,children:(0,H.jsx)(IMe,{className:`w-3 h-3`})}),(0,H.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault();let r=(0,fw.default)(t.feature),i=r.geometry;i.geometries.splice(a,1),i.geometries.length===1&&(r.geometry=i.geometries[0]),n({note:`Removed a geometry from a GeometryCollection`,putFeatures:[{...t,feature:r}]}).catch(e=>void 0)},title:`Delete geometry`,className:`text-red-500 opacity-40 dark:text-white group-hover:opacity-100`,children:(0,H.jsx)(Nt,{className:`w-3 h-3`})})]}),(0,H.jsx)(TL,{wrappedFeature:t,vertexId:o,geometry:e})]},a)})})]})}function lL(e){if(!e)throw Error(`coord is required`);if(!Array.isArray(e)){if(e.type===`Feature`&&e.geometry!==null&&e.geometry.type===`Point`)return[...e.geometry.coordinates];if(e.type===`Point`)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw Error(`coord must be GeoJSON Point or an Array of numbers`)}function RMe(e){if(Array.isArray(e))return e;if(e.type===`Feature`){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw Error(`coords must be GeoJSON Feature, Geometry Object or an Array`)}function uL(e){return e.type===`Feature`?e.geometry:e}function dL(e,t,n={}){var r=lL(e),i=lL(t),a=ES(i[1]-r[1]),o=ES(i[0]-r[0]),s=ES(r[1]),c=ES(i[1]),l=Math.sin(a/2)**2+Math.sin(o/2)**2*Math.cos(s)*Math.cos(c);return wS(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)}var zMe=dL;function BMe(e,t={}){return pfe(e,(e,n)=>{let r=n.geometry.coordinates;return e+dL(r[0],r[1],t)},0)}var fL=BMe,VMe=zv({areaUnits:`meters`,lengthUnits:`meters`});function pL(){let[e,t]=Zv(VMe);return{user:e,setUser:e=>{t(t=>({...t,...e}))}}}function HMe({geometry:e}){let{user:t}=pL();return(0,H.jsx)(mL,{label:`Length in`,length:fL(e,{units:t.lengthUnits})})}function UMe({features:e}){let{user:t}=pL(),n=0;for(let{feature:r}of e){let{geometry:e}=r;(e?.type===`LineString`||e?.type===`MultiLineString`)&&(n+=fL({type:`Feature`,properties:null,geometry:e},{units:t.lengthUnits}))}return n===0?null:(0,H.jsx)(mL,{label:`Total length in`,length:n})}function mL({length:e,label:t}){let{user:n,setUser:r}=pL();return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(bg,{children:t}),(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(zg,{type:`text`,readOnly:!0,"aria-label":`Length`,value:e.toFixed(3)}),(0,H.jsx)(Nse,{value:n.lengthUnits,onChange:e=>{r({lengthUnits:e})},type:`length`})]})]})}function hL({label:e,inputProps:t}){return(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`div`,{className:`pb-1 text-xs text-gray-500 dark:text-gray-200`,children:e}),(0,H.jsx)(zg,{type:`number`,...t})]})}function gL({longitudeProps:e,latitudeProps:t}){return(0,H.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2`,children:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(hL,{label:`Longitude`,inputProps:e}),(0,H.jsx)(hL,{label:`Latitude`,inputProps:{...t,min:-90,max:90}})]})})}function _L({value:e,onCommit:t,onBlur:n=dP.default,onChange:r=dP.default}){let[i,a]=(0,B.useState)(e);return(0,B.useEffect)(()=>{a(e)},[e]),{onKeyUp(n){switch(n.key){case`Escape`:a(e);break;case`Enter`:t(i);break}},onBlur(r){n(),r.target===r.currentTarget&&i!==e&&t(i)},value:i,onChange(e){a(e.currentTarget.value),r()}}}function WMe({wrappedFeature:e,vertexId:t}){let n=i_().useTransact(),r=t||new WC(0,0),[i,a]=QF(e.feature,r);return(0,H.jsx)(`div`,{children:(0,H.jsx)(gL,{longitudeProps:_L({value:i.toString(),onCommit(t){let i=+t;Number.isNaN(i)||n({note:`Manually updated point location`,putFeatures:[{...e,feature:zI({breakRectangle:!0,feature:e.feature,position:[i,a],vertexId:r}).feature}]}).catch(e=>void 0)}}),latitudeProps:_L({value:a.toString(),onCommit(t){let a=+t;Number.isNaN(a)||n({note:`Manually updated point location`,putFeatures:[{...e,feature:zI({breakRectangle:!0,feature:e.feature,position:[i,a],vertexId:r}).feature}]}).catch(e=>void 0)}})})})}function GMe(e){return dfe(e,(e,t)=>e+KMe(t),0)}function KMe(e){let t=0,n;
384switch(e.type){case`Polygon`:return vL(e.coordinates);case`MultiPolygon`:for(n=0;n<e.coordinates.length;n++)t+=vL(e.coordinates[n]);return t;case`Point`:case`MultiPoint`:case`LineString`:case`MultiLineString`:return 0}return 0}function vL(e){let t=0;if(e&&e.length>0){t+=Math.abs(bL(e[0]));for(let n=1;n<e.length;n++)t-=Math.abs(bL(e[n]))}return t}var qMe=vS*vS/2,yL=Math.PI/180;function bL(e){let t=e.length-1;if(t<=2)return 0;let n=0,r=0;for(;r<t;){let i=e[r],a=e[r+1===t?0:r+1],o=e[r+2>=t?(r+2)%t:r+2],s=i[0]*yL,c=a[1]*yL,l=o[0]*yL;n+=(l-s)*Math.sin(c),r++}return n*qMe}var xL=GMe;function JMe(){return(0,H.jsxs)(`div`,{className:`text-sm text-gray-700 bg-gray-100 dark:text-white dark:bg-black p-2 rounded-md`,children:[(0,H.jsx)($t,{className:`inline-block mr-1 text-purple-500 dark:text-purple-300`}),`Invalid Polygon: the area of this shape is negative, which means that one of its internal rings is likely larger than the outer ring.`]})}function YMe({geometry:e}){let t=xL(e);return t<=0||Number.isNaN(t)?(0,H.jsx)(JMe,{}):(0,H.jsx)(SL,{label:`Area square`,area:t})}function XMe({features:e}){let t=0;for(let{feature:n}of e)t+=xL(n);return t<=0?null:(0,H.jsx)(SL,{label:`Total area square`,area:t})}function SL({area:e,label:t}){let{user:n,setUser:r}=pL(),{areaUnits:i}=n;return(0,H.jsxs)(`div`,{className:`text-sm`,children:[(0,H.jsx)(bg,{children:t}),(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(zg,{type:`text`,"aria-label":`Area`,readOnly:!0,value:ufe(e,`meters`,i).toFixed(3)}),(0,H.jsx)(Nse,{value:i,onChange:e=>{r({areaUnits:e})},type:`area`})]})]})}function ZMe(){return{min:null,max:null,strings:new Map,sum:0,types:{number:0,string:0,boolean:0,other:0}}}function QMe(e){let t={Point:0,MultiPoint:0,Polygon:0,MultiPolygon:0,LineString:0,MultiLineString:0,GeometryCollection:0,null:0};for(let{feature:n}of e){let e=n.geometry?.type;e?t[e]++:t.null++}return t}function $Me(e){let t=new Map;for(let{feature:n}of e)if(n.properties)for(let[e,r]of Object.entries(n.properties)){let n=t.get(e);switch(n||(n=ZMe(),t.set(e,n)),typeof r){case`number`:(n.min===null||r<n.min)&&(n.min=r),(n.max===null||r>n.max)&&(n.max=r),n.sum+=r,n.types.number++;break;case`string`:n.strings.set(r,(n.strings.get(r)||0)+1),n.types.string++;break;case`boolean`:n.types.boolean++;break;default:n.types.other++;break}}return Array.from(t.entries(),([e,t])=>({property:e,stats:{...t,strings:Array.from(t.strings.entries()).sort((e,t)=>t[1]-e[1])}})).sort((e,t)=>e.property>t.property?-1:1)}function CL({features:e}){let t=(0,B.useMemo)(()=>QMe(e),[e]);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`font-bold text-sm pb-2`,children:`Geometry types`}),(0,H.jsx)(`div`,{className:`
385          grid grid-cols-2 gap-x-2 gap-y-1
386          text-xs`,style:{gridTemplateColumns:`min-content 1fr min-content 1fr`},children:Object.entries(t).map(([e,t])=>(0,H.jsxs)(B.Fragment,{children:[(0,H.jsx)(`div`,{className:`tabular-nums text-right`,children:ule(t)}),(0,H.jsx)(`div`,{children:e})]},e))})]})}function eNe({features:e}){let t=(0,B.useMemo)(()=>$Me(e),[e]);return(0,H.jsxs)(`div`,{className:`mt-2 rounded-sm p-3 dark:text-white bg-gray-100 dark:bg-gray-900 overflow-y-auto placemark-scrollbar`,style:{maxHeight:420},children:[(0,H.jsx)(CL,{features:e}),(0,H.jsx)(`div`,{className:`font-bold text-sm pt-4 pb-2`,children:`Properties`}),(0,H.jsx)(`table`,{className:`w-full border-collapse text-xs`,children:(0,H.jsx)(`tbody`,{children:t.map(({property:e,stats:t})=>{let n=`border border-gray-300 dark:border-gray-700 text-left p-2 overflow-x-auto`;return(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:`${n} align-top`,children:e}),(0,H.jsx)(`td`,{className:n,children:(0,H.jsx)(tNe,{stats:t})})]},e)})})})]})}function tNe({stats:e}){let{types:t}=e;return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{children:[t.number&&mv(`number`,t.number),t.string&&mv(`string`,t.string),t.boolean&&mv(`boolean`,t.boolean),t.other&&mv(`other value`,t.other)].filter(Boolean).join(`, `)}),t.number>0?(0,H.jsxs)(`div`,{children:[`min=`,e.min,`, max=`,e.max,`, sum=`,e.sum]}):null,t.string>0?(0,H.jsx)(`div`,{children:(0,H.jsxs)(Kp,{children:[(0,H.jsxs)(`div`,{children:[mv(`unique value`,e.strings.length),` `,(0,H.jsx)(qp,{title:`View values`,className:`align-middle inline-flex items-center opacity-50 hover:opacity-100
387                aria-expanded:opacity-100
388                aria-expanded:ring-3
389                aria-expanded:ring-1
390                aria-expanded:ring-purple-500
391                `,children:(0,H.jsx)(In,{className:`w-3 h-3`})})]}),(0,H.jsx)(vg,{children:(0,H.jsx)(nNe,{stats:e})})]})}):null]})}function nNe({stats:e}){let t=(0,B.useRef)(null),n=yP({count:e.strings.length,getScrollElement:()=>t.current,estimateSize:(0,B.useCallback)(()=>24,[])});return(0,H.jsx)(`div`,{ref:t,className:`text-xs overflow-y-auto h-48 placemark-scrollbar`,children:(0,H.jsx)(`div`,{className:`w-full relative rounded-sm`,style:{height:`${n.getTotalSize()}px`},children:n.getVirtualItems().map(t=>{let n=e.strings[t.index];return(0,H.jsxs)(`div`,{className:`absolute whitespace-nowrap top-0 left-0 `,style:{height:`${t.size}px`,transform:`translateY(${t.start}px)`},children:[n[0],` `,(0,H.jsxs)(`span`,{className:`select-none opacity-50`,children:[`(`,n[1],`)`]}
391)]},t.index)})})})}function wL({geometry:e}){return tC(e,!1).mapOrDefault(e=>(0,H.jsxs)(bg,{children:[`Bounding box`,(0,H.jsx)(zg,{type:`text`,readOnly:!0,value:iC(e)})]}),null)}function TL({wrappedFeature:e,geometry:t,vertexId:n}){return t.type===`Polygon`||t.type===`MultiPolygon`?(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(wL,{geometry:t}),(0,H.jsx)(YMe,{geometry:t})]}):t.type===`LineString`||t.type===`MultiLineString`?(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(wL,{geometry:t}),(0,H.jsx)(HMe,{geometry:t})]}):t.type===`Point`?(0,H.jsx)(WMe,{vertexId:n,wrappedFeature:e}):t.type===`GeometryCollection`?(0,H.jsx)(LMe,{geometry:t,wrappedFeature:e}):null}function rNe({wrappedFeatures:e}){return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`div`,{className:`text-sm`,children:mv(`feature`,e.length)}),(0,H.jsx)(`div`,{children:(0,H.jsx)(CL,{features:e})}),(0,H.jsx)(XMe,{features:e}),(0,H.jsx)(UMe,{features:e})]})}function iNe({geometry:e}){return(0,H.jsx)(Vg,{children:mv(`Vertex`,KC(e),!0,`Vertices`)})}var aNe=(0,B.memo)(function({wrappedFeatures:e}){if(e.length===1){let[t]=e,n=t.feature.geometry;return n===null?(0,H.jsx)(`div`,{className:`space-y-2`,children:(0,H.jsx)(Vg,{children:`This feature has no geometry`})}):(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(TL,{wrappedFeature:t,geometry:n}),(0,H.jsx)(iNe,{geometry:n})]})}return(0,H.jsx)(`div`,{className:`space-y-2`,children:(0,H.jsx)(rNe,{wrappedFeatures:e})})});function EL({children:e,...t}){return(0,H.jsx)(`div`,{className:`h-10 w-12 p-1
392          group bn
393          flex items-stretch justify-center focus:outline-hidden`,children:(0,H.jsx)(ym,{asChild:!0,...t,children:(0,H.jsx)(Bp,{asChild:!0,children:(0,H.jsxs)(Fg,{variant:`quiet`,children:[e,(0,H.jsx)(at,{className:`w-3 h-3`})]})})})})}function oNe(){let e=Yv(qx);return e.length===0?null:(0,H.jsxs)(`div`,{className:`flex items-center`,children:[(0,H.jsxs)(`div`,{className:`h-12 self
393-stretch flex items-center text-xs pr-2 text-gray-700 dark:text-white`,children:[mv(`feature`,e.length),` selected`]}),e.length>1?(0,H.jsxs)(zp,{children:[(0,H.jsxs)(vm,{children:[(0,H.jsx)(EL,{"aria-label":`Operations`,children:(0,H.jsx)(UF,{})}),(0,H.jsxs)(fg,{children:[(0,H.jsx)(gg,{}),(0,H.jsx)(`div`,{className:`whitespace-nowrap`,children:`Union features`})]})]}),(0,H.jsx)(Sg,{align:`start`,children:(0,H.jsx)(FMe,{selectedWrappedFeatures:e,as:`dropdown-item`})})]}):null,(0,H.jsx)(UL,{selectedWrappedFeatures:e,as:`root`}),(0,H.jsx)(vm,{children:(0,H.jsxs)(Kp,{children:[(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(`div`,{className:`h-10 w-10 p-1
394                  group bn
395                  flex items-stretch justify-center focus:outline-hidden`,children:(0,H.jsx)(qp,{asChild:!0,"aria-label":`Measurements`,children:(0,H.jsx)(Fg,{variant:`quiet`,children:(0,H.jsx)(or,{})})})})}),(0,H.jsxs)(fg,{side:`bottom`,children:[(0,H.jsx)(gg,{}),(0,H.jsx)(`div`,{className:`whitespace-nowrap`,children:`Geometry information`})]}),(0,H.jsx)(vg,{size:`md`,children:(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(Yp,{"aria-label":`Close`,className:`absolute top-0 right-1 dark:text-white`,children:(0,H.jsx)(kt,{})}),(0,H.jsx)(`div`,{className:`pt-4`,children:(0,H.jsx)(aNe,{wrappedFeatures:e})})]})})]})})]})}function sNe(e){let{feature:{geometry:t}}=e;return t?.type===`Polygon`||t?.type===`MultiPolygon`||t?.type===`LineString`||t?.type===`MultiLineString`}function cNe(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function lNe(e,t,n){let r=t[0],i=t[1],a=n[0]-r,o=n[1]-i;if(a!==0||o!==0){let t=((e[0]-r)*a+(e[1]-i)*o)/(a*a+o*o);t>1?(r=n[0],i=n[1]):t>0&&(r+=a*t,i+=o*t)}return a=e[0]-r,o=e[1]-i,a*a+o*o}function uNe(e,t){let n=e[0],r=[n],i;for(let a=1,o=e.length;a<o;a++)i=e[a],cNe(i,n)>t&&(r.push(i),n=i);return n!==i&&i&&r.push(i),r}function DL(e,t,n,r,i){let a=r,o=0;for(let r=t+1;r<n;r++){let i=lNe(e[r],e[t],e[n]);i>a&&(o=r,a=i)}a>r&&(o-t>1&&DL(e,t,o,r,i),i.push(e[o]),n-o>1&&DL(e,o,n,r,i))}function dNe(e,t){let n=e.length-1,r=[e[0]];return DL(e,0,n,t,r),r.push(e[n]),r}function OL(e,{tolerance:t,highQuality:n}){if(e.length<=2)return e;let r=t===void 0?1:t*t;return e=n?e:uNe(e,r),e=dNe(e,r),e}function fNe(e,t){return xC(e)&&e.properties&&delete e.properties[`@circle`],{...e,geometry:pNe(e.geometry,t)}}function pNe(e,t){return BC(e).with({type:`LineString`},e=>({...e,coordinates:OL(e.coordinates,t)})).with({type:`MultiLineString`},e=>({...e,coordinates:e.coordinates.map(e=>OL(e,t))})).with({type:`Polygon`},e=>({...e,coordinates:kL(e.coordinates,t)})).with({type:`MultiPolygon`},e=>({...e,coordinates:e.coordinates.map(e=>kL(e,t))})).exhaustive()}var mNe=10;function kL(e,t){let{tolerance:n}=t;return e.map(e=>{if(e.length<4)throw Error(`invalid polygon`);let r=OL(e,t),i=0;for(;!hNe(r);)if(n-=n*.01,r=OL(e,{...t,tolerance:n}
395),++i>mNe){r=e;break}return(r[r.length-1][0]!==r[0][0]||r[r.length-1][1]!==r[0][1])&&r.push(r[0]),r})}function hNe(e){return e.length<3?!1:!(e.length===3&&e[2][0]===e[0][0]&&e[2][1]===e[0][1])}function AL(e){let t=i_().useTransact(),[n,r]=Zv(Jx),i=Xv(Ux);if(!e.length)return[];let a=e.filter(e=>{let t=e.feature.geometry?.type;return t===`Polygon`||t===`MultiPolygon`}),o={label:`Convert to line`,icon:(0,H.jsx)($e,{}),applicable:!!a.length,onSelect:async function(){await t({note:`Converted to a line`,track:`feature-convert-to-line`,putFeatures:a.map(e=>({...e,feature:oMe(e.feature)}))})}},s=e.filter(e=>sNe(e)),c={label:`Simplify`,applicable:!!s.length,icon:(0,H.jsx)(Dt,{}),onSelect:async()=>{i({type:`simplify`,features:s})}},l={label:`Add convex hull`,applicable:!(e.length===1&&e[0].feature.geometry?.type===`Point`),icon:(0,H.jsx)(fje,{}),onSelect:async function(){await Xje(e.map(e=>e.feature)).caseOf({Left(e){return pE.error(e.message),Promise.resolve(void 0)},Right(n){return t({note:`Added a convex hull`,track:`operation-add-convex-hull`,putFeatures:[{id:VC(),folderId:e[0]?.folderId||null,feature:n}]}).catch(e=>void 0)}})}},u=e.filter(e=>{let t=e.feature.geometry?.type;if(t)return t!==`Point`&&t!==`MultiPoint`}),d={label:`Convert to points`,applicable:!!u.length,icon:(0,H.jsx)(Vt,{}),onSelect:async function(){let e=[];for(let t of u){let n=vje(t.feature);n&&e.push({...t,feature:n})}e.length!==0&&await t({note:`Converted to points`,track:`operation-convert-to-points`,putFeatures:e})}},f={applicable:e.length>1||e[0].feature.geometry?.type!==`Point`,label:`Add extent box`,icon:(0,H.jsx)(tt,{}),onSelect:async function(){await tC(e.map(e=>e.feature)).mapOrDefault(n=>{let i=VC();return t({note:`Added an extent box`,deleteFeatures:[],track:`operation-add-extent-box`,putFeatures:[{id:i,folderId:e[0].folderId,feature:{type:`Feature`,properties:{},geometry:nC(n)}}]}).then(()=>{r(U.single(i))})},null)}};return[d,{label:`Split line at vertex`,applicable:!!(e.length===1&&e[0].feature.geometry?.type===`LineString`&&n.type===`single`&&n.parts.length),icon:(0,H.jsx)(Ze,{}),onSelect:async function(){let r=PMe({feature:e[0].feature,sel:n});r.length!==0&&await t({note:`Split a line`,deleteFeatures:[e[0].id],track:`operation-split-line`,putFeatures:r.map(t=>({id:VC(),folderId:e[0].folderId,feature:t}))})}},f,o,l,c]}function jL({as:e,selectedWrappedFeatures:t}){let n=AL(t).filter(e=>e.applicable);return n.length?n.map((t,n)=>(0,H.jsx)(sL,{as:e,action:t},n)):e===`context-item`?null:(0,H.jsx)(sL,{as:e,action:{label:`No actions available`,icon:(0,H.jsx)(Or,{}),applicable:!0,onSelect:()=>Promise.resolve()}})}function gNe(e,t){let[n]=qC(e,t);if(t=YF(t,n),eL(t,[{op:`remove`,path:n}]),t.geometry===null)return null;let r=dC(t.geometry);return r?{...t,geometry:r}:null}function _Ne(e){return e.slice().sort((e,t)=>t.vertex-e.vertex)}function vNe(e,t,n){let r=e.id,i=Ex(n,r),a=[];for(let e of t.values())e.folderId&&i.has(e.folderId)&&a.push(e.id);return{newSelection:U.none(),moment:{...oy,note:`Deleted a folder of features`,deleteFolders:[...i],deleteFeatures:a}}}function yNe(e,t){if(e.type===`single`&&e.parts.length){let n=t.get(e.id);if(!n)return{newSelection:U.none(),moment:oy};let r=(0,fw.default)(n.feature),i=_Ne(e.parts);for(let t of i)if(r=gNe(t,r),r===null)return{newSelection:U.none(),moment:{...oy,note:`Deleted a feature`,deleteFeatures:[e.id]}};return{newSelection:U.single(e.id),moment:{...oy,note:`Deleted features`,putFeatures:[{...n,feature:r}]}}}let n=U.toIds(e);return n.length===0?{newSelection:U.none(),moment:oy}:{newSelection:U.none(),moment:{...oy,note:`Deleted features`,deleteFeatures:n.slice()}}}function ML({featureMap:e,selection:t,folderMap:n}){switch(t.type){case`folder`:return vNe(t,e,n);case`none`:return{newSelection:U.none(),moment:oy};case`multi`:case`single`:return yNe(t,e)}}function bNe(e){let t=[],n=[];for(let r of e){let e=xNe(r.feature);e!==null&&(n.push(r.id),t=t.concat(e.map(e=>({id:VC(),folderId:r.folderId,feature:e}))))}return{putFeatures:t,deleteFeatures:n}}function xNe(e){let t=e.properties;if(e.geometry===null)return null;switch(e.geometry.type){case`Point`:case`LineString`:case`Polygon`
395:return null;case`GeometryCollection`:return e.geometry.geometries.map(e=>({type:`Feature`,properties:t,geometry:e}));case`MultiLineString`:return e.geometry.coordinates.map(e=>({type:`Feature`,properties:t,geometry:{type:`LineString`,coordinates:e}}));case`MultiPolygon`:return e.geometry.coordinates.map(e=>({type:`Feature`,properties:t,geometry:{type:`Polygon`,coordinates:e}}));case`MultiPoint`:return e.geometry.coordinates.map(e=>({type:`Feature`,properties:t,geometry:{type:`Point`,coordinates:e}}))}}var NL=Math.PI/180,PL=180/Math.PI,FL=class e{lon;lat;x;y;constructor([e,t]){this.lon=e,this.lat=t,this.x=NL*e,this.y=NL*t}view(){return String(this.lon).slice(0,4)+`,`+String(this.lat).slice(0,4)}antipode(){let t=-1*this.lat,n=this.lon<0?180+this.lon:(180-this.lon)*-1;return new e([n,t])}},SNe=class{length;coords;constructor(){this.coords=[],this.length=0}move_to(e){this.length++,this.coords.push(e)}},CNe=class{geometries;constructor(){this.geometries=[]}json(){if(this.geometries.length<=0)return null;if(this.geometries.length==1)return{type:`LineString`,coordinates:this.geometries[0].coords};{let e=[];for(let t=0;t<this.geometries.length;t++)e.push(this.geometries[t].coords);return{type:`MultiLineString`,coordinates:e}}}},wNe=class{start;end;g;constructor(e,t){this.start=new FL(e),this.end=new FL(t);let n=this.start.x-this.end.x,r=this.start.y-this.end.y,i=Math.sin(r/2)**2+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.sin(n/2)**2;if(this.g=2*Math.asin(Math.sqrt(i)),this.g==Math.PI)throw Error(`it appears `+this.start.view()+` and `+this.end.view()+` are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite`);if(isNaN(this.g))throw Error(`Could not calculate great circle between ${e.join(`,`)} and ${t.join(`,`)}`)}interpolate(e){let t=Math.sin((1-e)*this.g)/Math.sin(this.g),n=Math.sin(e*this.g)/Math.sin(this.g),r=t*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=t*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),a=t*Math.sin(this.start.y)+n*Math.sin(this.end.y),o=PL*Math.atan2(a,Math.sqrt(r**2+i**2));return[PL*Math.atan2(i,r),o]}arc(e,t){let n=[];if(!e||e<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else{let t=1/(e-1);for(let r=0;r<e;++r){let e=t*r,i=this.interpolate(e);n.push(i)}}let r=!1,i=0,a=t&&t.offset?t.offset:10,o=180-a,s=-180+a,c=360-a;for(let e=1;e<n.length;++e){let t=n[e-1][0],a=n[e][0],l=Math.abs(a-t);l>c&&(a>o&&t<s||t>o&&a<s)?r=!0:l>i&&(i=l)}let l=[];if(r&&i<a){let e=[];l.push(e);for(let t=0;t<n.length;++t){let r=n[t][0];if(t>0&&Math.abs(r-n[t-1][0])>c){let i=n[t-1][0],a=n[t-1][1],c=n[t][0],u=n[t][1];if(i>-180&&i<s&&c==180&&t+1<n.length&&n[t-1][0]>-180&&n[t-1][0]<s){e.push([-180,n[t][1]]),t++,e.push([n[t][0],n[t][1]]);continue}else if(i>o&&i<180&&c==-180&&t+1<n.length&&n[t-1][0]>o&&n[t-1][0]<180){e.push([180,n[t][1]]),t++,e.push([n[t][0],n[t][1]]);continue}if(i<s&&c>o){let e=i;i=c,c=e;let t=a;a=u,u=t}if(i>o&&c<s&&(c+=360),i<=180&&c>=180&&i<c){let r=(180-i)/(c-i),s=r*u+(1-r)*a;e.push([n[t-1][0]>o?180:-180,s]),e=[],e.push([n[t-1][0]>o?-180:180,s]),l.push(e)}else e=[],l.push(e);e.push([r,n[t][1]])}else e.push([n[t][0],n[t][1]])}}else{let e=[];l.push(e);for(let t=0;t<n.length;++t)e.push([n[t][0],n[t][1]])}let u=new CNe;for(let e=0;e<l.length;++e){let t=new SNe;u.geometries.push(t);let n=l[e];for(let e=0;e<n.length;++e)t.move_to(n[e])}return u.json()}};function TNe(e){if(e.length!==2)return ue(new he(`Two features required`));let[{feature:{geometry:t}},{feature:{geometry:n}}]=e;return t?.type===`Point`&&n?.type===`Point`?pe.encase(()=>{let r=new wNe(t.coordinates,n.coordinates).arc(100),i=VC();return{newSelection:U.single(i),moment:{...oy,note:`Drew an arc`,track:`operation-arc`,putFeatures:[{id:i,feature:{type:`Feature`,properties:{},geometry:r},folderId:e[0].folderId}]}}}):ue(new he(`Both geometries must be points to create an arc`))}var ENe=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=(e<<1)+1,a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}};function IL(e,t=1,n=!1){let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let[t,n]of e[0])t<r&&(r=t),n<i&&(i=n),t>a&&(a=t),n>o&&(o=n);let s=a-r,c=o-i,l=Math.max(t,Math.min(s,c));if(l===t){let e=[r,i];return e.distance=0,e}let u=new ENe([],(e,t)=>t.max-e.max),d=ONe(e),f=new LL(r+s/2,i+c/2,0,e);f.d>d.d&&(d=f);let p=2;function m(r,i,a){let o=new LL(r,i,a,e);p++,o.max>d.d+t&&u.push(o),o.d>d.d&&(d=o,n&&console.log(`found best ${Math.round(1e4*o.d)/1e4} after ${p} probes`))}let h=l/2;for(let e=r;
395e<a;e+=l)for(let t=i;t<o;t+=l)m(e+h,t+h,h);for(;u.length;){let{max:e,x:n,y:r,h:i}=u.pop();if(e-d.d<=t)break;h=i/2,m(n-h,r-h,h),m(n+h,r-h,h),m(n-h,r+h,h),m(n+h,r+h,h)}n&&console.log(`num probes: ${p}\nbest distance: ${d.d}`);let g=[d.x,d.y];return g.distance=d.d,g}function LL(e,t,n,r){this.x=e,this.y=t,this.h=n,this.d=DNe(e,t,r),this.max=this.d+this.h*Math.SQRT2}function DNe(e,t,n){let r=!1,i=1/0;for(let a of n)for(let n=0,o=a.length,s=o-1;n<o;s=n++){let o=a[n],c=a[s];o[1]>t!=c[1]>t&&e<(c[0]-o[0])*(t-o[1])/(c[1]-o[1])+o[0]&&(r=!r),i=Math.min(i,kNe(e,t,o,c))}return i===0?0:(r?1:-1)*Math.sqrt(i)}function ONe(e){let t=0,n=0,r=0,i=e[0];for(let e=0,a=i.length,o=a-1;e<a;o=e++){let a=i[e],s=i[o],c=a[0]*s[1]-s[0]*a[1];n+=(a[0]+s[0])*c,r+=(a[1]+s[1])*c,t+=c*3}let a=new LL(n/t,r/t,0,e);return t===0||a.d<0?new LL(i[0][0],i[0][1],0,e):a}function kNe(e,t,n,r){let i=n[0],a=n[1],o=r[0]-i,s=r[1]-a;if(o!==0||s!==0){let n=((e-i)*o+(t-a)*s)/(o*o+s*s);n>1?(i=r[0],a=r[1]):n>0&&(i+=o*n,a+=s*n)}return o=e-i,s=t-a,o*o+s*s}function RL(e,t){return{id:VC(),feature:{type:`Feature`,properties:e.feature.properties,geometry:{type:`Point`,coordinates:t}},folderId:e.folderId}}function ANe(e){let t=e.flatMap(e=>{let t=e.feature.geometry;if(t)switch(t.type){case`MultiPolygon`:return t.coordinates.map(t=>RL(e,IL(t)));case`Polygon`:return RL(e,IL(t.coordinates));default:return[]}return[]});return{newSelection:U.fromIds(t.map(e=>e.id)),moment:{...oy,note:`Added label points`,track:`operation-label-points`,putFeatures:t}}}function zL(e,t){for(let n=0;n<e.length-1;n++){let r=e[n];t[0]+=r[0],t[1]+=r[1],t[2]++}return t}function BL([e,t,n]){return[e/n,t/n]}function jNe(e){let t=e.flatMap(e=>{let t=e.feature.geometry;if(t){let n=[0,0,0];switch(t.type){case`MultiPolygon`:for(let e of t.coordinates)for(let t of e)zL(t,n);return[RL(e,BL(n))];case`Polygon`:for(let e of t.coordinates)zL(e,n);return[RL(e,BL(n))];default:return[]}}return[]});return{newSelection:U.fromIds(t.map(e=>e.id)),moment:{...oy,note:`Added centroids`,track:`operation-centroids`,putFeatures:t}}}function MNe(e){let t=e.map(e=>({...e,id:VC()}));return{moment:{...oy,note:`Duplicated features`,putFeatures:t},newSelection:U.fromIds(t.map(e=>e.id))}}function NNe(e,t){let n=Ex(e.folderMap,t),r=new Map;for(let e of n)r.set(e,VC());let i=[];for(let t of n){let n=e.folderMap.get(t);n&&i.push({...n,id:r.get(t),folderId:n.folderId===null?null:r.get(n.folderId)||n.folderId})}let a=[];for(let t of e.featureMap.values())t.folderId&&n.has(t.folderId)&&a.push({...t,id:VC(),folderId:t.folderId?r.get(t.folderId):null});return{moment:{...oy,note:`Duplicated features`,putFeatures:a,putFolders:i},newSelection:U.folder(r.get(t))}}function VL(e){switch(e.selection.type){case`folder`:return NNe(e,e.selection.id);case`none`:return{newSelection:U.none(),moment:oy};case`multi`:case`single`:return MNe(U.getSelectedFeatures(e))}}function HL(e){let t=i_().useTransact(),n=e.map(e=>e.feature),r=hje(n),i=Xv(Ux),a=fC(),o={label:`Buffer`,applicable:!0,icon:(0,H.jsx)(Ue,{}),onSelect:function(){return i({type:`buffer`,features:e}),Promise.resolve()}},s=new Set([`Polygon`,`MultiPolygon`]),c=n.some(e=>e.geometry?.type&&s.has(e.geometry?.type)),l=ny((0,B.useCallback)(async(n,r)=>{let{newSelection:i,moment:a}=jNe(e);return r(Jx,i),t(a)},[t,e])),u={label:`Create centroids`,applicable:c,icon:(0,H.jsx)(zt,{}),onSelect:l},d=ny((0,B.useCallback)(async(n,r)=>{let{newSelection:i,moment:a}=ANe(e);return r(Jx,i),t(a)},[t,e])),f={label:`Create label points`,applicable:c,icon:(0,H.jsx)(vr,{}),onSelect:d},p=ny((0,B.useCallback)(async(n,r)=>TNe(e).caseOf({Left(e){pE.error(e.message)},Right({newSelection:e,moment:n}){return r(Jx,e),t(n)}}),[t,e])),m={label:`Draw great arc`,applicable:n.length===2&&n.every(e=>e.geometry?.type===`Point`),icon:(0,H.jsx)(mn,{}),onSelect:p},h=ny((0,B.useCallback)(async(e,n)=>{let{newSelection:r,moment:i}=VL(e(Wx));n(Jx,r),await t(i)},[t])),g={label:`Duplicate features`,applicable:!0,icon:(0,H.jsx)(Tt,{}),onSelect:h},_=ny((0,B.useCallback)(async(e,n)=>{let{newSelection:r,moment:i}=ML(e(Wx));n(Jx,r),await t(i)},[t])),v={label:`Delete features`,variant:`destructive`,applicable:!0,icon:(0,H.jsx)(Sr,{}),onSelect:_},y={icon:(0,H.jsx)(Ft,{}),applicable:!0,label:`Zoom to`,onSelect:function(){return Promise.resolve(a(e))}},b={icon:(0,H.jsx)(Rn,{}),applicable:r===mje.Yes,label:`Add inner ring-3 to polygon`,onSelect:async function(){return await gje(n[0],n[1]).caseOf({Left(e){return Promise.resolve(void pE.error(e.message))},Right(n){return t({note:`Added an innner ring-3 to a polygon`,track:`operation-add-polygon-inner-ring`,deleteFeatures:[e[0].id,e[1].id],putFeatures:n.map(t=>({id:VC(),folderId:e[0].folderId,feature:t}))})}})}};return[y,{icon:(0,H.jsx)(On,{}),applicable:n.some(e=>e.geometry!==null&&I.has(e.geometry?.type)),label:n.length===1?n[0]?.geometry?.type===`GeometryCollection`?`Split GeometryCollection`:`Divide into ${te[n[0]?.geometry?.type||`LineString`]}s`:`Divide features`,onSelect:async function(){let{putFeatures:n,deleteFeatures:r}=bNe(e);await t({note:`Divided multi-features into single features`,track:`operation-divide-multi-features`,deleteFeatures:r,putFeatures:n})}},b,o,g,m,v,u,f]}function UL({as:e,selectedWrappedFeatures:t}){let n=HL(t);return(0,H.jsxs)(H.Fragment,{children:[e===`context-item`?(0,H.jsx)(jL,{selectedWrappedFeatures:t,as:e}):(0,H.jsxs)(zp,{children:[(0,H.jsxs)(vm,{children:[(0,H.jsx)(EL,{"aria-label":`Operations`,children:(0,H.jsx)(Bn,{})}),(0,H.jsxs)(fg,{side:`bottom`,children:[(0,H.jsx)(gg,{}),(0,H.jsx)(`div`,{className:`whitespace-nowrap`,children:`Geometry operations`})]})]}),(0,H.jsx)(Sg,{align:`start`,children:(0,H.jsx)(jL,{selectedWrappedFeatures:t,as:`dropdown-item`})})]}),n.filter(e=>e.applicable).map((t,n)=>(0,H.jsx)(sL,{as:e,action:t},n))]})}var PNe=`px-4 py-3
396          text-black dark:text-white
397          block w-full
398          text-lg
399          bg-gray-100 dark:bg-gray-900
400          border-none
401          ring-0`,FNe=`bg-gray-200 dark:bg-gray-800
402      p-2 flex items-center gap-x-1 text-xs
403      text-gray-700 dark:text-gray-200 w-full`;function INe({item:e,active:t}){let n=BC(e).with({type:`Feature`},e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(In,{className:`opacity-30`}),(0,H.jsx)(`div`,{className:`truncate`,children:e.properties.label})]})).with({type:`extent`},e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(gn,{className:`opacity-30`}),`Pan to `,e.name]})).with({type:`coordinate`},e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(cr,{className:`opacity-30`}),`Pan to `,e.name]})).with({type:`action`},e=>(0,H.jsxs)(H.Fragment,{children:[e.action.icon,(0,H.jsx)(`div`,{className:`truncate`,children:e.action.label})]})).with({type:`wrappedFeature`},e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(cr,{className:`opacity-30`}),(0,H.jsxs)(`div`,{className:`truncate`,children:[e.result.item.feature.geometry?.type||``,` feature`,LNe(e.result.matches)]})]})).with({type:`leaf`},e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(mn,{className:`opacity-30`}),e.data.name]})).with({type:`container`},e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(uje,{className:`opacity-30`}),e.data.name]})).exhaustive();return(0,H.jsx)(`div`,{className:`
404                px-3 py-2
405                text-sm text-left
406                dark:text-gray-50
407                cursor-pointer
408                grid gap-x-1 items-center
409                text-black dark:text-white ${t?`bg-purple-200 dark:bg-purple-400 dark:text-black`:`hover:bg-purple-200 dark:hover:bg-purple-400 dark:hover:text-black`}`,style:{gridTemplateColumns:`1rem auto`},children:n})}function WL({results:e,title:t}){return e.length?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{style:{fontSize:10},className:`uppercase text-gray-500 pl-4 pt-2`,children:t}),e.map((e,t)=>(0,H.jsx)(HF.Option,{value:e,children:({active:t})=>(0,H.jsx)(INe,{item:e,active:t})},t))]}):null}function LNe(e){if(!e?.length)return null;let t=e[0];return(0,H.jsxs)(`span`,{children:[` `,`with`,` `,(0,H.jsxs)(`span`,{className:`font-mono`,children:[dv(t.key||``,64),`: `,dv(t.value||``,64)]})]})}function GL(e,t){Array.isArray(t)&&(t=t[0]);let n=e.feature.properties?.[t];return n===void 0?``:typeof n==`string`?n:JSON.stringify(n)}function KL({featureMap:e,folderId:t,virtualColumns:n}){let r=new Set;for(let{feature:n,folderId:i}of e.values())if(t===null||t===i){if(n.properties===null)continue;for(let e in n.properties)r.add(e)}for(let e of n)r.add(e);return Array.from(r)}function RNe({featureMap:e,folderId:t,virtualColumns:n}){return(0,B.useMemo)(()=>KL({featureMap:e,folderId:t,virtualColumns:n}),[e,e.version,t,n])}var zNe=Object.create,qL=Object.defineProperty,BNe=Object.getOwnPropertyDescriptor,VNe=Object.getOwnPropertyNames,HNe=Object.getPrototypeOf,JL=Object.prototype.hasOwnProperty,YL=(e,t)=>()=>(t||(e((t={exports:{}}
vendor: 4,674 bytes, line 409
409).exports,t),e=null),t.exports),UNe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=VNe(t),a=0,o=i.length,s;a<o;a++)s=i[a],!JL.call(e,s)&&s!==n&&qL(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=BNe(t,s))||r.enumerable});return e},WNe=(e,t,n)=>(n=e==null?{}:zNe(HNe(e)),UNe(t||!e||!e.__esModule||!JL.call(e,`default`)?qL(n,`default`,{value:e,enumerable:!0}):n,e));function K(e,t){this.x=e,this.y=t}K.prototype={clone(){return new K(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround(e,t){let n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),a=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:K},K.convert=function(e){if(e instanceof K)return e;if(Array.isArray(e))return new K(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new K(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};function GNe(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let n=e;for(let r=0;r<8;r++){let r=((o*n+a)*n+i)*n-e;if(Math.abs(r)<t)return((l*n+c)*n+s)*n;let u=(3*o*n+2*a)*n+i;if(Math.abs(u)<1e-6)break;n-=r/u}let r=0,u=1;n=e;for(let s=0;s<20;s++){let s=((o*n+a)*n+i)*n;if(Math.abs(s-e)<t)break;e>s?r=n:u=n,n=(r+u)*.5}return((l*n+c)*n+s)*n}}var XL;function ZL(){return XL??=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,XL}var QL;function KNe(){if(QL==null&&(QL=!1,ZL())){let e=new OffscreenCanvas(5,5).getContext(`2d`,{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let n=t*4;e.fillStyle=`rgb(${n},${n+1},${n+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){QL=!0;break}}}return QL||!1}var $L=typeof Float32Array<`u`?Float32Array:Array;Math.PI/180,180/Math.PI;function eR(){var e=new $L(9);return $L!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function qNe(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*(l*a-o*c)+n*(-l*i+o*s)+r*(c*i-a*s)}function JNe(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function YNe(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,d=r*s,f=i*o,p=i*s,m=i*c,h=a*o,g=a*s,_=a*c;return e[0]=1-d-m,e[3]=u-_,e[6]=f+g,e[1]=u+_,e[4]=1-l-m,e[7]=p-h,e[2]=f-g,e[5]=p+h,e[8]=1-l-d,e}function tR(){var e=new $L(16);return $L!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function nR(e){var t=new $L(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function XNe(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[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function rR(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10
vendor: 15,314 bytes, line 409
409]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function iR(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(A=1/A,e[0]=(s*k-c*O+l*D)*A,e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null}function aR(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}function oR(e,t,n){var r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*r+u*i+m*a+t[12],e[13]=s*r+d*i+h*a+t[13],e[14]=c*r+f*i+g*a+t[14],e[15]=l*r+p*i+_*a+t[15]),e}function sR(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function cR(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e}function lR(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-l*r,e[1]=o*i-u*r,e[2]=s*i-d*r,e[3]=c*i-f*r,e[8]=a*r+l*i,e[9]=o*r+u*i,e[10]=s*r+d*i,e[11]=c*r+f*i,e}function uR(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e}function ZNe(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function QNe(e,t,n,r,i){var a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){var o=1/(r-i);e[10]=(i+r)*o,e[14]=2*i*r*o}else e[10]=-1,e[14]=-2*r;return e}var dR=QNe;function $Ne(e,t,n,r,i,a,o){var s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e}var fR=$Ne;function ePe(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],h=e[13],g=e[14],_=e[15],v=t[0],y=t[1],b=t[2],x=t[3],S=t[4],C=t[5],w=t[6],T=t[7],E=t[8],D=t[9],O=t[10],k=t[11],A=t[12],j=t[13],M=t[14],N=t[15];return Math.abs(n-v)<=1e-6*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=1e-6*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-S)<=1e-6*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-C)<=1e-6*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(c-w)<=1e-6*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(l-T)<=1e-6*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(d-D)<=1e-6*Math.max(1,Math.abs(d),Math.abs(D))&&Math.abs(f-O)<=1e-6*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(p-k)<=1e-6*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(m-A)<=1e-6*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(h-j)<=1e-6*Math.max(1,Math.abs(h),Math.abs(j))&&Math.abs(g-M)<=1e-6*Math.max(1,Math.abs(g),Math.abs(M))&&Math.abs(_-N)<=1e-6*Math.max(1,Math.abs(_),Math.abs(N))}function pR(){var e=new $L(3);return $L!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function mR(e){var t=new $L(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function hR(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}function gR(e,t,n){var r=new $L(3);return r[0]=e,r[1]=t,r[2]=n,r}function _R(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function tPe(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function vR(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function yR(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function nPe(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function bR(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function xR(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function SR(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e}function rPe(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o||=1,e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}function iPe(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}function CR(e,t,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=t[0],c=t[1],l=t[2],u=i*l-a*c,d=a*s-r*l,f=r*c-i*s;return u+=u,d+=d,f+=f,e[0]=s+o*u+i*f-a*d,e[1]=c+o*d+a*u-r*f,e[2]=l+o*f+r*d-i*u,e}function wR(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function TR(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function ER(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function aPe(e){return e[0]=0,e[1]=0,e[2]=0,e}var DR=tPe,OR=hR;(function(){var e=pR();return function(t,n,r,i,a,o){var s,c;for(n||=3,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}})();function oPe(){var e=new $L(4);return $L!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function sPe(e,t,n,r){var i=new $L(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}function cPe(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function lPe(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function uPe(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o,e}function kR(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}var dPe=cPe;(function(){var e=oPe();return function(t,n,r,i,a,o){var s,c;for(n||=4,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}})();function AR(){var e=new $L(4);return $L!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function fPe(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function pPe(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=n[0],c=n[1],l=n[2],u=n[3];return e[0]=r*u+o*s+i*l-a*c,e[1]=i*u+o*c+a*s-r*l,e[2]=a*u+o*l+r*c-i*s,e[3]=o*u-r*s-i*c-a*l,e}function jR(e,t,n,r){var i=t[0],a=t[1],o=t[2],s=t[3],c=n[0],l=n[1],u=n[2],d=n[3],f,p=i*c+a*l+o*u+s*d,m,h,g;return p<0&&(p=-p,c=-c,l=-l,u=-u,d=-d),1-p>1e-6?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-r)*f)/m,g=Math.sin(r*f)/m):(h=1-r,g=r),e[0]=h*i+g*c,e[1]=h*a+g*l,e[2]=h*o+g*u,e[3]=h*s+g*d,e}function mPe(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+o]-t[o*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[o]=(t[o*3+i]+t[i*3+o])*r}return e}function MR(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`zyx`,a=Math.PI/360;t*=a,r*=a,n*=a;var o=Math.sin(t),s=Math.cos(t),c=Math.sin(n),l=Math.cos(n),u=Math.sin(r),d=Math.cos(r);switch(i){case`xyz`:e[0]=o*l*d+s*c*u,e[1]=s*c*d-o*l*u,e[2]=s*l*u+o*c*d,e[3]=s*l*d-o*c*u;break;case`xzy`:e[0]=o*l*d-s*c*u,e[1]=s*c*d-o*l*u,e[2]=s*l*u+o*c*d,e[3]=s*l*d+o*c*u;break;case`yxz`:e[0]=o*l*d+s*c*u,e[1]=s*c*d-o*l*u,e[2]=s*l*u-o*c*d,e[3]=s*l*d+o*c*u;break;case`yzx`:e[0]=o*l*d+s*c*u,e[1]=s*c*d+o*l*u,e[2]=s*l*u-o*c*d,e[3]=s*l*d-o*c*u;break;case`zxy`:e[0]=o*l*d-s*c*u,e[1]=s*c*d+o*l*u,e[2]=s*l*u+o*c*d,e[3]=s*l*d-o*c*u;break;case`zyx`:e[0]=o*l*d-s*c*u,e[1]=s*c*d+o*l*u,e[2]=s*l*u-o*c*d,e[3]=s*l*d+o*c*u;break;default:throw Error(`Unknown angle order `+i)}return e}var NR=sPe,PR=uPe;(function(){var e=pR(),t=gR(1,0,0),n=gR(0,1,0);return function(r,i,a){var o=xR(i,a);return o<-.999999?(SR(e,t,i),OR(e)<1e-6&&SR(e,n,i),bR(e,e),fPe(r,e,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(SR(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+o,PR(r,r))}})(),function(){var e=AR(),t=AR();return function(n,r,i,a,o,s){return jR(e,r,o,s),jR(t,i,a,s),jR(n,e,t,2*s*(1-s)),n}}(),function(){var e=eR();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],PR(t,mPe(t,e))}}();function FR(){var e=new $L(2);return $L!=Float32Array&&(e[0]=0,e[1]=0),e}function IR(e,t){var n=new $L(2);return n[0]=e,n[1]=t,n}function LR(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function RR(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function hPe(e){var t=e[0],n=e[1];return t*t+n*n}function gPe(e,t){return e[0]*t[0]+e[1]*t[1]}function zR(e){return e[0]=0,e[1]=0,e}var _Pe=hPe;(function(){var e=FR();return function(t,n,r,i,a,o){var s,c;for(n||=2,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}})();var q=8192;function BR(e,t,n){return t*(q/(e.tileSize*2**(n-e.tileID.overscaledZ)))}function VR(e){return e instanceof Error?e:Error(typeof e==`string`?e:String(e))}function HR(){return new Float64Array(4)}function UR(){return new Float64Array(3)}function WR(){return new Float64Array(16)}function GR(){let e=new Float64Array(16);return rR(e),e}function KR(){let e=new Float32Array(16);return rR(e),e}function qR(e,t,n,r,i=!1){if(!n[0]&&!n[1])return[0,0];let a=i?r===`map`?-e.bearingInRadians:0:r===`viewport`?e.bearingInRadians:0;if(a){let e=Math.sin(a),t=Math.cos(a);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}return[i?n[0]:BR(t,n[0],e.zoom),i?n[1]:BR(t,n[1],e.zoom)]}function JR(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]}function YR(e,t,n){let r=qNe([e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2]]);if(r===0)return null;let i=SR([],[t[0],t[1],t[2]],[n[0],n[1],n[2]]),a=SR([],[n[0],n[1],n[2]],[e[0],e[1],e[2]]),o=SR([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),s=vR([],i,-e[3]);return _R(s,s,vR([],a,-t[3])),_R(s,s,vR([],o,-n[3])),vR(s,s,1/r),s}function vPe(e,t,n){let r=e[0]*n[0]+e[1]*n[1]+e[2]*n[2],i=t[0]*n[0]+t[1]*n[1]+t[2]*n[2];return i===0?null:(-r-n[3])/i}function XR(e,t,n,r){let i=Math.sqrt(e*e+t*t),a=Math.sqrt(n*n+r*r);e/=i,t/=i,n/=a,r/=a;let o=e*n+t*r,s=Math.acos(o);return-t*n+e*r>0?s:-s}function ZR(e,t){let n=$R(e,360),r=$R(t,360),i=r-n,a=r>n?i-360:i+360;return Math.abs(i)<Math.abs(a)?i:a}function QR(e,t){let n=$R(e,Math.PI*2),r=$R(t,Math.PI*2);return Math.min(Math.abs(n-r),Math.abs(n-r+Math.PI*2),Math.abs(n-r-Math.PI*2))}function $R(e,t){return(e%t+t)%t}function ez(e,t,n,r,i){return tz(r,i,iz((e-t)/(n-t),0,1))}function tz(e,t,n){return e*(1-n)+t*n}function yPe(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);return[t,n,r,i]}function bPe(e){if(!e.length)return new Set;let t=Math.max(...e.map(e=>e.canonical.z)),n=1/0,r=-1/0,i=1/0,a=-1/0,o=[];for(let s of e){let{x:e,y:c,z:l}=s.canonical,u=2**(t-l),d=e*u,f=c*u;o.push({id:s,x:d,y:f}),d<n&&(n=d),d>r&&(r=d),f<i&&(i=f),f>a&&(a=f)}let s=new Set;for(let e of o)(e.x===n||e.x===r||e.y===i||e.y===a)&&s.add(e.id);return s}function xPe(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function nz(e,t,n,r){return GNe(e,t,n,r)}var rz=nz(.25,.1,.25,1);function iz(e,t,n){return Math.min(n,Math.max(t,e))}function az(e,t,n){let r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function oz(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}function sz(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}var SPe=1;function cz(){return SPe++}function CPe(e){return Math.log(e)/Math.LN2%1==0}function wPe(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}function lz(e){return 2**e}function uz(e){return Math.log(e)/Math.LN2}function dz(e,t,n){if(t<=0)return e;let r=1/t;return n===void 0||Math.abs(n)<1e-10?Math.round(e*r)/r:(n>0?Math.ceil(e*r-1e-9):Math.floor(e*r+1e-10))/r}function fz(e,t,n){let r={};for(let i in e)r[i]=t.call(n||this,e[i],i,e);return r}function pz(e,t,n){let r={};for(let i in e)t.call(n||this,e[i],i,e)&&(r[i]=e[i]);return r}function mz(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!mz(e[n],t[n]))return!1;return!0}if(typeof e==`object`&&e&&t!==null){if(typeof t!=`object`||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!mz(e[n],t[n]))return!1;return!0}return e===t}function hz(e){return Array.isArray(e)?e.map(hz):typeof e==`object`&&e?fz(e,hz):e}var gz={};function _z(e){gz[e]||(typeof console<`u`&&console.warn(e),gz[e]=!0)}function vz(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function TPe(e,t,n,r){let i=t.y-e.y,a=t.x-e.x,o=r.y-n.y,s=r.x-n.x,c=o*a-s*i;if(c===0)return null;let l=e.y-n.y,u=e.x-n.x,d=(s*l-o*u)/c;return new K(e.x+d*a,e.y+d*i)}function EPe([e,t,n]){return t+=90,t*=Math.PI/180,n*=Math.PI/180,[e*Math.cos(t)*Math.sin(n),e*Math.sin(t)*Math.sin(n),e*Math.cos(n)]}function yz(e){return typeof WorkerGlobalScope<`u`&&e!==void 0&&e instanceof WorkerGlobalScope}function DPe(e){let t=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,n={};
409if(e.replace(t,(e,t,r,i)=>{let a=r||i;return n[t]=!a||a.toLowerCase(),``}),n[`max-age`]){let e=parseInt(n[`max-age`],10);isNaN(e)?delete n[`max-age`]:n[`max-age`]=e}return n}var bz=null;function OPe(e){if(bz==null){let t=e.navigator?e.navigator.userAgent:null;bz=!!e.safari||!!(t&&(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match(`Safari`)&&!t.match(`Chrome`)))}return bz}function xz(e){return typeof ImageBitmap<`u`&&e instanceof ImageBitmap}var kPe=async(e,t)=>{if(e.byteLength===0)return createImageBitmap(new ImageData(1,1),t);let n=new Blob([new Uint8Array(e)],{type:`image/png`});try{return createImageBitmap(n,t)}catch(e){throw Error(`Could not load image because of ${VR(e).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}},Sz=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=`,APe=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{t(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>r.src=Sz)},r.onerror=()=>n(Error(`Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`));let i=new Blob([new Uint8Array(e)],{type:`image/png`});r.src=e.byteLength?URL.createObjectURL(i):Sz});function jPe(e,t,n,r,i){let a=Math.max(-t,0)*4,o=(Math.max(0,n)-n)*r*4+a,s=r*4,c=Math.max(0,t),l=Math.max(0,n),u=Math.min(e.width,t+r),d=Math.min(e.height,n+i);return{rect:{x:c,y:l,width:u-c,height:d-l},layout:[{offset:o,stride:s}]}}async function MPe(e,t,n,r,i){if(typeof VideoFrame>`u`)throw Error(`VideoFrame not supported`);let a=new VideoFrame(e,{timestamp:0});try{let o=a?.format;if(!o||!(o.startsWith(`BGR`)||o.startsWith(`RGB`)))throw Error(`Unrecognized format ${o}`);let s=o.startsWith(`BGR`),c=new Uint8ClampedArray(r*i*4);if(await a.copyTo(c,jPe(e,t,n,r,i)),s)for(let e=0;e<c.length;e+=4){let t=c[e];c[e]=c[e+2],c[e+2]=t}return c}finally{a.close()}}function Cz(e,t,n,r){return e.addEventListener(t,n,r),{unsubscribe:()=>{e.removeEventListener(t,n,r)}}}function wz(e){return e*Math.PI/180}function Tz(e){return e/Math.PI*180}function Ez(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing}function NPe(e){let t=new Float64Array(9);YNe(t,e);let n=Tz(-Math.asin(iz(t[2],-1,1))),r,i;return Math.hypot(t[5],t[8])<.001?(r=0,i=-Tz(Math.atan2(t[3],t[4]))):(r=Tz(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),i=Tz(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:r,pitch:n+90,bearing:i}}function Dz(e,t,n){let r=IR(t.x-n.x,t.y-n.y),i=IR(e.x-n.x,e.y-n.y),a=r[0]*i[1]-r[1]*i[0];return Tz(Math.atan2(a,gPe(r,i)))}function Oz(e,t,n){let r=new Float64Array(4);return MR(r,e,t-90,n),r}var kz=85.051129,Az={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},jz={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0};function PPe(e,t){return Az[t]&&`touches`in e}function FPe(e,t){if(!jz[t])return!1;let n=e,r=(n?.target)?.ownerDocument?.defaultView||window;return n instanceof r.MouseEvent||n instanceof r.WheelEvent}function IPe(e){return Az[e]||jz[e]}var Mz=`AbortError`,Nz=class extends Error{constructor(e=Mz){super(e instanceof Error?e.message:e),this.name=Mz,e instanceof Error&&e.stack&&(this.stack=e.stack)}};function Pz(e){return e instanceof Error&&e.name===`AbortError`}function Fz(e){if(e.aborted)throw new Nz(e.reason)}var Iz={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:``};function Lz(e){return Iz.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf(`://`))]}var Rz=`global-dispatcher`,zz=class extends Error{constructor(e,t,n,r){super(`AJAXError: ${t} (${e}): ${n}`),this.status=e,this.statusText=t,this.url=n,this.body=r}};function Bz(){if(yz(self))return self.worker?.referrer;if(window.location.protocol===`blob:`)try{return window.parent.location.href}catch{}return window.location.href}var LPe=e=>e.startsWith(`file:`)||Bz()?.startsWith(`file:`)&&!/^\w+:/.test(e);
vendor: 11,923 bytes, line 409
409async function RPe(e,t){let n=new Request(e.url,{method:e.method||`GET`,body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:Bz(),referrerPolicy:e.referrerPolicy,signal:t.signal});e.type===`json`&&!n.headers.has(`Accept`)&&n.headers.set(`Accept`,`application/json`);let r;try{r=await fetch(n)}catch(t){throw Pz(t)?t:new zz(0,VR(t).message,e.url,new Blob)}if(!r.ok){let t=await r.blob();throw new zz(r.status,r.statusText,e.url,t)}let i;i=e.type===`arrayBuffer`||e.type===`image`?r.arrayBuffer():e.type===`json`?r.json():r.text();let a=await i;return Fz(t.signal),{data:a,cacheControl:r.headers.get(`Cache-Control`),expires:r.headers.get(`Expires`),etag:r.headers.get(`ETag`)}}function zPe(e,t){return new Promise((n,r)=>{let i=new XMLHttpRequest;i.open(e.method||`GET`,e.url,!0),(e.type===`arrayBuffer`||e.type===`image`)&&(i.responseType=`arraybuffer`);for(let t in e.headers)i.setRequestHeader(t,e.headers[t]);e.type===`json`&&(i.responseType=`text`,e.headers?.Accept||i.setRequestHeader(`Accept`,`application/json`)),i.withCredentials=e.credentials===`include`,i.onerror=()=>{r(Error(i.statusText))},i.onload=()=>{if(!t.signal.aborted)if((i.status>=200&&i.status<300||i.status===0)&&i.response!==null){let t=i.response;if(e.type===`json`)try{t=JSON.parse(i.response)}catch(e){r(e);return}n({data:t,cacheControl:i.getResponseHeader(`Cache-Control`),expires:i.getResponseHeader(`Expires`),etag:i.getResponseHeader(`ETag`)})}else{let t=new Blob([i.response],{type:i.getResponseHeader(`Content-Type`)});r(new zz(i.status,i.statusText,e.url,t))}},t.signal.addEventListener(`abort`,()=>{i.abort(),r(new Nz(t.signal.reason))}),i.send(e.body)})}var Vz=async function(e,t){if(e.url.includes(`://`)&&!/^https?:|^file:/.test(e.url)){let n=Lz(e.url);if(n){let r=await n(e,t);return!r.data&&e.type===`arrayBuffer`?oz(r,{data:new ArrayBuffer(0)}):r}if(yz(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:`GR`,data:e,targetMapId:Rz},t)}if(!LPe(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,`signal`))return RPe(e,t);if(yz(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:`GR`,data:e,mustQueue:!0,targetMapId:Rz},t)}return zPe(e,t)},Hz=(e,t)=>Vz(oz(e,{type:`json`}),t),BPe=(e,t)=>Vz(oz(e,{type:`arrayBuffer`}),t);function Uz(e){if(!e||e.startsWith(`data:image/`))return!0;if(e.startsWith(`blob:`)&&(e=e.slice(5),e.startsWith(`null`)))return!1;if(e.indexOf(`://`)<=0)return!0;let t=new URL(e),n=window.location;return t.protocol===n.protocol&&t.host===n.host}var VPe=e=>{let t=window.document.createElement(`video`);return t.muted=!0,new Promise(n=>{t.onloadstart=()=>{n(t)};for(let n of e){let e=window.document.createElement(`source`);Uz(n)||(t.crossOrigin=`Anonymous`),e.src=n,t.appendChild(e)}})};function Wz(e,t,n){n[e]?.includes(t)||(n[e]||=[],n[e].push(t))}function Gz(e,t,n){if(n?.[e]){let r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}var Kz=class{constructor(e,t={}){oz(this,t),this.type=e}},qz=class extends Kz{constructor(e,t={}){super(`error`,oz({error:e},t))}},Jz=class{on(e,t){return this._listeners||={},Wz(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return Gz(e,t,this._listeners),Gz(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||={},Wz(e,t,this._oneTimeListeners),this):new Promise(t=>this.once(e,t))}fire(e,t){let n=typeof e==`string`?new Kz(e,t||{}):e,r=n.type;if(this.listens(r)){n.target=this;let e=this._listeners?.[r]?.slice()??[];for(let t of e)t.call(this,n);let t=this._oneTimeListeners?.[r]?.slice()??[];for(let e of t)Gz(r,e,this._oneTimeListeners),e.call(this,n);let i=this._eventedParent;i&&(oz(n,typeof this._eventedParentData==`function`?this._eventedParentData():this._eventedParentData),i.fire(n))}else n instanceof qz&&console.error(n.error);return this}listens(e){return!!(this._listeners?.[e]?.length||this._oneTimeListeners?.[e]?.length||this._eventedParent?.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}},J={$version:8,$root:{version:{required:!0,type:`enum`,values:[8]},name:{type:`string`},metadata:{type:`*`},center:{type:`array`,value:`number`,length:2},centerAltitude:{type:`number`},zoom:{type:`number`},bearing:{type:`number`,default:0,period:360,units:`degrees`},pitch:{type:`number`,default:0,units:`degrees`},roll:{type:`number`,default:0,units:`degrees`},state:{type:`state`,default:{}},light:{type:`light`},sky:{type:`sky`},projection:{type:`projection`},terrain:{type:`terrain`},sources:{required:!0,type:`sources`},sprite:{type:`sprite`},glyphs:{type:`string`},"font-faces":{type:`fontFaces`},transition:{type:`transition`},layers:{required:!0,type:`array`,value:`layer`}},sources:{"*":{type:`source`}},source:[`source_vector`,`source_raster`,`source_raster_dem`,`source_geojson`,`source_video`,`source_image`],source_vector:{type:{required:!0,type:`enum`,values:{vector:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},attribution:{type:`string`},promoteId:{type:`promoteId`},volatile:{type:`boolean`,default:!1},encoding:{type:`enum`,values:{mvt:{},mlt:{}},default:`mvt`},"*":{type:`*`}},source_raster:{type:{required:!0,type:`enum`,values:{raster:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},attribution:{type:`string`},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_raster_dem:{type:{required:!0,type:`enum`,values:{"raster-dem":{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},attribution:{type:`string`},encoding:{type:`enum`,values:{terrarium:{},mapbox:{},custom:{}},default:`mapbox`},redFactor:{type:`number`,default:1},blueFactor:{type:`number`,default:1},greenFactor:{type:`number`,default:1},baseShift:{type:`number`,default:0},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},source_geojson:{type:{required:!0,type:`enum`,values:{geojson:{}}},data:{required:!0,type:`*`},maxzoom:{type:`number`,default:18},attribution:{type:`string`},buffer:{type:`number`,default:128,maximum:512,minimum:0},filter:{type:`filter`},tolerance:{type:`number`,default:.375},cluster:{type:`boolean`,default:!1},clusterRadius:{type:`number`,default:50,minimum:0},clusterMaxZoom:{type:`number`},clusterMinPoints:{type:`number`},clusterProperties:{type:`*`},lineMetrics:{type:`boolean`,default:!1},generateId:{type:`boolean`,default:!1},promoteId:{type:`promoteId`}},source_video:{type:{required:!0,type:`enum`,values:{video:{}}},urls:{required:!0,type:`array`,value:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},source_image:{type:{required:!0,type:`enum`,values:{image:{}}},url:{required:!0,type:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},layer:{id:{type:`string`,required:!0},type:{type:`enum`,values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:`*`},source:{type:`string`},"source-layer":{type:`string`},minzoom:{type:`number`,minimum:0,maximum:24},maxzoom:{type:`number`,minimum:0,maximum:24},filter:{type:`filter`},layout:{type:`layout`},paint:{type:`paint`}},layout:[`layout_fill`,`layout_line`,`layout_circle`,`layout_heatmap`,`layout_fill-extrusion`,`layout_symbol`,`layout_raster`,`layout_hillshade`,`layout_color-relief`,`layout_background`],layout_background:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_fill:{"fill-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_circle:{"circle-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_heatmap:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},"layout_fill-extrusion":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`},"fill-extrusion-rounded-corner-distance":{type:`number`,default:0,minimum:0,units:`meters`,"property-type":`constant`}},layout_line:{"line-cap":{type:`enum`,values:{butt:{},round:{},square:{}},default:`butt`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-join":{type:`enum`,values:{bevel:{},round:{},miter:{}},default:`miter`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-miter-limit":{type:`number`,default:2,requires:[{"line-join":`miter`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-round-limit":{type:`number`,default:1.05,requires:[{"line-join":`round`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_symbol:{"symbol-placement":{type:`enum`,values:{point:{},line:{},"line-center":{}},default:`point`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-spacing":{type:`number`,default:250,minimum:1,units:`pixels`,requires:[{"symbol-placement":`line`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-avoid-edges":{type:`boolean`,default:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"symbol-z-order":{type:`enum`,values:{auto:{},"viewport-y":{},source:{}},default:`auto`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-allow-overlap":{type:`boolean`,default:!1,requires:[`icon-image`,{"!":`icon-overlap`}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-overlap":{type:`enum`,values:{never:{},always:{},cooperative:{}},requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-ignore-placement":{type:`boolean`,default:!1,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-optional":{type:`boolean`,default:!1,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant
vendor: 13,264 bytes, line 409
409`},"icon-size":{type:`number`,default:1,minimum:0,units:`factor of the original icon size`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-text-fit":{type:`enum`,values:{none:{},width:{},height:{},both:{}},default:`none`,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-text-fit-padding":{type:`array`,value:`number`,length:4,default:[0,0,0,0],units:`pixels`,requires:[`icon-image`,`text-field`,{"icon-text-fit":[`both`,`width`,`height`]}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-image":{type:`resolvedImage`,tokens:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-rotate":{type:`number`,default:0,period:360,units:`degrees`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-padding":{type:`padding`,default:[2],units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-keep-upright":{type:`boolean`,default:!1,requires:[`icon-image`,{"icon-rotation-alignment":`map`},{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-offset":{type:`array`,value:`number`,length:2,default:[0,0],requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-anchor":{type:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:`center`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-pitch-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-pitch-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:`auto`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-field":{type:`formatted`,default:``,tokens:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-font":{type:`array`,value:`string`,default:[`Open Sans Regular`,`Arial Unicode MS Regular`],requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-size":{type:`number`,default:16,minimum:0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-max-width":{type:`number`,default:10,minimum:0,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-line-height":{type:`number`,default:1.2,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-letter-spacing":{type:`number`,default:0,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-justify":{type:`enum`,values:{auto:{},left:{},center:{},right:{}},default:`center`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-radial-offset":{type:`number`,units:`ems`,default:0,requires:[`text-field`],"property-type":`data-driven`,expression:{interpolated:!0,parameters:[`zoom`,`feature`]}},"text-variable-anchor":{type:`array`,value:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-variable-anchor-offset":{type:`variableAnchorOffsetCollection`,requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-anchor":{type:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:`center`,requires:[`text-field`,{"!":`text-variable-anchor`}],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-max-angle":{type:`number`,default:45,units:`degrees`,requires:[`text-field`,{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-writing-mode":{type:`array`,value:`enum`,values:{horizontal:{},vertical:{}},requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-rotate":{type:`number`,default:0,period:360,units:`degrees`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-padding":{type:`number`,default:2,minimum:0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-keep-upright":{type:`boolean`,default:!0,requires:[`text-field`,{"text-rotation-alignment":`map`},{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-transform":{type:`enum`,values:{none:{},uppercase:{},lowercase:{}},default:`none`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-offset":{type:`array`,value:`number`,units:`ems`,length:2,default:[0,0],requires:[`text-field`,{"!":`text-radial-offset`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-allow-overlap":{type:`boolean`,default:!1,requires:[`text-field`,{"!":`text-overlap`}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-overlap":{type:`enum`,values:{never:{},always:{},cooperative:{}},requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-ignore-placement":{type:`boolean`,default:!1,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-optional":{type:`boolean`,default:!1,requires:[`text-field`,`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-height-offset":{type:`number`,default:0,units:`meters`,requires:[{"symbol-placement":[`point`]}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"symbol-height-anchor":{type:`enum`,values:{ground:{},absolute:{}},default:`ground`,requires:[`symbol-height-offset`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_raster:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},layout_hillshade:{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},"layout_color-relief":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,expression:{interpolated:!1,parameters:[`global-state`]},"property-type":`data-constant`}},filter:{type:`boolean`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},filter_operator:{type:`enum`,values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:`enum`,values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:`expression`},stops:{type:`array`,value:`function_stop`},base:{type:`number`,default:1,minimum:0},property:{type:`string`,default:`$zoom`},type:{type:`enum`,values:{identity:{},exponential:{},interval:{},categorical:{}},default:`exponential`},colorSpace:{type:`enum`,values:{rgb:{},lab:{},hcl:{}},default:`rgb`},default:{type:`*`,required:!1}},function_stop:{type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2},expression:{type:`array`,value:`expression_name`,minimum:1},light:{anchor:{type:`enum`,default:`viewport`,values:{map:{},viewport:{}},"property-type":`data-constant`,transition:!1,expression:{interpolated:!1,parameters:[`zoom`]}},position:{type:`array`,default:[1.15,210,30],length:3,value:`number`,"property-type":`data-constant`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]}},color:{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},intensity:{type:`number`,"property-type":`data-constant`,default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0}},sky:{"sky-color":{type:`color`,"property-type":`data-constant`,default:`#88C6FC`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"horizon-color":{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"fog-color":{type:`color`,"property-type":`data-constant`,default:`#ffffff`,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"fog-ground-blend":{type:`number`,"property-type":`data-constant`,default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"horizon-fog-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"sky-horizon-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0},"atmosphere-blend":{type:`number`,"property-type":`data-constant`,default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[`zoom`]},transition:!0}},terrain:{source:{type:`string`,required:!0},exaggeration:{type:`number`,minimum:0,default:1}},projection:{type:{type:`projectionDefinition`,default:`mercator`,"property-type":`data-constant`,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]}}},paint:[`paint_fill`,`paint_line`,`paint_circle`,`paint_heatmap`,`paint_fill-extrusion`,`paint_symbol`,`paint_raster`,`paint_hillshade`,`paint_color-relief`,`paint_background`],paint_fill:{"fill-antialias":{type:`boolean`,default:!0,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-layer-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`global-state`]},"property-type":`data-constant`},"fill-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-outline-color":{type:`color`,transition:!0,requires:[{"!":`fill-pattern`},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`fill-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`fill-extrusion-pattern`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`fill-extrusion-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"fill-extrusion-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"fill-extrusion-height":{type:`number`,default:0,
vendor: 897 bytes, line 409
409minimum:0,units:`meters`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-base":{type:`number`,default:0,minimum:0,units:`meters`,transition:!0,requires:[`fill-extrusion-height`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"fill-extrusion-vertical-gradient":{type:`boolean`,default:!0,transition:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_line:{"line-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-layer-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`global-state`]},"property-type":`data-constant
vendor: 12,722 bytes, line 409
409`},"line-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`line-pattern`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"line-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`line-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"line-width":{type:`number`,default:1,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-gap-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-offset":{type:`number`,default:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"line-dasharray":{type:`array`,value:`number`,minimum:0,transition:!0,units:`line widths`,requires:[{"!":`line-pattern`}],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"line-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`cross-faded-data-driven`},"line-gradient":{type:`color`,transition:!1,requires:[{"!":`line-dasharray`},{"!":`line-pattern`},{source:`geojson`,has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[`line-progress`]},"property-type":`color-ramp`}},paint_circle:{"circle-radius":{type:`number`,default:5,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-blur":{type:`number`,default:0,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"circle-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`circle-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-pitch-scale":{type:`enum`,values:{map:{},viewport:{}},default:`map`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-pitch-alignment":{type:`enum`,values:{map:{},viewport:{}},default:`viewport`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"circle-stroke-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-stroke-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"circle-stroke-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`}},paint_heatmap:{"heatmap-radius":{type:`number`,default:30,minimum:1,transition:!0,units:`pixels`,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"heatmap-weight":{type:`number`,default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"heatmap-intensity":{type:`number`,default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"heatmap-color":{type:`color`,default:[`interpolate`,[`linear`],[`heatmap-density`],0,`rgba(0, 0, 255, 0)`,.1,`royalblue`,.3,`cyan`,.5,`lime`,.7,`yellow`,1,`red`],transition:!1,expression:{interpolated:!0,parameters:[`heatmap-density`]},"property-type":`color-ramp`},"heatmap-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_symbol:{"icon-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-color":{type:`color`,default:`#000000`,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-color":{type:`color`,default:`rgba(0, 0, 0, 0)`,transition:!0,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-halo-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"icon-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`icon-image`,`icon-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-color":{type:`color`,default:`#000000`,transition:!0,overridable:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-color":{type:`color`,default:`rgba(0, 0, 0, 0)`,transition:!0,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-width":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-halo-blur":{type:`number`,default:0,minimum:0,transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-translate":{type:`array`,value:`number`,length:2,default:[0,0],transition:!0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-translate-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`map`,requires:[`text-field`,`text-translate`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_raster:{"raster-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-hue-rotate":{type:`number`,default:0,period:360,transition:!0,units:`degrees`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-brightness-min":{type:`number`,default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-brightness-max":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-saturation":{type:`number`,default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"raster-contrast":{type:`number`,default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-resampling":{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-fade-duration":{type:`number`,default:300,minimum:0,transition:!1,units:`milliseconds`,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_hillshade:{"hillshade-illumination-direction":{type:`numberArray`,default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-altitude":{type:`numberArray`,default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-anchor":{type:`enum`,values:{map:{},viewport:{}},default:`viewport`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-exaggeration":{type:`number`,default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-shadow-color":{type:`colorArray`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-highlight-color":{type:`colorArray`,default:`#FFFFFF`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-accent-color":{type:`color`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-method":{type:`enum`,values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:`standard`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},"paint_color-relief":{"color-relief-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"color-relief-color":{type:`color`,transition:!1,expression:{interpolated:!0,parameters:[`elevation`]},"property-type":`color-ramp`},resampling:{type:`enum`,values:{linear:{},nearest:{}},default:`linear`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_background:{"background-color":{type:`color`,default:`#000000`,transition:!0,requires:[{"!":`background-pattern`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"background-pattern":{type:`resolvedImage`,transition:!0,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`cross-faded`},"background-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},transition:{duration:{type:`number`,default:300,minimum:0,units:`milliseconds`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`}},"property-type":{"data-driven":{type:`property-type`},"cross-faded":{type:`property-type`},"cross-faded-data-driven":{type:`property-type`},"color-ramp":{type:`property-type`},"data-constant":{type:`property-type`},constant:{type:`property-type`}},promoteId:{"*":{type:`string`}},interpolation:{type:`array`,value:`interpolation_name`,minimum:1},interpolation_name:{type:`enum`,values:{linear:{syntax:{overloads:[{parameters:[],"output-type":`interpolation`}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[`base`],"output-type":`interpolation`}],parameters:[{name:`base`,type:`number literal`}]}},"cubic-bezier":{syntax:{overloads:[{parameters:[`x1`,`y1`,`x2`,`y2`],"output-type":`interpolation`}],parameters:[{name:`x1`,type:`number literal`},{name:`y1`,type:`number literal`},{name:`x2`,type:`number literal`},{name:`y2`,type:`number literal`}]}}}}}
409,HPe=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function UPe(e,t){let n={};for(let t in e)t!==`ref`&&(n[t]=e[t]);
vendor: 9,464 bytes, line 409
409return HPe.forEach(e=>{e in t&&(n[e]=t[e])}),n}function Yz(e){e=e.slice();let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].id]=e[n];for(let n=0;n<e.length;n++)`ref`in e[n]&&(e[n]=UPe(e[n],t[e[n].ref]));return e}function Xz(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Xz(e[n],t[n]))return!1;return!0}if(typeof e==`object`&&e&&t!==null){if(typeof t!=`object`||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!Xz(e[n],t[n]))return!1;return!0}return e===t}function Zz(e,t){e.push(t)}function Qz(e,t,n){Zz(n,{command:`addSource`,args:[e,t[e]]})}function $z(e,t,n){Zz(t,{command:`removeSource`,args:[e]}),n[e]=!0}function WPe(e,t,n,r){$z(e,n,r),Qz(e,t,n)}function GPe(e,t,n){let r;for(r in e[n])if(Object.prototype.hasOwnProperty.call(e[n],r)&&r!==`data`&&!Xz(e[n][r],t[n][r]))return!1;for(r in t[n])if(Object.prototype.hasOwnProperty.call(t[n],r)&&r!==`data`&&!Xz(e[n][r],t[n][r]))return!1;return!0}function KPe(e,t,n,r){e||={},t||={};let i;for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)||$z(i,n,r));for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)?Xz(e[i],t[i])||(e[i].type===`geojson`&&t[i].type===`geojson`&&GPe(e,t,i)?Zz(n,{command:`setGeoJSONSourceData`,args:[i,t[i].data]}):WPe(i,t,n,r)):Qz(i,t,n))}function eB(e,t,n,r,i,a){e||={},t||={};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(Xz(e[o],t[o])||n.push({command:a,args:[r,o,t[o],i]}));for(let o in t)!Object.prototype.hasOwnProperty.call(t,o)||Object.prototype.hasOwnProperty.call(e,o)||Xz(e[o],t[o])||n.push({command:a,args:[r,o,t[o],i]})}function tB(e){return e.id}function nB(e,t){return e[t.id]=t,e}function qPe(e,t,n){e||=[],t||=[];let r=e.map(tB),i=t.map(tB),a=e.reduce(nB,{}),o=t.reduce(nB,{}),s=r.slice(),c=Object.create(null),l,u,d,f,p;for(let e=0,t=0;e<r.length;e++)l=r[e],Object.prototype.hasOwnProperty.call(o,l)?t++:(Zz(n,{command:`removeLayer`,args:[l]}),s.splice(s.indexOf(l,t),1));for(let e=0,t=0;e<i.length;e++)l=i[i.length-1-e],s[s.length-1-e]!==l&&(Object.prototype.hasOwnProperty.call(a,l)?(Zz(n,{command:`removeLayer`,args:[l]}),s.splice(s.lastIndexOf(l,s.length-t),1)):t++,f=s[s.length-e],Zz(n,{command:`addLayer`,args:[o[l],f]}),s.splice(s.length-e,0,l),c[l]=!0);for(let e=0;e<i.length;e++)if(l=i[e],u=a[l],d=o[l],!(c[l]||Xz(u,d))){if(!Xz(u.source,d.source)||!Xz(u[`source-layer`],d[`source-layer`])||!Xz(u.type,d.type)){Zz(n,{command:`removeLayer`,args:[l]}),f=s[s.lastIndexOf(l)+1],Zz(n,{command:`addLayer`,args:[d,f]});continue}for(p in eB(u.layout,d.layout,n,l,null,`setLayoutProperty`),eB(u.paint,d.paint,n,l,null,`setPaintProperty`),Xz(u.filter,d.filter)||Zz(n,{command:`setFilter`,args:[l,d.filter]}),(!Xz(u.minzoom,d.minzoom)||!Xz(u.maxzoom,d.maxzoom))&&Zz(n,{command:`setLayerZoomRange`,args:[l,d.minzoom,d.maxzoom]}),u)Object.prototype.hasOwnProperty.call(u,p)&&p!==`layout`&&p!==`paint`&&p!==`filter`&&p!==`metadata`&&p!==`minzoom`&&p!==`maxzoom`&&(p.indexOf(`paint.`)===0?eB(u[p],d[p],n,l,p.slice(6),`setPaintProperty`):Xz(u[p],d[p])||Zz(n,{command:`setLayerProperty`,args:[l,p,d[p]]}));for(p in d)!Object.prototype.hasOwnProperty.call(d,p)||Object.prototype.hasOwnProperty.call(u,p)||p!==`layout`&&p!==`paint`&&p!==`filter`&&p!==`metadata`&&p!==`minzoom`&&p!==`maxzoom`&&(p.indexOf(`paint.`)===0?eB(u[p],d[p],n,l,p.slice(6),`setPaintProperty`):Xz(u[p],d[p])||Zz(n,{command:`setLayerProperty`,args:[l,p,d[p]]}))}}function JPe(e,t){if(!e)return[{command:`setStyle`,args:[t]}];let n=[];try{if(!Xz(e.version,t.version))return[{command:`setStyle`,args:[t]}];Xz(e.center,t.center)||n.push({command:`setCenter`,args:[t.center]}),Xz(e.state,t.state)||n.push({command:`setGlobalState`,args:[t.state]}),Xz(e.centerAltitude,t.centerAltitude)||n.push({command:`setCenterAltitude`,args:[t.centerAltitude]}),Xz(e.zoom,t.zoom)||n.push({command:`setZoom`,args:[t.zoom]}),Xz(e.bearing,t.bearing)||n.push({command:`setBearing`,args:[t.bearing]}),Xz(e.pitch,t.pitch)||n.push({command:`setPitch`,args:[t.pitch]}),Xz(e.roll,t.roll)||n.push({command:`setRoll`,args:[t.roll]}),Xz(e.sprite,t.sprite)||n.push({command:`setSprite`,args:[t.sprite]}),Xz(e.glyphs,t.glyphs)||n.push({command:`setGlyphs`,args:[t.glyphs]}),Xz(e.transition,t.transition)||n.push({command:`setTransition`,args:[t.transition]}),Xz(e.light,t.light)||n.push({command:`setLight`,args:[t.light]}),Xz(e.terrain,t.terrain)||n.push({command:`setTerrain`,args:[t.terrain]}),Xz(e.sky,t.sky)||n.push({command:`setSky`,args:[t.sky]}),Xz(e.projection,t.projection)||n.push({command:`setProjection`,args:[t.projection]});let r={},i=[];KPe(e.sources,t.sources,i,r);let a=[];e.layers&&e.layers.forEach(e=>{`source`in e&&r[e.source]?n.push({command:`removeLayer`,args:[e.id]}):a.push(e)}),n=n.concat(i),qPe(a,t.layers,n)}catch(e){console.warn(`Unable to compute style diff:`,e),n=[{command:`setStyle`,args:[t]}]}return n}var Y=class{constructor(e,t,n,r,i=`error`){this.message=(e?`${e}: `:``)+n,r&&(this.identifier=r),this.severity=i,t!=null&&t.__line__&&(this.line=t.__line__)}},rB=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},YPe=class e{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,n]of t)this.bindings[e]=n}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},iB={kind:`null`},X={kind:`number`},aB={kind:`string`},oB={kind:`boolean`},sB={kind:`color`},cB={kind:`projectionDefinition`},lB={kind:`object`},uB={kind:`value`},XPe={kind:`error`},dB={kind:`collator`},fB={kind:`formatted`},pB={kind:`padding`},mB={kind:`colorArray`},hB={kind:`numberArray`},gB={kind:`resolvedImage`},_B={kind:`variableAnchorOffsetCollection`};function vB(e,t){return{kind:`array`,itemType:e,N:t}}function yB(e){if(e.kind===`array`){let t=yB(e.itemType);return typeof e.N==`number`?`array<${t}, ${e.N}>`:e.itemType.kind===`value`?`array`:`array<${t}>`}return e.kind}var ZPe=[iB,X,aB,oB,sB,cB,fB,lB,vB(uB),pB,hB,mB,gB,_B];function bB(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!bB(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else if(e.kind===t.kind)return null;else if(e.kind===`value`){for(let e of ZPe)if(!bB(e,t))return null}return`Expected ${yB(e)} but found ${yB(t)} instead.`}function xB(e,t){return t.some(t=>t.kind===e.kind)}function SB(e,t){return t.some(t=>t===`null`?e===null:t===`array`?Array.isArray(e):t===`object`?e&&!Array.isArray(e)&&typeof e==`object`:t===typeof e)}function CB(e,t){return e.kind===`array`&&t.kind===`array`?e.itemType.kind===t.itemType.kind&&typeof e.N==`number`:e.kind===t.kind}var wB=.96422,TB=.82521,EB=4/29,DB=6/29,OB=3*DB*DB,QPe=Math.PI/180,$Pe=180/Math.PI;function kB(e){return e%=360,e<0&&(e+=360),e}function AB([e,t,n,r]){e=jB(e),t=jB(t),n=jB(n);let i,a,o=MB((.2225045*e+.7168786*t+.0606169*n)/1);e===t&&t===n?i=a=o:(i=MB((.4360747*e+.3850649*t+.1430804*n)/wB),a=MB((.0139322*e+.0971045*t+.7141733*n)/TB));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),r]}function jB(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function MB(e){return e>.008856451679035631?e**(1/3):e/OB+EB}function NB([e,t,n,r]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,o=isNaN(n)?i:i-n/200;return i=1*FB(i),a=wB*FB(a),o=TB*FB(o),[PB(3.1338561*a-1.6168667*i-.4906146*o),PB(-.9787684*a+1.9161415*i+.033454*o),PB(.0719453*a-.2289914*i+1.4052427*o),r]}function PB(e){return e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055,e<0?0:e>1?1:e}function FB(e){return e>DB?e*e*e:OB*(e-EB)}function eFe(e){let[t,n,r,i]=AB(e),a=Math.sqrt(n*n+r*r);return[Math.round(a*1e4)?kB(Math.atan2(r,n)*$Pe):NaN,a,t,i]}function tFe([e,t,n,r]){return e=isNaN(e)?0:e*QPe,NB([n,Math.cos(e)*t,Math.sin(e)*t,r])}function nFe([e,t,n,r]){e=kB(e),t/=100,n/=100;function i(r){let i=(r+e/30)%12,a=t*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4),r]}var rFe=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function IB(e,t){return rFe(e,t)?e[t]:void 0}function iFe(e){if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t=IB(aFe,e);if(t){let[e,n,r]=t;return[e/255,n/255,r/255,1]}if(e.startsWith(`#`)&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,n=1;return[LB(e.slice(n,n+=t)),LB(e.slice(n,n+=t)),LB(e.slice(n,n+=t)),LB(e.slice(n,n+t)||`ff`)]}if(e.startsWith(`rgb`)){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,n,r,i,a,o,s,c,l,u,d,f]=t,p=[i||` `,s||` `,u].join(``);if(p===`  `||p===`  /`||p===`,,`||p===`,,,`){let e=[r,o,l].join(``),t=e===`%%%`?100:e===``?255:0;if(t){let e=[zB(+n/t,0,1),zB(+a/t,0,1),zB(+c/t,0,1),d?RB(+d,f):1];if(BB(e))return e}}return}}let n=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[e,t,r,i,a,o,s,c,l]=n,u=[r||` `,a||` `,s].join(``);if(u===`  `||u===`  /`||u===`,,`||u===`,,,`){let e=[+t,zB(+i,0,100),zB(+o,0,100),c?RB(+c,l):1];if(BB(e))return nFe(e)}}}function LB(e){return parseInt(e.padEnd(2,e),16)/255}function RB(e,t){return zB(t?e/100:e,0,1)}function zB(e,t,n){return Math.min(Math.max(t,e),n)}
vendor: 4,706 bytes, line 409
409function BB(e){return!e.some(Number.isNaN)}var aFe={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]};function VB(e,t,n){return e+n*(t-e)}function HB(e,t,n){return e.map((e,r)=>VB(e,t[r],n))}function oFe(e){return e===`rgb`||e===`hcl`||e===`lab`}var UB=class e{constructor(e,t,n,r=1,i=!0){this.r=e,this.g=t,this.b=n,this.a=r,i||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter(`rgb`,[e,t,n,r]))}static{this.black=new e(0,0,0,1)}static{this.white=new e(1,1,1,1)}static{this.transparent=new e(0,0,0,0)}static{this.red=new e(1,0,0,1)}static parse(t){if(t instanceof e)return t;if(typeof t!=`string`)return;let n=iFe(t);if(n)return new e(...n,!1)}get rgb(){let{r:e,g:t,b:n,a:r}=this,i=r||1/0;return this.overwriteGetter(`rgb`,[e/i,t/i,n/i,r])}get hcl(){return this.overwriteGetter(`hcl`,eFe(this.rgb))}get lab(){return this.overwriteGetter(`lab`,AB(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,n,r]=this.rgb;return`rgba(${[e,t,n].map(e=>Math.round(e*255)).join(`,`)},${r})`}static interpolate(t,n,r,i=`rgb`){switch(i){case`rgb`:{let[i,a,o,s]=HB(t.rgb,n.rgb,r);return new e(i,a,o,s,!1)}case`hcl`:{let[i,a,o,s]=t.hcl,[c,l,u,d]=n.hcl,f,p;if(!isNaN(i)&&!isNaN(c)){let e=c-i;c>i&&e>180?e-=360:c<i&&i-c>180&&(e+=360),f=i+r*e}else isNaN(i)?isNaN(c)?f=NaN:(f=c,(o===1||o===0)&&(p=l)):(f=i,(u===1||u===0)&&(p=a));
vendor: 17,787 bytes, line 409
409let[m,h,g,_]=tFe([f,p??VB(a,l,r),VB(o,u,r),VB(s,d,r)]);return new e(m,h,g,_,!1)}case`lab`:{let[i,a,o,s]=NB(HB(t.lab,n.lab,r));return new e(i,a,o,s,!1)}}}},WB=class{constructor(e,t,n){this.sensitivity=e?t?`variant`:`case`:t?`accent`:`base`,this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:`search`})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},sFe=[`bottom`,`center`,`top`],GB=class{constructor(e,t,n,r,i,a){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i,this.verticalAlign=a}},KB=class e{constructor(e){this.sections=e}static fromString(t){return new e([new GB(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return this.sections.length===0?``:this.sections.map(e=>e.text).join(``)}},qB=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if(typeof e!=`number`)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(HB(t.values,n.values,r))}},JB=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t]);if(Array.isArray(t)){for(let e of t)if(typeof e!=`number`)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(HB(t.values,n.values,r))}},YB=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`string`){let n=UB.parse(t);return n?new e([n]):void 0}if(!Array.isArray(t))return;let n=[];for(let e of t){if(typeof e!=`string`)return;let t=UB.parse(e);if(!t)return;n.push(t)}return new e(n)}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r,i=`rgb`){let a=[];if(t.values.length!=n.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${n.values.length}), cannot interpolate.`);for(let e=0;e<t.values.length;e++)a.push(UB.interpolate(t.values[e],n.values[e],r,i));return new e(a)}},XB=class extends Error{constructor(e,t){super(e),this.name=`RuntimeError`,this.path=t}toJSON(){return this.message}},cFe=new Set([`center`,`left`,`right`,`top`,`bottom`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]),ZB=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let e=0;e<t.length;e+=2){let n=t[e],r=t[e+1];if(typeof n!=`string`||!cFe.has(n)||!Array.isArray(r)||r.length!==2||typeof r[0]!=`number`||typeof r[1]!=`number`)return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r,i){let a=t.values,o=n.values;if(a.length!==o.length)throw new XB(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`,i);let s=[];for(let e=0;e<a.length;e+=2){if(a[e]!==o[e])throw new XB(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${a[e]}, to[${e}]: ${o[e]}`,i);s.push(a[e]);let[t,n]=a[e+1],[c,l]=o[e+1];s.push([VB(t,c,r),VB(n,l,r)])}return new e(s)}},QB=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},$B=class e{constructor(e,t,n){this.from=e,this.to=t,this.transition=n}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,n,r){return new e(t,n,r)}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]==`string`&&typeof t[1]==`string`&&typeof t[2]==`number`)return new e(t[0],t[1],t[2]);if(typeof t==`object`&&typeof t.from==`string`&&typeof t.to==`string`&&typeof t.transition==`number`)return new e(t.from,t.to,t.transition);if(typeof t==`string`)return new e(t,t,1)}};function eV(e,t,n,r){return typeof e==`number`&&e>=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(`, `)}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)}]: 'r', 'g', and 'b' must be between 0 and 255.`}function tV(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof $B||e instanceof UB||e instanceof WB||e instanceof KB||e instanceof qB||e instanceof JB||e instanceof YB||e instanceof ZB||e instanceof QB)return!0;if(Array.isArray(e)){for(let t of e)if(!tV(t))return!1;return!0}if(typeof e==`object`){for(let t in e)if(!tV(e[t]))return!1;return!0}return!1}function nV(e){if(e===null)return iB;if(typeof e==`string`)return aB;if(typeof e==`boolean`)return oB;if(typeof e==`number`)return X;if(e instanceof UB)return sB;if(e instanceof $B)return cB;if(e instanceof WB)return dB;if(e instanceof KB)return fB;if(e instanceof qB)return pB;if(e instanceof JB)return hB;if(e instanceof YB)return mB;if(e instanceof ZB)return _B;if(e instanceof QB)return gB;if(Array.isArray(e)){let t=e.length,n;for(let t of e){let e=nV(t);if(!n)n=e;else if(n===e)continue;else{n=uB;break}}return vB(n||uB,t)}return lB}function rV(e){let t=typeof e;return e===null?``:t===`string`||t===`number`||t===`boolean`?String(e):e instanceof UB||e instanceof $B||e instanceof KB||e instanceof qB||e instanceof JB||e instanceof YB||e instanceof ZB||e instanceof QB?e.toString():JSON.stringify(e)}var iV=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,n){if(t.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!tV(t[1]))return n.error(`invalid value of type "${typeof t[1]}"`);let r=t[1],i=nV(r),a=n.expectedType;return i.kind===`array`&&i.N===0&&a&&a.kind===`array`&&(typeof a.N!=`number`||a.N===0)&&(i=a),new e(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},aV={string:aB,number:X,boolean:oB,object:lB},oV=class e{constructor(e,t,n){this.type=e,this.args=t,this.key=n}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=1,i,a=t[0];if(a===`array`){let e;if(t.length>2){let i=t[1];if(typeof i!=`string`||!(i in aV)||i===`object`)return n.error(`The item type argument of "array" must be one of string, number, boolean`,1);e=aV[i],r++}else e=uB;let a;if(t.length>3){if(t[2]!==null&&(typeof t[2]!=`number`||t[2]<0||t[2]!==Math.floor(t[2])))return n.error(`The length argument to "array" must be a positive integer literal`,2);a=t[2],r++}i=vB(e,a)}else{if(!aV[a])throw Error(`Types doesn't contain name = ${a}`);i=aV[a]}let o=[];for(;r<t.length;r++){let e=n.parse(t[r],r,uB);if(!e)return null;o.push(e)}return new e(i,o,n.key)}evaluate(e){for(let t=0;t<this.args.length;t++){let n=this.args[t].evaluate(e);if(!bB(this.type,nV(n)))return n;if(t===this.args.length-1)throw new XB(`Expected value to be of type ${yB(this.type)}, but found ${yB(nV(n))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},sV={"to-boolean":oB,"to-color":sB,"to-number":X,"to-string":aB},cV=class e{constructor(e,t,n){this.type=e,this.args=t,this.key=n}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[0];if(!sV[r])throw Error(`Can't parse ${r} as it is not part of the known types`);if((r===`to-boolean`||r===`to-string`)&&t.length!==2)return n.error(`Expected one argument.`);let i=sV[r],a=[];for(let e=1;e<t.length;e++){let r=n.parse(t[e],e,uB);if(!r)return null;a.push(r)}return new e(i,a,n.key)}evaluate(e){switch(this.type.kind){case`boolean`:return!!this.args[0].evaluate(e);case`color`:{let t,n;for(let r of this.args){if(t=r.evaluate(e),n=null,t instanceof UB)return t;if(typeof t==`string`){let n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:eV(t[0],t[1],t[2],t[3]),!n))return new UB(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new XB(n||`Could not parse color from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`padding`:{let t;for(let n of this.args){t=n.evaluate(e);let r=qB.parse(t);if(r)return r}throw new XB(`Could not parse padding from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`numberArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=JB.parse(t);if(r)return r}throw new XB(`Could not parse numberArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`colorArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=YB.parse(t);if(r)return r}throw new XB(`Could not parse colorArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`variableAnchorOffsetCollection`:{let t;for(let n of this.args){t=n.evaluate(e);let r=ZB.parse(t);if(r)return r}throw new XB(`Could not parse variableAnchorOffsetCollection from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}case`number`:{let t=null;for(let n of this.args){if(t=n.evaluate(e),t===null)return 0;let r=Number(t);if(!isNaN(r))return r}throw new XB(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case`formatted`:return KB.fromString(rV(this.args[0].evaluate(e)));case`resolvedImage`:return QB.fromString(rV(this.args[0].evaluate(e)));case`projectionDefinition`:{let t=this.args[0].evaluate(e);if($B.parse(t))return t;throw new XB(`Could not parse projectionDefinition from value '${typeof t==`string`?t:JSON.stringify(t)}'`,this.key)}default:return rV(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},lFe=[`Unknown`,`Point`,`LineString`,`Polygon`],lV=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&`id`in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type==`number`?lFe[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&`geometry`in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=UB.parse(e),this._parseColorCache.set(e,t)),t}},uV=class e{constructor(e,t,n=[],r,i=new YPe,a=[]){this.registry=e,this.path=n,this.key=n.map(e=>`[${e}]`).join(``),this.scope=i,this.errors=a,this.expectedType=r,this._isConstant=t}parse(e,t,n,r,i={}){return t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)}_parse(e,t){(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`)&&(e=[`literal`,e]);let n=this.key;function r(e,t,r){return r===`assert`?new oV(t,[e],n):r===`coerce`?new cV(t,[e],n):e}if(Array.isArray(e)){if(e.length===0)return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`);let n=e[0];if(typeof n!=`string`)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[n];if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){let e=this.expectedType,i=n.type;if((e.kind===`string`||e.kind===`number`||e.kind===`boolean`||e.kind===`object`||e.kind===`array`)&&i.kind===`value`)n=r(n,e,t.typeAnnotation||`assert`);else if(e.kind===`projectionDefinition`&&[`string`,`array`,`value`].includes(i.kind)||[`color`,`formatted`,`resolvedImage`].includes(e.kind)&&[`value`,`string`].includes(i.kind)||[`padding`,`numberArray`].includes(e.kind)&&[`value`,`number`,`array`].includes(i.kind)||e.kind===`colorArray`&&[`value`,`string`,`array`].includes(i.kind)||e.kind===`variableAnchorOffsetCollection`&&[`value`,`array`].includes(i.kind))n=r(n,e,t.typeAnnotation||`coerce`);else if(this.checkSubtype(e,i))return null}if(!(n instanceof iV)&&n.type.kind!==`resolvedImage`&&this._isConstant(n)){let e=new lV;try{n=new iV(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return e===void 0?this.error(`'undefined' value invalid. Use null instead.`):typeof e==`object`?this.error(`Bare objects invalid. Use ["literal", {...}] instead.`):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(t,n,r){let i=typeof t==`number`?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new e(this.registry,this._isConstant,i,n||null,a,this.errors)}error(e,...t){let n=`${this.key}${t.map(e=>`[${e}]`).join(``)}`;this.errors.push(new rB(n,e))}checkSubtype(e,t){let n=bB(e,t);return n&&this.error(n),n}},dV=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let r=[];for(let e=1;e<t.length-1;e+=2){let i=t[e];if(typeof i!=`string`)return n.error(`Expected string, but found ${typeof i} instead.`,e);if(/[^a-zA-Z0-9_]/.test(i))return n.error(`Variable names must contain only alphanumeric characters or '_'.`,e);let a=n.parse(t[e+1],e+1);if(!a)return null;r.push([i,a])}let i=n.parse(t[t.length-1],t.length-1,n.expectedType,r);return i?new e(r,i):null}outputDefined(){return this.result.outputDefined()}},fV=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,n){if(t.length!==2||typeof t[1]!=`string`)return n.error(`'var' expression requires exactly one string literal argument.`);let r=t[1];return n.scope.has(r)?new e(r,n.scope.get(r)):n.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},uFe=class e{constructor(e,t,n,r){this.type=e,this.index=t,this.input=n,this.key=r}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,X),i=n.parse(t[2],2,vB(n.expectedType||uB));if(!r||!i)return null;let a=i.type;return new e(a.itemType,r,i,n.key)}evaluate(e){let t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new XB(`Array index out of bounds: ${t} < 0.`,this.key);if(t>=n.length)throw new XB(`Array index out of bounds: ${t} > ${n.length-1}.`,this.key);if(t!==Math.floor(t))throw new XB(`Array index must be an integer, but found ${t} instead.`,this.key);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},dFe=class e{constructor(e,t,n){this.needle=e,this.haystack=t,this.key=n,this.type=oB}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,uB),i=n.parse(t[2],2,uB);return!r||!i?null:xB(r.type,[oB,aB,X,iB,uB])?new e(r,i,n.key):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${yB(r.type)} instead`)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!SB(t,[`boolean`,`string`,`number`,`null`]))throw new XB(`Expected first argument to be of type boolean, string, number or null, but found ${yB(nV(t))} instead.`,this.key);if(!SB(n,[`string`,`array`]))throw new XB(`Expected second argument to be of type array or string, but found ${yB(nV(n))} instead.`,this.key);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},fFe=class e{constructor(e,t,n,r){this.needle=e,this.haystack=t,this.key=n,this.fromIndex=r,this.type=X}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,uB),i=n.parse(t[2],2,uB);if(!r||!i)return null;if(!xB(r.type,[oB,aB,X,iB,uB]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${yB(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,X);return a?new e(r,i,n.key,a):null}return new e(r,i,n.key)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!SB(t,[`boolean`,`string`,`number`,`null`]))throw new XB(`Expected first argument to be of type boolean, string, number or null, but found ${yB(nV(t))} instead.`,this.key);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),SB(n,[`string`])){let e=n.indexOf(t,r);return e===-1?-1:[...n.slice(0,e)].length}if(SB(n,[`array`]))return n.indexOf(t,r);throw new XB(`Expected second argument to be of type array or string, but found ${yB(nV(n))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},pFe=class e{constructor(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error(`Expected an even number of arguments.`);let r,i;n.expectedType&&n.expectedType.kind!==`value`&&(i=n.expectedType);let a={},o=[];for(let e=2;e<t.length-1;e+=2){let s=t[e],c=t[e+1];Array.isArray(s)||(s=[s]);let l=n.concat(e);
vendor: 27,666 bytes, line 409
409if(s.length===0)return l.error(`Expected at least one branch label.`);for(let e of s){if(typeof e!=`number`&&typeof e!=`string`)return l.error(`Branch labels must be numbers or strings.`);if(typeof e==`number`&&Math.abs(e)>2**53-1)return l.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof e==`number`&&Math.floor(e)!==e)return l.error(`Numeric branch labels must be integer values.`);if(!r)r=nV(e);else if(l.checkSubtype(r,nV(e)))return null;if(a[String(e)]!==void 0)return l.error(`Branch labels must be unique.`);a[String(e)]=o.length}let u=n.parse(c,e,i);if(!u)return null;i||=u.type,o.push(u)}let s=n.parse(t[1],1,uB);if(!s)return null;let c=n.parse(t[t.length-1],t.length-1,i);return!c||s.type.kind!==`value`&&n.concat(1).checkSubtype(r,s.type)?null:new e(r,i,s,a,o,c)}evaluate(e){let t=this.input.evaluate(e);return(nV(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},mFe=class e{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error(`Expected an odd number of arguments.`);let r;n.expectedType&&n.expectedType.kind!==`value`&&(r=n.expectedType);let i=[];for(let e=1;e<t.length-1;e+=2){let a=n.parse(t[e],e,oB);if(!a)return null;let o=n.parse(t[e+1],e+1,r);if(!o)return null;i.push([a,o]),r||=o.type}let a=n.parse(t[t.length-1],t.length-1,r);if(!a)return null;if(!r)throw Error(`Can't infer output type`);return new e(r,i,a)}evaluate(e){for(let[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}},hFe=class e{constructor(e,t,n,r,i){this.type=e,this.input=t,this.beginIndex=n,this.key=r,this.endIndex=i}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,uB),i=n.parse(t[2],2,X);if(!r||!i)return null;if(!xB(r.type,[vB(uB),aB,uB]))return n.error(`Expected first argument to be of type array or string, but found ${yB(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,X);return a?new e(r.type,r,i,n.key,a):null}return new e(r.type,r,i,n.key)}evaluate(e){let t=this.input.evaluate(e),n=this.beginIndex.evaluate(e),r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),SB(t,[`string`]))return[...t].slice(n,r).join(``);if(SB(t,[`array`]))return t.slice(n,r);throw new XB(`Expected first argument to be of type array or string, but found ${yB(nV(t))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function pV(e,t,n){let r=e.length-1,i=0,a=r,o=0,s,c;for(;i<=a;)if(o=Math.floor((i+a)/2),s=e[o],c=e[o+1],s<=t){if(o===r||t<c)return o;i=o+1}else if(s>t)a=o-1;else throw new XB(`Input is not a number.`,n);return 0}var mV=class e{constructor(e,t,n,r){this.type=e,this.input=t,this.key=r,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);let r=n.parse(t[1],1,X);if(!r)return null;let i=[],a=null;n.expectedType&&n.expectedType.kind!==`value`&&(a=n.expectedType);for(let e=1;e<t.length;e+=2){let r=e===1?-1/0:t[e],o=t[e+1],s=e,c=e+1;if(typeof r!=`number`)return n.error(`Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,s);if(i.length&&i[i.length-1][0]>=r)return n.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,s);let l=n.parse(o,c,a);if(!l)return null;a||=l.type,i.push([r,l])}return new e(a,r,i,n.key)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[pV(t,r,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function gFe(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let n=e;for(let r=0;r<8;r++){let r=((o*n+a)*n+i)*n-e;if(Math.abs(r)<t)return((l*n+c)*n+s)*n;let u=(3*o*n+2*a)*n+i;if(Math.abs(u)<1e-6)break;n-=r/u}let r=0,u=1;n=e;for(let s=0;s<20;s++){let s=((o*n+a)*n+i)*n;if(Math.abs(s-e)<t)break;e>s?r=n:u=n,n=(r+u)*.5}return((l*n+c)*n+s)*n}}var hV=class e{constructor(e,t,n,r,i,a){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.key=a,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,r){let i=0;if(e.name===`exponential`)i=gV(t,e.base,n,r);else if(e.name===`linear`)i=gV(t,1,n,r);else if(e.name===`cubic-bezier`){let a=e.controlPoints;i=gFe(a[0],a[1],a[2],a[3])(gV(t,1,n,r))}return i}static parse(t,n){let[r,i,a,...o]=t;if(!Array.isArray(i)||i.length===0)return n.error(`Expected an interpolation type expression.`,1);if(i[0]===`linear`)i={name:`linear`};else if(i[0]===`exponential`){let e=i[1];if(typeof e!=`number`)return n.error(`Exponential interpolation requires a numeric base.`,1,1);i={name:`exponential`,base:e}}else if(i[0]===`cubic-bezier`){let e=i.slice(1);if(e.length!==4||e.some(e=>typeof e!=`number`||e<0||e>1))return n.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);i={name:`cubic-bezier`,controlPoints:e}}else return n.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);if(a=n.parse(a,2,X),!a)return null;let s=[],c=null;(r===`interpolate-hcl`||r===`interpolate-lab`)&&n.expectedType!=mB?c=sB:n.expectedType&&n.expectedType.kind!==`value`&&(c=n.expectedType);for(let e=0;e<o.length;e+=2){let t=o[e],r=o[e+1],i=e+3,a=e+4;if(typeof t!=`number`)return n.error(`Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,i);if(s.length&&s[s.length-1][0]>=t)return n.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,i);let l=n.parse(r,a,c);if(!l)return null;c||=l.type,s.push([t,l])}return!CB(c,X)&&!CB(c,cB)&&!CB(c,sB)&&!CB(c,pB)&&!CB(c,hB)&&!CB(c,mB)&&!CB(c,_B)&&!CB(c,vB(X))?n.error(`Type ${yB(c)} is not interpolatable.`):new e(c,r,i,a,s,n.key)}evaluate(t){let n=this.labels,r=this.outputs;if(n.length===1)return r[0].evaluate(t);let i=this.input.evaluate(t);if(i<=n[0])return r[0].evaluate(t);let a=n.length;if(i>=n[a-1])return r[a-1].evaluate(t);let o=pV(n,i,this.key),s=n[o],c=n[o+1],l=e.interpolationFactor(this.interpolation,i,s,c),u=r[o].evaluate(t),d=r[o+1].evaluate(t);switch(this.operator){case`interpolate`:switch(this.type.kind){case`number`:return VB(u,d,l);case`color`:return UB.interpolate(u,d,l);case`padding`:return qB.interpolate(u,d,l);case`colorArray`:return YB.interpolate(u,d,l);case`numberArray`:return JB.interpolate(u,d,l);case`variableAnchorOffsetCollection`:return ZB.interpolate(u,d,l,this.key);case`array`:return HB(u,d,l);case`projectionDefinition`:return $B.interpolate(u,d,l)}case`interpolate-hcl`:switch(this.type.kind){case`color`:return UB.interpolate(u,d,l,`hcl`);case`colorArray`:return YB.interpolate(u,d,l,`hcl`)}case`interpolate-lab`:switch(this.type.kind){case`color`:return UB.interpolate(u,d,l,`lab`);case`colorArray`:return YB.interpolate(u,d,l,`lab`)}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function gV(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}var _V={color:UB.interpolate,number:VB,padding:qB.interpolate,numberArray:JB.interpolate,colorArray:YB.interpolate,variableAnchorOffsetCollection:ZB.interpolate,array:HB},vV=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=null,i=n.expectedType;i&&i.kind!==`value`&&(r=i);let a=[];for(let e of t.slice(1)){let t=n.parse(e,1+a.length,r,void 0,{typeAnnotation:`omit`});if(!t)return null;r||=t.type,a.push(t)}if(!r)throw Error(`No output type`);return i&&a.some(e=>bB(i,e.type))?new e(uB,a):new e(r,a)}evaluate(e){let t=null,n=0,r;for(let i of this.args)if(n++,t=i.evaluate(e),t&&t instanceof QB&&!t.available&&(r||=t.name,t=null,n===this.args.length&&(t=r)),t!==null)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function yV(e,t){return e===`==`||e===`!=`?t.kind===`boolean`||t.kind===`string`||t.kind===`number`||t.kind===`null`||t.kind===`value`:t.kind===`string`||t.kind===`number`||t.kind===`value`}function _Fe(e,t,n){return t===n}function vFe(e,t,n){return t!==n}function yFe(e,t,n){return t<n}function bFe(e,t,n){return t>n}function xFe(e,t,n){return t<=n}function SFe(e,t,n){return t>=n}function bV(e,t,n,r){return r.compare(t,n)===0}function CFe(e,t,n,r){return!bV(e,t,n,r)}function wFe(e,t,n,r){return r.compare(t,n)<0}function TFe(e,t,n,r){return r.compare(t,n)>0}function EFe(e,t,n,r){return r.compare(t,n)<=0}function DFe(e,t,n,r){return r.compare(t,n)>=0}function xV(e,t,n){let r=e!==`==`&&e!==`!=`;return class i{constructor(e,t,n,r){this.lhs=e,this.rhs=t,this.key=n,this.collator=r,this.type=oB,this.hasUntypedArgument=e.type.kind===`value`||t.type.kind===`value`}static parse(e,t){if(e.length!==3&&e.length!==4)return t.error(`Expected two or three arguments.`);let n=e[0],a=t.parse(e[1],1,uB);if(!a)return null;if(!yV(n,a.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${yB(a.type)}'.`);let o=t.parse(e[2],2,uB);if(!o)return null;if(!yV(n,o.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${yB(o.type)}'.`);if(a.type.kind!==o.type.kind&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot compare types '${yB(a.type)}' and '${yB(o.type)}'.`);r&&(a.type.kind===`value`&&o.type.kind!==`value`?a=new oV(o.type,[a],t.key):a.type.kind!==`value`&&o.type.kind===`value`&&(o=new oV(a.type,[o],t.key)));let s=null;if(e.length===4){if(a.type.kind!==`string`&&o.type.kind!==`string`&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot use collator to compare non-string types.`);if(s=t.parse(e[3],3,dB),!s)return null}return new i(a,o,t.key,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){let t=nV(a),n=nV(o);if(t.kind!==n.kind||t.kind!==`string`&&t.kind!==`number`)throw new XB(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`,this.key)}if(this.collator&&!r&&this.hasUntypedArgument){let e=nV(a),n=nV(o);if(e.kind!==`string`||n.kind!==`string`)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}var OFe=xV(`==`,_Fe,bV),kFe=xV(`!=`,vFe,CFe),AFe=xV(`<`,yFe,wFe),jFe=xV(`>`,bFe,TFe),MFe=xV(`<=`,xFe,EFe),NFe=xV(`>=`,SFe,DFe),SV=class e{constructor(e,t,n){this.type=dB,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,n){if(t.length!==2)return n.error(`Expected one argument.`);let r=t[1];if(typeof r!=`object`||Array.isArray(r))return n.error(`Collator options argument must be an object.`);let i=n.parse(r[`case-sensitive`]!==void 0&&r[`case-sensitive`],1,oB);if(!i)return null;let a=n.parse(r[`diacritic-sensitive`]!==void 0&&r[`diacritic-sensitive`],1,oB);if(!a)return null;let o=null;return r.locale&&(o=n.parse(r.locale,1,aB),!o)?null:new e(i,a,o)}evaluate(e){return new WB(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},PFe=class e{constructor(e,t,n,r,i,a){this.type=aB,this.number=e,this.locale=t,this.currency=n,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=a}static parse(t,n){if(t.length!==3)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,X);if(!r)return null;let i=t[2];if(typeof i!=`object`||Array.isArray(i))return n.error(`NumberFormat options argument must be an object.`);let a=null;if(i.locale&&(a=n.parse(i.locale,1,aB),!a))return null;let o=null;if(i.currency&&(o=n.parse(i.currency,1,aB),!o))return null;let s=null;if(i.unit&&(s=n.parse(i.unit,1,aB),!s))return null;if(o&&s)return n.error("NumberFormat options `currency` and `unit` are mutually exclusive");let c=null;if(i[`min-fraction-digits`]&&(c=n.parse(i[`min-fraction-digits`],1,X),!c))return null;let l=null;return i[`max-fraction-digits`]&&(l=n.parse(i[`max-fraction-digits`],1,X),!l)?null:new e(r,a,o,s,c,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?`currency`:this.unit?`unit`:`decimal`,currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},CV=class e{constructor(e){this.type=fB,this.sections=e}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[1];if(!Array.isArray(r)&&typeof r==`object`)return n.error(`First argument must be an image or text section.`);let i=[],a=!1;for(let e=1;e<=t.length-1;++e){let r=t[e];if(a&&typeof r==`object`&&!Array.isArray(r)){a=!1;let e=null;if(r[`font-scale`]&&(e=n.parse(r[`font-scale`],1,X),!e))return null;let t=null;if(r[`text-font`]&&(t=n.parse(r[`text-font`],1,vB(aB)),!t))return null;let o=null;if(r[`text-color`]&&(o=n.parse(r[`text-color`],1,sB),!o))return null;let s=null;if(r[`vertical-align`]){if(typeof r[`vertical-align`]==`string`&&!sFe.includes(r[`vertical-align`]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${r[`vertical-align`]}' instead.`);if(s=n.parse(r[`vertical-align`],1,aB),!s)return null}let c=i[i.length-1];c.scale=e,c.font=t,c.textColor=o,c.verticalAlign=s}else{let r=n.parse(t[e],1,uB);if(!r)return null;let o=r.type.kind;if(o!==`string`&&o!==`value`&&o!==`null`&&o!==`resolvedImage`)return n.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);a=!0,i.push({content:r,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(i)}evaluate(e){return new KB(this.sections.map(t=>{let n=t.content.evaluate(e);return nV(n)===gB?new GB(``,n,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new GB(rV(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}},FFe=class e{constructor(e){this.type=gB,this.input=e}static parse(t,n){if(t.length!==2)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,aB);return r?new e(r):n.error(`No image name provided.`)}evaluate(e){let t=this.input.evaluate(e),n=QB.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},IFe=class e{constructor(e,t){this.input=e,this.key=t,this.type=X}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=n.parse(t[1],1);return r?r.type.kind!==`array`&&r.type.kind!==`string`&&r.type.kind!==`value`?n.error(`Expected argument of type string or array, but found ${yB(r.type)} instead.`):new e(r,n.key):null}evaluate(e){let t=this.input.evaluate(e);if(typeof t==`string`)return[...t].length;if(Array.isArray(t))return t.length;throw new XB(`Expected value to be of type string or array, but found ${yB(nV(t))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},wV=8192;function LFe(e,t){let n=RFe(e[0]),r=BFe(e[1]),i=2**t.z;return[Math.round(n*i*wV),Math.round(r*i*wV)]}function TV(e,t){let n=2**t.z,r=(e[0]/wV+t.x)/n,i=(e[1]/wV+t.y)/n;return[zFe(r),VFe(i)]}function RFe(e){return(180+e)/360}function zFe(e){return e*360-180}function BFe(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function VFe(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function EV(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function DV(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function HFe(e,t,n){return t[1]>e[1]!=n[1]>e[1]&&e[0]<(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1])+t[0]}function UFe(e,t,n){let r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i===0&&r*a<=0&&i*o<=0}function OV(e,t,n,r){let i=[t[0]-e[0],t[1]-e[1]];return qFe([r[0]-n[0],r[1]-n[1]],i)!==0&&!!(jV(e,t,n,r)&&jV(n,r,e,t))}function WFe(e,t,n){for(let r of n)for(let n=0;n<r.length-1;++n)if(OV(e,t,r[n],r[n+1]))return!0;return!1}function kV(e,t,n=!1){let r=!1;for(let i of t)for(let t=0;t<i.length-1;t++){if(UFe(e,i[t],i[t+1]))return n;HFe(e,i[t],i[t+1])&&(r=!r)}return r}function GFe(e,t){for(let n of t)if(kV(e,n))return!0;return!1}function AV(e,t){for(let n of e)if(!kV(n,t))return!1;for(let n=0;n<e.length-1;++n)if(WFe(e[n],e[n+1],t))return!1;return!0}function KFe(e,t){for(let n of t)if(AV(e,n))return!0;return!1}function qFe(e,t){return e[0]*t[1]-e[1]*t[0]}function jV(e,t,n,r){let i=e[0]-n[0],a=e[1]-n[1],o=t[0]-n[0],s=t[1]-n[1],c=r[0]-n[0],l=r[1]-n[1],u=i*l-c*a,d=o*l-c*s;return u>0&&d<0||u<0&&d>0}function MV(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=[];for(let r=0;r<e[i].length;r++){let o=LFe(e[i][r],n);EV(t,o),a.push(o)}r.push(a)}return r}function NV(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=MV(e[i],t,n);r.push(a)}return r}function PV(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){let t=r*.5,i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;i===0&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}EV(t,e)}function JFe(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function FV(e,t,n,r){let i=2**r.z*wV,a=[r.x*wV,r.y*wV],o=[];for(let r of e)for(let e of r){let r=[e.x+a[0],e.y+a[1]];PV(r,t,n,i),o.push(r)}return o}function IV(e,t,n,r){let i=2**r.z*wV,a=[r.x*wV,r.y*wV],o=[];for(let n of e){let e=[];for(let r of n){let n=[r.x+a[0],r.y+a[1]];EV(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){JFe(t);for(let e of o)for(let r of e)PV(r,t,n,i)}return o}function YFe(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=MV(t.coordinates,r,i),o=FV(e.geometry(),n,r,i);if(!DV(n,r))return!1;for(let e of o)if(!kV(e,a))return!1}if(t.type===`MultiPolygon`){let a=NV(t.coordinates,r,i),o=FV(e.geometry(),n,r,i);if(!DV(n,r))return!1;for(let e of o)if(!GFe(e,a))return!1}return!0}function XFe(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=MV(t.coordinates,r,i),o=IV(e.geometry(),n,r,i);if(!DV(n,r))return!1;for(let e of o)if(!AV(e,a))return!1}if(t.type===`MultiPolygon`){let a=NV(t.coordinates,r,i),o=IV(e.geometry(),n,r,i);if(!DV(n,r))return!1;for(let e of o)if(!KFe(e,a))return!1}return!0}var LV=class e{constructor(e,t){this.type=oB,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(tV(t[1])){let n=t[1];if(n.type===`FeatureCollection`){let t=[];for(let e of n.features){let{type:n,coordinates:r}=e.geometry;n===`Polygon`&&t.push(r),n===`MultiPolygon`&&t.push(...r)}if(t.length)return new e(n,{type:`MultiPolygon`,coordinates:t})}else if(n.type===`Feature`){let t=n.geometry.type;if(t===`Polygon`||t===`MultiPolygon`)return new e(n,n.geometry)}else if(n.type===`Polygon`||n.type===`MultiPolygon`)return new e(n,n)}return n.error(`'within' expression requires valid geojson object that contains polygon geometry type.`)}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return YFe(e,this.geometries);if(e.geometryType()===`LineString`)return XFe(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},RV=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=(e<<1)+1,a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}};function zV(e,t,n=0,r=e.length-1,i=ZFe){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);zV(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(BV(e,n,t),i(e[r],a)>0&&BV(e,n,r);o<s;){for(BV(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?BV(e,n,s):(s++,BV(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function BV(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function ZFe(e,t){return e<t?-1:+(e>t)}function VV(e,t){if(e.length<=1)return[e];let n=[],r,i;for(let t of e){let e=$Fe(t);e!==0&&(t.area=Math.abs(e),i===void 0&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(zV(n[e],t,1,n[e].length-1,QFe),n[e]=n[e].slice(0,t));return n}function QFe(e,t){return t.area-e.area}function $Fe(e){let t=0;for(let n=0,r=e.length,i=r-1,a,o;n<r;i=n++)a=e[n],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}var HV=Math.PI/180,UV=class{constructor(e){let t=HV*6378.137*1e3,n=Math.cos(e*HV),r=1/(1-.0066943799901413165*(1-n*n)),i=Math.sqrt(r);this.kx=t*i*n,this.ky=t*i*r*.9933056200098587}distance(e,t){let n=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(n*n+r*r)}pointOnLine(e,t){let n=1/0,r,i,a,o;for(let s=0;s<e.length-1;s++){let c=e[s][0],l=e[s][1],u=this.wrap(e[s+1][0]-c)*this.kx,d=(e[s+1][1]-l)*this.ky,f=0;(u!==0||d!==0)&&(f=(this.wrap(t[0]-c)*this.kx*u+(t[1]-l)*this.ky*d)/(u*u+d*d),f>1?(c=e[s+1][0],l=e[s+1][1]):f>0&&(c+=u/this.kx*f,l+=d/this.ky*f)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-l)*this.ky;let p=u*u+d*d;p<n&&(n=p,r=c,i=l,a=s,o=f)}return{point:[r,i],index:a,t:Math.max(0,Math.min(1,o))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};function WV(e,t){return t[0]-e[0]}function GV(e){return e[1]-e[0]+1}function KV(e,t){return e[1]>=e[0]&&e[1]<t}function qV(e,t){if(e[0]>e[1])return[null,null];let n=GV(e);if(t){if(n===2)return[e,null];let t=Math.floor(n/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(n===1)return[e,null];let r=Math.floor(n/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function JV(e,t){if(!KV(t,e.length))return[1/0,1/0,-1/0,-1/0];let n=[1/0,1/0,-1/0,-1/0];for(let r=t[0];r<=t[1];++r)EV(n,e[r]);return n}function YV(e){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)for(let e of n)EV(t,e);return t}function XV(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function ZV(e,t,n){if(!XV(e)||!XV(t))return NaN;let r=0,i=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),n.distance([0,0],[r,i])}function QV(e,t,n){let r=n.pointOnLine(t,e);return n.distance(e,r.point)}function $V(e,t,n,r,i){let a=Math.min(QV(e,[n,r],i),QV(t,[n,r],i)),o=Math.min(QV(n,[e,t],i),QV(r,[e,t],i));return Math.min(a,o)}function eIe(e,t,n,r,i){if(!(KV(t,e.length)&&KV(r,n.length)))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],s=e[o+1];for(let e=r[0];e<r[1];++e){let r=n[e],o=n[e+1];if(OV(t,s,r,o))return 0;a=Math.min(a,$V(t,s,r,o,i))}}return a}function tIe(e,t,n,r,i){if(!(KV(t,e.length)&&KV(r,n.length)))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=r[0];t<=r[1];++t)if(a=Math.min(a,i.distance(e[o],n[t])),a===0)return a;return a}function nIe(e,t,n){if(kV(e,t,!0))return 0;let r=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&(r=Math.min(r,QV(e,[a,t],n)),r===0))return r;let o=n.pointOnLine(i,e);if(r=Math.min(r,n.distance(e,o.point)),r===0)return r}return r}function rIe(e,t,n,r){if(!KV(t,e.length))return NaN;for(let r=t[0];r<=t[1];++r)if(kV(e[r],n,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],o=e[a+1];for(let e of n)for(let n=0,a=e.length,s=a-1;n<a;s=n++){let a=e[s],c=e[n];if(OV(t,o,a,c))return 0;i=Math.min(i,$V(t,o,a,c,r))}}return i}function eH(e,t){for(let n of e)for(let e of n)if(kV(e,t,!0))return!0;return!1}function iIe(e,t,n,r=1/0){let i=YV(e),a=YV(t);if(r!==1/0&&ZV(i,a,n)>=r)return r;if(DV(i,a)){if(eH(e,t))return 0}else if(eH(t,e))return 0;let o=1/0;for(let r of e)for(let e=0,i=r.length,a=i-1;e<i;a=e++){let i=r[a],s=r[e];for(let e of t)for(let t=0,r=e.length,a=r-1;t<r;a=t++){let r=e[a],c=e[t];if(OV(i,s,r,c))return 0;o=Math.min(o,$V(i,s,r,c,n))}}return o}function tH(e,t,n,r,i,a){if(!a)return;let o=ZV(JV(r,a),i,n);o<t&&e.push([o,a,[0,0]])}function nH(e,t,n,r,i,a,o){if(!a||!o)return;let s=ZV(JV(r,a),JV(i,o),n);s<t&&e.push([s,a,o])}function rH(e,t,n,r,i=1/0){let a=Math.min(r.distance(e[0],n[0][0]),i);if(a===0)return a;let o=new RV([[0,[0,e.length-1],[0,0]]],WV),s=YV(n);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let c=i[1],l=t?50:100;if(GV(c)<=l){if(!KV(c,e.length))return NaN;if(t){let t=rIe(e,c,n,r);if(isNaN(t)||t===0)return t;a=Math.min(a,t)}else for(let t=c[0];t<=c[1];++t){let i=nIe(e[t],n,r);if(a=Math.min(a,i),a===0)return 0}}else{let n=qV(c,t);tH(o,a,r,e,s,n[0]),tH(o,a,r,e,s,n[1])}}return a}function iH(e,t,n,r,i,a=1/0){let o=Math.min(a,i.distance(e[0],n[0]));if(o===0)return o;let s=new RV([[0,[0,e.length-1],[0,n.length-1]]],WV);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let c=a[1],l=a[2],u=t?50:100,d=r?50:100;if(GV(c)<=u&&GV(l)<=d){if(!KV(c,e.length)&&KV(l,n.length))return NaN;let a;if(t&&r)a=eIe(e,c,n,l,i),o=Math.min(o,a);else if(t&&!r){let t=e.slice(c[0],c[1]+1);for(let e=l[0];e<=l[1];++e)if(a=QV(n[e],t,i),o=Math.min(o,a),o===0)return o}else if(!t&&r){let t=n.slice(l[0],l[1]+1);for(let n=c[0];n<=c[1];++n)if(a=QV(e[n],t,i),o=Math.min(o,a),o===0)return o}else a=tIe(e,c,n,l,i),o=Math.min(o,a)}else{let a=qV(c,t),u=qV(l,r);nH(s,o,i,e,n,a[0],u[0]),nH(s,o,i,e,n,a[0],u[1]),nH(s,o,i,e,n,a[1],u[0]),nH(s,o,i,e,n,a[1],u[1])}}return o}function aIe(e,t){let n=e.geometry(),r=n.flat().map(t=>TV([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new UV(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,iH(r,!1,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,iH(r,!1,e.coordinates,!0,i,a));break;
vendor: 4,986 bytes, line 409
409case`Polygon`:a=Math.min(a,rH(r,!1,e.coordinates,i,a))}if(a===0)return a}return a}function oIe(e,t){let n=e.geometry(),r=n.flat().map(t=>TV([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new UV(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,iH(r,!0,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,iH(r,!0,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,rH(r,!0,e.coordinates,i,a))}if(a===0)return a}return a}function sIe(e,t){let n=e.geometry();if(n.length===0||n[0].length===0)return NaN;let r=VV(n,0).map(t=>t.map(t=>t.map(t=>TV([t.x,t.y],e.canonical)))),i=new UV(r[0][0][0][1]),a=1/0;for(let e of t)for(let t of r){switch(e.type){case`Point`:a=Math.min(a,rH([e.coordinates],!1,t,i,a));break;case`LineString`:a=Math.min(a,rH(e.coordinates,!0,t,i,a));break;case`Polygon`:a=Math.min(a,iIe(t,e.coordinates,i,a))}if(a===0)return a}return a}function aH(e){return e.type===`MultiPolygon`?e.coordinates.map(e=>({type:`Polygon`,coordinates:e})):e.type===`MultiLineString`?e.coordinates.map(e=>({type:`LineString`,coordinates:e})):e.type===`MultiPoint`?e.coordinates.map(e=>({type:`Point`,coordinates:e})):[e]}var oH=class e{constructor(e,t){this.type=X,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(tV(t[1])){let n=t[1];if(n.type===`FeatureCollection`)return new e(n,n.features.map(e=>aH(e.geometry)).flat());if(n.type===`Feature`)return new e(n,aH(n.geometry));if(`type`in n&&`coordinates`in n)return new e(n,aH(n))}return n.error(`'distance' expression requires valid geojson object that contains polygon geometry type.`)}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return aIe(e,this.geometries);if(e.geometryType()===`LineString`)return oIe(e,this.geometries);if(e.geometryType()===`Polygon`)return sIe(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},cIe=class e{constructor(e){let t=null;for(let n of e)if(!t)t=n.type;else if(t===n.type)continue;else{t=uB;break}this.type=vB(t??uB,e.length),this.arr=e}static parse(t,n){if(t.length!==2)return n.error(`'semiliteral' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!tV(t[1]))return n.error(`invalid value of type "${typeof t[1]}"`);let r=t[1],i=nV(r);if(i.kind===`array`){let t=r.map(e=>n.parse(e,null,uB));return new e(t)}return new iV(i,r)}evaluate(e){return this.arr.map(t=>t.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},sH=class e{constructor(e){this.key=e,this.type=uB}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=t[1];return r==null?n.error(`Global state property must be defined.`):typeof r==`string`?new e(r):n.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(e){let t=e.globals?.globalState;return!t||Object.keys(t).length===0?null:IB(t,this.key)??null}eachChild(){}outputDefined(){return!1}},cH={"==":OFe,"!=":kFe,">":jFe,"<":AFe,">=":NFe,"<=":MFe,array:oV,at:uFe,boolean:oV,case:mFe,coalesce:vV,collator:SV,format:CV,image:FFe,in:dFe,"index-of":fFe,interpolate:hV,"interpolate-hcl":hV,"interpolate-lab":hV,length:IFe,let:dV,literal:iV,match:pFe,number:oV,"number-format":PFe,object:oV,semiliteral:cIe,slice:hFe,step:mV,string:oV,"to-boolean":cV,"to-color":cV,"to-number":cV,"to-string":cV,var:fV,within:LV,distance:oH,"global-state":sH},lH=class e{constructor(e,t,n,r,i){this.name=e,this.type=t,this._evaluate=n,this.args=r,this.key=i}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,n){let r=t[0],i=e.definitions[r];if(!i)return n.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),c=null;for(let[i,o]of s){c=new uV(n.registry,mH,n.path,null,n.scope);let s=[],l=!1;for(let e=1;e<t.length;e++){let n=t[e],r=Array.isArray(i)?i[e-1]:i.type,a=c.parse(n,1+s.length,r);if(!a){l=!0;break}s.push(a)}if(!l){if(Array.isArray(i)&&i.length!==s.length){c.error(`Expected ${i.length} arguments, but found ${s.length} instead.`);continue}for(let e=0;e<s.length;e++){let t=Array.isArray(i)?i[e]:i.type,n=s[e];c.concat(e+1).checkSubtype(t,n.type)}if(c.errors.length===0)return new e(r,a,o,s,n.key)}}if(s.length===1)n.errors.push(...c.errors);else{let e=(s.length?s:o).map(([e])=>uIe(e)).join(` | `),r=[];for(let e=1;e<t.length;e++){let i=n.parse(t[e],1+r.length);if(!i)return null;r.push(yB(i.type))}n.error(`Expected arguments of type ${e}, but found (${r.join(`, `)}) instead.`)}return null}static register(t,n){e.definitions=n;for(let r in n)t[r]=e}};function uH(e,[t,n,r,i],a){t=t.evaluate(e),n=n.evaluate(e),r=r.evaluate(e);
vendor: 15,810 bytes, line 409
409let o=i?i.evaluate(e):1,s=eV(t,n,r,o);if(s)throw new XB(s,a);return new UB(t/255,n/255,r/255,o,!1)}function dH(e,t){return e in t&&t[e]!==void 0}function fH(e,t){let n=t[e];return n===void 0?null:n}function lIe(e,t,n,r){for(;n<=r;){let i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}function pH(e){return{type:e}}lH.register(cH,{error:[XPe,[aB],(e,[t],n)=>{throw new XB(t.evaluate(e),n)}],typeof:[aB,[uB],(e,[t])=>yB(nV(t.evaluate(e)))],"to-rgba":[vB(X,4),[sB],(e,[t])=>{let[n,r,i,a]=t.evaluate(e).rgb;return[n*255,r*255,i*255,a]}],rgb:[sB,[X,X,X],uH],rgba:[sB,[X,X,X,X],uH],has:{type:oB,overloads:[[[aB],(e,[t])=>dH(t.evaluate(e),e.properties())],[[aB,lB],(e,[t,n])=>dH(t.evaluate(e),n.evaluate(e))]]},get:{type:uB,overloads:[[[aB],(e,[t])=>fH(t.evaluate(e),e.properties())],[[aB,lB],(e,[t,n])=>fH(t.evaluate(e),n.evaluate(e))]]},"feature-state":[uB,[aB],(e,[t])=>fH(t.evaluate(e),e.featureState||{})],properties:[lB,[],e=>e.properties()],"geometry-type":[aB,[],e=>e.geometryType()],id:[uB,[],e=>e.id()],zoom:[X,[],e=>e.globals.zoom],"heatmap-density":[X,[],e=>e.globals.heatmapDensity||0],elevation:[X,[],e=>e.globals.elevation||0],"line-progress":[X,[],e=>e.globals.lineProgress||0],accumulated:[uB,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[X,pH(X),(e,t)=>{let n=0;for(let r of t)n+=r.evaluate(e);return n}],"*":[X,pH(X),(e,t)=>{let n=1;for(let r of t)n*=r.evaluate(e);return n}],"-":{type:X,overloads:[[[X,X],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[X],(e,[t])=>-t.evaluate(e)]]},"/":[X,[X,X],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[X,[X,X],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[X,[],()=>Math.LN2],pi:[X,[],()=>Math.PI],e:[X,[],()=>Math.E],"^":[X,[X,X],(e,[t,n])=>t.evaluate(e)**+n.evaluate(e)],sqrt:[X,[X],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[X,[X],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[X,[X],(e,[t])=>Math.log(t.evaluate(e))],log2:[X,[X],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[X,[X],(e,[t])=>Math.sin(t.evaluate(e))],cos:[X,[X],(e,[t])=>Math.cos(t.evaluate(e))],tan:[X,[X],(e,[t])=>Math.tan(t.evaluate(e))],asin:[X,[X],(e,[t])=>Math.asin(t.evaluate(e))],acos:[X,[X],(e,[t])=>Math.acos(t.evaluate(e))],atan:[X,[X],(e,[t])=>Math.atan(t.evaluate(e))],min:[X,pH(X),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[X,pH(X),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[X,[X],(e,[t])=>Math.abs(t.evaluate(e))],round:[X,[X],(e,[t])=>{let n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[X,[X],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[X,[X],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[oB,[aB,uB],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[oB,[uB],(e,[t])=>e.id()===t.value],"filter-type-==":[oB,[aB],(e,[t])=>e.geometryType()===t.value],"filter-<":[oB,[aB,uB],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[oB,[uB],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<r}],"filter->":[oB,[aB,uB],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[oB,[uB],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>r}],"filter-<=":[oB,[aB,uB],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[oB,[uB],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<=r}],"filter->=":[oB,[aB,uB],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[oB,[uB],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>=r}],"filter-has":[oB,[uB],(e,[t])=>{let n=t.value,r=e.properties();return n in r&&r[n]!==void 0}],"filter-has-id":[oB,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[oB,[vB(aB)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[oB,[vB(uB)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[oB,[aB,vB(uB)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[oB,[aB,vB(uB)],(e,[t,n])=>lIe(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:oB,overloads:[[[oB,oB],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[pH(oB),(e,t)=>{for(let n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:oB,overloads:[[[oB,oB],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[pH(oB),(e,t)=>{for(let n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[oB,[oB],(e,[t])=>!t.evaluate(e)],"is-supported-script":[oB,[aB],(e,[t])=>{let n=e.globals&&e.globals.isSupportedScript;return!n||n(t.evaluate(e))}],upcase:[aB,[aB],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[aB,[aB],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[aB,pH(uB),(e,t)=>t.map(t=>rV(t.evaluate(e))).join(``)],split:[vB(aB),[aB,aB],(e,[t,n])=>t.evaluate(e).split(n.evaluate(e))],join:[aB,[vB(aB),aB],(e,[t,n])=>t.evaluate(e).join(n.evaluate(e))],"resolved-locale":[aB,[dB],(e,[t])=>t.evaluate(e).resolvedLocale()]});function uIe(e){return Array.isArray(e)?`(${e.map(yB).join(`, `)})`:`(${yB(e.type)}...)`}function mH(e){if(e instanceof fV)return mH(e.boundExpression);if(e instanceof lH&&e.name===`error`||e instanceof SV||e instanceof LV||e instanceof oH||e instanceof sH)return!1;let t=e instanceof cV||e instanceof oV,n=!0;return e.eachChild(e=>{n&&=t?mH(e):e instanceof iV}),n?hH(e)&&_H(e,[`zoom`,`heatmap-density`,`elevation`,`line-progress`,`accumulated`,`is-supported-script`]):!1}function hH(e){if(e instanceof lH&&(e.name===`get`&&e.args.length===1||e.name===`feature-state`||e.name===`has`&&e.args.length===1||e.name===`properties`||e.name===`geometry-type`||e.name===`id`||/^filter-/.test(e.name))||e instanceof LV||e instanceof oH)return!1;let t=!0;return e.eachChild(e=>{t&&!hH(e)&&(t=!1)}),t}function gH(e){if(e instanceof lH&&e.name===`feature-state`)return!1;let t=!0;return e.eachChild(e=>{t&&!gH(e)&&(t=!1)}),t}function _H(e,t){if(e instanceof lH&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild(e=>{n&&!_H(e,t)&&(n=!1)}),n}function vH(e){return{result:`success`,value:e}}function yH(e){return{result:`error`,value:e}}function bH(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function xH(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function SH(e){return!!e.expression&&e.expression.interpolated}function CH(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}function wH(e){return e instanceof Number?`number`:e instanceof String?`string`:e instanceof Boolean?`boolean`:Array.isArray(e)?`array`:e===null?`null`:typeof e}function TH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&nV(e)===lB}function dIe(e){return e}function fIe(e){switch(e.type){case`color`:return UB.parse;case`padding`:return qB.parse;case`numberArray`:return JB.parse;case`colorArray`:return YB.parse;default:return null}}function pIe(e){switch(e){case`exponential`:return OH;case`interval`:return hIe;case`categorical`:return mIe;case`identity`:return gIe;default:throw Error(`Unknown function type "${e}"`)}}function EH(e,t){let n=e.stops&&typeof e.stops[0][0]==`object`,r=n||e.property!==void 0,i=n||!r,a=e.type||(SH(t)?`exponential`:`interval`),o=fIe(t);if(o&&(e=CH({},e),e.stops&&=e.stops.map(e=>[e[0],o(e[1])]),e.default?e.default=o(e.default):e.default=o(t.default)),e.colorSpace&&!oFe(e.colorSpace))throw Error(`Unknown color space: "${e.colorSpace}"`);let s=pIe(a),c,l;if(a===`categorical`){c=Object.create(null);for(let t of e.stops)c[t[0]]=t[1];l=typeof e.stops[0][0]}if(n){let n={},r=[];for(let t=0;t<e.stops.length;t++){let i=e.stops[t],a=i[0].zoom;n[a]===void 0&&(n[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},r.push(a)),n[a].stops.push([i[0].value,i[1]])}let i=[];for(let e of r)i.push([n[e].zoom,EH(n[e],t)]);let a={name:`linear`};return{kind:`composite`,interpolationType:a,interpolationFactor:hV.interpolationFactor.bind(void 0,a),zoomStops:i.map(e=>e[0]),evaluate({zoom:n},r){return OH({stops:i,base:e.base},t,n).evaluate(n,r)}}}if(i){let n=a===`exponential`?{name:`exponential`,base:e.base===void 0?1:e.base}:null;return{kind:`camera`,interpolationType:n,interpolationFactor:hV.interpolationFactor.bind(void 0,n),zoomStops:e.stops.map(e=>e[0]),evaluate:({zoom:n})=>s(e,t,n,c,l)}}return{kind:`source`,evaluate(n,r){let i=r&&r.properties?r.properties[e.property]:void 0;return i===void 0?DH(e.default,t.default):s(e,t,i,c,l)}}}function DH(e,t,n){if(e!==void 0)return e;if(t!==void 0)return t;if(n!==void 0)return n}function mIe(e,t,n,r,i){return DH(typeof n===i?r[n]:void 0,e.default,t.default)}function hIe(e,t,n){if(wH(n)!==`number`)return DH(e.default,t.default);let r=e.stops.length;if(r===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];let i=pV(e.stops.map(e=>e[0]),n,``);return e.stops[i][1]}function OH(e,t,n){let r=e.base===void 0?1:e.base;if(wH(n)!==`number`)return DH(e.default,t.default);let i=e.stops.length;if(i===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];let a=pV(e.stops.map(e=>e[0]),n,``),o=_Ie(n,r,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],c=e.stops[a+1][1],l=_V[t.type]||dIe;return typeof s.evaluate==`function`?{evaluate(...t){let n=s.evaluate.apply(void 0,t),r=c.evaluate.apply(void 0,t);if(n!==void 0&&r!==void 0)return l(n,r,o,e.colorSpace)}}:l(s,c,o,e.colorSpace)}function gIe(e,t,n){switch(t.type){case`color`:n=UB.parse(n);break;case`formatted`:n=KB.fromString(n.toString());break;case`resolvedImage`:n=QB.fromString(n.toString());break;case`padding`:n=qB.parse(n);break;case`colorArray`:n=YB.parse(n);break;case`numberArray`:n=JB.parse(n);break;default:wH(n)!==t.type&&(t.type!==`enum`||!t.values[n])&&(n=void 0)}return DH(n,e.default,t.default)}function _Ie(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}var kH=class{constructor(e,t,n,r){this.expression=e,this._warningHistory={},this._evaluator=new lV,this._defaultValue=n?BH(n):null,this._enumValues=n&&n.type===`enum`?n.values:null,this._globalState=r,this._rootKey=t}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=VH(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,a){this._globalState&&(e=VH(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(e==null||typeof e==`number`&&e!==e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new XB(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(`, `)}, but found ${JSON.stringify(e)} instead.`,``);return e}catch(e){let t=e instanceof XB?e.path:``,n=`${t}|${e.message}`;return this._warningHistory[n]||(this._warningHistory[n]=!0,typeof console<`u`&&console.warn(AH(this._rootKey,t,e.message,this._defaultValue))),this._defaultValue}}};function AH(e,t,n,r){return`${e}${t}: ${n}${r==null?``:` Falling back to ${String(r)}.`}`}function jH(e){if(!e)throw Error(`rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".`)}function MH(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`string`&&e[0]in cH}function NH(e,t,n,r){jH(t);let i=new uV(cH,mH,[],n?bIe(n):void 0),a=i.parse(e,void 0,void 0,void 0,n&&n.type===`string`?{typeAnnotation:`coerce`}:void 0);return a?vH(new kH(a,t,n,r)):yH(i.errors)}var PH=class{constructor(e,t,n){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!gH(t.expression),this.globalStateRefs=zH(t.expression),this._globalState=n}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=VH(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._globalState&&(e=VH(e,this._globalState)),this._styleExpression.evaluate(e,t,n,r,i,a)}},FH=class{constructor(e,t,n,r,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!gH(t.expression),this.globalStateRefs=zH(t.expression),this.interpolationType=r,this._globalState=i}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=VH(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._globalState&&(e=VH(e,this._globalState)),this._styleExpression.evaluate(e,t,n,r,i,a)}interpolationFactor(e,t,n){return this.interpolationType?hV.interpolationFactor(this.interpolationType,e,t,n):0}};function vIe(e){return e._styleExpression!==void 0}function IH(e,t,n,r){let i=NH(e,t,n,r);if(i.result===`error`)return i;let a=i.value.expression,o=hH(a);if(!o&&!bH(n))return yH([new rB(``,`data expressions not supported`)]);let s=_H(a,[`zoom`]);if(!s&&!xH(n))return yH([new rB(``,`zoom expressions not supported`)]);let c=RH(a);if(!c&&!s)return yH([new rB(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`)]);if(c instanceof rB)return yH([c]);if(c instanceof hV&&!SH(n))return yH([new rB(``,`"interpolate" expressions cannot be used with this property`)]);if(!c)return vH(o?new PH(`constant`,i.value,r):new PH(`source`,i.value,r));let l=c instanceof hV?c.interpolation:void 0;return vH(o?new FH(`camera`,i.value,c.labels,l,r):new FH(`composite`,i.value,c.labels,l,r))}var LH=class e{constructor(e,t,n){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,jH(t),this._parameters=e,this._specification=n,this._rootKey=t,this._defaultValue=BH(n),this._warningHistory={};let r=EH(this._parameters,this._specification);this.kind=r.kind,this.interpolationFactor=r.interpolationFactor,this.zoomStops=r.zoomStops,this.interpolationType=r.interpolationType,this._innerEvaluate=r.evaluate}evaluate(e,t){try{return this._innerEvaluate(e,t)}catch(e){let t=e instanceof Error?e.message:String(e),n=`|${t}`;return this._warningHistory[n]||(this._warningHistory[n]=!0,typeof console<`u`&&console.warn(AH(this._rootKey,``,t,this._defaultValue))),this._defaultValue}}static deserialize(t){return new e(t._parameters,t._rootKey,t._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function yIe(e,t,n,r){if(TH(e))return new LH(e,t,n);if(MH(e)){let i=IH(e,t,n,r);if(i.result===`error`)throw Error(i.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return i.value}{let t=e;return n.type===`color`&&typeof e==`string`?t=UB.parse(e):n.type===`padding`&&(typeof e==`number`||Array.isArray(e))?t=qB.parse(e):n.type===`numberArray`&&(typeof e==`number`||Array.isArray(e))?t=JB.parse(e):n.type===`colorArray`&&(typeof e==`string`||Array.isArray(e))?t=YB.parse(e):n.type===`variableAnchorOffsetCollection`&&Array.isArray(e)?t=ZB.parse(e):n.type===`projectionDefinition`&&typeof e==`string`&&(t=$B.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:`constant`,evaluate:()=>t}}}function RH(e){let t=null;if(e instanceof dV)t=RH(e.result);else if(e instanceof vV){for(let n of e.args)if(t=RH(n),t)break}else(e instanceof mV||e instanceof hV)&&e.input instanceof lH&&e.input.name===`zoom`&&(t=e);return t instanceof rB||e.eachChild(e=>{let n=RH(e);n instanceof rB?t=n:!t&&n?t=new rB(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`):t&&n&&t!==n&&(t=new rB(``,`Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.`))}),t}function zH(e,t=new Set){return e instanceof sH&&t.add(e.key),e.eachChild(e=>{zH(e,t)}),t}function bIe(e){let t={color:sB,string:aB,number:X,enum:aB,boolean:oB,formatted:fB,padding:pB,numberArray:hB,c
vendor: 5,619 bytes, line 409
409olorArray:mB,projectionDefinition:cB,resolvedImage:gB,variableAnchorOffsetCollection:_B};return e.type===`array`?vB(t[e.value]||uB,e.length):t[e.type]}function BH(e){if(e.type===`color`&&TH(e.default))return new UB(0,0,0,0);switch(e.type){case`color`:return UB.parse(e.default)||null;case`padding`:return qB.parse(e.default)||null;case`numberArray`:return JB.parse(e.default)||null;case`colorArray`:return YB.parse(e.default)||null;case`variableAnchorOffsetCollection`:return ZB.parse(e.default)||null;case`projectionDefinition`:return $B.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function VH(e,t){let{zoom:n,heatmapDensity:r,elevation:i,lineProgress:a,isSupportedScript:o,accumulated:s}=e??{};return{zoom:n,heatmapDensity:r,elevation:i,lineProgress:a,isSupportedScript:o,accumulated:s,globalState:t}}function xIe(e){let t=!1;for(let n of e){let e=HH(n);if(e===`expression`)return`expression`;e===`legacy`&&(t=!0)}return t?`legacy`:`neutral`}function HH(e){if(typeof e==`boolean`)return`neutral`;if(!Array.isArray(e)||e.length===0)return`legacy`;switch(e[0]){case`has`:return e.length<2||e[1]===`$id`||e[1]===`$type`?`legacy`:e.length===2?`neutral`:`expression`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]))?`expression`:`legacy`;case`!in`:case`!has`:return`legacy`;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?`expression`:`legacy`;case`none`:return`legacy`;case`any`:case`all`:return xIe(e.slice(1));default:return`expression`}}function UH(e){return HH(e)!==`legacy`}function WH(e){return e===`$type`?[`geometry-type`]:e===`$id`?[`id`]:[`get`,e]}function SIe(e){switch(e[0]){case`==`:case`!=`:case`<`:case`<=`:case`>`:case`>=`:return e.length!==3||typeof e[1]!=`string`?null:[e[0],WH(e[1]),e[2]];case`in`:case`!in`:{if(e.length<2||typeof e[1]!=`string`)return null;let t=[`in`,WH(e[1]),[`literal`,e.slice(2)]];return e[0]===`!in`?[`!`,t]:t}case`has`:case`!has`:{if(e.length!==2||typeof e[1]!=`string`||e[1]===`$type`||e[1]===`$id`)return null;let t=[`has`,e[1]];return e[0]===`!has`?[`!`,t]:t}default:return null}}function GH(e){if((e[0]===`<`||e[0]===`<=`||e[0]===`>`||e[0]===`>=`)&&e[1]===`$type`)return`"$type" cannot be use with operator "${e[0]}"`;let t=SIe(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function KH(e,t,n){let r=n[e];return Array.isArray(r)?UH(r)?qH(r,t.concat(e)):{path:t.concat(e),legacyFilter:r}:null}function qH(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case`all`:case`any`:case`none`:for(let n=1;n<e.length;n++){let r=KH(n,t,e);if(r)return r}break;case`!`:{let n=KH(1,t,e);if(n)return n;break}case`case`:for(let n=1;n<e.length-1;n+=2){let r=KH(n,t,e);if(r)return r}}return null}function CIe(e,t){let n=qH(e);if(!n||typeof console>`u`)return;let r=n.path.map(e=>`[${e}]`).join(``);console.warn(`${t}${r}: ${GH(n.legacyFilter)}`)}var wIe={type:`boolean`,default:!1,transition:!1,"property-type":`data-driven`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]}};function JH(e,t,n){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};UH(e)?CIe(e,t):e=XH(e);let r=NH(e,t,wIe,n);if(r.result===`error`)throw Error(r.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:YH(e),getGlobalStateRefs:()=>zH(r.value.expression)}}function TIe(e,t){return e<t?-1:+(e>t)}function YH(e){if(!Array.isArray(e))return!1;if(e[0]===`within`||e[0]===`distance`)return!0;for(let t=1;t<e.length;t++)if(YH(e[t]))return!0;return!1}function XH(e){if(!e)return!0;let t=e[0];return e.length<=1?t!==`any`:t===`==`?ZH(e[1],e[2],`==`):t===`!=`?eU(ZH(e[1],e[2],`==`)):t===`<`||t===`>`||t===`<=`||t===`>=`?ZH(e[1],e[2],t):t===`any`?EIe(e.slice(1)):t===`all`?[`all`].concat(e.slice(1).map(XH)):t===`none`?[`all`].concat(e.slice(1).map(XH).map(eU)):t===`in`?QH(e[1],e.slice(2)):t===`!in`?eU(QH(e[1],e.slice(2))):t===`has`?$H(e[1]):t!==`!has`||eU($H(e[1]))}function ZH(e,t,n){switch(e){case`$type`:return[`filter-type-${n}`,t];case`$id`:return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function EIe(e){return[`any`].concat(e.map(XH))}function QH(e,t){if(t.length===0)return!1;switch(e){case`$type`:return[`filter-type-in`,[`literal`,t]];case`$id`:return[`filter-id-in`,[`literal`,t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?[`filter-in-large`,e,[`literal`,t.sort(TIe)]]:[`filter-in-small`,e,[`literal`,t]]}}function $H(e){switch(e){case`$type`:return!0;case`$id`:return[`filter-has-id`];default:return[`filter-has`,e]}}function eU(e){return[`!`,e]}function DIe(){let e={},t=J.$version;for(let n in J.$root){let r=J.$root[n];if(r.required){let i=null;i=n===`version`?t:r.type===`array`?[]:{},i!=null&&(e[n]=i)}}return e}function tU(e){let t=e.key,n=e.value;return n?[new Y(t,n,`constants have been deprecated as of v8`)]:[]}function nU(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function rU(e){if(Array.isArray(e))return e.map(rU);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let n in e)t[n]=rU(e[n]);return t}return nU(e)}function iU(e){let t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,c=[],l=wH(n);if(l!==`object`)return[new Y(t,n,`object expected, ${l}
409 found`)];for(let e in n){let l=e.split(`.`)[0],u=IB(r,l)||r[`*`],d;if(IB(i,l))d=i[l];else if(IB(r,l)){if(n[e]===void 0)continue;d=s}else if(i[`*`])d=i[`*`];else if(r[`*`])d=s;else{c.push(new Y(t,n[e],`unknown property "${e}"`));continue}c=c.concat(d({key:(t&&`${t}.`)+e,value:n[e],valueSpec:u,style:a,styleSpec:o,object:n,objectKey:e,validateSpec:s},n))}for(let e in r)i[e]||r[e].required&&r[e].default===void 0&&n[e]===void 0&&c.push(new Y(t,n,`missing required property "${e}"`));return c}function aU(e){let t=e.value,n=e.valueSpec,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.key,s=e.arrayElementValidator||r;if(wH(t)!==`array`)return[new Y(o,t,`array expected, ${wH(t)} found`)];if(n.length&&t.length!==n.length)return[new Y(o,t,`array length ${n.length} expected, length ${t.length} found`)];let c={type:n.value,values:n.values};a.$version<7&&(c.function=n.function),wH(n.value)===`object`&&(c=n.value);let l=[];for(let n=0;n<t.length;n++)l=l.concat(s({array:t,arrayIndex:n,value:t[n],valueSpec:c,validateSpec:e.validateSpec,style:i,styleSpec:a,key:`${o}[${n}]`}));return l}function oU(e){let t=e.key,n=e.value,r=e.valueSpec,i=wH(n);return i===`number`&&n!==n&&(i=`NaN`),i===`number`?`minimum`in r&&n<r.minimum?[new Y(t,n,`${n} is less than the minimum value ${r.minimum}`)]:`maximum`in r&&n>r.maximum?[new Y(t,n,`${n} is greater than the maximum value ${r.maximum}`)]:[]:[new Y(t,n,`number expected, ${i} found`)]}function sU(e){let t=e.valueSpec,n=nU(e.value.type),r,i={},a,o,s=n!==`categorical`&&e.value.property===void 0,c=!s,l=wH(e.value.stops)===`array`&&wH(e.value.stops[0])===`array`&&wH(e.value.stops[0][0])===`object`,u=iU({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:d,default:m}});return n===`identity`&&s&&u.push(new Y(e.key,e.value,`missing required property "property"`)),n!==`identity`&&!e.value.stops&&u.push(new Y(e.key,e.value,`missing required property "stops"`)),n===`exponential`&&e.valueSpec.expression&&!SH(e.valueSpec)&&u.push(new Y(e.key,e.value,`exponential functions not supported`)),e.styleSpec.$version>=8&&(c&&!bH(e.valueSpec)?u.push(new Y(e.key,e.value,`property functions not supported`)):s&&!xH(e.valueSpec)&&u.push(new Y(e.key,e.value,`zoom functions not supported`))),(n===`categorical`||l)&&e.value.property===void 0&&u.push(new Y(e.key,e.value,`"property" property is required`)),u;function d(e){if(n===`identity`)return[new Y(e.key,e.value,`identity function may not have a "stops" property`)];let t=[],r=e.value;return t=t.concat(aU({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:f})),wH(r)===`array`&&r.length===0&&t.push(new Y(e.key,r,`array must have at least one stop`)),t}function f(e){let n=[],r=e.value,s=e.key;if(wH(r)!==`array`)return[new Y(s,r,`array expected, ${wH(r)} found`)];if(r.length!==2)return[new Y(s,r,`array length 2 expected, length ${r.length} found`)];if(l){if(wH(r[0])!==`object`)return[new Y(s,r,`object expected, ${wH(r[0])} found`)];if(r[0].zoom===void 0)return[new Y(s,r,`object stop key must have zoom`)];if(r[0].value===void 0)return[new Y(s,r,`object stop key must have value`)];if(o&&o>nU(r[0].zoom))return[new Y(s,r[0].zoom,`stop zoom values must appear in ascending order`)];nU(r[0].zoom)!==o&&(o=nU(r[0].zoom),a=void 0,i={}),n=n.concat(iU({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:oU,value:p}}))}else n=n.concat(p({key:`${s}[0]`,value:r[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},r));return MH(rU(r[1]))?n.concat([new Y(`${s}[1]`,r[1],`expressions are not allowed in function stops.`)]):n.concat(e.validateSpec({key:`${s}[1]`,value:r[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,o){let s=wH(e.value),c=nU(e.value),l=e.value===null?o:e.value;if(!r)r=s;else if(s!==r)return[new Y(e.key,l,`${s} stop domain type must match previous stop domain type ${r}`)];if(s!==`number`&&s!==`string`&&s!==`boolean`)return[new Y(e.key,l,`stop domain value must be a number, string, or boolean`)];if(s!==`number`&&n!==`categorical`){let r=`number expected, ${s} found`;return bH(t)&&n===void 0&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Y(e.key,l,r)]}return n===`categorical`&&s===`number`&&(!isFinite(c)||Math.floor(c)!==c)?[new Y(e.key,l,`integer expected, found ${c}`)]:n!==`categorical`&&s===`number`&&a!==void 0&&c<a?[new Y(e.key,l,`stop domain values must appear in ascending order`)]:(a=c,n===`categorical`&&c in i?[new Y(e.key,l,`stop domain values must be unique`)]:(i[c]=!0,[]))}function m(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}function cU(e){let t=(e.expressionContext===`property`?IH:NH)(rU(e.value),e.key,e.valueSpec);if(t.result===`error`)return t.value.map(t=>new Y(`${e.key}${t.key}`,e.value,t.message));let n=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext===`property`&&e.propertyKey===`text-font`&&!n.outputDefined())return[new Y(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext===`property`&&e.propertyType===`layout`&&!gH(n))return[new Y(e.key,e.value,`"feature-state" data expressions are not supported with layout properties.`)];if(e.expressionContext===`filter`&&!gH(n))return[new Y(e.key,e.value,`"feature-state" data expressions are not supported with filters.`)];if(e.expressionContext&&e.expressionContext.indexOf(`cluster`)===0){if(!_H(n,[`zoom`,`feature-state`]))return[new Y(e.key,e.value,`"zoom" and "feature-state" expressions are not supported with cluster properties.`)];if(e.expressionContext===`cluster-initial`&&!hH(n))return[new Y(e.key,e.value,`Feature data expressions are not supported with initial expression part of cluster properties.`)]}return[]}function OIe(e){let t=e.value,n=e.key,r=wH(t);return r===`boolean`?[]:[new Y(n,t,`boolean expected, ${r} found`)]}function lU(e){let t=e.key,n=e.value,r=wH(n);return r===`string`?UB.parse(String(n))?[]:[new Y(t,n,`color expected, "${n}" found`)]:[new Y(t,n,`color expected, ${r} found`)]}function uU(e){let t=e.key,n=e.value,r=e.valueSpec,i=[];return Array.isArray(r.values)?r.values.indexOf(nU(n))===-1&&i.push(new Y(t,n,`expected one of [${r.values.join(`, `)}], ${JSON.stringify(n)} found`)):Object.keys(r.values).indexOf(nU(n))===-1&&i.push(new Y(t,n,`expected one of [${Object.keys(r.values).join(`, `)}], ${JSON.stringify(n)} found`)),i}function kIe(e,t){let n=e;for(let e of t)n=n[e];return n}function AIe(e,t){let n=qH(t);return n?[new Y(`${e.key}${n.path.map(e=>`[${e}]`).join(``)}`,kIe(e.value,n.path),GH(n.legacyFilter),null,`warning`)]:[]}function dU(e){let t=rU(e.value);return UH(t)?[...AIe(e,t),...cU(CH({},e,{expressionContext:`filter`,valueSpec:{value:`boolean`}}))]:fU(e)}function fU(e){let t=e.value,n=e.key;if(wH(t)!==`array`)return[new Y(n,t,`array expected, ${wH(t)} found`)];let r=e.styleSpec,i,a=[];if(t.length<1)return[new Y(n,t,`filter array must have at least 1 element`)];
vendor: 6,831 bytes, line 409
409switch(a=a.concat(uU({key:`${n}[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),nU(t[0])){case`<`:case`<=`:case`>`:case`>=`:t.length>=2&&nU(t[1])===`$type`&&a.push(new Y(n,t,`"$type" cannot be use with operator "${t[0]}"`));case`==`:case`!=`:t.length!==3&&a.push(new Y(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case`in`:case`!in`:t.length>=2&&(i=wH(t[1]),i!==`string`&&a.push(new Y(`${n}[1]`,t[1],`string expected, ${i} found`)));for(let o=2;o<t.length;o++)i=wH(t[o]),nU(t[1])===`$type`?a=a.concat(uU({key:`${n}[${o}]`,value:t[o],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):i!==`string`&&i!==`number`&&i!==`boolean`&&a.push(new Y(`${n}[${o}]`,t[o],`string, number, or boolean expected, ${i} found`));break;case`any`:case`all`:case`none`:for(let r=1;r<t.length;r++)a=a.concat(fU({key:`${n}[${r}]`,value:t[r],style:e.style,styleSpec:e.styleSpec}));break;case`has`:case`!has`:i=wH(t[1]),t.length===2?i!==`string`&&a.push(new Y(`${n}[1]`,t[1],`string expected, ${i} found`)):a.push(new Y(n,t,`filter array for "${t[0]}" operator must have 2 elements`))}return a}function pU(e,t){let n=e.key,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,c=a[`${t}_${e.layerType}`];if(!c)return[];let l=s.match(/^(.*)-transition$/);if(t===`paint`&&l&&c[l[1]]&&c[l[1]].transition)return r({key:n,value:o,valueSpec:a.transition,style:i,styleSpec:a});let u=e.valueSpec||c[s];if(!u)return[new Y(n,o,`unknown property "${s}"`)];let d;if(wH(o)===`string`&&bH(u)&&!u.tokens&&(d=/^{([^}]+)}$/.exec(o)))return[new Y(n,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(d[1])} }\`.`)];let f=[];return e.layerType===`symbol`&&s===`text-font`&&TH(rU(o))&&nU(o.type)===`identity`&&f.push(new Y(n,o,`"text-font" does not support identity functions`)),f.concat(r({key:e.key,value:o,valueSpec:u,style:i,styleSpec:a,expressionContext:`property`,propertyType:t,propertyKey:s}))}function mU(e){return pU(e,`paint`)}function hU(e){return pU(e,`layout`)}function gU(e){let t=[],n=e.value,r=e.key,i=e.style,a=e.styleSpec;if(wH(n)!==`object`)return[new Y(r,n,`object expected, ${wH(n)} found`)];!n.type&&!n.ref&&t.push(new Y(r,n,`either "type" or "ref" is required`));let o=nU(n.type),s=nU(n.ref);if(n.id){let a=nU(n.id);for(let o=0;o<e.arrayIndex;o++){let e=i.layers[o];nU(e.id)===a&&t.push(new Y(r,n.id,`duplicate layer id "${n.id}", previously used at line ${e.id.__line__}`))}}if(`ref`in n){[`type`,`source`,`source-layer`,`filter`,`layout`].forEach(e=>{e in n&&t.push(new Y(r,n[e],`"${e}" is prohibited for ref layers`))});let e;i.layers.forEach(t=>{nU(t.id)===s&&(e=t)}),e?e.ref?t.push(new Y(r,n.ref,`ref cannot reference another ref layer`)):o=nU(e.type):t.push(new Y(r,n.ref,`ref layer "${s}" not found`))}else if(o!==`background`)if(!n.source)t.push(new Y(r,n,`missing required property "source"`));else{let e=i.sources&&i.sources[n.source],a=e&&nU(e.type);e?a===`vector`&&o===`raster`?t.push(new Y(r,n.source,`layer "${n.id}" requires a raster source`)):a!==`raster-dem`&&o===`hillshade`||a!==`raster-dem`&&o===`color-relief`?t.push(new Y(r,n.source,`layer "${n.id}" requires a raster-dem source`)):a===`raster`&&o!==`raster`?t.push(new Y(r,n.source,`layer "${n.id}" requires a vector source`)):a===`vector`&&!n[`source-layer`]?t.push(new Y(r,n,`layer "${n.id}" must specify a "source-layer"`)):a===`raster-dem`&&o!==`hillshade`&&o!==`color-relief`?t.push(new Y(r,n.source,`raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.`)):o===`line`&&n.paint&&n.paint[`line-gradient`]&&(a!==`geojson`||!e.lineMetrics)&&t.push(new Y(r,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new Y(r,n.source,`source "${n.source}" not found`))}return o===`raster`&&n.paint?.resampling&&n.paint?.[`raster-resampling`]&&t.push(new Y(r,n.paint,`layer "${n.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),t=t.concat(iU({key:r,value:n,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${r}.type`,value:n.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:n,objectKey:`type`})},filter:dU,layout(e){return iU({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return hU(CH({layerType:o},e))}}})},paint(e){return iU({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return mU(CH({layerType:o},e))}}})}}})),t}function _U(e){let t=e.value,n=e.key,r=wH(t);return r===`string`?[]:[new Y(n,t,`string expected, ${r} found`)]}function jIe(e){let t=e.sourceName??``,n=e.value,r=e.styleSpec,i=r.source_raster_dem,a=e.style,o=[],s=wH(n);if(n===void 0)return o;if(s!==`object`)return o.push(new Y(`source_raster_dem`,n,`object expected, ${s} found`)),o;let c=nU(n.encoding)===`custom`,l=[`redFactor`,`greenFactor`,`blueFactor`,`baseShift`],u=e.value.encoding?`"${e.value.encoding}"`:`Default`;for(let s in n)!c&&l.includes(s)?o.push(new Y(s,n[s],`In "${t}": "${s}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):i[s]?o=o.concat(e.validateSpec({key:s,value:n[s],valueSpec:i[s],validateSpec:e.validateSpec,style:a,styleSpec:r})):o.push(new Y(s,n[s],`unknown property "${s}"`));return o}var vU={promoteId:MIe};function yU(e){let t=e.value,n=e.key,r=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new Y(n,t,`"type" is required`)];let o=nU(t.type),s;switch(o){case`vector`:case`raster`:return s=iU({key:n,value:t,valueSpec:r[`source_${o.replace(`-`,`_`)}`],style:e.style,styleSpec:r,objectElementValidators:vU,validateSpec:a}),s;case`raster-dem`:return s=jIe({sourceName:n,value:t,style:e.style,styleSpec:r,validateSpec:a}),s;case`geojson`:if(s=iU({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,validateSpec:a,objectElementValidators:vU}),t.cluster)for(let e in t.clusterProperties){let[r,i]=t.clusterProperties[e],o=typeof r==`string`?[r,[`accumulated`],[`get`,e]]:r;s.push(...cU({key:`${n}.${e}.map`,value:i,validateSpec:a,expressionContext:`cluster-map`})),s.push(...cU({key:`${n}.${e}.reduce`,value:o,validateSpec:a,expressionContext:`cluster-reduce`}))}return s;case`video`:return iU({key:n,value:t,valueSpec:r.source_video,style:i,validateSpec:a,styleSpec:r});case`image`:return iU({key:n,value:t,valueSpec:r.source_image,style:i,validateSpec:a,styleSpec:r});case`canvas`:return[new Y(n,null,`Please use runtime APIs to add canvas sources, rather than 
409including them in stylesheets.`,`source.canvas`)];default:return uU({key:`${n}.type`,value:t.type,valueSpec:{values:[`vector`,`raster`,`raster-dem`,`geojson`,`video`,`image`]},style:i,validateSpec:a,styleSpec:r})}}function MIe({key:e,value:t}){if(wH(t)===`string`)return _U({key:e,value:t});{let n=[];for(let r in t)n.push(..._U({key:`${e}.${r}`,value:t[r]}));return n}}function bU(e){let t=e.value,n=e.styleSpec,r=n.light,i=e.style,a=[],o=wH(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new Y(`light`,t,`object expected, ${o} found`)]),a;for(let o in t){let s=o.match(/^(.*)-transition$/);a=s&&r[s[1]]&&r[s[1]].transition?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:n.transition,validateSpec:e.validateSpec,style:i,styleSpec:n})):r[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n})):a.concat([new Y(o,t[o],`unknown property "${o}"`)])}return a}function xU(e){let t=e.value,n=e.styleSpec,r=n.sky,i=e.style,a=wH(t);if(t===void 0)return[];if(a!==`object`)return[new Y(`sky`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n})):o.concat([new Y(a,t[a],`unknown property "${a}"`)]);return o}function SU(e){let t=e.value,n=e.styleSpec,r=n.terrain,i=e.style,a=[],o=wH(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new Y(`terrain`,t,`object expected, ${o} found`)]),a;for(let o in t)a=r[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n})):a.concat([new Y(o,t[o],`unknown property "${o}"`)]);return a}function NIe(e){return _U(e).length===0?[]:cU(e)}function PIe(e){return _U(e).length===0?[]:cU(e)}function FIe(e){let t=e.key,n=e.value;if(wH(n)===`array`){if(n.length<1||n.length>4)return[new Y(t,n,`padding requires 1 to 4 values; ${n.length} values found`)];let r={type:`number`},i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}return oU({key:t,value:n,valueSpec:{}})}function IIe(e){let t=e.key,n=e.value;if(wH(n)===`array`){let r={type:`number`};if(n.length<1)return[new Y(t,n,`array length at least 1 expected, length 0 found`)];let i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}return oU({key:t,value:n,valueSpec:{}})}function LIe(e){let t=e.key,n=e.value;if(wH(n)===`array`){if(n.length<1)return[new Y(t,n,`array length at least 1 expected, length 0 found`)];let e=[];for(let r=0;r<n.length;r++)e=e.concat(lU({key:`${t}[${r}]`,value:n[r],valueSpec:{}}));return e}return lU({key:t,value:n,valueSpec:{}})}function RIe(e){let t=e.key,n=e.value,r=wH(n),i=e.styleSpec;if(r!==`array`||n.length<1||n.length%2!=0)return[new Y(t,n,`variableAnchorOffsetCollection requires a non-empty array of even length`)];let a=[];for(let r=0;r<n.length;r+=2)a=a.concat(uU({key:`${t}[${r}]`,value:n[r],valueSpec:i.layout_symbol[`text-anchor`]})),a=a.concat(aU({key:`${t}[${r+1}]`,value:n[r+1],valueSpec:{length:2,value:`number`},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a}function CU(e){let t=[],n=e.value,r=e.key;if(Array.isArray(n)){let i=[],a=[];for(let o in n)n[o].id&&i.includes(n[o].id)&&t.push(new Y(r,n,`all the sprites' ids must be unique, but ${n[o].id} is duplicated`)),i.push(n[o].id),n[o].url&&a.includes(n[o].url)&&t.push(new Y(r,n,`all the sprites' URLs must be unique, but ${n[o].url} is duplicated`)),a.push(n[o].url),t=t.concat(iU({key:`${r}[${o}]`,value:n[o],valueSpec:{id:{type:`string`,required:!0},url:{type:`string`,required:!0}},validateSpec:e.validateSpec}));return t}return _U({key:r,value:n})}function zIe(e){let t=e.value,n=e.styleSpec,r=n.projection,i=e.style,a=wH(t);if(t===void 0)return[];if(a!==`object`)return[new Y(`projection`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n})):o.concat([new Y(a,t[a],`unknown property "${a}"`)]);return o}function BIe(e){let t=e.key,n=e.value;n=n instanceof String?n.valueOf():n;let r=wH(n);return r===`array`&&!HIe(n)&&!VIe(n)?[new Y(t,n,`projection expected, invalid array ${JSON.stringify(n)} found`)]:[`array`,`string`].includes(r)?[]:[new Y(t,n,`projection expected, invalid type "${r}" found`)]}function VIe(e){return!![`interpolate`,`step`,`literal`].includes(e[0])}function HIe(e){return Array.isArray(e)&&e.length===3&&typeof e[0]==`string`&&typeof e[1]==`string`&&typeof e[2]==`number`}function wU(e){return!!e&&e.constructor===Object}function TU(e){return wU(e.value)?[]:[new Y(e.key,e.value,`object expected, ${wH(e.value)} found`)]}function UIe(e){let t=e.key,n=e.value,r=e.validateSpec,i=e.styleSpec,a=e.style;if(!wU(n))return[new Y(t,n,`object expected, ${wH(n)} found`)];let o=[];for(let e in n){let s=n[e],c=wH(s);if(c===`string`)o.push(..._U({key:`${t}.${e}`,value:s}));else if(c===`array`){let n={url:{type:`string`,required:!0}
vendor: 12,442 bytes, line 409
409,"unicode-range":{type:`array`,value:`string`}};for(let[c,l]of s.entries())o.push(...iU({key:`${t}.${e}[${c}]`,value:l,valueSpec:n,styleSpec:i,style:a,validateSpec:r}))}else o.push(new Y(`${t}.${e}`,s,`string or array expected, ${c} found`))}return o}var EU={"*"(){return[]},array:aU,boolean:OIe,number:oU,color:lU,constants:tU,enum:uU,filter:dU,function:sU,layer:gU,object:iU,source:yU,light:bU,sky:xU,terrain:SU,projection:zIe,projectionDefinition:BIe,string:_U,formatted:NIe,resolvedImage:PIe,padding:FIe,numberArray:IIe,colorArray:LIe,variableAnchorOffsetCollection:RIe,sprite:CU,state:TU,fontFaces:UIe};function DU(e){let t=e.value,n=e.valueSpec,r=e.styleSpec;return e.validateSpec=DU,n.expression&&TH(nU(t))?sU(e):n.expression&&MH(rU(t))?cU(e):n.type&&EU[n.type]?EU[n.type](e):iU(CH({},e,{valueSpec:n.type?r[n.type]:n}))}function OU(e){let t=e.value,n=e.key,r=_U(e);return r.length?r:(t.indexOf(`{fontstack}`)===-1&&r.push(new Y(n,t,`"glyphs" url must include a "{fontstack}" token`)),t.indexOf(`{range}`)===-1&&r.push(new Y(n,t,`"glyphs" url must include a "{range}" token`)),r)}function kU(e,t=J){let n=[];return n=n.concat(DU({key:``,value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:DU,objectElementValidators:{glyphs:OU,"*"(){return[]}}})),e.constants&&(n=n.concat(tU({key:`constants`,value:e.constants,style:e,styleSpec:t,validateSpec:DU}))),jU(n)}kU.source=MU(AU(yU)),kU.sprite=MU(AU(CU)),kU.glyphs=MU(AU(OU)),kU.light=MU(AU(bU)),kU.sky=MU(AU(xU)),kU.terrain=MU(AU(SU)),kU.state=MU(AU(TU)),kU.layer=MU(AU(gU)),kU.filter=MU(AU(dU)),kU.paintProperty=MU(AU(mU)),kU.layoutProperty=MU(AU(hU));function AU(e){return function(t){return e(Object.assign({},t,{validateSpec:DU}))}}function jU(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function MU(e){return function(...t){return jU(e.apply(this,t))}}var WIe={type:`enum`,"property-type":`data-constant`,expression:{interpolated:!1,parameters:[`global-state`]},values:{visible:{},none:{}},transition:!1,default:`visible`},GIe=class{constructor(e,t,n){this._rootKey=t,this._globalState=n,this.setValue(e)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(e){if(e==null||e===`visible`||e===`none`){this._literalValue=e===`none`?`none`:`visible`,this._compiledValue=void 0,this._globalStateRefs=new Set;return}let t=NH(e,this._rootKey,WIe,this._globalState);if(t.result===`error`)throw this._literalValue=`visible`,this._compiledValue=void 0,Error(t.value.map(e=>`${e.key}: ${e.message}`).join(`, `));this._literalValue=void 0,this._compiledValue=t.value,this._globalStateRefs=zH(t.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function KIe(e,t,n){return new GIe(e,t,n)}var NU=kU,PU=new Set(Object.keys(J).filter(e=>e.startsWith(`source_`)).map(e=>e.slice(7).replaceAll(`_`,`-`)));function qIe(e){return Object.entries(e.sources??{}).filter(([,e])=>!PU.has(e.type)).map(([e])=>`sources.${e}`)}function FU(e,t){let n=qIe(t);return IU(e,NU(t).filter(({message:e})=>!n.some(t=>e.startsWith(`${t}:`)||e.startsWith(`${t}.`))))}function IU(e,t){let n=!1;for(let r of t){if(r.severity===`warning`){_z(r.message);continue}e.fire(new qz(Error(r.message))),n=!0}return n}function LU(e,t,n,r){return r?.validate!==!1&&IU(e,t({styleSpec:J,...n}))}var RU=class e{constructor(e,t,n){let r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let i=new Int32Array(this.arrayBuffer);e=i[0],t=i[1],n=i[2],this.d=t+2*n;for(let e=0;e<this.d*this.d;e++){let t=i[3+e],n=i[3+e+1];r.push(t===n?null:i.subarray(t,n))}let a=i[3+r.length],o=i[3+r.length+1];this.keys=i.subarray(a,o),this.bboxes=i.subarray(o),this.insert=this._insertReadonly}else{this.d=t+2*n;for(let e=0;e<this.d*this.d;e++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=n,this.scale=t/e,this.uid=0;let i=n/t*e;this.min=-i,this.max=e+i}insert(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}_insertReadonly(){throw Error(`Cannot insert into a GridIndex created from an ArrayBuffer.`)}_insertCell(e,t,n,r,i,a){this.cells[i].push(a)}query(e,t,n,r,i){let a=this.min,o=this.max;if(e<=a&&t<=a&&o<=n&&o<=r&&!i)return[...this.keys];{let a=[];return this._forEachCell(e,t,n,r,this._queryCell,a,{},i),a}}_queryCell(e,t,n,r,i,a,o,s){let c=this.cells[i];if(c!==null){let i=this.keys,l=this.bboxes;for(let u of c)if(o[u]===void 0){let c=u*4;(s?s(l[c+0],l[c+1],l[c+2],l[c+3]):e<=l[c+2]&&t<=l[c+3]&&n>=l[c+0]&&r>=l[c+1])?(o[u]=!0,a.push(i[u])):o[u]=!1}}}_forEachCell(e,t,n,r,i,a,o,s){let c=this._convertToCellCoord(e),l=this._convertToCellCoord(t),u=this._convertToCellCoord(n),d=this._convertToCellCoord(r);for(let f=c;f<=u;f++)for(let c=l;c<=d;c++){let l=this.d*c+f;if(!(s&&!s(this._convertFromCellCoord(f),this._convertFromCellCoord(c),this._convertFromCellCoord(f+1),this._convertFromCellCoord(c+1)))&&i.call(this,e,t,n,r,l,a,o,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,n=0;for(let e of this.cells)n+=e.length;let r=new Int32Array(t+n+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let i=t;for(let t=0;t<e.length;t++){let n=e[t];r[3+t]=i,r.set(n,i),i+=n.length}return r[3+e.length]=i,r.set(this.keys,i),i+=this.keys.length,r[3+e.length+1]=i,r.set(this.bboxes,i),i+=this.bboxes.length,r.buffer}static serialize(e,t){let n=e.toArrayBuffer();return t&&t.push(n),{buffer:n}}static deserialize(t){return new e(t.buffer)}},zU={};function BU(e,t,n={}){if(zU[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),zU[e]={klass:t,omit:n.omit||[],shallow:n.shallow||[]}}BU(`Object`,Object),BU(`Set`,Set),BU(`TransferableGridIndex`,RU),BU(`Color`,UB),BU(`Error`,Error),BU(`AJAXError`,zz),BU(`ResolvedImage`,QB),BU(`StylePropertyFunction`,LH),BU(`StyleExpression`,kH,{omit:[`_evaluator`]}),BU(`ZoomDependentExpression`,FH),BU(`ZoomConstantExpression`,PH),BU(`CompoundExpression`,lH,{omit:[`_evaluate`]});for(let e in cH)cH[e]._classRegistryKey||BU(`Expression_${e}`,cH[e]);function VU(e){return e&&typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||e.constructor?.name===`ArrayBuffer`)}function HU(e){let t=e.constructor;return e.$name||t._classRegistryKey}function JIe(e){if(typeof e!=`object`||!e)return!1;let t=HU(e);return t&&t!==`Object`}function UU(e){return!JIe(e)&&(e==null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||VU(e)||xz(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function WU(e,t){if(UU(e))return(VU(e)||xz(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let n=[];for(let r of e)n.push(WU(r,t));return n}if(typeof e!=`object`)throw Error(`can't serialize object of type ${typeof e}`);let n=HU(e);if(!n)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!zU[n])throw Error(`${n} is not registered.`);let{klass:r}=zU[n],i=r.serialize?r.serialize(e,t):{};if(!r.serialize){for(let r in e){if(!e.hasOwnProperty(r)||zU[n].omit.includes(r))continue;let a=e[r];a!==void 0&&(i[r]=zU[n].shallow.includes(r)?a:WU(a,t))}e instanceof Error&&(i.message=e.message)}else if(i===t?.[t.length-1])throw Error(`statically serialized object won't survive transfer of $name property`);if(i.$name)throw Error(`$name property is reserved for worker serialization logic.`);return n!==`Object`&&(i.$name=n),i}function GU(e){if(UU(e))return e;if(Array.isArray(e))return e.map(GU);if(typeof e!=`object`)throw Error(`can't deserialize object of type ${typeof e}`);let t=HU(e)||`Object`;if(!zU[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:n}=zU[t];if(!n)throw Error(`can't deserialize unregistered class ${t}`);if(n.deserialize)return n.deserialize(e);let r=Object.create(n.prototype);for(let n of Object.keys(e)){if(n===`$name`)continue;let i=e[n];r[n]=zU[t].shallow.includes(n)?i:GU(i)}return r}var KU=class{constructor(){this.first=!0}update(e,t){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=n,!0))}};function YIe(e){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function XIe(e){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function ZIe(e){return/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(e))}function QIe(e){for(let t of e)if(XIe(t.codePointAt(0)))return!0;return!1}function qU(e){let t=e.map(e=>{try{return RegExp(`\\p{sc=${e}}`,`u`).source}catch{return null}}).filter(e=>e);return new RegExp(t.join(`|`),`u`)}qU([`Arab`,`Dupl`,`Mong`,`Ougr`,`Syrc`]);var $Ie=qU(`Adlm.Arab.Armi.Avst.Chrs.Cprt.Egyp.Elym.Gara.Hatr.Hebr.Hung.Khar.Lydi.Mand.Mani.Mend.Merc.Mero.Narb.Nbat.Nkoo.Orkh.Palm.Phli.Phlp.Phnx.Prti.Rohg.Samr.Sarb.Sogo.Syrc.Thaa.Todr.Yezi`.split(`.`));function JU(e){return $Ie.test(String.fromCodePoint(e))}function eLe(e,t){return!t&&JU(e)?!1:!ZIe(e)}function tLe(e){for(let t of e)if(JU(t.codePointAt(0)))return!0;return!1}function nLe(e,t){for(let n of e)if(!eLe(n.codePointAt(0),t))return!1;return!0}var YU=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=`unavailable`,this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(YU.isParsed())throw Error(`RTL text plugin already registered.`);this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}
vendor: 6,689 bytes, line 409
409async syncState(e,t){if(this.isParsed())return this.getState();if(e.pluginStatus!==`loading`)return this.setState(e),e;let n=e.pluginURL,r=new Promise(e=>{this.loadScriptResolve=e}),i=new Promise(e=>setTimeout(()=>e(),this.TIMEOUT));if(await t(n),await Promise.race([r,i]),this.isParsed()){let e={pluginStatus:`loaded`,pluginURL:n};return this.setState(e),e}throw this.setState({pluginStatus:`error`,pluginURL:``}),Error(`RTL Text Plugin failed to import scripts from ${n}`)}},XU=class{constructor(e,t){this.isSupportedScript=rLe,this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new KU,this.transition=t.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new KU,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*t}}};function rLe(e){return nLe(e,YU.getRTLTextPluginStatus()===`loaded`)}var ZU=`-transition`,QU=class{constructor(e,t,n,r){this.property=e,this.value=t,this.expression=yIe(t===void 0?e.specification.default:t,n,e.specification,r)}isDataDriven(){return this.expression.kind===`source`||this.expression.kind===`composite`}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}},$U=class{constructor(e,t,n){this.property=e,this.value=new QU(e,void 0,t,n)}transitioned(e,t){return new tW(this.property,this.value,t,oz({},e.transition,this.transition),e.now)}untransitioned(){return new tW(this.property,this.value,null,{},0)}},eW=class{constructor(e,t,n){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=n,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return hz(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new $U(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new QU(this._values[e].property,t===null?void 0:hz(t),this._propertyRootKey(e),this._globalState)}getTransition(e){return hz(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new $U(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=hz(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let n=this.getValue(t);n!==void 0&&(e[t]=n);let r=this.getTransition(t);r!==void 0&&(e[`${t}${ZU}`]=r)}return e}transitioned(e,t){let n=new nW(this._properties);for(let r of Object.keys(this._values))n._values[r]=this._values[r].transitioned(e,t._values[r]);return n}untransitioned(){let e=new nW(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}},tW=class{constructor(e,t,n,r,i){this.property=e,this.value=t,this.begin=i+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=n)}possiblyEvaluate(e,t,n){let r=e.now||0,i=this.value.possiblyEvaluate(e,t,n),a=this.prior;if(!a)return i;if(r>this.end||this.value.isDataDriven())return this.prior=null,i;if(r<this.begin)return a.possiblyEvaluate(e,t,n);{let o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,n),i,xPe(o))}}},nW=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,n){let r=new iW(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(e,t,n);return r}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},iLe=class{constructor(e,t,n){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=n,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasValue(e){return this._values[e].value!==void 0}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return hz(this._values[e].value)}setValue(e,t){this._values[e]=new QU(this._values[e].property,t===null?void 0:hz(t),this._propertyRootKey(e),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let n=this.getValue(t);n!==void 0&&(e[t]=n)}return e}possiblyEvaluate(e,t,n){let r=new iW(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(e,t,n);return r}},rW=class{constructor(e,t,n){this.property=e,this.value=t,this.parameters=n}isConstant(){return this.value.kind===`constant`}constantOr(e){return this.value.kind===`constant`?this.value.value:e}evaluate(e,t,n,r){return this.property.evaluate(this.value,this.parameters,e,t,n,r)}},iW=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};function aW(e){if(Array.isArray(e))return e.length;let t=e?.values;return Array.isArray(t)?t.length:void 0}function oW(e,t){let n=aW(e),r=aW(t);return n!==void 0&&r!==void 0&&n!==r}var sW=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error(`Value should not be data driven`);return e.expression.evaluate(t)}interpolate(e,t,n){if(oW(e,t))return _z(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let r=_V[this.specification.type];return r?r(e,t,n):e}},cW=class{constructor(e,t,n){this.specification=e,this.name=t,this.overrides=n}possiblyEvaluate(e,t,n,r){return e.expression.kind===`constant`||e.expression.kind===`camera`?new rW(this,{kind:`constant`,value:e.expression.evaluate(t,null,{},n,r)},t):new rW(this,e.expression,t)}interpolate(e,t,n){if(e.value.kind!==`constant`||t.value.kind!==`constant`)return e;if(e.value.value===void 0||t.value.value===void 0)return new rW(this,{kind:`constant`,value:void 0},e.parameters);if(oW(e.value.value,t.value.value))return _z(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let r=_V[this.specification.type];if(r){let i=r(e.value.value,t.value.value,n);return new rW(this,{kind:`constant`,value:i},e.parameters)}return e}evaluate(e,t,n,r,i,a){return e.kind===`constant`?e.value:e.evaluate(t,n,r,i,a)}},lW=class extends cW{possiblyEvaluate(e,t,n,r){if(e.value===void 0)return new rW(this,{kind:`constant`,value:void 0},t);
vendor: 4,468 bytes, line 409
409if(e.expression.kind===`constant`){let i=e.expression.evaluate(t,null,{},n,r),a=e.property.specification.type===`resolvedImage`&&typeof i!=`string`?i.name:i,o=this._calculate(a,a,a,t);return new rW(this,{kind:`constant`,value:o},t)}if(e.expression.kind===`camera`){let n=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new rW(this,{kind:`constant`,value:n},t)}return new rW(this,e.expression,t)}evaluate(e,t,n,r,i,a){if(e.kind===`source`){let o=e.evaluate(t,n,r,i,a);return this._calculate(o,o,o,t)}return e.kind===`composite`?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},n,r),e.evaluate({zoom:Math.floor(t.zoom)},n,r),e.evaluate({zoom:Math.floor(t.zoom)+1},n,r),t):e.value}_calculate(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}},uW=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,n,r){if(e.value!==void 0){if(e.expression.kind===`constant`){let i=e.expression.evaluate(t,null,{},n,r);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new XU(Math.floor(t.zoom-1),t)),e.expression.evaluate(new XU(Math.floor(t.zoom),t)),e.expression.evaluate(new XU(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}},dW=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,n,r){return!!e.expression.evaluate(t,null,{},n,r)}interpolate(){return!1}},fW=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let n=e[t];n.specification.overridable&&this.overridableProperties.push(t);let r=this.defaultPropertyValues[t]=new QU(n,void 0,n.name,void 0),i=this.defaultTransitionablePropertyValues[t]=new $U(n,n.name,void 0);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}}};BU(`DataDrivenProperty`,cW),BU(`DataConstantProperty`,sW),BU(`CrossFadedDataDrivenProperty`,lW),BU(`CrossFadedProperty`,uW),BU(`ColorRampProperty`,dW);var pW=` is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?`,mW=` is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?`,hW=class extends Jz{constructor(e,t,n){if(super(),this.id=e.id,this.type=e.type,this._globalState=n,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=KIe(this.visibility,`layers[${this.id}].layout.visibility`,n),e.type!==`custom`&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!==`background`&&(this.source=e.source,this.sourceLayer=e[`source-layer`],this.filter=e.filter,this._featureFilter=JH(e.filter,`layers[${this.id}].filter`,n)),t.layout&&(this._unevaluatedLayout=new iLe(t.layout,`layers[${this.id}].layout`,n)),t.paint)){this._transitionablePaint=new eW(t.paint,`layers[${this.id}].paint`,n);for(let t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new iW(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=JH(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){if(e===`visibility`)return this.visibility;if(this._transitionablePaint?.hasProperty(e))throw Error(e+pW);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let t of this._visibilityExpression.getGlobalStateRefs())e.add(t);if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values){let n=this._unevaluatedLayout._values[t];for(let t of n.getGlobalStateRefs())e.add(t)}for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){let e=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let n=this._transitionablePaint._values[t].value;for(let r of n.getGlobalStateRefs()){let i=e.get(r)??[];
vendor: 2,282 bytes, line 409
409i.push({name:t,value:n.value}),e.set(r,i)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,t,n={}){if(e===`visibility`){this.visibility=t,this._visibilityExpression.setValue(t),this.recalculateVisibility();return}if(this._transitionablePaint?.hasProperty(e)){this.fire(new qz(Error(e+pW)));return}t!=null&&this._validate(NU.layoutProperty,`layers.${this.id}.layout.${e}`,e,t,n)||this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){if(e.endsWith(`-transition`)){let t=e.slice(0,-11);if(t===`visibility`||this._unevaluatedLayout?.hasProperty(t))throw Error(e+mW);return this._transitionablePaint.getTransition(t)}if(e===`visibility`||this._unevaluatedLayout?.hasProperty(e))throw Error(e+mW);return this._transitionablePaint.getValue(e)}setPaintProperty(e,t,n={}){if(e===`visibility`||this._unevaluatedLayout?.hasProperty(e))return this.fire(new qz(Error(e+mW))),!1;if(t!=null&&this._validate(NU.paintProperty,`layers.${this.id}.paint.${e}`,e,t,n))return!1;if(e.endsWith(`-transition`))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let n=this._transitionablePaint._values[e],r=n.property.specification[`property-type`]===`cross-faded-data-driven`,i=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let o=this._transitionablePaint._values[e].value;return o.isDataDriven()||i||r||this._handleOverridablePaintPropertyUpdate(e,a,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,n){return!1}isHidden(e=this.minzoom,t=!1){return this.minzoom&&e<(t?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&e>=this.maxzoom?!0:this._evaluatedVisibility===`none`}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}
vendor: 20,548 bytes, line 409
409serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(e.layout||={},e.layout.visibility=this.visibility),pz(e,(e,t)=>e!==void 0&&!(t===`layout`&&!Object.keys(e).length)&&!(t===`paint`&&!Object.keys(e).length))}_validate(e,t,n,r,i={}){return LU(this,e,{key:t,layerType:this.type,objectKey:n,value:r},i)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(!(!(t instanceof rW)||!bH(t.property.specification))&&(t.value.kind===`source`||t.value.kind===`composite`)&&t.value.isStateDependent)return!0}return!1}},aLe,oLe=()=>aLe||=new fW({"raster-opacity":new sW(J.paint_raster[`raster-opacity`],`raster-opacity`),"raster-hue-rotate":new sW(J.paint_raster[`raster-hue-rotate`],`raster-hue-rotate`),"raster-brightness-min":new sW(J.paint_raster[`raster-brightness-min`],`raster-brightness-min`),"raster-brightness-max":new sW(J.paint_raster[`raster-brightness-max`],`raster-brightness-max`),"raster-saturation":new sW(J.paint_raster[`raster-saturation`],`raster-saturation`),"raster-contrast":new sW(J.paint_raster[`raster-contrast`],`raster-contrast`),resampling:new sW(J.paint_raster.resampling,`resampling`),"raster-resampling":new sW(J.paint_raster[`raster-resampling`],`raster-resampling`),"raster-fade-duration":new sW(J.paint_raster[`raster-fade-duration`],`raster-fade-duration`)}),sLe={get paint(){return oLe()}},gW=e=>e.type===`raster`,cLe=class extends hW{constructor(e,t){super(e,sLe,t)}},lLe={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},_W=class{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},vW=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error(`_refreshViews() must be implemented by each concrete StructArray layout`)}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function yW(e,t=1){let n=0,r=0;return{members:e.map(e=>{let i=uLe(e.type),a=n=bW(n,Math.max(t,i)),o=e.components||1;return r=Math.max(r,i),n+=i*o,{name:e.name,type:e.type,components:o,offset:a}}),size:bW(n,Math.max(r,t)),alignment:t}}function uLe(e){return lLe[e].BYTES_PER_ELEMENT}function bW(e,t){return Math.ceil(e/t)*t}var xW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=e*2;return this.int16[r+0]=t,this.int16[r+1]=n,e}};xW.prototype.bytesPerElement=4,BU(`StructArrayLayout2i4`,xW);var SW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=e*3;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e}};SW.prototype.bytesPerElement=6,BU(`StructArrayLayout3i6`,SW);var CW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){let a=e*4;return this.int16[a+0]=t,this.int16[a+1]=n,this.int16[a+2]=r,this.int16[a+3]=i,e}};CW.prototype.bytesPerElement=8,BU(`StructArrayLayout4i8`,CW);var wW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=e*6;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}};wW.prototype.bytesPerElement=12,BU(`StructArrayLayout2i4i12`,wW);var TW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=e*4,c=e*8;return this.int16[s+0]=t,this.int16[s+1]=n,this.uint8[c+4]=r,this.uint8[c+5]=i,this.uint8[c+6]=a,this.uint8[c+7]=o,e}};TW.prototype.bytesPerElement=8,BU(`StructArrayLayout2i4ub8`,TW);var EW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=e*2;return this.float32[r+0]=t,this.float32[r+1]=n,e}};EW.prototype.bytesPerElement=8,BU(`StructArrayLayout2f8`,EW);var DW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s,c,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,n,r,i,a,o,s,c,l)}emplace(e,t,n,r,i,a,o,s,c,l,u){let d=e*10;return this.uint16[d+0]=t,this.uint16[d+1]=n,this.uint16[d+2]=r,this.uint16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=c,this.uint16[d+8]=l,this.uint16[d+9]=u,e}};DW.prototype.bytesPerElement=20,BU(`StructArrayLayout10ui20`,DW);var OW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s){let c=this.length;return this.resize(c+1),this.emplace(c,e,t,n,r,i,a,o,s)}emplace(e,t,n,r,i,a,o,s,c){let l=e*8;return this.uint16[l+0]=t,this.uint16[l+1]=n,this.uint16[l+2]=r,this.uint16[l+3]=i,this.uint16[l+4]=a,this.uint16[l+5]=o,this.uint16[l+6]=s,this.uint16[l+7]=c,e}};OW.prototype.bytesPerElement=16,BU(`StructArrayLayout8ui16`,OW);var kW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=this.length;return this.resize(p+1),this.emplace(p,e,t,n,r,i,a,o,s,c,l,u,d,f)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=e*14,h=e*7;return this.int16[m+0]=t,this.int16[m+1]=n,this.int16[m+2]=r,this.int16[m+3]=i,this.uint16[m+4]=a,this.uint16[m+5]=o,this.uint16[m+6]=s,this.uint16[m+7]=c,this.int16[m+8]=l,this.int16[m+9]=u,this.int16[m+10]=d,this.int16[m+11]=f,this.float32[h+6]=p,e}};kW.prototype.bytesPerElement=28,BU(`StructArrayLayout4i4ui4i1f28`,kW);var AW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=e*3;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e}};AW.prototype.bytesPerElement=12,BU(`StructArrayLayout3f12`,AW);var jW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let n=e*1;return this.uint32[n+0]=t,e}};jW.prototype.bytesPerElement=4,BU(`StructArrayLayout1ul4`,jW);var MW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s,c){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,n,r,i,a,o,s,c)}emplace(e,t,n,r,i,a,o,s,c,l){let u=e*10,d=e*5;return this.int16[u+0]=t,this.int16[u+1]=n,this.int16[u+2]=r,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[d+3]=s,this.uint16[u+8]=c,this.uint16[u+9]=l,e}};MW.prototype.bytesPerElement=20,BU(`StructArrayLayout6i1ul2ui20`,MW);var NW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=e*6;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}};NW.prototype.bytesPerElement=12,BU(`StructArrayLayout2i2i2i12`,NW);var PW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i)}emplace(e,t,n,r,i,a){let o=e*4,s=e*8;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.int16[s+6]=i,this.int16[s+7]=a,e}};PW.prototype.bytesPerElement=16,BU(`StructArrayLayout2f1f2i16`,PW);var FW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=e*16,c=e*4,l=e*8;return this.uint8[s+0]=t,this.uint8[s+1]=n,this.float32[c+1]=r,this.float32[c+2]=i,this.int16[l+6]=a,this.int16[l+7]=o,e}};FW.prototype.bytesPerElement=16,BU(`StructArrayLayout2ub2f2i16`,FW);var IW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=e*3;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e}};IW.prototype.bytesPerElement=6,BU(`StructArrayLayout3ui6`,IW);var LW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=this.length;return this.resize(v+1),this.emplace(v,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=e*26,b=e*13,x=e*52;return this.int16[y+0]=t,this.int16[y+1]=n,this.uint16[y+2]=r,this.uint16[y+3]=i,this.uint32[b+2]=a,this.uint32[b+3]=o,this.uint32[b+4]=s,this.uint16[y+10]=c,this.uint16[y+11]=l,this.uint16[y+12]=u,this.float32[b+7]=d,this.float32[b+8]=f,this.uint8[x+36]=p,this.uint8[x+37]=m,this.uint8[x+38]=h,this.uint32[b+10]=g,this.int16[y+22]=_,this.float32[b+12]=v,e}};LW.prototype.bytesPerElement=52,BU(`StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52`,LW);var RW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O){let k=this.length;return this.resize(k+1),this.emplace(k,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k){let A=e*34,j=e*17;return this.int16[A+0]=t,this.int16[A+1]=n,this.int16[A+2]=r,this.int16[A+3]=i,this.int16[A+4]=a,this.int16[A+5]=o,this.int16[A+6]=s,this.int16[A+7]=c,this.uint16[A+8]=l,this.uint16[A+9]=u,this.uint16[A+10]=d,this.uint16[A+11]=f,this.uint16[A+12]=p,this.uint16[A+13]=m,this.uint16[A+14]=h,this.uint16[A+15]=g,this.uint16[A+16]=_,this.uint16[A+17]=v,this.uint16[A+18]=y,this.uint16[A+19]=b,this.uint16[A+20]=x,this.uint16[A+21]=S,this.uint16[A+22]=C,this.uint32[j+12]=w,this.float32[j+13]=T,this.float32[j+14]=E,this.uint16[A+30]=D,this.uint16[A+31]=O,this.float32[j+16]=k,e}};RW.prototype.bytesPerElement=68,BU(`StructArrayLayout8i15ui1ul2f2ui1f68`,RW);var zW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let n=e*1;return this.float32[n+0]=t,e}};zW.prototype.bytesPerElement=4,BU(`StructArrayLayout1f4`,zW);var BW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=e*6,a=e*3;return this.uint16[i+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,e}};BW.prototype.bytesPerElement=12,BU(`StructArrayLayout1ui2f12`,BW);var VW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=e*2,a=e*4;return this.uint32[i+0]=t,this.uint16[a+2]=n,this.uint16[a+3]=r,e}};VW.prototype.bytesPerElement=8,BU(`StructArrayLayout1ul2ui8`,VW);var HW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=e*2;return this.uint16[r+0]=t,this.uint16[r+1]=n,e}};HW.prototype.bytesPerElement=4,BU(`StructArrayLayout2ui4`,HW);var UW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let n=e*1;return this.uint16[n+0]=t,e}};UW.prototype.bytesPerElement=2,BU(`StructArrayLayout1ui2`,UW);var WW=class extends vW{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){let a=e*4;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,e}};WW.prototype.bytesPerElement=16,BU(`StructArrayLayout4f16`,WW);var GW=class extends _W{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new K(this.anchorPointX,this.anchorPointY)}};GW.prototype.size=20;var KW=class extends MW{get(e){return new GW(this,e)}};BU(`CollisionBoxArray`,KW);var qW=class extends _W{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};qW.prototype.size=52;var JW=class extends LW{get(e){return new qW(this,e)}};BU(`PlacedSymbolArray`,JW);var YW=class extends _W{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};YW.prototype.size=68;var XW=class extends RW{get(e){return new YW(this,e)}};BU(`SymbolInstanceArray`,XW);var ZW=class extends zW{getoffsetX(e){return this.float32[e*1+0]}};BU(`GlyphOffsetArray`,ZW);var QW=class extends SW{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};BU(`SymbolLineVertexArray`,QW);var $W=class extends _W{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};$W.prototype.size=12;var eG=class extends BW{get(e){return new $W(this,e)}};BU(`TextAnchorOffsetArray`,eG);var tG=class extends _W{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};tG.prototype.size=8;var nG=class extends VW{get(e){return new tG(this,e)}};BU(`FeatureIndexArray`,nG);var rG=class extends xW{},dLe=class extends SW{},fLe=class extends CW{},pLe=class extends xW{},mLe=class extends xW{},hLe=class extends wW{},gLe=class extends TW{}
vendor: 4,112 bytes, line 409
409,_Le=class extends EW{},iG=class extends DW{},aG=class extends OW{},vLe=class extends kW{},yLe=class extends AW{},bLe=class extends jW{},oG=class extends NW{},xLe=class extends PW{},SLe=class extends FW{},CLe=class extends IW{},sG=class extends IW{},cG=class extends HW{},wLe=class extends UW{},lG=yW([{name:`a_pos`,components:2,type:`Int16`}],4),TLe=lG.members;lG.size,lG.alignment;var uG=class e{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(t,n,r,i){let a=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&_z(`Max vertices per segment is ${e.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${e.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==i?this.createNewSegment(n,r,i):a}createNewSegment(e,t,n){let r={vertexOffset:e.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return n!==void 0&&(r.sortKey=n),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(r),r}getOrCreateLatestSegment(e,t,n){return this.prepareSegment(0,e,t,n)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(t,n,r,i){return new e([{vertexOffset:t,primitiveOffset:n,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])}};uG.MAX_VERTEX_ARRAY_LENGTH=2**16-1,BU(`SegmentVector`,uG);function dG(e,t){return e=iz(Math.floor(e),0,255),t=iz(Math.floor(t),0,255),256*e+t}var ELe=yW([{name:`a_pattern_from`,components:4,type:`Uint16`},{name:`a_pattern_to`,components:4,type:`Uint16`},{name:`a_pixel_ratio_from`,components:1,type:`Uint16`},{name:`a_pixel_ratio_to`,components:1,type:`Uint16`}]),DLe=yW([{name:`a_dasharray_from`,components:4,type:`Uint16`},{name:`a_dasharray_to`,components:4,type:`Uint16`}]),OLe=YL(((e,t)=>{function n(e,t){for(var n=e.length&3,r=e.length-n,i=t,a,o=3432918353,s=461845907,c,l=0;l<r;)c=e.charCodeAt(l)&255|(e.charCodeAt(++l)&255)<<8|(e.charCodeAt(++l)&255)<<16|(e.charCodeAt(++l)&255)<<24,++l,c=(c&65535)*o+(((c>>>16)*o&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*s+(((c>>>16)*s&65535)<<16)&4294967295,i^=c,i=i<<13|i>>>19,a=(i&65535)*5+(((i>>>16)*5&65535)<<16)&4294967295,i=(a&65535)+27492+(((a>>>16)+58964&65535)<<16);switch(c=0,n){case 3:c^=(e.charCodeAt(l+2)&255)<<16;case 2:c^=(e.charCodeAt(l+1)&255)<<8;case 1:c^=e.charCodeAt(l)&255,c=(c&65535)*o+(((c>>>16)*o&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*s+(((c>>>16)*s&65535)<<16)&4294967295,i^=c}return i^=e.length,i^=i>>>16,i=(i&65535)*2246822507+(((i>>>16)*2246822507&65535)<<16)&4294967295,i^=i>>>13,i=(i&65535)*3266489909+(((i>>>16)*3266489909&65535)<<16)&4294967295,i^=i>>>16,i>>>0}t!==void 0&&(t.exports=n)})),kLe=YL(((e,t)=>{function n(e,t){for(var n=e.length,r=t^n,i=0,a;n>=4;)a=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)^a,n-=4,++i;switch(n){case 3:r^=(e.charCodeAt(i+2)&255)<<16;case 2:r^=(e.charCodeAt(i+1)&255)<<8;case 1:r^=e.charCodeAt(i)&255,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)}return r^=r>>>13,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16),r^=r>>>15,r>>>0}t.exports=n})),ALe=WNe(YL(((e,t)=>{var n=OLe(),r=kLe();t.exports=n,t.exports.murmur3=n,t.exports.murmur2=r}))(),1),fG=class e{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,n,r){this.ids.push(pG(e)),this.positions.push(t,n,r)}getPositions(e){if(!this.indexed)throw Error(`Trying to get index, but feature positions are not indexed`);let t=pG(e),n=0,r=this.ids.length-1;for(;n<r;){let e=n+r>>1;this.ids[e]>=t?r=e:n=e+1}let i=[];for(;this.ids[n]===t;){let e=this.positions[3*n],t=this.positions[3*n+1],r=this.positions[3*n+2];i.push({index:e,start:t,end:r}),n++}return i}
vendor: 29,279 bytes, line 409
409static serialize(e,t){let n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return mG(n,r,0,n.length-1),t&&t.push(n.buffer,r.buffer),{ids:n,positions:r}}static deserialize(t){let n=new e;return n.ids=t.ids,n.positions=t.positions,n.indexed=!0,n}};function pG(e){let t=+e;return!isNaN(t)&&t<=2**53-1?t:(0,ALe.default)(String(e))}function mG(e,t,n,r){for(;n<r;){let i=e[n+r>>1],a=n-1,o=r+1;for(;;){do a++;while(e[a]<i);do o--;while(e[o]>i);if(a>=o)break;hG(e,a,o),hG(t,3*a,3*o),hG(t,3*a+1,3*o+1),hG(t,3*a+2,3*o+2)}o-n<r-o?(mG(e,t,n,o),n=o+1):(mG(e,t,o+1,r),r=o)}}function hG(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}BU(`FeaturePositionMap`,fG);var gG=class{constructor(e,t){this.gl=e.gl,this.location=t}},_G=class extends gG{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},Z=class extends gG{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},vG=class extends gG{constructor(e,t){super(e,t),this.current=[0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},yG=class extends gG{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},bG=class extends gG{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},xG=class extends gG{constructor(e,t){super(e,t),this.current=UB.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}},SG=class extends gG{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(e.length*4);for(let n=0;n<e.length;n++)t[4*n]=e[n].r,t[4*n+1]=e[n].g,t[4*n+2]=e[n].b,t[4*n+3]=e[n].a;this.gl.uniform4fv(this.location,t)}}},CG=class extends gG{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(e);this.gl.uniform1fv(this.location,t)}}},jLe=new Float32Array(16),wG=class extends gG{constructor(e,t){super(e,t),this.current=jLe}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);return}for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}};function TG(e){return[dG(255*e.r,255*e.g),dG(255*e.b,255*e.a)]}var EG=class{constructor(e,t,n){this.value=e,this.uniformNames=t.map(e=>`u_${e}`),this.type=n}setUniform(e,t,n){e.set(n.constantOr(this.value))}getBinding(e,t,n){return this.type===`color`?new xG(e,t):new Z(e,t)}},DG=class{constructor(e,t){this.uniformNames=t.map(e=>`u_${e}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}setUniform(e,t,n,r){let i=null;r===`u_pattern_to`?i=this.patternTo:r===`u_pattern_from`?i=this.patternFrom:r===`u_dasharray_to`?i=this.dashTo:r===`u_dasharray_from`?i=this.dashFrom:r===`u_pixel_ratio_to`?i=this.pixelRatioTo:r===`u_pixel_ratio_from`&&(i=this.pixelRatioFrom),i!==null&&e.set(i)}getBinding(e,t,n){return n.startsWith(`u_pattern`)||n.startsWith(`u_dasharray_`)?new bG(e,t):new Z(e,t)}},OG=class{constructor(e,t,n,r){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:`Float32`,components:n===`color`?2:1,offset:0})),this.paintVertexArray=new r}populatePaintArray(e,t,n){let r=this.paintVertexArray.length,i=this.expression.evaluate(new XU(0,n),t,{},n.canonical,[],n.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(r,e,i)}updatePaintArray(e,t,n,r,i){let a=this.expression.evaluate(new XU(0,i),n,r);this._setPaintValue(e,t,a)}_setPaintValue(e,t,n){if(this.type===`color`){let r=TG(n);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r[0],r[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},kG=class{constructor(e,t,n,r,i,a){this.expression=e,this.uniformNames=t.map(e=>`u_${e}_t`),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:`Float32`,components:n===`color`?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,t,n){let r=this.expression.evaluate(new XU(this.zoom,n),t,{},n.canonical,[],n.formattedSection),i=this.expression.evaluate(new XU(this.zoom+1,n),t,{},n.canonical,[],n.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(a,e,r,i)}updatePaintArray(e,t,n,r,i){let a=this.expression.evaluate(new XU(this.zoom,i),n,r),o=this.expression.evaluate(new XU(this.zoom+1,i),n,r);this._setPaintValue(e,t,a,o)}_setPaintValue(e,t,n,r){if(this.type===`color`){let i=TG(n),a=TG(r);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i[0],i[1],a[0],a[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,n,r);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(r))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let n=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,r=iz(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(r)}getBinding(e,t,n){return new Z(e,t)}},AG=class{constructor(e,t,n,r,i,a){this.expression=e,this.type=t,this.useIntegerZoom=n,this.zoom=r,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(e,t,n){let r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(r,e,this.getPositionIds(t),n)}updatePaintArray(e,t,n,r,i){this._setPaintValues(e,t,this.getPositionIds(n),i)}_setPaintValues(e,t,n,r){let i=this.getPositions(r);if(!i||!n)return;let a=i[n.min],o=i[n.mid],s=i[n.max];if(!(!a||!o||!s))for(let n=e;n<t;n++)this.emplace(this.zoomInPaintVertexArray,n,a,o),this.emplace(this.zoomOutPaintVertexArray,n,s,o)}upload(e){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let t=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,t,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,t,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},jG=class extends AG{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns?.[this.layerId]}getVertexAttributes(){return ELe.members}emplace(e,t,n,r){e.emplace(t,n.tlbr[0],n.tlbr[1],n.tlbr[2],n.tlbr[3],r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],n.pixelRatio,r.pixelRatio)}},MG=class extends AG{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes?.[this.layerId]}getVertexAttributes(){return DLe.members}emplace(e,t,n,r){e.emplace(t,0,n.y,n.height,n.width,0,r.y,r.height,r.width)}},NG=class{constructor(e,t,n){this.binders={},this._buffers=[];let r=[];for(let i in e.paint._values){if(!n(i))continue;let a=e.paint.get(i);if(!(a instanceof rW)||!bH(a.property.specification))continue;let o=MLe(i,e.type),s=a.value,c=a.property.specification.type,l=a.property.useIntegerZoom,u=a.property.specification[`property-type`],d=u===`cross-faded`||u===`cross-faded-data-driven`;if(s.kind===`constant`)this.binders[i]=d?new DG(s.value,o):new EG(s.value,o,c),r.push(`/u_${i}`);else if(s.kind===`source`||d){let n=FG(i,c,`source`);this.binders[i]=d?i===`line-dasharray`?new MG(s,c,l,t,n,e.id):new jG(s,c,l,t,n,e.id):new OG(s,o,c,n),r.push(`/a_${i}`)}else{let e=FG(i,c,`composite`);this.binders[i]=new kG(s,o,c,l,t,e),r.push(`/z_${i}`)}}this.cacheKey=r.sort().join(``)}getMaxValue(e){let t=this.binders[e];return t instanceof OG||t instanceof kG?t.maxValue:0}populatePaintArrays(e,t,n){for(let r in this.binders){let i=this.binders[r];(i instanceof OG||i instanceof kG||i instanceof AG)&&i.populatePaintArray(e,t,n)}}setConstantPatternPositions(e,t){for(let n in this.binders){let r=this.binders[n];r instanceof DG&&r.setConstantPatternPositions(e,t)}}setConstantDashPositions(e,t){for(let n in this.binders){let r=this.binders[n];r instanceof DG&&r.setConstantDashPositions(e,t)}}updatePaintArrays(e,t,n,r,i){let a=!1;for(let o of e){let e=t.getPositions(o.id);for(let t of e){let e=n.feature(t.index);for(let n in this.binders){let s=this.binders[n];(s instanceof OG||s instanceof kG||s instanceof AG)&&s.expression.isStateDependent===!0&&(s.expression=r.paint.get(n).value,s.updatePaintArray(t.start,t.end,e,o.state,i),a=!0)}}}return a}defines(){let e=[];for(let t in this.binders){let n=this.binders[t];(n instanceof EG||n instanceof DG)&&e.push(...n.uniformNames.map(e=>`#define HAS_UNIFORM_${e}`))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let n=this.binders[t];if(n instanceof OG||n instanceof kG)for(let t of n.paintVertexAttributes)e.push(t.name);else if(n instanceof AG){let t=n.getVertexAttributes();for(let n of t)e.push(n.name)}}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let n=this.binders[t];if(n instanceof EG||n instanceof DG||n instanceof kG)for(let t of n.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let n=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof EG||i instanceof DG||i instanceof kG){for(let a of i.uniformNames)if(t[a]){let o=i.getBinding(e,t[a],a);n.push({name:a,property:r,binding:o})}}}return n}setUniforms(e,t,n,r){for(let{name:e,property:i,binding:a}of t)this.binders[i].setUniform(a,r,n.get(i),e)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let n=this.binders[t];if(e&&n instanceof AG){let t=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(n instanceof OG||n instanceof kG)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let t in this.binders){let n=this.binders[t];(n instanceof OG||n instanceof kG||n instanceof AG)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof OG||t instanceof kG||t instanceof AG)&&t.destroy()}}},PG=class{constructor(e,t,n=()=>!0){this.programConfigurations={};for(let r of e)this.programConfigurations[r.id]=new NG(r,t,n);this.needsUpload=!1,this._featureMap=new fG,this._bufferOffset=0}populatePaintArrays(e,t,n,r){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(e,t,r);t.id!==void 0&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,n,r){for(let i of n)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,r)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function MLe(e,t){return{"text-opacity":[`opacity`],"icon-opacity":[`opacity`],"text-color":[`fill_color`],"icon-color":[`fill_color`],"text-halo-color":[`halo_color`],"icon-halo-color":[`halo_color`],"text-halo-blur":[`halo_blur`],"icon-halo-blur":[`halo_blur`],"text-halo-width":[`halo_width`],"icon-halo-width":[`halo_width`],"line-gap-width":[`gapwidth`],"line-dasharray":[`dasharray_to`,`dasharray_from`],"line-pattern":[`pattern_to`,`pattern_from`,`pixel_ratio_to`,`pixel_ratio_from`],"fill-pattern":[`pattern_to`,`pattern_from`,`pixel_ratio_to`,`pixel_ratio_from`],"fill-extrusion-pattern":[`pattern_to`,`pattern_from`,`pixel_ratio_to`,`pixel_ratio_from`]}[e]||[e.replace(`${t}-`,``).replace(/-/g,`_`)]}function NLe(e){return{"line-pattern":{source:iG,composite:iG},"fill-pattern":{source:iG,composite:iG},"fill-extrusion-pattern":{source:iG,composite:iG},"line-dasharray":{source:aG,composite:aG}}[e]}function FG(e,t,n){let r={color:{source:EW,composite:WW},number:{source:zW,composite:EW}};return NLe(e)?.[n]||r[t][n]}BU(`ConstantBinder`,EG),BU(`CrossFadedConstantBinder`,DG),BU(`SourceExpressionBinder`,OG),BU(`CrossFadedPatternBinder`,jG),BU(`CrossFadedDasharrayBinder`,MG),BU(`CompositeExpressionBinder`,kG),BU(`ProgramConfiguration`,NG,{omit:[`_buffers`]}),BU(`ProgramConfigurationSet`,PG);var IG=2**14-1,LG=-IG-1;function RG(e){let t=q/e.extent,n=e.loadGeometry();for(let e of n)for(let n of e){let e=Math.round(n.x*t),r=Math.round(n.y*t);n.x=iz(e,LG,IG),n.y=iz(r,LG,IG),(e<n.x||e>n.x+1||r<n.y||r>n.y+1)&&_z(`Geometry exceeds allowed extent, reduce your vector tile buffer size`)}return n}function zG(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?RG(e):[]}}var BG=-32768;function PLe(e,t,n,r,i){e.emplaceBack(BG+t*8+r,BG+n*8+i)}var VG=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new pLe,this.indexArray=new sG,this.segments=new uG,this.programConfigurations=new PG(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,n){let r=this.layers[0],i=[],a=null,o=!1,s=r.type===`heatmap`;if(r.type===`circle`){let e=r;a=e.layout.get(`circle-sort-key`),o=!a.isConstant(),s||=e.paint.get(`circle-pitch-alignment`)===`map`}let c=s?t.subdivisionGranularity.circle:1,l=new XU(this.zoom),u=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:r,index:s,sourceLayerIndex:c}of e){let e=zG(t,u);if(!this.layers[0]._featureFilter.filter(l,e,n))continue;let d=o?a.evaluate(e,{},n):void 0,f={id:r,properties:t.properties,type:t.type,sourceLayerIndex:c,index:s,geometry:u?e.geometry:RG(t),patterns:{},sortKey:d};i.push(f)}o&&i.sort((e,t)=>e.sortKey-t.sortKey);for(let r of i){let{geometry:i,index:a,sourceLayerIndex:o}=r,s=e[a].feature;this.addFeature(r,i,a,n,c),t.featureIndex.insert(s,i,a,o,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:n})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,TLe),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,n,r,i=1){let a;switch(i){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${i}; valid values are 1, 3, 5, 7.`)}let o=a.length;for(let n of t)for(let t of n){let n=t.x,r=t.y;if(n<0||n>=8192||r<0||r>=8192)continue;let i=this.segments.prepareSegment(o*o,this.layoutVertexArray,this.indexArray,e.sortKey),s=i.vertexLength;for(let e=0;e<o;e++)for(let t=0;t<o;t++)PLe(this.layoutVertexArray,n,r,a[t],a[e]);for(let e=0;e<o-1;e++)for(let t=0;t<o-1;t++){let n=s+e*o+t,r=s+(e+1)*o+t;this.indexArray.emplaceBack(n,r+1,n+1),this.indexArray.emplaceBack(n,r,r+1)}i.vertexLength+=o*o,i.primitiveLength+=(o-1)*(o-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:{},canonical:r})}};BU(`CircleBucket`,VG,{omit:[`layers`]});function HG(e,t){for(let n of e)if(JG(t,n))return!0;for(let n of t)if(JG(e,n))return!0;return GG(e,t)}function UG(e,t,n){return JG(e,t)?!0:KG(t,e,n)}function WG(e,t){if(e.length===1)return qG(t,e[0]);for(let n of t)for(let t of n)if(JG(e,t))return!0;for(let n of e)if(qG(t,n))return!0;for(let n of t)if(GG(e,n))return!0;return!1}function FLe(e,t,n){for(let r of t){if(e.length>=3){for(let t of r)if(JG(e,t))return!0}if(ILe(e,r,n))return!0}return!1}function ILe(e,t,n){if(e.length>1){if(GG(e,t))return!0;for(let r of t)if(KG(r,e,n))return!0}for(let r of e)if(KG(r,t,n))return!0;return!1}function GG(e,t){if(e.length===0||t.length===0)return!1;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1];for(let e=0;e<t.length-1;e++){let n=t[e],a=t[e+1];if(LLe(r,i,n,a))return!0}}return!1}function LLe(e,t,n,r){return vz(e,n,r)!==vz(t,n,r)&&vz(e,t,n)!==vz(e,t,r)}function KG(e,t,n){let r=n*n;if(t.length===1)return e.distSqr(t[0])<r;for(let n=1;n<t.length;n++){let i=t[n-1],a=t[n];if(RLe(e,i,a)<r)return!0}return!1}function RLe(e,t,n){let r=t.distSqr(n);if(r===0)return e.distSqr(t);let i=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/r;return i<0?e.distSqr(t):i>1?e.distSqr(n):e.distSqr(n.sub(t)._mult(i)._add(t))}function qG(e,t){let n=!1,r,i,a;for(let o of e){r=o;for(let e=0,o=r.length-1;e<r.length;o=e++)i=r[e],a=r[o],i.y>t.y!=a.y>t.y&&t.x<(a.x-i.x)*(t.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function JG(e,t){let n=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],o=e[i];a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(n=!n)}return n}function zLe(e,t,n,r,i){for(let a of e)if(t<=a.x&&n<=a.y&&r>=a.x&&i>=a.y)return!0;let a=[new K(t,n),new K(t,i),new K(r,i),new K(r,n)];if(e.length>2){for(let t of a)if(JG(e,t))return!0}for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(BLe(n,r,a))return!0}return!1}function BLe(e,t,n){let r=n[0],i=n[2];if(e.x<r.x&&t.x<r.x||e.x>i.x&&t.x>i.x||e.y<r.y&&t.y<r.y||e.y>i.y&&t.y>i.y)return!1;let a=vz(e,t,n[0]);return a!==vz(e,t,n[1])||a!==vz(e,t,n[2])||a!==vz(e,t,n[3])}function YG(e,t,n){let r=t.paint.get(e).value;return r.kind===`constant`?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function XG(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ZG(e,t,n,r,i){if(!t[0]&&!t[1])return e;let a=K.convert(t)._mult(i);n===`viewport`&&a._rotate(-r);let o=[];for(let t of e)o.push(t.sub(a));return o}function VLe(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=t.at(-1);(n===0||i&&!r.equals(i))&&t.push(r)}return t}function HLe(e,t){let n=[];for(let r of e){let e=VLe(r),i=[];for(let n=0;n<e.length;n++){let r=e[n],a=e[n-1],o=e[n+1],s=n===0?new K(0,0):r.sub(a)._unit()._perp(),c=n===e.length-1?new K(0,0):o.sub(r)._unit()._perp(),l=s._add(c)._unit(),u=l.x*c.x+l.y*c.y;u!==0&&l._mult(1/u),i.push(l._mult(t)._add(r))}n.push(i)}return n}function ULe({queryGeometry:e,size:t},n){return UG(e,n,t)}function WLe({queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i},a){return UG(e,a,t*(n.projectTileCoordinates(a.x,a.y,r,i?.(a.x,a.y)).signedDistanceFromCamera/n.cameraToCenterDistance))}function GLe({queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i},a){let o=n.projectTileCoordinates(a.x,a.y,r,i?.(a.x,a.y)).signedDistanceFromCamera,s=t*(n.cameraToCenterDistance/o);return UG(e,$G(a,n,r,i),s)}function KLe({queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i},a){return UG(e,$G(a,n,r,i),t)}function QG({queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i,pitchAlignment:a=`map`,pitchScale:o=`map`},s){let c=a===`map`?o===`map`?ULe:WLe:o===`map`?GLe:KLe,l={queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i};for(let e of s)for(let t of e)if(c(l,t))return!0;return!1}function $G(e,t,n,r){let i=t.projectTileCoordinates(e.x,e.y,n,r?.(e.x,e.y)).point;return new K((i.x*.5+.5)*t.width,(-i.y*.5+.5)*t.height)}function qLe(e,t,n,r){return e.map(e=>$G(e,t,n,r))}var JLe,YLe=()=>JLe||=new fW({"circle-sort-key":new cW(J.layout_circle[`circle-sort-key`],`circle-sort-key`)}),XLe,ZLe=()=>XLe||=new fW({"circle-radius":new cW(J.paint_circle[`circle-radius`],`circle-radius`),"circle-color":new cW(J.paint_circle[`circle-color`],`circle-color`),"circle-blur":new cW(J.paint_circle[`circle-blur`],`circle-blur`),"circle-opacity":new cW(J.paint_circle[`circle-opacity`],`circle-opacity`),"circle-translate":new sW(J.paint_circle[`circle-translate`],`circle-translate`),"circle-translate-anchor":new sW(J.paint_circle[`circle-translate-anchor`],`circle-translate-anchor`),"circle-pitch-scale":new sW(J.paint_circle[`circle-pitch-scale`],`circle-pitch-scale`),"circle-pitch-alignment":new sW(J.paint_circle[`circle-pitch-alignment`],`circle-pitch-alignment`),"circle-stroke-width":new cW(J.paint_circle[`circle-stroke-width`],`circle-stroke-width`),"circle-stroke-color":new cW(J.paint_circle[`circle-stroke-color`],`circle-stroke-color`),"circle-stroke-opacity":new cW(J.paint_circle[`circle-stroke-opacity`],`circle-stroke-opacity`)}),QLe={get paint(){return ZLe()},get layout(){return YLe()}},$Le=e=>e.type===`circle`,eRe=class extends hW{constructor(e,t){super(e,QLe,t)}createBucket(e){return new VG(e)}queryRadius(e){let t=e;return YG(`circle-radius`,this,t)+YG(`circle-stroke-width`,this,t)+XG(this.paint.get(`circle-translate`))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:r,transform:i,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){let c=ZG(e,this.paint.get(`circle-translate`),this.paint.get(`circle-translate-anchor`),-i.bearingInRadians,a),l=this.paint.get(`circle-radius`).evaluate(t,n)+this.paint.get(`circle-stroke-width`).evaluate(t,n),u=this.paint.get(`circle-pitch-scale`),d=this.paint.get(`circle-pitch-alignment`),f,p;return d===`map`?(f=c,p=l*a):(f=qLe(c,i,o,s),p=l),QG({queryGeometry:f,size:p,transform:i,unwrappedTileID:o,getElevation:s,pitchAlignment:d,pitchScale:u},r)}},eK=class extends VG{};BU(`HeatmapBucket`,eK,{omit:[`layers`]});var tRe,nRe=()=>tRe||=new fW({"heatmap-radius":new cW(J.paint_heatmap[`heatmap-radius`],`heatmap-radius`),"heatmap-weight":new cW(J.paint_heatmap[`heatmap-weight`],`heatmap-weight`),"heatmap-intensity":new sW(J.paint_heatmap[`heatmap-intensity`],`heatmap-intensity`),"heatmap-color":new dW(J.paint_heatmap[`heatmap-color`],`heatmap-color`),"heatmap-opacity":new sW(J.paint_heatmap[`heatmap-opacity`],`heatmap-opacity`)}),rRe={get paint(){return nRe()}};function tK(e,{width:t,height:n},r,i){if(!i)i=new Uint8Array(t*n*r);else if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*n*r)throw RangeError(`mismatched image size. expected: ${i.length} but got: ${t*n*r}`);return e.width=t,e.height=n,e.data=i,e}function nK(e,{width:t,height:n},r){if(t===e.width&&n===e.height)return;let i=tK({},{width:t,height:n},r);rK(e,i,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,n)},r),e.width=t,e.height=n,e.data=i.data}function rK(e,t,n,r,i,a){if(i.width===0||i.height===0)return t;if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw RangeError(`out of range source coordinates for image copy`);if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw RangeError(`out of range destination coordinates for image copy`);let o=e.data,s=t.data;if(o===s)throw Error(`srcData equals dstData, so image is already copied`);for(let c=0;c<i.height;c++){let l=((n.y+c)*e.width+n.x)*a,u=((r.y+c)*t.width+r.x)*a;for(let e=0;e<i.width*a;e++)s[u+e]=o[l+e]}return t}var iK=class e{constructor(e,t){tK(this,e,1,t)}resize(e){nK(this,e,1)}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,r,i){rK(e,t,n,r,i,1)}},aK=class e{constructor(e,t){tK(this,e,4,t)}resize(e){nK(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,r,i){rK(e,t,n,r,i,4)}setPixel(e,t,n){let r=(e*this.width+t)*4;this.data[r+0]=Math.round(n.r*255/n.a),this.data[r+1]=Math.round(n.g*255/n.a),this.data[r+2]=Math.round(n.b*255/n.a),this.data[r+3]=Math.round(n.a*255)}};function oK(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=4){let r=e[n+3];t[n+0]=Math.round(e[n+0]*r/255),t[n+1]=Math.round(e[n+1]*r/255),t[n+2]=Math.round(e[n+2]*r/255),t[n+3]=r}return t}BU(`AlphaImage`,iK),BU(`RGBAImage`,aK);function sK(e){let t={},n=e.resolution||256,r=e.clips?e.clips.length:1,i=e.image||new aK({width:n,height:r});if(!CPe(n))throw Error(`width is not a power of 2 - ${n}`);let a=(r,a,o)=>{t[e.evaluationKey]=o;let s=e.expression.evaluate(t);i.setPixel(r/4/n,a/4,s)};if(e.clips)for(let t=0,i=0;t<r;++t,i+=n*4)for(let r=0,o=0;r<n;r++,o+=4){let s=r/(n-1),{start:c,end:l}=e.clips[t],u=c*(1-s)+l*s;a(i,o,u)}else for(let e=0,t=0;e<n;e++,t+=4){let r=e/(n-1);a(0,t,r)}return i}var cK=`big-fb`,iRe=e=>e.type===`heatmap`,aRe=class extends hW{createBucket(e){return new eK(e)}constructor(e,t){super(e,rRe,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e===`heatmap-color`&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values[`heatmap-color`].value.expression;this.colorRamp=sK({expression:e,evaluationKey:`heatmapDensity`,image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(`big-fb`)&&this.heatmapFbos.delete(cK)}queryRadius(e){return YG(`heatmap-radius`,this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:r,transform:i,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){return QG({queryGeometry:e,size:this.paint.get(`heatmap-radius`).evaluate(t,n)*a,transform:i,unwrappedTileID:o,getElevation:s},r)}hasOffscreenPass(){return this.paint.get(`heatmap-opacity`)!==0&&!this.isHidden()}},oRe,sRe=()=>oRe||=new fW({"hillshade-illumination-direction":new sW(J.paint_hillshade[`hillshade-illumination-direction`],`hillshade-illumination-direction`),"hillshade-illumination-altitude":new sW(J.paint_hillshade[`hillshade-illumination-altitude`],`hillshade-illumination-altitude`),"hillshade-illumination-anchor":new sW(J.paint_hillshade[`hillshade-illumination-anchor`],`hillshade-illumination-anchor`),"hillshade-exaggeration":new sW(J.paint_hillshade[`hillshade-exaggeration`],`hillshade-exaggeration`),"hillshade-shadow-color":new sW(J.paint_hillshade[`hillshade-shadow-color`],`hillshade-shadow-color`),"hillshade-highlight-color":new sW(J.paint_hillshade[`hillshade-highlight-color`],`hillshade-highlight-color`),"hillshade-accent-color":new sW(J.paint_hillshade[`hillshade-accent-color`],`hillshade-accent-color`),"hillshade-method":new sW(J.paint_hillshade[`hillshade-method`],`hillshade-method`),resampling:new sW(J.paint_hillshade.resampling,`resampling`)}),cRe={get paint(){return sRe()}},lRe=e=>e.type===`hillshade`,uRe=class extends hW{constructor(e,t){super(e,cRe,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get(`hillshade-illumination-direction`).values,t=this.paint.get(`hillshade-illumination-altitude`).values,n=this.paint.get(`hillshade-highlight-color`).values,r=this.paint.get(`hillshade-shadow-color`).values,i=Math.max(e.length,t.length,n.length,r.length);e=e.concat(Array(i-e.length).fill(e.at(-1))),t=t.concat(Array(i-t.length).fill(t.at(-1))),n=n.concat(Array(i-n.length).fill(n.at(-1))),r=r.concat(Array(i-r.length).fill(r.at(-1)));let a=t.map(wz);return{directionRadians:e.map(wz),altitudeRadians:a,shadowColor:r,highlightColor:n}}hasOffscreenPass(){return this.paint.get(`hillshade-exaggeration`)!==0&&!this.isHidden()}},dRe,fRe=()=>dRe||=new fW({"color-relief-opacity":new sW(J[`paint_color-relief`][`color-relief-opacity`],`color-relief-opacity`),"color-relief-color":new dW(J[`paint_color-relief`][`color-relief-color`],`color-relief-color`),resampling:new sW(J[`paint_color-relief`].resampling,`resampling`)}),pRe={get paint(){return fRe()}};function lK(e){return`data`in e}var uK=class{constructor(e,t,n,r){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(t,r)}update(e,t,n){let{width:r,height:i}=e,a=(this.size?.[0]!==r||this.size[1]!==i)&&!n,{context:o}=this,{gl:s}=o;this.useMipmap=!!t?.useMipmap,a&&this.size&&this.format===s.RGBA&&(s.deleteTexture(this.texture),this.texture=s.createTexture(),this._ownedHandle=this.texture,this.filter=void 0,this.wrap=void 0),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1);let c=this.format===s.RGBA&&t?.premultiply!==!1;if(a)if(this.size=[r,i],this.format===s.RGBA&&r>0&&i>
4090){let t=this.useMipmap?Math.floor(Math.log2(Math.max(r,i)))+1:1;if(s.texStorage2D(s.TEXTURE_2D,t,s.RGBA8,r,i),lK(e)){o.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:t}=e;c&&t&&(t=oK(t)),t&&s.texSubImage2D(s.TEXTURE_2D,0,0,0,r,i,s.RGBA,s.UNSIGNED_BYTE,t)}else o.pixelStoreUnpackPremultiplyAlpha.set(c),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,e)}else lK(e)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,c,r,i,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(c),this._uploadDomImage(e,s));else{let{x:t,y:a}=n||{x:0,y:0};lK(e)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,c,t,a,r,i,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(c),this._updateDomImage(e,t,a,s))}this.useMipmap&&s.generateMipmap(s.TEXTURE_2D),o.pixelStoreUnpackFlipY.setDefault(),o.pixelStoreUnpack.setDefault(),o.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,t){t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,e)}_uploadRawData(e,t,n,r,i){let{data:a}=e;t&&a&&(a=oK(a)),i.texImage2D(i.TEXTURE_2D,0,this.format,n,r,0,this.format,i.UNSIGNED_BYTE,a)}_updateDomImage(e,t,n,r){r.texSubImage2D(r.TEXTURE_2D,0,t,n,r.RGBA,r.UNSIGNED_BYTE,e)}_updateRawData(e,t,n,r,i,a,o){let{data:s}=e;t&&s&&(s=oK(s)),o.texSubImage2D(o.TEXTURE_2D,0,n,r,i,a,o.RGBA,o.UNSIGNED_BYTE,s)}bind(e,t,n){let{context:r}=this,{gl:i}=r;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),i.bindTexture(i.TEXTURE_2D,this.texture),n===i.LINEAR_MIPMAP_NEAREST&&!this.useMipmap&&(n=i.LINEAR),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n||e),this.filter=e),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},mRe=class e{static{this.byteViewCache=new WeakMap}constructor(t,n,r,i=1,a=1,o=1,s=0){if(this.uid=t,n.height!==n.width)throw RangeError(`DEM tiles must be square`);if(r&&![`mapbox`,`terrarium`,`custom`].includes(r)){_z(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=n.height;let c=this.dim=n.height-2;switch(this.data=new Uint32Array(n.data.buffer),e.byteViewCache.set(this,new Uint8Array(this.data.buffer)),r){case`terrarium`:this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case`custom`:this.redFactor=i,this.greenFactor=a,this.blueFactor=o,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=0;e<c;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(c,e)]=this.data[this._idx(c-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,c)]=this.data[this._idx(e,c-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(c,-1)]=this.data[this._idx(c-1,0)],this.data[this._idx(-1,c)]=this.data[this._idx(0,c-1)],this.data[this._idx(c,c)]=this.data[this._idx(c-1,c-1)];let l=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let e=0;e<c;e++)for(let t=0;t<c;t++){let n=this._idx(e,t)*4,r=this._unpackAtIndex(l,n);r>this.max&&(this.max=r),r<this.min&&(this.min=r)}}get(e,t){let n=this._getByteView(),r=this._idx(e,t)*4;return this._unpackAtIndex(n,r)}sampleBilinear(e,t){let n=Math.floor(e),r=Math.floor(t);if(n<-1||n>=this.dim||r<-1||r>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);let i=this._getByteView(),a=((r+1)*this.stride+n+1)*4,o=this.stride*4,s=e-n,c=t-r,l=this._unpackAtIndex(i,a),u=this._unpackAtIndex(i,a+4),d=this._unpackAtIndex(i,a+o),f=this._unpackAtIndex(i,a+o+4);return l*(1-s)*(1-c)+u*s*(1-c)+d*(1-s)*c+f*s*c}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);return(t+1)*this.stride+(e+1)}unpack(e,t,n){return e*this.redFactor+t*this.greenFactor+n*this.blueFactor-this.baseShift}pack(e){return dK(e,this.getUnpackVector())}getPixels(){return new aK({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,t,n){if(this.dim!==e.dim)throw Error(`dem dimension mismatch`);let r=t*this.dim,i=t*this.dim+this.dim,a=n*this.dim,o=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:a=o-1;break;case 1:o=a+1}let s=-t*this.dim,c=-n*this.dim;for(let t=a;t<o;t++)for(let n=r;n<i;n++)this.data[this._idx(n,t)]=e.data[this._idx(n+s,t+c)]}_getByteView(){let t=e.byteViewCache.get(this);return t?.buffer!==this.data.buffer&&(t=new Uint8Array(this.data.buffer),e.byteViewCache.set(this,t)),t}_unpackAtIndex(e,t){return this.unpack(e[t],e[t+1],e[t+2])}};function dK(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=Math.min(n,r,i),s=Math.round((e+a)/o);return{r:Math.floor(s*o/n)%256,g:Math.floor(s*o/r)%256,b:Math.floor(s*o/i)%256}}BU(`DEMData`,mRe);var hRe=e=>e.type===`color-relief`,gRe=class extends hW{constructor(e,t){super(e,pRe,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},n=this._transitionablePaint._values[`color-relief-color`].value.expression;if(n instanceof PH&&n._styleExpression.expression instanceof hV){this.colorRampExpression=n;let e=n._styleExpression.expression;t.elevationStops=e.labels,t.colorStops=[];for(let n of t.elevationStops)t.colorStops.push(e.evaluate({globals:{elevation:n}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[UB.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let r={elevationStops:[],colorStops:[]},i=(t.elevationStops.length-1)/(e-1);for(let e=0;e<t.elevationStops.length-.5;e+=i)r.elevationStops.push(t.elevationStops[Math.round(e)]),r.colorStops.push(t.colorStops[Math.round(e)]);return _z(`Too many colors in specification of ${this.id}
409 color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${t.elevationStops.length}`),r}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values[`color-relief-color`].value.expression}getColorRampTextures(e,t,n){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let r=this._createColorRamp(t),i=new aK({width:r.colorStops.length,height:1}),a=new aK({width:r.colorStops.length,height:1});for(let e=0;e<r.elevationStops.length;e++){let t=dK(r.elevationStops[e],n);a.setPixel(0,e,new UB(t.r/255,t.g/255,t.b/255,1)),i.setPixel(0,e,r.colorStops[e])}return this.colorRampTextures={elevationTexture:new uK(e,a,e.gl.RGBA),colorTexture:new uK(e,i,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}},fK=yW([{name:`a_pos`,components:2,type:`Int16`}],4),_Re=fK.members;fK.size,fK.alignment;function pK(e,t,n){let r=n.patternDependencies,i=!1;for(let n of t){let t=n.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);let a=t.constantOr(null);a&&(i=!0,r[a.to]=!0,r[a.from]=!0)}return i}function mK(e,t,n,r,i){let{zoom:a}=r,o=i.patternDependencies;for(let r of t){let t=r.paint.get(`${e}-pattern`).value;if(t.kind!==`constant`){let e=t.evaluate({zoom:a-1},n,{},i.availableImages),s=t.evaluate({zoom:a},n,{},i.availableImages),c=t.evaluate({zoom:a+1},n,{},i.availableImages);e=e?.name?e.name:e,s=s?.name?s.name:s,c=c?.name?c.name:c,o[e]=!0,o[s]=!0,o[c]=!0,n.patterns[r.id]={min:e,mid:s,max:c}}}return n}var hK=new Set,gK=!1;function vRe(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length;hK.size&&hK.clear();let a=yRe(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;let s=0,c=0,l=0;
vendor: 4,131 bytes, line 409
409if(r&&(a=wRe(e,t,a,n)),e.length>80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;a<i;a+=n){let n=e[a],i=e[a+1];n<s&&(s=n),i<c&&(c=i),n>t&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return vK(a,o,s,c,l),o}function yRe(e,t,n,r,i){let a=null;if(i===URe(e,t,n,r)>0)for(let i=t;i<n;i+=r)a=HRe(i/r|0,e[i],e[i+1],a);else for(let i=n-r;i>=t;i-=r)a=HRe(i/r|0,e[i],e[i+1],a);return a&&NK(a,a.next)&&(IK(a),a=a.next),a}function _K(e,t=e){let n=t===e,r=e,i;do i=!1,r!==r.next&&(hK.size===0||!hK.has(r))&&(NK(r,r.next)||MK(r.prev,r,r.next)===0)?((n||r===t)&&(t=r.prev),gK=!0,IK(r),r=r.prev,i=!0):(n||r!==t)&&(r=r.next,i=!n);while(i||r!==t);return t}function vK(e,t,n,r,i){i&&PRe(e,n,r,i);let a=e,o=!1;for(;e.prev!==e.next;){let s=e.prev,c=e.next;if(MK(s,e,c)<0&&(i?xRe(e,n,r,i):bRe(e))){t.push(s.i,e.i,c.i),IK(e),e=c,a=c;continue}if(e=c,e===a){if(gK=!1,e=_K(e),gK){a=e;continue}if(!o){e=SRe(e,t),a=e,o=!0;continue}CRe(e,t,n,r,i);break}}}function bRe(e){let t=e.prev,n=e,r=e.next,i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&(i!==m.x||s!==m.y)&&jK(i,s,a,c,o,l,m.x,m.y)&&MK(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function xRe(e,t,n,r){let i=e.prev,a=e,o=e.next,s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=AK(p,m,t,n,r),v=AK(h,g,t,n,r),y=e.prevZ;for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==o&&(s!==y.x||u!==y.y)&&jK(s,u,c,d,l,f,y.x,y.y)&&MK(y.prev,y,y.next)>=0)return!1;y=y.prevZ}let b=e.nextZ;for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==o&&(s!==b.x||u!==b.y)&&jK(s,u,c,d,l,f,b.x,b.y)&&MK(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function SRe(e,t){let n=e,r=!1;do{let i=n.prev,a=n.next.next;RRe(i,n,n.next,a,!1)&&FK(i,a)&&FK(a,i)&&(t.push(i.i,n.i,a.i),IK(n),IK(n.next),n=e=a,r=!0),n=n.next}while(n!==e);return r?_K(n):n}function CRe(e,t,n,r,i){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&LRe(a,e)){let o=VRe(a,e);a=_K(a,a.next),o=_K(o,o.next),vK(a,t,n,r,i),vK(o,t,n,r,i);return}e=e.next}a=a.next}while(a!==e)}var yK=!1;function wRe(e,t,n,r){let i=[];for(let n=0,a=t.length;n<a;n++){let o=yRe(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1);o===o.next&&hK.add(o),i.push(IRe(o))}i.sort(TRe),DRe(e.length/r,t.length),ORe(n,n),yK=!0;for(let e=0;e<i.length;e++)n=ERe(i[e],n);return yK=!1,_K(n)}function TRe(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function ERe(e,t){let n=MRe(e,t);if(!n)return t;let r=VRe(n,e),i=r.next;return ORe(n,i.next),_K(r,r.next),_K(n,n.next)}var bK=new Float64Array,xK=0,SK=[],CK=[];function DRe(e,t){let n=Math.ceil((e+2*t)/16)+t+2;bK.length<n*4&&(bK=new Float64Array(n*4)),xK=0}function ORe(e,t){let n=e;do{let e=xK++;SK[e]=n;let r=1/0,i=1/0,a=-1/0,o=-1/0,s=0;do{let t=n.next;n.z=e,n.x<r&&(r=n.x),n.x>a&&(a=n.x),n.y<i&&(i=n.y),n.y>o&&(o=n.y),t.x<r&&(r=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>o&&(o=t.y),n=t}while(++s<16&&n!==t);CK[e]=n;let c=e*4;bK[c]=r,bK[c+1]=i,bK[c+2]=a,bK[c+3]=o}while(n!==t)}function kRe(e,t){let n=e.z*4;t.x<bK[n]&&(bK[n]=t.x),t.y<bK[n+1]&&(bK[n+1]=t.y),t.x>bK[n+2]&&(bK[n+2]=t.x),t.y>bK[n+3]&&(bK[n+3]=t.y)}function ARe(e){let t=CK[e];for(;t.prev.next!==t;)t=t.next;return CK[e]=t,t}function jRe(e){let t=SK[e];for(;t.prev.next!==t;)t=t.next;return SK[e]=t,t}function MRe(e,t){let n=t,r=e.x,i=e.y,a=-1/0,o;if(NK(e,n))return n;for(let t=0,s=0;t<xK;t++,s+=4){if(i<bK[s+1]||i>bK[s+3]||bK[s]>r||bK[s+2]<=a)continue;let c=ARe(t);n=jRe(t);do{if(n.prev.next===n){if(NK(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x<n.next.x?n:n.next,e===r))return o}}n=n.next}while(n!==c)}if(!o)return null;let s=o.x,c=o.y,l=Math.min(i,c),u=Math.max(i,c),d=1/0;for(let t=0,f=0;t<xK;t++,f+=4){if(bK[f+2]<s||bK[f]>r||bK[f+3]<l||bK[f+1]>u)continue;let p=ARe(t);n=jRe(t);do{if(n.prev.next===n&&r>=n.x&&n.x>=s&&r!==n.x&&jK(i<c?r:a,i,s,c,i<c?a:r,i,n.x,n.y)){let t=Math.abs(i-n.y)/(r-n.x);(FK(n,e)||n.y===i&&n.next.y===i&&n.next.x>r)&&(t<d||t===d&&(n.x>
vendor: 10,353 bytes, line 409
409o.x||n.x===o.x&&NRe(o,n)))&&(o=n,d=t)}n=n.next}while(n!==p)}return o}function NRe(e,t){return MK(e.prev,e,t.prev)<0&&MK(t.next,e,e.next)<0}var wK=[],TK=[],EK=new Uint32Array,DK=new Uint32Array,OK=new Uint32Array(256);function PRe(e,t,n,r){let i=e,a=0;do i.z=AK(i.x,i.y,t,n,r),wK[a++]=i,i=i.next;while(i!==e);FRe(a);let o=null;for(let e=0;e<a;e++){let t=wK[e];t.prevZ=o,o&&(o.nextZ=t),o=t}o.nextZ=null}function FRe(e){if(e<=32){for(let t=1;t<e;t++){let e=wK[t],n=e.z,r=t-1;for(;r>=0&&wK[r].z>n;)wK[r+1]=wK[r],r--;wK[r+1]=e}return}EK.length<e&&(EK=new Uint32Array(e),DK=new Uint32Array(e),TK=Array(e));for(let t=0;t<e;t++)EK[t]=wK[t].z;kK(e,wK,EK,TK,DK,0),kK(e,TK,DK,wK,EK,8),kK(e,wK,EK,TK,DK,16),kK(e,TK,DK,wK,EK,24)}function kK(e,t,n,r,i,a){OK.fill(0);for(let t=0;t<e;t++)OK[n[t]>>>a&255]++;let o=0;for(let e=0;e<256;e++){let t=OK[e];OK[e]=o,o+=t}for(let o=0;o<e;o++){let e=n[o],s=OK[e>>>a&255]++;r[s]=t[o],i[s]=e}}function AK(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function IRe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function jK(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function LRe(e,t){let n=NK(e,t)&&MK(e.prev,e,e.next)>0&&MK(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||FK(e,t)&&FK(t,e)&&(MK(e.prev,e,t.prev)!==0||MK(e,t.prev,t)!==0))&&!zRe(e,t)&&(n||BRe(e,t))}function MK(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function NK(e,t){return e.x===t.x&&e.y===t.y}function RRe(e,t,n,r,i=!0){let a=MK(e,t,n),o=MK(e,t,r),s=MK(n,r,e),c=MK(n,r,t);return(a>0&&o<0||a<0&&o>0)&&(s>0&&c<0||s<0&&c>0)?!0:i?!!(a===0&&PK(e,n,t)||o===0&&PK(e,r,t)||s===0&&PK(n,e,r)||c===0&&PK(n,t,r)):!1}function PK(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function zRe(e,t){let n=Math.min(e.x,t.x),r=Math.max(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.y,t.y),o=e;do{let s=o.next;if(o.x>r&&s.x>r||o.x<n&&s.x<n||o.y>a&&s.y>a||o.y<i&&s.y<i){o=s;continue}if(o.i!==e.i&&s.i!==e.i&&o.i!==t.i&&s.i!==t.i&&RRe(o,s,e,t))return!0;o=s}while(o!==e);return!1}function FK(e,t){return MK(e.prev,e,e.next)<0?MK(e,t,e.next)>=0&&MK(e,e.prev,t)>=0:MK(e,t,e.prev)<0||MK(e,e.next,t)<0}function BRe(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{let e=n.next;n.y>a!=e.y>a&&i<(e.x-n.x)*(a-n.y)/(e.y-n.y)+n.x&&(r=!r),n=e}while(n!==e);return r}function VRe(e,t){let n=LK(e.i,e.x,e.y),r=LK(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function HRe(e,t,n,r){let i=LK(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function IK(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),yK&&kRe(e.prev,e.next)}function LK(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function URe(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var RK=class{constructor(e,t){if(t>e)throw Error(`Min granularity must not be greater than base granularity.`);this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){let t=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/t),this._minGranularity,1)}},zK=class e{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}static{this.noSubdivision=new e({fill:new RK(0,0),line:new RK(0,0),tile:new RK(0,0),stencil:new RK(0,0),circle:1})}};BU(`SubdivisionGranularityExpression`,RK),BU(`SubdivisionGranularitySetting`,zK);var WRe=-32768,GRe=32767,KRe=class{constructor(e,t){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=q/e,this._canonical=t}_getKey(e,t){return e+=32768,t+=32768,e<<16|t<<0}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw Error(`Vertex coordinates are out of signed 16 bit integer range.`);let n=Math.round(e)|0,r=Math.round(t)|0,i=this._getKey(n,r);if(this._vertexDictionary.has(i))return this._vertexDictionary.get(i);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(i,a),this._vertexBuffer.push(n,r),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return YRe(this._vertexBuffer,e);let t=[],n=e.length;for(let r=0;r<n;r+=3){let n=[e[r+0],e[r+1],e[r+2]],i=[this._vertexBuffer[e[r+0]*2+0],this._vertexBuffer[e[r+0]*2+1],this._vertexBuffer[e[r+1]*2+0],this._vertexBuffer[e[r+1]*2+1],this._vertexBuffer[e[r+2]*2+0],this._vertexBuffer[e[r+2]*2+1]],a=1/0,o=1/0,s=-1/0,c=-1/0;for(let e=0;e<3;e++){let t=i[e*2],n=i[e*2+1];a=Math.min(a,t),s=Math.max(s,t),o=Math.min(o,n),c=Math.max(c,n)}if(a===s||o===c)continue;let l=Math.floor(a/this._granularityCellSize),u=Math.ceil(s/this._granularityCellSize),d=Math.floor(o/this._granularityCellSize),f=Math.ceil(c/this._granularityCellSize);if(l===u&&d===f){t.push(...n);continue}for(let e=d;e<f;e++){let r=this._scanlineGenerateVertexRingForCellRow(e,i,n);XRe(this._vertexBuffer,r,t)}}return t}_scanlineGenerateVertexRingForCellRow(e,t,n){let r=e*this._granularityCellSize,i=r+this._granularityCellSize,a=[];for(let e=0;e<3;e++){let o=t[e*2],s=t[e*2+1],c=t[(e+1)*2%6],l=t[((e+1)*2+1)%6],u=t[(e+2)*2%6],d=t[((e+2)*2+1)%6],f=c-o,p=l-s,m=f===0,h=p===0,g=(r-s)/p,_=(i-s)/p,v=Math.min(g,_),y=Math.max(g,_);if(!h&&(v>=1||y<=0)||h&&(s<r||s>i)){l>=r&&l<=i&&a.push(n[(e+1)%3]);continue}if(!h&&v>0){let e=o+f*v,t=s+p*v;a.push(this._vertexToIndex(e,t))}let b=o+f*Math.max(v,0),x=o+f*Math.min(y,1);if(m||this._generateIntraEdgeVertices(a,o,s,c,l,b,x),!h&&y<1){let e=o+f*y,t=s+p*y;a.push(this._vertexToIndex(e,t))}(h||l>=r&&l<=i)&&a.push(n[(e+1)%3]),!h&&(l<=r||l>=i)&&this._generateInterEdgeVertices(a,o,s,c,l,u,d,x,r,i)}return a}_generateIntraEdgeVertices(e,t,n,r,i,a,o){let s=r-t,c=i-n,l=c===0,u=l?Math.min(t,r):Math.min(a,o),d=l?Math.max(t,r):Math.max(a,o),f=Math.floor(u/this._granularityCellSize)+1,p=Math.ceil(d/this._granularityCellSize)-1;if(l?t<r:a<o)for(let r=f;r<=p;r++){let i=r*this._granularityCellSize,a=n+c*(i-t)/s;e.push(this._vertexToIndex(i,a))}else for(let r=p;r>=f;r--){let i=r*this._granularityCellSize,a=n+c*(i-t)/s;e.push(this._vertexToIndex(i,a))}}_generateInterEdgeVertices(e,t,n,r,i,a,o,s,c,l){let u=i-n,d=a-r,f=o-i,p=(c-i)/f,m=(l-i)/f,h=Math.min(p,m),g=Math.max(p,m),_=r+d*h,v=Math.floor(Math.min(_,s)/this._granularityCellSize)+1,y=Math.ceil(Math.max(_,s)/this._granularityCellSize)-1,b=s<_,x=f===0;if(x&&(o===c||o===l))return;if(x||h>=1||g<=0){let e=t-a,r=n-o,i=(c-o)/r,u=(l-o)/r,d=a+e*Math.min(i,u);v=Math.floor(Math.min(d,s)/this._granularityCellSize)+1,y=Math.ceil(Math.max(d,s)/this._granularityCellSize)-1,b=s<d}let S=u>0?l:c;if(b)for(let t=v;t<=y;t++){let n=t*this._granularityCellSize;e.push(this._vertexToIndex(n,S))}else for(let t=y;t>=v;t--){let n=t*this._granularityCellSize;e.push(this._vertexToIndex(n,S))}}_generateOutline(e){let t=[];for(let n of e){let e=BK(n,this._granularity,!0),r=this._pointArrayToIndices(e),i=[];for(let e=1;e<r.length;e++)i.push(r[e-1]),i.push(r[e]);t.push(i)}return t}_handlePoles(e){let t=!1,n=!1;this._canonical&&(this._canonical.y===0&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(n=!0)),(t||n)&&this._fillPoles(e,t,n)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let n=e[t+1];n===-32768&&(e[t+1]=-32767),n===32767&&(e[t+1]=32766)}}_generatePoleQuad(e,t,n,r,i,a){r>i==(a===-32768)?(e.push(n),e.push(t),e.push(this._vertexToIndex(r,a)),e.push(this._vertexToIndex(i,a)),e.push(n),e.push(this._vertexToIndex(r,a))):(e.push(t),e.push(n),e.push(this._vertexToIndex(r,a)),e.push(n),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(r,a)))}_fillPoles(e,t,n){let r=this._vertexBuffer,i=q,a=e.length;for(let o=2;o<a;o+=3){let a=e[o-2],s=e[o-1],c=e[o],l=r[a*2],u=r[a*2+1],d=r[s*2],f=r[s*2+1],p=r[c*2],m=r[c*2+1];t&&(u===0&&f===0&&this._generatePoleQuad(e,a,s,l,d,-32768),f===0&&m===0&&this._generatePoleQuad(e,s,c,d,p,-32768),m===0&&u===0&&this._generatePoleQuad(e,c,a,p,l,-32768)),n&&(u===i&&f===i&&this._generatePoleQuad(e,a,s,l,d,32767),f===i&&m===i&&this._generatePoleQuad(e,s,c,d,p,32767),m===i&&u===i&&this._generatePoleQuad(e,c,a,p,l,32767))}}_initializeVertices(e){for(let t=0;t<e.length;t+=2)this._vertexToIndex(e[t],e[t+1])}subdividePolygonInternal(e,t){if(this._used)throw Error(`Subdivision: multiple use not allowed.`);this._used=!0;let{flattened:n,holeIndices:r}=JRe(e);this._initializeVertices(n);let i;try{let e=vRe(n,r),t=this._convertIndices(n,e);i=this._subdivideTrianglesScanline(t)}catch(e){console.error(e)}let a=[];return t&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(i),this._granularity>=2&&this._canonical?.z===0&&(i=this._removeTrianglesOutsideTileX(i),a=a.map(e=>this._removeLinesOutsideTileX(e))),{verticesFlattened:this._vertexBuffer,indicesTriangles:i,indicesLineList:a}}_vertexOutsideTileX(e){let t=this._vertexBuffer[e*2];return t<0||t>8192}_removeTrianglesOutsideTileX(e){let t=[];for(let n=0;n<e.length;n+=3)this._vertexOutsideTileX(e[n])||this._vertexOutsideTileX(e[n+1])||this._vertexOutsideTileX(e[n+2])||t.push(e[n],e[n+1],e[n+2]);return t}_removeLinesOutsideTileX(e){let t=[];for(let n=0;n<e.length;n+=2)this._vertexOutsideTileX(e[n])||this._vertexOutsideTileX(e[n+1])||t.push(e[n],e[n+1]);return t}_convertIndices(e,t){let n=[];for(let r of t){let t=e[r*2],i=e[r*2+1];n.push(this._vertexToIndex(t,i))}return n}_pointArrayToIndices(e){let t=[];for(let n of e)t.push(this._vertexToIndex(n.x,n.y));return t}};function qRe(e,t,n,r=!0){return new KRe(n,t).subdividePolygonInternal(e,r)}function BK(e,t,n=!1){if(!e||e.length<1||e.length<2)return[];let r=e[0],i=e[e.length-1],a=n&&(r.x!==i.x||r.y!==i.y);if(t<2)return a?[...e,e[0]]:[...e];let o=Math.floor(q/t),s=[];s.push(new K(e[0].x,e[0].y));let c=e.length,l=a?c:c-1;for(let t=0;t<l;t++){let n=e[t],r=t<c-1?e[t+1]:e[0],i=n.x,a=n.y,l=r.x,u=r.y,d=i!==l,f=a!==u;if(!d&&!f)continue;let p=l-i,m=u-a,h=Math.abs(p),g=Math.abs(m),_=i,v=a;for(;;){let e=p>0?(Math.floor(_/o)+1)*o:(Math.ceil(_/o)-1)*o,t=m>0?(Math.floor(v/o)+1)*o:(Math.ceil(v/o)-1)*o,n=Math.abs(_-e),r=Math.abs(v-t),i=Math.abs(_-l),a=Math.abs(v-u),c=d?n/h:1/0,y=f?r/g:1/0;
vendor: 13,606 bytes, line 409
409if((i<=n||!d)&&(a<=r||!f))break;if(c<y&&d||!f){_=e,v+=m*c;let t=new K(_,Math.round(v));(s[s.length-1].x!==t.x||s[s.length-1].y!==t.y)&&s.push(t)}else{_+=p*y,v=t;let e=new K(Math.round(_),v);(s[s.length-1].x!==e.x||s[s.length-1].y!==e.y)&&s.push(e)}}let y=new K(l,u);(s[s.length-1].x!==y.x||s[s.length-1].y!==y.y)&&s.push(y)}return s}function JRe(e){let t=[],n=[];for(let r of e)if(r.length!==0){r!==e[0]&&t.push(n.length/2);for(let e of r)n.push(e.x),n.push(e.y)}return{flattened:n,holeIndices:t}}function YRe(e,t){let n=[];for(let r=0;r<t.length;r+=3){let i=t[r],a=t[r+1],o=t[r+2],s=e[i*2],c=e[i*2+1],l=e[a*2],u=e[a*2+1],d=e[o*2],f=e[o*2+1],p=l-s,m=u-c,h=d-s;p*(f-c)-m*h>0?(n.push(i),n.push(o),n.push(a)):(n.push(i),n.push(a),n.push(o))}return n}function XRe(e,t,n){if(t.length===0)throw Error(`Subdivision vertex ring is empty.`);let r=0,i=e[t[0]*2];for(let n=1;n<t.length;n++){let a=e[t[n]*2];a<i&&(i=a,r=n)}let a=t.length,o=r,s=(o+1)%a;for(;;){let r=o-1>=0?o-1:a-1,i=(s+1)%a,c=e[t[r]*2],l=e[t[r]*2+1],u=e[t[i]*2],d=e[t[i]*2+1],f=e[t[o]*2],p=e[t[o]*2+1],m=e[t[s]*2],h=e[t[s]*2+1],g=!1;if(c<u)g=!0;else if(c>u)g=!1;else{let e=h-p,t=-(m-f),n=p<h?1:-1;((c-f)*e+(l-p)*t)*n>((u-f)*e+(d-p)*t)*n&&(g=!0)}if(g){let e=t[r],i=t[o],c=t[s];e!==i&&e!==c&&i!==c&&n.push(c,i,e),o--,o<0&&(o=a-1)}else{let e=t[i],r=t[o],c=t[s];e!==r&&e!==c&&r!==c&&n.push(c,r,e),s++,s>=a&&(s=0)}if(r===i)break}}function ZRe(e,t,n,r,i,a,o,s,c){let l=i.length/2,u=o&&s&&c;if(l<uG.MAX_VERTEX_ARRAY_LENGTH){let d=t.prepareSegment(l,n,r),f=d.vertexLength;for(let e=0;e<a.length;e+=3)r.emplaceBack(f+a[e],f+a[e+1],f+a[e+2]);d.vertexLength+=l,d.primitiveLength+=a.length/3;let p,m;u&&(m=o.prepareSegment(l,n,s),p=m.vertexLength,m.vertexLength+=l);for(let t=0;t<i.length;t+=2)e(i[t],i[t+1]);if(u)for(let e of c){for(let t=1;t<e.length;t+=2)s.emplaceBack(p+e[t-1],p+e[t]);m.primitiveLength+=e.length/2}}else QRe(t,n,r,i,a,e),u&&$Re(o,n,s,i,c,e),t.forceNewSegmentOnNextPrepare(),o?.forceNewSegmentOnNextPrepare()}function VK(e,t,n,r,i,a,o){if(a){let a=r.count;return n(t[i*2],t[i*2+1]),e[i]=r.count,r.count++,o.vertexLength++,a}return e[i]}function QRe(e,t,n,r,i,a){let o=[];for(let e=0;e<r.length/2;e++)o.push(-1);let s={count:0},c=0,l=e.getOrCreateLatestSegment(t,n),u=l.vertexLength;for(let d=2;d<i.length;d+=3){let f=i[d-2],p=i[d-1],m=i[d],h=o[f]<c,g=o[p]<c,_=o[m]<c,v=+!!h+ +!!g+ +!!_;l.vertexLength+v>uG.MAX_VERTEX_ARRAY_LENGTH&&(l=e.createNewSegment(t,n),c=s.count,h=!0,g=!0,_=!0,u=0);let y=VK(o,r,a,s,f,h,l),b=VK(o,r,a,s,p,g,l),x=VK(o,r,a,s,m,_,l);n.emplaceBack(u+y-c,u+b-c,u+x-c),l.primitiveLength++}}function $Re(e,t,n,r,i,a){let o=[];for(let e=0;e<r.length/2;e++)o.push(-1);let s={count:0},c=0,l=e.getOrCreateLatestSegment(t,n),u=l.vertexLength;for(let d of i)for(let i=1;i<d.length;i+=2){let f=d[i-1],p=d[i],m=o[f]<c,h=o[p]<c,g=+!!m+ +!!h;l.vertexLength+g>uG.MAX_VERTEX_ARRAY_LENGTH&&(l=e.createNewSegment(t,n),c=s.count,m=!0,h=!0,u=0);let _=VK(o,r,a,s,f,m,l),v=VK(o,r,a,s,p,h,l);n.emplaceBack(u+_-c,u+v-c),l.primitiveLength++}}var eze=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new mLe,this.indexArray=new sG,this.indexArray2=new cG,this.programConfigurations=new PG(e.layers,e.zoom),this.segments=new uG,this.segments2=new uG,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,n){this.hasDependencies=pK(`fill`,this.layers,t);let r=this.layers[0].layout.get(`fill-sort-key`),i=!r.isConstant(),a=[],o=new XU(this.zoom),s=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:l,index:u,sourceLayerIndex:d}of e){let e=zG(c,s);if(!this.layers[0]._featureFilter.filter(o,e,n))continue;let f=i?r.evaluate(e,{},n,t.availableImages):void 0,p={id:l,properties:c.properties,type:c.type,sourceLayerIndex:d,index:u,geometry:s?e.geometry:RG(c),patterns:{},sortKey:f};a.push(p)}i&&a.sort((e,t)=>e.sortKey-t.sortKey);for(let r of a){let{geometry:i,index:a,sourceLayerIndex:o}=r;if(this.hasDependencies){let e=mK(`fill`,this.layers,r,{zoom:this.zoom},t);this.patternFeatures.push(e)}else this.addFeature(r,i,a,n,{},t.subdivisionGranularity);let s=e[a].feature;t.featureIndex.insert(s,i,a,o,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:n})}addFeatures(e,t,n){for(let r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_Re),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,n,r,i,a){for(let e of VV(t,500)){let t=qRe(e,r,a.fill.getGranularityForZoomLevel(r.z)),n=this.layoutVertexArray;ZRe((e,t)=>{n.emplaceBack(e,t)},this.segments,this.layoutVertexArray,this.indexArray,t.verticesFlattened,t.indicesTriangles,this.segments2,this.indexArray2,t.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:i,canonical:r})}};BU(`FillBucket`,eze,{omit:[`layers`,`patternFeatures`]});var tze,nze=()=>tze||=new fW({"fill-sort-key":new cW(J.layout_fill[`fill-sort-key`],`fill-sort-key`)}),rze,ize=()=>rze||=new fW({"fill-antialias":new sW(J.paint_fill[`fill-antialias`],`fill-antialias`),"fill-opacity":new cW(J.paint_fill[`fill-opacity`],`fill-opacity`),"fill-layer-opacity":new sW(J.paint_fill[`fill-layer-opacity`],`fill-layer-opacity`),"fill-color":new cW(J.paint_fill[`fill-color`],`fill-color`),"fill-outline-color":new cW(J.paint_fill[`fill-outline-color`],`fill-outline-color`),"fill-translate":new sW(J.paint_fill[`fill-translate`],`fill-translate`),"fill-translate-anchor":new sW(J.paint_fill[`fill-translate-anchor`],`fill-translate-anchor`),"fill-pattern":new lW(J.paint_fill[`fill-pattern`],`fill-pattern`)}),aze={get paint(){return ize()},get layout(){return nze()}},oze=e=>e.type===`fill`,sze=class extends hW{constructor(e,t){super(e,aze,t)}recalculate(e,t){super.recalculate(e,t);let n=this.paint._values[`fill-outline-color`];n.value.kind===`constant`&&n.value.value===void 0&&(this.paint._values[`fill-outline-color`]=this.paint._values[`fill-color`])}createBucket(e){return new eze(e)}queryRadius(){return XG(this.paint.get(`fill-translate`))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:n,pixelsToTileUnits:r}){return WG(ZG(e,this.paint.get(`fill-translate`),this.paint.get(`fill-translate-anchor`),-n.bearingInRadians,r),t)}isTileClipped(){return!0}},HK=yW([{name:`a_pos`,components:2,type:`Int16`},{name:`a_normal_ed`,components:4,type:`Int16`}],4),cze=yW([{name:`a_centroid`,components:2,type:`Int16`}],4),lze=HK.members;HK.size,HK.alignment;var UK=class e{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(t){let n=new e;return n.extend(t(new K(this.minX,this.minY))),n.extend(t(new K(this.maxX,this.minY))),n.extend(t(new K(this.minX,this.maxY))),n.extend(t(new K(this.maxX,this.maxY))),n}static fromPoints(t){let n=new e;for(let e of t)n.extend(e);return n}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},uze=UK.fromPoints([new K(0,0),new K(q,q)]);function WK(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function dze(e){return e.every(e=>e.x<0)||e.every(e=>e.x>8192)||e.every(e=>e.y<0)||e.every(e=>e.y>8192)}var GK=class{constructor(e,t,n,r,i){for(this.properties=Object.create(null),this.extent=n,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=i;e.pos<t;){let t=e.readVarint();if(t===8)this.id=e.readVarint();else if(t===18){let t=e.readVarint()+e.pos;for(;e.pos<t;){let t=r[e.readVarint()],n=i[e.readVarint()];this.properties[t]=n}}else t===24?this.type=e.readVarint():(t===34&&(this._geometry=e.pos),e.skip(t))}}loadGeometry(){if(this._geometry<0)throw Error(`feature has no geometry`);let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,n=[],r,i=1,a=0,o=0,s=0;for(;e.pos<t;){if(a<=0){let t=e.readVarint();if(i=t&7,a=t>>3,a===0)continue}if(a--,i===1)o+=e.readSVarint(),s+=e.readSVarint(),r&&n.push(r),r=[new K(o,s)];else if(i===2)o+=e.readSVarint(),s+=e.readSVarint(),r&&r.push(new K(o,s));else if(i===7)r&&r.push(r[0].clone());else throw Error(`unknown command ${i}`)}return r&&n.push(r),n}bbox(){if(this._geometry<0)throw Error(`feature has no geometry`);let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,n=1,r=0,i=0,a=0,o=1/0,s=-1/0,c=1/0,l=-1/0;for(;e.pos<t;){if(r<=0){let t=e.readVarint();if(n=t&7,r=t>>3,r===0)continue}if(r--,n===1||n===2)i+=e.readSVarint(),a+=e.readSVarint(),i<o&&(o=i),i>s&&(s=i),a<c&&(c=a),a>l&&(l=a);else if(n!==7)throw Error(`unknown command ${n}`)}return[o,c,s,l]}toGeoJSON(e,t,n){let r=this.extent*2**n,i=this.extent*e,a=this.extent*t,o=this.loadGeometry();function s(e){return[(e.x+i)*360/r-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+a)*2/r)*Math.PI))-90]}function c(e){return e.map(s)}let l;if(this.type===1){let e=[];for(let t of o)e.push(t[0]);let t=c(e);l=e.length===1?{type:`Point`,coordinates:t[0]}:{type:`MultiPoint`,coordinates:t}}else if(this.type===2){let e=o.map(c);l=e.length===1?{type:`LineString`,coordinates:e[0]}:{type:`MultiLineString`,coordinates:e}}else if(this.type===3){let e=fze(o),t=[];for(let n of e)t.push(n.map(c));l=t.length===1?{type:`Polygon`,coordinates:t[0]}:{type:`MultiPolygon`,coordinates:t}}else throw Error(`unknown feature type`);let u={type:`Feature`,geometry:l,properties:this.properties};return this.id!=null&&(u.id=this.id),u}};GK.types=[`Unknown`,`Point`,`LineString`,`Polygon`];function fze(e){let t=e.length;if(t<=1)return[e];let n=[],r,i;for(let a=0;a<t;a++){let t=pze(e[a]);t!==0&&(i===void 0&&(i=t<0),i===t<0?(r&&n.push(r),r=[e[a]]):r&&r.push(e[a]))}return r&&n.push(r),n}function pze(e){let t=0;for(let n=0,r=e.length,i=r-1,a,o;n<r;i=n++)a=e[n],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}var mze=class{constructor(e,t){for(this.version=1,this.name=``,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],t===void 0&&(t=e.length);e.pos<t;){let t=e.readVarint();t===10?this.name=e.readString():t===18?(this._features.push(e.pos),e.skip(t)):t===26?this._keys.push(e.readString()):t===34?this._values.push(hze(e)):t===40?this.extent=e.readVarint():t===120?this.version=e.readVarint():e.skip(t)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw Error(`feature index out of bounds`);this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new GK(this._pbf,t,this.extent,this._keys,this._values)}};function hze(e){let t=null,n=e.readVarint()+e.pos;for(;e.pos<n;){let n=e.readVarint();t=n===10?e.readString():n===21?e.readFloat():n===25?e.readDouble():n===32?e.readVarint(!0):n===40?e.readVarint():n===48?e.readSVarint():n===56?e.readBoolean():(e.skip(n),null)}if(t==null)throw Error(`unknown feature value`);return t}var gze=class{constructor(e,t=e.length){let n=Object.create(null);for(;e.pos<t;){let t=e.readVarint();if(t===26){let t=new mze(e,e.readVarint()+e.pos);t.length&&(n[t.name]=t)}else e.skip(t)}this.layers=n}},KK=6371008.8,qK=class e{constructor(e,t){if(isNaN(e)||isNaN(t))throw Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw Error(`Invalid LngLat latitude value: must be between -90 and 90`)}wrap(){return new e(az(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return KK*Math.acos(Math.min(i,1))}static convert(t){if(t instanceof e)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t==`object`&&t)return new e(Number(`lng`in t?t.lng:t.lon),Number(t.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}},_ze=2*Math.PI*KK;function vze(e){return _ze*Math.cos(e*Math.PI/180)}function JK(e){return(180+e)/360}function YK(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function XK(e,t){return e/vze(t)}function ZK(e){return e*360-180}function QK(e){let t=180-e*360;
vendor: 6,580 bytes, line 409
409return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function yze(e,t){return e*vze(QK(t))}function bze(e){return 1/Math.cos(e*Math.PI/180)}var $K=class e{constructor(e,t,n=0){this.x=+e,this.y=+t,this.z=+n}static fromLngLat(t,n=0){let r=qK.convert(t);return new e(JK(r.lng),YK(r.lat),XK(n,r.lat))}toLngLat(){return new qK(ZK(this.x),QK(this.y))}toAltitude(){return yze(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/_ze*bze(QK(this.y))}},eq=89.25;function xze(e,t,n){let r=1/(1<<n.z);return new $K(e/q*r+n.x*r,t/q*r+n.y*r)}function Sze(e,t,n){return xze(e,t,n).toLngLat()}function tq(e,t){let n=iz(t.lat,-85.051129,kz);return new K(JK(t.lng)*e,YK(n)*e)}function nq(e,t){return new $K(t.x/e,t.y/e).toLngLat()}function rq(e){return e.cameraToCenterDistance*Math.min(Math.tan(wz(90-e.pitch))*.85,Math.tan(wz(eq-e.pitch)))}function iq(e,t){let n=e.canonical,r=t/lz(n.z),i=n.x+2**n.z*e.wrap,a=new Float64Array(16);return rR(a),oR(a,a,[i*r,n.y*r,0]),sR(a,a,[r/q,r/q,1]),a}function Cze(e,t,n,r,i){let a=$K.fromLngLat(e,t),o=i*XK(1,e.lat),{x:s,y:c,z:l}=aq(n,r),u=o*-s,d=o*-c,f=o*l;return new $K(a.x+u,a.y+d,a.z+f)}function wze(e){let t=XK(1,e.center.lat)*e.worldSize;return Cze(e.center,e.elevation,e.pitch,e.bearing,e.cameraToCenterDistance/t)}function aq(e,t){let n=wz(e),r=wz(t),i=Math.cos(-n),a=Math.sin(n);return{x:a*Math.sin(r),y:-a*Math.cos(r),z:i}}function Tze(e,t,n){if(t<=0||!e||e.length===0)return e;let r=Eze(t,n);return e.map(e=>Dze(e,r))}function Eze(e,t){let n=Sze(q/2,q/2,t),r=$K.fromLngLat(n).meterInMercatorCoordinateUnits(),i=(1<<t.z)*q;return e*r*i}function Dze(e,t){if(!e||e.length<3)return e;let n=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,r=n?e.length-1:e.length;if(r<3)return e;let i=[];for(let n=0;n<r;n++){let a=e[(n-1+r)%r],o=e[n],s=e[(n+1)%r];if(WK(a,o)||WK(o,s)){i.push(o.clone());continue}kze(i,a,o,s,t)}let a=Oze(i);return a.length<3?e:(n&&a.push(a[0].clone()),a)}function Oze(e){let t=[];for(let n of e){let e=n.round(),r=t[t.length-1];(r?.x!==e.x||r?.y!==e.y)&&t.push(e)}for(;t.length>1&&t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y;)t.pop();return t}function kze(e,t,n,r,i){let a=t.sub(n),o=r.sub(n),s=a.mag(),c=o.mag();if(s<1e-6||c<1e-6){e.push(n.clone());return}a._div(s),o._div(c);let l=a.x*o.x+a.y*o.y;if(Math.abs(l)>Math.cos(5*Math.PI/180)){e.push(n.clone());return}let u=.2,d=Math.min(i,s*u,c*u),f=n.add(a.mult(d)),p=n.add(o.mult(d)),m=Math.sqrt((1+l)/2),h=n.add(a.add(o)._unit()._mult(d/m)),g=f.sub(h).angleWith(p.sub(h)),_=Math.max(2,Math.ceil(Math.abs(g)/(Math.PI/6)-1e-6));for(let t=0;t<=_;t++)e.push(f.rotateAround(t/_*g,h))}var oq=8192;function sq(e,t,n,r,i,a,o,s){e.emplaceBack(t,n,Math.floor(r*oq)*2+o,i*oq*2,a*oq*2,Math.round(s))}var Aze=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new hLe,this.centroidVertexArray=new rG,this.indexArray=new sG,this.programConfigurations=new PG(e.layers,e.zoom),this.segments=new uG,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,n){this.features=[],this.hasDependencies=pK(`fill-extrusion`,this.layers,t);let r=new XU(this.zoom),i=this.layers[0],a=i.layout.get(`fill-extrusion-rounded-corner-distance`),o=i._featureFilter.needGeometry;for(let{feature:s,id:c,index:l,sourceLayerIndex:u}of e){let e=zG(s,o);if(!i._featureFilter.filter(r,e,n))continue;let d=o?e.geometry:RG(s),f={id:c,sourceLayerIndex:u,index:l,geometry:a>0?Tze(d,a,n):d,properties:s.properties,type:s.type,patterns:{}};this.hasDependencies?this.features.push(mK(`fill-extrusion`,this.layers,f,{zoom:this.zoom},t)):this.addFeature(f,f.geometry,l,n,{},t.subdivisionGranularity),t.featureIndex.insert(s,f.geometry,l,u,this.index,!0)}}addFeatures(e,t,n){for(let r of this.features){let{geometry:i}=r;this.addFeature(r,i,r.index,t,n,e.subdivisionGranularity)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:n})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lze),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,cze.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,n,r,i,a){let o=this.layers[0],s=o.layout?o.layout.get(`fill-extrusion-rounded-corner-distance`):0,c=s>0?Tze(t,s,r):t;for(let t of VV(c,500)){let n={x:0,y:0,sampleCount:0},i=this.layoutVertexArray.length;this.processPolygon(n,r,e,t,a);let o=this.layoutVertexArray.length-i,s=Math.floor(n.x/n.sampleCount),c=Math.floor(n.y/n.sampleCount);for(let e=0;e<o;e++)this.centroidVertexArray.emplaceBack(s,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:i,canonical:r})}processPolygon(e,t,n,r,i){if(r.length<1||dze(r[0]))return;for(let t of r)t.length!==0&&jze(e,t);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},o=i.fill.getGranularityForZoomLevel(t.z),s=GK.types[n.type]===`Polygon`;for(let e of r){if(e.length===0||dze(e))continue;let t=BK(e,o,s);this._generateSideFaces(t,a)}if(!s)return;let c=qRe(r,t,o,!1),l=this.layoutVertexArray;ZRe((e,t)=>{sq(l,e,t,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,c.verticesFlattened,c.indicesTriangles)}_generateSideFaces(e,t){let n=0;for(let r=1;r<e.length;r++){let i=e[r],a=e[r-1];if(WK(i,a))continue;t.segment.vertexLength+4>uG.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=i.sub(a)._perp()._unit(),s=a.dist(i);n+s>32768&&(n=0),sq(this.layoutVertexArray,i.x,i.y,o.x,o.y,0,0,n),sq(this.layoutVertexArray,i.x,i.y,o.x,o.y,0,1,n),n+=s,sq(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,0,n),sq(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,1,n);let c=t.segment.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}};function jze(e,t){for(let n=0;n<t.length;n++){let r=t[n];(n!==t.length-1||t[0].x!==r.x||t[0].y!==r.y)&&(e.x+=r.x,e.y+=r.y,e.sampleC
vendor: 4,590 bytes, line 409
409ount++)}}BU(`FillExtrusionBucket`,Aze,{omit:[`layers`,`features`]});var Mze,Nze=()=>Mze||=new fW({"fill-extrusion-rounded-corner-distance":new sW(J[`layout_fill-extrusion`][`fill-extrusion-rounded-corner-distance`],`fill-extrusion-rounded-corner-distance`)}),Pze,Fze=()=>Pze||=new fW({"fill-extrusion-opacity":new sW(J[`paint_fill-extrusion`][`fill-extrusion-opacity`],`fill-extrusion-opacity`),"fill-extrusion-color":new cW(J[`paint_fill-extrusion`][`fill-extrusion-color`],`fill-extrusion-color`),"fill-extrusion-translate":new sW(J[`paint_fill-extrusion`][`fill-extrusion-translate`],`fill-extrusion-translate`),"fill-extrusion-translate-anchor":new sW(J[`paint_fill-extrusion`][`fill-extrusion-translate-anchor`],`fill-extrusion-translate-anchor`),"fill-extrusion-pattern":new lW(J[`paint_fill-extrusion`][`fill-extrusion-pattern`],`fill-extrusion-pattern`),"fill-extrusion-height":new cW(J[`paint_fill-extrusion`][`fill-extrusion-height`],`fill-extrusion-height`),"fill-extrusion-base":new cW(J[`paint_fill-extrusion`][`fill-extrusion-base`],`fill-extrusion-base`),"fill-extrusion-vertical-gradient":new sW(J[`paint_fill-extrusion`][`fill-extrusion-vertical-gradient`],`fill-extrusion-vertical-gradient`)}),Ize={get paint(){return Fze()},get layout(){return Nze()}},Lze=e=>e.type===`fill-extrusion`,Rze=class extends hW{constructor(e,t){super(e,Ize,t)}createBucket(e){return new Aze(e)}queryRadius(){return XG(this.paint.get(`fill-extrusion-translate`))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:r,transform:i,pixelsToTileUnits:a,pixelPosMatrix:o}){let s=ZG(e,this.paint.get(`fill-extrusion-translate`),this.paint.get(`fill-extrusion-translate-anchor`),-i.bearingInRadians,a),c=this.paint.get(`fill-extrusion-height`).evaluate(t,n),l=this.paint.get(`fill-extrusion-base`).evaluate(t,n),u=Hze(s,o,0),d=Vze(r,l,c,o),f=d[0],p=d[1];return Bze(f,p,u)}};function cq(e,t){return e.x*t.x+e.y*t.y}function zze(e,t){if(e.length===1){let n=0,r=t[n++],i;for(;!i||r.equals(i);)if(i=t[n++],!i)return 1/0;for(;n<t.length;n++){let a=t[n],o=e[0],s=i.sub(r),c=a.sub(r),l=o.sub(r),u=cq(s,s),d=cq(s,c),f=cq(c,c),p=cq(l,s),m=cq(l,c),h=u*f-d*d,g=(f*p-d*m)/h,_=(u*m-d*p)/h,v=1-g-_,y=r.z*v+i.z*g+a.z*_;if(isFinite(y))return y}return 1/0}{let e=1/0;for(let n of t)e=Math.min(e,n.z);return e}}function Bze(e,t,n){let r=1/0;WG(n,t)&&(r=zze(n,t[0]));for(let i=0;i<t.length;i++){let a=t[i],o=e[i];for(let e=0;e<a.length-1;e++){let t=a[e],i=a[e+1],s=o[e],c=[t,i,o[e+1],s,t];HG(n,c)&&(r=Math.min(r,zze(n,c)))}}return r!==1/0&&r}function Vze(e,t,n,r){let i=[],a=[],o=r[8]*t,s=r[9]*t,c=r[10]*t,l=r[11]*t,u=r[8]*n,d=r[9]*n,f=r[10]*n,p=r[11]*n;for(let t of e){let e=[],n=[];for(let i of t){let t=i.x,a=i.y,m=r[0]*t+r[4]*a+r[12],h=r[1]*t+r[5]*a+r[13],g=r[2]*t+r[6]*a+r[14],_=r[3]*t+r[7]*a+r[15],v=m+o,y=h+s,b=g+c,x=_+l,S=m+u,C=h+d,w=g+f,T=_+p,E=new K(v/x,y/x);E.z=b/x,e.push(E);let D=new K(S/T,C/T);D.z=w/T,n.push(D)}i.push(e),a.push(n)}return[i,a]}function Hze(e,t,n){let r=[];for(let i of e){let e=[i.x,i.y,n,1];kR(e,e,t),r.push(new K(e[0]/e[3],e[1]/e[3]))}return r}var Uze=`geojsonvt_clip_start`,Wze=`geojsonvt_clip_end`,lq=yW([{name:`a_pos_normal`,components:2,type:`Int16`},{name:`a_data`,components:4,type:`Uint8`}],4),Gze=lq.members;lq.size,lq.alignment;var uq=yW([{name:`a_uv_x`,components:1,type:`Float32`},{name:`a_split_index`,components:1,type:`Float32`}]),Kze=uq.members;uq.size,uq.alignment;var qze=Math.cos(75/2*(Math.PI/180)),Jze=1/2,Yze=2**14/Jze,Xze=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new gLe,this.layoutVertexArray2=new _Le,this.indexArray=new sG,this.programConfigurations=new PG(e.layers,e.zoom),this.segments=new uG,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,n){this.hasDependencies=pK(`line`,this.layers,t)||this.hasLineDasharray(this.layers);let r=this.layers[0].layout.get(`line-sort-key`),i=!r.isConstant(),a=[],o=new XU(this.zoom),s=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:c,index:l,sourceLayerIndex:u}of e){let e=zG(t,s);if(!this.layers[0]._featureFilter.filter(o,e,n))continue;let d=i?r.evaluate(e,{},n):void 0,f={id:c,properties:t.properties,type:t.type,sourceLayerIndex:u,index:l,geometry:s?e.geometry:RG(t),patterns:{},dashes:{},sortKey:d};a.push(f)}i&&a.sort((e,t)=>
vendor: 9,132 bytes, line 409
409e.sortKey-t.sortKey);for(let r of a){let{geometry:i,index:a,sourceLayerIndex:o}=r;this.hasDependencies?(pK(`line`,this.layers,t)?mK(`line`,this.layers,r,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,r,this.zoom,t),this.patternFeatures.push(r)):this.addFeature(r,i,a,n,{},{},t.subdivisionGranularity);let s=e[a].feature;t.featureIndex.insert(s,i,a,o,this.index)}}update(e,t,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:n,dashPositions:r})}addFeatures(e,t,n,r){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,n,r,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Kze)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Gze),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,`geojsonvt_clip_start`)&&Object.hasOwn(e.properties,`geojsonvt_clip_end`))return{start:+e.properties[Uze],end:+e.properties[Wze]}}addFeature(e,t,n,r,i,a,o){let s=this.layers[0].layout,c=s.get(`line-join`).evaluate(e,{}),l=s.get(`line-cap`).evaluate(e,{}),u=s.get(`line-miter-limit`).evaluate(e,{}),d=s.get(`line-round-limit`).evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let n of t)this.addLine(n,e,c,l,u,d,r,o);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:i,dashPositions:a,canonical:r})}addLine(e,t,n,r,i,a,o,s){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let c=o?s.line.getGranularityForZoomLevel(o.z):1;if(e=BK(e,c),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let l=GK.types[t.type]===`Polygon`,u=e.length;for(;u>=2&&e[u-1].equals(e[u-2]);)u--;let d=0;for(;d<u-1&&e[d].equals(e[d+1]);)d++;if(u-d<(l?3:2))return;n===`bevel`&&(i=1.05);let f=this.overscaling<=16?15*q/(512*this.overscaling):0,p=this.segments.prepareSegment(u*10,this.layoutVertexArray,this.indexArray),m,h,g,_,v;this.e1=this.e2=-1,l&&(m=e[u-2],v=e[d].sub(m)._unit()._perp());for(let t=d;t<u;t++){if(g=t===u-1?l?e[d+1]:void 0:e[t+1],g&&e[t].equals(g))continue;v&&(_=v),m&&(h=m),m=e[t],v=g?g.sub(m)._unit()._perp():_,_||=v;let o=_.add(v);(o.x!==0||o.y!==0)&&o._unit();let s=_.x*v.x+_.y*v.y,c=o.x*v.x+o.y*v.y,y=c===0?1/0:1/c,b=2*Math.sqrt(2-2*c),x=c<qze&&h&&g,S=_.x*v.y-_.y*v.x>0;if(x&&t>d){let e=m.dist(h);if(e>2*f){let t=m.sub(m.sub(h)._mult(f/e)._round());this.updateDistance(h,t),this.addCurrentVertex(t,_,0,0,p),h=t}}let C=h&&g,w=C?n:l?`butt`:r;if(C&&w===`round`&&(y<a?w=`miter`:y<=2&&(w=`fakeround`)),w===`miter`&&y>i&&(w=`bevel`),w===`bevel`&&(y>2&&(w=`flipbevel`),y<i&&(w=`miter`)),h&&this.updateDistance(h,m),w===`miter`)o._mult(y),this.addCurrentVertex(m,o,0,0,p);else if(w===`flipbevel`){if(y>100)o=v.mult(-1);else{let e=y*_.add(v).mag()/_.sub(v).mag();o._perp()._mult(e*(S?-1:1))}this.addCurrentVertex(m,o,0,0,p),this.addCurrentVertex(m,o.mult(-1),0,0,p)}else if(w===`bevel`||w===`fakeround`){let e=-Math.sqrt(y*y-1),t=S?e:0,n=S?0:e;if(h&&this.addCurrentVertex(m,_,t,n,p),w===`fakeround`){let e=Math.round(b*180/Math.PI/20);for(let t=1;t<e;t++){let n=t/e;if(n!==.5){let e=n-.5,t=1.0904+s*(-3.2452+s*(3.55645-s*1.43519)),r=.848013+s*(-1.06021+s*.215638);n+=n*e*(n-1)*(t*e*e+r)}let r=v.sub(_)._mult(n)._add(_)._unit()._mult(S?-1:1);this.addHalfVertex(m,r.x,r.y,!1,S,0,p)}}g&&this.addCurrentVertex(m,v,-t,-n,p)}else if(w===`butt`)this.addCurrentVertex(m,o,0,0,p);else if(w===`square`){let e=h?1:-1;this.addCurrentVertex(m,o,e,e,p)}else w===`round`&&(h&&(this.addCurrentVertex(m,_,0,0,p),this.addCurrentVertex(m,_,1,1,p,!0)),g&&(this.addCurrentVertex(m,v,-1,-1,p,!0),this.addCurrentVertex(m,v,0,0,p)));if(x&&t<u-1){let e=m.dist(g);if(e>2*f){let t=m.add(g.sub(m)._mult(f/e)._round());this.updateDistance(m,t),this.addCurrentVertex(t,v,0,0,p),m=t}}}}addCurrentVertex(e,t,n,r,i,a=!1){let o=t.x+t.y*n,s=t.y-t.x*n,c=-t.x+t.y*r,l=-t.y-t.x*r;this.addHalfVertex(e,o,s,a,!1,n,i),this.addHalfVertex(e,c,l,a,!0,-r,i),this.distance>Yze/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,n,r,i,a))}addHalfVertex({x:e,y:t},n,r,i,a,o,s){let c=(this.lineClips?this.scaledDistance*(Yze-1):this.scaledDistance)*Jze;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!i,(t<<1)+ +!!a,Math.round(63*n)+128,Math.round(63*r)+128,(o===0?0:o<0?-1:1)+1|(c&63)<<2,c>>6),this.lineClips){let e=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(e,this.lineClipsArray.length)}let l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,l,this.e2),s.primitiveLength++),a?this.e2=l:this.e1=l}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let e=t.paint.get(`line-dasharray`);if(e&&!e.isConstant())return!0}return!1}addLineDashDependencies(e,t,n,r){for(let i of e){let e=i.paint.get(`line-dasharray`);if(!e||e.value.kind===`constant`)continue;let a=i.layout.get(`line-cap`).evaluate(t,{})===`round`,o={dasharray:e.value.evaluate({zoom:n-1},t,{}),round:a},s={dasharray:e.value.evaluate({zoom:n},t,{}),round:a},c={dasharray:e.value.evaluate({zoom:n+1},t,{}),round:a},l=`${o.dasharray.join(`,`)},${o.round}`,u=`${s.dasharray.join(`,`)},${s.round}`,d=`${c.dasharray.join(`,`)},${c.round}`;r.dashDependencies[l]=o,r.dashDependencies[u]=s,r.dashDependencies[d]=c,t.dashes[i.id]={min:l,mid:u,max:d}}}};BU(`LineBucket`,Xze,{omit:[`layers`,`patternFeatures`]});var Zze,Qze=()=>Zze||=new fW({"line-cap":new cW(J.layout_line[`line-cap`],`line-cap`),"line-join":new cW(J.layout_line[`line-join`],`line-join`),"line-miter-limit":new cW(J.layout_line[`line-miter-limit`],`line-miter-limit`),"line-round-limit":new cW(J.layout_line[`line-round-limit`],`line-round-limit`),"line-sort-key":new cW(J.layout_line[`line-sort-key`],`line-sort-key`)}),$ze,eBe=()=>$ze||=new fW({"line-opacity":new cW(J.paint_line[`line-opacity`],`line-opacity`),"line-layer-opacity":new sW(J.paint_line[`line-layer-opacity`],`line-layer-opacity`),"line-color":new cW(J.paint_line[`line-color`],`line-color`),"line-translate":new sW(J.paint_line[`line-translate`],`line-translate`),"line-translate-anchor":new sW(J.paint_line[`line-translate-anchor`],`line-translate-anchor`),"line-width":new cW(J.paint_line[`line-width`],`line-width`),"line-gap-width":new cW(J.paint_line[`line-gap-width`],`line-gap-width`),"line-offset":new cW(J.paint_line[`line-offset`],`line-offset`),"line-blur":new cW(J.paint_line[`line-blur`],`line-blur`),"line-dasharray":new lW(J.paint_line[`line-dasharray`],`line-dasharray`),"line-pattern":new lW(J.paint_line[`line-pattern`],`line-pattern`),"line-gradient":new dW(J.paint_line[`line-gradient`],`line-gradient`)}),tBe={get paint(){return eBe()},get layout(){return Qze()}},nBe=class extends cW{possiblyEvaluate(e,t){return t=new XU(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,n,r){return t=oz({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,n,r)}},dq,rBe=e=>e.type===`line`,iBe=class extends hW{constructor(e,t){super(e,tBe,t),this.gradientVersion=0,dq||(dq=new nBe(tBe.paint.properties[`line-width`].specification,`line-floorwidth`),dq.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e===`line-gradient`){let e=this.gradientExpression();this.stepInterpolant=vIe(e)?e._styleExpression.expression instanceof mV:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values[`line-gradient`].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values[`line-floorwidth`]=dq.possiblyEvaluate(this._transitioningPaint._values[`line-width`].value,e)}createBucket(e){return new Xze(e)}queryRadius(e){let t=e,n=aBe(YG(`line-width`,this,t),YG(`line-gap-width`,this,t)),r=YG(`line-offset`,this,t);return n/2+Math.abs(r)+XG(this.paint.get(`line-translate`))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:r,transform:i,pixelsToTileUnits:a}){let o=ZG(e,this.paint.get(`line-translate`),this.paint.get(`line-translate-anchor`),-i.bearingInRadians,a),s=a/2*aBe(this.paint.get(`line-width`).evaluate(t,n),this.paint.get(`line-gap-width`).evaluate(t,n)),c=this.paint.get(`line-offset`).evaluate(t,n);
vendor: 8,799 bytes, line 409
409return c&&(r=HLe(r,c*a)),FLe(o,r,s)}isTileClipped(){return!0}};function aBe(e,t){return t>0?t+2*e:e}var oBe=yW([{name:`a_pos_offset`,components:4,type:`Int16`},{name:`a_data`,components:4,type:`Uint16`},{name:`a_pixeloffset`,components:4,type:`Int16`},{name:`a_height_offset`,components:1,type:`Float32`}],4),sBe=yW([{name:`a_projected_pos`,components:3,type:`Float32`}],4);yW([{name:`a_fade_opacity`,components:1,type:`Uint32`}],4);var cBe=yW([{name:`a_placed`,components:2,type:`Uint8`},{name:`a_shift`,components:2,type:`Float32`},{name:`a_box_real`,components:2,type:`Int16`}]);yW([{type:`Int16`,name:`anchorPointX`},{type:`Int16`,name:`anchorPointY`},{type:`Int16`,name:`x1`},{type:`Int16`,name:`y1`},{type:`Int16`,name:`x2`},{type:`Int16`,name:`y2`},{type:`Uint32`,name:`featureIndex`},{type:`Uint16`,name:`sourceLayerIndex`},{type:`Uint16`,name:`bucketIndex`}]);var lBe=yW([{name:`a_pos`,components:2,type:`Int16`},{name:`a_anchor_pos`,components:2,type:`Int16`},{name:`a_extrude`,components:2,type:`Int16`}],4),uBe=yW([{name:`a_pos`,components:2,type:`Float32`},{name:`a_radius`,components:1,type:`Float32`},{name:`a_flags`,components:2,type:`Int16`}],4);yW([{name:`triangle`,components:3,type:`Uint16`}]),yW([{type:`Int16`,name:`anchorX`},{type:`Int16`,name:`anchorY`},{type:`Uint16`,name:`glyphStartIndex`},{type:`Uint16`,name:`numGlyphs`},{type:`Uint32`,name:`vertexStartIndex`},{type:`Uint32`,name:`lineStartIndex`},{type:`Uint32`,name:`lineLength`},{type:`Uint16`,name:`segment`},{type:`Uint16`,name:`lowerSize`},{type:`Uint16`,name:`upperSize`},{type:`Float32`,name:`lineOffsetX`},{type:`Float32`,name:`lineOffsetY`},{type:`Uint8`,name:`writingMode`},{type:`Uint8`,name:`placedOrientation`},{type:`Uint8`,name:`hidden`},{type:`Uint32`,name:`crossTileID`},{type:`Int16`,name:`associatedIconIndex`},{type:`Float32`,name:`heightOffset`}]),yW([{type:`Int16`,name:`anchorX`},{type:`Int16`,name:`anchorY`},{type:`Int16`,name:`rightJustifiedTextSymbolIndex`},{type:`Int16`,name:`centerJustifiedTextSymbolIndex`},{type:`Int16`,name:`leftJustifiedTextSymbolIndex`},{type:`Int16`,name:`verticalPlacedTextSymbolIndex`},{type:`Int16`,name:`placedIconSymbolIndex`},{type:`Int16`,name:`verticalPlacedIconSymbolIndex`},{type:`Uint16`,name:`key`},{type:`Uint16`,name:`textBoxStartIndex`},{type:`Uint16`,name:`textBoxEndIndex`},{type:`Uint16`,name:`verticalTextBoxStartIndex`},{type:`Uint16`,name:`verticalTextBoxEndIndex`},{type:`Uint16`,name:`iconBoxStartIndex`},{type:`Uint16`,name:`iconBoxEndIndex`},{type:`Uint16`,name:`verticalIconBoxStartIndex`},{type:`Uint16`,name:`verticalIconBoxEndIndex`},{type:`Uint16`,name:`featureIndex`},{type:`Uint16`,name:`numHorizontalGlyphVertices`},{type:`Uint16`,name:`numVerticalGlyphVertices`},{type:`Uint16`,name:`numIconVertices`},{type:`Uint16`,name:`numVerticalIconVertices`},{type:`Uint16`,name:`useRuntimeCollisionCircles`},{type:`Uint32`,name:`crossTileID`},{type:`Float32`,name:`textBoxScale`},{type:`Float32`,name:`collisionCircleDiameter`},{type:`Uint16`,name:`textAnchorOffsetStartIndex`},{type:`Uint16`,name:`textAnchorOffsetEndIndex`},{type:`Float32`,name:`heightOffset`}]),yW([{type:`Float32`,name:`offsetX`}]),yW([{type:`Int16`,name:`x`},{type:`Int16`,name:`y`},{type:`Int16`,name:`tileUnitDistanceFromAnchor`}]),yW([{type:`Uint16`,name:`textAnchor`},{type:`Float32`,components:2,name:`textOffset`}]);function dBe(e,t,n){let r=t.layout.get(`text-transform`).evaluate(n,{});return r===`uppercase`?e=e.toLocaleUpperCase():r===`lowercase`&&(e=e.toLocaleLowerCase()),YU.applyArabicShaping&&(e=YU.applyArabicShaping(e)),e}function fBe(e,t,n){for(let r of e.sections)r.text=dBe(r.text,t,n);return e}function pBe(e){let t={},n={},r=[],i=0;function a(t){r.push(e[t]),i++}function o(e,t,i){let a=n[e];return delete n[e],n[t]=a,r[a].geometry[0].pop(),r[a].geometry[0]=r[a].geometry[0].concat(i[0]),a}function s(e,n,i){let a=t[n];return delete t[n],t[e]=a,r[a].geometry[0].shift(),r[a].geometry[0]=i[0].concat(r[a].geometry[0]),a}function c(e,t,n){let r=n?t[0][t[0].length-1]:t[0][0];return`${e}:${r.x}:${r.y}`}for(let l=0;l<e.length;l++){let u=e[l],d=u.geometry,f=u.text?u.text.toString():null;if(!f){a(l);continue}let p=c(f,d),m=c(f,d,!0);if(p in n&&m in t&&n[p]!==t[m]){let e=s(p,m,d),i=o(p,m,r[e].geometry);delete t[p],delete n[m],n[c(f,r[i].geometry,!0)]=i,r[e].geometry=null}else p in n?o(p,m,d):m in t?s(p,m,d):(a(l),t[p]=i-1,n[m]=i-1)}return r.filter(e=>e.geometry)}var mBe={"!":`︕`,"#":`#`,$:`$`,"%":`%`,"&":`&`,"(":`︵`,")":`︶`,"*":`*`,"+":`+`,",":`︐`,"-":`︲`,".":`・`,"/":`/`,":":`︓`,";":`︔`,"<":`︿`,"=":`=`,">":`﹀`,"?":`︖`,"@":`@`,"[":`﹇`,"\\":`\`,"]":`﹈`,"^":`^`,_:`︳`,"`":```,"{":`︷`,"|":`―`,"}":`︸`,"~":`~`,"¢":`¢`,"£":`£`,"¥":`¥`,"¦":`¦`,"¬":`¬`,"¯":` ̄`,"–":`︲`,"—":`︱`,"‘":`﹃`,"’":`﹄`,"“":`﹁`,"”":`﹂`,"…":`︙`,"⋯":`︙`,"‧":`・`,"₩":`₩`,"、":`︑`,"。":`︒`,"〈":`︿`,"〉":`﹀`,"《":`︽`,"》":`︾`,"「":`﹁`,"」":`﹂`,"『":`﹃`,"』":`﹄`,"【":`︻`,"】":`︼`,"〔":`︹`,"〕":`︺`,"〖":`︗`,"〗":`︘`,"!":`︕`,"(":`︵`,")":`︶`,",":`︐`,"-":`︲`,".":`・`,":":`︓`,";":`︔`,"<":`︿`,">":`﹀`,"?":`︖`,"[":`﹇`,"]":`﹈`,"_":`︳`,"{":`︷`,"|":`―`,"}":`︸`,"⦅":`︵`,"⦆":`︶`,"。":`︒`,"「":`﹁`,"」":`﹂`},fq=4294967296;1/fq;var hBe=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`),gBe=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,n=this.length){let r;for(;r=this.nextField(n);)e(r,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*fq;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*fq;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,n=t[this.pos++];if(n<128)return n;let r=n&127,i;return i=t[this.pos++],r|=(i&127)<<7,i<128||(i=t[this.pos++],r|=(i&127)<<14,i<128)||(i=t[this.pos++],r|=(i&127)<<21,i<128)?r:(i=t[this.pos],r|=(i&15)<<28,_Be(r,e,this))}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&hBe?hBe.decode(this.buf.subarray(t,e)):yBe(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;let t=this.readVarint();return this.type=t&7,this._valueStart=this.pos,t>>>3}skip(e){let t=e&7;if(t===0)for(;this.buf[this.pos++]>127;);else if(t===2)this.pos=this.readVarint()+this.pos;else if(t===5)this.pos+=4;else if(t===1)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}};function _Be(e,t,n){let r=n.buf,i,a;if(a=r[n.pos++],i=(a&112)>>4,a<128||(a=r[n.pos++],i|=(a&127)<<3,a<128)||(a=r[n.pos++],i|=(a&127)<<10,a<128)||(a=r[n.pos++],i|=(a&127)<<17,a<128)||(a=r[n.pos++],i|=(a&127)<<24,a<128)||(a=r[n.pos++],i|=(a&1)<<31,a<128))return vBe(e,i,t);throw Error(`Expected varint not more than 10 bytes`)}function vBe(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function yBe(e,t,n){let r=``,i=t;
vendor: 9,698 bytes, line 409
409for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o>n)break;let s,c,l;o===1?t<128&&(a=t):o===2?(s=e[i+1],(s&192)==128&&(a=(t&31)<<6|s&63,a<=127&&(a=null))):o===3?(s=e[i+1],c=e[i+2],(s&192)==128&&(c&192)==128&&(a=(t&15)<<12|(s&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):o===4&&(s=e[i+1],c=e[i+2],l=e[i+3],(s&192)==128&&(c&192)==128&&(l&192)==128&&(a=(t&15)<<18|(s&63)<<12|(c&63)<<6|l&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,o=1):a>65535&&(a-=65536,r+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),r+=String.fromCharCode(a),i+=o}return r}function bBe(e,t,n){e===1&&n.readMessage(xBe,t)}function xBe(e,t,n){if(e===3){let{id:e,bitmap:r,width:i,height:a,left:o,top:s,advance:c}=n.readMessage(SBe,{});t.push({id:e,bitmap:new iK({width:i+6,height:a+6},r),metrics:{width:i,height:a,left:o,top:s,advance:c}})}}function SBe(e,t,n){e===1?t.id=n.readVarint():e===2?t.bitmap=n.readBytes():e===3?t.width=n.readVarint():e===4?t.height=n.readVarint():e===5?t.left=n.readSVarint():e===6?t.top=n.readSVarint():e===7&&(t.advance=n.readVarint())}function CBe(e){return new gBe(e).readFields(bBe,[])}function pq(e){return typeof e?.renderWithWebGL==`function`}function wBe(e){let{userImage:t}=e;return!t?.render||!t.render()?!1:(pq(t.data)||e.data.replace(new Uint8Array(t.data.buffer)),!0)}function TBe(e){let t=0,n=0;for(let r of e)t+=r.w*r.h,n=Math.max(n,r.w);e.sort((e,t)=>t.h-e.h);let r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}],i=0,a=0;for(let t of e)for(let e=r.length-1;e>=0;e--){let n=r[e];if(!(t.w>n.w||t.h>n.h)){if(t.x=n.x,t.y=n.y,a=Math.max(a,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===n.w&&t.h===n.h){let t=r.pop();t&&e<r.length&&(r[e]=t)}else t.h===n.h?(n.x+=t.w,n.w-=t.w):t.w===n.w?(n.y+=t.h,n.h-=t.h):(r.push({x:n.x+t.w,y:n.y,w:n.w-t.w,h:t.h}),n.y+=t.h,n.h-=t.h);break}}return{w:i,h:a,fill:t/(i*a)||0}}var mq=class{constructor(e,{pixelRatio:t,version:n,isWebGLImage:r=!1,stretchX:i,stretchY:a,content:o,textFitWidth:s,textFitHeight:c}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n,this.needsFirstWebGLRender=r,this.textFitWidth=s,this.textFitHeight=c}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},EBe=class{constructor(e,t){let n={},r={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let i=[];this.addImages(e,n,i),this.addImages(t,r,i);let{w:a,h:o}=TBe(i),s=new aK({width:a||1,height:o||1});for(let t in e){let r=e[t];if(r.isWebGLImage)continue;let i=n[t].paddedRect;aK.copy(r.data,s,{x:0,y:0},{x:i.x+1,y:i.y+1},r.data)}for(let e in t){let n=t[e],i=r[e].paddedRect,a=i.x+1,o=i.y+1,c=n.data.width,l=n.data.height;aK.copy(n.data,s,{x:0,y:0},{x:a,y:o},n.data),aK.copy(n.data,s,{x:0,y:l-1},{x:a,y:o-1},{width:c,height:1}),aK.copy(n.data,s,{x:0,y:0},{x:a,y:o+l},{width:c,height:1}),aK.copy(n.data,s,{x:c-1,y:0},{x:a-1,y:o},{width:1,height:l}),aK.copy(n.data,s,{x:0,y:0},{x:a+c,y:o},{width:1,height:l})}this.image=s,this.iconPositions=n,this.patternPositions=r}addImages(e,t,n){for(let r in e){let i=e[r],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(a),t[r]=new mq(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(e,t){if(e.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==e.updateVersion){this.patchedUpdateVersion=e.updateVersion;for(let n in this.iconPositions)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t);for(let n in this.patternPositions)this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)}}patchUpdatedImage(e,t,n){if(!e||!t||!e.needsFirstWebGLRender&&e.version===t.version)return;e.needsFirstWebGLRender=!1,e.version=t.version;let[r,i]=e.tl,a=t.userImage?.data;if(!pq(a)){n.update(t.data,void 0,{x:r,y:i});return}let{width:o,height:s}=t.data;n.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:n.context.gl,texture:n.texture,x:r,y:i,width:o,height:s}),n.context.setDirty()}};BU(`ImagePosition`,mq),BU(`ImageAtlas`,EBe);var DBe=function(e){return e[e.none=0]=`none`,e[e.horizontal=1]=`horizontal`,e[e.vertical=2]=`vertical`,e[e.horizontalOnly=3]=`horizontalOnly`,e}(DBe||{});function OBe(e){let t=.5,n=.5;switch(e){case`right`:case`top-right`:case`bottom-right`:t=1;break;case`left`:case`top-left`:case`bottom-left`:t=0}switch(e){case`bottom`:case`bottom-right`:case`bottom-left`:n=1;break;case`top`:case`top-right`:case`top-left`:n=0}return{horizontalAlign:t,verticalAlign:n}}var kBe=32640;function ABe(e,t){let{expression:n}=t;if(n.kind===`constant`)return{kind:`constant`,layoutSize:n.evaluate(new XU(e+1))};if(n.kind===`source`)return{kind:`source`};if(n.kind===`composite`){let{minZoom:t,maxZoom:r}=jBe(n.zoomStops,e);return{kind:`composite`,minZoom:t,maxZoom:r,interpolationType:n.interpolationType}}{let t=MBe(n),r=n.evaluate(new XU(e+1));return{kind:`camera`,zoomStops:n.zoomStops,sizes:t,layoutSize:r,interpolationType:n.interpolationType}}}function jBe(e,t){let n=0;for(;n<e.length&&e[n]<=t;)n++;n=Math.max(0,n-1);let r=n;for(;r<e.length&&e[r]<t+1;)r++;return r=Math.min(e.length-1,r),{minZoom:e[n],maxZoom:e[r]}}function MBe(e){return e.zoomStops.map(t=>e.evaluate(new XU(t===-1/0?e.zoomStops[1]-1:t)))}function hq(e,{uSize:t,uSizeT:n},{lowerSize:r,upperSize:i}){return e.kind===`source`?r/128:e.kind===`composite`?_V.number(r/128,i/128,n):t}function gq(e,t){let n=0,r=0;return e.kind===`constant`?r=e.layoutSize:e.kind===`camera`?r=NBe(e,t):e.kind===`composite`&&(n=PBe(e,t)),{uSizeT:n,uSize:r}}function NBe({zoomStops:e,sizes:t,layoutSize:n,interpolationType:r},i){let a=e.length-1;for(;a>0&&e[a]>i;)a--;let o=Math.min(a+1,e.length-1),s=r?iz(hV.interpolationFactor(r,i,e[a],e[o]),0,1):0;return Math.min(_V.number(t[a],t[o],s),n)}function PBe({interpolationType:e,minZoom:t,maxZoom:n},r){return e?iz(hV.interpolationFactor(e,r,t,n),0,1):0}function _q(e,t,n){let r=`never`,i=e.get(t);return i?r=i:e.get(n)&&(r=`always`),r}var FBe=[{name:`a_fade_opacity`,components:1,type:`Uint8`,offset:0}];function vq(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=s?Math.min(kBe,Math.round(s[0])):0,h=s?Math.min(kBe,Math.round(s[1])):0;e.emplaceBack(t,n,Math.round(r*32),Math.round(i*32),a,o,(m<<1)+ +!!c,h,l*16,u*16,d*256,f*256,p)}function yq(e,t,n){e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n)}function IBe(e){for(let t of e.sections)if(tLe(t.text))return!0;return!1}var bq=class{constructor(e){this.layoutVertexArray=new vLe,this.indexArray=new sG,this.programConfigurations=e,this.segments=new uG,this.dynamicLayoutVertexArray=new yLe,this.opacityVertexArray=new bLe,this.hasVisibleVertices=!1,this.placedSymbolArray=new JW}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,t,n,r){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,oBe.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,sBe.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,FBe,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};BU(`SymbolBuffers`,bq);var xq=class{constructor(e,t,n){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new n,this.segments=new uG,this.collisionVertexArray=new SLe}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,cBe.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};BU(`CollisionBuffers`,xq);var Sq=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ABe(this.zoom,t[`text-size`]),this.iconSizeData=ABe(this.zoom,t[`icon-size`]);let n=this.layers[0].layout,r=n.get(`symbol-sort-key`),i=n.get(`symbol-z-order`);this.canOverlap=_q(n,`text-overlap`,`text-allow-overlap`)!==`never`||_q(n,`icon-overlap`,`icon-allow-overlap`)!==`never`||n.get(`text-ignore-placement`)||n.get(`icon-ignore-placement`),this.sortFeaturesByKey=i!==`viewport-y`&&!r.isConstant();let a=i===`viewport-y`||i===`auto`&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,n.get(`symbol-placement`)===`point`&&(this.writingModes=n.get(`text-writing-mode`).map(e=>DBe[e])),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=e.sourceID}createArrays(){this.text=new bq(new PG(this.layers,this.zoom,e=>e.startsWith(`text`))),this.icon=new bq(new PG(this.layers,this.zoom,e=>e.startsWith(`icon`))),this.glyphOffsetArray=new ZW,this.lineVertexArray=new QW,this.symbolInstances=new XW,this.textAnchorOffsets=new eG}
409calculateGlyphDependencies(e,t,n,r,i){for(let a of e)if(t[a.codePointAt(0)]=!0,(n||r)&&i){let e=mBe[a];e&&(t[e.codePointAt(0)]=!0)}}populate(e,t,n){let r=this.layers[0],i=r.layout,a=i.get(`text-font`),o=i.get(`text-field`),s=i.get(`icon-image`),c=(o.value.kind!==`constant`||o.value.value instanceof KB&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&(a.value.kind!==`constant`||a.value.value.length>0),l=s.value.kind!==`constant`||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get(`symbol-sort-key`);if(this.features=[],!c&&!l)return;let d=t.iconDependencies,f=t.glyphDependencies,p=t.availableImages,m=new XU(this.zoom);for(let{feature:t,id:o,index:s,sourceLayerIndex:h}of e){let e=r._featureFilter.needGeometry,g=zG(t,e);if(!r._featureFilter.filter(m,g,n))continue;e||(g.geometry=RG(t));let _;if(c){let e=r.getValueAndResolveTokens(`text-field`,g,n,p),t=KB.factory(e);this.hasRTLText||=IBe(t),(!this.hasRTLText||YU.getRTLTextPluginStatus()===`unavailable`||this.hasRTLText&&YU.isParsed())&&(_=fBe(t,r,g))}let v;if(l){let e=r.getValueAndResolveTokens(`icon-image`,g,n,p);v=e instanceof QB?e:QB.fromString(e)}if(!_&&!v)continue;let y=this.sortFeaturesByKey?u.evaluate(g,{},n):void 0,b={id:o,text:_,icon:v,index:s,sourceLayerIndex:h,geometry:g.geometry,properties:t.properties,type:GK.types[t.type],sortKey:y};if(this.features.push(b),v&&(d[v.name]=!0),_){let e=a.evaluate(g,{},n).join(`,`),t=i.get(`text-rotation-alignment`)!==`viewport`&&i.get(`symbol-placement`)!==`point`;this.allowVerticalPlacement=this.writingModes?.includes(2);for(let n of _.sections)if(n.image)d[n.image.name]=!0;else{let r=QIe(_.toString()),i=n.fontStack||e;f[i]||={},this.calculateGlyphDependencies(n.text,f[i],t,this.allowVerticalPlacement,r)}}}i.get(`symbol-placement`)===`line`&&(this.features=pBe(this.features)),this.sortFeaturesByKey&&this.features.sort((e,t)=>
vendor: 10,073 bytes, line 409
409e.sortKey-t.sortKey)}update(e,t,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:n}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:n}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let n=this.lineVertexArray.length;if(e.segment!==void 0){let n=e.dist(t[e.segment+1]),r=e.dist(t[e.segment]),i={};for(let r=e.segment+1;r<t.length;r++)i[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:n},r<t.length-1&&(n+=t[r+1].dist(t[r]));for(let n=e.segment||0;n>=0;n--)i[n]={x:t[n].x,y:t[n].y,tileUnitDistanceFromAnchor:r},n>0&&(r+=t[n-1].dist(t[n]));for(let e=0;e<t.length;e++){let t=i[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=e.indexArray,m=e.layoutVertexArray,h=e.segments.prepareSegment(4*t.length,m,p,this.canOverlap?a.sortKey:void 0),g=this.glyphOffsetArray.length,_=h.vertexLength,v=this.allowVerticalPlacement&&o===2?Math.PI/2:0,y=a.text&&a.text.sections;for(let r=0;r<t.length;r++){let{tl:i,tr:o,bl:c,br:l,tex:u,pixelOffsetTL:g,pixelOffsetBR:_,minFontScaleX:b,minFontScaleY:x,glyphOffset:S,isSDF:C,sectionIndex:w}=t[r],T=h.vertexLength,E=S[1];vq(m,s.x,s.y,i.x,E+i.y,u.x,u.y,n,C,g.x,g.y,b,x,f),vq(m,s.x,s.y,o.x,E+o.y,u.x+u.w,u.y,n,C,_.x,g.y,b,x,f),vq(m,s.x,s.y,c.x,E+c.y,u.x,u.y+u.h,n,C,g.x,_.y,b,x,f),vq(m,s.x,s.y,l.x,E+l.y,u.x+u.w,u.y+u.h,n,C,_.x,_.y,b,x,f),yq(e.dynamicLayoutVertexArray,s,v),p.emplaceBack(T,T+2,T+1),p.emplaceBack(T+1,T+2,T+3),h.vertexLength+=4,h.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(S[0]),(r===t.length-1||w!==t[r+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(m.length,a,a.index,{imagePositions:{},canonical:d,formattedSection:y?.[w]})}e.placedSymbolArray.emplaceBack(s.x,s.y,g,this.glyphOffsetArray.length-g,_,c,l,s.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],o,0,!1,0,u,f)}_addCollisionDebugVertex(e,t,n,r,i,a){return t.emplaceBack(0,0),e.emplaceBack(n.x,n.y,r,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,n,r,i,a,o){let s=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=s.vertexLength,l=i.layoutVertexArray,u=i.collisionVertexArray,d=o.anchorX,f=o.anchorY;this._addCollisionDebugVertex(l,u,a,d,f,new K(e,t)),this._addCollisionDebugVertex(l,u,a,d,f,new K(n,t)),this._addCollisionDebugVertex(l,u,a,d,f,new K(n,r)),this._addCollisionDebugVertex(l,u,a,d,f,new K(e,r)),s.vertexLength+=4;let p=i.indexArray;p.emplaceBack(c,c+1),p.emplaceBack(c+1,c+2),p.emplaceBack(c+2,c+3),p.emplaceBack(c+3,c),s.primitiveLength+=4}addDebugCollisionBoxes(e,t,n,r){for(let i=e;i<t;i++){let e=this.collisionBoxArray.get(i),t=e.x1,a=e.y1,o=e.x2,s=e.y2;this.addCollisionDebugVertices(t,a,o,s,r?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new xq(oG,lBe.members,cG),this.iconCollisionBox=new xq(oG,lBe.members,cG);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,n,r,i,a,o,s,c){let l={};for(let r=t;r<n;r++){let t=e.get(r);l.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},l.textFeatureIndex=t.featureIndex;break}for(let t=r;t<i;t++){let n=e.get(t);l.verticalTextBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.verticalTextFeatureIndex=n.featureIndex;break}for(let t=a;t<o;t++){let n=e.get(t);l.iconBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.iconFeatureIndex=n.featureIndex;break}for(let t=s;t<c;t++){let n=e.get(t);l.verticalIconBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.verticalIconFeatureIndex=n.featureIndex;break}return l}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let n=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let n=e.placedSymbolArray.get(t),r=n.vertexStartIndex+n.numGlyphs*4;for(let t=n.vertexStartIndex;t<r;t+=4)e.indexArray.emplaceBack(t,t+2,t+1),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let t=Math.sin(e),n=Math.cos(e),r=[],i=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let o=this.symbolInstances.get(e);r.push(Math.round(t*o.anchorX+n*o.anchorY)|0),i.push(o.featureIndex)}return a.sort((e,t)=>r[e]-r[t]||i[t]-i[e]),a}addToSortKeyRanges(e,t){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n?.sortKey===t?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);let n=[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex];for(let e=0;e<n.length;e++){let t=n[e];t>=0&&n.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};BU(`SymbolBucket`,Sq,{omit:[`layers`,`collisionBoxArray`,`features`,`compareText`]}),Sq.MAX_GLYPHS=65535,Sq.addDynamicAttributes=yq;function LBe(e,t){return t.replace(/{([^{}]+)}/g,(t,n)=>e&&n in e?String(e[n]):``)}var RBe,zBe=()=>RBe||=new fW({"symbol-placement":new sW(J.layout_symbol[`symbol-placement`],`symbol-placement`),"symbol-spacing":new sW(J.layout_symbol[`symbol-spacing`],`symbol-spacing`),"symbol-avoid-edges":new sW(J.layout_symbol[`symbol-avoid-edges`],`symbol-avoid-edges`),"symbol-sort-key":new cW(J.layout_symbol[`symbol-sort-key`],`symbol-sort-key`),"symbol-z-order":new sW(J.layout_symbol[`symbol-z-order`],`symbol-z-order`),"icon-allow-overlap":new sW(J.layout_symbol[`icon-allow-overlap`],`icon-allow-overlap`),"icon-overlap":new sW(J.layout_symbol[`icon-overlap`],`icon-overlap`),"icon-ignore-placement":new sW(J.layout_symbol[`icon-ignore-placement`],`icon-ignore-placement`),"icon-optional":new sW(J.layout_symbol[`icon-optional`],`icon-optional`),"icon-rotation-alignment":new sW(J.layout_symbol[`icon-rotation-alignment`],`icon-rotation-alignment`),"icon-size":new cW(J.layout_symbol[`icon-size`],`icon-size`),"icon-text-fit":new sW(J.layout_symbol[`icon-text-fit`],`icon-text-fit`),"icon-text-fit-padding":new sW(J.layout_symbol[`icon-text-fit-padding`],`icon-text-fit-padding`),"icon-image":new cW(J.layout_symbol[`icon-image`],`icon-image`),"icon-rotate":new cW(J.layout_symbol[`icon-rotate`],`icon-rotate`),"icon-padding":new cW(J.layout_symbol[`icon-padding`],`icon-padding`),"icon-keep-upright":new sW(J.layout_symbol[`icon-keep-upright`],`icon-keep-upright`),"icon-offset":new cW(J.layout_symbol[`icon-offset`],`icon-offset`),"icon-anchor":new cW(J.layout_symbol[`icon-anchor`],`icon-anchor`),"icon-pitch-alignment":new sW(J.layout_symbol[`icon-pitch-alignment`],`icon-pitch-alignment`),"text-pitch-alignment":new sW(J.layout_symbol[`text-pitch-alignment`],`text-pitch-alignment`),"text-rotation-alignment":new sW(J.layout_symbol[`text-rotation-alignment`],`text-rotation-alignment`),"text-field":new cW(J.layout_symbol[`text-field`],`text-field`),"text-font":new cW(J.layout_symbol[`text-font`],`text-font`),"text-size":new cW(J.layout_symbol[`text-size`],`text-size`),"text-max-width":new cW(J.layout_symbol[`text-max-width`],`text-max-width`),"text-line-height":new sW(J.layout_symbol[`text-line-height`],`text-line-height`),"text-letter-spacing":new cW(J.layout_symbol[`text-letter-spacing`],`text-letter-spacing`),"text-justify":new cW(J.layout_symbol[`text-ju
409stify`],`text-justify`),"text-radial-offset":new cW(J.layout_symbol[`text-radial-offset`],`text-radial-offset`),"text-variable-anchor":new sW(J.layout_symbol[`text-variable-anchor`],`text-variable-anchor`),"text-variable-anchor-offset":new cW(J.layout_symbol[`text-variable-anchor-offset`],`text-variable-anchor-offset`),"text-anchor":new cW(J.layout_symbol[`text-anchor`],`text-anchor`),"text-max-angle":new sW(J.layout_symbol[`text-max-angle`],`text-max-angle`),"text-writing-mode":new sW(J.layout_symbol[`text-writing-mode`],`text-writing-mode`),"text-rotate":new cW(J.layout_symbol[`text-rotate`],`text-rotate`),"text-padding":new sW(J.layout_symbol[`text-padding`],`text-padding`),"text-keep-upright":new sW(J.layout_symbol[`text-keep-upright`],`text-keep-upright`),"text-transform":new cW(J.layout_symbol[`text-transform`],`text-transform`),"text-offset":new cW(J.layout_symbol[`text-offset`],`text-offset`),"text-allow-overlap":new sW(J.layout_symbol[`text-allow-overlap`],`text-allow-overlap`),"text-overlap":new sW(J.layout_symbol[`text-overlap`],`text-overlap`),"text-ignore-placement":new sW(J.layout_symbol[`text-ignore-placement`],`text-ignore-placement`),"text-optional":new sW(J.layout_symbol[`text-optional`],`text-optional`),"symbol-height-offset":new cW(J.layout_symbol[`symbol-height-offset`],`symbol-height-offset`),"symbol-height-anchor":new sW(J.layout_symbol[`symbol-height-anchor`],`symbol-height-anchor`)}),BBe,VBe=()=>BBe||=new fW({"icon-opacity":new cW(J.paint_symbol[`icon-opacity`],`icon-opacity`),"icon-color":new cW(J.paint_symbol[`icon-color`],`icon-color`),"icon-halo-color":new cW(J.paint_symbol[`icon-halo-color`],`icon-halo-color`),"icon-halo-width":new cW(J.paint_symbol[`icon-halo-width`],`icon-halo-width`),"icon-halo-blur":new cW(J.paint_symbol[`icon-halo-blur`],`icon-halo-blur`),"icon-translate":new sW(J.paint_symbol[`icon-translate`],`icon-translate`),"icon-translate-anchor":new sW(J.paint_symbol[`icon-translate-anchor`],`icon-translate-anchor`),"text-opacity":new cW(J.paint_symbol[`text-opacity`],`text-opacity`),"text-color":new cW(J.paint_symbol[`text-color`],`text-color`,{runtimeType:sB,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new cW(J.paint_symbol[`text-halo-color`],`text-halo-color`),"text-halo-width":new cW(J.paint_symbol[`text-halo-width`],`text-halo-width`),"text-halo-blur":new cW(J.paint_symbol[`text-halo-blur`],`text-halo-blur`),"text-translate":new sW(J.paint_symbol[`text-translate`],`text-translate`),"text-translate-anchor":new sW(J.paint_symbol[`text-translate-anchor`],`text-translate-anchor`)}),Cq={get paint(){return VBe()},get layout(){return zBe()}},HBe=class{constructor(e){if(e.property.overrides===void 0)throw Error(`overrides must be provided to instantiate FormatSectionOverride class`);this.type=e.property.overrides?e.property.overrides.runtimeType:iB,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t?.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let t=this.defaultValue.value;e(t._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};BU(`FormatSectionOverride`,HBe,{omit:[`defaultValue`]});var UBe=e=>e.type===`symbol`,WBe=class e extends hW{constructor(e,t){super(e,Cq,t)}recalculate(e,t){if(super.recalculate(e,t),this.layout.get(`icon-rotation-alignment`)===`auto`&&(this.layout.get(`symbol-placement`)===`point`?this.layout._values[`icon-rotation-alignment`]=`viewport`:this.layout._values[`icon-rotation-alignment`]=`map`),this.layout.get(`text-rotation-alignment`)===`auto`&&(this.layout.get(`symbol-placement`)===`point`?this.layout._values[`text-rotation-alignment`]=`viewport`:this.layout._values[`text-rotation-alignment`]=`map`),this.layout.get(`text-pitch-alignment`)===`auto`&&(this.layout._values[`text-pitch-alignment`]=this.layout.get(`text-rotation-alignment`)===`map`?`map`:`viewport`),this.layout.get(`icon-pitch-alignment`)===`auto`&&(this.layout._values[`icon-pitch-alignment`]=this.layout.get(`icon-rotation-alignment`)),this.layout.get(`symbol-placement`)===`point`){let e=this.layout.get(`text-writing-mode`);if(e){let t=[];for(let n of e)t.includes(n)||t.push(n);this.layout._values[`text-writing-mode`]=t}else this.layout._values[`text-writing-mode`]=[`horizontal`]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,n,r){let i=this.layout.get(e).evaluate(t,{},n,r),a=this._unevaluatedLayout._values[e];return!a.isDataDriven()&&!MH(a.value)&&i?LBe(t.properties,i):i}createBucket(e){return new Sq(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error(`Should take a different path in FeatureIndex`)}_setPaintOverrides(){for(let t of Cq.paint.overridableProperties){if(!e.hasPaintOverride(this.layout,t))continue;let n=this.paint.get(t),r=new kH(new HBe(n),`layers[${this.id}].paint.${n.property.name}`,n.property.specification),i=null;i=n.value.kind===`constant`||n.value.kind===`source`?new PH(`source`,r):new FH(`composite`,r,n.value.zoomStops),this.paint._values[t]=new rW(n.property,i,n.parameters)}}_handleOverridablePaintPropertyUpdate(t,n,r){return!this.layout||n.isDataDriven()||r.isDataDriven()?!1:e.hasPaintOverride(this.layout,t)}static hasPaintOverride(e,t){let n=e.get(`text-field`),r=Cq.paint.properties[t],i=!1,a=e=>{for(let t of e)if(r.overrides?.hasOverride(t)){i=!0;return}};if(n.value.kind===`constant`&&n.value.value instanceof KB)a(n.value.value.sections);else if(n.value.kind===`source`||n.value.kind===`composite`){let e=t=>{if(!i)if(t instanceof iV&&nV(t.value)===fB){let e=t.value;a(e.sections)}else t instanceof CV?a(t.sections):t.eachChild(e)},t=n.value;t._styleExpression&&e(t._styleExpression.expression)}return i}},GBe,KBe=()=>GBe||=new fW({"background-color":new sW(J.paint_background[`background-color`],`background-color`),"background-pattern":new uW(J.paint_background[`background-pattern`],`background-pattern`),"background-opacity":new sW(J.paint_background[`background-opacity`],`background-opacity`)}),qBe={get paint(){return KBe()}},JBe=e=>e.type===`background`,YBe=class extends hW{constructor(e,t){super(e,qBe,t)}};function XBe(e){let t=[],n=e.id;return n===void 0&&t.push(new Y(`layers.${n}`,null,`missing required property "id"`)),e.render===void 0&&t.push(new Y(`layers.${n}`,null,`missing required method "render"`)),e.renderingMode&&e.renderingMode!==`2d`&&e.renderingMode!==`3d`&&t.push(new Y(`layers.${n}`,null,`property "renderingMode" must be either "2d" or "3d"`)),t}var ZBe=e=>e.type===`custom`,QBe=class extends hW{constructor(e,t){super(e,{},t),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode===`3d`}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error(`Custom layers cannot be serialized`)}};function wq(e,t){if(e.type===`custom`)return new QBe(e,t);switch(e.type){case`background`:return new YBe(e,t);case`circle`:return new eRe(e,t);case`color-relief`:return new gRe(e,t);case`fill`:return new sze(e,t);case`fill-extrusion`:return new Rze(e,t);case`heatmap`:return new aRe(e,t);case`hillshade`:return new uRe(e,t);case`line`:return new iBe(e,t);case`raster`:return new cLe(e,t);case`symbol`:return new WBe(e,t)}}var $Be=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},eVe={once:!0},tVe=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new $Be(()=>this.process()),this.subscription=Cz(this.target,`message`,e=>this.receive(e),!1),this.globalScope=yz(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,t){return new Promise((n,r)=>{let i=Math.round(Math.random()*0xde0b6b3a7640000).toString(36).substring(0,10),a=t?Cz(t.signal,`abort`,()=>{a?.unsubscribe(),delete this.resolveRejects[i];let n={id:i,type:`<cancel>`,origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(n),r(new Nz(t.signal.reason))},eVe):null;this.resolveRejects[i]={resolve:e=>{a?.unsubscribe(),n(e)},reject:e=>{a?.unsubscribe(),r(e)}};let o=[],s={...e,id:i,sourceMapId:this.mapId,origin:location.origin,data:WU(e.data,o)};this.target.postMessage(s,{transfer:o})})}receive(e){let t=e.data,n=t.id,r=[`file://`,`resource://android`,`null`],i=[t.origin,location.origin],a=t.origin===location.origin,o=i.some(e=>r.includes(e));if(!(!a&&!o)&&!(t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type===`<cancel>`){delete this.tasks[n];let e=this.abortControllers[n];delete this.abortControllers[n],e&&e.abort();return}if(yz(self)||t.mustQueue){this.tasks[n]=t,this.taskQueue.push(n),this.invoker.trigger();return}this.processTask(n,t)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}async processTask(e,t){if(t.type===`<response>`){let n=this.resolveRejects[e];if(delete this.resolveRejects[e],!n)return;t.error?n.reject(VR(GU(t.error))):n.resolve(GU(t.data));return}if(!this.messageHandlers[t.type]){this.completeTask(e,null,null);return}let n=GU(t.data),r=new AbortController;this.abortControllers[e]=r;try{let i=await this.messageHandlers[t.type](t.sourceMapId,n,r);this.completeTask(e,null,i)}catch(t){this.completeTask(e,VR(t))}}completeTask(e,t,n){let r=[];delete this.abortControllers[e];let i={id:e,type:`<response>`,sourceMapId:this.mapId,origin:location.origin,error:t?WU(t):null,data:WU(n,r)};this.target.postMessage(i,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function nVe(e,t,n){return!(e<0||e>25||n<0||n>=2**e||t<0||t>=2**e)}function rVe(e,t){let{x:n,y:r}=$K.fromLngLat(t);return!(e<0||e>25||r<0||r>=1||n<0||n>=1)}var Tq=class{constructor(e,t,n){if(!nVe(e,t,n))throw Error(`x=${t}, y=${n}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=t,this.y=n,this.key=Oq(0,e,e,t,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,n){let r=iVe(this.x,this.y,this.z),i=oVe(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}
vendor: 5,833 bytes, line 409
409/g,String(n===`tms`?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,t>1?`@2x`:``).replace(/{quadkey}/g,i).replace(/{bbox-epsg-3857}/g,r)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=2**this.z;return new K((e.x*t-this.x)*q,(e.y*t-this.y)*q)}toString(){return`${this.z}/${this.x}/${this.y}`}},Eq=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=Oq(e,t.z,t.z,t.x,t.y)}},Dq=class e{constructor(e,t,n,r,i){if(this.terrainRttPosMatrix32f=null,e<n)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=t,this.canonical=new Tq(n,+r,+i),this.key=Oq(t,e,n,r,i)}clone(){return new e(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(t){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let n=this.canonical.z-t;return t>this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>n,this.canonical.y>>n)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,t){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let n=this.canonical.z-e;return e>this.canonical.z?Oq(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Oq(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let t=this.canonical.z-e.canonical.z;return t<0?!1:e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let n=this.canonical.z+1,r=this.canonical.x*2,i=this.canonical.y*2;return[new e(n,this.wrap,n,r,i),new e(n,this.wrap,n,r+1,i),new e(n,this.wrap,n,r,i+1),new e(n,this.wrap,n,r+1,i+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new e(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new e(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Eq(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new $K(e.x-this.wrap,e.y))}normalizeCoordinates(t,n,r=q){if(t>=0&&t<r&&n>=0&&n<r)return{tileID:this,x:t,y:n};let i=Math.floor(t/r),a=Math.floor(n/r),o=t-i*r,s=n-a*r,c=this.canonical.z,l=1<<c,u=this.canonical.y+a;if(u<0||u>=l)return null;let d=this.canonical.x+i,f=this.wrap;return d<0?(f-=Math.ceil(-d/l),d=(d%l+l)%l):d>=l&&(f+=Math.floor(d/l),d%=l),{tileID:new e(this.overscaledZ,f,c,d,u),x:o,y:s}}};function Oq(e,t,n,r,i){e*=2,e<0&&(e=e*-1-1);let a=1<<n;return(a*a*e+a*i+r).toString(36)+n.toString(36)+t.toString(36)}var kq=Math.PI*6378137;function iVe(e,t,n){t=2**n-t-1;let r=aVe(e*256,t*256,n),i=aVe((e+1)*256,(t+1)*256,n);return`${r[0]},${r[1]},${i[0]},${i[1]}`}function aVe(e,t,n){let r=2*kq/256/2**n;return[e*r-kq,t*r-kq]}function oVe(e,t,n){let r=``;for(let i=e;i>0;i--){let e=1<<i-1;r+=(t&e?1:0)+(n&e?2:0)}return r}function sVe(e,t){let n=Math.abs(e.wrap*2)-+(e.wrap<0),r=Math.abs(t.wrap*2)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}BU(`CanonicalTileID`,Tq),BU(`OverscaledTileID`,Dq,{omit:[`terrainRttPosMatrix32f`]});var Aq=`_geojsonTileLayer`,cVe=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let n=e[t];this._stringToNumber[n]=t,this._numberToString[t]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},lVe=class{constructor(e,t,n,r,i){this.type=`Feature`,this._vectorTileFeature=e,this._x=n,this._y=r,this._z=t;for(let t in e.properties)typeof e.properties[t]!=`string`||!e.properties[t].startsWith(`__$json__:`)||(e.properties[t]=JSON.parse(e.properties[t].slice(10)));this.properties=e.properties,this.id=i}projectPoint(e,t,n,r){return[(e.x+t)*360/r-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+n)*2/r)*Math.PI))-90]}projectLine(e,t,n,r){return e.map(e=>this.projectPoint(e,t,n,r))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,t=e.extent*2**this._z,n=e.extent*this._x,r=e.extent*this._y,i=e.loadGeometry();switch(e.type){case 1:{let e=[];for(let t of i)e.push(t[0]);let a=this.projectLine(e,n,r,t);this._geometry=e.length===1?{type:`Point`,coordinates:a[0]}:{type:`MultiPoint`,coordinates:a};break}case 2:{let e=i.map(e=>this.projectLine(e,n,r,t));this._geometry=e.length===1?{type:`LineString`,coordinates:e[0]}:{type:`MultiLineString`,coordinates:e};break}case 3:{let e=fze(i),a=[];for(let i of e)a.push(i.map(e=>this.projectLine(e,n,r,t)));this._geometry=a.length===1?{type:`Polygon`,coordinates:a[0]}:{type:`MultiPolygon`,coordinates:a};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)t!==`_geometry`&&t!==`_vectorTileFeature`&&t!==`_x`&&t!==`_y`&&t!==`_z`&&(e[t]=this[t]);return e}},jq=class{constructor(e,t,n){this._name=e,this.dataBuffer=t,typeof n==`
409number`?this._size=n:(this.nullabilityBuffer=n,this._size=n.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Mq=class extends jq{},Nq=class extends Mq{getValueFromBuffer(e){return this.dataBuffer[e]}},Pq=class extends Mq{getValueFromBuffer(e){return this.dataBuffer[e]}},uVe=class extends jq{constructor(e,t,n,r){super(e,t,r),this.delta=n}},Fq=class extends uVe{constructor(e,t,n,r,i){super(e,i?Int32Array.of(t):Uint32Array.of(t),n,r)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},Iq=class extends jq{constructor(e,t,n,r){super(e,r?Int32Array.of(t):Uint32Array.of(t),n)}getValueFromBuffer(e){return this.dataBuffer[0]}},dVe=class{constructor(e,t,n,r,i=4096){if(this._name=e,this._geometryVector=t,this._idVector=n,this._propertyVectors=r,this._extent=i,e.length===0)throw Error(`Missing layer name`)}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}getPropertyVector(e){return this.propertyVectorsMap||=new Map(this.propertyVectors.map(e=>[e.name,e])),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],t=this.geometryVector.getGeometries();for(let n=0;n<this.numFeatures;n++){let r;if(this.idVector){let e=this.idVector.getValue(n);e!==null&&(r=this.containsMaxSafeIntegerValues(this.idVector)?Number(e):e)}let i={coordinates:t[n],type:this.geometryVector.geometryType(n)},a={};for(let e of this.propertyVectors){if(!e)continue;let t=e.name,r=e.getValue(n);r!==null&&(a[t]=r)}e.push({id:r,geometry:i,properties:a})}return e}containsMaxSafeIntegerValues(e){return e instanceof Nq||e instanceof Iq||e instanceof Fq||e instanceof Pq}},Lq={FEATURE:0,VERTEX:1},Rq={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},zq={GEOMETRY:0,STRUCT:1,MAP:2},fVe={ID:0},pVe=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}},Bq;(function(e){e.NONE=`NONE`,e.DELTA=`DELTA`,e.COMPONENTWISE_DELTA=`COMPONENTWISE_DELTA`,e.RLE=`RLE`,e.MORTON=`MORTON`,e.PDE=`PDE`})(Bq||={});var Vq;(function(e){e.NONE=`NONE`,e.FAST_PFOR=`FAST_PFOR`,e.VARINT=`VARINT`})(Vq||={});var Hq=new Uint32Array(33);Hq[0]=0;for(let e=1;e<=32;e++)Hq[e]=e===32?4294967295:4294967295>>>32-e;var Uq=Hq,mVe=65536;function Wq(e,t){return e-e%t}function hVe(e){return Wq(e+31,32)}function gVe(e){if(!Number.isFinite(e)||e<=0)return mVe;let t=Wq(Math.floor(e),256);return t===0?256:t}function _Ve(e){let t=e>>>0;return((t&255)<<24|(t&65280)<<8|t>>>8&65280|t>>>24&255)>>>0}function vVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0;n[i++]=a>>>0&3,n[i++]=a>>>2&3,n[i++]=a>>>4&3,n[i++]=a>>>6&3,n[i++]=a>>>8&3,n[i++]=a>>>10&3,n[i++]=a>>>12&3,n[i++]=a>>>14&3,n[i++]=a>>>16&3,n[i++]=a>>>18&3,n[i++]=a>>>20&3,n[i++]=a>>>22&3,n[i++]=a>>>24&3,n[i++]=a>>>26&3,n[i++]=a>>>28&3,n[i++]=a>>>30&3,n[i++]=o>>>0&3,n[i++]=o>>>2&3,n[i++]=o>>>4&3,n[i++]=o>>>6&3,n[i++]=o>>>8&3,n[i++]=o>>>10&3,n[i++]=o>>>12&3,n[i++]=o>>>14&3,n[i++]=o>>>16&3,n[i++]=o>>>18&3,n[i++]=o>>>20&3,n[i++]=o>>>22&3,n[i++]=o>>>24&3,n[i++]=o>>>26&3,n[i++]=o>>>28&3,n[i]=o>>>30&3}function yVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0;n[i++]=a>>>0&7,n[i++]=a>>>3&7,n[i++]=a>>>6&7,n[i++]=a>>>9&7,n[i++]=a>>>12&7,n[i++]=a>>>15&7,n[i++]=a>>>18&7,n[i++]=a>>>21&7,n[i++]=a>>>24&7,n[i++]=a>>>27&7,n[i++]=(a>>>30|(o&1)<<2)&7,n[i++]=o>>>1&7,n[i++]=o>>>4&7,n[i++]=o>>>7&7,n[i++]=o>>>10&7,n[i++]=o>>>13&7,n[i++]=o>>>16&7,n[i++]=o>>>19&7,n[i++]=o>>>22&7,n[i++]=o>>>25&7,n[i++]=o>>>28&7,n[i++]=(o>>>31|(s&3)<<1)&7,n[i++]=s>>>2&7,n[i++]=s>>>5&7,n[i++]=s>>>8&7,n[i++]=s>>>11&7,n[i++]=s>>>14&7,n[i++]=s>>>17&7,n[i++]=s>>>20&7,n[i++]=s>>>23&7,n[i++]=s>>>26&7,n[i]=s>>>29&7}function bVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0;n[i++]=a>>>0&15,n[i++]=a>>>4&15,n[i++]=a>>>8&15,n[i++]=a>>>12&15,n[i++]=a>>>16&15,n[i++]=a>>>20&15,n[i++]=a>>>24&15,n[i++]=a>>>28&15,n[i++]=o>>>0&15,n[i++]=o>>>4&15,n[i++]=o>>>8&15,n[i++]=o>>>12&15,n[i++]=o>>>16&15,n[i++]=o>>>20&15,n[i++]=o>>>24&15,n[i++]=o>>>28&15,n[i++]=s>>>0&15,n[i++]=s>>>4&15,n[i++]=s>>>8&15,n[i++]=s>>>12&15,n[i++]=s>>>16&15,n[i++]=s>>>20&15,n[i++]=s>>>24&15,n[i++]=s>>>28&15,n[i++]=c>>>0&15,n[i++]=c>>>4&15,n[i++]=c>>>8&15,n[i++]=c>>>12&15,n[i++]=c>>>16&15,n[i++]=c>>>20&15,n[i++]=c>>>24&15,n[i]=c>>>28&15}function xVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0;n[i++]=a>>>0&31,n[i++]=a>>>5&31,n[i++]=a>>>10&31,n[i++]=a>>>15&31,n[i++]=a>>>20&31,n[i++]=a>>>25&31,n[i++]=(a>>>30|(o&7)<<2)&31,n[i++]=o>>>3&31,n[i++]=o>>>8&31,n[i++]=o>>>13&31,n[i++]=o>>>18&31,n[i++]=o>>>23&31,n[i++]=(o>>>28|(s&1)<<4)&31,n[i++]=s>>>1&31,n[i++]=s>>>6&31,n[i++]=s>>>11&31,n[i++]=s>>>16&31,n[i++]=s>>>21&31,n[i++]=s>>>26&31,n[i++]=(s>>>31|(c&15)<<1)&31,n[i++]=c>>>4&31,n[i++]=c>>>9&31,n[i++]=c>>>14&31,n[i++]=c>>>19&31,n[i++]=c>>>24&31,n[i++]=(c>>>29|(l&3)<<3)&31,n[i++]=l>>>2&31,n[i++]=l>>>7&31,n[i++]=l>>>12&31,n[i++]=l>>>17&31,n[i++]=l>>>22&31,n[i]=l>>>27&31}function SVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0;n[i++]=a>>>0&63,n[i++]=a>>>6&63,n[i++]=a>>>12&63,n[i++]=a>>>18&63,n[i++]=a>>>24&63,n[i++]=(a>>>30|(o&15)<<2)&63,n[i++]=o>>>4&63,n[i++]=o>>>10&63,n[i++]=o>>>16&63,n[i++]=o>>>22&63,n[i++]=(o>>>28|(s&3)<<4)&63,n[i++]=s>>>2&63,n[i++]=s>>>8&63,n[i++]=s>>>14&63,n[i++]=s>>>20&63,n[i++]=s>>>26&63,n[i++]=c>>>0&63,n[i++]=c>>>6&63,n[i++]=c>>>12&63,n[i++]=c>>>18&63,n[i++]=c>>>24&63,n[i++]=(c>>>30|(l&15)<<2)&63,n[i++]=l>>>4&63,n[i++]=l>>>10&63,n[i++]=l>>>16&63,n[i++]=l>>>22&63,n[i++]=(l>>>28|(u&3)<<4)&63,n[i++]=u>>>2&63,n[i++]=u>>>8&63,n[i++]=u>>>14&63,n[i++]=u>>>20&63,n[i]=u>>>26&63}function CVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0;n[i++]=a>>>0&127,n[i++]=a>>>7&127,n[i++]=a>>>14&127,n[i++]=a>>>21&127,n[i++]=(a>>>28|(o&7)<<4)&127,n[i++]=o>>>3&127,n[i++]=o>>>10&127,n[i++]=o>>>17&127,n[i++]=o>>>24&127,n[i++]=(o>>>31|(s&63)<<1)&127,n[i++]=s>>>6&127,n[i++]=s>>>13&127,n[i++]=s>>>20&127,n[i++]=(s>>>27|(c&3)<<5)&127,n[i++]=c>>>2&127,n[i++]=c>>>9&127,n[i++]=c>>>16&127,n[i++]=c>>>23&127,n[i++]=(c>>>30|(l&31)<<2)&127,n[i++]=l>>>5&127,n[i++]=l>>>12&127,n[i++]=l>>>19&127,n[i++]=(l>>>26|(u&1)<<6)&127,n[i++]=u>>>1&127,n[i++]=u>>>8&127,n[i++]=u>>>15&127,n[i++]=u>>>22&127,n[i++]=(u>>>29|(d&15)<<3)&127,n[i++]=d>>>4&127,n[i++]=d>>>11&127,n[i++]=d>>>18&127,n[i]=d>>>25&127}function wVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0;n[i++]=a>>>0&255,n[i++]=a>>>8&255,n[i++]=a>>>16&255,n[i++]=a>>>24&255,n[i++]=o>>>0&255,n[i++]=o>>>8&255,n[i++]=o>>>16&255,n[i++]=o>>>24&255,n[i++]=s>>>0&255,n[i++]=s>>>8&255,n[i++]=s>>>16&255,n[i++]=s>>>24&255,n[i++]=c>>>0&255,n[i++]=c>>>8&255,n[i++]=c>>>16&255,n[i++]=c>>>24&255,n[i++]=l>>>0&255,n[i++]=l>>>8&255,n[i++]=l>>>16&255,n[i++]=l>>>24&255,n[i++]=u>>>0&255,n[i++]=u>>>8&255,n[i++]=u>>>16&255,n[i++]=u>>>24&255,n[i++]=d>>>0&255,n[i++]=d>>>8&255,n[i++]=d>>>16&255,n[i++]=d>>>24&255,n[i++]=f>>>0&255,n[i++]=f>>>8&255,n[i++]=f>>>16&255,n[i]=f>>>24&255}function TVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0;n[i++]=a>>>0&511,n[i++]=a>>>9&511,n[i++]=a>>>18&511,n[i++]=(a>>>27|(o&15)<<5)&511,n[i++]=o>>>4&511,n[i++]=o>>>13&511,n[i++]=o>>>22&511,n[i++]=(o>>>31|(s&255)<<1)&511,n[i++]=s>>>8&511,n[i++]=s>>>17&511,n[i++]=(s>>>26|(c&7)<<6)&511,n[i++]=c>>>3&511,n[i++]=c>>>12&511,n[i++]=c>>>21&511,n[i++]=(c>>>30|(l&127)<<2)&511,n[i++]=l>>>7&511,n[i++]=l>>>16&511,n[i++]=(l>>>25|(u&3)<<7)&511,n[i++]=u>>>2&511,n[i++]=u>>>11&511,n[i++]=u>>>20&511,n[i++]=(u>>>29|(d&63)<<3)&511,n[i++]=d>>>6&511,n[i++]=d>>>15&511,n[i++]=(d>>>24|(f&1)<<8)&511,n[i++]=f>>>1&511,n[i++]=f>>>10&511,n[i++]=f>>>19&511,n[i++]=(f>>>28|(p&31)<<4)&511,n[i++]=p>>>5&511,n[i++]=p>>>14&511,n[i]=p>>>23&511}
vendor: 55,920 bytes, line 409
409function EVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0,m=e[t+9]>>>0;n[i++]=a>>>0&1023,n[i++]=a>>>10&1023,n[i++]=a>>>20&1023,n[i++]=(a>>>30|(o&255)<<2)&1023,n[i++]=o>>>8&1023,n[i++]=o>>>18&1023,n[i++]=(o>>>28|(s&63)<<4)&1023,n[i++]=s>>>6&1023,n[i++]=s>>>16&1023,n[i++]=(s>>>26|(c&15)<<6)&1023,n[i++]=c>>>4&1023,n[i++]=c>>>14&1023,n[i++]=(c>>>24|(l&3)<<8)&1023,n[i++]=l>>>2&1023,n[i++]=l>>>12&1023,n[i++]=l>>>22&1023,n[i++]=u>>>0&1023,n[i++]=u>>>10&1023,n[i++]=u>>>20&1023,n[i++]=(u>>>30|(d&255)<<2)&1023,n[i++]=d>>>8&1023,n[i++]=d>>>18&1023,n[i++]=(d>>>28|(f&63)<<4)&1023,n[i++]=f>>>6&1023,n[i++]=f>>>16&1023,n[i++]=(f>>>26|(p&15)<<6)&1023,n[i++]=p>>>4&1023,n[i++]=p>>>14&1023,n[i++]=(p>>>24|(m&3)<<8)&1023,n[i++]=m>>>2&1023,n[i++]=m>>>12&1023,n[i]=m>>>22&1023}function DVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0,m=e[t+9]>>>0,h=e[t+10]>>>0;n[i++]=a>>>0&2047,n[i++]=a>>>11&2047,n[i++]=(a>>>22|(o&1)<<10)&2047,n[i++]=o>>>1&2047,n[i++]=o>>>12&2047,n[i++]=(o>>>23|(s&3)<<9)&2047,n[i++]=s>>>2&2047,n[i++]=s>>>13&2047,n[i++]=(s>>>24|(c&7)<<8)&2047,n[i++]=c>>>3&2047,n[i++]=c>>>14&2047,n[i++]=(c>>>25|(l&15)<<7)&2047,n[i++]=l>>>4&2047,n[i++]=l>>>15&2047,n[i++]=(l>>>26|(u&31)<<6)&2047,n[i++]=u>>>5&2047,n[i++]=u>>>16&2047,n[i++]=(u>>>27|(d&63)<<5)&2047,n[i++]=d>>>6&2047,n[i++]=d>>>17&2047,n[i++]=(d>>>28|(f&127)<<4)&2047,n[i++]=f>>>7&2047,n[i++]=f>>>18&2047,n[i++]=(f>>>29|(p&255)<<3)&2047,n[i++]=p>>>8&2047,n[i++]=p>>>19&2047,n[i++]=(p>>>30|(m&511)<<2)&2047,n[i++]=m>>>9&2047,n[i++]=m>>>20&2047,n[i++]=(m>>>31|(h&1023)<<1)&2047,n[i++]=h>>>10&2047,n[i]=h>>>21&2047}function OVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0,m=e[t+9]>>>0,h=e[t+10]>>>0,g=e[t+11]>>>0;n[i++]=a>>>0&4095,n[i++]=a>>>12&4095,n[i++]=(a>>>24|(o&15)<<8)&4095,n[i++]=o>>>4&4095,n[i++]=o>>>16&4095,n[i++]=(o>>>28|(s&255)<<4)&4095,n[i++]=s>>>8&4095,n[i++]=s>>>20&4095,n[i++]=c>>>0&4095,n[i++]=c>>>12&4095,n[i++]=(c>>>24|(l&15)<<8)&4095,n[i++]=l>>>4&4095,n[i++]=l>>>16&4095,n[i++]=(l>>>28|(u&255)<<4)&4095,n[i++]=u>>>8&4095,n[i++]=u>>>20&4095,n[i++]=d>>>0&4095,n[i++]=d>>>12&4095,n[i++]=(d>>>24|(f&15)<<8)&4095,n[i++]=f>>>4&4095,n[i++]=f>>>16&4095,n[i++]=(f>>>28|(p&255)<<4)&4095,n[i++]=p>>>8&4095,n[i++]=p>>>20&4095,n[i++]=m>>>0&4095,n[i++]=m>>>12&4095,n[i++]=(m>>>24|(h&15)<<8)&4095,n[i++]=h>>>4&4095,n[i++]=h>>>16&4095,n[i++]=(h>>>28|(g&255)<<4)&4095,n[i++]=g>>>8&4095,n[i]=g>>>20&4095}function kVe(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0,m=e[t+9]>>>0,h=e[t+10]>>>0,g=e[t+11]>>>0,_=e[t+12]>>>0,v=e[t+13]>>>0,y=e[t+14]>>>0,b=e[t+15]>>>0;n[i++]=a>>>0&65535,n[i++]=a>>>16&65535,n[i++]=o>>>0&65535,n[i++]=o>>>16&65535,n[i++]=s>>>0&65535,n[i++]=s>>>16&65535,n[i++]=c>>>0&65535,n[i++]=c>>>16&65535,n[i++]=l>>>0&65535,n[i++]=l>>>16&65535,n[i++]=u>>>0&65535,n[i++]=u>>>16&65535,n[i++]=d>>>0&65535,n[i++]=d>>>16&65535,n[i++]=f>>>0&65535,n[i++]=f>>>16&65535,n[i++]=p>>>0&65535,n[i++]=p>>>16&65535,n[i++]=m>>>0&65535,n[i++]=m>>>16&65535,n[i++]=h>>>0&65535,n[i++]=h>>>16&65535,n[i++]=g>>>0&65535,n[i++]=g>>>16&65535,n[i++]=_>>>0&65535,n[i++]=_>>>16&65535,n[i++]=v>>>0&65535,n[i++]=v>>>16&65535,n[i++]=y>>>0&65535,n[i++]=y>>>16&65535,n[i++]=b>>>0&65535,n[i]=b>>>16&65535}function AVe(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0;n[i++]=t>>>0&1,n[i++]=t>>>1&1,n[i++]=t>>>2&1,n[i++]=t>>>3&1,n[i++]=t>>>4&1,n[i++]=t>>>5&1,n[i++]=t>>>6&1,n[i++]=t>>>7&1,n[i++]=t>>>8&1,n[i++]=t>>>9&1,n[i++]=t>>>10&1,n[i++]=t>>>11&1,n[i++]=t>>>12&1,n[i++]=t>>>13&1,n[i++]=t>>>14&1,n[i++]=t>>>15&1,n[i++]=t>>>16&1,n[i++]=t>>>17&1,n[i++]=t>>>18&1,n[i++]=t>>>19&1,n[i++]=t>>>20&1,n[i++]=t>>>21&1,n[i++]=t>>>22&1,n[i++]=t>>>23&1,n[i++]=t>>>24&1,n[i++]=t>>>25&1,n[i++]=t>>>26&1,n[i++]=t>>>27&1,n[i++]=t>>>28&1,n[i++]=t>>>29&1,n[i++]=t>>>30&1,n[i++]=t>>>31&1}}function jVe(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0;n[i++]=t>>>0&3,n[i++]=t>>>2&3,n[i++]=t>>>4&3,n[i++]=t>>>6&3,n[i++]=t>>>8&3,n[i++]=t>>>10&3,n[i++]=t>>>12&3,n[i++]=t>>>14&3,n[i++]=t>>>16&3,n[i++]=t>>>18&3,n[i++]=t>>>20&3,n[i++]=t>>>22&3,n[i++]=t>>>24&3,n[i++]=t>>>26&3,n[i++]=t>>>28&3,n[i++]=t>>>30&3,n[i++]=r>>>0&3,n[i++]=r>>>2&3,n[i++]=r>>>4&3,n[i++]=r>>>6&3,n[i++]=r>>>8&3,n[i++]=r>>>10&3,n[i++]=r>>>12&3,n[i++]=r>>>14&3,n[i++]=r>>>16&3,n[i++]=r>>>18&3,n[i++]=r>>>20&3,n[i++]=r>>>22&3,n[i++]=r>>>24&3,n[i++]=r>>>26&3,n[i++]=r>>>28&3,n[i++]=r>>>30&3}}function MVe(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0;n[i++]=t>>>0&7,n[i++]=t>>>3&7,n[i++]=t>>>6&7,n[i++]=t>>>9&7,n[i++]=t>>>12&7,n[i++]=t>>>15&7,n[i++]=t>>>18&7,n[i++]=t>>>21&7,n[i++]=t>>>24&7,n[i++]=t>>>27&7,n[i++]=(t>>>30|(r&1)<<2)&7,n[i++]=r>>>1&7,n[i++]=r>>>4&7,n[i++]=r>>>7&7,n[i++]=r>>>10&7,n[i++]=r>>>13&7,n[i++]=r>>>16&7,n[i++]=r>>>19&7,n[i++]=r>>>22&7,n[i++]=r>>>25&7,n[i++]=r>>>28&7,n[i++]=(r>>>31|(o&3)<<1)&7,n[i++]=o>>>2&7,n[i++]=o>>>5&7,n[i++]=o>>>8&7,n[i++]=o>>>11&7,n[i++]=o>>>14&7,n[i++]=o>>>17&7,n[i++]=o>>>20&7,n[i++]=o>>>23&7,n[i++]=o>>>26&7,n[i++]=o>>>29&7}}function NVe(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0;n[i++]=t>>>0&15,n[i++]=t>>>4&15,n[i++]=t>>>8&15,n[i++]=t>>>12&15,n[i++]=t>>>16&15,n[i++]=t>>>20&15,n[i++]=t>>>24&15,n[i++]=t>>>28&15,n[i++]=r>>>0&15,n[i++]=r>>>4&15,n[i++]=r>>>8&15,n[i++]=r>>>12&15,n[i++]=r>>>16&15,n[i++]=r>>>20&15,n[i++]=r>>>24&15,n[i++]=r>>>28&15,n[i++]=o>>>0&15,n[i++]=o>>>4&15,n[i++]=o>>>8&15,n[i++]=o>>>12&15,n[i++]=o>>>16&15,n[i++]=o>>>20&15,n[i++]=o>>>24&15,n[i++]=o>>>28&15,n[i++]=s>>>0&15,n[i++]=s>>>4&15,n[i++]=s>>>8&15,n[i++]=s>>>12&15,n[i++]=s>>>16&15,n[i++]=s>>>20&15,n[i++]=s>>>24&15,n[i++]=s>>>28&15}}function PVe(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,c=e[a++]>>>0;n[i++]=t>>>0&31,n[i++]=t>>>5&31,n[i++]=t>>>10&31,n[i++]=t>>>15&31,n[i++]=t>>>20&31,n[i++]=t>>>25&31,n[i++]=(t>>>30|(r&7)<<2)&31,n[i++]=r>>>3&31,n[i++]=r>>>8&31,n[i++]=r>>>13&31,n[i++]=r>>>18&31,n[i++]=r>>>23&31,n[i++]=(r>>>28|(o&1)<<4)&31,n[i++]=o>>>1&31,n[i++]=o>>>6&31,n[i++]=o>>>11&31,n[i++]=o>>>16&31,n[i++]=o>>>21&31,n[i++]=o>>>26&31,n[i++]=(o>>>31|(s&15)<<1)&31,n[i++]=s>>>4&31,n[i++]=s>>>9&31,n[i++]=s>>>14&31,n[i++]=s>>>19&31,n[i++]=s>>>24&31,n[i++]=(s>>>29|(c&3)<<3)&31,n[i++]=c>>>2&31,n[i++]=c>>>7&31,n[i++]=c>>>12&31,n[i++]=c>>>17&31,n[i++]=c>>>22&31,n[i++]=c>>>27&31}}function FVe(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,c=e[a++]>>>0,l=e[a++]>>>0;n[i++]=t>>>0&63,n[i++]=t>>>6&63,n[i++]=t>>>12&63,n[i++]=t>>>18&63,n[i++]=t>>>24&63,n[i++]=(t>>>30|(r&15)<<2)&63,n[i++]=r>>>4&63,n[i++]=r>>>10&63,n[i++]=r>>>16&63,n[i++]=r>>>22&63,n[i++]=(r>>>28|(o&3)<<4)&63,n[i++]=o>>>2&63,n[i++]=o>>>8&63,n[i++]=o>>>14&63,n[i++]=o>>>20&63,n[i++]=o>>>26&63,n[i++]=s>>>0&63,n[i++]=s>>>6&63,n[i++]=s>>>12&63,n[i++]=s>>>18&63,n[i++]=s>>>24&63,n[i++]=(s>>>30|(c&15)<<2)&63,n[i++]=c>>>4&63,n[i++]=c>>>10&63,n[i++]=c>>>16&63,n[i++]=c>>>22&63,n[i++]=(c>>>28|(l&3)<<4)&63,n[i++]=l>>>2&63,n[i++]=l>>>8&63,n[i++]=l>>>14&63,n[i++]=l>>>20&63,n[i++]=l>>>26&63}}function IVe(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,c=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0;n[i++]=t>>>0&127,n[i++]=t>>>7&127,n[i++]=t>>>14&127,n[i++]=t>>>21&127,n[i++]=(t>>>28|(r&7)<<4)&127,n[i++]=r>>>3&127,n[i++]=r>>>10&127,n[i++]=r>>>17&127,n[i++]=r>>>24&127,n[i++]=(r>>>31|(o&63)<<1)&127,n[i++]=o>>>6&127,n[i++]=o>>>13&127,n[i++]=o>>>20&127,n[i++]=(o>>>27|(s&3)<<5)&127,n[i++]=s>>>2&127,n[i++]=s>>>9&127,n[i++]=s>>>16&127,n[i++]=s>>>23&127,n[i++]=(s>>>30|(c&31)<<2)&127,n[i++]=c>>>5&127,n[i++]=c>>>12&127,n[i++]=c>>>19&127,n[i++]=(c>>>26|(l&1)<<6)&127,n[i++]=l>>>1&127,n[i++]=l>>>8&127,n[i++]=l>>>15&127,n[i++]=l>>>22&127,n[i++]=(l>>>29|(u&15)<<3)&127,n[i++]=u>>>4&127,n[i++]=u>>>11&127,n[i++]=u>>>18&127,n[i++]=u>>>25&127}}function LVe(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,c=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,d=e[a++]>>>0;n[i++]=t>>>0&255,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=r>>>0&255,n[i++]=r>>>8&255,n[i++]=r>>>16&255,n[i++]=r>>>24&255,n[i++]=o>>>0&255,n[i++]=o>>>8&255,n[i++]=o>>>16&255,n[i++]=o>>>24&255,n[i++]=s>>>0&255,n[i++]=s>>>8&255,n[i++]=s>>>16&255,n[i++]=s>>>24&255,n[i++]=c>>>0&255,n[i++]=c>>>8&255,n[i++]=c>>>16&255,n[i++]=c>>>24&255,n[i++]=l>>>0&255,n[i++]=l>>>8&255,n[i++]=l>>>16&255,n[i++]=l>>>24&255,n[i++]=u>>>0&255,n[i++]=u>>>8&255,n[i++]=u>>>16&255,n[i++]=u>>>24&255,n[i++]=d>>>0&255,n[i++]=d>>>8&255,n[i++]=d>>>16&255,n[i++]=d>>>24&255}}function RVe(e,t,n,r){let i=r,a=t;for(let t=0;t<128;t++){let t=e[a++]>>>0;n[i++]=t&65535,n[i++]=t>>>16&65535}}function zVe(e,t,n,r,i){let a=Uq[i]>>>0,o=t,s=0,c=e[o]>>>0,l=r;for(let t=0;t<8;t++){for(let t=0;t<32;t++)if(s+i<=32){let r=c>>>s&a;n[l+t]=r|0,s+=i,s===32&&(s=0,o++,t!==31&&(c=e[o]>>>0))}else{let r=32-s,u=c>>>s;o++,c=e[o]>>>0;let d=i-r,f=-1>>>32-d>>>0,p=(u|(c&f)<<r)&a;n[l+t]=p|0,s=d}l+=32,s=0,t<7&&(c=e[o]>>>0)}}var Gq=gVe(mVe),BVe=3*Gq/256+Gq|0;function VVe(){let e=new Uint8Array(BVe);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function HVe(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);let t=Math.max(16,e|0);return{encodedWords:new Uint32Array(t),decoderWorkspace:VVe()}}function UVe(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let n=new Uint32Array(Math.max(16,t*2));return e.encodedWords=n,n}function WVe(e,t,n,r){r.byteContainer.length<n&&(r.byteContainer=new Uint8Array(n*2),r.byteContainerI32=void 0);let i=r.byteContainer,a=n>>>2;if(i.byteOffset&3)for(let n=0;n<a;n=n+1|0){let r=e[t+n|0]|0,a=n<<2;i[a]=r&255,i[a+1|0]=r>>>8&255,i[a+2|0]=r>>>16&255,i[a+3|0]=r>>>24&255}else{let n=r.byteContainerI32;(!n||n.buffer!==i.buffer||n.byteOffset!==i.byteOffset||n.length<a)&&(n=r.byteContainerI32=new Int32Array(i.buffer,i.byteOffset,i.byteLength>>>2)),n.set(e.subarray(t,t+a))}let o=n&3;if(o>0){let n=e[t+a|0]|0,r=a<<2;for(let e=0;e<o;e=e+1|0)i[r+e|0]=n>>>(e<<3)&255}return i}function GVe(e,t,n){let r=e[t++]|0,i=n.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(r>>>a-1&1))continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let o=e[t++]>>>0,s=hVe(o),c=o*a+31>>>5;if(t+c>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${o}, streamWordIndex=${t}, needWords=${c}, availableWords=${e.length-t}, encodedWords=${e.length})`);let l=i[a];(!l||l.length<s)&&(l=i[a]=new Uint32Array(s));let u=0;for(;u<o;u=u+32|0)tHe(e,t,l,u,a),t=t+a|0;let d=u-o|0;t=t-(d*a>>>5)|0,n.exceptionSizes[a]=o}return t}function KVe(e,t,n,r,i){switch(i){case 1:AVe(e,t,n,r);break;case 2:jVe(e,t,n,r);break;case 3:MVe(e,t,n,r);break;case 4:NVe(e,t,n,r);break;case 5:PVe(e,t,n,r);break;case 6:FVe(e,t,n,r);break;case 7:IVe(e,t,n,r);break;case 8:LVe(e,t,n,r);break;case 16:RVe(e,t,n,r);break;default:zVe(e,t,n,r,i)}return t+(i<<3)|0}function qVe(e,t,n,r){if(n+2>t)throw Error(`FastPFOR decode: byteContainer underflow at block=${r} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${n}, byteSize=${t})`);let i=e[n++],a=e[n++];if(i>32)throw Error(`FastPFOR decode: invalid bitWidth=${i} at block=${r} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:i,exceptionCount:a,bytePosIn:n}}function JVe(e,t,n,r,i,a){if(n+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${n}, byteSize=${t})`);let o=e[n++];if(o<r||o>32)throw Error(`FastPFOR decode: invalid maxBits=${o} at block=${a} (bitWidth=${r}, expected ${r}..32)`);let s=o-r|0;if(s<1||s>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${s} at block=${a} (bitWidth=${r}, maxBits=${o})`);if(n+i>t)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${i}, have=${t-n})`);return{maxBits:o,exceptionBitWidth:s,bytePosIn:n}}function YVe(e,t,n,r,i,a,o,s,c){let{maxBits:l,exceptionBitWidth:u,bytePosIn:d}=JVe(i,a,o,n,r,c);if(o=d,u===1){let a=1<<n;for(let n=0;n<r;n=n+1|0){let n=i[o++];e[n+t|0]|=a}return o}let f=s.dataToBePacked[u];if(!f)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${u} (bitWidth=${n}, maxBits=${l}) at block ${c}`);let p=s.dataPointers,m=p[u]|0,h=s.exceptionSizes[u]|0;if(m+r>h)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${u} (ptr=${m}, need ${r}, size=${h}) at block ${c}`);for(let a=0;a<r;a=a+1|0){let r=i[o++],a=f[m++]|0;e[r+t|0]|=a<<n}return p[u]=m,o}function XVe(e,t,n,r,i,a,o,s,c,l){let u=n|0,d=0;for(let t=0;t<o;t=t+1|0){let n=qVe(s,c,d,t);d=n.bytePosIn;let r=n.bitWidth,o=n.exceptionCount,f=a+t*256|0;switch(r){case 0:i.fill(0,f,f+256);break;case 32:for(let t=0;t<256;t=t+1|0)i[f+t|0]=e[u+t|0]|0;u=u+256|0;break;default:u=KVe(e,u,i,f,r)}o>0&&(d=YVe(i,f,r,o,s,c,d,l,t))}if(u!==r)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${t}, packedStart=${n}, consumedPackedEnd=${u}, expectedPackedEnd=${r}, packedWords=${r-n}, encoded.length=${e.length})`)}function ZVe(e,t,n,r,i,a){let o=n|0,s=e[o]|0;if(s<=0||o+s>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${s} at pageStart=${o} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let c=o+1|0,l=o+s|0,u=e[l]>>>0,d=u+3>>>2,f=l+1,p=f+d;if(p>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${u} (metaInts=${d}, pageStart=${o}, packedEnd=${l}, byteContainerStart=${f}) causes bitmapPos=${p} out of bounds (encoded.length=${e.length})`);let m=WVe(e,f,u,a),h=u,g=GVe(e,p,a);return a.dataPointers.fill(0),XVe(e,o,c,l,t,r|0,i/256|0,m,h,a),g}function QVe(e,t,n,r,i,a){let o=r+Wq(i,256),s=r,c=n;for(;s!==o;){let n=Math.min(Gq,o-s);c=ZVe(e,t,c,s,n,a),s=s+n|0}return c}function $Ve(e,t,n,r,i,a){if(a===0)return t;let o=0,s=t,c=t+n,l=i,u=i,d=i+a,f=0,p=0;for(;s<c&&u<d;){let t=e[s]>>>o&255;if(o+=8,s+=o>>>5,o&=31,f|=(t&127)<<p,t&128)r[u++]=f|0,f=0,p=0;else if(p+=7,p>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${p}, partial=${f}, decoded=${u-l}/${a}, inPos=${s}, inEnd=${c})`)}if(u!==d)throw Error(`FastPFOR VByte: truncated stream (decoded=${u-l}, expected=${a}, consumedWords=${s-t}/${n}, vbyteStart=${t}, vbyteEnd=${c})`);return s}function eHe(e,t,n){let r=0,i=0,a=new Uint32Array(t),o=n??VVe();if(e.length>0){let t=e[r]|0;if(r=r+1|0,t&255)throw Error(`FastPFOR decode: invalid alignedLength=${t} (expected multiple of 256)`);if(i+t>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${i}, alignedLength=${t}, out.length=${a.length})`);r=QVe(e,a,r,i,t,o),i=i+t|0}let s=e.length-r|0,c=t-i|0;return $Ve(e,r,s,a,i,c),a}function tHe(e,t,n,r,i){switch(i){case 2:vVe(e,t,n,r);return;case 3:yVe(e,t,n,r);return;case 4:bVe(e,t,n,r);return;case 5:xVe(e,t,n,r);return;case 6:SVe(e,t,n,r);return;case 7:CVe(e,t,n,r);return;case 8:wVe(e,t,n,r);return;case 9:TVe(e,t,n,r);return;case 10:EVe(e,t,n,r);return;case 11:DVe(e,t,n,r);return;case 12:OVe(e,t,n,r);return;case 16:kVe(e,t,n,r);return;case 32:for(let i=0;i<32;i=i+1|0)n[r+i|0]=e[t+i|0]|0;return}let a=Uq[i]>>>0,o=t,s=0,c=e[o]>>>0;for(let t=0;t<32;t++)if(s+i<=32){let l=c>>>s&a;n[r+t]=l|0,s+=i,s===32&&(s=0,o++,t!==31&&(c=e[o]>>>0))}else{let l=32-s,u=c>>>s;o++,c=e[o]>>>0;let d=Uq[i-l]>>>0,f=(u|(c&d)<<l)&a;n[r+t]=f|0,s=i-l}}function nHe(e,t,n,r){if(t<0||n<0||t+n>e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${t}, byteLength=${n}, bytes.length=${e.length})`);let i=Math.floor(n/4),a=n%4!=0,o=a?i+1:i;if(r.length<o)throw RangeError(`decodeBigEndianInt32sInto: out.length=${r.length} < ${o}`);if(i>0){let n=e.byteOffset+t;if(n&3)for(let n=0;n<i;n++){let i=t+n*4;r[n]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]|0}else{let t=new Uint32Array(e.buffer,n,i);for(let e=0;e<i;e++)r[e]=_Ve(t[e])|0}}if(a){let a=t+i*4,o=n-i*4,s=0;for(let t=0;t<o;t++)s|=e[a+t]<<24-t*8;r[i]=s|0}return o}function Kq(e,t,n){let r=new Uint32Array(n),i=0,a=t.get();for(let t=0;t<r.length;t++){let t=e[a++],n=t&127;if(t<128){r[i++]=n;continue}if(t=e[a++],n|=(t&127)<<7,t<128){r[i++]=n;continue}if(t=e[a++],n|=(t&127)<<14,t<128){r[i++]=n;continue}if(t=e[a++],n|=(t&127)<<21,t<128){r[i++]=n;continue}t=e[a++],n|=(t&15)<<28,r[i++]=n}return t.set(a),r}function qq(e,t,n){let r=new BigUint64Array(n);for(let n=0;n<r.length;n++)r[n]=rHe(e,t);return r}function rHe(e,t){let n=0n,r=0,i=t.get();for(;i<e.length;){let t=e[i++];if(n|=BigInt(t&127)<<BigInt(r),!(t&128))break;if(r+=7,r>=64)throw Error(`Varint too long`)}return t.set(i),n}function iHe(e,t,n){let r=new Float64Array(n);for(let i=0;i<n;i++)r[i]=aHe(e,t);return r}function aHe(e,t){let n,r;return r=e[t.get()],t.increment(),n=r&127,r<128||(r=e[t.get()],t.increment(),n|=(r&127)<<7,r<128)||(r=e[t.get()],t.increment(),n|=(r&127)<<14,r<128)||(r=e[t.get()],t.increment(),n|=(r&127)<<21,r<128)?n:(r=e[t.get()],n|=(r&15)<<28,oHe(n,e,t))}function oHe(e,t,n){let r,i;if(i=t[n.get()],n.increment(),r=(i&112)>>4,i<128||(i=t[n.get()],n.increment(),r|=(i&127)<<3,i<128)||(i=t[n.get()],n.increment(),r|=(i&127)<<10,i<128)||(i=t[n.get()],n.increment(),r|=(i&127)<<17,i<128)||(i=t[n.get()],n.increment(),r|=(i&127)<<24,i<128)||(i=t[n.get()],n.increment(),r|=(i&1)<<31,i<128))return r*4294967296+(e>>>0);throw Error(`Expected varint not more than 10 bytes`)}function sHe(e,t,n,r){return cHe(e,t,n,r,HVe(n>>>2))}function cHe(e,t,n,r,i){let a=r.get();if(n&3)throw Error(`FastPFOR: invalid encodedByteLength=${n} at offset=${a} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let o=n>>>2,s=UVe(i,o);nHe(e,a,n,s);let c=eHe(s.subarray(0,o),t,i.decoderWorkspace);return r.add(n),c}function Jq(e){return e>>>1^-(e&1)}function Yq(e){return e>>1n^-(e&1n)}function Xq(e){return e%2==1?(e+1)/-2:e/2}function lHe(e){let t=new Int32Array(e.length);for(let n=0;n<e.length;n++)t[n]=Jq(e[n]);return t}function uHe(e){let t=new BigInt64Array(e.length);for(let n=0;n<e.length;n++)t[n]=Yq(e[n]);return t}function dHe(e){for(let t=0;t<e.length;t++)e[t]=Xq(e[t])}function Zq(e,t,n){if(n===void 0){n=0;for(let r=0;r<t;r++)n+=e[r]}let r=new Uint32Array(n),i=0;for(let n=0;n<t;n++){let a=e[n],o=e[n+t];r.fill(o,i,i+a),i+=a}return r}function Qq(e,t,n){if(n===void 0){n=0;for(let r=0;r<t;r++)n+=Number(e[r])}let r=new BigUint64Array(n),i=0;for(let n=0;n<t;n++){let a=Number(e[n]),o=e[n+t];r.fill(o,i,i+a),i+=a}return r}function fHe(e,t,n){let r=new Float64Array(n),i=0;for(let n=0;n<t;n++){let a=e[n],o=e[n+t];r.fill(o,i,i+a),i+=a}return r}function pHe(e){let t=new Int32Array(e.length);t[0]=Jq(e[0]);let n=e.length/4*4,r=1;if(n>=4)for(;r<n-4;r+=4){let n=e[r],i=e[r+1],a=e[r+2],o=e[r+3];t[r]=Jq(n)+t[r-1],t[r+1]=Jq(i)+t[r],t[r+2]=Jq(a)+t[r+1],t[r+3]=Jq(o)+t[r+2]}for(;r!==e.length;++r)t[r]=Jq(e[r])+t[r-1];return t}function mHe(e){let t=new BigInt64Array(e.length);t[0]=Yq(e[0]);let n=e.length/4*4,r=1;if(n>=4)for(;r<n-4;r+=4){let n=e[r],i=e[r+1],a=e[r+2],o=e[r+3];t[r]=Yq(n)+t[r-1],t[r+1]=Yq(i)+t[r],t[r+2]=Yq(a)+t[r+1],t[r+3]=Yq(o)+t[r+2]}for(;r!==t.length;++r)t[r]=Yq(e[r])+t[r-1];return t}function hHe(e){e[0]=Xq(e[0]);let t=e.length/4*4,n=1;if(t>=4)for(;n<t-4;n+=4){let t=e[n],r=e[n+1],i=e[n+2],a=e[n+3];e[n]=Xq(t)+e[n-1],e[n+1]=Xq(r)+e[n],e[n+2]=Xq(i)+e[n+1],e[n+3]=Xq(a)+e[n+2]}for(;n!==e.length;++n)e[n]=Xq(e[n])+e[n-1]}function gHe(e,t,n){if(n===void 0){n=0;for(let r=0;r<t;r++)n+=e[r]}let r=new Int32Array(n),i=0;for(let n=0;n<t;n++){let a=e[n],o=e[n+t];o=Jq(o),r.fill(o,i,i+a),i+=a}return r}function _He(e,t,n){if(n===void 0){n=0;for(let r=0;r<t;r++)n+=Number(e[r])}let r=new BigInt64Array(n),i=0;for(let n=0;n<t;n++){let a=Number(e[n]),o=e[n+t];o=Yq(o),r.fill(o,i,i+a),i+=a}return r}function vHe(e,t,n){let r=new Float64Array(n),i=0;for(let n=0;n<t;n++){let a=e[n],o=e[n+t];o=Xq(o),r.fill(o,i,i+a),i+=a}return r}function $q(e){let t=e.length/4*4,n=1;if(t>=4)for(let r=e[0];n<t-4;n+=4)r=e[n]+=r,r=e[n+1]+=r,r=e[n+2]+=r,r=e[n+3]+=r;for(;n!==e.length;)e[n]+=e[n-1],++n}function yHe(e){let t=0;for(let n=0;n<e.length;n++)e[n]+=t,t=e[n]}function bHe(e){if(e.length<2)return new Int32Array(e);let t=new Int32Array(e.length);t[0]=Jq(e[0]),t[1]=Jq(e[1]);let n=e.length/4*4,r=2;if(n>=4)for(;r<n-4;r+=4){let n=e[r],i=e[r+1],a=e[r+2],o=e[r+3];t[r]=Jq(n)+t[r-2],t[r+1]=Jq(i)+t[r-1],t[r+2]=Jq(a)+t[r],t[r+3]=Jq(o)+t[r+1]}for(;r!==e.length;r+=2)t[r]=Jq(e[r])+t[r-2],t[r+1]=Jq(e[r+1])+t[r-1];return t}function xHe(e,t,n,r){if(e.length<2)return new Int32Array(e);let i=new Int32Array(e.length),a=Jq(e[0]),o=Jq(e[1]);i[0]=eJ(Math.round(a*t),n,r),i[1]=eJ(Math.round(o*t),n,r);let s=e.length/16,c=2;if(s>=4)for(;c<s-4;c+=4){let s=e[c],l=e[c+1],u=Jq(s)+a,d=Jq(l)+o;i[c]=eJ(Math.round(u*t),n,r),i[c+1]=eJ(Math.round(d*t),n,r);let f=e[c+2],p=e[c+3];a=Jq(f)+u,o=Jq(p)+d,i[c+2]=eJ(Math.round(a*t),n,r),i[c+3]=eJ(Math.round(o*t),n,r)}for(;c!==e.length;c+=2)a+=Jq(e[c]),o+=Jq(e[c+1]),i[c]=eJ(Math.round(a*t),n,r),i[c+1]=eJ(Math.round(o*t),n,r);return i}function eJ(e,t,n){return Math.min(n,Math.max(t,e))}function SHe(e){let t=new Int32Array(e.length+1);t[0]=0,t[1]=Jq(e[0]);let n=t[1];for(let r=2;r!==t.length;++r){let i=e[r-1],a=Jq(i);n+=a,t[r]=t[r-1]+n}return new Uint32Array(t)}function CHe(e,t,n){let r=new Int32Array(n+1);r[0]=0;let i=1,a=r[0];for(let n=0;n<t;n++){let o=e[n],s=e[n+t];s=Jq(s);for(let e=i;e<i+o;e++)r[e]=s+a,a=r[e];i+=o}return r}function wHe(e,t,n){let r=new Uint32Array(n+1);r[0]=0;let i=1,a=r[0];for(let n=0;n<t;n++){let o=e[n],s=e[n+t];for(let e=i;e<i+o;e++)r[e]=s+a,a=r[e];i+=o}return r}function THe(e,t,n){let r=new Int32Array(n),i=0,a=0;for(let n=0;n<t;n++){let o=e[n],s=e[n+t],c=Jq(s);for(let e=0;e<o;e++)a+=c,r[i++]=a}return r}function EHe(e,t,n){let r=new BigInt64Array(n),i=0,a=0n;for(let n=0;n<t;n++){let o=Number(e[n]),s=e[n+t],c=Yq(s);for(let e=0;e<o;e++)a+=c,r[i++]=a}return r}function DHe(e){let t=new Uint32Array(e.length);t[0]=Jq(e[0])>>>0;for(let n=1;n<e.length;n++)t[n]=t[n-1]+Jq(e[n])>>>0;return t}function OHe(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,Yq(e[0]));for(let n=1;n<e.length;n++)t[n]=BigInt.asUintN(64,t[n-1]+Yq(e[n]));return t}function kHe(e){if(e.length<2)return new Uint32Array(e);let t=new Uint32Array(e.length);t[0]=Jq(e[0])>>>0,t[1]=Jq(e[1])>>>0;for(let n=2;n<e.length;n+=2)t[n]=t[n-2]+Jq(e[n])>>>0,t[n+1]=t[n-1]+Jq(e[n+1])>>>0;return t}function AHe(e,t,n,r){let i=xHe(e,t,n,r);return new Uint32Array(i)}function jHe(e){return e[1]}function MHe(e){return Jq(e[1])}function NHe(e){if(e.length===2){let t=Jq(e[1]);return[t,t]}return[Jq(e[2]),Jq(e[3])]}function PHe(e){return e[1]}function FHe(e){return Yq(e[1])}function IHe(e){if(e.length===2){let t=Yq(e[1]);return[t,t]}return[Yq(e[2]),Yq(e[3])]}var tJ;(function(e){e.PRESENT=`PRESENT`,e.DATA=`DATA`,e.OFFSET=`OFFSET`,e.LENGTH=`LENGTH`})(tJ||={});var nJ;(function(e){e.NONE=`NONE`,e.SINGLE=`SINGLE`,e.SHARED=`SHARED`,e.VERTEX=`VERTEX`,e.MORTON=`MORTON`,e.FSST=`FSST`})(nJ||={});var rJ;(function(e){e.VERTEX=`VERTEX`,e.INDEX=`INDEX`,e.STRING=`STRING`,e.KEY=`KEY`})(rJ||={});var iJ;(function(e){e.VAR_BINARY=`VAR_BINARY`,e.GEOMETRIES=`GEOMETRIES`,e.PARTS=`PARTS`,e.RINGS=`RINGS`,e.TRIANGLES=`TRIANGLES`,e.SYMBOL=`SYMBOL`,e.DICTIONARY=`DICTIONARY`})(iJ||={});var LHe=[tJ.PRESENT,tJ.DATA,tJ.OFFSET,tJ.LENGTH],RHe=[Bq.NONE,Bq.DELTA,Bq.COMPONENTWISE_DELTA,Bq.RLE,Bq.MORTON,Bq.PDE],zHe=[Vq.NONE,Vq.FAST_PFOR,Vq.VARINT],BHe=[nJ.NONE,nJ.SINGLE,nJ.SHARED,nJ.VERTEX,nJ.MORTON,nJ.FSST],VHe=[rJ.VERTEX,rJ.INDEX,rJ.STRING,rJ.KEY],HHe=[iJ.VAR_BINARY,iJ.GEOMETRIES,iJ.PARTS,iJ.RINGS,iJ.TRIANGLES,iJ.SYMBOL,iJ.DICTIONARY];function aJ(e,t){let n=GHe(e,t);return n.logicalLevelTechnique1===Bq.MORTON?UHe(n,e,t):(Bq.RLE===n.logicalLevelTechnique1||Bq.RLE===n.logicalLevelTechnique2)&&Vq.NONE!==n.physicalLevelTechnique?WHe(n,e,t):n}function UHe(e,t,n){let r=Kq(t,n,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:e.decompressedCount,numBits:r[0],coordinateShift:r[1]}}function WHe(e,t,n){let r=Kq(t,n,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:r[1],runs:r[0],numRleValues:r[1]}}function GHe(e,t){let n=e[t.get()],r=LHe[n>>4],i={};switch(r){case tJ.DATA:i={dictionaryType:BHe[n&15]};break;case tJ.OFFSET:i={offsetType:VHe[n&15]};break;case tJ.LENGTH:i={lengthType:HHe[n&15]}}t.increment();let a=e[t.get()],o=RHe[a>>5],s=RHe[a>>2&7],c=zHe[a&3];t.increment();let l=Kq(e,t,2),u=l[0],d=l[1];return{physicalStreamType:r,logicalStreamType:i,logicalLevelTechnique1:o,logicalLevelTechnique2:s,physicalLevelTechnique:c,numValues:u,byteLength:d,decompressedCount:u}}var oJ;(function(e){e[e.FLAT=0]=`FLAT`,e[e.CONST=1]=`CONST`,e[e.SEQUENCE=2]=`SEQUENCE`,e[e.DICTIONARY=3]=`DICTIONARY`,e[e.FSST_DICTIONARY=4]=`FSST_DICTIONARY`})(oJ||={});var sJ=class{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8),n=e%8;return(this.values[t]>>n&1)==1}set(e,t){let n=Math.floor(e/8),r=e%8;this.values[n]=this.values[n]|+!!t<<r}getInt(e){let t=Math.floor(e/8),n=e%8;return this.values[t]>>n&1}size(){return this._size}getBuffer(){return this.values}};function cJ(e,t,n){if(!t)return e;let r=t.size(),i=e.constructor,a=new i(r),o=0;for(let i=0;i<r;i++)a[i]=t.get(i)?e[o++]:n;return a}function KHe(e,t,n){if(!n)return e;let r=n.size(),i=new sJ(e,t),a=new sJ(new Uint8Array(Math.ceil(r/8)),r),o=0;for(let e=0;e<r;e++){let t=n.get(e)?i.get(o++):!1;a.set(e,t)}return a.getBuffer()}function qHe(e,t,n){for(let r=0;r<e;r++){let e=aJ(t,n);n.add(e.byteLength)}}function lJ(e,t,n,r,i){let a=JHe(e,Math.ceil(t/8),n,r);return i?KHe(a,t,i):a}function JHe(e,t,n,r){let i=new Uint8Array(t),a=0,o=r.get()+n;for(;a<t&&!(r.get()>=o);){let n=e[r.increment()];if(n<=127){let o=n+3,s=e[r.increment()],c=Math.min(a+o,t);i.fill(s,a,c),a=c}else{let o=256-n;for(let n=0;n<o&&a<t;n++)i[a++]=e[r.increment()]}}return r.set(o),i}function YHe(e,t,n,r){let i=t.get(),a=i+n*Float32Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(i,a)).buffer,s=new Float32Array(o);return t.set(a),r?cJ(s,r,0):s}function XHe(e,t,n,r){let i=t.get(),a=i+n*Float64Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(i,a)).buffer,s=new Float64Array(o);return t.set(a),r?cJ(s,r,0):s}function ZHe(e,t,n){let r=t.get(),i=n*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=new Uint32Array(n);for(let e=0;e<n;e++)o[e]=a.getUint32(r+e*Uint32Array.BYTES_PER_ELEMENT,!0);return t.add(i),o}function QHe(e,t,n){let r=t.get(),i=n*BigUint64Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=new BigUint64Array(n);for(let e=0;e<n;e++)o[e]=a.getBigUint64(r+e*BigUint64Array.BYTES_PER_ELEMENT,!0);return t.add(i),o}var $He=new TextDecoder;function uJ(e,t,n){return n-t>=12?$He.decode(e.subarray(t,n)):eUe(e,t,n)}function eUe(e,t,n){let r=``,i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o>n)break;let s,c,l;o===1?t<128&&(a=t):o===2?(s=e[i+1],(s&192)==128&&(a=(t&31)<<6|s&63,a<=127&&(a=null))):o===3?(s=e[i+1],c=e[i+2],(s&192)==128&&(c&192)==128&&(a=(t&15)<<12|(s&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):o===4&&(s=e[i+1],c=e[i+2],l=e[i+3],(s&192)==128&&(c&192)==128&&(l&192)==128&&(a=(t&15)<<18|(s&63)<<12|(c&63)<<6|l&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,o=1):a>65535&&(a-=65536,r+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),r+=String.fromCharCode(a),i+=o}return r}function dJ(e,t,n,r,i){return lUe(mJ(e,t,n),n,r,i)}function fJ(e,t,n,r,i){return uUe(mJ(e,t,n),n,r,i)}function pJ(e,t,n){return mUe(mJ(e,t,n),n)}function mJ(e,t,n){let r=n.physicalLevelTechnique;switch(r){case Vq.FAST_PFOR:return sHe(e,n.numValues,n.byteLength,t);case Vq.VARINT:return Kq(e,t,n.numValues);case Vq.NONE:return ZHe(e,t,n.numValues);default:throw Error(`Specified physicalLevelTechnique ${r} is not supported (yet).`)}}function hJ(e,t,n){let r=n.physicalLevelTechnique;switch(r){case Vq.VARINT:return qq(e,t,n.numValues);case Vq.NONE:return QHe(e,t,n.numValues);default:throw Error(`Specified physicalLevelTechnique ${r} is not supported (yet).`)}}function tUe(e,t,n){let r=mJ(e,t,n);return r.length===1?Jq(r[0]):MHe(r)}function gJ(e,t,n){let r=mJ(e,t,n);return r.length===1?n.logicalLevelTechnique1===Bq.DELTA?Jq(r[0]):r[0]:jHe(r)}function nUe(e,t,n){return NHe(mJ(e,t,n))}function rUe(e,t,n){return IHe(qq(e,t,n.numValues))}function iUe(e,t,n,r){return dUe(hJ(e,t,n),n,r)}function _J(e,t,n,r){return fUe(hJ(e,t,n),n,r)}function aUe(e,t,n,r){let i=oUe(e,t,n,!1);return r?cJ(i,r,0):i}function oUe(e,t,n,r){if(n.physicalLevelTechnique===Vq.VARINT)return pUe(iHe(e,t,n.numValues),n,r);let i=hJ(e,t,n),a=r?dUe(i,n):fUe(i,n);return Float64Array.from(a,Number)}function sUe(e,t,n){let r=hJ(e,t,n);return r.length===1?Yq(r[0]):FHe(r)}function cUe(e,t,n){let r=hJ(e,t,n);return r.length===1?n.logicalLevelTechnique1===Bq.DELTA?Yq(r[0]):r[0]:PHe(r)}function lUe(e,t,n,r){let i;switch(t.logicalLevelTechnique1){case Bq.DELTA:if(t.logicalLevelTechnique2===Bq.RLE){let n=t;if(!r)return THe(e,n.runs,n.numRleValues);e=Zq(e,n.runs,n.numRleValues),i=pHe(e)}else i=pHe(e);break;case Bq.RLE:i=gHe(e,t.runs,t.numRleValues);break;case Bq.MORTON:$q(e),i=new Int32Array(e);break;case Bq.COMPONENTWISE_DELTA:if(n&&!r)return xHe(e,n.scale,n.min,n.max);i=bHe(e);break;case Bq.NONE:i=lHe(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?cJ(i,r,0):i}function uUe(e,t,n,r){let i;switch(t.logicalLevelTechnique1){case Bq.DELTA:if(t.logicalLevelTechnique2===Bq.RLE){let n=t;i=DHe(Zq(e,n.runs,n.numRleValues))}else i=DHe(e);break;case Bq.RLE:i=Zq(e,t.runs,t.numRleValues);break;case Bq.MORTON:$q(e),i=e;break;case Bq.COMPONENTWISE_DELTA:i=n&&!r?AHe(e,n.scale,n.min,n.max):kHe(e);break;case Bq.NONE:i=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?cJ(i,r,0):i}function dUe(e,t,n){let r;switch(t.logicalLevelTechnique1){case Bq.DELTA:if(t.logicalLevelTechnique2===Bq.RLE){let i=t;if(!n)return EHe(e,i.runs,i.numRleValues);e=Qq(e,i.runs,i.numRleValues),r=mHe(e)}else r=mHe(e);break;case Bq.RLE:r=_He(e,t.runs,t.numRleValues);break;case Bq.NONE:r=uHe(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return n?cJ(r,n,0n):r}function fUe(e,t,n){let r;switch(t.logicalLevelTechnique1){case Bq.DELTA:if(t.logicalLevelTechnique2===Bq.RLE){let n=t;r=OHe(Qq(e,n.runs,n.numRleValues))}else r=OHe(e);break;case Bq.RLE:r=Qq(e,t.runs,t.numRleValues);break;case Bq.NONE:r=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return n?cJ(r,n,0n):r}function pUe(e,t,n){switch(t.logicalLevelTechnique1){case Bq.DELTA:if(t.logicalLevelTechnique2===Bq.RLE){let n=t;e=fHe(e,n.runs,n.numRleValues)}return hHe(e),e;case Bq.RLE:return gUe(e,t,n);case Bq.NONE:return n&&dHe(e),e;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}}function mUe(e,t){if(t.logicalLevelTechnique1===Bq.DELTA&&t.logicalLevelTechnique2===Bq.NONE)return SHe(e);if(t.logicalLevelTechnique1===Bq.RLE&&t.logicalLevelTechnique2===Bq.NONE){let n=t;return wHe(e,n.runs,n.numRleValues)}if(t.logicalLevelTechnique1===Bq.NONE&&t.logicalLevelTechnique2===Bq.NONE){yHe(e);let n=new Uint32Array(t.numValues+1);return n[0]=0,n.set(e,1),n}if(t.logicalLevelTechnique1===Bq.DELTA&&t.logicalLevelTechnique2===Bq.RLE){let n=t,r=CHe(e,n.runs,n.numRleValues);return $q(r),new Uint32Array(r)}throw Error(`Only delta encoding is supported for transforming length to offset streams yet.`)}function vJ(e,t,n,r,i=`int32`){let a=e.logicalLevelTechnique1;if(a===Bq.RLE)return e.runs===1?oJ.CONST:oJ.FLAT;if(a!==Bq.DELTA||e.logicalLevelTechnique2!==Bq.RLE)return e.numValues===1?oJ.CONST:oJ.FLAT;let o=t instanceof sJ?t.size():t,s=e;if(s.numRleValues!==o)return oJ.FLAT;if(s.runs===1)return oJ.SEQUENCE;if(s.runs!==2)return e.numValues===1?oJ.CONST:oJ.FLAT;let c=r.get();if(e.physicalLevelTechnique===Vq.VARINT)return hUe(n,r,i)?oJ.SEQUENCE:e.numValues===1?oJ.CONST:oJ.FLAT;let l=r.get(),u=new Int32Array(n.buffer,n.byteOffset+l,4);return r.set(c),u[2]===2&&u[3]===2?oJ.SEQUENCE:e.numValues===1?oJ.CONST:oJ.FLAT}function hUe(e,t,n){let r=new pVe(t.get());if(n===`int64`){let t=qq(e,r,4);return t[2]===2n&&t[3]===2n}let i=Kq(e,r,4);return i[2]===2&&i[3]===2}function gUe(e,t,n){return n?vHe(e,t.runs,t.numRleValues):fHe(e,t.runs,t.numRleValues)}var _Ue=class extends Mq{getValueFromBuffer(e){return this.dataBuffer[e]}},vUe=class extends uVe{constructor(e,t,n,r,i){super(e,i?BigInt64Array.of(t):BigUint64Array.of(t),n,r)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}};function yJ(e,t,n){return{x:yUe(e,t)-n,y:yUe(e>>1,t)-n}}function yUe(e,t){let n=0;for(let r=0;r<t;r++)n|=(e&1<<2*r)>>r;return n}var bJ;(function(e){e[e.POINT=0]=`POINT`,e[e.LINESTRING=1]=`LINESTRING`,e[e.POLYGON=2]=`POLYGON`,e[e.MULTIPOINT=3]=`MULTIPOINT`,e[e.MULTILINESTRING=4]=`MULTILINESTRING`,e[e.MULTIPOLYGON=5]=`MULTIPOLYGON`})(bJ||={});var bUe;(function(e){e[e.POINT=0]=`POINT`,e[e.LINESTRING=1]=`LINESTRING`,e[e.POLYGON=2]=`POLYGON`})(bUe||={});var xJ;(function(e){e[e.MORTON=0]=`MORTON`,e[e.VEC_2=1]=`VEC_2`,e[e.VEC_3=2]=`VEC_3`})(xJ||={});function xUe(e){let t=Array(e.numGeometries),n=1,r=1,i=1,a=0,o=0,s=0,c=e.mortonSettings,l=e.topologyVector,u=l.geometryOffsets,d=l.partOffsets,f=l.ringOffsets,p=e.vertexOffsets,m=!p||p.length===0,h=e.containsPolygonGeometry(),g=e.vertexBuffer;for(let l=0;l<e.numGeometries;l++){let _=e.geometryType(l);switch(_){case bJ.POINT:{let l,h;if(m)l=g[o++],h=g[o++];else if(e.vertexBufferType===xJ.MORTON){let e=g[p[s++]],t=yJ(e,c.numBits,c.coordinateShift);l=t.x,h=t.y}else{let e=p[s++]*2;l=g[e],h=g[e+1]}t[a++]=[[new K(l,h)]],u&&i++,d&&n++,f&&r++}break;case bJ.MULTIPOINT:{let l=u[i]-u[i-1];i++;let d;if(m){d=Array(l);for(let e=0;e<l;e++){let t=g[o++],n=g[o++];d[e]=new K(t,n)}}else d=SJ(e.vertexBufferType,g,p,s,l,!1,c),s+=l;t[a++]=d.map(e=>[e]),n+=l,r+=l}break;case bJ.LINESTRING:{let l;h?(l=f[r]-f[r-1],r++):l=d[n]-d[n-1],n++;let _;m?(_=CJ(g,o,l,!1),o+=l*2):(_=SJ(e.vertexBufferType,g,p,s,l,!1,c),s+=l),t[a++]=[_],u&&i++}break;case bJ.POLYGON:{let l=d[n]-d[n-1];n++;let h=Array(l-1),_,v=f[r]-f[r-1];if(r++,m){_=CJ(g,o,v,!0),o+=v*2;for(let e=0;e<h.length;e++)v=f[r]-f[r-1],r++,h[e]=CJ(g,o,v,!0),o+=v*2}else{_=SJ(e.vertexBufferType,g,p,s,v,!0,c),s+=v;for(let t=0;t<h.length;t++)v=f[r]-f[r-1],r++,h[t]=SJ(e.vertexBufferType,g,p,s,v,!0,c),s+=v}t[a++]=[_].concat(h),u&&i++}break;case bJ.MULTILINESTRING:{let l=u[i]-u[i-1];i++;let _=Array(l);for(let t=0;t<l;t++){let i;h?(i=f[r]-f[r-1],r++):i=d[n]-d[n-1],n++,m?(_[t]=CJ(g,o,i,!1),o+=i*2):(_[t]=SJ(e.vertexBufferType,g,p,s,i,!1,c),s+=i)}t[a++]=_}break;case bJ.MULTIPOLYGON:{let l=u[i]-u[i-1];i++;let h=Array(l);for(let t=0;t<l;t++){let i=d[n]-d[n-1];n++;let a,l=Array(i-1),u=f[r]-f[r-1];r++,m?(a=CJ(g,o,u,!0),o+=u*2):(a=SJ(e.vertexBufferType,g,p,s,u,!0,c),s+=u);for(let t=0;t<l.length;t++){let n=f[r]-f[r-1];r++,m?(l[t]=CJ(g,o,n,!0),o+=n*2):(l[t]=SJ(e.vertexBufferType,g,p,s,n,!0,c),s+=n)}h[t]=[a].concat(l)}t[a++]=h.flat()}break;default:throw Error(`The specified geometry type (${_}) is currently not supported.`)}}return t}function SJ(e,t,n,r,i,a,o){return e===xJ.MORTON?CUe(t,n,r,i,a,o):SUe(t,n,r,i,a)}function CJ(e,t,n,r){let i=Array(r?n+1:n);for(let r=0;r<n*2;r+=2){let n=e[t+r],a=e[t+r+1];i[r/2]=new K(n,a)}return r&&(i[i.length-1]=i[0]),i}function SUe(e,t,n,r,i){let a=Array(i?r+1:r);for(let i=0;i<r*2;i+=2){let r=t[n+i/2]*2,o=e[r],s=e[r+1];a[i/2]=new K(o,s)}return i&&(a[a.length-1]=a[0]),a}function CUe(e,t,n,r,i,a){let o=Array(i?r+1:r);for(let i=0;i<r;i++){let r=e[t[n+i]],s=yJ(r,a.numBits,a.coordinateShift);o[i]=new K(s.x,s.y)}return i&&(o[o.length-1]=o[0]),o}var wUe=class{constructor(e,t,n,r,i){this._vertexBufferType=e,this._topologyVector=t,this._vertexOffsets=n,this._vertexBuffer=r,this._mortonSettings=i}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let t=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let t=this.vertexOffsets[e],n=this.vertexBuffer[t],r=yJ(n,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[r.x,r.y]}let t=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return xUe(this)}get mortonSettings(){return this._mortonSettings}};function TUe(e,t,n,r,i){return new DUe(e,t,xJ.VEC_2,n,r,i)}function EUe(e,t,n,r,i,a){return new DUe(e,t,xJ.MORTON,n,r,i,a)}var DUe=class extends wUe{constructor(e,t,n,r,i,a,o){super(n,r,i,a,o),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===bJ.POLYGON||this._geometryType===bJ.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function OUe(e,t,n,r){return new AUe(xJ.VEC_2,e,t,n,r)}function kUe(e,t,n,r,i){return new AUe(xJ.MORTON,e,t,n,r,i)}var AUe=class extends wUe{constructor(e,t,n,r,i,a){super(e,n,r,i,a),this._geometryTypes=t}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===bJ.POLYGON||this.geometryType(e)===bJ.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},jUe=class{constructor(e,t,n,r){this._triangleOffsets=e,this._indexBuffer=t,this._vertexBuffer=n,this._topologyVector=r}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error(`Cannot convert GpuVector to coordinates without topology information`);let e=new Uint32Array(this.numGeometries);for(let t=0;t<this.numGeometries;t++)e[t]=this.geometryType(t);return OUe(e,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}};function MUe(e,t,n,r,i,a){return new NUe(e,t,n,r,i,a)}var NUe=class extends jUe{constructor(e,t,n,r,i,a){super(n,r,i,a),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function PUe(e,t,n,r,i){return new FUe(e,t,n,r,i)}var FUe=class extends jUe{constructor(e,t,n,r,i){super(t,n,r,i),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function IUe(e,t,n,r,i){let a=aJ(e,n),o=vJ(a,r,e,n),s,c,l,u;if(o===oJ.CONST){let o=gJ(e,n,a),d,f,p,m;for(let r=0;r<t-1;r++){let t=aJ(e,n);switch(t.physicalStreamType){case tJ.LENGTH:switch(t.logicalStreamType.lengthType){case iJ.GEOMETRIES:d=pJ(e,n,t);break;case iJ.PARTS:f=pJ(e,n,t);break;case iJ.RINGS:p=pJ(e,n,t);break;case iJ.TRIANGLES:m=pJ(e,n,t)}break;case tJ.OFFSET:switch(t.logicalStreamType.offsetType){case rJ.VERTEX:s=fJ(e,n,t);break;case rJ.INDEX:u=fJ(e,n,t)}break;case tJ.DATA:if(nJ.VERTEX===t.logicalStreamType.dictionaryType)c=dJ(e,n,t,i);else{let r=t;l={numBits:r.numBits,coordinateShift:r.coordinateShift},c=fJ(e,n,t,i)}}}return u?d!==void 0||f!==void 0?MUe(r,o,m,u,c,{geometryOffsets:d,partOffsets:f,ringOffsets:p}):MUe(r,o,m,u,c):l===void 0?TUe(r,o,{geometryOffsets:d,partOffsets:f,ringOffsets:p},s,c):EUe(r,o,{geometryOffsets:d,partOffsets:f,ringOffsets:p},s,c,l)}let d=fJ(e,n,a),f,p,m,h;for(let r=0;r<t-1;r++){let t=aJ(e,n);switch(t.physicalStreamType){case tJ.LENGTH:switch(t.logicalStreamType.lengthType){case iJ.GEOMETRIES:f=fJ(e,n,t);break;case iJ.PARTS:p=fJ(e,n,t);break;case iJ.RINGS:m=fJ(e,n,t);break;case iJ.TRIANGLES:h=pJ(e,n,t)}break;case tJ.OFFSET:switch(t.logicalStreamType.offsetType){case rJ.VERTEX:s=fJ(e,n,t);break;case rJ.INDEX:u=fJ(e,n,t)}break;case tJ.DATA:if(nJ.VERTEX===t.logicalStreamType.dictionaryType)c=dJ(e,n,t,i);else{let r=t;l={numBits:r.numBits,coordinateShift:r.coordinateShift},c=fJ(e,n,t,i)}}}let g,_,v;return f?(g=wJ(d,f,2),p&&m?(_=LUe(d,g,p,!1),v=zUe(d,g,_,m)):p&&(_=RUe(d,g,p))):p&&m?(_=wJ(d,p,1),v=LUe(d,_,m,!0)):p&&(_=wJ(d,p,0)),u&&!_?PUe(d,h,u,c):u?PUe(d,h,u,c,{geometryOffsets:g,partOffsets:_,ringOffsets:v}):l===void 0?OUe(d,{geometryOffsets:g,partOffsets:_,ringOffsets:v},s,c):kUe(d,{geometryOffsets:g,partOffsets:_,ringOffsets:v},s,c,l)}function wJ(e,t,n){let r=new Uint32Array(e.length+1),i=0;r[0]=i;let a=0;for(let o=0;o<e.length;o++)i=r[o+1]=i+(e[o]>n?t[a++]:1);return r}function LUe(e,t,n,r){let i=new Uint32Array(t[t.length-1]+1),a=0;i[0]=a;let o=1,s=0;for(let c=0;c<e.length;c++){let l=e[c],u=t[c+1]-t[c];if(l===5||l===2||r&&(l===4||l===1))for(let e=0;e<u;e++)a=i[o++]=a+n[s++];else for(let e=0;e<u;e++)i[o++]=++a}return i}function RUe(e,t,n){let r=new Uint32Array(t[t.length-1]+1),i=0;r[0]=i;let a=1,o=0;for(let s=0;s<e.length;s++){let c=e[s],l=t[s+1]-t[s];if(c===4||c===1)for(let e=0;e<l;e++)i=r[a++]=i+n[o++];else for(let e=0;e<l;e++)r[a++]=++i}return r}function zUe(e,t,n,r){let i=new Uint32Array(n[n.length-1]+1),a=0;i[0]=a;let o=1,s=1,c=0;for(let l=0;l<e.length;l++){let u=e[l],d=t[l+1]-t[l];if(u!==0&&u!==3)for(let e=0;e<d;e++){let e=n[o]-n[o-1];o++;for(let t=0;t<e;t++)a=i[s++]=a+r[c++]}else for(let e=0;e<d;e++)i[s++]=++a,o++}return i}var BUe=class extends jq{constructor(e,t,n){super(e,t.getBuffer(),n),this.dataVector=t}getValueFromBuffer(e){return this.dataVector.get(e)}},VUe=class extends Mq{getValueFromBuffer(e){return this.dataBuffer[e]}},HUe=class extends jq{constructor(e,t,n,r){super(e,r?BigInt64Array.of(t):BigUint64Array.of(t),n)}getValueFromBuffer(e){return this.dataBuffer[0]}},TJ=class extends jq{constructor(e,t,n,r){super(e,n,r),this.offsetBuffer=t}},UUe=class extends TJ{constructor(e,t,n,r){super(e,t,n,r??t.length-1)}getValueFromBuffer(e){let t=this.offsetBuffer[e],n=this.offsetBuffer[e+1];return uJ(this.dataBuffer,t,n)}},EJ=class extends TJ{constructor(e,t,n,r,i){super(e,n,r,i??t.length),this.indexBuffer=t,this.indexBuffer=t}getValueFromBuffer(e){let t=this.indexBuffer[e],n=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return uJ(this.dataBuffer,n,r)}};function WUe(e,t){let n=0;for(let r=0;r<t.length;r++){let i=t[r];i===255?(n++,r++):n+=e[i]}return n}function GUe(e,t,n){let r=new Uint32Array(t.length);for(let e=1;e<t.length;e++)r[e]=r[e-1]+t[e-1];let i=new Uint8Array(WUe(t,n)),a=0;for(let o=0;o<n.length;o++){let s=n[o];if(s===255)o++,i[a++]=n[o];else{let n=t[s],o=r[s];for(;n-->0;)i[a++]=e[o++]}}return i}var KUe=class extends TJ{constructor(e,t,n,r,i,a,o,s){super(e,n,r,o??t.length),this.indexBuffer=t,this.symbolOffsetBuffer=i,this.symbolTableBuffer=a,this.sharedDictionaryCache=s}getValueFromBuffer(e){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let t=this.indexBuffer[e],n=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return uJ(this.decodedDictionary,n,r)}decodeDictionary(){return this.symbolLengthBuffer??=this.offsetToLengthBuffer(this.symbolOffsetBuffer),GUe(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(e){let t=new Uint32Array(e.length-1),n=e[0];for(let r=1;r<e.length;r++){let i=e[r];t[r-1]=i-n,n=i}return t}};function qUe(e,t,n,r,i){let a,o,s,c,l,u=i,d,f;for(let e=0;e<r;e++){let e=aJ(t,n);switch(e.physicalStreamType){case tJ.PRESENT:{let r=new sJ(lJ(t,e.numValues,e.byteLength,n),e.numValues);u=i??r;break}case tJ.OFFSET:o=fJ(t,n,e,void 0,u);break;case tJ.LENGTH:{let r=pJ(t,n,e);iJ.DICTIONARY===e.logicalStreamType.lengthType?a=r:iJ.SYMBOL===e.logicalStreamType.lengthType?c=r:d=r;break}case tJ.DATA:{let r=t.subarray(n.get(),n.get()+e.byteLength);n.add(e.byteLength);let i=e.logicalStreamType.dictionaryType;nJ.FSST===i?l=r:nJ.SINGLE===i||nJ.SHARED===i?s=r:nJ.NONE===i&&(f=r);break}}}return JUe(e,l,o,a,s,c,u)??YUe(e,s,o,a,u)??XUe(e,d,f,o,u)}function JUe(e,t,n,r,i,a,o){if(t){if(!n||!r||!i||!a)throw Error(`Incomplete FSST dictionary string column "${e}"`);return new KUe(e,n,r,i,a,t,o)}}function YUe(e,t,n,r,i){if(t){if(!n||!r)throw Error(`Incomplete dictionary string column "${e}"`);return i?new EJ(e,n,r,t,i):new EJ(e,n,r,t)}}function XUe(e,t,n,r,i){if(!(!t||!n)){if(r)return i?new EJ(e,r,t,n,i):new EJ(e,r,t,n);if(i&&i.size()!==t.length-1){let r=new Uint32Array(i.size()),a=0;for(let e=0;e<i.size();e++)i.get(e)?r[e]=a++:r[e]=0;return new EJ(e,r,t,n,i)}return i?new UUe(e,t,n,i):new UUe(e,t,n)}}function ZUe(e,t,n,r){let i,a,o,s,c=!1;for(;!c;){let n=aJ(e,t);switch(n.physicalStreamType){case tJ.LENGTH:iJ.DICTIONARY===n.logicalStreamType.lengthType?i=pJ(e,t,n):o=pJ(e,t,n);break;case tJ.DATA:nJ.SINGLE===n.logicalStreamType.dictionaryType||nJ.SHARED===n.logicalStreamType.dictionaryType?(a=e.subarray(t.get(),t.get()+n.byteLength),c=!0):s=e.subarray(t.get(),t.get()+n.byteLength),t.add(n.byteLength)}}if(n.type!==`complexType`)throw Error(`Shared dictionary column ${n.name} must be a complex (struct) column.`);if(!i||!a)throw Error(`Incomplete shared dictionary for column "${n.name}"`);let l=n.complexType.children,u=[],d=s?{}:void 0,f=0;for(let c of l){let l=Kq(e,t,1)[0];if(l===0)continue;let p=c.name?`${n.name}${c.name}`:n.name;if(r&&!r.has(p)){qHe(l,e,t);continue}if(c.type!==`scalarField`||c.scalarField.physicalType!==Rq.STRING)throw Error(`Currently only scalar string fields are implemented for a struct.`);if(l>1&&!c.nullable||l===1&&c.nullable)throw Error(`The number of streams for the child field ${c.name} does not match its nullability. nullibilty: ${c.nullable}, numStreams: ${l}`);let m;if(c.nullable){let n=aJ(e,t);m=new sJ(lJ(e,n.numValues,n.byteLength,t),n.numValues)}let h=fJ(e,t,aJ(e,t),void 0,m);if(s){if(!o)throw Error(`Incomplete shared FSST dictionary for column "${p}"`);u[f++]=new KUe(p,h,i,a,o,s,m,d)}else u[f++]=new EJ(p,h,i,a,m)}return u}var QUe=class extends jq{constructor(e,t,n){super(e,new Uint8Array,n??t.length),this.values=t}getValueFromBuffer(e){return this.values[e]}},DJ;(function(e){e[e.STRING=1]=`STRING`,e[e.INT32=2]=`INT32`,e[e.UINT32=4]=`UINT32`,e[e.INT64=8]=`INT64`,e[e.UINT64=16]=`UINT64`,e[e.FLOAT=32]=`FLOAT`,e[e.DOUBLE=64]=`DOUBLE`,e[e.PRESENCE=128]=`PRESENCE`})(DJ||={});var OJ;(function(e){e[e.FALSE=0]=`FALSE`,e[e.TRUE=1]=`TRUE`,e[e.START_MAP=2]=`START_MAP`,e[e.START_LIST=3]=`START_LIST`,e[e.COUNT=4]=`COUNT`})(OJ||={});function $Ue(e,t,n,r){let i=eWe(n);if(r===0)return i.map(e=>new QUe(e,[]));let a=tWe(e,t,r),o=(a.presentStream?a.presentCount:a.lengthStream.length)/i.length,s=[],c=0,l=0;for(let e=0;e<i.length;e++){let t=oWe(a,e,o,c,l);s.push(new QUe(i[e],t.value,t.nullabilityBuffer)),c=t.countsEnd,l=t.valuesEnd}return s}function eWe(e){let t=e.type===`complexType`?e.complexType.children:void 0;return!t||t.length===0?[e.name]:t.map(t=>e.name+(t.name??``))}function tWe(e,t,n){let r=e[t.get()];t.add(1);let i=fJ(e,t,aJ(e,t)),a=n-1,o=[];r&DJ.STRING&&(a-=nWe(e,t,o)),a-=rWe(e,t,r,o),a-=iWe(e,t,r,o);let s,c=0;if(r&DJ.PRESENCE){let n=aWe(e,t);s=n.value,c=n.count,a--}let l=new Uint32Array;if(a>0&&(l=fJ(e,t,aJ(e,t)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:i,dictionary:o,presentStream:s,presentCount:c,flattenedValues:l}}function nWe(e,t,n){let r=e[t.get()];t.add(1);let i=qUe(``,e,t,r);if(i)for(let e=0;e<i.size;e++)n.push(i.getValue(e));return r}function rWe(e,t,n,r){let i=0;return n&DJ.INT32?(AJ(r,dJ(e,t,aJ(e,t))),i++):n&DJ.INT64&&(AJ(r,iUe(e,t,aJ(e,t))),i++),n&DJ.UINT32?(AJ(r,fJ(e,t,aJ(e,t))),i++):n&DJ.UINT64&&(AJ(r,_J(e,t,aJ(e,t))),i++),i}function iWe(e,t,n,r){let i=0;return n&DJ.FLOAT&&(AJ(r,YHe(e,t,aJ(e,t).numValues)),i++),n&DJ.DOUBLE&&(AJ(r,XHe(e,t,aJ(e,t).numValues)),i++),i}function aWe(e,t){let n=aJ(e,t);if(n.physicalStreamType!==tJ.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${n.physicalStreamType}`);let r=n.numValues,i=t.get(),a=new sJ(lJ(e,r,n.byteLength,t),r);return t.set(i+n.byteLength),{value:a,count:r}}function oWe(e,t,n,r,i){let{lengthStream:a,flattenedValues:o,presentStream:s,dictionary:c}=e,l=t*n,u=n,d;if(s){d=new sJ(new Uint8Array(Math.ceil(n/8)),n),u=0;for(let e=0;e<n;e++)s.get(l+e)&&(d.set(e,!0),u++)}let f=r+u;if(f>a.length)throw Error(`Merged map counts underflow while decoding child streams`);let p=Array(n),m=r,h=i;for(let e=0;e<n;e++){if(s&&!s.get(l+e)){p[e]=null;continue}let t=h+a[m++];if(t>o.length)throw Error(`Map value stream underflow while decoding feature payload`);let n=sWe(o,h,t,c);p[e]=n.value,h=n.nextIndex}let g=0;for(let e=r;e<f;e++)g+=a[e];let _=i+g;if(h!==_)throw Error(`Unused flattened map values remain after decode`);return{value:p,nullabilityBuffer:d,countsEnd:f,valuesEnd:_}}function sWe(e,t,n,r){return n-t===1||e[t]===OJ.START_LIST?kJ(e,t,n,r):cWe(e,t,n,r)}function cWe(e,t,n,r){let i=Object.create(null),a=t;for(;a<n;){let t=uWe(e[a++],r);if(typeof t!=`string`)throw Error(`Map key dictionary index does not resolve to a string: ${t}`);let o=kJ(e,a,n,r);i[t]=o.value,a=o.nextIndex}return{value:i,nextIndex:a}}function kJ(e,t,n,r){if(t>=n)throw Error(`Unexpected end of map value stream`);let i=e[t];if(i===OJ.FALSE)return{value:!1,nextIndex:t+1};if(i===OJ.TRUE)return{value:!0,nextIndex:t+1};if(i===OJ.START_MAP){let i=lWe(e,t,n);return{value:cWe(e,t+2,i,r).value,nextIndex:i}}if(i===OJ.START_LIST){let i=lWe(e,t,n),a=[],o=t+2;for(;o<i;){let t=kJ(e,o,i,r);a.push(t.value),o=t.nextIndex}return{value:a,nextIndex:i}}return{value:uWe(i,r),nextIndex:t+1}}function lWe(e,t,n){if(t+1>=n)throw Error(`Missing length for nested map/list payload`);let r=e[t+1];if(r<2)throw Error(`Invalid nested payload length: ${r}`);let i=t+r;if(i>n)throw Error(`Nested payload exceeds containing payload bounds`);return i}function uWe(e,t){let n=e-OJ.COUNT;if(n<0||n>=t.length)throw Error(`Scalar dictionary index out of range: ${e}`);return t[n]}function AJ(e,t){for(let n of t)e.push(n)}function dWe(e,t,n,r,i,a){return n.type===`scalarType`?a&&!a.has(n.name)?(qHe(r,e,t),null):fWe(r,e,t,i,n.scalarType,n):n.complexType?.physicalType===zq.MAP?$Ue(e,t,n,r):r===0?null:ZUe(e,t,n,a)}function fWe(e,t,n,r,i,a){let o;if(e===0)return null;if(a.nullable){let e=aJ(t,n),r=e.numValues,i=n.get(),a=lJ(t,r,e.byteLength,n);n.set(i+e.byteLength),o=new sJ(a,e.numValues)}let s=o??r;switch(i.physicalType){case Rq.UINT_32:case Rq.INT_32:return _We(t,n,a,i,s);case Rq.STRING:{let r=a.nullable?e-1:e;return qUe(a.name,t,n,r,o)??null}case Rq.BOOLEAN:return pWe(t,n,a,r,s);case Rq.UINT_64:case Rq.INT_64:return gWe(t,n,a,s,i);case Rq.FLOAT:return mWe(t,n,a,s);case Rq.DOUBLE:return hWe(t,n,a,s);default:throw Error(`The specified data type for the field is currently not supported: ${i}`)}}function pWe(e,t,n,r,i){let a=aJ(e,t),o=a.numValues,s=t.get(),c=jJ(i)?i:void 0,l=lJ(e,o,a.byteLength,t,c);t.set(s+a.byteLength);let u=new sJ(l,o);return new BUe(n.name,u,i)}function mWe(e,t,n,r){let i=aJ(e,t),a=jJ(r)?r:void 0,o=YHe(e,t,i.numValues,a);return new VUe(n.name,o,r)}function hWe(e,t,n,r){let i=aJ(e,t),a=jJ(r)?r:void 0,o=XHe(e,t,i.numValues,a);return new Pq(n.name,o,r)}function gWe(e,t,n,r,i){let a=aJ(e,t),o=vJ(a,r,e,t,`int64`),s=i.physicalType===Rq.INT_64;if(o===oJ.FLAT){let i=jJ(r)?r:void 0,o=s?iUe(e,t,a,i):_J(e,t,a,i);return new _Ue(n.name,o,r)}if(o===oJ.SEQUENCE){let r=rUe(e,t,a);return new vUe(n.name,r[0],r[1],a.numRleValues,s)}let c=s?sUe(e,t,a):cUe(e,t,a);return new HUe(n.name,c,r,s)}function _We(e,t,n,r,i){let a=aJ(e,t),o=vJ(a,i,e,t),s=r.physicalType===Rq.INT_32;if(o===oJ.FLAT){let r=jJ(i)?i:void 0,o=s?dJ(e,t,a,void 0,r):fJ(e,t,a,void 0,r);return new Nq(n.name,o,i)}if(o===oJ.SEQUENCE){let r=nUe(e,t,a);return new Fq(n.name,r[0],r[1],a.numRleValues,s)}let c=s?tUe(e,t,a):gJ(e,t,a);return new Iq(n.name,c,i,s)}function jJ(e){return e instanceof sJ}var MJ={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function vWe(e){switch(e){case MJ.ID:case MJ.ID|MJ.ID_NULLABLE:case MJ.ID|MJ.ID_LONG:case MJ.ID|MJ.ID_LONG|MJ.ID_NULLABLE:return{nullable:(e&MJ.ID_NULLABLE)!==0,columnScope:Lq.FEATURE,type:`scalarType`,scalarType:{longID:(e&MJ.ID_LONG)!==0,type:`logicalType`,logicalType:fVe.ID}};case MJ.GEOMETRY:return{nullable:!1,columnScope:Lq.FEATURE,type:`complexType`,complexType:{type:`physicalType`,physicalType:zq.GEOMETRY,children:[]}};case MJ.STRUCT:return{nullable:!1,columnScope:Lq.FEATURE,type:`complexType`,complexType:{type:`physicalType`,physicalType:zq.STRUCT,children:[]}};case MJ.MAP:return{nullable:!0,columnScope:Lq.FEATURE,type:`complexType`,complexType:{type:`physicalType`,physicalType:zq.MAP,children:[]}};default:return wWe(e)}}function yWe(e){return e>=MJ.SCALAR_BASE}function bWe(e){return e===MJ.STRUCT||e===MJ.MAP}function xWe(e){if(e.type===`scalarType`){let t=e.scalarType;if(t.type===`physicalType`)switch(t.physicalType){case Rq.BOOLEAN:case Rq.INT_8:case Rq.UINT_8:case Rq.INT_32:case Rq.UINT_32:case Rq.INT_64:case Rq.UINT_64:case Rq.FLOAT:case Rq.DOUBLE:return!1;case Rq.STRING:return!0;default:return!1}if(t.type===`logicalType`)return!1}else if(e.type===`complexType`){let t=e.complexType;if(t.type===`physicalType`)switch(t.physicalType){case zq.GEOMETRY:case zq.STRUCT:case zq.MAP:return!0;default:return!1}}return console.warn(`Unexpected column type in hasStreamCount`,e),!1}function SWe(e){return e.type===`scalarType`&&e.scalarType?.type===`logicalType`&&e.scalarType.logicalType===fVe.ID}function CWe(e){return e.type===`complexType`&&e.complexType?.type===`physicalType`&&e.complexType.physicalType===zq.GEOMETRY}function wWe(e){let t;switch(e){case 10:case 11:t=Rq.BOOLEAN;break;case 12:case 13:t=Rq.INT_8;break;case 14:case 15:t=Rq.UINT_8;break;case 16:case 17:t=Rq.INT_32;break;case 18:case 19:t=Rq.UINT_32;break;case 20:case 21:t=Rq.INT_64;break;case 22:case 23:t=Rq.UINT_64;break;case 24:case 25:t=Rq.FLOAT;break;case 26:case 27:t=Rq.DOUBLE;break;case 28:case 29:t=Rq.STRING;break;default:return null}return{nullable:!!(e&1),columnScope:Lq.FEATURE,type:`scalarType`,scalarType:{longID:!1,type:`physicalType`,physicalType:t}}}var TWe=new TextDecoder,EWe=`0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)`;function NJ(e,t){let n=Kq(e,t,1)[0];if(n===0)return``;let r=t.get(),i=r+n,a=e.subarray(r,i);return t.add(n),TWe.decode(a)}function DWe(e){let t=e.name,n=e.nullable;return e.type===`scalarType`?{type:`scalarField`,scalarField:e.scalarType,name:t,nullable:n}:{type:`complexField`,complexField:e.complexType,name:t,nullable:n}}function OWe(e,t){let n=Kq(e,t,1)[0]>>>0,r=n>=MJ.SCALAR_BASE?vWe(n):null;if(!r)throw Error(`Unsupported field type code ${n}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let i={...r,name:NJ(e,t)};if(i.type===`complexType`&&bWe(n)){let n=i.complexType,r=Kq(e,t,1)[0]>>>0;n.children=Array(r);for(let i=0;i<r;i++)n.children[i]=OWe(e,t)}return DWe(i)}function kWe(e,t){let n=Kq(e,t,1)[0]>>>0,r=vWe(n);
vendor: 4,377 bytes, line 409
409if(!r)throw Error(`Unsupported column type code ${n}. Supported: ${EWe}`);let i;if(yWe(n))i=NJ(e,t);else if(n<MJ.GEOMETRY)i=`id`;else if(n===MJ.GEOMETRY)i=`geometry`;else throw Error(`Unsupported column type code ${n}. Supported: ${EWe}`);let a={...r,name:i};if(a.type===`complexType`&&bWe(n)){let n=Kq(e,t,1)[0]>>>0,r=a.complexType;r.children=Array(n);for(let i=0;i<n;i++)r.children[i]=OWe(e,t)}return a}function AWe(e,t){let n={};n.featureTables=[];let r={};if(r.name=NJ(e,t),r.name.length===0)throw Error(`Missing layer name`);let i=Kq(e,t,1)[0]>>>0,a=Kq(e,t,1)[0]>>>0;r.columns=Array(a);for(let n=0;n<a;n++)r.columns[n]=kWe(e,t);return n.featureTables.push(r),[n,i]}function jWe(e,t,n=!0){let r=new pVe(0),i=[];for(;r.get()<e.length;){let a=Kq(e,r,1)[0]>>>0,o=r.get()+a;if(o>e.length)throw Error(`Block overruns tile: ${o} > ${e.length}`);let s=Kq(e,r,1)[0]>>>0;if(s!==1&&s!==2){r.set(o);continue}let[c,l]=AWe(e,r),u=c.featureTables[0],d=null,f=null,p=[],m=0;for(let i of u.columns){let a=i.name;if(SWe(i)){let t=null;if(i.nullable){let n=aJ(e,r),i=r.get(),a=lJ(e,n.numValues,n.byteLength,r);r.set(i+n.byteLength),t=new sJ(a,n.numValues)}let o=aJ(e,r);m=t?t.size():o.decompressedCount,d=MWe(e,i,r,a,o,t??m,n)}else if(CWe(i)){let n=Kq(e,r,1)[0];if(m===0){let t=r.get();m=aJ(e,r).decompressedCount,r.set(t)}t&&(t.scale=t.extent/l),f=IUe(e,n,r,m,t)}else{let t=xWe(i)?Kq(e,r,1)[0]:1;if(t===0)continue;let n=dWe(e,r,i,t,m,void 0);if(n)if(Array.isArray(n))for(let e of n)p.push(e);else p.push(n)}}let h=new dVe(u.name,f,d,p,l);i.push(h),r.set(o)}return i}function MWe(e,t,n,r,i,a,o=!1){let s=t.scalarType?.longID?Rq.UINT_64:Rq.UINT_32,c=typeof a==`number`?void 0:a,l=vJ(i,a,e,n,s===Rq.UINT_64?`int64`:`int32`);if(s===Rq.UINT_32)switch(l){case oJ.FLAT:return new Nq(r,fJ(e,n,i,void 0,c),a);case oJ.SEQUENCE:{let t=nUe(e,n,i);return new Fq(r,t[0],t[1],i.numRleValues,!1)}case oJ.CONST:return new Iq(r,gJ(e,n,i),a,!1)}switch(l){case oJ.FLAT:return o?new Pq(r,aUe(e,n,i,c),a):new _Ue(r,_J(e,n,i,c),a);case oJ.SEQUENCE:{let t=rUe(e,n,i);return new vUe(r,t[0],t[1],i.numRleValues,!1)}case oJ.CONST:return new HUe(r,cUe(e,n,i),a,!1)}throw Error(`Vector type not supported for id column.`)}var NWe=class{constructor(e,t){switch(this._featureData=e,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case bJ.POINT:case bJ.MULTIPOINT:this.type=1;break;case bJ.LINESTRING:case bJ.MULTILINESTRING:this.type=2;break;case bJ.POLYGON:case bJ.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=t,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let t of this._featureData.geometry.coordinates){let n=[];for(let e of t)n.push(new K(e.x,e.y));e.push(n)}return e}},PWe=class{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new NWe(this.features[e],this.extent)}},FWe=class{constructor(e){this.layers={};let t=jWe(new Uint8Array(e));this.layers=t.reduce((e,t)=>({...e,[t.name]:new PWe(t)}),{})}};BU(`FeatureIndex`,class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new RU(q,16,0),this.grid3D=new RU(q,16,0),this.featureIndexArray=new nG,this.promoteId=t}insert(e,t,n,r,i,a){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i);let s=a?this.grid3D:this.grid;for(let e of t){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)t[0]=Math.min(t[0],n.x),t[1]=Math.min(t[1],n.y),t[2]=Math.max(t[2],n.x),t[3]=Math.max(t[3],n.y);t[0]<8192&&t[1]<8192&&t[2]>=0&&t[3]>=0&&s.insert(o,t[0],t[1],t[2],t[3])}}loadVTLayers(){if(!this.vtLayers){switch(this.encoding){case`mlt`:this.vtLayers=new FWe(this.rawTileData).layers;break;default:this.vtLayers=new gze(new gBe(this.rawTileData)).layers}this.sourceLayerCoder=new cVe(this.vtLayers?Object.keys(this.vtLayers).sort():[Aq])}return this.vtLayers}query(e,t,n,r){this.loadVTLayers();let i=e.params,a=q/e.tileSize/e.scale,o=JH(i.filter,`queryRenderedFeatures filter`,i.globalState),s=e.queryGeometry,c=e.queryPadding*a,l=UK.fromPoints(s),u=this.grid.query(l.minX-c,l.minY-c,l.maxX+c,l.maxY+c),d=UK.fromPoints(e.cameraQueryGeometry).expandBy(c),f=this.grid3D.query(d.minX,d.minY,d.maxX,d.maxY,(t,n,r,i)=>zLe(e.cameraQueryGeometry,t-c,n-c,r+c,i+c));for(let e of f)u.push(e);u.sort(LWe);let p={},m;
vendor: 4,228 bytes, line 409
409for(let c of u){if(c===m)continue;m=c;let l=this.featureIndexArray.get(c),u=null;this.loadMatchingFeature(p,l.bucketIndex,l.sourceLayerIndex,l.featureIndex,o,i.layers,i.availableImages,t,n,r,(t,n,r)=>(u||=RG(t),n.queryIntersectsFeature({queryGeometry:s,feature:t,featureState:r,geometry:u,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return p}loadMatchingFeature(e,t,n,r,i,a,o,s,c,l,u){let d=this.bucketLayerIDs[t];if(a&&!d.some(e=>a.has(e)))return;let f=this.sourceLayerCoder.decode(n),p=this.vtLayers[f].feature(r);if(i.needGeometry){let e=zG(p,!0);if(!i.filter(new XU(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new XU(this.tileID.overscaledZ),p))return;let m=this.getId(p,f);for(let t of d){if(a&&!a.has(t))continue;let n=s[t];if(!n)continue;let i={};m&&l&&(i=l.getState(n.sourceLayer||`_geojsonTileLayer`,m));let d=oz({},c[t]);d.paint=IWe(d.paint,n.paint,p,i,o),d.layout=IWe(d.layout,n.layout,p,i,o);let f=!u||u(p,n,i);if(!f)continue;let h=new lVe(p,this.z,this.x,this.y,m);h.layer=d;let g=e[t];g===void 0&&(g=e[t]=[]),g.push({featureIndex:r,feature:h,intersectionZ:f})}}lookupSymbolFeatures(e,t,n,r,i,a,o,s){let c={};this.loadVTLayers();let l=JH(i.filterSpec,`queryRenderedFeatures symbol filter`,i.globalState);for(let i of e)this.loadMatchingFeature(c,n,r,i,l,a,o,s,t);return c}hasLayer(e){for(let t of this.bucketLayerIDs)for(let n of t)if(e===n)return!0;return!1}getId(e,t){let n=e.id;if(this.promoteId){let r=typeof this.promoteId==`string`?this.promoteId:this.promoteId[t];n=e.properties[r],typeof n==`boolean`&&(n=Number(n)),n===void 0&&e.properties?.cluster&&this.promoteId&&(n=Number(e.properties.cluster_id))}return n}},{omit:[`rawTileData`,`sourceLayerCoder`]});function IWe(e,t,n,r,i){return fz(e,(e,a)=>{let o=t instanceof iW?t.get(a):null;return o?.evaluate?o.evaluate(n,r,i):o})}function LWe(e,t){return t-e}var RWe=class{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,n){let r=e.wrapped().key;this.data[r]===void 0&&(this.data[r]=[]);let i={value:t,timeout:void 0};if(n!==void 0&&(i.timeout=setTimeout(()=>{this.remove(e,i)},n)),this.data[r].push(i),this.order.push(r),this.order.length>this.max){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){let t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;let n=e.wrapped().key,r=t===void 0?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){let t=[];for(let n in this.data)for(let r of this.data[n])e(r.value)||t.push(r);for(let e of t)this.remove(e.value.tileID,e)}};function zWe(e,t,n,r,i){let a=[];for(let o of e){let e;for(let s=0;s<o.length-1;s++){let c=o[s],l=o[s+1];c.x<t&&l.x<t||(c.x<t?c=new K(t,c.y+(l.y-c.y)*((t-c.x)/(l.x-c.x)))._round():l.x<t&&(l=new K(t,c.y+(l.y-c.y)*((t-c.x)/(l.x-c.x)))._round()),!(c.y<n&&l.y<n)&&(c.y<n?c=new K(c.x+(l.x-c.x)*((n-c.y)/(l.y-c.y)),n)._round():l.y<n&&(l=new K(c.x+(l.x-c.x)*((n-c.y)/(l.y-c.y)),n)._round()),!(c.x>=r&&l.x>=r)&&(c.x>=r?c=new K(r,c.y+(l.y-c.y)*((r-c.x)/(l.x-c.x)))._round():l.x>=r&&(l=new K(r,c.y+(l.y-c.y)*((r-c.x)/(l.x-c.x)))._round()),!(c.y>=i&&l.y>=i)&&(c.y>=i?c=new K(c.x+(l.x-c.x)*((i-c.y)/(l.y-c.y)),i)._round():l.y>=i&&(l=new K(c.x+(l.x-c.x)*((i-c.y)/(l.y-c.y)),i)._round()),(!e||!c.equals(e[e.length-1]))&&
409(e=[c],a.push(e)),e.push(l)))))}}return a}BU(`Anchor`,class e extends K{constructor(e,t,n,r){super(e,t),this.angle=n,r!==void 0&&(this.segment=r)}clone(){return new e(this.x,this.y,this.angle,this.segment)}});var BWe=function(e){return e[e.center=1]=`center`,e[e.left=2]=`left`,e[e.right=3]=`right`,e[e.top=4]=`top`,e[e.bottom=5]=`bottom`,e[e[`top-left`]=6]=`top-left`,e[e[`top-right`]=7]=`top-right`,e[e[`bottom-left`]=8]=`bottom-left`,e[e[`bottom-right`]=9]=`bottom-right`,e}({});function VWe(e){switch(e){case`right`:case`top-right`:case`bottom-right`:return`right`;case`left`:case`top-left`:case`bottom-left`:return`left`}return`center`}var HWe=`6.6.0`;function UWe(){var e=new $L(4);return $L!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function WWe(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*a-i*r;return o?(o=1/o,e[0]=a*o,e[1]=-r*o,e[2]=-i*o,e[3]=n*o,e):null}function GWe(e){return e[0]*e[3]-e[2]*e[1]}function KWe(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+a*s,e[1]=i*c+o*s,e[2]=r*-s+a*c,e[3]=i*-s+o*c,e}var PJ,qWe,FJ,IJ={frame(e,t,n,r){let i=r||window,a=i.requestAnimationFrame(e=>{o(),t(e)}),{unsubscribe:o}=Cz(e.signal,`abort`,()=>{o(),i.cancelAnimationFrame(a),n(new Nz(e.signal.reason))},!1)},frameAsync(e,t){return new Promise((n,r)=>{this.frame(e,n,r,t)})},getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t=window.document.createElement(`canvas`),n=t.getContext(`2d`,{willReadFrequently:!0});if(!n)throw Error(`failed to create canvas 2d context`);return t.width=e.width,t.height=e.height,n.drawImage(e,0,0,e.width,e.height),n},resolveURL(e){return PJ||=document.createElement(`a`),PJ.href=e,PJ.href},get hardwareConcurrency(){return typeof navigator<`u`&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return FJ===void 0?matchMedia?(qWe??=matchMedia(`(prefers-reduced-motion: reduce)`),qWe.matches):!1:FJ},set prefersReducedMotion(e){FJ=e}},JWe=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt===null?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function LJ(){return JWe.getCurrentTime()}var RJ=class e{static{this.docStyle=typeof window<`u`&&window.document?.documentElement.style}static{this.selectProp=!e.docStyle||`userSelect`in e.docStyle?`userSelect`:`webkitUserSelect`}static create(e,t,n){let r=window.document.createElement(e);return t!==void 0&&(r.className=t),n&&n.appendChild(r),r}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){e.docStyle&&e.selectProp&&(e.userSelect=e.docStyle[e.selectProp],e.docStyle[e.selectProp]=`none`)}static enableDrag(){e.docStyle&&e.selectProp&&(e.docStyle[e.selectProp]=e.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener(`click`,e.suppressClickInternal,!0)}static suppressClick(){window.addEventListener(`click`,e.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener(`click`,e.suppressClickInternal,!0)},0)}static getScale(e){let t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,t,n){let r=t.boundingClientRect;return new K((n.clientX-r.left)/t.x-e.clientLeft,(n.clientY-r.top)/t.y-e.clientTop)}static mousePos(t,n){let r=e.getScale(t);return e.getPoint(t,r,n)}static touchPos(t,n){let r=[],i=e.getScale(t);for(let a of n)r.push(e.getPoint(t,i,a));return r}static sanitize(t){let n=new DOMParser().parseFromString(t,`text/html`).body||document.createElement(`body`),r=n.querySelectorAll(`script`);for(let e of r)e.remove();return e.clean(n),n.innerHTML}static isPossiblyDangerous(e,t){let n=t.replace(/\s+/g,``).toLowerCase();if([`src`,`href`,`xlink:href`].includes(e)&&(n.includes(`javascript:`)||n.includes(`data:`))||e.startsWith(`on`))return!0}static clean(t){let n=t.children;for(let t of n)e.removeAttributes(t),e.clean(t)}static removeAttributes(t){for(let{name:n,value:r}of Array.from(t.attributes))e.isPossiblyDangerous(n,r)&&t.removeAttribute(n)}},zJ;(function(e){let t,n,r,i;e.resetRequestQueue=()=>{t=[],n=0,r=0,i={}},e.addThrottleControl=e=>{let t=r++;return i[t]=e,t},e.removeThrottleControl=e=>{delete i[e],l()};let a=()=>{for(let e of Object.keys(i))if(i[e]())return!0;return!1};async function o(e,t,n,r,i=!0,a){let o=await e.transformRequest(t,n);return Fz(r.signal),zJ.getImage(o,r,i,a)}e.transformAndGetImage=o,e.getImage=(e,n,r=!0,i)=>new Promise((a,o)=>{e.headers||={},e.headers.accept=`image/webp,*/*`,oz(e,{type:`image`});let s={abortController:n,requestParameters:e,supportImageRefresh:r,imageBitmapOptions:i,state:`queued`,onError:e=>{o(e)},onSuccess:e=>{a(e)}};t.push(s),l()});let s=(e,t)=>typeof createImageBitmap==`function`?kPe(e,t):APe(e),c=async e=>{e.state=`running`;
vendor: 9,282 bytes, line 409
409let{requestParameters:t,supportImageRefresh:r,imageBitmapOptions:i,onError:a,onSuccess:o,abortController:c}=e,d=r===!1&&!i&&!yz(self)&&!Lz(t.url)&&(!t.headers||Object.keys(t.headers).reduce((e,t)=>e&&t===`accept`,!0));n++;let f=d?u(t,c):Vz(t,c);try{let t=await f;delete e.abortController,e.state=`completed`,t.data instanceof HTMLImageElement||xz(t.data)?o(t):t.data&&o({data:await s(t.data,i),cacheControl:t.cacheControl,expires:t.expires})}catch(t){delete e.abortController,a(VR(t))}finally{n--,l()}},l=()=>{let e=a()?Iz.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:Iz.MAX_PARALLEL_IMAGE_REQUESTS;for(let r=n;r<e&&t.length>0;r++){let e=t.shift();if(e.abortController.signal.aborted){r--;continue}c(e)}},u=(e,t)=>new Promise((n,r)=>{let i=new Image,a=e.url,o=e.credentials;o&&o===`include`?i.crossOrigin=`use-credentials`:(o&&o===`same-origin`||!Uz(a))&&(i.crossOrigin=`anonymous`),t.signal.addEventListener(`abort`,()=>{i.src=``,r(new Nz(t.signal.reason))}),i.fetchPriority=`high`,i.onload=()=>{i.onerror=i.onload=null,n({data:i})},i.onerror=()=>{i.onerror=i.onload=null,!t.signal.aborted&&r(Error(`Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))},i.src=a})})(zJ||={}),zJ.resetRequestQueue();var YWe=class{constructor(e){this._transformRequestFn=e??null}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}},BJ=class extends Kz{},VJ=class extends BJ{},XWe=class extends BJ{constructor(e={}){super(`style.load`,e)}},HJ=class extends BJ{constructor(e,t={}){super(e,t),this.dataType=`style`}},UJ=class extends BJ{constructor(e,t={}){super(e,t),this.dataType=`source`}},WJ=class extends BJ{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n,r={}){n=n instanceof MouseEvent?n:new MouseEvent(e,n);let i=RJ.mousePos(t.getCanvas(),n),a=t.unproject(i);super(e,oz({point:i,lngLat:a,originalEvent:n},r)),this._defaultPrevented=!1,this.target=t}},GJ=class extends BJ{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){let r=e===`touchend`?n.changedTouches:n.touches,i=RJ.touchPos(t.getCanvasContainer(),r),a=i.map(e=>t.unproject(e)),o=i.reduce((e,t,n,r)=>e.add(t.div(r.length)),new K(0,0)),s=t.unproject(o);super(e,{points:i,point:o,lngLats:a,lngLat:s,originalEvent:n}),this._defaultPrevented=!1}},ZWe=class extends BJ{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super(`wheel`,{originalEvent:t}),this._defaultPrevented=!1}},QWe=class extends BJ{},$We=class extends BJ{constructor(e={}){super(`terrain`,e)}},eGe=class extends BJ{constructor(e={}){super(`projectiontransition`,e)}},KJ=class extends BJ{},tGe=class extends BJ{constructor(e={}){super(`styleimagemissing`,e)}};function qJ(e){let t=[];if(typeof e==`string`)t.push({id:`default`,url:e});else if(e&&e.length>0){let n=[];for(let{id:r,url:i}of e){let e=`${r}${i}`;n.includes(e)||(n.push(e),t.push({id:r,url:i}))}}return t}function nGe(e,t,n){try{let r=new URL(e);return r.pathname+=`${t}${n}`,r.toString()}catch{throw Error(`Invalid sprite URL "${e}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}async function rGe(e,t,n,r){let i=qJ(e),a=n>1?`@2x`:``,o={},s={};for(let{id:e,url:n}of i){o[e]=Hz(await t.transformRequest(nGe(n,a,`.json`),`SpriteJSON`),r);let i=await t.transformRequest(nGe(n,a,`.png`),`SpriteImage`);s[e]=zJ.getImage(i,r)}return await Promise.all([...Object.values(o),...Object.values(s)]),iGe(o,s)}async function iGe(e,t){let n={};for(let r in e){n[r]={};let i=IJ.getImageCanvasContext((await t[r]).data),a=(await e[r]).data;for(let e in a){let{width:t,height:o,x:s,y:c,sdf:l,pixelRatio:u,stretchX:d,stretchY:f,content:p,textFitWidth:m,textFitHeight:h}=a[e],g={width:t,height:o,x:s,y:c,context:i};n[r][e]={data:null,pixelRatio:u,sdf:l,stretchX:d,stretchY:f,content:p,textFitWidth:m,textFitHeight:h,spriteData:g}}}return n}var aGe=class extends Jz{constructor(){super(),this.images={},this.updateVersion=0,this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this._spriteImagesIds={},this._imagesIds=null,this._renderCallbacksDispatchedThisFrame={}}destroy(){for(let e of Object.keys(this.images))this.removeImage(e);this._spriteImagesIds={}}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){let t=this.images[e];if(t&&!t.data&&t.spriteData){let e=t.spriteData;t.data=new aK({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),t.spriteData=null}return t}addImage(e,t){if(this.images[e])throw Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t,this._imagesIds=null,t.isWebGLImage&&this.updateImage(e,t,!1))}_validate(e,t){let n=!0,r=t.data||t.spriteData;return this._validateStretch(t.stretchX,r?.width)||(this.fire(new qz(Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(t.stretchY,r?.height)||(this.fire(new qz(Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(t.content,t)||(this.fire(new qz(Error(`Image "${e}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let n=0;for(let r of e){if(r[0]<n||r[1]<r[0]||t<r[1])return!1;n=r[1]}return!0}_validateContent(e,t){if(!e)return!0;if(e.length!==4)return!1;let n=t.spriteData,r=n?.width||t.data.width,i=n?.height||t.data.height;return e[0]<0||r<e[0]||e[1]<0||i<e[1]||e[2]<0||r<e[2]||e[3]<0||i<e[3]||e[2]<e[0]?!1:e[3]>=e[1]}updateImage(e,t,n=!0){let r=this.images[e];if(n){let e=r.data||r.spriteData;if(e.width!==t.data.width||e.height!==t.data.height)throw Error(`size mismatch between old image (${e.width}x${e.height}) and new image (${t.data.width}x${t.data.height}).`)}t.version=(r.version??0)+1,this.images[e]=t,this.updateVersion++}removeImage(e){let t=this.images[e];t&&(delete this.images[e],this._imagesIds=null,t.userImage?.onRemove&&t.userImage.onRemove())}listImages(){return this._imagesIds??=Object.keys(this.images),this._imagesIds}_getSpriteImageId(e,t){return e==="default"?t:`${e}:${t}`}setSpriteImages(e,t){let n=this._spriteImagesIds[e]??[],r=[];for(let n in t){let i=this._getSpriteImageId(e,n);r.push(i),i in this.images?this.updateImage(i,t[n],!1):this.addImage(i,t[n])}let i=new Set(r),a=n.filter(e=>!i.has(e));for(let e of a)this.removeImage(e);return this._spriteImagesIds[e]=r,{loaded:r,removed:a}}removeSpriteImages(e){let t=this._spriteImagesIds[e]??[];for(let e of t)this.removeImage(e);return delete this._spriteImagesIds[e],t}removeAllSpriteImages(){let e=Object.values(this._spriteImagesIds).flat();for(let t of e)this.removeImage(t);return this._spriteImagesIds={},e}setMissingImageResolver(e){this.missingImageResolver=e}getImages(e){return new Promise((t,n)=>{let r=!0;if(!this.isLoaded())for(let t of e)this.images[t]||(r=!1);this.isLoaded()||r?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})})}async _getImagesForIds(e){let t=new Set(e.filter(e=>!this.getImage(e))),n=this.missingImageResolver;n&&await Promise.allSettled(Array.from(t,e=>n(e)));let r={};for(let n of e){let e=this.getImage(n);e&&(t.delete(n),r[n]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:!!e.userImage?.render,isWebGLImage:e.isWebGLImage})}for(let e of t)this.fire(new tGe({id:e})),_z(`Image "${e}" could not be loaded. Please make sure you have added the image before it is needed with map.addImage(), resolved it with map.setMissingStyleImageResolver(), or included it in a "sprite" property in your style.`);return r}beginFrame(){this._renderCallbacksDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let t of e){if(this._renderCallbacksDispatchedThisFrame[t])continue;this._renderCallbacksDispatchedThisFrame[t]=!0;let e=this.getImage(t);e||_z(`Image with ID: "${t}" was not found`),wBe(e)&&this.updateImage(t,e)}}cloneImages(){let e={};for(let t in this.images){let n=this.images[t];e[t]={...n,data:n.data?n.data.clone():null}}return e}},oGe=class{constructor(e){this._imageManager=e,this._entries={},this._image=new aK({width:1,height:1}),this._dirty=!0}destroy(){this._texture&&=(this._texture.destroy(),null),this._entries={},this._image=new aK({width:1,height:1}),this._dirty=!0}getPixelSize(){let{width:e,height:t}=this._image;return{width:e,height:t}}getPattern(e){let t=this._imageManager.getImage(e);if(!t)return null;let n=this._entries[e];if(n?.image!==t){let n={w:t.data.width+2,h:t.data.height+2,x:0,y:0};this._entries[e]={bin:n,position:new mq(n,t),image:t}}else if(n.position.version!==t.version)n.position.version=t.version;else return n.position;return this._update(),this._entries[e].position}bind(e){let t=e.gl;this._texture?this._dirty&&=(this._texture.update(this._image),!1):(this._texture=new uK(e,this._image,t.RGBA),this._dirty=!1),this._texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}
409_update(){for(let e in this._entries)this._imageManager.getImage(e)||delete this._entries[e];let e=[];for(let t in this._entries)e.push(this._entries[t].bin);let{w:t,h:n}=TBe(e),r=this._image;r.resize({width:t||1,height:n||1});for(let e in this._entries){let{bin:t}=this._entries[e],n=t.x+1,i=t.y+1,a=this._entries[e].image.data,o=a.width,s=a.height;aK.copy(a,r,{x:0,y:0},{x:n,y:i},{width:o,height:s}),aK.copy(a,r,{x:0,y:s-1},{x:n,y:i-1},{width:o,height:1}),aK.copy(a,r,{x:0,y:0},{x:n,y:i+s},{width:o,height:1}),aK.copy(a,r,{x:o-1,y:0},{x:n-1,y:i},{width:1,height:s}),aK.copy(a,r,{x:0,y:0},{x:n+o,y:i},{width:1,height:s})}this._dirty=!0}};async function sGe(e,t,n,r){let i=t*256,a=i+255,o=await BPe(await r.transformRequest(n.replace(`{fontstack}`,e).replace(`{range}`,`${i}-${a}`),`Glyphs`),new AbortController);if(!o?.data)throw Error(`Could not load glyph range. range: ${t}, ${i}-${a}`);let s={};for(let e of CBe(o.data))s[e.id]=e;return s}var JJ=0x56bc75e2d63100000,YJ=new Float64Array(256);for(let e=0;e<256;e++){let t=.5-(e/255)**(1/2.2);YJ[e]=t*Math.abs(t)}YJ[255]=-0x56bc75e2d63100000;var cGe=class{constructor({fontSize:e=24,buffer:t=3,radius:n=8,cutoff:r=.25,fontFamily:i=`sans-serif`,fontWeight:a=`normal`,fontStyle:o=`normal`,lang:s=null}={}){this.buffer=t,this.radius=n,this.cutoff=r,this.lang=s;let c=this.size=e+t*4,l=this._createCanvas(c),u=this.ctx=l.getContext(`2d`,{willReadFrequently:!0});u.font=`${o} ${a} ${e}px ${i}`,u.textBaseline=`alphabetic`,u.textAlign=`left`,u.fillStyle=`black`,this.gridOuter=new Float64Array(c*c),this.gridInner=new Float64Array(c*c),this.f=new Float64Array(c),this.z=new Float64Array(c+1),this.v=new Uint16Array(c)}_createCanvas(e){if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(e,e);let t=document.createElement(`canvas`);return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:r,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(n),s=Math.floor(-i),c=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a)-s)),l=Math.max(0,Math.min(this.size-this.buffer,o+Math.ceil(r))),u=c+2*this.buffer,d=l+2*this.buffer,f=Math.max(u*d,0),p=new Uint8ClampedArray(f),m={data:p,width:u,height:d,glyphWidth:c,glyphHeight:l,glyphTop:o,glyphLeft:s,glyphAdvance:t};if(c===0||l===0)return m;let{ctx:h,buffer:g,gridInner:_,gridOuter:v}=this;this.lang&&(h.lang=this.lang),h.clearRect(g,g,c,l),h.fillText(e,g-s,g+o);let y=h.getImageData(g,g,c,l);v.fill(JJ,0,f),_.fill(0,0,f);let b=3;for(let e=0;e<l;e++){let t=(e+g)*u+g;for(let e=0;e<c;e++,b+=4,t++){let e=y.data[b];if(e===0)continue;let n=YJ[e];v[t]=Math.max(0,n),_[t]=Math.max(0,-n)}}lGe(v,0,0,u,d,u,this.f,this.v,this.z);let x=Math.min(g,1);lGe(_,g-x,g-x,c+2*x,l+2*x,u,this.f,this.v,this.z);let S=255/this.radius,C=255*(1-this.cutoff);for(let e=0;e<f;e++){let t=Math.sqrt(v[e])-Math.sqrt(_[e]);p[e]=Math.round(C-S*t)}return m}};function lGe(e,t,n,r,i,a,o,s,c){for(let l=t;l<t+r;l++)uGe(e,n*a+l,a,i,o,s,c);for(let l=n;l<n+i;l++)uGe(e,l*a+t,1,r,o,s,c)}function uGe(e,t,n,r,i,a,o){a[0]=0,o[0]=-0x56bc75e2d63100000,o[1]=JJ,i[0]=e[t];for(let s=1,c=0,l=0;s<r;s++){i[s]=e[t+s*n];let r=s*s;do{let e=a[c];l=(i[s]-i[e]+r-e*e)/(s-e)/2}while(l<=o[c]&&--c>-1);c++,a[c]=s,o[c]=l,o[c+1]=JJ}for(let s=0,c=0;s<r;s++){for(;o[c+1]<s;)c++;let r=a[c],l=s-r;e[t+s*n]=i[r]+l*l}}var dGe=J.layout_symbol[`text-font`].default.join(`,`),fGe=class e{static{this.loadGlyphRange=sGe}static{this.TinySDF=cGe}constructor(e,t,n){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={},this.lang=n}setURL(e){this.url=e}async getGlyphs(e){let t=[];for(let n in e)for(let r of e[n])t.push(this._getAndCacheGlyphsPromise(n,r));let n=await Promise.all(t),r={};for(let{stack:e,id:t,glyph:i}of n)r[e]||={},r[e][t]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics};return r}async _getAndCacheGlyphsPromise(e,t){this.entries[e]??={glyphs:{},requests:{},ranges:{}};let n=this.entries[e],r=n.glyphs[t];return r===void 0?!this.url||this._charUsesLocalIdeographFontFamily(t)?(r=n.glyphs[t]=await this._drawGlyph(n,e,t),{stack:e,id:t,glyph:r}):await this._downloadAndCacheRangePromise(e,t):{stack:e,id:t,glyph:r}}async _downloadAndCacheRangePromise(t,n){let r=this.entries[t],i=Math.floor(n/256);if(r.ranges[i])return{stack:t,id:n,glyph:null};r.requests[i]||=e.loadGlyphRange(t,i,this.url,this.requestManager);try{let e=await r.requests[i];for(let t in e)r.glyphs[+t]=e[+t];return r.ranges[i]=!0,{stack:t,id:n,glyph:e[n]||null}}catch(e){let a=r.glyphs[n]=await this._drawGlyph(r,t,n);return this._warnOnMissingGlyphRange(a,i,n,VR(e)),{stack:t,id:n,glyph:a}}}_warnOnMissingGlyphRange(e,t,n,r){let i=t*256;_z(`Unable to load glyph range ${t}, ${i}-${i+255}. Rendering codepoint U+${n.toString(16).padStart(4,`0`).toUpperCase()} locally instead. ${r}`)}_charUsesLocalIdeographFontFamily(e){return!!this.localIdeographFontFamily&&YIe(e)}
409async _drawGlyph(e,t,n){let r=t===dGe&&this.localIdeographFontFamily!==``&&this._charUsesLocalIdeographFontFamily(n),i=r?`ideographTinySDF`:`tinySDF`;e[i]||=this._createTinySDF(r?this.localIdeographFontFamily:t);let a=(await e[i]).draw(String.fromCodePoint(n)),o=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(n));return{id:n,bitmap:new iK({width:a.width||60,height:a.height||60},a.data),metrics:{width:o?0:a.glyphWidth/2||24,height:a.glyphHeight/2||24,left:a.glyphLeft/2+.5||0,top:a.glyphTop/2-27.5||-8,advance:o?0:a.glyphAdvance/2||24,isDoubleResolution:!0}}}async _createTinySDF(t){let n=t?t.split(`,`):[];n.push(`sans-serif`);let r=n.map(e=>/[-\w]+/.test(e)?e:`'${CSS.escape(e)}'`).join(`,`),i=this._fontWeight(n[0]),a=this._fontStyle(n[0]);if(typeof document<`u`&&document.fonts?.load)try{await document.fonts.load(`${a} ${i||`normal`} 48px ${r}`)}catch(e){_z(`Failed to load font "${r}": ${VR(e).message}`)}return new e.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:r,fontWeight:i,fontStyle:a,lang:this.lang})}_fontStyle(e){return/italic/i.test(e)?`italic`:/oblique/i.test(e)?`oblique`:`normal`}_fontWeight(e){let t={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},n;for(let[r,i]of Object.entries(t))RegExp(`\\b${r}\\b`,`i`).test(e)&&(n=`${i}`);return n}destroy(){for(let e in this.entries){let t=this.entries[e];t.tinySDF=null,t.ideographTinySDF=null,t.glyphs={},t.requests={},t.ranges={}}this.entries={}}},pGe,mGe=()=>pGe||=new fW({anchor:new sW(J.light.anchor,`anchor`),position:new sW(J.light.position,`position`),color:new sW(J.light.color,`color`),intensity:new sW(J.light.intensity,`intensity`)}),hGe=class extends Jz{constructor(e,t){super(),this._transitionable=new eW(mGe(),`light`,t),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}getCartesianPosition(){return EPe(this.properties.get(`position`))}setLight(e,t={}){if(!this._validate(NU.light,e,t))for(let t in e){let n=e[t];t.endsWith(`-transition`)?this._transitionable.setTransition(t.slice(0,-ZU.length),n):this._transitionable.setValue(t,n)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,t,n){return LU(this,e,{value:t},n)}},gGe,_Ge=()=>gGe||=new fW({"sky-color":new sW(J.sky[`sky-color`],`sky-color`),"horizon-color":new sW(J.sky[`horizon-color`],`horizon-color`),"fog-color":new sW(J.sky[`fog-color`],`fog-color`),"fog-ground-blend":new sW(J.sky[`fog-ground-blend`],`fog-ground-blend`),"horizon-fog-blend":new sW(J.sky[`horizon-fog-blend`],`horizon-fog-blend`),"sky-horizon-blend":new sW(J.sky[`sky-horizon-blend`],`sky-horizon-blend`),"atmosphere-blend":new sW(J.sky[`atmosphere-blend`],`atmosphere-blend`)}),vGe=class extends Jz{constructor(e,t){super(),this._transitionable=new eW(_Ge(),`sky`,t),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new XU(0))}setSky(e,t={}){if(!this._validate(NU.sky,e,t)){e||={"sky-color":`transparent`,"horizon-color":`transparent`,"fog-color":`transparent`,"fog-ground-blend":1,"atmosphere-blend":0};for(let t in e){let n=e[t];t.endsWith(`-transition`)?this._transitionable.setTransition(t.slice(0,-ZU.length),n):this._transitionable.setValue(t,n)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,t,n={}){return LU(this,e,{value:t},n)}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}},yGe=class{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){let n=e.join(`,`)+String(t);return this.dashEntry[n]||=this.addDash(e,t),this.dashEntry[n]}
vendor: 19,566 bytes, line 409
409getDashRanges(e,t,n){let r=e.length%2==1,i=[],a=r?-e[e.length-1]*n:0,o=e[0]*n,s=!0;i.push({left:a,right:o,isDash:s,zeroLength:e[0]===0});let c=e[0];for(let t=1;t<e.length;t++){s=!s;let r=e[t];a=c*n,c+=r,o=c*n,i.push({left:a,right:o,isDash:s,zeroLength:r===0})}return i}addRoundDash(e,t,n){let r=t/2;for(let t=-n;t<=n;t++){let i=this.nextRow+n+t,a=this.width*i,o=0,s=e[o];for(let i=0;i<this.width;i++){i/s.right>1&&(s=e[++o]);let c=Math.abs(i-s.left),l=Math.abs(i-s.right),u=Math.min(c,l),d,f=t/n*(r+1);if(s.isDash){let e=r-Math.abs(f);d=Math.sqrt(u*u+e*e)}else d=r-Math.sqrt(u*u+f*f);this.data[a+i]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e){for(let t=e.length-1;t>=0;--t){let n=e[t],r=e[t+1];n.zeroLength?e.splice(t,1):r?.isDash===n.isDash&&(r.left=n.left,e.splice(t,1))}let t=e[0],n=e[e.length-1];t.isDash===n.isDash&&(t.left=n.left-this.width,n.right=t.right+this.width);let r=this.width*this.nextRow,i=0,a=e[i];for(let t=0;t<this.width;t++){t/a.right>1&&(a=e[++i]);let n=Math.abs(t-a.left),o=Math.abs(t-a.right),s=Math.min(n,o),c=a.isDash?s:-s;this.data[r+t]=Math.max(0,Math.min(255,c+128))}}addDash(e,t){let n=t?7:0,r=2*n+1;if(this.nextRow+r>this.height)return _z(`LineAtlas out of space`),null;let i=0;for(let t of e)i+=t;if(i!==0){let r=this.width/i,a=this.getDashRanges(e,this.width,r);t?this.addRoundDash(a,r,n):this.addRegularDash(a)}let a={y:this.nextRow+n,height:2*n,width:i};return this.nextRow+=r,this.dirty=!0,a}bind(e){let t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}};function bGe(e){if(!e)return!1;let t=globalThis.location;if(!t)return!1;try{return new URL(e,t.href).origin!==t.origin}catch{return!1}}function xGe(){let e=import.meta.url;if(!/^https?:/.test(e))return``;let t=e.endsWith(`-dev.mjs`)?`maplibre-gl-worker-dev.mjs`:`maplibre-gl-worker.mjs`;return new URL(`./${t}`,e).href}function XJ(e,t){if(t)try{return new Worker(e,{type:`module`})}catch(e){console.warn(`Module worker not supported, falling back to classic worker`,e)}return new Worker(e)}async function SGe(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch worker script (${t.status}): ${e}`);let n=await t.text(),r=new Blob([n],{type:`text/javascript`});return URL.createObjectURL(r)}function CGe(e){let t=new Blob([`import ${JSON.stringify(new URL(e,import.meta.url).href)}`],{type:`text/javascript`});return URL.createObjectURL(t)}async function wGe(){let e=Iz.WORKER_URL||xGe(),t=!e?.endsWith(`.cjs`);if(!bGe(e))return XJ(e,t);if(t){let n=CGe(e);try{return XJ(n,t)}finally{URL.revokeObjectURL(n)}}let n=await SGe(e);try{return XJ(n,t)}finally{URL.revokeObjectURL(n)}}var TGe=`maplibre_preloaded_worker_pool`,EGe=class e{constructor(){this.active={},this.workersPromise=null}async acquire(t){if(this.active[t]=!0,!this.workersPromise){let t=[];for(;t.length<e.workerCount;)t.push(wGe());this.workersPromise=Promise.all(t)}return(await this.workersPromise).slice()}release(e){if(delete this.active[e],this.numActive()===0&&this.workersPromise){let e=this.workersPromise;this.workersPromise=null,e.then(e=>{for(let t of e)t.terminate()})}}isPreloaded(){return!!this.active[TGe]}numActive(){return Object.keys(this.active).length}},DGe=Math.floor(IJ.hardwareConcurrency/2);EGe.workerCount=OPe(globalThis)?Math.max(Math.min(DGe,3),1):1;var OGe;function kGe(){return OGe||=new EGe,OGe}var AGe=class{constructor(e,t){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=t,this.removed=!1,this.actorsPromise=this.initActors(t)}async initActors(e){let t=await this.workerPool.acquire(e);if(this.removed)return[];if(this.actors=t.map((t,n)=>{let r=new tVe(t,e);return r.name=`Worker ${n}`,r}),!this.actors.length)throw Error(`No actors found`);return this.actors}async broadcast(e,t){let n=await this.actorsPromise;return Promise.all(n.map(n=>n.sendAsync({type:e,data:t})))}async getActor(){let e=await this.actorsPromise;return this.currentActor=(this.currentActor+1)%e.length,e[this.currentActor]}async waitForInitComplete(){this.actors.length===0&&await this.actorsPromise}getReadyActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.removed=!0;for(let e of this.actors)e.remove();this.actors=[],e&&this.workerPool.release(this.id)}async registerMessageHandler(e,t){let n=await this.actorsPromise;for(let r of n)r.registerMessageHandler(e,t)}async unregisterMessageHandler(e){let t=await this.actorsPromise;for(let n of t)n.unregisterMessageHandler(e)}},ZJ;function jGe(){return ZJ||(ZJ=new AGe(kGe(),Rz),ZJ.registerMessageHandler(`GR`,(e,t,n)=>Vz(t,n))),ZJ}function MGe(e,t){let n=tR();return oR(n,n,[1,1,0]),sR(n,n,[e.width*.5,e.height*.5,1]),e.calculatePosMatrix?aR(n,n,e.calculatePosMatrix(t.toUnwrapped())):n}function NGe(e,t,n){if(e)for(let r of e){let e=t[r];if(e?.source===n&&e.type===`fill-extrusion`)return!0}else for(let e in t){let r=t[e];if(r.source===n&&r.type===`fill-extrusion`)return!0}return!1}function PGe(e,t,n,r,i,a,o){let s=NGe(i?.layers??null,t,e.id),c=a.maxPitchScaleFactor(),l=e.tilesIn(r,c,s);l.sort(LGe);let u=[];for(let r of l)u.push({wrappedTileID:r.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(t,n,e.getState(),r.queryGeometry,r.cameraQueryGeometry,r.scale,i,a,c,MGe(a,r.tileID),o?(e,t)=>o(r.tileID,e,t):void 0)});return zGe(RGe(u),e)}function FGe(e,t,n,r,i,a,o){let s={},c=a.queryRenderedSymbols(r),l=[];for(let e of Object.keys(c).map(Number))l.push(o[e]);l.sort(LGe);for(let n of l){let r=n.featureIndex.lookupSymbolFeatures(c[n.bucketInstanceId],t,n.bucketIndex,n.sourceLayerIndex,{filterSpec:i.filter,globalState:i.globalState},i.layers,i.availableImages,e);for(let e in r){s[e]||=[];let t=r[e];t.sort((e,t)=>{let r=n.featureSortOrder;if(r){let n=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex});for(let n of t)s[e].push(n)}}return BGe(s,e,n)}function IGe(e,t){let n=e.getRenderableIds().map(t=>e.getTileByID(t)),r=[],i={};for(let e of n){let n=e.tileID.canonical.key;i[n]||(i[n]=!0,e.querySourceFeatures(r,t))}return r}function LGe(e,t){let n=e.tileID,r=t.tileID;return n.overscaledZ-r.overscaledZ||n.canonical.y-r.canonical.y||n.wrap-r.wrap||n.canonical.x-r.canonical.x}function RGe(e){let t={},n={};for(let{queryResults:r,wrappedTileID:i}of e){n[i]||={};let e=n[i];for(let n in r){let i=r[n];e[n]||={};let a=e[n];t[n]||=[];for(let e of i)a[e.featureIndex]||(a[e.featureIndex]=!0,t[n].push(e))}}return t}function zGe(e,t){for(let n in e)for(let r of e[n])VGe(r,t);return e}function BGe(e,t,n){for(let r in e)for(let i of e[r]){let e=n[t[r].source];VGe(i,e)}return e}function VGe(e,t){let n=e.feature,r=t.getFeatureState(n.layer[`source-layer`],n.id);n.source=n.layer.source,n.layer[`source-layer`]&&(n.sourceLayer=n.layer[`source-layer`]),n.state=r}async function HGe(e,t,n,r){let i=e;if(e.url?i=(await Hz(await t.transformRequest(e.url,`Source`),n)).data:await IJ.frameAsync(n,r),!i)return null;let a=sz(oz(i,e),[`tiles`,`minzoom`,`maxzoom`,`attribution`,`bounds`,`scheme`,`tileSize`,`encoding`]);return`vector_layers`in i&&i.vector_layers&&(a.vectorLayerIds=i.vector_layers.map(e=>e.id)),a}var QJ=class e{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof qK?new qK(e.lng,e.lat):qK.convert(e),this}setSouthWest(e){return this._sw=e instanceof qK?new qK(e.lng,e.lat):qK.convert(e),this}extend(t){let n=this._sw,r=this._ne,i,a;if(t instanceof qK)i=t,a=t;else if(t instanceof e){if(i=t._sw,a=t._ne,!i||!a)return this}else{if(Array.isArray(t)){if(t.length===4||t.every(Array.isArray)){let n=t;return this.extend(e.convert(n))}{let e=t;return this.extend(qK.convert(e))}}return t&&(`lng`in t||`lon`in t)&&`lat`in t?this.extend(qK.convert(t)):this}return!n&&!r?(this._sw=new qK(i.lng,i.lat),this._ne=new qK(a.lng,a.lat)):(n.lng=Math.min(i.lng,n.lng),n.lat=Math.min(i.lat,n.lat),r.lng=Math.max(a.lng,r.lng),r.lat=Math.max(a.lat,r.lat)),this}getCenter(){return new qK((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new qK(this.getWest(),this.getNorth())}getSouthEast(){return new qK(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:t,lat:n}=qK.convert(e),r=this._sw.lat<=n&&n<=this._ne.lat,i=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=t&&t>=this._ne.lng),r&&i}intersects(t){if(t=e.convert(t),!(t.getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let n=Math.abs(this.getEast()-this.getWest()),r=Math.abs(t.getEast()-t.getWest());if(n>=360||r>=360)return!0;let i=az(this.getWest(),-180,180),a=az(this.getEast(),-180,180),o=az(t.getWest(),-180,180),s=az(t.getEast(),-180,180),c=i>a,l=o>s;return c&&l?!0:c?s>=i||o<=a:l?a>=o||i<=s:o<=a&&s>=i}static convert(t){return t instanceof e||!t?t:new e(t)}static fromLngLat(t,n=0){let r=360*n/40075017,i=r/Math.cos(Math.PI/180*t.lat);return new e(new qK(t.lng-i,t.lat-r),new qK(t.lng+i,t.lat+r))}adjustAntiMeridian(){let t=new qK(this._sw.lng,this._sw.lat),n=new qK(this._ne.lng,this._ne.lat);return t.lng>n.lng?new e(t,new qK(n.lng+360,n.lat)):new e(t,n)}},UGe=class{constructor(e,t,n){this.bounds=QJ.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=n||24}validateBounds(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}contains(e){let t=2**e.z,n={minX:Math.floor(JK(this.bounds.getWest())*t),minY:Math.floor(YK(this.bounds.getNorth())*t),maxX:Math.ceil(JK(this.bounds.getEast())*t),maxY:Math.ceil(YK(this.bounds.getSouth())*t)};return e.x>=n.minX&&e.x<n.maxX&&e.y>=n.minY&&e.y<n.maxY}},WGe=class extends Jz{constructor(e,t,n,r){if(super(),this.id=e,this.dispatcher=n,this.type=`vector`,this.minzoom=0,this.maxzoom=22,this.scheme=`xyz`,this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,oz(this,sz(t,[`url`,`scheme`,`tileSize`,`promoteId`,`encoding`])),this._options=oz({type:`vector`},t),this._collectResourceTiming=t.collectResourceTiming,this.tileSize!==512)throw Error(`vector tile sources must have a tileSize of 512`);this.setEventedParent(r)}async load(e=!1){this._loaded=!1,this.fire(new UJ(`dataloading`)),this._tileJSONRequest=new AbortController;try{let t=await HGe(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(oz(this,t),t.bounds&&(this.tileBounds=new UGe(t.bounds,this.minzoom,this.maxzoom)),this.fire(new UJ(`data`,{sourceDataType:`metadata`})),this.fire(new UJ(`data`,{sourceDataType:`content`,sourceDataChanged:e})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,Pz(e)||this.fire(new qz(VR(e)))}}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null)}serialize(){return oz({},this._options)}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n={request:await this.map._requestManager.transformRequest(t,`Tile`),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:await this._getOverzoomParameters(e),etag:e.etag};n.request.collectResourceTiming=this._collectResourceTiming,await this.dispatcher.waitForInitComplete();let r=`RT`;if(!e.actor||e.state===`expired`)e.actor=this.dispatcher.getReadyActor(),r=`LT`;else if(e.state===`loading`)return new Promise((t,n)=>{e.reloadPromise={resolve:t,reject:n}});e.abortController=new AbortController;try{let t=await e.actor.sendAsync({type:r,data:n},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t);let i={};return t?.etagUnmodified&&(i.unmodified=!0),i}catch(t){if(delete e.abortController,e.aborted||Pz(t))return;if(t&&t.status!==404)throw t;this._afterTileLoadWorkerResponse(e,null)}}async _getOverzoomParameters(e){if(e.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let t=e.tileID.scaledTo(this.maxzoom).canonical,n=t.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:t,overzoomRequest:await this.map._requestManager.transformRequest(n,`Tile`)}}_afterTileLoadWorkerResponse(e,t){if(t?.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.etag=t?.etag,e.loadVectorData(t,this.map.painter),e.reloadPromise){let t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&await e.actor.sendAsync({type:`AT`,data:{uid:e.uid,type:this.type,source:this.id}})}async unloadTile(e){e.unloadVectorData(),e.actor&&await e.actor.sendAsync({type:`RMT`,data:{uid:e.uid,type:this.type,source:this.id}})}hasTransition(){return!1}},GGe=class extends Jz{constructor(e,t,n,r){super(),this.id=e,this.dispatcher=n,this.setEventedParent(r),this.type=`raster`,this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme=`xyz`,this.tileSize=512,this._loaded=!1,this._premultiplyAlpha=!0,this._options=oz({type:`raster`},t),oz(this,sz(t,[`url`,`scheme`,`tileSize`]))}async load(e=!1){this._loaded=!1,this.fire(new UJ(`dataloading`)),this._tileJSONRequest=new AbortController;try{let t=await HGe(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(oz(this,t),t.bounds&&(this.tileBounds=new UGe(t.bounds,this.minzoom,this.maxzoom)),this.fire(new UJ(`data`,{sourceDataType:`metadata`})),this.fire(new UJ(`data`,{sourceDataType:`content`,sourceDataChanged:e})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,Pz(e)||this.fire(new qz(VR(e)))}}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null)}setSourceProperty(e){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return oz({},this._options)}setPremultiplyAlpha(e){return this._premultiplyAlpha===e||this.setSourceProperty(()=>{this._premultiplyAlpha=e}),this}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this._premultiplyAlpha,r=n?void 0:{premultiplyAlpha:`none`};e.abortController=new AbortController;try{let i=await zJ.transformAndGetImage(this.map._requestManager,t,`Tile`,e.abortController,this.map._refreshExpiredTiles,r);if(delete e.abortController,e.aborted){e.state=`unloaded`;return}if(i?.data){this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&e.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});let t=this.map.painter.context,r=t.gl,a=i.data;e.texture=this.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0,premultiply:n}):(e.texture=new uK(t,a,r.RGBA,{useMipmap:!0,premultiply:n}),e.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST)),e.state=`loaded`}}catch(t){if(delete e.abortController,e.aborted)e.state=`unloaded`;else if(t)throw e.state=`errored`,t}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController)}async unloadTile(e){e.texture&&this.map.painter.saveTileTexture(e.texture)}hasTransition(){return!1}},KGe=class extends GGe{constructor(e,t,n,r){super(e,t,n,r),this.type=`raster-dem`,this.maxzoom=22,this._options=oz({type:`raster-dem`},t),this.encoding=t.encoding||`mapbox`,this.redFactor=t.redFactor,this.greenFactor=t.greenFactor,this.blueFactor=t.blueFactor,this.baseShift=t.baseShift}async loadTile(e){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let n=await zJ.transformAndGetImage(this.map._requestManager,t,`Tile`,e.abortController,this.map._refreshExpiredTiles,{colorSpaceConversion:`none`});if(delete e.abortController,e.aborted){e.state=`unloaded`;return}if(n?.data){let t=n.data;this.map._refreshExpiredTiles&&(n.cacheControl||n.expires)&&e.setExpiryData({cacheControl:n.cacheControl,expires:n.expires});let r=xz(t)&&ZL()?t:await this.readImageNow(t),i={type:this.type,uid:e.uid,source:this.id,rawImageData:r,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(e.actor&&e.state!==`expired`&&e.state!==`reloading`)return;await this.dispatcher.waitForInitComplete(),(!e.actor||e.state===`expired`)&&(e.actor=this.dispatcher.getReadyActor()),e.dem=await e.actor.sendAsync({type:`LDT`,data:i}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0,e.state=`loaded`}}catch(t){if(delete e.abortController,e.aborted)e.state=`unloaded`;else if(t)throw e.state=`errored`,t}}async readImageNow(e){if(typeof VideoFrame<`u`&&KNe()){let t=e.width+2,n=e.height+2;try{return new aK({width:t,height:n},await MPe(e,-1,-1,t,n))}catch{}}return IJ.getImageData(e,1)}_getNeighboringTiles(e){let t=e.canonical,n=2**t.z,r=(t.x-1+n)%n,i=t.x===0?e.wrap-1:e.wrap,a=(t.x+1+n)%n,o=t.x+1===n?e.wrap+1:e.wrap,s={};return s[new Dq(e.overscaledZ,i,t.z,r,t.y).key]={backfilled:!1},s[new Dq(e.overscaledZ,o,t.z,a,t.y).key]={backfilled:!1},t.y>0&&(s[new Dq(e.overscaledZ,i,t.z,r,t.y-1).key]={backfilled:!1},s[new Dq(e.overscaledZ,e.wrap,t.z,t.x,t.y-1).key]={backfilled:!1},s[new Dq(e.overscaledZ,o,t.z,a,t.y-1).key]={backfilled:!1}),t.y+1<n&&(s[new Dq(e.overscaledZ,i,t.z,r,t.y+1).key]={backfilled:!1},s[new Dq(e.overscaledZ,e.wrap,t.z,t.x,t.y+1).key]={backfilled:!1},s[new Dq(e.overscaledZ,o,t.z,a,t.y+1).key]={backfilled:!1}),s}async unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state=`unloaded`,e.actor&&await e.actor.sendAsync({type:`RDT`,data:{type:this.t
409ype,uid:e.uid,source:this.id}})}};function $J(e,t){return t?e.properties[t]:e.id}function qGe(e,t){let n=new Map;if(e==null||e.type==null)return n;if(e.type===`Feature`){let r=$J(e,t);return r==null?void 0:(n.set(r,e),n)}if(e.type===`FeatureCollection`){let r=new Set;for(let i of e.features){let e=$J(i,t);if(e==null||r.has(e))return;r.add(e),n.set(e,i)}return n}}function JGe(e,t,n){let r=[];if(t.removeAll)e.clear();else if(t.remove)for(let n of t.remove){let t=e.get(n);t&&(r.push(t.geometry),e.delete(n))}if(t.add)for(let i of t.add){let t=$J(i,n);if(t==null)continue;let a=e.get(t);a&&r.push(a.geometry),r.push(i.geometry),e.set(t,i)}if(t.update)for(let n of t.update){let t=e.get(n.id);if(!t)continue;let i=!!n.newGeometry,a=n.removeAllProperties||n.removeProperties?.length>0||n.addOrUpdateProperties?.length>0;if(!i&&!a)continue;r.push(t.geometry);let o={...t};if(e.set(n.id,o),i&&(r.push(n.newGeometry),o.geometry=n.newGeometry),a){if(o.properties=n.removeAllProperties?{}:{...o.properties||{}},n.removeProperties)for(let e of n.removeProperties)delete o.properties[e];if(n.addOrUpdateProperties)for(let{key:e,value:t}of n.addOrUpdateProperties)o.properties[e]=t}}return r}function YGe(e,t,n){if(!e)return t||{};if(!t)return e||{};n&&(QGe(e.add,n),QGe(t.add,n));let r=eKe(e),i=eKe(t);XGe(r,i);let a={};if((r.removeAll||i.removeAll)&&(a.removeAll=!0),a.remove=new Set([...r.remove,...i.remove]),a.add=new Map([...r.add,...i.add]),a.update=new Map([...r.update,...i.update]),a.remove.size&&a.add.size)for(let e of a.add.keys())a.remove.delete(e);let o=tKe(a);return n&&$Ge(o.add,n),o}function XGe(e,t){t.removeAll&&(e.add.clear(),e.update.clear(),e.remove.clear(),t.remove.clear());for(let n of t.remove)e.add.delete(n),e.update.delete(n);for(let[n,r]of t.update){let i=e.update.get(n);i&&(t.update.set(n,ZGe(i,r)),e.update.delete(n))}}function ZGe(e,t){let n={id:e.id};if(t.removeAllProperties&&(delete e.removeProperties,delete e.addOrUpdateProperties,delete t.removeProperties),t.removeProperties)for(let n of t.removeProperties){let t=e.addOrUpdateProperties.findIndex(e=>e.key===n);t>-1&&e.addOrUpdateProperties.splice(t,1)}return(e.removeAllProperties||t.removeAllProperties)&&(n.removeAllProperties=!0),(e.removeProperties||t.removeProperties)&&(n.removeProperties=[...e.removeProperties||[],...t.removeProperties||[]]),(e.addOrUpdateProperties||t.addOrUpdateProperties)&&(n.addOrUpdateProperties=[...e.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(e.newGeometry||t.newGeometry)&&(n.newGeometry=t.newGeometry||e.newGeometry),n}function QGe(e,t){if(e)for(let n of e){let e=$J(n,t);e!=null&&(n.id=e)}}function $Ge(e,t){if(e)for(let n of e)$J(n,t)!=null&&delete n.id}function eKe(e){if(!e)return{};let t={};return t.removeAll=e.removeAll,t.remove=new Set(e.remove||[]),t.add=new Map(e.add?.map(e=>[e.id,e])),t.update=new Map(e.update?.map(e=>[e.id,e])),t}function tKe(e){let t={};return e.removeAll&&(t.removeAll=e.removeAll),e.remove&&(t.remove=Array.from(e.remove)),e.add&&(t.add=Array.from(e.add.values())),e.update&&(t.update=Array.from(e.update.values())
vendor: 20,572 bytes, line 409
409),t}function nKe(e){return!e||e.length===0?[]:typeof e[0]==`number`?[e]:e.flatMap(e=>nKe(e))}function eY(e){return e.type===`GeometryCollection`?e.geometries.flatMap(e=>eY(e)):nKe(e.coordinates)}function rKe(e){let t=new QJ,n;switch(e.type){case`FeatureCollection`:n=e.features.flatMap(e=>eY(e.geometry));break;case`Feature`:n=eY(e.geometry);break;default:n=eY(e)}if(n.length===0)return t;for(let e of n){let[n,r]=e;t.extend([n,r])}return t}function iKe({x:e,y:t,z:n},r=0){let i=ZK((e-r)/2**n),a=QK((t+1+r)/2**n),o=ZK((e+1+r)/2**n),s=QK((t-r)/2**n);return new QJ([i,a],[o,s])}var aKe=class extends Jz{constructor(e,t,n,r){super(),this.id=e,this.type=`geojson`,this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:t.data},this.actorPromise=n.getActor(),this.setEventedParent(r),this._data=typeof t.data==`string`?{url:t.data}:{geojson:t.data},this._options=oz({},t),this._collectResourceTiming=t.collectResourceTiming,t.maxzoom!==void 0&&(this.maxzoom=t.maxzoom),t.type&&(this.type=t.type),t.attribution&&(this.attribution=t.attribution),this.promoteId=t.promoteId,t.clusterMaxZoom!==void 0&&this.maxzoom<=t.clusterMaxZoom&&_z(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${t.clusterMaxZoom}".`),this.workerOptions=oz({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(t.buffer===void 0?128:t.buffer),tolerance:this._pixelsToTileUnits(t.tolerance===void 0?.375:t.tolerance),extent:q,maxZoom:this.maxzoom,lineMetrics:t.lineMetrics||!1,generateId:t.generateId||!1,promoteId:typeof t.promoteId==`string`?t.promoteId:void 0,cluster:t.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(t.clusterMaxZoom),minPoints:Math.max(2,t.clusterMinPoints||2),extent:q,radius:this._pixelsToTileUnits(t.clusterRadius||50),log:!1,generateId:t.generateId||!1}},clusterProperties:t.clusterProperties,filter:t.filter},t.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(e){return e*(q/this.tileSize)}_tileUnitsToPixels(e){return e/(q/this.tileSize)}_getClusterMaxZoom(e){let t=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||e===void 0||_z(`Integer expected for option 'clusterMaxZoom': provided value "${e}" rounded to "${t}"`),t}async load(){await this._updateWorkerData()}onAdd(e){this.map=e,this.load()}setData(e){return this._data=typeof e==`string`?{url:e}:{geojson:e},this._pendingWorkerUpdate={data:e},this._updateWorkerData()}updateData(e){return this._pendingWorkerUpdate.diff=YGe(this._pendingWorkerUpdate.diff,e),this._updateWorkerData()}async getData(){return this._data.url&&await this.once(`data`),this._data.geojson?this._data.geojson:{type:`FeatureCollection`,features:Array.from(this._data.updateable.values())}}async getBounds(){return rKe(await this.getData())}setClusterOptions(e){return this.workerOptions.geojsonVtOptions.cluster=e.cluster,e.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData()}getClusterOptions(){let{cluster:e,clusterOptions:t}=this.workerOptions.geojsonVtOptions;return{cluster:e,clusterMaxZoom:t.maxZoom,clusterRadius:this._tileUnitsToPixels(t.radius)}}async getClusterExpansionZoom(e){return(await this.actorPromise).sendAsync({type:`GCEZ`,data:{type:this.type,clusterId:e,source:this.id}})}async getClusterChildren(e){return(await this.actorPromise).sendAsync({type:`GCC`,data:{type:this.type,clusterId:e,source:this.id}})}async getClusterLeaves(e,t,n){return(await this.actorPromise).sendAsync({type:`GCL`,data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:n}})}async _updateWorkerData(){if(this._isUpdatingWorker)return this._updatePromise;if(!this._hasPendingWorkerUpdate()){_z(`No pending worker updates for GeoJSONSource ${this.id}.`);return}let{data:e,diff:t,updateCluster:n}=this._pendingWorkerUpdate,r=this._getLoadGeoJSONParameters(e,t,n);e===void 0?t?this._pendingWorkerUpdate.diff=void 0:n&&(this._pendingWorkerUpdate.updateCluster=void 0):this._pendingWorkerUpdate.data=void 0,this._updatePromise=this._dispatchWorkerUpdate(r),await this._updatePromise}async _getLoadGeoJSONParameters(e,t,n){let r=oz({type:this.type,source:this.id},this.workerOptions);if(typeof e==`string`)return r.request=await this.map._requestManager.transformRequest(IJ.resolveURL(e),`Source`),r.request.collectResourceTiming=this._collectResourceTiming,r;if(e!==void 0)return r.data=e,r;if(t)return r.dataDiff=t,r;if(n)return r.updateCluster=!0,r}async _dispatchWorkerUpdate(e){this._isUpdatingWorker=!0,this.fire(new UJ(`dataloading`));try{let t=await e,n=await(await this.actorPromise).sendAsync({type:`LD`,data:t});if(this._isUpdatingWorker=!1,this._removed||n.abandoned){this.fire(new UJ(`dataabort`));return}n.data&&(this._data={geojson:n.data});let r=this._applyDiffToSource(t.dataDiff),i=this._getShouldReloadTileOptions(r),a={};this._applyResourceTiming(a,n),this.fire(new UJ(`data`,{...a,sourceDataType:`metadata`})),this.fire(new UJ(`data`,{...a,sourceDataType:`content`,shouldReloadTileOptions:i}))}catch(e){if(this._isUpdatingWorker=!1,this._removed){this.fire(new UJ(`dataabort`));return}this.fire(new qz(VR(e)))}finally{this._hasPendingWorkerUpdate()&&await this._updateWorkerData()}}_applyResourceTiming(e,t){if(!this._collectResourceTiming)return;let n=t.resourceTiming?.[this.id];if(!n)return;let r=n.slice(0);r?.length&&oz(e,{resourceTiming:r})}_applyDiffToSource(e){if(!e)return;let t=typeof this.promoteId==`string`?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let e=qGe(this._data.geojson,t);if(!e)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:e}}if(!this._data.updateable)return;let n=JGe(this._data.updateable,e,t);if(!(e.removeAll||this._options.cluster))return n}_getShouldReloadTileOptions(e){if(e)return{affectedBounds:e.filter(Boolean).map(e=>rKe(e))}}shouldReloadTile(e,{affectedBounds:t}){if(e.state===`loading`)return!0;if(e.state===`unloaded`)return!1;let{buffer:n,extent:r}=this.workerOptions.geojsonVtOptions,i=iKe(e.tileID.canonical,n/r);for(let e of t)if(i.intersects(e))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}async loadTile(e){let t=e.actor?`RT`:`LT`;e.actor=await this.actorPromise;let n={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;try{let r=await(await this.actorPromise).sendAsync({type:t,data:n},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(r,this.map.painter,t===`RT`)}catch(t){if(delete e.abortController,e.aborted||Pz(t))return;throw t}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}async unloadTile(e){e.unloadVectorData(),await(await this.actorPromise).sendAsync({type:`RMT`,data:{uid:e.uid,type:this.type,source:this.id}})}onRemove(){this._removed=!0,this.actorPromise.then(e=>e.sendAsync({type:`RS`,data:{type:this.type,source:this.id}}))}serialize(){return oz({},this._options,{type:this.type,data:this._data.updateable?{type:`FeatureCollection`,features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}},tY=[0,0,1],oKe=(e,t)=>({u_tl_parent:new vG(e,t.u_tl_parent),u_scale_parent:new Z(e,t.u_scale_parent),u_buffer_scale:new Z(e,t.u_buffer_scale),u_image_warp:new yG(e,t.u_image_warp),u_fade_t:new Z(e,t.u_fade_t),u_opacity:new Z(e,t.u_opacity),u_image0:new _G(e,t.u_image0),u_image1:new _G(e,t.u_image1),u_brightness_low:new Z(e,t.u_brightness_low),u_brightness_high:new Z(e,t.u_brightness_high),u_saturation_factor:new Z(e,t.u_saturation_factor),u_contrast_factor:new Z(e,t.u_contrast_factor),u_spin_weights:new yG(e,t.u_spin_weights),u_coords_top:new bG(e,t.u_coords_top),u_coords_bottom:new bG(e,t.u_coords_bottom)}),sKe=(e,t,n,r,i,a)=>({u_tl_parent:e,u_scale_parent:t,u_buffer_scale:1,u_image_warp:a,u_fade_t:n.mix,u_opacity:n.opacity*r.paint.get(`raster-opacity`),u_image0:0,u_image1:1,u_brightness_low:r.paint.get(`raster-brightness-min`),u_brightness_high:r.paint.get(`raster-brightness-max`),u_saturation_factor:uKe(r.paint.get(`raster-saturation`)),u_contrast_factor:lKe(r.paint.get(`raster-contrast`)),u_spin_weights:cKe(r.paint.get(`raster-hue-rotate`)),u_coords_top:[i[0].x,i[0].y,i[1].x,i[1].y],u_coords_bottom:[i[3].x,i[3].y,i[2].x,i[2].y]});function cKe(e){e*=Math.PI/180;let t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}function lKe(e){return e>0?1/(1-e):1+e}function uKe(e){return e>0?1-1/(1.001-e):-e}var nY=class{constructor(e,t,n){this.vertexBuffer=e,this.indexBuffer=t,this.segments=n}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}},rY=yW([{name:`a_pos`,type:`Int16`,components:2}]),iY=q/128;function dKe(e,t){let n=fKe(t,`16bit`),r=rG.deserialize({arrayBuffer:n.vertices,length:n.vertices.byteLength/2/2}),i=sG.deserialize({arrayBuffer:n.indices,length:n.indices.byteLength/2/3});return new nY(e.createVertexBuffer(r,rY.members),e.createIndexBuffer(i),uG.simpleSegment(0,0,r.length,i.length))}function fKe(e,t){let n=e.granularity===void 0?1:Math.max(e.granularity,1),r=n+(e.generateBorders?2:0),i=n+(e.extendToNorthPole||e.generateBorders?1:0)+(e.extendToSouthPole||e.generateBorders?1:0),a=r+1,o=i+1,s=e.generateBorders?-1:0,c=e.generateBorders||e.extendToNorthPole?-1:0,l=n+ +!!e.generateBorders,u=n+(e.generateBorders||e.extendToSouthPole?1:0),d=a*o,f=r*i*6,p=a*o>65536;if(p&&t===`16bit`)throw Error(`Granularity is too large and meshes would not fit inside 16 bit vertex indices.`);let m=p||t===`32bit`,h=new Int16Array(d*2),g=0;for(let t=c;t<=u;t++)for(let r=s;r<=l;r++){let i=r/n*q;r===-1&&(i=-iY),r===n+1&&(i=8192+iY);let a=t/n*q;t===-1&&(a=e.extendToNorthPole?-32768:-iY),t===n+1&&(a=e.extendToSouthPole?32767:8192+iY),h[g++]=i,h[g++]=a}let _=m?new Uint32Array(f):new Uint16Array(f),v=0;for(let e=0;e<i;e++)for(let t=0;t<r;t++){let n=t+e*a,r=t+1+e*a,i=t+(e+1)*a,o=t+1+(e+1)*a;_[v++]=n,_[v++]=i,_[v++]=r,_[v++]=r,_[v++]=i,_[v++]=o}return{vertices:h.buffer.slice(0),indices:_.buffer.slice(0),uses32bitIndices:m}}var aY=class extends Jz{constructor(e,t,n,r){super(),this.imageWarp=tY,this.flippedWindingOrder=!1,this._warp=`auto`,this._imageDirty=!1,this._subdividedQuad=!1,this._subdividedMesh=null,this.id=e,this.dispatcher=n,this.coordinates=t.coordinates,this.type=`image`,this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=t}async load(e){this._loaded=!1,this.fire(new UJ(`dataloading`)),this.url=this.options.url,this._abortController=new AbortController;try{let t=await zJ.transformAndGetImage(this.map._requestManager,this.url,`Image`,this._abortController);this._abortController=null,this._loaded=!0,t?.data&&(this._setImage(t.data),e&&(this.coordinates=e),this._finishLoading())}catch(e){if(Pz(e))return;this._abortController=null,this._loaded=!0,this.fire(new qz(VR(e)))}}loaded(){return this._loaded}updateImage(e){return this._abortController&&=(this._abortController.abort(),null),`image`in e?(this._loaded=!0,this._setImage(e.image),e.coordinates&&(this.coordinates=e.coordinates),this._finishLoading(),this):e.url?(this.options.url=e.url,this.load(e.coordinates),this):this}_setImage(e){this.image=e,this._imageDirty=!0}getMesh(e,t){return!this._subdividedQuad||t?null:(this._subdividedMesh??=dKe(e,{granularity:16}),this._subdividedMesh)}_disposeTexture(){this.texture?.destroy(),this.texture=null}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new UJ(`data`,{sourceDataType:`metadata`})))}onAdd(e){this.map=e,this.load()}onRemove(){this._abortController&&=(this._abortController.abort(),null),this._disposeTexture(),this._subdividedMesh?.destroy(),this._subdividedMesh=null,this.image=null,this.tiles={}}setWarp(e){return this._warp===e?this:(this._warp=e,this.tileCoords&&this.setCoordinates(this.coordinates),this)}getWarp(){return this._warp}setCoordinates(e){this.coordinates=e;let t=e.map($K.fromLngLat);return this.tileID=pKe(t),this.terrainTileRanges=this._getOverlappingTileRanges(t),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=t.map(e=>this.tileID.getTilePoint(e)._round()),this.imageWarp=hKe(this.tileCoords,this._warp),this._subdividedQuad=this.imageWarp[2]>0&&!_Ke(this.tileCoords),this.flippedWindingOrder=mKe(this.tileCoords),this.fire(new UJ(`data`,{sourceDataType:`content`})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,t=e.gl;this.texture?this._imageDirty&&(this.texture.update(this.image),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)):(this.texture=new uK(e,this.image,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)),this._imageDirty=!1;let n=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,n=!0)}n&&this.fire(new UJ(`data`,{sourceDataType:`idle`,sourceId:this.id}))}async loadTile(e){this.tileID?.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state=`errored`}serialize(){return{type:`image`,url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:t,minY:n,maxX:r,maxY:i}=UK.fromPoints(e),a={};for(let e=0;e<=25;e++){let o=2**e,s=Math.floor(t*o),c=Math.floor(n*o),l=Math.floor(r*o),u=Math.floor(i*o),d=(s%o+o)%o,f=l%o;a[e]={minWrap:Math.floor(s/o),maxWrap:Math.floor(l/o),minTileXWrapped:d,maxTileXWrapped:f,minTileY:c,maxTileY:u}}return a}};function pKe(e){let t=UK.fromPoints(e),n=t.width(),r=t.height(),i=Math.max(0,Math.floor(-Math.log(Math.max(n,r))/Math.LN2)),a=2**i;return new Tq(i,Math.floor((t.minX+t.maxX)/2*a),Math.floor((t.minY+t.maxY)/2*a))}function mKe(e){let t=e[1].x-e[0].x,n=e[1].y-e[0].y,r=e[2].x-e[0].x;return t*(e[2].y-e[0].y)-n*r<0}function hKe(e,t){if(t===`flat`||_Ke(e))return tY;let[n,r,i,a]=e,o=n.x-r.x+i.x-a.x,s=n.y-r.y+i.y-a.y,c=[r.x-i.x,r.y-i.y,a.x-i.x,a.y-i.y],[l,u,d,f]=c,p=GWe(c),m=(o*f-d*s)/p,h=(l*s-o*u)/p,g=[1,1+m,1+m+h,1+h],_=Math.max(...g)/Math.min(...g),v=t===`perspective`?0:gKe(_);return!(_>=1&&_<=512)||v>=1?tY:[m,h,v]}function gKe(e){let t=(1-4/e)/(1-4/512);return Math.max(0,t)}function _Ke(e){let[t,n,r,i]=e;return t.x+r.x===n.x+i.x&&t.y+r.y===n.y+i.y}var vKe=class extends aY{constructor(e,t,n,r){super(e,t,n,r),this._onPlayingHandler=()=>{this.map?.triggerRepaint()},this.roundZoom=!0,this.type=`video`,this.options=t}async load(){this._loaded=!1;let e=this.options;this.urls=[];for(let t of e.urls)this.urls.push((await this.map._requestManager.transformRequest(t,`Source`)).url);try{let e=await VPe(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener(`playing`,this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(e){this.fire(new qz(VR(e)))}}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let t=this.video.seekable;e<t.start(0)||e>t.end(0)?this.fire(new qz(new Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${t.start(0)} and ${t.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener(`playing`,this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,t=e.gl;this.texture?this.video.paused||(this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this.texture=new uK(e,this.video,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let n=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,n=!0)}n&&this.fire(new UJ(`data`,{sourceDataType:`idle`,sourceId:this.id}))}serialize(){return{type:`video`,urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},yKe=class extends aY{constructor(e,t,n,r){super(e,t,n,r),t.coordinates?(!Array.isArray(t.coordinates)||t.coordinates.length!==4||t.coordinates.some(e=>!Array.isArray(e)||e.length!==2||e.some(e=>typeof e!=`number`)))&&this.fire(new qz(new Y(`sources.${e}`,null,`"coordinates" property must be an array of 4 longitude/latitude array pairs`))):this.fire(new qz(new Y(`sources.${e}`,null,`missing required property "coordinates"`))),t.animate&&typeof t.animate!=`boolean`&&this.fire(new qz(new Y(`sources.${e}`,null,`optional "animate" property must be a boolean value`))),t.canvas?typeof t.canvas!=`string`&&!(t.canvas instanceof HTMLCanvasElement)&&this.fire(new qz(new Y(`sources.${e}`,null,`"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance`))):this.fire(new qz(new Y(`sources.${e}`,null,`missing required property "canvas"`))),this.options=t,this.animate=t.animate===void 0||t.animate}async load(){if(this._loaded=!0,this.canvas||=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new qz(Error(`Canvas dimensions cannot be less than or equal to zero.`)));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&=(this.prepare(),!1)},this._finishLoading()}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this._playing=!1,super.onRemove()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let t=this.map.painter.context,n=t.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new uK(t,this.canvas,n.RGBA,{premultiply:!0}),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let r=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,r=!0)}r&&this.fire(new UJ(`data`,{sourceDataType:`idle`,sourceId:this.id}))}serialize(){return{type:`canvas`,animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},bKe={},xKe=(e,t,n,r)=>{let i=new(SKe(t.type))(e,t,n,r);if(i.id!==e)throw Error(`Expected Source id to be ${e} instead of ${i.id}`);return i},SKe=e=>{switch(e){case`geojson`:return aKe;case`image`:return aY;case`raster`:return GGe;case`raster-dem`:return KGe;case`vector`:return WGe;case`video`:return vKe;case`canvas`:return yKe}return bKe[e]};function CKe(e,t){let n={};if(!t)return n;for(let r of e){let e=r.layerIds.map(e=>t.getLayer(e)).filter(Boolean);if(e.length!==0){r.layers=e,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map(t=>e.filter(e=>e.id===t)[0]));for(let t of e)n[t.id]=r}}return n}var oY=`RTLPluginLoaded`,wKe=class extends Jz{constructor(...e){super(...e),this.status=`unavailable`,this.url=null,this.dispatcher=jGe()}_syncState(e){return this.status=e,this.dispatcher.broadcast(`SRPS`,{pluginStatus:e,pluginURL:this.url}).catch(e=>{throw this.status=`error`,e})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status=`unavailable`,this.url=null}async setRTLTextPlugin(e,t=!1){if(this.url)throw Error(`setRTLTextPlugin cannot be called multiple times.`);if(this.url=IJ.resolveURL(e),!this.url)throw Error(`requested url ${e}
409 is invalid`);if(this.status===`unavailable`)if(t)this.status=`deferred`,this._syncState(this.status);else return this._requestImport();else if(this.status===`requested`)return this._requestImport()}async _requestImport(){await this._syncState(`loading`),this.status=`loaded`,this.fire(new Kz(oY))}lazyLoad(){this.status===`unavailable`?this.status=`requested`:this.status===`deferred`&&this._requestImport()}},TKe=null;function sY(){return TKe||=new wKe,TKe}var EKe=class{constructor(e,t){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=cz(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rttObjects=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state=`loading`,this.featureStateRevision=-1}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:t,fadingParentID:n,fadeEndTime:r}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=t,this.fadingParentID=n,this.fadeEndTime=r}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=LJ(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state===`errored`||this.state===`loaded`||this.state===`reloading`}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}getRTT(e){return this.rttObjects[e]}acquireRTT(e,t,n){return this.rttObjects[t]=e.acquireRTT(n)}releaseRTT(e){if(this.rttObjects.length!==0){for(let t of this.rttObjects)t&&e.releaseRTT(t);this.rttObjects.length=0}}loadVectorData(e,t,n){if(e?.etagUnmodified===!0){this.state=`loaded`;return}if(this.hasData()&&this.unloadVectorData(),this.state=`loaded`,!e){this.collisionBoxArray=new KW;return}e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestEncoding=e.encoding,this.latestFeatureIndex.rawTileData=e.rawTileData,this.latestFeatureIndex.encoding=e.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=CKe(e.buckets,t?.style),this.hasSymbolBuckets=!1;for(let e in this.buckets){let t=this.buckets[e];if(t instanceof Sq)if(this.hasSymbolBuckets=!0,n)t.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let e in this.buckets){let t=this.buckets[e];if(t instanceof Sq&&t.hasRTLText){this.hasRTLText=!0,sY().lazyLoad();break}}this.queryPadding=0;for(let e in this.buckets){let n=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(e).queryRadius(n))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state=`unloaded`}getBucket(e){return this.buckets[e.id]}upload(e){for(let t in this.buckets){let n=this.buckets[t];n.uploadPending()&&n.upload(e)}let t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new uK(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&=(this.glyphAtlasTexture=new uK(e,this.glyphAtlasImage,t.ALPHA),null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,n,r,i,a,o,s,c,l,u){return this.latestFeatureIndex?.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:o,queryPadding:this.queryPadding*c,getElevation:u},e,t,n):{}}querySourceFeatures(e,t){let n=this.latestFeatureIndex;if(!n?.rawTileData)return;let r=n.loadVTLayers(),i=t?.sourceLayer?t.sourceLayer:``,a=r._geojsonTileLayer||r[i];if(!a)return;let o=JH(t?.filter,`querySourceFeatures[${i}].filter`,t?.globalState),{z:s,x:c,y:l}=this.tileID.canonical,u={z:s,x:c,y:l};for(let t=0;t<a.length;t++){let r=a.feature(t);if(o.needGeometry){let e=zG(r,!0);
vendor: 61,995 bytes, line 409
409if(!o.filter(new XU(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!o.filter(new XU(this.tileID.overscaledZ),r))continue;let d=new lVe(r,s,c,l,n.getId(r,i));d.tile=u,e.push(d)}}hasData(){return this.state===`loaded`||this.state===`reloading`||this.state===`expired`}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let t=this.expirationTime;if(e.cacheControl){let t=DPe(e.cacheControl);t[`max-age`]&&(this.expirationTime=Date.now()+t[`max-age`]*1e3)}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let e=Date.now(),n=!1;if(this.expirationTime>e)n=!1;else if(!t)n=!0;else if(this.expirationTime<t)n=!0;else{let r=this.expirationTime-t;r?this.expirationTime=e+Math.max(r,3e4):n=!0}n?(this.expiredRequestCount++,this.state=`expired`):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),2**31-1)}setFeatureState(e,t,n){if(!this.latestFeatureIndex?.rawTileData||Object.keys(e).length===0||this.featureStateRevision===n)return;this.featureStateRevision=n;let r=this.latestFeatureIndex.loadVTLayers();for(let n in this.buckets){if(!t.style.hasLayer(n))continue;let i=this.buckets[n],a=i.layers[0].sourceLayer||`_geojsonTileLayer`,o=r[a],s=e[a];if(!o||!s||s.length===0)continue;i.update(s,o,this.imageAtlas?.patternPositions||{},this.dashPositions||{});let c=t?.style?.getLayer(n);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(i)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<LJ()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(e){this.symbolFadeHoldUntil=LJ()+e}setDependencies(e,t){let n={};for(let e of t)n[e]=!0;this.dependencies[e]=n}hasDependency(e,t){for(let n of e){let e=this.dependencies[n];if(e){for(let n of t)if(e[n])return!0}}return!1}};function DKe(e){let t=[];for(let n in e)t.push({id:n,state:e[n]});return t}var OKe=class{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(e,t,n){let r=String(t);if(this.stateChanges[e]||={},this.stateChanges[e][r]||={},oz(this.stateChanges[e][r],n),this.deletedStates[e]===null){this.deletedStates[e]={};for(let t in this.state[e])if(t===r){this.deletedStates[e][r]={};for(let i in this.state[e][t])n[i]===void 0&&(this.deletedStates[e][r][i]=null)}else this.deletedStates[e][t]=null}else if(this.deletedStates[e]?.[r]===null){this.deletedStates[e][r]={};for(let t in this.state[e][r])n[t]===void 0&&(this.deletedStates[e][r][t]=null)}else for(let t in n)this.deletedStates[e]?.[r]?.[t]===null&&delete this.deletedStates[e][r][t]}removeFeatureState(e,t,n){if(this.deletedStates[e]===null)return;let r=String(t);if(this.deletedStates[e]||={},n&&t!==void 0)this.deletedStates[e][r]!==null&&(this.deletedStates[e][r]||={},this.deletedStates[e][r][n]=null);else if(t!==void 0)if(this.stateChanges[e]?.[r])for(n in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][n]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}getState(e,t){let n=String(t),r=this.state[e]||{},i=this.stateChanges[e]||{},a=oz({},r[n],i[n]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let n=this.deletedStates[e][t];if(n===null)return{};for(let e in n)delete a[e]}return a}initializeTileState(e,t){let n={};for(let e in this.state)n[e]=DKe(this.state[e]);e.setFeatureState(n,t,this.revision)}coalesceChanges(e,t){let n={};for(let e in this.stateChanges){this.state[e]||={},n[e]||={};for(let t in this.stateChanges[e])this.state[e][t]||={},oz(this.state[e][t],this.stateChanges[e][t]),n[e][t]=this.state[e][t]}for(let e in this.deletedStates)if(this.state[e]||={},n[e]||={},this.deletedStates[e]===null)for(let t in this.state[e])this.state[e][t]={},n[e][t]={};else for(let t in this.deletedStates[e]){if(this.deletedStates[e][t]===null)this.state[e][t]={};else for(let n of Object.keys(this.deletedStates[e][t]))delete this.state[e][t][n];n[e][t]=this.state[e][t]}if(this.stateChanges={},this.deletedStates={},Object.keys(n).length===0)return;this.revision++;let r={};for(let e in n)r[e]=DKe(n[e]);e.setFeatureState(r,t,this.revision)}};function kKe(e,t,n){let r=t.intersectsFrustum(e);if(!n||r===0)return r;let i=t.intersectsPlane(n);return i===0?0:r===2&&i===2?2:1}function AKe(e,t,n){let r=0,i=(n-t)/10;for(let a=0;a<10;a++){let o=t+(a+.5)/10*(n-t);r+=i*Math.cos(o)**+e}return r}function cY(e,t){return function(n,r,i,a,o){let s=2*((e-1)/uz(Math.cos(wz(eq-o))/Math.cos(wz(eq)))-1),c=Math.acos(i/a),l=2*AKe(s-1,0,wz(o/2)),u=Math.min(wz(eq),c+wz(o/2)),d=Math.min(u,c-wz(o/2)),f=AKe(s-1,d,u),p=Math.atan(r/i),m=Math.hypot(r,i),h=n;return h+=uz(a/m/Math.max(.5,Math.cos(wz(o/2)))),h+=s*uz(Math.cos(p))/2,h-=uz(Math.max(1,f/l/t))/2,h}}var jKe=cY(9.314,3);function lY(e,t){let n=(t.roundZoom?Math.round:Math.floor)(e.zoom+uz(e.tileSize/t.tileSize));return Math.max(0,n)}function MKe(e){let t=iz((15-(eq-e.pitch-e.fov/2))/15,0,1);return e.elevation+t*500}function uY(e,t){let n=e.getCameraFrustum(),r=e.getClippingPlane(),i=wze(e),a=$K.fromLngLat(e.center,e.elevation),o=MKe(e),s=e.getCoveringTilesDetailsProvider(),c=s.allowVariableZoom(e,t),l=lY(e,t),u=t.minzoom||0,d=t.maxzoom===void 0?e.maxZoom:t.maxzoom,f=Math.min(Math.max(0,l),d),p=2**f,m=[p*i.x,p*i.y,0],h=[p*a.x,p*a.y,0],g=Math.hypot(a.x-i.x,a.y-i.y),_=Math.abs(a.z-i.z),v=Math.hypot(g,_),y=e=>({zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),b=[],x=[];if(e.renderWorldCopies&&s.allowWorldCopies())for(let e=1;e<=3;e++)b.push(y(-e)),b.push(y(e));for(b.push(y(0));b.length>0;){let p=b.pop(),g=p.x,y=p.y,S=p.fullyVisible,C={x:g,y,z:p.zoom},w=s.getTileBoundingVolume(C,p.wrap,o,t);if(!S){let e=kKe(n,w,r);if(e===0)continue;S=e===2}let T=s.distanceToTile2d(i.x,i.y,C,w),E=l;c&&(E=(t.calculateTileZoom||jKe)(e.zoom+uz(e.tileSize/t.tileSize),T,_,v,e.fov)),E=(t.roundZoom?Math.round:Math.floor)(E),E=Math.max(0,E);let D=Math.min(E,d);if(p.wrap=s.getWrap(a,C,p.wrap),p.zoom>=D){if(p.zoom<u)continue;let e=f-p.zoom,n=m[0]-.5-(g<<e),r=m[1]-.5-(y<<e),i=t.reparseOverscaled?Math.max(p.zoom,E):p.zoom;x.push({tileID:new Dq(p.zoom===d?i:p.zoom,p.wrap,p.zoom,g,y),distanceSq:_Pe([h[0]-.5-g,h[1]-.5-y]),tileDistanceToCamera:Math.sqrt(n*n+r*r)});continue}for(let e=0;e<4;e++){let t=(g<<1)+e%2,n=(y<<1)+(e>>1),r=p.zoom+1;b.push({zoom:r,x:t,y:n,wrap:p.wrap,fullyVisible:S})}}return x.sort((e,t)=>e.distanceSq-t.distanceSq).map(e=>e.tileID)}function NKe(e){return e===`raster`||e===`image`||e===`video`}function PKe(e,t,n,r,i,a,o){let s=LJ(),c=bPe(t);for(let l of t){let t=e.getTileById(l.key);(t.fadingDirection===0||t.fadeOpacity===0)&&t.resetFadeLogic(),!FKe(e,t,n,s,r,i,o)&&(IKe(e,t,n,s,a,o)||RKe(t,c,s,o)||t.resetFadeLogic())}}function FKe(e,t,n,r,i,a,o){if(!t.hasData())return!1;let{tileID:s,fadingRole:c,fadingDirection:l,fadingParentID:u}=t;if(c===0&&l===1&&u)return n[u.key]=u,!0;let d=Math.max(s.overscaledZ-i,a);for(let i=s.overscaledZ-1;i>=d;i--){let a=s.scaledTo(i),c=e.getLoadedTile(a);if(c)return t.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:c.tileID,fadeEndTime:r+o}),c.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:r+o}),n[a.key]=a,!0}return!1}function IKe(e,t,n,r,i,a){if(!t.hasData())return!1;let o=t.tileID.children(i),s=LKe(e,t,o,n,r,i,a);if(s)return!0;for(let c of o)LKe(e,t,c.children(i),n,r,i,a)&&(s=!0);return s}function LKe(e,t,n,r,i,a,o){if(n[0].overscaledZ>=a)return!1;let s=!1;for(let a of n){let n=e.getLoadedTile(a);if(!n)continue;let{fadingRole:c,fadingDirection:l,fadingParentID:u}=n;(c!==0||l!==0||!u)&&(n.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:t.tileID,fadeEndTime:i+o}),t.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:i+o})),r[a.key]=a,s=!0}return s}function RKe(e,t,n,r){let i=e.tileID;if(e.selfFading)return!0;if(e.hasData())return!1;if(t.has(i)){let t=n+r;return e.setSelfFadeLogic(t),!0}return!1}function zKe(e,t){if(t<=0)return!1;let n=LJ();for(let t of e.getAllTiles())if(t.fadeEndTime>=n)return!0;return!1}function BKe(e,t){let n=t.getRenderableIds();for(let r of n){if(!e.neighboringTiles?.[r])continue;let n=t.getTileById(r);e.neighboringTiles[r].backfilled||VKe(e,n),!n.neighboringTiles?.[e.tileID.key]?.backfilled&&VKe(n,e)}}function VKe(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0;let n=t.tileID.canonical.x-e.tileID.canonical.x,r=t.tileID.canonical.y-e.tileID.canonical.y,i=2**e.tileID.canonical.z,a=t.tileID.key;(n!==0||r!==0)&&(Math.abs(r)>1||(Math.abs(n)>1&&(Math.abs(n+i)===1?n+=i:Math.abs(n-i)===1&&(n-=i)),!(!t.dem||!e.dem)&&(e.dem.backfillBorder(t.dem,n,r),e.neighboringTiles?.[a]&&(e.neighboringTiles[a].backfilled=!0))))}var HKe=class{constructor(){this._tiles={}}handleWrapJump(e){let t={};for(let n in this._tiles){let r=this._tiles[n];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),t[r.tileID.key]=r}this._tiles=t}setFeatureState(e,t,n){for(let r in this._tiles)this._tiles[r].setFeatureState(e,t,n)}getAllTiles(){return Object.values(this._tiles)}getAllIds(e=!1){return e?Object.values(this._tiles).map(e=>e.tileID).sort(sVe).map(e=>e.key):Object.keys(this._tiles)}getTileById(e){return this._tiles[e]}setTile(e,t){this._tiles[e]=t}deleteTileById(e){delete this._tiles[e]}getLoadedTile(e){let t=this.getTileById(e.key);return t?.hasData()?t:null}isIdRenderable(e,t=!1){return this.getTileById(e)?.isRenderable(t)}getRenderableIds(e=0,t){let n=[];for(let e of this.getAllIds())this.isIdRenderable(e,t)&&n.push(this.getTileById(e));return t?n.sort((t,n)=>{let r=t.tileID,i=n.tileID,a=new K(r.canonical.x,r.canonical.y)._rotate(-e),o=new K(i.canonical.x,i.canonical.y)._rotate(-e);return r.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x}).map(e=>e.tileID.key):n.map(e=>e.tileID).sort(sVe).map(e=>e.key)}},dY=class e extends Jz{static{this.maxUnderzooming=10}static{this.maxOverzooming=3}constructor(e,t,n){super(),this.id=e,this.dispatcher=n,this.on(`data`,e=>{this._dataHandler(e)}),this.on(`dataloading`,()=>{this._sourceErrored=!1}),this.on(`error`,()=>{this._sourceErrored=this._source.loaded()}),this._source=xKe(e,t,n,this),this._inViewTiles=new HKe,this._outOfViewCache=new RWe(0,e=>this._unloadTile(e)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new OKe,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source?.onAdd&&this._source.onAdd(e)}onRemove(e){for(let e of this._inViewTiles.getAllTiles())e.unloadVectorData();this.clearTiles(),this._source?.onRemove&&this._source.onRemove(e),this._inViewTiles=new HKe}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((this.used!==void 0||this.usedForTerrain!==void 0)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let e of this._inViewTiles.getAllTiles())if(e.state!==`loaded`&&e.state!==`errored`)return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}async _loadTile(e,t,n,r){try{let i=await this._source.loadTile(e);this._tileLoaded(e,t,n,r,i)}catch(t){e.state=`errored`,t.status===404?this.update(this.transform,this.terrain):this._source.fire(new qz(VR(t),{tile:e}))}}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new UJ(`dataabort`,{tile:e,coord:e.tileID}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let t of this._inViewTiles.getAllTiles())t.upload(e),t.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(e){return this._inViewTiles.getRenderableIds(this.transform?.bearingInRadians,e)}hasRenderableParent(e){let t=e.overscaledZ-1;if(t>=this._source.minzoom){let n=this.getLoadedTile(e.scaledTo(t));if(n)return this._inViewTiles.isIdRenderable(n.tileID.key)}return!1}reload(e,t=void 0){if(this._paused){this._shouldReloadOnResume=!0;return}this._outOfViewCache.reset();for(let n of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(n);t&&!this._source.shouldReloadTile(r,t)||(e?this._reloadTile(n,r.state===`errored`?`loading`:`expired`):r.state!==`errored`&&this._reloadTile(n,`reloading`))}}async _reloadTile(e,t){let n=this._inViewTiles.getTileById(e);if(!n)return;let r=n.hasData();n.state!==`loading`&&(n.state=t),await this._loadTile(n,e,t,r)}_tileLoaded(e,t,n,r,i){r||(e.timeAdded=LJ(),e.selfFading&&(e.fadeEndTime=e.timeAdded+this._rasterFadeDuration)),n===`expired`&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),!i?.unmodified&&(this.getSource().type===`raster-dem`&&e.dem&&BKe(e,this._inViewTiles),e.featureStateRevision=-1,this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new UJ(`data`,{tile:e,coord:e.tileID})))}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._inViewTiles.getTileById(e)}_retainLoadedChildren(t,n){let r=this._getLoadedDescendents(n),i=new Set;for(let a of n){let n=r[a.key];if(!n?.length){i.add(a);continue}let o=a.overscaledZ+e.maxOverzooming,s=n.filter(e=>e.tileID.overscaledZ<=o);if(!s.length){i.add(a);continue}let c=Math.min(...s.map(e=>e.tileID.overscaledZ)),l=s.filter(e=>e.tileID.overscaledZ===c).map(e=>e.tileID);for(let e of l)t[e.key]=e;this._areDescendentsComplete(l,c,a.overscaledZ)||i.add(a)}return i}_getLoadedDescendents(e){let t={};for(let n of this._inViewTiles.getAllTiles().filter(e=>e.hasData()))for(let r of e)n.tileID.isChildOf(r)&&(t[r.key]||=[],t[r.key].push(n));return t}_areDescendentsComplete(e,t,n){return e.length===1&&e[0].isOverscaled()?e[0].overscaledZ===t:4**(t-n)===e.length}getLoadedTile(e){return this._inViewTiles.getLoadedTile(e)}updateCacheSize(e){let t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),n=this._maxTileCacheZoomLevels===null?Iz.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,r=Math.floor(t*n),i=typeof this._maxTileCacheSize==`number`?Math.min(this._maxTileCacheSize,r):r;this._outOfViewCache.setMaxSize(i)}handleWrapJump(e){let t=(e-(this._prevLng===void 0?e:this._prevLng))/360,n=Math.round(t);this._prevLng=e,n&&(this._inViewTiles.handleWrapJump(n),this._resetTileReloadTimers())}update(e,t){if(!this._sourceLoaded||this._paused)return;this.transform=e,this.terrain=t,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng);let n;!this.used&&!this.usedForTerrain?n=[]:this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(e=>new Dq(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)):(n=uY(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type===`vector`&&this.map._zoomLevelsToOverscale!==void 0?Math.max(this._source.maxzoom,e.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:t,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(n=n.filter(e=>this._source.hasTile(e)))),this.usedForTerrain&&(n=this._addTerrainIdealTiles(n));let r=n.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,r&&this.fire(new UJ(`data`,{sourceDataType:`idle`,sourceId:this.id}));let i=lY(e,this._source),a=this._updateRetainedTiles(n,i),o=NKe(this._source.type);o&&this._rasterFadeDuration>0&&!t&&PKe(this._inViewTiles,n,a,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),o?this._cleanUpRasterTiles(a):this._cleanUpVectorTiles(a)}_cleanUpRasterTiles(e){for(let t of this._inViewTiles.getAllIds())e[t]||this._removeTile(t)}_cleanUpVectorTiles(e){for(let t of this._inViewTiles.getAllIds()){let n=this._inViewTiles.getTileById(t);if(e[t]){n.clearSymbolFadeHold();continue}if(!n.hasSymbolBuckets){this._removeTile(t);continue}n.holdingForSymbolFade()?n.symbolFadeFinished()&&this._removeTile(t):n.setSymbolHoldDuration(this.map._fadeDuration)}}_addTerrainIdealTiles(e){let t=[];for(let n of e)if(n.canonical.z>this._source.minzoom){let e=n.scaledTo(n.canonical.z-1);t.push(e);let r=n.scaledTo(Math.max(this._source.minzoom,Math.min(n.canonical.z,5)));t.push(r)}return e.concat(t)}releaseSymbolFadeTiles(){for(let e of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(e).holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(t,n){let r=new Set;for(let e of t)this._addTile(e).hasData()||r.add(e);let i=t.reduce((e,t)=>(e[t.key]=t,e),{}),a=this._retainLoadedChildren(i,r),o={},s=Math.max(n-e.maxUnderzooming,this._source.minzoom);for(let e of a){let t=this._inViewTiles.getTileById(e.key),n=t?.wasRequested();for(let r=e.overscaledZ-1;r>=s;--r){let a=e.scaledTo(r);if(o[a.key])break;if(o[a.key]=!0,t=this.getTile(a),!t&&n&&(t=this._addTile(a)),t){let e=t.hasData();if((e||!this.map?.cancelPendingTileRequestsWhileZooming||n)&&(i[a.key]=a),n=t.wasRequested(),e)break}}}return i}_addTile(e){let t=this._inViewTiles.getTileById(e.key);if(t)return t;t=this._outOfViewCache.getAndRemove(e),t&&(t.resetFadeLogic(),this._setTileReloadTimer(e.key,t),t.tileID=e,this._state.initializeTileState(t,this.map?this.map.painter:null));let n=t;return t||(t=new EKe(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(t,e.key,t.state,!1)),t.uses++,this._inViewTiles.setTile(e.key,t),n||this._source.fire(new UJ(`dataloading`,{tile:t,coord:t.tileID})),t}_setTileReloadTimer(e,t){this._clearTileReloadTimer(e);let n=t.getExpiryTimeout();if(n){let t=()=>{this._reloadTile(e,`expired`),delete this._timers[e]};this._timers[e]=setTimeout(t,n)}}_clearTileReloadTimer(e){let t=this._timers[e];t&&(clearTimeout(t),delete this._timers[e])}_resetTileReloadTimers(){for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e of this._inViewTiles.getAllIds()){let t=this._inViewTiles.getTileById(e);this._setTileReloadTimer(e,t)}}refreshTiles(e){for(let t of this._inViewTiles.getAllIds()){let n=this._inViewTiles.getTileById(t);!this._inViewTiles.isIdRenderable(t)&&n.state!=`errored`||e.some(e=>e.equals(n.tileID.canonical))&&this._reloadTile(t,`expired`)}}_removeTile(e){let t=this._inViewTiles.getTileById(e);t&&(t.uses--,this._inViewTiles.deleteTileById(e),this._clearTileReloadTimer(e),!(t.uses>0)&&(t.hasData()&&t.state!==`reloading`?this._outOfViewCache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){if(e.dataType===`source`){if(e.sourceDataType===`metadata`){this._sourceLoaded=!0;return}e.sourceDataType!==`content`||!this._sourceLoaded||this._paused||(this.reload(e.sourceDataChanged,e.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e of this._inViewTiles.getAllIds())this._removeTile(e);this._outOfViewCache.reset()}tilesIn(e,t,n){let r=[],i=this.transform;if(!i)return r;let a=i.getCoveringTilesDetailsProvider().allowWorldCopies(),o=n?i.getCameraQueryGeometry(e):e,s=e=>i.screenPointToMercatorCoordinate(e,this.terrain),c=this.transformBbox(e,s,!a),l=this.transformBbox(o,s,!a),u=this.getIds(),d=UK.fromPoints(l);for(let e of u){let n=this._inViewTiles.getTileById(e);if(n.holdingForSymbolFade())continue;let o=a?[n.tileID]:[n.tileID.unwrapTo(-1),n.tileID.unwrapTo(0)],s=2**(i.zoom-n.tileID.overscaledZ),u=t*n.queryPadding*q/n.tileSize/s;for(let e of o){let t=d.map(t=>e.getTilePoint(new $K(t.x,t.y)));if(t.expandBy(u),t.intersects(uze)){let t=c.map(t=>e.getTilePoint(t)),i=l.map(t=>e.getTilePoint(t));r.push({tile:n,tileID:a?e:e.unwrapTo(0),queryGeometry:t,cameraQueryGeometry:i,scale:s})}}}return r}transformBbox(e,t,n){let r=e.map(t);if(n){let n=UK.fromPoints(e);n.shrinkBy(Math.min(n.width(),n.height())*.001);let i=n.map(t);UK.fromPoints(r).covers(i)||(r=r.map(e=>e.x>.5?new $K(e.x-1,e.y,e.z):e))}return r}getVisibleCoordinates(e){let t=this.getRenderableIds(e).map(e=>this._inViewTiles.getTileById(e).tileID);return this.transform&&this.transform.populateCache(t),t}hasTransition(){return this._source.hasTransition()?!0:NKe(this._source.type)&&zKe(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,t,n){e||=Aq,this._state.updateState(e,t,n)}removeFeatureState(e,t,n){e||=Aq,this._state.removeFeatureState(e,t,n)}getFeatureState(e,t){return e||=Aq,this._state.getState(e,t)}setDependencies(e,t,n){let r=this._inViewTiles.getTileById(e);r&&r.setDependencies(t,n)}reloadTilesForDependencies(e,t){for(let n of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(n).hasDependency(e,t)&&this._reloadTile(n,`reloading`);this._outOfViewCache.filter(n=>!n.hasDependency(e,t))}areTilesLoaded(){for(let e of this._inViewTiles.getAllTiles())if(e.state!==`loaded`&&e.state!==`errored`)return!1;return!0}},UKe=class{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,this.length*.5),this.paddedLength=this.length-this.padding*2}lerp(e){if(this.points.length===1)return this.points[0];e=iz(e,0,1);let t=1,n=this._distances[t],r=e*this.paddedLength+this.padding;for(;n<r&&t<this._distances.length;)n=this._distances[++t];let i=t-1,a=this._distances[i],o=n-a,s=o>0?(r-a)/o:0;return this.points[i].mult(1-s).add(this.points[t].mult(s))}};function fY(e,t,n,r,i){return i?e?e(t,n)+r:r===0?void 0:r:r}function pY(e,t){let n=!0;return e===`always`||(e===`never`||t===`never`)&&(n=!1),n}var WKe=class{constructor(e,t,n){let r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(let e=0;e<this.xCellCount*this.yCellCount;e++)r.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}insertCircle(e,t,n,r){this._forEachCell(t-r,n-r,t+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(n),this.circles.push(r)}_insertBoxCell(e,t,n,r,i,a){this.boxCells[i].push(a)}_insertCircleCell(e,t,n,r,i,a){this.circleCells[i].push(a)}_query(e,t,n,r,i,a,o){if(n<0||e>this.width||r<0||t>this.height)return[];let s=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return[{key:null,x1:e,y1:t,x2:n,y2:r}];for(let e=0;e<this.boxKeys.length;e++)s.push({key:this.boxKeys[e],x1:this.bboxes[e*4],y1:this.bboxes[e*4+1],x2:this.bboxes[e*4+2],y2:this.bboxes[e*4+3]});for(let e=0;e<this.circleKeys.length;e++){let t=this.circles[e*3],n=this.circles[e*3+1],r=this.circles[e*3+2];s.push({key:this.circleKeys[e],x1:t-r,y1:n-r,x2:t+r,y2:n+r})}}else{let c={hitTest:i,overlapMode:a,seenUids:{box:{},circle:{}}};this._forEachCell(e,t,n,r,this._queryCell,s,c,o)}return s}query(e,t,n,r){return this._query(e,t,n,r,!1,null)}hitTest(e,t,n,r,i,a){return this._query(e,t,n,r,!0,i,a).length>0}hitTestCircle(e,t,n,r,i){let a=e-n,o=e+n,s=t-n,c=t+n;if(o<0||a>this.width||c<0||s>this.height)return!1;let l=[],u={hitTest:!0,overlapMode:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,c,this._queryCellCircle,l,u,i),l.length>0}_queryCell(e,t,n,r,i,a,o,s){let{seenUids:c,hitTest:l,overlapMode:u}=o,d=this.boxCells[i],f=1e-6;if(d!==null){let i=this.bboxes;for(let o of d)if(!c.box[o]){c.box[o]=!0;let d=o*4,p=this.boxKeys[o];if(e<=i[d+2]+f&&t<=i[d+3]+f&&n>=i[d+0]-f&&r>=i[d+1]-f&&(!s||s(p))&&(!l||!pY(u,p.overlapMode))&&(a.push({key:p,x1:i[d],y1:i[d+1],x2:i[d+2],y2:i[d+3]}),l))return!0}}let p=this.circleCells[i];if(p!==null){let i=this.circles;for(let o of p)if(!c.circle[o]){c.circle[o]=!0;let d=o*3,f=this.circleKeys[o];if(this._circleAndRectCollide(i[d],i[d+1],i[d+2],e,t,n,r)&&(!s||s(f))&&(!l||!pY(u,f.overlapMode))){let e=i[d],t=i[d+1],n=i[d+2];if(a.push({key:f,x1:e-n,y1:t-n,x2:e+n,y2:t+n}),l)return!0}}}return!1}_queryCellCircle(e,t,n,r,i,a,o,s){let{circle:c,seenUids:l,overlapMode:u}=o,d=this.boxCells[i];if(d!==null){let e=this.bboxes;for(let t of d)if(!l.box[t]){l.box[t]=!0;let n=t*4,r=this.boxKeys[t];if(this._circleAndRectCollide(c.x,c.y,c.radius,e[n+0],e[n+1],e[n+2],e[n+3])&&(!s||s(r))&&!pY(u,r.overlapMode))return a.push(!0),!0}}let f=this.circleCells[i];if(f!==null){let e=this.circles;for(let t of f)if(!l.circle[t]){l.circle[t]=!0;let n=t*3,r=this.circleKeys[t];if(this._circlesCollide(e[n],e[n+1],e[n+2],c.x,c.y,c.radius)&&(!s||s(r))&&!pY(u,r.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,n,r,i,a,o,s){let c=this._convertToXCellCoord(e),l=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),d=this._convertToYCellCoord(r);for(let f=c;f<=u;f++)for(let c=l;c<=d;c++){let l=this.xCellCount*c+f;if(i.call(this,e,t,n,r,l,a,o,s))return}}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,n,r,i,a){let o=r-e,s=i-t,c=n+a;return c*c>o*o+s*s}_circleAndRectCollide(e,t,n,r,i,a,o){let s=(a-r)/2,c=Math.abs(e-(r+s));if(c>s+n)return!1;let l=(o-i)/2,u=Math.abs(t-(i+l));if(u>l+n)return!1;if(c<=s||u<=l)return!0;let d=c-s,f=u-l;return d*d+f*f<=n*n}};function GKe(e,t){let n=1/(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),r=1/(t[8]*t[8]+t[9]*t[9]+t[10]*t[10]),i=t[0]*n,a=t[4]*n,o=t[8]*r,s=t[1]*n,c=t[5]*n,l=t[9]*r,u=t[2]*n,d=t[6]*n,f=t[10]*r;e[0]=i,e[1]=a,e[2]=o,e[4]=s,e[5]=c,e[6]=l,e[8]=u,e[9]=d,e[10]=f;let p=t[12],m=t[13],h=t[14];return e[12]=-i*p-s*m-u*h,e[13]=-a*p-c*m-d*h,e[14]=-o*p-l*m-f*h,e[3]=0,e[7]=0,e[11]=0,e[15]=1,e}function KKe(e,t){return e[0]=1/t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1/t[5],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=1/t[14],e[12]=0,e[13]=0,e[14]=-1,e[15]=t[10]/t[14],e}function qKe(e,t){let n=1/(t[0]*t[5]-t[1]*t[4]);return e[0]=t[5]*n,e[1]=-t[1]*n,e[2]=0,e[3]=0,e[4]=-t[4]*n,e[5]=t[0]*n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1/t[10],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1/t[15],e}var JKe=tR();function mY(e,t,n){let r=tR();if(!e){let{vecSouth:e,vecEast:n}=hY(t),i=UWe();i[0]=n[0],i[1]=n[1],i[2]=e[0],i[3]=e[1],WWe(i,i),r[0]=i[0],r[1]=i[1],r[4]=i[2],r[5]=i[3]}return sR(r,r,[1/n,1/n,1]),r}function YKe(e,t,n,r){if(e){let e=tR();if(!t){let{vecSouth:t,vecEast:r}=hY(n);e[0]=r[0],e[1]=r[1],e[4]=t[0],e[5]=t[1]}return sR(e,e,[r,r,1]),e}return n.pixelsToClipSpaceMatrix}function hY(e){let t=Math.cos(e.rollInRadians),n=Math.sin(e.rollInRadians),r=Math.cos(e.pitchInRadians),i=Math.cos(e.bearingInRadians),a=Math.sin(e.bearingInRadians),o=FR();o[0]=-i*r*n-a*t,o[1]=-a*r*n+i*t;let s=RR(o);s<1e-9?zR(o):LR(o,o,1/s);let c=FR();c[0]=i*r*t-a*n,c[1]=a*r*t+i*n;let l=RR(c);return l<1e-9?zR(c):LR(c,c,1/l),{vecEast:c,vecSouth:o}}function gY(e,t,n){return fY(e.getElevation,t,n,e.heightOffset??0,e.heightAnchorGround??!0)}function _Y(e,t,n,r){let i;r==null?(i=[e,t,0,1],wY(i,i,n)):(i=[e,t,r,1],kR(i,i,n));let a=i[3];return{point:new K(i[0]/a,i[1]/a),signedDistanceFromCamera:a,isOccluded:!1}}function XKe(e,t){return .5+e/t*.5}function ZKe(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function QKe(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=n?e.textSizeData:e.iconSizeData,m=gq(p,t.transform.zoom),h=[256/t.width*2+1,256/t.height*2+1],g=n?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;g.clear();let _=e.lineVertexArray,v=n?e.text.placedSymbolArray:e.icon.placedSymbolArray,y=t.transform.width/t.transform.height,b=!1;for(let n=0;n<v.length;n++){let x=v.get(n);if(x.hidden||x.writingMode===2&&!b){CY(x.numGlyphs,g);continue}b=!1;let S=new K(x.anchorX,x.anchorY),C={getElevation:f,pitchedLabelPlaneMatrix:r,lineVertexArray:_,pitchWithMap:a,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:S,unwrappedTileID:c,width:l,height:u,translation:d},w=rqe(x.anchorX,x.anchorY,C);if(!ZKe(w.point,h)){CY(x.numGlyphs,g);continue}let T=w.signedDistanceFromCamera,E=XKe(t.transform.cameraToCenterDistance,T),D=hq(p,m,x),O=a?D*t.transform.getPitchedTextCorrection(x.anchorX,x.anchorY,c)/E:D*E,k=tqe({projectionContext:C,pitchedLabelPlaneMatrixInverse:i,symbol:x,fontSize:O,flip:!1,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:y,rotateToLine:s});b=k.useVertical,(k.notEnoughRoom||b||k.needsFlipping&&tqe({projectionContext:C,pitchedLabelPlaneMatrixInverse:i,symbol:x,fontSize:O,flip:!0,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:y,rotateToLine:s}).notEnoughRoom)&&CY(x.numGlyphs,g)}n?e.text.dynamicLayoutVertexBuffer.updateData(g):e.icon.dynamicLayoutVertexBuffer.updateData(g)}function $Ke(e,t,n,r,i,a,o,s){let c=a.glyphStartIndex+a.numGlyphs,l=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,d=t.getoffsetX(a.glyphStartIndex),f=t.getoffsetX(c-1),p=SY(e*d,n,r,i,a.segment,l,u,s,o);if(!p)return null;let m=SY(e*f,n,r,i,a.segment,l,u,s,o);return!m||s.projectionCache.anyProjectionOccluded?null:{first:p,last:m}}function eqe(e,t,n,r){return e===1&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*r?{useVertical:!0}:(e===2?t.y<n.y:t.x>n.x)?{needsFlipping:!0}:null}function tqe(e){let{projectionContext:t,pitchedLabelPlaneMatrixInverse:n,symbol:r,fontSize:i,flip:a,keepUpright:o,glyphOffsetArray:s,dynamicLayoutVertexArray:c,aspectRatio:l,rotateToLine:u}=e,d=i/24,f=r.lineOffsetX*d,p=r.lineOffsetY*d,m;if(r.numGlyphs>1){let e=r.glyphStartIndex+r.numGlyphs,i=r.lineStartIndex,c=r.lineStartIndex+r.lineLength,h=$Ke(d,s,f,p,a,r,u,t);if(!h)return{notEnoughRoom:!0};let g=bY(h.first.point.x,h.first.point.y,t,n),_=bY(h.last.point.x,h.last.point.y,t,n);if(o&&!a){let e=eqe(r.writingMode,g,_,l);if(e)return e}m=[h.first];for(let n=r.glyphStartIndex+1;n<e-1;n++){let e=SY(d*s.getoffsetX(n),f,p,a,r.segment,i,c,t,u);if(!e)return{notEnoughRoom:!0};m.push(e)}m.push(h.last)}else{if(o&&!a){let e=yY(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,i=r.lineStartIndex+r.segment+1,a=new K(t.lineVertexArray.getx(i),t.lineVertexArray.gety(i)),o=yY(a.x,a.y,t),s=o.signedDistanceFromCamera>0?o.point:nqe(t.tileAnchorPoint,a,e,1,t),c=bY(e.x,e.y,t,n),u=bY(s.x,s.y,t,n),d=eqe(r.writingMode,c,u,l);if(d)return d}let e=SY(d*s.getoffsetX(r.glyphStartIndex),f,p,a,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,t,u);if(!e||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[e]}for(let e of m)yq(c,e.point,e.angle);return{}}function nqe(e,t,n,r,i){let a=e.add(e.sub(t)._unit()),o=yY(a.x,a.y,i).point,s=n.sub(o);return n.add(s._mult(r/s.mag()))}function vY(e,t,n){let r=t.projectionCache;if(r.projections[e])return r.projections[e];let i=new K(t.lineVertexArray.getx(e),t.lineVertexArray.gety(e)),a=yY(i.x,i.y,t);if(a.signedDistanceFromCamera>0)return r.projections[e]=a.point,r.anyProjectionOccluded||=a.isOccluded,a.point;let o=e-n.direction,s=n.distanceFromAnchor===0?t.tileAnchorPoint:new K(t.lineVertexArray.getx(o),t.lineVertexArray.gety(o)),c=n.absOffsetX-n.distanceFromAnchor+1;return nqe(s,i,n.previousVertex,c,t)}function yY(e,t,n){let r=e+n.translation[0],i=t+n.translation[1],a;return n.pitchWithMap?(a=_Y(r,i,n.pitchedLabelPlaneMatrix,gY(n,r,i)),a.isOccluded=!1):(a=n.transform.projectTileCoordinates(r,i,n.unwrappedTileID,gY(n,r,i)),a.point.x=(a.point.x*.5+.5)*n.width,a.point.y=(-a.point.y*.5+.5)*n.height),a}function bY(e,t,n,r){if(n.pitchWithMap){let i=[e,t,0,1];kR(i,i,r);let a=i[0]/i[3],o=i[1]/i[3];return n.transform.projectTileCoordinates(a,o,n.unwrappedTileID,gY(n,a,o)).point}return{x:e/n.width*2-1,y:1-t/n.height*2}}function rqe(e,t,n){return n.transform.projectTileCoordinates(e,t,n.unwrappedTileID,gY(n,e,t))}function xY(e,t,n){return e._unit()._perp()._mult(t*n)}function iqe(e,t,n,r,i,a,o,s,c){if(s.projectionCache.offsets[e])return s.projectionCache.offsets[e];let l=n.add(t);if(e+c.direction<r||e+c.direction>=i)return s.projectionCache.offsets[e]=l,l;let u=vY(e+c.direction,s,c),d=xY(u.sub(n),o,c.direction),f=n.add(d),p=u.add(d);return s.projectionCache.offsets[e]=TPe(a,l,f,p)||l,s.projectionCache.offsets[e]}function SY(e,t,n,r,i,a,o,s,c){let l=r?e-t:e+t,u=l>0?1:-1,d=0;r&&(u*=-1,d=Math.PI),u<0&&(d+=Math.PI);let f=u>0?a+i:a+i+1,p;s.projectionCache.cachedAnchorPoint?p=s.projectionCache.cachedAnchorPoint:(p=yY(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=p);let m=p,h=p,g,_,v=0,y=0,b=Math.abs(l),x=[],S;for(;v+y<=b;){if(f+=u,f<a||f>=o)return null;v+=y,h=m,_=g;let e={absOffsetX:b,direction:u,distanceFromAnchor:v,previousVertex:h};if(m=vY(f,s,e),n===0)x.push(h),S=m.sub(h);else{let t,r=m.sub(h);t=r.mag()===0?xY(vY(f+u,s,e).sub(m),n,u):xY(r,n,u),_||=h.add(t),g=iqe(f,t,m,a,o,_,n,s,e),x.push(_),S=g.sub(_)}y=S.mag()}let C=(b-v)/y,w=S._mult(C)._add(_||h),T=d+Math.atan2(m.y-h.y,m.x-h.x);return x.push(w),{point:w,angle:c?T:0,path:x}}var aqe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function CY(e,t){for(let n=0;n<e;n++){let e=t.length;t.resize(e+4),t.float32.set(aqe,e*3)}}function wY(e,t,n){let r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e[3]=n[3]*r+n[7]*i+n[15],e}function oqe(e,t){let n=JKe;return qKe(n,t.pitchedLabelPlaneMatrix),e.map(e=>{let r=_Y(e.x,e.y,n,gY(t,e.x,e.y)),i=t.transform.projectTileCoordinates(r.point.x,r.point.y,t.unwrappedTileID,gY(t,r.point.x,r.point.y));return i.point.x=(i.point.x*.5+.5)*t.width,i.point.y=(-i.point.y*.5+.5)*t.height,i})}function sqe(e){let t=0,n=0,r=0,i=0;for(let a=0;a<e.length;a++)e[a].isOccluded?(r=a+1,i=0):(i++,i>n&&(n=i,t=r));return e.slice(t,t+n)}var cqe=class{constructor(e,t=new WKe(e.width+200,e.height+200,25),n=new WKe(e.width+200,e.height+200,25)){this.transform=e,this.grid=t,this.ignoredGrid=n,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,n,r,i,a,o,s,c,l,u,d,f=0,p=!0){let m=e.anchorPointX+s[0],h=e.anchorPointY+s[1],g=this.projectAndGetPerspectiveRatio(m,h,i,fY(l,m,h,f,p),d),_=n*g.perspectiveRatio,v;if(!a&&!o){let t=g.x+(u?u.x*_:0),n=g.y+(u?u.y*_:0);v={allPointsOccluded:!1,box:[t+e.x1*_,n+e.y1*_,t+e.x2*_,n+e.y2*_]}}else v=this._projectCollisionBox(e,_,r,i,a,o,s,g,l,u,d,f,p);let[y,b,x,S]=v.box,C=a?v.allPointsOccluded:g.isOccluded,w=C;return w||=g.perspectiveRatio<this.perspectiveRatioCutoff,w||=!this.isInsideGrid(y,b,x,S),w||t!==`always`&&this.grid.hitTest(y,b,x,S,t,c)?{box:[y,b,x,S],placeable:!1,offscreen:!1,occluded:C}:{box:[y,b,x,S],placeable:!0,offscreen:this.isOffscreen(y,b,x,S),occluded:C}}placeCollisionCircles(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=[],h=new K(t.anchorX,t.anchorY),g=this.getPerspectiveRatio(h.x,h.y,a,p?.(h.x,h.y)),_=(c?i*this.transform.getPitchedTextCorrection(t.anchorX,t.anchorY,a)/g:i*g)/24,v={projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},y=t.lineOffsetX*_,b=t.lineOffsetY*_,x={getElevation:p,pitchedLabelPlaneMatrix:o,lineVertexArray:n,pitchWithMap:c,projectionCache:v,transform:this.transform,tileAnchorPoint:h,unwrappedTileID:a,width:this.transform.width,height:this.transform.height,translation:f},S=$Ke(_,r,y,b,!1,t,!1,x),C=!1,w=!1,T=!0;if(S){let t=u*.5*g+d,n=new K(-100,-100),r=new K(this.screenRightBoundary,this.screenBottomBoundary),i=new UKe,a=S.first,o=S.last,f=[];for(let e=a.path.length-1;e>=1;e--)f.push(a.path[e]);for(let e=1;e<o.path.length;e++)f.push(o.path[e]);let p=t*2.5;if(c){let e=this.projectPathToScreenSpace(f,x);f=e.some(e=>e.signedDistanceFromCamera<=0)?[]:e.map(e=>e.point)}let h=[];if(f.length>0){let e=f[0].clone(),t=f[0].clone();for(let n=1;n<f.length;n++)e.x=Math.min(e.x,f[n].x),e.y=Math.min(e.y,f[n].y),t.x=Math.max(t.x,f[n].x),t.y=Math.max(t.y,f[n].y);h=e.x>=n.x&&t.x<=r.x&&e.y>=n.y&&t.y<=r.y?[f]:t.x<n.x||e.x>r.x||t.y<n.y||e.y>r.y?[]:zWe([f],n.x,n.y,r.x,r.y)}for(let n of h){i.reset(n,t*.25);let r=0;r=i.length<=.5*t?1:Math.ceil(i.paddedLength/p)+1;for(let n=0;n<r;n++){let a=n/Math.max(r-1,1),o=i.lerp(a),c=o.x+100,u=o.y+100;m.push(c,u,t,0);let d=c-t,f=u-t,p=c+t,h=u+t;if(T&&=this.isOffscreen(d,f,p,h),w||=this.isInsideGrid(d,f,p,h),e!==`always`&&this.grid.hitTestCircle(c,u,t,e,l)&&(C=!0,!s))return{circles:[],offscreen:!1,collisionDetected:C}}}}return{circles:!s&&C||!w||g<this.perspectiveRatioCutoff?[]:m,offscreen:T,collisionDetected:C}}projectPathToScreenSpace(e,t){return sqe(oqe(e,t))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let t=[],n=new UK;for(let r of e){let e=new K(r.x+100,r.y+100);n.extend(e),t.push(e)}let{minX:r,minY:i,maxX:a,maxY:o}=n,s=this.grid.query(r,i,a,o).concat(this.ignoredGrid.query(r,i,a,o)),c={},l={};for(let e of s){let n=e.key;c[n.bucketInstanceId]===void 0&&(c[n.bucketInstanceId]={}),!c[n.bucketInstanceId][n.featureIndex]&&HG(t,[new K(e.x1,e.y1),new K(e.x2,e.y1),new K(e.x2,e.y2),new K(e.x1,e.y2)])&&(c[n.bucketInstanceId][n.featureIndex]=!0,l[n.bucketInstanceId]===void 0&&(l[n.bucketInstanceId]=[]),l[n.bucketInstanceId].push(n.featureIndex))}return l}insertCollisionBox(e,t,n,r,i,a){let o=n?this.ignoredGrid:this.grid,s={bucketInstanceId:r,featureIndex:i,collisionGroupID:a,overlapMode:t};o.insert(s,e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,n,r,i,a){let o=n?this.ignoredGrid:this.grid,s={bucketInstanceId:r,featureIndex:i,collisionGroupID:a,overlapMode:t};for(let t=0;t<e.length;t+=4)o.insertCircle(s,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(e,t,n,r,i){if(i){let n;r==null?(n=[e,t,0,1],wY(n,n,i)):(n=[e,t,r,1],kR(n,n,i));let a=n[3];return{x:(n[0]/a+1)/2*this.transform.width+100,y:(-n[1]/a+1)/2*this.transform.height+100,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/a),isOccluded:!1,signedDistanceFromCamera:a}}{let i=this.transform.projectTileCoordinates(e,t,n,r);return{x:(i.point.x+1)/2*this.transform.width+100,y:(-i.point.y+1)/2*this.transform.height+100,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/i.signedDistanceFromCamera),isOccluded:i.isOccluded,signedDistanceFromCamera:i.signedDistanceFromCamera}}}getPerspectiveRatio(e,t,n,r){let i=this.transform.projectTileCoordinates(e,t,n,r);return .5+.5*(this.transform.cameraToCenterDistance/i.signedDistanceFromCamera)}isOffscreen(e,t,n,r){return n<100||e>=this.screenRightBoundary||r<100||t>this.screenBottomBoundary}isInsideGrid(e,t,n,r){return n>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary}getViewportMatrix(){let e=rR([]);return oR(e,e,[-100,-100,0]),e}_projectCollisionBox(e,t,n,r,i,a,o,s,c,l,u,d=0,f=!0){let p=1,m=0,h=0,g=1,_=e.anchorPointX+o[0],v=e.anchorPointY+o[1];if(a&&!i){let e=this.projectAndGetPerspectiveRatio(_+1,v,r,fY(c,_+1,v,d,f),u),t=e.x-s.x,n=e.y-s.y,i=Math.atan(n/t)+(t<0?Math.PI:0),a=Math.sin(i),o=Math.cos(i);p=o,m=a,h=-a,g=o}else if(!a&&i){let e=hY(this.transform);p=e.vecEast[0],m=e.vecEast[1],h=e.vecSouth[0],g=e.vecSouth[1]}let y=s.x,b=s.y,x=t;if(i&&(y=_,b=v,x=2**-(this.transform.zoom-n.overscaledZ),x*=this.transform.getPitchedTextCorrection(_,v,r),!l)){let e=iz(.5+.5*(s.signedDistanceFromCamera/this.transform.cameraToCenterDistance),0,4);x*=e}l&&(y+=p*l.x*x+h*l.y*x,b+=m*l.x*x+g*l.y*x);let S=e.x1*x,C=e.x2*x,w=(S+C)/2,T=e.y1*x,E=e.y2*x,D=(T+E)/2,O=[{offsetX:S,offsetY:T},{offsetX:w,offsetY:T},{offsetX:C,offsetY:T},{offsetX:C,offsetY:D},{offsetX:C,offsetY:E},{offsetX:w,offsetY:E},{offsetX:S,offsetY:E},{offsetX:S,offsetY:D}],k=[];for(let{offsetX:e,offsetY:t}of O)k.push(new K(y+p*e+h*t,b+m*e+g*t));let A=!1;if(i){let e=k.map(e=>this.projectAndGetPerspectiveRatio(e.x,e.y,r,fY(c,e.x,e.y,d,f),u));A=e.some(e=>!e.isOccluded),k=e.map(e=>new K(e.x,e.y))}else A=!0;return{box:yPe(k),allPointsOccluded:!A}}},lqe=class{constructor(e,t,n,r){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):r&&n?1:0,this.placed=n}isHidden(){return this.opacity===0&&!this.placed}},TY=class{constructor(e,t,n,r,i){this.text=new lqe(e?e.text:null,t,n,i),this.icon=new lqe(e?e.icon:null,t,r,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},uqe=class{constructor(e,t,n){this.text=e,this.icon=t,this.skipFade=n}},dqe=class{constructor(e,t,n,r,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i}},fqe=class{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}};function pqe(e,t,n,r,i){let{horizontalAlign:a,verticalAlign:o}=OBe(e),s=-(a-.5)*t,c=-(o-.5)*n;return new K(s+r[0]*i,c+r[1]*i)}var mqe=class{constructor(e,t,n,r,i){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new cqe(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new fqe(r),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let t=this.terrain;if(t)return(n,r)=>t.getElevation(e,n,r)}getBucketParts(e,t,n,r){let i=n.getBucket(t),a=n.latestFeatureIndex;if(!i||!a||t.id!==i.layerIds[0])return;let o=n.collisionBoxArray,s=i.layers[0].layout,c=i.layers[0].paint,l=2**(this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/q,d=n.tileID.toUnwrapped(),f=s.get(`text-rotation-alignment`)===`map`,p=BR(n,1,this.transform.zoom),m=qR(this.collisionIndex.transform,n,c.get(`text-translate`),c.get(`text-translate-anchor`)),h=qR(this.collisionIndex.transform,n,c.get(`icon-translate`),c.get(`icon-translate-anchor`)),g=mY(f,this.transform,p);this.retainedQueryData[i.bucketInstanceId]=new dqe(i.bucketInstanceId,a,i.sourceLayerIndex,i.index,n.tileID);let _={bucket:i,layout:s,translationText:m,translationIcon:h,unwrappedTileID:d,pitchedLabelPlaneMatrix:g,scale:l,textPixelRatio:u,holdingForFade:n.holdingForSymbolFade(),collisionBoxArray:o,partiallyEvaluatedTextSize:gq(i.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(i.sourceID)};if(r)for(let t of i.sortKeyRanges){let{sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i}=t;e.push({sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i,parameters:_})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:i.symbolInstances.length,parameters:_})}attemptAnchorPlacement(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=BWe[e.textAnchor],C=[e.textOffset0,e.textOffset1],w=pqe(S,n,r,C,i),T=this.collisionIndex.placeCollisionBox(t,d,s,c,l,o,a,h,u.predicate,v,w,y,b,x);if(!(_&&!this.collisionIndex.placeCollisionBox(_,d,s,c,l,o,a,g,u.predicate,v,w,y,b,x).placeable)&&T.placeable){let e;if(this.prevPlacement?.variableOffsets[f.crossTileID]&&this.prevPlacement?.placements[f.crossTileID]?.text&&(e=this.prevPlacement.variableOffsets[f.crossTileID].anchor),f.crossTileID===0)throw Error(`symbolInstance.crossTileID can't be 0`);return this.variableOffsets[f.crossTileID]={textOffset:C,width:n,height:r,anchor:S,textBoxScale:i,prevAnchor:e},this.markUsedJustification(p,S,f,m),p.allowVerticalPlacement&&(this.markUsedOrientation(p,m,f),this.placedOrientations[f.crossTileID]=m),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(e,t,n){let{bucket:r,layout:i,translationText:a,translationIcon:o,unwrappedTileID:s,pitchedLabelPlaneMatrix:c,textPixelRatio:l,holdingForFade:u,collisionBoxArray:d,partiallyEvaluatedTextSize:f,collisionGroup:p}=e.parameters,m=i.get(`text-optional`),h=i.get(`icon-optional`),g=_q(i,`text-overlap`,`text-allow-overlap`),_=g===`always`,v=_q(i,`icon-overlap`,`icon-allow-overlap`),y=v===`always`,b=i.get(`text-rotation-alignment`)===`map`,x=i.get(`text-pitch-alignment`)===`map`,S=i.get(`icon-text-fit`)!==`none`,C=i.get(`symbol-z-order`)===`viewport-y`,w=i.get(`symbol-height-anchor`)===`ground`,T=_&&(y||!r.hasIconData()||h),E=y&&(_||!r.hasTextData()||m);!r.collisionArrays&&d&&r.deserializeCollisionBoxes(d);let D=this.retainedQueryData[r.bucketInstanceId].tileID,O=this._getTerrainElevationFunc(D),k=this.transform.getFastPathSimpleProjectionMatrix(D),A=(e,d,y)=>{if(t[e.crossTileID])return;if(u){this.placements[e.crossTileID]=new uqe(!1,!1,!1);return}let C=e.heightOffset,A=!1,j=!1,M=!0,N=null,P={box:null,placeable:!1,offscreen:null,occluded:!1},F={box:null,placeable:!1,offscreen:null},I=null,L=null,R=null,ee=0,z=0,te=0;d.textFeatureIndex?ee=d.textFeatureIndex:e.useRuntimeCollisionCircles&&(ee=e.featureIndex),d.verticalTextFeatureIndex&&(z=d.verticalTextFeatureIndex);let ne=d.textBox;if(ne){let t=t=>{let n=1;if(r.allowVerticalPlacement&&!t&&this.prevPlacement){let t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,n=t,this.markUsedOrientation(r,n,e))}return n},i=(t,n)=>{if(r.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&d.verticalTextBox){for(let e of r.writingModes)if(e===2?(P=n(),F=P):P=t(),P?.placeable)break}else P=t()},c=e.textAnchorOffsetStartIndex,u=e.textAnchorOffsetEndIndex;if(u===c){let n=(t,n)=>{let i=this.collisionIndex.placeCollisionBox(t,g,l,D,s,x,b,a,p.predicate,O,void 0,k,C,w);return i?.placeable&&(this.markUsedOrientation(r,n,e),this.placedOrientations[e.crossTileID]=n),i};i(()=>n(ne,1),()=>{let t=d.verticalTextBox;return r.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&t?n(t,2):{box:null,offscreen:null}}),t(P?.placeable)}else{let f=BWe[this.prevPlacement?.variableOffsets[e.crossTileID]?.anchor],m=(t,i,d)=>{let m=t.x2-t.x1,h=t.y2-t.y1,_=e.textBoxScale,y=S&&v===`never`?i:null,T=null,E=g===`never`?1:2,j=`never`;f&&E++;for(let n=0;n<E;n++){for(let n=c;n<u;n++){let i=r.textAnchorOffsets.get(n);if(f&&i.textAnchor!==f)continue;let c=this.attemptAnchorPlacement(i,t,m,h,_,b,x,l,D,s,p,j,e,r,d,a,o,y,O,k,C,w);if(c&&(T=c.placedGlyphBoxes,T?.placeable))return A=!0,N=c.shift,T}f?f=null:j=g}return n&&!T&&(T={box:this.collisionIndex.placeCollisionBox(ne,`always`,l,D,s,x,b,a,p.predicate,O,void 0,k,C,w).box,offscreen:!1,placeable:!1,occluded:!1}),T};i(()=>m(ne,d.iconBox,1),()=>{let t=d.verticalTextBox,n=P?.placeable;return r.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&t?m(t,d.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}}),P&&(A=P.placeable,M=P.offscreen);let h=t(P?.placeable);if(!A&&this.prevPlacement){let t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(r,t.anchor,e,h))}}}if(I=P,A=I?.placeable,M=I?.offscreen,e.useRuntimeCollisionCircles&&e.centerJustifiedTextSymbolIndex>=0){let t=r.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),o=hq(r.textSizeData,f,t),l=i.get(`text-padding`),u=e.collisionCircleDiameter;L=this.collisionIndex.placeCollisionCircles(g,t,r.lineVertexArray,r.glyphOffsetArray,o,s,c,n,x,p.predicate,u,l,a,O),L.circles.length&&L.collisionDetected&&!n&&_z(`Collisions detected, but collision boxes are not shown`),A=_||L.circles.length>0&&!L.collisionDetected,M&&=L.offscreen}if(d.iconFeatureIndex&&(te=d.iconFeatureIndex),d.iconBox){let e=e=>this.collisionIndex.placeCollisionBox(e,v,l,D,s,x,b,o,p.predicate,O,S&&N?N:void 0,k,C,w);F&&F.placeable&&d.verticalIconBox?(R=e(d.verticalIconBox),j=R.placeable):(R=e(d.iconBox),j=R.placeable),M&&=R.offscreen}let re=m||e.numHorizontalGlyphVertices===0&&e.numVerticalGlyphVertices===0,ie=h||e.numIconVertices===0;!re&&!ie?j=A=j&&A:ie?re||(j&&=A):A=j&&A;let ae=A&&I.placeable,oe=j&&R.placeable;if(ae&&(F&&F.placeable&&z?this.collisionIndex.insertCollisionBox(I.box,g,i.get(`text-ignore-placement`),r.bucketInstanceId,z,p.ID):this.collisionIndex.insertCollisionBox(I.box,g,i.get(`text-ignore-placement`),r.bucketInstanceId,ee,p.ID)),oe&&this.collisionIndex.insertCollisionBox(R.box,v,i.get(`icon-ignore-placement`),r.bucketInstanceId,te,p.ID),L&&A&&this.collisionIndex.insertCollisionCircles(L.circles,g,i.get(`text-ignore-placement`),r.bucketInstanceId,ee,p.ID),n&&this.storeCollisionData(r.bucketInstanceId,y,d,I,R,L),e.crossTileID===0)throw Error(`symbolInstance.crossTileID can't be 0`);if(r.bucketInstanceId===0)throw Error(`bucket.bucketInstanceId can't be 0`);let se=(A||T)&&!I?.occluded,ce=(j||E)&&!R?.occluded;this.placements[e.crossTileID]=new uqe(se,ce,M||r.justReloaded),t[e.crossTileID]=!0};if(C){if(e.symbolInstanceStart!==0)throw Error(`bucket.bucketInstanceId should be 0`);let t=r.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let e=t.length-1;e>=0;--e){let n=t[e];A(r.symbolInstances.get(n),r.collisionArrays[n],n)}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)A(r.symbolInstances.get(t),r.collisionArrays[t],t);r.justReloaded=!1}storeCollisionData(e,t,n,r,i,a){if(n.textBox||n.iconBox){let a;this.collisionBoxArrays.has(e)?a=this.collisionBoxArrays.get(e):(a=new Map,this.collisionBoxArrays.set(e,a));let o;a.has(t)?o=a.get(t):(o={text:null,icon:null},a.set(t,o)),n.textBox&&(o.text=r.box),n.iconBox&&(o.icon=i.box)}if(a){let t=this.collisionCircleArrays[e];t===void 0&&(t=this.collisionCircleArrays[e]=[]);for(let e=0;e<a.circles.length;e+=4)t.push(a.circles[e+0]-100),t.push(a.circles[e+1]-100),t.push(a.circles[e+2]),t.push(+!!a.collisionDetected)}}markUsedJustification(e,t,n,r){let i={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex},a;a=r===2?n.verticalPlacedTextSymbolIndex:i[VWe(t)];let o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(let t of o)t>=0&&(a>=0&&t!==a?e.text.placedSymbolArray.get(t).crossTileID=0:e.text.placedSymbolArray.get(t).crossTileID=n.crossTileID)}markUsedOrientation(e,t,n){let r=t===1||t===3?t:0,i=t===2?t:0,a=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(let t of a)e.text.placedSymbolArray.get(t).placedOrientation=r;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=i)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,n=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let r=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(let e in this.placements){let t=this.placements[e],a=i[e];a?(this.opacities[e]=new TY(a,r,t.text,t.icon),n||=t.text!==a.text.placed,n||=t.icon!==a.icon.placed):(this.opacities[e]=new TY(null,r,t.text,t.icon,t.skipFade),n||=t.text||t.icon)}for(let e in i){let t=i[e];if(!this.opacities[e]){let i=new TY(t,r,!1,!1);i.isHidden()||(this.opacities[e]=i,n||=t.text.placed,n||=t.icon.placed)}}for(let e in a)!this.variableOffsets[e]&&this.opacities[e]&&!this.opacities[e].isHidden()&&(this.variableOffsets[e]=a[e]);for(let e in o)!this.placedOrientations[e]&&this.opacities[e]&&!this.opacities[e].isHidden()&&(this.placedOrientations[e]=o[e]);if(t&&t.lastPlacementChangeTime===void 0)throw Error(`Last placement time for previous placement is not defined`);n?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!=`number`&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let n={};for(let r of t){let t=r.getBucket(e);t&&r.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,r.tileID,n,r.collisionBoxArray)}}updateBucketOpacities(e,t,n,r){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let i=e.layers[0],a=i.layout,o=new TY(null,0,!1,!1,!0),s=a.get(`text-allow-overlap`),c=a.get(`icon-allow-overlap`),l=i._unevaluatedLayout.hasValue(`text-variable-anchor`)||i._unevaluatedLayout.hasValue(`text-variable-anchor-offset`),u=a.get(`text-rotation-alignment`)===`map`,d=a.get(`text-pitch-alignment`)===`map`,f=a.get(`icon-text-fit`)!==`none`,p=new TY(null,0,s&&(c||!e.hasIconData()||a.get(`icon-optional`)),c&&(s||!e.hasTextData()||a.get(`text-optional`)),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(r);let m=(e,t,n)=>{for(let r=0;r<t/4;r++)e.opacityVertexArray.emplaceBack(n);e.hasVisibleVertices||=n!==EY},h=this.collisionBoxArrays.get(e.bucketInstanceId);for(let t=0;t<e.symbolInstances.length;t++){let r=e.symbolInstances.get(t),{numHorizontalGlyphVertices:i,numVerticalGlyphVertices:a,crossTileID:s}=r,c=n[s],g=this.opacities[s];c?g=o:g||(g=p,this.opacities[s]=g),n[s]=!0;let _=i>0||a>0,v=r.numIconVertices>0,y=this.placedOrientations[r.crossTileID],b=y===2,x=y===1||y===3;if(_){let t=bqe(g.text),n=b?EY:t;m(e.text,i,n);let o=x?EY:t;m(e.text,a,o);let s=g.text.isHidden(),c=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let t of c)t>=0&&(e.text.placedSymbolArray.get(t).hidden=s||b?1:0);r.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).hidden=s||x?1:0);let l=this.variableOffsets[r.crossTileID];l&&this.markUsedJustification(e,l.anchor,r,y);let u=this.placedOrientations[r.crossTileID];u&&(this.markUsedJustification(e,`left`,r,u),this.markUsedOrientation(e,u,r))}if(v){let t=bqe(g.icon),n=!(f&&r.verticalPlacedIconSymbolIndex&&b);if(r.placedIconSymbolIndex>=0){let i=n?t:EY;m(e.icon,r.numIconVertices,i),e.icon.placedSymbolArray.get(r.placedIconSymbolIndex).hidden=g.icon.isHidden()}if(r.verticalPlacedIconSymbolIndex>=0){let i=n?EY:t;m(e.icon,r.numVerticalIconVertices,i),e.icon.placedSymbolArray.get(r.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden()}}let S=h?.has(t)?h.get(t):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let n=e.collisionArrays[t];if(n){let t=new K(0,0);if(n.textBox||n.verticalTextBox){let r=!0;if(l){let e=this.variableOffsets[s];e?(t=pqe(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),u&&t._rotate(d?-this.transform.bearingInRadians:this.transform.bearingInRadians)):r=!1}if(n.textBox||n.verticalTextBox){let i;n.textBox&&(i=b),n.verticalTextBox&&(i=x),hqe(e.textCollisionBox.collisionVertexArray,g.text.placed,!r||i,S.text,t.x,t.y)}}if(n.iconBox||n.verticalIconBox){let r=!!(!x&&n.verticalIconBox),i;n.iconBox&&(i=r),n.verticalIconBox&&(i=!r),hqe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,i,S.icon,f?t.x:0,f?t.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){let n=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*n>e}setStale(){this.stale=!0}};function hqe(e,t,n,r,i,a){(!r||r.length===0)&&(r=[0,0,0,0]);let o=r[0]-100,s=r[1]-100,c=r[2]-100,l=r[3]-100;e.emplaceBack(+!!t,+!!n,i||0,a||0,o,s),e.emplaceBack(+!!t,+!!n,i||0,a||0,c,s),e.emplaceBack(+!!t,+!!n,i||0,a||0,c,l),e.emplaceBack(+!!t,+!!n,i||0,a||0,o,l)}var gqe=2**25,_qe=2**24,vqe=2**17,yqe=2**16;function bqe(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return 4294967295;let t=+!!e.placed,n=Math.floor(e.opacity*127);return n*gqe+t*_qe+n*vqe+t*yqe+n*512+t*256+n*2+t}var EY=0,xqe=class{constructor(e){this._sortAcrossTiles=e.layout.get(`symbol-z-order`)!==`viewport-y`&&!e.layout.get(`symbol-sort-key`).isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,n,r,i){let a=this._bucketParts;for(;this._currentTileIndex<e.length;){let n=e[this._currentTileIndex];if(t.getBucketParts(a,r,n,this._sortAcrossTiles),this._currentTileIndex++,i())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((e,t)=>e.sortKey-t.sortKey));this._currentPartIndex<a.length;){let e=a[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,n),this._currentPartIndex++,i())return!0}return!1}},Sqe=class{constructor(e,t,n,r,i,a,o,s){this.placement=new mqe(e,t,a,o,s),this._currentPlacementIndex=n.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(e,t,n){let r=LJ(),i=()=>!this._forceFullPlacement&&LJ()-r>2;for(;this._currentPlacementIndex>=0;){let r=t[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if(UBe(r)&&r.layout&&(!r.minzoom||r.minzoom<=a)&&(!r.maxzoom||r.maxzoom>a)){if(this._inProgressLayer||=new xqe(r),this._inProgressLayer.continuePlacement(n[r.source],this.placement,this._showCollisionBoxes,r,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}},Cqe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],DY=new Uint32Array(96),wqe=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw Error(`Data must be an instance of ArrayBuffer or SharedArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==1)throw Error(`Got v${i} data when expected v1.`);let a=Cqe[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,void 0,t)}constructor(e,t=64,n=Float64Array,r=ArrayBuffer,i){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=Cqe.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-s%8)%8;if(a<0)throw Error(`Unexpected typed array class: ${n}.`);if(i)this.data=i,this.ids=new this.IndexArrayType(i,8,e),this.coords=new n(i,8+s+c,e*2),this._pos=e*2,this._finished=!0;else{let i=this.data=new r(8+o+s+c);this.ids=new this.IndexArrayType(i,8,e),this.coords=new n(i,8+s+c,e*2),this._pos=0,this._finished=!1,new Uint8Array(i,0,2).set([219,16+a]),new Uint16Array(i,2,1)[0]=t,new Uint32Array(i,4,1)[0]=e}}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return OY(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;DY[0]=0,DY[1]=i.length-1,DY[2]=0;let s=3,c=[];for(;s>0;){let l=DY[--s],u=DY[--s],d=DY[--s];if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(DY[s++]=d,DY[s++]=f-1,DY[s++]=1-l),(l===0?n>=p:r>=m)&&(DY[s++]=f+1,DY[s++]=u,DY[s++]=1-l)}return c}within(e,t,n){let r=[];return this.withinInto(e,t,n,r),r}withinInto(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;DY[0]=0,DY[1]=i.length-1,DY[2]=0;let s=3,c=0,l=n*n;for(;s>0;){let u=DY[--s],d=DY[--s],f=DY[--s];if(d-f<=o){for(let n=f;n<=d;n++)Eqe(a[2*n],a[2*n+1],e,t)<=l&&(r[c++]=i[n]);continue}let p=f+d>>1,m=a[2*p],h=a[2*p+1];Eqe(m,h,e,t)<=l&&(r[c++]=i[p]),(u===0?e-n<=m:t-n<=h)&&(DY[s++]=f,DY[s++]=p-1,DY[s++]=1-u),(u===0?e+n>
vendor: 2,075 bytes, line 409
409=m:t+n>=h)&&(DY[s++]=p+1,DY[s++]=d,DY[s++]=1-u)}return c}};function OY(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;Tqe(e,t,o,r,i,a),OY(e,t,n,r,o-1,1-a),OY(e,t,n,o+1,i,1-a)}function Tqe(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);Tqe(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(kY(e,t,r,n),t[2*i+a]>o&&kY(e,t,r,i);s<c;){for(kY(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?kY(e,t,r,c):(c++,kY(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function kY(e,t,n,r){AY(e,n,r),AY(t,2*n,2*r),AY(t,2*n+1,2*r+1)}function AY(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Eqe(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var jY=512/q/2,Dqe=class{constructor(e,t,n){this.tileID=e,this.bucketInstanceId=n,this._symbolsByKey={};let r=new Map;for(let e=0;e<t.length;e++){let n=t.get(e),i=n.key,a=r.get(i);a?a.push(n):r.set(i,[n])}for(let[e,t]of r){let n={positions:t.map(e=>({x:Math.floor(e.anchorX*jY),y:Math.floor(e.anchorY*jY)})),crossTileIDs:t.map(e=>e.crossTileID)};if(n.positions.length>128){let e=new wqe(n.positions.length,16,Uint16Array);for(let{x:t,y:r}of n.positions)e.add(t,r);e.finish(),delete n.positions,n.index=e}this._symbolsByKey[e]=n}}getScaledCoordinates(e,t){let{x:n,y:r,z:i}=this.tileID.canonical,{x:a,y:o,z:s}=t.canonical,c=jY/2**(s-i),l=(a*q+e.anchorX)*c,u=(o*q+e.anchorY)*c,d=n*q*jY,f=r*q*jY;return{x:Math.floor(l-d),y:Math.floor(u-f)}}findMatches(e,t,n){let r=this.tileID.canonical.z<t.canonical.z?1:2**(this.tileID.canonical.z-t.canonical.z);for(let i=0;i<e.length;i++){let a=e.get(i);if(a.crossTileID)continue;let o=this._symbolsByKey[a.key];if(!o)continue;let s=this.getScaledCoordinates(a,t);o.index?this.findMatchesForIndexedEntry(o,a,s,r,n):o.positions&&this.findMatchesForNonIndexedEntry(o,a,s,r,n)}}findMatchesForIndexedEntry(e,t,n,r,i){let a=e.index.range(n.x-r,n.y-r,n.x+r,n.y+r),o=1/0;for(let t of a)t<o&&!i[e.crossTileIDs[t]]&&(o=t);if(o!==1/0){let n=e.crossTileIDs[o];i[n]=!0,t.crossTileID=n}}
vendor: 4,677 bytes, lines 409-441
409findMatchesForNonIndexedEntry(e,t,n,r,i){for(let a=0;a<e.positions.length;a++){let o=e.positions[a],s=e.crossTileIDs[a];if(Math.abs(o.x-n.x)<=r&&Math.abs(o.y-n.y)<=r&&!i[s]){i[s]=!0,t.crossTileID=s;break}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}},Oqe=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},kqe=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(t!==0)for(let e in this.indexes){let n=this.indexes[e],r={};for(let e in n){let i=n[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),r[i.tileID.key]=i}this.indexes[e]=r}this.lng=e}addBucket(e,t,n){if(this.indexes[e.overscaledZ]?.[e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++){let n=t.symbolInstances.get(e);n.crossTileID=0}this.usedCrossTileIDs[e.overscaledZ]||={};let r=this.usedCrossTileIDs[e.overscaledZ];for(let n in this.indexes){let i=this.indexes[n];if(Number(n)>e.overscaledZ)for(let n in i){let a=i[n];a.tileID.isChildOf(e)&&a.findMatches(t.symbolInstances,e,r)}else{let a=i[e.scaledTo(Number(n)).key];a&&a.findMatches(t.symbolInstances,e,r)}}for(let e=0;e<t.symbolInstances.length;e++){let i=t.symbolInstances.get(e);i.crossTileID||(i.crossTileID=n.generate(),r[i.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Dqe(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let n of t.getCrossTileIDsLists())for(let t of n)delete this.usedCrossTileIDs[e][t]}removeStaleBuckets(e){let t=!1;for(let n in this.indexes){let r=this.indexes[n];for(let i in r)e[r[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,r[i]),delete r[i],t=!0)}return t}},Aqe=class{constructor(){this.layerIndexes={},this.crossTileIDs=new Oqe,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,n){let r=this.layerIndexes[e.id];r===void 0&&(r=this.layerIndexes[e.id]=new kqe);let i=!1,a={};r.handleWrapJump(n);for(let n of t){let t=n.getBucket(e);e.id===t?.layerIds[0]&&(t.bucketInstanceId||=(this.maxBucketInstanceId+=1,this.maxBucketInstanceId),r.addBucket(n.tileID,t,this.crossTileIDs)&&(i=!0),a[t.bucketInstanceId]=!0)}return r.removeStaleBuckets(a)&&(i=!0),i}pruneUnusedLayers(e){let t={};for(let n of e)t[n]=!0;for(let e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}},jqe=`#ifdef GL_ES
410precision mediump float;
411#else
412#if !defined(lowp)
413#define lowp
414#endif
415#if !defined(mediump)
416#define mediump
417#endif
418#if !defined(highp)
419#define highp
420#endif
421#endif
422out highp vec4 fragColor;`,Mqe=`#ifdef GL_ES
423precision highp float;
424#else
425#if !defined(lowp)
426#define lowp
427#endif
428#if !defined(mediump)
429#define mediump
430#endif
431#if !defined(highp)
432#define highp
433#endif
434#endif
435vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const uint packedOpacity) {return vec2(float(packedOpacity >> 1u)/127.0,float(packedOpacity & 1u));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
436);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+      c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+    c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+    c
437);}
438#ifdef TERRAIN3D
439uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
440#endif
441const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts
441);}highp float depthOpacity(vec3 frag) {
442#ifdef TERRAIN3D
443highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
444#else
445return 1.0;
446#endif
447}float calculate_visibility(vec4 pos) {
448#ifdef TERRAIN3D
449vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
450#else
451return 1.0;
452#endif
453}float ele(ivec2 pos) {
454#ifdef TERRAIN3D
455vec4 rgb=(texelFetch(u_terrain,pos,0)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
456#else
457return 0.0;
458#endif
459}float get_elevation(vec2 pos) {
460#ifdef TERRAIN3D
461#ifdef GLOBE
462if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
463#endif
464vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);ivec2 c=ivec2(floor(coord));ivec2 hi=textureSize(u_terrain,0)-1;float tl=ele(clamp(c,ivec2(0),hi));float tr=ele(clamp(c+ivec2(1,0),ivec2(0),hi));float bl=ele(clamp(c+ivec2(0,1),ivec2(0),hi));float br=ele(clamp(c+ivec2(1,1),ivec2(0),hi));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
465#else
466return 0.0;
467#endif
468}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`,Nqe=`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
469#ifdef OVERDRAW_INSPECTOR
470fragColor=vec4(1.0);
471#endif
472}`,Pqe=`layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}`,Fqe=`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;
473#ifdef OVERDRAW_INSPECTOR
474fragColor=vec4(1.0);
475#endif
476}`,Iqe=`uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}`,Lqe=`in vec3 v_data;flat in float v_visibility;
477#pragma maplibre: define highp vec4 color
478#pragma maplibre: define mediump float radius
479#pragma maplibre: define lowp float blur
480#pragma maplibre: define lowp float opacity
481#pragma maplibre: define highp vec4 stroke_color
482#pragma maplibre: define mediump float stroke_width
483#pragma maplibre: define lowp float stroke_opacity
484void main() {
485#pragma maplibre: initialize highp vec4 color
486#pragma maplibre: initialize mediump float radius
487#pragma maplibre: initialize lowp float blur
488#pragma maplibre: initialize lowp float opacity
489#pragma maplibre: initialize highp vec4 stroke_color
490#pragma maplibre: initialize mediump float stroke_width
491#pragma maplibre: initialize lowp float stroke_opacity
492vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}
493#ifdef OVERDRAW_INSPECTOR
494fragColor=vec4(1.0);
495#endif
496}`,Rqe=`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;layout(location=0) in ivec2 a_pos;out vec3 v_data;flat out float v_visibility;
497#pragma maplibre: define highp vec4 color
498#pragma maplibre: define mediump float radius
499#pragma maplibre: define lowp float blur
500#pragma maplibre: define lowp float opacity
501#pragma maplibre: define highp vec4 stroke_color
502#pragma maplibre: define mediump float stroke_width
503#pragma maplibre: define lowp float stroke_opacity
504void main(void) {
505#pragma maplibre: initialize highp vec4 color
506#pragma maplibre: initialize mediump float radius
507#pragma maplibre: initialize lowp float blur
508#pragma maplibre: initialize lowp float opacity
509#pragma maplibre: initialize highp vec4 stroke_color
510#pragma maplibre: initialize mediump float stroke_width
511#pragma maplibre: initialize lowp float stroke_opacity
512ivec2 pos_raw=a_pos+32768;vec2 extrude=vec2(pos_raw & 7)/7.0*2.0-1.0;vec2 circle_center=vec2(pos_raw >> 3)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {
513#ifdef GLOBE
514vec3 center_vector=projectToSphere(circle_center);
515#endif
516float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {
517#ifdef GLOBE
518vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
519#else
520vec4 projected_center=projectTileWithElevation(circle_center,ele);
521#endif
522corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}
523#ifdef GLOBE
524vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
525#else
526gl_Position=projectTileWithElevation(corner_position,ele);
527#endif
528} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,zqe=`void main() {fragColor=vec4(1.0);}`,MY={prelude:NY(jqe,Mqe),projectionMercator:NY(`
529void clipAntimeridian() {}`,`float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}`),projectionGlobe:NY(`uniform bool u_projection_clip_antimeridian;in highp float v_projection_tile_x;void clipAntimeridian() {if (u_projection_clip_antimeridian && (v_projection_tile_x < 0.0 || v_projection_tile_x >=8192.0)) {discard;}}`,`#define GLOBE_RADIUS 6371008.8
530uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;out highp float v_projection_tile_x;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos
531);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float t=exp(PI-(mercator_pos_y*PI*2.0));return (2.0*t)/(t*t+1.0);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY);if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;float spherical_x=mercator_pos.x*PI*2.0+PI;float t=exp(PI-(mercator_pos.y*PI*2.0));
531float t2=t*t;float denom=t2+1.0;float sin_sy=(t2-1.0)/denom;float cos_sy=(2.0*t)/denom;vec3 pos=vec3(sin(spherical_x)*cos_sy,sin_sy,cos(spherical_x)*cos_sy
532);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:NY(Nqe,Pqe),backgroundPattern:NY(Fqe,Iqe),circle:NY(Lqe,Rqe),clippingMask:NY(zqe,`layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}`),heatmap:NY(`uniform highp float u_intensity;in vec2 v_extrude;
533#pragma maplibre: define highp float weight
534#define GAUSS_COEF 0.3989422804014327
535void main() {
536#pragma maplibre: initialize highp float weight
537float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);
538#ifdef OVERDRAW_INSPECTOR
539fragColor=vec4(1.0);
540#endif
541}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;layout(location=0) in ivec2 a_pos;out vec2 v_extrude;
542#pragma maplibre: define highp float weight
543#pragma maplibre: define mediump float radius
544const highp float ZERO=1.0/255.0/16.0;
545#define GAUSS_COEF 0.3989422804014327
546void main(void) {
547#pragma maplibre: initialize highp float weight
548#pragma maplibre: initialize mediump float radius
549ivec2 pos_raw=a_pos+32768;vec2 unscaled_extrude=vec2(pos_raw & 7)/7.0*2.0-1.0;float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=vec2(pos_raw >> 3);
550#ifdef GLOBE
551vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);
552#else
553gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
554#endif
555}`),heatmapTexture:NY(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;
556#ifdef OVERDRAW_INSPECTOR
557fragColor=vec4(0.0);
558#endif
559}`,`uniform mat4 u_matrix;uniform vec2 u_world;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}`),collisionBox:NY(`flat in float v_placed;flat in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}`,`layout(location=0) in vec2 a_anchor_pos;layout(location=1) in vec2 a_placed;layout(location=2) in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;flat out float v_placed;flat out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:NY(`flat in float v_radius;in vec2 v_extrude;flat in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}`,`layout(location=0) in vec2 a_pos;layout(location=1) in float a_radius;layout(location=2) in vec2 a_flags;uniform vec2 u_viewport_size;flat out float v_radius;out vec2 v_extrude;flat out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}`),colorRelief:NY(`#ifdef GL_ES
560precision highp float;
561#endif
562uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {vec4 data=texelFetch(u_elevation_stops,ivec2(stop,0),0)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else
563{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));
564#ifdef OVERDRAW_INSPECTOR
565fragColor=vec4(1.0);
566#endif
567}`,`uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}`),debug:NY(`uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}`,`layout(location=0) in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}`),depth:NY(zqe,`layout(location=0) in vec2 a_pos;void main() {
568#ifdef GLOBE
569gl_Position=projectTileFor3D(a_pos,0.0);
570#else
571gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
572#endif
573}`),fill:NY(`#pragma maplibre: define highp vec4 color
574#pragma maplibre: define lowp float opacity
575void main() {
576#pragma maplibre: initialize highp vec4 color
577#pragma maplibre: initialize lowp float opacity
578fragColor=color*opacity;
579#ifdef OVERDRAW_INSPECTOR
580fragColor=vec4(1.0);
581#endif
582}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;
583#pragma maplibre: define highp vec4 color
584#pragma maplibre: define lowp float opacity
585void main() {
586#pragma maplibre: initialize highp vec4 color
587#pragma maplibre: initialize lowp float opacity
588if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:NY(`in vec2 v_pos;
589#ifdef GLOBE
590in float v_depth;
591#endif
592#pragma maplibre: define highp vec4 outline_color
593#pragma maplibre: define lowp float opacity
594void main() {
595#pragma maplibre: initialize highp vec4 outline_color
596#pragma maplibre: initialize lowp float opacity
597float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
598#ifdef GLOBE
599if (v_depth > 1.0) {discard;}
600#endif
601#ifdef OVERDRAW_INSPECTOR
602fragColor=vec4(1.0);
603#endif
604}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos;
605#ifdef GLOBE
606out float v_depth;
607#endif
608#pragma maplibre: define highp vec4 outline_color
609#pragma maplibre: define lowp float opacity
610void main() {
611#pragma maplibre: initialize highp vec4 outline_color
612#pragma maplibre: initialize lowp float opacity
613if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
614#ifdef GLOBE
615v_depth=gl_Position.z/gl_Position.w;
616#endif
617}`),fillOutlinePattern:NY(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;
618#ifdef GLOBE
619in float v_depth;
620#endif
621#pragma maplibre: define lowp float opacity
622#pragma maplibre: define lowp vec4 pattern_from
623#pragma maplibre: define lowp vec4 pattern_to
624void main() {
625#pragma maplibre: initialize lowp float opacity
626#pragma maplibre: initialize mediump vec4 pattern_from
627#pragma maplibre: initialize mediump vec4 pattern_to
628vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;
629#ifdef GLOBE
630if (v_depth > 1.0) {discard;}
631#endif
632#ifdef OVERDRAW_INSPECTOR
633fragColor=vec4(1.0);
634#endif
635}`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;
636#ifdef GLOBE
637out float v_depth;
638#endif
639#pragma maplibre: define lowp float opacity
640#pragma maplibre: define lowp vec4 pattern_from
641#pragma maplibre: define lowp vec4 pattern_to
642#pragma maplibre: define lowp float pixel_ratio_from
643#pragma maplibre: define lowp float pixel_ratio_to
644void main() {
645#pragma maplibre: initialize lowp float opacity
646#pragma maplibre: initialize mediump vec4 pattern_from
647#pragma maplibre: initialize mediump vec4 pattern_to
648#pragma maplibre: initialize lowp float pixel_ratio_from
649#pragma maplibre: initialize lowp float pixel_ratio_to
650if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
651#ifdef GLOBE
652v_depth=gl_Position.z/gl_Position.w;
653#endif
654}`),fillPattern:NY(`#ifdef GL_ES
655precision highp float;
656#endif
657uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
658#pragma maplibre: define lowp float opacity
659#pragma maplibre: define lowp vec4 pattern_from
660#pragma maplibre: define lowp vec4 pattern_to
661void main() {
662#pragma maplibre: initialize lowp float opacity
663#pragma maplibre: initialize mediump vec4 pattern_from
664#pragma maplibre: initialize mediump vec4 pattern_to
665vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;
666#ifdef OVERDRAW_INSPECTOR
667fragColor=vec4(1.0);
668#endif
669}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;
670#pragma maplibre: define lowp float opacity
671#pragma maplibre: define lowp vec4 pattern_from
672#pragma maplibre: define lowp vec4 pattern_to
673#pragma maplibre: define lowp float pixel_ratio_from
674#pragma maplibre: define lowp float pixel_ratio_to
675void main() {
676#pragma maplibre: initialize lowp float opacity
677#pragma maplibre: initialize mediump vec4 pattern_from
678#pragma maplibre: initialize mediump vec4 pattern_to
679#pragma maplibre: initialize lowp float pixel_ratio_from
680#pragma maplibre: initialize lowp float pixel_ratio_to
681if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:NY(`in vec4 v_color;void main() {fragColor=v_color;
682#ifdef OVERDRAW_INSPECTOR
683fragColor=vec4(1.0);
684#endif
685}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;layout(location=1) in ivec4 a_normal_ed;
686#ifdef TERRAIN3D
687layout(location=2) in vec2 a_centroid;
688#endif
689out vec4 v_color;
690#pragma maplibre: define highp float base
691#pragma maplibre: define highp float height
692#pragma maplibre: define highp vec4 color
693void main() {
694#pragma maplibre: initialize highp float base
695#pragma maplibre: initialize highp float height
696#pragma maplibre: initialize highp vec4 color
697vec3 normal=vec3(a_normal_ed.xyz);
698#ifdef TERRAIN3D
699float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
700#else
701float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
702#endif
703base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
704#ifdef GLOBE
705vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,el
705evation);
706#else
707gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
708#endif
709float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);
710#ifdef GLOBE
711mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
712#endif
713directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:NY(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;
714#pragma maplibre: define lowp float base
715#pragma maplibre: define lowp float height
716#pragma maplibre: define lowp vec4 pattern_from
717#pragma maplibre: define lowp vec4 pattern_to
718#pragma maplibre: define lowp float pixel_ratio_from
719#pragma maplibre: define lowp float pixel_ratio_to
720void main() {
721#pragma maplibre: initialize lowp float base
722#pragma maplibre: initialize lowp float height
723#pragma maplibre: initialize mediump vec4 pattern_from
724#pragma maplibre: initialize mediump vec4 pattern_to
725#pragma maplibre: initialize lowp float pixel_ratio_from
726#pragma maplibre: initialize lowp float pixel_ratio_to
727vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;
728#ifdef OVERDRAW_INSPECTOR
729fragColor=vec4(1.0);
730#endif
731}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;layout(location=0) in vec2 a_pos;layout(location=1) in ivec4 a_normal_ed;
732#ifdef TERRAIN3D
733layout(location=2) in vec2 a_centroid;
734#endif
735#ifdef GLOBE
736out vec3 v_sphere_pos;
737#endif
738out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
739#pragma maplibre: define lowp float base
740#pragma maplibre: define lowp float height
741#pragma maplibre: define lowp vec4 pattern_from
742#pragma maplibre: define lowp vec4 pattern_to
743#pragma maplibre: define lowp float pixel_ratio_from
744#pragma maplibre: define lowp float pixel_ratio_to
745void main() {
746#pragma maplibre: initialize lowp float base
747#pragma maplibre: initialize lowp float height
748#pragma maplibre: initialize mediump vec4 pattern_from
749#pragma maplibre: initialize mediump vec4 pattern_to
750#pragma maplibre: initialize lowp float pixel_ratio_from
751#pragma maplibre: initialize lowp float pixel_ratio_to
752vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=vec3(a_normal_ed.xyz);float edgedistance=float(a_normal_ed.w);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
753#ifdef TERRAIN3D
754float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
755#else
756float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
757#endif
758base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
759#ifdef GLOBE
760vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
761#else
762gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
763#endif
764vec2 pos=a_normal_ed.x==1 && a_normal_ed.y==0 && a_normal_ed.z==16384
765? a_pos
766: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:NY(`#ifdef GL_ES
767precision highp float;
768#endif
769uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(ivec2 texel) {vec4 data=texelFetch(u_image,texel,0)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {ivec2 pos=ivec2(gl_FragCoord.xy)+ivec2(1);float tileSize=u_dimension.x-2.0;float a=getElevation(pos+ivec2(-1,-1));float b=getElevation(pos+ivec2(0,-1));float c=getElevation(pos+ivec2(1,-1));float d=getElevation(pos+ivec2(-1,0));float e=getElevation(pos);float f=getElevation(pos+ivec2(1,0));float g=getElevation(pos+ivec2(-1,1));float h=getElevation(pos+ivec2(0,1));float i=getElevation(pos+ivec2(1,1));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/p
769ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);
770#ifdef OVERDRAW_INSPECTOR
771fragColor=vec4(1.0);
772#endif
773}`,`uniform mat4 u_matrix;uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;layout(location=1) in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}`),hillshade:NY(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];
774#define PI 3.141592653589793
775#define STANDARD 0
776#define COMBINED 1
777#define IGOR 2
778#define MULTIDIRECTIONAL 3
779#define BASIC 4
780float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else
781{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else
782{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}
783#ifdef OVERDRAW_INSPECTOR
784fragColor=vec4(1.0);
785#endif
786}`,`uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}`),line:NY(`uniform lowp float u_device_pixel_ratio;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
787#ifdef GLOBE
788in float v_depth;
789#endif
790#pragma maplibre: define highp vec4 color
791#pragma maplibre: define lowp float blur
792#pragma maplibre: define lowp float opacity
793void main() {
794#pragma maplibre: initialize highp vec4 color
795#pragma maplibre: initialize lowp float blur
796#pragma maplibre: initialize lowp float opacity
797clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);
798#ifdef GLOBE
799if (v_depth > 1.0) {discard;}
800#endif
801#ifdef OVERDRAW_INSPECTOR
802fragColor=vec4(1.0);
803#endif
804}`,`
805#define scale 0.015873016
806layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;
807#ifdef GLOBE
808out float v_depth;
809#endif
810#pragma maplibre: define highp vec4 color
811#pragma maplibre: define lowp float blur
812#pragma maplibre: define lowp float opacity
813#pragma maplibre: define mediump float gapwidth
814#pragma maplibre: define lowp float offset
815#pragma maplibre: define mediump float width
816void main() {
817#pragma maplibre: initialize highp vec4 color
818#pragma maplibre: initialize lowp float blur
819#pragma maplibre: initialize lowp float opacity
820#pragma maplibre: initialize mediump float gapwidth
821#pragma maplibre: initialize lowp float offset
822#pragma maplibre: initialize mediump float width
823if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);v_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*2.0;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
823float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
824#ifdef GLOBE
825v_depth=gl_Position.z/gl_Position.w;
826#endif
827#ifdef TERRAIN3D
828v_gamma_scale=1.0;
829#else
830float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
831#endif
832v_width2=vec2(outset,inset);}`),lineGradient:NY(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;
833#ifdef GLOBE
834in float v_depth;
835#endif
836#pragma maplibre: define lowp float blur
837#pragma maplibre: define lowp float opacity
838void main() {
839#pragma maplibre: initialize lowp float blur
840#pragma maplibre: initialize lowp float opacity
841clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);
842#ifdef GLOBE
843if (v_depth > 1.0) {discard;}
844#endif
845#ifdef OVERDRAW_INSPECTOR
846fragColor=vec4(1.0);
847#endif
848}`,`
849#define scale 0.015873016
850layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;
851#ifdef GLOBE
852out float v_depth;
853#endif
854#pragma maplibre: define lowp float blur
855#pragma maplibre: define lowp float opacity
856#pragma maplibre: define mediump float gapwidth
857#pragma maplibre: define lowp float offset
858#pragma maplibre: define mediump float width
859void main() {
860#pragma maplibre: initialize lowp float blur
861#pragma maplibre: initialize lowp float opacity
862#pragma maplibre: initialize mediump float gapwidth
863#pragma maplibre: initialize lowp float offset
864#pragma maplibre: initialize mediump float width
865if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
866#ifdef GLOBE
867v_depth=gl_Position.z/gl_Position.w;
868#endif
869#ifdef TERRAIN3D
870v_gamma_scale=1.0;
871#else
872float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
873#endif
874v_width2=vec2(outset,inset);}`),linePattern:NY(`#ifdef GL_ES
875precision highp float;
876#endif
877uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;flat in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;flat in float v_width;
878#ifdef GLOBE
879in float v_depth;
880#endif
881#pragma maplibre: define lowp vec4 pattern_from
882#pragma maplibre: define lowp vec4 pattern_to
883#pragma maplibre: define lowp float pixel_ratio_from
884#pragma maplibre: define lowp float pixel_ratio_to
885#pragma maplibre: define lowp float blur
886#pragma maplibre: define lowp float opacity
887void main() {
888#pragma maplibre: initialize mediump vec4 pattern_from
889#pragma maplibre: initialize mediump vec4 pattern_to
890#pragma maplibre: initialize lowp float pixel_ratio_from
891#pragma maplibre: initialize lowp float pixel_ratio_to
892#pragma maplibre: initialize lowp float blur
893#pragma maplibre: initialize lowp float opacity
894clipAntimeridian();vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;
895#ifdef GLOBE
896if (v_depth > 1.0) {discard;}
897#endif
898#ifdef OVERDRAW_INSPECTOR
899fragColor=vec4(1.0);
900#endif
901}`,`
902#define scale 0.015873016
903#define LINE_DISTANCE_SCALE 2.0
904layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;flat out float v_width;
905#ifdef GLOBE
906out float v_depth;
907#endif
908#pragma maplibre: define lowp float blur
909#pragma maplibre: define lowp float opacity
910#pragma maplibre: define lowp float offset
911#pragma maplibre: define mediump float gapwidth
912#pragma maplibre: define mediump float width
913#pragma maplibre: define lowp float floorwidth
914#pragma maplibre: define lowp vec4 pattern_from
915#pragma maplibre: define lowp vec4 pattern_to
916#pragma maplibre: define lowp float pixel_ratio_from
917#pragma maplibre: define lowp float pixel_ratio_to
918void main() {
919#pragma maplibre: initialize lowp float blur
920#pragma maplibre: initialize lowp float opacity
921#pragma maplibre: initialize lowp float offset
922#pragma maplibre: initialize mediump float gapwidth
923#pragma maplibre: initialize mediump float width
924#pragma maplibre: initialize lowp float floorwidth
925#pragma maplibre: initialize mediump vec4 pattern_from
926#pragma maplibre: initialize mediump vec4 pattern_to
927#pragma maplibre: initialize lowp float pixel_ratio_from
928#pragma maplibre: initialize lowp float pixel_ratio_to
929if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
929float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
930#ifdef GLOBE
931v_depth=gl_Position.z/gl_Position.w;
932#endif
933#ifdef TERRAIN3D
934v_gamma_scale=1.0;
935#else
936float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
937#endif
938v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:NY(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;
939#ifdef GLOBE
940in float v_depth;
941#endif
942#pragma maplibre: define highp vec4 color
943#pragma maplibre: define lowp float blur
944#pragma maplibre: define lowp float opacity
945#pragma maplibre: define mediump float width
946#pragma maplibre: define lowp float floorwidth
947#pragma maplibre: define mediump vec4 dasharray_from
948#pragma maplibre: define mediump vec4 dasharray_to
949void main() {
950#pragma maplibre: initialize highp vec4 color
951#pragma maplibre: initialize lowp float blur
952#pragma maplibre: initialize lowp float opacity
953#pragma maplibre: initialize mediump float width
954#pragma maplibre: initialize lowp float floorwidth
955#pragma maplibre: initialize mediump vec4 dasharray_from
956#pragma maplibre: initialize mediump vec4 dasharray_to
957clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
957float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);
958#ifdef GLOBE
959if (v_depth > 1.0) {discard;}
960#endif
961#ifdef OVERDRAW_INSPECTOR
962fragColor=vec4(1.0);
963#endif
964}`,`
965#define scale 0.015873016
966#define LINE_DISTANCE_SCALE 2.0
967layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;
968#ifdef GLOBE
969out float v_depth;
970#endif
971#pragma maplibre: define highp vec4 color
972#pragma maplibre: define lowp float blur
973#pragma maplibre: define lowp float opacity
974#pragma maplibre: define mediump float gapwidth
975#pragma maplibre: define lowp float offset
976#pragma maplibre: define mediump float width
977#pragma maplibre: define lowp float floorwidth
978#pragma maplibre: define mediump vec4 dasharray_from
979#pragma maplibre: define mediump vec4 dasharray_to
980void main() {
981#pragma maplibre: initialize highp vec4 color
982#pragma maplibre: initialize lowp float blur
983#pragma maplibre: initialize lowp float opacity
984#pragma maplibre: initialize mediump float gapwidth
985#pragma maplibre: initialize lowp float offset
986#pragma maplibre: initialize mediump float width
987#pragma maplibre: initialize lowp float floorwidth
988#pragma maplibre: initialize mediump vec4 dasharray_from
989#pragma maplibre: initialize mediump vec4 dasharray_to
990if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
991#ifdef GLOBE
992v_depth=gl_Position.z/gl_Position.w;
993#endif
994#ifdef TERRAIN3D
995v_gamma_scale=1.0;
996#else
997float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
998#endif
999float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:NY(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;
1000#ifdef GLOBE
1001in float v_depth;
1002#endif
1003#pragma maplibre: define lowp float blur
1004#pragma maplibre: define lowp float opacity
1005#pragma maplibre: define mediump float width
1006#pragma maplibre: define lowp float floorwidth
1007#pragma maplibre: define mediump vec4 dasharray_from
1008#pragma maplibre: define mediump vec4 dasharray_to
1009void main() {
1010#pragma maplibre: initialize lowp float blur
1011#pragma maplibre: initialize lowp float opacity
1012#pragma maplibre: initialize mediump float width
1013#pragma maplibre: initialize lowp float floorwidth
1014#pragma maplibre: initialize mediump vec4 dasharray_from
1015#pragma maplibre: initialize mediump vec4 dasharray_to
1016clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
1016float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);
1017#ifdef GLOBE
1018if (v_depth > 1.0) {discard;}
1019#endif
1020#ifdef OVERDRAW_INSPECTOR
1021fragColor=vec4(1.0);
1022#endif
1023}`,`
1024#define scale 0.015873016
1025#define LINE_DISTANCE_SCALE 2.0
1026layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;
1027#ifdef GLOBE
1028out float v_depth;
1029#endif
1030#pragma maplibre: define lowp float blur
1031#pragma maplibre: define lowp float opacity
1032#pragma maplibre: define mediump float gapwidth
1033#pragma maplibre: define lowp float offset
1034#pragma maplibre: define mediump float width
1035#pragma maplibre: define lowp float floorwidth
1036#pragma maplibre: define mediump vec4 dasharray_from
1037#pragma maplibre: define mediump vec4 dasharray_to
1038void main() {
1039#pragma maplibre: initialize lowp float blur
1040#pragma maplibre: initialize lowp float opacity
1041#pragma maplibre: initialize mediump float gapwidth
1042#pragma maplibre: initialize lowp float offset
1043#pragma maplibre: initialize mediump float width
1044#pragma maplibre: initialize lowp float floorwidth
1045#pragma maplibre: initialize mediump vec4 dasharray_from
1046#pragma maplibre: initialize mediump vec4 dasharray_to
1047if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
1048#ifdef GLOBE
1049v_depth=gl_Position.z/gl_Position.w;
1050#endif
1051#ifdef TERRAIN3D
1052v_gamma_scale=1.0;
1053#else
1054float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
1055#endif
1056float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),layerOpacity:NY(`uniform sampler2D u_image;uniform float u_opacity;in vec2 v_pos;void main() {fragColor=texture(u_image,v_pos)*u_opacity;
1057#ifdef OVERDRAW_INSPECTOR
1058fragColor=vec4(0.0);
1059#endif
1060}`,`layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos.x*2.0-1.0,1.0-a_pos.y*2.0,0.0,1.0);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}`),raster:NY(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec3 v_pos0;in vec3 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0.xy/v_pos0.z);vec4 color1=texture(u_image1,v_pos1.xy/v_pos1.z);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
1061#ifdef OVERDRAW_INSPECTOR
1062fragColor=vec4(1.0);
1063#endif
1064}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec3 u_image_warp;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;layout(location=0) in vec2 a_pos;out vec3 v_pos0;out vec3 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 topLeft=u_coords_top.xy;vec2 topRight=u_coords_top.zw;vec2 bottomLeft=u_coords_bottom.xy;vec2 bottomRight=u_coords_bottom.zw;
1064vec2 bilinearPos=mix(mix(topLeft,topRight,fractionalPos.x),mix(bottomLeft,bottomRight,fractionalPos.x),fractionalPos.y);float denominator=dot(u_image_warp.xy,fractionalPos)+1.0;vec2 acrossTop=topRight-topLeft+u_image_warp.x*topRight;vec2 downLeft=bottomLeft-topLeft+u_image_warp.y*bottomLeft;vec2 projectivePos=(acrossTop*fractionalPos.x+downLeft*fractionalPos.y+topLeft)/denominator;vec2 position=mix(projectivePos,bilinearPos,u_image_warp.z);gl_Position=projectTile(position,position);vec2 texturePos=((fractionalPos-0.5)/u_buffer_scale)+0.5;
1065#ifdef GLOBE
1066if (a_pos.y <-32767.5) {texturePos.y=0.0;}if (a_pos.y > 32766.5) {texturePos.y=1.0;}
1067#endif
1068float perspectiveRatio=mix(1.0/denominator,1.0,u_image_warp.z);v_pos0=vec3(texturePos*perspectiveRatio,perspectiveRatio);vec2 parentPos=(texturePos*u_scale_parent)+u_tl_parent;v_pos1=vec3(parentPos*perspectiveRatio,perspectiveRatio);}`),symbolIcon:NY(`uniform sampler2D u_texture;in vec2 v_tex;flat in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity;
1069#ifdef OVERDRAW_INSPECTOR
1070fragColor=vec4(1.0);
1071#endif
1072}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in uint a_fade_opacity;layout(location=5) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec2 v_tex;flat out float v_total_opacity;
1073#pragma maplibre: define lowp float opacity
1074void main() {
1075#pragma maplibre: initialize lowp float opacity
1076vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
1077camera_to_anchor_distance/u_camera_to_center_distance :
1078u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
1079#ifdef GLOBE
1080if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
1081#endif
1082vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:NY(`#define SDF_PX 8.0
1083uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;
1084#pragma maplibre: define highp vec4 fill_color
1085#pragma maplibre: define highp vec4 halo_color
1086#pragma maplibre: define lowp float halo_width
1087#pragma maplibre: define lowp float halo_blur
1088void main() {
1089#pragma maplibre: initialize highp vec4 fill_color
1090#pragma maplibre: initialize highp vec4 halo_color
1091#pragma maplibre: initialize lowp float halo_width
1092#pragma maplibre: initialize lowp float halo_blur
1093float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;}
1094#ifdef OVERDRAW_INSPECTOR
1095fragColor=vec4(1.0);
1096#endif
1097}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in uint a_fade_opacity;layout(location=5) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec2 v_data0;out vec3 v_data1;
1098#pragma maplibre: define highp vec4 fill_color
1099#pragma maplibre: define highp vec4 halo_color
1100#pragma maplibre: define lowp float opacity
1101#pragma maplibre: define lowp float halo_width
1102#pragma maplibre: define lowp float halo_blur
1103void main() {
1104#pragma maplibre: initialize highp vec4 fill_color
1105#pragma maplibre: initialize highp vec4 halo_color
1106#pragma maplibre: initialize lowp float opacity
1107#pragma maplibre: initialize lowp float halo_width
1108#pragma maplibre: initialize lowp float halo_blur
1109vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
1110camera_to_anchor_distance/u_camera_to_center_distance :
1111u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
1112#ifdef GLOBE
1113if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
1114#endif
1115vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:NY(`#define SDF_PX 8.0
1116#define SDF 1.0
1117#define ICON 0.0
1118uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec3 v_data1;flat in float v_is_sdf;
1119#pragma maplibre: define highp vec4 fill_color
1120#pragma maplibre: define highp vec4 halo_color
1121#pragma maplibre: define lowp float halo_width
1122#pragma maplibre: define lowp float halo_blur
1123void main() {
1124#pragma maplibre: initialize highp vec4 fill_color
1125#pragma maplibre: initialize highp vec4 halo_color
1126#pragma maplibre: initialize lowp float halo_width
1127#pragma maplibre: initialize lowp float halo_blur
1128float total_opacity=v_data1[2];if (v_is_sdf==ICON) {vec2 tex_icon=v_data0.zw;
1128fragColor=texture(u_texture_icon,tex_icon)*total_opacity;
1129#ifdef OVERDRAW_INSPECTOR
1130fragColor=vec4(1.0);
1131#endif
1132return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;}
1133#ifdef OVERDRAW_INSPECTOR
1134fragColor=vec4(1.0);
1135#endif
1136}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec3 a_projected_pos;layout(location=3) in uint a_fade_opacity;layout(location=4) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec4 v_data0;out vec3 v_data1;flat out float v_is_sdf;
1137#pragma maplibre: define highp vec4 fill_color
1138#pragma maplibre: define highp vec4 halo_color
1139#pragma maplibre: define lowp float opacity
1140#pragma maplibre: define lowp float halo_width
1141#pragma maplibre: define lowp float halo_blur
1142void main() {
1143#pragma maplibre: initialize highp vec4 fill_color
1144#pragma maplibre: initialize highp vec4 halo_color
1145#pragma maplibre: initialize lowp float opacity
1146#pragma maplibre: initialize lowp float halo_width
1147#pragma maplibre: initialize lowp float halo_blur
1148vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);float is_sdf=float(a_data.z & 1u);float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
1149camera_to_anchor_distance/u_camera_to_center_distance :
1150u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
1151#ifdef GLOBE
1152if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
1153#endif
1154vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec3(gamma_scale,size,total_opacity);v_is_sdf=is_sdf;}`),terrain:NY(`uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
1154float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}`,`layout(location=0) in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}`),terrainDepth:NY(`in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}`,`layout(location=0) in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}`),atmosphere:NY(`#ifdef GL_ES
1155precision highp float;
1156#endif
1157in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758
1158);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,`layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}`),sky:NY(`uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}`,`layout(location=0) in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}`)};function NY(e,t){let n=/#pragma maplibre: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/in ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s=r?r.length:0,c={};return e=e.replace(n,(e,t,n,r,i)=>(c[i]=!0,t===`define`?`
1159#ifndef HAS_UNIFORM_u_${i}
1160in ${n} ${r} ${i};
1161#else
1162uniform ${n} ${r} u_${i};
1163#endif
1164`:`
1165#ifdef HAS_UNIFORM_u_${i}
1166    ${n} ${r} ${i} = u_${i};
1167#endif
1168`)),t=t.replace(n,(e,t,n,r,i)=>{let a=r===`float`?`vec2`:`vec4`,o=i.match(/color/)?`color`:a;return c[i]?t===`define`?`
1169#ifndef HAS_UNIFORM_u_${i}
1170uniform lowp float u_${i}_t;
1171layout(location = ${s++}) in ${n} ${a} a_${i};
1172out ${n} ${r} ${i};
1173#else
1174uniform ${n} ${r} u_${i};
1175#endif
1176`:o===`vec4`?`
1177#ifndef HAS_UNIFORM_u_${i}
1178    ${i} = a_${i};
1179#else
1180    ${n} ${r} ${i} = u_${i};
1181#endif
1182`:`
1183#ifndef HAS_UNIFORM_u_${i}
1184    ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);
1185#else
1186    ${n} ${r} ${i} = u_${i};
1187#endif
1188`:t===`define`?`
1189#ifndef HAS_UNIFORM_u_${i}
1190uniform lowp float u_${i}_t;
1191layout(location = ${s++}) in ${n} ${a} a_${i};
1192#else
1193uniform ${n} ${r} u_${i};
1194#endif
1195`:o===`vec4`?`
1196#ifndef HAS_UNIFORM_u_${i}
1197    ${n} ${r} ${i} = a_${i};
1198#else
1199    ${n} ${r} ${i} = u_${i};
1200#endif
1201`:`
1202#ifndef HAS_UNIFORM_u_${i}
1203    ${n} ${r} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);
1204#else
1205    ${n} ${r} ${i} = u_${i};
1206#endif
1207`}),{fragmentSource:e,vertexSource:t,staticAttributes:r,staticUniforms:o}}var Bqe=`#define PROJECTION_MERCATOR`,Vqe=`mercator`,PY=class{constructor(){this._cachedMesh=null}get name(){return`mercator`}get useSubdivision(){return!1}get shaderVariantName(){return Vqe}get shaderDefine(){return Bqe}get shaderPreludeCode(){return MY.projectionMercator}get vertexShaderPreludeCode(){return MY.projectionMercator.vertexSource}get subdivisionGranularity(){return zK.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}destroy(){}getMeshFromTileID(e,t,n,r,i){if(this._cachedMesh)return this._cachedMesh;let a=new rG;a.emplaceBack(0,0),a.emplaceBack(q,0),a.emplaceBack(0,q),a.emplaceBack(q,q);let o=e.createVertexBuffer(a,rY.members),s=uG.simpleSegment(0,0,4,2),c=new sG;
vendor: 16,158 bytes, line 1207
1207c.emplaceBack(1,0,2),c.emplaceBack(1,2,3);let l=e.createIndexBuffer(c);return this._cachedMesh=new nY(o,l,s),this._cachedMesh}recalculate(){}hasTransition(){return!1}},Hqe=class e{constructor(e=0,t=0,n=0,r=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw Error(`Invalid value for edge-insets, top, bottom, left and right must all be numbers`);this.top=e,this.bottom=t,this.left=n,this.right=r}interpolate(e,t,n){return t.top!=null&&e.top!=null&&(this.top=_V.number(e.top,t.top,n)),t.bottom!=null&&e.bottom!=null&&(this.bottom=_V.number(e.bottom,t.bottom,n)),t.left!=null&&e.left!=null&&(this.left=_V.number(e.left,t.left,n)),t.right!=null&&e.right!=null&&(this.right=_V.number(e.right,t.right,n)),this}getCenter(e,t){return new K(iz((this.left+e-this.right)/2,0,e),iz((this.top+t-this.bottom)/2,0,t))}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new e(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}};function FY(e,t){if(!e.renderWorldCopies||e.lngRange)return;let n=t.lng-e.center.lng;t.lng+=n>180?-360:n<-180?360:0}function Uqe(e){return Math.max(0,Math.floor(e))}var IY=class{constructor(e,t){this.applyConstrain=(e,t)=>this._constrainOverride===null?this._callbacks.defaultConstrain(e,t):this._constrainOverride(e,t),this._callbacks=e,this._tileSize=512,this._renderWorldCopies=t?.renderWorldCopies===void 0||!!t?.renderWorldCopies,this._minZoom=t?.minZoom||0,this._maxZoom=t?.maxZoom||22,this._minPitch=t?.minPitch===void 0||t?.minPitch===null?0:t?.minPitch,this._maxPitch=t?.maxPitch===void 0||t?.maxPitch===null?60:t?.maxPitch,this._constrainOverride=t?.constrainOverride??null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new qK(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Uqe(this._zoom),this._scale=lz(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Hqe,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,t,n){this._constrainOverride=e.constrainOverride,this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=Uqe(this._zoom),this._scale=lz(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new Hqe(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!n&&e.autoCalculateNearFarZ,t&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){if(this._minZoom===e)return;this._minZoom=e;let t=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=t}get maxZoom(){return this._maxZoom}setMaxZoom(e){if(this._maxZoom===e)return;this._maxZoom=e;let t=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=t}get minPitch(){return this._minPitch}setMinPitch(e){if(this._minPitch===e)return;this._minPitch=e;let t=this._unmodified;this.setPitch(Math.max(this.pitch,e)),this._unmodified=t}get maxPitch(){return this._maxPitch}setMaxPitch(e){if(this._maxPitch===e)return;this._maxPitch=e;let t=this._unmodified;this.setPitch(Math.min(this.pitch,e)),this._unmodified=t}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get constrainOverride(){return this._constrainOverride}setConstrainOverride(e){e===void 0&&(e=null),this._constrainOverride!==e&&(this._constrainOverride=e,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new K(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){let t=az(e,-180,180)*Math.PI/180;this._bearingInRadians!==t&&(this._unmodified=!1,this._bearingInRadians=t,this._calcMatrices(),this._rotationMatrix=UWe(),KWe(this._rotationMatrix,this._rotationMatrix,-this._bearingInRadians))}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){let t=iz(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==t&&(this._unmodified=!1,this._pitchInRadians=t,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){let t=e/180*Math.PI;this._rollInRadians!==t&&(this._unmodified=!1,this._rollInRadians=t,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return Tz(this._fovInRadians)}setFov(e){e=iz(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=wz(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){let t=this.applyConstrain(this._center,e).zoom;this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this._tileZoom=Math.max(0,Math.floor(t)),this._scale=lz(t),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(e){(e.lat!==this._center.lat||e.lng!==this._center.lng)&&(this._unmodified=!1,this._center=e,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,t){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=t,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this.constrainInternal(),this._calcMatrices()}resize(e,t,n=!0){this._width=e,this._height=t,n&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange?.length!==2||this._lngRange?.length!==2?null:new QJ([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-kz,kz])}getCameraQueryGeometry(e,t){if(t.length===1)return[t[0],e];{let{minX:n,minY:r,maxX:i,maxY:a}=UK.fromPoints(t).extend(e);return[new K(n,r),new K(i,r),new K(i,a),new K(n,a),new K(n,r)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:n}=this.applyConstrain(this.center,this.zoom);this.setCenter(t),this.setZoom(n),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=rR(new Float64Array(16));sR(e,e,[this._width/2,-this._height/2,1]),oR(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=rR(new Float64Array(16)),sR(e,e,[1,-1,1]),oR(e,e,[-1,-1,0]),sR(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e;let t=this.fovInRadians/2;this._cameraToCenterDistance=.5/Math.tan(t)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,t,n,r){let i=n===void 0?this.bearing:n,a=r=r===void 0?this.pitch:r,{distanceToCenter:o,clampedElevation:s}=this._distanceToCenterFromAltElevationPitch(t,this.elevation,a),{x:c,y:l}=aq(a,i),u=$K.fromLngLat(e,t),d=yze(1,u.y),f,p,m=0;do{if(m+=1,m>10)break;p=o/d;let e=c*p,t=l*p;f=new $K(u.x+e,u.y+t),d=1/f.meterInMercatorCoordinateUnits()}while(Math.abs(o-p*d)>1e-12);return{center:f.toLngLat(),elevation:s,zoom:uz(this.height/2/Math.tan(this.fovInRadians/2)/p/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e===0)return;let t=1/this.worldSize,n=XK(1,this.center.lat)*this.worldSize,r=$K.fromLngLat(this.center,this.elevation),i=r.x/t,a=r.y/t,o=r.z/t,s=this.pitch,c=this.bearing,{x:l,y:u,z:d}=aq(s,c),f=this.cameraToCenterDistance,p=i+f*-l,m=a+f*-u,h=o+f*d,{distanceToCenter:g,clampedElevation:_}=this._distanceToCenterFromAltElevationPitch(h/n,e,s),v=g*n,y=p+l*v,b=m+u*v,x=new $K(y*t,b*t,0).toLngLat(),S=XK(1,x.lat),C=uz(this.height/2/Math.tan(this.fovInRadians/2)/g/S/this.tileSize);this._elevation=_,this._center=x,this.setZoom(C)}_distanceToCenterFromAltElevationPitch(e,t,n){let r=-Math.cos(wz(n)),i=e-t,a,o=t;return r*i>=0||Math.abs(r)<.1?(a=1e4,o=e+a*r):a=-i/r,{distanceToCenter:a,clampedElevation:o}}getCameraPoint(){let e=this.pitchInRadians,t=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new K(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){return wze(this).toLngLat()}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];let t=e.canonical.z>=0?1<<e.canonical.z:2**e.canonical.z;return[e.canonical.x/t,e.canonical.y/t,1/t/q,1/t/q]}},Wqe=class e{constructor(e,t){this.min=e,this.max=t,this.center=vR([],_R([],this.min,this.max),.5)}quadrant(t){let n=[t%2==0,t<2],r=mR(this.min),i=mR(this.max);for(let e=0;e<n.length;e++)r[e]=n[e]?this.min[e]:this.center[e],i[e]=n[e]?this.center[e]:this.max[e];return i[2]=this.max[2],new e(r,i)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let t=!0;for(let n of e.planes){let e=this.intersectsPlane(n);if(e===0)return 0;e===1&&(t=!1)}return t?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let t=e[3],n=e[3];for(let r=0;r<3;r++)e[r]>0?(t+=e[r]*this.min[r],n+=e[r]*this.max[r]):(n+=e[r]*this.min[r],t+=e[r]*this.max[r]);return t>=0?2:n<0?0:1}},Gqe=class{distanceToTile2d(e,t,n,r){let i=r,a=i.distanceX([e,t]),o=i.distanceY([e,t]);return Math.hypot(a,o)}getWrap(e,t,n){return n}getTileBoundingVolume(e,t,n,r){let i=Math.min(0,n),a=Math.max(0,n);if(r?.terrain){let n=new Dq(e.z,t,e.z,e.x,e.y),o=r.terrain.getMinMaxElevation(n);i=o.minElevation??i,a=o.maxElevation??a}let o=1<<e.z;return new Wqe([t+e.x/o,e.y/o,i],[t+(e.x+1)/o,(e.y+1)/o,a])}allowVariableZoom(e,t){let n=iz(78.5-e.fov*(Math.abs(Math.cos(e.rollInRadians))*e.height+Math.abs(Math.sin(e.rollInRadians))*e.width)/e.height/2,0,60);return!!t.terrain||e.pitch>n}allowWorldCopies(){return!0}prepareNextFrame(){}},Kqe=class e{constructor(e,t,n){this.points=e,this.planes=t,this.aabb=n}static fromInvProjectionMatrix(t,n=1,r=0,i,a){let o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],s=a?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],c=2**r,l=o.map(e=>qqe(e,t,n,c));i&&Jqe(l,s[0],i,a);let u=s.map(e=>{let t=bR([],SR([],DR([],l[e[0]],l[e[1]]),DR([],l[e[2]],l[e[1]]))),n=-xR(t,l[e[1]]);return t.concat(n)}),d=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0];for(let e of l)for(let t=0;t<3;t++)d[t]=Math.min(d[t],e[t]),f[t]=Math.max(f[t],e[t]);return new e(l,u,new Wqe(d,f))}};function qqe(e,t,n,r){let i=kR([],e,t),a=1/i[3]/n*r;return dPe(i,i,[a,a,1/i[3],a])}function Jqe(e,t,n,r){let i=r?4:0,a=r?0:4,o=0,s=[],c=[];for(let t=0;t<4;t++){let n=DR([],e[t+a],e[t+i]),r=hR(n);vR(n,n,1/r),s.push(r),c.push(n)}for(let t=0;t<4;t++){let r=vPe(e[t+i],c[t],n);o=r!==null&&r>=0?Math.max(o,r):Math.max(o,s[t])}let l=Yqe(e,t),u=Xqe(n,l);if(u!==null){let e=u/xR(c[0],l);o=Math.min(o,e)}for(let t=0;t<4;t++){let n=Math.min(o,s[t]);e[t+a]=[e[t+i][0]+c[t][0]*n,e[t+i][1]+c[t][1]*n,e[t+i][2]+c[t][2]*n,1]}}function Yqe(e,t){let n=DR([],e[t[0]],e[t[1]]),r=DR([],e[t[2]],e[t[1]]),i=[0,0,0,0];return bR(i,SR([],n,r)),i[3]=-xR(i,e[t[0]]),i}function Xqe(e,t){let n=lPe([],e,1/OR(e)),r=DR([],t,vR([],n,xR(t,n))),i=OR(r);if(i>0){let e=Math.sqrt(1-n[3]*n[3]);return JR(t,_R([],vR([],n,-n[3]),vR([],r,e/i)))}return null}var Zqe=yW([{name:`a_pos3d`,type:`Int16`,components:3}]),Qqe=class extends Jz{constructor(e){super(),this._lastTilesetChange=LJ(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,t){this.tileManager.update(e,t),this._renderableTilesKeys=[];let n={};for(let r of uY(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:t,calculateTileZoom:this.tileManager._source.calculateTileZoom}))n[r.key]=!0,this._renderableTilesKeys.push(r.key),this._tiles[r.key]||(r.terrainRttPosMatrix32f=new Float32Array(16),fR(r.terrainRttPosMatrix32f,0,8192,8192,0,0,1),this._tiles[r.key]=new EKe(r,this.tileSize),this._lastTilesetChange=LJ());for(let e in this._tiles)n[e]||(this._tiles[e].releaseRTT(this.tileManager.map.painter),delete this._tiles[e])}releaseRTT(e){for(let t in this._tiles){let n=this._tiles[t];(n.tileID.equals(e)||n.tileID.isChildOf(e)||e.isChildOf(n.tileID))&&n.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let t={};for(let n of this._renderableTilesKeys){let r=this._tiles[n].tileID,i=e.clone(),a=WR();if(r.canonical.equals(e.canonical))fR(a,0,q,q,0,0,1);else if(r.canonical.isChildOf(e.canonical)){let t=r.canonical.z-e.canonical.z,n=r.canonical.x-(r.canonical.x>>t<<t),i=r.canonical.y-(r.canonical.y>>t<<t),o=q>>t;fR(a,0,o,o,0,0,1),oR(a,a,[-n*o,-i*o,0])}else if(e.canonical.isChildOf(r.canonical)){let t=e.canonical.z-r.canonical.z,n=e.canonical.x-(e.canonical.x>>t<<t),i=e.canonical.y-(e.canonical.y>>t<<t),o=q>>t;fR(a,0,q,q,0,0,1),oR(a,a,[n*o,i*o,0]),sR(a,a,[1/2**t,1/2**t,0])}else continue;i.terrainRttPosMatrix32f=new Float32Array(a),t[n]=i}return t}_getTerrainCoordsForTileRanges(e,t){let n={};for(let r of this._renderableTilesKeys){let i=this._tiles[r].tileID;if(!this._isWithinTileRanges(i,t))continue;let a=e.clone(),o=WR();if(i.canonical.z===e.canonical.z){let t=e.canonical.x-i.canonical.x+e.wrap*(1<<e.canonical.z),n=e.canonical.y-i.
vendor: 8,869 bytes, line 1207
1207canonical.y;fR(o,0,q,q,0,0,1),oR(o,o,[t*q,n*q,0])}else if(i.canonical.z>e.canonical.z){let t=i.canonical.z-e.canonical.z,n=i.canonical.x-(i.canonical.x>>t<<t)+e.wrap*(1<<i.canonical.z),r=i.canonical.y-(i.canonical.y>>t<<t),a=e.canonical.x-(i.canonical.x>>t),s=e.canonical.y-(i.canonical.y>>t),c=q>>t;fR(o,0,c,c,0,0,1),oR(o,o,[-n*c+a*q,-r*c+s*q,0])}else{let t=e.canonical.z-i.canonical.z,n=e.canonical.x-(e.canonical.x>>t<<t)+e.wrap*(1<<e.canonical.z),r=e.canonical.y-(e.canonical.y>>t<<t),a=(e.canonical.x>>t)-i.canonical.x,s=(e.canonical.y>>t)-i.canonical.y,c=q<<t;fR(o,0,c,c,0,0,1),oR(o,o,[n*q+a*c,r*q+s*c,0])}a.terrainRttPosMatrix32f=new Float32Array(o),n[r]=a}return n}getSourceTile(e,t){let n=this.tileManager._source,r=e.overscaledZ-this.deltaZoom;if(r>n.maxzoom&&(r=n.maxzoom),r<n.minzoom)return;this._sourceTileCache[e.key]||=e.scaledTo(r).key;let i=this.findTileInCaches(this._sourceTileCache[e.key]);if(!i?.dem&&t)for(;r>=n.minzoom&&!i?.dem;)i=this.findTileInCaches(e.scaledTo(r--).key);return i}findTileInCaches(e){let t=this.tileManager.getTileByID(e);return t||(t=this.tileManager._outOfViewCache.getByKey(e),t)}anyTilesAfterTime(e=LJ()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){let n=t[e.canonical.z];return!!n&&(e.wrap>n.minWrap||e.wrap<n.maxWrap||e.canonical.x>=n.minTileXWrapped&&e.canonical.x<=n.maxTileXWrapped&&e.canonical.y>=n.minTileY&&e.canonical.y<=n.maxTileY)}},$qe=q*.999999999999,eJe=class{constructor(e,t,n,r=`auto`){this._meshCache={},this.painter=e,this.tileManager=new Qqe(t),this.options=n,this.exaggeration=typeof n.exaggeration==`number`?n.exaggeration:1,this._terrainSkirtLength=r,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this._elevationSamplerCache=new Map}destroy(){this._fbo&&=(this._fbo.destroy(),null),this._fboDepthTexture&&=(this._fboDepthTexture.destroy(),null),this._emptyDemTexture&&=(this._emptyDemTexture.destroy(),null),this._emptyDepthTexture&&=(this._emptyDepthTexture.destroy(),null);for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,t,n,r=q){let i=e.normalizeCoordinates(t,n,r);if(!i)return 0;let a=this.getElevationSampler(i.tileID);return a?a(i.x,i.y,r):0}getElevationForLngLatZoom(e,t){if(!rVe(t,e.wrap()))return 0;let{tileID:n,mercatorX:r,mercatorY:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getElevation(n,r%q,i%q,q)}getElevationForLngLat(e,t){let n=uY(t,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),r=0;for(let e of n)e.canonical.z>r&&(r=Math.min(e.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(e,r)}getElevation(e,t,n,r=q){return this.getDEMElevation(e,t,n,r)*this.exaggeration}resetElevationCache(){this._elevationSamplerCache.clear(),this._coverageIndex=void 0}getCoverageIndex(){return this._coverageIndex===void 0&&(this._coverageIndex=this._buildCoverageIndex()),this._coverageIndex}_buildCoverageIndex(){let e=[],t=new Map,n=0,r=0;for(let i of this.tileManager.getRenderableTiles()){if(!i)continue;let{canonical:a,wrap:o}=i.tileID;e.includes(a.z)||e.push(a.z);let s=this.getElevationSampler(i.tileID);t.set(`${o}/${a.z}/${a.x}/${a.y}`,s);let{minElevation:c,maxElevation:l}=this.getMinMaxElevation(i.tileID);n=Math.min(n,c??0),r=Math.max(r,l??0)}return t.size===0?null:(e.sort((e,t)=>t-e),{zooms:e,samplerPerTile:t,minElevation:n-10,maxElevation:r+10})}getElevationSampler(e){let t=e.key,n=this._elevationSamplerCache.get(t);if(n)return n;let r=this.tileManager.getSourceTile(e,!0),i=r?.dem;if(!r||!i)return null;let a=this._getDEMTileMatrix(e,r),o=a[0]*i.dim,s=a[5]*i.dim,c=a[12]*i.dim,l=a[13]*i.dim,u=(e,t,n)=>{let r=n===8192?1:q/n;return i.sampleBilinear(e*r*o+c,t*r*s+l)};return this._elevationSamplerCache.set(t,u),u}_getDEMTileMatrix(e,t){let n=`${t.tileID.key}/${e.key}`,r=this._demMatrixCache.get(n);if(r)return r;let i=this.tileManager.getSource().maxzoom,a=e.canonical.z-t.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=i?a=e.canonical.z-i:_z(`cannot calculate elevation if elevation maxzoom > source.maxzoom`));let o=e.canonical.x-(e.canonical.x>>a<<a),s=e.canonical.y-(e.canonical.y>>a<<a),c=ZNe(new Float64Array(16),[1/(q<<a),1/(q<<a),0]);return oR(c,c,[o*q,s*q,0]),this._demMatrixCache.set(n,c),c}getTerrainData(e){if(!this._emptyDemTexture){let e=this.painter.context,t=new aK({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new uK(e,t,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new uK(e,new aK({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=rR([])}let t=this.tileManager.getSourceTile(e,!0);if(t?.dem&&(!t.demTexture||t.needsTerrainPrepare)){let e=this.painter.context;t.demTexture||=this.painter.getTileTexture(t.dem.stride),t.demTexture?t.demTexture.update(t.dem.getPixels(),{premultiply:!1}):t.demTexture=new uK(e,t.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),t.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),t.needsTerrainPrepare=!1}let n=t?this._getDEMTileMatrix(e,t):this._emptyDemMatrix;return{u_depth:2,u_terrain:3,u_terrain_dim:t?.dem?.dim||1,u_terrain_matrix:n,u_terrain_unpack:t?.dem?.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(t?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:t}}getFramebuffer(){let e=this.painter,t=e.width/devicePixelRatio,n=e.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==t||this._fbo.height!==n)&&(this._fbo.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture),this._fboDepthTexture||(this._fboDepthTexture=new uK(e.context,{width:t,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(t,n,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,t,n))),this._fbo.colorAttachment.set(this._fboDepthTexture.texture),this._fbo}depthAtPoint(e){let t=new Uint8Array(4),n=this.painter.context,r=n.gl;return n.bindFramebuffer.set(this.getFramebuffer().framebuffer),r.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,t),n.bindFramebuffer.set(null),(t[0]/16777216+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(e){let t=this.painter.style.projection?.transitionState>0,n=t&&e.canonical.y===0,r=t&&e.canonical.y===(1<<e.canonical.z)-1,i=`m_${n?`n`:``}_${r?`s`:``}`;if(this._meshCache[i])return this._meshCache[i];let a=this.painter.context,o=new dLe,s=new sG,c=this.meshSize,l=q/c,u=c*c;for(let e=0;e<=c;e++)for(let t=0;t<=c;t++)o.emplaceBack(t*l,e*l,0);for(let e=0;e<u;e+=c+1)for(let t=0;t<c;t++)s.emplaceBack(t+e,c+t+e+1,c+t+e+2),s.emplaceBack(t+e,c+t+e+2,t+e+1);this._terrainSkirtLength!==`none`&&this._buildSkirts(o,s,c,l,n,r);let d=new nY(a.createVertexBuffer(o,Zqe.members),a.createIndexBuffer(s),uG.simpleSegment(0,0,o.length,s.length));return this._meshCache[i]=d,d}getSkirtLength(e){return 2*Math.PI*KK/2**Math.max(e,0)/5}getMinTileElevationForLngLatZoom(e,t){if(!rVe(t,e.wrap()))return 0;let{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getMinMaxElevation(n).minElevation??0}getMinMaxElevation(e){let t=this.tileManager.getSourceTile(e,!0),n={minElevation:null,maxElevation:null};return t?.dem&&(n.minElevation=t.dem.min*this.exaggeration,n.maxElevation=t.dem.max*this.exaggeration),n}_getOverscaledTileIDFromLngLatZoom(e,t){let n=$K.fromLngLat(e.wrap()),r=(1<<t)*q,i=n.x*r,a=n.y*r;return{tileID:new Dq(t,0,t,Math.floor(i/q),Math.floor(a/q)),mercatorX:i,mercatorY:a}}_buildSkirts(e,t,n,r,i,a){let o=e.length,s=o+(n+1),c=(n+1)*n,l=i?WRe:0,u=+!i,d=a?GRe:q,f=+!a;for(let t=0;t<=n;t++)e.emplaceBack(t*r,l,u);for(let t=0;t<=n;t++)e.emplaceBack(t*r,d,f);for(let e=0;e<n;e++)t.emplaceBack(c+e,s+e,s+e+1),t.emplaceBack(c+e,s+e+1,c+e+1),t.emplaceBack(0+e,o+e+1,o+e),t.emplaceBack(0+e,0+e+1,o+e+1);let p=e.length,m=p+(n+1)*2;for(let t of[0,1])for(let i=0;i<=n;i++)for(let n of[0,1])e.emplaceBack(t*q,i*r,n);for(let e=0;e<n*2;e+=2)t.emplaceBack(p+e,p+e+1,p+e+3),t.emplaceBack(p+e,p+e+3,p+e+2),t.emplaceBack(m+e,m+e+3,m+e+1),t.emplaceBack(m+e,m+e+2,m+e+3)}},tJe={covered:!1,elevation:0};function nJe(e,t,n,r){if(r<0||r>=1)return tJe;let i=Math.floor(n),a=n-i;for(let n of e.zooms){let o=1<<n,s=a*o,c=r*o,l=Math.floor(s),u=Math.floor(c),d=`${i}/${n}/${l}/${u}`;if(!e.samplerPerTile.has(d))continue;let f=e.samplerPerTile.get(d);return f?{covered:!0,elevation:f(Math.min((s-l)*q,$qe),Math.min((c-u)*q,$qe),q)*t}:{covered:!0,elevation:0}}return tJe}function rJe(e,t){return e.covered&&t<=e.elevation+1e-6}function iJe(e,t,n,r,i){for(let a=0;a<40&&r-n>i;a++){let i=(n+r)/2;t(e,i)?r=i:n=i}return{lo:n,hi:r}}
1207var LY=class e{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,n){this._helper.interpolatePadding(e,t,n)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,n=!0){this._helper.resize(e,t,n)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(e){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(e,t)=>{t=iz(+t,this.minZoom,this.maxZoom);let n={center:new qK(e.lng,e.lat),zoom:t},r=this._helper._lngRange;!this._helper._renderWorldCopies&&r===null&&(r=[-179.9999999999,179.9999999999]);let i=this.tileSize*lz(n.zoom),a=0,o=i,s=0,c=i,l=0,u=0,{x:d,y:f}=this.size;if(this._helper._latRange){let e=this._helper._latRange;a=YK(e[1])*i,o=YK(e[0])*i,o-a<f&&(l=f/(o-a))}r&&(s=az(JK(r[0])*i,0,i),c=az(JK(r[1])*i,0,i),c<s&&(c+=i),c-s<d&&(u=d/(c-s)));let{x:p,y:m}=tq(i,e),h,g,_=Math.max(u||0,l||0);if(_)return n.center=nq(i,new K(u?(c+s)/2:p,l?(o+a)/2:m)).wrap(),n.zoom+=uz(_),n;if(this._helper._latRange){let e=f/2;m-e<a&&(g=a+e),m+e>o&&(g=o-e)}if(r){let e=(s+c)/2,t=p;
vendor: 4,292 bytes, line 1207
1207this._helper._renderWorldCopies&&(t=az(p,e-i/2,e+i/2));let n=d/2;t-n<s&&(h=s+n),t+n>c&&(h=c-n)}return(h!==void 0||g!==void 0)&&(n.center=nq(i,new K(h??p,g??m)).wrap()),n},this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new IY({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._coveringTilesDetailsProvider=new Gqe}clone(){let t=new e;return t.apply(this,!1),t}apply(e,t,n){this._helper.apply(e,t,n)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(e){let t=[new Eq(0,e)];if(this._helper._renderWorldCopies){let n=this.screenPointToMercatorCoordinate(new K(0,0)),r=this.screenPointToMercatorCoordinate(new K(this._helper._width,0)),i=this.screenPointToMercatorCoordinate(new K(this._helper._width,this._helper._height)),a=this.screenPointToMercatorCoordinate(new K(0,this._helper._height)),o=Math.floor(Math.min(n.x,r.x,i.x,a.x)),s=Math.floor(Math.max(n.x,r.x,i.x,a.x));for(let n=o-1;n<=s+1;n++)n!==0&&t.push(new Eq(n,e))}return t}getCameraFrustum(){return Kqe.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){let t=this.screenPointToLocation(this.centerPoint,e),n=e?e.getElevationForLngLatZoom(t,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(n)}setLocationAtPoint(e,t,n=this.elevation){let r=n-this.elevation,i=this.screenPointToMercatorCoordinateAtZ(t,r),a=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,0),o=$K.fromLngLat(e),s=new $K(o.x-(i.x-a.x),o.y-(i.y-a.y));this.setCenter(s?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,t){return t?this.coordinatePoint($K.fromLngLat(e),t.getElevationForLngLat(e,this),this._pixelMatrix3D):this.coordinatePoint($K.fromLngLat(e))}screenPointToLocation(e,t){return this.screenPointToMercatorCoordinate(e,t)?.toLngLat()}screenPointToLocationAtElevation(e,t){return this.screenPointToMercatorCoordinateAtZ(e,t-this.elevation)?.toLngLat()}screenPointToMercatorCoordinate(e,t){if(t){let n=this.screenTerrainPointToMercatorCoordinate(e,t);if(n!=null)return n}return this.screenPointToMercatorCoordinateAtZ(e)}screenTerrainPointToMercatorCoordinate(e,t){let n=t.getCoverageIndex();if(!n)return null;let{near:r,far:i}=this.getRaySegmentFromPixel(e),a=this.worldSize,o=i[0]-r[0],s=i[1]-r[1],c=i[2]-r[2],l={index:n,exaggeration:t.exaggeration,near:r,dx:o,dy:s,dz:c,worldSize:a},u=0,d=1;if(c===0){if(r[2]>n.maxElevation||r[2]<n.minElevation)return null}else{let e=(n.maxElevation-r[2])/c,t=(n.minElevation-r[2])/c;if(u=Math.max(u,Math.min(e,t)),d=Math.min(d,Math.max(e,t)),u>d)return null}let f=Math.hypot(o,s),p=iz(Math.ceil(f*(d-u)/4),1,512),m=0,h=!zY(l,0);for(let e=0;e<=p;e++){let t=u+(d-u)*e/p;if(!h)h=!zY(l,t);else if(zY(l,t)){let{lo:e,hi:n}=iJe(l,zY,m,t,.001/f),i=RY(l,e),u=RY(l,n),d=r[2]+e*c-i.elevation,p=r[2]+n*c-u.elevation,h=i.covered&&d>p?iz(e+d*(n-e)/(d-p),e,n):n;return new $K((r[0]+h*o)/a,(r[1]+h*s)/a,RY(l,h).elevation)}m=t}return null}getRaySegmentFromPixel(e){let t=[e.x,e.y,0,1],n=[e.x,e.y,1,1];kR(t,t,this._pixelMatrixInverse),kR(n,n,this._pixelMatrixInverse);let r=t[3],i=n[3],a=this.elevation;return{near:[t[0]/r,t[1]/r,t[2]/r+a],far:[n[0]/i,n[1]/i,n[2]/i+a]}}screenPointToMercatorCoordinateAtZ(e,t){let n=t||0,{near:r,far:i}=this.getRaySegmentFromPixel(e),a=r[2]===i[2]?0:(n+this.elevation-r[2])/(i[2]-r[2]);return new $K(_V.number(r[0],i[0],a)/this.worldSize,_V.number(r[1],i[1],a)/this.worldSize,n)}coordinatePoint(e,t=0,n=this._pixelMatrix){let r=[e.x*this.worldSize,e.y*this.worldSize,t,1];return kR(r,r,n),new K(r[0]/r[3],r[1]/r[3])}getBounds(){let e=Math.max(0,this._helper._height/2-rq(this));return new QJ().extend(this.screenPointToLocation(new K(0,e))).extend(this.screenPointToLocation(new K(this._helper._width,e))).extend(this.screenPointToLocation(new K(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new K(0,this._helper._height)))}
vendor: 7,056 bytes, line 1207
1207isPointOnMapSurface(e,t){return t?this.screenTerrainPointToMercatorCoordinate(e,t)!=null:e.y>this.height/2-rq(this)}calculatePosMatrix(e,t=!1,n=!1){let r=e.key??Oq(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),i=t?this._alignedPosMatrixCache:this._posMatrixCache;if(i.has(r)){let e=i.get(r);return n?e.f32:e.f64}let a=iq(e,this.worldSize);aR(a,t?this._alignedProjMatrix:this._viewProjMatrix,a);let o={f64:a,f32:new Float32Array(a)};return i.set(r,o),n?o.f32:o.f64}calculateFogMatrix(e){let t=e.key,n=this._fogMatrixCacheF32;if(n.has(t))return n.get(t);let r=iq(e,this.worldSize);return aR(r,this._fogMatrix,r),n.set(t,new Float32Array(r)),n.get(t)}calculateCenterFromCameraLngLatAlt(e,t,n,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,n,r)}_calculateNearFarZIfNeeded(e,t,n){if(!this._helper.autoCalculateNearFarZ)return;let r=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),i=e-r*this._helper._pixelPerMeter/Math.cos(t),a=r<0?i:e,o=Math.PI/2+this.pitchInRadians,s=wz(this.fov)*(Math.abs(Math.cos(wz(this.roll)))*this.height+Math.abs(Math.sin(wz(this.roll)))*this.width)/this.height*(.5+n.y/this.height),c=Math.sin(s)*a/Math.sin(iz(Math.PI-o-s,.01,Math.PI-.01)),l=rq(this),u=Math.atan(l/this._helper.cameraToCenterDistance),d=wz(90-eq),f=u>d?2*u*(.5+n.y/(l*2)):d,p=Math.sin(f)*a/Math.sin(iz(Math.PI-o-f,.01,Math.PI-.01)),m=Math.min(c,p);this._helper._farZ=(Math.cos(Math.PI/2-t)*m+a)*1.01,this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;let e=this.centerOffset,t=tq(this.worldSize,this.center),n=t.x,r=t.y;this._helper._pixelPerMeter=XK(1,this.center.lat)*this.worldSize;let i=wz(Math.min(this.pitch,eq)),a=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(i));this._calculateNearFarZIfNeeded(a,i,e);let o;o=new Float64Array(16),dR(o,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),KKe(this._invProjMatrix,o),o[8]=-e.x*2/this._helper._width,o[9]=e.y*2/this._helper._height,this._projectionMatrix=nR(o),sR(o,o,[1,-1,1]),oR(o,o,[0,0,-this._helper.cameraToCenterDistance]),uR(o,o,-this.rollInRadians),cR(o,o,this.pitchInRadians),uR(o,o,-this.bearingInRadians),oR(o,o,[-n,-r,0]),this._mercatorMatrix=sR([],o,[this.worldSize,this.worldSize,this.worldSize]),sR(o,o,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=aR(new Float64Array(16),this.clipSpaceToPixelsMatrix,o),oR(o,o,[0,0,-this.elevation]),this._viewProjMatrix=o,this._invViewProjMatrix=iR([],o);let s=[0,0,-1,1];kR(s,s,this._invViewProjMatrix),this._cameraPosition=[s[0]/s[3],s[1]/s[3],s[2]/s[3]],this._fogMatrix=new Float64Array(16),dR(this._fogMatrix,this.fovInRadians,this.width/this.height,a,this._helper._farZ),this._fogMatrix[8]=-e.x*2/this.width,this._fogMatrix[9]=e.y*2/this.height,sR(this._fogMatrix,this._fogMatrix,[1,-1,1]),oR(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),uR(this._fogMatrix,this._fogMatrix,-this.rollInRadians),cR(this._fogMatrix,this._fogMatrix,this.pitchInRadians),uR(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),oR(this._fogMatrix,this._fogMatrix,[-n,-r,0]),sR(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),oR(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=aR(new Float64Array(16),this.clipSpaceToPixelsMatrix,o);let c=this._helper._width%2/2,l=this._helper._height%2/2,u=Math.cos(this.bearingInRadians),d=Math.sin(-this.bearingInRadians),f=n-Math.round(n)+u*c+d*l,p=r-Math.round(r)+u*l+d*c,m=new Float64Array(o);if(oR(m,m,[f>.5?f-1:f,p>.5?p-1:p,0]),this._alignedProjMatrix=m,o=iR(new Float64Array(16),this._pixelMatrix),!o)throw Error(`failed to invert matrix`);this._pixelMatrixInverse=o,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let e=this.screenPointToMercatorCoordinate(new K(0,0)),t=[e.x*this.worldSize,e.y*this.worldSize,0,1];return kR(t,t,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let e=XK(1,this.center.lat)*this.worldSize,t=this._helper.cameraToCenterDistance/e;return Cze(this.center,this.elevation,this.pitch,this.bearing,t).toLngLat()}lngLatToCameraDepth(e,t){let n=$K.fromLngLat(e),r=[n.x*this.worldSize,n.y*this.worldSize,t,1];return kR(r,r,this._viewProjMatrix),r[2]/r[3]}getProjectionData(e){let{overscaledTileID:t,aligned:n,applyTerrainMatrix:r}=e,i=this._helper.getMercatorTileCoordinates(t),a=t?this.calculatePosMatrix(t,n,!0):null,o;return o=t?.terrainRttPosMatrix32f&&r?t.terrainRttPosMatrix32f:a||KR(),{mainMatrix:o,tileMercatorCoords:i,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:o,clipAntimeridian:!1}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,t,n){return 1}transformLightDirection(e){return mR(e)}getRayDirectionFromPixel(e){throw Error(`Not implemented.`)}projectTileCoordinates(e,t,n,r){let i=this.calculatePosMatrix(n),a;r==null?(a=[e,t,0,1],wY(a,a,i)):(a=[e,t,r,1],kR(a,a,i));let o=a[3];return{point:new K(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}populateCache(e){for(let t of e)this.calculatePosMatrix(t)}getProjectionDataForCustomLayer(e=!0){let t=new Dq(0,0,0,0,0),n=this.getProjectionData({overscaledTileID:t,applyGlobeMatrix:e}),r=iq(t,this.worldSize);aR(r,this._viewProjMatrix,r);let i=[q,q,this.worldSize/this._helper.pixelsPerMeter],a=WR();return sR(a,r,i),{...n,tileMercatorCoords:[0,0,1,1],fallbackMatrix:a,mainMatrix:a}}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}};function RY(e,t){return nJe(e.index,e.exaggeration,(e.near[0]+t*e.dx)/e.worldSize,(e.near[1]+t*e.dy)/e.worldSize)}function zY(e,t){return rJe(RY(e,t),e.near[2]+t*e.dz)}function aJe(){_z(`Map cannot fit within canvas with the given bounds, padding, and/or offset.`)}function oJe(e){if(e.useSlerp)if(e.k<1){let t=Oz(e.startEulerAngles.roll,e.startEulerAngles.pitch,e.startEulerAngles.bearing),n=Oz(e.endEulerAngles.roll,e.endEulerAngles.pitch,e.endEulerAngles.bearing),r=new Float64Array(4);jR(r,t,n,e.k);let i=NPe(r);e.tr.setRoll(i.roll),e.tr.setPitch(i.pitch),e.tr.setBearing(i.bearing)}else e.tr.setRoll(e.endEulerAngles.roll),e.tr.setPitch(e.endEulerAngles.pitch),e.tr.setBearing(e.endEulerAngles.bearing);else e.tr.setRoll(_V.number(e.startEulerAngles.roll,e.endEulerAngles.roll,e.k)),e.tr.setPitch(_V.number(e.startEulerAngles.pitch,e.endEulerAngles.pitch,e.k)),e.tr.setBearing(_V.number(e.startEulerAngles.bearing,e.endEulerAngles.bearing,e.k))}function sJe(e,t,n,r,i){let a=i.padding,o=tq(i.worldSize,n.getNorthWest()),s=tq(i.worldSize,n.getNorthEast()),c=tq(i.worldSize,n.getSouthEast()),l=tq(i.worldSize,n.getSouthWest
vendor: 7,750 bytes, line 1207
1207()),u=wz(-r),d=o.rotate(u),f=s.rotate(u),p=c.rotate(u),m=l.rotate(u),h=new K(Math.max(d.x,f.x,m.x,p.x),Math.max(d.y,f.y,m.y,p.y)),g=new K(Math.min(d.x,f.x,m.x,p.x),Math.min(d.y,f.y,m.y,p.y)),_=h.sub(g),v=i.width-(a.left+a.right+t.left+t.right),y=i.height-(a.top+a.bottom+t.top+t.bottom),b=v/_.x,x=y/_.y;if(x<0||b<0){aJe();return}let S=Math.min(uz(i.scale*Math.min(b,x)),e.maxZoom),C=K.convert(e.offset),w=new K((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(wz(r)),T=C.add(w).mult(i.scale/lz(S));return{center:nq(i.worldSize,o.add(c).div(2).sub(T)),zoom:S,bearing:r}}var BY=class{get useGlobeControls(){return!1}handlePanInertia(e,t){let n=e.mag(),r=Math.abs(rq(t));return{easingOffset:e.mult(Math.min(r*.75/n,1)),easingCenter:t.center}}handleMapControlsRollPitchBearingZoom(e,t){e.bearingDelta&&t.setBearing(t.bearing+e.bearingDelta),e.pitchDelta&&t.setPitch(t.pitch+e.pitchDelta),e.rollDelta&&t.setRoll(t.roll+e.rollDelta),e.zoomDelta&&t.setZoom(t.zoom+e.zoomDelta)}handleMapControlsPan(e,t,n){e.around.distSqr(t.centerPoint)<.01||t.setLocationAtPoint(n,e.around,e.aroundElevation)}cameraForBoxAndBearing(e,t,n,r,i){return sJe(e,t,n,r,i)}handleJumpToCenterZoom(e,t){let n=t.zoom===void 0?e.zoom:+t.zoom;e.zoom!==n&&e.setZoom(+t.zoom),t.center!==void 0&&e.setCenter(qK.convert(t.center))}handleEaseTo(e,t){let n=e.zoom,r=e.padding,i={roll:e.roll,pitch:e.pitch,bearing:e.bearing},a={roll:t.roll===void 0?e.roll:t.roll,pitch:t.pitch===void 0?e.pitch:t.pitch,bearing:t.bearing===void 0?e.bearing:t.bearing},o=t.zoom!==void 0,s=!e.isPaddingEqual(t.padding),c=!1,l=o?+t.zoom:e.zoom,u=e.centerPoint.add(t.offsetAsPoint),d=e.screenPointToLocation(u),{center:f,zoom:p}=e.applyConstrain(qK.convert(t.center||d),l??n);FY(e,f);let m=tq(e.worldSize,d),h=tq(e.worldSize,f).sub(m),g=lz(p-n);return c=p!==n,{easeFunc:o=>{if(c&&e.setZoom(_V.number(n,p,o)),Ez(i,a)||oJe({startEulerAngles:i,endEulerAngles:a,tr:e,k:o,useSlerp:i.roll!=a.roll}),s&&(e.interpolatePadding(r,t.padding,o),u=e.centerPoint.add(t.offsetAsPoint)),t.around)e.setLocationAtPoint(t.around,t.aroundPoint);else{let t=lz(e.zoom-n),r=(p>n?Math.min(2,g):Math.max(.5,g))**(1-o),i=nq(e.worldSize,m.add(h.mult(o*r)).mult(t));e.setLocationAtPoint(e.renderWorldCopies?i.wrap():i,u)}},isZooming:c,elevationCenter:f}}handleFlyTo(e,t){let n=t.zoom!==void 0,r=e.zoom,i=e.applyConstrain(qK.convert(t.center||t.locationAtOffset),n?+t.zoom:r),a=i.center,o=i.zoom;FY(e,a);let s=e.worldSize,c=tq(s,t.locationAtOffset),l=tq(s,a).sub(c),u=l.mag(),d=lz(o-r),f=t.minZoom===void 0?e.minZoom:+t.minZoom,p=Math.max(f,e.minZoom),m=Math.min(p,r,o),h=e.applyConstrain(a,m).zoom;return{easeFunc:(t,n,i,u)=>{e.setZoom(t===1?o:r+uz(n));let d=t===1?a:nq(s,c.add(l.mult(i)));e.setLocationAtPoint(e.renderWorldCopies?d.wrap():d,u)},scaleOfZoom:d,targetCenter:a,scaleOfMinZoom:lz(h-r),pixelPathLength:u}}},cJe,lJe=()=>cJe||=new fW({type:new sW(J.projection.type,`type`)}),VY=new zK({fill:new RK(128,2),line:new RK(512,0),tile:new RK(128,32),stencil:new RK(128,1),circle:3}),uJe=class{constructor(){this._tileMeshCache={}}get name(){return`vertical-perspective`}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return`globe`}get shaderDefine(){return`#define GLOBE`}get shaderPreludeCode(){return MY.projectionGlobe}get vertexShaderPreludeCode(){return MY.projectionMercator.vertexSource}get subdivisionGranularity(){return VY}get useGlobeControls(){return!0}destroy(){}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?`b`:``}${e.extendToNorthPole?`n`:``}${e.extendToSouthPole?`s`:``}`}getMeshFromTileID(e,t,n,r,i){let a=(i===`stencil`?VY.stencil:VY.tile).getGranularityForZoomLevel(t.z),o=t.y===0&&r,s=t.y===(1<<t.z)-1&&r;return this._getMesh(e,{granularity:a,generateBorders:n,extendToNorthPole:o,extendToSouthPole:s})}_getMesh(e,t){let n=this._getMeshKey(t);if(n in this._tileMeshCache)return this._tileMeshCache[n];let r=dKe(e,t);return this._tileMeshCache[n]=r,r}recalculate(e){}hasTransition(){return!1}},dJe=class extends Jz{constructor(e,t){super(),this._transitionable=new eW(lJe(),`projection`,t),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new XU(0)),this._mercatorProjection=new PY,this._verticalPerspectiveProjection=new uJe}get transitionState(){let e=this.properties.get(`type`);if(typeof e==`string`&&e===`mercator`)return 0;if(typeof e==`string`&&e===`vertical-perspective`)return 1;if(e instanceof $B){if(e.from===e.to)return e.from===`mercator`?0:1;if(e.from===`vertical-perspective`&&e.to===`mercator`)return 1-e.transition;if(e.from===`mercator`&&e.to===`vertical-perspective`)return e.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return`globe`}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}getMeshFromTileID(e,t,n,r,i){return this.currentProjection.getMeshFromTileID(e,t,n,r,i)}setProjection(e){this._transitionable.setValue(`type`,e?.type||`mercator`)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}};function fJe(e){let t=WY(e.worldSize,e.center.lat);return 2*Math.PI*t}function pJe(e,t,n){let r=xR(UY(t),UY(n)),i=Math.acos(r),a=fJe(e);return i/(2*Math.PI)*a}function mJe(e,t){return[$R(e*Math.PI*2+Math.PI,Math.PI*2),2*Math.atan(Math.exp(Math.PI-t*Math.PI*2))-Math.PI*.5]}function hJe(e,t){let n=Math.cos(t),r=new Float64Array(3);return r[0]=Math.sin(e)*n,r[1]=Math.sin(t),r[2]=Math.cos(e)*n,r}function HY(e,t,n,r,i){let a=1/(1<<i),o=e/q*a+n*a,s=t/q*a+r*a,c=$R(o*Math.PI*2+Math.PI,Math.PI*2),l=2*Math.atan(Math.exp(Math.PI-s*Math.PI*2))-Math.PI*.5,u=Math.cos(l),d=new Float64Array(3);return d[0]=Math.sin(c)*u,d[1]=Math.sin(l),d[2]=Math.cos(c)*u,d}function UY(e){return hJe(e.lng*Math.PI/180,e.lat*Math.PI/180)}function WY(e,t){return e/(2*Math.PI)/Math.cos(t*Math.PI/180)}function GY(e){let t=Math.asin(e[1])/Math.PI*180,n=Math.sqrt(e[0]*e[0]+e[2]*e[2]);if(n>1e-6){let r=e[0]/n,i=e[2]/n,a=Math.acos(i);return new qK(az((r>0?a:-a)/Math.PI*180,-180,180),t)}return new qK(0,t)}function gJe(e,t){return MR(HR(),-e.lng,-e.lat,t)}function _Je(e){let t=e[0],n=e[1],r=e[2],i=e[3];return{lng:-Math.atan2(2*(i*t+n*r),1-2*(t*t+n*n))*180/Math.PI,lat:-Math.asin(iz(2*(i*n-r*t),-1,1))*180/Math.PI,bearing:Math.atan2(2*(i*r+t*n),1-2*(n*n+r*r))*180/Math.PI}}var KY=Math.PI*.98;function vJe(e,t){let n=e.cameraPosition,r=hR(n);if(r<=1)return e.screenPointToLocation(t);let i=UR();bR(i,n);let a=e.getRayDirectionFromPixel(t),o=-xR(a,i),s=UR();yR(s,a,i,o);let c=hR(s);if(c<1e-9)return e.screenPointToLocation(t);let l=Math.atan2(c,o),u=Math.asin(1/r)*.9;if(l<u)return e.screenPointToLocation(t);let d=r*Math.sin(u),f=Math.asin(iz(d,-1,1))-u,p=r*Math.cos(u)/Math.sqrt(Math.max(1-d*d,1e-12))-1,m=KY-f,h=l-u,g=f+p*h*m/(m+p*h),_=UR();vR(_,s,1/c);let v=UR();return vR(v,i,Math.cos(iz(g,0,KY))),yR(v,v,_,Math.sin(iz(g,0,KY))),bR(v,v),GY(v)}function yJe(e,t,n,r,i=!0){let a=vJe(e,n),o=t;if(r)o=vJe(e,n.sub(r));
vendor: 3,087 bytes, line 1207
1207else if(!e.isPointOnMapSurface(n))return;let s=UY(a),c=UY(o),l=gJe(e.center,e.bearing),u=SR(UR(),c,s),d=Math.sqrt(xR(u,u)),f=Math.acos(iz(xR(c,s),-1,1))/2,p=Math.sin(f),m=d?NR(u[1]/d*p,-u[0]/d*p,u[2]/d*p,Math.cos(f)):NR(0,0,0,1),{lng:h,lat:g,bearing:_}=_Je(pPe(HR(),l,m)),v=e.center.lat,y=e.zoom,b=iz(g,-90,90),x=i?bJe(e,n,r,h):h;e.setCenter(new qK(az(x,-180,180),b)),i||e.setBearing(_),e.setZoom(y+JY(v,e.center.lat))}function bJe(e,t,n,r){let i=e.center.lng,a=e.center.lat,o=a>=0?90:-90,s=e.locationToScreenPoint(new qK(0,o)),c=t.x-s.x,l=t.y-s.y,u=c*c+l*l,d=iz(1-(kz-Math.abs(a))/12,0,1),f=d*d*(3-2*d),p=$R(r-i+180,360)-180,m=0;if(f>0&&n){let e=(c*n.y-l*n.x)/Math.max(u,400);m=(o>0?1:-1)*e*180/Math.PI}return i+(1-f)*p+f*m}function xJe(e){let t=UR();return t[0]=e[0]*-e[3],t[1]=e[1]*-e[3],t[2]=e[2]*-e[3],{center:t,radius:Math.sqrt(1-e[3]*e[3])}}function SJe(e,t,n){let r=UR();DR(r,n,e);let i=UR();return yR(i,e,r,t/OR(r)),i}function qY(e){return Math.cos(e*Math.PI/180)}function JY(e,t){let n=qY(e);return uz(qY(t)/n)}function CJe(e,t){return 360/fJe({worldSize:e,center:{lat:t}})}function wJe(e,t){let n=e.rotate(t.bearingInRadians),r=t.zoom+JY(t.center.lat,0),i=tz(1/qY(t.center.lat),1/qY(Math.min(Math.abs(t.center.lat),60)),ez(r,7,3,0,1)),a=CJe(t.worldSize,t.center.lat);return new qK(t.center.lng-n.x*a*i,iz(t.center.lat+n.y*a,-kz,kz))}function YY(e){let t=.5*e,n=Math.sin(t),r=Math.cos(t);return Math.log(n+r)-Math.log(r-n)}function TJe(e,t,n,r){let i=e.lat+n*r;if(Math.abs(n)>1){let a=e.lat+n,o=(Math.sign(a)===Math.sign(e.lat)?Math.abs(e.lat):-Math.abs(e.lat))*Math.PI/180,s=Math.abs(e.lat+n)*Math.PI/180,c=YY(o+r*(s-o)),l=YY(o),u=YY(s),d=(c-l)/(u-l);return new qK(e.lng+t*d,i)}return new qK(e.lng+t*r,i)}function XY(e,t,n=1){let r=xR(e,t),i=n*n,a=UR(),o=UR();vR(o,t,r),DR(a,e,o);let s=i-xR(a,a);if(s<0)return null;let c=xR(e,e)-i,l=-r+(r<0?1:-1)*Math.sqrt(s),u=c/l,d=l;return{tMin:Math.min(u,d),tMax:Math.max(u,d)}}var EJe=class{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;let e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,t,n,r){let i=`${e.z}_${e.x}_${e.y}_${r?.terrain?`t`:``}_${Math.round(n)}`,a=this._cache.get(i);if(a)return a;let o=this._cachePrevious.get(i);if(o)return this._cache.set(i,o),o;let s=this._boundingVolumeFactory(e,t,n,r);return this._cache.set(i,s),this._hadAnyChanges=!0,s}},ZY=class e{constructor(e,t,n,r){this.min=n,this.max=r,this.points=e,this.planes=t}static fromAabb(t,n){let r=[];for(let e=0;e<8;e++)r.push([(e>>0&1)==1?n[0]:t[0],(e>>1&1)==1?n[1]:t[1],(e>>2&1)==1?n[2]:t[2]]);return new e(r,[[-1,0,0,n[0]],[1,0,0,-t[0]],[0,-1,0,n[1]],[0,1,0,-t[1]],[0,0,-1,n[2]],[0,0,1,-t[2]]],t,n)}static fromCenterSizeAngles(t,n,r){let i=MR([],r[0],r[1],r[2]),a=CR([],[n[0],0,0],i),o=CR([],[0,n[1],0],i),s=CR([],[0,0,n[2]],i),c=[...t],l=[...t];for(let e=0;e<8;e++)for(let n=0;n<3;n++){let r=t[n]+a[n]*((e>>0&1)==1?1:-1)+o[n]*((e>>1&1)==1?1:-1)+s[n]*((e>>
vendor: 9,111 bytes, line 1207
12072&1)==1?1:-1);c[n]=Math.min(c[n],r),l[n]=Math.max(l[n],r)}let u=[];for(let e=0;e<8;e++){let n=[...t];_R(n,n,vR([],a,(e>>0&1)==1?1:-1)),_R(n,n,vR([],o,(e>>1&1)==1?1:-1)),_R(n,n,vR([],s,(e>>2&1)==1?1:-1)),u.push(n)}return new e(u,[[...a,-xR(a,u[0])],[...o,-xR(o,u[0])],[...s,-xR(s,u[0])],[-a[0],-a[1],-a[2],-xR(a,u[7])],[-o[0],-o[1],-o[2],-xR(o,u[7])],[-s[0],-s[1],-s[2],-xR(s,u[7])]],c,l)}intersectsFrustum(e){let t=!0,n=this.points.length,r=this.planes.length,i=e.planes.length,a=e.points.length;for(let r=0;r<i;r++){let i=e.planes[r],a=0;for(let e=0;e<n;e++){let t=this.points[e];i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=0&&a++}if(a===0)return 0;a<n&&(t=!1)}if(t)return 2;for(let t=0;t<r;t++){let n=this.planes[t],r=0;for(let t=0;t<a;t++){let i=e.points[t];n[0]*i[0]+n[1]*i[1]+n[2]*i[2]+n[3]>=0&&r++}if(r===0)return 0}return 1}intersectsPlane(e){let t=this.points.length,n=0;for(let r=0;r<t;r++){let t=this.points[r];e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]>=0&&n++}return n===t?2:n===0?0:1}};function QY(e,t,n){let r=e-t;return r<0?-r:Math.max(0,r-n)}function $Y(e,t,n,r,i){let a=e-n,o;return o=a<0?Math.min(-a,1+a-i):a>i?Math.min(Math.max(a-i,0),1-a):0,Math.max(o,QY(t,r,i))}var DJe=class{constructor(){this._boundingVolumeCache=new EJe(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,t,n,r){let i=1<<n.z,a=1/i,o=n.x/i,s=n.y/i,c=.5,l=2;return l=Math.min(l,$Y(e,t,o,s,a)),l=Math.min(l,$Y(e,t,o+c,-s-a,a)),l=Math.min(l,$Y(e,t,o+c,2-s-a,a)),l}getWrap(e,t,n){let r=1<<t.z,i=1/r,a=t.x/r,o=QY(e.x,a,i),s=QY(e.x,a-1,i),c=QY(e.x,a+1,i),l=Math.min(o,s,c);return l===c?1:l===s?-1:0}allowVariableZoom(e,t){return lY(e,t)>4}allowWorldCopies(){return!1}getTileBoundingVolume(e,t,n,r){return this._boundingVolumeCache.getTileBoundingVolume(e,t,n,r)}_computeTileBoundingVolume(e,t,n,r){let i=Math.min(0,n),a=Math.max(0,n);if(r?.terrain){let n=new Dq(e.z,t,e.z,e.x,e.y),o=r.terrain.getMinMaxElevation(n);i=o.minElevation??i,a=o.maxElevation??a}if(i/=6371008.8,a/=6371008.8,i+=1,a+=1,e.z<=0)return ZY.fromAabb([-a,-a,-a],[a,a,a]);if(e.z===1)return ZY.fromAabb([e.x===0?-a:0,e.y===0?0:-a,-a],[e.x===0?0:a,e.y===0?a:0,a]);{let t=[HY(0,0,e.x,e.y,e.z),HY(q,0,e.x,e.y,e.z),HY(q,q,e.x,e.y,e.z),HY(0,q,e.x,e.y,e.z)],n=[];for(let e of t)n.push(vR([],e,a));if(a!==i)for(let e of t)n.push(vR([],e,i));e.y===0&&n.push([0,1,0]),e.y===(1<<e.z)-1&&n.push([0,-1,0]);let r=[1,1,1],o=[-1,-1,-1];for(let e of n)for(let t=0;t<3;t++)r[t]=Math.min(r[t],e[t]),o[t]=Math.max(o[t],e[t]);let s=HY(q/2,q/2,e.x,e.y,e.z),c=SR([],[0,1,0],s);bR(c,c);let l=SR([],s,c);bR(l,l);let u=SR([],t[2],t[1]);bR(u,u);let d=SR([],t[0],t[3]);bR(d,d),n.push(vR([],s,a)),e.y>=(1<<e.z)/2&&n.push(vR([],HY(8192/2,0,e.x,e.y,e.z),a)),e.y<(1<<e.z)/2&&n.push(vR([],HY(8192/2,8192,e.x,e.y,e.z),a));let f=OJe(s,n),p=OJe(l,n),m=[-s[0],-s[1],-s[2],f.max],h=[s[0],s[1],s[2],-f.min],g=[-l[0],-l[1],-l[2],p.max],_=[l[0],l[1],l[2],-p.min],v=[...u,0],y=[...d,0],b=[];return e.y===0?b.push(YR(y,v,m),YR(y,v,h)):b.push(YR(g,v,m),YR(g,v,h),YR(g,y,m),YR(g,y,h)),e.y===(1<<e.z)-1?b.push(YR(y,v,m),YR(y,v,h)):b.push(YR(_,v,m),YR(_,v,h),YR(_,y,m),YR(_,y,h)),new ZY(b,[m,h,g,_,v,y],r,o)}}};function OJe(e,t){let n=1/0,r=-1/0;for(let i of t){let t=xR(e,i);n=Math.min(n,t),r=Math.max(r,t)}return{min:n,max:r}}var kJe=class e{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,n){this._helper.interpolatePadding(e,t,n)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t){this._helper.resize(e,t)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(e){this._cachedClippingPlane=HR(),this._projectionMatrix=GR(),this._globeViewProjMatrix32f=KR(),this._globeViewProjMatrixF64=GR(),this._globeViewProjMatrixF64Inverted=GR(),this._globeProjMatrixInverted=GR(),this._cameraPosition=UR(),this.defaultConstrain=(e,t)=>{let n=iz(e.lat,-kz,kz),r=iz(+t,this.minZoom+JY(0,n),this.maxZoom);return{center:new qK(e.lng,n),zoom:r}},this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new IY({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._coveringTilesDetailsProvider=new DJe}clone(){let t=new e;return t.apply(this,!1),t}apply(e,t){this._helper.apply(e,t)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixF64}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let e=UR();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){let{overscaledTileID:t,applyGlobeMatrix:n}=e,r=this._helper.getMercatorTileCoordinates(t);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:r,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!n,fallbackMatrix:this._globeViewProjMatrix32f,clipAntimeridian:t?.canonical.z===0}}_computeClippingPlane(e){let t=this.pitchInRadians,n=this.cameraToCenterDistance/e,r=Math.sin(t)*n,i=Math.cos(t)*n+1,a=1/Math.sqrt(r*r+i*i)*1,o=-r,s=i,c=Math.sqrt(o*o+s*s);o/=c,s/=c;let l=[0,o,s];ER(l,l,[0,0,0],-this.bearingInRadians),wR(l,l,[0,0,0],-1*this.center.lat*Math.PI/180),TR(l,l,[0,0,0],this.center.lng*Math.PI/180);let u=1/hR(l);return vR(l,l,u),[...l,-a*u]}isLocationOccluded(e){return!this.isSurfacePointVisible(UY(e))}transformLightDirection(e){let t=this._helper._center.lng*Math.PI/180,n=this._helper._center.lat*Math.PI/180,r=Math.cos(n),i=[Math.sin(t)*r,Math.sin(n),Math.cos(t)*r],a=[i[2],0,-i[0]],o=[0,0,0];SR(o,a,i),bR(a,a),bR(o,o);let s=[a[0]*e[0]+o[0]*e[1]+i[0]*e[2],a[1]*e[0]+o[1]*e[1]+i[1]*e[2],a[2]*e[0]+o[2]*e[1]+i[2]*e[2]],c=[0,0,0];return bR(c,s),c}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,t,n){let r=xze(e,t,n.canonical),i=mJe(r.x,r.y);return this.getCircleRadiusCorrection()/Math.cos(i[1])}projectTileCoordinates(e,t,n,r){let i=n.canonical,a=HY(e,t,i.x,i.y,i.z),o=1+(r??0)/KK,s=[a[0]*o,a[1]*o,a[2]*o,1];kR(s,s,this._globeViewProjMatrixF64);let c=this._cachedClippingPlane,l=c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]<0;return{point:new K(s[0]/s[3],s[1]/s[3]),signedDistanceFromCamera:s[3],isOccluded:l}}
vendor: 14,780 bytes, line 1207
1207_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let e=WY(this.worldSize,this.center.lat),t=WR();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+e*2),dR(t,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let n=this.centerOffset;t[8]=-n.x*2/this._helper._width,t[9]=n.y*2/this._helper._height,this._projectionMatrix=nR(t),this._globeProjMatrixInverted=WR(),iR(this._globeProjMatrixInverted,t),oR(t,t,[0,0,-this.cameraToCenterDistance]),uR(t,t,this.rollInRadians),cR(t,t,-this.pitchInRadians),uR(t,t,this.bearingInRadians),oR(t,t,[0,0,-e]);let r=UR();r[0]=e,r[1]=e,r[2]=e,cR(t,t,this.center.lat*Math.PI/180),lR(t,t,-this.center.lng*Math.PI/180),sR(t,t,r),this._globeViewProjMatrixF64=t,this._globeViewProjMatrix32f=new Float32Array(t),this._globeViewProjMatrixF64Inverted=WR(),iR(this._globeViewProjMatrixF64Inverted,t);let i=UR();this._cameraPosition=UR(),this._cameraPosition[2]=this.cameraToCenterDistance/e,ER(this._cameraPosition,this._cameraPosition,i,-this.rollInRadians),wR(this._cameraPosition,this._cameraPosition,i,this.pitchInRadians),ER(this._cameraPosition,this._cameraPosition,i,-this.bearingInRadians),_R(this._cameraPosition,this._cameraPosition,[0,0,1]),wR(this._cameraPosition,this._cameraPosition,i,-this.center.lat*Math.PI/180),TR(this._cameraPosition,this._cameraPosition,i,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);let a=nR(this._globeViewProjMatrixF64Inverted);sR(a,a,[1,1,-1]),this._cachedFrustum=Kqe.fromInvProjectionMatrix(a,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(e){_z(`calculateFogMatrix is not supported on globe projection.`);let t=WR();return rR(t),t}getVisibleUnwrappedCoordinates(e){return[new Eq(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){if(e){_z(`terrain is not fully supported on vertical perspective projection.`);return}this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,t){if(!this._globeViewProjMatrixF64)return 1;let n=UY(e);vR(n,n,1+t/KK);let r=HR();return kR(r,[n[0],n[1],n[2],1],this._globeViewProjMatrixF64),r[2]/r[3]}populateCache(e){}getBounds(){let e=this.width*.5,t=this.height*.5,n=[new K(0,0),new K(e,0),new K(this.width,0),new K(this.width,t),new K(this.width,this.height),new K(e,this.height),new K(0,this.height),new K(0,t)],r=[];for(let e of n)r.push(this.unprojectScreenPoint(e));let i=0,a=0,o=0,s=0,c=this.center;for(let e of r){let t=ZR(c.lng,e.lng),n=ZR(c.lat,e.lat);t<a&&(a=t),t>i&&(i=t),n<s&&(s=n),n>o&&(o=n)}let l=[c.lng+a,c.lat+s,c.lng+i,c.lat+o];return this.isSurfacePointOnScreen([0,1,0])&&(l[3]=90,l[0]=-180,l[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(l[1]=-90,l[0]=-180,l[2]=180),new QJ(l)}calculateCenterFromCameraLngLatAlt(e,t,n,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,n,r)}setLocationAtPoint(e,t,n){let r=UY(this.unprojectScreenPoint(t)),i=UY(e),a=UR();aPe(a);let o=UR();TR(o,r,a,-this.center.lng*Math.PI/180),wR(o,o,a,this.center.lat*Math.PI/180);let s=i[0]*i[0]+i[2]*i[2],c=o[0]*o[0];if(s<c)return;let l=Math.sqrt(s-c),u=-l,d=XR(i[0],i[2],o[0],l),f=XR(i[0],i[2],o[0],u),p=UR();TR(p,i,a,-d);let m=XR(p[1],p[2],o[1],o[2]),h=UR();TR(h,i,a,-f);let g=XR(h[1],h[2],o[1],o[2]),_=Math.PI*.5,v=m>=-_&&m<=_,y=g>=-_&&g<=_,b,x;if(v&&y){let e=this.center.lng*Math.PI/180,t=this.center.lat*Math.PI/180,n=QR(d,e),r=QR(m,t),i=QR(f,e),a=QR(g,t);n+r<i+a?(b=d,x=m):(b=f,x=g)}else if(v)b=d,x=m;else if(y)b=f,x=g;else return;let S=b/Math.PI*180,C=x/Math.PI*180,w=this.center.lat;this.setCenter(new qK(S,iz(C,-90,90))),this.setZoom(this.zoom+JY(w,this.center.lat))}locationToScreenPoint(e,t){let n=UY(e);return t&&vR(n,n,1+t.getElevationForLngLatZoom(e,this._helper._tileZoom)/KK),this._projectSurfacePointToScreen(n)}_projectSurfacePointToScreen(e){let t=HR();return kR(t,[...e,1],this._globeViewProjMatrixF64),t[0]/=t[3],t[1]/=t[3],new K((t[0]*.5+.5)*this.width,(-t[1]*.5+.5)*this.height)}screenPointToMercatorCoordinate(e,t){if(t){let n=this.screenTerrainPointToMercatorCoordinate(e,t);if(n)return n}return $K.fromLngLat(this.unprojectScreenPoint(e))}screenTerrainPointToMercatorCoordinate(e,t){let n=t.getCoverageIndex();if(!n)return null;let r=this.cameraPosition,i=this.getRayDirectionFromPixel(e),a=XY(r,i,1+n.maxElevation/KK);if(!a)return null;let o=XY(r,i,1+n.minElevation/KK),s=Math.max(a.tMin,0),c=o?o.tMin:a.tMax;if(c<=s)return null;let l={index:n,exaggeration:t.exaggeration,origin:r,direction:i},u=0;for(let e=0;e<=256;e++){let t=s+(c-s)*e/256;if(jJe(l,t)){let{hi:e}=iJe(l,jJe,u,t,1e-12),{sample:n,mercator:r}=AJe(l,e);return new $K(r.x,r.y,n.elevation)}u=t}return null}screenPointToLocation(e,t){return this.screenPointToMercatorCoordinate(e,t)?.toLngLat()}screenPointToLocationAtElevation(e,t){return this.screenPointToLocation(e)}isPointOnMapSurface(e,t){let n=this._cameraPosition;return!!XY(n,this.getRayDirectionFromPixel(e))}getRayDirectionFromPixel(e){let t=HR();t[0]=e.x/this.width*2-1,t[1]=(e.y/this.height*2-1)*-1,t[2]=1,t[3]=1,kR(t,t,this._globeViewProjMatrixF64Inverted),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3];let n=UR();n[0]=t[0]-this._cameraPosition[0],n[1]=t[1]-this._cameraPosition[1],n[2]=t[2]-this._cameraPosition[2];let r=UR();return bR(r,n),r}isSurfacePointVisible(e){let t=this._cachedClippingPlane;return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;let t=HR();return kR(t,[...e,1],this._globeViewProjMatrixF64),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3],t[0]>-1&&t[0]<1&&t[1]>-1&&t[1]<1&&t[2]>-1&&t[2]<1}unprojectScreenPoint(e){let t=this._cameraPosition,n=this.getRayDirectionFromPixel(e),r=XY(t,n);if(r){let e=UR();_R(e,t,[n[0]*r.tMin,n[1]*r.tMin,n[2]*r.tMin]);let i=UR();return bR(i,e),GY(i)}let i=this._cachedClippingPlane,a=i[0]*n[0]+i[1]*n[1]+i[2]*n[2],o=-JR(i,t)/a,s=UR();if(o>0)_R(s,t,[n[0]*o,n[1]*o,n[2]*o]);else{let e=UR();_R(e,t,[n[0]*2,n[1]*2,n[2]*2]);let r=JR(this._cachedClippingPlane,e);DR(s,e,[this._cachedClippingPlane[0]*r,this._cachedClippingPlane[1]*r,this._cachedClippingPlane[2]*r])}let c=xJe(i);return GY(SJe(c.center,c.radius,s))}getProjectionDataForCustomLayer(e=!0){let t=this.getProjectionData({overscaledTileID:new Dq(0,0,0,0,0),applyGlobeMatrix:e});return t.tileMercatorCoords=[0,0,1,1],t}getFastPathSimpleProjectionMatrix(e){}};function AJe(e,t){let n=UR();yR(n,e.origin,e.direction,t);let r=hR(n),i=UR();vR(i,n,1/r);let a=GY(i),o=$K.fromLngLat(a),s=new $K(o.x,iz(o.y,0,.999999999)),c=nJe(e.index,e.exaggeration,s.x,s.y),l=Math.abs(a.lat)>85.051129?0:c.elevation;return{sample:{covered:c.covered,elevation:l},radius:r,mercator:s}}function jJe(e,t){let{sample:n,radius:r}=AJe(e,t);return rJe(n,(r-1)*KK)}var MJe=class e{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,n){this._helper.interpolatePadding(e,t,n)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,n=!0){this._helper.resize(e,t,n)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(e){this._globeness=e,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(e){this._globeness=1,this.defaultConstrain=(e,t)=>this.currentTransform.defaultConstrain(e,t),this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new IY({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._globeness=1,this._mercatorTransform=new LY,this._verticalPerspectiveTransform=new kJe}clone(){let t=new e;return t._globeness=this._globeness,t.apply(this,!1),t}apply(e,t){this._helper.apply(e,t),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(e){let t=this._mercatorTransform.getProjectionData(e),n=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?n.mainMatrix:t.mainMatrix,clippingPlane:n.clippingPlane,tileMercatorCoords:n.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:t.fallbackMatrix,clipAntimeridian:n.clipAntimeridian}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return tz(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return tz(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,t,n){return tz(this._mercatorTransform.getPitchedTextCorrection(e,t,n),this._verticalPerspectiveTransform.getPitchedTextCorrection(e,t,n),this._globeness)}projectTileCoordinates(e,t,n,r){return this.currentTransform.projectTileCoordinates(e,t,n,r)}_calcMatrices(){!this._helper._width||!this._helper._height||(this._verticalPerspectiveTransform.apply(this,!1),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this.currentTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,t){return this.currentTransform.lngLatToCameraDepth(e,t)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(e,t,n,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,n,r)}setLocationAtPoint(e,t,n){if(!this.isGlobeRendering){this._mercatorTransform.setLocationAtPoint(e,t,n),this.apply(this._mercatorTransform,!1);return}this._verticalPerspectiveTransform.setLocationAtPoint(e,t,n),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(e,t){return this.currentTransform.locationToScreenPoint(e,t)}screenPointToMercatorCoordinate(e,t){return this.currentTransform.screenPointToMercatorCoordinate(e,t)}screenTerrainPointToMercatorCoordinate(e,t){return this.currentTransform.screenTerrainPointToMercatorCoordinate(e,t)}screenPointToLocation(e,t){return this.currentTransform.screenPointToLocation(e,t)}screenPointToLocationAtElevation(e,t){return this.currentTransform.screenPointToLocationAtElevation(e,t)}
vendor: 16,060 bytes, line 1207
1207isPointOnMapSurface(e,t){return this.currentTransform.isPointOnMapSurface(e,t)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getProjectionDataForCustomLayer(e=!0){let t=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return t;let n=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return n.fallbackMatrix=t.mainMatrix,n.projectionTransition=this._globeness,n}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}},NJe=class e{get useGlobeControls(){return!0}handlePanInertia(e,t){let n=wJe(e,t);return Math.abs(n.lng-t.center.lng)>180&&(n.lng=t.center.lng+179.5*Math.sign(n.lng-t.center.lng)),{easingCenter:n,easingOffset:new K(0,0)}}handleMapControlsRollPitchBearingZoom(e,t){let n=e.around,r=t.screenPointToLocation(n);e.bearingDelta&&t.setBearing(t.bearing+e.bearingDelta),e.pitchDelta&&t.setPitch(t.pitch+e.pitchDelta),e.rollDelta&&t.setRoll(t.roll+e.rollDelta);let i=t.zoom;e.zoomDelta&&t.setZoom(t.zoom+e.zoomDelta);let a=t.zoom-i;if(a===0)return;let o=ZR(t.center.lng,r.lng),s=o/(Math.abs(o/180)+1),c=ZR(t.center.lat,r.lat),l=t.getRayDirectionFromPixel(n),u=t.cameraPosition,d=xR(u,l)*-1,f=UR();_R(f,u,[l[0]*d,l[1]*d,l[2]*d]);let p=hR(f),m=p-1,h=Math.exp(-Math.max(m-.3,0)*.5),g=ez(p,.95,.999,0,1),_=ez(WY(t.worldSize,t.center.lat)/Math.min(t.width,t.height),.9,.5,1,.25),v=Math.min(h,tz(1,_,g)),y=(1-lz(-a))*v,b=t.center.lat,x=t.zoom,S=new qK(t.center.lng+s*y,iz(t.center.lat+c*y,-kz,kz));t.setLocationAtPoint(r,n);let C=t.center,w=ez(Math.abs(o),45,85,0,1),T=Math.max(w,g)**.25,E=ZR(C.lng,S.lng),D=ZR(C.lat,S.lat);t.setCenter(new qK(C.lng+E*T,C.lat+D*T).wrap()),t.setZoom(x+JY(b,t.center.lat))}handleMapControlsPan(e,t,n){e.panDelta&&yJe(t,n,t.isPointOnMapSurface(e.around)?e.around:t.centerPoint,e.panDelta)}cameraForBoxAndBearing(t,n,r,i,a){let o=sJe(t,n,r,i,a),s=n.left/a.width*2-1,c=(a.width-n.right)/a.width*2-1,l=n.top/a.height*-2+1,u=(a.height-n.bottom)/a.height*-2+1,d=ZR(r.getWest(),r.getEast())<0,f=d?r.getEast():r.getWest(),p=d?r.getWest():r.getEast(),m=Math.max(r.getNorth(),r.getSouth()),h=Math.min(r.getNorth(),r.getSouth()),g=f+ZR(f,p)*.5,_=m+ZR(m,h)*.5,v=a.clone();v.setCenter(o.center),v.setBearing(o.bearing),v.setPitch(0),v.setRoll(0),v.setZoom(o.zoom);let y=v.modelViewProjectionMatrix,b=[UY(r.getNorthWest()),UY(r.getNorthEast()),UY(r.getSouthWest()),UY(r.getSouthEast()),UY(new qK(p,_)),UY(new qK(f,_)),UY(new qK(g,m)),UY(new qK(g,h))],x=UY(o.center),S=1/0;for(let t of b)s<0&&(S=e.getLesserNonNegativeNonNull(S,e.solveVectorScale(t,x,y,`x`,s))),c>0&&(S=e.getLesserNonNegativeNonNull(S,e.solveVectorScale(t,x,y,`x`,c))),l>0&&(S=e.getLesserNonNegativeNonNull(S,e.solveVectorScale(t,x,y,`y`,l))),u<0&&(S=e.getLesserNonNegativeNonNull(S,e.solveVectorScale(t,x,y,`y`,u)));if(!Number.isFinite(S)||S===0){aJe();return}return o.zoom=Math.min(v.zoom+uz(S),t.maxZoom),o}handleJumpToCenterZoom(e,t){let n=e.center.lat,r=e.applyConstrain(t.center?qK.convert(t.center):e.center,e.zoom).center;e.setCenter(r.wrap());let i=t.zoom===void 0?e.zoom+JY(n,r.lat):+t.zoom;e.zoom!==i&&e.setZoom(i)}handleEaseTo(e,t){let n=e.zoom,r=e.center,i=e.padding,a={roll:e.roll,pitch:e.pitch,bearing:e.bearing},o={roll:t.roll===void 0?e.roll:t.roll,pitch:t.pitch===void 0?e.pitch:t.pitch,bearing:t.bearing===void 0?e.bearing:t.bearing},s=t.zoom!==void 0,c=!e.isPaddingEqual(t.padding),l=!1,u=t.center?qK.convert(t.center):r,d=e.applyConstrain(u,n).center;FY(e,d);let f=e.clone();f.setCenter(d),f.setZoom(s?+t.zoom:n+JY(r.lat,u.lat)),f.setBearing(t.bearing);let p=new K(iz(e.centerPoint.x+t.offsetAsPoint.x,0,e.width),iz(e.centerPoint.y+t.offsetAsPoint.y,0,e.height));f.setLocationAtPoint(d,p);let m=(t.offset&&t.offsetAsPoint.mag())>0?f.center:d,h=s?+t.zoom:n+JY(r.lat,m.lat),g=n+JY(r.lat,0),_=h+JY(m.lat,0),v=ZR(r.lng,m.lng),y=ZR(r.lat,m.lat),b=lz(_-g);return l=h!==n,{easeFunc:n=>{if(Ez(a,o)||oJe({startEulerAngles:a,endEulerAngles:o,tr:e,k:n,useSlerp:a.roll!=o.roll}),c&&e.interpolatePadding(i,t.padding,n),t.around)_z(`Easing around a point is not supported under globe projection.`),e.setLocationAtPoint(t.around,t.aroundPoint);else{let t=n*(_>g?Math.min(2,b):Math.max(.5,b))**(1-n),i=TJe(r,v,y,t);e.setCenter(i.wrap())}if(l){let t=_V.number(g,_,n)+JY(0,e.center.lat);e.setZoom(t)}},isZooming:l,elevationCenter:m}}handleFlyTo(e,t){let n=t.zoom!==void 0,r=e.center,i=e.zoom,a=e.padding,o=!e.isPaddingEqual(t.padding),s=e.applyConstrain(qK.convert(t.center||t.locationAtOffset),i).center,c=n?+t.zoom:e.zoom+JY(e.center.lat,s.lat),l=e.clone();l.setCenter(s),l.setZoom(c),l.setBearing(t.bearing);let u=new K(iz(e.centerPoint.x+t.offsetAsPoint.x,0,e.width),iz(e.centerPoint.y+t.offsetAsPoint.y,0,e.height));l.setLocationAtPoint(s,u);let d=l.center;FY(e,d);let f=pJe(e,r,d),p=i+JY(r.lat,0),m=c+JY(d.lat,0),h=lz(m-p),g=typeof t.minZoom==`number`?+t.minZoom:e.minZoom,_=Math.max(g,e.minZoom)+JY(d.lat,0),v=Math.min(_,p,m)+JY(0,d.lat),y=lz(e.applyConstrain(d,v).zoom+JY(d.lat,0)-p),b=ZR(r.lng,d.lng),x=ZR(r.lat,d.lat);return{easeFunc:(n,i,s,l)=>{let u=TJe(r,b,x,s);o&&e.interpolatePadding(a,t.padding,n);let f=n===1?d:u;e.setCenter(f.wrap());let m=p+uz(i);e.setZoom(n===1?c:m+JY(0,f.lat))},scaleOfZoom:h,targetCenter:d,scaleOfMinZoom:y,pixelPathLength:f}}static solveVectorScale(e,t,n,r,i){let a=i,o=r===`x`?[n[0],n[4],n[8],n[12]]:[n[1],n[5],n[9],n[13]],s=[n[3],n[7],n[11],n[15]],c=e[0]*o[0]+e[1]*o[1]+e[2]*o[2],l=e[0]*s[0]+e[1]*s[1]+e[2]*s[2],u=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],d=t[0]*s[0]+t[1]*s[1]+t[2]*s[2],f=(u+o[3]-a*d-a*s[3])/(u-c-a*d+a*l);return u+a*l===c+a*d||s[3]*(c-u)+o[3]*(d-l)+c*d===u*l?null:f}static getLesserNonNegativeNonNull(e,t){return t!==null&&t>=0&&t<e?t:e}},PJe=class{constructor(e){this._globe=e,this._mercatorCameraHelper=new BY,this._verticalPerspectiveCameraHelper=new NJe}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(e,t){return this.currentHelper.handlePanInertia(e,t)}handleMapControlsRollPitchBearingZoom(e,t){this.currentHelper.handleMapControlsRollPitchBearingZoom(e,t)}handleMapControlsPan(e,t,n){this.currentHelper.handleMapControlsPan(e,t,n)}cameraForBoxAndBearing(e,t,n,r,i){return this.currentHelper.cameraForBoxAndBearing(e,t,n,r,i)}handleJumpToCenterZoom(e,t){this.currentHelper.handleJumpToCenterZoom(e,t)}handleEaseTo(e,t){return this.currentHelper.handleEaseTo(e,t)}handleFlyTo(e,t){return this.currentHelper.handleFlyTo(e,t)}};function FJe(e,t,n){let r={constrainOverride:t};if(Array.isArray(e)){let t=new dJe({type:e},n);return{projection:t,transform:new MJe(r),cameraHelper:new PJe(t)}}switch(e){case`mercator`:return{projection:new PY,transform:new LY(r),cameraHelper:new BY};case`globe`:{let e=new dJe({type:[`interpolate`,[`linear`],[`zoom`],11,`vertical-perspective`,12,`mercator`]},{});return{projection:e,transform:new MJe(r),cameraHelper:new PJe(e)}}case`vertical-perspective`:return{projection:new uJe,transform:new kJe(r),cameraHelper:new NJe};default:return _z(`Unknown projection name: ${e}. Falling back to mercator projection.`),{projection:new PY,transform:new LY(r),cameraHelper:new BY}}}var IJe=DIe(),LJe=class extends Jz{constructor(e,t={}){super(),this._rtlPluginLoaded=()=>{for(let e in this.tileManagers){let t=this.tileManagers[e].getSource().type;(t===`vector`||t===`geojson`)&&this.tileManagers[e].reload()}},this.map=e,this.dispatcher=new AGe(kGe(),e._getMapId()),this.dispatcher.registerMessageHandler(`GG`,(e,t)=>this.getGlyphs(e,t)),this.dispatcher.registerMessageHandler(`GI`,(e,t)=>this.getImages(e,t)),this.dispatcher.registerMessageHandler(`GDA`,(e,t)=>this.getDashes(e,t)),this.imageManager=new aGe,this.imageManager.setEventedParent(this),this.imageManager.setMissingImageResolver(e._missingStyleImageResolver),this.patternAtlas=new oGe(this.imageManager);let n=e._container?.lang||typeof document<`u`&&document.documentElement?.lang||void 0;this.glyphManager=new fGe(e._requestManager,t.localIdeographFontFamily,n),this.lineAtlas=new yGe(256,512),this.crossTileSymbolIndex=new Aqe,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast(`SR`,Bz()),sY().on(oY,this._rtlPluginLoaded),this.on(`data`,e=>{if(e.dataType!==`source`||e.sourceDataType!==`metadata`)return;let t=this.tileManagers[e.sourceId];if(!t)return;let n=t.getSource();if(n?.vectorLayerIds)for(let e in this._layers){let t=this._layers[e];t.source===n.id&&this._validateLayer(t)}})}_setInitialValues(){this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new KU,this._imagesListDirty=!1,this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new((this.crossTileSymbolIndex?.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(e,t){this._checkLoaded();let n=t===null?this.stylesheet.state?.[e]?.default??null:t;if(mz(n,this._globalState[e]))return this;this._globalState[e]=n,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();let t=[];for(let n in e)mz(this._globalState[n],e[n].default)||(t.push(n),this._globalState[n]=e[n].default);this._applyGlobalStateChanges(t)}_applyGlobalStateChanges(e){if(e.length===0)return;let t=new Set,n={};for(let r of e){n[r]=this._globalState[r];for(let e in this._layers){let n=this._layers[e],i=n.getLayoutAffectingGlobalStateRefs(),a=n.getPaintAffectingGlobalStateRefs(),o=n.getVisibilityAffectingGlobalStateRefs();if(i.has(r)&&t.add(n.source),a.has(r))for(let{name:e,value:t}of a.get(r))this._updatePaintProperty(n,e,t);o?.has(r)&&(n.recalculateVisibility(),this._updateLayer(n))}}this.dispatcher.broadcast(`UGS`,n);for(let e in this.tileManagers)t.has(e)&&(this._reloadSource(e),this._changed=!0)}async loadURL(e,t={},n){this.fire(new HJ(`dataloading`)),t.validate=typeof t.validate!=`boolean`||t.validate,this._loadStyleRequest=new AbortController;let r=this._loadStyleRequest;try{let i=await this.map._requestManager.transformRequest(e,`Style`);Fz(r.signal);let a=await Hz(i,r);this._loadStyleRequest===r&&(this._loadStyleRequest=null),this._load(a.data,t,n)}catch(e){this._loadStyleRequest===r&&(this._loadStyleRequest=null),e&&!r.signal.aborted&&this.fire(new qz(VR(e)))}}loadJSON(e,t={},n){this.fire(new HJ(`dataloading`)),this._frameRequest=new AbortController,IJ.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,t.validate=t.validate!==!1,this._load(e,t,n)}).catch(()=>{})}loadEmpty(){this.fire(new HJ(`dataloading`)),this._load(IJe,{validate:!1})}_load(e,t,n){let r=t.transformStyle?t.transformStyle(n,e):e;if(!(t.validate&&FU(this,r))){r={...r},this._loaded=!0,this.stylesheet=r;for(let e in r.sources)this.addSource(e,r.sources[e],{validate:!1});r.sprite?this._loadSprite(r.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(r.glyphs),this._createLayers(),this.light=new hGe(this.stylesheet.light??{},this._globalState),this._setProjectionInternal(this.stylesheet.projection?.type||`mercator`),this.sky=new vGe(this.stylesheet.sky,this._globalState),this.map.setTerrain(this.stylesheet.terrain??null,{validate:!1}),this.fire(new HJ(`data`)),this.fire(new XWe)}}_createLayers(){let e=Yz(this.stylesheet.layers);this.setGlobalState(this.stylesheet.state??null),this.dispatcher.broadcast(`SL`,e),this._order=e.map(e=>e.id),this._layers={},this._serializedLayers=null;for(let t of e){let e=wq(t,this._globalState);if(e.setEventedParent(this,{layer:{id:t.id}}),this._layers[t.id]=e,gW(e)&&this.tileManagers[e.source]){let n=t.paint?.[`raster-fade-duration`]??e.paint.get(`raster-fade-duration`);this.tileManagers[e.source].setRasterFadeDuration(n)}}}async _loadSprite(e,t=!1,n=void 0){this.imageManager.setLoaded(!1);let r=new AbortController;this._spriteRequest=r;let i;try{let n=await rGe(e,this.map._requestManager,this.map.getPixelRatio(),r);if(!n)return;for(let e in n){let{loaded:r,removed:i}=this.imageManager.setSpriteImages(e,n[e]);this._markImagesChanged(i),t&&this._markImagesChanged(r)}}catch(e){i=e,r.signal.aborted||this.fire(new qz(i))}finally{this._spriteRequest=null,this.imageManager.setLoaded(!0),t&&(this._changed=!0),this.dispatcher.broadcast(`SI`,this.imageManager.listImages()),this.fire(new HJ(`data`)),n?.(i)}}_unloadSprite(){this._markImagesChanged(this.imageManager.removeAllSpriteImages()),this._imagesListDirty=!0,this._changed=!0,this.fire(new HJ(`data`))}_validateLayer(e){let t=this.tileManagers[e.source];if(!t)return;let n=e.sourceLayer;if(!n)return;let r=t.getSource();(r.type===`geojson`||r.vectorLayerIds&&!r.vectorLayerIds.includes(n))&&this.fire(new qz(Error(`Source layer "${n}" does not exist on source "${r.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.tileManagers)if(!this.tileManagers[e].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(e,t=!1){let n=this._serializedAllLayers();if(!e||e.length===0)return Object.values(t?hz(n):n);let r=[];for(let i of e)if(n[i]){let e=t?hz(n[i]):n[i];r.push(e)}return r}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};let t=Object.keys(this._layers);for(let n of t){let t=this._layers[n];t.type!==`custom`&&(e[n]=t.serialize())}return e}hasTransitions(){if(this.light?.hasTransition()||this.sky?.hasTransition()||this.projection?.hasTransition())return!0;for(let e in this.tileManagers)if(this.tileManagers[e].hasTransition())return!0;for(let e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error(`Style is not done loading.`)}update(e){if(!this._loaded)return;let t=this._changed;if(t){this._imagesListDirty&&=(this.dispatcher.broadcast(`SI`,this.imageManager.listImages()),!1);let t=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);(t.length||n.length)&&this._updateWorkerLayers(t,n);for(let e in this._updatedSources){let t=this._updatedSources[e];if(t===`reload`)this._reloadSource(e);else if(t===`clear`)this._clearSource(e);else throw Error(`Invalid action ${t}`)}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}let n={};for(let e in this.tileManagers){let t=this.tileManagers[e];n[e]=t.used,t.used=!1}let r=this.imageManager.listImages();for(let t of this._order){let n=this._layers[t];n.recalculate(e,r),!n.isHidden(e.zoom)&&n.source&&(this.tileManagers[n.source].used=!0)}for(let e in n){let t=this.tileManagers[e];!!n[e]!=!!t.used&&t.fire(new UJ(`data`,{sourceDataType:`visibility`,sourceId:e}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,t&&this.fire(new HJ(`data`))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies([`icons`,`patterns`],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies([`glyphs`],[``]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast(`UL`,{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,t={}){this._checkLoaded();let n=this.serialize();if(e=t.transformStyle?t.transformStyle(n,e):e,(t.validate??!0)&&FU(this,e))return!1;
vendor: 4,264 bytes, line 1207
1207e=hz(e),e.layers=Yz(e.layers);let r=JPe(n,e),i=this._getOperationsToPerform(r);if(i.unimplemented.length>0)throw Error(`Unimplemented: ${i.unimplemented.join(`, `)}.`);if(i.operations.length===0)return!1;for(let e of i.operations)e();return this.stylesheet=e,this._serializedLayers=null,this.fire(new XWe({style:this})),!0}_getOperationsToPerform(e){let t=[],n=[];for(let r of e)switch(r.command){case`setCenter`:case`setZoom`:case`setBearing`:case`setPitch`:case`setRoll`:continue;case`addLayer`:t.push(()=>this.addLayer.apply(this,r.args));break;case`removeLayer`:t.push(()=>this.removeLayer.apply(this,r.args));break;case`setPaintProperty`:t.push(()=>this.setPaintProperty.apply(this,r.args));break;case`setLayoutProperty`:t.push(()=>this.setLayoutProperty.apply(this,r.args));break;case`setFilter`:t.push(()=>this.setFilter.apply(this,r.args));break;case`addSource`:t.push(()=>this.addSource.apply(this,r.args));break;case`removeSource`:t.push(()=>this.removeSource.apply(this,r.args));break;case`setLayerZoomRange`:t.push(()=>this.setLayerZoomRange.apply(this,r.args));break;case`setLight`:t.push(()=>this.setLight.apply(this,r.args));break;case`setGeoJSONSourceData`:t.push(()=>this.setGeoJSONSourceData.apply(this,r.args));break;case`setGlyphs`:t.push(()=>this.setGlyphs.apply(this,r.args));break;case`setSprite`:t.push(()=>this.setSprite.apply(this,r.args));break;case`setTerrain`:t.push(()=>this.map.setTerrain.apply(this,r.args));break;case`setSky`:t.push(()=>this.setSky.apply(this,r.args));break;case`setProjection`:this.setProjection.apply(this,r.args);break;case`setGlobalState`:t.push(()=>this.setGlobalState.apply(this,r.args));break;case`setTransition`:t.push(()=>{});break;default:n.push(r.command)}return{operations:t,unimplemented:n}}addImage(e,t){if(this.getImage(e)){this.fire(new qz(Error(`An image named "${e}" already exists.`)));return}this.imageManager.addImage(e,t),this._afterImageUpdated(e)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}setMissingImageResolver(e){this.imageManager.setMissingImageResolver(e)}removeImage(e){if(!this.getImage(e)){this.fire(new qz(Error(`An image named "${e}" does not exist.`)));return}this.imageManager.removeImage(e),this._afterImageUpdated(e)}_markImagesChanged(e){for(let t of e)this._changedImages[t]=!0}_afterImageUpdated(e){this._changedImages[e]=!0,this._imagesListDirty=!0,this._changed=!0,this.fire(new HJ(`data`))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,t,n={}){if(this._checkLoaded(),this.tileManagers[e]!==void 0)throw Error(`Source "${e}" already exists.`);if(!t.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(t).join(`, `)}.`);if(PU.has(t.type)&&this._validate(NU.source,`sources.${e}`,t,null,n))return;this.map?._collectResourceTiming&&(t.collectResourceTiming=!0);let r=this.tileManagers[e]=new dY(e,t,this.dispatcher);r.style=this,r.setEventedParent(this,()=>({isSourceLoaded:r.loaded(),source:r.serialize(),sourceId:e})),r.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);for(let t in this._layers)if(this._layers[t].source===e)return this.fire(new qz(Error(`Source "${e}" cannot be removed while layer "${t}" is using it.`)));let t=this.tileManagers[e];delete this.tileManagers[e],delete this._updatedSources[e],t.fire(new UJ(`data`,{sourceDataType:`metadata`,sourceId:e})),t.setEventedParent(null),t.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);let n=this.tileManagers[e].getSource();if(n.type!==`geojson`)throw Error(`geojsonSource.type is ${n.type}, which is !== 'geojson`);n.setData(t),this._changed=!0}getSource(e){return this.tileManagers[e]?.getSource()}addLayer(e,t,n={}){this._checkLoaded();let r=e.id;if(this.getLayer(r)){this.fire(new qz(Error(`Layer "${r}" already exists on this map.`)));return}let i;if(e.type===`custom`){if(IU(this,XBe(e)))return;i=wq(e,this._globalState)}else{if(`source`in e&&typeof e.source==`object`&&(this.addSource(r,e.source),e=hz(e),e=oz(e,{source:r}
vendor: 21,323 bytes, lines 1207-1209
1207)),this._validate(NU.layer,`layers.${r}`,e,{arrayIndex:-1},n))return;i=wq(e,this._globalState),this._validateLayer(i),i.setEventedParent(this,{layer:{id:r}})}let a=t?this._order.indexOf(t):this._order.length;if(t&&a===-1){this.fire(new qz(Error(`Cannot add layer "${r}" before non-existing layer "${t}".`)));return}if(this._order.splice(a,0,r),this._layerOrderChanged=!0,this._layers[r]=i,this._removedLayers[r]&&i.source&&i.type!==`custom`){let e=this._removedLayers[r];delete this._removedLayers[r],e.type===i.type?(this._updatedSources[i.source]=`reload`,this.tileManagers[i.source].pause()):this._updatedSources[i.source]=`clear`}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}moveLayer(e,t){if(this._checkLoaded(),this._changed=!0,!this._layers[e]){this.fire(new qz(Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));return}if(e===t)return;let n=this._order.indexOf(e);this._order.splice(n,1);let r=t?this._order.indexOf(t):this._order.length;if(t&&r===-1){this.fire(new qz(Error(`Cannot move layer "${e}" before non-existing layer "${t}".`)));return}this._order.splice(r,0,e),this._layerOrderChanged=!0}removeLayer(e){this._checkLoaded();let t=this._layers[e];if(!t){this.fire(new qz(Error(`Cannot remove non-existing layer "${e}".`)));return}t.setEventedParent(null);let n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=t,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],t.onRemove&&t.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,t,n){this._checkLoaded();let r=this.getLayer(e);if(!r){this.fire(new qz(Error(`Cannot set the zoom range of non-existing layer "${e}".`)));return}(r.minzoom!==t||r.maxzoom!==n)&&(t!=null&&(r.minzoom=t),n!=null&&(r.maxzoom=n),this._updateLayer(r))}setFilter(e,t,n={}){this._checkLoaded();let r=this.getLayer(e);if(!r){this.fire(new qz(Error(`Cannot filter non-existing layer "${e}".`)));return}if(!mz(r.filter,t)){if(t==null){r.setFilter(void 0),this._updateLayer(r);return}this._validate(NU.filter,`layers.${r.id}.filter`,t,null,n)||(r.setFilter(hz(t)),this._updateLayer(r))}}getFilter(e){return hz(this.getLayer(e).filter)}setLayoutProperty(e,t,n,r={}){this._checkLoaded();let i=this.getLayer(e);if(!i){this.fire(new qz(Error(`Cannot style non-existing layer "${e}".`)));return}mz(i.getLayoutProperty(t),n)||(i.setLayoutProperty(t,n,r),this._updateLayer(i))}getLayoutProperty(e,t){let n=this.getLayer(e);if(!n){this.fire(new qz(Error(`Cannot get style of non-existing layer "${e}".`)));return}return n.getLayoutProperty(t)}setPaintProperty(e,t,n,r={}){this._checkLoaded();let i=this.getLayer(e);if(!i){this.fire(new qz(Error(`Cannot style non-existing layer "${e}".`)));return}mz(i.getPaintProperty(t),n)||this._updatePaintProperty(i,t,n,r)}_updatePaintProperty(e,t,n,r={}){e.setPaintProperty(t,n,r)&&this._updateLayer(e),gW(e)&&t===`raster-fade-duration`&&this.tileManagers[e.source].setRasterFadeDuration(n),this._changed=!0,this._updatedPaintProps[e.id]=!0,this._serializedLayers=null}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,t){this._checkLoaded();let n=e.source,r=e.sourceLayer,i=this.tileManagers[n];if(i===void 0){this.fire(new qz(Error(`The source '${n}' does not exist in the map's style.`)));return}let a=i.getSource().type;if(a===`geojson`&&r){this.fire(new qz(Error(`GeoJSON sources cannot have a sourceLayer parameter.`)));return}if(a===`vector`&&!r){this.fire(new qz(Error(`The sourceLayer parameter must be provided for vector source types.`)));return}if(e.id===void 0){this.fire(new qz(Error(`The feature id parameter must be provided.`)));return}let o=[`__proto__`,`constructor`,`prototype`];if(t&&Object.keys(t).some(e=>o.includes(e))){this.fire(new qz(Error(`The feature state should not include one of the following keys: ${o}`)));return}i.setFeatureState(r,e.id,t)}removeFeatureState(e,t){this._checkLoaded();let n=e.source,r=this.tileManagers[n];if(r===void 0){this.fire(new qz(Error(`The source '${n}' does not exist in the map's style.`)));return}let i=r.getSource().type,a=i===`vector`?e.sourceLayer:void 0;if(i===`vector`&&!a){this.fire(new qz(Error(`The sourceLayer parameter must be provided for vector source types.`)));return}if(t&&typeof e.id!=`string`&&typeof e.id!=`number`){this.fire(new qz(Error(`A feature id is required to remove its specific state property.`)));return}r.removeFeatureState(a,e.id,t)}getFeatureState(e){this._checkLoaded();let t=e.source,n=e.sourceLayer,r=this.tileManagers[t];if(r===void 0){this.fire(new qz(Error(`The source '${t}' does not exist in the map's style.`)));return}if(r.getSource().type===`vector`&&!n){this.fire(new qz(Error(`The sourceLayer parameter must be provided for vector source types.`)));return}return e.id===void 0&&this.fire(new qz(Error(`The feature id parameter must be provided.`))),r.getFeatureState(n,e.id)}getTransition(){return oz({duration:300,delay:0},this.stylesheet?.transition)}serialize(){if(!this._loaded)return;let e=fz(this.tileManagers,e=>e.serialize()),t=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,r=this.stylesheet;return pz({version:r.version,name:r.name,metadata:r.metadata,light:r.light,sky:r.sky,center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch,sprite:r.sprite,glyphs:r.glyphs,transition:r.transition,projection:r.projection,sources:e,layers:t,terrain:n},e=>e!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.tileManagers[e.source].getSource().type!==`raster`&&(this._updatedSources[e.source]=`reload`,this.tileManagers[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let t=e=>this._layers[e].type===`fill-extrusion`,n={},r=[];for(let i=this._order.length-1;i>=0;i--){let a=this._order[i];if(t(a)){n[a]=i;for(let t of e){let e=t[a];if(e)for(let t of e)r.push(t)}}}r.sort((e,t)=>t.intersectionZ-e.intersectionZ);let i=[];for(let a=this._order.length-1;a>=0;a--){let o=this._order[a];if(t(o))for(let e=r.length-1;e>=0;e--){let t=r[e].feature;if(n[t.layer.id]<a)break;i.push(t),r.pop()}else for(let t of e){let e=t[o];if(e)for(let t of e)i.push(t.feature)}}return i}queryRenderedFeatures(e,t,n){t?.filter&&this._validate(NU.filter,`queryRenderedFeatures.filter`,t.filter,null,t);let r={};if(t?.layers){if(!(Array.isArray(t.layers)||t.layers instanceof Set))return this.fire(new qz(Error(`parameters.layers must be an Array or a Set of strings`))),[];for(let e of t.layers){let t=this._layers[e];if(!t)return this.fire(new qz(Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];r[t.source]=!0}}let i=[];t.availableImages=this.imageManager.listImages();let a=this._serializedAllLayers(),o=t.layers instanceof Set?t.layers:Array.isArray(t.layers)?new Set(t.layers):null,s={...t,layers:o,globalState:this._globalState};for(let o in this.tileManagers)t.layers&&!r[o]||i.push(PGe(this.tileManagers[o],this._layers,a,e,s,n,this.map.terrain?(e,t,n)=>this.map.terrain.getElevation(e,t,n):void 0));return this.placement&&i.push(FGe(this._layers,a,this.tileManagers,e,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(i)}querySourceFeatures(e,t){t?.filter&&this._validate(NU.filter,`querySourceFeatures.filter`,t.filter,null,t);let n=this.tileManagers[e];return n?IGe(n,t?{...t,globalState:this._globalState}:{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,t={}){this._checkLoaded();let n=this.light.getLight(),r=!1;for(let t in e)if(!mz(e[t],n[t])){r=!0;break}if(!r)return;let i={now:LJ(),transition:oz({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,t),this.light.updateTransitions(i)}getProjection(){return this.stylesheet?.projection}setProjection(e){this._checkLoaded();let t=e??{type:`mercator`};if(this.stylesheet.projection=e,this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(t.type)}getSky(){return this.stylesheet?.sky}setSky(e,t={}){this._checkLoaded();let n=this.getSky(),r=!1;if(!e&&!n)return;if(e&&!n)r=!0;else if(!e&&n)r=!0;else for(let t in e)if(!mz(e[t],n[t])){r=!0;break}if(!r)return;let i={now:LJ(),transition:oz({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,t),this.sky.updateTransitions(i)}_setProjectionInternal(e){let t=FJe(e,this.map._camera?.transform.constrainOverride,this._globalState);this.projection=t.projection,this.map.migrateProjection(t.transform,t.cameraHelper);for(let e in this.tileManagers)this.tileManagers[e].reload()}_validate(e,t,n,r,i={}){return LU(this,e,{key:t,style:this.serialize(),value:n,...r},i)}_remove(e=!0){this._frameRequest&&=(this._frameRequest.abort(),null),this._loadStyleRequest&&=(this._loadStyleRequest.abort(),null),this._spriteRequest&&=(this._spriteRequest.abort(),null),sY().off(oY,this._rtlPluginLoaded);for(let e in this._layers)this._layers[e].setEventedParent(null);for(let e in this.tileManagers){let t=this.tileManagers[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast(`RM`,void 0),this.dispatcher.remove(e)}_clearSource(e){this.tileManagers[e].clearTiles()}_reloadSource(e){this.tileManagers[e].resume(),this.tileManagers[e].reload()}_updateSources(e){for(let t in this.tileManagers)this.tileManagers[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(let e in this.tileManagers)this._reloadSource(e)}_updatePlacement(e,t,n,r,i=!1){let a=!1,o=!1,s={};for(let t of this._order){let n=this._layers[t];if(n.type!==`symbol`)continue;if(!s[n.source]){let e=this.tileManagers[n.source];s[n.source]=e.getRenderableIds(!0).map(t=>e.getTileByID(t)).sort((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1))}let r=this.crossTileSymbolIndex.addLayer(n,s[n.source],e.center.lng);a||=r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),i||=this._layerOrderChanged||n===0,(i||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(LJ(),e.zoom))&&(this.pauseablePlacement=new Sqe(e,this.map.terrain,this._order,i,t,n,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(LJ()),o=!0),a&&this.pauseablePlacement.placement.setStale()),o||a)for(let e of this._order){let t=this._layers[e];t.type===`symbol`&&this.placement.updateLayerOpacities(t,s[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(LJ())}_releaseSymbolFadeTiles(){for(let e in this.tileManagers)this.tileManagers[e].releaseSymbolFadeTiles()}async getImages(e,t){let n=await this.imageManager.getImages(t.icons);this._updateTilesForChangedImages();let r=this.tileManagers[t.source];return r&&r.setDependencies(t.tileID.key,t.type,t.icons),n}async getGlyphs(e,t){let n=await this.glyphManager.getGlyphs(t.stacks),r=this.tileManagers[t.source];return r&&r.setDependencies(t.tileID.key,t.type,[``]),n}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,t={}){this._checkLoaded(),!(e&&this._validate(NU.glyphs,`glyphs`,e,null,t))&&(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}async getDashes(e,t){let n={};for(let[e,r]of Object.entries(t.dashes))n[e]=this.lineAtlas.getDash(r.dasharray,r.round);return n}addSprite(e,t,n={},r){this._checkLoaded();let i=[{id:e,url:t}],a=[...qJ(this.stylesheet.sprite),...i];this._validate(NU.sprite,`sprite`,a,null,n)||(this.stylesheet.sprite=a,this._loadSprite(i,!0,r))}removeSprite(e){this._checkLoaded();let t=qJ(this.stylesheet.sprite);if(!t.find(t=>t.id===e)){this.fire(new qz(Error(`Sprite "${e}" doesn't exists on this map.`)));return}let n=this.imageManager.removeSpriteImages(e);this._markImagesChanged(n),t.splice(t.findIndex(t=>t.id===e),1),this.stylesheet.sprite=t.length>0?t:void 0,this._imagesListDirty=!0,this._changed=!0,this.fire(new HJ(`data`))}getSprite(){return qJ(this.stylesheet.sprite)}setSprite(e,t={},n){this._checkLoaded(),!(e&&this._validate(NU.sprite,`sprite`,e,null,t))&&(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,n):(this._unloadSprite(),n&&n(null)))}destroy(){this._frameRequest&&=(this._frameRequest.abort(),null),this._loadStyleRequest&&=(this._loadStyleRequest.abort(),null),this._spriteRequest&&=(this._spriteRequest.abort(),null);for(let e in this.tileManagers){let t=this.tileManagers[e];t.setEventedParent(null),t.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.patternAtlas.destroy()),this.glyphManager&&this.glyphManager.destroy();for(let e in this._layers){let t=this._layers[e];t.setEventedParent(null),t.onRemove&&t.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler(`GG`),this.dispatcher.unregisterMessageHandler(`GI`),this.dispatcher.unregisterMessageHandler(`GDA`),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}},RJe=yW([{name:`a_pos`,type:`Int16`,components:2},{name:`a_texture_pos`,type:`Int16`,components:2}]),zJe=class{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,n,r,i,a,o,s,c){this.context=e;let l=this.boundPaintVertexBuffers.length!==r.length;for(let e=0;!l&&e<r.length;e++)this.boundPaintVertexBuffers[e]!==r[e]&&(l=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==n||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==c?this.freshBind(t,n,r,i,a,o,s,c):(e.bindVertexArray.set(this.vao),o&&o.bind(),i?.dynamicDraw&&i.bind(),s&&s.bind(),c&&c.bind())}freshBind(e,t,n,r,i,a,o,s){let c=e.numAttributes,l=this.context,u=l.gl;this.vao&&this.destroy(),this.vao=l.createVertexArray(),l.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=r,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,t.enableAttributes(u,e);for(let t of n)t.enableAttributes(u,e);a&&a.enableAttributes(u,e),o&&o.enableAttributes(u,e),s&&s.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,i);for(let t of n)t.bind(),t.setVertexAttribPointers(u,e,i);a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),s&&(s.bind(),s.setVertexAttribPointers(u,e,i)),l.currentNumAttributes=c}destroy(){this.vao&&=(this.context.deleteVertexArray(this.vao),null)}},BJe=(e,t)=>({u_depth:new _G(e,t.u_depth),u_terrain:new _G(e,t.u_terrain),u_terrain_dim:new Z(e,t.u_terrain_dim),u_terrain_matrix:new wG(e,t.u_terrain_matrix),u_terrain_unpack:new bG(e,t.u_terrain_unpack),u_terrain_exaggeration:new Z(e,t.u_terrain_exaggeration)}),VJe=(e,t)=>({u_texture:new _G(e,t.u_texture),u_ele_delta:new Z(e,t.u_ele_delta),u_fog_matrix:new wG(e,t.u_fog_matrix),u_fog_color:new xG(e,t.u_fog_color),u_fog_ground_blend:new Z(e,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new Z(e,t.u_fog_ground_blend_opacity),u_horizon_color:new xG(e,t.u_horizon_color),u_horizon_fog_blend:new Z(e,t.u_horizon_fog_blend),u_is_globe_mode:new Z(e,t.u_is_globe_mode)}),HJe=(e,t)=>({u_ele_delta:new Z(e,t.u_ele_delta)}),UJe=(e,t,n,r,i)=>({u_texture:0,u_ele_delta:e,u_fog_matrix:t,u_fog_color:n?n.properties.get(`fog-color`):UB.white,u_fog_ground_blend:n?n.properties.get(`fog-ground-blend`):1,u_fog_ground_blend_opacity:i?0:n?n.calculateFogBlendOpacity(r):0,u_horizon_color:n?n.properties.get(`horizon-color`):UB.white,u_horizon_fog_blend:n?n.properties.get(`horizon-fog-blend`):1,u_is_globe_mode:+!!i}),WJe=e=>({u_ele_delta:e}),GJe=(e,t)=>({u_projection_matrix:new wG(e,t.u_projection_matrix),u_projection_tile_mercator_coords:new bG(e,t.u_projection_tile_mercator_coords),u_projection_clipping_plane:new bG(e,t.u_projection_clipping_plane),u_projection_transition:new Z(e,t.u_projection_transition),u_projection_fallback_matrix:new wG(e,t.u_projection_fallback_matrix),u_projection_clip_antimeridian:new _G(e,t.u_projection_clip_antimeridian)}),KJe=e=>({u_projection_matrix:e.mainMatrix,u_projection_tile_mercator_coords:e.tileMercatorCoords,u_projection_clipping_plane:e.clippingPlane,u_projection_transition:e.projectionTransition,u_projection_fallback_matrix:e.fallbackMatrix,u_projection_clip_antimeridian:+!!e.clipAntimeridian});function eX(e){let t=[];for(let n of e){if(n===null)continue;let e=n.split(` `);t.push(e.pop())}return t}function qJe(e,t){let n=new Set([e.INT,e.INT_VEC2,e.INT_VEC3,e.INT_VEC4,e.UNSIGNED_INT,e.UNSIGNED_INT_VEC2,e.UNSIGNED_INT_VEC3,e.UNSIGNED_INT_VEC4]),r=new Set,i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let a=0;a<i;a++){let i=e.getActiveAttrib(t,a);i&&n.has(i.type)&&r.add(i.name)}return r}var JJe=class{constructor(e,t,n,r,i,a,o,s,c=[]){let l=e.gl;this.program=l.createProgram();let u=eX(t.staticAttributes),d=n?n.getBinderAttributes():[],f=u.concat(d),p=MY.prelude.staticUniforms?eX(MY.prelude.staticUniforms):[],m=o.staticUniforms?eX(o.staticUniforms):[],h=t.staticUniforms?eX(t.staticUniforms):[],g=n?n.getBinderUniforms():[],_=p.concat(m).concat(h).concat(g),v=[];for(let e of _)v.includes(e)||v.push(e);let y=n?n.defines():[];y.unshift(`#version 300 es`),i&&y.push(`#define OVERDRAW_INSPECTOR;`),a&&y.push(`#define TERRAIN3D;`),s&&y.push(s),c&&y.push(...c);let b=y.concat(MY.prelude.fragmentSource,o.fragmentSource,t.fragmentSource).join(`
1208`),x=y.concat(MY.prelude.vertexSource,o.vertexSource,t.vertexSource).join(`
1209`),S=l.createShader(l.FRAGMENT_SHADER);if(l.isContextLost()){this.failedToCreate=!0;return}if(l.shaderSource(S,b),l.compileShader(S),!l.getShaderParameter(S,l.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${l.getShaderInfoLog(S)}`);l.attachShader(this.program,S);let C=l.createShader(l.VERTEX_SHADER);if(l.isContextLost()){this.failedToCreate=!0;return}if(l.shaderSource(C,x),l.compileShader(C),!l.getShaderParameter(C,l.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${l.getShaderInfoLog(C)}`);l.attachShader(this.program,C),this.attributes={};let w={};if(this.numAttributes=f.length,l.linkProgram(this.program),!l.getProgramParameter(this.program,l.LINK_STATUS))throw Error(`Program failed to link: ${l.getProgramInfoLog(this.program)}`);let T=qJe(l,this.program);for(let e of f){if(!e)continue;let t=l.getAttribLocation(this.program,e);t>=0&&(this.attributes[e]={location:t,isInteger:T.has(e)})}l.deleteShader(C),l.deleteShader(S);for(let e of v)if(e&&!w[e]){let t=l.getUniformLocation(this.program,e);t&&(w[e]=t)}this.fixedUniforms=r(e,w),this.terrainUniforms=BJe(e,w),this.projectionUniforms=GJe(e,w),this.binderUniforms=n?n.getUniforms(e,w):[]}draw(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(r),e.setColorMode(i),e.setCullFace(a),s){e.activeTexture.set(y.TEXTURE2),y.bindTexture(y.TEXTURE_2D,s.depthTexture),e.activeTexture.set(y.TEXTURE3),y.bindTexture(y.TEXTURE_2D,s.texture);for(let e in this.terrainUniforms)this.terrainUniforms[e].set(s[e])}if(c){let e=KJe(c);for(let t in this.projectionUniforms)this.projectionUniforms[t].set(e[t])}if(o)for(let e in this.fixedUniforms)this.fixedUniforms[e].set(o[e]);h&&h.setUniforms(e,this.binderUniforms,p,{zoom:m});let b=0;switch(t){case y.LINES:b=2;break;case y.TRIANGLES:b=3;break;case y.LINE_STRIP:b=1}for(let n of f.get())n.vaos||={},n.vaos[l]||=new zJe,n.vaos[l].bind(e,this,u,h?h.getPaintVertexBuffers():[],d,n.vertexOffset,g,_,v),y.drawElements(t,n.primitiveLength*b,y.UNSIGNED_SHORT,n.primitiveOffset*b*2)}};function YJe(e,t,n){let r=1/BR(n,1,t.transform.tileZoom),i=2**n.tileID.overscaledZ,a=n.tileSize*2**t.transform.tileZoom/i,o=a*(n.tileID.canonical.x+n.tileID.wrap*i),s=a*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[r,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[o&65535,s&65535]}}function XJe(e,t,n,r){let i=n.patternAtlas.getPattern(e.from.toString()),a=n.patternAtlas.getPattern(e.to.toString()),{width:o,height:s}=n.patternAtlas.getPixelSize(),c=2**r.tileID.overscaledZ,l=r.tileSize*2**n.transform.tileZoom/c,u=l*(r.tileID.canonical.x+r.tileID.wrap*c),d=l*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/BR(r,1,n.transform.tileZoom),u_pixel_coord_upper:[u>>16,d>>16],u_pixel_coord_lower:[u&65535,d&65535]}}var ZJe=(e,t)=>
1209({u_lightpos:new yG(e,t.u_lightpos),u_lightpos_globe:new yG(e,t.u_lightpos_globe),u_lightintensity:new Z(e,t.u_lightintensity),u_lightcolor:new yG(e,t.u_lightcolor),u_vertical_gradient:new Z(e,t.u_vertical_gradient),u_opacity:new Z(e,t.u_opacity),u_fill_translate:new vG(e,t.u_fill_translate)}),QJe=(e,t)=>({u_lightpos:new yG(e,t.u_lightpos),u_lightpos_globe:new yG(e,t.u_lightpos_globe),u_lightintensity:new Z(e,t.u_lightintensity),u_lightcolor:new yG(e,t.u_lightcolor),u_vertical_gradient:new Z(e,t.u_vertical_gradient),u_height_factor:new Z(e,t.u_height_factor),u_opacity:new Z(e,t.u_opacity),u_fill_translate:new vG(e,t.u_fill_translate),u_image:new _G(e,t.u_image),u_texsize:new vG(e,t.u_texsize),u_pixel_coord_upper:new vG(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new vG(e,t.u_pixel_coord_lower),u_scale:new yG(e,t.u_scale),u_fade:new Z(e,t.u_fade)}),$Je=(e,t,n,r)=>{let i=e.style.light,a=i.getCartesianPosition(),o=eR();i.properties.get(`anchor`)===`viewport`&&JNe(o,e.transform.bearingInRadians),iPe(a,a,o);let s=e.transform.transformLightDirection(a),c=i.properties.get(`color`);return{u_lightpos:a,u_lightpos_globe:s,u_lightintensity:i.properties.get(`intensity`),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+t,u_opacity:n,u_fill_translate:r}},eYe=(e,t,n,r,i,a,o)=>oz($Je(e,t,n,r),YJe(a,e,o),{u_height_factor:-(2**i.overscaledZ)/o.tileSize/8}),tYe=(e,t)=>({u_fill_translate:new vG(e,t.u_fill_translate)}),nYe=(e,t)=>({u_image:new _G(e,t.u_image),u_texsize:new vG(e,t.u_texsize),u_pixel_coord_upper:new vG(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new vG(e,t.u_pixel_coord_lower),u_scale:new yG(e,t.u_scale),u_fade:new Z(e,t.u_fade),u_fill_translate:new vG(e,t.u_fill_translate)}),rYe=(e,t)=>({u_world:new vG(e,t.u_world),u_fill_translate:new vG(e,t.u_fill_translate)}),iYe=(e,t)=>({u_world:new vG(e,t.u_world),u_image:new _G(e,t.u_image),u_texsize:new vG(e,t.u_texsize),u_pixel_coord_upper:new vG(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new vG(e,t.u_pixel_coord_lower),u_scale:new yG(e,t.u_scale),u_fade:new Z(e,t.u_fade),u_fill_translate:new vG(e,t.u_fill_translate)}),aYe=(e,t,n,r)=>oz(YJe(t,e,n),{u_fill_translate:r}),oYe=e=>({u_fill_translate:e}),sYe=(e,t)=>({u_world:e,u_fill_translate:t}),cYe=(e,t,n,r,i)=>oz(aYe(e,t,n,i),{u_world:r}),lYe=(e,t)=>({u_camera_to_center_distance:new Z(e,t.u_camera_to_center_distance),u_scale_with_map:new _G(e,t.u_scale_with_map),u_pitch_with_map:new _G(e,t.u_pitch_with_map),u_extrude_scale:new vG(e,t.u_extrude_scale),u_device_pixel_ratio:new Z(e,t.u_device_pixel_ratio),u_globe_extrude_scale:new Z(e,t.u_globe_extrude_scale),u_translate:new vG(e,t.u_translate)}),uYe=(e,t,n,r,i)=>{let a=e.transform,o,s,c=0;if(n.paint.get(`circle-pitch-alignment`)===`map`){let e=BR(t,1,a.zoom);o=!0,s=[e,e],c=e/(q*2**t.tileID.overscaledZ)*2*Math.PI*i}else o=!1,s=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+(n.paint.get(`circle-pitch-scale`)===`map`),u_pitch_with_map:+o,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:s,u_globe_extrude_scale:c,u_translate:r}},dYe=(e,t)=>({u_pixel_extrude_scale:new vG(e,t.u_pixel_extrude_scale)}),fYe=(e,t)=>({u_viewport_size:new vG(e,t.u_viewport_size)}),pYe=e=>({u_pixel_extrude_scale:[1/e.width,1/e.height]}),mYe=e=>({u_viewport_size:[e.width,e.height]}),hYe=(e,t)=>({u_color:new xG(e,t.u_color),u_overlay:new _G(e,t.u_overlay),u_overlay_scale:new Z(e,t.u_overlay_scale)}),gYe=(e,t=1)=>({u_color:e,u_overlay:0,u_overlay_scale:t}),_Ye=(e,t)=>({u_extrude_scale:new Z(e,t.u_extrude_scale),u_intensity:new Z(e,t.u_intensity),u_globe_extrude_scale:new Z(e,t.u_globe_extrude_scale)}),vYe=(e,t)=>({u_matrix:new wG(e,t.u_matrix),u_world:new vG(e,t.u_world),u_image:new _G(e,t.u_image),u_color_ramp:new _G(e,t.u_color_ramp),u_opacity:new Z(e,t.u_opacity)}),yYe=(e,t,n,r)=>{let i=BR(e,1,t)/(q*2**e.tileID.overscaledZ)*2*Math.PI*r;return{u_extrude_scale:BR(e,1,t),u_intensity:n,u_globe_extrude_scale:i}},bYe=(e,t,n,r)=>{let i=tR();fR(i,0,e.width,e.height,0,0,1);let a=e.context.gl;return{u_matrix:i,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:n,u_color_ramp:r,u_opacity:t.paint.get(`heatmap-opacity`)}},xYe=(e,t)=>
vendor: 4,815 bytes, line 1209
1209({u_image:new _G(e,t.u_image),u_latrange:new vG(e,t.u_latrange),u_exaggeration:new Z(e,t.u_exaggeration),u_altitudes:new CG(e,t.u_altitudes),u_azimuths:new CG(e,t.u_azimuths),u_accent:new xG(e,t.u_accent),u_method:new _G(e,t.u_method),u_shadows:new SG(e,t.u_shadows),u_highlights:new SG(e,t.u_highlights)}),SYe=(e,t)=>({u_matrix:new wG(e,t.u_matrix),u_image:new _G(e,t.u_image),u_dimension:new vG(e,t.u_dimension),u_zoom:new Z(e,t.u_zoom),u_unpack:new bG(e,t.u_unpack)}),CYe=(e,t,n)=>{let r=n.paint.get(`hillshade-accent-color`),i;switch(n.paint.get(`hillshade-method`)){case`basic`:i=4;break;case`combined`:i=1;break;case`igor`:i=2;break;case`multidirectional`:i=3;break;default:i=0}let a=n.getIlluminationProperties();for(let t=0;t<a.directionRadians.length;t++)n.paint.get(`hillshade-illumination-anchor`)===`viewport`&&(a.directionRadians[t]+=e.transform.bearingInRadians);return{u_image:0,u_latrange:TYe(e,t.tileID),u_exaggeration:n.paint.get(`hillshade-exaggeration`),u_altitudes:a.altitudeRadians,u_azimuths:a.directionRadians,u_accent:r,u_method:i,u_highlights:a.highlightColor,u_shadows:a.shadowColor}},wYe=(e,t)=>{let n=t.stride,r=tR();return fR(r,0,q,-q,0,0,1),oR(r,r,[0,-q,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:t.getUnpackVector()}};function TYe(e,t){let n=2**t.canonical.z,r=t.canonical.y;return[new $K(0,r/n).toLngLat().lat,new $K(0,(r+1)/n).toLngLat().lat]}var EYe=(e,t)=>({u_image:new _G(e,t.u_image),u_unpack:new bG(e,t.u_unpack),u_dimension:new vG(e,t.u_dimension),u_elevation_stops:new _G(e,t.u_elevation_stops),u_color_stops:new _G(e,t.u_color_stops),u_color_ramp_size:new _G(e,t.u_color_ramp_size),u_opacity:new Z(e,t.u_opacity)}),DYe=(e,t,n=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:n,u_opacity:e.paint.get(`color-relief-opacity`)}),OYe=(e,t)=>({u_translation:new vG(e,t.u_translation),u_ratio:new Z(e,t.u_ratio),u_device_pixel_ratio:new Z(e,t.u_device_pixel_ratio),u_units_to_pixels:new vG(e,t.u_units_to_pixels)}),kYe=(e,t)=>({u_translation:new vG(e,t.u_translation),u_ratio:new Z(e,t.u_ratio),u_device_pixel_ratio:new Z(e,t.u_device_pixel_ratio),u_units_to_pixels:new vG(e,t.u_units_to_pixels),u_image:new _G(e,t.u_image),u_image_height:new Z(e,t.u_image_height)}),AYe=(e,t)=>({u_translation:new vG(e,t.u_translation),u_texsize:new vG(e,t.u_texsize),u_ratio:new Z(e,t.u_ratio),u_device_pixel_ratio:new Z(e,t.u_device_pixel_ratio),u_image:new _G(e,t.u_image),u_units_to_pixels:new vG(e,t.u_units_to_pixels),u_scale:new yG(e,t.u_scale),u_fade:new Z(e,t.u_fade)}),jYe=(e,t)=>({u_translation:new vG(e,t.u_translation),u_ratio:new Z(e,t.u_ratio),u_device_pixel_ratio:new Z(e,t.u_device_pixel_ratio),u_units_to_pixels:new vG(e,t.u_units_to_pixels),u_image:new _G(e,t.u_image),u_mix:new Z(e,t.u_mix),u_tileratio:new Z(e,t.u_tileratio),u_crossfade_from:new Z(e,t.u_crossfade_from),u_crossfade_to:new Z(e,t.u_crossfade_to),u_lineatlas_width:new Z(e,t.u_lineatlas_width),u_lineatlas_height:new Z(e,t.u_lineatlas_height)}),MYe=(e,t)=>({u_translation:new vG(e,t.u_translation),u_ratio:new Z(e,t.u_ratio),u_device_pixel_ratio:new Z(e,t.u_device_pixel_ratio),u_units_to_pixels:new vG(e,t.u_units_to_pixels),u_image:new _G(e,t.u_image),u_image_height:new Z(e,t.u_image_height),u_tileratio:new Z(e,t.u_tileratio),u_crossfade_from:new Z(e,t.u_crossfade_from),u_crossfade_to:new Z(e,t.u_crossfade_to),u_image_dash:new _G(e,t.u_image_dash),u_mix:new Z(e,t.u_mix),u_lineatlas_width:new Z(e,t.u_lineatlas_width),u_lineatlas_height:new Z(e,t.u_lineatlas_height)}),tX=(e,t,n,r)=>{let i=e.transform;return{u_translation:LYe(e,t,n),u_ratio:r/BR(t,1,i.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},NYe=(e,t,n,r,i)=>oz(tX(e,t,n,r),{u_image:0,u_image_height:i}),PYe=(e,t,n,r,i)=>{let a=e.transform,o=nX(t,a);return{u_translation:LYe(e,t,n),u_texsize:t.imageAtlasTexture.size,u_ratio:r/BR(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},FYe=(e,t,n,r,i)=>{let a=e.transform,o=nX(t,a);return oz(tX(e,t,n,r),{u_tileratio:o,u_crossfade_from:i.fromScale,u_crossfade_to:i.toScale,u_image:0,u_mix:i.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},IYe=(e,t,n,r,i,a)=>{let o=e.transform,s=nX(t,o);return oz(tX(e,t,n,r),{u_image:0,u_image_height:a,u_tileratio:s,u_crossfade_from:i.fromScale,u_crossfade_to:i.toScale,u_image_dash:1,u_mix:i.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})};function nX(e,t){return 1/BR(e,1,t.tileZoom)}function LYe(e,t,n){return qR(e.transform,t,n.paint.get(`line-translate`),n.paint.get(`line-translate-anchor`))}var RYe=(e,t)=>
1209({u_image:new _G(e,t.u_image),u_opacity:new Z(e,t.u_opacity)}),zYe=(e,t)=>({u_image:t,u_opacity:e}),BYe=(e,t)=>({u_is_size_zoom_constant:new _G(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new _G(e,t.u_is_size_feature_constant),u_size_t:new Z(e,t.u_size_t),u_size:new Z(e,t.u_size),u_camera_to_center_distance:new Z(e,t.u_camera_to_center_distance),u_pitch:new Z(e,t.u_pitch),u_rotate_symbol:new _G(e,t.u_rotate_symbol),u_aspect_ratio:new Z(e,t.u_aspect_ratio),u_fade_change:new Z(e,t.u_fade_change),u_label_plane_matrix:new wG(e,t.u_label_plane_matrix),u_coord_matrix:new wG(e,t.u_coord_matrix),u_is_text:new _G(e,t.u_is_text),u_pitch_with_map:new _G(e,t.u_pitch_with_map),u_is_along_line:new _G(e,t.u_is_along_line),u_is_variable_anchor:new _G(e,t.u_is_variable_anchor),u_texsize:new vG(e,t.u_texsize),u_texture:new _G(e,t.u_texture),u_translation:new vG(e,t.u_translation),u_pitched_scale:new Z(e,t.u_pitched_scale),u_is_offset:new _G(e,t.u_is_offset),u_height_anchor_ground:new _G(e,t.u_height_anchor_ground)}),VYe=(e,t)=>({u_is_size_zoom_constant:new _G(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new _G(e,t.u_is_size_feature_constant),u_size_t:new Z(e,t.u_size_t),u_size:new Z(e,t.u_size),u_camera_to_center_distance:new Z(e,t.u_camera_to_center_distance),u_pitch:new Z(e,t.u_pitch),u_rotate_symbol:new _G(e,t.u_rotate_symbol),u_aspect_ratio:new Z(e,t.u_aspect_ratio),u_fade_change:new Z(e,t.u_fade_change),u_label_plane_matrix:new wG(e,t.u_label_plane_matrix),u_coord_matrix:new wG(e,t.u_coord_matrix),u_is_text:new _G(e,t.u_is_text),u_pitch_with_map:new _G(e,t.u_pitch_with_map),u_is_along_line:new _G(e,t.u_is_along_line),u_is_variable_anchor:new _G(e,t.u_is_variable_anchor),u_texsize:new vG(e,t.u_texsize),u_texture:new _G(e,t.u_texture),u_gamma_scale:new Z(e,t.u_gamma_scale),u_device_pixel_ratio:new Z(e,t.u_device_pixel_ratio),u_is_halo:new _G(e,t.u_is_halo),u_is_plain:new _G(e,t.u_is_plain),u_translation:new vG(e,t.u_translation),u_pitched_scale:new Z(e,t.u_pitched_scale),u_is_offset:new _G(e,t.u_is_offset),u_height_anchor_ground:new _G(e,t.u_height_anchor_ground)}),HYe=(e,t)=>({u_is_size_zoom_constant:new _G(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new _G(e,t.u_is_size_feature_constant),u_size_t:new Z(e,t.u_size_t),u_size:new Z(e,t.u_size),u_camera_to_center_distance:new Z(e,t.u_camera_to_center_distance),u_pitch:new Z(e,t.u_pitch),u_rotate_symbol:new _G(e,t.u_rotate_symbol),u_aspect_ratio:new Z(e,t.u_aspect_ratio),u_fade_change:new Z(e,t.u_fade_change),u_label_plane_matrix:new wG(e,t.u_label_plane_matrix),u_coord_matrix:new wG(e,t.u_coord_matrix),u_is_text:new _G(e,t.u_is_text),u_pitch_with_map:new _G(e,t.u_pitch_with_map),u_is_along_line:new _G(e,t.u_is_along_line),u_is_variable_anchor:new _G(e,t.u_is_variable_anchor),u_texsize:new vG(e,t.u_texsize),u_texsize_icon:new vG(e,t.u_texsize_icon),u_texture:new _G(e,t.u_texture),u_texture_icon:new _G(e,t.u_texture_icon),u_gamma_scale:new Z(e,t.u_gamma_scale),u_device_pixel_ratio:new Z(e,t.u_device_pixel_ratio),u_is_halo:new _G(e,t.u_is_halo),u_translation:new vG(e,t.u_translation),u_pitched_scale:new Z(e,t.u_pitched_scale),u_is_offset:new _G(e,t.u_is_offset),u_height_anchor_ground:new _G(e,t.u_height_anchor_ground)}),UYe=(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m)=>{let h=o.transform;return{u_is_size_zoom_constant:+(e===`constant`||e===`source`),u_is_size_feature_constant:+(e===`constant`||e===`camera`),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:h.width/h.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_label_plane_matrix:s,u_coord_matrix:c,u_is_text:+u,u_pitch_with_map:+r,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:d,u_texture:0,u_translation:l,u_pitched_scale:f,u_is_offset:p,u_height_anchor_ground:+m}},WYe=(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)=>{let g=o.transform;return oz(UYe(e,t,n,r,i,a,o,s,c,l,u,d,p,m,h),{u_gamma_scale:r?Math.cos(g.pitch*Math.PI/180)*g.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+!!f,u_is_plain:1})},GYe=(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m)=>oz(WYe(e,t,n,r,i,a,o,s,c,l,!0,u,!0,f,p,m),{u_texsize_icon:d,u_texture_icon:1}),KYe=(e,t)=>
vendor: 5,008 bytes, line 1209
1209({u_opacity:new Z(e,t.u_opacity),u_color:new xG(e,t.u_color)}),qYe=(e,t)=>({u_opacity:new Z(e,t.u_opacity),u_image:new _G(e,t.u_image),u_pattern_tl_a:new vG(e,t.u_pattern_tl_a),u_pattern_br_a:new vG(e,t.u_pattern_br_a),u_pattern_tl_b:new vG(e,t.u_pattern_tl_b),u_pattern_br_b:new vG(e,t.u_pattern_br_b),u_texsize:new vG(e,t.u_texsize),u_mix:new Z(e,t.u_mix),u_pattern_size_a:new vG(e,t.u_pattern_size_a),u_pattern_size_b:new vG(e,t.u_pattern_size_b),u_scale_a:new Z(e,t.u_scale_a),u_scale_b:new Z(e,t.u_scale_b),u_pixel_coord_upper:new vG(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new vG(e,t.u_pixel_coord_lower),u_tile_units_to_pixels:new Z(e,t.u_tile_units_to_pixels)}),JYe=(e,t)=>({u_opacity:e,u_color:t}),YYe=(e,t,n,r,i)=>oz(XJe(n,i,t,r),{u_opacity:e}),XYe=(e,t)=>({u_sun_pos:new yG(e,t.u_sun_pos),u_atmosphere_blend:new Z(e,t.u_atmosphere_blend),u_globe_position:new yG(e,t.u_globe_position),u_globe_radius:new Z(e,t.u_globe_radius),u_inv_proj_matrix:new wG(e,t.u_inv_proj_matrix)}),ZYe=(e,t,n,r,i)=>({u_sun_pos:e,u_atmosphere_blend:t,u_globe_position:n,u_globe_radius:r,u_inv_proj_matrix:i}),QYe=(e,t)=>({u_sky_color:new xG(e,t.u_sky_color),u_horizon_color:new xG(e,t.u_horizon_color),u_horizon:new vG(e,t.u_horizon),u_horizon_normal:new vG(e,t.u_horizon_normal),u_sky_horizon_blend:new Z(e,t.u_sky_horizon_blend),u_sky_blend:new Z(e,t.u_sky_blend)}),$Ye=(e,t,n)=>{let r=Math.cos(t.rollInRadians),i=Math.sin(t.rollInRadians),a=rq(t),o=t.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:e.properties.get(`sky-color`),u_horizon_color:e.properties.get(`horizon-color`),u_horizon:[(t.width/2-a*i)*n,(t.height/2+a*r)*n],u_horizon_normal:[-i,r],u_sky_horizon_blend:e.properties.get(`sky-horizon-blend`)*t.height/2*n,u_sky_blend:o}},eXe=(e,t)=>{},tXe={fillExtrusion:ZJe,fillExtrusionPattern:QJe,fill:tYe,fillPattern:nYe,fillOutline:rYe,fillOutlinePattern:iYe,circle:lYe,collisionBox:dYe,collisionCircle:fYe,debug:hYe,depth:eXe,clippingMask:eXe,heatmap:_Ye,heatmapTexture:vYe,hillshade:xYe,hillshadePrepare:SYe,colorRelief:EYe,line:OYe,lineGradient:kYe,linePattern:AYe,lineSDF:jYe,lineGradientSDF:MYe,layerOpacity:RYe,raster:oKe,symbolIcon:BYe,symbolSDF:VYe,symbolTextAndIcon:HYe,background:KYe,backgroundPattern:qYe,terrain:VJe,terrainDepth:HJe,atmosphere:XYe,sky:QYe},nXe=class{constructor(e,t,n){this.context=e;let r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||t.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw Error(`Attempted to update data while not in dynamic mode.`);this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},rXe={Int8:`BYTE`,Uint8:`UNSIGNED_BYTE`,Int16:`SHORT`,Uint16:`UNSIGNED_SHORT`,Int32:`INT`,Uint32:`UNSIGNED_INT`,Float32:`FLOAT`},iXe=class{constructor(e,t,n,r){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.context=e;let i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||t.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let n of this.attributes){let r=t.attributes[n.name];r!==void 0&&e.enableVertexAttribArray(r.location)}}setVertexAttribPointers(e,t,n){for(let r of this.attributes){let i=t.attributes[r.name];if(i!==void 0){let t=r.offset+this.itemSize*(n||0);i.isInteger?e.vertexAttribIPointer(i.location,r.components,e[rXe[r.type]],this.itemSize,t):e.vertexAttribPointer(i.location,r.components,e[rXe[r.type]],!1,this.itemSize,t)}}}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},rX=class{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}},aXe=class extends rX{getDefault(){return UB.transparent}set(e){let t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a&&!this.dirty||(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}},oXe=class extends rX{getDefault(){return 1}set(e){e===this.current&&!this.dirty||(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}},sXe=class extends rX{getDefault(){return 0}set(e){e===this.current&&!this.dirty||(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}
1209,cXe=class extends rX{getDefault(){return[!0,!0,!0,!0]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&!this.dirty||(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}},lXe=class extends rX{getDefault(){return!0}set(e){e===this.current&&!this.dirty||(this.gl.depthMask(e),this.current=e,this.dirty=!1)}},uXe=class extends rX{getDefault(){return 255}set(e){e===this.current&&!this.dirty||(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}},dXe=class extends rX{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let t=this.current;e.func===t.func&&e.ref===t.ref&&e.mask===t.mask&&!this.dirty||(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}},fXe=class extends rX{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&!this.dirty||(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}},pXe=class extends rX{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}},mXe=class extends rX{getDefault(){return[0,1]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&!this.dirty||(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}},hXe=class extends rX{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}},gXe=class extends rX{getDefault(){return this.gl.LESS}set(e){e===this.current&&!this.dirty||(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}},_Xe=class extends rX{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}},vXe=class extends rX{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&!this.dirty||(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}},yXe=class extends rX{getDefault(){return UB.transparent}set(e){let t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a&&!this.dirty||(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}},bXe=class extends rX{getDefault(){return this.gl.FUNC_ADD}set(e){e===this.current&&!this.dirty||(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}},xXe=class extends rX{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}},SXe=class extends rX{getDefault(){return this.gl.BACK}set(e){e===this.current&&!this.dirty||(this.gl.cullFace(e),this.current=e,this.dirty=!1)}},CXe=class extends rX{getDefault(){return this.gl.CCW}set(e){e===this.current&&!this.dirty||(this.gl.frontFace(e),this.current=e,this.dirty=!1)}},wXe=class extends rX{getDefault(){return null}set(e){e===this.current&&!this.dirty||(this.gl.useProgram(e),this.current=e,this.dirty=!1)}},TXe=class extends rX{getDefault(){return this.gl.TEXTURE0}set(e){e===this.current&&!this.dirty||(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}},EXe=class extends rX{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&!this.dirty||(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}},DXe=class extends rX{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},OXe=class extends rX{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},kXe=class extends rX{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}},AXe=class extends rX{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},jXe=class extends rX{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},MXe=class extends rX{getDefault(){return null}set(e){e===this.current&&!this.dirty||(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}},NXe=class extends rX{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},PXe=class extends rX{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},FXe=class extends rX{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},iX=class extends rX{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}},IXe=class extends iX{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},LXe=class extends iX{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},RXe=class extends iX{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},zXe=class{constructor(e,t,n,r,i){this.context=e,this.width=t,this.height=n;let a=e.gl,o=this.framebuffer=a.createFramebuffer();
vendor: 6,813 bytes, line 1209
1209if(this.colorAttachment=new IXe(e,o),r)this.depthAttachment=i?new RXe(e,o):new LXe(e,o);else if(i)throw Error(`Stencil cannot be set without depth`)}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}},aX=class{constructor(e,t,n){this.blendFunction=e,this.blendColor=t,this.mask=n}};aX.Replace=[1,0],aX.disabled=new aX(aX.Replace,UB.transparent,[!1,!1,!1,!1]),aX.unblended=new aX(aX.Replace,UB.transparent,[!0,!0,!0,!0]),aX.alphaBlended=new aX([1,771],UB.transparent,[!0,!0,!0,!0]);var BXe=class{constructor(e){this.gl=e,this.clearColor=new aXe(this),this.clearDepth=new oXe(this),this.clearStencil=new sXe(this),this.colorMask=new cXe(this),this.depthMask=new lXe(this),this.stencilMask=new uXe(this),this.stencilFunc=new dXe(this),this.stencilOp=new fXe(this),this.stencilTest=new pXe(this),this.depthRange=new mXe(this),this.depthTest=new hXe(this),this.depthFunc=new gXe(this),this.blend=new _Xe(this),this.blendFunc=new vXe(this),this.blendColor=new yXe(this),this.blendEquation=new bXe(this),this.cullFace=new xXe(this),this.cullFaceSide=new SXe(this),this.frontFace=new CXe(this),this.program=new wXe(this),this.activeTexture=new TXe(this),this.viewport=new EXe(this),this.bindFramebuffer=new DXe(this),this.bindRenderbuffer=new OXe(this),this.bindTexture=new kXe(this),this.bindVertexBuffer=new AXe(this),this.bindElementBuffer=new jXe(this),this.bindVertexArray=new MXe(this),this.pixelStoreUnpack=new NXe(this),this.pixelStoreUnpackPremultiplyAlpha=new PXe(this),this.pixelStoreUnpackFlipY=new FXe(this),this.extTextureFilterAnisotropic=e.getExtension(`EXT_texture_filter_anisotropic`),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),e.getExtension(`EXT_color_buffer_half_float`),e.getExtension(`EXT_color_buffer_float`)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}setCustomLayerDefaults(){this.unbindVAO(),this.cullFace.setDefault(),this.activeTexture.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}createIndexBuffer(e,t){return new nXe(this,e,t)}createVertexBuffer(e,t,n){return new iXe(this,e,t,n)}createRenderbuffer(e,t,n){let r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,n,r){return new zXe(this,e,t,n,r)}clear({color:e,depth:t,stencil:n}){let r=this.gl,i=0;e&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),t!==void 0&&(i|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),n!==void 0&&(i|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),r.clear(i)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func===this.gl.ALWAYS&&!e.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range))}setStencilMode(e){e.test.func===this.gl.ALWAYS&&!e.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask}))}setColorMode(e){mz(e.blendFunction,aX.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){return this.gl.createVertexArray()}deleteVertexArray(e){this.gl.deleteVertexArray(e)}unbindVAO(){this.bindVertexArray.set(null)}},oX=class{constructor(e,t,n){this.func=e,this.mask=t,this.range=n}};oX.ReadOnly=!1,oX.ReadWrite=!0,oX.disabled=new oX(519,oX.ReadOnly,[0,1]);var sX=7680,cX=class{constructor(e,t,n,r,i,a){this.test=e,this.ref=t,this.mask=n,this.fail=r,this.depthFail=i,this.pass=a}};cX.disabled=new cX({func:519,mask:0},0,0,sX,sX,sX);var VXe=1029,lX=2305,uX=class{constructor(e,t,n){this.enable=e,this.mode=t,this.frontFace=n}};uX.disabled=new uX(!1,VXe,lX),uX.backCCW=new uX(!0,VXe,lX),uX.frontCCW=new uX(!0,1028,lX);var dX;function HXe(e,t,n,r,i){let a=e.context,o=e.transform,s=a.gl,c=e.useProgram(`collisionBox`),l=[],u=0,d=0;for(let f of r){let r=t.getTile(f).getBucket(n);if(!r)continue;let p=i?r.textCollisionBox:r.iconCollisionBox,m=r.collisionCircleArray;m.length>0&&(l.push({circleArray:m,circleOffset:d,coord:f}),u+=m.length/4,d=u),p&&c.draw(a,s.LINES,oX.disabled,cX.disabled,e.colorModeForRenderPass(),uX.disabled,pYe(e.transform),e.style.map.terrain?.getTerrainData(f),o.getProjectionData({overscaledTileID:f,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,null,e.transform.zoom,null,null,p.collisionVertexBuffer)}if(!i||!l.length)return;let f=e.useProgram(`collisionCircle`),p=new xLe;p.resize(u*4),p._trim();let m=0;for(let e of l)for(let t=0;t<e.circleArray.length/4;
vendor: 6,915 bytes, line 1209
1209t++){let n=t*4,r=e.circleArray[n+0],i=e.circleArray[n+1],a=e.circleArray[n+2],o=e.circleArray[n+3];p.emplace(m++,r,i,a,o,0),p.emplace(m++,r,i,a,o,1),p.emplace(m++,r,i,a,o,2),p.emplace(m++,r,i,a,o,3)}(!dX||dX.length<u*2)&&(dX=UXe(u));let h=a.createIndexBuffer(dX,!0),g=a.createVertexBuffer(p,uBe.members,!0);for(let t of l){let r=mYe(e.transform);f.draw(a,s.TRIANGLES,oX.disabled,cX.disabled,e.colorModeForRenderPass(),uX.disabled,r,e.style.map.terrain?.getTerrainData(t.coord),null,n.id,g,h,uG.simpleSegment(0,t.circleOffset*2,t.circleArray.length,t.circleArray.length/2),null,e.transform.zoom,null,null,null)}g.destroy(),h.destroy()}function UXe(e){let t=e*2,n=new CLe;n.resize(t),n._trim();for(let e=0;e<t;e++){let t=e*6;n.uint16[t+0]=e*4+0,n.uint16[t+1]=e*4+1,n.uint16[t+2]=e*4+2,n.uint16[t+3]=e*4+2,n.uint16[t+4]=e*4+3,n.uint16[t+5]=e*4+0}return n}var WXe=rR(new Float32Array(16));function GXe(e,t,n,r,i,a){if(e.renderPass!==`translucent`)return;let{isRenderingToTexture:o}=a,s=cX.disabled,c=e.colorModeForRenderPass();(n._unevaluatedLayout.hasValue(`text-variable-anchor`)||n._unevaluatedLayout.hasValue(`text-variable-anchor-offset`))&&qXe(r,e,n,t,n.layout.get(`text-rotation-alignment`),n.layout.get(`text-pitch-alignment`),n.paint.get(`text-translate`),n.paint.get(`text-translate-anchor`),i),n.paint.get(`icon-opacity`).constantOr(1)!==0&&ZXe(e,t,n,r,!1,n.paint.get(`icon-translate`),n.paint.get(`icon-translate-anchor`),n.layout.get(`icon-rotation-alignment`),n.layout.get(`icon-pitch-alignment`),n.layout.get(`icon-keep-upright`),s,c,o),n.paint.get(`text-opacity`).constantOr(1)!==0&&ZXe(e,t,n,r,!0,n.paint.get(`text-translate`),n.paint.get(`text-translate-anchor`),n.layout.get(`text-rotation-alignment`),n.layout.get(`text-pitch-alignment`),n.layout.get(`text-keep-upright`),s,c,o),t.map.showCollisionBoxes&&(HXe(e,t,n,r,!0),HXe(e,t,n,r,!1))}function KXe(e,t,n,r,i,a){let{horizontalAlign:o,verticalAlign:s}=OBe(e),c=-(o-.5)*t,l=-(s-.5)*n;return new K((c/i+r[0])*a,(l/i+r[1])*a)}function qXe(e,t,n,r,i,a,o,s,c){let l=t.transform,u=t.style.map.terrain,d=i===`map`,f=a===`map`;for(let i of e){let e=r.getTile(i),a=e.getBucket(n);if(!a?.text?.segments.get().length)continue;let p=a.textSizeData,m=gq(p,l.zoom),h=BR(e,1,t.transform.zoom),g=mY(d,t.transform,h),_=n.layout.get(`icon-text-fit`)!==`none`&&a.hasIconData();if(m){let t=2**(l.zoom-e.tileID.overscaledZ),r=u?(e,t)=>u.getElevation(i,e,t):void 0;YXe(a,d,f,c,l,g,t,m,_,qR(l,e,o,s),i.toUnwrapped(),r,n.layout.get(`symbol-height-anchor`)===`ground`)}}}function JXe(e,t,n,r,i,a){let o=t.tileAnchorPoint.add(new K(t.translation[0],t.translation[1]));if(t.pitchWithMap){let e=r.mult(a);n||(e=e.rotate(-i));let s=o.add(e);return _Y(s.x,s.y,t.pitchedLabelPlaneMatrix,gY(t,s.x,s.y)).point}if(n){let n=yY(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(e),i=Math.atan(n.y/n.x)+(n.x<0?Math.PI:0);return e.add(r.rotate(i))}return e.add(r)}function YXe(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=e.text.placedSymbolArray,m=e.text.dynamicLayoutVertexArray,h=e.icon.dynamicLayoutVertexArray,g={};m.clear();for(let h=0;h<p.length;h++){let _=p.get(h),v=e.allowVerticalPlacement&&!_.placedOrientation,y=!_.hidden&&_.crossTileID&&!v?r[_.crossTileID]:null;if(!y)CY(_.numGlyphs,m);else{let r=new K(_.anchorX,_.anchorY),p={getElevation:d,heightOffset:_.heightOffset,heightAnchorGround:f,width:i.width,height:i.height,pitchedLabelPlaneMatrix:a,lineVertexArray:null,pitchWithMap:n,transform:i,projectionCache:null,tileAnchorPoint:r,translation:l,unwrappedTileID:u},h=n?rqe(r.x,r.y,p):yY(r.x,r.y,p),v=XKe(i.cameraToCenterDistance,h.signedDistanceFromCamera),b=hq(e.textSizeData,s,_)*v/24;n&&(b*=e.tilePixelRatio/o);let{width:x,height:S,anchor:C,textOffset:w,textBoxScale:T}=y,E=KXe(C,x,S,w,T,b),D=i.getPitchedTextCorrection(r.x+l[0],r.y+l[1],u),O=JXe(h.point,p,t,E,-i.bearingInRadians,D),k=e.allowVerticalPlacement&&_.placedOrientation===2?Math.PI/2:0;for(let e=0;e<_.numGlyphs;e++)yq(m,O,k);c&&_.associatedIconIndex>=0&&(g[_.associatedIconIndex]={shiftedAnchor:O,angle:k})}}if(c){h.clear();let t=e.icon.placedSymbolArray;for(let e=0;e<t.length;e++){let n=t.get(e);if(n.hidden)CY(n.numGlyphs,h);else{let t=g[e];if(!t)CY(n.numGlyphs,h);else for(let e=0;e<n.numGlyphs;e++)yq(h,t.shiftedAnchor,t.angle)}}e.icon.dynamicLayoutVertexBuffer.updateData(h)}e.text.dynamicLayoutVertexBuffer.updateData(m)}function XXe(e,t,n){return n.iconsInText&&t?`symbolTextAndIcon`:e?`symbolSDF`:`symbolIcon`}function ZXe(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=e.context,m=p.gl,h=e.transform,g=s===`map`,_=c===`map`,v=s!==`viewport`&&n.layout.get(`symbol-placement`)!==`point`,y=g&&!_&&!v,b=!n.layout.get(`symbol-sort-key`).isConstant(),x=!1,S=e.getDepthModeForSublayer(0,oX.ReadOnly),C=n._unevaluatedLayout.hasValue(`text-variable-anchor`)||n._unevaluatedLayout.hasValue(`text-variable-anchor-offset`),w=[],T=h.getCircleRadiusCorrection();for(let s of r){let r=t.getTile(s),c=r.getBucket(n);if(!c)continue;let u=i?c.text:c.icon;if(!u?.segments.get().length||!u.hasVisibleVertices)continue;let d=u.programConfigurations.get(n.id),p=i||c.sdfIcons,S=i?c.textSizeData:c.iconSizeData,E=_||h.pitch!==0,D=e.useProgram(XXe(p,i,c),d),O=gq(S,h.zoom),k=e.style.map.terrain?.getTerrainData(s),A,j=[0,0],M,N,P=null,F;if(i){if(M=r.glyphAtlasTexture,N=m.LINEAR,A=r.glyphAtlasTexture.size,c.iconsInText){j=r.imageAtlasTexture.size,P=r.imageAtlasTexture;let t=S.kind===`composite`||S.kind===`camera`;F=E||e.options.rotating||e.options.zooming||t?m.LINEAR:m.NEAREST}}else{let t=n.layout.get(`icon-size`).constantOr(0)!==1||c.iconsNeedLinear;M=r.imageAtlasTexture,N=p||e.options.rotating||e.options.zooming||t||E?m.LINEAR:m.NEAREST,A=r.imageAtlasTexture.size}let I=BR(r,1,e.transform.zoom),L=mY(g,e.transform,I),R=YKe(_,g,e.transform,I),ee=qR(h,r,a,o),z=h.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!f,applyTerrainMatrix:!0}),te=C&&c.hasTextData(),ne=n.layout.get(`icon-text-fit`)!==`none`&&te&&c.hasIconData(),re=n._unevaluatedLayout.hasValue(`icon-offset`),ie=n.layout.get(`symbol-height-anchor`)===`ground`;if(v){let t=tR();GKe(t,L);let r=e.style.map.terrain?(t,n)=>e.style.map.terrain.getElevation(s,t,n):void 0;QKe(c,e,i,L,t,_,l,n.layout.get(`text-rotation-alignment`)===`map`,s.toUnwrapped(),h.width,h.height,ee,r)}let ae=i&&C||ne,oe=_?L:e.transform.clipSpaceToPixelsMatrix,se=v||ae?WXe:oe,ce=p&&n.paint.get(i?`text-halo-width`:`icon-halo-width`).constantOr(1)!==0,le;le=p?c.iconsInText?GYe(S.kind,O,y,_,v,ae,e,se,R,ee,A,j,T,re,ie):WYe(S.kind,O,y,_,v,ae,e,se,R,ee,i,A,ce,T,re,ie):UYe(S.kind,O,y,_,v,ae,e,se,R,ee,i,A,T,re,ie);let ue={program:D,buffers:u,uniformValues:le,projectionData:z,atlasTexture:M,atlasTextureIcon:P,atlasInterpolation:N,atlasInterpolationIcon:F,isSDF:p,hasHalo:ce};if(b&&c.canOverlap){x=!0;let e=u.segments.get();for(let t of e)w.push({segments:new uG([t]),sortKey:t.sortKey,state:ue,terrainData:k})}else w.push({segments:u.segments,sortKey:0,state:ue,terrainData:k})}x&&w.sort((e,t)=>
1209e.sortKey-t.sortKey);let E=n.paint.get(i?`text-halo-width`:`icon-halo-width`).constantOr(null)??1/0,D=n.layout.get(`text-letter-spacing`).constantOr(0)*24<0||E>1;for(let t of w){let r=t.state;p.activeTexture.set(m.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,m.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(m.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,m.CLAMP_TO_EDGE));let i=r.isSDF&&r.hasHalo;if(i){let i=r.uniformValues;i.u_is_halo=1,D&&(i.u_is_plain=0,QXe(r.buffers,t.segments,n,e,r.program,S,u,d,i,r.projectionData,t.terrainData),i.u_is_halo=0,i.u_is_plain=1)}QXe(r.buffers,t.segments,n,e,r.program,S,u,d,r.uniformValues,r.projectionData,t.terrainData),i&&!D&&(r.uniformValues.u_is_halo=0)}}function QXe(e,t,n,r,i,a,o,s,c,l,u){let d=r.context,f=d.gl;i.draw(d,f.TRIANGLES,a,o,s,uX.backCCW,c,u,l,n.id,e.layoutVertexBuffer,e.indexBuffer,t,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function $Xe(e,t,n,r,i){if(e.renderPass!==`translucent`)return;let{isRenderingToTexture:a}=i,o=n.paint.get(`circle-opacity`),s=n.paint.get(`circle-stroke-width`),c=n.paint.get(`circle-stroke-opacity`),l=!n.layout.get(`circle-sort-key`).isConstant();if(o.constantOr(1)===0&&(s.constantOr(1)===0||c.constantOr(1)===0))return;let u=e.context,d=u.gl,f=e.transform,p=e.getDepthModeForSublayer(0,oX.ReadOnly),m=cX.disabled,h=e.colorModeForRenderPass(),g=[],_=f.getCircleRadiusCorrection();for(let i of r){let r=t.getTile(i),o=r.getBucket(n);if(!o)continue;let s=qR(f,r,n.paint.get(`circle-translate`),n.paint.get(`circle-translate-anchor`)),c=o.programConfigurations.get(n.id),u=e.useProgram(`circle`,c),d=o.layoutVertexBuffer,p=o.indexBuffer,m=e.style.map.terrain?.getTerrainData(i),h={programConfiguration:c,program:u,layoutVertexBuffer:d,indexBuffer:p,uniformValues:uYe(e,r,n,s,_),terrainData:m,projectionData:f.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!a,applyTerrainMatrix:!0})};if(l){let e=o.segments.get();for(let t of e)g.push({segments:new uG([t]),sortKey:t.sortKey,state:h})}else g.push({segments:o.segments,sortKey:0,state:h})}l&&g.sort((e,t)=>
vendor: 9,496 bytes, line 1209
1209e.sortKey-t.sortKey);for(let t of g){let{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:c,projectionData:l}=t.state,f=t.segments;i.draw(u,d.TRIANGLES,p,m,h,uX.backCCW,s,c,l,n.id,a,o,f,n.paint,e.transform.zoom,r)}}function eZe(e,t,n,r,i){if(n.paint.get(`heatmap-opacity`)===0)return;let a=e.context,{isRenderingToTexture:o,isRenderingGlobe:s}=i;if(e.style.map.terrain){for(let i of r){let r=t.getTile(i);t.hasRenderableParent(i)||(e.renderPass===`offscreen`?rZe(e,r,n,i,s):e.renderPass===`translucent`&&iZe(e,n,i,o,s))}a.viewport.set([0,0,e.width,e.height])}else e.renderPass===`offscreen`?tZe(e,t,n,r):e.renderPass===`translucent`&&nZe(e,n)}function tZe(e,t,n,r){let i=e.context,a=i.gl,o=e.transform,s=cX.disabled,c=new aX([a.ONE,a.ONE],UB.transparent,[!0,!0,!0,!0]);aZe(i,e,n),i.clear({color:UB.transparent});for(let l of r){if(t.hasRenderableParent(l))continue;let r=t.getTile(l),u=r.getBucket(n);if(!u)continue;let d=u.programConfigurations.get(n.id),f=e.useProgram(`heatmap`,d),p=o.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),m=o.getCircleRadiusCorrection();f.draw(i,a.TRIANGLES,oX.disabled,s,c,uX.backCCW,yYe(r,o.zoom,n.paint.get(`heatmap-intensity`),m),null,p,n.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,n.paint,o.zoom,d)}i.viewport.set([0,0,e.width,e.height])}function nZe(e,t){let n=e.context,r=n.gl;n.setColorMode(e.colorModeForRenderPass());let i=t.heatmapFbos.get(cK);i&&(n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,i.colorAttachment.get()),n.activeTexture.set(r.TEXTURE1),sZe(n,t).bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram(`heatmapTexture`).draw(n,r.TRIANGLES,oX.disabled,cX.disabled,e.colorModeForRenderPass(),uX.disabled,bYe(e,t,0,1),null,null,t.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,t.paint,e.transform.zoom))}function rZe(e,t,n,r,i){let a=e.context,o=a.gl,s=cX.disabled,c=new aX([o.ONE,o.ONE],UB.transparent,[!0,!0,!0,!0]),l=t.getBucket(n);if(!l)return;let u=r.key,d=n.heatmapFbos.get(u);d||(d=oZe(a,t.tileSize,t.tileSize),n.heatmapFbos.set(u,d)),a.bindFramebuffer.set(d.framebuffer),a.viewport.set([0,0,t.tileSize,t.tileSize]),a.clear({color:UB.transparent});let f=l.programConfigurations.get(n.id),p=e.useProgram(`heatmap`,f,!i),m=e.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),h=e.style.map.terrain.getTerrainData(r);p.draw(a,o.TRIANGLES,oX.disabled,s,c,uX.disabled,yYe(t,e.transform.zoom,n.paint.get(`heatmap-intensity`),1),h,m,n.id,l.layoutVertexBuffer,l.indexBuffer,l.segments,n.paint,e.transform.zoom,f)}function iZe(e,t,n,r,i){let a=e.context,o=a.gl,s=e.transform;a.setColorMode(e.colorModeForRenderPass());let c=sZe(a,t),l=n.key,u=t.heatmapFbos.get(l);if(!u)return;a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,u.colorAttachment.get()),a.activeTexture.set(o.TEXTURE1),c.bind(o.LINEAR,o.CLAMP_TO_EDGE);let d=s.getProjectionData({overscaledTileID:n,applyTerrainMatrix:i,applyGlobeMatrix:!r});e.useProgram(`heatmapTexture`).draw(a,o.TRIANGLES,oX.disabled,cX.disabled,e.colorModeForRenderPass(),uX.disabled,bYe(e,t,0,1),null,d,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,s.zoom),u.destroy(),t.heatmapFbos.delete(l)}function aZe(e,t,n){let r=e.gl;e.activeTexture.set(r.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);let i=n.heatmapFbos.get(cK);i?(r.bindTexture(r.TEXTURE_2D,i.colorAttachment.get()),e.bindFramebuffer.set(i.framebuffer)):(i=oZe(e,t.width/4,t.height/4),n.heatmapFbos.set(cK,i))}function oZe(e,t,n){let r=e.gl,i=r.createTexture();r.bindTexture(r.TEXTURE_2D,i),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texStorage2D(r.TEXTURE_2D,1,r.RGBA16F,t,n);let a=e.createFramebuffer(t,n,!1,!1);return a.colorAttachment.set(i),a}function sZe(e,t){return t.colorRampTexture||=new uK(e,t.colorRamp,e.gl.RGBA),t.colorRampTexture}function cZe(e,t,n,r){let i=e.context,a=i.bindFramebuffer.get(),o=i.viewport.get(),[,,s,c]=o;return lZe(e,s,c),i.viewport.set([0,0,s,c]),i.clear({color:UB.transparent,depth:1,stencil:0}),e.currentStencilSource=void 0,e.renderTileClippingMasks(t,n,r),{compositeTarget:a,compositeViewport:o}}function lZe(e,t,n){let r=e.context.gl;if(!e.layerOpacityFbo){let i=e.context.createFramebuffer(t,n,!0,!0),a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t,n,0,r.RGBA,r.UNSIGNED_BYTE,null),i.colorAttachment.set(a),i.depthAttachment.set(e.context.createRenderbuffer(r.DEPTH_STENCIL,t,n)),e.layerOpacityFbo=i,e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}if(e.layerOpacityFbo.width===t&&e.layerOpacityFbo.height===n){e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}let i=e.layerOpacityFbo;r.bindTexture(r.TEXTURE_2D,i.colorAttachment.get()),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t,n,0,r.RGBA,r.UNSIGNED_BYTE,null),e.context.bindRenderbuffer.set(i.depthAttachment.get()),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,n),e.context.bindRenderbuffer.set(null),i.width=t,i.height=n,e.context.bindFramebuffer.set(i.framebuffer)}function uZe(e,t,n,r){let i=e.context,a=i.gl;i.bindFramebuffer.set(n.compositeTarget),i.viewport.set(n.compositeViewport),i.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,e.layerOpacityFbo.colorAttachment.get()),e.useProgram(`layerOpacity`).draw(i,a.TRIANGLES,oX.disabled,cX.disabled,e.colorModeForRenderPass(),uX.disabled,zYe(t,0),null,null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom),e.currentStencilSource=void 0}function dZe(e,t,n,r,i,a,o,s){let c=256;if(i.stepInterpolant){let r=t.getSource().maxzoom,i=o.canonical.z===r?Math.ceil(1<<e.transform.maxZoom-o.canonical.z):1;c=iz(wPe(a.maxLineLength/q*1024*i),256,n.maxTextureSize)}return s.gradient=sK({expression:i.gradientExpression(),evaluationKey:`lineProgress`,resolution:c,image:s.gradient||void 0,clips:a.lineClipsArray}),s.texture?s.texture.update(s.gradient):s.texture=new uK(n,s.gradient,r.RGBA),s.version=i.gradientVersion,s.texture}function fZe(e,t,n,r,i){e.activeTexture.set(t.TEXTURE0),n.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),r.updatePaintBuffers(i)}function pZe(e,t,n,r,i,a){(i||e.lineAtlas.dirty)&&(t.activeTexture.set(n.TEXTURE0),e.lineAtlas.bind(t)),r.updatePaintBuffers(a)}function mZe(e,t,n,r,i,a,o){let s=a.gradients[i.id],c=s.texture;i.gradientVersion!==s.version&&(c=dZe(e,t,n,r,i,a,o,s)),n.activeTexture.set(r.TEXTURE0),c.bind(i.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function hZe(e,t,n,r,i,a,o,s,c){let l=a.gradients[i.id],u=l.texture;i.gradientVersion!==l.version&&(u=dZe(e,t,n,r,i,a,o,l)),n.activeTexture.set(r.TEXTURE0),u.bind(i.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),n.activeTexture.set(r.TEXTURE1),e.lineAtlas.bind(n),s.updatePaintBuffers(c)}function gZe(e,t,n,r,i){if(e.renderPass!==`translucent`)return;let a=n.paint.get(`line-opacity`),o=n.paint.get(`line-width`),s=n.paint.get(`line-layer-opacity`);if(a.constantOr(1)===0||o.constantOr(1)===0||s===0)return;let c=!!e.style.map.terrain;if(s<1){let a=cZe(e,n,r,c);_Ze(e,t,n,r,i,c),uZe(e,s,a,n);return}_Ze(e,t,n,r,i,c)}function _Ze(e,t,n,r,i,a){let{isRenderingToTexture:o}=i,s=e.getDepthModeForSublayer(0,oX.ReadOnly),c=e.colorModeForRenderPass(),l=n.paint.get(`line-dasharray`),u=l.constantOr(1),d=n.paint.get(`line-pattern`),f=d.constantOr(1),p=n.paint.get(`line-gradient`),m=n.getCrossfadeParameters(),h;h=f?`linePattern`:u&&p?`lineGradientSDF`:u?`lineSDF`:p?`lineGradient`:`line`;let g=e.context,_=g.gl,v=e.transform,y=!0;for(let i of r){let r=t.getTile(i);if(f&&!r.patternsLoaded())continue;let b=r.getBucket(n);if(!b)continue;let x=b.programConfigurations.get(n.id),S=e.context.program.get(),C=e.useProgram(h,x),w=y||C.program!==S,T=a?e.getTerrainDataForTile(i,o):null,E=d.constantOr(null),D=l?.constantOr(null);if(E&&r.imageAtlas){let e=r.imageAtlas,t=e.patternPositions[E.to.toString()],n=e.patternPositions[E.from.toString()];t&&n&&x.setConstantPatternPositions(t,n)}else if(D){let t=n.layout.get(`line-cap`).constantOr(null)===`round`,r=e.lineAtlas.getDash(D.to,t),i=e.lineAtlas.getDash(D.from,t);x.setConstantDashPositions(r,i)}let O=v.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!o,applyTerrainMatrix:!0}),k=v.getPixelScale(),A;f?(A=PYe(e,r,n,k,m),fZe(g,_,r,x,m)):u&&p?(A=IYe(e,r,n,k,m,b.lineClipsArray.length),hZe(e,t,g,_,n,b,i,x,m)):u?(A=FYe(e,r,n,k,m),pZe(e,g,_,x,w,m)):p?(A=NYe(e,r,n,k,b.lineClipsArray.length),mZe(e,t,g,_,n,b,i)):A=tX(e,r,n,k);let j=e.stencilModeForClipping(i);C.draw(g,_.TRIANGLES,s,j,c,uX.disabled,A,T,O,n.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,n.paint,e.transform.zoom,x,b.layoutVertexBuffer2),y=!1}}function vZe(e,t,n,r,i){if(!n||!r?.imageAtlas)return;let a=r.imageAtlas.patternPositions,o=a[n.to.toString()],s=a[n.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let e=i.getPaintProperty(t);o=a[e],s=a[e]}o&&s&&e.setConstantPatternPositions(o,s)}function yZe(e,t,n,r,i){let a=n.paint.get(`fill-color`),o=n.paint.get(`fill-opacity`),s=n.paint.get(`fill-layer
1209-opacity`);if(o.constantOr(1)===0||s===0)return;if(s<1){if(e.renderPass!==`translucent`)return;let a=cZe(e,n,r,!!e.style.map.terrain);bZe(e,t,n,r,i),uZe(e,s,a,n);return}let c=n.paint.get(`fill-pattern`),l=e.opaquePassEnabledForLayer()&&!c.constantOr(1)&&a.constantOr(UB.transparent).a===1&&o.constantOr(0)===1;if(l&&e.renderPass===`opaque`){let{isRenderingToTexture:a}=i,o=e.colorModeForRenderPass();fX(e,t,n,r,e.getDepthModeForSublayer(1,oX.ReadWrite),o,!1,a);return}if(l&&e.renderPass===`translucent`){xZe(e,t,n,r,i);return}e.renderPass===`translucent`&&bZe(e,t,n,r,i)}function bZe(e,t,n,r,i){let{isRenderingToTexture:a}=i,o=e.colorModeForRenderPass();fX(e,t,n,r,e.getDepthModeForSublayer(1,oX.ReadOnly),o,!1,a),xZe(e,t,n,r,i)}function xZe(e,t,n,r,i){if(!n.paint.get(`fill-antialias`))return;let{isRenderingToTexture:a}=i,o=e.colorModeForRenderPass();fX(e,t,n,r,e.getDepthModeForSublayer(n.getPaintProperty(`fill-outline-color`)?2:0,oX.ReadOnly),o,!0,a)}function fX(e,t,n,r,i,a,o,s){let c=e.context.gl,l=`fill-pattern`,u=n.paint.get(l),d=u?.constantOr(1),f=n.getCrossfadeParameters(),p,m,h,g,_,v=e.transform,y=n.paint.get(`fill-translate`),b=n.paint.get(`fill-translate-anchor`);o?(m=d&&!n.getPaintProperty(`fill-outline-color`)?`fillOutlinePattern`:`fillOutline`,p=c.LINES):(m=d?`fillPattern`:`fill`,p=c.TRIANGLES);let x=u.constantOr(null);for(let u of r){let r=t.getTile(u);if(d&&!r.patternsLoaded())continue;let S=r.getBucket(n);if(!S)continue;let C=S.programConfigurations.get(n.id),w=e.useProgram(m,C),T=e.getTerrainDataForTile(u,s);d&&(e.context.activeTexture.set(c.TEXTURE0),r.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),C.updatePaintBuffers(f)),vZe(C,l,x,r,n);let E=v.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),D=qR(v,r,y,b);if(!o)g=S.indexBuffer,_=S.segments,h=d?aYe(e,f,r,D):oYe(D);else{g=S.indexBuffer2,_=S.segments2;let t=[c.drawingBufferWidth,c.drawingBufferHeight];h=m===`fillOutlinePattern`&&d?cYe(e,f,r,t,D):sYe(t,D)}let O=e.stencilModeForClipping(u);w.draw(e.context,p,i,O,a,uX.backCCW,h,T,E,n.id,S.layoutVertexBuffer,g,_,n.paint,e.transform.zoom,C)}}function SZe(e,t,n,r,i){let a=n.paint.get(`fill-extrusion-opacity`);if(a===0)return;let{isRenderingToTexture:o}=i;if(e.renderPass===`translucent`){let i=new oX(e.context.gl.LEQUAL,oX.ReadWrite,e.depthRangeFor3D);if(a===1&&!n.paint.get(`fill-extrusion-pattern`).constantOr(1)){let a=e.colorModeForRenderPass();pX(e,t,n,r,i,cX.disabled,a,o)}else pX(e,t,n,r,i,cX.disabled,aX.disabled,o),pX(e,t,n,r,i,e.stencilModeFor3D(),e.colorModeForRenderPass(),o)}}function pX(e,t,n,r,i,a,o,s){let c=e.context,l=c.gl,u=`fill-extrusion-pattern`,d=n.paint.get(u),f=d.constantOr(1),p=n.getCrossfadeParameters(),m=n.paint.get(`fill-extrusion-opacity`),h=d.constantOr(null),g=e.transform;for(let d of r){let r=t.getTile(d),_=r.getBucket(n);if(!_)continue;let v=e.style.map.terrain?.getTerrainData(d),y=_.programConfigurations.get(n.id),b=e.useProgram(f?`fillExtrusionPattern`:`fillExtrusion`,y);f&&(e.context.activeTexture.set(l.TEXTURE0),r.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(p));let x=g.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!s,applyTerrainMatrix:!0});vZe(y,u,h,r,n);let S=qR(g,r,n.paint.get(`fill-extrusion-translate`),n.paint.get(`fill-extrusion-translate-anchor`)),C=n.paint.get(`fill-extrusion-vertical-gradient`),w=f?eYe(e,C,m,S,d,p,r):$Je(e,C,m,S);b.draw(c,c.gl.TRIANGLES,i,a,o,uX.backCCW,w,v,x,n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,n.paint,e.transform.zoom,y,e.style.map.terrain&&_.centroidVertexBuffer)}}function CZe(e,t,n,r,i){if(e.renderPass!==`offscreen`&&e.renderPass!==`translucent`)return;let{isRenderingToTexture:a}=i,o=e.context,s=e.style.projection.useSubdivision,c=e.getDepthModeForSublayer(0,oX.ReadOnly),l=e.colorModeForRenderPass();if(e.renderPass===`offscreen`)wZe(e,t,r,n,c,cX.disabled,l),o.viewport.set([0,0,e.width,e.height]);else if(e.renderPass===`translucent`)if(s){let[i,o,s]=e.stencilConfigForOverlapTwoPass(r);mX(e,t,n,s,i,c,l,!1,a),mX(e,t,n,s,o,c,l,!0,a)}else{let[i,o]=e.getStencilConfigForOverlapAndUpdateStencilID(r);mX(e,t,n,o,i,c,l,!1,a)}}function mX(e,t,n,r,i,a,o,s,c){let l=e.style.projection,u=e.context,d=e.transform,f=u.gl,p=[`#define NUM_ILLUMINATION_SOURCES ${n.paint.get(`hillshade-highlight-color`).values.length}`],m=e.useProgram(`hillshade`,null,!1,p),h=!e.options.moving;for(let p of r){let r=t.getTile(p),g=r.fbo;if(!g)continue;let _=l.getMeshFromTileID(u,p.canonical,s,!0,`raster`),v=e.getTerrainDataForTile(p,c);u.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,g.colorAttachment.get());let y=d.getProjectionData({overscaledTileID:p,aligned:h,applyGlobeMatrix:!c,applyTerrainMatrix:!0});m.draw(u,f.TRIANGLES,a,i[p.overscaledZ],o,uX.backCCW,CYe(e,r,n),v,y,n.id,_.vertexBuffer,_.indexBuffer,_.segments)}}function wZe(e,t,n,r,i,a,o){let s=e.context,c=s.gl,l=r.paint.get(`resampling`)===`nearest`?c.NEAREST:c.LINEAR;for(let u of n){let n=t.getTile(u),d=n.dem;if(!d?.data||!n.needsHillshadePrepare)continue;let f=d.dim,p=d.stride,m=d.getPixels();if(s.activeTexture.set(c.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture||=e.getTileTexture(p),n.demTexture){let e=n.demTexture;e.update(m,{premultiply:!1}),e.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else n.demTexture=new uK(s,m,c.RGBA,{premultiply:!1}),n.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);s.activeTexture.set(c.TEXTURE0);let h=n.fbo;if(!h){let e=new uK(s,{width:f,height:f,data:null},c.RGBA);e.bind(l,c.CLAMP_TO_EDGE),h=n.fbo=s.createFramebuffer(f,f,!0,!1),h.colorAttachment.set(e.texture)}s.bindFramebuffer.set(h.framebuffer),s.viewport.set([0,0,f,f]),e.useProgram(`hillshadePrepare`).draw(s,c.TRIANGLES,i,a,o,uX.disabled,wYe(n.tileID,d),null,null,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function TZe(e,t,n,r,i){if(e.renderPass!==`translucent`||!r.length)return;let{isRenderingToTexture:a}=i,o=e.style.projection.useSubdivision,s=e.getDepthModeForSublayer(0,oX.ReadOnly),c=e.colorModeForRenderPass();if(o){let[i,o,l]=e.stencilConfigForOverlapTwoPass(r);hX(e,t,n,l,i,s,c,!1,a),hX(e,t,n,l,o,s,c,!0,a)}else{let[i,o]=e.getStencilConfigForOverlapAndUpdateStencilID(r);hX(e,t,n,o,i,s,c,!1,a)}}var EZe=0;function hX(e,t,n,r,i,a,o,s,c){let l=e.style.projection,u=e.context,d=e.transform,f=u.gl,p=e.useProgram(`colorRelief`),m=!e.options.moving,h=n.paint.get(`resampling`)===`nearest`?f.NEAREST:f.LINEAR,g=!0,_=0;for(let v of r){let r=t.getTile(v),y=r.dem;if(g){EZe||=f.getParameter(f.MAX_TEXTURE_SIZE);let e=EZe,{elevationTexture:t,colorTexture:r}=n.getColorRampTextures(u,e,y.getUnpackVector());u.activeTexture.set(f.TEXTURE1),t.bind(f.NEAREST,f.CLAMP_TO_EDGE),u.activeTexture.set(f.TEXTURE4),r.bind(f.LINEAR,f.CLAMP_TO_EDGE),g=!1,_=t.size[0]}if(!y?.data)continue;let b=y.stride;u.activeTexture.set(f.TEXTURE0),(!r.demTexture||r.needsColorReliefPrepare)&&(u.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture||=e.getTileTexture(b)??new uK(u,{width:b,height:b,data:null},f.RGBA),r.demTexture.update(y.getPixels(),{premultiply:!1}),r.needsColorReliefPrepare=!1),r.demTexture.bind(h,f.CLAMP_TO_EDGE);let x=l.getMeshFromTileID(u,v.canonical,s,!0,`raster`),S=e.getTerrainDataForTile(v,c),C=d.getProjectionData({overscaledTileID:v,aligned:m,applyGlobeMatrix:!c,applyTerrainMatrix:!0});p.draw(u,f.TRIANGLES,a,i[v.overscaledZ],o,uX.backCCW,DYe(n,r.dem,_),S,C,n.id,x.vertexBuffer,x.indexBuffer,x.segments)}}var gX=[new K(0,0),new K(q,0),new K(q,q),new K(0,q)];function DZe(e,t,n,r,i){if(e.renderPass!==`translucent`||n.paint.get(`raster-opacity`)===0||!r.length)return;let{isRenderingToTexture:a}=i,o=t.getSource(),s=e.style.projection.useSubdivision;if(o instanceof aY)_X(e,t,n,r,null,!1,!1,o.tileCoords,o.imageWarp,o.flippedWindingOrder,a,o.getMesh(e.context,s));else if(s){let[i,o,s]=e.stencilConfigForOverlapTwoPass(r);_X(e,t,n,s,i,!1,!0,gX,tY,!1,a),_X(e,t,n,s,o,!0,!0,gX,tY,!1,a)}else{let[i,o]=e.getStencilConfigForOverlapAndUpdateStencilID(r);_X(e,t,n,o,i,!1,!0,gX,tY,!1,a)}}function _X(e,t,n,r,i,a,o,s,c,l=!1,u=!1,d=null){let f=r[r.length-1].overscaledZ,p=e.context,m=p.gl,h=e.useProgram(`raster`),g=e.transform,_=e.style.projection,v=e.colorModeForRenderPass(),y=!e.options.moving,b=n.paint.get(`raster-opacity`),x=n.paint.get(`resampling`)===`nearest`||n.paint.get(`raster-resampling`)===`nearest`?m.NEAREST:m.LINEAR,S=n.paint.get(`raster-fade-duration`),C=!!e.style.map.terrain;for(let w of r){let r=e.getDepthModeForSublayer(w.overscaledZ-f,b===1?oX.ReadWrite:oX.ReadOnly,m.LESS),T=t.getTile(w);p.activeTexture.set(m.TEXTURE0),T.texture.bind(x,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(m.TEXTURE1);let{parentTile:E,parentScaleBy:D,parentTopLeft:O,fadeValues:k}=OZe(T,t,S,C);T.fadeOpacity=k.tileOpacity,E?(E.fadeOpacity=k.parentTileOpacity,E.texture.bind(x,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST)):T.texture.bind(x,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST),T.texture.useMipmap&&p.extTextureFilterAnisotropic&&e.transform.pitch>e.options.anisotropicFilterPitch&&m.texParameterf(m.TEXTURE_2D,p.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,p.extTextureFilterAnisotropicMax);let A=e.getTerrainDataForTile(w,u),j=g.getProjectionData({overscaledTileID:w,aligned:y,applyGlobeMatrix:!u,applyTerrainMatrix:!0}
vendor: 8,026 bytes, line 1209
1209),M=sKe(O,D,k.fadeMix,n,s,c),N=d??_.getMeshFromTileID(p,w.canonical,a,o,`raster`),P=i?i[w.overscaledZ]:cX.disabled;h.draw(p,m.TRIANGLES,r,P,v,l?uX.frontCCW:uX.backCCW,M,A,j,n.id,N.vertexBuffer,N.indexBuffer,N.segments)}}function OZe(e,t,n,r){let i={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(n===0||r)return i;if(e.fadingParentID){let r=t.getLoadedTile(e.fadingParentID);if(!r)return i;let a=2**(r.tileID.overscaledZ-e.tileID.overscaledZ);return{parentTile:r,parentScaleBy:a,parentTopLeft:[e.tileID.canonical.x*a%1,e.tileID.canonical.y*a%1],fadeValues:kZe(e,r,n)}}return e.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:AZe(e,n)}:i}function kZe(e,t,n){let r=LJ(),i=(r-e.timeAdded)/n,a=(r-t.timeAdded)/n,o=e.fadingDirection===1,s=iz(i,0,1),c=iz(1-a,0,1),l=o?s:c;return{tileOpacity:l,parentTileOpacity:o?c:s,fadeMix:{opacity:1,mix:1-l}}}function AZe(e,t){let n=iz((LJ()-e.timeAdded)/t,0,1);return{tileOpacity:n,fadeMix:{opacity:n,mix:0}}}function jZe(e,t,n,r,i){let a=n.paint.get(`background-color`),o=n.paint.get(`background-opacity`);if(o===0)return;let{isRenderingToTexture:s}=i,c=e.context,l=c.gl,u=e.style.projection,d=e.transform,f=d.tileSize,p=n.paint.get(`background-pattern`);if(e.isPatternMissing(p))return;let m=!p&&a.a===1&&o===1&&e.opaquePassEnabledForLayer()?`opaque`:`translucent`;if(e.renderPass!==m)return;let h=cX.disabled,g=e.getDepthModeForSublayer(0,m===`opaque`?oX.ReadWrite:oX.ReadOnly),_=e.colorModeForRenderPass(),v=e.useProgram(p?`backgroundPattern`:`background`),y=r||uY(d,{tileSize:f,terrain:e.style.map.terrain});p&&(c.activeTexture.set(l.TEXTURE0),e.patternAtlas.bind(e.context));let b=n.getCrossfadeParameters();for(let t of y){let r=d.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),i=p?YYe(o,e,p,{tileID:t,tileSize:f},b):JYe(o,a),m=e.getTerrainDataForTile(t,s),y=u.getMeshFromTileID(c,t.canonical,!1,!0,`raster`);v.draw(c,l.TRIANGLES,g,h,_,uX.backCCW,i,m,r,n.id,y.vertexBuffer,y.indexBuffer,y.segments)}}var MZe=new UB(1,0,0,1),NZe=new UB(0,1,0,1),PZe=new UB(0,0,1,1),FZe=new UB(1,0,1,1),IZe=new UB(0,1,1,1);function LZe(e){let t=e.transform.padding;zZe(e,e.transform.height-(t.top||0),3,MZe),zZe(e,t.bottom||0,3,NZe),BZe(e,t.left||0,3,PZe),BZe(e,e.transform.width-(t.right||0),3,FZe);let n=e.transform.centerPoint;RZe(e,n.x,e.transform.height-n.y,IZe)}function RZe(e,t,n,r){vX(e,t-1,n-10,2,20,r),vX(e,t-10,n-1,20,2,r)}function zZe(e,t,n,r){vX(e,0,t+n/2,e.transform.width,n,r)}function BZe(e,t,n,r){vX(e,t-n/2,0,n,e.transform.height,r)}function vX(e,t,n,r,i,a){let o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,n*e.pixelRatio,r*e.pixelRatio,i*e.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function VZe(e,t,n){for(let r of n)HZe(e,t,r)}function HZe(e,t,n){let r=e.context,i=r.gl,a=e.useProgram(`debug`),o=oX.disabled,s=cX.disabled,c=e.colorModeForRenderPass(),l=`$debug`,u=e.style.map.terrain?.getTerrainData(n);r.activeTexture.set(i.TEXTURE0);let d=t.getTileByID(n.key).latestRawTileData?.byteLength||0,f=Math.floor(d/1024),p=t.getTile(n).tileSize,m=512/Math.min(p,512)*(n.overscaledZ/e.transform.zoom)*.5,h=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(h+=` => ${n.overscaledZ}`),UZe(e,`${h} ${f}kB`);let g=e.transform.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!0,applyTerrainMatrix:!0});a.draw(r,i.TRIANGLES,o,s,aX.alphaBlended,uX.disabled,gYe(UB.transparent,m),null,g,l,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),a.draw(r,i.LINE_STRIP,o,s,c,uX.disabled,gYe(UB.red),u,g,l,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function UZe(e,t){e.initDebugOverlayCanvas();let n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext(`2d`);i.clearRect(0,0,n.width,n.height),i.shadowColor=`white`,i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle=`white`,i.textBaseline=`top`,i.font=`bold 36px Open Sans, sans-serif`,i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}function WZe(e,t){let n=null,r=Object.values(e._layers).flatMap(n=>n.source&&!n.isHidden(t)?[e.tileManagers[n.source]]:[]),i=r.filter(e=>e.getSource().type===`vector`),a=r.filter(e=>e.getSource().type!==`vector`),o=e=>{(!n||n.getSource().maxzoom<e.getSource().maxzoom)&&(n=e)};for(let e of i)o(e);if(!n)for(let e of a)o(e);return n}function GZe(e,t,n,r){let{isRenderingGlobe:i}=r,a=e.context,o=n.implementation,s=e.style.projection,c=e.transform,l=c.getProjectionDataForCustomLayer(i),u={farZ:c.farZ,nearZ:c.nearZ,fov:c.fov*Math.PI/180,modelViewProjectionMatrix:c.modelViewProjectionMatrix,projectionMatrix:c.projectionMatrix,shaderData:{variantName:s.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n${s.shaderPreludeCode.vertexSource}`,define:s.shaderDefine},defaultProjectionData:l,getProjectionData:e=>c.getProjectionData({overscaledTileID:new Dq(e.tileID.canonical.z,e.tileID.wrap??0,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),aligned:e.aligned,applyGlobeMatrix:e.applyGlobeMatrix,applyTerrainMatrix:e.applyTerrainMatrix})},d=o.renderingMode?o.renderingMode:`2d`;if(e.renderPass===`offscreen`){let t=o.prerender;t&&(e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),t.call(o,a.gl,u),a.setDirty(),e.setBaseState())}else if(e.renderPass===`translucent`){e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),a.setStencilMode(cX.disabled);let t=d===`3d`?e.getDepthModeFor3D():e.getDepthModeForSublayer(0,oX.ReadOnly);a.setDepthMode(t),o.render(a.gl,u),a.setDirty(),e.setBaseState(),a.bindFramebuffer.set(null)}}function KZe(e,t){let n=e.context,r=n.gl,i=e.transform,a=aX.unblended,o=new oX(r.LEQUAL,oX.ReadWrite,[0,1]),s=t.tileManager.getRenderableTiles(),c=e.useProgram(`terrainDepth`);n.bindFramebuffer.set(t.getFramebuffer().framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:UB.white,depth:1});for(let e of s){let s=t.getTerrainMesh(e.tileID),l=t.getTerrainData(e.tileID),u=i.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),d=WJe(t.getSkirtLength(i.zoom));c.draw(n,r.TRIANGLES,o,cX.disabled,a,uX.backCCW,d,l,u,`terrain`,s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}function qZe(e,t,n,r){let{isRenderingGlobe:i}=r,a=e.context,o=a.gl,s=e.transform,c=e.colorModeForRenderPass(),l=e.getDepthModeFor3D(),u=e.useProgram(`terrain`);a.bindFramebuffer.set(null),a.viewport.set([0,0,e.width,e.height]);for(let r of n){let n=t.getTerrainMesh(r.tileID),d=e.renderToTexture.getTexture(r),f=t.getTerrainData(r.tileID);a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,d.texture);let p=UJe(t.getSkirtLength(s.zoom),s.calculateFogMatrix(r.tileID.toUnwrapped()),e.style.sky,s.pitch,i),m=s.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(a,o.TRIANGLES,l,cX.disabled,c,uX.backCCW,p,f,m,`terrain`,n.vertexBuffer,n.indexBuffer,n.segments)}}function JZe(e,t){if(!t.mesh){let n=new rG;n.emplaceBack(-1,-1),n.emplaceBack(1,-1),n.emplaceBack(1,1),n.emplaceBack(-1,1);let r=new sG;r.emplaceBack(0,1,2),r.emplaceBack(0,2,3),t.mesh=new nY(e.createVertexBuffer(n,rY.members),e.createIndexBuffer(r),uG.simpleSegment(0,0,n.length,r.length))}return t.mesh}function YZe(e,t){let n=e.context,r=n.gl,i=$Ye(t,e.transform,e.pixelRatio),a=new oX(r.LEQUAL,oX.ReadWrite,[0,1]),o=cX.disabled,s=e.colorModeForRenderPass(),c=e.useProgram(`sky`),l=JZe(n,t);c.draw(n,r.TRIANGLES,a,o,s,uX.disabled,i,null,void 0,`sky`,l.vertexBuffer,l.indexBuffer,l.segments)}function XZe(e,t){let n=e.getCartesianPosition();nPe(n,n);let r=rR(new Float64Array(16));return e.properties.get(`anchor`)===`map`&&(uR(r,r,t.rollInRadians),cR(r,r,-t.pitchInRadians),uR(r,r,t.bearingInRadians),cR(r,r,t.center.lat*Math.PI/180),lR(r,r,-t.center.lng*Math.PI/180)
1209),rPe(n,n,r),n}function ZZe(e,t,n){let r=e.context,i=r.gl,a=e.useProgram(`atmosphere`),o=new oX(i.LEQUAL,oX.ReadOnly,[0,1]),s=e.transform,c=XZe(n,e.transform),l=s.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),u=t.properties.get(`atmosphere-blend`)*l.projectionTransition;if(u===0)return;let d=WY(s.worldSize,s.center.lat),f=s.inverseProjectionMatrix,p=new Float64Array(4);p[3]=1,kR(p,p,s.modelViewProjectionMatrix),p[0]/=p[3],p[1]/=p[3],p[2]/=p[3],p[3]=1,kR(p,p,f),p[0]/=p[3],p[1]/=p[3],p[2]/=p[3],p[3]=1;let m=ZYe(c,u,[p[0],p[1],p[2]],d,f),h=JZe(r,t);a.draw(r,i.TRIANGLES,o,cX.disabled,aX.alphaBlended,uX.disabled,m,null,null,`atmosphere`,h.vertexBuffer,h.indexBuffer,h.segments)}var QZe={symbol:GXe,circle:$Xe,heatmap:eZe,line:gZe,fill:yZe,fillExtrusion:SZe,hillshade:CZe,colorRelief:TZe,raster:DZe,background:jZe,sky:YZe,atmosphere:ZZe,custom:GZe,debug:VZe,debugPadding:LZe,terrainDepth:KZe},$Ze=class e{constructor(e,t){this.drawFunctions=QZe,this.context=new BXe(e),this.transform=t,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:rR(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=dY.maxOverzooming+dY.maxUnderzooming+1,this.depthEpsilon=1/2**16,this.crossTileSymbolIndex=new Aqe}resize(e,t,n){if(this.width=Math.floor(e*n),this.height=Math.floor(t*n),this.pixelRatio=n,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style._order)this.style._layers[e].resize()}setup(){let e=this.context,t=new rG;t.emplaceBack(0,0),t.emplaceBack(q,0),t.emplaceBack(0,q),t.emplaceBack(q,q),this.tileExtentBuffer=e.createVertexBuffer(t,rY.members),this.tileExtentSegments=uG.simpleSegment(0,0,4,2);let n=new rG;n.emplaceBack(0,0),n.emplaceBack(q,0),n.emplaceBack(0,q),n.emplaceBack(q,q),this.debugBuffer=e.createVertexBuffer(n,rY.members),this.debugSegments=uG.simpleSegment(0,0,4,5);let r=new fLe;r.emplaceBack(0,0,0,0),r.emplaceBack(q,0,q,0),r.emplaceBack(0,q,0,q),r.emplaceBack(q,q,q,q),this.rasterBoundsBuffer=e.createVertexBuffer(r,RJe.members),this.rasterBoundsSegments=uG.simpleSegment(0,0,4,2);let i=new rG;i.emplaceBack(0,0),i.emplaceBack(q,0),i.emplaceBack(0,q),i.emplaceBack(q,q),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(i,rY.members),this.rasterBoundsSegmentsPosOnly=uG.simpleSegment(0,0,4,5);let a=new rG;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,rY.members),this.viewportSegments=uG.simpleSegment(0,0,4,2);let o=new wLe;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);let s=new sG;s.emplaceBack(1,0,2),s.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);let c=this.context.gl;this.stencilClearMode=new cX({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO),this.tileExtentMesh=new nY(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let e=this.context,t=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let n=tR();fR(n,0,this.width,this.height,0,0,1),sR(n,n,[t.drawingBufferWidth,t.drawingBufferHeight,0]);let r={mainMatrix:n,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:n,clipAntimeridian:!1};this.useProgram(`clippingMask`,null,!0).draw(e,t.TRIANGLES,oX.disabled,this.stencilClearMode,aX.disabled,uX.disabled,null,null,r,`$clipping`,this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(e,t,n){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t?.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let r=this.context;r.setColorMode(aX.disabled),r.setDepthMode(oX.disabled);let i={};for(let e of t)i[e.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(i,t,n,!0),this._renderTileMasks(i,t,n,!1),this._tileClippingMaskIDs=i}_renderTileMasks(e,t,n,r){let i=this.context,a=i.gl,o=this.style.projection,s=this.transform,c=this.useProgram(`clippingMask`);for(let l of t){let t=e[l.key],u=this.getTerrainDataForTile(l,n),d=o.getMeshFromTileID(this.context,l.canonical,r,!0,`stencil`),f=s.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!n,applyTerrainMatrix:!0});c.draw(i,a.TRIANGLES,oX.disabled,new cX({func:a.ALWAYS,mask:0},t,255,a.KEEP,a.KEEP,a.REPLACE),aX.disabled,n?uX.disabled:uX.backCCW,null,u,f,`$clipping`,d.vertexBuffer,d.indexBuffer,d.segments)}}getTerrainDataForTile(e,t){return t&&this.style.projection?.name===`mercator`?null:this.style.map.terrain?.getTerrainData(e)||null}_renderTilesDepthBuffer(){let e=this.context,t=e.gl,n=this.style.projection,r=this.transform,i=this.useProgram(`depth`),a=this.getDepthModeFor3D(),o=uY(r,{tileSize:r.tileSize});for(let s of o){let o=this.style.map.terrain?.getTerrainData(s),c=n.getMeshFromTileID(this.context,s.canonical,!0,!0,`raster`),l=r.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});i.draw(e,t.TRIANGLES,a,cX.disabled,aX.disabled,uX.backCCW,null,o,l,`$clipping`,c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new cX({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new cX({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,n=e.sort((e,t)=>
1209t.overscaledZ-e.overscaledZ),r=n[n.length-1].overscaledZ,i=n[0].overscaledZ-r+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();let e={};for(let n=0;n<i;n++)e[n+r]=new cX({func:t.GEQUAL,mask:255},n+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=i,[e,n]}return[{[r]:cX.disabled},n]}stencilConfigForOverlapTwoPass(e){let t=this.context.gl,n=e.sort((e,t)=>t.overscaledZ-e.overscaledZ),r=n[n.length-1].overscaledZ,i=n[0].overscaledZ-r+1;if(this.clearStencil(),i>1){let e={},a={};for(let n=0;n<i;n++)e[n+r]=new cX({func:t.GREATER,mask:255},i+1+n,255,t.KEEP,t.KEEP,t.REPLACE),a[n+r]=new cX({func:t.GREATER,mask:255},1+n,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID=i*2+1,[e,a,n]}return this.nextStencilID=3,[{[r]:new cX({func:t.GREATER,mask:255},2,255,t.KEEP,t.KEEP,t.REPLACE)},{[r]:new cX({func:t.GREATER,mask:255},1,255,t.KEEP,t.KEEP,t.REPLACE)},n]}colorModeForRenderPass(){let e=this.context.gl;if(this._showOverdrawInspector){let t=1/8;return new aX([e.CONSTANT_COLOR,e.ONE],new UB(t,t,t,0),[!0,!0,!0,!0])}return this.renderPass===`opaque`?aX.unblended:aX.alphaBlended}getDepthModeForSublayer(e,t,n){if(!this.opaquePassEnabledForLayer())return oX.disabled;let r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new oX(n||this.context.gl.LEQUAL,t,[r,r])}getDepthModeFor3D(){return new oX(this.context.gl.LEQUAL,oX.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,t){this.style=e,this.options=t,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.patternAtlas=e.patternAtlas,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(LJ()),this.imageManager.beginFrame();let n=this.style._order,r=this.style.tileManagers,i={},a={},o={},s={isRenderingToTexture:!1,isRenderingGlobe:e.projection?.transitionState>0};for(let e in r){let t=r[e];t.used&&t.prepare(this.context),i[e]=t.getVisibleCoordinates(!1),a[e]=i[e].slice().reverse(),o[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<n.length;e++){let t=n[e];if(this.style._layers[t].is3D()){this.opaquePassCutoff=e;break}}this.maybeDrawDepth(),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass=`offscreen`;for(let e of n){let t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;let n=a[t.source];t.type!==`custom`&&!n.length||this.renderLayer(this,r[t.source],t,n,s)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:t.showOverdrawInspector?UB.black:UB.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=t.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass=`opaque`,this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){let e=this.style._layers[n[this.currentLayer]],t=r[e.source],a=i[e.source];this.renderTileClippingMasks(e,a,!1),this.renderLayer(this,t,e,a,s)}this.renderPass=`translucent`;let c=!1;for(this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){let e=this.style._layers[n[this.currentLayer]],t=r[e.source];if(this.renderToTexture?.renderLayer(e,s))continue;!this.opaquePassEnabledForLayer()&&!c&&(c=!0,s.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let l=(e.type===`symbol`?o:a)[e.source];this.renderTileClippingMasks(e,i[e.source],!!this.renderToTexture),this.renderLayer(this,t,e,l,s)}if(s.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let e=WZe(this.style,this.transform.zoom);e&&this.drawFunctions.debug(this,e,e.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(){if(!this.style?.map?.terrain)return;let e=this.terrainFacilitator.matrix,t=this.transform.modelViewProjectionMatrix,n=this.terrainFacilitator.depthDirty;n||=!ePe(e,t),n||=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime),n&&(XNe(e,t),this.terrainFacilitator.renderTime=LJ(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}renderLayer(e,t,n,r,i){if(n.isHidden(this.transform.zoom)||n.type!==`background`&&n.type!==`custom`&&!(r||[]).length)return;this.id=n.id;let a=this.drawFunctions;UBe(n)?a.symbol(e,t,n,r,this.style.placement.variableOffsets,i):$Le(n)?a.circle(e,t,n,r,i):iRe(n)?a.heatmap(e,t,n,r,i):rBe(n)?a.line(e,t,n,r,i):oze(n)?a.fill(e,t,n,r,i):Lze(n)?a.fillExtrusion(e,t,n,r,i):lRe(n)?a.hillshade(e,t,n,r,i):hRe(n)?a.colorRelief(e,t,n,r,i):gW(n)?a.raster(e,t,n,r,i):JBe(n)?a.background(e,t,n,r,i):ZBe(n)&&a.custom(e,t,n,i)}
1209static{this.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50}saveTileTexture(t){let n=this._tileTextures[t.size[0]];n?n.length<e.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?n.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(e){let t=this._tileTextures[e];return t&&t.length>0?t.pop():null}acquireRTT(e){let t=this.context.gl,n=this._rttObjectRecyclePool.pop();if(n)return n.size!==e&&(t.bindTexture(t.TEXTURE_2D,n.texture.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,e,0,t.RGBA,t.UNSIGNED_BYTE,null),n.texture.size=[e,e],n.size=e),n;let r=new uK(this.context,{width:e,height:e,data:null},t.RGBA);return r.bind(t.LINEAR,t.CLAMP_TO_EDGE),this.context.extTextureFilterAnisotropic&&t.texParameterf(t.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:r,size:e}}bindRTT(e){let t=this.context.gl,n=e.size;if(!this._rttSharedFbo){let e=this.context.createFramebuffer(n,n,!0,!0),r=this.context.createRenderbuffer(t.DEPTH_STENCIL,n,n);e.depthAttachment.set(r),this._rttSharedFbo={fbo:e,depthRenderbuffer:r,size:n}}this._rttSharedFbo.size!==n&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n,n),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=n,this._rttSharedFbo.fbo.height=n,this._rttSharedFbo.size=n),this._rttSharedFbo.fbo.colorAttachment.set(e.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(e){this._rttObjectRecyclePool.push(e)}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.patternAtlas.getPattern(e.from.toString()),n=this.patternAtlas.getPattern(e.to.toString());return!t||!n}useProgram(e,t,n=!1,r=[]){this.cache||={};let i=!!this.style.map.terrain,a=this.style.projection,o=n?MY.projectionMercator:a.shaderPreludeCode,s=n?Bqe:a.shaderDefine,c=`/${n?Vqe:a.shaderVariantName}`,l=t?t.cacheKey:``,u=this._showOverdrawInspector?`/overdraw`:``,d=i?`/terrain`:``,f=r?`/${r.join(`/`)}`:``,p=e+l+c+u+d+f;return this.cache[p]||=new JJe(this.context,MY[e],t,tXe[e],this._showOverdrawInspector,i,o,s,r),this.cache[p]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}setBaseState(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement(`canvas`),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let e=this.context.gl;this.debugOverlayTexture=new uK(this.context,this.debugOverlayCanvas,e.RGBA)}}destroy(){if(this._tileTextures){for(let e in this._tileTextures){let t=this._tileTextures[e];if(t)for(let e of t)e.destroy()}this._tileTextures={}}for(let e of this._rttObjectRecyclePool)e.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let e=this.context.gl;e.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),e.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}if(this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let e in this.cache){let t=this.cache[e];t?.program&&this.context.gl.deleteProgram(t.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}
vendor: 23,111 bytes, line 1209
1209,eQe=class extends Error{constructor(e,t){super(`WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL`),this.name=`GPUInitializationError`,this.requestedAttributes=e,this.statusMessage=t?.statusMessage??null}};function tQe(e,t){let n=!1,r=null,i,a=()=>{r=null,n&&=(e(...i),r=setTimeout(a,t),!1)};return(...e)=>(n=!0,i=e,r||a(),r)}var nQe=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace(`#`,``)),this._getCurrentHash=()=>{let e=this._getHashParams();return this._hashName?(e.get(this._hashName)||``).split(`/`):([...e.keys()][0]??``).split(`/`)},this._onHashChange=()=>{let e=this._getCurrentHash();if(!this._isValidHash(e))return!1;let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{let e=this._getHashParams();if(this._hashName)e.delete(this._hashName);else{let t=Array.from(e.keys());t.length>0&&e.delete(t[0])}let t=decodeURIComponent(e.toString()).replace(/=&/g,`&`).replace(/=$/g,``),n=t?`#${t}`:``,r=window.location.href.replace(/(#.+)?$/,n);r=r.replace(`&&`,`&`),window.history.replaceState(window.history.state,null,r)},this._updateHash=tQe(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener(`hashchange`,this._onHashChange,!1),this._map.on(`moveend`,this._updateHash),this}remove(){return removeEventListener(`hashchange`,this._onHashChange,!1),this._map.off(`moveend`,this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let t=this._map.getCenter(),n=Math.round(this._map.getZoom()*100)/100,r=10**Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.round(t.lng*r)/r,a=Math.round(t.lat*r)/r,o=this._map.getBearing(),s=this._map.getPitch(),c=``;if(c+=e?`/${i}/${a}/${n}`:`${n}/${a}/${i}`,(o||s)&&(c+=`/${Math.round(o*10)/10}`),s&&(c+=`/${Math.round(s)}`),this._hashName){let e=this._getHashParams();return e.set(this._hashName,c),`#${decodeURIComponent(e.toString()).replace(/=&/g,`&`).replace(/=$/g,``)}`}return`#${c}`}_isValidHash(e){if(e.length<3||e.some(e=>isNaN(+e)))return!1;try{new qK(+e[2],+e[1])}catch{return!1}let t=+e[0],n=+(e[3]||0),r=+(e[4]||0);return t>=this._map.getMinZoom()&&t<=this._map.getMaxZoom()&&n>=-180&&n<=180&&r>=this._map.getMinPitch()&&r<=this._map.getMaxPitch()}},yX={linearity:.3,easing:nz(0,0,.3,1)},rQe=oz({deceleration:2500,maxSpeed:1400},yX),iQe=oz({deceleration:20,maxSpeed:1400},yX),aQe=oz({deceleration:1e3,maxSpeed:360},yX),oQe=oz({deceleration:1e3,maxSpeed:90},yX),sQe=oz({deceleration:1e3,maxSpeed:360},yX),cQe=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:LJ(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=LJ();for(;e.length>0&&t-e[0].time>160;)e.shift()}_getVelocityEntries(){let e=this._inertiaBuffer,t=LJ()-60,n=Math.max(0,e.length-2);for(;n>0&&e[n-1].time>=t;)n--;return e.slice(n)}_onMoveEnd(e){this._drainInertiaBuffer();let t=this._getVelocityEntries();if(t.length<2){this.clear();return}let n={zoom:0,bearing:0,pitch:0,roll:0,pan:new K(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of t)e.around&&(n.around=e.around),e.pinchAround&&(n.pinchAround=e.pinchAround);for(let{settings:e}of t.slice(1))n.zoom+=e.zoomDelta||0,n.bearing+=e.bearingDelta||0,n.pitch+=e.pitchDelta||0,n.roll+=e.rollDelta||0,e.panDelta&&n.pan._add(e.panDelta);if(!n.pan.mag()&&!n.zoom&&!n.bearing&&!n.pitch&&!n.roll){this.clear();return}let r=LJ()-t[0].time,i={};if(n.pan.mag()){let t=xX(n.pan.mag(),r,oz({},rQe,e||{})),a=n.pan.mult(t.amount/n.pan.mag()),o=this._map._camera.cameraHelper.handlePanInertia(a,this._map._camera.transform);i.center=o.easingCenter,i.offset=o.easingOffset,bX(i,t)}if(n.zoom){let e=xX(n.zoom,r,iQe);i.zoom=dz(this._map.getZoom()+e.amount,this._map.getZoomSnap(),e.amount),bX(i,e)}if(n.bearing){let e=xX(n.bearing,r,aQe);i.bearing=this._map.getBearing()+iz(e.amount,-179,179),bX(i,e)}if(n.pitch){let e=xX(n.pitch,r,oQe);i.pitch=this._map.getPitch()+e.amount,bX(i,e)}if(n.roll){let e=xX(n.roll,r,sQe);i.roll=this._map.getRoll()+iz(e.amount,-179,179),bX(i,e)}if(i.zoom||i.bearing){let e=n.pinchAround===void 0?n.around:n.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),oz(i,{noMoveStart:!0})}};function bX(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function xX(e,t,n){let{maxSpeed:r,linearity:i,deceleration:a}=n,o=iz(e*i/(t/1e3),-r,r),s=Math.abs(o)/(a*i);return{easing:n.easing,duration:s*1e3,amount:s/2*o}}var lQe=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new ZWe(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new WJ(e.type,this._map,e))}mouseup(e){this._map.fire(new WJ(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new WJ(e.type,this._map,e))}dblclick(e){return this._firePreventable(new WJ(e.type,this._map,e))}mouseover(e){this._map.fire(new WJ(e.type,this._map,e))}mouseout(e){this._map.fire(new WJ(e.type,this._map,e))}touchstart(e){return this._firePreventable(new GJ(e.type,this._map,e))}touchmove(e){this._map.fire(new GJ(e.type,this._map,e))}touchend(e){this._map.fire(new GJ(e.type,this._map,e))}touchcancel(e){this._map.fire(new GJ(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},uQe=class{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new WJ(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new WJ(`contextmenu`,this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new WJ(e.type,this._map,e)),this._map.listens(`contextmenu`)&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},dQe=class{constructor(e,t,n){this._map=e,this._tr=n,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1,t.boxZoom&&typeof t.boxZoom==`object`&&(this._boxZoomEnd=t.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(RJ.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let n=t;if(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;let r=this._startPos;this._lastPos=n,this._box||(this._box=RJ.create(`div`,`maplibregl-boxzoom`,this._container),this._container.classList.add(`maplibregl-crosshair`),this._fireEvent(`boxzoomstart`,e));let i=Math.min(r.x,n.x),a=Math.max(r.x,n.x),o=Math.min(r.y,n.y),s=Math.max(r.y,n.y);this._box.style.transform=`translate(${i}px,${o}px)`,this._box.style.width=`${a-i}px`,this._box.style.height=`${s-o}px`}mouseupWindow(e,t){if(!this._active||e.button!==0)return;let n=this._startPos,r=t;if(this.reset(),RJ.suppressClick(),n.x===r.x&&n.y===r.y)this._fireEvent(`boxzoomcancel`,e);else{if(this._map.fire(new QWe(`boxzoomend`,{originalEvent:e})),this._boxZoomEnd){this._boxZoomEnd(this._map,n,r,e);return}return{cameraAnimation:e=>e.fitScreenCoordinates(n,r,this._tr.bearing,{linear:!0})}}}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent(`boxzoomcancel`,e))}reset(){this._active=!1,this._container.classList.remove(`maplibregl-crosshair`),this._box&&=(this._box.remove(),null),RJ.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new QWe(e,{originalEvent:t}))}};function SX(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let n={};for(let r=0;r<e.length;r++)n[e[r].identifier]=t[r];return n}function fQe(e){let t=new K(0,0);for(let n of e)t._add(n);return t.div(e.length)}var pQe=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,t,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=fQe(t),this.touches=SX(n,t)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;let r=SX(n,t);for(let e in this.touches){let t=this.touches[e],n=r[e];(!n||n.dist(t)>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}},CX=class{constructor(e){this.singleTap=new pQe(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){let r=this.singleTap.touchend(e,t,n);if(r){let t=e.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(r)<30;if((!t||!n)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}},mQe=class{constructor(e,t){this._tr=t,this._zoomIn=new CX({numTouches:1,numTaps:2}),this._zoomOut=new CX({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,t,n){let r=this._zoomIn.touchend(e,t,n),i=this._zoomOut.touchend(e,t,n),a=this._tr;if(r)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:dz(a.zoom+1,t.getZoomSnap()),around:a.unproject(r)},{originalEvent:e})};if(i)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:dz(a.zoom-1,t.getZoomSnap()),around:a.unproject(i)},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},wX=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){!this.isEnabled()||this._lastPoint||this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(t)?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let n=this._lastPoint;if(!n)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let r=Array.isArray(t)?t[0]:t;if(!(!this._moved&&r.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=r,this._move(n,r)}dragEnd(e){!this.isEnabled()||!this._lastPoint||this._moveStateManager.isValidEndEvent(e)&&(this._moved&&RJ.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}},hQe={0:1,2:2};function gQe(e,t){let n=hQe[t];return e.buttons===void 0||(e.buttons&n)!==n}var TX=class{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){this._eventButton=e.button}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!gQe(e,this._eventButton)}isValidEndEvent(e){return e.button===this._eventButton}},_Qe=class{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}},vQe=class{constructor(e=new TX({checkCorrectEvent:()=>!0}),t=new _Qe){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=t}_executeRelevantHandler(e,t,n){if(e instanceof MouseEvent)return t(e);if(typeof TouchEvent<`u`&&e instanceof TouchEvent)return n(e)}startMove(e){this._executeRelevantHandler(e,e=>{this.mouseMoveStateManager.startMove(e)},e=>{this.oneFingerTouchMoveStateManager.startMove(e)})}endMove(e){this._executeRelevantHandler(e,e=>{this.mouseMoveStateManager.endMove(e)},e=>{this.oneFingerTouchMoveStateManager.endMove(e)})}isValidStartEvent(e){return!!this._executeRelevantHandler(e,e=>this.mouseMoveStateManager.isValidStartEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidStartEvent(e))}isValidMoveEvent(e){return!!this._executeRelevantHandler(e,e=>this.mouseMoveStateManager.isValidMoveEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(e))}isValidEndEvent(e){return!!this._executeRelevantHandler(e,e=>this.mouseMoveStateManager.isValidEndEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidEndEvent(e))}},EX=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}};function yQe({enable:e,clickTolerance:t}){return new wX({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:new TX({checkCorrectEvent:e=>e.button===0&&!e.ctrlKey}),enable:e,assignEvents:EX})}function bQe({enable:e,clickTolerance:t,aroundCenter:n=!0,minPixelCenterThreshold:r=100,rotateSpeed:i=.8},a){return new wX({clickTolerance:t,move:(e,t)=>{let o=a();if(n&&Math.abs(o.y-e.y)>r)return{bearingDelta:Dz(new K(e.x,t.y),t,o)};let s=(t.x-e.x)*i;return n&&t.y<o.y&&(s=-s),{bearingDelta:s}},moveStateManager:new TX({checkCorrectEvent:e=>e.button===0&&e.ctrlKey||e.button===2&&!e.ctrlKey}),enable:e,assignEvents:EX})}function xQe({enable:e,clickTolerance:t,pitchSpeed:n=-.5}){return new wX({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:new TX({checkCorrectEvent:e=>e.button===0&&e.ctrlKey||e.button===2}),enable:e,assignEvents:EX})}function SQe({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:n=.3},r){return new wX({clickTolerance:t,move:(e,t)=>{let i=r(),a=(t.x-e.x)*n;return t.y<i.y&&(a=-a),{rollDelta:a}},moveStateManager:new TX({checkCorrectEvent:e=>e.button===2&&e.ctrlKey}),enable:e,assignEvents:EX})}var CQe=class{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new K(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(e,t,n){if(this._active){if(this._shouldBePrevented(n.length)){this._map.cooperativeGestures.notifyGestureBlocked(`touch_pan`,e);return}return e.preventDefault(),this._calculateTransform(e,t,n)}}touchend(e,t,n){this._calculateTransform(e,t,n),this._active&&this._shouldBePrevented(n.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,t,n){n.length>0&&(this._active=!0);let r=SX(n,t),i=new K(0,0),a=new K(0,0),o=0;for(let e in r){let t=r[e],n=this._touches[e];n&&(i._add(t),a._add(t.sub(n)),o++,r[e]=t)}if(this._touches=r,this._shouldBePrevented(o)||!a.mag())return;let s=a.div(o);if(this._sum._add(s),!(this._sum.mag()<this._clickTolerance))return{around:i.div(o),panDelta:s}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},DX=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){if(!this._firstTwoTouches)return;e.preventDefault();let[r,i]=this._firstTwoTouches,a=OX(n,t,r),o=OX(n,t,i);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;let[r,i]=this._firstTwoTouches,a=OX(n,t,r),o=OX(n,t,i);a&&o||(this._active&&RJ.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around===`center`}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function OX(e,t,n){for(let r=0;r<e.length;r++)if(e[r].identifier===n)return t[r]}var wQe=.1;function TQe(e,t){return Math.log(e/t)/Math.LN2}var EQe=class extends DX{constructor(){super(),this._zoomRate=1,this._zoomThreshold=wQe}setZoomRate(e){this._zoomRate=e??1}setZoomThreshold(e){this._zoomThreshold=e??wQe}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let n=this._distance;if(this._distance=e[0].dist(e[1]),!(!this._active&&Math.abs(TQe(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:TQe(this._distance,n)*this._zoomRate,pinchAround:t}}};function DQe(e,t){return e.angleWith(t)*180/Math.PI}var OQe=class extends DX{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,n){let r=this._vector;if(this._vector=e[0].sub(e[1]),!(!this._active&&this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:DQe(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,n=DQe(e,this._startVector);return Math.abs(n)<t}};function kX(e){return Math.abs(e.y)>Math.abs(e.x)}var kQe=class extends DX{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,n){super.touchstart(e,t,n),this._currentTouchCount=n.length}_start(e){this._lastPoints=e,kX(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,n){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}}gestureBeginsVertically(e,t,n){if(this._valid!==void 0)return this._valid;let r=e.mag()>=2,i=t.mag()>=2;if(!r&&!i)return;if(!r||!i)return this._firstMove===void 0&&(this._firstMove=n),n-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return kX(e)&&kX(t)&&a}},AQe={panStep:100,bearingStep:15,pitchStep:10},jQe=class{constructor(e,t){this._tr=t;let n=AQe;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,n=0,r=0,i=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?r=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=0,r=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:`keyboardHandler`,easing:MQe,zoom:t?dz(s.zoom+t*(e.shiftKey?2:1),o.getZoomSnap()):s.zoom,bearing:s.bearing+n*this._bearingStep,pitch:s.pitch+r*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}};function MQe(e){return e*(2-e)}var NQe=4.000244140625,PQe=class{constructor(e,t,n){this._onTimeout=e=>{this._type=`wheel`,this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=n,this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around===`center`)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return this._map.cooperativeGestures.isEnabled()?!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e)):!1}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e)){this._map.cooperativeGestures.notifyGestureBlocked(`wheel_zoom`,e);return}let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY,n=LJ(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,t!==0&&t%NQe==0?this._type=`wheel`:t!==0&&Math.abs(t)<4?this._type=`trackpad`:r>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*t)<200?`trackpad`:`wheel`,this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let t=RJ.mousePos(this._map.getCanvas(),e),n=this._tr;this._aroundPoint=this._aroundCenter?n.transform.locationToScreenPoint(qK.convert(n.center)):t,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom==`number`){let t=e.zoom-this._lastExpectedZoom;
vendor: 4,951 bytes, line 1209
1209typeof this._startZoom==`number`&&(this._startZoom+=t),typeof this._targetZoom==`number`&&(this._targetZoom+=t)}if(this._delta!==0){let t=this._type===`wheel`&&Math.abs(this._delta)>NQe?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&n!==0&&(n=1/n);let r=typeof this._targetZoom==`number`?lz(this._targetZoom):e.scale,i=e.applyConstrain(e.getCameraLngLat(),uz(r*n)).zoom,a=this._map.getZoomSnap();if(this._type===`wheel`&&a>0){let t=dz(e.zoom,a);this._targetZoom=dz(i,a,i-t)}else this._targetZoom=i;this._type===`wheel`&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let t=typeof this._targetZoom==`number`?this._targetZoom:e.zoom,n=this._startZoom,r=this._easing,i=!1,a;if(this._type===`wheel`&&n&&r){let e=LJ()-this._lastWheelEventTime,o=Math.min((e+5)/200,1),s=r(o);a=_V.number(n,t,s),o<1?this._needsRerender=!0:i=!0}else a=t,i=!0;return this._active=!0,i&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!i,zoomDelta:a-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=rz;if(this._prevEase){let e=this._prevEase,n=(LJ()-e.start)/e.duration,r=e.easing(n+.01)-e.easing(n),i=.27/Math.sqrt(r*r+1e-4)*.01;t=nz(i,Math.sqrt(.0729-i*i),.25,1)}return this._prevEase={start:LJ(),duration:e,easing:t},t}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},FQe=class{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}},IQe=class{constructor(e,t){this._tr=t,this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:dz(this._tr.zoom+(e.shiftKey?-1:1),n.getZoomSnap()),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},LQe=class{constructor(){this._tap=new CX({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,n){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(e,t,n);else{let r=t[0],i=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(r)<30;!i||!a?this.reset():n.length>0&&(this._swipePoint=r,this._swipeTouch=n[0].identifier)}}touchmove(e,t,n){if(!this._tapTime)this._tap.touchmove(e,t,n);else if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;let r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128*this._zoomRate}}}touchend(e,t,n){if(this._tapTime)this._swipePoint&&n.length===0&&this.reset();else{let r=this._tap.touchend(e,t,n);r&&(this._tapTime=e.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},RQe=class{constructor(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add(`maplibregl-touch-drag-pan`)}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove(`maplibregl-touch-drag-pan`)}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},zQe=class{constructor(e,t,n,r){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=n,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},BQe=class{constructor(e,t,n,r){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add(`maplibregl-touch-zoom-rotate`)}
vendor: 4,508 bytes, line 1209
1209disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove(`maplibregl-touch-zoom-rotate`)}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},VQe=class{constructor(e,t){this._bypassKey=navigator.userAgent.includes(`Mac`)?`metaKey`:`ctrlKey`,this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add(`maplibregl-cooperative-gestures`),this._container=RJ.create(`div`,`maplibregl-cooperative-gesture-screen`,e);let t=this._map._getUIString(`CooperativeGesturesHandler.WindowsHelpText`);this._bypassKey===`metaKey`&&(t=this._map._getUIString(`CooperativeGesturesHandler.MacHelpText`));let n=this._map._getUIString(`CooperativeGesturesHandler.MobileHelpText`),r=document.createElement(`div`);r.className=`maplibregl-desktop-message`,r.textContent=t,this._container.appendChild(r);let i=document.createElement(`div`);i.className=`maplibregl-mobile-message`,i.textContent=n,this._container.appendChild(i),this._container.setAttribute(`aria-hidden`,`true`)}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove(`maplibregl-cooperative-gestures`)),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,t){this._enabled&&(this._map.fire(new BJ(`cooperativegestureprevented`,{gestureType:e,originalEvent:t})),this._container.classList.add(`maplibregl-show`),setTimeout(()=>{this._container.classList.remove(`maplibregl-show`)},100))}},HQe=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(K.convert(e),this._camera.terrain)}},AX=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate,UQe=class extends Kz{};function jX(e){return e.panDelta?.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}var WQe=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(e,t,n){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if(e.type===`blur`){this.stop(!0);return}this._updatingCamera=!0;let n=e.type===`renderFrame`?void 0:e,r={needsRenderFrame:!1},i={},a={};for(let{handlerName:o,handler:s,allowed:c}of this._handlers){if(!s.isEnabled())continue;let l;if(this._blockedByActive(a,c,o))s.reset();else if(s[t||e.type]){if(FPe(e,t||e.type)){let n=RJ.mousePos(this._map.getCanvas(),e);l=s[t||e.type](e,n)}else if(PPe(e,t||e.type)){let n=e.touches,r=this._getMapTouches(n),i=RJ.touchPos(this._map.getCanvas(),r);l=s[t||e.type](e,i,r)}else IPe(t||e.type)||(l=s[t||e.type](e));this.mergeHandlerResult(r,i,l,o,n),l?.needsRenderFrame&&this._triggerRenderFrame()}(l||s.isActive())&&(a[o]=s)}let o={};for(let e in this._previousActiveHandlers)a[e]||(o[e]=n);this._previousActiveHandlers=a,(Object.keys(o).length||jX(r))&&(this._changes.push([r,i,o]),this._triggerRenderFrame()),(Object.keys(a).length||jX(r))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:s}=r;s&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],s(this._map))},this._map=e,this._camera=t,this._transformProvider=new HQe(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new cQe(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);let r=this._el;this._listeners=[[r,`touchstart`,{passive:!0}],[r,`touchmove`,{passive:!1}
vendor: 7,969 bytes, line 1209
1209],[r,`touchend`,void 0],[r,`touchcancel`,void 0],[r,`mousedown`,void 0],[r,`mousemove`,void 0],[r,`mouseup`,void 0],[this._ownerDocument,`mousemove`,{capture:!0}],[this._ownerDocument,`mouseup`,void 0],[r,`mouseover`,void 0],[r,`mouseout`,void 0],[r,`dblclick`,void 0],[r,`click`,void 0],[r,`keydown`,{capture:!1}],[r,`keyup`,void 0],[r,`wheel`,{passive:!1}],[r,`contextmenu`,void 0],[this._ownerWindow,`blur`,void 0]];for(let[e,t,n]of this._listeners)e.addEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(let[e,t,n]of this._listeners)e.removeEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){let t=this._map,n=t.getCanvasContainer();this._add(`mapEvent`,new lQe(t,e));let r=t.boxZoom=new dQe(t,e,this._transformProvider);this._add(`boxZoom`,r),e.interactive&&e.boxZoom&&r.enable();let i=t.cooperativeGestures=new VQe(t,e.cooperativeGestures);this._add(`cooperativeGestures`,i),e.cooperativeGestures&&i.enable();let a=new mQe(t,this._transformProvider),o=new IQe(t,this._transformProvider);t.doubleClickZoom=new FQe(o,a),this._add(`tapZoom`,a),this._add(`clickZoom`,o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new LQe;this._add(`tapDragZoom`,s);let c=t.touchPitch=new kQe(t);this._add(`touchPitch`,c),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let l=()=>t.project(t.getCenter()),u=bQe(e,l),d=xQe(e),f=SQe(e,l);t.dragRotate=new zQe(e,u,d,f),this._add(`mouseRotate`,u,[`mousePitch`]),this._add(`mousePitch`,d,[`mouseRotate`,`mouseRoll`]),this._add(`mouseRoll`,f,[`mousePitch`]),e.interactive&&e.dragRotate&&t.dragRotate.enable();let p=yQe(e),m=new CQe(e,t);t.dragPan=new RQe(n,p,m),this._add(`mousePan`,p),this._add(`touchPan`,m,[`touchZoom`,`touchRotate`]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let h=new OQe,g=new EQe;t.touchZoomRotate=new BQe(n,g,h,s),this._add(`touchRotate`,h,[`touchPan`,`touchZoom`]),this._add(`touchZoom`,g,[`touchPan`,`touchRotate`]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),this._add(`blockableMapEvent`,new uQe(t));let _=t.scrollZoom=new PQe(t,()=>this._triggerRenderFrame(),this._transformProvider);this._add(`scrollZoom`,_,[`mousePan`]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let v=t.keyboard=new jQe(t,this._transformProvider);this._add(`keyboard`,v),e.interactive&&e.keyboard&&t.keyboard.enable()}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!AX(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,n){for(let r in e)if(r!==n&&!t?.includes(r))return!0;return!1}_getMapTouches(e){let t=[];for(let n of e){let e=n.target;this._el.contains(e)&&t.push(n)}return t}mergeHandlerResult(e,t,n,r,i){if(!n)return;oz(e,n);let a={handlerName:r,originalEvent:n.originalEvent||i};n.zoomDelta!==void 0&&(t.zoom=a),n.panDelta!==void 0&&(t.drag=a),n.rollDelta!==void 0&&(t.roll=a),n.pitchDelta!==void 0&&(t.pitch=a),n.bearingDelta!==void 0&&(t.rotate=a)}_applyChanges(){let e={},t={},n={};for(let[r,i,a]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new K(0,0))._add(r.panDelta)),r.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+r.pitchDelta),r.rollDelta&&(e.rollDelta=(e.rollDelta||0)+r.rollDelta),r.around!==void 0&&(e.around=r.around),r.pinchAround!==void 0&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),oz(t,i),oz(n,a);this._updateMapTransform(e,t,n),this._changes=[]}_updateMapTransform(e,t,n){let r=this._map,i=this._camera.getTransformForUpdate(),a=r.terrain;if(!jX(e)&&!(a&&this._terrainMovement)){this._fireEvents(t,n,!0);return}this._camera.stop(!0);let{panDelta:o,zoomDelta:s,bearingDelta:c,pitchDelta:l,rollDelta:u}=e,{around:d,aroundOnSurface:f}=this._resolveAround(e,a,i),p=a?this._terrainGestureElevation(a,d,f,i,t):void 0,m={panDelta:o,zoomDelta:s,rollDelta:u,pitchDelta:l,bearingDelta:c,around:d,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!i.isPointOnMapSurface(d)&&(d=i.centerPoint);let h=this._computePreZoomAroundLoc(i,d,o,p);this._handleMapControls({terrain:a,tr:i,deltasForHelper:m,preZoomAroundLoc:h,combinedEventsInProgress:t,panDelta:o}),this._camera.applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,n,!0)}_resolveAround(e,t,n){let r=e.pinchAround===void 0?e.around:e.pinchAround;return r||=this._camera.transform.centerPoint,t&&!n.isPointOnMapSurface(r)?{around:n.centerPoint,aroundOnSurface:!1}:{around:r,aroundOnSurface:!0}}_terrainGestureElevation(e,t,n,r,i){if(!n)return;if(!this._terrainMovement&&(i.drag||i.zoom)){let n=r.screenTerrainPointToMercatorCoordinate(t,e);this._terrainGestureAnchorElevation=n?n.z:null}if(this._terrainGestureAnchorElevation===null)return;let a=this._terrainGestureAnchorElevation;if(!(t.distSqr(r.centerPoint)<.01)&&!(a-r.elevation>=.9*(r.getCameraAltitude()-r.elevation)))return a}_computePreZoomAroundLoc(e,t,n,r){if(t.distSqr(e.centerPoint)<.01)return e.center;let i=n?t.sub(n):t;return r===void 0?e.screenPointToLocation(i):e.screenPointToLocationAtElevation(i,r)}_handleMapControls({terrain:e,tr:t,deltasForHelper:n,preZoomAroundLoc:r,combinedEventsInProgress:i,panDelta:a}){let o=this._camera.cameraHelper;if(o.handleMapControlsRollPitchBearingZoom(n,t),!e){o.handleMapControlsPan(n,t,r);return}if(o.useGlobeControls){!this._terrainMovement&&(i.drag||i.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),o.handleMapControlsPan(n,t,r);return}if(!this._terrainMovement&&(i.drag||i.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,o.handleMapControlsPan(n,t,r);return}if(n.aroundElevation===void 0&&i.drag&&this._terrainMovement&&a){t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a)));return}o.handleMapControlsPan(n,t,r)}_fireEvents(e,t,n){let r=AX(this._eventsInProgress),i=AX(e),a={};for(let t in e){let{originalEvent:n}=e[t];this._eventsInProgress[t]||(a[`${t}start`]=n),this._eventsInProgress[t]=e[t]}!r&&i&&this._fireEvent(`movestart`,i.originalEvent);for(let e in a)this._fireEvent(e,a[e]);i&&this._fireEvent(`move`,i.originalEvent);for(let t in e){let{originalEvent:n}=e[t];this._fireEvent(t,n)}let o={},s;for(let e in this._eventsInProgress){let{handlerName:n,originalEvent:r}=this._eventsInProgress[e];this._handlersById[n].isActive()||(delete this._eventsInProgress[e],s=t[n]||r,o[`${e}end`]=s)}for(let e in o)this._fireEvent(e,o[e]);let c=AX(this._eventsInProgress),l=(r||i)&&!c;if(l&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let e=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&e.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(e)}if(n&&l){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),t=e=>e!==0&&-this._bearingSnap<e&&e<this._bearingSnap;e&&(e.essential||!IJ.prefersReducedMotion)?(t(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:s})):(this._map.fire(new VJ(`moveend`,{originalEvent:s})),t(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(e,t){this._map.fire(new VJ(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new UQe(`renderFrame`,{timeStamp:e})),this._applyChanges()})}
vendor: 5,358 bytes, line 1209
1209_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},GQe=class extends Jz{constructor(e){super(),this._renderFrameCallback=()=>{let e=Math.min((LJ()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new LY,this.cameraHelper=new BY,e.minZoom!==void 0&&this.transform.setMinZoom(e.minZoom),e.maxZoom!==void 0&&this.transform.setMaxZoom(e.maxZoom),e.minPitch!==void 0&&this.transform.setMinPitch(e.minPitch),e.maxPitch!==void 0&&this.transform.setMaxPitch(e.maxPitch),e.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(e.renderWorldCopies),e.transformConstrain!==null&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=e.centerClampedToGround??!0,this.transformCameraUpdate=e.transformCameraUpdate??null,this._stopHandlers=e.stopHandlers??(()=>{}),this.on(`moveend`,()=>{delete this._requestedCameraState})}migrateProjection(e,t){e.apply(this.transform,!0),this.transform=e,this.cameraHelper=t}getCenter(){return new qK(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,t,n){return e=K.convert(e).mult(-1),this.panTo(this.transform.center,oz({offset:e},t),n)}panTo(e,t,n){return this.easeTo(oz({center:e},t),n)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,n){return this.easeTo(oz({zoom:e},t),n)}zoomIn(e,t){return this.zoomTo(dz(this.getZoom()+1,this._zoomSnap),e,t),this}zoomOut(e,t){return this.zoomTo(dz(this.getZoom()-1,this._zoomSnap),e,t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,t){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new VJ(`movestart`,t)).fire(new VJ(`move`,t)).fire(new VJ(`moveend`,t))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,n){return this.easeTo(oz({bearing:e},t),n)}resetNorth(e,t){return this.rotateTo(0,oz({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(oz({bearing:0,pitch:0,roll:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getRoll(){return this.transform.roll}setRoll(e,t){return this.jumpTo({roll:e},t),this}cameraForBounds(e,t){e=QJ.convert(e).adjustAntiMeridian();let n=t?.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,t)}_cameraForBoxAndBearing(e,t,n,r){let i={top:0,bottom:0,right:0,left:0};if(r=oz({padding:i,offset:[0,0],maxZoom:this.transform.maxZoom},r),typeof r.padding==`number`){let e=r.padding;r.padding={top:e,bottom:e,right:e,left:e}}let a=oz(i,r.padding);r.padding=a;let o=this.transform,s=new QJ(e,t),c=this.cameraHelper.cameraForBoxAndBearing(r,a,s,n,o);return c&&this._zoomSnap&&(c.zoom=dz(c.zoom,this._zoomSnap,-1)),c}fitBounds(e,t,n){return this._fitInternal(this.cameraForBounds(e,t),t,n)}fitScreenCoordinates(e,t,n,r,i){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(K.convert(e)),this.transform.screenPointToLocation(K.convert(t)),n,r),r,i)}_fitInternal(e,t,n){return e?(t=oz(e,t),delete t.padding,t.linear?this.easeTo(t,n):this.flyTo(t,n)):this}jumpTo(e,t){this.stop(),`zoom`in e&&this._zoomSnap&&(e.zoom=dz(e.zoom,this._zoomSnap));let n=this.getTransformForUpdate(),r=!1,i=!1,a=!1,o=n.zoom;this.terrain&&n.setElevation(this.terrain.getElevationForLngLatZoom(e.center?qK.convert(e.center):n.center,e.zoom||n.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(n,e);let s=n.zoom!==o;return`elevation`in e&&n.elevation!==+e.elevation&&n.setElevation(+e.elevation),`bearing`in e&&n.bearing!==+e.bearing&&(r=!0,n.setBearing(+e.bearing)),`pitch`in e&&n.pitch!==+e.pitch&&(i=!0,n.setPitch(+e.pitch)),`roll`in e&&n.roll!==+e.roll&&(a=!0,n.setRoll(+e.roll)),e.padding!=null&&!n.isPaddingEqual(e.padding)&&n.setPadding(e.padding),this.applyUpdatedTransform(n),this.fire(new VJ(`movestart`,t)).fire(new VJ(`move`,t)),s&&this.fire(new VJ(`zoomstart`,t)).fire(new VJ(`zoom`,t)).fire(new VJ(`zoomend`,t)),r&&this.fire(new VJ(`rotatestart`,t)).fire(new VJ(`rotate`,t)).fire(new VJ(`rotateend`,t)),i&&this.fire(new VJ(`pitchstart`,t)).fire(new VJ(`pitch`,t)).fire(new VJ(`pitchend`,t)),a&&this.fire(new VJ(`rollstart`,t)).fire(new VJ(`roll`,t)).fire(new VJ(`rollend`,t)),this.fire(new VJ(`moveend`,t))}calculateCameraOptionsFromTo(e,t,n,r=0){let i=$K.fromLngLat(e,t),a=$K.fromLngLat(n,r),o=a.x-i.x,s=a.y-i.y,c=a.z-i.z,l=Math.hypot(o,s,c);
1209if(l===0)throw Error(`Can't calculate camera options with same From and To`);let u=Math.hypot(o,s),d=uz(this.transform.cameraToCenterDistance/l/this.transform.tileSize),f=Math.atan2(o,-s)*180/Math.PI,p=Math.acos(u/l)*180/Math.PI;return p=c<0?90-p:90+p,{center:a.toLngLat(),elevation:r,zoom:d,pitch:p,bearing:f}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,n,r,i){let a=this.transform.calculateCenterFromCameraLngLatAlt(e,t,n,r);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:n,pitch:r,roll:i}}easeTo(e,t){this._stop(!1,e.easeId),e=oz({offset:[0,0],duration:500,easing:rz},e),`zoom`in e&&this._zoomSnap&&(e.zoom=dz(e.zoom,this._zoomSnap)),(e.animate===!1||!e.essential&&IJ.prefersReducedMotion)&&(e.duration=0);let n=this.getTransformForUpdate(),r=this.getBearing(),i=n.pitch,a=n.roll,o=`bearing`in e?this._normalizeBearing(e.bearing,r):r,s=`pitch`in e?+e.pitch:i,c=`roll`in e?this._normalizeBearing(e.roll,a):a,l=`padding`in e?e.padding:n.padding,u=K.convert(e.offset),d,f;e.around&&(d=qK.convert(e.around),f=n.locationToScreenPoint(d));let p={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},m=this.cameraHelper.handleEaseTo(n,{bearing:o,pitch:s,roll:c,padding:l,around:d,aroundPoint:f,offsetAsPoint:u,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating||=r!==o,this._pitching||=s!==i,this._rolling||=c!==a,this._padding=!n.isPaddingEqual(l),this._zooming||=m.isZooming,this._easeId=e.easeId,this._prepareEase(t,e.noMoveStart,p),this.terrain&&this._prepareElevation(m.elevationCenter),this._ease(r=>{m.easeFunc(r),this.terrain&&!e.freezeElevation&&this._updateElevation(r),this.applyUpdatedTransform(n),this._fireMoveEvents(t)},n=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(t,n)},e),this}_prepareEase(e,t,n={}){this._moving=!0,!t&&!n.moving&&this.fire(new VJ(`movestart`,e)),this._zooming&&!n.zooming&&this.fire(new VJ(`zoomstart`,e)),this._rotating&&!n.rotating&&this.fire(new VJ(`rotatestart`,e)),this._pitching&&!n.pitching&&this.fire(new VJ(`pitchstart`,e)),this._rolling&&!n.rolling&&this.fire(new VJ(`rollstart`,e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this.elevationFreeze=!0}_updateElevation(e){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let t=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&t!==this._elevationTarget){let n=this._elevationTarget-this._elevationStart,r=(t-(n*e+this._elevationStart))/(1-e);this._elevationStart+=e*(n-r),this._elevationTarget=t}this.transform.setElevation(_V.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState)}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};let t=e.getCameraLngLat(),n=e.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(t,e.zoom):0;if(n<r){let n=this.calculateCameraOptionsFromTo(t,r,e.center,e.elevation);return{pitch:n.pitch,zoom:n.zoom}}return{}}applyUpdatedTransform(e){let t=[];if(t.push(e=>this._elevateCameraIfInsideTerrain(e)),this.transformCameraUpdate&&t.push(e=>this.transformCameraUpdate(e)),!t.length)return;let n=e.clone();for(let e of t){let t=n.clone(),{center:r,zoom:i,roll:a,pitch:o,bearing:s,elevation:c}=e(t);r&&t.setCenter(r),c!==void 0&&t.setElevation(c),i!==void 0&&t.setZoom(i),a!==void 0&&t.setRoll(a),o!==void 0&&t.setPitch(o),s!==void 0&&t.setBearing(s),n.apply(t,!1)}this.transform.apply(n,!1)}_fireMoveEvents(e){this.fire(new VJ(`move`,e)),this._zooming&&this.fire(new VJ(`zoom`,e)),this._rotating&&this.fire(new VJ(`rotate`,e)),this._pitching&&this.fire(new VJ(`pitch`,e)),this._rolling&&this.fire(new VJ(`roll`,e))}_afterEase(e,t){if(this._easeId&&t&&this._easeId===t)return;delete this._easeId;let n=this._zooming,r=this._rotating,i=this._pitching,a=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,n&&this.fire(new VJ(`zoomend`,e)),r&&this.fire(new VJ(`rotateend`,e)),i&&this.fire(new VJ(`pitchend`,e)),a&&this.fire(new VJ(`rollend`,e)),this.fire(new VJ(`moveend`,e))}flyTo(e,t){if(!e.essential&&IJ.prefersReducedMotion){let n=sz(e,[`center`,`zoom`,`bearing`,`pitch`,`roll`,`elevation`,`padding`]);return this.jumpTo(n,t)}this.stop(),e=oz({offset:[0,0],speed:1.2,curve:1.42,easing:rz},e),`zoom`in e&&this._zoomSnap&&(e.zoom=dz(e.zoom,this._zoomSnap));let n=this.getTransformForUpdate(),r=n.bearing,i=n.pitch,a=n.roll,o=n.padding,s=`bearing`in e?this._normalizeBearing(e.bearing,r):r,c=`pitch`in e?+e.pitch:i,l=`roll`in e?this._normalizeBearing(e.roll,a):a,u=`padding`in e?e.padding:n.padding,d=K.convert(e.offset),f=n.centerPoint.add(d),p=n.screenPointToLocation(f),m=this.cameraHelper.handleFlyTo(n,{bearing:s,pitch:c,roll:l,padding:u,locationAtOffset:p,offsetAsPoint:d,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),h=e.curve,g=Math.max(n.width,n.height),_=g/m.scaleOfZoom,v=m.pixelPathLength,y=g/m.scaleOfMinZoom;h=Math.min(h,Math.sqrt(y/v*2));let b=h*h;function x(e){let t=(_*_-g*g+(e?-1:1)*b*b*v*v)/(2*(e?_:g)*b*v);return Math.log(Math.sqrt(t*t+1)-t)}function S(e){return(Math.exp(e)-Math.exp(-e))/2}function C(e){return(Math.exp(e)+Math.exp(-e))/2}function w(e){return S(e)/C(e)}let T=x(!1),E=function(e){return C(T)/C(T+h*e)},D=function(e){return g*((C(T)*w(T+h*e)-S(T))/b)/v},O=(x(!0)-T)/h;
vendor: 7,263 bytes, line 1209
1209if(Math.abs(v)<2e-6||!isFinite(O)){if(Math.abs(g-_)<1e-6)return this.easeTo(e,t);let n=_<g?-1:1;O=Math.abs(Math.log(_/g))/h,D=()=>0,E=e=>Math.exp(n*h*e)}if(`duration`in e)e.duration=+e.duration;else{let t=`screenSpeed`in e?+e.screenSpeed/h:+e.speed;e.duration=1e3*O/t}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=r!==s,this._pitching=c!==i,this._rolling=l!==a,this._padding=!n.isPaddingEqual(u),this._prepareEase(t,!1),this.terrain&&this._prepareElevation(m.targetCenter),this._ease(p=>{let h=p*O,g=1/E(h),_=D(h);this._rotating&&n.setBearing(_V.number(r,s,p)),this._pitching&&n.setPitch(_V.number(i,c,p)),this._rolling&&n.setRoll(_V.number(a,l,p)),this._padding&&(n.interpolatePadding(o,u,p),f=n.centerPoint.add(d)),m.easeFunc(p,g,_,f),this.terrain&&!e.freezeElevation&&this._updateElevation(p),this.applyUpdatedTransform(n),this._fireMoveEvents(t)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(t)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||this._stopHandlers(),this}_ease(e,t,n){n.animate===!1||n.duration===0?(e(1),t()):(this._easeStart=LJ(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){e=az(e,-180,180);let n=Math.abs(e-t);return Math.abs(e-360-t)<n&&(e-=360),Math.abs(e+360-t)<n&&(e+=360),e}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}},KQe={compact:!0,customAttribution:`<a href="https://maplibre.org/" target="_blank">MapLibre</a>`},qQe=class{constructor(e=KQe){this._toggleAttribution=()=>{this._container.classList.contains(`maplibregl-compact`)&&(this._container.classList.contains(`maplibregl-compact-show`)?(this._container.setAttribute(`open`,``),this._container.classList.remove(`maplibregl-compact-show`)):(this._container.classList.add(`maplibregl-compact-show`),this._container.removeAttribute(`open`)))},this._updateData=e=>{e&&(e.type===`terrain`||e.dataType===`style`||e.dataType===`source`&&(e.sourceDataType===`metadata`||e.sourceDataType===`visibility`))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute(`open`,``):!this._container.classList.contains(`maplibregl-compact`)&&!this._container.classList.contains(`maplibregl-attrib-empty`)&&(this._container.setAttribute(`open`,``),this._container.classList.add(`maplibregl-compact`,`maplibregl-compact-show`)):(this._container.setAttribute(`open`,``),this._container.classList.contains(`maplibregl-compact`)&&this._container.classList.remove(`maplibregl-compact`,`maplibregl-compact-show`))},this._updateCompactMinimize=()=>{this._container.classList.contains(`maplibregl-compact`)&&this._container.classList.contains(`maplibregl-compact-show`)&&this._container.classList.remove(`maplibregl-compact-show`)},this.options=e}getDefaultPosition(){return`bottom-right`}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=RJ.create(`details`,`maplibregl-ctrl maplibregl-ctrl-attrib`),this._compactButton=RJ.create(`summary`,`maplibregl-ctrl-attrib-button`,this._container),this._compactButton.addEventListener(`click`,this._toggleAttribution),this._setElementTitle(this._compactButton,`ToggleAttribution`),this._innerContainer=RJ.create(`div`,`maplibregl-ctrl-attrib-inner`,this._container),this._updateAttributions(),this._updateCompact(),this._map.on(`styledata`,this._updateData),this._map.on(`sourcedata`,this._updateData),this._map.on(`terrain`,this._updateData),this._map.on(`resize`,this._updateCompact),this._map.on(`drag`,this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off(`styledata`,this._updateData),this._map.off(`sourcedata`,this._updateData),this._map.off(`terrain`,this._updateData),this._map.off(`resize`,this._updateCompact),this._map.off(`drag`,this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let n=this._map._getUIString(`AttributionControl.${t}`);e.title=n,e.setAttribute(`aria-label`,n)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(e=>typeof e==`string`?e:``)):typeof this.options.customAttribution==`string`&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let t=this._map.style.tileManagers;for(let n in t){let r=t[n];if(r.used||r.usedForTerrain){let t=r.getSource();t.attribution&&!e.includes(t.attribution)&&e.push(t.attribution)}}e=e.filter(e=>String(e).trim()),e.sort((e,t)=>e.length-t.length),e=e.filter((t,n)=>{for(let r=n+1;r<e.length;r++)if(e[r].includes(t))return!1;return!0});let n=e.join(` | `);n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=RJ.sanitize(n),this._container.classList.remove(`maplibregl-attrib-empty`)):this._container.classList.add(`maplibregl-attrib-empty`),this._updateCompact(),this._editLink=null)}},JQe=class{constructor(e={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&t.classList.add(`maplibregl-compact`):t.classList.remove(`maplibregl-compact`)}},this.options=e}getDefaultPosition(){return`bottom-left`}onAdd(e){this._map=e,this._compact=this.options?.compact,this._container=RJ.create(`div`,`maplibregl-ctrl`);let t=RJ.create(`a`,`maplibregl-ctrl-logo`);return t.target=`_blank`,t.rel=`noopener nofollow`,t.href=`https://maplibre.org/`,t.setAttribute(`aria-label`,this._map._getUIString(`LogoControl.Title`)),t.setAttribute(`rel`,`noopener nofollow`),this._container.appendChild(t),this._container.style.display=`block`,this._map.on(`resize`,this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off(`resize`,this._updateCompact),this._map=void 0,this._compact=void 0}},YQe=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,n=t?this._queue.concat(t):this._queue;for(let t of n)if(t.id===e){t.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error(`Attempting to run(), but is already running.`);let t=this._currentlyRunning=this._queue;this._queue=[];for(let n of t)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},MX={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0},XQe=class{constructor(e,t){this.painter=e,this.terrain=t,this.rttSize=t.tileManager.tileSize*t.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}
1209prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(n=>!e._layers[n].isHidden(t));let n=new Set;for(let t of this._renderableLayerIds){let r=e._layers[t],i=r.source;i&&MX[r.type]&&n.add(i)}this._coordsAscending={},this._rttFingerprints={};for(let t of n){let n=e.tileManagers[t];if(!n)continue;this._coordsAscending[t]={};let r=this._coordsAscending[t],i=n.getSource(),a=i instanceof aY?i.terrainTileRanges:null;for(let e of n.getVisibleCoordinates()){let t=this.terrain.tileManager.getTerrainCoords(e,a);for(let e in t)r[e]||=[],r[e].push(t[e])}this._rttFingerprints[t]={};let o=this._rttFingerprints[t],s=n.getState().revision;for(let e in r)o[e]=`${r[e].map(e=>e.key).sort().join()}#${s}`}for(let e of this._renderableTiles)for(let t in this._rttFingerprints){let n=this._rttFingerprints[t][e.tileID.key];n&&n!==e.rttFingerprint[t]&&e.releaseRTT(this.painter)}}renderLayer(e,t){if(e.isHidden(this.painter.transform.zoom))return!1;let n={...t,isRenderingToTexture:!0},r=e.type,i=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(MX[r]&&((!this._prevType||!MX[this._prevType])&&this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(e.id),!a))return!0;if(MX[this._prevType]||MX[r]&&a){this._prevType=r;let e=this._stacks.length-1,t=this._stacks[e]||[];for(let r of this._renderableTiles){if(this._rttTiles.push(r),r.getRTT(e))continue;let a=r.acquireRTT(i,e,this.rttSize);
vendor: 42,679 bytes, line 1209
1209i.bindRTT(a),i.context.clear({color:UB.transparent,stencil:0}),i.currentStencilSource=void 0;for(let e of t){let t=i.style._layers[e],a=t.source?this._coordsAscending[t.source][r.tileID.key]:[r.tileID];i.context.viewport.set([0,0,this.rttSize,this.rttSize]),i.renderTileClippingMasks(t,a,!0),i.renderLayer(i,i.style.tileManagers[t.source],t,a,n),t.source&&(r.rttFingerprint[t.source]=this._rttFingerprints[t.source][r.tileID.key])}}return qZe(this.painter,this.terrain,this._rttTiles,n),this._rttTiles=[],MX[r]}return!1}},ZQe={"AttributionControl.ToggleAttribution":`Toggle attribution`,"AttributionControl.MapFeedback":`Map feedback`,"FullscreenControl.Enter":`Enter fullscreen`,"FullscreenControl.Exit":`Exit fullscreen`,"GeolocateControl.FindMyLocation":`Find my location`,"GeolocateControl.LocationNotAvailable":`Location not available`,"LogoControl.Title":`MapLibre logo`,"Map.Title":`Map`,"Marker.Title":`Map marker`,"NavigationControl.ResetBearing":`Drag to rotate map, click to reset north`,"NavigationControl.ZoomIn":`Zoom in`,"NavigationControl.ZoomOut":`Zoom out`,"Popup.Close":`Close popup`,"ScaleControl.Feet":`ft`,"ScaleControl.Meters":`m`,"ScaleControl.Kilometers":`km`,"ScaleControl.Miles":`mi`,"ScaleControl.NauticalMiles":`nm`,"GlobeControl.Enable":`Enable globe`,"GlobeControl.Disable":`Disable globe`,"TerrainControl.Enable":`Enable terrain`,"TerrainControl.Disable":`Disable terrain`,"CooperativeGesturesHandler.WindowsHelpText":`Use Ctrl + scroll to zoom the map`,"CooperativeGesturesHandler.MacHelpText":`Use ⌘ + scroll to zoom the map`,"CooperativeGesturesHandler.MobileHelpText":`Use two fingers to move the map`},QQe=HWe,$Qe={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:KQe,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:`high-performance`,failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:Iz.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:`sans-serif`,pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:`auto`,zoomLevelsToOverscale:4,anisotropicFilterPitch:20},e$e=class extends Jz{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(e){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new YQe,this._controls=[],this._mapId=cz(),this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=e=>{if(e.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style){this.fire(new KJ(`webglcontextlost`,{originalEvent:e}));return}for(let e of Object.values(this.style._layers))if(e.type===`custom`&&console.warn(`Custom layer with id '${e.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),e._listeners)for(let[t]of Object.entries(e._listeners))console.warn(`Custom layer with id '${e.id}' had event listeners for event '${t}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new KJ(`webglcontextlost`,{originalEvent:e}))},this._contextRestored=e=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style){this.style.imageManager.images=this._lostContextStyle.images;for(let e in this._lostContextStyle.images){let t=this._lostContextStyle.images[e];t.isWebGLImage&&this.style.imageManager.updateImage(e,t,!1)}}this._lostContextStyle={style:null,images:null},this._setupPainter(),this.painter&&(this.resize(),this._update(),this._resizeInternal(),this.fire(new KJ(`webglcontextrestored`,{originalEvent:e})))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let t={...$Qe,...e,canvasContextAttributes:{...$Qe.canvasContextAttributes,...e.canvasContextAttributes}};if(t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw Error(`maxZoom must be greater than or equal to minZoom`);if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw Error(`maxPitch must be greater than or equal to minPitch`);if(t.minPitch!=null&&t.minPitch<0)throw Error(`minPitch must be greater than or equal to 0`);if(t.maxPitch!=null&&t.maxPitch>180)throw Error(`maxPitch must be less than or equal to 180`);if(this._camera=new GQe({minZoom:t.minZoom,maxZoom:t.maxZoom,minPitch:t.minPitch,maxPitch:t.maxPitch,bearingSnap:t.bearingSnap,zoomSnap:t.zoomSnap,renderWorldCopies:t.renderWorldCopies,centerClampedToGround:t.centerClampedToGround,terrain:this.terrain,transformConstrain:t.transformConstrain,requestRenderFrame:e=>this._requestRenderFrame(e),cancelRenderFrame:e=>this._cancelRenderFrame(e),transformCameraUpdate:t.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._canvasContextAttributes={...t.canvasContextAttributes},this._trackResize=t.trackResize===!0,this._terrainSkirtLength=t.terrainSkirtLength,this._refreshExpiredTiles=t.refreshExpiredTiles===!0,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions===!0,this._collectResourceTiming=t.collectResourceTiming===!0,this._locale={...ZQe,...t.locale},this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this._zoomLevelsToOverscale=t.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=t.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(t.anisotropicFilterPitch),t.reduceMotion!==void 0&&(IJ.prefersReducedMotion=t.reduceMotion),this._imageQueueHandle=zJ.addThrottleControl(()=>this.isMoving()),this._requestManager=new YWe(t.transformRequest),this._container=this._resolveContainer(t.container),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer(),this._setupPainter(),!this.painter)return;this.on(`move`,()=>this._update(!1)),this.on(`moveend`,()=>this._update(!1)),this.on(`zoom`,()=>this._update(!0)),this.on(`terrain`,()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once(`idle`,()=>this._idleTriggered=!0),this._handlers=new WQe(this,this._camera,t),typeof window<`u`&&(this._ownerWindow.addEventListener(`online`,this._onWindowOnline,!1),this._setupResizeObserver());let n=typeof t.hash==`string`&&t.hash||void 0;this._hash=t.hash?new nQe(n).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:t.center,elevation:t.elevation,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch,roll:t.roll}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,oz({},t.fitBoundsOptions,{duration:0}))));let r=typeof t.style==`string`||t.style?.projection?.type!==`globe`;this.resize(null,r),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new qQe(typeof t.attributionControl==`boolean`?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new JQe,t.logoPosition),this.on(`style.load`,()=>{if(r||this._resizeTransform(),this._camera.transform.unmodified){let e=sz(this.style.stylesheet,[`center`,`zoom`,`bearing`,`pitch`,`roll`]);this.jumpTo(e)}}),this.on(`data`,e=>{this._update(e.dataType===`style`),this.fire(e.dataType===`style`?new HJ(`styledata`,e):new UJ(`sourcedata`,e))}),this.on(`dataloading`,e=>{this.fire(e.dataType===`style`?new HJ(`styledataloading`,e):new UJ(`sourcedataloading`,e))}),this.on(`dataabort`,e=>{this.fire(new UJ(`sourcedataabort`,e))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,t){if(t===void 0&&(t=e.getDefaultPosition?e.getDefaultPosition():`top-right`),!e?.onAdd)return this.fire(new qz(Error(`Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.`)));let n=e.onAdd(this);this._controls.push(e);let r=this._controlPositions[t];return t.includes(`bottom`)?r.insertBefore(n,r.firstChild):r.appendChild(n),this}removeControl(e){if(!e?.onRemove)return this.fire(new qz(Error(`Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.`)));let t=this._controls.indexOf(e);return t>-1&&this._controls.splice(t,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return uY(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new qK(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,t){return this._camera.setCenter(e,t),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,t){return this._camera.setCenterElevation(e,t),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,t,n){return this._camera.panBy(e,t,n),this}panTo(e,t,n){return this._camera.panTo(e,t,n),this}getZoom(){return this._camera.transform.zoom}setZoom(e,t){return this._camera.setZoom(e,t),this}zoomTo(e,t,n){return this._camera.zoomTo(e,t,n),this}zoomIn(e,t){return this._camera.zoomIn(e,t),this}zoomOut(e,t){return this._camera.zoomOut(e,t),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,t){return this._camera.setVerticalFieldOfView(e,t),this}getBearing(){return this._camera.transform.bearing}setBearing(e,t){return this._camera.setBearing(e,t),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,t){return this._camera.setPadding(e,t),this}rotateTo(e,t,n){return this._camera.rotateTo(e,t,n),this}resetNorth(e,t){return this._camera.resetNorth(e,t),this}resetNorthPitch(e,t){return this._camera.resetNorthPitch(e,t),this}snapToNorth(e,t){return this._camera.snapToNorth(e,t),this}getPitch(){return this._camera.transform.pitch}setPitch(e,t){return this._camera.setPitch(e,t),this}getRoll(){return this._camera.transform.roll}setRoll(e,t){return this._camera.setRoll(e,t),this}cameraForBounds(e,t){return this._camera.cameraForBounds(e,t)}fitBounds(e,t,n){return this._camera.fitBounds(e,t,n),this}fitScreenCoordinates(e,t,n,r,i){return this._camera.fitScreenCoordinates(e,t,n,r,i),this}jumpTo(e,t){return this._camera.jumpTo(e,t),this}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,n,r,i){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,t,n,r,i)}easeTo(e,t){return this._camera.easeTo(e,t),this}flyTo(e,t){return this._camera.flyTo(e,t),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(qK.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,t,n,r){return r==null&&this.terrain&&(r=this.terrain.getElevationForLngLat(n,this._camera.transform)),this._camera.calculateCameraOptionsFromTo(e,t,n,r)}resize(e,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let n=!this._camera._moving;return n&&(this.stop(),this.fire(new VJ(`movestart`,e)).fire(new VJ(`move`,e))),this.fire(new BJ(`resize`,e)),n&&this.fire(new VJ(`moveend`,e)),this}_resizeInternal(e=!0){let[t,n]=this._containerDimensions(),r=this._getClampedPixelRatio(t,n);if(this._resizeCanvas(t,n,r),this.painter.resize(t,n,r),this.painter.overLimit()){let e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];let r=this._getClampedPixelRatio(t,n);this._resizeCanvas(t,n,r),this.painter.resize(t,n,r)}this._resizeTransform(e)}_resizeTransform(e=!0){let[t,n]=this._containerDimensions();this._camera.transform.resize(t,n,e),this._camera._requestedCameraState?.resize(t,n,e)}_getClampedPixelRatio(e,t){let{0:n,1:r}=this._maxCanvasSize,i=this.getPixelRatio(),a=e*i,o=t*i,s=a>n?n/a:1,c=o>r?r/o:1;return Math.min(s,c)*i}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.transform.setMaxBounds(QJ.convert(e)),this._update()}setMinZoom(e){if(e??=-2,e>=-2&&e<=this._camera.transform.maxZoom){let t=this._camera.transform.zoom,n=this._camera.getTransformForUpdate();return n.setMinZoom(e),this._camera.applyUpdatedTransform(n),this._update(),t!==this._camera.transform.zoom&&this.fire(new VJ(`zoomstart`)).fire(new VJ(`zoom`)).fire(new VJ(`zoomend`)).fire(new VJ(`movestart`)).fire(new VJ(`move`)).fire(new VJ(`moveend`)),this}throw Error(`minZoom must be between -2 and the current maxZoom, inclusive`)}getMinZoom(){return this._camera.transform.minZoom}setMaxZoom(e){if(e??=22,e>=this._camera.transform.minZoom){let t=this._camera.transform.zoom,n=this._camera.getTransformForUpdate();return n.setMaxZoom(e),this._camera.applyUpdatedTransform(n),this._update(),t!==this._camera.transform.zoom&&this.fire(new VJ(`zoomstart`)).fire(new VJ(`zoom`)).fire(new VJ(`zoomend`)).fire(new VJ(`movestart`)).fire(new VJ(`move`)).fire(new VJ(`moveend`)),this}throw Error(`maxZoom must be greater than the current minZoom`)}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??=0,e<0)throw Error(`minPitch must be greater than or equal to 0`);if(e>=0&&e<=this._camera.transform.maxPitch){let t=this._camera.transform.pitch,n=this._camera.getTransformForUpdate();return n.setMinPitch(e),this._camera.applyUpdatedTransform(n),this._update(),t!==this._camera.transform.pitch&&this.fire(new VJ(`pitchstart`)).fire(new VJ(`pitch`)).fire(new VJ(`pitchend`)).fire(new VJ(`movestart`)).fire(new VJ(`move`)).fire(new VJ(`moveend`)),this}throw Error(`minPitch must be between 0 and the current maxPitch, inclusive`)}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??=60,e>180)throw Error(`maxPitch must be less than or equal to 180`);if(e>=this._camera.transform.minPitch){let t=this._camera.transform.pitch,n=this._camera.getTransformForUpdate();return n.setMaxPitch(e),this._camera.applyUpdatedTransform(n),this._update(),t!==this._camera.transform.pitch&&this.fire(new VJ(`pitchstart`)).fire(new VJ(`pitch`)).fire(new VJ(`pitchend`)).fire(new VJ(`movestart`)).fire(new VJ(`move`)).fire(new VJ(`moveend`)),this}throw Error(`maxPitch must be greater than the current minPitch`)}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??=20,e>180)throw Error(`anisotropicFilterPitch must be less than or equal to 180`);if(e<0)throw Error(`anisotropicFilterPitch must be greater than or equal to 0`);return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.transform.setRenderWorldCopies(e),this._update()}setTransformConstrain(e){return this._camera.transform.setConstrainOverride(e),this._update()}project(e){return this._camera.transform.locationToScreenPoint(qK.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(K.convert(e),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegatedListener(e,t,n){if(e===`mouseenter`||e===`mouseover`){let r=!1;return{layers:t,listener:n,delegates:{mousemove:i=>{let a=t.filter(e=>this.getLayer(e)),o=a.length===0?[]:this.queryRenderedFeatures(i.point,{layers:a});o.length?r||(r=!0,n.call(this,new WJ(e,this,i.originalEvent,{features:o}))):r=!1},mouseout:()=>{r=!1}}}}if(e===`mouseleave`||e===`mouseout`){let r=!1;return{layers:t,listener:n,delegates:{mousemove:i=>{let a=t.filter(e=>this.getLayer(e));(a.length===0?[]:this.queryRenderedFeatures(i.point,{layers:a})).length?r=!0:r&&(r=!1,n.call(this,new WJ(e,this,i.originalEvent)))},mouseout:t=>{r&&(r=!1,n.call(this,new WJ(e,this,t.originalEvent)))}}}}{let r=e=>{let r=t.filter(e=>this.getLayer(e)),i=r.length===0?[]:this.queryRenderedFeatures(e.point,{layers:r});i.length&&(e.features=i,n.call(this,e),delete e.features)};return{layers:t,listener:n,delegates:{[e]:r}}}}_saveDelegatedListener(e,t){this._delegatedListeners||={},this._delegatedListeners[e]||=[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,n){if(!this._delegatedListeners?.[e])return;let r=this._delegatedListeners[e];for(let e=0;e<r.length;e++){let i=r[e];if(i.listener===n&&i.layers.length===t.length&&i.layers.every(e=>t.includes(e))){for(let e in i.delegates)this.off(e,i.delegates[e]);r.splice(e,1);return}}}on(e,t,n){if(n===void 0)return super.on(e,t);let r=typeof t==`string`?[t]:t,i=this._createDelegatedListener(e,r,n);this._saveDelegatedListener(e,i);for(let e in i.delegates)this.on(e,i.delegates[e]);return{unsubscribe:()=>{this._removeDelegatedListener(e,r,n)}}}once(e,t,n){if(n===void 0)return super.once(e,t);let r=typeof t==`string`?[t]:t,i=this._createDelegatedListener(e,r,n);for(let t in i.delegates){let a=i.delegates[t];i.delegates[t]=(...t)=>{this._removeDelegatedListener(e,r,n),a(...t)}}this._saveDelegatedListener(e,i);for(let e in i.delegates)this.once(e,i.delegates[e]);return this}off(e,t,n){if(n===void 0)return super.off(e,t);let r=typeof t==`string`?[t]:t;return this._removeDelegatedListener(e,r,n),this}queryRenderedFeatures(e,t){if(!this.style)return[];let n,r=e instanceof K||Array.isArray(e),i=r?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(t||=(r?{}:e)||{},i instanceof K||typeof i[0]==`number`)n=[K.convert(i)];else{let e=K.convert(i[0]),t=K.convert(i[1]);n=[e,new K(t.x,e.y),t,new K(e.x,t.y),e]}return this.style.queryRenderedFeatures(n,t,this._camera.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,t){return t=oz({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t),t.diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(e,t))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(t==null)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded){this.style.once(`style.load`,()=>this._updateStyle(e,t));return}let n=this.style&&t.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e)this.style=new LJe(this,t||{});else return this._frameRequest&&=(this._frameRequest.abort(),null),this.style?.projection?.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof e==`string`?this.style.loadURL(e,t,n):this.style.loadJSON(e,t,n),this}_lazyInitEmptyStyle(){this.style||(this.style=new LJe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}async _diffStyle(e,t){if(this._diffStyleRequest?.abort(),typeof e==`string`){let n=e;this._diffStyleRequest=new AbortController;let r=this._diffStyleRequest;try{let e=await this._requestManager.transformRequest(n,`Style`);if(r.signal.aborted){this._diffStyleRequest=null;return}let i=await Hz(e,r);this._diffStyleRequest=null,this._updateDiff(i.data,t)}catch(e){this._diffStyleRequest=null,Pz(e)||this.fire(new qz(VR(e)))}}else typeof e==`object`&&(this._diffStyleRequest=null,this._updateDiff(e,t))}_updateDiff(e,t){try{this.style.setState(e,t)&&this._update(!0)}catch(n){_z(`Unable to perform style diff: ${VR(n).message}.  Rebuilding the style from scratch.`),this._updateStyle(e,t)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style){_z(`There is no style added to the map.`);return}return this.style.loaded()}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let t=this.style?.tileManagers[e];if(t===void 0){this.fire(new qz(Error(`There is no tile manager with ID '${e}'`)));return}return t.loaded()}setTerrain(e,t={}){if(this.style._checkLoaded(),e&&LU(this,NU.terrain,{value:e},t))return this;if(this._terrainDataCallback&&this.style.off(`data`,this._terrainDataCallback),!e)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);else{let t=this.style.tileManagers[e.source];if(!t)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&t.reload();for(let t in this.style._layers){let n=this.style._layers[t];n.type===`hillshade`&&n.source===e.source&&_z(`You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.`),n.type===`color-relief`&&n.source===e.source&&_z(`You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.`)}this.terrain&&this.terrain.destroy(),this.terrain=new eJe(this.painter,t,e,this._terrainSkirtLength),this.painter.renderToTexture=new XQe(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._terrainDataCallback=t=>this._handleTerrainDataEvent(t,e.source),this.style.on(`data`,this._terrainDataCallback)}return this.fire(new $We({terrain:e})),this}_handleTerrainDataEvent(e,t){if(e.dataType===`style`){this.terrain.tileManager.releaseAllRTT();return}let n=e.sourceId===t;if(n&&this.terrain.resetElevationCache(),n&&e.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom))),e.tile){if(e.source?.type===`image`){this.terrain.tileManager.releaseAllRTT();return}this.terrain.tileManager.releaseRTT(e.tile.tileID)}}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let e=this.style?.tileManagers;for(let t of Object.values(e))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style?.getSource(e)}setSourceTileLodParams(e,t,n){if(n){let r=this.getSource(n);if(!r)throw Error(`There is no source with ID "${n}", cannot set LOD parameters`);r.calculateTileZoom=cY(Math.max(1,e),Math.max(1,t))}else for(let n in this.style.tileManagers)this.style.tileManagers[n].getSource().calculateTileZoom=cY(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,t){let n=this.style.tileManagers[e];if(!n)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);t===void 0?n.reload(!0):n.refreshTiles(t.map(e=>new Tq(e.z,e.x,e.y)))}addImage(e,t,n={}){this._lazyInitEmptyStyle();let r=this._createStyleImage(t,n);return r?(this.style.addImage(e,r),r.userImage?.onAdd&&r.userImage.onAdd(this,e),this):this}setMissingStyleImageResolver(e){return this._missingStyleImageResolver=e,this.style?.setMissingImageResolver(e),this}_createStyleImage(e,t={}){let{pixelRatio:n=1,sdf:r=!1,stretchX:i,stretchY:a,content:o,textFitWidth:s,textFitHeight:c}=t;if(e instanceof HTMLImageElement||xz(e)){let{width:t,height:l,data:u}=IJ.getImageData(e);return{data:new aK({width:t,height:l},u),pixelRatio:n,stretchX:i,stretchY:a,content:o,textFitWidth:s,textFitHeight:c,sdf:r,version:0}}if(e.width===void 0||e.height===void 0)return this.fire(new qz(Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))),null;{let{width:t,height:l,data:u}=e,d=e,f=pq(d.data);return{data:f?new aK({width:t,height:l}):new aK({width:t,height:l},new Uint8Array(u)),pixelRatio:n,stretchX:i,stretchY:a,content:o,textFitWidth:s,textFitHeight:c,sdf:r,version:0,isWebGLImage:f,userImage:d}}}updateImage(e,t){let n=this.style.getImage(e);if(!n)return this.fire(new qz(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:i,data:a}=t instanceof HTMLImageElement||xz(t)?IJ.getImageData(t):t;if(r===void 0||i===void 0)return this.fire(new qz(Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(r!==n.data.width||i!==n.data.height)return this.fire(new qz(Error(`The width and height of the updated image must be that same as the previous version of the image`)));if(n.isWebGLImage=pq(a),n.isWebGLImage)n.userImage=t;else{let e=!(t instanceof HTMLImageElement||xz(t));n.data.replace(a,e)}return this.style.updateImage(e,n),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new qz(Error(`Missing required image id`))),!1)}removeImage(e){this.style.removeImage(e)}async loadImage(e){return zJ.getImage(await this._requestManager.transformRequest(e,`Image`),new AbortController)}listImages(){return this.style?.listImages()??[]}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style?.getLayer(e)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}setFilter(e,t,n={}){return this.style?.setFilter(e,t,n),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,n,r={}){return this.style?.setPaintProperty(e,t,n,r),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,n,r={}){return this.style.setLayoutProperty(e,t,n,r),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,n,e=>{e||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,e=>{e||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupResizeObserver(){let e=!1,t=tQe(e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())},50),n=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new n(n=>{if(!e){e=!0;return}t(n)}),this._resizeObserver.observe(this._container)}_resolveContainer(e){if(typeof e==`string`){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&typeof e==`object`&&e.nodeType===1)return e;throw Error(`Invalid type: 'container' must be a String or HTMLElement.`)}_setupContainer(){let e=this._container;e.classList.add(`maplibregl-map`);let t=this._canvasContainer=RJ.create(`div`,`maplibregl-canvas-container`,e);this._interactive&&t.classList.add(`maplibregl-interactive`),this._canvas=RJ.create(`canvas`,`maplibregl-canvas`,t),this._canvas.addEventListener(`webglcontextlost`,this._contextLost,!1),this._canvas.addEventListener(`webglcontextrestored`,this._contextRestored,!1),this._canvas.setAttribute(`tabindex`,this._interactive?`0`:`-1`),this._canvas.setAttribute(`aria-label`,this._getUIString(`Map.Title`)),this._canvas.setAttribute(`role`,`region`);let n=this._containerDimensions(),r=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],r);let i=this._controlContainer=RJ.create(`div`,`maplibregl-control-container`,e),a=this._controlPositions={};for(let e of[`top-left`,`top-right`,`bottom-left`,`bottom-right`])a[e]=RJ.create(`div`,`maplibregl-ctrl-${e} `,i);this._container.addEventListener(`scroll`,this._onMapScroll,!1)}_resizeCanvas(e,t,n){this._canvas.width=Math.floor(n*e),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let e={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},t=null;this._canvas.addEventListener(`webglcontextcreationerror`,e=>{t=e},{once:!0});let n=this._canvas.getContext(`webgl2`,e);if(!n){this.fire(new qz(new eQe(e,t)));return}this.painter=new $Ze(n,this._camera.transform)}migrateProjection(e,t){this._camera.migrateProjection(e,t),this.painter.transform=e,this.fire(new eGe({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?._loaded?(this._styleDirty||=e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let t=this._idleTriggered?this._fadeDuration:0,n=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let r=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let e=this._camera.transform.zoom,n=LJ();this.style.zoomHistory.update(e,n);let i=new XU(e,{now:n,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),a=i.crossFadingFactor();(a!==1||a!==this._crossFadingFactor)&&(r=!0,this._crossFadingFactor=a),this.style.update(i)}let i=this.style.projection?.transitionState>0!==n;this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||i)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain),this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,t,this._crossSourceCollisions,i),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new BJ(`render`)),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new BJ(`load`))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new BJ(`idle`)),this._loaded&&!this._fullyLoaded&&!a&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&=(this._frameRequest.abort(),null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let e of this._controls)e.onRemove(this);this._controls=[],this._frameRequest&&=(this._frameRequest.abort(),null),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<`u`&&this._ownerWindow.removeEventListener(`online`,this._onWindowOnline,!1),zJ.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let e=this.painter.context.gl.getExtension(`WEBGL_lose_context`);e?.loseContext&&e.loseContext(),this._canvas.removeEventListener(`webglcontextrestored`,this._contextRestored,!1),this._canvas.removeEventListener(`webglcontextlost`,this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener(`scroll`,this._onMapScroll,!1),this._container.classList.remove(`maplibregl-map`),this._removed=!0,this.fire(new BJ(`remove`))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,IJ.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(e){if(!Pz(e))throw e}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return QQe}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}},t$e={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0},n$e=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),n=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute(`aria-disabled`,t.toString()),this._zoomOutButton.setAttribute(`aria-disabled`,n.toString())},this._rotateCompassArrow=()=>{let e=this._map.getPitch(),t=this._map.getRoll(),n=this._map.getBearing(),r=1/Math.cos(wz(e))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${r}) rotateZ(${-t}deg) rotateX(${e}deg) rotateZ(${-n}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${r}) rotateX(${e}deg) rotateZ(${-n}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-n-t}deg)`;return}this._compassIcon.style.transform=`rotate(${-n}deg)`},this._setButtonTitle=(e,t)=>{let n=this._map._getUIString(`NavigationControl.${t}`);e.title=n,e.setAttribute(`aria-label`,n)},this.options=oz({},t$e,e),this._container=RJ.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._container.addEventListener(`contextmenu`,e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton(`maplibregl-ctrl-zoom-in`,e=>this._map.zoomIn({},{originalEvent:e})),RJ.create(`span`,`maplibregl-ctrl-icon`,this._zoomInButton).setAttribute(`aria-hidden`,`true`),this._zoomOutButton=this._createButton(`maplibregl-ctrl-zoom-out`,e=>this._map.zoomOut({},{originalEvent:e})),RJ.create(`span`,`maplibregl-ctrl-icon`,this._zoomOutButton).setAttribute(`aria-hidden`,`true`)),this.options.showCompass&&(this._compass=this._createButton(`maplibregl-ctrl-compass`,e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=RJ.create(`span`,`maplibregl-ctrl-icon`,this._compass),this._compassIcon.setAttribute(`aria-hidden`,`true`))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,`ZoomIn`),this._setButtonTitle(this._zoomOutButton,`ZoomOut`),this._map.on(`zoom`,this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,`ResetBearing`),this.options.visualizePitch&&this._map.on(`pitch`,this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on(`roll`,this._rotateCompassArrow),this._map.on(`rotate`,this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new r$e(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off(`zoom`,this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off(`pitch`,this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off(`roll`,this._rotateCompassArrow),this._map.off(`rotate`,this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){let n=RJ.create(`button`,e,this._container);return n.type=`button`,n.addEventListener(`click`,t),n}},r$e=class{constructor(e,t,n=!1){this.mousedown=e=>{this.startMove(e,RJ.mousePos(this.element,e)),window.addEventListener(`mousemove`,this.mousemove),window.addEventListener(`mouseup`,this.mouseup)},this.mousemove=e=>{this.move(e,RJ.mousePos(this.element,e))},this.mouseup=e=>{this._rotatePitchHandler.dragEnd(e),this.offTemp()},this.touchstart=e=>{e.targetTouches.length===1?(this._startPos=this._lastPos=RJ.touchPos(this.element,e.targetTouches)[0],this.startMove(e,this._startPos),window.addEventListener(`touchmove`,this.touchmove,{passive:!1}),window.addEventListener(`touchend`,this.touchend)):this.reset()},this.touchmove=e=>{e.targetTouches.length===1?(this._lastPos=RJ.touchPos(this.element,e.targetTouches)[0],this.move(e,this._lastPos)):this.reset()},this.touchend=e=>{e.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=t;let r=new vQe;this._rotatePitchHandler=new wX({clickTolerance:3,move:(e,r)=>{let i=t.getBoundingClientRect(),a=new K((i.bottom-i.top)/2,(i.right-i.left)/2);return{bearingDelta:Dz(new K(e.x,r.y),r,a),pitchDelta:n?(r.y-e.y)*-.5:void 0}},moveStateManager:r,enable:!0,assignEvents:()=>{}}),this.map=e,t.addEventListener(`mousedown`,this.mousedown),t.addEventListener(`touchstart`,this.touchstart,{passive:!1}),t.addEventListener(`touchcancel`,this.reset)}startMove(e,t){this._rotatePitchHandler.dragStart(e,t),RJ.disableDrag()}move(e,t){let n=this.map,{bearingDelta:r,pitchDelta:i}=this._rotatePitchHandler.dragMove(e,t)||{};r&&n.setBearing(n.getBearing()+r),i&&n.setPitch(n.getPitch()+i)}off(){let e=this.element;e.removeEventListener(`mousedown`,this.mousedown),e.removeEventListener(`touchstart`,this.touchstart),window.removeEventListener(`touchmove`,this.touchmove),window.removeEventListener(`touchend`,this.touchend),e.removeEventListener(`touchcancel`,this.reset),this.offTemp()}offTemp(){RJ.enableDrag(),window.removeEventListener(`mousemove`,this.mousemove),window.removeEventListener(`mouseup`,this.mouseup),window.removeEventListener(`touchmove`,this.touchmove),window.removeEventListener(`touchend`,this.touchend)}},NX;async function i$e(e=!1){if(NX!==void 0&&!e)return NX;if(window.navigator.permissions===void 0)return NX=!!window.navigator.geolocation,NX;try{NX=(await window.navigator.permissions.query({name:`geolocation`})).state!==`denied`}catch{NX=!!window.navigator.geolocation}return NX}function a$e(e,t,n,r=!1){if(r||!n.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let i=new qK(e.lng,e.lat);if(e=new qK(e.lng,e.lat),t){let r=new qK(e.lng-360,e.lat),i=new qK(e.lng+360,e.lat),a=n.locationToScreenPoint(e).distSqr(t);n.locationToScreenPoint(r).distSqr(t)<a?e=r:n.locationToScreenPoint(i).distSqr(t)<a&&(e=i)}for(;Math.abs(e.lng-n.center.lng)>180;){let t=n.locationToScreenPoint(e);if(t.x>=0&&t.y>=0&&t.x<=n.width&&t.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}
1209return e.lng!==i.lng&&n.isPointOnMapSurface(n.locationToScreenPoint(e))?e:i}var o$e={center:`translate(-50%,-50%)`,top:`translate(-50%,0)`,"top-left":`translate(0,0)`,"top-right":`translate(-100%,0)`,bottom:`translate(-50%,-100%)`,"bottom-left":`translate(0,-100%)`,"bottom-right":`translate(-100%,-100%)`,left:`translate(0,-50%)`,right:`translate(-100%,-50%)`};function s$e(e,t,n){let r=e.classList;for(let e in o$e)r.remove(`maplibregl-${n}-anchor-${e}`);r.add(`maplibregl-${n}-anchor-${t}`)}var c$e={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},PX=class extends Kz{},l$e=class extends Kz{},FX=class extends Jz{constructor(e){if(super(),this._onClick=e=>{this.fire(new l$e(`click`,{originalEvent:e}))},this._onKeyPress=e=>{(e.code===`Space`||e.code===`Enter`)&&this.togglePopup()},this._onKeyDown=e=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||e.composedPath()[0]!==this._element||e.altKey||e.ctrlKey||e.metaKey)return;let t=c$e[e.key];if(!t)return;e.preventDefault(),e.stopPropagation();let n=e.shiftKey?10:1,r=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new K(r.x+t[0]*n,r.y+t[1]*n))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new PX(`dragstart`))),this.fire(new PX(`drag`))},this._onKeyUp=e=>{c$e[e.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=e=>{let t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()},this._update=e=>{if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();(e?.type===`terrain`||e?.type===`render`&&!t)&&this._map.once(`render`,this._update),this._lngLat=a$e(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let n=``;this._rotationAlignment===`viewport`||this._rotationAlignment===`auto`?n=`rotateZ(${this._rotation}deg)`:this._rotationAlignment===`map`&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r=``;this._pitchAlignment===`viewport`||this._pitchAlignment===`auto`?r=`rotateX(0deg)`:this._pitchAlignment===`map`&&(r=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&(!e||e.type===`moveend`)&&(this._pos=this._pos.round()),this._element.style.transform=`${o$e[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${n}`,IJ.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(e?.type===`moveend`)}).catch(()=>{})},this._onMove=e=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents=`none`,this._state===`pending`&&(this._state=`active`,this.fire(new PX(`dragstart`))),this.fire(new PX(`drag`)))},this._onUp=()=>{this._element.style.pointerEvents=`auto`,this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off(`mousemove`,this._onMove),this._map.off(`touchmove`,this._onMove),this._state===`active`&&this.fire(new PX(`dragend`)),this._state=`inactive`},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state=`pending`,this._map.on(`mousemove`,this._onMove),this._map.on(`touchmove`,this._onMove),this._map.once(`mouseup`,this._onUp),this._map.once(`touchend`,this._onUp))},this._anchor=e?.anchor||`center`,this._color=e?.color||`#3FB1CE`,this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state=`inactive`,this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||`auto`,this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!==`auto`?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=K.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=RJ.create(`div`);let t=RJ.createNS(`http://www.w3.org/2000/svg`,`svg`);t.setAttributeNS(null,`display`,`block`),t.setAttributeNS(null,`height`,`41px`),t.setAttributeNS(null,`width`,`27px`),t.setAttributeNS(null,`viewBox`,`0 0 27 41`);let n=RJ.createNS(`http://www.w3.org/2000/svg`,`g`);n.setAttributeNS(null,`stroke`,`none`),n.setAttributeNS(null,`stroke-width`,`1`),n.setAttributeNS(null,`fill`,`none`),n.setAttributeNS(null,`fill-rule`,`evenodd`);let r=RJ.createNS(`http://www.w3.org/2000/svg`,`g`);r.setAttributeNS(null,`fill-rule`,`nonzero`);let i=RJ.createNS(`http://www.w3.org/2000/svg`,`g`);i.setAttributeNS(null,`transform`,`translate(3.0, 29.0)`),i.setAttributeNS(null,`fill`,`#000000`);for(let e of[{rx:`10.5`,ry:`5.25002273`},{rx:`10.5`,ry:`5.25002273`},{rx:`9.5`,ry:`4.77275007`},{rx:`8.5`,ry:`4.29549936`},{rx:`7.5`,ry:`3.81822308`},{rx:`6.5`,ry:`3.34094679`},{rx:`5.5`,ry:`2.86367051`},{rx:`4.5`,ry:`2.38636864`}]){let t=RJ.createNS(`http://www.w3.org/2000/svg`,`ellipse`);t.setAttributeNS(null,`opacity`,`0.04`),t.setAttributeNS(null,`cx`,`10.5`),t.setAttributeNS(null,`cy`,`5.80029008`),t.setAttributeNS(null,`rx`,e.rx),t.setAttributeNS(null,`ry`,e.ry),i.appendChild(t)}let a=RJ.createNS(`http://www.w3.org/2000/svg`,`g`);a.setAttributeNS(null,`fill`,this._color);let o=RJ.createNS(`http://www.w3.org/2000/svg`,`path`);o.setAttributeNS(null,`d`,`M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z`),a.appendChild(o);let s=RJ.createNS(`http://www.w3.org/2000/svg`,`g`);s.setAttributeNS(null,`opacity`,`0.25`),s.setAttributeNS(null,`fill`,`#000000`);let c=RJ.createNS(`http://www.w3.org/2000/svg`,`path`);c.setAttributeNS(null,`d`,`M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z`),s.appendChild(c);let l=RJ.createNS(`http://www.w3.org/2000/svg`,`g`);l.setAttributeNS(null,`transform`,`translate(6.0, 7.0)`),l.setAttributeNS(null,`fill`,`#FFFFFF`);let u=RJ.createNS(`http://www.w3.org/2000/svg`,`g`);u.setAttributeNS(null,`transform`,`translate(8.0, 8.0)`);let d=RJ.createNS(`http://www.w3.org/2000/svg`,`circle`);d.setAttributeNS(null,`fill`,`#000000`),d.setAttributeNS(null,`opacity`,`0.25`),d.setAttributeNS(null,`cx`,`5.5`),d.setAttributeNS(null,`cy`,`5.5`),d.setAttributeNS(null,`r`,`5.4999962`);let f=RJ.createNS(`http://www.w3.org/2000/svg`,`circle`);f.setAttributeNS(null,`fill`,`#FFFFFF`),f.setAttributeNS(null,`cx`,`5.5`),f.setAttributeNS(null,`cy`,`5.5`),f.setAttributeNS(null,`r`,`5.4999962`),u.appendChild(d),u.a
vendor: 5,077 bytes, line 1209
1209ppendChild(f),r.appendChild(i),r.appendChild(a),r.appendChild(s),r.appendChild(l),r.appendChild(u),t.appendChild(r),t.setAttributeNS(null,`height`,`${41*this._scale}px`),t.setAttributeNS(null,`width`,`${27*this._scale}px`),this._element.appendChild(t),this._offset=K.convert(e?.offset||[0,-14])}if(this._element.classList.add(`maplibregl-marker`),this._element.addEventListener(`dragstart`,e=>{e.preventDefault()}),this._element.addEventListener(`mousedown`,e=>{e.preventDefault()}),s$e(this._element,this._anchor,`marker`),e?.className)for(let t of e.className.split(` `))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute(`aria-label`)&&this._element.setAttribute(`aria-label`,e._getUIString(`Marker.Title`)),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on(`move`,this._update),e.on(`moveend`,this._update),e.on(`terrain`,this._update),e.on(`projectiontransition`,this._update),this._element.addEventListener(`click`,this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on(`click`,this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off(`click`,this._onMapClick),this._map.off(`move`,this._update),this._map.off(`moveend`,this._update),this._map.off(`terrain`,this._update),this._map.off(`projectiontransition`,this._update),this._map.off(`mousedown`,this._addDragHandler),this._map.off(`touchstart`,this._addDragHandler),this._map.off(`mouseup`,this._onUp),this._map.off(`touchend`,this._onUp),this._map.off(`mousemove`,this._onMove),this._map.off(`touchmove`,this._onMove),delete this._map),this._element.removeEventListener(`click`,this._onClick),this._element.removeEventListener(`keydown`,this._onKeyDown),this._element.removeEventListener(`keyup`,this._onKeyUp),this._element.removeEventListener(`blur`,this._onBlur),this._element.removeEventListener(`keypress`,this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=qK.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener(`keypress`,this._onKeyPress)),e){if(!(`offset`in e.options)){let t=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,(24.6+t)*-1],"bottom-right":[-t,(24.6+t)*-1],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._element.addEventListener(`keypress`,this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new PX(`dragend`)))}getPopup(){return this._popup}togglePopup(){let e=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(e)e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map));else return this;return this}_updateOpacity(e=!1){let t=this._map?.terrain,n=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!t||n){let e=n?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==e&&(this._element.style.opacity=e,this._element.classList.toggle(`maplibregl-marker-covered`,n));return}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let r=this._map,i=r.terrain.depthAtPoint(this._pos),a=r.terrain.getElevationForLngLat(this._lngLat,r._camera.transform),o=r._camera.transform.lngLatToCameraDepth(this._lngLat,a),s=.006;if(o-i<s){this._element.style.opacity=this._opacity,this._element.classList.remove(`maplibregl-marker-covered`);return}let c=-this._offset.y/r._camera.transform.pixelsPerMeter,l=Math.sin(r.getPitch()*Math.PI/180)*c,u=r.terrain.depthAtPoint(new K(this._pos.x,this._pos.y-this._offset.y)),d=r._camera.transform.lngLatToCameraDepth(this._lngLat,a+l)-u>s;this._popup?.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle(`maplibregl-marker-covered`,d)}getOffset(){return this._offset}setOffset(e){return this._offset=K.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle(`maplibregl-marker-draggable`,this._draggable),this._map&&(e?(this._map.on(`mousedown`,this._addDragHandler),this._map.on(`touchstart`,this._addDragHandler)):(this._map.off(`mousedown`,this._addDragHandler),this._map.off(`touchstart`,this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener(`ke
1209ydown`,this._onKeyDown),this._element.addEventListener(`keyup`,this._onKeyUp),this._element.addEventListener(`blur`,this._onBlur)):(this._element.removeEventListener(`keydown`,this._onKeyDown),this._element.removeEventListener(`keyup`,this._onKeyUp),this._element.removeEventListener(`blur`,this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute(`tabindex`)||(this._element.setAttribute(`tabindex`,`0`),this._tabIndexManaged=!0):this._tabIndexManaged&&=(this._element.getAttribute(`tabindex`)===`0`&&this._element.removeAttribute(`tabindex`),!1)}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute(`role`)&&!this._roleManaged)return;let e=this._draggable||this._popup?`button`:`img`;this._element.setAttribute(`role`,e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||`auto`,this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!==`auto`?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(this._opacity===void 0||e===void 0&&t===void 0)&&(this._opacity=`1`,this._opacityWhenCovered=`0.2`),e!==void 0&&(this._opacity=String(e)),t!==void 0&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(!0),this}},u$e={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},IX=0,LX=!1,RX=class extends Kz{},d$e=class extends Kz{},f$e=class extends Kz{},p$e=class extends Jz{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e)){this._setErrorState(),this.fire(new d$e(`outofmaxbounds`,e)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case`WAITING_ACTIVE`:case`ACTIVE_LOCK`:case`ACTIVE_ERROR`:this._watchState=`ACTIVE_LOCK`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active-error`),this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-active`);break;case`BACKGROUND`:case`BACKGROUND_ERROR`:this._watchState=`BACKGROUND`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background-error`),this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-background`);break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!==`OFF`&&this._updateMarker(e),(!this.options.trackUserLocation||this._watchState===`ACTIVE_LOCK`)&&this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove(`maplibregl-user-location-dot-stale`),this.fire(new d$e(`geolocate`,e)),this._finish()}},this._updateCamera=e=>{let t=new qK(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,r=oz({bearing:this._map.getBearing()},this.options.fitBoundsOptions),i=QJ.fromLngLat(t,n);this._map.fitBounds(i,r,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let t=new qK(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=e.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=e=>{if(this._map){if(e.code===1){this._watchState=`OFF`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active-error`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background-error`),this._geolocateButton.disabled=!0;let e=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e),this._geolocationWatchID!==void 0&&this._clearWatch()}else if(e.code===3&&LX)return;else this._setErrorState();this._watchState!==`OFF`&&this.options.showUserLocation&&this._dotElement.classList.add(`maplibregl-user-location-dot-stale`),this.fire(new f$e(`error`,e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=e=>{if(!this._map)return;let t=e?.[0]instanceof ResizeObserverEntry;!e.geolocateSource&&this._watchState===`ACTIVE_LOCK`&&!t&&!this._map.isZooming()&&(this._watchState=`BACKGROUND`,this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-background`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active`),this.fire(new RX(`trackuserlocationend`)),this.fire(new RX(`userlocationlostfocus`)))},this._setupUI=()=>{this._map&&(this._container.addEventListener(`contextmenu`,e=>{e.preventDefault()}),this._geolocateButton=RJ.create(`button`,`maplibregl-ctrl-geolocate`,this._container),RJ.create(`span`,`maplibregl-ctrl-icon`,this._geolocateButton).setAttribute(`aria-hidden`,`true`),this._geolocateButton.type=`button`,this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){_z(`Geolocation support is not available so the GeolocateControl will be disabled.`);let e=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e)}else{let e=this._map._getUIString(`GeolocateControl.FindMyLocation`);this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute(`aria-pressed`,`false`),this._watchState=`OFF`),this.options.showUserLocation&&(this._dotElement=RJ.create(`div`,`maplibregl-user-location-dot`),this._userLocationDotMarker=new FX({element:this._dotElement}),this._circleElement=RJ.create(`div`,`maplibregl-user-location-accuracy-circle`),this._accuracyCircleMarker=new FX({element:this._circleElement,pitchAlignment:`map`}),this.options.trackUserLocation&&(this._watchState=`OFF`),this._map.on(`zoom`,this._onUpdate),this._map.on(`move`,this._onUpdate),this._map.on(`rotate`,this._onUpdate),this._map.on(`pitch`,this._onUpdate)),this._geolocateButton.addEventListener(`click`,()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on(`movestart`,this._onMoveStart)}},this.options=oz({},u$e,e)}onAdd(e){return this._map=e,this._container=RJ.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._setupUI(),i$e().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off(`movestart`,this._onMoveStart),this._map.off(`zoom`,this._onUpdate),this._map.off(`move`,this._onUpdate),this._map.off(`rotate`,this._onUpdate),this._map.off(`pitch`,this._onUpdate),this._map=void 0,IX=0,LX=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),n=e.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case`WAITING_ACTIVE`:this._watchState=`ACTIVE_E
1209RROR`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active`),this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-active-error`);break;case`ACTIVE_LOCK`:this._watchState=`ACTIVE_ERROR`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active`),this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-active-error`),this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-waiting`);break;case`BACKGROUND`:this._watchState=`BACKGROUND_ERROR`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background`),this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-background-error`),this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-waiting`);break;case`ACTIVE_ERROR`:case`BACKGROUND_ERROR`:break;case`OFF`:case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let e=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!e)return;let t=this._map.project(e),n=this._map.unproject([t.x+100,t.y]),r=e.distanceTo(n)/100,i=2*this._accuracy/r;this._circleElement.style.width=`${i.toFixed(2)}px`,this._circleElement.style.height=`${i.toFixed(2)}px`}trigger(){if(!this._setup)return _z(`Geolocate control triggered before added to a map`),!1;if(this.options.trackUserLocation){switch(this._watchState){case`OFF`:this._watchState=`WAITING_ACTIVE`,this.fire(new RX(`trackuserlocationstart`));break;case`WAITING_ACTIVE`:case`ACTIVE_LOCK`:case`ACTIVE_ERROR`:case`BACKGROUND_ERROR`:IX--,LX=!1,this._watchState=`OFF`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active-error`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background-error`),this.fire(new RX(`trackuserlocationend`));break;case`BACKGROUND`:this._watchState=`ACTIVE_LOCK`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background`),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new RX(`trackuserlocationstart`)),this.fire(new RX(`userlocationfocus`));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case`WAITING_ACTIVE`:this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-active`);break;case`ACTIVE_LOCK`:this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-active`);break;case`OFF`:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState===`OFF`&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.setAttribute(`aria-pressed`,`true`),IX++;let e;IX>1?(e={maximumAge:6e5,timeout:0},LX=!0):(e=this.options.positionOptions,LX=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.setAttribute(`aria-pressed`,`false`),this.options.showUserLocation&&this._updateMarker(null)}};[`a[href]`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable]:not([contenteditable='false'])`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`].join(`, `);function m$e(e,t){return sY().setRTLTextPlugin(e,t)}function h$e(e){Iz.WORKER_URL=e}function g$e(e){let[t,n,r,i]=e;return QJ.convert([[t,n],[r,i]])}var _$e=16;function v$e({onClose:e}){let t=(0,B.useContext)(kS),n=Yv(Wx),{featureMap:r}=n,i=fC(),a=Xv(Jx),o=Xv(nS),[s,c]=Zv(Lde),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(0),h=U.getSelectedFeatures(n),g=HL(h),_=cL(h),v=AL(h),y=(0,B.useMemo)(()=>{let e=KL({featureMap:r,folderId:null,virtualColumns:[]});return new FT(Array.from(r.values()),{keys:e,isCaseSensitive:!1,includeMatches:!0,getFn:GL,threshold:.2,ignoreLocation:!0}
1209)},[r]),{data:b,isLoading:x,isError:S}=Rj({queryKey:[`geocoder`,l],queryFn:async({signal:e})=>sye({query:l||``,center:t?.map.getCenter(),zoom:t?.map.getZoom(),signal:e,searchIndex:y,actions:g.concat(_).concat(v)}),enabled:l.length>2,placeholderData:(e,t)=>e});function C(e){if(!e||!t)return;let n=e=>{t.map.zoomTo(_$e,{animate:!1}),t.map.setCenter(e,{animate:!1})},r=e=>{t.map.fitBounds(g$e(e),{animate:!1})};switch(e.type){case`action`:e.action.onSelect();break;case`wrappedFeature`:a(U.single(e.result.item.id)),i([e.result.item]);break;case`coordinate`:n(e.coordinates),o(e);break;case`Feature`:e.bbox?r(e.bbox):n(e.geometry.coordinates),o(e);break;case`extent`:r(e.coordinates),o(e);break;case`container`:case`leaf`:}}let w=b?.geocoder||[],T=b?.literal||[],E=b?.features||[],D=b?.actions||[];return(0,H.jsxs)(`div`,{"aria-label":`Search`,className:`relative w-full`,children:[(0,H.jsxs)(HF,{value:null,onChange:t=>{l&&c(e=>[l].concat(e)),t&&(e(),C(t))},children:[(0,H.jsx)(HF.Input,{ref:e=>{e?.focus()},onKeyUp:t=>{switch(t.key){case`Escape`:e();break;case`ArrowUp`:if(!d&&s.length){let e=s[p];e&&(u(s[0]),m(e=>e+1),t.target.value=e)}break}},value:l,onChange:e=>{u(e.target.value),d||f(!0)},spellCheck:!1,id:`search-geocoder`,"aria-label":`Search`,className:PNe}),x||S?(0,H.jsx)(lg,{}):(0,H.jsxs)(HF.Options,{className:`bg-white dark:bg-gray-900`,children:[(0,H.jsx)(WL,{results:D,title:`Actions`}),(0,H.jsx)(WL,{results:T,title:`Literal`}),(0,H.jsx)(WL,{results:w,title:`Geocoder`}),(0,H.jsx)(WL,{results:E,title:`Features`})]})]}),(0,H.jsx)(`div`,{className:FNe,children:y$e(b)?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Ge,{}),` Navigate options`,(0,H.jsx)(`div`,{className:`flex-auto text-right`,children:`© Geocode Earth`})]}):`Type to search…`})]})}function y$e(e){return e?!!(e.features.length||e.geocoder.length||e.actions.length||e.literal.length):!1}function zX(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,width:`15`,height:`15`,...e,children:(0,H.jsx)(`path`,{d:`M13 2L10 7L5 8L2 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function b$e({modal:e,onClose:t}){let[n,r]=Zv(Jx),i=i_().useTransact(),{features:a}=e,o=tC(a).map(e=>Math.max(Math.abs(e[0]-e[2]),Math.abs(e[1]-e[3]))/8).orDefault(2);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Simplify`,titleIcon:zX}),(0,H.jsx)(eg,{initialValues:{tolerance:o/20,highQuality:!0},onSubmit:e=>{let o=a.map(t=>({...t,feature:fNe(t.feature,e)}));n.type===`single`&&n.parts.length&&r(U.single(n.id)),i({note:`Simplified features`,track:[`operation-simplify`,{count:a.length}],putFeatures:o}).catch(e=>void 0).finally(()=>{t()})},children:(0,H.jsxs)(ig,{className:`space-y-4`,children:[(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(dg,{name:`highQuality`,type:`checkbox`}),(0,H.jsx)(bg,{children:`High quality`})]}),(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Tolerance (degrees, higher values simplify more)`})}),(0,H.jsx)(rg,{name:`tolerance`,className:`w-full`,type:`range`,min:`0`,step:o/100,max:o})]}),(0,H.jsx)(`div`,{className:`flex flex-col sm:flex-row-reverse space-y-2 sm:space-y-0 sm:gap-x-3`,children:(0,H.jsx)(Ug,{variant:`xs`,action:`Simplify`,onClose:t})})]})})]})}var BX=`https://www.openstreetmap.org/copyright`,x$e=`Data from <a href="${BX}" target="_blank">OpenStreetMap</a>`,VX={openrouteservice:{attribution:`© openrouteservice.org by HeiGIT (CC BY 4.0) | Map data © OpenStreetMap contributors (${BX})`,attributionsHtml:[`© <a href="https://openrouteservice.org/terms-of-service/" target="_blank">openrouteservice.org</a> by HeiGIT`,x$e],homepage:`https://openrouteservice.org/`,name:`openrouteservice`},geoapify:{attribution:`Powered by Geoapify (https://www.geoapify.com/) | © OpenStreetMap contributors (${BX})`,attributionsHtml:[`Powered by <a href="https://www.geoapify.com/" target="_blank">Geoapify</a>`,x$e],homepage:`https://www.geoapify.com/`,name:`Geoapify`},osrm:{attribution:`Routing data © OpenStreetMap contributors (${BX})`,attributionsHtml:[`Routing data <a href="${BX}" target="_blank">© OpenStreetMap contributors</a>`],homepage:`https://project-osrm.org/`,name:`OSRM`}},HX=[xx.DRIVING,xx.WALKING,xx.CYCLING];function UX(e){return typeof e==`object`&&e?e:null}function WX(e){let t=UX(e),n=t?.message??t?.error;return typeof n==`string`?n:`Routing request failed`}async function GX(e){let t=await e.json();if(!e.ok)throw Error(WX(t));return t}function S$e(e){return Array.isArray(e)&&e.length>=2&&e.every(e=>typeof e==`number`)}function C$e(e){return Array.isArray(e)&&e.every(S$e)}function w$e(e){let t=UX(e);if(t?.type===`LineString`&&C$e(t.coordinates))return{type:`LineString`,coordinates:t.coordinates};if(t?.type===`MultiLineString`&&Array.isArray(t.coordinates)&&t.coordinates.every(C$e)){let e=[];for(let n of t.coordinates){let t=n[0],r=e.at(-1),i=r&&t&&r[0]===t[0]&&r[1]===t[1];e.push(...i?n.slice(1):n)}return{type:`LineString`,coordinates:e}}
1209throw Error(`Routing provider returned an invalid geometry`)}function T$e(e){let t=UX(e)?.features;if(!Array.isArray(t)||!t.length)throw Error(WX(e));return UX(t[0])?.geometry}function E$e(e){let t=UX(e)?.routes;if(!Array.isArray(t)||!t.length)throw Error(WX(e));return UX(t[0])?.geometry}function KX(e,t){return{attribution:VX[e].attribution,geometry:w$e(t),provider:e}}function D$e(e,t){if(!e.apiKey&&!e.url)return null;let n=(e.url||`https://api.openrouteservice.org/v2/directions`).replace(/\/+$/,``),r={[xx.DRIVING]:`driving-car`,[xx.WALKING]:`foot-walking`,[xx.CYCLING]:`cycling-regular`};return{...VX.openrouteservice,id:`openrouteservice`,profiles:HX,async route(i,a){let o={"Content-Type":`application/json`};return e.apiKey&&(o.Authorization=e.apiKey),KX(`openrouteservice`,T$e(await GX(await t(`${n}/${r[i]}/geojson`,{method:`POST`,headers:o,body:JSON.stringify({coordinates:a})}))))}}}function O$e(e,t){if(!e.apiKey&&!e.url)return null;let n={[xx.DRIVING]:`drive`,[xx.WALKING]:`walk`,[xx.CYCLING]:`bicycle`};return{...VX.geoapify,id:`geoapify`,profiles:HX,async route(r,i){let a=new URL(e.url||`https://api.geoapify.com/v1/routing`);return a.searchParams.set(`waypoints`,i.map(([e,t])=>`lonlat:${e},${t}`).join(`|`)),a.searchParams.set(`mode`,n[r]),a.searchParams.set(`format`,`geojson`),e.apiKey&&a.searchParams.set(`apiKey`,e.apiKey),KX(`geoapify`,T$e(await GX(await t(a))))}}}function k$e(e,t){let n=new Map;return e.osrmDrivingUrl&&n.set(xx.DRIVING,e.osrmDrivingUrl),e.osrmWalkingUrl&&n.set(xx.WALKING,e.osrmWalkingUrl),e.osrmCyclingUrl&&n.set(xx.CYCLING,e.osrmCyclingUrl),n.size?{...VX.osrm,id:`osrm`,profiles:HX.filter(e=>n.has(e)),async route(e,r){let i=n.get(e);if(!i)throw Error(`${e} routing is not configured`);let a=r.map(e=>e.join(`,`)).join(`;`),o=new URL(`${i.replace(/\/+$/,``)}/${a}`);return o.search=new URLSearchParams({alternatives:`false`,geometries:`geojson`,overview:`full`,steps:`false`}).toString(),KX(`osrm`,E$e(await GX(await t(o))))}}:null}function A$e(e,t=fetch){switch(e.provider){case`openrouteservice`:return D$e(e,t);case`geoapify`:return O$e(e,t);case`osrm`:return k$e(e,t);default:return null}}function j$e(e,t){return{...e,"@routing:provider":t.provider,"@routing:attribution":t.attribution}}var qX=A$e({provider:ry.ROUTING_PROVIDER,apiKey:ry.ROUTING_API_KEY,url:ry.ROUTING_URL,osrmDrivingUrl:ry.OSRM_DRIVING_URL,osrmWalkingUrl:ry.OSRM_WALKING_URL,osrmCyclingUrl:ry.OSRM_CYCLING_URL});function M$e(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xm,{title:`Route help`,titleIcon:Ct}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`p`,{children:[`Routing is a beta feature! Please leave feedback and consider`,` `,(0,H.jsx)(`a`,{href:`https://github.com/placemark/placemark`,className:Tg,children:`helping out with development`}),` `,`of this.`]}),(0,H.jsxs)(`p`,{className:`mt-2`,children:[`Draw a route by clicking `,(0,H.jsx)(Ct,{className:`w-4 inline-block`}),` `,`and clicking on the map to add a waypoint. Using the menu to the right of the block, you can customize whether the route using walking, driving, or cycling profiles.`]}),(0,H.jsxs)(`p`,{className:`mt-2`,children:[`Routes are represented as GeometryCollection objects with points for waypoints and a linestring for the route. They are generated by`,` `,(0,H.jsx)(`a`,{href:qX?.homepage,className:Tg,children:qX?.name||`the configured routing provider`}),`. Provider and attribution details are saved with the route so they remain available when the document is exported.`]}),(0,H.jsxs)(`p`,{children:[(0,H.jsx)(`h2`,{className:`mt-8 font-bold`,children:`Known limitations`}),(0,H.jsxs)(`ul`,{className:`list-disc ml-6 mt-2`,children:[(0,H.jsx)(`li`,{children:`You can't add control points to the middle of routes, or extend routes once they've been drawn.`}),(0,H.jsx)(`li`,{children:`Other than doing 'Split GeometryCollection', there is not a very intuitive way to turn a route into a normal LineString.`})]})]})]})]})}var N$e=(0,B.memo)(function(){let[e,t]=Zv(Ux),n=(0,B.useCallback)(()=>{t(null)},[t]),r=`sm`,i=BC(e).with(null,()=>null).with({type:`import`},e=>(0,H.jsx)(SDe,{modal:e,onClose:n})).with({type:`import_notes`},e=>(0,H.jsx)(EDe,{modal:e,onClose:n})).with({type:`export`},()=>(0,H.jsx)(Sxe,{onClose:n})).with({type:`quickswitcher`},()=>(r=`xs`,(0,H.jsx)(v$e,{onClose:n}))).with({type:`export_code`},()=>(0,H.jsx)(Kxe,{onClose:n})).with({type:`load_text`},e=>(0,H.jsx)(DDe,{modal:e,onClose:n})).with({type:`cast_property`},e=>(0,H.jsx)(rfe,{modal:e,onClose:n})).with({type:`cheatsheet`},()=>(0,H.jsx)(afe,{})).with({type:`circle_types`},()=>(0,H.jsx)(Fpe,{})).with({type:`route_help`},()=>(0,H.jsx)(M$e,{})).with({type:`circle`},e=>(0,H.jsx)(Ppe,{modal:e,onClose:n})).with({type:`simplify`},e=>(0,H.jsx)(b$e,{onClose:n,modal:e})).with({type:`buffer`},e=>(0,H.jsx)(Qse,{onClose:n,modal:e})).with({type:`export-svg`},()=>(0,H.jsx)(fEe,{})).with({type:`from_url`},()=>(0,H.jsx)(ODe,{onClose:n})).with({type:`import_example`},()=>(0,H.jsx)(TDe,{onClose:n})).exhaustive();return(0,H.jsxs)(Hs,{open:!!i,onOpenChange:e=>{e||n()},children:[(0,H.jsx)(Us,{className:`hidden`,children:(0,H.jsx)(`div`,{className:`hidden`})}),(0,H.jsxs)(Ws,{children:[e?.type===`circle`?null:(0,H.jsx)(hse,{}),(0,H.jsx)(B.Suspense,{fallback:(0,H.jsx)(lg,{}),children:(0,H.jsx)(gse,{onOpenAutoFocus:e=>e.preventDefault(),size:r,children:(0,H.jsx)(cg,{children:i})})})]})]})}),P$e=new RegExp([`^npm-debug\\.log$`,`^\\..*\\.swp$`,`^\\.DS_Store$`,`^\\.AppleDouble$`,`^\\.LSOverride$`,`^Icon\\r$`,`^\\._.*`,`^\\.Spotlight-V100(?:$|\\/)`,`\\.Trashes`,`^__MACOSX$`,`~$`,`^Thumbs\\.db$`,`^ehthumbs\\.db$`,`^Desktop\\.ini$`,`@eaDir$`].join(`|`));function F$e(e){return e.isFile}function I$e(e){return e.isDirectory}function L$e(e){return new Promise((t,n)=>{e.file(t,n)})}function R$e(e){return new Promise((t,n)=>{e.readEntries(t,n)})}function z$e(e){return!e||!e.getAsFileSystemHandle?Promise.resolve(null):e.getAsFileSystemHandle().c
1209atch(e=>(console.error(e),null))}function B$e(e,t,n){return Promise.all([L$e(e),z$e(t)]).then(([e,t])=>(t&&(e.handle=t),e.path=n+e.name,e))}async function V$e(e,t){return R$e(e).then(e=>{let n=e.map(e=>U$e(e,void 0,t));return Promise.all(n).then(e=>e.flat())})}async function H$e(e,t){let n=e.createReader(),r=`${t+e.name}/`,i=[],a;do a=await V$e(n,r),i=i.concat(a);while(a.length>0);return i}function U$e(e,t,n=``){return F$e(e)?B$e(e,t,n).then(e=>[e]):I$e(e)?H$e(e,n):Promise.resolve([])}function W$e(e){let t=[];for(let n of e){let e=n.webkitGetAsEntry();e&&t.push([e,n])}return Promise.all(t.map(([e,t])=>U$e(e,t))).then(e=>e.flat().filter(e=>!P$e.test(e.name)))}function G$e(e){return{type:`file`,file:e}}function K$e(e){return{type:`shapefile`,files:{shp:e}}}function q$e(e){return XC(e.name)===`.shp`}function J$e(e){let t=Array.from(e),n=(0,KS.default)(t,e=>q$e(e)).map(e=>K$e(e));function r(e,n){let r=e.files.shp.name.replace(/\.shp$/,``),i=(0,KS.default)(t,e=>e.name===`${r}.${n}`);i.length&&(e.files[n]=i[0])}for(let e of n)r(e,`shx`),r(e,`prj`),r(e,`dbf`),r(e,`cpg`);return[...t.map(e=>G$e(e)),...n]}var JX=e=>{e.preventDefault()},Y$e=(0,B.memo)(function(){let[e,t]=(0,B.useState)(!1),n=Xv(Ux);return(0,B.useEffect)(()=>{let e=e=>{e.length&&n({type:`import`,files:J$e(e)})},r=()=>{t(!0)},i=e=>{if(!e.relatedTarget){t(!1);return}let n=document.querySelectorAll(`[data-radix-portal]`);for(let r of n)if(e.relatedTarget instanceof Node&&r.contains(e.relatedTarget)){t(!1);return}},a=async n=>{t(!1);let r=n.dataTransfer?.items?await W$e(n.dataTransfer.items):[];e(r),n.preventDefault()},o=e=>{a(e).catch(e=>void 0)};return document.addEventListener(`dragenter`,r),document.addEventListener(`dragleave`,i),document.addEventListener(`drop`,o),window.addEventListener(`dragover`,JX),window.addEventListener(`drop`,JX),()=>{document.removeEventListener(`dragenter`,r),document.removeEventListener(`dragleave`,i),document.removeEventListener(`drop`,o),window.removeEventListener(`dragover`,JX),window.removeEventListener(`drop`,JX)}},[n]),e?(0,H.jsx)(dse,{children:`Drop files to add to the map`}):null});function X$e(e){switch(e.length){case 0:return le.empty();case 1:return le.of({data:JSON.stringify(e[0].feature),message:`Copied feature as GeoJSON`});default:return le.of({data:JSON.stringify(Mx.toFeatureCollection(e)),message:`Copied features as GeoJSON`})}}function Z$e(){let e=i_().useTransact(),t=bM(),n=fC(),r=ny((0,B.useCallback)((t,n,r)=>{if(!r.clipboardData||ov(r))return;let i=t(qx);if(i.length){r.clipboardData.setData(`text/plain`,JSON.stringify(Mx.toFeatureCollection(i)));let{newSelection:a,moment:o}=ML(t(Wx));n(Jx,a),r.preventDefault(),pE.promise(e({...o,track:`cut-features`}),{loading:`Cutting features…`,error:`Failed to cut features`,success:`Cut features`});return}},[e])),i=ny((0,B.useCallback)((e,t,n)=>{if(!n.clipboardData||ov(n))return;let r=e(qx),i=n.clipboardData;X$e(r).ifJust(({data:e,message:t})=>{n.preventDefault(),i.setData(`text/plain`,e),pE.success(t)})},[])),a=ny((0,B.useCallback)((e,r,i)=>{let a=e(Wx);if(!i.clipboardData||ole(i))return;i.preventDefault();let o=i.clipboardData.getData(`text`);if(!o)return;let s=BC(a.selection).with({type:`none`},()=>void 0).with({type:`multi`},()=>U.getSelectedFeatures(a)[0]?.folderId||void 0).with({type:`single`},()=>U.getSelectedFeatures(a)[0]?.folderId||void 0).with({type:`folder`},e=>e.id).exhaustive();t(o,{...GT,type:`geojson`},$g(()=>{}),`Imported text`,s).then(e=>e.caseOf({Left(e){return pE.error(`Tried to import pasted GeoJSON, but: ${e.message}`),Promise.resolve()},Right:async e=>{pE.success(`Pasted features onto map`);let t=tC(EM(await e));return n(t)}}))},[t,n]));(0,B.useEffect)(()=>(document.addEventListener(`copy`,i),document.addEventListener(`cut`,r),document.addEventListener(`paste`,a),()=>{document.removeEventListener(`copy`,i),document.removeEventListener(`cut`,r),document.removeEventListener(`paste`,a)}),[i,r,a])}function Q$e(e,t){return e.type!==`vertex`||t.geometry?.type!==`LineString`?null:e.vertex===t.geometry.coordinates.length-1?`forward`:e.vertex===0?`reverse`:null}function $$e(e,t){return WF(e,t===`forward`?e.geometry.coordinates.concat([(0,GS.default)(e.geometry.coordinates)]):[e.geometry.coordinates[0]].concat(e.geometry.coordinates))}function e1e(){let e=i_().useTransact();return ny((0,B.useCallback)((t,n,{event:r,replaceGeometryForId:i=null})=>{let{featureMap:a,selection:o}=t(Wx);
1209function s(){n(tS,{type:`none`});let e=t(Wx);n(Wx,{...e,selection:U.selectionToFolder(e)}),n(Sx,{mode:yx.DRAW_LINE,modeOptions:{multi:!!r?.shiftKey,replaceGeometryForId:i}})}if(o.type!==`single`||o.parts.length!==1||i)return s();let c=o.parts[0],l=a.get(o.id);if(l){let{feature:t}=l;if(t.geometry?.type!==`LineString`)return s();let r=Q$e(c,t);if(r){let i=$$e(t,r);e({note:`Continued a line`,putFeatures:[{...l,feature:i}]}).then(()=>{n(Jx,U.single(l.id)),n(Sx,{mode:yx.DRAW_LINE,modeOptions:{reverse:r===`reverse`}})}).catch(e=>void 0);return}else s()}},[e]))}function t1e({feature:e}){let t=Xv(Jx);return(0,H.jsx)(Og,{onSelect:()=>{t(U.single(e.id))},onFocus:()=>{t(U.single(e.id))},children:e.feature.geometry?.type},e.id)}function n1e(e){for(let{id:t,wrappedFeature:n}of e.features.ids){let e=Q$e(t,n.feature);if(e)return{wrappedFeature:n,direction:e}}return null}function r1e({contextInfo:e}){let t=i_().useTransact(),n=Xv(Jx),r=Xv(Sx),i=n1e(e);return i?(0,H.jsxs)(Og,{onSelect:()=>{let{wrappedFeature:e,direction:a}=i,o=$$e(e.feature,a);t({note:`Continued a feature`,putFeatures:[{...e,feature:o}]}).then(()=>{n(U.single(e.id)),r({mode:yx.DRAW_LINE,modeOptions:{reverse:a===`reverse`}})}).catch(e=>void 0)},children:[(0,H.jsx)(Ct,{}),`Continue line`]}):null}var i1e=(0,B.memo)(function({contextInfo:e}){let t=Xv(Ux);return(0,H.jsx)(_p,{children:(0,H.jsxs)(xse,{children:[e?(0,H.jsxs)(H.Fragment,{children:[e.features.features.length?(0,H.jsxs)(yp,{children:[(0,H.jsxs)(Ose,{children:[`Select`,(0,H.jsx)(qe,{})]}),(0,H.jsx)(Sse,{children:e.features.features.map(e=>(0,H.jsx)(t1e,{feature:e},e.id))})]}):null,e.selectedFeatures.length?(0,H.jsxs)(yp,{children:[(0,H.jsxs)(Ose,{children:[`Operations`,(0,H.jsx)(qe,{})]}),(0,H.jsx)(Sse,{children:(0,H.jsx)(UL,{selectedWrappedFeatures:e.selectedFeatures,as:`context-item`})}),(0,H.jsxs)(Og,{onSelect:()=>{X$e(e.selectedFeatures).ifJust(({data:e,message:t})=>{pE.promise(lv(e),{loading:`Copying…`,error:`Failed to copy`,success:t}).catch(e=>{})})},children:[`Copy as GeoJSON`,(0,H.jsx)(xt,{})]})]}):null,(0,H.jsx)(r1e,{contextInfo:e})]}):null,(0,H.jsxs)(Og,{onSelect:()=>{e&&t({type:`circle`,position:e.position})},children:[`Draw circle here`,(0,H.jsx)(_t,{})]})]})})}),a1e={fp:!0},o1e=class{id;geometry;constructor(e,t,n){this.id=e,this.geometry={type:`Point`,coordinates:t},this.properties=n?a1e:null}properties;type=`Feature`},s1e=class{id;geometry;constructor(e,t){this.id=e,this.geometry={type:`Point`,coordinates:t}}properties=null;type=`Feature`};function YX({ring:e,syntheticPoints:t,index:n,offset:r,ringType:i}){let a=e.length-+(i===0);for(let o=0;o<a;o++)t.push(new o1e(UC(n,r),e[o],i===2)),i!==2&&o<e.length-1&&t.push(new s1e(wpe(n,r),Bfe(e[o],e[o+1]))),r++;return r}function c1e({geometry:e,syntheticPoints:t,index:n,offset:r}){for(let i of e.coordinates)r=YX({ring:i,syntheticPoints:t,index:n,offset:r,ringType:0});return r}function l1e({geometry:e,syntheticPoints:t,index:n,offset:r}){for(let i of e.coordinates)for(let e of i)r=YX({ring:e,syntheticPoints:t,index:n,offset:r,ringType:0});return r}function u1e({geometry:e,syntheticPoints:t,index:n,offset:r}){return r=YX({ring:e.coordinates,syntheticPoints:t,index:n,offset:r,ringType:1}),r}function d1e({geometry:e,syntheticPoints:t,index:n,offset:r}){return t.push(new o1e(UC(n,r),e.coordinates,!0)),r+1}function f1e({geometry:e,syntheticPoints:t,index:n,offset:r}){return YX({ring:e.coordinates,syntheticPoints:t,index:n,offset:r,ringType:2})}function p1e({geometry:e,syntheticPoints:t,index:n,offset:r}){for(let i of e.coordinates)r=YX({ring:i,syntheticPoints:t,index:n,offset:r,ringType:1});return r}function m1e({geometry:e,syntheticPoints:t,index:n,offset:r}){for(let i of e.geometries)i&&(r=h1e({geometry:i,syntheticPoints:t,index:n,offset:r}));return r}function h1e(e){return BC(e).with({geometry:null},()=>0).with({geometry:{type:`LineString`}},e=>u1e(e)).with({geometry:{type:`MultiLineString`}},e=>p1e(e)).with({geometry:{type:`MultiPoint`}},e=>f1e(e)).with({geometry:{type:`Point`}},e=>d1e(e)).with({geometry:{type:`Polygon`}},e=>c1e(e)).with({geometry:{type:`MultiPolygon`}},e=>l1e(e)).with({geometry:{type:`GeometryCollection`}},e=>m1e(e)).otherwise(()=>0)}var g1e=VA(function(e,t){let n=[],{geometry:r}=e;return h1e({geometry:r,syntheticPoints:n,index:t,offset:0}),n}),_1e=class{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(e,t){let n=this.length++;for(;n>0;){let e=n-1>>1,r=this.values[e];if(t>=r)break;this.ids[n]=this.ids[e],this.values[n]=r,n=e}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],r=--this.length;if(r>0){let n=e[r],i=t[r],a=0,o=r>>1;for(;a<o;){let n=(a<<1)+1,o=n+1,s=n+(o<r&+(t[o]<t[n]));if(t[s]>=i)break;e[a]=e[s],t[a]=t[s],a=s}e[a]=n,t[a]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){this.ids.length=this.values.length=this.length}},v1e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array
1209],XX=3,ZX=class e{static from(t,n=0){if(n%8!=0)throw Error(`byteOffset must be 8-byte aligned.`);if(!t||t.byteLength===void 0||t.buffer)throw Error(`Data must be an instance of ArrayBuffer or SharedArrayBuffer.`);let[r,i]=new Uint8Array(t,n+0,2);if(r!==251)throw Error(`Data does not appear to be in a Flatbush format.`);let a=i>>4;if(a!==XX)throw Error(`Got v${a} data when expected v${XX}.`);let o=v1e[i&15];if(!o)throw Error(`Unrecognized array type.`);let[s]=new Uint16Array(t,n+2,1),[c]=new Uint32Array(t,n+4,1);return new e(c,s,o,void 0,t,n)}constructor(e,t=16,n=Float64Array,r=ArrayBuffer,i,a=0){if(e===void 0)throw Error(`Missing required argument: numItems.`);if(isNaN(e)||e<=0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.byteOffset=a;let o=e,s=o;this._levelBounds=[o*4];do o=Math.ceil(o/this.nodeSize),s+=o,this._levelBounds.push(s*4);while(o!==1);this.ArrayType=n,this.IndexArrayType=s<16384?Uint16Array:Uint32Array;let c=v1e.indexOf(n),l=s*4*n.BYTES_PER_ELEMENT;if(c<0)throw Error(`Unexpected typed array class: ${n}.`);if(i)this.data=i,this._boxes=new n(i,a+8,s*4),this._indices=new this.IndexArrayType(i,a+8+l,s),this._pos=s*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let i=this.data=new r(8+l+s*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new n(i,8,s*4),this._indices=new this.IndexArrayType(i,8+l,s),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(i,0,2).set([251,(XX<<4)+c]),new Uint16Array(i,2,1)[0]=t,new Uint32Array(i,4,1)[0]=e}this._queue=new _1e}add(e,t,n=e,r=t){let i=this._pos>>2,a=this._boxes;return this._indices[i]=i,a[this._pos++]=e,a[this._pos++]=t,a[this._pos++]=n,a[this._pos++]=r,e<this.minX&&(this.minX=e),t<this.minY&&(this.minY=t),n>this.maxX&&(this.maxX=n),r>this.maxY&&(this.maxY=r),i}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let e=this._boxes;if(this.numItems<=this.nodeSize){e[this._pos++]=this.minX,e[this._pos++]=this.minY,e[this._pos++]=this.maxX,e[this._pos++]=this.maxY;return}let t=this.maxX-this.minX||1,n=this.maxY-this.minY||1,r=new Uint32Array(this.numItems),i=65535;for(let a=0,o=0;a<this.numItems;a++){let s=e[o++],c=e[o++],l=e[o++],u=e[o++];r[a]=x1e(Math.floor(i*((s+l)/2-this.minX)/t),Math.floor(i*((c+u)/2-this.minY)/n))}QX(r,e,this._indices,0,this.numItems-1,this.nodeSize);for(let t=0,n=0;t<this._levelBounds.length-1;t++){let r=this._levelBounds[t];for(;n<r;){let t=n,i=e[n++],a=e[n++],o=e[n++],s=e[n++];for(let t=1;t<this.nodeSize&&n<r;t++)i=Math.min(i,e[n++]),a=Math.min(a,e[n++]),o=Math.max(o,e[n++]),s=Math.max(s,e[n++]);this._indices[this._pos>>2]=t,e[this._pos++]=i,e[this._pos++]=a,e[this._pos++]=o,e[this._pos++]=s}}}search(e,t,n,r,i){if(this._pos!==this._boxes.length)throw Error(`Data not yet indexed - call index.finish().`);let a=this._boxes.length-4,o=[],s=[];for(;a!==void 0;){let c=Math.min(a+this.nodeSize*4,y1e(a,this._levelBounds));for(let l=a;l<c;l+=4){let c=this._boxes[l];if(n<c)continue;let u=this._boxes[l+1];if(r<u)continue;let d=this._boxes[l+2];if(e>d)continue;let f=this._boxes[l+3];if(t>f)continue;let p=this._indices[l>>2]|0;a>=this.numItems*4?o.push(p):(i===void 0||i(p,c,u,d,f))&&s.push(p)}a=o.pop()}return s}neighbors(e,t,n=1/0,r=1/0,i){if(this._pos!==this._boxes.length)throw Error(`Data not yet indexed - call index.finish().`);let a=this._boxes.length-4,o=this._queue,s=[],c=r*r;outer:for(;a!==void 0;){let r=Math.min(a+this.nodeSize*4,y1e(a,this._levelBounds));for(let n=a;n<r;n+=4){let r=this._indices[n>>2]|0,s=this._boxes[n],l=this._boxes[n+1],u=this._boxes[n+2],d=this._boxes[n+3],f=e<s?s-e:e>u?e-u:0,p=t<l?l-t:t>d?t-d:0,m=f*f+p*p;m>c||(a>=this.numItems*4?o.push(r<<1,m):(i===void 0||i(r))&&o.push((r<<1)+1,m))}for(;o.length&&o.peek()&1;)if(o.peekValue()>c||(s.push(o.pop()>>1),s.length===n))break outer;a=o.length?o.pop()>>1:void 0}return o.clear(),s}};function y1e(e,t){let n=0,r=t.length-1;for(;n<r;){let i=n+r>>1;t[i]>e?r=i:n=i+1}return t[n]}function QX(e,t,n,r,i,a){if(Math.floor(r/a)>=Math.floor(i/a))return;let o=e[r],s=e[r+i>>1],c=e[i],l=c,u=Math.max(o,s);c>u?l=u:u===o?l=Math.max(s,c):u===s&&(l=Math.max(o,c));let d=r-1,f=i+1;for(;;){do d++;while(e[d]<l);do f--;while(e[f]>l);if(d>=f)break;b1e(e,t,n,d,f)}QX(e,t,n,r,f,a),QX(e,t,n,f+1,i,a)}function b1e(e,t,n,r,i){let a=e[r];e[r]=e[i],e[i]=a;let o=4*r,s=4*i,c=t[o],l=t[o+1],u=t[o+2],d=t[o+3];t[o]=t[s],t[o+1]=t[s+1],t[o+2]=t[s+2],t[o+3]=t[s+3],t[s]=c,t[s+1]=l,t[s+2]=u,t[s+3]=d;let f=n[r];n[r]=n[i],n[i]=f}function x1e(e,t){let n=e^t,r=65535^n,i=65535^(e|t),a=e&(t^65535),o=n|r>>1,s=n>>1^n,c=i>>1^r&a>>1^i,l=n&i>>1^a>>1^a;n=o,r=s,i=c,a=l,o=n&n>>2^r&r>>2,s=n&r>>2^r&(n^r)>>2,c^=n&i>>2^r&a>>2,l^=r&i>>2^(n^r)&a>>2,n=o,r=s,i=c,a=l,o=n&n>>4^r&r>>4,s=n&r>>4^r&(n^r)>>4,c^=n&i>>4^r&a>>4,l^=r&i>>4^(n^r)&a>>4,n=o,r=s,i=c,a=l,c^=n&i>>8^r&a>>8,l^=r&i>>8^(n^r)&a>>8,n=c^c>>1,r=l^l>>1;let u=e^t,d=r|65535^(u|n);return u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,(d<<1|u)>>>0}var S1e={type:`none`,search:()=>U.none()};function C1e(e){let t=Math.min(e[0][0],e[1][0]),n=Math.max(e[0][0],e[1][0]);return[t,Math.min(e[0][1],e[1][1]),n,Math.max(e[0][1],e[1][1])]}var w1e=class{type=`feature`;index;features;indexes;constructor(e){this.indexes=[];let t=[];for(let n=0;n<e.length;n++){let{feature:r}=e[n],i=Wfe(r);for(let e of i)t.push(e[0],e[1],e[2],e[3]),this.indexes.push(n)}let n=new ZX(t.length/4);for(let e=0;e<t.length;e+=4)n.add(t[e],t[e+1],t[e+2],t[e+3]);n.finish(),this.features=e,this.index=n}search(e,t){let n=(0,qS.default)((0,qS.default)(this.index.search(...C1e(e))).map(e=>this.features[this.indexes[e]]));if(t.type===`multi`&&t.previousIds?.length){let e=t.previousIds.slice(),r=new Set(e);for(let{id:t}of n)r.has(t)||e.push(t);return{type:`multi`,ids:e,previousIds:t.previousIds}}else return U.fromIds(n.map(e=>e.id))}},T1e=class{type=`vertex`;index;vertexes;constructor(e,t){let n=g1e(e.feature,t).filter(e=>GC(e.id).type===`vertex`),r=new ZX(n.length);for(let e of n){let[t,n]=e.geometry.coordinates;r.add(t,n,t,n)}r.finish(),this.vertexes=n,this.index=r}search(e,t){if(t.type!==`single`)return t;let n=(0,qS.default)(this.index.search(...C1e(e)).map(e=>this.vertexes[e])).map(e=>GC(e.id));return{type:`single`,id:t.id,parts:n}}};function E1e(e){return e.length?new w1e(e):S1e}function D1e(e,t){return new T1e(e,t)}var O1e=Object.defineProperty,k1e=Object.defineProperties,A1e=Object.getOwnPropertyDescriptors,j1e=Object.getOwnPropertySymbols,M1e=Object.prototype.hasOwnProperty,N1e=Object.prototype.propertyIsEnumerable,P1e=(e,t,n)=>t in e?O1e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F1e=(e,t)=>{for(var n in t||={})M1e.call(t,n)&&P1e(e,n,t[n]);if(j1e)for(var n of j1e(t))N1e.call(t,n)&&P1e(e,n,t[n]);return e},I1e=(e,t)=>k1e(e,A1e(t));function L1e(e,t,n={}){if(!e||!t)throw Error(`lines and inputPoint are required arguments`);let r=lL(t),i=SS([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),a=0,o=0,s=-1;return MS(e,function(e,c,l){s!==l&&(s=l,o=0);let u=RMe(e),d=u.length-2;for(let e=0;e<u.length-1;e++){let s=SS(u[e]),c=lL(s),f=SS(u[e+1]),p=lL(f),m=dL(s,f,n),h,g;p[0]===r[0]&&p[1]===r[1]?[h,g]=[p,!0]:c[0]===r[0]&&c[1]===r[1]?[h,g]=[c,!1]:[h,g]=V1e(c,p,r);let _=dL(t,h,n);if(_<i.properties.pointDistance){let t=dL(s,h,n);i=SS(h,{lineStringIndex:l,segmentIndex:g&&e+1<=d?e+1:e,totalDistance:a+t,lineDistance:o+t,segmentDistance:t,pointDistance:_,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),i.properties=I1e(F1e({},i.properties),{multiFeatureIndex:i.properties.lineStringIndex,index:i.properties.segmentIndex,location:i.properties.totalDistance,dist:i.properties.pointDistance})}a+=m,o+=m}}),i}function $X(e,t){let[n,r,i]=e,[a,o,s]=t;return n*a+r*o+i*s}function eZ(e,t){let[n,r,i]=e,[a,o,s]=t;return[r*s-i*o,i*a-n*s,n*o-r*a]}function R1e(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2)}function z1e(e){let t=R1e(e);return[e[0]/t,e[1]/t,e[2]/t]}function tZ(e){let t=ES(e[1]),n=ES(e[0]);return[Math.cos(t)*Math.cos(n),Math.cos(t)*Math.sin(n),Math.sin(t)]}function B1e(e){let[t,n,r]=e,i=TS(Math.asin(Math.min(Math.max(r,-1),1)));return[TS(Math.atan2(n,t)),i]}function V1e(e,t,n){let r=tZ(e),i=tZ(t),a=tZ(n),o=eZ(r,i);if(o[0]===0&&o[1]===0&&o[2]===0)return $X(r,i)>0?[[...t],!0]:[[...n],!1];let s=eZ(o,a);if(s[0]===0&&s[1]===0&&s[2]===0)return[[...t],!0];let c=z1e(eZ(s,o)),l=[-c[0],-c[1],-c[2]],u=$X(a,c)>$X(a,l)?c:l,d=z1e(o),f=$X(eZ(r,u),d),p=$X(eZ(u,i),d);return f>=0&&p>=0?[B1e(u),!1]:$X(r,a)>$X(i,a)?[[...e],!1]:[[...t],!0]}var H1e=L1e;function U1e(e,t={}){let n=uL(e);switch(!t.properties&&e.type===`Feature`&&(t.properties=e.properties),n.type){case`Polygon`
1209:return W1e(n,t);case`MultiPolygon`:return G1e(n,t);default:throw Error(`invalid poly`)}}function W1e(e,t={}){let n=uL(e).coordinates;return K1e(n,t.properties?t.properties:e.type===`Feature`?e.properties:{})}function G1e(e,t={}){let n=uL(e).coordinates,r=t.properties?t.properties:e.type===`Feature`?e.properties:{},i=[];return n.forEach(e=>{i.push(K1e(e,r))}),sfe(i)}function K1e(e,t){return e.length>1?cfe(e,t):CS(e[0],t)}var q1e=U1e,nZ={empty(){return{uuids:[],intids:new Map}},loadIdsFromPersistence(e){let t=nZ.empty();for(let{id:n}of e)nZ.pushUUID(t,n);return t},pushUUID(e,t){if(e.intids.has(t))return;let n=e.uuids.push(t)-1;e.intids.set(t,n)},deleteUUID(e,t){let n=e.intids.get(t);n!==void 0&&(delete e.uuids[n],e.intids.delete(t))},getUUID(e,t){return e.uuids[t]},getIntID(e,t){return e.intids.get(t)}};function rZ(e){return aC(e.lngLat.toArray(),7)}function iZ({mode:e,featureMap:t,geometry:n,selection:r,properties:i={}}){let a=VC(),o=e.modeOptions?.replaceGeometryForId,s=o&&t.get(o);return s?{...s,feature:{...s.feature,geometry:n}}:{id:a,folderId:U.folderId(r),feature:{type:`Feature`,properties:i,geometry:n}}}var J1e=(e,t,n,r)=>{let{x:i,y:a}=e,o=[[i-12,a-12],[i+12,a+12]],s=t.map.queryRenderedFeatures(o,{layers:ME});if(!s.length)return null;for(let e of s){let t=e.id,i=GC(t),a=nZ.getUUID(n,i.featureId);if(a!==r)return a}return null},Y1e=(e,t)=>{let n=t,r=1/0;for(let i of e.coordinates){let e=zMe(t,i);e<r&&(n=i,r=e)}return n},X1e=(e,t)=>{if(!e.geometry)return t;switch(e.geometry.type){case`Point`:return e.geometry.coordinates;case`MultiPoint`:return Y1e(e.geometry,t);case`LineString`:case`MultiLineString`:{let n=e.geometry;return H1e(n,t).geometry.coordinates}case`Polygon`:case`MultiPolygon`:return H1e(q1e(e.geometry),t).geometry.coordinates;default:return t}},aZ=(e,t,n,r,i)=>{let a=rZ(e),o=J1e(e.point,n,r,i);if(!o)return a;let s=t.get(o);if(!s)return a;let{feature:c}=s;return c.geometry?X1e(c,a):a};async function Z1e(e,t,n){let r=t.feature.geometry;if(r?.type!==`GeometryCollection`)return null;let i=r.geometries.filter(e=>e.type===`Point`);if(!r.geometries.find(e=>e.type===`LineString`)||!i.length)return null;e({note:`Added to line`,putFeatures:[t]});try{if(!qX){dE.error(`Routing is not configured`);return}if(!qX.profiles.includes(n)){dE.error(`${n} routing is not configured`);return}let r=await qX.route(n,i.map(e=>e.coordinates));e({note:`Added to line`,putFeatures:[{...t,feature:{...t.feature,properties:j$e(t.feature.properties,r),geometry:{type:`GeometryCollection`,geometries:[r.geometry,...i]}}}]})}catch(e){dE.error(`Could not calculate a route for an unexpected reason ${e}`)}}function Q1e(e){return{type:`Polygon`,coordinates:[[e,e,e,e]]}}function $1e({dragTargetRef:e,selection:t,featureMap:n,folderMap:r,mode:i,rep:a}){let o=i.modeOptions?.multi,s=Xv(Jx),c=Xv(Sx),l=(0,B.useContext)(kS),u=Xv(eS),d=a.useTransact(),[f,p]=(0,B.useState)(null);return{click:dP.default,move:e=>{if(t?.type!==`single`||!f||!l)return;let r=n.get(t.id);if(r){let t=r.feature,n=dpe({center:f,mouse:e.lngLat.toArray(),type:i.modeOptions?.circleType||bx.MERCATOR});return d({putFeatures:[{...r,feature:{...t,geometry:n}}],quiet:!0})}},down:e=>{e.preventDefault(),p(e.lngLat.toArray());let r=rZ(e),a=iZ({geometry:Q1e(r),featureMap:n,selection:t,mode:i,properties:{"@circle":{type:i.modeOptions?.circleType||bx.MERCATOR,center:r}}}),o=a.id;d({note:`Drew a circle`,putFeatures:[a]}).then(()=>{s(U.single(o))}).catch(e=>console.error(e))},up:()=>{if(e.current=null,t?.type!==`single`)return;let i=n.get(t.id);if(i){let e=i.feature;if(!ZS(e))return s(U.none()),c({mode:yx.NONE}),dE(`Click and drag to draw a circle.`),d({note:`Delete empty circle`,deleteFeatures:[t.id]})}o?s(U.selectionToFolder({selection:t,featureMap:n,folderMap:r})):c({mode:yx.NONE}),u(``)},enter(){c({mode:yx.NONE})},double:dP.default}}var e0e=i(((e,t)=>
1209{var n=$ye(),r=P_();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),t0e=i(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),n0e=i(((e,t)=>{var n=B_();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),r0e=i(((e,t)=>{var n=n0e();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),i0e=i(((e,t)=>{var n=q_(),r=BS(),i=HS(),a=e0e(),o=t0e(),s=k_(),c=r0e(),l=Y_(),u=x_();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),a0e=i(((e,t)=>{var n=a_(),r=P_(),i=D_(),a=c_();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),oZ=e(i(((e,t)=>{var n=IT(),r=i0e(),i=$_(),a=a0e();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})}))());function o0e(e,t,n){let r=new Set,i=[];for(let a of e){let e=nZ.getUUID(n,a.id),o=t.get(e);o&&(r.add(o),i.push({id:GC(a.id),wrappedFeature:o}))}return{ids:i,features:(0,oZ.default)(Array.from(r),`at`)}}function s0e(e){let t=rZ(e);return{type:`GeometryCollection`,geometries:[{type:`Point`,coordinates:t},{type:`LineString`,coordinates:[t,t]}]}}function c0e(e){let t=rZ(e);return{type:`LineString`,coordinates:[t,t]}}function l0e(e){let t=rZ(e);return{type:`Polygon`,coordinates:[[t,t,t]]}}function u0e(e,t){let n=t.project(e.box[0]),r=t.project(e.box[1]);return Math.abs(n.x-r.x)*Math.abs(n.y-r.y)<5}function sZ(e,{idMap:t,featureMap:n,folderMap:r}){let i=e.target,a=[],o=i.queryRenderedFeatures(e.point,{layers:ME,filter:[`!has`,`lasso`]});o.length||(o=i.queryRenderedFeatures(Kfe(e.point),{layers:ME,filter:[`!has`,`lasso`]}));for(let e of o)a.push(e.id);let s=[];for(let e of a){let i=GC(e),a=nZ.getUUID(t,i.featureId),o=n.get(a);o&&!Dde(o,r)&&s.push({wrappedFeature:o,decodedId:i,id:e})}return s.sort((e,t)=>e.wrappedFeature.at>t.wrappedFeature.at?-1:1),s[0]||null}function d0e({flatbushInstance:e,featureMap:t,idMap:n,folderMap:r,selection:i}){return{click:ny((0,B.useCallback)((e,t)=>{t(Sx,{mode:yx.NONE})},[])),move:ny((0,B.useCallback)((t,n,r)=>{let i=r.target,a=t(tS);if(a.type!==`lasso`)return;let o=r.lngLat.toArray(),s={type:`lasso`,box:[a.box[0],o]};if(u0e(s,i)){n(tS,s);return}let{box:c}=s;switch(e.type){case`feature`:n(tS,s),n(Jx,t=>e.search(c,t));break;case`vertex`:t(Jx).type===`single`&&(n(tS,s),n(Jx,t=>e.search(c,t)));break;default:break}r.preventDefault()},[e])),down:dP.default,up:ny((e,a,o)=>{let s=o.target,c=e(tS);if(a(tS,{type:`none`}),c?.type!==`lasso`)return;if(!(u0e(c,s)&&o.originalEvent.shiftKey)){a(Sx,{mode:yx.NONE});return}let l=sZ(o,{idMap:n,featureMap:t,folderMap:r});if(!l){a(Jx,U.none());return}let{wrappedFeature:u,decodedId:d}=l,f=u.id;switch(i.type){case`folder`:break;case`none`:a(Jx,U.single(f));break;case`multi`:a(Jx,U.toggleSelectionId(i,f));break;case`single`:if(d.type===`vertex`)a(Jx,{type:`single`,parts:lle(i.parts,d),id:f});else if(d.type===`feature`){let e=fv([i.id],f);a(Jx,e.length===0?{type:`none`}:{type:`multi`,ids:e})}break}}),double:dP.default,enter(){}}}var f0e=[`shift`,`alt`,`meta`,`mod`,`ctrl`,`control`],p0e={esc:`escape`,return:`enter`,left:`arrowleft`,right:`arrowright`,up:`arrowup`,down:`arrowdown`,ShiftLeft:`shift`,ShiftRight:`shift`,AltLeft:`alt`,AltRight:`alt`,MetaLeft:`meta`,MetaRight:`meta`,OSLeft:`meta`,OSRight:`meta`,ControlLeft:`ctrl`,ControlRight:`ctrl`};function cZ(e){return(p0e[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,``)}function m0e(e){return f0e.includes(e)}function lZ(e,t=`,`){return e.toLowerCase().split(t)}function uZ(e,t=`+`,n=`>`,r=!1,i){let a=[],o=!1;e.includes(n)?(o=!0,a=e.toLocaleLowerCase().split(n).map(e=>cZ(e))):a=e.toLocaleLowerCase().split(t).map(e=>cZ(e));let s={alt:a.includes(`alt`),ctrl:a.includes(`ctrl`)||a.includes(`control`),shift:a.includes(`shift`),meta:a.includes(`meta`),mod:a.includes(`mod`),useKey:r},c=a.filter(e=>!f0e.includes(e));return{...s,keys:c,description:i,isSequence:o}}
1209typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.code!==void 0&&g0e([cZ(e.code)])}),document.addEventListener(`keyup`,e=>{e.code!==void 0&&_0e([cZ(e.code)])})),typeof window<`u`&&(window.addEventListener(`blur`,()=>{dZ.clear()}),window.addEventListener(`contextmenu`,()=>{setTimeout(()=>{dZ.clear()},0)}));var dZ=new Set;function fZ(e){return Array.isArray(e)}function h0e(e,t=`,`){return(fZ(e)?e:e.split(t)).every(e=>dZ.has(e.trim().toLowerCase()))}function g0e(e){let t=Array.isArray(e)?e:[e];dZ.has(`meta`)&&dZ.forEach(e=>!m0e(e)&&dZ.delete(e.toLowerCase())),t.forEach(e=>dZ.add(e.toLowerCase()))}function _0e(e){e===`meta`?dZ.clear():(Array.isArray(e)?e:[e]).forEach(e=>dZ.delete(e.toLowerCase()))}function v0e(e,t,n){(typeof n==`function`&&n(e,t)||n===!0)&&e.preventDefault()}function y0e(e,t,n){return typeof n==`function`?n(e,t):n===!0||n===void 0}function b0e(e){return x0e(e,[`input`,`textarea`,`select`])}function x0e(e,t=!1){let{target:n,composed:r}=e,i;return i=S0e(n)&&r?e.composedPath()[0]&&e.composedPath()[0].tagName:n&&n.tagName,fZ(t)?!!(i&&t&&t.some(e=>e.toLowerCase()===i.toLowerCase())):!!(i&&t&&t)}function S0e(e){return!!e.tagName&&!e.tagName.startsWith(`-`)&&e.tagName.includes(`-`)}function C0e(e,t){return e.length===0&&t?(console.warn(`A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>`),!0):t?e.some(e=>t.includes(e))||e.includes(`*`):!0}var w0e=(e,t,n=!1)=>{let{alt:r,meta:i,mod:a,shift:o,ctrl:s,keys:c,useKey:l}=t,{code:u,key:d,ctrlKey:f,metaKey:p,shiftKey:m,altKey:h}=e,g=cZ(u);if(l&&c?.length===1&&c.includes(d))return!0;if(!(c!=null&&c.includes(g))&&![`ctrl`,`control`,`unknown`,`meta`,`alt`,`shift`,`os`].includes(g))return!1;if(!n){if(r!==h&&g!==`alt`||o!==m&&g!==`shift`)return!1;if(a){if(!p&&!f)return!1}else if(i!==p&&g!==`meta`&&g!==`os`||s!==f&&g!==`ctrl`&&g!==`control`)return!1}return c&&c.length===1&&c.includes(g)?!0:c?h0e(c):!c},T0e=(0,B.createContext)(void 0),E0e=()=>(0,B.useContext)(T0e);function D0e(e,t){return e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&D0e(e[r],t[r]),!0):e===t}var O0e=(0,B.createContext)({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),k0e=()=>(0,B.useContext)(O0e);function A0e(e){let t=(0,B.useRef)(void 0);return D0e(t.current,e)||(t.current=e),t.current}var j0e=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},M0e=typeof window<`u`?B.useLayoutEffect:B.useEffect;function pZ(e,t,n,r){let i=(0,B.useRef)(null),a=(0,B.useRef)(!1),o=n instanceof Array?r instanceof Array?void 0:r:n,s=fZ(e)?e.join(o?.delimiter):e,c=n instanceof Array?n:r instanceof Array?r:void 0,l=(0,B.useCallback)(t,c??[]),u=(0,B.useRef)(l);c?u.current=l:u.current=t;let d=A0e(o),{activeScopes:f}=k0e(),p=E0e();return M0e(()=>{if(d?.enabled===!1||!C0e(f,d?.scopes))return;let e=[],t,n=(n,r=!1)=>{var o;if(!(b0e(n)&&!x0e(n,d?.enableOnFormTags))){if(i.current!==null){let e=i.current.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&e.activeElement!==i.current&&!i.current.contains(e.activeElement)){j0e(n);return}}(o=n.target)!=null&&o.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||lZ(s,d?.delimiter).forEach(i=>{var o,s;if(i.includes(d?.splitKey??`+`)&&i.includes(d?.sequenceSplitKey??`>`)){console.warn(`Hotkey ${i} contains both ${d?.splitKey??`+`} and ${d?.sequenceSplitKey??`>`} which is not supported.`);return}let c=uZ(i,d?.splitKey,d?.sequenceSplitKey,d?.useKey,d?.description);if(c.isSequence){t=setTimeout(()=>{e=[]},d?.sequenceTimeoutMs??1e3);let r=c.useKey?n.key:cZ(n.code);if(m0e(r.toLowerCase()))return;if(e.push(r),r!==c.keys?.[e.length-1]){e=[],t&&clearTimeout(t);return}e.length===c.keys?.length&&(u.current(n,c),t&&clearTimeout(t),e=[])}else if(w0e(n,c,d?.ignoreModifiers)||(o=c.keys)!=null&&o.includes(`*`)){if((s=d?.ignoreEventWhen)!=null&&s.call(d,n)||r&&a.current)return;if(v0e(n,c,d?.preventDefault),!y0e(n,c,d?.enabled)){j0e(n);return}u.current(n,c),r||(a.current=!0)}})}},r=e=>{e.code!==void 0&&(g0e(cZ(e.code)),(d?.keydown===void 0&&d?.keyup!==!0||d!=null&&d.keydown)&&n(e))},c=e=>{e.code!==void 0&&(_0e(cZ(e.code)),a.current=!1,d!=null&&d.keyup&&n(e,!0))},l=i.current||o?.document||document;
1209return l.addEventListener(`keyup`,c,o?.eventListenerOptions),l.addEventListener(`keydown`,r,o?.eventListenerOptions),p&&lZ(s,d?.delimiter).forEach(e=>p.addHotkey(uZ(e,d?.splitKey,d?.sequenceSplitKey,d?.useKey,d?.description))),()=>{l.removeEventListener(`keyup`,c,o?.eventListenerOptions),l.removeEventListener(`keydown`,r,o?.eventListenerOptions),p&&lZ(s,d?.delimiter).forEach(e=>p.removeHotkey(uZ(e,d?.splitKey,d?.sequenceSplitKey,d?.useKey,d?.description))),e=[],t&&clearTimeout(t)}},[s,d,f]),i}function mZ(e,t){let n=Math.atan2(e[1]-t[1],e[0]-t[0]);return Math.abs(n)<Math.PI/4||Math.abs(n)>3/4*Math.PI?[t[0],e[1]]:[e[0],t[1]]}function N0e(){let e=(0,B.useRef)(!1);return pZ(`*`,t=>{e.current=t.shiftKey},{keydown:!0,keyup:!0},[]),e}function P0e(){let e=(0,B.useRef)(!1),t=Xv(eS);return pZ(`Space`,n=>{t(n.type===`keydown`?`move`:``),e.current=n.type===`keydown`},{keydown:!0,keyup:!0},[]),e}function hZ(){let e=(0,B.useRef)(!1);return pZ(`*`,t=>{e.current=t.altKey},{keydown:!0,keyup:!0},[]),e}function F0e({rep:e,featureMap:t,folderMap:n,selection:r,pmap:i,idMap:a,mode:o,dragTargetRef:s}){let c=o.modeOptions?.multi,l=Xv(Jx),u=Xv(Sx),d=Xv(eS),f=e.useTransact(),p=hS(),m=(0,B.useRef)(!1),h=N0e(),g=hZ(),_={click:e=>{let{modeOptions:n}=o;if(r.type===`none`||r.type===`folder`){let n=iZ({mode:o,selection:r,featureMap:t,geometry:c0e(e)}),i=n.id;f({note:`Drew a line`,putFeatures:[n]}).catch(e=>void 0),l(U.single(i))}else if(r.type===`single`){let i=rZ(e),a=t.get(r.id);if(!a){l(U.none());return}let o=a.feature;f({note:`Added to line`,putFeatures:[{...a,feature:WF(o,n?.reverse?[i].concat(o.geometry.coordinates):o.geometry.coordinates.concat([i]))}]}).catch(e=>void 0).then(()=>{})}},move:e=>{let{modeOptions:n}=o;if(r.type!==`single`||e.type===`mousemove`&&m.current)return;let s=t.get(r.id);if(!s)return;let c=s.feature,l=rZ(e),u=c.geometry.coordinates.at(-2);h.current&&u&&(l=mZ(u,l)),g.current&&u&&(l=aZ(e,t,i,a)),f({putFeatures:[{...s,feature:WF(c,n?.reverse?[l].concat(c.geometry.coordinates.slice(1)):c.geometry.coordinates.slice(0,-1).concat([l]))}],quiet:!0}).catch(e=>void 0).then(()=>{})},touchstart:e=>{m.current=!0,e.preventDefault()},touchmove:e=>{_.move(e)},touchend:e=>{_.click(e)},down:e=>{e.type===`mousedown`&&(m.current=!1)},up(){s.current=null,d(``)},double:e=>{let{modeOptions:i}=o;if(r?.type!==`single`)return;let a=t.get(r.id);if(!a){l(U.none());return}c?l(U.selectionToFolder({selection:r,folderMap:n,featureMap:t})):u({mode:yx.NONE}),e.preventDefault();let s=a.feature,d=WF(s,i?.reverse?s.geometry.coordinates.slice(2):s.geometry.coordinates.slice(0,-2));p(2),f({putFeatures:[{...a,feature:d}],quiet:!0}).catch(e=>void 0)},enter(){if(u({mode:yx.NONE}),r.type!==`single`)return;let e=t.get(r.id);if(!e){l(U.none());return}let n=e.feature;f({putFeatures:[{...e,feature:WF(n,n.geometry.coordinates.length>2?o.modeOptions?.reverse?n.geometry.coordinates.slice(1):n.geometry.coordinates.slice(0,-1):n.geometry.coordinates)}]}).catch(e=>void 0)}};return _}function I0e({setFlatbushInstance:e,throttledMovePointer:t,dragTargetRef:n,selection:r,featureMap:i,idMap:a,folderMap:o,mode:s,rep:c,pmap:l}){let u=Xv(tS),d=Xv(Sx),f=Xv(Jx),p=Xv(eS),m=c.useTransact(),h=efe(),g=tfe(),_=(0,B.useRef)(null),v=P0e(),y=hZ();return{double:dP.default,down:t=>{if(_.current=t.lngLat,`button`in t.originalEvent&&t.originalEvent.button===2)return;let{shiftKey:s}=t.originalEvent;if(s){let n;if(r.type===`single`){let e=i.get(r.id);if(!e)return;n=e.feature.geometry?.type===`Point`?E1e(Dx({featureMap:i,folderMap:o})):D1e(e,nZ.getIntID(a,r.id))}else n=E1e(Dx({featureMap:i,folderMap:o}));n&&(e(n),d({mode:yx.LASSO}),u({type:`lasso`,box:[t.lngLat.toArray(),t.lngLat.toArray()]}),r.type===`multi`&&f(e=>e.type===`multi`?{type:`multi`,ids:e.ids,previousIds:e.ids}:e)),t.preventDefault();return}let c=U.toIds(r);if((t.originalEvent.altKey||v.current)&&c.length){n.current=c.slice(),g(U.getSelectedFeatures({selection:r,featureMap:i,folderMap:o})),t.preventDefault();return}let h=l.map.queryRenderedFeatures(t.point,{layers:[xE]})[0];if(!h||r.type!==`single`){let e=sZ(t,{idMap:a,featureMap:i,folderMap:o});if(e){let{wrappedFeature:i,id:a}=e;r.type===`single`&&r.id!==i.id&&(g(i),n.current=a,f(U.single(i.id))),t.preventDefault()}return}t.preventDefault();let y=h.id,b=GC(y),x=i.get(r.id);if(x){if(b.type===`midpoint`){let e=NMe({feature:x.feature,id:b,position:rZ(t)});g(x),m({putFeatures:[{...x,feature:e}]}).then(()=>{n.current=UC(b.featureId,b.vertex+1)}).catch(e=>void 0);return}
1209g(x),n.current=y,p(`pointer`)}},up:()=>{if(n.current=null,h(),p(``),r.type===`single`){let e=i.get(r.id);if(e){let t=e.feature.properties?.[`@type`];if(t===`route:walking`||t===`route:cycling`||t===`route:driving`){let n=t.split(`:`)[1];return Z1e(m,e,n)}}}},move:e=>{if(n.current===null){t(e.point);return}_.current===null&&(_.current=e.lngLat);let o=n.current;if(Array.isArray(o))if(e.originalEvent.altKey){let t=_.current;return _.current=e.lngLat,m({putFeatures:dMe(o.map(e=>i.get(e)),t,e.lngLat),quiet:!0})}else{let t=_.current.lng-e.lngLat.lng,n=_.current.lat-e.lngLat.lat;return _.current=e.lngLat,m({putFeatures:o.map(e=>{let r=i.get(e);return{...r,feature:aMe(r.feature,t,n)}}),quiet:!0})}else if(r.type===`single`){let t=GC(o);switch(t.type){case`feature`:case`midpoint`:break;case`vertex`:{let n=i.get(r.id);if(!n)return;let o=rZ(e);y.current&&(o=aZ(e,i,l,a,r.id));let{feature:c,wasRectangle:u}=zI({feature:n.feature,position:o,breakRectangle:e.originalEvent.metaKey,vertexId:t});return u&&!s?.modeOptions?.hasResizedRectangle&&d(e=>({...e,modeOptions:{hasResizedRectangle:!0}})),m({putFeatures:[{...n,feature:c}],quiet:!0})}}}},click:e=>{let t=sZ(e,{idMap:a,featureMap:i,folderMap:o});if(!t){f(U.none()),d({mode:yx.NONE});return}let{wrappedFeature:n,decodedId:s}=t,c=n.feature,l=n.id;switch(s.type){case`feature`:f(U.single(l));break;case`vertex`:f({type:`single`,parts:[s],id:l});break;case`midpoint`:break}c.geometry!==null&&s.type===`vertex`&&c.geometry.type===`LineString`&&U.isVertexSelected(r,l,s)},enter(){f(U.none())}}}function L0e({dragTargetRef:e,mode:t,selection:n,featureMap:r,rep:i}){let a=Xv(Jx),o=Xv(Sx),s=Xv(eS),c=i.useTransact(),l=t.modeOptions?.multi;return{click:e=>{l||o({mode:yx.NONE});let i=iZ({mode:t,selection:n,featureMap:r,geometry:{type:`Point`,coordinates:rZ(e)}}),s=i.id;c({note:`Drew a point`,putFeatures:[i]}).then(()=>{l||a(U.single(s))}).catch(e=>void 0)},move:dP.default,down:dP.default,up(){e.current=null,s(``)},double:dP.default,enter(){o({mode:yx.NONE})}}}function R0e({rep:e,mode:t,selection:n,idMap:r,featureMap:i,folderMap:a,dragTargetRef:o,pmap:s}){let c=t.modeOptions?.multi,l=Xv(Jx),u=Xv(Sx),d=Xv(eS),f=hS(),p=e.useTransact(),m=(0,B.useRef)(!1),h=N0e(),g=hZ(),_={click:e=>{let a=rZ(e);if(n.type!==`single`){let r=iZ({featureMap:i,geometry:l0e(e),mode:t,selection:n}),a=r.id;p({note:`Drew a polygon`,putFeatures:[r]}).then(()=>{l(U.single(a))}).catch(e=>void 0);return}let o=s.map.queryRenderedFeatures(e.point,{layers:[xE]}),c=i.get(n.id);if(!c){l(U.none());return}let d=c.feature;if(o.some(e=>{if(e.id===void 0)return!1;let t=GC(e.id);return t.type===`vertex`&&nZ.getUUID(r,t.featureId)===n.id&&t.vertex===0})){let e=d.geometry.coordinates[0][0].slice(),t=WF(d,[d.geometry.coordinates[0].slice(0,-2).concat([e])]);p({putFeatures:[{...c,feature:t}],quiet:!0}).then(()=>{u({mode:yx.NONE})}).catch(e=>void 0);return}let f=d.geometry.coordinates[0].at(-3);h.current&&f&&(a=mZ(f,a)),g.current&&f&&(a=aZ(e,i,s,r,n.id));let m=d.geometry.coordinates[0].slice();m.splice(-2,0,a),p({putFeatures:[{...c,feature:WF(d,[m])}],note:`Added a vertex to a polygon`}).catch(e=>void 0)},move:e=>{if(n?.type!==`single`||e.type===`mousemove`&&m.current)return;let t=rZ(e),a=i.get(n.id);if(!a){l(U.none());return}let o=a.feature,c=o.geometry.coordinates[0].at(-3);h.current&&c&&(t=mZ(c,t)),g.current&&c&&(t=aZ(e,i,s,r,n.id));let u=o.geometry.coordinates[0].slice();u[u.length-2]=t,p({putFeatures:[{...a,feature:WF(o,[u])}],quiet:!0}).catch(e=>void 0)},down:e=>{e.type===`mousedown`&&(m.current=!1)},touchstart:e=>{m.current=!0,e.preventDefault()},touchmove:e=>{e.preventDefault(),e.originalEvent?.touches[0]?.force&&_.move(e)},touchend:e=>{_.click(e)},up(){o.current=null,d(``)},double:e=>{if(n?.type!==`single`)return;e.preventDefault();let t=i.get(n.id);if(!t){l(U.none());return}let r=t.feature,o=r.geometry.coordinates[0].slice();o.splice(-2,1);let s=WF(r,[o]);c?l(U.selectionToFolder({selection:n,folderMap:a,featureMap:i})):u({mode:yx.NONE}),f(2),p({putFeatures:[{...t,feature:s}],quiet:!0}).catch(e=>void 0)},enter(){if(n.type!==`single`)return;let e=i.get(n.id);e&&(p({putFeatures:[{...e,feature:_je(e.feature)}
1209],note:`Finished drawing a polygon`}).catch(e=>void 0),u({mode:yx.NONE}))}};return _}function z0e(e){return{type:`Polygon`,coordinates:[[e,e,e,e]]}}function B0e({dragTargetRef:e,selection:t,featureMap:n,folderMap:r,mode:i,rep:a}){let o=i.modeOptions?.multi,s=Xv(Jx),c=Xv(Sx),l=(0,B.useContext)(kS),u=Xv(eS),d=a.useTransact(),[f,p]=(0,B.useState)(null);return{click:dP.default,move:e=>{if(t?.type!==`single`||!f||!l)return;let r=e.originalEvent.shiftKey,i=n.get(t.id);if(i){let t=i.feature,n={x:e.point.x,y:e.point.y};if(r){let e=n.x-f.x,t=n.y-f.y,r=Math.max(Math.abs(e),Math.abs(t));n.x=f.x+Math.sign(e)*r,n.y=f.y+Math.sign(t)*r}let a=l.map,o=[f,[n.x,f.y],[n.x,n.y],[f.x,n.y],f].map(e=>a.unproject(e).toArray());return d({putFeatures:[{...i,feature:WF(t,[o])}],quiet:!0})}},down:e=>{e.preventDefault(),p(e.point);let r=iZ({geometry:z0e(rZ(e)),featureMap:n,selection:t,mode:i}),a=r.id;d({note:`Drew a rectangle`,putFeatures:[r]}).then(()=>{s(U.single(a))}).catch(e=>void 0)},up:()=>{if(e.current=null,t?.type!==`single`)return;let i=n.get(t.id);if(i){let e=i.feature;if(!ZS(e))return s(U.none()),dE(`Click and drag to draw a rectangle.`),d({note:`Delete empty rectangle`,deleteFeatures:[t.id]})}o?s(U.selectionToFolder({selection:t,featureMap:n,folderMap:r})):c({mode:yx.NONE}),u(``)},enter(){c({mode:yx.NONE})},double:dP.default}}function V0e({rep:e,featureMap:t,folderMap:n,selection:r,mode:i,dragTargetRef:a}){let o=i.modeOptions?.multi,s=Xv(Jx),c=Xv(Sx),l=Yv(dS),u=qX?.profiles.includes(l)?l:qX?.profiles[0]||l,d=Xv(eS),f=e.useTransact(),p=hS(),m=(0,B.useRef)(!1),h={click:e=>{if(r.type===`none`||r.type===`folder`){let n=iZ({mode:i,selection:r,featureMap:t,geometry:s0e(e),properties:{"@type":`route:${u}`}}),a=n.id;f({note:`Started drawing a route`,putFeatures:[n]}).catch(e=>void 0),s(U.single(a))}else if(r.type===`single`){let n=rZ(e),i=t.get(r.id);if(!i){s(U.none());return}let a=i.feature,o=a.geometry.geometries.filter(e=>e.type===`Point`),c=a.geometry.geometries.find(e=>e.type===`LineString`),l=[...o,{type:`Point`,coordinates:n}];Z1e(f,{...i,feature:{...a,geometry:{type:`GeometryCollection`,geometries:[c,...l]}}},u)}},move:e=>{},touchstart:e=>{m.current=!0,e.preventDefault()},touchmove:e=>{h.move(e)},touchend:e=>{h.click(e)},down:e=>{e.type===`mousedown`&&(m.current=!1)},up(){a.current=null,d(``)},double:e=>{let{modeOptions:a}=i;if(r?.type!==`single`)return;let l=t.get(r.id);if(!l){s(U.none());return}o?s(U.selectionToFolder({selection:r,folderMap:n,featureMap:t})):c({mode:yx.NONE}),e.preventDefault();let u=l.feature,d=WF(u,a?.reverse?u.geometry.coordinates.slice(2):u.geometry.coordinates.slice(0,-2));p(2),f({putFeatures:[{...l,feature:d}],quiet:!0}).catch(e=>void 0)},enter(){if(c({mode:yx.NONE}),r.type!==`single`)return;let e=t.get(r.id);if(!e){s(U.none());return}let n=e.feature;f({putFeatures:[{...e,feature:WF(n,n.geometry.coordinates.length>2?i.modeOptions?.reverse?n.geometry.coordinates.slice(1):n.geometry.coordinates.slice(0,-1):n.geometry.coordinates)}]}).catch(e=>void 0)}};return h}function H0e(e){return{[yx.NONE]:I0e(e),[yx.DRAW_POINT]:L0e(e),[yx.DRAW_LINE]:F0e(e),[yx.DRAW_ROUTE]:V0e(e),[yx.DRAW_POLYGON]:R0e(e),[yx.DRAW_RECTANGLE]:B0e(e),[yx.DRAW_CIRCLE]:$1e(e),[yx.LASSO]:d0e(e)}}var U0e=e(i(((e,t)=>{(function(n,r){if(typeof e==`object`){var i=r();typeof t==`object`&&t&&t.exports&&(e=t.exports=i),e.randomColor=i}else typeof define==`function`&&define.amd?define([],r):n.randomColor=r()})(e,function(){var e=null,t={};h();var n=[],r=function(t){if(t||={},t.seed!==void 0&&t.seed!==null&&t.seed===parseInt(t.seed,10))e=t.seed;else if(typeof t.seed==`string`)e=y(t.seed);else if(t.seed!==void 0&&t.seed!==null)throw TypeError(`The seed value must be an integer or string`);else e=null;var c,l,u;if(t.count!==null&&t.count!==void 0){for(var d=t.count,f=[],p=0;p<t.count;p++)n.push(!1);for(t.count=null;d>f.length;){var m=r(t);e!==null&&(t.seed=e),f.push(m)}return t.count=d,f}return c=i(t),l=a(c,t),u=o(c,l,t),s([c,l,u],t)};function i(e){if(n.length>0){var t=b(e.hue),r=f(t),i=(t[1]-t[0])/n.length,a=parseInt((r-t[0])/i);return n[a]===!0?a=(a+2)%n.length:n[a]=!0,t=[(t[0]+a*i)%359,(t[0]+(a+1)*i)%359],r=f(t),r<0&&(r=360+r),r}else{var t=l(e.hue);return r=f(t),r<0&&(r=360+r),r}}function a(e,t){if(t.hue===`monochrome`)return 0;if(t.luminosity===`random`)return f([0,100]);var n=u(e),r=n[0],i=n[1];switch(t.luminosity){case`bright`:r=55;break;case`dark`:r=i-10;break;case`light`:i=55;break}return f([r,i])}function o(e,t,n){var r=c(e,t),i=100;switch(n.luminosity){case`dark`:i=r+20;break;case`light`:r=(i+r)/2;break;case`random`:r=0,i=100;break}return f([r,i])}function s(e,t){switch(t.format){case`hsvArray`:return e;case`hslArray`:return v(e);case`hsl`:var n=v(e);return`hsl(`+n[0]+`, `+n[1]+`%, `+n[2]+`%)`;case`hsla`:var r=v(e),i=t.alpha||Math.random();return`hsla(`+r[0]+`, `+r[1]+`%, `+r[2]+`%, `+i+`)`;case`rgbArray`:return g(e);case`rgb`:return`rgb(`+g(e).join(`, `)+`)`;case`rgba`:var a=g(e),i=t.alpha||Math.random();return`rgba(`+a.join(`, `)+`, `+i+`)`;default:return p(e)}}function c(e,t){for(var n=d(e).lowerBounds,r=0;r<n.length-1;r++){var i=n[r][0],a=n[r][1],o=n[r+1][0],s=n[r+1][1];if(t>=i&&t<=o){var c=(s-a)/(o-i),l=a-c*i;return c*t+l}}return 0}function l(e){if(typeof parseInt(e)==`number`){var n=parseInt(e);if(n<360&&n>0)return[n,n]}if(typeof e==`string`){if(t[e]){var r=t[e];if(r.hueRange)return r.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var i=_(e)[0];return[i,i]}}return[0,360]}function u(e){return d(e).saturationRange}function d(e){for(var n in e>=334&&e<=360&&(e-=360),t){var r=t[n];if(r.hueRange&&e>=r.hueRange[0]&&e<=r.hueRange[1])return t[n]}return`Color not found`}function f(t){if(e===null){var n=.618033988749895,r=Math.random();return r+=n,r%=1,Math.floor(t[0]+r*(t[1]+1-t[0]))}else{var i=t[1]||1,a=t[0]||0;e=(e*9301+49297)%233280;var o=e/233280;return Math.floor(a+o*(i-a))}}function p(e){var t=g(e);function n(e){var t=e.toString(16);return t.length==1?`0`+t:t}return`#`+n(t[0])+n(t[1])+n(t[2])}function m(e,n,r){var i=r[0][0],a=r[r.length-1][0],o=r[r.length-1][1],s=r[0][1];t[e]={hueRange:n,lowerBounds:r,saturationRange:[i,a],brightnessRange:[o,s]}}function h(){m(`monochrome`,null,[[0,0],[100,0]]),m(`red`,[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),m(`orange`,[18,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),m(`yellow`,[46,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),m(`green`,[62,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),m(`blue`,[178,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),m(`purple`,[257,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),m(`pink`,[282,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]])}function g(e){var t=e[0];
1209t===0&&(t=1),t===360&&(t=359),t/=360;var n=e[1]/100,r=e[2]/100,i=Math.floor(t*6),a=t*6-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=256,u=256,d=256;switch(i){case 0:l=r,u=c,d=o;break;case 1:l=s,u=r,d=o;break;case 2:l=o,u=r,d=c;break;case 3:l=o,u=s,d=r;break;case 4:l=c,u=o,d=r;break;case 5:l=r,u=o,d=s;break}return[Math.floor(l*255),Math.floor(u*255),Math.floor(d*255)]}function _(e){e=e.replace(/^#/,``),e=e.length===3?e.replace(/(.)/g,`$1$1`):e;var t=parseInt(e.substr(0,2),16)/255,n=parseInt(e.substr(2,2),16)/255,r=parseInt(e.substr(4,2),16)/255,i=Math.max(t,n,r),a=i-Math.min(t,n,r),o=i?a/i:0;switch(i){case t:return[60*((n-r)/a%6)||0,o,i];case n:return[60*((r-t)/a+2)||0,o,i];case r:return[60*((t-n)/a+4)||0,o,i]}}function v(e){var t=e[0],n=e[1]/100,r=e[2]/100,i=(2-n)*r;return[t,Math.round(n*r/(i<1?i:2-i)*1e4)/100,i/2*100]}function y(e){for(var t=0,n=0;n!==e.length&&!(t>=2**53-1);n++)t+=e.charCodeAt(n);return t}function b(e){if(!isNaN(e)){var n=parseInt(e);if(n<360&&n>0)return d(e).hueRange}else if(typeof e==`string`){if(t[e]){var r=t[e];if(r.hueRange)return r.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var i=_(e)[0];return d(i).hueRange}}return[0,360]}return r})}))());function W0e(e){return(0,U0e.default)({seed:e.userId*10,luminosity:`dark`})}function G0e({colors:e,interpolate:t}){let n=100/e.length;return`linear-gradient(90deg, ${e.map((e,r)=>t===`step`?`${e} ${n*r}%, ${e} ${n*(r+1)}%`:`${e} ${n*r}%`).join(`,`)}`}function K0e(e){if(e.geometry?.type===`Polygon`){let t=e.geometry.coordinates[0];if(t.length<3||t.length===3&&t[0][0]===t[2][0]&&t[0][1]===t[2][1])return{type:`Feature`,properties:{},geometry:{type:`LineString`,coordinates:e.geometry.coordinates[0]}}}return e}function q0e(e,t){if(!e)return e;if(t.length===0)return null;let n=null;for(let r of t)r in e&&(n===null&&(n={}),n[r]=e[r]);return n}var J0e=function(e,t,n){return{type:`Feature`,id:t,properties:q0e(e.feature.properties,n),geometry:e.feature.geometry}};function Y0e({symbolization:e,previewProperty:t}){let n=[];switch(t&&n.push(t),e?.simplestyle&&(n=n.concat(re)),e?.type){case`ramp`:case`categorical`:n.push(e.property);break;case`none`:case void 0:break}return n}var X0e=({wrappedFeature:e,keepProperties:t,idMap:n})=>J0e(e,nZ.getIntID(n,e.id),t);function Z0e({data:e,lastSymbolization:t,idMap:n,previewProperty:r}){let{selection:i,folderMap:a,featureMap:o}=e,s=[],c=null,l=wx(a),u=Y0e({symbolization:t,previewProperty:r});for(let e of o.values())e.folderId&&l.size&&l.has(e.folderId)||e.feature.properties?.visibility!==!1&&(i.type===`single`&&e.id===i.id?c=X0e({wrappedFeature:e,keepProperties:u,idMap:n}):s.push(X0e({wrappedFeature:e,keepProperties:u,idMap:n})));let d={synthetic:E,ephemeral:E,features:s,selectionIds:ne};switch(i.type){case`single`:{let{id:e}=i;if(!c)return d;let t=new Set(i.parts.map(Dpe));return{synthetic:g1e(c,nZ.getIntID(n,e)),ephemeral:[K0e(c)],features:s,selectionIds:t}}case`folder`:case`none`:return d;case`multi`:return{synthetic:E,ephemeral:E,features:s,selectionIds:new Set(i.ids.map(e=>nZ.getIntID(n,e)))}}}h$e(`/assets/maplibre-gl-worker-DozJHzxZ.js`);var Q0e={style:{version:8,layers:[],sources:{}},maxZoom:26,boxZoom:!1,dragRotate:!1,attributionControl:!1,fadeDuration:0},$0e=e=>{let t=document.createElement(`div`);return t.style.color=e,t.innerHTML=`<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
1210<path d="M7 17L1 1L17 7L10 10L7 17Z" stroke="white" fill="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
1211</svg>
1212`,t},e2e=new WeakMap;function gZ(e,t,n,r){(!av(e2e.get(e),t)||r)&&(e.setData({type:`FeatureCollection`,features:t}),e2e.set(e,t))}var t2e=class{map;handlers;idMap;lastSelection;lastSelectionIds;lastData;lastEphemeralState;lastSymbolization;presenceMarkers;lastLayer;lastPreviewProperty;constructor({element:e,layerConfigs:t,handlers:n,previewProperty:r,symbolization:i,idMap:a,controlsCorner:o=`bottom-left`}){this.idMap=a;let s={bounds:R},c=new e$e({container:e,...Q0e,...s});c.addControl(new p$e({showUserLocation:!1,showAccuracyCircle:!1,positionOptions:{enableHighAccuracy:!0}}),o),c.addControl(new n$e({}
1212),o),c.addControl(new qQe({compact:!0,customAttribution:[`<a href="/map-style-licenses.html" target="_blank">Style licenses</a>`,...qX?qX.attributionsHtml:[]]})),c.getCanvas().style.cursor=``,c.on(`click`,this.onClick),c.on(`mousedown`,this.onMapMouseDown),c.on(`mousemove`,this.onMapMouseMove),c.on(`dblclick`,this.onMapDoubleClick),c.on(`mouseup`,this.onMapMouseUp),c.on(`moveend`,this.onMoveEnd),c.on(`touchend`,this.onMapTouchEnd),c.on(`move`,this.onMove),c.on(`touchstart`,this.onMapTouchStart),c.on(`touchmove`,this.onMapTouchMove),c.on(`touchend`,this.onMapTouchEnd),this.presenceMarkers=new Map,this.lastSymbolization=i,this.lastSelection={type:`none`},this.lastSelectionIds=ne,this.lastData=null,this.lastEphemeralState={type:`none`},this.lastLayer=null,this.lastPreviewProperty=null,this.handlers=n,this.map=c,this.setStyle({layerConfigs:t,symbolization:i,previewProperty:r})}onClick=e=>{this.handlers.current.onClick(e)};onMapMouseDown=e=>{this.handlers.current.onMapMouseDown(e)};onMapTouchStart=e=>{this.handlers.current.onMapTouchStart(e)};onMapMouseUp=e=>{this.handlers.current.onMapMouseUp(e)};onMoveEnd=e=>{this.handlers.current.onMoveEnd(e)};onMapTouchEnd=e=>{this.handlers.current.onMapTouchEnd(e)};onMove=e=>{this.handlers.current.onMove(e)};onMapMouseMove=e=>{this.handlers.current.onMapMouseMove(e)};onMapTouchMove=e=>{this.handlers.current.onMapTouchMove(e)};onMapDoubleClick=e=>{this.handlers.current.onDoubleClick(e)};setPresences(e){let t=new Set(e.map(e=>e.userId));for(let t of e){let e=this.presenceMarkers.get(t.userId)??new FX($0e(W0e(t)));e.setLngLat([t.cursorLongitude,t.cursorLatitude]).addTo(this.map),this.presenceMarkers.set(t.userId,e)}for(let[e,n]of this.presenceMarkers.entries())t.has(e)||(n.remove(),this.presenceMarkers.delete(e))}setData({data:e,ephemeralState:t,force:n=!1}){let r=this.map.getSource(mE),i=this.map.getSource(hE),a=this.map.getSource(gE),o=this.map.getSource(_E);if(!r||!a||!o){this.lastData=e;return}let s=Z0e({idMap:this.idMap,data:e,lastSymbolization:this.lastSymbolization,previewProperty:this.lastPreviewProperty});gZ(a,s.ephemeral,`ephem`),gZ(r,s.features,`features`,n),gZ(o,s.synthetic.length?s.synthetic.map(e=>({...e,properties:{...e.properties,selected:s.selectionIds.has(e.id)}})):s.synthetic,`synthetic`,n),t.type===`lasso`?gZ(i,[{geometry:nC([...t.box[0],...t.box[1]]),properties:{},type:`Feature`}],`features`,n):gZ(i,[],`features`,n),this.lastData=e,this.updateSelections(s.selectionIds),this.lastEphemeralState=t}remove(){this.map.remove()}async setStyle({layerConfigs:e,symbolization:t,previewProperty:n}){if(e===this.lastLayer&&t===this.lastSymbolization&&n===this.lastPreviewProperty)return;this.lastLayer=e,this.lastSymbolization=t,this.lastPreviewProperty=n;let r=await Bxe({layerConfigs:e,symbolization:t,previewProperty:n});this.map.setStyle(r),await new Promise(e=>setTimeout(e,100)),this.lastData&&(this.setData({data:this.lastData,ephemeralState:this.lastEphemeralState,force:!0}),this.lastSelection={type:`none`})}updateSelections(e){let t=this.lastSelectionIds,n=new Set(e);for(let e of n)t.has(e)||(this.map.setFeatureState({source:mE,id:e},{state:`selected`}),n.delete(e));for(let e of t)n.has(e)||this.map.removeFeatureState({source:mE,id:e},`state`);this.lastSelectionIds=e}},n2e=i(((e,t)=>{var n=w();t.exports=function(){return n.Date.now()}})),r2e=i(((e,t)=>{var n=c_(),r=n2e(),i=V_(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),i2e=e(i(((e,t)=>{var n=r2e(),r=c_(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))());function _Z(e,t,n,r){return pZ(e,(...e)=>t(...e),n,r)}var a2e=new Set([`menuitem`]),vZ={enabled(e){try{return!a2e.has(e.target.getAttribute(`role`))}catch{return!0}}};function o2e(e){return`target`in e&&e.target instanceof HTMLElement&&e.target.closest(`[data-keybinding-scope="editor_folder"]`)}function s2e(){let e=i_(),t=e.useHistoryControl(),n=e.useTransact();_Z(`meta+z, Ctrl+z`,e=>(e.preventDefault(),t(`undo`).catch(e=>void 0),!1),[t]),_Z(`meta+shift+z, Ctrl+shift+z`,e=>{t(`redo`).catch(e=>void 0)},[t]);let r=ny((0,B.useCallback)((e,t,r)=>{let i=e(Wx),{selection:a}=i,o=U.folderId(a);if(o){let e=i.folderMap.get(o);e&&n({note:`Toggled a folder`,putFolders:[{...e,expanded:r}]})}else r||t(Jx,U.selectionToFolder(i))},[n]));_Z(`arrowright`,e=>{o2e(e)&&(e.preventDefault(),r(!0))},vZ,[r]),_Z(`arrowleft`,e=>{o2e(e)&&(e.preventDefault(),r(!1))},vZ,[r]);let i=ny((0,B.useCallback)((e,t)=>{t(Jx,{type:`multi`,ids:Dx(e(Wx)).map(e=>e.id)})},[]));_Z(`meta+a, Ctrl+a`,e=>{e.preventDefault(),i()},vZ,[i]);let a=ny((0,B.useCallback)((e,t)=>{let r=e(Wx);return t(Jx,U.none()),(async()=>{let{newSelection:e,moment:i}=ML(r);t(Jx,e),await n(i)})().catch(e=>void 0),!1},[n]));_Z(`Backspace, delete`,e=>{e.preventDefault(),a()},vZ,[a])}function c2e(){let[e,t]=Zv(Jde),n=i_().useTransact(),[r,i]=Zv(nS),[a,o]=Zv(Jx);if(!r)return null;let s=t=>{let s=VC();n({note:`Added a geocoded point`,track:`add-geocoded-point`,putFeatures:[{id:s,folderId:U.folderId(a),feature:rye(r,e)}]}).then(()=>{o(U.single(s))}).catch(e=>void 0),i(null),t.stopPropagation()},c=r&&nye(r,e);function l(e){let t=VC();n({note:`Added a geocoded extent`,putFeatures:[{id:t,folderId:U.folderId(a),feature:e}]}).then(()=>{o(U.single(t))}).catch(e=>void 0),i(null)}return(0,H.jsx)(`div`,{className:`absolute inset-0 bg-opacity-50 p-4 flex justify-end items-start`,onClick:()=>{i(null)},children:(0,H.jsxs)(`div`,{className:`bg-white p-2 rounded-md space-y-1`,children:[(0,H.jsx)(`div`,{className:`flex items-stretch gap-x-1`,children:BC(r).with({type:`extent`},e=>c?(0,H.jsxs)(Fg,{type:`button`,variant:`primary`,onClick:e=>{l(c),e.stopPropagation()},children:[(0,H.jsx)(gn,{}),`Add `,LT(e)]}):null).with({type:`coordinate`},e=>(0,H.jsxs)(Fg,{type:`button`,variant:`primary`,onClick:s,children:[(0,H.jsx)(Jn,{}),`Add `,LT(e)]})).with({type:`Feature`},e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Fg,{type:`button`,variant:`primary`,onClick:s,children:[(0,H.jsx)(Jn,{}),`Add `,LT(e)]}),c?(0,H.jsxs)(Fg,{type:`button`,variant:`primary`,onClick:e=>{e.stopPropagation(),l(c)},children:[(0,H.jsx)(gn,{}),`Extent`]}):null]})).exhaustive()}),(0,H.jsxs)(`label`,{onClick:e=>{e.stopPropagation()},className:`flex items-center justify-end gap-x-1 text-sm opacity-50 hover:opacity-100`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:e,className:ug({variant:`default`}),onChange:e=>{t(e.target.checked)}}),(0,H.jsx)(`span`,{children:`Include data`})]})]})})}var l2e=i((e=>{e.match=o,e.parse=s;var t=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,n=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,r=/^(?:(min|max)-)?(.+)/,i=/(em|rem|px|cm|mm|in|pt|pc)?$/,a=/(dpi|dpcm|dppx)?$/;function o(e,t){return s(e).some(function(e){var n=e.inverse,r=e.type===`all`||t.type===e.type;if(r&&n||!(r||n))return!1;var i=e.expressions.every(function(e){var n=e.feature,r=e.modifier,i=e.value,a=t[n];if(!a)return!1;switch(n){case`orientation`:case`scan`:return a.toLowerCase()===i.toLowerCase();
1212case`width`:case`height`:case`device-width`:case`device-height`:i=u(i),a=u(a);break;case`resolution`:i=l(i),a=l(a);break;case`aspect-ratio`:case`device-aspect-ratio`:case`device-pixel-ratio`:i=c(i),a=c(a);break;case`grid`:case`color`:case`color-index`:case`monochrome`:i=parseInt(i,10)||1,a=parseInt(a,10)||0;break}switch(r){case`min`:return a>=i;case`max`:return a<=i;default:return a===i}});return i&&!n||!i&&n})}function s(e){return e.split(`,`).map(function(e){e=e.trim();var i=e.match(t),a=i[1],o=i[2],s=i[3]||``,c={};return c.inverse=!!a&&a.toLowerCase()===`not`,c.type=o?o.toLowerCase():`all`,s=s.match(/\([^\)]+\)/g)||[],c.expressions=s.map(function(e){var t=e.match(n),i=t[1].toLowerCase().match(r);return{modifier:i[1],feature:i[2],value:t[2]}}),c})}function c(e){var t=Number(e),n;return t||=(n=e.match(/^(\d+)\s*\/\s*(\d+)$/),n[1]/n[2]),t}function l(e){var t=parseFloat(e);switch(String(e).match(a)[1]){case`dpcm`:return t/2.54;case`dppx`:return t*96;default:return t}}function u(e){var t=parseFloat(e);switch(String(e).match(i)[1]){case`em`:return t*16;case`rem`:return t*16;case`cm`:return t*96/2.54;case`mm`:return t*96/2.54/10;case`in`:return t*96;case`pt`:return t*72;case`pc`:return t*72/12;default:return t}}})),u2e=e(i(((e,t)=>{var n=l2e().match,r=typeof window<`u`?window.matchMedia:null;function i(e,t,i){var a=this,o;r&&!i&&(o=r.call(window,e)),o?(this.matches=o.matches,this.media=o.media,o.addListener(l)):(this.matches=n(e,t),this.media=e),this.addListener=s,this.removeListener=c,this.dispose=u;function s(e){o&&o.addListener(e)}function c(e){o&&o.removeListener(e)}function l(e){a.matches=e.matches,a.media=e.media}function u(){o&&o.removeListener(l)}}function a(e,t,n){return new i(e,t,n)}t.exports=a}))()),d2e=/[A-Z]/g,f2e=/^ms-/,yZ={};function p2e(e){return`-`+e.toLowerCase()}function m2e(e){if(yZ.hasOwnProperty(e))return yZ[e];var t=e.replace(d2e,p2e);return yZ[e]=f2e.test(t)?`-`+t:t}function h2e(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(let r=0;r<i;r++){let i=n[r];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0}var g2e=i(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),_2e=i(((e,t)=>{var n=g2e();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),bZ=e(i(((e,t)=>{t.exports=_2e()()}))()),xZ=bZ.default.oneOfType([bZ.default.string,bZ.default.number]),SZ={all:bZ.default.bool,grid:bZ.default.bool,aural:bZ.default.bool,braille:bZ.default.bool,handheld:bZ.default.bool,print:bZ.default.bool,projection:bZ.default.bool,screen:bZ.default.bool,tty:bZ.default.bool,tv:bZ.default.bool,embossed:bZ.default.bool},v2e={orientation:bZ.default.oneOf([`portrait`,`landscape`]),scan:bZ.default.oneOf([`progressive`,`interlace`]),aspectRatio:bZ.default.string,deviceAspectRatio:bZ.default.string,height:xZ,deviceHeight:xZ,width:xZ,deviceWidth:xZ,color:bZ.default.bool,colorIndex:bZ.default.bool,monochrome:bZ.default.bool,resolution:xZ,type:Object.keys(SZ)},{type:y2e,...b2e}=v2e,x2e={minAspectRatio:bZ.default.string,maxAspectRatio:bZ.default.string,minDeviceAspectRatio:bZ.default.string,maxDeviceAspectRatio:bZ.default.string,minHeight:xZ,maxHeight:xZ,minDeviceHeight:xZ,maxDeviceHeight:xZ,minWidth:xZ,maxWidth:xZ,minDeviceWidth:xZ,maxDeviceWidth:xZ,minColor:bZ.default.number,maxColor:bZ.default.number,minColorIndex:bZ.default.number,maxColorIndex:bZ.default.number,minMonochrome:bZ.default.number,maxMonochrome:bZ.default.number,minResolution:xZ,maxResolution:xZ,...b2e},S2e={all:{...SZ,...x2e},types:SZ,matchers:v2e,features:x2e},C2e=e=>`not ${e}`,w2e=(e,t)=>
1212{let n=m2e(e);return typeof t==`number`&&(t=`${t}px`),t===!0?n:t===!1?C2e(n):`(${n}: ${t})`},T2e=e=>e.join(` and `),E2e=e=>{let t=[];return Object.keys(S2e.all).forEach(n=>{let r=e[n];r!=null&&t.push(w2e(n,r))}),T2e(t)},D2e=(0,B.createContext)(void 0),O2e=e=>e.query||E2e(e),k2e=e=>{if(e)return Object.keys(e).reduce((t,n)=>(t[m2e(n)]=e[n],t),{})},A2e=()=>{let e=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{e.current=!0},[]),e.current},j2e=e=>{let t=(0,B.useContext)(D2e),n=()=>k2e(e)||k2e(t),[r,i]=(0,B.useState)(n);return(0,B.useEffect)(()=>{let e=n();h2e(r,e)||i(e)},[e,t]),r},M2e=e=>{let t=()=>O2e(e),[n,r]=(0,B.useState)(t);return(0,B.useEffect)(()=>{let e=t();n!==e&&r(e)},[e]),n},N2e=(e,t)=>{let n=()=>(0,u2e.default)(e,t||{},!!t),[r,i]=(0,B.useState)(n),a=A2e();return(0,B.useEffect)(()=>{if(a){let e=n();return i(e),()=>{e&&e.dispose()}}},[e,t]),r},P2e=e=>{let[t,n]=(0,B.useState)(e.matches);return(0,B.useEffect)(()=>{let t=e=>{n(e.matches)};return e.addListener(t),n(e.matches),()=>{e.removeListener(t)}},[e]),t},F2e=(e,t,n)=>{let r=j2e(t),i=M2e(e);if(!i)throw Error(`Invalid or missing MediaQuery!`);let a=N2e(i,r),o=P2e(a),s=A2e();return(0,B.useEffect)(()=>{s&&n&&n(o)},[o]),(0,B.useEffect)(()=>()=>{a&&a.dispose()},[]),o},I2e={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function L2e(e){return F2e({query:`(min-width: ${I2e[e]}px)`})}function CZ({mode:e,children:t}){let[n,r]=Zv(Kde);return n.includes(e)?null:(0,H.jsxs)(`div`,{className:Dm(`z-0 absolute top-2 left-2 px-2 text-sm flex gap-x-2 items-center dark:text-white`,xg),children:[(0,H.jsx)(vn,{}),t,(0,H.jsx)(`button`,{type:`button`,onClick:()=>{r(t=>t.concat(e))},className:`pl-3`,children:(0,H.jsx)(kt,{className:`w-2 h-2`})})]})}function R2e(){let e=Yv(Sx),t=Yv(Jx),n=L2e(`lg`),r=sv();if(!n)return null;let i=(e=!1)=>(0,H.jsxs)(`div`,{className:`text-xs`,children:[`Hold `,cv(`Option`,r),` to snap to existing features.`,e?`Hold Shift to snap to right angles.`:null]});switch(e.mode){case yx.DRAW_RECTANGLE:return(0,H.jsx)(CZ,{mode:e.mode,children:t.type===`single`?`Lift the mouse button to finish`:`Click and drag to draw a rectangle`});case yx.LASSO:case yx.DRAW_POINT:return null;case yx.DRAW_POLYGON:return(0,H.jsx)(CZ,{mode:e.mode,children:t.type===`single`?(0,H.jsxs)(`div`,{children:[`Finish by clicking the starting point, double-clicking or hitting Enter`,(0,H.jsx)(`br`,{}),i(!0)]}):`Click to start the polygon, then click to add each vertex`});case yx.DRAW_ROUTE:return(0,H.jsx)(CZ,{mode:e.mode,children:t.type===`single`?(0,H.jsxs)(`div`,{children:[`Finish by hitting escape`,(0,H.jsx)(`br`,{}),i(!0)]}):`Click to start the route, then click to add each waypoint`});case yx.NONE:if(t.type===`single`)return e.modeOptions?.hasResizedRectangle?(0,H.jsx)(CZ,{mode:e.mode,children:`Resizing a rectangle. Hold Cmd to edit as a polygon.`}):(0,H.jsx)(CZ,{mode:e.mode,children:(0,H.jsxs)(`div`,{children:[`Hold space bar & drag to move entire features. Hold option & drag to rotate.`,(0,H.jsx)(`br`,{}),i()]})});break;case yx.DRAW_CIRCLE:return(0,H.jsx)(CZ,{mode:e.mode,children:t.type===`single`?`Lift the mouse button to finish`:`Click and drag to draw a circle`});case yx.DRAW_LINE:return(0,H.jsx)(CZ,{mode:e.mode,children:t.type===`single`?(0,H.jsxs)(`div`,{children:[`End a line by double-clicking or hitting Enter`,(0,H.jsx)(`br`,{}),i(!0)]}):`Click to start the line, then click to add each vertex`})}return null}m$e(`https://unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-rtl-text.js`,!0).catch(cse);var z2e=(0,B.memo)(function({setMap:e}){let t=Yv(Wx),n=Yv(Kx),{featureMap:r,folderMap:i}=t,[a,o]=(0,B.useState)(S1e),[s,c]=(0,B.useState)(null),l=(0,B.useRef)({cursorLatitude:0,cursorLongitude:0}),u=i_(),d=t.selection,f=Yv(tS),p=Yv(Sx),[m,h]=Zv(eS),g=(0,B.useRef)(null),_=(0,B.useRef)(null),v=(0,B.useRef)(null),y=(0,B.useRef)(null),b=(0,B.useContext)(kS),x=u.useTransact(),[S,C]=u.useMetadata(),{label:w,symbolization:T}=S,E=S.layer;Z$e();let D=(0,B.useRef)(!1);(0,B.useEffect)(()=>{E&&!D.current&&(D.current=!0,pE.promise(Promise.resolve(C({layerId:null,defaultLayer:null})).then(()=>x({...ay(`Upgrade layers`),putLayerConfigs:[{...E,at:`a0`,visibility:!0,opacity:1,tms:!1,id:VC()}]})),{loading:`Upgrading layers`,success:`Upgraded layers`,error:`Error migrating layers`}).catch(e=>{}))},[E,x,C,n]),(0,B.useEffect)(()=>
1212{if(!g.current&&!(!_.current||!y))return g.current=new t2e({element:_.current,layerConfigs:n,handlers:y,symbolization:T||Ix,previewProperty:w,idMap:k}),e(g.current),()=>{e(null),g.current&&`remove`in g.current&&g.current.remove(),g.current=null}},[g,_,e]),(0,B.useEffect)(function(){b?.map&&(b.setData({data:t,ephemeralState:f}),b.setStyle({layerConfigs:n,symbolization:T||Ix,previewProperty:w}).catch(e=>void 0))},[b,i,T,t,n,f,w]);let O=(0,B.useMemo)(()=>{function e(e){if(!b)return;let t=b.map.queryRenderedFeatures(e,{layers:ME});h(t.length?`move`:``)}return e},[b,h]),k=u.idMap,A=H0e({flatbushInstance:a,setFlatbushInstance:o,throttledMovePointer:O,mode:p,dragTargetRef:v,featureMap:r,folderMap:i,idMap:k,selection:d,pmap:g.current,rep:u}),j={onClick:e=>{A[p.mode].click(e)},onMapMouseDown:e=>{A[p.mode].down(e)},onMapTouchStart:e=>{let t=A[p.mode];t.touchstart?t.touchstart(e):t.down(e)},onMapMouseUp:e=>{A[p.mode].up(e)},onMapTouchEnd:e=>{let t=A[p.mode];t.touchend?t.touchend(e):t.up(e)},onMapTouchMove:e=>{let t=A[p.mode];t.touchmove?t.touchmove(e):t.move(e)},onMapMouseMove:e=>{A[p.mode].move(e),g.current?.map&&(l.current={cursorLongitude:e.lngLat.lng,cursorLatitude:e.lngLat.lat})},onDoubleClick:e=>{A[p.mode].double(e)},onMoveEnd(){},onMove:(0,i2e.default)(e=>({center:e.target.getCenter().toArray(),bounds:e.target.getBounds()?.toArray()}),300)};_Z(`Escape, Enter`,()=>{A[p.mode].enter()},vZ,[A,p]),y.current=j;let M=ny((0,B.useCallback)((e,t,n)=>{let{featureMap:r}=e(Wx),i=_.current?.getBoundingClientRect(),a=g.current;if(i&&a){let t=a.map.queryRenderedFeatures([n.pageX-i.left,n.pageY-i.top],{layers:ME}),o=a.map.unproject([n.pageX-i.left,n.pageY-i.top]).toArray(),s=e(qx);c({features:o0e(t,r,u.idMap),position:o,selectedFeatures:s})}},[_,u])),N=(0,B.useCallback)(e=>{c(t=>!e&&t?null:t)},[c]);return(0,H.jsxs)(hp,{modal:!1,onOpenChange:N,children:[(0,H.jsx)(gp,{asChild:!0,onContextMenu:M,children:(0,H.jsx)(`div`,{className:Dm(`top-0 bottom-0 left-0 right-0 maplibregl-map`,m===`move`?`cursor-move`:{"placemark-cursor-default":p.mode===yx.NONE||p.mode===yx.DRAW_POLYGON||p.mode===yx.DRAW_LINE,"placemark-cursor-point":p.mode===yx.DRAW_POINT,"placemark-cursor-crosshair":p.mode===yx.DRAW_RECTANGLE||p.mode===yx.LASSO}),ref:_,"data-testid":`map`,style:{position:`absolute`}})}),(0,H.jsx)(i1e,{contextInfo:s}),(0,H.jsx)(c2e,{}),(0,H.jsx)(R2e,{})]})});function B2e(){let e=Yv(rS),[t]=Zv(iS);return e?(0,H.jsxs)(Kp,{open:t.matches(`visible`),children:[(0,H.jsxs)(`div`,{className:`pl-3 flex-initial hidden sm:flex items-center gap-x-1`,children:[(0,H.jsx)(hte,{children:(0,H.jsx)(on,{className:`w-3 h-3`})}),(0,H.jsx)(`div`,{className:`text-xs font-mono whitespace-nowrap truncate`,title:`Saving as ${e.handle.name}`,children:dv(e.handle.name,18)})]}),(0,H.jsxs)(_g,{size:`xs`,children:[(0,H.jsx)(hg,{}),(0,H.jsx)(`div`,{className:`text-xs`,children:`Saved`})]})]}):(0,H.jsx)(`div`,{})}function wZ(){let e=Xv(Ux),{data:t}=Rj({queryKey:[`browser-fs-access`],queryFn:async()=>ye(()=>Promise.resolve().then(()=>J9),void 0)});return(0,B.useCallback)(()=>{if(!t)throw Error(`Sorry, still loading`);return t.fileOpen({multiple:!0,description:`Open files…`}).then(t=>{let n=J$e(t);e({type:`import`,files:n})}).catch(e=>{})},[e,t])}function V2e(){let e=i_().useHistoryControl(),t=Yv($x);return(0,H.jsxs)(bse,{children:[t.undo.map((t,n)=>(0,H.jsxs)(Dg,{onSelect:async t=>{for(let t=0;t<n+1;t++)await e(`undo`)},children:[(0,H.jsx)(qe,{className:`opacity-0`}),t.note||``]},n)).reverse(),(0,H.jsx)(Cg,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(qe,{}),`Current state`]})}),t.redo.map((t,n)=>(0,H.jsxs)(Dg,{onSelect:async t=>{for(let t=0;t<n+1;t++)await e(`redo`)},children:[(0,H.jsx)(qe,{className:`opacity-0`}),t.note||``]},n))]})}function H2e(){let[e,t]=Zv(fS);return(0,H.jsxs)(Dg,{onSelect:()=>{t(e=>e===`light`?`dark`:`light`)},children:[`Switch to `,e===`light`?`dark`:`light`,` theme`]})}function U2e(){let e=wZ(),t=Xv(Ux);return(0,H.jsx)(`div`,{className:`flex items-center`,children:(0,H.jsxs)(zp,{children:[(0,H.jsx)(Bp,{className:Pg({size:`sm`,variant:`quiet`}),children:(0,H.jsx)(`span`,{children:`File`})}),(0,H.jsx)(Bee,{children:(0,H.jsxs)(Sg,{children:[(0,H.jsxs)(Gee,{children:[(0,H.jsxs)(Dse,{children:[`Import`,(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(lt,{})]}),(0,H.jsxs)(bse,{children:[(0,H.jsx)(Dg,{onSelect:()=>e(),children:`Import file`}),(0,H.jsx)(Dg,{onSelect:()=>{t({type:`load_text`})},children:`Paste text`}),(0,H.jsx)(Dg,{onSelect:()=>{t({type:`from_url`})},children:`From URL`}),(0,H.jsx)(Dg,{onSelect:()=>{t({type:`import_example`})},children:`Data library`})]})]}),(0,H.jsx)(Dg,{onSelect:()=>{t({type:`export`})},children:`Export`}),(0,H.jsx)(Dg,{onSelect:()=>{t({type:`export-svg`})},children:`Export SVG`}),(0,H.jsx)(H2e,{}),(0,H.jsx)(wg,{}),(0,H.jsxs)(Gee,{children:[(0,H.jsxs)(Dse,{children:[`Undo history`,(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(lt,{})]}),(0,H.jsx)(V2e,{})]})]})})]})})}var W2e=(0,B.memo)(function(){return(0,H.jsxs)(`div`,{className:`flex justify-between h-12 pr-2 text-black dark:text-white`,children:[(0,H.jsxs)(`div`,{className:`flex items-center`,children:[(0,H.jsxs)(`span`,{className:`py-1 pl-1 pr-2
1213          text-gray-500
1214          inline-flex gap-x-2 items-center`,title:`Home`,children:[(0,H.jsx)(use,{className:`w-8 h-8`}),`Placemark Play`,(0,H.jsxs)(`a`,{href:`https://github.com/placemark/placemark`,className:`text-purple-600 hover:text-purple-700 flex items-center gap-1 text-sm bg-purple-100 px-2 py-1 rounded-sm`,children:[(0,H.jsx)(fn,{}),`Open Source`]})]}),(0,H.jsx)(B2e,{})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(U2e,{}),(0,H.jsx)(G2e,{})]})]})});function G2e(){let e=Xv(Ux);return(0,H.jsxs)(zp,{children:[(0,H.jsx)(Bp,{asChild:!0,children:(0,H.jsx)(Fg,{variant:`quiet`,children:`Help`})}),(0,H.jsxs)(Sg,{children:[(0,H.jsxs)(Dg,{onSelect:()=>{e({type:`cheatsheet`})},children:[(0,H.jsx)(Sn,{}),`Keyboard shorcuts`]}),(0,H.jsxs)(Dg,{onSelect:()=>{window.open(`https://placemark.github.io/docs/`)},children:[(0,H.jsx)(nr,{}),` Documentation`]})]})]})}function K2e(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 15 15`,width:`15`,height:`15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,H.jsx)(`circle`,{r:`6.5`,stroke:`currentColor`,cx:`7.5`,cy:`7.5`})})}function q2e(e){return(0,H.jsx)(`svg`,{viewBox:`0 0 15 15`,width:`15`,height:`15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,H.jsx)(`path`,{d:`M6 1L12 4L11 11L4 12L1 6L6 1Z`,stroke:`currentColor`,strokeLinejoin:`round`})})}function J2e({selected:e=!1,onClick:t,children:n,disabled:r=!1,role:i=void 0,label:a,hotkey:o,noShift:s=!1}){return _Z(`Shift+${o||``}`,e=>{e.preventDefault(),t({shiftKey:!0})}
1214,{enabled:!!o&&!s},[t]),_Z(o||`noop`,e=>{e.preventDefault(),t()},{enabled:!!o},[t]),(0,H.jsx)(`div`,{className:`relative`,children:(0,H.jsxs)(vm,{children:[(0,H.jsx)(`div`,{className:`h-10 w-8 ${r?`opacity-50`:``} group bn flex items-stretch py-1 focus:outline-hidden`,children:(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(Fg,{onClick:t,variant:`quiet/mode`,role:i,disabled:r,"aria-label":a,"aria-checked":e,"aria-expanded":e?`true`:`false`,children:n})})}),(0,H.jsx)(fg,{side:`bottom`,children:(0,H.jsxs)(`div`,{className:`flex gap-x-2 items-center`,children:[a,o?(0,H.jsx)(Rg,{size:`xs`,children:o}):null]})})]})})}function Y2e(){let[e,t]=Zv(dS),n=Xv(Ux),r=qX?.profiles.includes(e)?e:qX?.profiles[0];return(0,H.jsx)(`div`,{className:`z-50`,children:(0,H.jsxs)(zp,{children:[(0,H.jsx)(Bp,{asChild:!0,children:(0,H.jsx)(Fg,{size:`xxs`,variant:`quiet`,children:(0,H.jsx)(at,{})})}),(0,H.jsxs)(Sg,{children:[(0,H.jsx)(Cg,{children:`Route type`}),qX?.profiles.map(e=>(0,H.jsxs)(Dg,{onSelect:()=>{t(e)},children:[(0,H.jsx)(dt,{className:r===e?``:`opacity-0`}),e]},e)),(0,H.jsx)(wg,{}),(0,H.jsxs)(Dg,{onSelect:()=>{n({type:`route_help`})},children:[(0,H.jsx)(er,{className:`h-3 w-3`}),` `,(0,H.jsx)(`span`,{className:`text-xs`,children:`Help`})]})]})]})})}function X2e(){let[e,t]=Zv(uS),n=Xv(Wx),r=Xv(tS),i=Xv(Ux),a=Xv(Sx);return(0,H.jsx)(`div`,{className:`z-50`,children:(0,H.jsxs)(zp,{children:[(0,H.jsx)(Bp,{asChild:!0,children:(0,H.jsx)(Fg,{size:`xxs`,variant:`quiet`,children:(0,H.jsx)(at,{})})}),(0,H.jsxs)(Sg,{children:[(0,H.jsx)(Cg,{children:`Circle type`}),[bx.MERCATOR,bx.GEODESIC,bx.DEGREES].map(i=>(0,H.jsxs)(Dg,{onSelect:()=>{t(i),r({type:`none`}),n(e=>({...e,selection:U.selectionToFolder(e)})),a({mode:yx.DRAW_CIRCLE,modeOptions:{multi:!1,replaceGeometryForId:null,circleType:i}})},children:[(0,H.jsx)(dt,{className:e===i?``:`opacity-0`}),i]},i)),(0,H.jsx)(wg,{}),(0,H.jsxs)(Dg,{onSelect:()=>{i({type:`circle_types`})},children:[(0,H.jsx)(er,{className:`h-3 w-3`}),` `,(0,H.jsx)(`span`,{className:`text-xs`,children:`Help`})]})]})]})})}var Z2e=[{mode:yx.NONE,hotkey:`1`,Icon:Lt,Menu:null},{mode:yx.DRAW_POINT,hotkey:`2`,Icon:Vt,Menu:null},{mode:yx.DRAW_LINE,hotkey:`3`,Icon:zX,Menu:null},{mode:yx.DRAW_POLYGON,hotkey:`4`,Icon:q2e,Menu:null},{mode:yx.DRAW_RECTANGLE,hotkey:`5`,Icon:mr,Menu:null},{mode:yx.DRAW_CIRCLE,hotkey:`6`,Icon:K2e,Menu:X2e},{mode:yx.DRAW_ROUTE,hotkey:`7`,Icon:Ct,Menu:Y2e}],Q2e=(0,B.memo)(function({replaceGeometryForId:e}){let[{mode:t,modeOptions:n},r]=Zv(Sx),i=Xv(Wx),a=Xv(tS),o=e1e(),s=Yv(uS);return(0,H.jsx)(`div`,{className:`flex items-center justify-start gap-x-1`,role:`radiogroup`,children:Z2e.filter(t=>t.mode===yx.DRAW_ROUTE&&!qX?!1:e?t.mode!==yx.NONE:!0).map(({mode:c,hotkey:l,Icon:u,Menu:d},f)=>{let p=(0,H.jsxs)(J2e,{role:`radio`,selected:t===c,hotkey:l,label:Tde[c].label,onClick:t=>{c===yx.DRAW_LINE?o({event:t,replaceGeometryForId:e}):(a({type:`none`}),i(e=>({...e,selection:U.selectionToFolder(e)})),r({mode:c,modeOptions:{multi:!!t?.shiftKey,replaceGeometryForId:e,circleType:s}}))},children:[(0,H.jsx)(u,{}),t===c&&n?.multi?(0,H.jsx)(Jn,{className:`w-2 h-2 absolute bottom-1 right-1`}):null]},f);return d?(0,H.jsxs)(`div`,{className:`flex items-center`,children:[p,(0,H.jsx)(d,{})]},c):p})})});function $2e(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}var e4e=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e,i=r[0];return!t||!i?n:$2e(n,t,i)},t4e=e=>{let{transform:t}=e;return{...t,x:0}},n4e=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:$2e(t,n,r)};function r4e(){let e=Xv(iS);return ny((0,B.useCallback)(function(t,n){return ve(async function({fromPromise:r}){let{supported:i,fileSave:a}=await ye(async()=>{let{supported:e,fileSave:t}=await Promise.resolve().then(()=>J9);return{supported:e,fileSave:t}},void 0),o=t(rS),s=t(Wx);return o&&i?r(JT(s,o.options).map(async t=>{let r=await a(t.result.blob,{fileName:`map.svg`,description:`Save file`},o.handle,!0);return e(`show`),r&&n(rS,{handle:r,options:o.options}),!0})):!1})},[e]))}function i4e(){let e=Xv(Ux),t=r4e(),n=wZ();return s2e(),_Z(`/`,t=>{t.preventDefault(),e({type:`quickswitcher`})},[e]),_Z(`meta+k, Ctrl+k`,t=>{t.preventDefault(),e({type:`quickswitcher`})},[e]),_Z(`meta+shift+s, Ctrl+shift+s`,t=>{t.preventDefault(),e({type:`export`})},[e]),_Z(`Shift+/`,t=>{t.preventDefault(),e(e=>e||{type:`cheatsheet`})},[e]),_Z(`meta+s, Ctrl+s`,n=>{n.preventDefault(),(async()=>(await t()).ifLeft(e=>pE.error(e?.message||`Could not save`)).map(t=>{t||e({type:`export`})}))().catch(e=>void 0)},[e,t]),_Z(`meta+o, Ctrl+o`,e=>{e.preventDefault(),n().catch(e=>void 0)},[n]),null}function a4e({title:e}){let t=Xv(oS);return(0,H.jsxs)(`div`,{className:`block w-full px-2 pt-2 text-right flex justify-between items-center`,children:[e,(0,H.jsx)(Fg,{variant:`quiet`,"aria-label":`Edit symbolization`,onClick:()=>{t(aS.Symbolization)},children:(0,H.jsx)(Kn,{className:`w-3 h-3`})})]})}function o4e({children:e}){return(0,H.jsx)(`div`,{className:`space-y-1 text-xs
1215      bg-white dark:bg-gray-900
1216      dark:text-white
1217      border border-gray-300 dark:border-black w-48 rounded-t`,children:e})}function s4e({symbolization:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(a4e,{title:e.property}),(0,H.jsxs)(`div`,{className:`p-2`,children:[(0,H.jsx)(`div`,{className:`h-4 rounded-sm dark:border dark:border-white`,style:{background:G0e({colors:e.stops.map(e=>e.output),interpolate:e.interpolate})}}),(0,H.jsxs)(`div`,{className:`flex justify-between pt-1`,children:[(0,H.jsx)(`div`,{className:`truncate`,children:e.stops[0]?.input}),(0,H.jsx)(`div`,{className:`truncate`,children:(0,GS.default)(e.stops)?.input})]})]})]})}function c4e({symbolization:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(a4e,{title:e.property}),(0,H.jsx)(`div`,{className:`p-2`,children:(0,H.jsx)(`div`,{className:`grid gap-x-1`,style:{gridTemplateColumns:`12px 1fr`,gridRowGap:`1px`},children:e.stops.map((e,t)=>(0,H.jsxs)(B.Fragment,{children:[(0,H.jsx)(`div`,{className:`dark:border dark:border-gray-300/40 rounded-xs`,style:{background:e.output}}),(0,H.jsx)(`div`,{title:String(e.input),className:`truncate`,children:e.input})]},t))})})]})}function l4e(e,t){let n=f4e,{clientHeight:r,clientWidth:i}=e.getContainer(),a=r/2,o=i/2-n/2,s=e.unproject([o,a]),c=e.unproject([o+n,a]),l=s.distanceTo(c);if(t.unit===`imperial`){let e=3.2808*l;return e>5280?{maxDistance:e/5280,unit:`mile`}:{maxDistance:e,unit:`foot`}}
1217else if(t.unit===`nautical`)return{maxDistance:l/1852,unit:`nautical-mile`};else if(l>=1e3)return{maxDistance:l/1e3,unit:`kilometer`};else return{maxDistance:l,unit:`meter`}}function u4e(e){let t=10**Math.ceil(-Math.log(e)/Math.LN10);return Math.round(e*t)/t}function d4e(e){let t=10**(`${Math.floor(e)}`.length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:u4e(n),t*n}var f4e=150;function p4e(){let e=(0,B.useContext)(kS),[,t]=(0,B.useTransition)(),[n,r]=Zv(qde),[{unit:i,maxDistance:a},o]=(0,B.useState)({maxDistance:1,unit:`mile`});(0,B.useEffect)(()=>{if(e){let r=(0,i2e.default)(e=>{t(()=>{o(l4e(e.target,{unit:n}))})},50);return e.map.on(`move`,r),o(l4e(e.map,{unit:n})),()=>{e&&e.map.off(`move`,r)}}},[e,n]);let s=d4e(a),l=s/a,u=i===`nautical-mile`?`${s}nm`:new Intl.NumberFormat(`en-us`,{style:`unit`,unitDisplay:`narrow`,unit:i}).format(s),d=`rgba(255, 255, 255, 0.3)`;return(0,H.jsx)(Kp,{children:(0,H.jsxs)(`div`,{className:`group flex items-center`,children:[(0,H.jsxs)(`div`,{className:`flex-auto`,children:[(0,H.jsx)(`div`,{className:`border-l-2 border-r-2 border-b-2 border-purple-500`,style:{width:f4e*l,height:5,boxShadow:`
1218                -1px 0 ${d},
1219                1px 0 ${d},
1220                0 1px ${d}
1221                `}}),(0,H.jsx)(`div`,{className:`text-xs pt-0.5 text-black`,style:{textShadow:`
1222          -1px 0 ${d},
1223          0 1px ${d},
1224          1px 1px ${d},
1225          -1px -1px ${d},
1226          1px -1px ${d},
1227          -1px 1px ${d},
1228          1px 0 ${d},
1229          0 -1px ${d}`},children:u})]}),(0,H.jsx)(qp,{className:`opacity-10 group-hover:opacity-100 p-1 rounded-sm group-hover:bg-white`,children:(0,H.jsx)(un,{})}),(0,H.jsxs)(_g,{size:`xs`,children:[(0,H.jsx)(hg,{}),(0,H.jsxs)(`label`,{className:`block space-y-1`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Units`})}),(0,H.jsx)(`select`,{className:Ig({size:`sm`}),value:n,onChange:e=>{let t=c.safeParse(e.target.value);t.success&&r(t.data)},children:T.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))})]})]})]})})}function m4e(){let[e]=i_().useMetadata(),{symbolization:t}=e;if(!t)return null;let n=BC(t).with({type:`none`},()=>null).with({type:`categorical`},e=>(0,H.jsx)(c4e,{symbolization:e})).with({type:`ramp`},e=>(0,H.jsx)(s4e,{symbolization:e})).exhaustive();return(0,H.jsxs)(`div`,{className:`space-y-1 absolute bottom-0 right-10 w-48`,children:[(0,H.jsx)(p4e,{}),(0,H.jsx)(o4e,{children:n})]})}function h4e(){return(0,H.jsx)(vxe,{position:`top-center`,reverseOrder:!1,gutter:8,containerClassName:``,containerStyle:{},toastOptions:{className:`dark:bg-gray-900 dark:text-white dark:ring-1 dark:ring-gray-500 rounded-md`,duration:5e3,success:{duration:3e3,iconTheme:{primary:`green`,secondary:`white`}}}})}var g4e=(0,B.memo)(function(){let e=wZ(),t=Xv(Ux);return(0,H.jsxs)(`div`,{className:`px-3 pt-3 overflow-y-auto pb-4 text-gray-900 dark:text-gray-300 flex-auto placemark-scrollbar`,children:[(0,H.jsx)(`div`,{className:`text-sm font-semibold pb-2`,children:`Select a drawing tool from the menu`}),(0,H.jsxs)(`div`,{className:`grid gap-x-2 gap-y-4 items-start p-2 text-sm`,style:{gridTemplateColumns:`min-content 1fr`},children:[(0,H.jsx)(`div`,{className:`pt-1`,children:(0,H.jsx)(Vt,{})}),(0,H.jsx)(`div`,{children:`Draw points by clicking`}),(0,H.jsx)(`div`,{className:`pt-1`,children:(0,H.jsx)(zX,{})}),(0,H.jsx)(`div`,{children:`Click to draw vertexes along a line. Finish the line by double-clicking or pressing Enter or Escape.`}),(0,H.jsx)(`div`,{className:`pt-1`,children:(0,H.jsx)(q2e,{})}),(0,H.jsx)(`div`,{children:`Click to draw vertexes for a polygon. Finish the polygon by clicking the first point or pressing Enter or Escape.`}),(0,H.jsx)(`div`,{className:`pt-1`,children:(0,H.jsx)(mr,{})}),(0,H.jsx)(`div`,{children:`Draw a rectangle by clicking and dragging to define the rectangle's size.`})]}),(0,H.jsxs)(`div`,{className:`pt-4 space-y-3`,children:[(0,H.jsx)(`div`,{className:`text-sm font-semibold`,children:`Working with files`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsxs)(Fg,{type:`button`,onClick:()=>{e().catch(e=>void 0)},children:[(0,H.jsx)(Jn,{}),`Import`]}),(0,H.jsxs)(Fg,{type:`button`,onClick:()=>{t({type:`export`})},children:[(0,H.jsx)(Yt,{}),`Export`]})]})]})]})});function TZ({children:e,accessory:t,variant:n=`default`,title:r}){return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:Ase({}),children:[r,t]}),(0,H.jsx)(`div`,{className:Dm({"px-3":n==="default"},`pb-3 contain-layout`),children:e})]})}function EZ({title:e,children:t,atom:n}){let[r,i]=Zv(n);return(0,H.jsxs)(Di,{open:r,onOpenChange:i,children:[(0,H.jsxs)(Oi,{className:Ase({interactive:!0}),children:[(0,H.jsx)(`span`,{children:e}),r?(0,H.jsx)(at,{className:`w-3 h-3`}):(0,H.jsx)(lt,{className:`w-3 h-3`}),` `]}),(0,H.jsx)(ki,{className:`px-3 pb-3 contain-layout`,children:t})]})}function _4e({wrappedFeature:e}){let t=i_().useTransact(),n=xC(e.feature),r=bC(e.feature);if(!n||!r)return null;let i=(0,H.jsx)(rg,{type:`number`,name:`radius`,min:`0`,step:`any`,className:Lg({_size:`sm`})});return(0,H.jsx)(EZ,{title:`${n.type}
1229 circle`,atom:Wde,children:(0,H.jsx)(eg,{initialValues:{radius:n.type===bx.GEODESIC?DS(r,`radians`,`meters`):r,units:`meters`},onSubmit:async r=>{let i=n.type===bx.GEODESIC?DS(r.radius,r.units,`radians`):r.radius;return t({track:`resize-circle`,putFeatures:[{...e,feature:{...e.feature,geometry:yC({center:n.center,type:n.type,value:i})}}]})},children:(0,H.jsxs)(ig,{className:`space-y-2`,children:[n.type===bx.MERCATOR?(0,H.jsx)(`label`,{className:`text-xs`,htmlFor:`radius`,children:`Radius in mercator meters`}):n.type===bx.DEGREES?(0,H.jsx)(`label`,{className:`text-xs`,htmlFor:`radius`,children:`Radius in decimal degrees`}):null,n.type===bx.GEODESIC?(0,H.jsxs)(`div`,{className:`flex gap-x-2`,children:[i,(0,H.jsx)(y4e,{}),(0,H.jsx)(Fg,{type:`submit`,children:`Resize`})]}):(0,H.jsxs)(`div`,{className:`flex gap-x-2`,children:[i,(0,H.jsx)(Fg,{type:`submit`,children:`Resize`})]}),(0,H.jsx)(v4e,{type:n.type,wrappedFeature:e})]})})})}function v4e({type:e,wrappedFeature:t}){let{setFieldValue:n}=Gh();return(0,B.useEffect)(()=>{let r=bC(t.feature);r&&n(`radius`,e===bx.GEODESIC?DS(r,`radians`,`meters`):r)},[n,e,t]),null}function y4e(){let{values:e,setFieldValue:t}=Gh();return(0,H.jsx)(rg,{as:`select`,className:`${Ig({size:`sm`})} w-24`,name:`units`,"aria-label":`Select units`,onChange:n=>{let r=n.target.value;t(`radius`,DS(e.radius,e.units,r)),t(`units`,r)},children:(0,H.jsx)(Wg,{groups:k.length})})}var b4e={wkt:async e=>{let{WKT:t}=await ye(async()=>{let{WKT:e}=await Promise.resolve().then(()=>lbe);return{WKT:e}},void 0);return t.featureToString(e)},geojson:e=>Promise.resolve(fe(JSON.stringify(e))),geohash:async e=>await ve(async function({throwE:t}){let n=e.geometry;return n.type===`Point`?(await ye(()=>import(`./geohash-BPGwrG2X.js`),[])).encode(n.coordinates):t(new _e(`Only Point features can be copied as geohash`))}),coordinates:e=>Promise.resolve(Bpe.featureToString(e)),bbox:async e=>{let{BBOX:t}=await ye(async()=>{let{BBOX:e}=await Promise.resolve().then(()=>Rpe);return{BBOX:e}},void 0);return t.featureToString(e)},polyline:async e=>{let{Polyline:t}=await ye(async()=>{let{Polyline:e}=await Promise.resolve().then(()=>qye);return{Polyline:e}},void 0);return t.featureToString(e)}},x4e=(0,B.memo)(function({wrappedFeature:e}){let t=(0,B.useRef)(e);t.current=e;let n=(0,B.useCallback)(async function(e){if(t.current.feature.geometry===null)return dE.error(`Could not copy, because this feature has no geometry`);await dE.promise(lv(b4e[e.format](t.current.feature).then(e=>e.unsafeCoerce())),{loading:`Copying…`,success:`Copied`,error:`Failed to copy. Try again?`})},[]);return e.feature.geometry===null?null:(0,H.jsx)(S4e,{type:e.feature.geometry.type,onCopy:n})}),S4e=(0,B.memo)(function({type:e,onCopy:t}){return(0,H.jsx)(EZ,{title:`Export`,atom:Hde,children:(0,H.jsx)(eg,{initialValues:{format:`wkt`},onSubmit:t,children:(0,H.jsxs)(ig,{className:`flex items-center space-x-2`,children:[(0,H.jsxs)(rg,{className:`${Ig({size:`xs`})} w-full`,component:`select`,id:`format`,name:`format`,children:[(0,H.jsx)(`option`,{value:`wkt`,children:`WKT`}),(0,H.jsx)(`option`,{value:`geojson`,children:`GeoJSON`}),e===`LineString`?(0,H.jsx)(`option`,{value:`polyline`,children:`Polyline`}):null,e===`Point`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`option`,{value:`geohash`,children:`Geohash`}),(0,H.jsx)(`option`,{value:`coordinates`,children:`Coordinates`})]}):null,(0,H.jsx)(`option`,{value:`bbox`,children:`BBOX`})]}),(0,H.jsxs)(Fg,{type:`submit`,size:`xs`,children:[(0,H.jsx)(Tt,{className:`w-3 h-3`}),`Copy`]})]})})})});function C4e({wrappedFeature:e}){let t=i_().useTransact();return(0,H.jsxs)(EZ,{title:`ID`,atom:Bde,children:[(0,H.jsxs)(`div`,{className:`contain-layout grid gap-x-2 gap-y-2 items-center`,style:{gridTemplateColumns:`min-content 1fr`},children:[(0,H.jsx)(bg,{size:`xs`,children:`User`}),(0,H.jsx)(`div`,{className:`flex items-stretch`,children:(0,H.jsx)(eg,{enableReinitialize:!0,initialValues:{id:e.feature.id||``},onSubmit:async(n,r)=>{if(n.id===void 0)return;let i=n.id===``?void 0:Number.isNaN(+n.id)?n.id:+n.id;await t({note:`Updated a feature’s id`,putFeatures:[{...e,feature:{...e.feature,id:i}}]}),r.resetForm(),pE.success(`Updated feature ID`)},children:(0,H.jsxs)(ig,{className:`flex-auto flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{name:`id`,spellCheck:`false`,variant:`code`,type:`text`,_size:`xs`,"aria-label":`ID`}),(0,H.jsx)(Fg,{type:`submit`,size:`xs`,children:`Update`})]})},e.feature.id)}),(0,H.jsx)(bg,{size:`xs`,children:`System`}),(0,H.jsx)(`input`,{type:`text`,className:Lg({_size:`xs`,variant:`code`}),value:e.id,readOnly:!0,"aria-label":`System ID`})]}),(0,H.jsx)(`div`,{className:`pt-2 text-right`,children:(0,H.jsxs)(`a`,{href:`https://www.placemark.io/documentation/ids`,className:`underline
1230            text-purple-500 hover:text-black
1231            dark:text-purple-300 dark:hover:text-purple-100
1232            inline-flex items-center gap-x-1 text-xs`,rel:`noreferrer`,target:`_blank`,children:[(0,H.jsx)(er,{}),`Help`]})})]})}var w4e=(0,B.memo)(function({wrappedFeature:e}){return e.feature.geometry?null:(0,H.jsxs)(EZ,{title:`Null geometry`,atom:Ude,children:[(0,H.jsxs)(Vg,{size:`xs`,children:[(0,H.jsx)($t,{className:`inline-block w-3 h-3 mr-1`}),`This feature has no geometry information.`]}),(0,H.jsx)(`div`,{className:`pt-2`,children:(0,H.jsxs)(Kp,{children:[(0,H.jsx)(qp,{asChild:!0,children:(0,H.jsx)(Fg,{size:`xs`,children:`Add geometry`})}),(0,H.jsx)(_g,{size:`xs`,children:(0,H.jsx)(Q2e,{replaceGeometryForId:e.id})})]})})]})});function T4e(e){let t=`empty`;if(e instanceof HTMLInputElement&&`selectionStart`in e&&e.type===`text`){let n=e.value;t=n?e.selectionStart===e.selectionEnd?e.selectionStart===0?`start`:e.selectionStart===n.length?`end`:`middle`:`middle`:`empty`}for(;e&&!(e.dataset&&`focusScope`in e.dataset);){if(e.dataset&&`focusX`in e.dataset)return{x:+(e.dataset.focusX||0),y:+(e.dataset.focusY||0),inputLocation:t};e=e.parentNode}return null}var DZ=e=>{let t=e.target,n=T4e(t);if(n){switch(e.key){case`ArrowUp`:n.y--;break;case`ArrowDown`:n.y++;break;case`ArrowLeft`:if(n.inputLocation===`middle`||n.inputLocation===`end`)return;n.x--;break;case`ArrowRight`:if(n.inputLocation===`middle`||n.inputLocation===`start`)return;n.x++;break}let t=document.querySelector(`[data-focus-x="${n.x}"][data-focus-y="${n.y}"]`);t&&t.focus()}};function E4e(e,t,n){let r={};for(let i in e)i===t?r[n]=e[t]:i!==n&&(r[i]=e[i]);return r}function D4e(e,{key:t,newKey:n}){return{...e,properties:E4e(e.properties,t,n)}}function OZ(e,{key:t,value:n}){let{properties:r}=e,i={...r},a=i[t];return a===void 0?typeof n==`string`?(i[t]=Cv(n),{...e,properties:i}):(i[t]=n,{...e,properties:i}):(i[t]=vle(a,n),{...e,properties:i})}var kZ=[],O4e=[];(()=>{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(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?O4e:kZ).push(n+=e[t])})();function k4e(e){if(e<768)return!1;for(let t=0,n=kZ.length;;){let r=t+n>>1;if(e<kZ[r])n=r;else if(e>=O4e[r])t=r+1;else return!0;
vendor: 15,927 bytes, lines 1232-1235
1232if(t==n)return!1}}function A4e(e){return e>=127462&&e<=127487}var j4e=8205;function M4e(e,t,n=!0,r=!0){return(n?N4e:P4e)(e,t,r)}function N4e(e,t,n){if(t==e.length)return t;t&&F4e(e.charCodeAt(t))&&I4e(e.charCodeAt(t-1))&&t--;let r=AZ(e,t);for(t+=L4e(r);t<e.length;){let i=AZ(e,t);if(r==j4e||i==j4e||n&&k4e(i))t+=L4e(i),r=i;else if(A4e(i)){let n=0,r=t-2;for(;r>=0&&A4e(AZ(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function P4e(e,t,n){for(;t>0;){let r=N4e(e,t-2,n);if(r<t)return r;t--}return 0}function AZ(e,t){let n=e.charCodeAt(t);if(!I4e(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return F4e(r)?(n-55296<<10)+(r-56320)+65536:n}function F4e(e){return e>=56320&&e<57344}function I4e(e){return e>=55296&&e<56320}function L4e(e){return e<65536?1:2}var jZ=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=IZ(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),NZ.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=IZ(this,e,t);let n=[];return this.decompose(e,t,n,0),NZ.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new FZ(this),i=new FZ(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new FZ(this,e)}iterRange(e,t=this.length){return new B4e(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new V4e(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new MZ(t):NZ.from(MZ.split(t,[]))}},MZ=class e extends jZ{constructor(e,t=R4e(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new H4e(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(z4e(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=PZ(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=IZ(this,t,n);let i=PZ(this.text,PZ(r.text,z4e(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):NZ.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
1233`){[e,t]=IZ(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},NZ=class e extends jZ{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=IZ(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
1234`){[e,t]=IZ(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new MZ(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof MZ&&c&&(n=u[u.length-1])instanceof MZ&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new MZ(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};jZ.empty=new MZ([``],0);function R4e(e){let t=-1;for(let n of e)t+=n.length+1;return t}function PZ(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function z4e(e,t,n){return PZ(e,[``],t,n)}var FZ=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof MZ?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof MZ?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
1235`,this;e--}else if(r instanceof MZ){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof MZ?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},B4e=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new FZ(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},V4e=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(jZ.prototype[Symbol.iterator]=function(){return this.iter()},FZ.prototype[Symbol.iterator]=B4e.prototype[Symbol.iterator]=V4e.prototype[Symbol.iterator]=function(){return this});var H4e=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function IZ(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function LZ(e,t,n=!0,r=!0){return M4e(e,t,n,r)}function U4e(e){return e>=56320&&e<57344}function W4e(e){return e>=55296&&e<56320}function G4e(e,t){let n=e.charCodeAt(t);if(!W4e(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return U4e(r)?(n-55296<<10)+(r-56320)+65536:n}function K4e(e){return e<65536?1:2}var RZ=/\r\n?|\n/,zZ=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(zZ||={}),BZ=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){WZ(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:q4e(this,e)}mapDesc(e,t=!1){return e.empty?this:GZ(this,e,t)}mapPos(e,t=-1,n=zZ.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=zZ.Simple&&c>=e&&(n==zZ.TrackDel&&r<e&&c>e||n==zZ.TrackBefore&&r<e||n==zZ.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},VZ=class e extends BZ{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return WZ(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return GZ(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(jZ.empty);r.push(a?t.slice(i,i+a):jZ.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:q4e(this,e,!0)}map(e,t=!1){return e.empty?this:GZ(this,e,t,!0)}iterChanges(e,t=!1){WZ(this,e,t)}get desc(){return BZ.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new KZ(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);HZ(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;HZ(n,e,t),t>0&&UZ(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);HZ(n,e,-1),HZ(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:BZ.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&HZ(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?jZ.of(l.split(r||RZ)):l:jZ.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&HZ(i,e-o,-1),HZ(i,s-e,d),UZ(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(jZ.empty);r[e]=jZ.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function HZ(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=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 UZ(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(jZ.empty);e.push(n)}}function WZ(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=jZ.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function GZ(e,t,n,r=!1){let i=[],a=r?[]:null,o=new KZ(e),s=new KZ(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);HZ(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(HZ(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(HZ(i,0,o.ins),a&&UZ(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;HZ(i,t,e<o.i?o.ins:0),a&&e<o.i&&UZ(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?VZ.createSet(i,a):BZ.create(i);else throw Error(`Mismatched change set lengths`)}function q4e(e,t,n=!1){let r=[],i=n?[]:null,a=new KZ(e),o=new KZ(t);for(let e=!1;;)if(a.done&&o.done)return i?VZ.createSet(r,i):BZ.create(r);else if(a.ins==0)HZ(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)HZ(r,0,o.ins,e),i&&UZ(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;HZ(r,t,n,e),i&&n&&UZ(i,r,o.text)}else o.ins==-1?(HZ(r,a.off?0:a.len,t,e),i&&UZ(i,r,a.textBit(t))):(HZ(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&UZ(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var KZ=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?jZ.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?jZ.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}
vendor: 4,184 bytes, line 1235
1235forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},qZ=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}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 e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}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 e(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return JZ.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return JZ.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return JZ.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},JZ=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>qZ.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return qZ.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r){let i=(n??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?qZ.create(t,e,48|i):qZ.create(e,t,(t>e?8:0)|i)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function J4e(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var YZ=0,XZ=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=YZ++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:ZZ),!!t.static,t.enables)}of(e){return new QZ([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new QZ(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new QZ(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function ZZ(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var QZ=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=YZ++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||$Z(e,c)){let r=t(e);
vendor: 9,093 bytes, line 1235
1235if(a?!Y4e(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=sQ(o,c);if(this.dependencies.every(t=>t instanceof XZ?o.facet(t)===e.facet(t):t instanceof tQ?o.field(t,!1)==e.field(t,!1):!0)||(a?Y4e(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function Y4e(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function $Z(e,t){let n=!1;for(let r of t)oQ(e,r)&1&&(n=!0);return n}function X4e(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=sQ(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)oQ(e,t);return e.values[o]=s(e),1},update(e,n){if(!$Z(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=$Z(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&ZZ(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var eQ=XZ.define({static:!0}),tQ=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(YZ++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(eQ).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(eQ),i=n.facet(eQ),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,eQ.of({field:this,create:e})]}get extension(){return this}},nQ={lowest:4,low:3,default:2,high:1,highest:0};function rQ(e){return t=>new Z4e(t,e)}var iQ={highest:rQ(nQ.highest),high:rQ(nQ.high),default:rQ(nQ.default),low:rQ(nQ.low),lowest:rQ(nQ.lowest)},Z4e=class{constructor(e,t){this.inner=e,this.prec=t}},Q4e=class e{of(e){return new aQ(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},aQ=class{constructor(e,t){this.compartment=e,this.inner=t}},$4e=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of e3e(t,n,o))e instanceof tQ?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,ZZ(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>X4e(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function e3e(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof aQ&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof aQ){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof Z4e)a(e.inner,e.prec);else if(e instanceof tQ)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof QZ)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,nQ.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,nQ.default),r.reduce((e,t)=>e.concat(t))}function oQ(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw 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 sQ(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var t3e=XZ.define(),cQ=XZ.define({combine:e=>e.some(e=>e),static:!0}),n3e=XZ.define({combine:e=>e.length?e[0]:void 0,static:!0}),r3e=XZ.define(),i3e=XZ.define(),a3e=XZ.define(),o3e=XZ.define({combine:e=>e.length?e[0]:!1}),lQ=class{constructor(e,t){this.type=e,this.value=t}static define(){return new s3e}},s3e=class{of(e){return new lQ(this,e)}},c3e=class{constructor(e){this.map=e}of(e){return new uQ(this,e)}},uQ=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new c3e(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};uQ.reconfigure=uQ.define(),uQ.appendConfig=uQ.define();var dQ=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&J4e(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return 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(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};dQ.time=lQ.define(),dQ.userEvent=lQ.define(),dQ.addToHistory=lQ.define(),dQ.remote=lQ.define();function l3e(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function u3e(e,t,n){let r,i,a;return n?(r=t.changes,i=VZ.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:uQ.mapEffects(e.effects,r).concat(uQ.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function fQ(e,t,n){let r=t.selection,i=pQ(t.annotations);return t.userEvent&&(i=i.concat(dQ.userEvent.of(t.userEvent))),{changes:t.changes instanceof VZ?t.changes:VZ.of(t.changes||[],n,e.facet(n3e)),selection:r&&(r instanceof JZ?r:JZ.single(r.anchor,r.head)),effects:pQ(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function d3e(e,t,n){let r=fQ(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=u3e(r,fQ(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=dQ.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return p3e(n?f3e(i):i)}function f3e(e){let t=e.startState,n=!0;for(let r of t.facet(r3e)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:l3e(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=VZ.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=dQ.create(t,r,e.selection&&e.selection.map(i),uQ.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(i3e);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof dQ?i:Array.isArray(i)&&i.length==1&&i[0]instanceof dQ?i[0]:d3e(t,pQ(i),!1)}return e}function p3e(e){let t=e.startState,n=t.facet(a3e),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=u3e(r,fQ(t,a,e.changes.newLength),!0))}return r==e?e:dQ.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var m3e=[];function pQ(e){return e==null?m3e:Array.isArray(e)?e:[e]}var mQ=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(mQ||={}),h3e=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,hQ;try{hQ=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function g3e(e){if(hQ)return hQ.test(e);for(let t=0;t<e.length;t++){let n=e[t];
vendor: 4,877 bytes, lines 1235-1236
1235if(/\w/.test(n)||n>`€`&&(n.toUpperCase()!=n.toLowerCase()||h3e.test(n)))return!0}return!1}function _3e(e){return t=>{if(!/\S/.test(t))return mQ.Space;if(g3e(t))return mQ.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return mQ.Word;return mQ.Other}}var gQ=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)oQ(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return oQ(this,n),sQ(this,n)}update(...e){return d3e(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(Q4e.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(uQ.reconfigure)?(n=null,r=e.value):e.is(uQ.appendConfig)&&(n=null,r=pQ(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=$4e.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(cQ)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:JZ.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=pQ(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=uQ.mapEffects(a,c).concat(uQ.mapEffects(pQ(o.effects),l))}return{changes:r,selection:JZ.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof VZ?t:VZ.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return jZ.of(t.split(this.facet(e.lineSeparator)||RZ))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(oQ(this,t),sQ(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof tQ&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:JZ.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=$4e.resolve(t.extensions||[],new Map),r=t.doc instanceof jZ?t.doc:jZ.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||RZ)),i=t.selection?t.selection instanceof JZ?t.selection:JZ.single(t.selection.anchor,t.selection.head):JZ.single(0);return J4e(i,r.length),n.staticFacet(cQ)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
1236`}get readOnly(){return this.facet(o3e)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(t3e))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return _3e(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=LZ(t,a,!1);if(i(t.slice(e,a))!=mQ.Word)break;a=e}for(;o<r;){let e=LZ(t,o);if(i(t.slice(o,e))!=mQ.Word)break;o=e}return a==o?null:JZ.range(a+n,o+n)}};gQ.allowMultipleSelections=cQ,gQ.tabSize=XZ.define({combine:e=>e.length?e[0]:4}),gQ.lineSeparator=n3e,gQ.readOnly=o3e,gQ.phrases=XZ.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),gQ.languageData=t3e,gQ.changeFilter=r3e,gQ.transactionFilter=i3e,gQ.transactionExtender=a3e,Q4e.reconfigure=uQ.define();function _Q(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var vQ=class{eq(e){return this==e}range(e,t=e){return bQ.create(e,t,this)}};vQ.prototype.startSide=vQ.prototype.endSide=0,vQ.prototype.point=!1,vQ.prototype.mapM
vendor: 26,703 bytes, lines 1236-1238
1236ode=zZ.TrackDel;function yQ(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var bQ=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function xQ(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var v3e=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},SQ=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(xQ)),this.isEmpty)return n.length?e.of(n):this;let s=new x3e(this,null,-1).goto(0),c=0,l=[],u=new CQ;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(bQ.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return wQ.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return wQ.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=b3e(a,o,n),c=new EQ(a,s,i),l=new EQ(o,s,i);n.iterGaps((e,t,n)=>S3e(c,e,l,t,n,r)),n.empty&&n.length==0&&S3e(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=b3e(i,a),s=new EQ(i,o,0).goto(n),c=new EQ(a,o,0).goto(n);for(;;){if(s.to!=c.to||!DQ(s.active,c.active)||s.point&&(!c.point||!yQ(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new EQ(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new CQ;for(let r of e instanceof bQ?[e]:t?y3e(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};SQ.empty=new SQ([],[],null,-1);function y3e(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(xQ(t,r)>0)return e.slice().sort(xQ);t=r}return e}SQ.empty.nextLayer=SQ.empty;var CQ=class e{finishChunk(e){this.chunks.push(new v3e(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,e&&(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||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(SQ.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=SQ.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function b3e(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var x3e=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},wQ=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new x3e(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)TQ(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)TQ(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),TQ(this.heap,0)}}};function TQ(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var EQ=class{constructor(e,t,n){this.minPoint=n,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=wQ.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){OQ(this.active,e),OQ(this.activeTo,e),OQ(this.activeRank,e),this.minActive=C3e(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;kQ(this.active,t,n),kQ(this.activeTo,t,r),kQ(this.activeRank,t,i),e&&kQ(e,t,this.cursor.from),this.minActive=C3e(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&OQ(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function S3e(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&yQ(e.point,n.point)&&DQ(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!DQ(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function DQ(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!yQ(e[n],t[n]))return!1;return!0}function OQ(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function kQ(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function C3e(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function AQ(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=LZ(e,i));return r}function w3e(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=LZ(e,r)}return r===!0?-1:e.length}for(var T3e=`ͼ`,E3e=typeof Symbol>`u`?`__ͼ`:Symbol.for(T3e),jQ=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),D3e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},MQ=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
1237`)}static newName(){let e=D3e[E3e]||1;return D3e[E3e]=e+1,T3e+e.toString(36)}static mount(e,t,n){let r=e[jQ],i=n&&n.nonce;r?i&&r.setNonce(i):r=new k3e(e,i),r.mount(Array.isArray(t)?t:[t],e)}},O3e=new Map,k3e=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=O3e.get(n);if(t)return e[jQ]=t;this.sheet=new r.CSSStyleSheet,O3e.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[jQ]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
1238`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},NQ={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},PQ={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},A3e=typeof navigator<`u`&&/Mac/.test(navigator.platform),j3e=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),FQ=0;FQ<10;FQ++)NQ[48+FQ]=NQ[96+FQ]=String(FQ);for(var FQ=1;FQ<=24;FQ++)NQ[FQ+111]=`F`+FQ;for(var FQ=65;FQ<=90;FQ++)NQ[FQ]=String.fromCharCode(FQ+32),PQ[FQ]=String.fromCharCode(FQ);for(var IQ in NQ)PQ.hasOwnProperty(IQ)||(PQ[IQ]=NQ[IQ]);function M3e(e){var t=!(A3e&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||j3e&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?PQ:NQ)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function LQ(){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(;t<arguments.length;t++)N3e(e,arguments[t]);return e}function N3e(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)N3e(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var RQ=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},zQ=typeof document<`u`?document:{documentElement:{style:{}}},BQ=/Edge\/(\d+)/.exec(RQ.userAgent),P3e=/MSIE \d/.test(RQ.userAgent),VQ=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(RQ.userAgent),HQ=!!(P3e||VQ||BQ),F3e=!HQ&&/gecko\/(\d+)/i.test(RQ.userAgent),UQ=!HQ&&/Chrome\/(\d+)/.exec(RQ.userAgent),I3e=`webkitFontSmoothing`in zQ.documentElement.style,WQ=!HQ&&/Apple Computer/.test(RQ.vendor),L3e=WQ&&(/Mobile\/\w+/.test(RQ.userAgent)||RQ.maxTouchPoints>2),GQ={mac:L3e||/Mac/.test(RQ.platform),windows:/Win/.test(RQ.platform),linux:/Linux|X11/.test(RQ.platform),ie:HQ,ie_version:P3e?zQ.documentMode||6:VQ?+VQ[1]:BQ?+BQ[1]:0,gecko:F3e,gecko_version:F3e?+(/Firefox\/(\d+)/.exec(RQ.userAgent)||[0,0])[1]:0,chrome:!!UQ,chrome_version:UQ?+UQ[1]:0,ios:L3e,android:/Android\b/.test(RQ.userAgent),webkit:I3e,webkit_version:I3e?+(/\bAppleWebKit\/(\d+)/.exec(RQ.userAgent)||[0,0])[1]:0,safari:WQ,safari_version:WQ?+(/\bVersion\/(\d+(\.\d+)?)/.exec(RQ.userAgent)||[0,0])[1]:0,tabSize:zQ.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function KQ(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}var qQ=Object.create(null);function JQ(e,t,n){if(e==t)return!0;e||=qQ,t||=qQ;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function R3e(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??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 z3e(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 B3e(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var YQ=class{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},XQ=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(XQ||={}),ZQ=class extends vQ{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new QQ(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new e$(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=V3e(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new e$(e,n,r,t,e.widget||null,!0)}static line(e){return new $Q(e)}static set(e,t=!1){return SQ.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};ZQ.none=SQ.empty;var QQ=class e extends ZQ{constructor(e){let{start:t,end:n}=V3e(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?KQ(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||qQ}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&JQ(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};QQ.prototype.point=!1;var $Q=class e extends ZQ{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&JQ(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};$Q.prototype.mapMode=zZ.TrackBefore,$Q.prototype.point=!0;var e$=class e extends ZQ{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?zZ.TrackBefore:zZ.TrackAfter:zZ.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?XQ.WidgetBefore:XQ.WidgetAfter:XQ.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&H3e(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};e$.prototype.point=!0;function V3e(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function H3e(e,t){return e==t||!!(e&&t&&e.compare(t))}function t$(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)}var U3e=class e extends vQ{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&JQ(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||qQ)}static set(e,t=!1){return SQ.of(e,t)}};U3e.prototype.startSide=U3e.prototype.endSide=-1;function n$(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function r$(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function i$(e,t){if(!t.anchorNode)return!1;try{return r$(e,t.anchorNode)}catch{return!1}}function a$(e){return e.nodeType==3?f$(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function o$(e,t,n,r){return n?W3e(e,t,n,r,-1)||W3e(e,t,n,r,1):!1}function s$(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function c$(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function W3e(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:l$(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=s$(e)+(i<0?0:1),e=n}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?l$(e):0}else return!1}}function l$(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function u$(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function G3e(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 K3e(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 q3e(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=G3e(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=K3e(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function J3e(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}}var Y3e=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?l$(t):0),n,Math.min(e.focusOffset,n?l$(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},d$=null;GQ.safari&&GQ.safari_version>=26&&(d$=!1);function X3e(e){if(e.setActive)return e.setActive();if(d$)return e.focus(d$);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);
vendor: 4,798 bytes, line 1238
1238if(e.focus(d$==null?{get preventScroll(){return d$={preventScroll:!0},!0}}:void 0),!d$){d$=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}var Z3e;function f$(e,t,n=t){let r=Z3e||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function p$(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function Q3e(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function $3e(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,l$(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=l$(n))}else if(n==e)return!0;else r=s$(n),n=n.parentNode}function e6e(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function t6e(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=l$(n)}else if(n.parentNode&&!c$(n))r=s$(n),n=n.parentNode;else return null}function n6e(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!c$(n))r=s$(n)+1,n=n.parentNode;else return null}var m$=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,s$(t),n)}static after(t,n){return new e(t.parentNode,s$(t)+1,n)}},h$=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(h$||={}),g$=h$.LTR,_$=h$.RTL;function r6e(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var i6e=r6e(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),a6e=r6e(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),v$=Object.create(null),y$=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);v$[t]=n,v$[n]=-t}function o6e(e){return e<=247?i6e[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?a6e[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var s6e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,b$=class{get dir(){return this.level%2?_$:g$}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function c6e(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!c6e(r.inner,i.inner))return!1}return!0}var x$=[];function l6e(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=o6e(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),x$[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=x$[e];if(i==128)e<s-1&&t==x$[e+1]&&t&24?i=x$[e]=t:x$[e]=256;else if(i==64){let i=e+1;for(;i<s&&x$[i]==64;)i++;let a=e&&t==8||i<n&&x$[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)x$[t]=a;e=i-1}else i==8&&r==1&&(x$[e]=1);t=i,i&7&&(r=i)}}}function u6e(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=v$[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(y$[e+1]==-r){let n=y$[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(x$[t]=x$[y$[e]]=r),s=e;break}}else if(y$.length==189)break;else y$[s++]=t,y$[s++]=n,y$[s++]=c;else if((o=x$[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=y$[t+2];if(n&2)break;if(e)y$[t+2]|=2;else{if(n&4)break;y$[t+2]|=4}}}}}function d6e(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=x$[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(x$[o]==256)o++;else break;let l=a==1,u=l==((o<t?x$[o]:r)==1)?l?1:2:r;
vendor: 37,912 bytes, line 1238
1238for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),x$[--t]=u;c=o}else a=o,c++}}}function S$(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=x$[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(x$[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new b$(c,m.from,f)),C$(e,m.direction==g$==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?x$[p]!=s:x$[p]==s))break;else p++;d?S$(e,c,p,r+1,i,d,o):c<p&&o.push(new b$(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=x$[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(x$[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new b$(m.to,c,f)),C$(e,m.direction==g$==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?x$[p-1]!=s:x$[p-1]==s))break;else p--;d?S$(e,p,c,r+1,i,d,o):p<c&&o.push(new b$(p,c,f)),c=p}}function C$(e,t,n,r,i,a,o){let s=t%2?2:1;l6e(e,i,a,r,s),u6e(e,i,a,r,s),d6e(i,a,r,s),S$(e,i,a,t,n,r,o)}function f6e(e,t,n){if(!e)return[new b$(0,0,+(t==_$))];if(t==g$&&!n.length&&!s6e.test(e))return p6e(e.length);if(n.length)for(;e.length>x$.length;)x$[x$.length]=256;let r=[],i=t==g$?0:1;return C$(e,i,i,n,0,e.length,r),r}function p6e(e){return[new b$(0,e,0)]}var m6e=``;function h6e(e,t,n,r,i){let a=r.head-e.from,o=b$.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=LZ(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),m6e=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?JZ.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):JZ.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function g6e(e,t,n){for(let r=t;r<n;r++){let t=o6e(e.charCodeAt(r));if(t==1)return g$;if(t==2||t==4)return _$}return g$}var _6e=XZ.define(),v6e=XZ.define(),y6e=XZ.define(),b6e=XZ.define(),w$=XZ.define(),x6e=XZ.define(),S6e=XZ.define(),T$=XZ.define(),E$=XZ.define(),C6e=XZ.define({combine:e=>e.some(e=>e)}),w6e=XZ.define({combine:e=>e.some(e=>e)}),T6e=XZ.define(),D$=class e{constructor(e,t=`nearest`,n=`nearest`,r=5,i=5,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(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 e(JZ.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},O$=uQ.define({map:(e,t)=>e.map(t)}),E6e=uQ.define();function k$(e,t,n){let r=e.facet(b6e);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))}var A$=XZ.define({combine:e=>e.length?e[0]:!0}),D6e=0,j$=XZ.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),M$=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(j$.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(j$.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(D6e++,t,r,i,e=>{let t=[];return o&&t.push(F$.of(t=>{let n=t.plugin(e);return n?o(n):ZQ.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},N$=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){k$(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(k$(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){k$(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},O6e=XZ.define(),P$=XZ.define(),F$=XZ.define(),k6e=XZ.define(),I$=XZ.define(),L$=XZ.define(),A6e=XZ.define();function j6e(e,t){let n=e.state.facet(A6e);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return SQ.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=g6e(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var M6e=XZ.define();function R$(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(M6e)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var z$=XZ.define(),B$=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(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(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},N6e=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=VZ.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new B$(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(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(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},P6e=[],V$=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return P6e}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&R3e(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=s$(this.dom),r=this.length?e>0:t>0;return new m$(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof U$)return e;return null}static get(e){return e.cmTile}},H$=class extends V${constructor(e){super(e,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(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=F6e(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=F6e(r);this.length=a}};function F6e(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var U$=class extends H${constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=V$.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof W$)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},W$=class e extends H${constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},G$=class e extends H${constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&L6e(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):I6e(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new m$(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new m$(e.dom,0);e==n.tile&&(a=!0)}}return new m$(this.dom,0)}};function I6e(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=a$(t);return n[n.length-1]||null}function L6e(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var K$=class e extends H${constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},q$=class e extends V${constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?GQ.chrome||GQ.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=f$(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return GQ.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?u$(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},J$=class e extends V${constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return u$(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return u$(n,!r)}}get overrideDOMText(){if(!this.length)return jZ.empty;let{root:e}=this;if(!e)return jZ.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},Y$=class extends V${constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return jZ.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},R6e=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},z6e=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},B6e=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new q$(a.dom,a.text+e);t.parent=i}else i.append(r||q$.of(e,this.cache.find(q$)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Z$(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof K$&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(Z$(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=V$.get(n.dom);e&&e.setDOM(Z$(n.dom))}let e=K$.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=V$.get(e.text);i&&this.cache.reused.set(i,2);let a=new q$(e.text,e.text.nodeValue);a.flags|=8,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=K6e;let n=G$.start(e,t||this.cache.find(G$)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof K$&&a.mark.eq(i))n=a,t--;else{let e=K$.of(i,this.cache.find(K$,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!W6e(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(GQ.ios&&W6e(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget($$,0,32)||new J$($$.toDOM(),0,$$,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new z6e(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof W$&&n.wrapper.eq(t.wrapper))e=n;else{let n=W$.of(t.wrapper,this.cache.find(W$,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(Y$,void 0,1);return n&&(n.flags=t),n||new Y$(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},V6e=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},X$=[J$,G$,q$,K$,Y$,W$,U$];for(let e=0;e<X$.length;e++)X$[e].bucket=e;var H6e=class{constructor(e){this.view=e,this.buckets=X$.map(()=>[]),this.index=X$.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new J$(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},U6e=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new H6e(e),this.text=new V6e(e.state.doc),this.builder=new B6e(this.cache,new U$(e,e.contentDOM),SQ.iter(n)),this.cache.reused.set(t,2),this.old=new R6e(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=J6e(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?J$.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof Y$)this.cache.add(e);else if(e instanceof K$)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof K$&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof K$&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=SQ.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof e$){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?Q$.block:Q$.inline),c=G6e(a),l=this.cache.findWidget(i,t-e,c)||J$.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=q6e(n,a);t>e&&this.text.skip(t-e)},span:(e,t,i,a)=>{for(let o=e;o<t;){let e=this.text.next(Math.min(512,t-o));e==null?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(e,i,a),o+=e.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>i,this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=V$.get(r);if(r==this.view.contentDOM)break;e instanceof K$?t.push(e):e?.isLine()?n=e:r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new G$(r,K6e):t.push(K$.of(new QQ({tagName:r.nodeName.toLowerCase(),attributes:B3e(r)}),r))}return{line:n,marks:t}}};function W6e(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function G6e(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}var K6e={class:`cm-line`};function q6e(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&KQ(n,e),r&&(e.class+=` `+r),e)}function J6e(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 K$&&t.push(r.mark)}return t}function Z$(e){let t=V$.get(e);return t&&t.setDOM(e.cloneNode()),e}var Q$=class extends YQ{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Q$.inline=new Q$(`span`),Q$.block=new Q$(`div`);var $$=new class extends YQ{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},Y6e=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ZQ.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 U$(e,e.contentDOM),this.updateInner([new B$(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!a8e(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?Q6e(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new B$(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(GQ.ie||GQ.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=t8e(i,this.decorations,e.changes);o.length&&(t=B$.extendWithRanges(t,o));let s=r8e(a,this.blockWrappers,e.changes);return s.length&&(t=B$.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new U6e(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=r.run(e,t),e1(n,r.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 r=GQ.chrome||GQ.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof t1&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(E6e)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(A$)||n.tabIndex>-1)&&i$(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),GQ.gecko&&s.empty&&!this.hasComposition&&X6e(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new m$(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!o$(c.node,c.offset,u.anchorNode,u.anchorOffset)||!o$(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{GQ.android&&GQ.chrome&&n.contains(u.focusNode)&&i8e(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=n$(this.view.root);if(e)if(s.empty){if(GQ.gecko){let e=$6e(c.node,c.offset);if(e&&e!=3){let t=(e==1?t6e:n6e)(c.node,c.offset);t&&(c=new m$(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new m$(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new m$(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&o$(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=n$(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=l$(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!V$.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof t1?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=LZ(e.text,t);if(n==t)return null;let r=f$(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==h$.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof W$)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?a$(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?h$.RTL:h$.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=a$(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;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.tile.dom.appendChild(t);let e=a$(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(ZQ.replace({widget:new t1(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return ZQ.set(e)}updateDeco(){let e=1,t=this.view.state.facet(F$).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(I$).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(SQ.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(k6e).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(T6e))try{if(t(this.view,e.range,e))return!0}catch(e){k$(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=R$(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;q3e(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==h$.LTR)}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){e1(this.tile)}};function e1(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)e1(n,t)}}function X6e(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 Z6e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=t6e(n.focusNode,n.focusOffset),i=n6e(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=V$.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=V$.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function Q6e(e,t,n){let r=Z6e(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new B$(c.mapPos(a),c.mapPos(o),a,o),text:i}}function $6e(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var e8e=class{constructor(){this.changes=[]}compareRange(e,t){t$(e,t,this.changes)}comparePoint(e,t){t$(e,t,this.changes)}boundChange(e){t$(e,e,this.changes)}};function t8e(e,t,n){let r=new e8e;return SQ.compare(e,t,n,r),r.changes}var n8e=class{constructor(){this.changes=[]}compareRange(e,t){t$(e,t,this.changes)}comparePoint(){}boundChange(e){t$(e,e,this.changes)}};function r8e(e,t,n){let r=new n8e;return SQ.compare(e,t,n,r),r.changes}function i8e(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function a8e(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var t1=class extends YQ{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function o8e(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return JZ.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=LZ(i.text,a,!1):s=LZ(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;
1238){let e=LZ(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=LZ(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return JZ.range(o+i.from,s+i.from)}function s8e(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+w3e(o,a,e.state.tabSize)}function n1(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==XQ.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function c8e(e,t,n,r){let i=n1(e,t.head,t.assoc||-1),a=!r||i.type!=XQ.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==h$.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return JZ.cursor(o,n?-1:1)}return JZ.cursor(n?i.to:i.from,n?-1:1)}function l8e(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=h6e(i,a,o,s,n),l=m6e;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
1239`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function u8e(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==mQ.Space&&(i=t),i==t}}function d8e(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return JZ.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||-1),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=r??e.viewState.heightOracle.textHeight>>1,p=o1(e,{x:d,y:s+f*a},!1,a);return JZ.cursor(p.pos,p.assoc,void 0,o)}function r1(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function f8e(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=r1(e,i.from,0);t!=i.from&&(a=JZ.cursor(t,-1))}else{let t=r1(e,i.from,-1),n=r1(e,i.to,1);(t!=i.from||n!=i.to)&&(a=JZ.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?JZ.create(n,t.mainIndex):t}function i1(e,t,n){let r=r1(e.state.facet(L$).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:JZ.cursor(r,r<n.from?1:-1)}var a1=class{constructor(e,t){this.pos=e,this.assoc=t}};function o1(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new a1(0,1);if(c>e.viewState.docHeight)return new a1(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==XQ.Text){let t=e.docView.coordsAt(r<0?l.from:l.to,r);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==XQ.Text){let t=s8e(e,i,l,o,s);return new a1(t,t==l.from?1:-1)}}if(l.type!=XQ.Text)return c<(l.top+l.bottom)/2?new a1(l.from,1):new a1(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),p8e(e,u,l.from,o,s)}function p8e(e,t,n,r,i){let a=-1,o=null,s=1e9,c=1e9,l=i,u=i,d=(e,t)=>{for(let n=0;n<e.length;n++){let d=e[n];if(d.top==d.bottom)continue;let f=d.left>r?d.left-r:d.right<r?r-d.right:0,p=d.top>i?d.top-i:d.bottom<i?i-d.bottom:0;d.top<=u&&d.bottom>=l&&(l=Math.min(d.top,l),u=Math.max(d.bottom,u),p=0),(a<0||(p-c||f-s)<0)&&(a>=0&&c&&s<f&&o.top<=u-2&&o.bottom>=l+2?c=0:(a=t,s=f,c=p,o=d))}};if(t.isText()){for(let e=0;e<t.length;){let n=LZ(t.text,e);if(d(f$(t.dom,e,n).getClientRects(),e),!s&&!c)break;e=n}return r>(o.left+o.right)/2==(m8e(e,a+n)==h$.LTR)?new a1(n+LZ(t.text,a),-1):new a1(n+a,1)}else{if(!t.length)return new a1(n,1);for(let e=0;e<t.children.length;e++){let n=t.children[e];if(!(n.flags&48)&&(d((n.dom.nodeType==1?n.dom:f$(n.dom,0,n.length)).getClientRects(),e),!s&&!c))break}let l=t.children[a],u=t.posBefore(l,n);return l.isComposite()||l.isText()?p8e(e,l,u,Math.max(o.left,Math.min(o.right,r)),i):r>(o.left+o.right)/2==(m8e(e,a+n)==h$.LTR)?new a1(u+l.length,-1):new a1(u,1)}}function m8e(e,t){let n=e.state.doc.lineAt(t);return e.bidiSpans(n)[b$.find(e.bidiSpans(n),t-n.from,-1,1)].dir}var s1=`ï¿¿`,h8e=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(gQ.lineSeparator)}append(e){this.text+=e}
1239lineBreak(){this.text+=s1}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=V$.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=V$.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:c$(r))||c$(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!_8e(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=V$.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(g8e(e,n.node,n.offset)?t:0))}};function g8e(e,t,n){for(;;){if(!t||n<l$(t))return!1;if(t==e)return!0;n=s$(t)+1,t=t.parentNode}}function _8e(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=V$.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var v8e=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},y8e=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=b8e(e.docView.tile,t,n,0))){let t=i||a?[]:w8e(e),n=new h8e(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=T8e(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!r$(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!r$(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),o=e.viewport;if((GQ.ios||GQ.chrome)&&e.state.selection.main.empty&&n!=r&&(o.from>0||o.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=o.from-t,s=o.to-i;(a==0||a==1||t==0)&&(s==0||s==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(JZ.range(r,n)):this.newSel=JZ.single(r,n)}}};function b8e(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return b8e(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function x8e(e,t){let n,{newSel:r}=t,i=e.state.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:o}=t.bounds,s=i.from,c=null;(a===8||GQ.android&&t.text.length<o-r)&&(s=i.to,c=`end`);let l=C8e(e.state.doc.sliceString(r,o,s1),t.text,s-r,c);l&&(GQ.chrome&&a==13&&l.toB==l.from+2&&t.text.slice(l.from,l.toB)==`ï¿¿ï¿¿`&&l.toB--,n={from:r+l.from,to:r+l.toA,insert:jZ.of(t.text.slice(l.from,l.toB).split(s1))})}else r&&(!e.hasFocus&&e.state.facet(A$)||l1(r,i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(GQ.mac||GQ.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=JZ.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:jZ.of([n.insert.toString().replace(`.`,` `)]
vendor: 5,123 bytes, lines 1239-1240
1239)}):n&&n.from>=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).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:GQ.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
1240 `&&e.lineWrapping&&(r&&=JZ.single(r.main.anchor-1,r.main.head-1),n={from:i.from,to:i.to,insert:jZ.of([` `])}),n)return c1(e,n,r,a);if(r&&!l1(r,i)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=f8e(e.state.facet(L$).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function c1(e,t,n,r=-1){if(GQ.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(GQ.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&&p$(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&p$(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&p$(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=S8e(e,t,n);return e.state.facet(x6e).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function S8e(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=r1(i.facet(L$).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:JZ.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&Z6e(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?JZ.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function C8e(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function w8e(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new v8e(n,r)),(i!=n||a!=r)&&t.push(new v8e(i,a))),t}function T8e(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?JZ.single(n+t,r+t):null}function l1(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var E8e=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,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=e.hasFocus,GQ.safari&&e.contentDOM.addEventListener(`input`,()=>null),GQ.gecko&&n5e(e.contentDOM.ownerDocument)}handleEvent(e){!L8e(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Prom
vendor: 5,905 bytes, line 1240
1240ise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=O8e(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&j8e.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),GQ.android&&GQ.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return GQ.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=k8e.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||A8e.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,p$(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:GQ.safari&&!GQ.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function D8e(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){k$(n.state,e)}}}function O8e(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(D8e(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(D8e(t.value,r))}}for(let e in f1)n(e).handlers.push(f1[e]);for(let e in p1)n(e).observers.push(p1[e]);return t}var k8e=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],A8e=`dthko`,j8e=[16,17,18,20,91,92,224,225],u1=6;function d1(e){return Math.max(0,e)*.7+8}function M8e(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var N8e=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=J3e(e.contentDOM),this.atoms=e.state.facet(L$).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(gQ.allowMultipleSelections)&&P8e(e,t),this.dragging=I8e(e,t)&&K8e(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&M8e(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=R$(this.view);e.clientX-s.left<=r+u1?t=-d1(r-e.clientX):e.clientX+s.right>=a-u1&&(t=d1(e.clientX-a)),e.clientY-s.top<=i+u1?n=-d1(i-e.clientY):e.clientY+s.bottom>=o-u1&&(n=d1(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=f8e(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function P8e(e,t){let n=e.state.facet(_6e);return n.length?n[0](t):GQ.mac?t.metaKey:t.ctrlKey}function F8e(e,t){let n=e.state.facet(v6e);return n.length?n[0](t):GQ.mac?!t.altKey:!t.ctrlKey}function I8e(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=n$(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function L8e(e,t){if(!t.bubbles)return!0;
vendor: 24,920 bytes, line 1240
1240if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=V$.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var f1=Object.create(null),p1=Object.create(null),R8e=GQ.ie&&GQ.ie_version<15||GQ.ios&&GQ.webkit_version<604;function z8e(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(),B8e(e,n.value)},50)}function m1(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function B8e(e,t){t=m1(e.state,T$,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(h1!=null&&n.selection.ranges.every(e=>e.empty)&&h1==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:JZ.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:JZ.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}p1.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},f1.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),p1.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin(`select.pointer`)},p1.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},f1.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(y6e))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=q8e(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new N8e(e,t,n,r)),r&&e.observer.ignore(()=>{X3e(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function V8e(e,t,n,r){if(r==1)return JZ.cursor(t,n);if(r==2)return o8e(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,JZ.range(a,o)}}var H8e=GQ.ie&&GQ.ie_version<=11,U8e=null,W8e=0,G8e=0;function K8e(e){if(!H8e)return e.detail;let t=U8e,n=G8e;return U8e=e,G8e=Date.now(),W8e=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(W8e+1)%3:1}function q8e(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=K8e(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=V8e(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=V8e(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?JZ.range(i,a):JZ.range(a,i)}return a?i.replaceRange(i.main.extend(l.from,l.to)):o&&r==1&&i.ranges.length>1&&(c=J8e(i,s.pos))?c:o?i.addRange(l):JZ.create([l])}}}function J8e(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return JZ.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}f1.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=JZ.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,m1(e.state,E$,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},f1.dragend=e=>(e.inputState.draggedContent=null,!1);function Y8e(e,t,n,r){if(n=m1(e.state,T$,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&F8e(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}f1.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,a=()=>{++i==n.length&&Y8e(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return Y8e(e,t,n,!0),!0}return!1},f1.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=R8e?null:t.clipboardData;return n?(B8e(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(z8e(e),!1)};function X8e(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 Z8e(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:m1(e,E$,t.join(e.lineBreak)),ranges:n,linewise:r}}var h1=null;f1.copy=f1.cut=(e,t)=>{let n=n$(e.root);if(n&&!i$(e.contentDOM,n))return!1;let{text:r,ranges:i,linewise:a}=Z8e(e.state);if(!r&&!a)return!1;h1=a?r:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:`delete.cut`});let o=R8e?null:t.clipboardData;return o?(o.clearData(),o.setData(`text/plain`,r),!0):(X8e(e,r),!1)};var Q8e=lQ.define();function $8e(e,t){let n=[];for(let r of e.facet(S6e)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:Q8e.of(!0)}):null}function e5e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=$8e(e.state,t);n?e.dispatch(n):e.update([])}},10)}p1.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),e5e(e)},p1.blur=e=>{e.observer.clearSelectionRange(),e5e(e)},p1.compositionstart=p1.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},p1.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,GQ.chrome&&GQ.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},p1.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},f1.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return c1(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(GQ.chrome&&GQ.android&&(n=k8e.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return GQ.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),GQ.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>p1.compositionend(e,t),20),!1};var t5e=new Set;function n5e(e){t5e.has(e)||(t5e.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var r5e=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],g1=!1;function i5e(){g1=!1}var a5e=class{constructor(e){this.lineWrapping=e,this.doc=jZ.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return r5e.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=r5e.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},o5e=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},_1=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?XQ.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof e$?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},v1=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(v1||={}),y1=.001,b1=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>y1&&(g1=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,v1.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,v1.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,v1.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=f5e.build(n.setDoc(a),e,l,u);i=x1(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new S1(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new l5e(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function x1(e,t){return e==t?e:(e.constructor!=t.constructor&&(g1=!0),t)}b1.prototype.size=1;var s5e=ZQ.replace({}),c5e=class extends b1{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new _1(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new _1(r,0,n,this.spaceAbove,s5e):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,v1.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},S1=class e extends c5e{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new _1(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof C1&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof C1?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):b1.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},C1=class e extends b1{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new _1(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new _1(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==v1.ByHeight)return this.blockAt(e,n,r,i);if(t==v1.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new _1(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new _1(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new _1(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return b1.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=y1&&(s=-2);let c=new S1(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=b1.of(r);return(s<0||Math.abs(c.height-this.height)>=y1||Math.abs(s-this.heightMetrics(t,n).perLine)>=y1)&&(g1=!0),x1(this,c)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},l5e=class extends b1{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==v1.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==v1.ByPosNoHeight?v1.ByPosNoHeight:v1.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,v1.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&u5e(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),u5e(i,e)}return b1.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?b1.of(this.break?[e,null,t]:[e,t]):(this.left=x1(this.left,e),this.right=x1(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function u5e(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof C1&&(r=e[t+1])instanceof C1&&e.splice(t-1,3,new C1(n.length+1+r.length))}var d5e=5,f5e=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof S1?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new S1(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new c5e(a,r,n)):(a||i||r>=d5e)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new S1(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new C1(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof S1)return e;let t=new S1(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof S1)&&!this.isCovered?this.nodes.push(new S1(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof S1&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return SQ.spans(n,r,i,a,0),a.finish(r)}};function p5e(e,t,n){let r=new m5e;return SQ.compare(e,t,n,r,0),r.changes}var m5e=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&t$(e,t,this.changes,5)}};function h5e(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function g5e(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function _5e(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var w1=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return ZQ.replace({widget:new v5e(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},v5e=class extends YQ{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},y5e=class{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=S5e,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=h$.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(P$).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new a5e(t),this.stateDeco=C5e(e),this.heightMap=b1.empty().applyChanges(this.stateDeco,jZ.empty,this.heightOracle.setDoc(e.doc),[new B$(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ZQ.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new T1(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?S5e:new w5e(this.heightOracle,this.heightMap,this.viewports),e.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,e=>{this.viewportLines.push(O1(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=C5e(this.state);let r=e.changedRanges,i=B$.extendWithRanges(r,p5e(n,this.stateDeco,e?e.changes:VZ.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);i5e(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.
vendor: 2,217 bytes, line 1240
1240setDoc(this.state.doc),i),(this.heightMap.height!=a||g1)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(w6e)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?h$.RTL:h$.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=K3e(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=e6e(e.scrollDOM);let p=(this.printing?_5e:h5e)(t,this.paddingTop),m=p.top-this.pixelViewport.top,h=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;
vendor: 29,996 bytes, lines 1240-1241
1240if(g!=this.inView&&(this.inView=g,g&&(s=!0)),!this.inView&&!this.scrollTarget&&!g5e(e.dom))return 0;let _=o.width;if((this.contentDOMWidth!=_||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(_-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,_/o),t),a&&(e.docView.minWidth=0,c|=16)}m>0&&h>0?l=Math.max(m,h):m<0&&h<0&&(l=Math.min(m,h)),i5e();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?b1.empty().applyChanges(this.stateDeco,jZ.empty,this.heightOracle,[new B$(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new o5e(n.from,i))}g1&&(c|=2)}let v=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return v&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new T1(r.lineAt(a-n*1e3,v1.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,v1.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,v1.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new T1(r.lineAt(o-1e3/2,v1.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,v1.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new T1(this.heightMap.lineAt(n,v1.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,v1.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,v1.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,v1.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new w1(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=h$.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=x5e(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(JZ.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new w1(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=XQ.Text)return;let i=b5e(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=D1(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=E1(i,n),l=E1(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=D1(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=E1(i,f),l=E1(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=D1(r,n)-D1(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){w1.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ZQ.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];SQ.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||O1(this.heightMap.lineAt(e,v1.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||O1(this.heightMap.lineAt(this.scaler.fromDOM(e),v1.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return O1(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},T1=class{constructor(e,t){this.from=e,this.to=t}};function b5e(e,t,n){let r=[],i=e,a=0;return SQ.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function E1({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function D1(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 x5e(e,t){for(let n of e)if(t(n))return n}var S5e={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function C5e(e){let t=e.facet(F$).filter(e=>typeof e!=`function`),n=e.facet(I$).filter(e=>typeof e!=`function`);return n.length&&t.push(SQ.join(n)),t}var w5e=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,v1.ByPos,e,0,0).top,o=t.lineAt(i,v1.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function O1(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new _1(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>O1(e,t)):e._content)}var k1=XZ.define({combine:e=>e.join(` `)}),A1=XZ.define({combine:e=>e.indexOf(!0)>-1}),j1=MQ.newName(),T5e=MQ.newName(),E5e=MQ.newName(),D5e={"&light":`.`+T5e,"&dark":`.`+E5e};function M1(e,t,n){return new MQ(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var O5e=M1(`.`+j1,{"&":{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,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,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`}},D5e),k5e={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},N1=GQ.ie&&GQ.ie_version<=11,A5e=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Y3e,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=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(GQ.ie&&GQ.ie_version<=11||GQ.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&GQ.android&&e.constructor.EDIT_CONTEXT!==!1&&!(GQ.chrome&&GQ.chrome_version<126)&&(this.editContext=new P5e(e),e.state.facet(A$)&&(e.contentDOM.editContext=this.editContext.editContext)),N1&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.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(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.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(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(A$)?n.root.activeElement!=this.dom:!i$(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(GQ.ie&&GQ.ie_version<=11||GQ.android&&GQ.chrome)&&!n.state.selection.main.empty&&r.focusNode&&o$(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=n$(e.root);if(!t)return!1;let n=GQ.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&N5e(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=i$(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&$3e(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,k5e),N1&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),N1&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&p$(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&i$(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new y8e(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=x8e(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!l1(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=j5e(t,e.previousSibling||e.target.previousSibling,-1),r=j5e(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(A$)!=e.state.facet(A$)&&(e.view.contentDOM.editContext=e.state.facet(A$)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.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 j5e(e,t,n){for(;t;){let r=V$.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function M5e(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return o$(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function N5e(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return M5e(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?M5e(e,n):null}var P5e=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=C8e(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=JZ.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));l1(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:jZ.of(n.text.slice(l.from,l.toB).split(`
1241`))};if((GQ.mac||GQ.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:jZ.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);c1(e,u,JZ.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(ZQ.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:E6e.of(ZQ.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=n$(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},P1=class e{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(e={}){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),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>
vendor: 12,041 bytes, line 1241
1241e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Q3e(e.parent)||document,this.viewState=new y5e(e.state||gQ.create(e)),e.scrollTo&&e.scrollTo.is(O$)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(j$).map(e=>new N$(e));for(let e of this.plugins)e.update(this);this.observer=new A5e(this),this.inputState=new E8e(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Y6e(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof dQ?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);i=t.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,o=0,s=null;e.some(e=>e.annotation(Q8e))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=$8e(i,a),s||(o=1));let c=this.observer.delayedAndroidKey,l=null;if(c?(this.observer.clearDelayedAndroidKey(),l=this.observer.readChange(),(l&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(l=null)):this.observer.clear(),i.facet(gQ.phrases)!=this.state.facet(gQ.phrases))return this.setState(i);r=N6e.create(this,i,e),r.flags|=o;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&=u.map(t.changes),t.scrollIntoView){let{main:e}=t.state.selection;u=new D$(e.empty?e:JZ.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(O$)&&(u=e.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=L5e.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(z$)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(r.startState.facet(k1)!=r.state.facet(k1)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(w$))try{e(r)}catch(e){k$(this.state,e,`update listener`)}(s||l)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),l&&!x8e(this,l)&&c.force&&p$(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new y5e(e),this.plugins=e.facet(j$).map(e=>new N$(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new Y6e(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(j$),n=e.state.facet(j$);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new N$(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){k$(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(e6e(n))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure(this);if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return k$(this.state,e),I5e}}),l=N6e.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=I5e)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){k$(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a;if(e>1||e<-1){r+=e,n.scrollTop=r/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(w$))e(t)}get themeClasses(){return j1+` `+(this.state.facet(A1)?E5e:T5e)+` `+this.state.facet(k1)}updateAttrs(){let e=R5e(this,O6e,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(A$)?`true`:`false`,class:`cm-content`,style:`${GQ.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),R5e(this,P$,t);let n=this.observer.ignore(()=>{let n=z3e(this.contentDOM,this.contentAttrs,t),r=z3e(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(z$);let t=this.state.facet(e.cspNonce);MQ.mount(this.root,this.styleModules.concat(O5e).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.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(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return i1(this,e,l8e(this,e,t,n))}moveByGroup(e,t){return i1(this,e,l8e(this,e,t,t=>u8e(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return JZ.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return c8e(this,e,t,n)}moveVertically(e,t,n){return i1(this,e,d8e(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=o1(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),o1(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[b$.find(i,e-r.from,-1,t)];return u$(n,a.dir==h$.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(C6e)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>F5e)return p6e(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||c6e(r.isolates,n=j6e(this,e))))return r.order;n||=j6e(this,e);let r=f6e(e.text,t,n);return this.bidiCache.push(new L5e(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||GQ.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{X3e(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.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(e,t={}){return O$.of(new D$(typeof e==`number`?JZ.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return O$.of(new D$(JZ.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return M$.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return M$.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=MQ.newName(),r=[k1.of(n),z$.of(M1(`.${n}`,e))];return t&&t.dark&&r.push(A1.of(!0)),r}static baseTheme(e){return iQ.lowest(z$.of(M1(`.`+j1,e,D5e)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&V$.get(t)||V$.get(e))?.root?.view||null}};P1.styleModule=z$,P1.inputHandler=x6e,P1.clipboardInputFilter=T$,P1.clipboardOutputFilter=E$,P1.scrollHandler=T6e,P1.focusChangeEffect=S6e,P1.perLineTextDirection=C6e,P1.exceptionSink=b6e,P1.updateListener=w$,P1.editable=A$,P1.mouseSelectionStyle=y6e,P1.dragMovesSelection=v6e,P1.clickAddsSelectionRange=_6e,P1.decorations=F$,P1.blockWrappers=k6e,P1.outerDecorations=I$,P1.atomicRanges=L$,P1.bidiIsolatedRanges=A6e,P1.scrollMargins=M6e,P1.darkTheme=A1,P1.cspNonce=XZ.define({combine:e=>e.length?e[0]:``}
vendor: 17,882 bytes, line 1241
1241),P1.contentAttributes=P$,P1.editorAttributes=O6e,P1.lineWrapping=P1.contentAttributes.of({class:`cm-lineWrapping`}),P1.announce=uQ.define();var F5e=4096,I5e={},L5e=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:h$.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function R5e(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&KQ(a,n)}return n}var z5e=GQ.mac?`mac`:GQ.windows?`win`:GQ.linux?`linux`:`key`;function B5e(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function F1(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var V5e=iQ.default(P1.domEventHandlers({keydown(e,t){return K5e(U5e(t.state),e,t,`editor`)}})),I1=XZ.define({enables:V5e}),H5e=new WeakMap;function U5e(e){let t=e.facet(I1),n=H5e.get(t);return n||H5e.set(t,n=G5e(t.reduce((e,t)=>e.concat(t),[]))),n}var L1=null,W5e=4e3;function G5e(e,t=z5e){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>B5e(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=L1={view:t,prefix:n,scope:e};return setTimeout(()=>{L1==r&&(L1=null)},W5e),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,R1))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var R1=null;function K5e(e,t,n,r){R1=t;let i=M3e(t),a=K4e(G4e(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;L1&&L1.view==n&&L1.scope==r&&(o=L1.prefix+` `,j8e.indexOf(t.keyCode)<0&&(c=!0,L1=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+F1(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(GQ.windows&&t.ctrlKey&&t.altKey)&&!(GQ.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=NQ[t.keyCode])&&p!=i?(d(f[o+F1(p,t,!0)])||t.shiftKey&&(m=PQ[t.keyCode])!=i&&m!=p&&d(f[o+F1(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+F1(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),R1=null,s}var z1=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className?(this.adjust(e),!0):!1}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=q5e(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return Y5e(t,n,r)}};function q5e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==h$.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function J5e(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function Y5e(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),a=e.textDirection==h$.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=q5e(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=n1(e,r,1),m=n1(e,i,-1),h=p.type==XQ.Text?p:null,g=m.type==XQ.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=J5e(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=J5e(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==XQ.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new z1(t,e-c.left,n-c.top,r-e,i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);!p||!m||(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==h$.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function X5e(e,t){return e.constructor==t.constructor&&e.eq(t)}var Z5e=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(`div`)),this.dom.classList.add(`cm-layer`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(B1)!=e.state.facet(B1)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(B1);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!X5e(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,GQ.safari&&GQ.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()}},B1=XZ.define();function Q5e(e){return[M$.define(t=>new Z5e(t,e)),B1.of(e)]}var V1=XZ.define({combine(e){return _Q(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function $5e(e={}){return[V1.of(e),t7e,r7e,i7e,w6e.of(!0)]}function e7e(e){return e.startState.facet(V1)!=e.state.facet(V1)}var t7e=Q5e({above:!0,markers(e){let{state:t}=e,n=t.facet(V1),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:JZ.cursor(i.head,i.head>i.anchor?-1:1);for(let i of z1.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=e7e(e);return n&&n7e(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){n7e(t.state,e)},class:`cm-cursorLayer`});function n7e(e,t){t.style.animationDuration=e.facet(V1).cursorBlinkRate+`ms`}var r7e=Q5e({above:!1,markers(e){return e.state.selection.ranges.map(t=>t.empty?[]:z1.forRange(e,`cm-selectionBackground`,t)).reduce((e,t)=>e.concat(t))},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||e7e(e)},class:`cm-selectionLayer`}),i7e=iQ.highest(P1.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`}}}}));/x/.unicode;var H1=`-10000px`,a7e=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function o7e(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var U1=XZ.define({combine:e=>({position:GQ.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||o7e})}),s7e=new WeakMap,c7e=M$.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(U1);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 a7e(e,f7e,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.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(U1);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.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 e of this.manager.tooltipViews)this.container.appendChild(e.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 e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=H1,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 t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(GQ.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=R$(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((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(U1).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=H1;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=s7e.get(c)??d.bottom-d.top,g=c.offset||d7e,_=this.view.textDirection==h$.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=H1;continue}s7e.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,l7e(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,l7e(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),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=H1}},{eventObservers:{scroll(){this.maybeMeasure()}}});function l7e(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var u7e=P1.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`}
vendor: 4,928 bytes, line 1241
1241,".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`}}}),d7e={x:0,y:0},f7e=XZ.define({enables:[c7e,u7e]}),W1=XZ.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),p7e=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new a7e(e,W1,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},m7e=f7e.compute([W1],e=>{let t=e.facet(W1);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:p7e.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),h7e=class{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.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 e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==h$.RTL?-1:1;i=t.x<n.left?-o:o}let a=this.source(e,r,i);if(a?.then){let t=this.pending={pos:r};a.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>k$(e.state,t,`hover tooltip`))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(c7e),t=e?e.manager.tooltips.findIndex(e=>e.create==p7e.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&n&&!g7e(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!_7e(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},G1=4;function g7e(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-G1&&t.clientX<=r+G1&&t.clientY>
vendor: 23,462 bytes, line 1241
1241=i-G1&&t.clientY<=a+G1}function _7e(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function v7e(e,t={}){let n=uQ.define(),r=tQ.define({create(){return[]},update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,zZ.TrackDel);if(e!=null){let i=Object.assign(Object.create(null),n);i.pos=e,i.end!=null&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(y7e)&&(e=[]);return e},provide:e=>W1.from(e)});return{active:r,extension:[r,M$.define(i=>new h7e(i,e,r,n,t.hoverTime||300)),m7e]}}var y7e=uQ.define(),b7e=XZ.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}}),x7e=M$.fromClass(class{constructor(e){this.input=e.state.facet(q1),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(b7e);this.top=new K1(e,!0,t.topContainer),this.bottom=new K1(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(b7e);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new K1(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new K1(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(q1);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>P1.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),K1=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),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 e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=S7e(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=S7e(e)}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 e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}};function S7e(e){let t=e.nextSibling;return e.remove(),t}var q1=XZ.define({enables:x7e}),J1=class extends vQ{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};J1.prototype.elementClass=``,J1.prototype.toDOM=void 0,J1.prototype.mapMode=zZ.TrackBefore,J1.prototype.startSide=J1.prototype.endSide=-1,J1.prototype.point=!0;var Y1=XZ.define(),C7e=XZ.define(),X1=XZ.define(),Z1=XZ.define({combine:e=>e.some(e=>e)});function w7e(e){let t=[T7e];return e&&e.fixed===!1&&t.push(Z1.of(!0)),t}var T7e=M$.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(X1).map(t=>new O7e(e,t)),this.fixed=!e.state.facet(Z1);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.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 e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Z1)!=!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=SQ.iter(this.view.state.facet(Y1),this.view.viewport.from),r=[],i=this.gutters.map(e=>new D7e(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==XQ.Text&&t){Q1(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==XQ.Text){Q1(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(X1),n=e.state.facet(X1),r=e.docChanged||e.heightChanged||e.viewportChanged||!SQ.eq(e.startState.facet(Y1),e.state.facet(Y1),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new O7e(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.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=>P1.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==h$.LTR?{left:r,right:i}:{right:r,left:i}})});function E7e(e){return Array.isArray(e)?e:[e]}function Q1(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var D7e=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=SQ.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new k7e(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];Q1(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(C7e)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},O7e=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=E7e(t.markers(e)),t.initialSpacer&&(this.spacer=new k7e(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=E7e(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!SQ.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},k7e=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),A7e(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function A7e(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var j7e=XZ.define(),M7e=XZ.define(),$1=XZ.define({combine(e){return _Q(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),e0=class extends J1{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function t0(e,t){return e.state.facet($1).formatNumber(t,e.state)}var N7e=X1.compute([$1],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(j7e)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new e0(t0(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(M7e)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet($1)!=e.state.facet($1),initialSpacer(e){return new e0(t0(e,F7e(e.state.doc.lines)))},updateSpacer(e,t){let n=t0(t.view,F7e(t.view.state.doc.lines));return n==e.number?e:new e0(n)},domEventHandlers:e.facet($1).domEventHandlers,side:`before`}));function P7e(e={}){return[$1.of(e),w7e(),N7e]}function F7e(e){let t=9;for(;t<e;)t=t*10+9;return t}var I7e=1024,L7e=0,n0=class{constructor(e,t){this.from=e,this.to=t}},r0=class{constructor(e={}){this.id=L7e++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=a0.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};r0.closedBy=new r0({deserialize:e=>e.split(` `)}),r0.openedBy=new r0({deserialize:e=>e.split(` `)}),r0.group=new r0({deserialize:e=>e.split(` `)}),r0.isolate=new r0({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),r0.contextHash=new r0({perNode:!0}),r0.lookAhead=new r0({perNode:!0}),r0.mounted=new r0({perNode:!0});var i0=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[r0.mounted.id]}},R7e=Object.create(null),a0=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):R7e,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.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(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(r0.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(r0.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};a0.none=new a0(``,Object.create(null),0,8);var z7e=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new a0(e.name,r,e.id,e.flags):e)}return new e(n)}},o0=new WeakMap,B7e=new WeakMap,s0;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(s0||={});var c0=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=i0.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new m0(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new m0(o0.get(this)||this.topNode);return r.moveTo(e,t),o0.set(this,r._tree),r}get topNode(){return new d0(this,0,0,null)}resolve(e,t=0){let n=u0(o0.get(this)||this.topNode,e,t,!1);return o0.set(this,n),n}resolveInner(e,t=0){let n=u0(B7e.get(this)||this.topNode,e,t,!0);return B7e.set(this,n),n}resolveStack(e,t=0){return J7e(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&s0.IncludeAnonymous)>0;for(let e=this.cursor(a|s0.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:_0(a0.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(a0.none,t,n,r)))}static build(e){return Y7e(e)}};c0.empty=new c0(a0.none,[],[],0);var V7e=class e{constructor(e,t){this.buffer=e,this.index=t}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 e(this.buffer,this.index)}},l0=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return a0.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(H7e(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function H7e(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function u0(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof d0&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:s0.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof d0&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var U7e=class{cursor(e=0){return new m0(this,e)}getChild(e,t=null,n=null){let r=W7e(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return W7e(this,e,t,n)}resolve(e,t=0){return u0(this,e,t,!1)}resolveInner(e,t=0){return u0(this,e,t,!0)}matchContext(e){return f0(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},d0=class e extends U7e{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from;if(!(!(a&s0.EnterBracketed&&l instanceof c0&&i0.get(l)?.overlay===null&&(u>=r||u+l.length<=r))&&!H7e(i,r,u,u+l.length))){if(l instanceof l0){if(a&s0.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new p0(new G7e(o,l,t,u),null,e)}else if(a&s0.IncludeAnonymous||!l.type.isAnonymous||h0(l)){let s;if(!(a&s0.IgnoreMounts)&&(s=i0.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&s0.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&s0.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))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(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&s0.IgnoreOverlays)&&(i=i0.get(this._tree))&&i.overlay){let a=t-this.from,o=r&s0.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}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 W7e(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function f0(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}var G7e=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},p0=class e extends U7e{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(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&s0.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,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 e(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 e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new c0(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function K7e(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof d0&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new q7e(i,n)}var q7e=class{constructor(e,t){this.heads=e,this.node=t}get next(){return K7e(this.heads)}};function J7e(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof d0?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=i0.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new d0(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(u0(o,t,n,!1))}}return i?K7e(i):r}var m0=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~s0.EnterBracketed,e instanceof d0)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;
vendor: 5,056 bytes, line 1241
1241for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof d0?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&s0.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&s0.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&s0.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&s0.IncludeAnonymous||e instanceof l0||!e.type.isAnonymous||h0(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new p0(this.buffer,t,this.stack[e]);return this.bufferNode=new p0(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return f0(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return f0(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function h0(e){return e.children.some(e=>e instanceof l0||!e.type.isAnonymous||h0(e))}function Y7e(e){let{buffer:t,nodeSet:n,maxBufferLength:r=I7e,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new V7e(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0)if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(w==-3){c=x;return}else if(w==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${w}`);let D=s[x],O,k,A=S-e;if(C-S<=r&&(k=h(o.pos-t,y))){let t=new Uint16Array(k.size-k.skip),r=o.pos-k.size,i=t.length;for(;o.pos>r;)i=g(k.start,t,i);O=new l0(t,C-k.start,n),A=k.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);O=_0(D,t,n,0,t.length,0,C-S,e,e)}else O=m(D,t,n,C-S,T-C,E)}_.push(O),v.push(A)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;
vendor: 4,131 bytes, line 1241
1241else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new l0(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof c0){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(r0.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[r0.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[r0.lookAhead,i];o=o?[e].concat(o):[e]}return new c0(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new c0(s[e.topID],_.reverse(),v.reverse(),y)}var X7e=new WeakMap;function g0(e,t){if(!e.isAnonymous||t instanceof l0||t.type!=e)return 1;let n=X7e.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof c0)){n=1;break}n+=g0(e,r)}X7e.set(t,n)}return n}function _0(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=g0(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=g0(e,t[s]);for(s++;s<i;s++){let n=g0(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(_0(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var v0=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?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 e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},Z7e=class{startParse(e,t,n){return typeof e==`string`&&(e=new Q7e(e)),n=n?n.length?n.map(e=>new n0(e.from,e.to)):[new n0(0,0)]:[new n0(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},Q7e=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new r0({perNode:!0});var $7e=0,y0=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=$7e++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new t9e(e);return e=>e.modified.indexOf(t)>-1?e:t9e.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},e9e=0,t9e=class e{constructor(e){this.name=e,this.instances=[],this.id=e9e++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>
vendor: 3,464 bytes, line 1241
1241e.base==t&&n9e(n,e.modified));if(r)return r;let i=[],a=new y0(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=r9e(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function n9e(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function r9e(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function i9e(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new b0(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return a9e.add(t)}var a9e=new r0({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 a=new b0(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),b0=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};b0.empty=new b0([],2,null);function o9e(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function s9e(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function c9e(e,t,n,r=0,i=e.length){let a=new l9e(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var l9e=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=u9e(e)||b0.empty,u=s9e(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(r0.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function u9e(e){let t=e.type.prop(a9e);for(;t&&t.context&&!e.matchContext(t.context);
vendor: 11,768 bytes, line 1241
1241)t=t.next;return t||null}var x0=y0.define,S0=x0(),C0=x0(),d9e=x0(C0),f9e=x0(C0),w0=x0(),T0=x0(w0),E0=x0(w0),D0=x0(),O0=x0(D0),k0=x0(),A0=x0(),j0=x0(),M0=x0(j0),N0=x0(),Q={comment:S0,lineComment:x0(S0),blockComment:x0(S0),docComment:x0(S0),name:C0,variableName:x0(C0),typeName:d9e,tagName:x0(d9e),propertyName:f9e,attributeName:x0(f9e),className:x0(C0),labelName:x0(C0),namespace:x0(C0),macroName:x0(C0),literal:w0,string:T0,docString:x0(T0),character:x0(T0),attributeValue:x0(T0),number:E0,integer:x0(E0),float:x0(E0),bool:x0(w0),regexp:x0(w0),escape:x0(w0),color:x0(w0),url:x0(w0),keyword:k0,self:x0(k0),null:x0(k0),atom:x0(k0),unit:x0(k0),modifier:x0(k0),operatorKeyword:x0(k0),controlKeyword:x0(k0),definitionKeyword:x0(k0),moduleKeyword:x0(k0),operator:A0,derefOperator:x0(A0),arithmeticOperator:x0(A0),logicOperator:x0(A0),bitwiseOperator:x0(A0),compareOperator:x0(A0),updateOperator:x0(A0),definitionOperator:x0(A0),typeOperator:x0(A0),controlOperator:x0(A0),punctuation:j0,separator:x0(j0),bracket:M0,angleBracket:x0(M0),squareBracket:x0(M0),paren:x0(M0),brace:x0(M0),content:D0,heading:O0,heading1:x0(O0),heading2:x0(O0),heading3:x0(O0),heading4:x0(O0),heading5:x0(O0),heading6:x0(O0),contentSeparator:x0(D0),list:x0(D0),quote:x0(D0),emphasis:x0(D0),strong:x0(D0),link:x0(D0),monospace:x0(D0),strikethrough:x0(D0),inserted:x0(),deleted:x0(),changed:x0(),invalid:x0(),meta:N0,documentMeta:x0(N0),annotation:x0(N0),processingInstruction:x0(N0),definition:y0.defineModifier(`definition`),constant:y0.defineModifier(`constant`),function:y0.defineModifier(`function`),standard:y0.defineModifier(`standard`),local:y0.defineModifier(`local`),special:y0.defineModifier(`special`)};for(let e in Q){let t=Q[e];t instanceof y0&&(t.name=e)}o9e([{tag:Q.link,class:`tok-link`},{tag:Q.heading,class:`tok-heading`},{tag:Q.emphasis,class:`tok-emphasis`},{tag:Q.strong,class:`tok-strong`},{tag:Q.keyword,class:`tok-keyword`},{tag:Q.atom,class:`tok-atom`},{tag:Q.bool,class:`tok-bool`},{tag:Q.url,class:`tok-url`},{tag:Q.labelName,class:`tok-labelName`},{tag:Q.inserted,class:`tok-inserted`},{tag:Q.deleted,class:`tok-deleted`},{tag:Q.literal,class:`tok-literal`},{tag:Q.string,class:`tok-string`},{tag:Q.number,class:`tok-number`},{tag:[Q.regexp,Q.escape,Q.special(Q.string)],class:`tok-string2`},{tag:Q.variableName,class:`tok-variableName`},{tag:Q.local(Q.variableName),class:`tok-variableName tok-local`},{tag:Q.definition(Q.variableName),class:`tok-variableName tok-definition`},{tag:Q.special(Q.variableName),class:`tok-variableName2`},{tag:Q.definition(Q.propertyName),class:`tok-propertyName tok-definition`},{tag:Q.typeName,class:`tok-typeName`},{tag:Q.namespace,class:`tok-namespace`},{tag:Q.className,class:`tok-className`},{tag:Q.macroName,class:`tok-macroName`},{tag:Q.propertyName,class:`tok-propertyName`},{tag:Q.operator,class:`tok-operator`},{tag:Q.comment,class:`tok-comment`},{tag:Q.meta,class:`tok-meta`},{tag:Q.invalid,class:`tok-invalid`},{tag:Q.punctuation,class:`tok-punctuation`}]);var P0=new r0;function p9e(e){return XZ.define({combine:e?t=>t.concat(e):void 0})}var m9e=new r0,F0=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,gQ.prototype.hasOwnProperty(`tree`)||Object.defineProperty(gQ.prototype,"tree",{get(){return I0(this)}}),this.parser=t,this.extension=[B0.of(this),gQ.languageData.of((e,t,n)=>{let r=h9e(e,t,n),i=r.type.prop(P0);if(!i)return[];let a=e.facet(i),o=r.type.prop(m9e);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return h9e(e,t,n).type.prop(P0)==this.data}findRegions(e){let t=e.facet(B0);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(P0)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(r0.mounted);if(i){if(i.tree.prop(P0)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof c0&&r(i,e.positions[n]+t)}};return r(I0(e),0),n}get allowsNesting(){return!0}};F0.setState=uQ.define();function h9e(e,t,n){let r=e.facet(B0),i=I0(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,s0.ExcludeBuffers|s0.EnterBracketed))e.type.isTop&&(i=e);return i}var g9e=class e extends F0{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=p9e(t.languageData);return new e(n,t.parser.configure({props:[P0.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function I0(e){let t=e.field(F0.state,!1);return t?t.tree:c0.empty}var _9e=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},L0=null,v9e=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],c0.empty,0,r,[],null)}startParse(){return this.parser.startParse(new _9e(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=c0.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(v0.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(v0.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=L0;L0=this;try{return e()}finally{L0=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=y9e(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=v0.applyChanges(r,e),i=c0.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=y9e(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Z7e{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=L0;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new c0(a0.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return L0}};function y9e(e,t,n){return v0.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var R0=class e{constructor(e){this.context=e,this.tree=e.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 e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=v9e.create(t.facet(B0).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};F0.state=tQ.define({create:R0.init,update(e,t){for(let e of t.effects)if(e.is(F0.setState))return e.value;return t.startState.facet(B0)==t.state.facet(B0)?e.apply(t):R0.init(t.state)}});var b9e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(b9e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var z0=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,x9e=M$.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(F0.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(F0.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=b9e(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(F0.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!z0?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>z0&&z0()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:F0.setState.of(new R0(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>k$(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),B0=XZ.define({combine(e){return e.length?e[0]:null},enables:e=>[F0.state,x9e,P1.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),S9e=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},C9e=XZ.define(),V0=XZ.define({combine:e=>{if(!e.length)return`  `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function H0(e){let t=e.facet(V0);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function U0(e,t){let n=``,r=e.tabSize,i=e.facet(V0)[0];if(i==`	`){for(;t>=r;)n+=`	`,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function w9e(e,t){e instanceof gQ&&(e=new W0(e));for(let n of e.state.facet(C9e)){let r=n(e,t);if(r!==void 0)return r}let n=I0(e.state);return n.length>
vendor: 5,978 bytes, line 1241
1241=t?E9e(e,n,t):null}var W0=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=H0(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return AQ(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},T9e=new r0;function E9e(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return D9e(r,e,n)}function D9e(e,t,n){for(let r=e;r;r=r.next){let e=k9e(r.node);if(e)return e(j9e.create(t,n,r))}return 0}function O9e(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function k9e(e){let t=e.type.prop(T9e);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(r0.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>P9e(e,!0,1,void 0,n&&!O9e(e)?t.from:void 0)}return e.parent==null?A9e:null}function A9e(){return 0}var j9e=class e extends W0{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(M9e(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return D9e(this.context.next,this.base,this.pos)}};function M9e(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function N9e(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function P9e(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?N9e(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function F9e({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var I9e=new r0;function L9e(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}var R9e=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=MQ.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof F0?e=>e.prop(P0)==a.data:a?e=>e==a:void 0,this.style=o9e(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new MQ(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},G0=XZ.define(),z9e=XZ.define({combine(e){return e.length?[e[0]]:null}});function K0(e){let t=e.facet(G0);return t.length?t:e.facet(z9e)}function B9e(e,t){let n=[H9e],r;return e instanceof R9e&&(e.module&&n.push(P1.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(z9e.of(e)):r?n.push(G0.computeN([P1.darkTheme],t=>t.facet(P1.darkTheme)==(r==`dark`)?[e]:[])):n.push(G0.of(e)),n}var V9e=class{constructor(e){this.markCache=Object.create(null),this.tree=I0(e.state),this.decorations=this.buildDeco(e,K0(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=I0(e.state),n=K0(e.state),r=n!=K0(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return ZQ.none;let n=new CQ;for(let{from:r,to:i}of e.visibleRanges)c9e(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=ZQ.mark({class:r})))},r,i);return n.finish()}},H9e=iQ.high(M$.fromClass(V9e,{decorations:e=>e.decorations}));Q.meta,Q.link,Q.heading,Q.emphasis,Q.strong,Q.strikethrough,Q.keyword,Q.atom,Q.bool,Q.url,Q.contentSeparator,Q.labelName,Q.literal,Q.inserted,Q.string,Q.deleted,Q.regexp,Q.escape,Q.string,Q.variableName,Q.variableName,Q.typeName,Q.namespace,Q.className,Q.variableName,Q.macroName,Q.propertyName,Q.comment,Q.invalid;var U9e=1e4,W9e=`()[]{}`,G9e=new r0;function q0(e,t,n){let r=e.prop(t<0?r0.openedBy:r0.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function J0(e){let t=e.type.prop(G9e);return t?t(e.node):e}function Y0(e,t,n,r={}){let i=r.maxScanDistance||U9e,a=r.brackets||W9e,o=I0(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=q0(r.type,n,a);if(i&&r.from<r.to){let o=J0(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return K9e(e,t,n,r,o,i,a)}}return q9e(e,t,n,o,s.type,i,a)}function K9e(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>
vendor: 4,900 bytes, line 1241
1241=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=J0(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(q0(u.type,n,o))l++;else if(q0(u.type,-n,o)){if(l==0){let e=J0(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function q9e(e,t,n,r,i,a,o){let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var J9e=Object.create(null),Y9e=[a0.none],X9e=[],Z9e=Object.create(null),Q9e=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`]])Q9e[e]=$9e(J9e,t);function X0(e,t){X9e.indexOf(e)>-1||(X9e.push(e),console.warn(t))}function $9e(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||Q[n];r?typeof r==`function`?t.length?t=t.map(r):X0(n,`Modifier ${n} used at start of tag`):t.length?X0(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:X0(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=Z9e[i];if(a)return a.id;let o=Z9e[i]=a0.define({id:Y9e.length,name:r,props:[i9e({[r]:n})]});return Y9e.push(o),o.id}h$.RTL,h$.LTR;var eet=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Q0(e.state,n.from);return r.line?tet(e):r.block?ret(e):!1};function Z0(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}}var tet=Z0(set,0),net=Z0(oet,0),ret=Z0((e,t)=>oet(e,t,aet(t)),0);function Q0(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var $0=50;function iet(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-$0,r),o=e.sliceDoc(i,i+$0),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*$0?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+$0),d=e.sliceDoc(i-$0,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function aet(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 a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function oet(e,t,n=t.selection.ranges){let r=n.map(e=>Q0(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>iet(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function set(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:a}of n){let n=r.length,o=1e9,s=Q0(t,e).line;if(s){for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var e2=lQ.define(),cet=lQ.define(),uet=XZ.define(),det=XZ.define({combine(e){return _Q(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>
vendor: 4,580 bytes, line 1241
1241t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),fet=tQ.define({create(){return s2.empty},update(e,t){let n=t.state.facet(det),r=t.annotation(e2);if(r){let i=r2.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?i2(o,o.length,n.minDepth,i):xet(o,t.startState.selection),new s2(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(cet);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(dQ.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=r2.fromTransaction(t),o=t.annotation(dQ.time),s=t.annotation(dQ.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new s2(e.done.map(r2.fromJSON),e.undone.map(r2.fromJSON))}});function pet(e={}){return[fet,det.of(e),P1.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?met:e.inputType==`historyRedo`?n2:null;return n?(e.preventDefault(),n(t)):!1}})]}function t2(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(fet,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var met=t2(0,!1),n2=t2(1,!1),het=t2(0,!0),get=t2(1,!0),r2=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&VZ.fromJSON(t.changes),[],t.mapped&&BZ.fromJSON(t.mapped),t.startSelection&&JZ.fromJSON(t.startSelection),t.selectionsAfter.map(JZ.fromJSON))}static fromTransaction(t,n){let r=a2;for(let e of t.startState.facet(uet)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,a2)}static selection(t){return new e(void 0,a2,void 0,void 0,t)}};function i2(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function _et(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function vet(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function yet(e,t){return e.length?t.length?e.concat(t):e:t}var a2=[],bet=200;function xet(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-bet));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),i2(e,e.length-1,1e9,n.setSelAfter(r)))}else return[r2.selection([t])]}function Cet(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 o2(e,t){if(!e.length)return e;let n=e.length,r=a2;for(;n;){let i=wet(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[r2.selection(r)]:a2}function wet(e,t,n){let r=yet(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):a2,n);if(!e.changes)return r2.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new r2(i,uQ.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Tet=/^(input\.type|delete)($|\.)/,s2=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Tet.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,_et(s.changes,t.changes))||r==`input.type.compose`)?i2(o,o.length-1,i.minDepth,new r2(t.changes.compose(s.changes),yet(uQ.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,a2)):i2(o,o.length,i.minDepth,t),new e(o,a2,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:a2;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&vet(a[a.length-1],t)?this:new e(xet(this.done,t),this.undone,n,r)}addMapping(t){return new e(o2(this.done,t),o2(this.undone,t),this.prevTime,this.prevUserEvent)}
vendor: 12,910 bytes, line 1241
1241pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:e2.of({side:e,rest:Cet(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?a2:r.slice(0,r.length-1);return i.mapped&&(n=o2(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:e2.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};s2.empty=new s2(a2,a2);var Eet=[{key:`Mod-z`,run:met,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:n2,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:n2,preventDefault:!0},{key:`Mod-u`,run:het,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:get,preventDefault:!0}];function c2(e,t){return JZ.create(e.ranges.map(t),e.mainIndex)}function l2(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function u2({state:e,dispatch:t},n){let r=c2(e.selection,n);return r.eq(e.selection,!0)?!1:(t(l2(e,r)),!0)}function d2(e,t){return JZ.cursor(t?e.to:e.from)}function Det(e,t){return u2(e,n=>n.empty?e.moveByChar(n,t):d2(n,t))}function f2(e){return e.textDirectionAt(e.state.selection.main.head)==h$.LTR}var Oet=e=>Det(e,!f2(e)),ket=e=>Det(e,f2(e));function Aet(e,t){return u2(e,n=>n.empty?e.moveByGroup(n,t):d2(n,t))}var jet=e=>Aet(e,!f2(e)),Met=e=>Aet(e,f2(e));typeof Intl<`u`&&Intl.Segmenter;function Net(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 p2(e,t,n){let r=I0(e).resolveInner(t.head),i=n?r0.closedBy:r0.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;Net(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?Y0(e,r.from,1):Y0(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,JZ.cursor(s,n?-1:1)}var Pet=e=>u2(e,t=>p2(e.state,t,!f2(e))),Fet=e=>u2(e,t=>p2(e.state,t,f2(e)));function Iet(e,t){return u2(e,n=>{if(!n.empty)return d2(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var Let=e=>Iet(e,!1),Ret=e=>Iet(e,!0);function zet(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(P1.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function Bet(e,t){let n=zet(e),{state:r}=e,i=c2(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):d2(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=P1.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(l2(r,i),{effects:a}),!0}var Vet=e=>Bet(e,!1),m2=e=>Bet(e,!0);function h2(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 n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=JZ.cursor(r.from+n))}return i}var Het=e=>u2(e,t=>h2(e,t,!0)),Uet=e=>u2(e,t=>h2(e,t,!1)),Wet=e=>u2(e,t=>h2(e,t,!f2(e))),Get=e=>u2(e,t=>h2(e,t,f2(e))),Ket=e=>u2(e,t=>JZ.cursor(e.lineBlockAt(t.head).from,1)),qet=e=>u2(e,t=>JZ.cursor(e.lineBlockAt(t.head).to,-1));function Jet(e,t,n){let r=!1,i=c2(e.selection,t=>{let i=Y0(e,t.head,-1)||Y0(e,t.head,1)||t.head>0&&Y0(e,t.head-1,1)||t.head<e.doc.length&&Y0(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?JZ.range(t.anchor,a):JZ.cursor(a)});return r?(t(l2(e,i)),!0):!1}var Yet=({state:e,dispatch:t})=>Jet(e,t,!1);function g2(e,t){let n=c2(e.state.selection,e=>{let n=t(e);return JZ.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(l2(e.state,n)),!0)}function Xet(e,t){return g2(e,n=>e.moveByChar(n,t))}var Zet=e=>Xet(e,!f2(e)),Qet=e=>Xet(e,f2(e));function $et(e,t){return g2(e,n=>e.moveByGroup(n,t))}var ett=e=>$et(e,!f2(e)),ttt=e=>$et(e,f2(e)),ntt=e=>g2(e,t=>p2(e.state,t,!f2(e))),rtt=e=>g2(e,t=>p2(e.state,t,f2(e)));function itt(e,t){return g2(e,n=>e.moveVertically(n,t))}var att=e=>itt(e,!1),ott=e=>itt(e,!0);function stt(e,t){return g2(e,n=>e.moveVertically(n,t,zet(e).height))}var ctt=e=>stt(e,!1),ltt=e=>stt(e,!0),utt=e=>g2(e,t=>h2(e,t,!0)),dtt=e=>g2(e,t=>h2(e,t,!1)),ftt=e=>g2(e,t=>h2(e,t,!f2(e))),ptt=e=>g2(e,t=>h2(e,t,f2(e))),mtt=e=>g2(e,t=>JZ.cursor(e.lineBlockAt(t.head).from)),htt=e=>g2(e,t=>JZ.cursor(e.lineBlockAt(t.head).to)),gtt=({state:e,dispatch:t})=>(t(l2(e,{anchor:0})),!0),_tt=({state:e,dispatch:t})=>(t(l2(e,{anchor:e.doc.length})),!0),vtt=({state:e,dispatch:t})=>(t(l2(e,{anchor:e.selection.main.anchor,head:0})),!0),ytt=({state:e,dispatch:t})=>(t(l2(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),btt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),xtt=({state:e,dispatch:t})=>{let n=b2(e).map(({from:t,to:n})=>JZ.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:JZ.create(n),userEvent:`select`})),!0},Stt=({state:e,dispatch:t})=>{let n=c2(e.selection,t=>{let n=I0(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return JZ.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(l2(e,n)),!0)};function Ctt(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(l2(n,JZ.create(i,i.length-1))),!0)}var wtt=e=>Ctt(e,!1),Ttt=e=>Ctt(e,!0),Ett=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=JZ.create([n.main]):n.main.empty||(r=JZ.create([JZ.cursor(n.main.head)])),r?(t(l2(e,r)),!0):!1};function _2(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=v2(e,o,!1)):o>i&&(n=`delete.forward`,o=v2(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=v2(e,i,!1),a=v2(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:JZ.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?P1.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function v2(e,t,n){if(e instanceof P1)for(let r of e.state.facet(P1.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var Dtt=(e,t,n)=>_2(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==`	`)return i-1;let e=AQ(s,a.tabSize)%H0(a)||H0(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=LZ(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=LZ(o.text,c-o.from,!1,!1)+o.from);return c}),y2=e=>Dtt(e,!1,!0),Ott=e=>Dtt(e,!0,!1),ktt=(e,t)=>_2(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=LZ(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Att=e=>ktt(e,!1),jtt=e=>ktt(e,!0),Mtt=e=>_2(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Ntt=e=>_2(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Ptt=e=>_2(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Ftt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:jZ.of([``,``])},range:JZ.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},Itt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:LZ(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:LZ(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:JZ.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function b2(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Ltt(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of b2(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(JZ.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(JZ.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:JZ.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Rtt=({state:e,dispatch:t})=>Ltt(e,t,!1),ztt=({state:e,dispatch:t})=>Ltt(e,t,!0);function Btt(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of b2(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.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}var Vtt=({state:e,dispatch:t})=>Btt(e,t,!1),Htt=({state:e,dispatch:t})=>Btt(e,t,!0),Utt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(b2(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=c2(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Wtt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=I0(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(r0.closedBy))&&a.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}var Gtt=qtt(!1),Ktt=qtt(!0);function qtt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&Wtt(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new W0(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=w9e(s,r);for(c??=AQ(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,U0(t,c)];return o&&l.push(U0(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:jZ.of(l)},range:JZ.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function x2(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:JZ.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Jtt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new W0(e,{overrideIndentation:e=>n[e]??-1}),i=x2(e,(t,i,a)=>{let o=w9e(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=U0(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},Ytt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(x2(e,(t,n)=>{n.push({from:t.from,insert:e.facet(V0)})}),{userEvent:`input.indent`})),!0),Xtt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(x2(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=AQ(r,e.tabSize),a=0,o=U0(e,Math.max(0,i-H0(e)));for(;
vendor: 7,542 bytes, line 1241
1241a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),Ztt=e=>(e.setTabFocusMode(),!0),Qtt=[{key:`Ctrl-b`,run:Oet,shift:Zet,preventDefault:!0},{key:`Ctrl-f`,run:ket,shift:Qet},{key:`Ctrl-p`,run:Let,shift:att},{key:`Ctrl-n`,run:Ret,shift:ott},{key:`Ctrl-a`,run:Ket,shift:mtt},{key:`Ctrl-e`,run:qet,shift:htt},{key:`Ctrl-d`,run:Ott},{key:`Ctrl-h`,run:y2},{key:`Ctrl-k`,run:Mtt},{key:`Ctrl-Alt-h`,run:Att},{key:`Ctrl-o`,run:Ftt},{key:`Ctrl-t`,run:Itt},{key:`Ctrl-v`,run:m2}],$tt=[{key:`ArrowLeft`,run:Oet,shift:Zet,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:jet,shift:ett,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Wet,shift:ftt,preventDefault:!0},{key:`ArrowRight`,run:ket,shift:Qet,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Met,shift:ttt,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Get,shift:ptt,preventDefault:!0},{key:`ArrowUp`,run:Let,shift:att,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:gtt,shift:vtt},{mac:`Ctrl-ArrowUp`,run:Vet,shift:ctt},{key:`ArrowDown`,run:Ret,shift:ott,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:_tt,shift:ytt},{mac:`Ctrl-ArrowDown`,run:m2,shift:ltt},{key:`PageUp`,run:Vet,shift:ctt},{key:`PageDown`,run:m2,shift:ltt},{key:`Home`,run:Uet,shift:dtt,preventDefault:!0},{key:`Mod-Home`,run:gtt,shift:vtt},{key:`End`,run:Het,shift:utt,preventDefault:!0},{key:`Mod-End`,run:_tt,shift:ytt},{key:`Enter`,run:Gtt,shift:Gtt},{key:`Mod-a`,run:btt},{key:`Backspace`,run:y2,shift:y2,preventDefault:!0},{key:`Delete`,run:Ott,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Att,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:jtt,preventDefault:!0},{mac:`Mod-Backspace`,run:Ntt,preventDefault:!0},{mac:`Mod-Delete`,run:Ptt,preventDefault:!0}].concat(Qtt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),ent=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Pet,shift:ntt},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Fet,shift:rtt},{key:`Alt-ArrowUp`,run:Rtt},{key:`Shift-Alt-ArrowUp`,run:Vtt},{key:`Alt-ArrowDown`,run:ztt},{key:`Shift-Alt-ArrowDown`,run:Htt},{key:`Mod-Alt-ArrowUp`,run:wtt},{key:`Mod-Alt-ArrowDown`,run:Ttt},{key:`Escape`,run:Ett},{key:`Mod-Enter`,run:Ktt},{key:`Alt-l`,mac:`Ctrl-l`,run:xtt},{key:`Mod-i`,run:Stt,preventDefault:!0},{key:`Mod-[`,run:Xtt},{key:`Mod-]`,run:Ytt},{key:`Mod-Alt-\\`,run:Jtt},{key:`Shift-Mod-k`,run:Utt},{key:`Shift-Mod-\\`,run:Yet},{key:`Mod-/`,run:eet},{key:`Alt-A`,run:net},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Ztt}].concat($tt);ze();var tnt=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new nnt(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from,c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(r==0&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&e.buffer[r-4]==0&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r,!a.stateFlag(i,1)&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.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 e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new rnt(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>
vendor: 5,051 bytes, line 1241
124119)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(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:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new nnt(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},nnt=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},rnt=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},int=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.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 e(this.stack,this.pos,this.index)}};function S2(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var C2=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},ant=new C2,ont=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=ant,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}
vendor: 8,084 bytes, line 1241
1241readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,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(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=ant,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},w2=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;cnt(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};w2.prototype.contextual=w2.prototype.fallback=w2.prototype.extend=!1;var snt=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?S2(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(cnt(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};snt.prototype.contextual=w2.prototype.fallback=w2.prototype.extend=!1;function cnt(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||unt(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function lnt(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function unt(e,t,n,r){let i=lnt(n,r,t);return i<0||lnt(n,r,e)<i}var T2=Re!==void 0&&/\bparse\b/.test({}.LOG),dnt=null;function fnt(e,t,n){let r=e.cursor(s0.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>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}}var pnt=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?fnt(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?fnt(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof c0){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(r0.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},mnt=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new C2)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new C2,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new C2,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=E2(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(E2(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(E2(o,s+1),t,n,r))}return r}},hnt=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new ont(t,r),this.tokens=new mnt(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[tnt.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new pnt(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&ynt(r);if(e)return T2&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw T2&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return T2&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}
vendor: 6,614 bytes, line 1241
1241else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=T2?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(r0.contextHash)||0)==n))return e.useNode(o,r),T2&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof c0)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof c0&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),T2&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),T2&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return gnt(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=T2?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),T2&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(T2&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)T2&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))T2&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),T2&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),gnt(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),c0.build({buffer:int.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(dnt||=new WeakMap).get(e);return t||dnt.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function gnt(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var _nt=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},vnt=class e extends Z7e{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=r0[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new z7e(t.map((t,i)=>a0.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=I7e;let a=S2(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(bnt),this.states=S2(e.states,Uint32Array),this.data=S2(e.stateData),this.goto=S2(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new w2(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new hnt(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=E2(n,i+2)];else if(n[i+1]==2)return E2(n,i+2);else break;if(a==t||a==0)return E2(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=E2(this.data,n+2);else break;r=t(E2(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=E2(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);
1241if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=bnt(a),a})),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(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new _nt(e,n,r)}static deserialize(t){return new e(t)}};function E2(e,t){return e[t]|e[t+1]<<16}function ynt(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function bnt(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var xnt=i9e({String:Q.string,Number:Q.number,"True False":Q.bool,PropertyName:Q.propertyName,Null:Q.null,", :":Q.separator,"[ ]":Q.squareBracket,"{ }":Q.brace}),Snt=vnt.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:[xnt],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}),Cnt=g9e.define({name:`json`,parser:Snt.configure({props:[T9e.add({Object:F9e({except:/^\s*\}/}),Array:F9e({except:/^\s*\]/})}),I9e.add({"Object Array":L9e})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function wnt(){return new S9e(Cnt)}function D2(e){this.content=e}D2.prototype={constructor:D2,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new D2(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new D2(n)},addToStart:function(e,t){return new D2([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new D2(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new D2(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=D2.from(e),e.size?new D2(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=D2.from(e),e.size?new D2(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=D2.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},D2.from=function(e){if(e instanceof D2)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new D2(t)};function Tnt(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Tnt(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Ent(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Ent(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var O2=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}
vendor: 15,634 bytes, line 1241
1241textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Tnt(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ent(this,e,t,n)}findIndex(e){if(e==0)return A2(0,e);if(e==this.size)return A2(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?A2(t+1,i):A2(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};O2.empty=new O2([],0);var k2={index:0,offset:0};function A2(e,t){return k2.index=e,k2.offset=t,k2}function j2(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!j2(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!j2(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var M2=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&j2(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};M2.none=[];var N2=class extends Error{},P2=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Ont(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Dnt(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(O2.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};P2.empty=new P2(O2.empty,0,0);function Dnt(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Dnt(a.content,t-i-1,n-i-1)))}function Ont(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Ont(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function knt(e,t,n){if(n.openStart>e.depth)throw new N2(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new N2(`Inconsistent open depths`);return Ant(e,t,n,0)}function Ant(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Ant(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return R2(a,z2(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return R2(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Nnt(n,e);return R2(a,Mnt(e,i,o,t,r))}}function jnt(e,t){if(!t.type.compatibleContent(e.type))throw new N2(`Cannot join `+t.type.name+` onto `+e.type.name)}function F2(e,t,n){let r=e.node(n);return jnt(r,t.node(n)),r}function I2(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function L2(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(I2(e.nodeAfter,r),a++));for(let e=a;e<o;e++)I2(i.child(e),r);t&&t.depth==n&&t.textOffset&&I2(t.nodeBefore,r)}function R2(e,t){return e.type.checkContent(t),e.copy(t)}function Mnt(e,t,n,r,i){let a=e.depth>i&&F2(e,t,i+1),o=r.depth>i&&F2(n,r,i+1),s=[];return L2(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(jnt(a,o),I2(R2(a,Mnt(e,t,n,r,i+1)),s)):(a&&I2(R2(a,z2(e,t,i+1)),s),L2(t,n,i,s),o&&I2(R2(o,z2(n,r,i+1)),s)),L2(r,null,i,s),new O2(s)}function z2(e,t,n){let r=[];return L2(null,e,n,r),e.depth>n&&I2(R2(F2(e,t,n+1),z2(e,t,n+1)),r),L2(t,null,n,r),new O2(r)}function Nnt(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(O2.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Pnt=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return M2.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new B2(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Lnt.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Lnt.set(t,r=new Fnt);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Int,i}},Fnt=class{constructor(){this.elts=[],this.i=0}},Int=12,Lnt=new WeakMap,B2=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Rnt=Object.create(null),V2=class e{constructor(e,t,n,r=M2.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||O2.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&j2(this.attrs,t||e.defaultAttrs||Rnt)&&M2.sameSet(this.marks,n||M2.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return P2.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new P2(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return knt(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Pnt.resolveCached(this,e)}resolveNoCache(e){return Pnt.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Bnt(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=O2.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=M2.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!M2.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>
1241e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=O2.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};V2.prototype.text=void 0;var znt=class e extends V2{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Bnt(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Bnt(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var H2=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Vnt(t,n);if(r.next==null)return e.empty;let i=Hnt(r);r.next&&r.err(`Unexpected trailing text`);let a=Qnt(Ynt(i));return $nt(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return O2.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1242`)}};H2.empty=new H2(!0);var Vnt=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Hnt(e){let t=[];do t.push(Unt(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Unt(e){let t=[];
vendor: 55,281 bytes, lines 1242-1245
1242do t.push(Wnt(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Wnt(e){let t=Jnt(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Knt(e,t);else break;return t}function Gnt(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Knt(e,t){let n=Gnt(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Gnt(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function qnt(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Jnt(e){if(e.eat(`(`)){let t=Hnt(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=qnt(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Ynt(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Xnt(e,t){return t-e}function Znt(e,t){let n=[];return r(t),n.sort(Xnt);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Qnt(e){let t=Object.create(null);return n(Znt(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Znt(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new H2(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Xnt);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function $nt(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function ert(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function trt(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function nrt(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function rrt(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ort(e,r,t[r]);return n}var irt=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=rrt(e,n.attrs),this.defaultAttrs=ert(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==H2.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:trt(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new V2(this,this.computeAttrs(e),O2.from(t),M2.setFrom(n))}createChecked(e=null,t,n){return t=O2.from(t),this.checkContent(t),new V2(this,this.computeAttrs(e),t,M2.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=O2.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(O2.empty,!0);return i?new V2(this,e,t.append(i),M2.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){nrt(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:M2.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function art(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var ort=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?art(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},srt=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=rrt(e,r.attrs),this.excluded=null;let i=ert(this.attrs);this.instance=i?new M2(this,i):null}create(e=null){return!e&&this.instance?this.instance:new M2(this,trt(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){nrt(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},crt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=D2.from(e.nodes),t.marks=D2.from(e.marks||{}),this.nodes=irt.compile(this.spec.nodes,this),this.marks=srt.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=H2.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?lrt(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:lrt(this,n.split(` `))}this.nodeFromJSON=e=>V2.fromJSON(this,e),this.markFromJSON=e=>M2.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof irt))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new znt(n,n.defaultAttrs,e,M2.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function lrt(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function urt(e){return e.tag!=null}function drt(e){return e.style!=null}var U2=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(urt(e))this.tags.push(e);else if(drt(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new _rt(this,t,!1);return n.addAll(e,M2.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new _rt(this,t,!0);return n.addAll(e,M2.none,t.from,t.to),P2.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(yrt(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=brt(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=brt(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},frt={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},prt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},mrt={ol:!0,ul:!0},W2=1,hrt=2,G2=4;function grt(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?W2:0)|(t===`full`?hrt:0)}var K2=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=M2.none,this.match=i||(a&G2?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(O2.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&W2)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=O2.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(O2.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!frt.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},_rt=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=grt(null,t.preserveWhitespace,0)|(n?G2:0);i=r?new K2(r.type,r.attrs,M2.none,!0,t.topMatch||r.type.contentMatch,a):n?new K2(null,null,M2.none,!0,null,a):new K2(e.schema.topNodeType,null,M2.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&hrt?`full`:this.localPreserveWS||(r.options&W2)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
1243`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;mrt.hasOwnProperty(a)&&this.parser.normalizeLists&&vrt(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:prt.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(frt.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
1244`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=M2.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):xrt(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=grt(e,i,a.options);a.options&G2&&a.content.length==0&&(o|=G2);let s=M2.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):xrt(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new K2(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=W2);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function vrt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&mrt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function yrt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function brt(e){let t={};for(let n in e)t[n]=e[n];return t}function xrt(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var q2=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=J2(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Y2(J2(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Y2(J2(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Y2(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Srt(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Srt(e.marks)}};function Srt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function J2(e){return e.document||window.document}var Crt=new WeakMap;function wrt(e){let t=Crt.get(e);return t===void 0&&Crt.set(e,t=Trt(e)),t}function Trt(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function Y2(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=wrt(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=Y2(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Ert=65535,Drt=2**16;function Ort(e,t){return e+t*Drt}function krt(e){return e&Ert}function Art(e){return(e-(e&Ert))/Drt}var jrt=1,Mrt=2,Nrt=4,Prt=8,X2=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Prt)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Nrt)>0}},Z2=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=krt(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Art(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Ort(o/3,e-s),f=e==s?Mrt:e==u?jrt:Nrt;return(t<0?e!=s:e!=u)&&(f|=Prt),new X2(a,f,d)}r+=l-c}return n?e+r:new X2(e+r,0,null)}touches(e,t){let n=0,r=krt(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Z2.empty=new Z2([]);var Frt=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new X2(e,r,null)}},Q2=Object.create(null),$2=class{getMap(){return Z2.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Q2[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Q2)throw RangeError(`Duplicate use of step JSON ID `+e);return Q2[e]=t,t.prototype.jsonID=e,t}},e4=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof N2)return e.fail(t.message);throw t}}};function t4(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(t4(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return O2.fromArray(r)}var n4=class e extends $2{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new P2(t4(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return e4.fromReplace(e,this.from,this.to,i)}invert(){return new r4(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};$2.jsonID(`addMark`,n4);var r4=class e extends $2{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new P2(t4(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return e4.fromReplace(e,this.from,this.to,n)}invert(){return new n4(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};$2.jsonID(`removeMark`,r4);var i4=class e extends $2{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return e4.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return e4.fromReplace(e,this.pos,this.pos+1,new P2(O2.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new a4(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};$2.jsonID(`addNodeMark`,i4);var a4=class e extends $2{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return e4.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return e4.fromReplace(e,this.pos,this.pos+1,new P2(O2.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new i4(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};$2.jsonID(`removeNodeMark`,a4);var o4=class e extends $2{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&c4(e,this.from,this.to)?e4.fail(`Structure replace would overwrite content`):e4.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Z2([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?P2.empty:new P2(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?P2.empty:new P2(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,P2.fromJSON(t,n.slice),!!n.structure)}};$2.jsonID(`replace`,o4);var s4=class e extends $2{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(c4(e,this.from,this.gapFrom)||c4(e,this.gapTo,this.to)))return e4.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return e4.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?e4.fromReplace(e,this.from,this.to,n):e4.fail(`Content does not fit in gap`)}getMap(){return new Z2([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,P2.fromJSON(t,n.slice),n.insert,!!n.structure)}};$2.jsonID(`replaceAround`,s4);function c4(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Irt(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new r4(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new n4(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Lrt(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof srt){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new r4(t.from,t.to,t.style)))}function l4(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new o4(s,l,P2.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new r4(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new P2(O2.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new o4(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(O2.empty,!0);e.replace(s,s,new P2(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Rrt(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function u4(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Rrt(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function zrt(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=O2.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=O2.from(r.node(e).copy(u)),d++):c--;let f=O2.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=O2.from(i.node(e).copy(f)),p++):l++;e.step(new s4(c,l,o,s,new P2(u.append(f),d,p),u.size-d,!0))}function d4(e,t,n=null,r=e){let i=Vrt(e,t),a=i&&Hrt(r,t);return a?i.map(Brt).concat({type:t,attrs:n}).concat(a.map(Brt)):null}function Brt(e){return{type:e,attrs:null}}function Vrt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Hrt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Urt(e,t,n){let r=O2.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=O2.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new s4(i,a,i,a,new P2(r,0,0),n.length,!0))}function Wrt(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&qrt(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Krt(e,t,n,a),l4(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new s4(c,l,c+1,l-1,new P2(O2.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Grt(e,t,n,a),!1}})}function Grt(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Krt(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
1245`))}})}function qrt(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Jrt(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new s4(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new P2(O2.from(o),0,0),1,!0))}function f4(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Yrt(e,t,n=1,r){let i=e.doc.resolve(t),a=O2.empty,o=O2.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=O2.from(i.node(e).copy(a));let t=r&&r[s];o=O2.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new o4(t,t,new P2(a.append(o),n,n),!0))}function p4(e,t){let n=e.resolve(t),r=n.index();return Zrt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Xrt(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Zrt(e,t){return!!(e&&t&&!e.isLeaf&&Xrt(e,t))}function m4(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Zrt(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Qrt(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Krt(e,r.node(),r.before(),s)}o.inlineContent&&l4(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new o4(l,c.map(t+n,-1),P2.empty,!0)),r===!0){let t=e.doc.resolve(l);Grt(e,t.node(),t.before(),e.steps.length)}return e}function $rt(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function eit(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function h4(e,t,n=t,r=P2.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return tit(i,a,r)?new o4(t,n,r):new nit(i,a,r).fit()}function tit(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var nit=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=O2.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=O2.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new P2(i,a,o);return e>-1?new s4(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new o4(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=v4(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(O2.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=v4(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new P2(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=v4(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new P2(g4(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new P2(g4(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(rit(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=_4(this.placed,t,O2.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?P2.empty:new P2(g4(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new P2(g4(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!y4(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=y4(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=y4(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=_4(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=_4(this.placed,this.depth,O2.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(O2.empty,!0);e.childCount&&(this.placed=_4(this.placed,this.frontier.length,e))}};function g4(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(g4(e.firstChild.content,t-1,n)))}function _4(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(_4(e.lastChild.content,t-1,n)))}function v4(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function rit(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,rit(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(O2.empty,!0)))),e.copy(r)}function y4(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!iit(n,a.content,o)?s:null}function iit(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function ait(e){return e.spec.defining||e.spec.definingForContent}function oit(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(tit(i,a,r))return e.step(new o4(t,n,r));let o=uit(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=ait(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new P2(sit(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function sit(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(sit(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(O2.empty,!0))}return e}function cit(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=$rt(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new P2(O2.from(r),0,0))}function lit(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),a=uit(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function uit(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var dit=class e extends $2{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return e4.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return e4.fromReplace(e,this.pos,this.pos+1,new P2(O2.from(r),0,+!t.isLeaf))}getMap(){return Z2.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};$2.jsonID(`attr`,dit);var fit=class e extends $2{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return e4.ok(n)}getMap(){return Z2.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};$2.jsonID(`docAttr`,fit);var b4=class extends Error{};b4=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},b4.prototype=Object.create(Error.prototype),b4.prototype.constructor=b4,b4.prototype.name=`TransformError`;var pit=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Frt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new b4(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=P2.empty){let r=h4(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new P2(O2.from(n),0,0))}delete(e,t){return this.replace(e,t,P2.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return oit(this,e,t,n),this}replaceRangeWith(e,t,n){return cit(this,e,t,n),this}deleteRange(e,t){return lit(this,e,t),this}lift(e,t){return zrt(this,e,t),this}join(e,t=1){return Qrt(this,e,t),this}wrap(e,t){return Urt(this,e,t),this}setBlockType(e,t=e,n,r=null){return Wrt(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Jrt(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new dit(e,t,n)),this}setDocAttribute(e,t){return this.step(new fit(e,t)),this}addNodeMark(e,t){return this.step(new i4(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof M2)t.isInSet(n.marks)&&this.step(new a4(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new a4(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Yrt(this,e,t,n),this}addMark(e,t,n){return Irt(this,e,t,n),this}removeMark(e,t,n){return Lrt(this,e,t,n),this}clearIncompatible(e,t,n){return l4(this,e,t,n),this}},x4=Object.create(null),S4=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new mit(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=P2.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?P2.empty:t),o==0&&bit(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),bit(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new C4(e):E4(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?E4(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):E4(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}
1245static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new T4(e.node(0))}static atStart(e){return E4(e,e,0,0,1)||new T4(e)}static atEnd(e){return E4(e,e,e.content.size,e.childCount,-1)||new T4(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=x4[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in x4)throw RangeError(`Duplicate use of selection JSON ID `+e);return x4[e]=t,t.prototype.jsonID=e,t}getBookmark(){return C4.between(this.$anchor,this.$head).getBookmark()}};S4.prototype.visible=!0;var mit=class{constructor(e,t){this.$from=e,this.$to=t}},hit=!1;function git(e){!hit&&!e.parent.inlineContent&&(hit=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var C4=class e extends S4{constructor(e,t=e){git(e),git(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return S4.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=P2.empty){if(super.replace(e,t),t==P2.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new _it(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=S4.findFrom(n,r,!0)||S4.findFrom(n,-r,!0);if(e)n=e.$head;else return S4.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(S4.findFrom(t,-r,!0)||S4.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};S4.jsonID(`text`,C4);var _it=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return C4.between(e.resolve(this.anchor),e.resolve(this.head))}},w4=class e extends S4{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?S4.near(a):new e(a)}content(){return new P2(O2.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new vit(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};w4.prototype.visible=!1,S4.jsonID(`node`,w4);var vit=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new _it(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&w4.isSelectable(n)?new w4(t):S4.near(t)}},T4=class e extends S4{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=P2.empty){if(t==P2.empty){e.delete(0,e.doc.content.size);let t=S4.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return yit}};S4.jsonID(`all`,T4);var yit={map(){return this},resolve(e){return new T4(e)}};function E4(e,t,n,r,i,a=!1){if(t.inlineContent)return C4.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=E4(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&w4.isSelectable(r))return w4.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function bit(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof o4||i instanceof s4))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(S4.near(e.doc.resolve(o),n))}var xit=1,Sit=2,Cit=4,wit=class extends pit{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|xit)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&xit)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Sit,this}ensureMarks(e){return M2.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Sit)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||M2.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(S4.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Cit,this}get scrolledIntoView(){return(this.updated&Cit)>0}};function Tit(e,t){return!t||!e?e:e.bind(t)}var D4=class{constructor(e,t,n){this.name=e,this.init=Tit(t.init,
1245n),this.apply=Tit(t.apply,n)}},Eit=[new D4(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new D4(`selection`,{init(e,t){return e.selection||S4.atStart(t.doc)},apply(e){return e.selection}}),new D4(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new D4(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],O4=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Eit.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new D4(e.key,e.spec.state,e))})}},Dit=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new wit(this)}static create(t){let n=new O4(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new O4(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new O4(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=V2.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=S4.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Oit(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Oit(i,t,{})),n[r]=i}return n}var k4=class{constructor(e){this.spec=e,this.props={},e.props&&Oit(e.props,this,this.props),this.key=e.key?e.key.key:kit(`plugin`)}getState(e){return e[this.key]}},A4=Object.create(null);function kit(e){return e in A4?e+`$`+ ++A4[e]:(A4[e]=0,e+`$`)}var j4=class{constructor(e=`key`){this.key=kit(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},M4=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},N4=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Ait=null,P4=function(e,t,n){let r=Ait||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},jit=function(){Ait=null},F4=function(e,t,n,r){return n&&(Nit(e,t,n,r,-1)||Nit(e,t,n,r,1))},Mit=/^(img|br|input|textarea|hr)$/i;function Nit(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;
vendor: 107,163 bytes, lines 1245-1250
1245if(t==(i<0?0:I4(e))){let n=e.parentNode;if(!n||n.nodeType!=1||L4(e)||Mit.test(e.nodeName)||e.contentEditable==`false`)return!1;t=M4(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?I4(e):0}else return!1}}function I4(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Pit(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=I4(e)}else if(e.parentNode&&!L4(e))t=M4(e),e=e.parentNode;else return null}}function Fit(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!L4(e))t=M4(e)+1,e=e.parentNode;else return null}}function Iit(e,t,n){for(let r=t==0,i=t==I4(e);r||i;){if(e==n)return!0;let t=M4(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==I4(e)}}function L4(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var R4=function(e){return e.focusNode&&F4(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function z4(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Lit(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Rit(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(I4(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(I4(r.startContainer),r.startOffset)}}}var B4=typeof navigator<`u`?navigator:null,zit=typeof document<`u`?document:null,V4=B4&&B4.userAgent||``,H4=/Edge\/(\d+)/.exec(V4),Bit=/MSIE \d/.exec(V4),U4=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(V4),W4=!!(Bit||U4||H4),G4=Bit?document.documentMode:U4?+U4[1]:H4?+H4[1]:0,K4=!W4&&/gecko\/(\d+)/i.test(V4);K4&&+(/Firefox\/(\d+)/.exec(V4)||[0,0])[1];var q4=!W4&&/Chrome\/(\d+)/.exec(V4),J4=!!q4,Vit=q4?+q4[1]:0,Y4=!W4&&!!B4&&/Apple Computer/.test(B4.vendor),X4=Y4&&(/Mobile\/\w+/.test(V4)||!!B4&&B4.maxTouchPoints>2),Z4=X4||(B4?/Mac/.test(B4.platform):!1),Hit=B4?/Win/.test(B4.platform):!1,Q4=/Android \d/.test(V4),$4=!!zit&&`webkitFontSmoothing`in zit.documentElement.style,Uit=$4?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Wit(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function e3(e,t){return typeof e==`number`?e:e[t]}function Git(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Kit(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=N4(o);continue}let e=o,n=e==a.body,s=n?Wit(a):Git(e),c=0,l=0;if(t.top<s.top+e3(r,`top`)?l=-(s.top-t.top+e3(i,`top`)):t.bottom>s.bottom-e3(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+e3(i,`top`)-s.top:t.bottom-s.bottom+e3(i,`bottom`)),t.left<s.left+e3(r,`left`)?c=-(s.left-t.left+e3(i,`left`)):t.right>s.right-e3(r,`right`)&&(c=t.right-s.right+e3(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:N4(o)}}function qit(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Jit(e.dom)}}function Jit(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=N4(r));return t}function Yit({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Xit(n,r==0?0:r-t)}function Xit(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var t3=null;function Zit(e){if(e.setActive)return e.setActive();if(t3)return e.focus(t3);let t=Jit(e);e.focus(t3==null?{get preventScroll(){return t3={preventScroll:!0},!0}}:void 0),t3||(t3=!1,Xit(t,0))}function Qit(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=P4(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?$it(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Qit(n,i)}function $it(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=r3(r,1);if(n.top!=n.bottom&&n3(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function n3(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function eat(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function tat(e,t,n){let{node:r,offset:i}=Qit(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function nat(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function rat(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(n3(t,i))return rat(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function iat(e,t){let n=e.dom.ownerDocument,r,i=0,a=Rit(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!n3(t,n)||(o=rat(e.dom,t,n),!o))return null}if(Y4)for(let e=o;r&&e;e=N4(e))e.draggable&&(r=void 0);if(o=eat(o,t),r){if(K4&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;$4&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=nat(e,r,i,t))}s??=tat(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function aat(e){return e.top<e.bottom||e.left<e.right}function r3(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(aat(e))return e}return Array.prototype.find.call(n,aat)||e.getBoundingClientRect()}var oat=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function sat(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=$4||K4;if(r.nodeType==3)if(o&&(oat.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=r3(P4(r,i,i),n);if(K4&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=r3(P4(r,i-1,i-1),-1);if(t.top==e.top){let n=r3(P4(r,i,i+1),-1);if(n.top!=e.top)return i3(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,i3(r3(P4(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==I4(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return a3(e.getBoundingClientRect(),!1)}if(a==null&&i<I4(r)){let e=r.childNodes[i];if(e.nodeType==1)return a3(e.getBoundingClientRect(),!0)}return a3(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==I4(r))){let e=r.childNodes[i-1],t=e.nodeType==3?P4(e,I4(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return i3(r3(t,1),!1)}if(a==null&&i<I4(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?P4(e,0,+!o):e.nodeType==1?e:null:null;if(t)return i3(r3(t,-1),!0)}return i3(r3(r.nodeType==3?P4(r):r,-n),n>=0)}function i3(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function a3(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function cat(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function lat(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return cat(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=sat(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=P4(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var uat=/[\u0590-\u08ac]/;function dat(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!uat.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:cat(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var fat=null,pat=null,mat=!1;function hat(e,t,n){return fat==t&&pat==n?mat:(fat=t,pat=n,mat=n==`up`||n==`down`?lat(e,t,n):dat(e,t,n))}var o3=0,gat=1,s3=2,c3=3,l3=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=o3,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>M4(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof xat){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof _at&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?M4(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?M4(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=M4(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=M4(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((K4||Y4)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
1246`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:M4(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(K4&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Y4)&&F4(o.node,o.offset,l.anchorNode,l.anchorOffset)&&F4(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&K4)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?s3:gat,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=c3:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?s3:c3}n=a}this.dirty=s3}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?s3:gat;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},_at=class extends l3{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==o3&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},vat=class extends l3{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},u3=class e extends l3{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=q2.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&c3||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=c3&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=o3){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=o3}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=g3(a,n,o,r)),t>0&&(a=g3(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},d3=class e extends l3{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=q2.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Eat(u,r,n),l?c=new Sat(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new bat(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>O2.empty)}return e}matchesNode(e,t,n){return this.dirty==o3&&e.eq(this.node)&&h3(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Oat(this,a&&a.node,e);jat(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?M2.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==s3)&&(a&&this.protectLocalComposition(e,a),Cat(this.contentDOM,this.children,e),X4&&Mat(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof C4)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Nat(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new vat(this,i,t,r);e.input.compositionNodes.push(a),this.children=g3(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==c3||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=o3}updateOuterDeco(e){if(h3(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=wat(this.dom,this.nodeDOM,m3(this.outerDeco,this.node,t),m3(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function yat(e,t,n,r,i){Eat(r,t,e);let a=new d3(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var bat=class e extends d3{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==c3||this.dirty!=o3&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=o3||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=o3,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=c3)}get domAtom(){return!1}isText(e){return this.node.text==e}},xat=class extends l3{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==o3&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Sat=class extends d3{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==c3)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Cat(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Dat(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof u3){let t=r?r.previousSibling:e.lastChild;Cat(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Dat(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var f3=function(e){e&&(this.nodeName=e)};f3.prototype=Object.create(null);var p3=[new f3];function m3(e,t,n){if(e.length==0)return p3;let r=n?p3[0]:new f3,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new f3(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new f3(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function wat(e,t,n,r){if(n==p3&&r==p3)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=p3[0],i=t)}Tat(i,o||p3[0],a)}return i}function Tat(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Eat(e,t,n){return wat(e,e,p3,m3(t,n,e.nodeType!=1))}function h3(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Dat(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Oat=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=kat(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=o3,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=u3.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==c3&&a.dom==a.contentDOM&&(a.dirty=s3),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof d3){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=c3&&h3(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=s3,u.updateChildren(r,a+1),u.dirty=o3),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!h3(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=d3.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=d3.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new _at(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof u3;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof bat)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Y4||J4)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new xat(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function kat(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof u3)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Aat(e,t){return e.type.side-t.type.side}function jat(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Aat);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Mat(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Nat(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function g3(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function _3(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(R4(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&w4.isSelectable(e)&&i.parent&&!(e.isInline&&Iit(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new w4(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=b3(e,u,s,n)}return l}function Pat(e){return e.editable?e.hasFocus():Uat(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function v3(e,t=!1){let n=e.state.selection;if(Bat(e,n),Pat(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&J4){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&F4(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)zat(e);else{let{anchor:r,head:i}=n,a,o;Fat&&!(n instanceof C4)&&(n.$from.parent.inlineContent||(a=Iat(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Iat(e,n.to))),e.docView.setSelection(r,i,e,t),Fat&&(a&&Lat(a),o&&Lat(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Rat(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Fat=Y4||J4&&Vit<63;function Iat(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Y4&&i&&i.contentEditable==`false`)return y3(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return y3(i);if(a)return y3(a)}}function y3(e){return e.contentEditable=`true`,Y4&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Lat(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Rat(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Pat(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function zat(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,M4(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&W4&&G4<=11&&(n.disabled=!0,n.disabled=!1)}function Bat(e,t){if(t instanceof w4){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Vat(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Vat(e)}function Vat(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function b3(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||C4.between(t,n,r)}function Hat(e){return e.editable&&!e.hasFocus()?!1:Uat(e)}function Uat(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Wat(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return F4(t.node,t.offset,n.anchorNode,n.anchorOffset)}function x3(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&S4.findFrom(a,t)}function S3(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Gat(e,t,n){let r=e.state.selection;if(r instanceof C4){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return S3(e,new C4(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=x3(e.state,t);return n&&n instanceof w4?S3(e,n):!1}else if(!(Z4&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?w4.isSelectable(i)?S3(e,new w4(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):$4?S3(e,new C4(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof w4&&r.node.isInline)return S3(e,new C4(t>0?r.$to:r.$from));else{let n=x3(e.state,t);return n?S3(e,n):!1}}function C3(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function w3(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function T3(e,t){return t<0?Kat(e):qat(e)}function Kat(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(K4&&n.nodeType==1&&r<C3(n)&&w3(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(w3(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Jat(n))break;else{let t=n.previousSibling;for(;t&&w3(t,-1);)i=n.parentNode,a=M4(t),t=t.previousSibling;if(t)n=t,r=C3(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?E3(e,n,r):i&&E3(e,i,a)}function qat(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=C3(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(w3(e,1))a=n,o=++r;else break}else if(Jat(n))break;else{let t=n.nextSibling;for(;t&&w3(t,1);)a=t.parentNode,o=M4(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=C3(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&E3(e,a,o)}function Jat(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Yat(e,t){for(;e&&t==e.childNodes.length&&!L4(e);)t=M4(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Xat(e,t){for(;e&&!t&&!L4(e);)t=M4(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function E3(e,t,n){if(t.nodeType!=3){let e,r;(r=Yat(t,n))?(t=r,n=0):(e=Xat(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(R4(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&v3(e)},50)}function Zat(e,t){let n=e.state.doc.resolve(t);if(!(J4||Hit)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Qat(e,t,n){let r=e.state.selection;if(r instanceof C4&&!r.empty||n.indexOf(`s`)>-1||Z4&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=x3(e.state,t);if(n&&n instanceof w4)return S3(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof T4?S4.near(n,t):S4.findFrom(n,t);return o?S3(e,o):!1}return!1}function $at(e,t){if(!(e.state.selection instanceof C4))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function eot(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function tot(e){if(!Y4||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;eot(e,n,`true`),setTimeout(()=>eot(e,n,`false`),20)}return!1}function not(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function rot(e,t){let n=t.keyCode,r=not(t);if(n==8||Z4&&n==72&&r==`c`)return $at(e,-1)||T3(e,-1);if(n==46&&!t.shiftKey||Z4&&n==68&&r==`c`)return $at(e,1)||T3(e,1);if(n==13||n==27)return!0;if(n==37||Z4&&n==66&&r==`c`){let t=n==37?Zat(e,e.state.selection.from)==`ltr`?-1:1:-1;return Gat(e,t,r)||T3(e,t)}else if(n==39||Z4&&n==70&&r==`c`){let t=n==39?Zat(e,e.state.selection.from)==`ltr`?1:-1:1;return Gat(e,t,r)||T3(e,t)}else if(n==38||Z4&&n==80&&r==`c`)return Qat(e,-1,r)||T3(e,-1);else if(n==40||Z4&&n==78&&r==`c`)return tot(e)||Qat(e,1,r)||T3(e,1);else if(r==(Z4?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function D3(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||q2.fromSchema(e.state.schema),s=pot(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=dot[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
1247
1248`),slice:t}}function iot(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new P2(O2.from(e.state.schema.text(t.replace(/\r\n?/g,`
1249`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=q2.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=got(n),$4&&_ot(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||U2.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!aot.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=vot(uot(s,+u[1],+u[2]),u[4]);else if(s=P2.maxOpen(oot(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=uot(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var aot=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function oot(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&cot(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=lot(a[a.length-1],i.length));let n=sot(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return O2.from(a)}return e}function sot(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,O2.from(e));return e}function cot(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=cot(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(O2.from(sot(n,e,i+1))))}}function lot(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,lot(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(O2.empty,!0);return e.copy(n.append(r))}function O3(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=O3(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(O2.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function uot(e,t,n){return t<e.openStart&&(e=new P2(O3(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new P2(O3(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var dot={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},fot=null;function pot(){return fot||=document.implementation.createHTMLDocument(`title`)}var mot=null;function hot(e){let t=window.trustedTypes;return t?(mot||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),mot.createHTML(e)):e}function got(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=pot().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&dot[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=hot(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function _ot(e){let t=e.querySelectorAll(J4?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function vot(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=O2.from(t.create(r[e+1],i)),a++,o++}return new P2(i,a,o)}var k3={},A3={},yot={touchstart:!0,touchmove:!0},bot=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function xot(e){for(let t in k3){let n=k3[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Cot(e,t)&&!N3(e,t)&&(e.editable||!(t.type in A3))&&n(e,t)},yot[t]?{passive:!0}:void 0)}Y4&&e.dom.addEventListener(`input`,()=>null),M3(e)}function j3(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Sot(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function M3(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>N3(e,t))})}function N3(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Cot(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function wot(e,t){!N3(e,t)&&k3[t.type]&&(e.editable||!(t.type in A3))&&k3[t.type](e,t)}A3.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Pot(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Q4&&J4&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),X4&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,z4(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||rot(e,n)?n.preventDefault():j3(e,`key`)},A3.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},A3.keypress=(e,t)=>{let n=t;if(Pot(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Z4&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof C4)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function P3(e){return{left:e.clientX,top:e.clientY}}function Tot(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function F3(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function I3(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function Eot(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&w4.isSelectable(r)?(I3(e,new w4(n),`pointer`),!0):!1}function Dot(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof w4&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(w4.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(I3(e,w4.create(e.state.doc,i),`pointer`),!0)}function Oot(e,t,n,r,i){return F3(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Dot(e,n):Eot(e,n))}function kot(e,t,n,r){return F3(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Aot(e,t,n,r){return F3(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||jot(e,n,r)}function jot(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(I3(e,C4.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)I3(e,C4.create(r,a+1,a+1+n.content.size),`pointer`);else if(w4.isSelectable(n))I3(e,w4.create(r,a),`pointer`);else continue;return!0}}function L3(e){return R3(e)}var Mot=Z4?`metaKey`:`ctrlKey`;k3.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=L3(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Tot(n,e.input.lastClick)&&!n[Mot]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(P3(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Not(e,o,n,!!r)):(a==`doubleClick`?kot:Aot)(e,o.pos,o.inside,n)?n.preventDefault():j3(e,`pointer`))};var Not=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Mot],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof w4&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&K4&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),j3(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>v3(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(P3(e))),this.updateAllowDefault(e),this.allowDefault||!t?j3(this.view,`pointer`):Oot(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Y4&&this.mightDrag&&!this.mightDrag.node.isAtom||J4&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(I3(this.view,S4.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):j3(this.view,`pointer`)}move(e){this.updateAllowDefault(e),j3(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};k3.touchstart=e=>{e.input.lastTouch=Date.now(),L3(e),j3(e,`pointer`)},k3.touchmove=e=>{e.input.lastTouch=Date.now(),j3(e,`pointer`)},k3.contextmenu=e=>L3(e);function Pot(e,t){return e.composing?!0:Y4&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Fot=Q4?5e3:-1;A3.compositionstart=A3.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof C4&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||J4&&Hit&&Iot(e)))e.markCursor=e.state.storedMarks||n.marks(),R3(e,!0),e.markCursor=null;else if(R3(e,!t.selection.empty),K4&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}Lot(e,Fot)};function Iot(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}A3.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Lot(e,20))};function Lot(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>R3(e),t))}function Rot(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Bot());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function zot(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Pit(t.focusNode,t.focusOffset),r=Fit(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Bot(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function R3(e,t=!1){if(!(Q4&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Rot(e),t||e.docView&&e.docView.dirty){let n=_3(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Vot(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var z3=W4&&G4<15||X4&&Uit<604;k3.copy=A3.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=z3?null:n.clipboardData,{dom:o,text:s}=D3(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Vot(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Hot(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Uot(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?B3(e,r.value,null,i,t):B3(e,r.textContent,r.innerHTML,i,t)},50)}function B3(e,t,n,r,i){let a=iot(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||P2.empty)))return!0;if(!a)return!1;let o=Hot(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function Wot(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}A3.paste=(e,t)=>{let n=t;if(e.composing&&!Q4)return;let r=z3?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&B3(e,Wot(r),r.getData(`text/html`),i,n)?n.preventDefault():Uot(e,n)};var Got=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Kot=Z4?`altKey`:`ctrlKey`;function qot(e,t){return e.someProp(`dragCopies`,e=>!e(t))??!t[Kot]}k3.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(P3(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof w4?i.to-1:i.to))){if(r&&r.mightDrag)o=w4.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=w4.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=D3(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!J4||Vit>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(z3?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,z3||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Got(l,qot(e,n),o)},k3.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},A3.dragover=A3.dragenter=(e,t)=>t.preventDefault(),A3.drop=(e,t)=>{try{Jot(e,t,e.dragging)}finally{e.dragging=null}};function Jot(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(P3(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=iot(e,Wot(t.dataTransfer),z3?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&qot(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||P2.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?eit(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&w4.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new w4(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(b3(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}k3.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&v3(e)},20))},k3.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},k3.beforeinput=(e,t)=>{if(J4&&Q4&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,z4(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in A3)k3[e]=A3[e];function V3(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Yot=class e{constructor(e,t){this.toDOM=e,this.spec=t||G3,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new U3(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&V3(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},H3=class e{constructor(e,t){this.attrs=e,this.spec=t||G3}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new U3(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&V3(this.attrs,t.attrs)&&V3(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Xot=class e{constructor(e,t){this.attrs=e,this.spec=t||G3}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new U3(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&V3(this.attrs,t.attrs)&&V3(this.spec,t.spec)}destroy(){}},U3=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Yot(n,r))}static inline(t,n,r,i){return new e(t,n,new H3(r,i))}static node(t,n,r,i){return new e(t,n,new Xot(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof H3}get widget(){return this.type instanceof Yot}},W3=[],G3={},K3=class e{constructor(e,t){this.local=e.length?e:W3,this.children=t.length?t:W3}static create(e,t){return t.length?J3(t,e,0,G3):q3}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==q3||e.maps.length==0?this:this.mapInner(e,t,0,0,n||G3)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Qot(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Y3),W3):q3}add(t,n){return n.length?this==q3?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=tst(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,J3(s,e,o+1,G3)),a+=3}});let o=$ot(a?nst(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Y3):this.local,i||this.children)}remove(e){return e.length==0||this==q3?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==q3?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):q3}forChild(t,n){if(this==q3)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof H3){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Y3),W3);return r?new Zot([t,r]):t}return r||q3}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return X3(this.localsInner(e))}localsInner(e){if(this==q3)return W3;if(e.inlineContent||!this.local.some(H3.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof H3||t.push(this.local[e]);return t}forEachSet(e){e(this)}};K3.empty=new K3([],[]),K3.removeOverlap=X3;var q3=K3.empty,Zot=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,G3));return e.from(r)}forChild(t,n){if(n.isLeaf)return K3.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=q3&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?X3(n?t:t.sort(Y3)):W3}static from(t){switch(t.length){case 0:return q3;case 1:return t[0];default:return new e(t.every(e=>e instanceof K3)?t:t.reduce((e,t)=>e.concat(t instanceof K3?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Qot(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==q3?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=J3(est(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new K3(t.sort(Y3),s)}function $ot(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new U3(i.from+t,i.to+t,i.type))}return n}function est(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function tst(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function nst(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function J3(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=tst(e,t,o+n);if(s){a=!0;let e=J3(s,t,n+o+1,r);e!=q3&&i.push(o,o+t.nodeSize,e)}});let o=$ot(a?nst(e):e,-n).sort(Y3);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new K3(o,i):q3}function Y3(e,t){return e.from-t.from||e.to-t.to}function X3(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),rst(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),rst(t,i,r.copy(a.from,r.to)));break}}}return t}function rst(e,t,n){for(;t<e.length&&Y3(n,e[t])>0;)t++;e.splice(t,0,n)}function Z3(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=q3&&t.push(r)}),e.cursorWrapper&&t.push(K3.create(e.state.doc,[e.cursorWrapper.deco])),Zot.from(t)}var ist={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ast=W4&&G4<=11,ost=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},sst=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ost,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);W4&&G4<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Y4&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ast&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ist)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Hat(this.view)){if(this.suppressingSelectionUpdates)return v3(this.view);if(W4&&G4<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&F4(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=N4(n))t.add(n);for(let r=e.anchorNode;r;r=N4(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Hat(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(K4&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||pst(e,n)!=t)&&r.remove()}}}else if((J4||Y4)&&s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;t&&t.nodeType==1&&t.contentEditable==`false`&&e.parentNode.removeChild(e)}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&R4(n)&&(c=_3(e))&&c.eq(S4.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,v3(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),ust(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,mst(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||v3(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(W4&&G4<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?M4(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?M4(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},cst=new WeakMap,lst=!1;function ust(e){if(!cst.has(e)&&(cst.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=K4,lst)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),lst=!0}}function dst(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return F4(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function fst(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return dst(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?dst(e,n):null}function pst(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function mst(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function hst(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],R4(c)||l.push({node:c.focusNode,offset:c.focusOffset})),J4&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||U2.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:gst,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function gst(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Y4&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Y4&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var _st=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function vst(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=_3(e,t);if(n&&!e.state.selection.eq(n)){if(J4&&Q4&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,z4(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=hst(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Sst(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(X4&&e.input.lastIOSEnter>Date.now()-225||Q4)&&i.some(e=>e.nodeType==1&&!_st.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,z4(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof C4&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=yst(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof C4&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),W4&&G4<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((X4&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,z4(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&xst(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,z4(8,`Backspace`)))){Q4&&J4&&e.domObserver.suppressSelectionUpdates();return}J4&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Q4&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,z4(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=yst(e,n.doc,l.sel);t&&!(J4&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||W4&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){W4&&G4<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>v3(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=bst(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function yst(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:b3(e,t.resolve(n.anchor),t.resolve(n.head))}function bst(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(O2.from(l).eq(e))return{mark:s,type:o}}function xst(e,t,n,r,i){if(n-t<=i.pos-r.pos||Q3(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Q3(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Q3(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Q3(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Sst(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&Cst(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&Cst(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function Cst(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var wst=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new bot,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(jst),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Dst(this),Est(this),this.nodeViews=kst(this),this.docView=yat(this.state.doc,Tst(this),Z3(this),this.dom,this),this.domObserver=new sst(this,(e,t,n,r)=>vst(this,e,t,n,r)),this.domObserver.start(),xot(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&M3(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(jst),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Rot(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=kst(this);Ast(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&M3(this),this.editable=Dst(this),Est(this);let o=Z3(this),s=Tst(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&qit(this);if(i){this.domObserver.stop();let t=l&&(W4||J4)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Ost(n.selection,e.selection);if(l){let n=J4?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=zot(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=yat(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Wat(this))?v3(this,t):(Bat(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Yit(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof w4){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Kit(this,t.getBoundingClientRect(),e)}else Kit(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Got(e.slice,e.move,r<0?void 0:w4.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(W4){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Zit(this.dom),v3(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return iat(this,e)}coordsAtPos(e,t=1){return sat(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return hat(this,t||this.state,e)}pasteHTML(e,t){return B3(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return B3(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return D3(this,e)}destroy(){this.docView&&(Sot(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Z3(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,jit())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return wot(this,e)}domSelectionRange(){let e=this.domSelection();return e?Y4&&this.root.nodeType===11&&Lit(this.dom.ownerDocument)==this.dom&&fst(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};wst.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Tst(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[U3.node(0,e.state.doc.content.size,t)]}function Est(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:U3.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Dst(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Ost(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function kst(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Ast(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function jst(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var Mst=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Nst=typeof navigator<`u`&&/Win/.test(navigator.platform);function Pst(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Mst?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Fst(e){let t=Object.create(null);for(let n in e)t[Pst(n)]=e[n];return t}function $3(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Ist(e){return new k4({props:{handleKeyDown:Lst(e)}})}function Lst(e){let t=Fst(e);return function(e,n){let r=M3e(n),i,a=t[$3(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[$3(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Nst&&n.ctrlKey&&n.altKey)&&(i=NQ[n.keyCode])&&i!=r){let r=t[$3(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var e6=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Rst(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var zst=(e,t,n)=>{let r=Rst(e,n);if(!r)return!1;let i=n6(r);if(!i){let n=r.blockRange(),i=n&&u4(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(act(e,i,t,-1))return!0;if(r.parent.content.size==0&&(t6(a,`end`)||w4.isSelectable(a)))for(let n=r.depth;;n--){let o=h4(e.doc,r.before(n),r.after(n),P2.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(t6(a,`end`)?S4.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):w4.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Bst=(e,t,n)=>{let r=Rst(e,n);if(!r)return!1;let i=n6(r);return i?Hst(e,i,t):!1},Vst=(e,t,n)=>{let r=Wst(e,n);if(!r)return!1;let i=r6(r);return i?Hst(e,i,t):!1};function Hst(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=h4(e.doc,i,o,P2.empty);if(!s||s.from!=i||s instanceof o4&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(C4.create(t.doc,i)),n(t.scrollIntoView())}return!0}function t6(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Ust=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=n6(r)}let o=a&&a.nodeBefore;return!o||!w4.isSelectable(o)?!1:(t&&t(e.tr.setSelection(w4.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function n6(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Wst(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Gst=(e,t,n)=>{let r=Wst(e,n);if(!r)return!1;let i=r6(r);if(!i)return!1;let a=i.nodeAfter;if(act(e,i,t,1))return!0;if(r.parent.content.size==0&&(t6(a,`start`)||w4.isSelectable(a))){let n=h4(e.doc,r.before(),r.after(),P2.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(t6(a,`start`)?S4.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):w4.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Kst=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=r6(r)}let o=a&&a.nodeAfter;return!o||!w4.isSelectable(o)?!1:(t&&t(e.tr.setSelection(w4.create(e.doc,a.pos)).scrollIntoView()),!0)};function r6(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var qst=(e,t)=>{let n=e.selection,r=n instanceof w4,i;if(r){if(n.node.isTextblock||!p4(e.doc,n.from))return!1;i=n.from}else if(i=m4(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(w4.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Jst=(e,t)=>{let n=e.selection,r;if(n instanceof w4){if(n.node.isTextblock||!p4(e.doc,n.to))return!1;r=n.to}else if(r=m4(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Yst=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&u4(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Xst=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
1250`).scrollIntoView()),!0)};function i6(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Zst=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=i6(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(S4.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Qst=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof T4||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=i6(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(C4.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},$st=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(f4(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&u4(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function ect(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof w4&&t.selection.node.isBlock)return!r.parentOffset||!f4(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=i6(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof C4||t.selection instanceof T4)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=f4(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,f4(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var tct=ect(),nct=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(w4.create(e.doc,i))),!0)},rct=(e,t)=>(t&&t(e.tr.setSelection(new T4(e.doc))),!0);function ict(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||p4(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function act(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&ict(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=O2.empty;for(let e=o.length-1;e>=0;e--)s=O2.from(o[e].create(null,s));s=O2.from(i.copy(s));let c=e.tr.step(new s4(t.pos-1,r,t.pos,r,new P2(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&p4(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:S4.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&u4(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&t6(a,`start`,!0)&&t6(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=O2.empty;for(let e=o.length-1;e>=0;e--)r=O2.from(o[e].copy(r));n(e.tr.step(new s4(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new P2(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function oct(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(C4.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var sct=oct(-1),cct=oct(1);function lct(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&d4(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function uct(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function a6(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var o6=a6(e6,zst,Ust),dct=a6(e6,Gst,Kst),s6={Enter:a6(Xst,Qst,$st,tct),"Mod-Enter":Zst,Backspace:o6,"Mod-Backspace":o6,"Shift-Backspace":o6,Delete:dct,"Mod-Delete":dct,"Mod-a":rct},fct={"Ctrl-h":s6.Backspace,"Alt-Backspace":s6[`Mod-Backspace`],"Ctrl-d":s6.Delete,"Ctrl-Alt-Backspace":s6[`Mod-Delete`],"Alt
1250-Delete":s6[`Mod-Delete`],"Alt-d":s6[`Mod-Delete`],"Ctrl-a":sct,"Ctrl-e":cct};for(let e in s6)fct[e]=s6[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function pct(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return mct(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function mct(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new B2(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new B2(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=d4(a,n,r,t);return s?(e&&hct(e,t,s,i,n),!0):!1}function hct(e,t,n,r,i){let a=O2.empty;for(let e=n.length-1;e>=0;e--)a=O2.from(n[e].type.create(n[e].attrs,a));e.step(new s4(t.start-(r?2:0),t.end,t.start,t.end,new P2(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&f4(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function gct(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?_ct(t,n,e,a):vct(t,n,a):!0:!1}}function _ct(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new s4(a-1,o,a,o,new P2(O2.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new B2(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=u4(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return p4(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function vct(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?O2.empty:O2.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new s4(d-+!!s,f+ +!!c,d+1,f-1,new P2((s?O2.empty:O2.from(i.copy(O2.empty))).append(c?O2.empty:O2.from(i.copy(O2.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function yct(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=O2.from(r?e.create():null),o=new P2(O2.from(e.create(null,O2.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new s4(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}function c6(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var l6=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:c6({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},bct=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];
1250return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function u6(e,t,n){return e.config[t]===void 0&&e.parent?u6(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?u6(e.parent,t,n):null}):e.config[t]}function d6(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function xct(e){let t=[],{nodeExtensions:n,markExtensions:r}=d6(e),i=[...n,...r],a={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n=u6(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}
1250),i.forEach(e=>{let n=u6(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function f6(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function p6(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=t?t.split(`;`).map(e=>e.trim()).filter(Boolean):[],i=n[e]?n[e].split(`;`).map(e=>e.trim()).filter(Boolean):[],a=new Map;i.forEach(e=>{let[t,n]=e.split(`:`).map(e=>e.trim());a.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(`:`).map(e=>e.trim());a.set(t,n)}),n[e]=Array.from(a.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function m6(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>p6(e,t),{})}function Sct(e){return typeof e==`function`}function h6(e,t=void 0,...n){return Sct(e)?t?e.bind(t)(...n):e(...n):e}function Cct(e={}){return Object.keys(e).length===0&&e.constructor===Object}function wct(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Tct(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):wct(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Ect(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Cct(t)?!1:t!=null))}function Dct(e,t){let n=xct(e),{nodeExtensions:r,markExtensions:i}=d6(e);return new crt({topNode:r.find(e=>u6(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Ect({...e.reduce((e,t)=>{let n=u6(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:h6(u6(r,`content`,a)),marks:h6(u6(r,`marks`,a)),group:h6(u6(r,`group`,a)),inline:h6(u6(r,`inline`,a)),atom:h6(u6(r,`atom`,a)),selectable:h6(u6(r,`selectable`,a)),draggable:h6(u6(r,`draggable`,a)),code:h6(u6(r,`code`,a)),whitespace:h6(u6(r,`whitespace`,a)),linebreakReplacement:h6(u6(r,`linebreakReplacement`,a)),defining:h6(u6(r,`defining`,a)),isolating:h6(u6(r,`isolating`,a)),attrs:Object.fromEntries(i.map(e=>[e.name,{default:e?.attribute?.default}]))}),s=h6(u6(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Tct(e,i)));let c=u6(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:m6(e,i)}));let l=u6(r,`renderText`,a);
1250return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Ect({...e.reduce((e,t)=>{let n=u6(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:h6(u6(r,`inclusive`,a)),excludes:h6(u6(r,`excludes`,a)),group:h6(u6(r,`group`,a)),spanning:h6(u6(r,`spanning`,a)),code:h6(u6(r,`code`,a)),attrs:Object.fromEntries(i.map(e=>[e.name,{default:e?.attribute?.default}]))}),s=h6(u6(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Tct(e,i)));let c=u6(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:m6(e,i)})),[r.name,o]}))})}function g6(e,t){return t.nodes[e]||t.marks[e]||null}function Oct(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function _6(e,t){let n=q2.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}var kct=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function v6(e){return Object.prototype.toString.call(e)===`[object RegExp]`}var y6=class{constructor(e){this.find=e.find,this.handler=e.handler}},Act=(e,t)=>{if(v6(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function b6(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=kct(c)+i;return a.forEach(e=>{if(l)return;let a=Act(u,e.find);if(!a)return;let c=s.state.tr,d=c6({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new l6({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function jct(e){let{editor:t,rules:n}=e,r=new k4({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:_6(O2.from(e),a.schema);let{from:i}=s,o=i+e.length;b6({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return b6({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&b6({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?b6({editor:t,from:a.pos,to:a.pos,text:`
1251`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Mct(e){return Object.prototype.toString.call(e).slice(8,-1)}function x6(e){return Mct(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function S6(e,t){let n={...e};return x6(e)&&x6(t)&&Object.keys(t).forEach(r=>{x6(t[r])&&x6(e[r])?n[r]=S6(e[r],t[r]):n[r]=t[r]}),n}var C6=class e{constructor(e={}){this.type=`mark`,this.name=`mark`,this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=h6(u6(this,`addOptions`,{name:this.name}))),this.storage=h6(u6(this,`addStorage`,{name:this.name,options:this.options}))||{}}static create(t={}){return new e(t)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>S6(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(t={}){let n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=h6(u6(n,`addOptions`,{name:n.name})),n.storage=h6(u6(n,`addStorage`,{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}};function Nct(e){return typeof e==`number`}var Pct=class{constructor(e){this.find=e.find,this.handler=e.handler}}
1251,Fct=(e,t,n)=>{if(v6(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Ict(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new l6({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(!e.isTextblock||e.type.spec.code)return;let f=Math.max(r,t),p=Math.min(i,t+e.content.size);Fct(e.textBetween(f-t,p-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=f+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(p)})}),d.every(e=>e!==null)}var w6=null,Lct=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Rct(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=c6({state:e,transaction:c});if(!(!Ict({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new k4({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(w6=t)},i=()=>{w6&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=w6;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:_6(O2.from(t),r.schema);let{from:n}=d,i=n+t.length,a=Lct(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Nct(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}function zct(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}var Bct=class e{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=e.resolve(t),this.schema=Dct(this.extensions,n),this.setupExtensions()}static resolve(t){let n=e.sort(e.flatten(t)),r=zct(n.map(e=>e.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),n}static flatten(e){return e.map(e=>{let t=u6(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e}).flat(10)}static sort(e){return e.sort((e,t)=>{let n=u6(e,`priority`)||100,r=u6(t,`priority`)||100;return n>r?-1:+(n<r)})}get commands(){return this.extensions.reduce((e,t)=>{let n=u6(t,`addCommands`,{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:g6(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:t}=this,n=e.sort([...this.extensions].reverse()),r=[],i=[],a=n.map(e=>{let n={name:e.name,options:e.options,storage:e.storage,editor:t,type:g6(e.name,this.schema)},a=[],o=u6(e,`addKeyboardShortcuts`,n),s={};if(e.type===`mark`&&u6(e,`exitable`,n)&&(s.ArrowRight=()=>C6.handleExit({editor:t,mark:e})),o){let e=Object.fromEntries(Object.entries(o()).map(([e,n])=>[e,()=>n({editor:t})]));s={...s,...e}}let c=Ist(s);a.push(c);let l=u6(e,`addInputRules`,n);Oct(e,t.options.enableInputRules)&&l&&r.push(...l());let u=u6(e,`addPasteRules`,n);Oct(e,t.options.enablePasteRules)&&u&&i.push(...u());let d=u6(e,`addProseMirrorPlugins`,n);if(d){let e=d();a.push(...e)}return a}).flat();return[jct({editor:t,rules:r}),...Rct({editor:t,rules:i}),...a]}get attributes(){return xct(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=d6(this.extensions);return Object.fromEntries(t.filter(e=>!!u6(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=u6(t,`addNodeView`,{name:t.name,options:t.options,storage:t.storage,editor:e,type:f6(t.name,this.schema)});return r?[t.name,(i,a,o,s,c)=>{let l=m6(i,n);return r()({node:i,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}
1251setupExtensions(){this.extensions.forEach(e=>{this.editor.extensionStorage[e.name]=e.storage;let t={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:g6(e.name,this.schema)};e.type===`mark`&&(h6(u6(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=u6(e,`onBeforeCreate`,t),r=u6(e,`onCreate`,t),i=u6(e,`onUpdate`,t),a=u6(e,`onSelectionUpdate`,t),o=u6(e,`onTransaction`,t),s=u6(e,`onFocus`,t),c=u6(e,`onBlur`,t),l=u6(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}},T6=class e{constructor(e={}){this.type=`extension`,this.name=`extension`,this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=h6(u6(this,`addOptions`,{name:this.name}))),this.storage=h6(u6(this,`addStorage`,{name:this.name,options:this.options}))||{}}static create(t={}){return new e(t)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>S6(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(t={}){let n=new e({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=h6(u6(n,`addOptions`,{name:n.name})),n.storage=h6(u6(n,`addStorage`,{name:n.name,options:n.options})),n}};function Vct(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
1252
1253`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function E6(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}var Hct=T6.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new k4({key:new j4(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=E6(n);return Vct(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator}
vendor: 21,662 bytes, line 1253
1253,textSerializers:c})}}})]}}),Uct=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Wct=(e=!1)=>({commands:t})=>t.setContent(``,e),Gct=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=u4(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Kct=e=>t=>e(t),qct=()=>({state:e,dispatch:t})=>Qst(e,t),Jct=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new C4(r.doc.resolve(Math.max(o-1,0)))),!0},Yct=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},Xct=e=>({tr:t,state:n,dispatch:r})=>{let i=f6(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Zct=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Qct=()=>({state:e,dispatch:t})=>e6(e,t),$ct=()=>({commands:e})=>e.keyboardShortcut(`Enter`),elt=()=>({state:e,dispatch:t})=>Zst(e,t);function D6(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:v6(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function tlt(e,t,n={}){return e.find(e=>e.type===t&&D6(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function nlt(e,t,n={}){return!!tlt(e,t,n)}function O6(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t)||(n||=r.node.marks[0]?.attrs,!tlt([...r.node.marks],t,n)))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&nlt([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&nlt([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function k6(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var rlt=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=k6(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=O6(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=C4.create(o,e.from,e.to);n.setSelection(t)}}return!0},ilt=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function A6(e){return e instanceof C4}function j6(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function alt(e,t=null){if(!t)return null;let n=S4.atStart(e),r=S4.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?C4.create(e,j6(0,i,a),j6(e.content.size,i,a)):C4.create(e,j6(t,i,a),j6(t,i,a))}function olt(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function M6(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function slt(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var clt=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(M6()||olt())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),slt()&&!M6()&&!olt()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!A6(n.state.selection))return o(),!0;let s=alt(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},llt=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),ult=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),dlt=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&dlt(r)}return e};function N6(e){let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return dlt(n)}function P6(e,t,n){if(e instanceof V2||e instanceof O2)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return O2.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),P6(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new crt({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?U2.fromSchema(a).parseSlice(N6(e),n.parseOptions):U2.fromSchema(a).parse(N6(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=U2.fromSchema(t);return n.slice?r.parseSlice(N6(e),n.parseOptions).content:r.parse(N6(e),n.parseOptions)}return P6(``,t,n)}function flt(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof o4||i instanceof s4))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(S4.near(e.doc.resolve(o),n))}var plt=e=>!(`type`in e),mlt=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{P6(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=P6(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((plt(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof O2){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else f=i,r.replaceWith(c,l,f);n.updateSelection&&flt(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},hlt=()=>({state:e,dispatch:t})=>qst(e,t),glt=()=>({state:e,dispatch:t})=>Jst(e,t),_lt=()=>({state:e,dispatch:t})=>zst(e,t),vlt=()=>({state:e,dispatch:t})=>Gst(e,t),ylt=()=>({state:e,dispatch:t,tr:n})=>{try{let r=m4(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},blt=()=>({state:e,dispatch:t,tr:n})=>{try{let r=m4(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},xlt=()=>({state:e,dispatch:t})=>Bst(e,t),Slt=()=>({state:e,dispatch:t})=>Vst(e,t);function Clt(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function wlt(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))M6()||Clt()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Tlt=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=wlt(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function F6(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?f6(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>D6(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Elt=(e,t={})=>({state:n,dispatch:r})=>F6(n,f6(e,n.schema),t)?Yst(n,r):!1,Dlt=()=>({state:e,dispatch:t})=>$st(e,t),Olt=e=>({state:t,dispatch:n})=>gct(f6(e,t.schema))(t,n),klt=()=>({state:e,dispatch:t})=>Xst(e,t);function I6(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Alt(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var jlt=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=I6(typeof e==`string`?e:e.name,r.schema);return s?(s===`node`&&(a=f6(e,r.schema)),s===`mark`&&(o=k6(e,r.schema)),i&&n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&n.setNodeMarkup(r,void 0,Alt(e.attrs,t)),o&&e.marks.length&&e.marks.forEach(i=>{o===i.type&&n.addMark(r,r+e.nodeSize,o.create(Alt(i.attrs,t)))})})}),!0):!1},Mlt=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Nlt=()=>({tr:e,dispatch:t})=>{if(t){let t=new T4(e.doc);e.setSelection(t)}return!0},Plt=()=>({state:e,dispatch:t})=>Ust(e,t),Flt=()=>({state:e,dispatch:t})=>Kst(e,t),Ilt=()=>({state:e,dispatch:t})=>nct(e,t),Llt=()=>({state:e,dispatch:t})=>cct(e,t),Rlt=()=>({state:e,dispatch:t})=>sct(e,t);function L6(e,t,n={},r={}){return P6(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var zlt=(e,t=!1,n={},r={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(n.preserveWhitespace!==`full`){let s=L6(e,i.schema,n,{errorOnInvalidContent:r.errorOnInvalidContent??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!t),!0}return o&&a.setMeta(`preventUpdate`,!t),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent??i.options.enableContentCheck})};function Blt(e,t){let n=k6(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function Vlt(e,t){let n=new pit(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Hlt(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Ult(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function Wlt(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function R6(e){return t=>Wlt(t.$from,e)}function Glt(e,t){return Vct(e,{from:0,to:e.content.size},t)}function Klt(e,t){let n=f6(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function qlt(e,t){let n=I6(typeof t==`string`?t:t.name,e.schema);return n===`node`?Klt(e,t):n===`mark`?Blt(e,t):{}}function Jlt(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Ylt(e){let t=Jlt(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Xlt(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Ylt(r)}function z6(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=O6(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function B6(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}function V6(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?k6(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>D6(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize),c=a-n;o+=c,s.push(...e.marks.map(e=>({mark:e,from:n,to:a})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>D6(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Zlt(e,t,n={}){if(!t)return F6(e,null,n)||V6(e,null,n);let r=I6(t,e.schema);return r===`node`?F6(e,t,n):r===`mark`?V6(e,t,n):!1}function Qlt(e,t){let{nodeExtensions:n}=d6(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=h6(u6(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function H6(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return/^\s*$/m.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(H6(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function $lt(e){return e instanceof w4}function eut(e,t,n){let r=e.state.doc.content.size,i=j6(t,0,r),a=j6(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function tut(e,t,n){let{selection:r}=t,i=null;if(A6(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return!!n.isInSet(t)||!t.some(e=>e.type.excludes(n))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var nut=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=k6(e,r.schema);if(i)if(o){let e=Blt(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return tut(r,n,c)},rut=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),iut=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=f6(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>uct(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>uct(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},aut=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=j6(e,0,n.content.size),i=w4.create(n,r);t.setSelection(i)}return!0},out=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=C4.atStart(n).from,o=C4.atEnd(n).to,s=j6(r,a,o),c=j6(i,a,o),l=C4.create(n,s,c);t.setSelection(l)}return!0},sut=e=>({state:t,dispatch:n})=>yct(f6(e,t.schema))(t,n);function cut(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var lut=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=B6(l,s.node().type.name,s.node().attrs);if(a instanceof w4&&a.node.isBlock)return!s.parentOffset||!f4(o,s.pos)?!1:(r&&(e&&cut(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Hlt(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=f4(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&f4(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof C4&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&cut(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},uut=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=f6(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=O2.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=O2.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...B6(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(O2.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new P2(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(C4.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...B6(d,u.type.name,u.attrs),...t},m={...B6(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!f4(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},U6=(e,t)=>{let n=R6(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&p4(e.doc,n.pos)&&e.join(n.pos),!0},W6=(e,t)=>{let n=R6(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&p4(e.doc,r)&&e.join(r),!0},dut=Object.freeze({__proto__:null,blur:Uct,clearContent:Wct,clearNodes:Gct,command:Kct,createParagraphNear:qct,cut:Jct,deleteCurrentNode:Yct,deleteNode:Xct,deleteRange:Zct,deleteSelection:Qct,enter:$ct,exitCode:elt,extendMarkRange:rlt,first:ilt,focus:clt,forEach:llt,insertContent:ult,insertContentAt:mlt,joinBackward:_lt,joinDown:glt,joinForward:vlt,joinItemBackward:ylt,joinItemForward:blt,joinTextblockBackward:xlt,joinTextblockForward:Slt,joinUp:hlt,keyboardShortcut:Tlt,lift:Elt,liftEmptyBlock:Dlt,liftListItem:Olt,newlineInCode:klt,resetAttributes:jlt,scrollIntoView:Mlt,selectAll:Nlt,selectNodeBackward:Plt,selectNodeForward:Flt,selectParentNode:Ilt,selectTextblockEnd:Llt,selectTextblockStart:Rlt,setContent:zlt,setMark:nut,setMeta:rut,setNode:iut,setNodeSelection:aut,setTextSelection:out,sinkListItem:sut,splitBlock:lut,splitListItem:uut,toggleList:(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=f6(e,o.schema),m=f6(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=R6(e=>Qlt(e.type.name,d))(h);if(y.depth>=1&&x&&y.depth-x.depth<=1){if(x.node.type===p)return l.liftListItem(m);if(Qlt(x.node.type.name,d)&&p.validContent(x.node.content)&&s)return c().command(()=>(a.setNodeMarkup(x.pos,p),!0)).command(()=>U6(a,p)).command(()=>W6(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>U6(a,p)).command(()=>W6(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>
1253f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>U6(a,p)).command(()=>W6(a,p)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=k6(e,r.schema);return V6(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{let a=f6(e,r.schema),o=f6(t,r.schema),s=F6(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},toggleWrap:(e,t={})=>({state:n,commands:r})=>{let i=f6(e,n.schema);return F6(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=k6(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=O6(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=I6(typeof e==`string`?e:e.name,r.schema);
1253return s?(s===`node`&&(a=f6(e,r.schema)),s===`mark`&&(o=k6(e,r.schema)),i&&n.selection.ranges.forEach(e=>{let i=e.$from.pos,s=e.$to.pos,c,l,u,d;n.selection.empty?r.doc.nodesBetween(i,s,(e,t)=>{a&&a===e.type&&(u=Math.max(t,i),d=Math.min(t+e.nodeSize,s),c=t,l=e)}):r.doc.nodesBetween(i,s,(e,r)=>{r<i&&a&&a===e.type&&(u=Math.max(r,i),d=Math.min(r+e.nodeSize,s),c=r,l=e),r>=i&&r<=s&&(a&&a===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type){let c=Math.max(r,i),l=Math.min(r+e.nodeSize,s);n.addMark(c,l,o.create({...a.attrs,...t}))}}))}),l&&(c!==void 0&&n.setNodeMarkup(c,void 0,{...l.attrs,...t}),o&&l.marks.length&&l.marks.forEach(e=>{o===e.type&&n.addMark(u,d,o.create({...e.attrs,...t}))}))}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:r})=>lct(f6(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>pct(f6(e,n.schema),t)(n,r)}),fut=T6.create({name:`commands`,addCommands(){return{...dut}}}),put=T6.create({name:`drop`,addProseMirrorPlugins(){return[new k4({key:new j4(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),mut=T6.create({name:`editable`,addProseMirrorPlugins(){return[new k4({key:new j4(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),hut=new j4(`focusEvents`),gut=T6.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new k4({key:hut,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),_ut=T6.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:S4.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return M6()||Clt()?i:r},addProseMirrorPlugins(){return[new k4({key:new j4(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=S4.atStart(t.doc).from,l=S4.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!H6(n.doc))return;let u=n.tr,d=c6({state:n,transaction:u}),{commands:f}=new l6({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),vut=T6.create({name:`paste`,addProseMirrorPlugins(){return[new k4({key:new j4(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),yut=T6.create({name:`tabindex`,addProseMirrorPlugins(){return[new k4({key:new j4(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),but=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}
1253get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=this.pos+r+ +!a;if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;let s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;let c=new e(s,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),t.push(new e(s,this.editor,i,i?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},xut=`.ProseMirror {
1254  position: relative;
1255}
1256
1257.ProseMirror {
1258  word-wrap: break-word;
1259  white-space: pre-wrap;
1260  white-space: break-spaces;
1261  -webkit-font-variant-ligatures: none;
1262  font-variant-ligatures: none;
1263  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
1264}
1265
1266.ProseMirror [contenteditable="false"] {
1267  white-space: normal;
1268}
1269
1270.ProseMirror [contenteditable="false"] [contenteditable="true"] {
1271  white-space: pre-wrap;
1272}
1273
1274.ProseMirror pre {
1275  white-space: pre-wrap;
1276}
1277
1278img.ProseMirror-separator {
1279  display: inline !important;
1280  border: none !important;
1281  margin: 0 !important;
1282  width: 0 !important;
1283  height: 0 !important;
1284}
1285
1286.ProseMirror-gapcursor {
1287  display: none;
1288  pointer-events: none;
1289  position: absolute;
1290  margin: 0;
1291}
1292
1293.ProseMirror-gapcursor:after {
1294  content: "";
1295  display: block;
1296  position: absolute;
1297  top: -2px;
1298  width: 20px;
1299  border-top: 1px solid black;
1300  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
1301}
1302
1303@keyframes ProseMirror-cursor-blink {
1304  to {
1305    visibility: hidden;
1306  }
1307}
1308
1309.ProseMirror-hideselection *::selection {
1310  background: transparent;
1311}
1312
1313.ProseMirror-hideselection *::-moz-selection {
1314  background: transparent;
1315}
1316
1317.ProseMirror-hideselection * {
1318  caret-color: transparent;
1319}
1320
1321.ProseMirror-focused .ProseMirror-gapcursor {
1322  display: block;
1323}
1324
1325.tippy-box[data-animation=fade][data-state=hidden] {
1326  opacity: 0
1327}`;function Sut(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var Cut=class extends bct{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement(`div`),content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit
1327(`beforeCreate`,{editor:this}),this.on(`contentError`,this.options.onContentError),this.createView(),this.injectCSS(),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Sut(xut,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){let n=Sct(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let e=[...this.options.enableCoreExtensions?[mut,Hct.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),fut,gut,_ut,yut,put,vut].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new Bct(e,this)}createCommandManager(){this.commandManager=new l6({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=L6(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=L6(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let t=alt(e,this.options.autofocus);this.view=new wst(this.options.element,{...this.options.editorProps,attributes:{role:`textbox`,...this.options.editorProps?.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Dit.create({doc:e,selection:t||void 0})});let n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass();let r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let t=this.state.apply(e),n=!this.state.selection.eq(t.selection);
1327this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e}),n&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let r=e.getMeta(`focus`),i=e.getMeta(`blur`);r&&this.emit(`focus`,{editor:this,event:r.event,transaction:e}),i&&this.emit(`blur`,{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta(`preventUpdate`))&&this.emit(`update`,{editor:this,transaction:e})}getAttributes(e){return qlt(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Zlt(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return _6(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
1328
1329`,textSerializers:n={}}=e||{};return Glt(this.state.doc,{blockSeparator:t,textSerializers:{...E6(this.schema),...n}})}get isEmpty(){return H6(this.state.doc)}getCharacterCount(){return console.warn(`[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.`),this.state.doc.content.size-2}destroy(){if(this.emit(`destroy`),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){return!this.view?.docView}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new but(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function G6(e){return new y6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=h6(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(z6(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}}})}function wut(e){return new y6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=h6(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()}})}function K6(e){return new y6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=h6(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)}})}function q6(e){return new y6({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=h6(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&d4(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&p4(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}var J6=class e{constructor(e={}){this.type=`node`,this.name=`node`,this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=h6(u6(this,`addOptions`,{name:this.name}))),this.storage=h6(u6(this,`addStorage`,{name:this.name,options:this.options}))||{}}static create(t={}){return new e(t)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>S6(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(t={}){let n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=h6(u6(n,`addOptions`,{name:n.name})),n.storage=h6(u6(n,`addStorage`,{name:n.name,options:n.options})),n}};function Y6(e){return new Pct({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=h6(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let r=c.search(/\S/),i=n.from+c.indexOf(s),u=i+s.length;if(z6(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;u<n.to&&o.delete(u,n.to),i>
1329n.from&&o.delete(n.from+r,i),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(a||{})),o.removeStoredMark(e.type)}}})}function Tut(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof w4){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}var Eut=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Dut=J6.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,p6(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[wut({find:Eut,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Out=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
1329ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,kut=`ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
1329ºÐ´2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3Õ°Õ¡Õµ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1ì»´2삼성2한국2`,X6=`numeric`,Z6=`ascii`,Q6=`alpha`,$6=`asciinumeric`,e8=`alphanumeric`,t8=`domain`,Aut=`emoji`,jut=`scheme`,Mut=`slashscheme`,n8=`whitespace`;function Nut(e,t){return e in t||(t[e]=[]),t[e]}function r8(e,t,n){t[X6]&&(t[$6]=!0,t[e8]=!0),t[Z6]&&(t[$6]=!0,t[Q6]=!0),t[$6]&&(t[e8]=!0),t[Q6]&&(t[e8]=!0),t[e8]&&(t[t8]=!0),t[Aut]&&(t[t8]=!0);for(let r in t){let t=Nut(r,n);t.indexOf(e)<0&&t.push(e)}}function Put(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function i8(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}i8.groups={},i8.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=i8.groups;let i;return t&&t.j?i=t:(i=new i8(t),n&&r&&r8(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=i8.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new i8,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new i8,a&&(r&&(o.t&&typeof o.t==`string`?r8(a,Object.assign(Put(o.t,r),n),r):n&&r8(a,n,r)),o.t=a),i.j[e]=o,o}};var a8=(e,t,n,r,i)=>e.ta(t,n,r,i),o8=(e,t,n,r,i)=>e.tr(t,n,r,i),Fut=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),s8=`WORD`,c8=`UWORD`,Iut=`ASCIINUMERICAL`,Lut=`ALPHANUMERICAL`,l8=`LOCALHOST`,u8=`TLD`,d8=`UTLD`,f8=`SCHEME`,p8=`SLASH_SCHEME`,m8=`NUM`,h8=`WS`,g8=`NL`,_8=`OPENBRACE`,v8=`CLOSEBRACE`,y8=`OPENBRACKET`,b8=`CLOSEBRACKET`,x8=`OPENPAREN`,S8=`CLOSEPAREN`,C8=`OPENANGLEBRACKET`,w8=`CLOSEANGLEBRACKET`,T8=`FULLWIDTHLEFTPAREN`,E8=`FULLWIDTHRIGHTPAREN`,D8=`LEFTCORNERBRACKET`,O8=`RIGHTCORNERBRACKET`,k8=`LEFTWHITECORNERBRACKET`,A8=`RIGHTWHITECORNERBRACKET`,j8=`FULLWIDTHLESSTHAN`,M8=`FULLWIDTHGREATERTHAN`,N8=`AMPERSAND`,P8=`APOSTROPHE`,F8=`ASTERISK`,I8=`AT`,L8=`BACKSLASH`,R8=`BACKTICK`,z8=`CARET`,B8=`COLON`,V8=`COMMA`,H8=`DOLLAR`,U8=`DOT`,W8=`EQUALS`,G8=`EXCLAMATION`,K8=`HYPHEN`,q8=`PERCENT`,J8=`PIPE`,Y8=`PLUS`,X8=`POUND`,Z8=`QUERY`,Q8=`QUOTE`,Rut=`FULLWIDTHMIDDLEDOT`,$8=`SEMI`,e5=`SLASH`,t5=`TILDE`,n5=`UNDERSCORE`,zut=`EMOJI`,r5=`SYM`,But=Object.freeze({__proto__:null,ALPHANUMERICAL:Lut,AMPERSAND:N8,APOSTROPHE:P8,ASCIINUMERICAL:Iut,ASTERISK:F8,AT:I8,BACKSLASH:L8,BACKTICK:R8,CARET:z8,CLOSEANGLEBRACKET:w8,CLOSEBRACE:v8,CLOSEBRACKET:b8,CLOSEPAREN:S8,COLON:B8,COMMA:V8,DOLLAR:H8,DOT:U8,EMOJI:zut,EQUALS:W8,EXCLAMATION:G8,FULLWIDTHGREATERTHAN:M8,FULLWIDTHLEFTPAREN:T8,FULLWIDTHLESSTHAN:j8,FULLWIDTHMIDDLEDOT:Rut,FULLWIDTHRIGHTPAREN:E8,HYPHEN:K8,LEFTCORNERBRACKET:D8,LEFTWHITECORNERBRACKET:k8,LOCALHOST:l8,NL:g8,NUM:m8,OPENANGLEBRACKET:C8,OPENBRACE:_8,OPENBRACKET:y8,OPENPAREN:x8,PERCENT:q8,PIPE:J8,PLUS:Y8,POUND:X8,QUERY:Z8,QUOTE:Q8,RIGHTCORNERBRACKET:O8,RIGHTWHITECORNERBRACKET:A8,SCHEME:f8,SEMI:$8,SLASH:e5,SLASH_SCHEME:p8,SYM:r5,TILDE:t5,TLD:u8,UNDERSCORE:n5,UTLD:d8,UWORD:c8,WORD:s8,WS:h8}),i5=/[a-z]/,a5=/\p{L}/u,o5=/\p{Emoji}/u,s5=/\d/,c5=/\s/,Vut=`\r`,l5=`
1330`,Hut=`️`,Uut=`‍`,u5=``,d5=null,f5=null;function Wut(e=[]){let t={};i8.groups=t;let n=new i8;d5??=qut(Out),f5??=qut(kut),$(n,`'`,P8),$(n,`{`,_8),$(n,`}`,v8),$(n,`[`,y8),$(n,`]`,b8),$(n,`(`,x8),$(n,`)`,S8),$(n,`<`,C8),$(n,`>`,w8),$(n,`(`,T8),$(n,`)`,E8),$(n,`「`,D8),$(n,`」`,O8),$(n,`『`,k8),$(n,`』`,A8),$(n,`<`,j8),$(n,`>`,M8),$(n,`&`,N8),$(n,`*`,F8),$(n,`@`,I8),$(n,"`",R8),$(n,`^`,z8),$(n,`:`,B8),$(n,`,`,V8),$(n,`$`,H8),$(n,`.`,U8),$(n,`=`,W8),$(n,`!`,G8),$(n,`-`,K8),$(n,`%`,q8),$(n,`|`,J8),$(n,`+`,Y8),$(n,`#`,X8),$(n,`?`,Z8),$(n,`"`,Q8),$(n,`/`,e5),$(n,`;`,$8),$(n,`~`,t5),$(n,`_`,n5),$(n,`\\`,L8),$(n,`・`,Rut);let r=o8(n,s5,m8,{[X6]:!0});o8(r,s5,r);let i=o8(r,i5,Iut,{[$6]:!0}),a=o8(r,a5,Lut,{[e8]:!0}),o=o8(n,i5,s8,{[Z6]:!0});o8(o,s5,i),o8(o,i5,o),o8(i,s5,i),o8(i,i5,i);let s=o8(n,a5,c8,{[Q6]:!0});o8(s,i5),o8(s,s5,a),o8(s,a5,s),o8(a,s5,a),o8(a,i5),o8(a,a5,a);let c=$(n,l5,g8,{[n8]:!0}),l=$(n,Vut,h8,{[n8]:!0}),u=o8(n,c5,h8,{[n8]:!0});$(n,u5,u),$(l,l5,c),$(l,u5,u),o8(l,c5,u),$(u,Vut),$(u,l5),o8(u,c5,u),$(u,u5,u);let d=o8(n,o5,zut,{[Aut]:!0});$(d,`#`),o8(d,o5,d),$(d,Hut,d);let f=$(d,Uut);$(f,`#`),o8(f,o5,d);let p=[[i5,o],[s5,i]],m=[[i5,null],[a5,s],[s5,a]];for(let e=0;e<d5.length;e++)p5(n,d5[e],u8,s8,p);for(let e=0;e<f5.length;e++)p5(n,f5[e],d8,c8,m);r8(u8,{tld:!0,ascii:!0},t),r8(d8,{utld:!0,alpha:!0},t),p5(n,`file`,f8,s8,p),p5(n,`mailto`,f8,s8,p),p5(n,`http`,p8,s8,p),p5(n,`https`,p8,s8,p),p5(n,`ftp`,p8,s8,p),p5(n,`ftps`,p8,s8,p),r8(f8,{scheme:!0,ascii:!0},t),r8(p8,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>
vendor: 8,195 bytes, lines 1330-1333
1330e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[jut]:!0}:{[Mut]:!0};r.indexOf(`-`)>=0?i[t8]=!0:i5.test(r)?s5.test(r)?i[$6]=!0:i[Z6]=!0:i[X6]=!0,Fut(n,r,r,i)}return Fut(n,`localhost`,l8,{ascii:!0}),n.jd=new i8(r5),{start:n,tokens:Object.assign({groups:t},But)}}function Gut(e,t){let n=Kut(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function Kut(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function p5(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new i8(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new i8(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function qut(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var m5={defaultProtocol:`http`,events:null,format:Jut,formatHref:Jut,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function h5(e,t=null){let n=Object.assign({},m5);e&&(n=Object.assign(n,e instanceof h5?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}h5.prototype={o:m5,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:m5[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function Jut(e){return e}function Yut(e,t){this.t=`token`,this.v=e,this.tk=t}Yut.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=m5.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function g5(e,t){class n extends Yut{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var Xut=g5(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),Zut=g5(`text`),Qut=g5(`nl`),_5=g5(`url`,{isLink:!0,toHref(e=m5.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==l8&&e[1].t===B8}}),v5=e=>new i8(e);function $ut({groups:e}){let t=e.domain.concat([N8,F8,I8,L8,R8,z8,H8,W8,K8,m8,q8,J8,Y8,X8,e5,r5,t5,n5]),n=[P8,B8,V8,U8,G8,q8,Z8,Q8,$8,C8,w8,_8,v8,b8,y8,x8,S8,T8,E8,D8,O8,k8,A8,j8,M8],r=[N8,P8,F8,L8,R8,z8,H8,W8,K8,_8,v8,q8,J8,Y8,X8,Z8,e5,r5,t5,n5],i=v5(),a=$(i,t5);a8(a,r,a),a8(a,e.domain,a);let o=v5(),s=v5(),c=v5();a8(i,e.domain,o),a8(i,e.scheme,s),a8(i,e.slashscheme,c),a8(o,r,a),a8(o,e.domain,o);let l=$(o,I8);$(a,I8,l),$(s,I8,l),$(c,I8,l);let u=$(a,U8);a8(u,r,a),a8(u,e.domain,a);let d=v5();a8(l,e.domain,d),a8(d,e.domain,d);let f=$(d,U8);a8(f,e.domain,d);let p=v5(Xut);a8(f,e.tld,p),a8(f,e.utld,p),$(l,l8,p);let m=$(d,K8);$(m,K8,m),a8(m,e.domain,d),a8(p,e.domain,d),$(p,U8,f),$(p,K8,m),a8($(p,B8),e.numeric,Xut);let h=$(o,K8),g=$(o,U8);$(h,K8,h),a8(h,e.domain,o),a8(g,r,a),a8(g,e.domain,o);let _=v5(_5);a8(g,e.tld,_),a8(g,e.utld,_),a8(_,e.domain,o),a8(_,r,a),$(_,U8,g),$(_,K8,h),$(_,I8,l);let v=$(_,B8),y=v5(_5);a8(v,e.numeric,y);let b=v5(_5),x=v5();a8(b,t,b),a8(b,n,x),a8(x,t,b),a8(x,n,x),$(_,e5,b),$(y,e5,b);let S=$(s,B8),C=$($($(c,B8),e5),e5);a8(s,e.domain,o),$(s,U8,g),$(s,K8,h),a8(c,e.domain,o),$(c,U8,g),$(c,K8,h),a8(S,e.domain,b),$(S,e5,b),$(S,Z8,b),a8(C,e.domain,b),a8(C,t,b),$(C,e5,b);let w=[[_8,v8],[y8,b8],[x8,S8],[C8,w8],[T8,E8],[D8,O8],[k8,A8],[j8,M8]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=$(b,r);$(x,r,a),$(a,i,b);let o=v5(_5);a8(a,t,o);let s=v5();a8(a,n),a8(o,t,o),a8(o,n,s),a8(s,t,o),a8(s,n,s),$(o,i,b),$(s,i,b)}return $(i,l8,_),$(i,g8,Qut),{start:i,tokens:But}}function edt(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(y5(Zut,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(y5(e,t,r))}}return o.length>0&&a.push(y5(Zut,t,o)),a}function y5(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var tdt=typeof console<`u`&&console&&console.warn||(()=>{}),ndt=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,b5={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function rdt(){return i8.groups={},b5.scanner=null,b5.parser=null,b5.tokenQueue=[],b5.pluginQueue=[],b5.customSchemes=[],b5.initialized=!1,b5}function idt(e,t=!1){if(b5.initialized&&tdt(`linkifyjs: already initialized - will not register custom scheme "${e}" ${ndt}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
13311. Must only contain digits, lowercase ASCII letters or "-"
13322. Cannot start or end with "-"
13333. "-" cannot repeat`);b5.customSchemes.push([e,t])}function adt(){b5.scanner=Wut(b5.customSchemes);for(let e=0;e<b5.tokenQueue.length;e++)b5.tokenQueue[e][1]({scanner:b5.scanner});b5.parser=$ut(b5.scanner.tokens);for(let e=0;e<b5.pluginQueue.length;e++)b5.pluginQueue[e][1]({scanner:b5.scanner,parser:b5.parser});return b5.initialized=!0,b5}function x5(e){return b5.initialized||adt(),edt(b5.parser.start,e,Gut(b5.scanner.start,e))}x5.scan=Gut;function odt(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new h5(n),i=x5(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var S5=`[\0- \xA0 ᠎ -\u2029  ]`,sdt=new RegExp(S5),cdt=RegExp(`${S5}$`),ldt=new RegExp(S5,`g`);function udt(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function ddt(e){return new k4({key:new j4(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Xlt(Vlt(n.doc,[...t])).forEach(({newRange:t})=>{let n=Ult(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!cdt.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(sdt).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=x5(n).map(t=>t.toObject(e.defaultProtocol));if(!udt(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>
1333r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{z6(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function fdt(e){return new k4({key:new j4(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=r.target,a=[];for(;i.nodeName!==`DIV`;)a.push(i),i=i.parentNode;if(!a.find(e=>e.nodeName===`A`))return!1;let o=qlt(t.state,e.type.name),s=r.target,c=s?.href??o.href,l=s?.target??o.target;return s&&c?(window.open(c,l),!0):!1}}})}function pdt(e){return new k4({key:new j4(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{state:i}=t,{selection:a}=i,{empty:o}=a;if(o)return!1;let s=``;r.content.forEach(e=>{s+=e.textContent});let c=odt(s,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===s);return!s||!c?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function C5(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(ldt,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.\-]+(?:[^a-z+.\-:]|$))`,`i`))}var mdt=C6.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){idt(e);return}idt(e.scheme,e.optionalSlashes)})},onDestroy(){rdt()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!C5(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!C5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!C5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,p6(this.options.HTMLAttributes,e),0]:[`a`,p6(this.options.HTMLAttributes,{...e,href:``}),0]},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!C5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!C5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[Y6({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=odt(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!C5(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>t.push({text:e.value,data:{href:e.href},index:e.start}))}return t}
vendor: 6,544 bytes, line 1333
1333,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(ddt({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!C5(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(fdt({type:this.type})),this.options.linkOnPaste&&e.push(pdt({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),w5=`bottom`,T5=`right`,E5=`left`,hdt=`auto`,D5=[`top`,w5,T5,E5],O5=`start`,gdt=`clippingParents`,_dt=`viewport`,vdt=`popper`,ydt=`reference`,bdt=D5.reduce(function(e,t){return e.concat([t+`-`+O5,t+`-end`])},[]),xdt=[].concat(D5,[hdt]).reduce(function(e,t){return e.concat([t,t+`-`+O5,t+`-end`])},[]),Sdt=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function k5(e){return e?(e.nodeName||``).toLowerCase():null}function A5(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function j5(e){return e instanceof A5(e).Element||e instanceof Element}function M5(e){return e instanceof A5(e).HTMLElement||e instanceof HTMLElement}function N5(e){return typeof ShadowRoot>`u`?!1:e instanceof A5(e).ShadowRoot||e instanceof ShadowRoot}function Cdt(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!M5(i)||!k5(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function wdt(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(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!M5(r)||!k5(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var Tdt={name:`applyStyles`,enabled:!0,phase:`write`,fn:Cdt,effect:wdt,requires:[`computeStyles`]};function P5(e){return e.split(`-`)[0]}var F5=Math.max,I5=Math.min,L5=Math.round;function R5(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function Edt(){return!/^((?!chrome|android).)*safari/i.test(R5())}function z5(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&M5(e)&&(i=e.offsetWidth>0&&L5(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&L5(r.height)/e.offsetHeight||1);var o=(j5(e)?A5(e):window).visualViewport,s=!Edt()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function B5(e){var t=z5(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 Ddt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&N5(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function V5(e){return A5(e).getComputedStyle(e)}function Odt(e){return[`table`,`td`,`th`].indexOf(k5(e))>=0}function H5(e){return((j5(e)?e.ownerDocument:e.document)||window.document).documentElement}function U5(e){return k5(e)===`html`?e:e.assignedSlot||e.parentNode||(N5(e)?e.host:null)||H5(e)}function kdt(e){return!M5(e)||V5(e).position===`fixed`?null:e.offsetParent}function Adt(e){var t=/firefox/i.test(R5());if(/Trident/i.test(R5())&&M5(e)&&V5(e).position===`fixed`)return null;var n=U5(e);for(N5(n)&&(n=n.host);M5(n)&&[`html`,`body`].indexOf(k5(n))<0;){var r=V5(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function W5(e){for(var t=A5(e),n=kdt(e);n&&Odt(n)&&V5(n).position===`static`;)n=kdt(n);return n&&(k5(n)===`html`||k5(n)===`body`&&V5(n).position===`static`)?t:n||Adt(e)||t}function G5(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function K5(e,t,n){return F5(e,I5(t,n))}function jdt(e,t,n){var r=K5(e,t,n);return r>n?n:r}function Mdt(){return{top:0,right:0,bottom:0,left:0}}function Ndt(e){return Object.assign({},Mdt(),e)}function Pdt(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var Fdt=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,Ndt(typeof e==`number`?Pdt(e,D5):e)};function Idt(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=P5(n.placement),c=G5(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=Fdt(i.padding,n),d=B5(a),f=c===`y`?`top`:E5,p=c===`y`?w5:T5,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=W5(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=K5(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function Ldt(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||Ddt(t.elements.popper,r)&&(t.elements.arrow=r))}var Rdt={name:`arrow`,enabled:!0,phase:`main`,fn:Idt,effect:Ldt,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function q5(e){return e.split(`-`)[1]}var zdt={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function Bdt(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:L5(n*i)/i||0,y:L5(r*i)/i||0}}function Vdt(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=E5,b=`top`,x=window;if(l){var S=W5(n),C=`clientHeight`,w=`clientWidth`;if(S===A5(n)&&(S=H5(n),V5(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=w5;
vendor: 28,345 bytes, line 1333
1333var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=T5;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&zdt),O=u===!0?Bdt({x:p,y:h},A5(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function Hdt(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,c=s===void 0?!0:s,l={placement:P5(t.placement),variation:q5(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,Vdt(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Vdt(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Udt={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:Hdt,data:{}},J5={passive:!0};function Wdt(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,c=A5(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,J5)}),s&&c.addEventListener(`resize`,n.update,J5),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,J5)}),s&&c.removeEventListener(`resize`,n.update,J5)}}var Gdt={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:Wdt,data:{}},Kdt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Y5(e){return e.replace(/left|right|bottom|top/g,function(e){return Kdt[e]})}var qdt={start:`end`,end:`start`};function Jdt(e){return e.replace(/start|end/g,function(e){return qdt[e]})}function X5(e){var t=A5(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Z5(e){return z5(H5(e)).left+X5(e).scrollLeft}function Ydt(e,t){var n=A5(e),r=H5(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=Edt();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+Z5(e),y:c}}function Xdt(e){var t=H5(e),n=X5(e),r=e.ownerDocument?.body,i=F5(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=F5(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+Z5(e),s=-n.scrollTop;return V5(r||t).direction===`rtl`&&(o+=F5(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function Q5(e){var t=V5(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Zdt(e){return[`html`,`body`,`#document`].indexOf(k5(e))>=0?e.ownerDocument.body:M5(e)&&Q5(e)?e:Zdt(U5(e))}function $5(e,t){t===void 0&&(t=[]);var n=Zdt(e),r=n===e.ownerDocument?.body,i=A5(n),a=r?[i].concat(i.visualViewport||[],Q5(n)?n:[]):n,o=t.concat(a);return r?o:o.concat($5(U5(a)))}function e7(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Qdt(e,t){var n=z5(e,!1,t===`fixed`);return n.top+=e.clientTop,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 $dt(e,t,n){return t===`viewport`?e7(Ydt(e,n)):j5(t)?Qdt(t,n):e7(Xdt(H5(e)))}function eft(e){var t=$5(U5(e)),n=[`absolute`,`fixed`].indexOf(V5(e).position)>=0&&M5(e)?W5(e):e;return j5(n)?t.filter(function(e){return j5(e)&&Ddt(e,n)&&k5(e)!==`body`}):[]}function tft(e,t,n,r){var i=t===`clippingParents`?eft(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=$dt(e,n,r);return t.top=F5(i.top,t.top),t.right=I5(i.right,t.right),t.bottom=I5(i.bottom,t.bottom),t.left=F5(i.left,t.left),t},$dt(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function nft(e){var t=e.reference,n=e.element,r=e.placement,i=r?P5(r):null,a=r?q5(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case w5:c={x:o,y:t.y+t.height};break;case T5:c={x:t.x+t.width,y:s};break;case E5:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?G5(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case O5:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2);break;default:}}return c}function t7(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?gdt:s,l=n.rootBoundary,u=l===void 0?_dt:l,d=n.elementContext,f=d===void 0?vdt:d,p=n.altBoundary,m=p===void 0?!1:p,h=n.padding,g=h===void 0?0:h,_=Ndt(typeof g==`number`?Pdt(g,D5):g),v=f===`popper`?ydt:vdt,y=e.rects.popper,b=e.elements[m?v:f],x=tft(j5(b)?b:b.contextElement||H5(e.elements.popper),c,u,o),S=z5(e.elements.reference),C=nft({reference:S,element:y,strategy:`absolute`,placement:i}),w=e7(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function rft(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?xdt:c,u=q5(r),d=u?s?bdt:bdt.filter(function(e){return q5(e)===u}):D5,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=t7(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[P5(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function ift(e){if(P5(e)===`auto`)return[];var t=Y5(e);return[Jdt(e),t,Jdt(t)]}function aft(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,h=n.allowedAutoPlacements,g=t.options.placement,_=P5(g)===g,v=c||(_||!m?[Y5(g)]:ift(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(P5(n)===`auto`?rft(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=P5(E),O=q5(E)===O5,k=[`top`,w5].indexOf(D)>=0,A=k?`width`:`height`,j=t7(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?T5:E5:O?w5:`top`;b[A]>x[A]&&(M=Y5(M));var N=Y5(M),P=[];if(a&&P.push(j[D]<=0),s&&P.push(j[M]<=0,j[N]<=0),P.every(function(e){return e})){w=E,C=!1;break}S.set(E,P)}if(C)for(var F=m?3:1,I=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},L=F;L>0&&I(L)!==`break`;L--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var oft={name:`flip`,enabled:!0,phase:`main`,fn:aft,requiresIfExists:[`offset`],data:{_skip:!1}};function sft(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 cft(e){return[`top`,T5,w5,E5].some(function(t){return e[t]>=0})}function lft(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=t7(t,{elementContext:`reference`}),s=t7(t,{altBoundary:!0}),c=sft(o,r),l=sft(s,i,a),u=cft(c),d=cft(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var uft={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:lft};function dft(e,t,n){var r=P5(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function fft(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=xdt.reduce(function(e,n){return e[n]=dft(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var pft={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:fft};function mft(e){var t=e.state,n=e.name;t.modifiersData[n]=nft({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var hft={name:`popperOffsets`,enabled:!0,phase:`read`,fn:mft,data:{}};function gft(e){return e===`x`?`y`:`x`}function _ft(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,m=n.tetherOffset,h=m===void 0?0:m,g=t7(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=P5(t.placement),v=q5(t.placement),y=!v,b=G5(_),x=gft(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:E5,A=b===`y`?w5:T5,j=b===`y`?`height`:`width`,M=S[b],N=M+g[k],P=M-g[A],F=p?-w[j]/2:0,I=v===`start`?C[j]:w[j],L=v===`start`?-w[j]:-C[j],R=t.elements.arrow,ee=p&&R?B5(R):{width:0,height:0},z=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:Mdt(),te=z[k],ne=z[A],re=K5(0,C[j],ee[j]),ie=y?C[j]/2-F-re-te-E.mainAxis:I-re-te-E.mainAxis,ae=y?-C[j]/2+F+re+ne+E.mainAxis:L+re+ne+E.mainAxis,oe=t.elements.arrow&&W5(t.elements.arrow),se=oe?b===`y`?oe.clientTop||0:oe.clientLeft||0:0,ce=D?.[b]??0,le=M+ie-ce-se,ue=M+ae-ce,de=K5(p?I5(N,le):N,M,p?F5(P,ue):P);S[b]=de,O[b]=de-M}if(s){var fe=b===`x`?`top`:E5,pe=b===`x`?w5:T5,me=S[x],he=x===`y`?`height`:`width`,ge=me+g[fe],_e=me-g[pe],ve=[`top`,E5].indexOf(_)!==-1,ye=D?.[x]??0,be=ve?ge:me-C[he]-w[he]-ye+E.altAxis,xe=ve?me+C[he]+w[he]-ye-E.altAxis:_e,Se=p&&ve?jdt(be,me,xe):K5(p?be:ge,me,p?xe:_e);S[x]=Se,O[x]=Se-me}t.modifiersData[r]=O}}var vft={name:`preventOverflow`,enabled:!0,phase:`main`,fn:_ft,requiresIfExists:[`offset`]};function yft(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function bft(e){return e===A5(e)||!M5(e)?X5(e):yft(e)}function xft(e){var t=e.getBoundingClientRect(),n=L5(t.width)/e.offsetWidth||1,r=L5(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Sft(e,t,n){n===void 0&&(n=!1);var r=M5(t),i=M5(t)&&xft(t),a=H5(t),o=z5(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((k5(t)!==`body`||Q5(a))&&(s=bft(t)),M5(t)?(c=z5(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Z5(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function Cft(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function wft(e){var t=Cft(e);return Sdt.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function Tft(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function Eft(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var Dft={placement:`bottom`,modifiers:[],strategy:`absolute`};function Oft(){return![...arguments].some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function kft(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Dft:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},Dft,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:j5(e)?$5(e):e.contextElement?$5(e.contextElement):[],popper:$5(t)};var s=wft(Eft([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(Oft(t,n)){i.rects={reference:Sft(t,W5(n),i.options.strategy===`fixed`),popper:B5(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:Tft(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!Oft(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var Aft=kft({defaultModifiers:[Gdt,hft,Udt,Tdt,pft,oft,vft,Rdt,uft]}),jft=`tippy-box`,Mft=`tippy-content`,Nft=`tippy-backdrop`,Pft=`tippy-arrow`,Fft=`tippy-svg-arrow`,n7={passive:!0,capture:!0},Ift=function(){return document.body};function r7(e,t,n){return Array.isArray(e)?e[t]??(Array.isArray(n)?n[t]:n):e}function i7(e,t){var n={}.toString.call(e);return n.indexOf(`[object`)===0&&n.indexOf(t+`]`)>-1}function Lft(e,t){return typeof e==`function`?e.apply(void 0,t):e}function Rft(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function zft(e){return e.split(/\s+/).filter(Boolean)}function a7(e){return[].concat(e)}function Bft(e,t){e.indexOf(t)===-1&&e.push(t)}function Vft(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function Hft(e){return e.split(`-`)[0]}function o7(e){return[].slice.call(e)}function Uft(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function s7(){return document.createElement(`div`)}function c7(e){return[`Element`,`Fragment`].some(function(t){return i7(e,t)})}function Wft(e){return i7(e,`NodeList`)}function Gft(e){return i7(e,`MouseEvent`)}function Kft(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function qft(e){return c7(e)?[e]:Wft(e)?o7(e):Array.isArray(e)?e:o7(document.querySelectorAll(e))}function l7(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+`ms`)})}function Jft(e,t){e.forEach(function(e){e&&e.setAttribute(`data-state`,t)})}function Yft(e){var t,n=a7(e)[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function Xft(e,t){var n=t.clientX,r=t.clientY;return e.every(function(e){var t=e.popperRect,i=e.popperState,a=e.props.interactiveBorder,o=Hft(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c=o===`bottom`?s.top.y:0,l=o===`top`?s.bottom.y:0,u=o===`right`?s.left.x:0,d=o===`left`?s.right.x:0,f=t.top-r+c>a,p=r-t.bottom-l>a,m=t.left-n+u>a,h=n-t.right-d>a;return f||p||m||h})}function u7(e,t,n){var r=t+`EventListener`;[`transitionend`,`webkitTransitionEnd`].forEach(function(t){e[r](t,n)})}function Zft(e,t){for(var n=t;n;){if(e.contains(n))return!0;n=n.getRootNode==null?void 0:n.getRootNode()?.host}return!1}var d7={isTouch:!1},Qft=0;function $ft(){d7.isTouch||(d7.isTouch=!0,window.performance&&document.addEventListener(`mousemove`,ept))}function ept(){var e=performance.now();e-Qft<20&&(d7.isTouch=!1,document.removeEventListener(`mousemove`,ept)),Qft=e}function tpt(){var e=document.activeElement;if(Kft(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function npt(){document.addEventListener(`touchstart`,$ft,n7),window.addEventListener(`blur`,tpt)}var rpt=typeof window<`u`&&typeof document<`u`?!!window.msCrypto:!1,f7=Object.assign({appendTo:Ift,aria:{content:`auto`,expanded:`auto`},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:``,offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:`top`,plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:`mouseenter focus`,triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:`fade`,arrow:!0,content:``,inertia:!1,maxWidth:350,role:`tooltip`,theme:``,zIndex:9999}),ipt=Object.keys(f7),apt=function(e){Object.keys(e).forEach(function(t){f7[t]=e[t]})};function opt(e){var t=(e.plugins||[]).reduce(function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=e[r]===void 0?f7[r]??i:e[r]),t},{});return Object.assign({},e,t)}function spt(e,t){return(t?Object.keys(opt(Object.assign({},f7,{plugins:t}))):ipt).reduce(function(t,n){var r=(e.getAttribute(`data-tippy-`+n)||``).trim();if(!r)return t;if(n===`content`)t[n]=r;else try{t[n]=JSON.parse(r)}catch{t[n]=r}return t},{})}function cpt(e,t){var n=Object.assign({},t,{content:Lft(t.content,[e])},t.ignoreAttributes?{}:spt(e,t.plugins));return n.aria=Object.assign({},f7.aria,n.aria),n.aria={expanded:n.aria.expanded===`auto`?t.interactive:n.aria.expanded,content:n.aria.content===`auto`?t.interactive?null:`describedby`:n.aria.content},n}var lpt=function(){return`innerHTML`};function p7(e,t){e[lpt()]=t}function upt(e){var t=s7();return e===!0?t.className=Pft:(t.className=Fft,c7(e)?t.appendChild(e):p7(t,e)),t}function dpt(e,t){c7(t.content)?(p7(e,``),e.appendChild(t.content)):typeof t.content!=`function`&&(t.allowHTML?p7(e,t.content):e.textContent=t.content)}function m7(e){var t=e.firstElementChild,n=o7(t.children);return{box:t,content:n.find(function(e){return e.classList.contains(Mft)}),arrow:n.find(function(e){return e.classList.contains(Pft)||e.classList.contains(Fft)}),backdrop:n.find(function(e){return e.classList.contains(Nft)})}}function fpt(e){var t=s7(),n=s7();n.className=jft,n.setAttribute(`data-state`,`hidden`),n.setAttribute(`tabindex`,`-1`);var r=s7();r.className=Mft,r.setAttribute(`data-state`,`hidden`),dpt(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(n,r){var i=m7(t),a=i.box,o=i.content,s=i.arrow;r.theme?a.setAttribute(`data-theme`,r.theme):a.removeAttribute(`data-theme`),typeof r.animation==`string`?a.setAttribute(`data-animation`,r.animation):a.removeAttribute(`data-animation`),r.inertia?a.setAttribute(`data-inertia`,``):a.removeAttribute(`data-inertia`),a.style.maxWidth=typeof r.maxWidth==`number`?r.maxWidth+`px`:r.maxWidth,r.role?a.setAttribute(`role`,r.role):a.removeAttribute(`role`),(n.content!==r.content||n.allowHTML!==r.allowHTML)&&dpt(o,e.props),r.arrow?s?n.arrow!==r.arrow&&(a.removeChild(s),a.appendChild(upt(r.arrow))):a.appendChild(upt(r.arrow)):s&&a.removeChild(s)}return{popper:t,onUpdate:i}}fpt.$$tippy=!0;var ppt=1,h7=[],g7=[];function mpt(e,t){var n=cpt(e,Object.assign({},f7,opt(Uft(t)))),r,i,a,o=!1,s=!1,c=!1,l=!1,u,d,f,p=[],m=Rft(le,n.interactiveDebounce),h,g=ppt++,_=null,v=Vft(n.plugins),y={id:g,reference:e,popper:s7(),popperInstance:_,props:n,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:xe,setProps:Se,setContent:Ce,show:we,hide:Te,hideWithInteractivity:Ee,enable:ye,disable:be,unmount:De,destroy:Oe};if(!n.render)return y;var b=n.render(y),x=b.popper,S=b.onUpdate;x.setAttribute(`data-tippy-root`,``),x.id=`tippy-`+y.id,y.popper=x,e._tippy=y,x._tippy=y;var C=v.map(function(e){return e.fn(y)}),w=e.hasAttribute(`aria-expanded`);return oe(),F(),M(),N(`onCreate`,[y]),n.showOnCreate&&_e(),x.addEventListener(`mouseenter`,function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),x.addEventListener(`mouseleave`,function(){y.props.interactive&&y.props.trigger.indexOf(`mouseenter`)>=0&&k().addEventListener(`mousemove`,m)}),y;function T(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return T()[0]===`hold`}function D(){var e;return!!((e=y.props.render)!=null&&e.$$tippy)}function O(){return h||e}function k(){var e=O().parentNode;return e?Yft(e):document}function A(){return m7(x)}function j(e){return y.state.isMounted&&!y.state.isVisible||d7.isTouch||u&&u.type===`focus`?0:r7(y.props.delay,+!e,f7.delay)}function M(e){e===void 0&&(e=!1),x.style.pointerEvents=y.props.interactive&&!e?``:`none`,x.style.zIndex=``+y.props.zIndex}function N(e,t,n){if(n===void 0&&(n=!0),C.forEach(function(n){n[e]&&n[e].apply(n,t)}),n){var r;(r=y.props)[e].apply(r,t)}}function P(){var t=y.props.aria;if(t.content){var n=`aria-`+t.content,r=x.id;a7(y.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+` `+r:r);else{var i=t&&t.replace(r,``).trim();i?e.setAttribute(n,i):e.removeAttribute(n)}})}}function F(){w||!y.props.aria.expanded||a7(y.props.triggerTarget||e).forEach(function(e){y.props.interactive?e.setAttribute(`aria-expanded`,y.state.isVisible&&e===O()?`true`:`false`):e.removeAttribute(`aria-expanded`)})}function I(){k().removeEventListener(`mousemove`,m),h7=h7.filter(function(e){return e!==m})}function L(t){if(!(d7.isTouch&&(c||t.type===`mousedown`))){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!(y.props.interactive&&Zft(x,n))){if(a7(y.props.triggerTarget||e).some(function(e){return Zft(e,n)})){if(d7.isTouch||y.state.isVisible&&y.props.trigger.indexOf(`click`)>=0)return}else N(`onClickOutside`,[y,t]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),s=!0,setTimeout(function(){s=!1}),y.state.isMounted||te())}}}function R(){c=!0}function ee(){c=!1}function z(){var e=k();e.addEventListener(`mousedown`,L,!0),e.addEventListener(`touchend`,L,n7),e.addEventListener(`touchstart`,ee,n7),e.addEventListener(`touchmove`,R,n7)}function te(){var e=k();e.removeEventListener(`mousedown`,L,!0),e.removeEventListener(`touchend`,L,n7),e.removeEventListener(`touchstart`,ee,n7),e.removeEventListener(`touchmove`,R,n7)}function ne(e,t){ie(e,function(){!y.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}function re(e,t){ie(e,t)}function ie(e,t){var n=A().box;function r(e){e.target===n&&(u7(n,`remove`,r),t())}if(e===0)return t();u7(n,`remove`,d),u7(n,`add`,r),d=r}function ae(t,n,r){r===void 0&&(r=!1),a7(y.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,n,r),p.push({node:e,eventType:t,handler:n,options:r})})}function oe(){E()&&(ae(`touchstart`,ce,{passive:!0}),ae(`touchend`,ue,{passive:!0})),zft(y.props.trigger).forEach(function(e){if(e!==`manual`)switch(ae(e,ce),e){case`mouseenter`:ae(`mouseleave`,ue);break;case`focus`:ae(rpt?`focusout`:`blur`,de);break;case`focusin`:ae(`focusout`,de);break}})}function se(){p.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),p=[]}function ce(e){var t=!1;if(!(!y.state.isEnabled||fe(e)||s)){var n=u?.type===`focus`;u=e,h=e.currentTarget,F(),!y.state.isVisible&&Gft(e)&&h7.forEach(function(t){return t(e)}),e.type===`click`&&(y.props.trigger.indexOf(`mouseenter`)<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?t=!0:_e(e),e.type===`click`&&(o=!t),t&&!n&&ve(e)}}function le(e){var t=e.target,r=O().contains(t)||x.contains(t);e.type===`mousemove`&&r||Xft(ge().concat(x).map(function(e){var t=e._tippy.popperInstance?.state;return t?{popperRect:e.getBoundingClientRect(),popperState:t,props:n}:null}).filter(Boolean),e)&&(I(),ve(e))}function ue(e){if(!(fe(e)||y.props.trigger.indexOf(`click`)>=0&&o)){if(y.props.interactive){y.hideWithInteractivity(e);return}ve(e)}}function de(e){y.props.trigger.indexOf(`focusin`)<0&&e.target!==O()||y.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ve(e)}function fe(e){return d7.isTouch?E()!==e.type.indexOf(`touch`)>=0:!1}function pe(){me();var t=y.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,o=t.moveTransition,s=D()?m7(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||O()}:e,l=[{name:`offset`,options:{offset:i}},{name:`preventOverflow`,options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:`flip`,options:{padding:5}},{name:`computeStyles`,options:{adaptive:!o}},{name:`$$tippy`,enabled:!0,phase:`beforeWrite`,requires:[`computeStyles`],fn:function(e){var t=e.state;if(D()){var n=A().box;[`placement`,`reference-hidden`,`escaped`].forEach(function(e){e===`placement`?n.setAttribute(`data-placement`,t.placement):t.attributes.popper[`data-popper-`+e]?n.setAttribute(`data-`+e,``):n.removeAttribute(`data-`+e)}),t.attributes.popper={}}}}];D()&&s&&l.push({name:`arrow`,options:{element:s,padding:3}}),l.push.apply(l,n?.modifiers||[]),y.popperInstance=Aft(c,x,Object.assign({},n,{placement:r,onFirstUpdate:f,modifiers:l}))}function me(){y.popperInstance&&=(y.popperInstance.destroy(),null)}function he(){var e=y.props.appendTo,t,n=O();t=y.props.interactive&&e===Ift||e===`parent`?n.parentNode:Lft(e,[n]),t.contains(x)||t.appendChild(x),y.state.isMounted=!0,pe()}function ge(){return o7(x.querySelectorAll(`[data-tippy-root]`))}function _e(e){y.clearDelayTimeouts(),e&&N(`onTrigger`,[y,e]),z();var t=j(!0),n=T(),i=n[0],a=n[1];d7.isTouch&&i===`hold`&&a&&(t=a),t?r=setTimeout(function(){y.show()},t):y.show()}function ve(e){if(y.clearDelayTimeouts(),N(`onUntrigger`,[y,e]),!y.state.isVisible){te();return}if(!(y.props.trigger.indexOf(`mouseenter`)>=0&&y.props.trigger.indexOf(`click`)>=0&&[`mouseleave`,`mousemove`].indexOf(e.type)>=0&&o)){var t=j(!1);t?i=setTimeout(function(){y.state.isVisible&&y.hide()},t):a=requestAnimationFrame(function(){y.hide()})}}function ye(){y.state.isEnabled=!0}function be(){y.hide(),y.state.isEnabled=!1}function xe(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(a)}function Se(t){if(!y.state.isDestroyed){N(`onBeforeUpdate`,[y,t]),se();var n=y.props,r=cpt(e,Object.assign({},n,Uft(t),{ignoreAttributes:!0}));y.props=r,oe(),n.interactiveDebounce!==r.interactiveDebounce&&(I(),m=Rft(le,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?a7(n.triggerTarget).forEach(function(e){e.removeAttribute(`aria-expanded`)}):r.triggerTarget&&e.removeAttribute(`aria-expanded`),F(),M(),S&&S(n,r),y.popperInstance&&(pe(),ge().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),N(`onAfterUpdate`,[y,t])}}function Ce(e){y.setProps({content:e})}function we(){var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,r=d7.isTouch&&!y.props.touch,i=r7(y.props.duration,0,f7.duration);if(!(e||t||n||r)&&!O().hasAttribute(`disabled`)&&(N(`onShow`,[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,D()&&(x.style.visibility=`visible`),M(),z(),y.state.isMounted||(x.style.transition=`none`),D()){var a=A(),o=a.box,s=a.content;l7([o,s],0)}f=function(){var e;if(!(!y.state.isVisible||l)){if(l=!0,x.offsetHeight,x.style.transition=y.props.moveTransition,D()&&y.props.animation){var t=A(),n=t.box,r=t.content;l7([n,r],i),Jft([n,r],`visible`)}P(),F(),Bft(g7,y),(e=y.popperInstance)==null||e.forceUpdate(),N(`onMount`,[y]),y.props.animation&&D()&&re(i,function(){y.state.isShown=!0,N(`onShown`,[y])})}},he()}}function Te(){var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,r=r7(y.props.duration,1,f7.duration);
1333if(!(e||t||n)&&(N(`onHide`,[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,l=!1,o=!1,D()&&(x.style.visibility=`hidden`),I(),te(),M(!0),D()){var i=A(),a=i.box,s=i.content;y.props.animation&&(l7([a,s],r),Jft([a,s],`hidden`))}P(),F(),y.props.animation?D()&&ne(r,y.unmount):y.unmount()}}function Ee(e){k().addEventListener(`mousemove`,m),Bft(h7,m),m(e)}function De(){y.state.isVisible&&y.hide(),y.state.isMounted&&(me(),ge().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),g7=g7.filter(function(e){return e!==y}),y.state.isMounted=!1,N(`onHidden`,[y]))}function Oe(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),se(),delete e._tippy,y.state.isDestroyed=!0,N(`onDestroy`,[y]))}}function _7(e,t){t===void 0&&(t={});var n=f7.plugins.concat(t.plugins||[]);npt();var r=Object.assign({},t,{plugins:n}),i=qft(e).reduce(function(e,t){var n=t&&mpt(t,r);return n&&e.push(n),e},[]);return c7(e)?i[0]:i}_7.defaultProps=f7,_7.setDefaultProps=apt,_7.currentInput=d7,Object.assign({},Tdt,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),_7.setDefaultProps({render:fpt});var hpt=class{constructor({editor:e,element:t,view:n,tippyOptions:r={},updateDelay:i=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&A6(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{var i;let{state:a,composing:o}=e,{selection:s}=a;if(o||!t&&!n)return;this.createTooltip();let{ranges:c}=s,l=Math.min(...c.map(e=>e.$from.pos)),u=Math.max(...c.map(e=>e.$to.pos));if(!this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:e,state:a,oldState:r,from:l,to:u})){this.hide();return}(i=this.tippy)==null||i.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>{if($lt(a.selection)){let t=e.nodeDOM(l);if(t){let e=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);if(e&&(t=e.firstChild),t)return t.getBoundingClientRect()}}return eut(e,l,u)})}),this.show()},this.editor=e,this.element=t,this.view=n,this.updateDelay=i,a&&(this.shouldShow=a),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility=`visible`}createTooltip(){let{element:e}=this.editor.options,t=!!e.parentElement;this.element.tabIndex=0,!(this.tippy||!t)&&(this.tippy=_7(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:`manual`,placement:`top`,hideOnClick:`toggle`,...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener(`blur`,this.tippyBlurHandler))}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}show(){var e;(e=this.tippy)==null||e.show()}hide(){var e;(e=this.tippy)==null||e.hide()}destroy(){var e;this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener(`blur`,this.tippyBlurHandler),(e=this.tippy)==null||e.destroy(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler)}},gpt=e=>new k4({key:typeof e.pluginKey==`string`?new j4(e.pluginKey):e.pluginKey,view:t=>new hpt({view:t,...e})});T6.create({name:`bubbleMenu`,addOptions(){return{element:null,tippyOptions:{},pluginKey:`bubbleMenu`,updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[gpt({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});
1333var _pt=class{getTextContent(e){return Glt(e,{textSerializers:E6(this.editor.schema)})}constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility=`visible`}createTooltip(){let{element:e}=this.editor.options,t=!!e.parentElement;this.element.tabIndex=0,!(this.tippy||!t)&&(this.tippy=_7(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:`manual`,placement:`right`,hideOnClick:`toggle`,...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener(`blur`,this.tippyBlurHandler))}update(e,t){var n;let{state:r}=e,{doc:i,selection:a}=r,{from:o,to:s}=a;if(!(t&&t.doc.eq(i)&&t.selection.eq(a))){if(this.createTooltip(),!this.shouldShow?.call(this,{editor:this.editor,view:e,state:r,oldState:t})){this.hide();return}(n=this.tippy)==null||n.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>eut(e,o,s))}),this.show()}}show(){var e;(e=this.tippy)==null||e.show()}hide(){var e;(e=this.tippy)==null||e.hide()}destroy(){var e;this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener(`blur`,this.tippyBlurHandler),(e=this.tippy)==null||e.destroy(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler)}},vpt=e=>new k4({key:typeof e.pluginKey==`string`?new j4(e.pluginKey):e.pluginKey,view:t=>new _pt({view:t,...e})});T6.create({name:`floatingMenu`,addOptions(){return{element:null,tippyOptions:{},pluginKey:`floatingMenu`,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[vpt({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function ypt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var bpt={exports:{}},v7={},xpt;function Spt(){if(xpt)return v7;xpt=1;var e=B.default;function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var n=typeof Object.is==`function`?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function s(e,t){var n=t(),s=r({inst:{value:n,getSnapshot:t}}),l=s[0].inst,u=s[1];return a(function(){l.value=n,l.getSnapshot=t,c(l)&&u({inst:l})},[e,n,t]),i(function(){return c(l)&&u({inst:l}),e(function(){c(l)&&u({inst:l})})},[e]),o(n),n}function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch{return!0}}function l(e,t){return t()}var u=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?l:s;return v7.useSyncExternalStore=e.useSyncExternalStore===void 0?u:e.useSyncExternalStore,v7}bpt.exports=Spt();var y7=bpt.exports,Cpt=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},wpt=({contentComponent:e})=>{let t=y7.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return B.createElement(B.Fragment,null,Object.values(t))};function Tpt(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t}
1333,setRenderer(n,r){t={...t,[n]:Wr.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var Ept=class extends B.Component{constructor(e){super(e),this.editorContentRef=B.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!e.editor?.contentComponent}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=Tpt(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){let e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;let t=document.createElement(`div`);t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){let{editor:e,innerRef:t,...n}=this.props;return B.createElement(B.Fragment,null,B.createElement(`div`,{ref:Cpt(t,this.editorContentRef),...n}),e?.contentComponent&&B.createElement(wpt,{contentComponent:e.contentComponent}))}},Dpt=(0,B.forwardRef)((e,t)=>{let n=B.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return B.createElement(Ept,{key:n,innerRef:t,...e})}),Opt=B.memo(Dpt),kpt=ypt(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,a;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 instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(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(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!(o===`_owner`&&t.$$typeof)&&!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),Apt={exports:{}},b7={},jpt;function Mpt(){if(jpt)return b7;jpt=1;var e=B.default,t=y7;function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,s=e.useMemo,c=e.useDebugValue;return b7.useSyncExternalStoreWithSelector=function(e,t,n,l,u){var d=a(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,a=e,e=l(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,r(a,e))return t;var n=l(e);return u!==void 0&&u(t,n)?t:(a=e,o=n)}var i=!1,a,o,s=n===void 0?null:n;return[function(){return e(t())},s===null?void 0:function(){return e(s())}]},[t,n,l,u]);var p=i(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),c(p),p},b7}Apt.exports=Mpt();var Npt=Apt.exports,Ppt=typeof window<`u`?B.useLayoutEffect:B.useEffect,Fpt=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>
1333{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function Ipt(e){let[t]=(0,B.useState)(()=>new Fpt(e.editor)),n=Npt.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??kpt);return Ppt(()=>t.watch(e.editor),[e.editor,t]),(0,B.useDebugValue)(n),n}var Lpt=typeof window>`u`,Rpt=Lpt||!!(typeof window<`u`&&window.next),zpt=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?Lpt||Rpt?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){return new Cut({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Bpt(e={},t=[]){let n=(0,B.useRef)(e);n.current=e;let[r]=(0,B.useState)(()=>new zpt(n)),i=y7.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,B.useDebugValue)(i),(0,B.useEffect)(r.onRender(t)),Ipt({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1?null:e.immediatelyRender&&t===0?0:t+1}),i}var Vpt=(0,B.createContext)({editor:null});Vpt.Consumer;var Hpt=()=>(0,B.useContext)(Vpt),Upt=e=>{let[t,n]=(0,B.useState)(null),{editor:r}=Hpt();return(0,B.useEffect)(()=>
1333{if(!t||e.editor?.isDestroyed||r?.isDestroyed)return;let{pluginKey:n=`bubbleMenu`,editor:i,tippyOptions:a={},updateDelay:o,shouldShow:s=null}=e,c=i||r;if(!c){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let l=gpt({updateDelay:o,editor:c,element:t,pluginKey:n,shouldShow:s,tippyOptions:a});return c.registerPlugin(l),()=>{c.unregisterPlugin(n)}},[e.editor,r,t]),B.createElement(`div`,{ref:n,className:e.className,style:{visibility:`hidden`}},e.children)},Wpt=e=>{let[t,n]=(0,B.useState)(null),{editor:r}=Hpt();return(0,B.useEffect)(()=>{if(!t||e.editor?.isDestroyed||r?.isDestroyed)return;let{pluginKey:n=`floatingMenu`,editor:i,tippyOptions:a={},shouldShow:o=null}=e,s=i||r;if(!s){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let c=vpt({pluginKey:n,editor:s,element:t,tippyOptions:a,shouldShow:o});return s.registerPlugin(c),()=>{s.unregisterPlugin(n)}},[e.editor,r,t]),B.createElement(`div`,{ref:n,className:e.className,style:{visibility:`hidden`}},e.children)},Gpt=(0,B.createContext)({onDragStart:void 0}),Kpt=()=>(0,B.useContext)(Gpt);B.forwardRef((e,t)=>{let{onDragStart:n}=Kpt(),r=e.as||`div`;return B.createElement(r,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});var qpt=/^\s*>\s$/,Jpt=J6.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return[`blockquote`,p6(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[q6({find:qpt,type:this.type})]}}),Ypt=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Xpt=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Zpt=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Qpt=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,$pt=C6.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return[`strong`,p6(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[G6({find:Ypt,type:this.type}),G6({find:Zpt,type:this.type})]},addPasteRules(){return[Y6({find:Xpt,type:this.type}),Y6({find:Qpt,type:this.type})]}}),emt=`listItem`,tmt=`textStyle`,nmt=/^\s*([-+*])\s$/,rmt=J6.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,p6(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(emt,this.editor.getAttributes(tmt)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=q6({find:nmt,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=q6({find:nmt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(tmt),editor:this.editor})),[e]}}),imt=/(^|[^`])`([^`]+)`(?!`)/,amt=/(^|[^`])`([^`]+)`(?!`)/g,omt=C6.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,p6(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}}
vendor: 11,575 bytes, lines 1333-1337
1333,addInputRules(){return[G6({find:imt,type:this.type})]},addPasteRules(){return[Y6({find:amt,type:this.type})]}}),smt=/^```([a-z]+)?[\s\n]$/,cmt=/^~~~([a-z]+)?[\s\n]$/,lmt=J6.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,p6(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
1334
1335`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(S4.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[K6({find:smt,type:this.type,getAttributes:e=>({language:e[1]})}),K6({find:cmt,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new k4({key:new j4(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
1336`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(C4.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),umt=J6.create({name:`doc`,topNode:!0,content:`block+`});function dmt(e={}){return new k4({view(t){return new fmt(t,e)}})}var fmt=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=eit(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},pmt=T6.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[dmt(this.options)]}}),x7=class e extends S4{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):S4.near(r)}content(){return P2.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new mmt(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!gmt(e)||!_mt(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!w4.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};x7.prototype.visible=!1,x7.findFrom=x7.findGapCursorFrom,S4.jsonID(`gapcursor`,x7);var mmt=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return x7.valid(t)?new x7(t):S4.near(t)}};function hmt(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function gmt(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||hmt(e.type))return!0;if(e.inlineContent)return!1}}return!0}function _mt(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||hmt(e.type))return!0;if(e.inlineContent)return!1}}return!0}function vmt(){return new k4({props:{decorations:Smt,createSelectionBetween(e,t,n){return t.pos==n.pos&&x7.valid(n)?new x7(n):null},handleClick:bmt,handleKeyDown:ymt,handleDOMEvents:{beforeinput:xmt}}})}var ymt=Lst({ArrowLeft:S7(`horiz`,-1),ArrowRight:S7(`horiz`,1),ArrowUp:S7(`vert`,-1),ArrowDown:S7(`vert`,1)});function S7(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof C4){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=x7.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new x7(c))),!0):!1}}function bmt(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!x7.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&w4.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new x7(r))),!0)}function xmt(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof x7))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=O2.empty;for(let e=r.length-1;e>=0;e--)i=O2.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new P2(i,0,0));return a.setSelection(C4.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Smt(e){if(!(e.selection instanceof x7))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,K3.create(e.doc,[U3.widget(e.selection.head,t,{key:`gapcursor`})])}var Cmt=T6.create({name:`gapCursor`,addProseMirrorPlugins(){return[vmt()]},extendNodeSchema(e){return{allowGapCursor:h6(u6(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),wmt=J6.create({name:`hardBreak`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,p6(this.options.HTMLAttributes,e)]},renderText(){return`
1337`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Tmt=J6.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,p6(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>K6({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
1337)\\s$`),type:this.type,getAttributes:{level:e}}))}}),C7=200,w7=function(){};w7.prototype.append=function(e){return e.length?(e=w7.from(e),!this.length&&e||e.length<C7&&this.leafAppend(e)||this.length<C7&&e.leafPrepend(this)||this.appendInner(e)):this},w7.prototype.prepend=function(e){return e.length?w7.from(e).append(this):this},w7.prototype.appendInner=function(e){return new Dmt(this,e)},w7.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?w7.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},w7.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},w7.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},w7.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},w7.from=function(e){return e instanceof w7?e:e&&e.length?new Emt(e):w7.empty};var Emt=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=C7)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=C7)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(w7);w7.empty=new Emt([]);var Dmt=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(w7),Omt=500,T7=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new E7(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new E7(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new E7(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Amt&&(s=kmt(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Frt;
vendor: 5,640 bytes, line 1337
1337return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new E7(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new E7(i,o,l))}else r.push(new E7(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new E7(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>Omt&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new E7(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(w7.from(i.reverse()),a)}};T7.empty=new T7(w7.empty,0);function kmt(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var E7=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},D7=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Amt=20;function jmt(e,t,n,r){let i=n.getMeta(j7),a;if(i)return i.historyState;n.getMeta(Imt)&&(e=new D7(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(j7))return o.getMeta(j7).redo?new D7(e.done.addTransform(n,void 0,r,A7(t)),e.undone,Nmt(n.mapping.maps),e.prevTime,e.prevComposition):new D7(e.done,e.undone.addTransform(n,void 0,r,A7(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Mmt(n,e.prevRanges)),s=o?O7(e.prevRanges,n.mapping):Nmt(n.mapping.maps);return new D7(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,A7(t)),T7.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new D7(e.done.rebased(n,a),e.undone.rebased(n,a),O7(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new D7(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),O7(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Mmt(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function Nmt(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function O7(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Pmt(e,t,n){let r=A7(t),i=j7.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new D7(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(j7,{redo:n,historyState:c})}var k7=!1,Fmt=null;function A7(e){let t=e.plugins;if(Fmt!=t){k7=!1,Fmt=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){k7=!0;break}}return k7}var j7=new j4(`history`),Imt=new j4(`closeHistory`);function Lmt(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new k4({key:j7,state:{init(){return new D7(T7.empty,T7.empty,null,0,-1)},apply(t,n,r){return jmt(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?zmt:n==`historyRedo`?Bmt:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Rmt(e,t){return(n,r)=>{let i=j7.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Pmt(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var zmt=Rmt(!1,!0),Bmt=Rmt(!0,!0),Vmt=T6.create({name:`history`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>zmt(e,t),redo:()=>({state:e,dispatch:t})=>Bmt(e,t)}},addProseMirrorPlugins(){return[Lmt(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Hmt=J6.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{}}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,p6(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Tut(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$from:r,$to:i}=n,a=e();return r.parentOffset===0?a.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):$lt(n)?a.insertContentAt(i.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:e,dispatch:t})=>{if(t){let{$to:t}=e.selection,n=t.end();
vendor: 4,359 bytes, line 1337
1337if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(C4.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(w4.create(e.doc,t.pos)):e.setSelection(C4.create(e.doc,t.pos));else{let r=t.parent.type.contentMatch.defaultType?.create();r&&(e.insert(n,r),e.setSelection(C4.create(e.doc,n+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){return[wut({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Umt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Wmt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Gmt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Kmt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,qmt=C6.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,p6(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[G6({find:Umt,type:this.type}),G6({find:Gmt,type:this.type})]},addPasteRules(){return[Y6({find:Wmt,type:this.type}),Y6({find:Kmt,type:this.type})]}}),Jmt=J6.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,p6(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ymt=`listItem`,Xmt=`textStyle`,Zmt=/^(\d+)\.\s$/,Qmt=J6.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,p6(this.options.HTMLAttributes,n),0]:[`ol`,p6(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Ymt,this.editor.getAttributes(Xmt)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=q6({find:Zmt,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=q6({find:Zmt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Xmt)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),$mt=J6.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,p6(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eht=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,tht=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,nht=C6.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,p6(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}}
1337,addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[G6({find:eht,type:this.type})]},addPasteRules(){return[Y6({find:tht,type:this.type})]}}),rht=J6.create({name:`text`,group:`inline`}),iht=T6.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push($pt.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Jpt.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(rmt.configure(this.options.bulletList)),this.options.code!==!1&&e.push(omt.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(lmt.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(umt.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(pmt.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Cmt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(wmt.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Tmt.configure(this.options.heading)),this.options.history!==!1&&e.push(Vmt.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(Hmt.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(qmt.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Jmt.configure(this.options.listItem)),this.options.orderedList!==!1&&e.push(Qmt.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push($mt.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(nht.configure(this.options.strike)),this.options.text!==!1&&e.push(rht.configure(this.options.text)),e}}),aht=`var(--highlight-purple)`,oht=`var(--highlight-dark-purple)`,sht=`var(--highlight-gray)`,cht=`var(--highlight-dark-gray)`,lht=`#ffffff`,M7=`#abb2bf`,uht=`var(--highlight-background)`,N7=`var(--highlight-background)`,dht=`var(--highlight-background)`,fht=`var(--highlight-light-gray)`,pht=`#528bff`;function mht(e){if(typeof btoa!=`function`)return`none`;let t=`<svg xmlns="http://www.w3.org/2000/svg" width="6" height="3">
1338    <path d="m0 3 l2 -2 l1 0 l2 2 l1 0" stroke="${e}" fill="none" stroke-width=".9"/>
1339  </svg>`;return`url('data:image/svg+xml;base64,${btoa(t)}')`}var hht=[P1.theme({".cm-lintRange-error":{backgroundImage:mht(`#DC2626`)},"&":{height:`16rem`,color:M7,backgroundColor:dht},".cm-content":{caretColor:pht,fontFamily:`var(--cm-font)`,padding:`4px`,fontSize:`12px`},".cm-line":{padding:`0px`},"&.cm-focused .cm-cursor":{borderLeftColor:pht},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:fht},".cm-panels":{backgroundColor:uht,color:M7},".cm-scroller":{overflow:`auto`},".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:N7},".cm-selectionMatch":{backgroundColor:`#aafe661a`},".cm-matchingBracket, .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`,outline:`1px solid #515a6b`},".cm-gutters":{backgroundColor:dht,color:cht,opacity:.5,border:`none`},".cm-activeLineGutter":{backgroundColor:N7},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-diagnostic-error":{borderLeft:`initial`},".cm-diagnostic-warning":{borderLeft:`initial`},".cm-diagnostic-info":{borderLeft:`initial`},".cm-tooltip":{color:`var(--highlight-tooltip-text)`,borderRadius:`2px`,boxShadow:`rgb(255, 255, 255) 0px 0px 0px 0px, rgb(229, 229, 229) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px`,backgroundColor:uht},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:N7,color:M7}}},{dark:!0}),B9e(R9e.define([{tag:[Q.keyword,Q.name,Q.deleted,Q.character,Q.propertyName,Q.macroName,Q.function(Q.variableName),Q.labelName,Q.operator,Q.operatorKeyword,Q.url,Q.escape,Q.regexp,Q.link,Q.special(Q.string)],color:aht},{tag:[Q.processingInstruction,Q.string,Q.inserted,Q.special(Q.variableName),Q.color,Q.constant(Q.name),Q.standard(
1339Q.name)],color:oht},{tag:[Q.typeName,Q.className,Q.number,Q.atom,Q.bool,Q.changed,Q.annotation,Q.modifier,Q.self,Q.namespace],color:oht},{tag:[Q.meta,Q.comment,Q.definition(Q.name),Q.separator],color:sht},{tag:Q.strong,fontWeight:`bold`},{tag:Q.emphasis,fontStyle:`italic`},{tag:Q.strikethrough,textDecoration:`line-through`},{tag:Q.link,color:sht,textDecoration:`underline`},{tag:Q.heading,fontWeight:`bold`,color:aht},{tag:Q.invalid,color:lht}]))];function P7(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ght(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function F7(){}var I7=.7,L7=1/I7,R7=`\\s*([+-]?\\d+)\\s*`,z7=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,B7=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,_ht=/^#([0-9a-f]{3,8})$/,vht=RegExp(`^rgb\\(${R7},${R7},${R7}\\)$`),yht=RegExp(`^rgb\\(${B7},${B7},${B7}\\)$`),bht=RegExp(`^rgba\\(${R7},${R7},${R7},${z7}\\)$`),xht=RegExp(`^rgba\\(${B7},${B7},${B7},${z7}\\)$`),Sht=RegExp(`^hsl\\(${z7},${B7},${B7}\\)$`),Cht=RegExp(`^hsla\\(${z7},${B7},${B7},${z7}\\)$`),wht={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};P7(F7,V7,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Tht,formatHex:Tht,formatHex8:Eht,formatHsl:Dht,formatRgb:Oht,toString:Oht});function Tht(){return this.rgb().formatHex()}function Eht(){return this.rgb().formatHex8()}function Dht(){return Iht(this).formatHsl()}function Oht(){return this.rgb().formatRgb()}function V7(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=_ht.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kht(t):n===3?new U7(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?H7(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?H7(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=vht.exec(e))?new U7(t[1],t[2],t[3],1):(t=yht.exec(e))?new U7(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bht.exec(e))?H7(t[1],t[2],t[3],t[4]):(t=xht.exec(e))?H7(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Sht.exec(e))?Fht(t[1],t[2]/100,t[3]/100,1):(t=Cht.exec(e))?Fht(t[1],t[2]/100,t[3]/100,t[4]):wht.hasOwnProperty(e)?kht(wht[e]):e===`transparent`?new U7(NaN,NaN,NaN,0):null}function kht(e){return new U7(e>>16&255,e>>8&255,e&255,1)}function H7(e,t,n,r){return r<=0&&(e=t=n=NaN),new U7(e,t,n,r)}function Aht(e){return e instanceof F7||(e=V7(e)),e?(e=e.rgb(),new U7(e.r,e.g,e.b,e.opacity)):new U7}function jht(e,t,n,r){return arguments.length===1?Aht(e):new U7(e,t,n,r??1)}function U7(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}P7(U7,jht,ght(F7,{brighter(e){return e=e==null?L7:L7**+e,new U7(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?I7:I7**+e,new U7(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new U7(G7(this.r),G7(this.g),G7(this.b),W7(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:Mht,formatHex:Mht,formatHex8:Nht,formatRgb:Pht,toString:Pht}));function Mht(){return`#${K7(this.r)}${K7(this.g)}${K7(this.b)}`}function Nht(){return`#${K7(this.r)}${K7(this.g)}${K7(this.b)}${K7((isNaN(this.opacity)?1:this.opacity)*255)}`}function Pht(){let e=W7(this.opacity);return`${e===1?`rgb(`:`rgba(`}${G7(this.r)}, ${G7(this.g)}, ${G7(this.b)}${e===1?`)`:`, ${e})`}`}function W7(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function G7(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function K7(e){return e=G7(e),(e<16?`0`:``)+e.toString(16)}function Fht(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new q7(e,t,n,r)}function Iht(e){if(e instanceof q7)return new q7(e.h,e.s,e.l,e.opacity);if(e instanceof F7||(e=V7(e)),!e)return new q7;if(e instanceof q7)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new q7(o,s,c,e.opacity)}function Lht(e,t,n,r){return arguments.length===1?Iht(e):new q7(e,t,n,r??1)}function q7(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}P7(q7,Lht,ght(F7,{brighter(e){return e=e==null?L7:L7**+e,new q7(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?I7:I7**+e,new q7(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 U7(Y7(e>=240?e-240:e+120,i,r),Y7(e,i,r),Y7(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new q7(Rht(this.h),J7(this.s),J7(this.l),W7(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(){let e=W7(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Rht(this.h)}, ${J7(this.s)*100}%, ${J7(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Rht(e){return e=(e||0)%360,e<0?e+360:e}function J7(e){return Math.max(0,Math.min(1,e||0))}function Y7(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function X7(){return(X7=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Z7(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function Q7(e){var t=(0,B.useRef)(e),n=(0,B.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var $7=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},e9=function(e){return`touches`in e},t9=function(e){return e&&e.ownerDocument.defaultView||self},zht=function(e,t,n){var r=e.getBoundingClientRect(),i=e9(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:$7((i.pageX-(r.left+t9(e).pageXOffset))/r.width),top:$7((i.pageY-(r.top+t9(e).pageYOffset))/r.height)}},Bht=function(e){!e9(e)&&e.preventDefault()}
1339,n9=B.memo(function(e){var t=e.onMove,n=e.onKey,r=Z7(e,[`onMove`,`onKey`]),i=(0,B.useRef)(null),a=Q7(t),o=Q7(n),s=(0,B.useRef)(null),c=(0,B.useRef)(!1),l=(0,B.useMemo)(function(){var e=function(e){Bht(e),(e9(e)?e.touches.length>0:e.buttons>0)&&i.current?a(zht(i.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=c.current,a=t9(i.current),o=n?a.addEventListener:a.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=i.current;if(r&&(Bht(t),!function(e,t){return t&&!e9(e)}(t,c.current)&&r)){if(e9(t)){c.current=!0;var o=t.changedTouches||[];o.length&&(s.current=o[0].identifier)}r.focus(),a(zht(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),o({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},n]},[o,a]),u=l[0],d=l[1],f=l[2];return(0,B.useEffect)(function(){return f},[f]),B.createElement(`div`,X7({},r,{onTouchStart:u,onMouseDown:u,className:`react-colorful__interactive`,ref:i,onKeyDown:d,tabIndex:0,role:`slider`}))}),r9=function(e){return e.filter(Boolean).join(` `)},i9=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=r9([`react-colorful__pointer`,e.className]);return B.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},B.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},a9=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var Vht=function(e){return qht(o9(e))},o9=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?a9(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?a9(parseInt(e.substring(6,8),16)/255,2):1}},Hht=function(e){return Kht(Wht(e))},Uht=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:a9(e.h),s:a9(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:a9(i/2),a:a9(r,2)}},s9=function(e){var t=Uht(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},c9=function(e){var t=Uht(e);return`hsla(`+t.h+`, `+t.s+`%, `+t.l+`%, `+t.a+`)`},Wht=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:a9(255*[r,s,o,o,c,r][l]),g:a9(255*[c,r,r,s,o,o][l]),b:a9(255*[o,o,c,r,r,s][l]),a:a9(i,2)}},Ght=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?qht({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},l9=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},Kht=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?l9(a9(255*i)):``;return`#`+l9(t)+l9(n)+l9(r)+a},qht=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:a9(60*(s<0?s+6:s)),s:a9(a?o/a*100:0),v:a9(a/255*100),a:i}},Jht=B.memo(function(e){var t=e.hue,n=e.onChange,r=r9([`react-colorful__hue`,e.className]);return B.createElement(`div`,{className:r},B.createElement(n9,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:$7(t+360*e.left,0,360)})},"aria-label":`Hue`,"aria-valuenow":a9(t),"aria-valuemax":`360`,"aria-valuemin":`0`},B.createElement(i9,{className:`react-colorful__hue-pointer`,left:t/360,color:s9({h:t,s:100,v:100,a:1})})))}),Yht=B.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:s9({h:t.h,s:100,v:100,a:1})};return B.createElement(`div`,{className:`react-colorful__saturation`,style:r},B.createElement(n9,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:$7(t.s+100*e.left,0,100),v:$7(t.v-100*e.top,0,100)})},"aria-label":`Color`,"aria-valuetext":`Saturation `+a9(t.s)+`%, Brightness `+a9(t.v)+`%`},B.createElement(i9,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:s9(t)})))}),Xht=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},Zht=function(e,t){return e.replace(/\s/g,``)===t.replace(/\s/g,``)},Qht=function(e,t){return e.toLowerCase()===t.toLowerCase()||Xht(o9(e),o9(t))};function $ht(e,t,n){var r=Q7(n),i=(0,B.useState)(function(){return e.toHsva(t)}),a=i[0],o=i[1],s=(0,B.useRef)({color:t,hsva:a});return(0,B.useEffect)(function(){if(!e.equal(t,s.current.color)){var n=e.toHsva(t);s.current={hsva:n,color:t},o(n)}},[t,e]),(0,B.useEffect)(function(){var t;Xht(a,s.current.hsva)||e.equal(t=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:t},r(t))},[a,e,r]),[a,(0,B.useCallback)(function(e){o(function(t){return Object.assign({},t,e)})},[])]}var egt,tgt=typeof window<`u`?B.useLayoutEffect:B.useEffect,ngt=function(){return egt||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},rgt=new Map,igt=function(e){tgt(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!rgt.has(t)){var n=t.createElement(`style`);n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;
1339width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,rgt.set(t,n);var r=ngt();r&&n.setAttribute(`nonce`,r),t.head.appendChild(n)}},[])},agt=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=Z7(e,[`className`,`colorModel`,`color`,`onChange`]),s=(0,B.useRef)(null);igt(s);var c=$ht(n,i,a),l=c[0],u=c[1],d=r9([`react-colorful`,t]);return B.createElement(`div`,X7({},o,{ref:s,className:d}),B.createElement(Yht,{hsva:l,onChange:u}),B.createElement(Jht,{hue:l.h,onChange:u,className:`react-colorful__last-control`}))},ogt={defaultColor:`000`,toHsva:Vht,fromHsva:function(e){return Hht({h:e.h,s:e.s,v:e.v,a:1})},equal:Qht},sgt=function(e){return B.createElement(agt,X7({},e,{colorModel:ogt}))},cgt=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:`linear-gradient(90deg, `+c9(Object.assign({},n,{a:0}))+`, `+c9(Object.assign({},n,{a:1}))+`)`},a=r9([`react-colorful__alpha`,t]),o=a9(100*n.a);return B.createElement(`div`,{className:a},B.createElement(`div`,{className:`react-colorful__alpha-gradient`,style:i}),B.createElement(n9,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:$7(n.a+e.left)})},"aria-label":`Alpha`,"aria-valuetext":o+`%`,"aria-valuenow":o,"aria-valuemin":`0`,"aria-valuemax":`100`},B.createElement(i9,{className:`react-colorful__alpha-pointer`,left:n.a,color:c9(n)})))},lgt=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=Z7(e,[`className`,`colorModel`,`color`,`onChange`]),s=(0,B.useRef)(null);igt(s);var c=$ht(n,i,a),l=c[0],u=c[1],d=r9([`react-colorful`,t]);return B.createElement(`div`,X7({},o,{ref:s,className:d}),B.createElement(Yht,{hsva:l,onChange:u}),B.createElement(Jht,{hue:l.h,onChange:u}),B.createElement(cgt,{hsva:l,onChange:u,className:`react-colorful__last-control`}))},ugt={defaultColor:`rgba(0, 0, 0, 1)`,toHsva:Ght,fromHsva:function(e){var t=Wht(e);return`rgba(`+t.r+`, `+t.g+`, `+t.b+`, `+t.a+`)`},equal:Zht},dgt=function(e){return B.createElement(lgt,X7({},e,{colorModel:ugt}))},fgt=/^#?([0-9A-F]{3,8})$/i,pgt=function(e){var t=e.color,n=t===void 0?``:t,r=e.onChange,i=e.onBlur,a=e.escape,o=e.validate,s=e.format,c=e.process,l=Z7(e,[`color`,`onChange`,`onBlur`,`escape`,`validate`,`format`,`process`]),u=(0,B.useState)(function(){return a(n)}),d=u[0],f=u[1],p=Q7(r),m=Q7(i),h=(0,B.useCallback)(function(e){var t=a(e.target.value);f(t),o(t)&&p(c?c(t):t)},[a,c,o,p]),g=(0,B.useCallback)(function(e){o(e.target.value)||f(a(n)),m(e)},[n,a,o,m]);return(0,B.useEffect)(function(){f(a(n))},[n,a]),B.createElement(`input`,X7({},l,{value:s?s(d):d,spellCheck:`false`,onChange:h,onBlur:g}))},mgt=function(e){return`#`+e},hgt=function(e){var t=e.prefixed,n=e.alpha,r=Z7(e,[`prefixed`,`alpha`]),i=(0,B.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,``).substring(0,n?8:6)},[n]),a=(0,B.useCallback)(function(e){return function(e,t){var n=fgt.exec(e),r=n?n[1].length:0;return r===3||r===6||!!t&&r===4||!!t&&r===8}(e,n)},[n]);return B.createElement(pgt,X7({},r,{escape:i,format:t?mgt:void 0,process:mgt,validate:a}))};function u9({x:e,y:t}){return{"data-focus-x":e,"data-focus-y":t}}
1339function ggt({value:e,onChange:t,readOnly:n}){let r=(0,B.useRef)(null),i=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!i.current&&window&&r.current){let a=P1.updateListener.of(e=>{e.docChanged&&t(o.state.doc.toString())}),o=new P1({state:gQ.create({doc:e,extensions:[I1.of([...ent,...Eet]),pet(),$5e(),hht,P7e(),wnt(),a,gQ.readOnly.of(!!n)]}),parent:r.current});i.current=o}return()=>{}},[e,t,n]),(0,H.jsx)(`div`,{className:`flex-auto h-64
1340        border border-gray-300 dark:border-gray-600 rounded
1341        overflow-hidden
1342        focus-visible:border-gray-300`,ref:r})}function _gt(e){return e instanceof Map?[...e.keys()][0]:e}function vgt(e){switch(typeof e){case`string`:return`String`;case`number`:return`Number`;case`boolean`:return`Boolean`;case`object`:return e&&`@type`in e&&e[`@type`]===`html`?`HTML`:`Object`;default:return`Other`}}function ygt(e){return`
1343    opacity-0
1344    transition-opacity
1345    group-1-hover:opacity-100
1346    hover:opacity-100
1347    aria-expanded:opacity-100
1348    focus:opacity-100
1349    text-gray-700 dark:text-gray-500
1350    border dark:border-gray-500
1351    ${e?`bg-gray-100 dark:bg-gray-700`:`bg-white dark:bg-gray-800`}
1352    px-1 py-1
1353    hover:bg-gray-100 dark:hover:bg-gray-900
1354    aria-expanded:bg-gray-100 dark:aria-expanded:bg-gray-900
1355    rounded-xs`}var d9=(0,Tm.default)(Jte)(`px-2 py-1 text-xs 
1356  bg-gray-100
1357  data-state-active:bg-gray-300
1358  dark:bg-gray-800 
1359  dark:data-state-active:bg-gray-500 rounded`);function bgt(e){return typeof e==`string`&&e.length<80&&V7(e)?`color`:typeof e==`string`?`text`:(0,tM.default)(e)&&`@type`in e&&e[`@type`]===`html`?`rich-text`:`json`}var f9=Tm.default.div(`block w-full
1360  text-sm
1361  h-64 px-4
1362  border-gray-300 dark:border-gray-600 rounded
1363  flex items-center justify-center
1364  dark:bg-gray-800 dark:text-white`);function xgt(e){let[t,n]=Zv(e.newValueAtom);return typeof t==`string`&&V7(t)?.formatHex()?(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`border border-white`,style:{borderRadius:5},children:(0,H.jsx)(sgt,{style:{width:`100%`},color:t,onChange:e=>n(e)})}),(0,H.jsx)(hgt,{className:Lg({}),prefixed:!0,color:t,onChange:e=>n(e)})]}):(0,H.jsx)(f9,{children:(0,H.jsxs)(`div`,{children:[`This value can’t be parsed as a color. Edit it in another mode, or`,` `,(0,H.jsx)(Fg,{onClick:()=>{n(`#ff0000`)},children:`start with red.`})]})})}function Sgt(e){let[t,n]=Zv(e.newValueAtom);return Ev(t).caseOf({Nothing(){return(0,H.jsx)(f9,{children:(0,H.jsxs)(`div`,{children:[`This value is not rich text. Use another editor, or`,` `,(0,H.jsx)(Fg,{onClick:()=>{n({"@type":`html`,value:String(t)})},children:`convert this value to text`})]})})},Just(){return(0,H.jsx)(wgt,{...e})}})}function Cgt({active:e}){return Dm([e?`underline`:``,`font-semibold`,`text-gray-700 hover:text-black dark:text-gray-300 dark:hover:text-white`])}var p9=Tm.default.button(Cgt);function wgt(e){let[t,n]=Zv(e.newValueAtom),r=(0,tM.default)(t)&&!Array.isArray(t)&&t.value||``,i=Bpt({autofocus:!0,extensions:[iht,Dut,mdt.configure({openOnClick:!0})],editable:!e.readOnly,content:r,editorProps:{handleDrop:(e,t,n,r)=>{if(!r&&t.dataTransfer?.files)throw Error(`Can’t upload files in play`);return!1}},onUpdate:({editor:e})=>{let t=e.getHTML();n({"@type":`html`,value:t})}});return(0,H.jsxs)(`div`,{className:`relative`,"data-handle-drop":!0,children:[i&&(0,H.jsxs)(Upt,{className:`flex rounded-sm px-2 py-1 bg-gray-100 dark:bg-gray-700 text-xs gap-x-2`,tippyOptions:{duration:100},editor:i,children:[(0,H.jsx)(p9,{onClick:()=>i.chain().focus().toggleBold().run(),active:i.isActive(`bold`),children:`Bold`}),(0,H.jsx)(p9,{onClick:()=>i.chain().focus().toggleItalic().run(),active:i.isActive(`italic`),children:`Italic`}),(0,H.jsx)(p9,{onClick:()=>i.chain().focus().toggleStrike().run(),active:i.isActive(`strike`),children:`Strike`}),(0,H.jsxs)(Kp,{children:[(0,H.jsx)(qp,{onClick:e=>{i.isActive(`link`)&&(i.chain().focus().toggleLink({href:``}).run(),e.preventDefault())},className:Cgt({active:i.isActive(`link`)}),children:`Link`}),(0,H.jsx)(vg,{children:(0,H.jsx)(eg,{onSubmit:e=>{i.chain().focus().toggleLink({href:e.href}).run()},initialValues:{href:``},children:(0,H.jsxs)(ig,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{autoFocus:!0,className:Lg({_size:`sm`}),name:`href`,required:!0,type:`url`,"aria-label":`URL`,placeholder:`https://…`,spell
1364Check:`false`,autoCapitalize:`false`}),(0,H.jsx)(Fg,{size:`sm`,children:`Add`})]})})})]})]}),i&&(0,H.jsxs)(Wpt,{className:`flex rounded-sm px-2 py-1 bg-gray-100 dark:bg-gray-700 text-xs gap-x-2`,tippyOptions:{duration:100},editor:i,children:[(0,H.jsx)(p9,{onClick:()=>i.chain().focus().toggleHeading({level:1}).run(),active:i.isActive(`heading`,{level:1}),children:`H1`}),(0,H.jsx)(p9,{onClick:()=>i.chain().focus().toggleHeading({level:2}).run(),active:i.isActive(`heading`,{level:2}),children:`H2`}),(0,H.jsx)(p9,{onClick:()=>i.chain().focus().toggleBulletList().run(),active:i.isActive(`bulletList`),children:`Bullet list`})]}),(0,H.jsx)(Opt,{editor:i})]})}function Tgt(e){let[t,n]=Zv(e.newValueAtom);return(0,tM.default)(t)?(0,H.jsx)(f9,{children:(0,H.jsxs)(`div`,{children:[`This value is complex and can’t be edited as text. Edit it in with the JSON editor, or`,` `,(0,H.jsx)(Fg,{onClick:()=>{n(JSON.stringify(t))},children:`convert this value to text.`})]})}):(0,H.jsx)(`div`,{children:(0,H.jsx)(`textarea`,{className:`block w-full
1365        text-sm
1366        h-64
1367        border-gray-300 dark:border-gray-600 rounded
1368        focus-visible:border-gray-300
1369        focus:ring-purple-500
1370        dark:bg-gray-800 dark:text-white`,value:String(t),readOnly:e.readOnly,onChange:e=>n(e.target.value)})})}function Egt(e){let[t,n]=Zv(e.newValueAtom),[r,i]=(0,B.useState)(!1);return(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(ggt,{readOnly:e.readOnly,value:JSON.stringify(t,null,2),onChange:e=>{me(e).caseOf({Left(){i(!0)},Right(e){n(e),i(!1)}})}}),r?(0,H.jsx)(`div`,{className:`opacity-100 hover:opacity-100 pointer-events-none
1371      bg-red-300/20 text-red-300 absolute top-2 right-2 rounded
1372      py-0.5 px-1
1373      text-xs`,children:`Invalid JSON`}):null]})}function Dgt({even:e}){return(0,H.jsxs)(vm,{delayDuration:300,children:[(0,H.jsx)(ym,{className:ygt(e),children:(0,H.jsx)(Qn,{})}),(0,H.jsxs)(fg,{children:[(0,H.jsx)(gg,{}),(0,H.jsx)(`div`,{className:`w-48`,children:`This property exists in other features but not in this one: you can add it to this feature by entering a value.`})]})]})}function Ogt(e){let{onCast:t,pair:[n]}=e,[r,i]=Zv(e.newValueAtom),[a,o]=(0,B.useState)(bgt(r));return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(Kte,{value:a,onValueChange:e=>o(e),children:[(0,H.jsxs)(qte,{className:`flex items-center pb-2 gap-x-2`,children:[(0,H.jsx)(d9,{value:`text`,children:`Text`}),(0,H.jsx)(d9,{value:`rich-text`,children:`Rich text`}),(0,H.jsx)(d9,{value:`json`,children:`JSON`}),(0,H.jsx)(d9,{value:`color`,children:`Color`})]}),(0,H.jsx)(tm,{value:`text`,children:(0,H.jsx)(Tgt,{...e})}),(0,H.jsx)(tm,{value:`rich-text`,children:(0,H.jsx)(Sgt,{...e})}),(0,H.jsx)(tm,{value:`json`,children:(0,H.jsx)(Egt,{...e})}),(0,H.jsx)(tm,{value:`color`,children:(0,H.jsx)(xgt,{...e})})]}),(0,H.jsxs)(`div`,{className:`pt-3 text-xs flex items-stretch justify-start gap-x-2`,children:[e.readOnly?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(vm,{children:[(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(Fg,{variant:`destructive`,onClick:()=>{e.onDeleteKey(e.pair[0])},children:(0,H.jsx)(Sr,{className:`w-3 h-3`})})}),(0,H.jsx)(fg,{side:`bottom`,children:`Delete property`})]}),(0,H.jsx)(`div`,{children:(0,H.jsxs)(zp,{children:[(0,H.jsx)(Bp,{asChild:!0,children:(0,H.jsxs)(Fg,{size:`sm`,children:[`Type: `,vgt(r),(0,H.jsx)(Er,{className:`w-3 h-3`})]})}),(0,H.jsxs)(Sg,{children:[(0,H.jsx)(Dg,{onSelect:()=>{t(n,String(r),yv.String),o(`text`)},children:`String`}),(0,H.jsx)(Dg,{onSelect:()=>{t(n,String(r),yv.JSON),o(`json`)},children:`JSON`}),(0,H.jsx)(Dg,{onSelect:()=>{i(Tv(r||0,yv.Boolean)),o(`json`)},children:`True/False`}),(0,H.jsx)(Dg,{onSelect:()=>{i(Tv(r||0,yv.Number)),o(`json`)},children:`Number`})]})]})})]}),(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(Yp,{asChild:!0,children:(0,H.jsxs)(Fg,{children:[(0,H.jsx)(dt,{}),` Done`]})})]})]})}function kgt(e){return(0,H.jsx)(`div`,{className:`flex items-center absolute top-1 bottom-1 right-1`,children:_gt(e.pair[1])===void 0?(0,H.jsx)(Dgt,{even:e.even}):(0,H.jsxs)(vm,{children:[(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(qp,{className:ygt(e.even),children:(0,H.jsx)(fr,{})})}),(0,H.jsx)(bm,{children:(0,H.jsxs)(fg,{children:[(0,H.jsx)(`span`,{className:`whitespace-nowrap`,children:`Edit value`}),(0,H.jsx)(fg,{children:(0,H.jsx)(`span`,{className:`whitespace-nowrap`,children:`Edit value`})})]})}),(0,H.jsx)(vg,{size:`lg`,sideOffset:-28,children:(0,H.jsx)(Ogt,{...e})})]})})}function Agt({pair:e,x:t,y:n,onChangeValue:r}){return(0,H.jsxs)(`label`,{...u9({x:t,y:n}),className:`select-none block py-2 px-2 flex items-center gap-x-2 text-xs dar
1373k:text-white`,children:[(0,H.jsx)(`input`,{checked:!!e[1],onChange:t=>{r(e[0],t.target.checked)},type:`checkbox`,className:ug({variant:`default`})}),e[1]?`True`:`False`]})}function jgt({value:e,x:t,y:n}){let r=(0,B.useMemo)(()=>Ev(e).map(e=>({kind:`html`,value:String(e.value).slice(0,100)})).orDefaultLazy(()=>({kind:`code`,value:JSON.stringify(e).slice(0,100)})),[e]);return(0,H.jsx)(qp,{"aria-label":`Edit JSON property`,className:`h-8
1374      ${r.kind===`html`?``:`font-mono`}
1375      text-left text-xs
1376      truncate
1377      block w-full dark:bg-transparent
1378      focus-visible:ring-inset
1379      focus-visible:ring-1 focus-visible:ring-purple-500
1380      truncate text-gray-900 dark:text-gray-100`,...u9({x:t,y:n}),children:(0,H.jsx)(`div`,{className:`truncate absolute top-0 bottom-0 left-2 right-0 flex items-center`,children:r.value||(0,H.jsx)(`span`,{className:`opacity-0`,children:`|`})})})}function Mgt({pair:e,x:t,y:n,table:r=!1,onChangeValue:i,readOnly:a=!1}){let{featureMap:o}=Yv(Wx),s=(0,B.useRef)(null),[c,l]=(0,B.useState)(!1),[u,d]=e,f=_L({value:d===void 0?``:d===null?`null`:String(d),onCommit(e){i(u,e)},onBlur(){l(!1)},onChange(){l(!0)}}),p=c||d===void 0||d===``,m=(0,B.useMemo)(()=>{if(s.current!==document.activeElement||!p)return[];let[t]=e,n=new Map,r=f.value;for(let{feature:e}of o.values()){let i=e.properties?.[t];i!==r&&i!==``&&(typeof i==`string`||typeof i==`number`)&&(!r||String(i).toLowerCase().includes(String(r).toLowerCase()))&&n.set(i,(n.get(i)||0)+1)}return[...n.entries()].sort((e,t)=>t[1]-e[1]).slice(0,50).map(e=>e[0])},[e,f.value,o,p]),h=p&&m.length>0;return(0,H.jsxs)(Kp,{open:h,children:[(0,H.jsx)(hte,{asChild:!0,children:(0,H.jsx)(`input`,{spellCheck:`false`,type:`text`,...u9({x:t,y:n}),className:pg(r?`table`:`right`),"aria-label":`Value for: ${u}`,readOnly:a,...f,ref:s})}),(0,H.jsx)(Jp,{children:(0,H.jsx)(_g,{size:`xs`,flush:`yes`,side:`bottom`,align:`start`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),children:(0,H.jsx)(`div`,{className:`overflow-y-auto divide-y
1381            divide-gray-200 dark:divide-gray-900
1382            placemark-scrollbar w-full text-xs rounded-md`,style:{maxHeight:100},children:m.map((t,n)=>(0,H.jsx)(`button`,{type:`button`,className:`block w-full text-left truncate py-1 px-2
1383                    bg-gray-100 dark:bg-gray-700
1384                    opacity-75 hover:opacity-100`,onMouseDown:n=>{n.preventDefault(),i(e[0],t)},title:String(t),children:dv(String(t),24)},n))})})})]})}function m9({pair:e,onChangeValue:t,onDeleteKey:n,onFocus:r=dP.default,table:i=!1,even:a,onCast:o,readOnly:s=!1,x:c,y:l}){let[u,d]=e,f=(0,B.useMemo)(()=>zv(d),[d]),p=Yv(f);return(0,H.jsx)(`div`,{onFocus:r,className:`relative group-1`,children:(0,H.jsxs)(Kp,{onOpenChange:e=>{e||t(u,p)},children:[(0,tM.default)(d)?(0,H.jsx)(jgt,{value:d,x:c,y:l,readOnly:s}):typeof d==`boolean`?(0,H.jsx)(Agt,{pair:e,onChangeValue:t,x:c,y:l}):(0,H.jsx)(Mgt,{table:i,pair:e,onChangeValue:t,readOnly:s,x:c,y:l}),(0,H.jsx)(kgt,{readOnly:s,onDeleteKey:n,onCast:o,even:a,pair:e,newValueAtom:f})]})})}function Ngt({onCommit:e,y:t}){let[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(``),o=(0,B.useRef)(null);function s(t,n){e(t,n),r(``),a(``),o.current?.focus()}function c(){n&&i&&s(n,i)}function l(e){switch(e.key){case`Escape`:break;case`Enter`:c();break}}let u=e=>{e.target===e.currentTarget&&c()};return(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{className:`border-r border-b border-t ${mg}`,children:(0,H.jsx)(`input`,{ref:o,type:`text`,className:pg(`left`),"aria-label":`New key`,placeholder:`New key`,spellCheck:`false`,value:n,onChange:e=>r(e.currentTarget.value),onKeyUp:l,onBlur:u,...u9({x:0,y:t})})}),(0,H.jsxs)(`td`,{className:`border-l border-b border-t ${mg} relative`,children:[(0,H.jsx)(`input`,{type:`text`,className:pg(`right`),"aria-label":`New value`,placeholder:`New value`,value:i,onChange:e=>a(e.currentTarget.value),onKeyUp:l,onBlur:u,...u9({x:1,y:t})}),(0,H.jsx)(`div`,{className:`flex items-center absolute top-1 bottom-1 right-1`,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":`Save property`,onClick:()=>s(n,i),className:`text-gray-500 focus:text-gray-700 hover:text-black
1385              dark:hover:text-white dark:focus:text-white p-1`,children:(0,H.jsx)(Jn,{})})})]})]})}function Pgt({pair:e,onAccept:t}){let n=(0,B.useRef)(null),r=Array.from(e[1].entries()),i=yP({count:r.length,getScrollElement:()=>n.current,estimateSize:(0,B.useCallback)(()=>28,[])});return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`pb-2 text-xs`,children:`Existing values`}),(0,H.jsx)(`div`,{ref:n,className:`h-32 overflow-y-auto`,children:(0,H.jsx)(`div`,{className:`w-full relative rounded-sm`,style:{height:`${i.getTotalSize()}px`},children:i.getVirtualItems().map(e=>{let n=r[e.index];return(0,H.jsxs)(`button`,{type:`button`,className:`top-0 left-0 block text-left w-full absolute py-1 px-2 flex items-center
1386                hover:bg-gray-200 dark:hover:bg-gray-700
1387                gap-x-2`,onClick:()=>t(n[0]),style:{height:`${e.size}px`,transform:`translateY(${e.start}px)`},children:[(0,H.jsx)(`div`,{className:`flex-auto font-mono text-xs truncate`,children:(0,tM.default)(n[0])?JSON.stringify(n[0]).substring(0,1024):String(n[0])}),(0,H.jsxs)(`div`,{className:`text-xs font-mono`,title:`Features with this value`,children:[`(`,n[1],`)`]}
1387)]},e.index)})})}),(0,H.jsx)(`div`,{className:`pt-3 pb-2 text-xs`,children:`New value`}),(0,H.jsx)(eg,{initialValues:{value:``},onSubmit:e=>{t(e.value)},children:(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{name:`value`,spellCheck:`false`,type:`text`,_size:`xs`}),(0,H.jsx)(Fg,{size:`xs`,type:`submit`,children:`Set`})]})})})]})}function Fgt({pair:e,onAccept:t,x:n,y:r}){let[,i]=e;return(0,H.jsx)(`div`,{children:(0,H.jsxs)(Kp,{children:[(0,H.jsxs)(qp,{...u9({x:n,y:r}),"aria-label":`Multiple values`,className:`group
1388          text-left font-mono
1389          text-xs px-1.5 py-2
1390          text-gray-700
1391
1392          focus-visible:ring-inset
1393          focus-visible:ring-1
1394          focus-visible:ring-purple-500
1395          aria-expanded:ring-1
1396          aria-expanded:ring-purple-500
1397
1398          gap-x-1 block w-full
1399          dark:text-white bg-transparent
1400          flex overflow-hidden`,children:[(0,H.jsx)(rt,{}),mv(`value`,i.size)]}),(0,H.jsx)(Jp,{children:(0,H.jsxs)(_g,{children:[(0,H.jsx)(hg,{}),(0,H.jsx)(kg,{title:``}),(0,H.jsx)(Pgt,{pair:e,onAccept:t})]})})]})})}function Igt({pair:e,onChangeKey:t,x:n,y:r}){let[i,a]=e,o=_L({value:i,onCommit(e){t(i,e)}});return(0,H.jsx)(`input`,{spellCheck:`false`,type:`text`,className:pg(`left`,a===void 0),...u9({x:n,y:r}),"aria-label":`Key: ${i}`,...o})}function Lgt({pair:e,onChangeValue:t,onChangeKey:n,onDeleteKey:r,onCast:i,even:a,y:o}){let[s,c]=e,l=c.size>1,{value:u}=c.keys().next();return(0,H.jsx)(Kp,{children:(0,H.jsxs)(`tr`,{className:`${a?``:`bg-gray-100 dark:bg-gray-700`} group`,children:[(0,H.jsx)(`td`,{className:`border-r border-b border-t ${mg}`,children:(0,H.jsx)(Igt,{pair:e,onChangeKey:n,x:0,y:o})}),(0,H.jsx)(`td`,{className:`border-l border-b border-t ${mg}`,children:l?(0,H.jsx)(Fgt,{x:1,y:o,pair:e,onAccept:e=>{e===void 0?r(s):t(s,e)}}):(0,H.jsx)(m9,{x:1,y:o,pair:[s,u],onChangeValue:t,even:a,onDeleteKey:r,onCast:i})})]})})}function Rgt({pair:e,onChangeValue:t,onChangeKey:n,even:r,onDeleteKey:i,onCast:a,y:o}){return(0,H.jsx)(Kp,{children:(0,H.jsxs)(`tr`,{className:`${r?``:`bg-gray-100 dark:bg-gray-700`}`,children:[(0,H.jsx)(`td`,{className:`border-r border-b border-t ${mg}`,children:(0,H.jsx)(Igt,{x:0,y:o,pair:e,onChangeKey:n})}),(0,H.jsx)(`td`,{className:`border-l border-b border-t relative ${mg}`,children:(0,H.jsx)(m9,{x:1,y:o,pair:e,onChangeValue:t,onDeleteKey:i,onCast:a,even:r})})]})})}var zgt=(0,B.memo)(function(){let[e,t]=Zv(Zx);return(0,H.jsxs)(vm,{delayDuration:300,children:[(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsxs)(`label`,{className:`inline-flex gap-x-2`,children:[`Show all`,(0,H.jsx)(`input`,{type:`checkbox`,className:ug({variant:`default`}),checked:e,onChange:e=>t(e.target.checked)})]})}),(0,H.jsxs)(fg,{size:`md`,children:[(0,H.jsx)(gg,{}),`Show all possible properties from all features, even if they aren’t defined on this feature.`]})]})}),Bgt=(0,B.memo)(function({wrappedFeature:e}){let t=i_(),n=Yv(Zx);return(0,H.jsx)(TZ,{title:`Properties`,variant:`fullwidth`,accessory:(0,H.jsx)(zgt,{}),children:(0,H.jsx)(`div`,{className:`pb-3 contain-layout`,children:(0,H.jsx)(Hgt,{wrappedFeature:e,showAll:n,rep:t},`properties-${String(n)}`)})})});function Vgt(){return(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`bg-gray-100 dark:bg-gray-800 font-sans text-gray-500 dark:text-gray-100 text-xs text-left`,children:[(0,H.jsx)(`th`,{className:`pl-3 py-2 border-r border-t border-b border-gray-200 dark:border-gray-700`,children:`Name`}),(0,H.jsx)(`th`,{className:`pl-2 py-2 border-l border-t border-b border-gray-200 dark:border-gray-700`,children:`Value`})]})})}function Hgt({wrappedFeature:e,rep:t,showAll:n}){let{featureMap:r}=Yv(Wx),{feature:i}=e,{feature:{properties:a}}=e,o=nM(r),s=(0,B.useMemo)(()=>{let e={};if(!a)return o;for(let t of o)t in a||(e[t]=void 0);return e},[a,o]),c=t.useTransact(),l=(0,B.useRef)(Object.keys({...a||{},...n?s||{}:[]}));function u(t){return c({putFeatures:[{...e,feature:t}]})}let d=(e,t)=>{u(OZ(i,{key:e,value:t})).catch(e=>void 0)},f=(e,t)=>{u(D4e(i,{key:e,newKey:t})).catch(e=>void 0)},p=e=>{l.current=(0,rv.default)(l.current,e),u(RI(i,{key:e})).catch(e=>void 0)}
1400,m=(e,t,n)=>{let r={...i.properties};r[e]=Tv(t,n),u({...i,properties:r}).catch(e=>void 0)},h=(e,t)=>{let n=OZ(i,{key:e,value:t});l.current.includes(e)||l.current.push(e),u(n).then(()=>{}).catch(e=>void 0)},g=(0,oZ.default)(Object.entries({...a||{},...n?s:[]}),([e])=>l.current.indexOf(e));return(0,H.jsx)(`div`,{className:`overflow-y-auto placemark-scrollbar`,"data-focus-scope":!0,onKeyDown:DZ,children:(0,H.jsxs)(`table`,{className:`pb-2 w-full`,children:[(0,H.jsx)(Vgt,{}),(0,H.jsxs)(`tbody`,{children:[g.map((e,t)=>(0,H.jsx)(Rgt,{pair:e,y:t,even:t%2==0,onChangeValue:d,onChangeKey:f,onDeleteKey:p,onCast:m},e[0])),(0,H.jsx)(Ngt,{y:g.length,onCommit:h})]})]})})}function h9({field:e,form:t,...n}){return(0,H.jsx)(qgt,{color:e.value,onChange:n=>{t.setFieldValue(e.name,n)},...n})}function Ugt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wgt(e){return e=Ugt(e),(e<16?`0`:``)+e.toString(16)}function Ggt(e){let t=V7(e);return t===null?``:t.opacity===1?t.formatHex():`${t.formatHex()}${Wgt(t.opacity*255)}`}function Kgt(e){let t=V7(e);return t===null?`rgba(0, 0, 0, 0)`:t.formatRgb()}function qgt({color:e,onChange:t,onBlur:n,_size:r=`sm`}){return(0,H.jsxs)(Kp,{children:[(0,H.jsxs)(qp,{className:Dm(Mg(`default`),Ag(r),`flex items-center w-full gap-x-2 font-mono dark:text-white`),children:[(0,H.jsx)(`div`,{className:`h-3 w-3 rounded-full`,style:{backgroundColor:e}}),(0,H.jsx)(`span`,{children:e?Ggt(e):``})]}),(0,H.jsx)(vg,{size:`no-width`,children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`border border-white`,style:{borderRadius:5},children:(0,H.jsx)(dgt,{color:Kgt(e),onChange:t,onBlur:n})}),(0,H.jsx)(hgt,{className:Lg({_size:r}),prefixed:!0,alpha:!0,color:e,onChange:t}),(0,H.jsx)(Yp,{asChild:!0,children:(0,H.jsx)(Fg,{children:`Done`})})]})})]})}var Jgt=e(r2e()),Ygt=100;function Xgt(){let{submitForm:e,values:t}=Gh(),n=(0,B.useMemo)(()=>(0,Jgt.default)(()=>e(),Ygt),[e]);(0,B.useEffect)(()=>{n()},[n,t])}function Zgt(e){if(e.size===1){let t=[...e][0];if(typeof t==`string`)return t}}function g9(e){if(e.size===1){let t=[...e][0];if(typeof t==`number`)return t}}function Qgt(e){let t={enableFill:!0,enableStroke:!0,enableFillOpacity:!0,enableStrokeWidth:!0,enableStrokeOpacity:!0};return{...v({fill:o().refine($gt).catch(()=>(t.enableFill=!1,l)),stroke:o().refine($gt).catch(()=>(t.enableStroke=!1,l)),"fill-opacity":p().catch(()=>(t.enableFillOpacity=!1,.3)),"stroke-width":p().catch(()=>(t.enableStrokeWidth=!1,1)),"stroke-opacity":p().catch(()=>(t.enableStrokeOpacity=!1,1))}).parse(e),...t}}function $gt(e){return V7(e)!==null}var e_t=[`fill`,`stroke`,`fill-opacity`,`stroke-opacity`,`stroke-width`];function t_t(){return Xgt(),null}function n_t({enableName:e,name:t,helpers:n}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{type:`checkbox`,name:e,className:ug({variant:`default`})}),n.values[e]?(0,H.jsx)(rg,{component:h9,name:t,_size:`sm`,className:Lg({_size:`sm`})}):null]})}function r_t({helpers:e}){return(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-y-1 gap-x-2 items-center`,children:[(0,H.jsx)(`div`,{className:`py-1`,children:(0,H.jsx)(bg,{size:`xs`,children:`Fill`})}),(0,H.jsx)(n_t,{name:`fill`,enableName:`enableFill`,helpers:e}),(0,H.jsx)(`div`,{className:`py-1 whitespace-nowrap`,children:(0,H.jsx)(bg,{size:`xs`,children:`Fill opacity`})}),(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{type:`checkbox`,name:`enableFillOpacity`,className:ug({variant:`default`})}),e.values.enableFillOpacity?(0,H.jsx)(rg,{type:`number`,name:`fill-opacity`,step:`0.1`,min:`0`,max:`1`,className:Lg({_size:`sm`})}):null]}),(0,H.jsx)(`div`,{className:`py-1`,children:(0,H.jsx)(bg,{size:`xs`,children:`Stroke`})}),(0,H.jsx)(n_t,{name:`stroke`,enableName:`enableStroke`,helpers:e}),(0,H.jsx)(`div`,{className:`py-1 whitespace-nowrap`,children:(0,H.jsx)(bg,{size:`xs`,children:`Stroke opacity`})}),(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{type:`checkbox`,name:`enableStrokeOpacity`,className:ug({variant:`default`})}),e.values.enableStrokeOpacity?(0,H.jsx)(rg,{type:`number`,name:`stroke-opacity`,step:`0.1`,min:`0`,max:`1`,className:Lg({_size:`sm`})}):null]}),(0,H.jsx)(`div`,{className:`py-1 whitespace-nowrap`,children:(0,H.jsx)(bg,{size:`xs`,children:`Stroke width`})}),(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{type:`checkbox`,name:`enableStrokeWidth`,className:ug({variant:`default`})}),e.values.enableStrokeWidth?(0,H.jsx)(rg,{type:`number`,name:`stroke-width`,className:Lg({_size:`sm`})}):null]})]})}function i_t(){let e=Xv(oS);return(0,H.jsxs)(Vg,{children:[`The current map symbolization has literal styles disabled.`,` `,(0,H.jsx)(Fg,{onClick:()=>{e(aS.Symbolization)},size:`xs`,children:`Enable literal styles`}),` `,`for your changes to be seen on the map.`]})}function a_t({wrappedFeature:e}){let t=i_(),n=t.useTransact(),[r]=t.useMetadata(),i=e.feature.properties,a=Qgt(i);return(0,H.jsxs)(EZ,{title:`Literal styles`,atom:Qx,children:[r.symbolization?.simplestyle===!1?(0,H.jsx)(i_t,{}):null,(0,H.jsx)(eg,{onSubmit:t=>{let r=(0,fw.default)(e.feature.properties||{});return t.enableFill?r.fill=t.fill:delete r.fill,t.enableFillOpacity?r[`fill-opacity`]=t[`fill-opacity`]:delete r[`fill-opacity`],t.enableStroke?r.stroke=t.stroke:delete r.stroke,t.enableStrokeOpacity?r[`stroke-opacity`]=t[`stroke-opacity`]:delete r[`stroke-opacity`],t.enableStrokeWidth?r[`stroke-width`]=t[`stroke-width`]:delete r[`stroke-width`],n({track:`feature-update-style`,putFeatures:[{...e,feature:{...e.feature,properties:r}}]})},initialValues:a,children:e=>(0,H.jsxs)(ig,{children:[(0,H.jsx)(t_t,{}),(0,H.jsx)(r_t,{helpers:e})]})})]})}function o_t({wrappedFeatures:e}){let t=i_(),n=t.useTransact(),[r]=t.useMetadata(),i=Qgt((0,B.useMemo)(()=>{let t={fill:new Set,stroke:new Set,"fill-opacity":new Set,"stroke-opacity":new Set,"stroke-width":new Set};for(let{feature:n}of e){let{properties:e}=n;if(e)for(let n of e_t){let r=e[n];t[n].add(r)}}return{fill:Zgt(t.fill),"fill-opacity":g9(t[`fill-opacity`]),stroke:Zgt(t.stroke),"stroke-opacity":g9(t[`stroke-opacity`]),"stroke-width":g9(t[`stroke-width`])}},[e]));return(0,H.jsxs)(EZ,{title:`Literal styles`,atom:Qx,children:[r.symbolization?.simplestyle===!1?(0,H.jsx)(i_t,{}):null,(0,H.jsx)(eg,{onSubmit:t=>n({track:`feature-update-style-multi`,putFeatures:e.map(e=>{let n=(0,fw.default)(e.feature.properties||{});return t.enableFill&&(n.fill=t.fill),t.enableFillOpacity&&(n[`fill-opacity`]=t[`fill-opacity`]),t.enableStroke&&(n.stroke=t.stroke),t.enableStrokeOpacity&&(n[`stroke-opacity`]=t[`stroke-opacity`]),t.enableStrokeWidth&&(n[`stroke-width`]=t[`stroke-width`]),{...e,feature:{...e.feature,properties:n}}})}),initialValues:i,children:e=>(0,H.jsxs)(ig,{children:[(0,H.jsx)(t_t,{}),(0,H.jsx)(r_t,{helpers:e})]})})]})}function s_t({wrappedFeature:e,vertexId:t}){let n=i_().useTransact(),r=Cje(e.feature,t),[i,a]=r.orDefault([0,0]),o=_L({value:i.toString(),onCommit(r){let i=+r;Number.isNaN(i)||n({putFeatures:[{...e,feature:zI({breakRectangle:!0,feature:e.feature,position:[i,a],vertexId:t}).feature}]}).catch(e=>void 0)}}),s=_L({value:a.toString(),onCommit(r){let a=+r;Number.isNaN(a)||n({putFeatures:[{...e,feature:zI({breakRectangle:!0,feature:e.feature,position:[i,a],vertexId:t}).feature}]}).catch(e=>void 0)}});return r.isNothing()?null:(0,H.jsx)(TZ,{title:`Selected vertex`,children:(0,H.jsx)(gL,{longitudeProps:o,latitudeProps:s})})}var c_t=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},_9=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(x9).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>
vendor: 9,234 bytes, line 1400
1400e.from-t.from||e.to-t.to),o=new CQ,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=A_t(s);if(i)o.add(n,n,ZQ.widget({widget:new w_t(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,ZQ.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,v9(f))}};function v9(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new c_t(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new c_t(r.from,n,r.diagnostic)}),r}function l_t(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(x9).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(y9))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function u_t(e,t){return e.field(b9,!1)?t:t.concat(uQ.appendConfig.of(j_t))}function d_t(e,t){return{effects:u_t(e,[y9.of(t)])}}var y9=uQ.define(),f_t=uQ.define(),p_t=uQ.define(),b9=tQ.define({create(){return new _9(ZQ.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 i=t.changes.mapPos(e.selected.from,1);r=v9(n,e.selected.diagnostic,i)||v9(n,null,i)}!n.size&&i&&t.state.facet(x9).autoPanel&&(i=null),e=new _9(n,i,r)}for(let n of t.effects)if(n.is(y9)){let r=t.state.facet(x9).autoPanel?n.value.length?E_t.open:null:e.panel;e=_9.init(n.value,r,t.state)}else n.is(f_t)?e=new _9(e.diagnostics,n.value?E_t.open:null,e.selected):n.is(p_t)&&(e=new _9(e.diagnostics,e.panel,n.value));return e},provide:e=>[q1.from(e,e=>e.panel),P1.decorations.from(e,e=>e.diagnostics)]}),m_t=ZQ.mark({class:`cm-lintRange cm-lintRange-active`});function h_t(e,t,n){let{diagnostics:r}=e.state.field(b9),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(x9).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:g_t(e,i)}}}:null}function g_t(e,t){return LQ(`ul`,{class:`cm-tooltip-lint`},t.map(t=>C_t(e,t,!1)))}var __t=e=>{let t=e.state.field(b9,!1);return!t||!t.panel?!1:(e.dispatch({effects:f_t.of(!1)}),!0)},v_t=M$.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(x9);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(x9);t.length&&y_t(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(d_t(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{k$(this.view.state,e)})}}update(e){let t=e.state.facet(x9);(e.docChanged||t!=e.startState.facet(x9)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function y_t(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var x9=XZ.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),..._Q(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:b_t,tooltipFilter:b_t,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function b_t(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function x_t(e,t={}){return[x9.of({source:e,config:t}),v_t,j_t]}function S_t(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function C_t(e,t,n){let r=n?S_t(t.actions):[];return LQ(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},LQ(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=v9(e.state.field(b9).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),LQ(`u`,s.slice(c,c+1)),s.slice(c+1)];return LQ(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&LQ(`div`,{class:`cm-diagnosticSource`},t.source))}var w_t=class extends YQ{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return LQ(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},T_t=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=C_t(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},E_t=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(t.keyCode==27)__t(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=S_t(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=v9(this.view.state.field(b9).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=LQ(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=LQ(`div`,{class:`cm-panel-lint`},this.list,LQ(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>__t(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(b9).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(b9),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new T_t(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new T_t(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=v9(this.view.state.field(b9).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:p_t.of(t)})}static open(t){return new e(t)}};function D_t(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function S9(e){return D_t(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var O_t=P1.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`
1400-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:S9(`#d11`)},".cm-lintRange-warning":{backgroundImage:S9(`orange`)},".cm-lintRange-info":{backgroundImage:S9(`#999`)},".cm-lintRange-hint":{backgroundImage:S9(`#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 k_t(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function A_t(e){let t=`hint`,n=1;for(let r of e){let e=k_t(r.severity);e>n&&(n=e,t=r.severity)}return t}var j_t=[b9,P1.decorations.compute([b9],e=>{let{selected:t,panel:n}=e.field(b9);return!t||!n||t.from==t.to?ZQ.none:ZQ.set([m_t.range(t.from,t.to)])}),v7e(h_t,{hideOn:l_t}),O_t],M_t=x_t(e=>r_.getIssues(e.state.doc.toString()));function N_t(e){return e.docChanged&&e.transactions.some(e=>e.annotation(dQ.userEvent))}var P_t=(0,B.memo)(function({feature:e}){let t=i_().useTransact(),{at:n,id:r,folderId:i}=e,[a,o]=(0,B.useState)(null),s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(null),u=(0,B.useMemo)(()=>P1.updateListener.of(e=>{if(!N_t(e))return;let a=e.state.doc.toString();r_.getIssues(a).then(e=>{if(e.length>0)return;let o=JSON.parse(a);return l.current=o,t({note:`Updated a property value`,putFeatures:[{at:n,id:r,folderId:i,feature:o}]})}).catch(e=>void 0)}),[n,r,i,t]);return(0,B.useEffect)(()=>{let t;return!c.current&&window&&s.current&&(t=new P1({state:gQ.create({doc:JSON.stringify(e,null,2),extensions:[I1.of([...ent,...Eet]),pet(),$5e(),hht,wnt(),M_t,u]}),parent:s.current}),c.current=t,o(t)),()=>{}},[e,u]),(0,B.useEffect)(()=>{if(!a||!window)return;let t=()=>{a.dispatch({changes:{from:0,to:a.state.doc.length,insert:JSON.stringify(e.feature,null,2)}}),l.current=e.feature};try{if(l.current===e.feature)return;let n=a.state.doc.toString(),r=JSON.parse(n);if((0,tv.default)(e.feature,r))return;t()}catch{a.state.doc.toString().trim()===``&&t()}},[a,e]),(0,H.jsx)(`div`,{className:`flex-auto`,ref:s})});function F_t({feature:e}){let t=Xv(Ux);return(0,H.jsxs)(EZ,{title:`GeoJSON`,atom:Vde,children:[(0,H.jsx)(`div`,{className:`${Dm(Mg(`default`))} rounded-xs`,children:(0,H.jsx)(P_t,{feature:e})}),(0,H.jsx)(`div`,{className:`pt-2`,children:(0,H.jsxs)(Vg,{size:`xs`,children:[`This editor edits this feature. You can copy & paste new GeoJSON features or feature collections under Menu →`,` `,(0,H.jsx)(Fg,{onClick:()=>{t({type:`load_text`})},size:`xs`,children:`Paste text`}),`.`]})})]})}function I_t({selectedFeature:e}){let t=Yv(Jx),[n]=U.getVertexIds(t);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`flex-auto overflow-y-auto placemark-scrollbar`,children:(0,H.jsx)(Bgt,{wrappedFeature:e})}),(0,H.jsxs)(`div`,{className:`divide-y divide-gray-200 dark:divide-gray-900 border-t border-gray-200 dark:border-gray-900 overflow-auto placemark-scrollbar`,children:[n===void 0?null:(0,H.jsx)(s_t,{wrappedFeature:e,vertexId:n}),(0,H.jsx)(w4e,{wrappedFeature:e}),(0,H.jsx)(_4e,{wrappedFeature:e},`circle-${e.id}`),(0,H.jsx)(a_t,{wrappedFeature:e},e.id),(0,H.jsx)(x4e,{wrappedFeature:e}),(0,H.jsx)(C4e,{wrappedFeature:e}),(0,H.jsx)(F_t,{feature:e})]})]})}function L_t({selectedFeatures:e}){let t=eDe(e),n=i_().useTransact(),r=(0,B.useRef)(Array.from(t.keys()));
1400function i(t){return n({note:`Updated multiple feature properties`,putFeatures:e.map(e=>({...e,feature:t(e.feature)}))})}let a=(e,t)=>i(n=>OZ(n,{key:e,value:t})),o=(e,t)=>{i(n=>D4e(n,{key:e,newKey:t}))},s=e=>{r.current=(0,rv.default)(r.current,e),i(t=>RI(t,{key:e}))},c=(e,t)=>{i(n=>{let r={...n.properties};return r[e]=Cv(t),{...n,properties:r}})},l=(e,t)=>{i(n=>OZ(n,{key:e,value:t})).then(()=>{r.current.includes(e)||r.current.push(e)})},u=(0,oZ.default)(Array.from(t.entries()),([e])=>r.current.indexOf(e));return(0,H.jsx)(TZ,{title:`Properties (${mv(`feature`,e.length)})`,variant:`fullwidth`,children:(0,H.jsxs)(`table`,{className:`ppb-2 b-2 w-full`,"data-focus-scope":!0,onKeyDown:DZ,children:[(0,H.jsx)(Vgt,{}),(0,H.jsxs)(`tbody`,{children:[u.map((e,t)=>(0,H.jsx)(Lgt,{y:t,pair:e,even:t%2==0,onChangeValue:a,onChangeKey:o,onDeleteKey:s,onCast:c},e[0])),(0,H.jsx)(Ngt,{onCommit:l,y:u.length})]})]})})}function R_t({selectedFeatures:e}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`overflow-auto`,children:(0,H.jsx)(L_t,{selectedFeatures:e})}),(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(`div`,{className:`divide-y divide-gray-200 dark:divide-gray-900 border-t border-gray-200 dark:border-gray-900 overflow-auto placemark-scrollbar`,children:(0,H.jsx)(o_t,{wrappedFeatures:e},`style-editor-multi`)})]})}function z_t(){let e=Yv(qx);return e.length>1?(0,H.jsx)(R_t,{selectedFeatures:e}):e.length===1?(0,H.jsx)(I_t,{selectedFeature:e[0]}):(0,H.jsx)(g4e,{})}function B_t({onAddColumn:e,...t}){let[n,r]=(0,B.useState)(!1);return(0,H.jsxs)(Kp,{open:n,onOpenChange:e=>r(e),children:[(0,H.jsx)(qp,{title:`Add column`,...t,children:(0,H.jsx)(Jn,{})}),(0,H.jsxs)(_g,{children:[(0,H.jsx)(hg,{}),(0,H.jsx)(kg,{title:`Add column`}),(0,H.jsx)(eg,{initialValues:{name:``},onSubmit:(t,n)=>{e(t.name),n.resetForm(),r(!1)},children:(0,H.jsxs)(ig,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{name:`name`,type:`text`,required:!0,_size:`xs`,innerRef:e=>{e&&setTimeout(()=>{e.focus()},0)}}),(0,H.jsx)(Fg,{size:`xs`,children:`Add`})]})})]})]})}function V_t({onClose:e,column:t,localOrder:n}){let r=i_().useTransact(),i=gS();return(0,H.jsx)(eg,{onSubmit:async a=>{await r({note:`Renamed a property`,track:`property-rename`,putFeatures:Array.from(i.values(),e=>({...e,feature:{...e.feature,properties:E4e(e.feature.properties,t,a.renameTo)}}))});for(let e=0;e<n.current.length;e++)n.current[e]===t&&(n.current[e]=a.renameTo);e()},initialValues:{renameTo:t},children:(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{required:!0,name:`renameTo`,spellCheck:`false`,type:`text`}),(0,H.jsx)(Fg,{type:`submit`,variant:`primary`,children:`Rename`})]})})})}var H_t=(0,B.memo)(function({virtualColumn:e,statsOpen:t,column:n,localOrder:r,...i}){let a=i_().useTransact(),o=Xv(Ux),s=Xv(sS),[c,l]=Zv(lS),u=ny((0,B.useCallback)((e,t)=>{confirm(`Are you sure you want to delete this property across all features?`)&&a({note:`Deleted a property from all features`,putFeatures:Array.from(e(Wx).featureMap.values(),e=>({...e,feature:RI(e.feature,{key:n})}))}).then(()=>{r.current=(0,rv.default)(r.current,n),t(sS,[])}).catch(e=>void 0)},[n,r,a])),[d,f]=(0,B.useState)(!1);function p(e){l(t=>t.sort?.column===n&&t.sort?.direction===e?{...t,sort:null}:{...t,sort:{column:n,direction:e}})}return(0,H.jsx)(`div`,{style:w9(e),className:`absolute flex`,children:(0,H.jsxs)(Kp,{open:d,onOpenChange:e=>f(e),children:[(0,H.jsx)(qp,{}),(0,H.jsxs)(zp,{children:[(0,H.jsxs)(Bp,{title:n,...i,className:Dm(i.className,c.sort?.column===n?`bg-purple-100 font-bold`:``),children:[(0,H.jsx)(`div`,{title:n,children:n}),c.sort?.column===n?c.sort?.direction===`asc`?(0,H.jsx)(qt,{className:`w-3 h-3`}):(0,H.jsx)(Gt,{className:`w-3 h-3`}):null,(0,H.jsx)(Ut,{className:`opacity-20 group-hover:opacity-100`})]}),(0,H.jsxs)(Sg,{align:`end`,children:[(0,H.jsxs)(Dg,{className:c.sort?.direction===`asc`&&c.sort.column===n?`bg-purple-200 font-bold`:``,onSelect:e=>{p(`asc`)},children:[(0,H.jsx)(qt,{className:`w-3 h-3`}),`Sort asc`]}),(0,H.jsxs)(Dg,{className:c.sort?.direction===`desc`&&c.sort.column===n?`bg-purple-200 font-bold`:``,onSelect:e=>{p(`desc`)},children:[(0,H.jsx)(Gt,{className:`w-3 h-3`}),`Sort desc`]}),(0,H.jsx)(wg,{}),(0,H.jsx)(Dg,{onSelect:()=>{o({type:`cast_property`,column:n})},children:`Cast`}),(0,H.jsx)(Dg,{onSelect:e=>{setTimeout(()=>{f(!0)},50)},children:`Rename`}),(0,H.jsx)(wg,{}),(0,H.jsx)(Dg,{variant:`destructive`,onSelect:u,children:`Delete`})]})]}),(0,H.jsx)(vg,{children:(0,H.jsx)(V_t,{column:n,localOrder:r,onClose:()=>{f(!1),s(e=>e.slice())}})})]})})}),U_t=(0,B.memo)(function({feature:e,column:t,x:n,y:r}){let i=fC(),a=i_().useTransact(),o=e.feature.properties?.[t];o??=``;function s(n){a({note:`Changed a property value`,putFeatures:[{...e,feature:OZ(e.feature,{key:t,value:n})}]}).catch(e=>void 0)}return(0,H.jsx)(`div`,{className:`group`,children:(0,H.jsx)(m9,{x:n,y:r,pair:[t,o],table:!0,onChangeValue:(e,t)=>
1400s(t),onFocus:()=>i([e]),onDeleteKey:()=>{},onCast:()=>{},even:!1})})}),W_t=i(((e,t)=>{var n=B_();function r(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===void 0?s===s&&!n(s):r(s,c)))var c=s,l=o}return l}t.exports=r})),G_t=i(((e,t)=>{function n(e,t){return e>t}t.exports=n})),K_t=i(((e,t)=>{var n=W_t(),r=G_t(),i=Y_();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),q_t=i(((e,t)=>{function n(e,t){return e<t}t.exports=n})),J_t=i(((e,t)=>{var n=W_t(),r=q_t(),i=Y_();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),Y_t=i(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),X_t=i(((e,t)=>{var n=Y_t(),r=a0e(),i=H_();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),Z_t=i(((e,t)=>{t.exports=X_t()()})),Q_t=e(K_t()),$_t=e(J_t()),evt=e(Z_t()),tvt=(0,B.memo)(function({feature:e,features:t,selected:n,setSelection:r}){let{id:i}=e,a=ny((0,B.useCallback)((e,n,r)=>{let{selection:i}=e(Wx),a=U.toIds(i).map(e=>t.findIndex(t=>t.id===e)).concat(t.findIndex(e=>e.id===r)),o=(0,evt.default)((0,$_t.default)(a),(0,Q_t.default)(a)+1).map(e=>t[e].id);n(Jx,U.fromIds(o))},[t]));return(0,H.jsxs)(`label`,{className:`pl-1 dark:text-white z-50 contain-layout
1401        hover:bg-gray-100 dark:hover:bg-gray-900
1402        flex items-center`,style:{height:33},children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:n,className:ug({variant:`default`})+` w-3 h-3 group-hover:opacity-100 checked:opacity-100 opacity-0 focus:ring-purple-500 focus:ring-1`,onChange:e=>{if((e.nativeEvent instanceof PointerEvent?e.nativeEvent:null)?.shiftKey)return a(i);r(e=>U.toggleSelectionId(e,i))}}),(0,H.jsx)(`div`,{className:`text-xs pl-2 text-gray-700 dark:text-gray-200`,children:e.feature.geometry?.type||`Null`})]})});function nvt(){return(0,H.jsx)(`div`,{className:`px-3 pt-3 flex flex-auto items-center justify-center`,children:(0,H.jsx)(`div`,{className:`text-sm text-center opacity-50 text-gray-500 dark:text-gray-200 flex items-center`,children:`There's nothing on this map yet.`})})}var C9=64,rvt=140,ivt=180,avt=40,ovt=10;function svt(e,t){return(0,Ox.default)(e,C9,t?rvt:ivt)}function cvt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function lvt({features:e,columns:t,column:n,search:r,replace:i,isCaseSensitive:a}){if(!r)return[];let o=new RegExp(cvt(r),a?`g`:`gi`),s=n?[n]:t;return e.flatMap(e=>{let t=e.feature.properties;if(!t)return[];let n=!1,r={...t};for(let e of s){let a=t[e];if(typeof a!=`string`)continue;let s=a.replace(o,()=>i);s!==a&&(n=!0,r[e]=s)}return n?[{...e,feature:{...e.feature,properties:r}}]:[]})}function uvt(e,t){return{position:`absolute`,top:0,left:0,width:`${e.size-1}px`,height:`${t.size-2}px`,transform:`translate(${e.start+1}px, ${t.start+1}px)`}}function w9(e){return{width:`${e.size}px`,transform:`translateX(${e.start}px)`,height:34}}function dvt({virtualColumn:e,column:t,onResize:n}){let{moveProps:r}=vN({onMove(e){n(t,e.deltaX)}});return(0,H.jsx)(`button`,{className:`absolute flex
1403      bg-purple-500 rounded
1404      opacity-0 hover:opacity-100 focus:opacity-100
1405      hover-none:opacity-20
1406      touch-none
1407      cursor-ew-resize`,style:{width:`8px`,transform:`translateX(${.5+e.end-8/2}px)`,height:33},...r})}function fvt(e,t){let n=e.length+2,r=0;for(let{feature:i}of t.values()){let t=i.properties?.[e];if(typeof t==`string`){if(t.length>n&&(n=t.length),++r>20)break}else if(typeof t==`object`&&(8>n&&(n=8),++r>20))break}return svt(n*ovt,!0)}function pvt({features:e,sort:t}){return t?e.toSorted((e,n)=>{let r=e.feature.properties?.[t.column],i=n.feature.properties?.[t.column];return r===void 0&&i===void 0?e.at>n.at?-1:1:(r??=``,i??=``,t.direction===`desc`?r>i?-1:1:i>r?-1:1)}):e}function mvt({featureMap:e,filter:t,columns:n}){let{column:r,search:i,geometryType:a,isCaseSensitive:o,folderId:s}=t,c=!!i,l=a!==null;if(!(c||l||s!==null))return Array.from(e.values());let u=[];for(let t of e.values()){let{feature:e}=t,n=e.geometry,r=!l||n?.type===a,i=!s||t.folderId===s;r&&i&&u.push(t)}return c?new FT(u,{keys:r?[r]:n,isCaseSensitive:o,getFn:GL,threshold:t.exact?0:.2,ignoreLocation:t.exact}).search(i).map(e=>e.item):u}function hvt({data:e}){let{featureMap:t,folderMap:n}=e,r=i_().useTransact(),i=Yv(Xx).right>300,[a,o]=Zv(Jx),{type:s}=a,c=a.type===`single`?a.id:null,l=(0,B.useRef)(null),[u,d]=Zv(sS),[f,p]=(0,B.useState)(new Map),[m,h]=Zv(lS),g=(0,B.useMemo)(()=>({...m,folderId:m.folderId&&n.has(m.folderId)?m.folderId:null}),[m,n]),_=RNe({featureMap:t,folderId:g.folderId,virtualColumns:u}),v=(0,B.useRef)(_||[]),y=(0,B.useRef)(null);(0,B.useEffect)(function(){p(t=>{let n=new Map(t);for(let r of _){if(t.has(r))continue;let i=fvt(r,e.featureMap);n.set(r,{width:i})}return n})},[e,_]),_=(0,B.useMemo)(()=>(0,oZ.default)(_,e=>v.current.indexOf(e)),[_]);let x=(0,B.useMemo)(()=>pvt({features:mvt({filter:g,columns:_,featureMap:e.featureMap}),sort:g.sort}),[g,_,e]),S=(0,B.useCallback)(e=>{switch(e){case 0:return 120;case _.length+1:return 50;default:return(f.get(_[e-1])?.width||C9)+avt}},[f]),C=yP({count:x.length,getScrollElement:()=>l.current,estimateSize:(0,B.useCallback)(()=>33,[]),overscan:3}),w=yP({count:_.length+2,horizontal:!0,getScrollElement:()=>l.current,estimateSize:S,overscan:3});(0,B.useEffect)(()=>{w.measure()},[f]),(0,B.useEffect)(()=>{s===`single`&&y.current!==c&&C.scrollToIndex(x.findIndex(e=>e.id===c),{align:`auto`}),y.current=c},[s,c,C,x]);let T=(0,B.useCallback)((e,t)=>{p(n=>{let r=new Map(n),i=svt((r.get(e)?.width||C9)+t,!1);return r.set(e,{width:i}),r})},[]),E=(0,B.useCallback)(e=>{let t=e.target.value;t=t===`All`?null:t,h(e=>({...e,folderId:t}))},[h]),[D,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(!1),j=g.search?x.length:0,M=(0,B.useCallback)(async e=>{if(j===0)return;let t=lvt({features:x,columns:_,column:g.column,search:g.search,replace:e,isCaseSensitive:g.isCaseSensitive});t.length!==0&&await r({note:`Replaced property values`,track:`property-replace`,putFeatures:t})},[_,x,g.column,g.isCaseSensitive,g.search,j,r]),N=`text-xs text-left
1408    text-gray-700 dark:text-gray-300
1409    flex items-center
1410    bg-gray-100 dark:bg-gray-700
1411    border-t border-b border-gray-300 dark:border-gray-600`,P=`hover:bg-gray-200 dark:hover:bg-gray-700
1412    hover:text-black dark:hover:text-white`,F=Dm(N,`absolute pl-1`),I=Dm(N,P,`px-2 justify-center border-r border-l`),L=Dm(N,P,`
1413    group justify-between
1414    gap-x-2
1415    w-full truncate
1416    px-2 border-l`);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`p-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-1 gap-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-stretch gap-x-1`,children:[(0,H.jsxs)(Fg,{size:`xs`,type:`button`,...D?{"aria-expanded":!0}:{},onClick:()=>{O(e=>!e)},children:[(0,H.jsx)(Ye,{}),i?`Stats`:``]}),(0,H.jsx)(`div`,{className:`w-1 mr-1 border-r border-gray-300 dark:border-gray-700`}),(0,H.jsxs)(`select`,{className:Ig({size:`xs`})+(i?` w-24`:`w-16`),onChange:E,value:g.folderId||`All`,children:[(0,H.jsx)(`option`,{value:`All`,children:`All folders`}),Array.from(n.values(),e=>(0,H.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,H.jsx)(Kp,{children:(0,H.jsx)(eg,{onSubmit:({exact:e,search:t,isCaseSensitive:n,column:r,geometryType:i})=>{h(a=>({...a,search:t?.trim()||null,isCaseSensitive:!!n,column:r||null,geometryType:i||null,exact:e}))},initialValues:{...g,replace:``},children:e=>
1416(0,H.jsxs)(ig,{className:`flex-auto space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-stretch gap-x-1`,children:[(0,H.jsxs)(`div`,{className:`relative w-full`,children:[(0,H.jsx)(rg,{className:Lg({_size:`xs`}),name:`search`,type:`input`,placeholder:`Search`}),(0,H.jsx)(`div`,{className:`absolute flex items-center top-0 bottom-0 right-1`,children:(0,H.jsx)(Fg,{size:`xs`,type:`button`,variant:`quiet`,onClick:()=>{e.resetForm(),h(()=>({...cS}))},children:(0,H.jsx)(jt,{})})})]}),(0,H.jsx)(Fg,{size:`xs`,type:`button`,"aria-label":`Toggle replace`,title:`Toggle replace`,...k?{"aria-expanded":!0}:{},onClick:()=>A(e=>!e),children:(0,H.jsx)(bn,{})}),(0,H.jsx)(qp,{asChild:!0,children:(0,H.jsx)(Fg,{size:`xs`,children:(0,H.jsx)(un,{})})}),(0,H.jsx)(Fg,{size:`xs`,type:`submit`,children:i?`Search`:(0,H.jsx)(In,{})})]}),k?(0,H.jsxs)(`div`,{className:`flex w-full items-center gap-x-3`,children:[(0,H.jsx)(rg,{className:Dm(Lg({_size:`xs`}),`flex-1`),name:`replace`,type:`text`,placeholder:`Replace`}),g.search?(0,H.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[j,` matches`]}):null,(0,H.jsx)(Fg,{type:`button`,size:`xs`,onClick:()=>{M(e.values.replace).catch(e=>void 0)},disabled:j===0,children:`Replace All`})]}):null,(0,H.jsxs)(vg,{children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-2 py-2`,children:[(0,H.jsxs)(rg,{as:`select`,className:Ig({size:`xs`}),name:`column`,children:[(0,H.jsx)(`option`,{value:``,children:`Any column`}),_.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))]}),(0,H.jsxs)(rg,{as:`select`,className:Ig({size:`xs`}),name:`geometryType`,children:[(0,H.jsx)(`option`,{value:``,children:`Any geometry type`}),b.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`label`,{className:`flex items-center gap-x-1`,children:[(0,H.jsx)(dg,{type:`checkbox`,size:`xs`,name:`isCaseSensitive`}),(0,H.jsx)(bg,{size:`xs`,children:`Case sensitive`})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-1`,children:[(0,H.jsx)(dg,{type:`checkbox`,size:`xs`,name:`exact`}),(0,H.jsx)(bg,{size:`xs`,children:`Exact string`})]})]})]})]})})})]}),D?(0,H.jsx)(eNe,{features:x}):null]}),(0,H.jsxs)(`div`,{ref:l,className:`overflow-auto flex-auto placemark-scrollbar`,"data-focus-scope":!0,onKeyUp:DZ,children:[(0,H.jsxs)(`div`,{className:`w-full sticky top-0 border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 z-50`,style:{height:33,width:`${w.getTotalSize()}px`},children:[w.getVirtualItems().map(e=>e.index===0?(0,H.jsxs)(`div`,{style:w9(e),className:F,children:[(0,H.jsx)(`input`,{className:ug({variant:`default`})+` mr-2 w-3 h-3 focus:ring-purple-500 focus:ring-1`,type:`checkbox`,onChange:e=>{e.target.checked?o(U.fromIds(x.map(e=>e.id))):o(U.none())}}),`Geometry`]},`geometry-column-${e.index}`):e.index===_.length+1?(0,H.jsx)(`div`,{className:`absolute`,style:w9(e),children:(0,H.jsx)(B_t,{style:{height:34},className:I,onAddColumn:e=>{d(u.concat(e)),v.current.push(e)}})},`add-column-${e.index}`):(0,H.jsx)(H_t,{virtualColumn:e,column:_[e.index-1],localOrder:v,statsOpen:D,className:L},`header-column-${e.index}`)),w.getVirtualItems().map(e=>e.index===0||e.index===_.length+1?null:(0,H.jsx)(dvt,{virtualColumn:e,column:_[e.index-1],onResize:T},`resizer-${e.index}`))]}),(0,H.jsxs)(`div`,{className:`relative w-full`,style:{willChange:`transform`,height:`${C.getTotalSize()}px`,width:`${w.getTotalSize()}px`},children:[C.getVirtualItems().map(e=>{let t=x[e.index],n=U.isSelected(a,t.id),r=w.getVirtualItems()[0];return(0,H.jsxs)(`div`,{className:`group`,children:[w.getVirtualItems().slice(1).map(n=>{let r=uvt(n,e);return n.index===_.length+1?null:(0,H.jsx)(`div`,{style:r,children:(0,H.jsx)(U_t,{x:n.index,y:e.index,column:_[n.index-1],feature:t})},`property-column-${n.index}`)}),(0,H.jsx)(`div`,{style:uvt(r,e),children:(0,H.jsx)(tvt,{selected:n,setSelection:o,features:x,feature:t})})]},`row-${e.index}`)}),C.getVirtualItems().map(e=>(0,H.jsx)(`div`,{className:`group absolute left-0 top-0 border-t border-gray-300 dark:border-gray-700 z-50`,style:{transform:`translateY(${e.start+e.size}px)`,width:w.getTotalSize()-50}},`row-line-${e.index}`)),w.getVirtualItems().slice(0,-1).map(e=>(0,H.jsx)(`div`,{className:`group absolute top-0 border-l border-gray-200 dark:border-gray-700 z-50`,style:{transform:`translateX(${e.start+e.size}px)`,height:C.getTotalSize()}},`column-line-${e.index}`))]})]})]})}function gvt(){let e=Yv(Wx);return e.featureMap.size===0?(0,H.jsx)(nvt,{}):(0,H.jsx)(hvt,{data:e})}var _vt=[{name:`RdBu`,colors:{3:[`rgb(239,138,98)`,`rgb(247,247,247)`,`rgb(103,169,207)`],4:[`rgb(202,0,32)`,`rgb(244,165,130)`,`rgb(146,197,222)`,`rgb(5,113,176)`],5:[`rgb(202,0,32)`,`rgb(244,165,130)`,`rgb(247,247,247)`,`rgb(146,197,222)`,`rgb(5,113,176)`],6:[`rgb(178,24,43)`,`rgb(239,138,98)`,`rgb(253,219,199)`,`rgb(209,229,240)`,`rgb(103,169,207)`,`rgb(33,102,172)`],7:[`rgb(178,24,43)`,`rgb(239,138,98)`,`rgb(253,219,199)`,`rgb(247,247,247)`,`rgb(209,229,240)`,`rgb(103,169,207)`,`rgb(33,102,172)`],8:[`rgb(178,24,43)`,`rgb(214,96,77)`,`rgb(244,165,130)`,`rgb(253,219,199)`,`rgb(209,229,240)`,`rgb(146,197,222)`,`rgb(67,147,195)`,`rgb(33,102,172)`],9:[`rgb(178,24,43)`,`rgb(214,96,77)`,`rgb(244,165,130)`,`rgb(253,219,199)`,`rgb(247,247,247)`,`rgb(209,229,240)`,`rgb(146,197,222)`,`rgb(67,147,195)`,`rgb(33,102,172)`],10:[`rgb(103,0,31)`,`rgb(178,24,43)`,`rgb(214,96,77)`,`rgb(244,165,130)`,`rgb(253,219,199)`,`rgb(209,229,240)`,`rgb(146,197,222)`,`rgb(67,147,195)`,`rgb(33,102,172)`,`rgb(5,48,97)`],11:[`rgb(103,0,31)`,`rgb(178,24,43)`,`rgb(214,96,77)`,`rgb(244,165,130)`,`rgb(253,219,199)`,`rgb(247,247,247)`,`rgb(209,229,240)`,`rgb(146,197,222)`,`rgb(67,147,195)`,`rgb(33,102,172)`,`rgb(5,48,97)`]}},{name:`PiYG`,colors:{3:[`rgb(233,163,201)`,`rgb(247,247,247)`,`rgb(161,215,106)`],4:[`rgb(208,28,139)`,`rgb(241,182,218)`,`rgb(184,225,134)`,`rgb(77,172,38)`],5:[`rgb(208,28,139)`,`rgb(241,182,218)`,`rgb(247,247,247)`,`rgb(184,225,134)`,`rgb(77,172,38)`],6:[`rgb(197,27,125)`,`rgb(233,163,201)`,`rgb(253,224,239)`,`rgb(230,245,208)`,`rgb(161,215,106)`,`rgb(77,146,33)`],7:[`rgb(197,27,125)`,`rgb(233,163,201)`,`rgb(253,224,239)`,`rgb(247,247,247)`,`rgb(230,245,208)`,`rgb(161,215,106)`,`rgb(77,146,33)`],8:[`rgb(197,27,125)`,`rgb(222,119,174)`,`rgb(241,182,218)`,`rgb(253,224,239)`,`rgb(230,245,208)`,`rgb(184,225,134)`,`rgb(127,188,65)`,`rgb(77,146,33)`],9:[`rgb(197,27,125)`,`rgb(222,119,174)`,`rgb(241,182,218)`,`rgb(253,224,239)`,`rgb(247,247,247)`,`rgb(230,245,208)`,`rgb(184,225,134)`,`rgb(127,188,65)`,`rgb(77,146,33)`],10:[`rgb(142,1,82)`,`rgb(197,27,125)`,`rgb(222,119,174)`,`rgb(241,182,218)`,`rgb(253,224,239)`,`rgb(230,245,208)`,`rgb(184,225,134)`,`rgb(127,188,65)`,`rgb(77,146,33)`,`rgb(39,100,25)`],11:[`rgb(142,1,82)`,`rgb(197,27,125)`,`rgb(222,119,174)`,`rgb(241,182,218)`,`rgb(253,224,239)`,`rgb(247,247,247)`,`rgb(230,245,208)`,`rgb(184,225,134)`,`rgb(127,188,65)`,`rgb(77,146,33)`,`rgb(39,100,25)`]}},{name:`PRGn`,colors:{3:[`rgb(175,141,195)`,`rgb(247,247,247)`,`rgb(127,191,123)`],4:[`rgb(123,50,148)`,`rgb(194,165,207)`,`rgb(166,219,160)`,`rgb(0,136,55)`],5:[`rgb(123,50,148)`,`rgb(194,165,207)`,`rgb(247,247,247)`,`rgb(166,219,160)`,`rgb(0,136,55)`],6:[`rgb(118,42,131)`,`rgb(175,141,195)`,`rgb(231,212,232)`,`rgb(217,240,211)`,`rgb(127,191,123)`,`rgb(27,120,55)`],7:[`rgb(118,42,131)`,`rgb(175,141,195)`,`rgb(231,212,232)`,`rgb(247,247,247)`,`rgb(217,240,211)`,`rgb(127,191,123)`,`rgb(27,120,55)`],8:[`rgb(118,42,131)`,`rgb(153,112,171)`,`rgb(194,165,207)`,`rgb(231,212,232)`,`rgb(217,240,211)`,`rgb(166,219,160)`,`rgb(90,174,97)`,`rgb(27,120,55)`],9:[`rgb(118,42,131)`,`rgb(153,112,171)`,`rgb(194,165,207)`,`rgb(231,212,232)`,`rgb(247,247,247)`,`rgb(217,240,211)`,`rgb(166,219,160)`,`rgb(90,174,97)`,`rgb(27,120,55)`],10:[`rgb(64,0,75)`,`rgb(118,42,131)`,`rgb(153,112,171)`,`rgb(194,165,207)`,`rgb(231,212,232)`,`rgb(217,240,211)`,`rgb(166,219,160)`,`rgb(90,174,97)`,`rgb(27,120,55)`,`rgb(0,68,27)`],11:[`rgb(64,0,75)`,`rgb(118,42,131)`,`rgb(153,112,171)`,`rgb(194,165,207)`,`rgb(231,212,232)`,`rgb(247,247,247)`,`rgb(217,240,211)`,`rgb(166,219,160)`,`rgb(90,174,97)`,`rgb(27,120,55)`,`rgb(0,68,27)`]}},{name:`RdYlBu`,colors:{3:[`rgb(252,141,89)`,`rgb(255,255,191)`,`rgb(145,191,219)`],4:[`rgb(215,25,28)`,`rgb(253,174,97)`,`rgb(171,217,233)`,`rgb(44,123,182)`],5:[`rgb(215,25,28)`,`rgb(253,174,97)`,`rgb(255,255,191)`,`rgb(171,217,233)`,`rgb(44,123,182)`],6:[`rgb(215,48,39)`,`rgb(252,141,89)`,`rgb(254,224,144)`,`rgb(224,243,248)`,`rgb(145,191,219)`,`rgb(69,117,180)`],7:[`rgb(215,48,39)`,`rgb(252,141,89)`,`rgb(254,224,144)`,`rgb(255,255,191)`,`rgb(224,243,248)`,`rgb(145,191,219)`,`rgb(69,117,180)`],8:[`rgb(215,48,39)`,`rgb(244,109,67)`,`rgb(253,174,97)`,`rgb(254,224,144)`,`rgb(224,243,248)`,`rgb(171,217,233)`,`rgb(116,173,209)`,`rgb(69,117,180)`],9:[`rgb(215,48,39)`,`rgb(244,109,67)`,`rgb(253,174,97)`,`rgb(254,224,144)`,`rgb(255,255,191)`,`rgb(224,243,248)`,`rgb(171,217,233)`,`rgb(116,173,209)`,`rgb(69,117,180)`],10:[`rgb(165,0,38)`,`rgb(215,48,39)`,`rgb(244,109,67)`,`rgb(253,174,97)`,`rgb(254,224,144)`,`rgb(224,243,248)`,`rgb(171,217,233)`,`rgb(116,173,209)`,`rgb(69,117,180)`,`rgb(49,54,149)`],11:[`rgb(165,0,38)`,`rgb(215,48,39)`,`rgb(244,109,67)`,`rgb(253,174,97)`,`rgb(254,224,144)`,`rgb(255,255,191)`,`rgb(224,243,248)`,`rgb(171,217,233)`,`rgb(116,173,209)`,`rgb(69,117,180)`,`rgb(49,54,149)`]}},{name:`BrBG`,colors:{3:[`rgb(216,179,101)`,`rgb(245,245,245)`,`rgb(90,180,172)`],4:[`rgb(166,97,26)`,`rgb(223,194,125)`,`rgb(128,205,193)`,`rgb(1,133,113)`],5:[`rgb(166,97,26)`,`rgb(223,194,125)`,`rgb(245,245,245)`,`rgb(128,205,193)`,`rgb(1,133,113)`],6:[`rgb(140,81,10)`,`rgb(216,179,101)`,`rgb(246,232,195)`,`rgb(199,234,229)`,`rgb(90,180,172)`,`rgb(1,102,94)`],7:[`rgb(140,81,10)`,`rgb(216,179,101)`,`rgb(246,232,195)`,`rgb(245,245,245)`,`rgb(199,234,229)`,`rgb(90,180,172)`,`rgb(1,102,94)`],8:[`rgb(140,81,10)`,`rgb(191,129,45)`,`rgb(223,194,125)`,`rgb(246,232,195)`,`rgb(199,234,229)`,`rgb(128,205,193)`,`rgb(53,151,143)`,`rgb(1,102,94)`],9:[`rgb(140,81,10)`,`rgb(191,129,45)`,`rgb(223,194,125)`,`rgb(246,232,195)`,`rgb(245,245,245)`,`rgb(199,234,229)`,`rgb(128,205,193)`,`rgb(53,151,143)`,`rgb(1,102,94)`],10:[`rgb(84,48,5)`,`rgb(140,81,10)`,`rgb(191,129,45)`,`rgb(223,194,125)`,`rgb(246,232,195)`,`rgb(199,234,229)`,`rgb(128,205,193)`,`rgb(53,151,143)`,`rgb(1,102,94)`,`rgb(0,60,48)`],11:[`rgb(84,48,5)`,`rgb(140,81,10)`,`rgb(191,129,45)`,`rgb(223,194,125)`,`rgb(246,232,195)`,`rgb(245,245,245)`,`rgb(199,234,229)`,`rgb(128,205,193)`,`rgb(53,151,143)`,`rgb(1,102,94)`,`rgb(0,60,48)`]}},{name:`PuOr`,colors:{3:[`rgb(241,163,64)`,`rgb(247,247,247)`,`rgb(153,142,195)`],4:[`rgb(230,97,1)`,`rgb(253,184,99)`,`rgb(178,171,210)`,`rgb(94,60,153)`],5:[`rgb(230,97,1)`,`rgb(253,184,99)`,`rgb(247,247,247)`,`rgb(178,171,210)`,`rgb(94,60,153)`],6:[`rgb(179,88,6)`,`rgb(241,163,64)`,`rgb(254,224,182)`,`rgb(216,218,235)`,`rgb(153,142,195)`,`rgb(84,39,136)`],7:[`rgb(179,88,6)`,`rgb(241,163,64)`,`rgb(254,224,182)`,`rgb(247,247,247)`,`rgb(216,218,235)`,`rgb(153,142,195)`,`rgb(84,39,136)`],8:[`rgb(179,88,6)`,`rgb(224,130,20)`,`rgb(253,184,99)`,`rgb(254,224,182)`,`rgb(216,218,235)`,`rgb(178,171,210)`,`rgb(128,115,172)`,`rgb(84,39,136)`],9:[`rgb(179,88,6)`,`rgb(224,130,20)`,`rgb(253,184,99)`,`rgb(254,224,182)`,`rgb(247,247,247)`,`rgb(216,218,235)`,`rgb(178,171,210)`,`rgb(128,115,172)`,`rgb(84,39,136)`],10:[`rgb(127,59,8)`,`rgb(179,88,6)`,`rgb(224,130,20)`,`rgb(253,184,99)`,`rgb(254,224,182)`,`rgb(216,218,235)`,`rgb(178,171,210)`,`rgb(128,115,172)`,`rgb(84,39,136)`,`rgb(45,0,75)`],11:[`rgb(127,59,8)`,`rgb(179,88,6)`,`rgb(224,130,20)`,`rgb(253,184,99)`,`rgb(254,224,182)`,`rgb(247,247,247)`,`rgb(216,218,235)`,`rgb(178,171,210)`,`rgb(128,115,172)`,`rgb(84,39,136)`,`rgb(45,0,75)`]}}],T9=[{name:`Set2`,colors:{3:[`rgb(102,194,165)`,`rgb(252,141,98)`,`rgb(141,160,203)`],4:[`rgb(102,194,165)`,`rgb(252,141,98)`,`rgb(141,160,203)`,`rgb(231,138,195)`],5:[`rgb(102,194,165)`,`rgb(252,141,98)`,`rgb(141,160,203)`,`rgb(231,138,195)`,`rgb(166,216,84)`],6:[`rgb(102,194,165)`,`rgb(252,141,98)`,`rgb(141,160,203)`,`rgb(231,138,195)`,`rgb(166,216,84)`,`rgb(255,217,47)`],7:[`rgb(102,194,165)`,`rgb(252,141,98)`,`rgb(141,160,203)`,`rgb(231,138,195)`,`rgb(166,216,84)`,`rgb(255,217,47)`,`rgb(229,196,148)`],8:[`rgb(102,194,165)`,`rgb(252,141,98)`,`rgb(141,160,203)`,`rgb(231,138,195)`,`rgb(166,216,84)`,`rgb(255,217,47)`,`rgb(229,196,148)`,`rgb(179,179,179)`]}},{name:`Dark2`,colors:{3:[`rgb(27,158,119)`,`rgb(217,95,2)`,`rgb(117,112,179)`],4:[`rgb(27,158,119)`,`rgb(217,95,2)`,`rgb(117,112,179)`,`rgb(231,41,138)`],5:[`rgb(27,158,119)`,`rgb(217,95,2)`,`rgb(117,112,179)`,`rgb(231,41,138)`,`rgb(102,166,30)`],6:[`rgb(27,158,119)`,`rgb(217,95,2)`,`rgb(117,112,179)`,`rgb(231,41,138)`,`rgb(102,166,30)`,`rgb(230,171,2)`],7:[`rgb(27,158,119)`,`rgb(217,95,2)`,`rgb(117,112,179)`,`rgb(231,41,138)`,`rgb(102,166,30)`,`rgb(230,171,2)`,`rgb(166,118,29)`],8:[`rgb(27,158,119)`,`rgb(217,95,2)`,`rgb(117,112,179)`,`rgb(231,41,138)`,`rgb(102,166,30)`,`rgb(230,171,2)`,`rgb(166,118,29)`,`rgb(102,102,102)`]}},{name:`Paired`,colors:{3:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`],4:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`],5:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`,`rgb(251,154,153)`],6:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`,`rgb(251,154,153)`,`rgb(227,26,28)`],7:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`,`rgb(251,154,153)`,`rgb(227,26,28)`,`rgb(253,191,111)`],8:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`,`rgb(251,154,153)`,`rgb(227,26,28)`,`rgb(253,191,111)`,`rgb(255,127,0)`],9:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`,`rgb(251,154,153)`,`rgb(227,26,28)`,`rgb(253,191,111)`,`rgb(255,127,0)`,`rgb(202,178,214)`],10:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`,`rgb(251,154,153)`,`rgb(227,26,28)`,`rgb(253,191,111)`,`rgb(255,127,0)`,`rgb(202,178,214)`,`rgb(106,61,154)`],11:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`,`rgb(251,154,153)`,`rgb(227,26,28)`,`rgb(253,191,111)`,`rgb(255,127,0)`,`rgb(202,178,214)`,`rgb(106,61,154)`,`rgb(255,255,153)`],12:[`rgb(166,206,227)`,`rgb(31,120,180)`,`rgb(178,223,138)`,`rgb(51,160,44)`,`rgb(251,154,153)`,`rgb(227,26,28)`,`rgb(253,191,111)`,`rgb(255,127,0)`,`rgb(202,178,214)`,`rgb(106,61,154)`,`rgb(255,255,153)`,`rgb(177,89,40)`]}}],vvt=[{name:`OrRd`,colors:{3:[`rgb(254,232,200)`,`rgb(253,187,132)`,`rgb(227,74,51)`],4:[`rgb(254,240,217)`,`rgb(253,204,138)`,`rgb(252,141,89)`,`rgb(215,48,31)`],5:[`rgb(254,240,217)`,`rgb(253,204,138)`,`rgb(252,141,89)`,`rgb(227,74,51)`,`rgb(179,0,0)`],6:[`rgb(254,240,217)`,`rgb(253,212,158)`,`rgb(253,187,132)`,`rgb(252,141,89)`,`rgb(227,74,51)`,`rgb(179,0,0)`],7:[`rgb(254,240,217)`,`rgb(253,212,158)`,`rgb(253,187,132)`,`rgb(252,141,89)`,`rgb(239,101,72)`,`rgb(215,48,31)`,`rgb(153,0,0)`],8:[`rgb(255,247,236)`,`rgb(254,232,200)`,`rgb(253,212,158)`,`rgb(253,187,132)`,`rgb(252,141,89)`,`rgb(239,101,72)`,`rgb(215,48,31)`,`rgb(153,0,0)`],9:[`rgb(255,247,236)`,`rgb(254,232,200)`,`rgb(253,212,158)`,`rgb(253,187,132)`,`rgb(252,141,89)`,`rgb(239,101,72)`,`rgb(215,48,31)`,`rgb(179,0,0)`,`rgb(127,0,0)`]}},{name:`PuBu`,colors:{3:[`rgb(236,231,242)`,`rgb(166,189,219)`,`rgb(43,140,190)`],4:[`rgb(241,238,246)`,`rgb(189,201,225)`,`rgb(116,169,207)`,`rgb(5,112,176)`],5:[`rgb(241,238,246)`,`rgb(189,201,225)`,`rgb(116,169,207)`,`rgb(43,140,190)`,`rgb(4,90,141)`],6:[`rgb(241,238,246)`,`rgb(208,209,230)`,`rgb(166,189,219)`,`rgb(116,169,207)`,`rgb(43,140,190)`,`rgb(4,90,141)`],7:[`rgb(241,238,246)`,`rgb(208,209,230)`,`rgb(166,189,219)`,`rgb(116,169,207)`,`rgb(54,144,192)`,`rgb(5,112,176)`,`rgb(3,78,123)`],8:[`rgb(255,247,251)`,`rgb(236,231,242)`,`rgb(208,209,230)`,`rgb(166,189,219)`,`rgb(116,169,207)`,`rgb(54,144,192)`,`rgb(5,112,176)`,`rgb(3,78,123)`],9:[`rgb(255,247,251)`,`rgb(236,231,242)`,`rgb(208,209,230)`,`rgb(166,189,219)`,`rgb(116,169,207)`,`rgb(54,144,192)`,`rgb(5,112,176)`,`rgb(4,90,141)`,`rgb(2,56,88)`]}},{name:`BuPu`,colors:{3:[`rgb(224,236,244)`,`rgb(158,188,218)`,`rgb(136,86,167)`],4:[`rgb(237,248,251)`,`rgb(179,205,227)`,`rgb(140,150,198)`,`rgb(136,65,157)`],5:[`rgb(237,248,251)`,`rgb(179,205,227)`,`rgb(140,150,198)`,`rgb(136,86,167)`,`rgb(129,15,124)`],6:
1416[`rgb(237,248,251)`,`rgb(191,211,230)`,`rgb(158,188,218)`,`rgb(140,150,198)`,`rgb(136,86,167)`,`rgb(129,15,124)`],7:[`rgb(237,248,251)`,`rgb(191,211,230)`,`rgb(158,188,218)`,`rgb(140,150,198)`,`rgb(140,107,177)`,`rgb(136,65,157)`,`rgb(110,1,107)`],8:[`rgb(247,252,253)`,`rgb(224,236,244)`,`rgb(191,211,230)`,`rgb(158,188,218)`,`rgb(140,150,198)`,`rgb(140,107,177)`,`rgb(136,65,157)`,`rgb(110,1,107)`],9:[`rgb(247,252,253)`,`rgb(224,236,244)`,`rgb(191,211,230)`,`rgb(158,188,218)`,`rgb(140,150,198)`,`rgb(140,107,177)`,`rgb(136,65,157)`,`rgb(129,15,124)`,`rgb(77,0,75)`]}},{name:`Oranges`,colors:{3:[`rgb(254,230,206)`,`rgb(253,174,107)`,`rgb(230,85,13)`],4:[`rgb(254,237,222)`,`rgb(253,190,133)`,`rgb(253,141,60)`,`rgb(217,71,1)`],5:[`rgb(254,237,222)`,`rgb(253,190,133)`,`rgb(253,141,60)`,`rgb(230,85,13)`,`rgb(166,54,3)`],6:[`rgb(254,237,222)`,`rgb(253,208,162)`,`rgb(253,174,107)`,`rgb(253,141,60)`,`rgb(230,85,13)`,`rgb(166,54,3)`],7:[`rgb(254,237,222)`,`rgb(253,208,162)`,`rgb(253,174,107)`,`rgb(253,141,60)`,`rgb(241,105,19)`,`rgb(217,72,1)`,`rgb(140,45,4)`],8:[`rgb(255,245,235)`,`rgb(254,230,206)`,`rgb(253,208,162)`,`rgb(253,174,107)`,`rgb(253,141,60)`,`rgb(241,105,19)`,`rgb(217,72,1)`,`rgb(140,45,4)`],9:[`rgb(255,245,235)`,`rgb(254,230,206)`,`rgb(253,208,162)`,`rgb(253,174,107)`,`rgb(253,141,60)`,`rgb(241,105,19)`,`rgb(217,72,1)`,`rgb(166,54,3)`,`rgb(127,39,4)`]}},{name:`BuGn`,colors:{3:[`rgb(229,245,249)`,`rgb(153,216,201)`,`rgb(44,162,95)`],4:[`rgb(237,248,251)`,`rgb(178,226,226)`,`rgb(102,194,164)`,`rgb(35,139,69)`],5:[`rgb(237,248,251)`,`rgb(178,226,226)`,`rgb(102,194,164)`,`rgb(44,162,95)`,`rgb(0,109,44)`],6:[`rgb(237,248,251)`,`rgb(204,236,230)`,`rgb(153,216,201)`,`rgb(102,194,164)`,`rgb(44,162,95)`,`rgb(0,109,44)`],7:[`rgb(237,248,251)`,`rgb(204,236,230)`,`rgb(153,216,201)`,`rgb(102,194,164)`,`rgb(65,174,118)`,`rgb(35,139,69)`,`rgb(0,88,36)`],8:[`rgb(247,252,253)`,`rgb(229,245,249)`,`rgb(204,236,230)`,`rgb(153,216,201)`,`rgb(102,194,164)`,`rgb(65,174,118)`,`rgb(35,139,69)`,`rgb(0,88,36)`],9:[`rgb(247,252,253)`,`rgb(229,245,249)`,`rgb(204,236,230)`,`rgb(153,216,201)`,`rgb(102,194,164)`,`rgb(65,174,118)`,`rgb(35,139,69)`,`rgb(0,109,44)`,`rgb(0,68,27)`]}},{name:`YlOrBr`,colors:{3:[`rgb(255,247,188)`,`rgb(254,196,79)`,`rgb(217,95,14)`],4:[`rgb(255,255,212)`,`rgb(254,217,142)`,`rgb(254,153,41)`,`rgb(204,76,2)`],5:[`rgb(255,255,212)`,`rgb(254,217,142)`,`rgb(254,153,41)`,`rgb(217,95,14)`,`rgb(153,52,4)`],6:[`rgb(255,255,212)`,`rgb(254,227,145)`,`rgb(254,196,79)`,`rgb(254,153,41)`,`rgb(217,95,14)`,`rgb(153,52,4)`],7:[`rgb(255,255,212)`,`rgb(254,227,145)`,`rgb(254,196,79)`,`rgb(254,153,41)`,`rgb(236,112,20)`,`rgb(204,76,2)`,`rgb(140,45,4)`],8:[`rgb(255,255,229)`,`rgb(255,247,188)`,`rgb(254,227,145)`,`rgb(254,196,79)`,`rgb(254,153,41)`,`rgb(236,112,20)`,`rgb(204,76,2)`,`rgb(140,45,4)`],9:[`rgb(255,255,229)`,`rgb(255,247,188)`,`rgb(254,227,145)`,`rgb(254,196,79)`,`rgb(254,153,41)`,`rgb(236,112,20)`,`rgb(204,76,2)`,`rgb(153,52,4)`,`rgb(102,37,6)`]}},{name:`YlGn`,colors:{3:[`rgb(247,252,185)`,`rgb(173,221,142)`,`rgb(49,163,84)`],4:[`rgb(255,255,204)`,`rgb(194,230,153)`,`rgb(120,198,121)`,`rgb(35,132,67)`],5:[`rgb(255,255,204)`,`rgb(194,230,153)`,`rgb(120,198,121)`,`rgb(49,163,84)`,`rgb(0,104,55)`],6:[`rgb(255,255,204)`,`rgb(217,240,163)`,`rgb(173,221,142)`,`rgb(120,198,121)`,`rgb(49,163,84)`,`rgb(0,104,55)`],7:[`rgb(255,255,204)`,`rgb(217,240,163)`,`rgb(173,221,142)`,`rgb(120,198,121)`,`rgb(65,171,93)`,`rgb(35,132,67)`,`rgb(0,90,50)`],8:[`rgb(255,255,229)`,`rgb(247,252,185)`,`rgb(217,240,163)`,`rgb(173,221,142)`,`rgb(120,198,121)`,`rgb(65,171,93)`,`rgb(35,132,67)`,`rgb(0,90,50)`],9:[`rgb(255,255,229)`,`rgb(247,252,185)`,`rgb(217,240,163)`,`rgb(173,221,142)`,`rgb(120,198,121)`,`rgb(65,171,93)`,`rgb(35,132,67)`,`rgb(0,104,55)`,`rgb(0,69,41)`]}},{name:`Reds`,colors:{3:[`rgb(254,224,210)`,`rgb(252,146,114)`,`rgb(222,45,38)`],4:[`rgb(254,229,217)`,`rgb(252,174,145)`,`rgb(251,106,74)`,`rgb(203,24,29)`],5:[`rgb(254,229,217)`,`rgb(252,174,145)`,`rgb(251,106,74)`,`rgb(222,45,38)`,`rgb(165,15,21)`],6:[`rgb(254,229,217)`,`rgb(252,187,161)`,`rgb(252,146,114)`,`rgb(251,106,74)`,`rgb(222,45,38)`,`rgb(165,15,21)`],7:[`rgb(254,229,217)`,`rgb(252,187,161)`,`rgb(252,146,114)`,`rgb(251,106,74)`,`rgb(239,59,44)`,`rgb(203,24,29)`,`rgb(153,0,13)`],8:[`rgb(255,245,240)`,`rgb(254,224,210)`,`rgb(252,187,161)`,`rgb(252,146,114)`,`rgb(251,106,74)`,`rgb(239,59,44)`,`rgb(203,24,29)`,`rgb(153,0,13)`],9:[`rgb(255,245,240)`,`rgb(254,224,210)`,`rgb(252,187,161)`,`rgb(252,146,114)`,`rgb(251,106,74)`,`rgb(239,59,44)`,`rgb(203,24,29)`,`rgb(165,15,21)`,`rgb(103,0,13)`]}},{name:`RdPu`,colors:{3:[`rgb(253,224,221)`,`rgb(250,159,181)`,`rgb(197,27,138)`],4:[`rgb(254,235,226)`,`rgb(251,180,185)`,`rgb(247,104,161)`,`rgb(174,1,126)`],5:[`rgb(254,235,226)`,`rgb(251,180,185)`,`rgb(247,104,161)`,`rgb(197,27,138)`,`rgb(122,1,119)`],6:[`rgb(254,235,226)`,`rgb(252,197,192)`,`rgb(250,159,181)`,`rgb(247,104,161)`,`rgb(197,27,138)`,`rgb(122,1,119)`],7:[`rgb(254,235,226)`,`rgb(252,197,192)`,`rgb(250,159,181)`,`rgb(247,104,161)`,`rgb(221,52,151)`,`rgb(174,1,126)`,`rgb(122,1,119)`],8:[`rgb(255,247,243)`,`rgb(253,224,221)`,`rgb(252,197,192)`,`rgb(250,159,181)`,`rgb(247,104,161)`,`rgb(221,52,151)`,`rgb(174,1,126)`,`rgb(122,1,119)`],9:[`rgb(255,247,243)`,`rgb(253,224,221)`,`rgb(252,197,192)`,`rgb(250,159,181)`,`rgb(247,104,161)`,`rgb(221,52,151)`,`rgb(174,1,126)`,`rgb(122,1,119)`,`rgb(73,0,106)`]}},{name:`Greens`,colors:{3:[`rgb(229,245,224)`,`rgb(161,217,155)`,`rgb(49,163,84)`],4:[`rgb(237,248,233)`,`rgb(186,228,179)`,`rgb(116,196,118)`,`rgb(35,139,69)`],5:[`rgb(237,248,233)`,`rgb(186,228,179)`,`rgb(116,196,118)`,`rgb(49,163,84)`,`rgb(0,109,44)`],6:[`rgb(237,248,233)`,`rgb(199,233,192)`,`rgb(161,217,155)`,`rgb(116,196,118)`,`rgb(49,163,84)`,`rgb(0,109,44)`],7:[`rgb(237,248,233)`,`rgb(199,233,192)`,`rgb(161,217,155)`,`rgb(116,196,118)`,`rgb(65,171,93)`,`rgb(35,139,69)`,`rgb(0,90,50)`],8:[`rgb(247,252,245)`,`rgb(229,245,224)`,`rgb(199,233,192)`,`rgb(161,217,155)`,`rgb(116,196,118)`,`rgb(65,171,93)`,`rgb(35,139,69)`,`rgb(0,90,50)`],9:[`rgb(247,252,245)`,`rgb(229,245,224)`,`rgb(199,233,192)`,`rgb(161,217,155)`,`rgb(116,196,118)`,`rgb(65,171,93)`,`rgb(35,139,69)`,`rgb(0,109,44)`,`rgb(0,68,27)`]}},{name:`YlGnBu`,colors:{3:[`rgb(237,248,177)`,`rgb(127,205,187)`,`rgb(44,127,184)`],4:[`rgb(255,255,204)`,`rgb(161,218,180)`,`rgb(65,182,196)`,`rgb(34,94,168)`],5:[`rgb(255,255,204)`,`rgb(161,218,180)`,`rgb(65,182,196)`,`rgb(44,127,184)`,`rgb(37,52,148)`],6:[`rgb(255,255,204)`,`rgb(199,233,180)`,`rgb(127,205,187)`,`rgb(65,182,196)`,`rgb(44,127,184)`,`rgb(37,52,148)`],7:[`rgb(255,255,204)`,`rgb(199,233,180)`,`rgb(127,205,187)`,`rgb(65,182,196)`,`rgb(29,145,192)`,`rgb(34,94,168)`,`rgb(12,44,132)`],8:[`rgb(255,255,217)`,`rgb(237,248,177)`,`rgb(199,233,180)`,`rgb(127,205,187)`,`rgb(65,182,196)`,`rgb(29,145,192)`,`rgb(34,94,168)`,`rgb(12,44,132)`],9:[`rgb(255,255,217)`,`rgb(237,248,177)`,`rgb(199,233,180)`,`rgb(127,205,187)`,`rgb(65,182,196)`,`rgb(29,145,192)`,`rgb(34,94,168)`,`rgb(37,52,148)`,`rgb(8,29,88)`]}
1416},{name:`Purples`,colors:{3:[`rgb(239,237,245)`,`rgb(188,189,220)`,`rgb(117,107,177)`],4:[`rgb(242,240,247)`,`rgb(203,201,226)`,`rgb(158,154,200)`,`rgb(106,81,163)`],5:[`rgb(242,240,247)`,`rgb(203,201,226)`,`rgb(158,154,200)`,`rgb(117,107,177)`,`rgb(84,39,143)`],6:[`rgb(242,240,247)`,`rgb(218,218,235)`,`rgb(188,189,220)`,`rgb(158,154,200)`,`rgb(117,107,177)`,`rgb(84,39,143)`],7:[`rgb(242,240,247)`,`rgb(218,218,235)`,`rgb(188,189,220)`,`rgb(158,154,200)`,`rgb(128,125,186)`,`rgb(106,81,163)`,`rgb(74,20,134)`],8:[`rgb(252,251,253)`,`rgb(239,237,245)`,`rgb(218,218,235)`,`rgb(188,189,220)`,`rgb(158,154,200)`,`rgb(128,125,186)`,`rgb(106,81,163)`,`rgb(74,20,134)`],9:[`rgb(252,251,253)`,`rgb(239,237,245)`,`rgb(218,218,235)`,`rgb(188,189,220)`,`rgb(158,154,200)`,`rgb(128,125,186)`,`rgb(106,81,163)`,`rgb(84,39,143)`,`rgb(63,0,125)`]}},{name:`GnBu`,colors:{3:[`rgb(224,243,219)`,`rgb(168,221,181)`,`rgb(67,162,202)`],4:[`rgb(240,249,232)`,`rgb(186,228,188)`,`rgb(123,204,196)`,`rgb(43,140,190)`],5:[`rgb(240,249,232)`,`rgb(186,228,188)`,`rgb(123,204,196)`,`rgb(67,162,202)`,`rgb(8,104,172)`],6:[`rgb(240,249,232)`,`rgb(204,235,197)`,`rgb(168,221,181)`,`rgb(123,204,196)`,`rgb(67,162,202)`,`rgb(8,104,172)`],7:[`rgb(240,249,232)`,`rgb(204,235,197)`,`rgb(168,221,181)`,`rgb(123,204,196)`,`rgb(78,179,211)`,`rgb(43,140,190)`,`rgb(8,88,158)`],8:[`rgb(247,252,240)`,`rgb(224,243,219)`,`rgb(204,235,197)`,`rgb(168,221,181)`,`rgb(123,204,196)`,`rgb(78,179,211)`,`rgb(43,140,190)`,`rgb(8,88,158)`],9:[`rgb(247,252,240)`,`rgb(224,243,219)`,`rgb(204,235,197)`,`rgb(168,221,181)`,`rgb(123,204,196)`,`rgb(78,179,211)`,`rgb(43,140,190)`,`rgb(8,104,172)`,`rgb(8,64,129)`]}},{name:`Greys`,colors:{3:[`rgb(240,240,240)`,`rgb(189,189,189)`,`rgb(99,99,99)`],4:[`rgb(247,247,247)`,`rgb(204,204,204)`,`rgb(150,150,150)`,`rgb(82,82,82)`],5:[`rgb(247,247,247)`,`rgb(204,204,204)`,`rgb(150,150,150)`,`rgb(99,99,99)`,`rgb(37,37,37)`],6:[`rgb(247,247,247)`,`rgb(217,217,217)`,`rgb(189,189,189)`,`rgb(150,150,150)`,`rgb(99,99,99)`,`rgb(37,37,37)`],7:[`rgb(247,247,247)`,`rgb(217,217,217)`,`rgb(189,189,189)`,`rgb(150,150,150)`,`rgb(115,115,115)`,`rgb(82,82,82)`,`rgb(37,37,37)`],8:[`rgb(255,255,255)`,`rgb(240,240,240)`,`rgb(217,217,217)`,`rgb(189,189,189)`,`rgb(150,150,150)`,`rgb(115,115,115)`,`rgb(82,82,82)`,`rgb(37,37,37)`],9:[`rgb(255,255,255)`,`rgb(240,240,240)`,`rgb(217,217,217)`,`rgb(189,189,189)`,`rgb(150,150,150)`,`rgb(115,115,115)`,`rgb(82,82,82)`,`rgb(37,37,37)`,`rgb(0,0,0)`]}},{name:`YlOrRd`,colors:{3:[`rgb(255,237,160)`,`rgb(254,178,76)`,`rgb(240,59,32)`],4:[`rgb(255,255,178)`,`rgb(254,204,92)`,`rgb(253,141,60)`,`rgb(227,26,28)`],5:[`rgb(255,255,178)`,`rgb(254,204,92)`,`rgb(253,141,60)`,`rgb(240,59,32)`,`rgb(189,0,38)`],6:[`rgb(255,255,178)`,`rgb(254,217,118)`,`rgb(254,178,76)`,`rgb(253,141,60)`,`rgb(240,59,32)`,`rgb(189,0,38)`],7:[`rgb(255,255,178)`,`rgb(254,217,118)`,`rgb(254,178,76)`,`rgb(253,141,60)`,`rgb(252,78,42)`,`rgb(227,26,28)`,`rgb(177,0,38)`],8:[`rgb(255,255,204)`,`rgb(255,237,160)`,`rgb(254,217,118)`,`rgb(254,178,76)`,`rgb(253,141,60)`,`rgb(252,78,42)`,`rgb(227,26,28)`,`rgb(177,0,38)`],9:[`rgb(255,255,204)`,`rgb(255,237,160)`,`rgb(254,217,118)`,`rgb(254,178,76)`,`rgb(253,141,60)`,`rgb(252,78,42)`,`rgb(227,26,28)`,`rgb(177,0,38)`,`rgb(128,0,38)`]}},{name:`PuRd`,colors:{3:[`rgb(231,225,239)`,`rgb(201,148,199)`,`rgb(221,28,119)`],4:[`rgb(241,238,246)`,`rgb(215,181,216)`,`rgb(223,101,176)`,`rgb(206,18,86)`],5:[`rgb(241,238,246)`,`rgb(215,181,216)`,`rgb(223,101,176)`,`rgb(221,28,119)`,`rgb(152,0,67)`],6:[`rgb(241,238,246)`,`rgb(212,185,218)`,`rgb(201,148,199)`,`rgb(223,101,176)`,`rgb(221,28,119)`,`rgb(152,0,67)`],7:[`rgb(241,238,246)`,`rgb(212,185,218)`,`rgb(201,148,199)`,`rgb(223,101,176)`,`rgb(231,41,138)`,`rgb(206,18,86)`,`rgb(145,0,63)`],8:[`rgb(247,244,249)`,`rgb(231,225,239)`,`rgb(212,185,218)`,`rgb(201,148,199)`,`rgb(223,101,176)`,`rgb(231,41,138)`,`rgb(206,18,86)`,`rgb(145,0,63)`],9:[`rgb(247,244,249)`,`rgb(231,225,239)`,`rgb(212,185,218)`,`rgb(201,148,199)`,`rgb(223,101,176)`,`rgb(231,41,138)`,`rgb(206,18,86)`,`rgb(152,0,67)`,`rgb(103,0,31)`]}},{name:`Blues`,colors:{3:[`rgb(222,235,247)`,`rgb(158,202,225)`,`rgb(49,130,189)`],4:[`rgb(239,243,255)`,`rgb(189,215,231)`,`rgb(107,174,214)`,`rgb(33,113,181)`],5:[`rgb(239,243,255)`,`rgb(189,215,231)`,`rgb(107,174,214)`,`rgb(49,130,189)`,`rgb(8,81,156)`],6:[`rgb(239,243,255)`,`rgb(198,219,239)`,`rgb(158,202,225)`,`rgb(107,174,214)`,`rgb(49,130,189)`,`rgb(8,81,156)`],7:[`rgb(239,243,255)`,`rgb(198,219,239)`,`rgb(158,202,225)`,`rgb(107,174,214)`,`rgb(66,
1416146,198)`,`rgb(33,113,181)`,`rgb(8,69,148)`],8:[`rgb(247,251,255)`,`rgb(222,235,247)`,`rgb(198,219,239)`,`rgb(158,202,225)`,`rgb(107,174,214)`,`rgb(66,146,198)`,`rgb(33,113,181)`,`rgb(8,69,148)`],9:[`rgb(247,251,255)`,`rgb(222,235,247)`,`rgb(198,219,239)`,`rgb(158,202,225)`,`rgb(107,174,214)`,`rgb(66,146,198)`,`rgb(33,113,181)`,`rgb(8,81,156)`,`rgb(8,48,107)`]}},{name:`PuBuGn`,colors:{3:[`rgb(236,226,240)`,`rgb(166,189,219)`,`rgb(28,144,153)`],4:[`rgb(246,239,247)`,`rgb(189,201,225)`,`rgb(103,169,207)`,`rgb(2,129,138)`],5:[`rgb(246,239,247)`,`rgb(189,201,225)`,`rgb(103,169,207)`,`rgb(28,144,153)`,`rgb(1,108,89)`],6:[`rgb(246,239,247)`,`rgb(208,209,230)`,`rgb(166,189,219)`,`rgb(103,169,207)`,`rgb(28,144,153)`,`rgb(1,108,89)`],7:[`rgb(246,239,247)`,`rgb(208,209,230)`,`rgb(166,189,219)`,`rgb(103,169,207)`,`rgb(54,144,192)`,`rgb(2,129,138)`,`rgb(1,100,80)`],8:[`rgb(255,247,251)`,`rgb(236,226,240)`,`rgb(208,209,230)`,`rgb(166,189,219)`,`rgb(103,169,207)`,`rgb(54,144,192)`,`rgb(2,129,138)`,`rgb(1,100,80)`],9:[`rgb(255,247,251)`,`rgb(236,226,240)`,`rgb(208,209,230)`,`rgb(166,189,219)`,`rgb(103,169,207)`,`rgb(54,144,192)`,`rgb(2,129,138)`,`rgb(1,108,89)`,`rgb(1,70,54)`]}}],yvt=[{name:`Burg`,colors:{2:[`#ffc6c4`,`#672044`],3:[`#ffc6c4`,`#cc607d`,`#672044`],4:[`#ffc6c4`,`#e38191`,`#ad466c`,`#672044`],5:[`#ffc6c4`,`#ee919b`,`#cc607d`,`#9e3963`,`#672044`],6:[`#ffc6c4`,`#f29ca3`,`#da7489`,`#b95073`,`#93345d`,`#672044`],7:[`#ffc6c4`,`#f4a3a8`,`#e38191`,`#cc607d`,`#ad466c`,`#8b3058`,`#672044`]},tags:[`quantitative`]},{name:`BurgYl`,colors:{2:[`#fbe6c5`,`#70284a`],3:[`#fbe6c5`,`#dc7176`,`#70284a`],4:[`#fbe6c5`,`#ee8a82`,`#c8586c`,`#70284a`],5:[`#fbe6c5`,`#f2a28a`,`#dc7176`,`#b24b65`,`#70284a`],6:[`#fbe6c5`,`#f4b191`,`#e7807d`,`#d06270`,`#a44360`,`#70284a`],7:[`#fbe6c5`,`#f5ba98`,`#ee8a82`,`#dc7176`,`#c8586c`,`#9c3f5d`,`#70284a`]},tags:[`quantitative`]},{name:`RedOr`,colors:{2:[`#f6d2a9`,`#b13f64`],3:[`#f6d2a9`,`#ea8171`,`#b13f64`],4:[`#f6d2a9`,`#f19c7c`,`#dd686c`,`#b13f64`],5:[`#f6d2a9`,`#f3aa84`,`#ea8171`,`#d55d6a`,`#b13f64`],6:[`#f6d2a9`,`#f4b28a`,`#ef9177`,`#e3726d`,`#cf5669`,`#b13f64`],7:[`#f6d2a9`,`#f5b78e`,`#f19c7c`,`#ea8171`,`#dd686c`,`#ca5268`,`#b13f64`]},tags:[`quantitative`]},{name:`OrYel`,colors:{2:[`#ecda9a`,`#ee4d5a`],3:[`#ecda9a`,`#f7945d`,`#ee4d5a`],4:[`#ecda9a`,`#f3ad6a`,`#f97b57`,`#ee4d5a`],5:[`#ecda9a`,`#f1b973`,`#f7945d`,`#f86f56`,`#ee4d5a`],6:[`#ecda9a`,`#f0c079`,`#f5a363`,`#f98558`,`#f76856`,`#ee4d5a`],7:[`#ecda9a`,`#efc47e`,`#f3ad6a`,`#f7945d`,`#f97b57`,`#f66356`,`#ee4d5a`]},tags:[`quantitative`]},{name:`Peach`,colors:{2:[`#fde0c5`,`#eb4a40`],3:[`#fde0c5`,`#f59e72`,`#eb4a40`],4:[`#fde0c5`,`#f8b58b`,`#f2855d`,`#eb4a40`],5:[`#fde0c5`,`#f9c098`,`#f59e72`,`#f17854`,`#eb4a40`],6:[`#fde0c5`,`#fac7a1`,`#f7ac80`,`#f38f65`,`#f0704f`,`#eb4a40`],7:[`#fde0c5`,`#facba6`,`#f8b58b`,`#f59e72`,`#f2855d`,`#ef6a4c`,`#eb4a40`]},tags:[`quantitative`]},{name:`PinkYl`,colors:{2:[`#fef6b5`,`#e15383`],3:[`#fef6b5`,`#ffa679`,`#e15383`],4:[`#fef6b5`,`#ffc285`,`#fa8a76`,`#e15383`],5:[`#fef6b5`,`#ffd08e`,`#ffa679`,`#f67b77`,`#e15383`],6:[`#fef6b5`,`#ffd795`,`#ffb77f`,`#fd9576`,`#f37378`,`#e15383`],7:[`#fef6b5`,`#ffdd9a`,`#ffc285`,`#ffa679`,`#fa8a76`,`#f16d7a`,`#e15383`]},tags:[`quantitative`]},{name:`Mint`,colors:{2:[`#e4f1e1`,`#0d585f`],3:[`#e4f1e1`,`#63a6a0`,`#0d585f`],4:[`#e4f1e1`,`#89c0b6`,`#448c8a`,`#0d585f`],5:[`#E4F1E1`,`#9CCDC1`,`#63A6A0`,`#337F7F`,`#0D585F`],6:[`#e4f1e1`,`#abd4c7`,`#7ab5ad`,`#509693`,`#2c7778`,`#0d585f`],7:[`#e4f1e1`,`#b4d9cc`,`#89c0b6`,`#63a6a0`,`#448c8a`,`#287274`,`#0d585f`]},tags:[`quantitative`]},{name:`BluGrn`,colors:{2:[`#c4e6c3`,`#1d4f60`],3:[`#c4e6c3`,`#4da284`,`#1d4f60`],4:[`#c4e6c3`,`#6dbc90`,`#36877a`,`#1d4f60`],5:[`#c4e6c3`,`#80c799`,`#4da284`,`#2d7974`,`#1d4f60`],6:[`#c4e6c3`,`#8dce9f`,`#5fb28b`,`#3e927e`,`#297071`,`#1d4f60`],7:[`#c4e6c3`,`#96d2a4`,`#6dbc90`,`#4da284`,`#36877a`,`#266b6e`,`#1d4f60`]},tags:[`quantitative`]},{name:`DarkMint`,colors:{2:[`#d2fbd4`,`#123f5a`],3:[`#d2fbd4`,`#559c9e`,`#123f5a`],4:[`#d2fbd4`,`#7bbcb0`,`#3a7c89`,`#123f5a`],5:[`#d2fbd4`,`#8eccb9`,`#559c9e`,`#2b6c7f`,`#123f5a`],6:[`#d2fbd4`,`#9cd5be`,`#6cafa9`,`#458892`,`#266377`,`#123f5a`],7:[`#d2fbd4`,`#a5dbc2`,`#7bbcb0`,`#559c9e`,`#3a7c89`,`#235d72`,`#123f5a`]},tags:[`quantitative`]},{name:`Emrld`,colors:{2:[`#d3f2a3`,`#074050`],3:[`#d3f2a3`,`#4c9b82`,`#074050`],4:[`#d3f2a3`,`#6cc08b`,`#217a79`,`#074050`],5:[`#d3f2a3`,`#82d091`,`#4c9b82`,`#19696f`,`#074050`],6:[`#d3f2a3`,`#8fda94`,`#60b187`,`#35877d`,`#145f69`,`#074050`],7:[`#d3f2a3`,`#97e196`,`#6cc08b`,`#4c9b82`,`#217a79`,`#105965`,`#074050`]},tags:[`quantitative`]},{name:`ag_GrnYl`,colors:{2:[`#245668`,`#EDEF5D`],3:[`#245668`,`#39AB7E`,`#EDEF5D`],4:[`#245668`,`#0D8F81`,`#6EC574`,`#EDEF5D`],5:[`#245668`,`#04817E`,`#39AB7E`,`#8BD16D`,`#EDE
1416F5D`],6:[`#245668`,`#09787C`,`#1D9A81`,`#58BB79`,`#9DD869`,`#EDEF5D`],7:[`#245668`,`#0F7279`,`#0D8F81`,`#39AB7E`,`#6EC574`,`#A9DC67`,`#EDEF5D`]},tags:[`aggregation`]},{name:`BluYl`,colors:{2:[`#f7feae`,`#045275`],3:[`#f7feae`,`#46aea0`,`#045275`],4:[`#f7feae`,`#7ccba2`,`#089099`,`#045275`],5:[`#f7feae`,`#9bd8a4`,`#46aea0`,`#058092`,`#045275`],6:[`#f7feae`,`#ace1a4`,`#68bfa1`,`#2a9c9c`,`#02778e`,`#045275`],7:[`#f7feae`,`#b7e6a5`,`#7ccba2`,`#46aea0`,`#089099`,`#00718b`,`#045275`]},tags:[`quantitative`]},{name:`Teal`,colors:{2:[`#d1eeea`,`#2a5674`],3:[`#d1eeea`,`#68abb8`,`#2a5674`],4:[`#d1eeea`,`#85c4c9`,`#4f90a6`,`#2a5674`],5:[`#d1eeea`,`#96d0d1`,`#68abb8`,`#45829b`,`#2a5674`],6:[`#d1eeea`,`#a1d7d6`,`#79bbc3`,`#599bae`,`#3f7994`,`#2a5674`],7:[`#d1eeea`,`#a8dbd9`,`#85c4c9`,`#68abb8`,`#4f90a6`,`#3b738f`,`#2a5674`]},tags:[`quantitative`]},{name:`TealGrn`,colors:{2:[`#b0f2bc`,`#257d98`],3:[`#b0f2bc`,`#4cc8a3`,`#257d98`],4:[`#b0f2bc`,`#67dba5`,`#38b2a3`,`#257d98`],5:[`#b0f2bc`,`#77e2a8`,`#4cc8a3`,`#31a6a2`,`#257d98`],6:[`#b0f2bc`,`#82e6aa`,`#5bd4a4`,`#3fbba3`,`#2e9ea1`,`#257d98`],7:[`#b0f2bc`,`#89e8ac`,`#67dba5`,`#4cc8a3`,`#38b2a3`,`#2c98a0`,`#257d98`]},tags:[`quantitative`]},{name:`Purp`,colors:{2:[`#f3e0f7`,`#63589f`],3:[`#f3e0f7`,`#b998dd`,`#63589f`],4:[`#f3e0f7`,`#d1afe8`,`#9f82ce`,`#63589f`],5:[`#f3e0f7`,`#dbbaed`,`#b998dd`,`#9178c4`,`#63589f`],6:[`#f3e0f7`,`#e0c2ef`,`#c8a5e4`,`#aa8bd4`,`#8871be`,`#63589f`],7:[`#f3e0f7`,`#e4c7f1`,`#d1afe8`,`#b998dd`,`#9f82ce`,`#826dba`,`#63589f`]},tags:[`quantitative`]},{name:`PurpOr`,colors:{2:[`#f9ddda`,`#573b88`],3:[`#f9ddda`,`#ce78b3`,`#573b88`],4:[`#f9ddda`,`#e597b9`,`#ad5fad`,`#573b88`],5:[`#f9ddda`,`#eda8bd`,`#ce78b3`,`#9955a8`,`#573b88`],6:[`#f9ddda`,`#f0b2c1`,`#dd8ab6`,`#bb69b0`,`#8c4fa4`,`#573b88`],7:[`#f9ddda`,`#f2b9c4`,`#e597b9`,`#ce78b3`,`#ad5fad`,`#834ba0`,`#573b88`]},tags:[`quantitative`]},{name:`Sunset`,colors:{2:[`#f3e79b`,`#5c53a5`],3:[`#f3e79b`,`#eb7f86`,`#5c53a5`],4:[`#f3e79b`,`#f8a07e`,`#ce6693`,`#5c53a5`],5:[`#f3e79b`,`#fab27f`,`#eb7f86`,`#b95e9a`,`#5c53a5`],6:[`#f3e79b`,`#fabc82`,`#f59280`,`#dc6f8e`,`#ab5b9e`,`#5c53a5`],7:[`#f3e79b`,`#fac484`,`#f8a07e`,`#eb7f86`,`#ce6693`,`#a059a0`,`#5c53a5`]},tags:[`quantitative`]},{name:`Magenta`,colors:{2:[`#f3cbd3`,`#6c2167`],3:[`#f3cbd3`,`#ca699d`,`#6c2167`],4:[`#f3cbd3`,`#dd88ac`,`#b14d8e`,`#6c2167`],5:[`#f3cbd3`,`#e498b4`,`#ca699d`,`#a24186`,`#6c2167`],6:[`#f3cbd3`,`#e7a2b9`,`#d67ba5`,`#bc5894`,`#983a81`,`#6c2167`],7:[`#f3cbd3`,`#eaa9bd`,`#dd88ac`,`#ca699d`,`#b14d8e`,`#91357d`,`#6c2167`]},tags:[`quantitative`]},{name:`SunsetDark`,colors:{2:[`#fcde9c`,`#7c1d6f`],3:[`#fcde9c`,`#e34f6f`,`#7c1d6f`],4:[`#fcde9c`,`#f0746e`,`#dc3977`,`#7c1d6f`],5:[`#fcde9c`,`#f58670`,`#e34f6f`,`#d72d7c`,`#7c1d6f`],6:[`#fcde9c`,`#f89872`,`#ec666d`,`#df4273`,`#c5287b`,`#7c1d6f`],7:[`#fcde9c`,`#faa476`,`#f0746e`,`#e34f6f`,`#dc3977`,`#b9257a`,`#7c1d6f`]},tags:[`quantitative`]},{name:`ag_Sunset`,colors:{2:[`#4b2991`,`#edd9a3`],3:[`#4b2991`,`#ea4f88`,`#edd9a3`],4:[`#4b2991`,`#c0369d`,`#fa7876`,`#edd9a3`],5:[`#4b2991`,`#a52fa2`,`#ea4f88`,`#fa9074`,`#edd9a3`],6:[`#4b2991`,`#932da3`,`#d43f96`,`#f7667c`,`#f89f77`,`#edd9a3`],7:[`#4b2991`,`#872ca2`,`#c0369d`,`#ea4f88`,`#fa7876`,`#f6a97a`,`#edd9a3`]},tags:[`aggregation`]},{name:`BrwnYl`,colors:{2:[`#ede5cf`,`#541f3f`],3:[`#ede5cf`,`#c1766f`,`#541f3f`],4:[`#ede5cf`,`#d39c83`,`#a65461`,`#541f3f`],5:[`#ede5cf`,`#daaf91`,`#c1766f`,`#95455a`,`#541f3f`],6:[`#ede5cf`,`#ddba9b`,`#cd8c7a`,`#b26166`,`#8a3c56`,`#541f3f`],7:[`#ede5cf`,`#e0c2a2`,`#d39c83`,`#c1766f`,`#a65461`,`#813753`,`#541f3f`]},tags:[`quantitative`]}],bvt=[{name:`ArmyRose`,colors:{2:[`#929b4f`,`#db8195`],3:[`#a3ad62`,`#fdfbe4`,`#df91a3`],4:[`#929b4f`,`#d9dbaf`,`#f3d1ca`,`#db8195`],5:[`#879043`,`#c1c68c`,`#fdfbe4`,`#ebb4b8`,`#d8758b`],6:[`#7f883b`,`#b0b874`,`#e3e4be`,`#f6ddd1`,`#e4a0ac`,`#d66d85`],7:[`#798234`,`#a3ad62`,`#d0d3a2`,`#fdfbe4`,`#f0c6c3`,`#df91a3`,`#d46780`]},tags:[`diverging`]},{name:`Fall`,colors:{2:[`#3d5941`,`#ca562c`],3:[`#3d5941`,`#f6edbd`,`#ca562c`],4:[`#3d5941`,`#b5b991`,`#edbb8a`,`#ca562c`],5:[`#3d5941`,`#96a07c`,`#f6edbd`,`#e6a272`,`#ca562c`],6:[`#3d5941`,`#839170`,`#cecea2`,`#f1cf9e`,`#e19464`,`#ca562c`],7:[`#3d5941`,`#778868`,`#b5b991`,`#f6edbd`,`#edbb8a`,`#de8a5a`,`#ca562c`]},tags:[`diverging`]},{name:`Geyser`,colors:{2:[`#008080`,`#ca562c`],3:[`#008080`,`#f6edbd`,`#ca562c`],4:[`#008080`,`#b4c8a8`,`#edbb8a`,`#ca562c`],5:[`#008080`,`#92b69e`,`#f6edbd`,`#e6a272`,`#ca562c`],6:[`#008080`,`#7eab98`,`#ced7b1`,`#f1cf9e`,`#e19464`,`#ca562c`],7:[`#008080`,`#70a494`,`#b4c8a8`,`#f6edbd`,`#edbb8a`,`#de8a5a`,`#ca562c`]},tags:[`diverging`]},{name:`Temps`,colors:{2:[`#009392`,`#cf597e`],3:[`#009392`,`#e9e29c`,`#cf597e`],4:[`#009392`,`#9ccb86`,`#eeb479`,`#cf597e`],5:[`#009392`,`#71be83`,`#e9e29c`,`#ed9c72`,`#cf597e`],6:[`#009392`,`#52b684`,`#bcd48c`,`#edc783`,`#eb8d71`,`#cf597e`],7:[`#009392`,`#39b185`,`#9ccb86`,`#e9e29c`,`#eeb479`,`#e88471`,`#cf597e`]},tags:[`diverging`]},{name:`TealRose`,colors:{2:[`#009392`,`#d0587e`],3:[`#009392`,`#f1eac8`,`#d0587e`],4:[`#009392`,`#91b8aa`,`#f1eac8`,`#dfa0a0`,`#d0587e`],5:[`#009392`,`#91b8aa`,`#f1eac8`,`#dfa0a0`,`#d0587e`],6:[`#009392`,`#72aaa1`,`#b1c7b3`,`#e5b9ad`,`#d98994`,`#d0587e`],7:[`#009392`,`#72aaa1`,`#b1c7b3`,`#f1eac8`,`#e5b9ad`,`#d98994`,`#d0587e`]},tags:[`diverging`]},{name:`Tropic`,colors:{2:[`#009B9E`,`#C75DAB`],3:[`#009B9E`,`#F1F1F1`,`#C75DAB`],4:[`#009B9E`,`#A7D3D4`,`#E4C1D9`,`#C75DAB`],5:[`#009B9E`,`#7CC5C6`,`#F1F1F1`,`#DDA9CD`,`#C75DAB`],6:[`#009B9E`,`#5DBCBE`,`#C6DFDF`,`#E9D4E2`,`#D99BC6`,`#C75DAB`],7:[`#009B9E`,`#42B7B9`,`#A7D3D4`,`#F1F1F1`,`#E4C1D9`,`#D691C1`,`#C75DAB`]},tags:[`diverging`]},{name:`Earth`,colors:{2:[`#A16928`,`#2887a1`],3:[`#A16928`,`#edeac2`,`#2887a1`],4:[`#A16928`,`#d6bd8d`,`#b5c8b8`,`#2887a1`],5:[`#A16928`,`#caa873`,`#edeac2`,`#98b7b2`,`#2887a1`],6:[`#A16928`,`#c29b64`,`#e0cfa2`,`#cbd5bc`,`#85adaf`,`#2887a1`],7:[`#A16928`,`#bd925a`,`#d6bd8d`,`#edeac2`,`#b5c8b8`,`#79a7ac`,`#2887a1`]},tags:[`diverging`]}],xvt=[{name:`Antique`,colors:{2:[`#855C75`,`#D9AF6B`,`#7C7C7C`],3:[`#855C75`,`#D9AF6B`,`#AF6458`,`#7C7C7C`],4:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#7C7C7C`],5:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#7C7C7C`],6:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#7C7C7C`],7:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#7C7C7C`],8:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#9C9C5E`,`#7C7C7C`],9:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#9C9C5E`,`#A06177`,`#7C7C7C`],10:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#9C9C5E`,`#A06177`,`#8C785D`,`#7C7C7C`],11:[`#855C75`,`#D9AF6B`,`#AF6458`,`#736F4C`,`#526A83`,`#625377`,`#68855C`,`#9C9C5E`,`#A06177`,`#8C785D`,`#467378`,`#7C7C7C`]},tags:[`qualitative`]},{name:`Bold`,colors:{2:[`#7F3C8D`,`#11A579`,`#A5AA99`],3:[`#7F3C8D`,`#11A579`,`#3969AC`,`#A5AA99`],4:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#A5AA99`],5:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#A5AA99`],6:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#A5AA99`],7:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#A5AA99`],8:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#008695`,`#A5AA99`],9:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#008695`,`#CF1C90`,`#A5AA99`],10:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#008695`,`#CF1C90`,`#f97b72`,`#A5AA99`],11:[`#7F3C8D`,`#11A579`,`#3969AC`,`#F2B701`,`#E73F74`,`#80BA5A`,`#E68310`,`#008695`,`#CF1C90`,`#f97b72`,`#4b4b8f`,`#A5AA99`]},tags:[`qualitative`]},{name:`Pastel`,colors:{2:[`#66C5CC`,`#F6CF71`,`#B3B3B3`],3:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#B3B3B3`],4:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#B3B3B3`],5:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#B3B3B3`],6:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#B3B3B3`],7:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#B3B3B3`],8:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#C9DB74`,`#B3B3B3`],9:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#C9DB74`,`#8BE0A4`,`#B3B3B3`],10:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#C9DB74`,`#8BE0A4`,`#B497E7`,`#B3B3B3`],11:[`#66C5CC`,`#F6CF71`,`#F89C74`,`#DCB0F2`,`#87C55F`,`#9EB9F3`,`#FE88B1`,`#C9DB74`,`#8BE0A4`,`#B497E7`,`#D3B484`,`#B3B3B3`]},tags:[`qualitative`]},{name:`Prism`,colors:{2:[`#5F4690`,`#1D6996`,`#666666`],3:[`#5F4690`,`#1D6996`,`#38A6A5`,`#666666`],4:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#666666`],5:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#666666`],6:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#666666`],7:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#666666`],8:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#CC503E`,`#666666`],9:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#CC503E`,`#94346E`,`#666666`],10:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#CC503E`,`#94346E`,`#6F4070`,`#666666`],11:[`#5F4690`,`#1D6996`,`#38A6A5`,`#0F8554`,`#73AF48`,`#EDAD08`,`#E17C05`,`#CC503E`,`#94346E`,`#6F4070`,`#994E95`,`#666666`]},tags:[`qualitative`]},{name:`Safe`,colors:{2:[`#88CCEE`,`#CC6677`,`#888888`],3:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#888888`],4:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#888888`],5:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#888888`],6:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#888888`],7:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#888888`],8:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#999933`,`#888888`],9:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#999933`,`#882255`,`#888888`],10:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#999933`,`#882255`,`#661100`,`#888888`],11:[`#88CCEE`,`#CC6677`,`#DDCC77`,`#117733`,`#332288`,`#AA4499`,`#44AA99`,`#999933`,`#882255`,`#661100`,`#6699CC`,`#888888`]},tags:[`qualitative`,`colorblind`]},{name:`Vivid`,colors:{2:[`#E58606`,`#5D69B1`,`#A5AA99`],3:[`#E58606`,`#5D69B1`,`#52BCA3`,`#A5AA99`],4:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#A5AA99`],5:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#A5AA99`],6:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#A5AA99`],7:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#A5AA99`],8:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#2F8AC4`,`#A5AA99`],9:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#2F8AC4`,`#764E9F`,`#A5AA99`],10:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#2F8AC4`,`#764E9F`,`#
1416ED645A`,`#A5AA99`],11:[`#E58606`,`#5D69B1`,`#52BCA3`,`#99C945`,`#CC61B0`,`#24796C`,`#DAA51B`,`#2F8AC4`,`#764E9F`,`#ED645A`,`#CC3A8E`,`#A5AA99`]},tags:[`qualitative`]}],E9=[...vvt,..._vt,...T9,...bvt,...yvt,...xvt];function Svt(e){return`const properties = feature.properties || {};
1417  const fallback = ${JSON.stringify(e.defaultColor)};
1418  const property = ${JSON.stringify(e.property)};
1419  const drivenValue = properties[property];`}function Cvt(e){let{simplestyle:t}=e;function n({symbolization:e,color:n}){return`return {
1420    color: ${t?`properties.stroke || `:``}${n?`color || `:``}${JSON.stringify(e.defaultColor)},
1421    weight: ${e.simplestyle?`properties['stroke-width'] || `:``}2,
1422    opacity: ${e.simplestyle?`properties['stroke-opacity'] || `:``}1,
1423    fillColor: ${e.simplestyle?`properties['fill'] || `:``}${n?`color || `:``}${JSON.stringify(e.defaultColor)},
1424    fillOpacity: ${e.simplestyle?`properties['fill-opacity'] || `:``}0.5,
1425  }`}switch(e.type){case`categorical`:return`function style(feature) {
1426  ${Svt(e)}
1427  // Data-driven styles
1428  const ramp = ${JSON.stringify(Object.fromEntries(e.stops.map(e=>[e.input,e.output])),null,2)};
1429  const color = ramp[drivenValue] || fallback;
1430  ${n({symbolization:e,color:!0})}
1431}`;case`ramp`:return`function style(feature) {
1432  ${Svt(e)}
1433
1434  const ramp = ${JSON.stringify(e.stops.flatMap(e=>[e.input,e.output]),null,2)};
1435
1436  let color = fallback;
1437  for (let i = 0; i < ramp.length; i += 2) {
1438    if (drivenValue >= ramp[i]) {
1439      color = ramp[i + 1];
1440    }
1441  }
1442  
1443  ${n({symbolization:e,color:!0})}
1444}`;case`none`:return`function style(feature) {
1445  const properties = feature.properties || {};
1446  ${n({symbolization:e,color:!1})}
1447}`}}function wvt(e){return[{name:`MapLibre Style: Line`,value:JSON.stringify(jE(e,!0),null,2)},{name:`MapLibre Style: Fill`,value:JSON.stringify(AE(e,!0),null,2)},{name:`MapLibre Style: Circle`,value:JSON.stringify(kE(e,!1),null,2)},{name:`MapLibre Expression`,value:JSON.stringify(EE({symbolization:{...e,simplestyle:!1}}),null,2)},{name:`Leaflet`,value:Cvt(e)}]}var Tvt=i(((e,t)=>{var n=HS(),r=P_(),i=F_();function a(e){return function(t,a,o){var s=Object(t);if(!r(t)){var c=n(a,3);t=i(t),a=function(e){return c(s[e],e,s)}}var l=e(t,a,o);return l>-1?s[c?t[l]:l]:void 0}}t.exports=a})),Evt=i(((e,t)=>{var n=W_(),r=HS(),i=U_(),a=Math.max;function o(e,t,o){var s=e==null?0:e.length;if(!s)return-1;var c=o==null?0:i(o);return c<0&&(c=a(s+c,0)),n(e,r(t,3),c)}t.exports=o})),Dvt=e(i(((e,t)=>{t.exports=Tvt()(Evt())}))()),D9=zv(!1),O9=7;function Ovt(){return(0,H.jsx)(`div`,{children:(0,H.jsx)(Yp,{asChild:!0,children:(0,H.jsx)(Fg,{children:`Done`})})})}function kvt(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(bg,{children:`Interpolate`}),(0,H.jsxs)(rg,{as:`select`,name:`interpolate`,required:!0,className:`${Ig({size:`sm`})} w-full`,children:[(0,H.jsx)(`option`,{value:`linear`,children:`Linear`}),(0,H.jsx)(`option`,{value:`step`,children:`Step`})]})]})}function Avt(e){let t=new Map;for(let n of e.values())for(let[e,r]of Object.entries(n.feature.properties||{}))if(typeof r==`number`||typeof r==`string`){let n=t.get(e);n?n.add(r):t.set(e,new Set([r]))}return t}function jvt(e){return(0,B.useMemo)(()=>Avt(e),[e,e.version])}function Mvt(e){let t=new Map;for(let n of e.values())for(let[e,r]of Object.entries(n.feature.properties||{}))if(typeof r==`number`){let n=t.get(e);n?n.push(r):t.set(e,[r])}for(let e of t.values())e.sort();return t}function Nvt(e){return(0,B.useMemo)(()=>Mvt(e),[e,e.version])}function k9({name:e,interpolate:t,classes:n}){let r=(0,Dvt.default)(E9,{name:e}),i=r.colors[n]||r.colors[O9];return(0,H.jsx)(`div`,{title:e,className:`w-full h-5 border`,style:{background:G0e({colors:i,interpolate:t}),borderColor:i[i.length-1]}})}function Pvt({form:e,ramp:t,field:n}){return(0,H.jsxs)(`label`,{className:`hover:cursor-pointer hover:ring-1 dark:ring-white ring-gray-200`,children:[(0,H.jsx)(`input`,{className:`hidden`,type:`radio`,...n,value:t.name}),(0,H.jsx)(k9,{name:t.name,classes:e.values.classes||O9,interpolate:e.values.interpolate||`step`})]},t.name)}function A9(){return Xgt(),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(rg,{type:`checkbox`,className:ug({variant:`default`}),name:`simplestyle`}),(0,H.jsxs)(bg,{children:[`Allow literal styles in data`,` `,(0,H.jsx)(lse,{children:`Allows features with simplestyle attributes to override data-driven styles.`})]})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(`div`,{className:`whitespace-nowrap`,children:(0,H.jsx)(bg,{children:`Default color`})}),(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(rg,{component:h9,name:`defaultColor`,_size:`sm`,className:Lg({_size:`sm`})})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(`div`,{className:`whitespace-nowrap`,children:(0,H.jsx)(bg,{children:`Default fill opacity`})}),(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(rg,{type:`number`,min:`0`,max:`1`,name:`defaultOpacity`,step:`0.01`,_size:`sm`,className:Lg({_size:`sm`})})]})]})}function j9({label:e,colors:t,fieldProps:n}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(bg,{children:e}),(0,H.jsx)(`div`,{className:`grid gap-x-2 gap-y-2 grid-cols-3`,children:t.map(e=>(0,H.jsx)(Pvt,{form:n.form,ramp:e,field:n.field},e.name))})]})}function Fvt(){let[e,t]=i_().useMetadata(),{featureMap:n}=Yv(Wx),r=Nvt(n),[i,a]=Zv(D9),[o,s]=(0,B.useState)(null);return i?(0,H.jsx)(eg,{onSubmit:async e=>{let n=E9.find(t=>t.name===e.rampName),i=r.get(e.property),o=n.colors[e.classes];function s({colors:e}){let[t,n]=Zwe(i);return e.map((e,r,i)=>({input:+ale(t,n,r/(i.length-1)).toFixed(4),output:e}))}function c({colors:e}){return e.map((e,t,n)=>({input:rTe(i,t/(n.length-1))||0,output:e}
1447)).filter((e,t,n)=>t===0?!0:n[t-1].input!==e.input)}let l={type:`ramp`,simplestyle:e.simplestyle,property:e.property,interpolate:e.interpolate,rampName:e.rampName,defaultColor:e.defaultColor,defaultOpacity:e.defaultOpacity,stops:e.breaks===`linear`?s({colors:o}):c({colors:o})};await Promise.resolve(t({symbolization:l})).catch(()=>{pE.error(`Failed to generate ramp`)}),a(!1)},initialValues:{property:e.symbolization?.type===`ramp`?e.symbolization.property:``,defaultColor:l,defaultOpacity:e.symbolization.defaultOpacity,interpolate:e.symbolization?.type===`ramp`?e.symbolization.interpolate:`step`,simplestyle:e.symbolization?.type===`ramp`?e.symbolization.simplestyle:!0,breaks:`linear`,rampName:`RdPu`,classes:O9},children:(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{className:``,children:(0,H.jsx)(bg,{children:`Input property`})}),(0,H.jsxs)(rg,{as:`select`,name:`property`,required:!0,className:`${Ig({size:`sm`})} w-full`,children:[(0,H.jsx)(`option`,{value:``,children:`Select…`}),Array.from(r.keys(),e=>(0,H.jsx)(`option`,{value:e,children:e},e))]})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(bg,{children:`Class breaks`}),(0,H.jsxs)(rg,{as:`select`,name:`breaks`,required:!0,className:`${Ig({size:`sm`})} w-full`,children:[(0,H.jsx)(`option`,{value:`linear`,children:`Linear`}),(0,H.jsx)(`option`,{value:`quantile`,children:`Quantile`})]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(bg,{children:`Ramp`}),(0,H.jsx)(rg,{name:`rampName`,children:e=>{let{field:t,form:n}=e;return(0,H.jsxs)(Kp,{children:[(0,H.jsxs)(jse,{children:[(0,H.jsx)(k9,{name:t.value,classes:n.values.classes,interpolate:n.values.interpolate}),(0,H.jsx)(at,{className:`w-5 h-5 shrink-0`})]}),(0,H.jsxs)(vg,{side:`left`,children:[(0,H.jsx)(hg,{}),(0,H.jsxs)(`div`,{style:{maxHeight:480},className:`space-y-2 p-1 overflow-y-auto placemark-scrollbar`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-2`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(bg,{children:`Classes`}),(0,H.jsx)(rg,{as:`select`,name:`classes`,required:!0,className:`${Ig({size:`sm`})} w-full`,children:oTe(3,8).map(e=>(0,H.jsx)(`option`,{value:String(e),children:e},e))})]}),(0,H.jsx)(`label`,{className:`block`,children:(0,H.jsx)(kvt,{})})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(j9,{label:`Continuous (ColorBrewer)`,colors:vvt,fieldProps:e}),(0,H.jsx)(j9,{label:`Continuous (CARTO Colors)`,colors:yvt,fieldProps:e})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(j9,{label:`Diverging (ColorBrewer)`,colors:_vt,fieldProps:e}),(0,H.jsx)(j9,{label:`Diverging (CARTO Colors)`,colors:bvt,fieldProps:e})]}),(0,H.jsx)(Ovt,{})]})]})]})}})]})]}),(0,H.jsx)(`div`,{className:`relative pt-2`,children:(0,H.jsx)(Fg,{type:`submit`,variant:`primary`,children:`Generate`})})]})})}):(0,H.jsx)(`div`,{children:(0,H.jsx)(eg,{onSubmit:async e=>{try{Fx.parse(e)}catch(e){s(e.message);return}s(null);try{await Promise.resolve(t({symbolization:e})).catch(()=>{pE.error(`Failed to generate ramp`)})}catch{}},validate:e=>{let t={},n=e.stops[0]?.input;for(let r=1;r<e.stops.length;r++){let i=e.stops[r].input;i<n&&(t.stops=`Ramp input values need to be in ascending order.`),n=i}return t},initialValues:e.symbolization,children:({values:e})=>(0,H.jsxs)(ig,{className:`space-y-4`,children:[o&&(0,H.jsx)(YT,{children:o}),(0,H.jsx)(A9,{}),(0,H.jsx)(sse,{name:`stops`,children:t=>(0,H.jsxs)(`div`,{className:`w-full grid gap-2 items-center dark:text-white`,style:{gridTemplateColumns:`1fr 1fr min-content`},children:[(0,H.jsx)(`div`,{className:`text-left font-normal`,children:`Value`}),(0,H.jsx)(`div`,{className:`text-left font-normal col-span-2`,children:`Output`}),e.stops.map((n,r)=>(0,H.jsxs)(B.Fragment,{children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(rg,{name:`stops.${r}.input`,type:`number`,className:Lg({_size:`sm`})})}),(0,H.jsx)(`div`,{children:(0,H.jsx)(rg,{component:h9,name:`stops.${r}.output`,_size:`sm`,className:Lg({_size:`sm`})})}),e.stops.length>1?(0,H.jsx)(`div`,{children:(0,H.jsx)(Fg,{variant:`quiet`,"aria-label":`Delete stop`,onClick:()=>{t.remove(r)},children:(0,H.jsx)(Sr,{className:`opacity-60`})})}):null]},r)),(0,H.jsx)(`div`,{className:`col-span-3`,children:(0,H.jsxs)(Fg,{type:`button`,onClick:()=>{let n=(0,GS.default)(e.stops);t.push({input:(n?.input||0)+1,output:`#0fffff`})},children:[(0,H.jsx)(Jn,{}),` Add stop`]})})]})}),(0,H.jsx)(sg,{name:`stops`,component:YT}),(0,H.jsx)(`label`,{className:`block space-y-1`,children:(0,H.jsx)(kvt,{})})]})})})}function Ivt(){let e=i_(),{featureMap:t}=Yv(Wx),n=jvt(t),[r,i]=e.useMetadata(),[a,o]=Zv(D9),[s,c]=(0,B.useState)(null);return a?(0,H.jsx)(eg,{onSubmit:async e=>{let t=E9.find(t=>t.name===e.rampName),r=Array.from(n.get(e.property)||[]),a=t.colors[O9],s={type:`categorical`,simplestyle:e.simplestyle,defaultColor:e.defaultColor,defaultOpacity:e.defaultOpacity,property:e.property,stops:r.slice(0,a.length).map((e,t)=>({input:e,output:a[t]}))};await Promise.resolve(i({symbolization:s})).catch(()=>{pE.error(`Failed to generate ramp`)}),o(!1)},initialValues:{property:r.symbolization?.type===`categorical`?r.symbolization.property:``,defaultColor:l,defaultOpacity:r.symbolization?.type===`categorical`?r.symbolization.defaultOpacity:.3,rampName:T9[0].name,simplestyle:r.symbolization?.type===`categorical`?r.symbolization.simplestyle:!0},children:(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Input property`})}),(0,H.jsxs)(rg,{as:`select`,name:`property`,required:!0,className:`${Ig({size:`sm`})} w-full`,children:[(0,H.jsx)(`option`,{value:``,children:`Select…`}),Array.from(n.keys(),e=>(0,H.jsx)(`option`,{value:e,children:e},e))]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(bg,{children:`Colors`}),(0,H.jsx)(rg,{name:`rampName`,children:e=>{let{field:t}=e;return(0,H.jsxs)(Kp,{children:[(0,H.jsxs)(jse,{children:[(0,H.jsx)(k9,{name:t.value,classes:O9,interpolate:`step`}),(0,H.jsx)(at,{className:`w-5 h-5 shrink-0`})]}),(0,H.jsxs)(vg,{children:[(0,H.jsx)(hg,{}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(j9,{label:`Qualitative (Colorbrewer)`,colors:T9,fieldProps:e})}),(0,H.jsx)(`div`,{children:(0,H.jsx)(j9,{label:`Qualitative (CARTO Colors)`,colors:xvt,fieldProps:e})}),(0,H.jsx)(Ovt,{})]})]})]})}})]})]}),(0,H.jsx)(`div`,{className:`relative pt-2`,children:(0,H.jsx)(Fg,{type:`submit`,variant:`primary`,children:`Generate`})})]})})}):(0,H.jsx)(`div`,{children:(0,H.jsx)(eg,{onSubmit:async e=>{try{Fx.parse(e)}catch(e){c(e.message);return}c(null);try{await Promise.resolve(i({symbolization:e})).catch(()=>{pE.error(`Failed to generate ramp`)})}catch{}},initialValues:r.symbolization,children:({values:e})=>(0,H.jsxs)(ig,{className:`space-y-4`,children:[s&&(0,H.jsx)(YT,{children:s}),(0,H.jsx)(A9,{}),(0,H.jsx)(sse,{name:`stops`,children:t=>(0,H.jsxs)(`div`,{className:`w-full grid gap-2 items-center dark:text-white`,style:{gridTemplateColumns:`1fr 1fr min-content`},children:[(0,H.jsx)(`div`,{className:`text-left font-normal`,children:`Value`}),(0,H.jsx)(`div`,{className:`text-left font-normal col-span-2`,children:`Output`}),e.stops.map((n,r)=>(0,H.jsxs)(B.Fragment,{children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(rg,{name:`stops.${r}.input`,className:Lg({_size:`sm`})})}),(0,H.jsx)(`div`,{children:(0,H.jsx)(rg,{component:h9,name:`stops.${r}.output`,_size:`sm`,className:Lg({_size:`sm`})})}),e.stops.length>1?(0,H.jsx)(`div`,{children:(0,H.jsx)(Fg,{variant:`quiet`,"aria-label":`Delete stop`,onClick:()=>{t.remove(r)},children:(0,H.jsx)(Sr,{className:`opacity-60`})})}):null]},r)),(0,H.jsx)(`div`,{className:`col-span-3`,children:(0,H.jsxs)(Fg,{type:`button`,onClick:()=>{t.push({input:``,output:`#0fffff`})},children:[(0,H.jsx)(Jn,{}),` Add stop`]})})]})}),(0,H.jsx)(sg,{name:`stops`,component:YT})]})})})}function Lvt(){let[e,t]=i_().useMetadata();return(0,H.jsx)(`div`,{children:(0,H.jsx)(eg,{onSubmit:async e=>{try{await Promise.resolve(t({symbolization:e})).catch(e=>{pE.error(`Failed to generate`)})}catch{}},initialValues:{type:`none`,simplestyle:e.symbolization.simplestyle||!0,defaultColor:l,defaultOpacity:e.symbolization.defaultOpacity},children:(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(Vg,{children:`Uniform style for all features on the map.`}),(0,H.jsx)(A9,{})]})})})})}function Rvt({option:e}){return(0,H.jsxs)(ca,{value:e.name,className:`data-state-open:ring-1 ring-purple-300 data-state-open:rounded-sm`,children:[(0,H.jsx)(la,{children:(0,H.jsxs)(ua,{className:`w-full block text-sm p-2 flex items-center gap-x-2
1448        bg-gray-100 dark:bg-gray-900
1449        dark:text-white
1450        data-state-open:rounded-t
1451        data-state-open:bg-gray-200 dark:data-state-open:bg-black`,children:[(0,H.jsx)(at,{className:`transform data-state-open:rotate-90`}),e.name]})}),(0,H.jsx)(da,{children:(0,H.jsxs)(`div`,{className:`p-2 space-y-2`,children:[(0,H.jsx)(`textarea`,{rows:10,value:e.value,className:yg}),(0,H.jsxs)(Fg,{onClick:()=>{pE.promise(lv(e.value),{loading:`Copying…`,success:`Copied`,error:`Failed to copy. Try again?`})},size:`sm`,children:[(0,H.jsx)(Tt,{}),` Copy`]})]})})]})}function zvt(){let[e]=i_().useMetadata(),t=wvt(e.symbolization);return(0,H.jsx)(sa,{type:`single`,className:`space-y-2`,children:t.map((e,t)=>(0,H.jsx)(Rvt,{option:e},t))})}function Bvt(){let[e,t]=i_().useMetadata(),[n,r]=Zv(D9),[i,a]=(0,B.useState)(e.symbolization?.type||`none`);return(0,H.jsx)(`div`,{className:`flex-auto overflow-y-auto placemark-scrollbar`,children:(0,H.jsxs)(`div`,{className:`divi
1451de-y divide-gray-200 dark:divide-gray-900 border-gray-200 dark:border-gray-900`,children:[(0,H.jsxs)(`div`,{className:`p-3 space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-sm font-bold dark:text-white`,children:`Symbolization`}),(0,H.jsx)(Vg,{children:`Control the style of features either directly with literal styles, or by using data-driven styles.`})]}),(0,H.jsx)(TZ,{title:`Type`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsxs)(`select`,{className:Ig({size:`sm`}),value:i,onChange:async e=>{let n=e.target.value;n&&(a(n),n===`none`?await pE.promise(Promise.resolve(t({symbolization:{type:n,defaultOpacity:.3,simplestyle:!0,defaultColor:l}})),{loading:`Generating style…`,success:`Generated`,error:`Failed to generate style`}):r(!0))},children:[(0,H.jsx)(`option`,{value:`none`,children:`Uniform`}),(0,H.jsxs)(`optgroup`,{label:`Data-driven`,children:[(0,H.jsx)(`option`,{value:`ramp`,children:`Ramp`}),(0,H.jsx)(`option`,{value:`categorical`,children:`Category`})]})]}),(0,H.jsx)(`div`,{className:`flex-auto`})]})}),(0,H.jsx)(TZ,{title:`Configuration`,accessory:i!==`none`&&n===!1?(0,H.jsxs)(Fg,{size:`xs`,onClick:()=>{r(!0)},children:[(0,H.jsx)(ir,{}),`Regenerate`]}):null,children:(0,H.jsx)(`div`,{className:`text-sm`,children:BC(i).with(`none`,()=>(0,H.jsx)(Lvt,{})).with(`categorical`,()=>(0,H.jsx)(Ivt,{})).with(`ramp`,()=>(0,H.jsx)(Fvt,{})).otherwise(()=>null)})}),(0,H.jsx)(EZ,{title:`Export symbolization`,atom:Gde,children:(0,H.jsx)(zvt,{})})]})})}function Vvt(){let e=i_().useTransact(),t=Xv(Jx),[n,r]=(0,B.useState)(!1);return(0,H.jsxs)(Kp,{open:n,onOpenChange:e=>r(e),children:[(0,H.jsx)(qp,{"aria-label":`Add folder`,asChild:!0,children:(0,H.jsx)(Fg,{variant:`quiet`,size:`sm`,children:(0,H.jsx)(lje,{})})}),(0,H.jsxs)(_g,{align:`end`,children:[(0,H.jsx)(hg,{}),(0,H.jsx)(kg,{title:`Add folder`}),(0,H.jsx)(eg,{initialValues:{name:``},onSubmit:(n,i)=>{let a=VC();e({note:`Added a folder`,track:`add-folder`,putFolders:[{id:a,expanded:!0,folderId:null,name:n.name,locked:!1,visibility:!0}]}).catch(e=>{}).then(()=>{t({type:`folder`,id:a})}),i.resetForm(),r(!1)},children:(0,H.jsxs)(ig,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(Bg,{name:`name`,type:`text`,required:!0,innerRef:e=>{e&&setTimeout(()=>{e.focus()},0)}}),(0,H.jsx)(Fg,{type:`submit`,children:`Add`})]})})]})]})}function Hvt({featureMap:e}){let[t,n]=i_().useMetadata(),r=nM(e);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(bg,{children:`Label property`}),(0,H.jsxs)(`select`,{className:`${Ig({size:`sm`})} w-full`,onChange:e=>{n({label:e.target.value})},value:t.label||``,children:[(0,H.jsx)(`option`,{value:``}),r.map((e,t)=>(0,H.jsx)(`option`,{value:e,children:e},t))]}),(0,H.jsx)(Vg,{children:`Choose a property from your data which will show up as a label for each feature on the map and in this list.`})]})}function Uvt({featureMap:e}){let[t]=i_().useMetadata();return(0,H.jsxs)(`div`,{className:`flex justify-between px-2 py-1 border-b border-gray-200 dark:border-gray-900`,children:[(0,H.jsxs)(Kp,{children:[(0,H.jsx)(qp,{"aria-label":`Add folder`,asChild:!0,children:(0,H.jsxs)(Fg,{size:`xs`,children:[(0,H.jsxs)(`span`,{className:`w-30 truncate`,children:[`Label: `,t.label]}),` `,(0,H.jsx)(at,{})]})}),(0,H.jsxs)(_g,{align:`end`,children:[(0,H.jsx)(hg,{}),(0,H.jsx)(Hvt,{featureMap:e})]})]}),(0,H.jsx)(Vvt,{})]})}function Wvt(){return Iw(Fw(Xw,{activationConstraint:{distance:8}}))}function Gvt({folder:e,rep:t}){let n=t.useTransact(),[r,i]=(0,B.useState)(!1);async function a(t){await n({note:`Renamed a folder`,putFolders:[{...e,name:t.name}]}),i(!1)}return r?(0,H.jsx)(`div`,{className:`flex items-center flex-auto
1452      text-inherit text-gray-500 dark:text-gray-300`,children:(0,H.jsx)(eg,{onSubmit:a,initialValues:{name:e.name},children:({isSubmitting:e,handleSubmit:t})=>(0,H.jsx)(ig,{className:`flex-auto`,children:(0,H.jsx)(rg,{autoFocus:!0,className:`bg-transparent w-full font-bold text-black dark:text-white bg-purple-100 dark:bg-purple-700`,name:`name`,"aria-label":`Folder name`,spellCheck:`false`,autoCapitalize:`false`,disabled:e,onBlur:()=>{t()}})})})}):(0,H.jsx)(`div`,{className:`flex-auto font-semibold select-none truncate`,title:e.name,onDoubleClick:()=>i(!0),children:e.name})}var Kvt=`hidden opacity-30 hover:opacity-100 group-hover:inline-block pr-2`;function qvt({rep:e,item:t,overlay:n}){let r=e.useTransact(),{depth:i}=t,[a,o]=Zv(Jx),s=t.data,c=U.isFolderSelected(a,s.id),l=s.folderId&&U.isFolderSelected(a,s.folderId),u=c?`direct`:l?`secondary`:!1;function d(e){e.stopPropagation(),r({note:`Toggled a folder`,putFolders:[{...s,expanded:!s.expanded}]})}function f(e){e.stopPropagation(),r({note:`Toggled a folder’s locking`,putFolders:[{...s,locked:!s.locked}]})}function p(e){e.stopPropagation(),r({note:`Toggled a folder’s visibility`,track:`folder-toggle-visibility`,putFolders:[{...s,visibility:!s.visibility}]})}return(0,H.jsxs)(`div`,{className:ryt({selected:u,overlay:n,visibility:s.visibility}),onClick:()=>{o(U.folder(s.id))},"data-at":s.at,children:[(0,H.jsx)(Xvt,{selected:u,depth:i}),(0,H.jsx)(`button`,{type:`button`,title:`Expand / collapse`,onClick:d,className:Dm(`opacity-0 group-hover:opacity-50`,s.expanded?`transform rotate-90`:``),children:(0,H.jsx)(wr,{className:`w-4`})}),(0,H.jsx)(Gvt,{folder:s,rep:e}),(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(`button`,{type:`button`,title:`Toggle locked`,onClick:f,className:`pr-2`,children:s.locked?(0,H.jsx)(Mn,{className:`w-3 h-3`}):(0,H.jsx)(Pn,{className:`w-3 h-3 hidden opacity-30 group-hover:inline-block hover:opacity-100 `})}),(0,H.jsx)(`div`,{role:`checkbox`,title:`Toggle visibility`,onClick:p,"aria-checked":s.visibility,className:Kvt,children:(0,H.jsx)(Hg,{visibility:s.visibility})})]})}function Jvt({item:e,preview:t,overlay:n,treeCurrentValueRef:r}){let i=i_();return e.kind===`folder`?(0,H.jsx)(qvt,{overlay:n,rep:i,item:e}):(0,H.jsx)(Zvt,{overlay:n,item:e,rep:i,preview:t,treeCurrentValueRef:r})}function Yvt(e,t){let n={...e.feature.properties};return(t===void 0?n.visibility===!1:t)?delete n.visibility:n.visibility=!1,{...e,feature:{...e.feature,properties:n}}}function Xvt({selected:e,feature:t=!1,depth:n}){return(0,H.jsx)(`div`,{className:e?`border-purple-300 dark:border-purple-300`:`border-gray-200 dark:border-gray-700`,style:{height:2,borderLeftWidth:n*16,marginRight:t?16:0}})}function Zvt({item:e,rep:t,preview:n,overlay:r,treeCurrentValueRef:i}){let[a,o]=Zv(Jx),s=fC(),c=e.data,{depth:l}=e,u=U.isSelected(a,c.id),d=c.folderId&&U.isFolderSelected(a,c.folderId),f=c.feature.geometry?.type||`Null geometry`,p=Qvt(n&&c.feature.properties?.[n]),m=t.useTransact(),h=ny((0,B.useCallback)((e,t,n)=>{let r=e(Wx);n.stopPropagation();
1452let i=U.getSelectedFeatures(r);if(i.length>1){let e=c.feature.properties?.visibility===!1;m({note:`Toggled a feature’s visibility`,track:`feature-toggle-visibility`,putFeatures:i.map(t=>Yvt(t,e))})}else m({note:`Toggled a feature’s visibility`,putFeatures:[Yvt(c)]})},[c,m])),g=u?`direct`:d?`secondary`:!1;return(0,H.jsxs)(`button`,{type:`button`,className:ryt({selected:g,overlay:r}),onDoubleClick:()=>{s([c])},onClick:e=>{o(t=>{if(e.metaKey)return U.toggleSelectionId(t,c.id);if(e.shiftKey){let e=U.toIds(t);if(e.length===0)return U.single(c.id);let n=i.current,r=n.findIndex(e=>e.id===c.id),a={min:r,max:r},o=new Set(e);for(let e=0;e<n.length;e++)if(e<a.min||e>a.max){let t=n[e];o.has(t.id)&&(e<a.min&&(a.min=e),e>a.max&&(a.max=e))}let s=[];for(let e=a.min;e<a.max+1;e++){let t=n[e];t?.kind===`feature`&&s.push(t.id)}return U.fromIds(s)}return U.single(c.id)})},"data-at":e.at,children:[(0,H.jsx)(Xvt,{selected:g,depth:l,feature:!0}),(0,H.jsx)(`span`,{className:`block select-none truncate flex-auto`,children:p?(0,H.jsxs)(H.Fragment,{children:[p,` `,(0,H.jsx)(`span`,{className:`opacity-20`,children:f})]}):f}),(0,H.jsx)(`div`,{role:`checkbox`,title:`Toggle visibility`,onClick:h,className:Kvt,"aria-checked":c.feature.properties?.visibility!==!1,children:(0,H.jsx)(Hg,{visibility:c.feature.properties?.visibility!==!1})})]})}function Qvt(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`)e=e.slice(0,32);else return;return e}var $vt=({id:e,item:t,preview:n,treeCurrentValueRef:r,...i})=>(0,H.jsx)(`div`,{className:`absolute`,...i,children:(0,H.jsx)(Jvt,{treeCurrentValueRef:r,item:t,overlay:!0,preview:n})});function eyt({item:e}){return(0,H.jsx)(UL,{selectedWrappedFeatures:[e.data],as:`context-item`})}var tyt=(0,B.memo)(function({id:e,item:t,preview:n,isDragging:r,treeCurrentValueRef:i,depth:a,highlight:o}){let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d}=__e({id:e}),f={transform:Mw.Transform.toString(u),transition:d,touchAction:`none`};return(0,H.jsx)(`div`,{...s,...c,ref:l,style:f,className:Dm(r?`opacity-100`:``,o&&`ring-2 ring-purple-500 ring-inset bg-opacity-20 bg-purple-300 dark:bg-purple-700`),children:r?(0,H.jsx)(`div`,{style:{height:0,paddingLeft:16+a*16},children:(0,H.jsx)(`div`,{className:`rounded-xs bg-purple-500 border border-purple-700`,style:{height:4}})}):(0,H.jsxs)(hp,{children:[(0,H.jsx)(gp,{children:(0,H.jsx)(Jvt,{overlay:!1,preview:n,item:t,treeCurrentValueRef:i})}),(0,H.jsx)(_p,{children:(0,H.jsx)(xse,{children:t.kind===`feature`?(0,H.jsx)(eyt,{item:t}):(0,H.jsx)(nyt,{folder:t.data})})})]})})});function nyt({folder:e}){let t=i_().useTransact(),n=fC(),r=ny((0,B.useCallback)((n,r)=>{let{newSelection:i,moment:a}=VL({...n(Wx),selection:U.folder(e.id)});return r(Jx,i),t(a)},[t,e.id])),i=ny((0,B.useCallback)((n,r)=>{let{newSelection:i,moment:a}=ML({...n(Wx),selection:U.folder(e.id)});return r(Jx,i),t(a)},[t,e.id])),a=ny((0,B.useCallback)(t=>{let{featureMap:r,folderMap:i}=t(Wx),a=e.id,o=new Set([a]),s=[];Cx(a,Tx(i),o);for(let e of r.values())e.folderId&&o.has(e.folderId)&&s.push(e.id);n({type:`multi`,ids:s})},[e.id,n]));return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Og,{onSelect:r,children:[(0,H.jsx)(Tt,{}),`Duplicate`]}),(0,H.jsxs)(Og,{onSelect:a,children:[(0,H.jsx)(In,{}),`Zoom to`]}),(0,H.jsx)(wg,{}),(0,H.jsx)(Og,{onSelect:i,variant:`destructive`,children:`Delete`})]})}function ryt({selected:e,overlay:t,visibility:n=!0}){return Dm(`text-xs block w-full
1453    text-left
1454    flex items-center
1455    py-1
1456    border-gray-100
1457    dark:text-white`,n?``:`text-gray-500 dark:text-gray-400`,e===`direct`?`bg-opacity-40 bg-purple-300 dark:bg-purple-800`:e===`secondary`?`bg-opacity-40 bg-purple-200 dark:bg-purple-700`:`hover:bg-gray-100 dark:hover:bg-gray-700 focus:bg-gray-200 dark:focus:bg-gray-700`,t?`px-4 rounded-xs ring-1 ring-gray-500 shadow-md opacity-60`:``)}function iyt(e){return{position:`absolute`,top:0,left:0,width:`100%`,height:`${e.size}px`,transform:`translate(0px, ${e.start}px)`}}function ayt(e){return e.top+e.height*.5}var oyt=({pointerCoordinates:e,droppableRects:t,droppableContainers:n})=>{let r=e?.y||0,i=null;for(let e of n){let{id:n}=e,a=t.get(n);if(a){let t=Math.abs(ayt(a)-r);(!i||t<i.data.value)&&(i={id:n,data:{droppableContainer:e,value:t}})}}return i?[i]:[]},syt=3;function cyt(e,t){let n=t.top+syt,r=t.bottom-syt;return n<=e.y&&e.y<=r}var lyt=({droppableContainers:e,droppableRects:t,pointerCoordinates:n},r)=>{if(!n)return null;for(let i of e){let{id:e}=i;if(!r.has(e))continue;let a=t.get(e);if(a&&cyt(n,a))return[{id:e,data:{droppableContainer:i,value:1,dropIntoFolder:!0}}]}return null};function uyt(){let e=Yv(Xx);return e.leftOpen?(0,H.jsx)(`div`,{style:{width:e.left},className:`bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-900 relative`,children:(0,H.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:(0,H.jsx)(pyt,{})})}):null}function dyt({newIndex:e,myDepth:t,sortedItems:n}){for(let r=e-1;r>=0&&!(n[r].depth<t);r--)if(n[r].depth===t)return n[r].at;return null}function fyt({newIndex:e,myDepth:t,sortedItems:n}){for(let r=e+1;r<n.length&&!(n[r].depth<t);r++)if(n[r].depth===t)return n[r].at;return null}function pyt(){let e=Yv(Wx),{featureMap:t,folderMap:n,selection:r}=e,i=i_(),[a]=i.useMetadata(),o=i.useTransact(),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(0),h=(0,B.useRef)(null),g=Wvt(),_=(0,B.useRef)([]),v=k_e({data:e,activeId:s});_.current=v;let y=s&&l?M_e({tree:v,activeId:s,overId:l,offsetLeft:p,indentationWidth:16,dropIntoFolder:d}):null,b=(0,B.useMemo)(()=>v.findIndex(({id:e})=>e===s),[v,s]),x=yP({count:v.length,getScrollElement:()=>h.current,estimateSize:(0,B.useCallback)(e=>e===b?0:24,[b]),overscan:10}),{scrollToIndex:S}=x,C=(0,B.useRef)(null);(0,B.useEffect)(()=>
1457{if(!(r.type===`none`||(0,tv.default)(r,C.current))){switch(r.type){case`single`:{let t=F_e(r,e);if(t.length){o({note:`Auto-expand folders`,putFolders:t.map(e=>({...e,expanded:!0}))});return}let n=v.findIndex(e=>e.kind===`feature`&&e.id===r.id);n!==null&&n!==-1&&S(n);break}case`folder`:{let e=v.findIndex(e=>e.kind===`folder`&&e.id===r.id);e!==null&&e!==-1&&S(e);break}case`multi`:break}C.current=r}},[v,r,S,e,o]);let w=(0,B.useCallback)(e=>lyt(e,n)||oyt(e),[n,n.version]);function T(){c(null),u(null),m(0)}function E(e){c(e.active.id),u(e.active.id)}function D(e){let{over:t}=e;u(t?.id??null),f(!!(e?.collisions?.length===1&&e?.collisions?.[0].data?.dropIntoFolder))}function O(e){let{delta:t}=e;m(t.x),f(!!(e?.collisions?.length===1&&e?.collisions?.[0].data?.dropIntoFolder))}function k(t){let{active:n,over:i}=t;if(T(),y&&i){let{depth:t,folderId:a}=y,s=v.slice(),c=s.findIndex(({id:e})=>e===i.id),l=s.findIndex(({id:e})=>e===n.id),u=s[l],d=lT(s,l,c),f=d.findIndex(e=>e.id===n.id),p=t,m=dyt({newIndex:f,myDepth:p,sortedItems:d}),h=fyt({newIndex:f,myDepth:p,sortedItems:d}),g=u.at;try{g=gM(m,h)}catch{}switch(u.kind){case`feature`:if(r.type===`multi`)try{let t=U.getSelectedFeatures(e),n=_M(m,h,t.length);o({note:`Changed the order of features`,putFeatures:t.map((e,t)=>({...e,at:n[t],folderId:a}))})}catch{}else o({note:`Changed the order of a feature`,putFeatures:[{...u.data,at:g,folderId:a}]});break;case`folder`:o({note:`Changed the order of a folder`,putFolders:[{...u.data,at:g,folderId:a}]});break}}}return(0,H.jsxs)(cT,{sensors:g,collisionDetection:w,onDragStart:E,onDragOver:D,onDragMove:O,onDragEnd:k,children:[(0,H.jsx)(Uvt,{featureMap:t}),(0,H.jsx)(l_e,{items:v,strategy:a_e,children:(0,H.jsx)(`div`,{ref:h,"data-keybinding-scope":`editor_folder`,className:`placemark-scrollbar overflow-y-scroll flex-auto group`,children:(0,H.jsx)(`div`,{className:`relative w-full`,style:{willChange:`transform`,height:`${x.getTotalSize()}px`},children:x.getVirtualItems().map(e=>{let t=v[e.index],n=s===t.id;return n&&d?null:(0,H.jsx)(`div`,{style:iyt(e),children:(0,H.jsx)(tyt,{id:t.id,treeCurrentValueRef:_,depth:t.id===s&&y?y.depth:t.depth,highlight:d&&l===t.id,item:t,preview:a.label,isDragging:n},t.id)},e.index)})})})}),(0,H.jsx)(Ga,{children:(0,H.jsx)(e_e,{dropAnimation:null,className:`bg-transparent`,children:s?(0,H.jsx)($vt,{preview:a.label,id:s,treeCurrentValueRef:_,item:v.find(e=>e.id===s)}):null})})]})}var myt=[aS.Feature,aS.Table],hyt=[aS.Table,aS.Feature,aS.List];function gyt({onClick:e,active:t,label:n,...r}){return(0,H.jsx)(`button`,{role:`tab`,onClick:e,"aria-selected":t,className:Dm(`text-left text-sm py-1 px-3 focus:outline-hidden`,t?`text-black dark:text-white`:`
1458          bg-gray-100 dark:bg-gray-900
1459          border-b
1460          border-gray-200 dark:border-black
1461          text-gray-500 dark:text-gray-400
1462          hover:text-black dark:hover:text-gray-200
1463          focus:text-black`),...r,children:n})}function _yt(e,t){let n=e.indexOf(t)-1;return n<0&&(n=e.length-1),e[n]}function vyt(e,t){return e[(e.indexOf(t)+1)%e.length]}var yyt=(0,B.memo)(function({activeTab:e}){switch(e){case aS.Feature:return(0,H.jsx)(z_t,{});case aS.Table:return(0,H.jsx)(gvt,{});case aS.List:return(0,H.jsx)(pyt,{});case aS.Symbolization:return(0,H.jsx)(Bvt,{})}}),byt=(0,B.memo)(function({tabOrder:e,setTab:t,activeTab:n,showSymbolization:r}){return(0,H.jsxs)(`div`,{role:`tablist`,style:{gridTemplateColumns:`repeat(${e.length}, 1fr) min-content`},className:`flex-0 grid h-8 flex-none
1464      sticky top-0 z-10
1465      bg-white dark:bg-gray-800
1466      divide-x divide-gray-200 dark:divide-black`,children:[e.map(e=>(0,H.jsx)(gyt,{onClick:()=>t(e),active:n===e,label:e},e)),r?(0,H.jsx)(gyt,{"aria-label":`Symbolization`,title:`Symbolization`,onClick:()=>t(aS.Symbolization),active:n===aS.Symbolization,label:(0,H.jsx)(rn,{})},`Symbolization`):null]})}),xyt=(0,B.memo)(function(){let e=Yv(Xx);return e.rightOpen?(0,H.jsx)(`div`,{style:{width:e.right},className:`bg-white dark:bg-gray-800 border-l border-gray-200 dark:border-gray-900 relative`,children:(0,H.jsx)(M9,{tabOrder:myt})}):null}),Syt=(0,B.memo)(function(){let e=Yv(Xx);return Yv(zde)?(0,H.jsx)(`div`,{style:{height:e.bottom},className:`bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-900 relative`,children:(0,H.jsx)(M9,{tabOrder:hyt,showSymbolization:!1})}):null}),Cyt=(0,B.memo)(function(){return(0,H.jsx)(`div`,{className:`flex flex-auto bg-white dark:bg-gray-800 relative`,children:(0,H.jsx)(M9,{tabOrder:hyt,showSymbolization:!1})})}),M9=(0,B.memo)(function({tabOrder:e,showSymbolization:t=!0}
1466){let[n,r]=Zv(oS);return _Z(`]`,()=>{r(vyt(e,n))},[n]),_Z(`[`,()=>{r(_yt(e,n))},[n]),(0,H.jsxs)(`div`,{className:`absolute inset-0 flex flex-col`,children:[(0,H.jsx)(byt,{tabOrder:e,activeTab:n,setTab:r,showSymbolization:t}),(0,H.jsx)(cg,{children:(0,H.jsx)(yyt,{activeTab:n})})]})}),N9=80;function wyt(){let e=Tyt(),t=Xv(Xx);(0,B.useEffect)(()=>{function n(){e&&t(e=>{let t=window.innerWidth;if(t-(e.left+e.right)>N9)return e;let n={...e};return t-e.left>N9?(n.leftOpen=!1,n):t-e.right>N9?(n.rightOpen=!1,n):(n.rightOpen=!1,n.leftOpen=!1,n)})}return window.addEventListener(`resize`,n),()=>{window.removeEventListener(`resize`,n)}},[t,e])}function Tyt(){return F2e({minWidth:640})}function Eyt(e,t,n){let r=Rde[t],i=window.innerWidth,a={...e};n<Yx[t]?a[`${t}Open`]=!1:a[t]=Math.min(n,i-N9);let o=a[t],s=i-(a.left+a.right),c=i-o-N9;return s<N9&&(c<Yx[r]?a[`${r}Open`]=!1:a[r]=c),a}function Dyt(e){let[t,n]=Zv(Xx),r=t[`${e}Open`],i=(0,B.useRef)(null),{moveProps:a}=vN({onMoveStart(){i.current=t[e]},onMove(t){if(i.current===null||(i.current-=Math.round(t.deltaX*(e===`left`?-1:1)),i.current===null))return;let r=i.current;n(t=>Eyt(t,e,r))},onMoveEnd(){i.current=null}});return{moveProps:a,showPanel:r,splits:t}}function Oyt(){let[e,t]=Zv(Xx),n=(0,B.useRef)(null),{moveProps:r}=vN({onMoveStart(){n.current=e.bottom},onMove(e){if(n.current===null||(n.current-=Math.round(e.deltaY*1),n.current===null))return;let r=n.current;t(e=>({...e,bottom:r}))},onMoveEnd(){n.current=null}});return{moveProps:r,splits:e}}var kyt=(0,B.memo)(function({side:e}){let{moveProps:t,showPanel:n,splits:r}=Dyt(e);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{...t,type:`button`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize panel`,tabIndex:0,style:{cursor:`col-resize`,[e]:n?r[e]:0},className:`absolute top-0 bottom-0
1467        touch-none
1468        flex items-center
1469        justify-center
1470        w-1
1471        hover-none:w-3
1472        z-max
1473        bg-opacity-0
1474        dark:bg-opacity-0
1475        hover-none:bg-opacity-40
1476        hover-none:dark:bg-opacity-40
1477        hover-none:bg-white
1478        hover-none:dark:bg-black
1479        hover-hover:hover:bg-opacity-100
1480        hover-hover:dark:hover:bg-opacity-100
1481        hover:bg-purple-700
1482        hover:dark:bg-purple-700
1483        `,children:(0,H.jsx)(`div`,{className:`
1484        hover-hover:hidden
1485        h-16
1486        w-1
1487        rounded
1488        bg-white`})}),n?null:(0,H.jsx)(Ayt,{side:e})]})});function Ayt({side:e}){let t=Xv(Xx);return(0,H.jsxs)(vm,{children:[(0,H.jsx)(ym,{onClick:()=>{t(t=>({...t,[`${e}Open`]:!t[`${e}Open`]}))},"aria-label":`Show panel`,className:Dm(e===`right`?`right-0`:`left-0`,e===`right`?`border-l rounded-r-none`:`border-r rounded-l-none`,`
1489          absolute px-0.5 py-2 top-1/2 border-t border-b
1490          bg-white hover:bg-purple-100 border-gray-300
1491          dark:bg-gray-900 dark:text-white dark:hover:bg-purple-700 dark:border-white
1492          rounded
1493        `),children:e===`right`?(0,H.jsx)(pt,{}):(0,H.jsx)(ht,{})}),(0,H.jsx)(bm,{children:(0,H.jsx)(fg,{children:(0,H.jsx)(`div`,{className:`whitespace-nowrap`,children:`Expand panel`})})})]})}var jyt=(0,B.memo)(function(){let{moveProps:e,splits:t}=Oyt();return(0,H.jsx)(`button`,{...e,type:`button`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize panel`,tabIndex:0,style:{cursor:`row-resize`,bottom:t.bottom},className:`absolute left-0 right-0
1494        touch-none
1495        flex items-center
1496        justify-center
1497        h-1
1498        hover-none:w-3
1499        z-max
1500        bg-opacity-0
1501        dark:bg-opacity-0
1502        hover-none:bg-opacity-40
1503        hover-none:dark:bg-opacity-40
1504        hover-none:bg-white
1505        hover-none:dark:bg-black
1506        hover-hover:hover:bg-opacity-100
1507        hover-hover:dark:hover:bg-opacity-100
1508        bg-purple-700
1509        dark:bg-purple-700
1510        `,children:(0,H.jsx)(`div`,{className:`
1511        hover-hover:hidden
1512        h-16
1513        w-1
1514        rounded
1515        bg-white`})})});function Myt(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var Nyt=Js(),Pyt=B.useInsertionEffect,Fyt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?B.useLayoutEffect:B.useEffect,Iyt=Pyt||Fyt,P9=e=>{let t=B.useRef([e,(...e)=>t[0](...e)]).current;return Iyt(()=>{t[0]=e}),t[1]},Lyt=`popstate`,F9=`pushState`,I9=`replaceState`,Ryt=[Lyt,F9,I9,`hashchange`],zyt=e=>{for(let t of Ryt)addEventListener(t,e);return()=>{for(let t of Ryt)removeEventListener(t,e)}},Byt=(e,t)=>
1515(0,Nyt.useSyncExternalStore)(zyt,e,t),Vyt=()=>location.search,Hyt=({ssrSearch:e}={})=>Byt(Vyt,e==null?Vyt:()=>e),Uyt=()=>location.pathname,Wyt=({ssrPath:e}={})=>Byt(Uyt,e==null?Uyt:()=>e),Gyt=(e,{replace:t=!1,state:n=null}={})=>history[t?I9:F9](n,``,e),Kyt=(e={})=>[Wyt(e),Gyt],qyt=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[qyt]===void 0){for(let e of[F9,I9]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,qyt,{value:!0})}var Jyt=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,Yyt=(e=``)=>e===`/`?``:e,Xyt=(e,t)=>e[0]===`~`?e.slice(1):Yyt(t)+e,Zyt=(e=``,t)=>Jyt(L9(Yyt(e)),L9(t)),Qyt=e=>e[0]===`?`?e.slice(1):e,L9=e=>{try{return decodeURI(e)}catch{return e}},$yt=e=>L9(Qyt(e)),ebt={hook:Kyt,searchHook:Hyt,parser:Myt,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},tbt=(0,B.createContext)(ebt),R9=()=>(0,B.useContext)(tbt),nbt={},rbt=(0,B.createContext)(nbt),ibt=()=>(0,B.useContext)(rbt),z9=e=>{let[t,n]=e.hook(e);return[Zyt(e.base,t),P9((t,r)=>e.aroundNav(n,Xyt(t,e.base),r))]},abt=()=>z9(R9()),obt=()=>{let e=R9();return $yt(e.searchHook(e))},sbt=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},cbt=({children:e,...t})=>{let n=R9(),r=t.hook?ebt:n,i=r,[a,o=t.ssrSearch??``]=t.ssrPath?.split(`?`)??[];a&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let s=(0,B.useRef)({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return(0,B.createElement)(tbt.Provider,{value:i,children:e})},lbt=({children:e,component:t},n)=>t?(0,B.createElement)(t,{params:n}):typeof e==`function`?e(n):e,ubt=e=>{let t=(0,B.useRef)(nbt),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n};function dbt(){let[e,t]=abt(),n=obt(),r=(0,B.useMemo)(()=>new URLSearchParams(n),[n]),i=r;return[r,P9((n,r)=>{i=new URLSearchParams(typeof n==`function`?n(i):n),t(e+`?`+i,r)})]}var B9=({path:e,nest:t,match:n,...r})=>{let i=R9(),[a]=z9(i),[o,s,c]=n??sbt(i.parser,e,a,t),l=ubt({...ibt(),...s});if(!o)return null;let u=c?(0,B.createElement)(cbt,{base:c},lbt(r,l)):lbt(r,l);return(0,B.createElement)(rbt.Provider,{value:l,children:u})};(0,B.forwardRef)((e,t)=>{let n=R9(),[r,i]=z9(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e,h=P9(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),g=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&(0,B.isValidElement)(l)?(0,B.cloneElement)(l,{onClick:h,href:g}):(0,B.createElement)(`a`,{...m,onClick:h,href:g,className:u?.call?u(r===o):u,children:l,ref:t})});var fbt=e=>Array.isArray(e)?e.flatMap(e=>fbt(e&&e.type===B.Fragment?e.props.children:e)):[e],pbt=({children:e,location:t})=>{let n=R9(),[r]=z9(n);for(let i of fbt(e)){let e=0;if((0,B.isValidElement)(i)&&(e=sbt(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,B.cloneElement)(i,{match:e})}return null},V9=`FORM_ERROR`;function H9({children:e,submitText:t,schema:n,mini:r,initialValues:i,onCancel:a,onSubmit:o,fullWidthSubmit:s=!1,track:c,...l}){let[u,d]=(0,B.useState)(null);return(0,H.jsx)(eg,{initialValues:i||{},validate:e=>{if(!n)return;let t=n.safeParse(e);if(t.success===!1)return C(t.error).fieldErrors},validateOnChange:!1,validateOnBlur:!1,onSubmit:async(e,t)=>{let{setErrors:n}=t,{FORM_ERROR:r,...i}=await o(e,t)||{};d(r||null),Object.keys(i).length>0&&n(i)},children:({handleSubmit:n})=>(0,H.jsxs)(`form`,{onSubmit:n,className:`form`,autoComplete:`off`,...l,children:[(0,H.jsx)(`div`,{className:`space-y-2`,children:e}),u&&(0,H.jsx)(YT,{children:u}),t&&(0,H.jsx)(Ug,{onClose:a,action:t,fullWidthSubmit:!!s})]})})}function mbt({layer:e,onSelect:t}){return(0,H.jsx)(`button`,{type:`button`,onClick:()=>{t(e)},className:Eg({variant:`default`}),children:e.name||`Untitled`})}var U9=zv(`initial`),W9={at:`a0`,id:``,name:``,url:``,token:``,visibility:!0,labelVisibility:!0,tms:!1,opacity:1};function G9(e){return e.length?gM(null,e[0].at||null):gM(null,null)}function K9(e){let t,n=e.find(e=>e.type===`STYLE`),r=[];return n&&(t=n.at,r.push(n.id)),{oldAt:t,deleteLayerConfigs:r}}var hbt=v({version:_(8),name:o().optional()});function gbt({to:e}){let t=Xv(U9);return(0,H.jsxs)(Fg,{type:`button`,size:`xs`,onClick:()=>{t(e)},children:[(0,H.jsx)(st,{}),`Back`]})}function q9({isEditing:e,children:t}){return(0,H.jsxs)(`div`,{className:`flex justify-between items-center pb-2`,children:[(0,H.jsx)(`div`,{className:`font-bold`,children:t}),e?(0,H.jsx)(Yp,{asChild:!0,children:(0,H.jsx)(Fg,{type:`button`,size:`xs`,children:`Cancel`})}):(0,H.jsx)(gbt,{to:`custom`})]})}function _bt({layer:e,onDone:t}){let n=Xv(U9),r=i_().useTransact(),i=!!e,a=[...Yv(Kx).values()];return(0,H.jsxs)(H9,{schema:jx,initialValues:e||{...W9,type:`STYLE`},submitText:i?`Update style`:`Add style`,fullWidthSubmit:!0,onSubmit:async e=>{if(e.type!==`STYLE`)return{[V9]:`Expected a MapLibre style`};let i=`MapLibre style`;try{i=(await vv(e.url,hbt)).name||i}catch{return{[V9]:`Could not load a valid MapLibre style`}}let{deleteLayerConfigs:o,oldAt:s}=K9(a);o.length&&pE(`Base style replaced`),await r({note:`Add MapLibre style`,deleteLayerConfigs:o,putLayerConfigs:[{...e,name:i,visibility:!0,labelVisibility:!0,tms:!1,opacity:1,at:s||G9(a),id:e.id||VC()}]}),n(`initial`),t?.()},children:[(0,H.jsx)(q9,{isEditing:i,children:`MapLibre style`}),(0,H.jsx)(Vg,{variant:`primary`,size:`xs`,children:`Enter an HTTPS URL for a MapLibre style. OpenFreeMap styles do not require a token.`}),(0,H.jsx)(DM,{name:`url`,label:`Style URL`,required:!0,type:`url`,autoComplete:`off`,placeholder:`https://tiles.openfreemap.org/styles/positron`})]})}function vbt({layer:e,onDone:t}){let n=Xv(U9),r=i_().useTransact(),i=!!e,a=[...Yv(Kx).values()];return(0,H.jsxs)(H9,{schema:jx,initialValues:e||{...W9,type:`TILEJSON`},submitText:i?`Update layer`:`Add layer`,fullWidthSubmit:!0,onSubmit:async i=>{try{await vv(i.url,$se)}catch(e){return e instanceof x?{[V9]:`Invalid response: this endpoint does not produce valid TileJSON.`}:{[V9]:`Invalid: this TileJSON can’t be downloaded.`}}await r({putLayerConfigs:[{...i,at:e?.at||G9(a),id:i.id||VC()}]}),n(`initial`),t&&t()},children:[(0,H.jsx)(q9,{isEditing:i,children:`TileJSON`}),(0,H.jsxs)(Vg,{variant:`primary`,size:`xs`,children:[`Raster tiles are supported with`,` `,(0,H.jsx)(`a`,{target:`_blank`,rel:`noreferrer`,className:Tg,href:`https://github.com/mapbox/tilejson-spec`,children:`TileJSON`}),`.`]}),(0,H.jsx)(DM,{name:`name`,label:`Name`,required:!0,autoComplete:`off`,placeholder:``}),(0,H.jsx)(DM,{name:`url`,required:!0,label:`TileJSON URL`,autoComplete:`off`,placeholder:`https://…`})]})}function ybt({layer:e,onDone:t}){let n=Xv(U9),r=i_().useTransact(),i=[...Yv(Kx).values()],a=!!e;return(0,H.jsxs)(H9,{schema:jx,initialValues:e||{...W9,type:`XYZ`},submitText:a?`Update layer`:`Add layer`,fullWidthSubmit:!0,onSubmit:async o=>{await pE.promise(r({putLayerConfigs:[{...o,at:e?.at||G9(i),id:o.id||VC()}]}),{loading:a?`Updating layer`:`Adding layer`,success:a?`Updated layer`:`Added layer`,error:`Error`}),n(`initial`),t&&t()},children:[(0,H.jsx)(q9,{isEditing:a,children:`XYZ`}),(0,H.jsxs)(Vg,{variant:`primary`,size:`xs`,children:[`Supports image`,` `,(0,H.jsx)(`a`,{target:`_blank`,rel:`noreferrer`,className:Tg,href:`https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames`,children:`slippy map tiles`}),`.`]}),(0,H.jsx)(DM,{name:`name`,label:`Name`,autoComplete:`off`,required:!0,placeholder:``}),(0,H.jsx)(DM,{name:`url`,label:`Template URL`,autoComplete:`off`,required:!0,type:`url`,placeholder:`https://…`}),(0,H.jsxs)(Vg,{children:[`Template URLs should contain `,`{z}`,`, `,`{x}`,`, and `,`{y}`,`.`]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-x-2 text-sm py-2`,children:[(0,H.jsx)(dg,{name:`tms`,type:`checkbox`}),` TMS`]})]})}function bbt({layer:e,...t}){return BC(e).with({type:`XYZ`},e=>(0,H.jsx)(ybt,{layer:e,...t})).with({type:`TILEJSON`},e=>(0,H.jsx)(vbt,{layer:e,...t})).with({type:`STYLE`},e=>(0,H.jsx)(_bt,{layer:e,...t})).exhaustive()}function xbt(){let e=i_().useTransact(),[t,n]=(0,B.useState)(!1),[r,i]=Zv(U9),a=[...Yv(Kx).values()],o=G9(a),s=(0,H.jsxs)(`div`,{className:`py-2`,children:[Object.entries((0,nbe.default)(Object.entries(iy),([e,t])=>t.provider)).map(([t,n])=>(0,H.jsxs)(B.Fragment,{children:[(0,H.jsx)(wse,{children:t}),n.map(([t,n])=>(0,H.jsx)(mbt,{layer:n,onSelect:async t=>{let{deleteLayerConfigs:n,oldAt:r}=K9(a);n.length&&pE(`Base style replaced`),await e({note:`Add layer`,deleteLayerConfigs:n,putLayerConfigs:[{...t,visibility:!0,tms:!1,opacity:1,at:r||o,id:VC(),labelVisibility:!0}]})}},t))]},t)),(0,H.jsx)(Ese,{}),(0,H.jsxs)(`button`,{type:`button`,className:`w-full block ${Eg({variant:`default`})}`,onClick:()=>{i(`custom`)},value:`manage`,children:[(0,H.jsx)(Jn,{}),` Custom`]})]});return(0,H.jsxs)(Kp,{open:t,onOpenChange:e=>{n(e),i(`initial`)},children:[(0,H.jsx)(qp,{asChild:!0,children:(0,H.jsx)(Fg,{"aria-label":`Add layer`,children:(0,H.jsx)(Jn,{})})}),(0,H.jsx)(Jp,{children:(0,H.jsxs)(_g,{flush:`yes`,size:`sm`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,H.jsx)(hg,{}),(0,H.jsx)(B.Suspense,{fallback:(0,H.jsx)(lg,{}),children:BC(r).with(`initial`,()=>s).with(`custom`,()=>(0,H.jsxs)(`div`,{className:`p-3`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center pb-3`,children:[(0,H.jsx)(`div`,{className:`font-bold`,children:`Choose type`}),(0,H.jsx)(gbt,{to:`initial`})]}),(0,H.jsxs)(`div`,{className:`space-y-2 grid grid-cols-1`,children:[(0,H.jsxs)(Fg,{onClick:()=>i(`custom-xyz`),children:[`XYZ`,(0,H.jsx)(lt,{})]}),(0,H.jsxs)(Fg,{onClick:()=>i(`custom-style`),children:[`MapLibre style`,(0,H.jsx)(lt,{})]}),(0,H.jsxs)(Fg,{onClick:()=>i(`custom-tilejson`),children:[`TileJSON`,(0,H.jsx)(lt,{})]})]})]})).with(`custom-xyz`,()=>(0,H.jsx)(`div`,{className:`p-3`,children:(0,H.jsx)(ybt,{onDone:()=>n(!1)})})).with(`custom-style`,()=>(0,H.jsx)(`div`,{className:`p-3`,children:(0,H.jsx)(_bt,{onDone:()=>n(!1)})})).with(`custom-tilejson`,()=>(0,H.jsx)(`div`,{className:`p-3`,children:(0,H.jsx)(vbt,{onDone:()=>n(!1)})})).exhaustive()})]})})]})}function Sbt({layerConfig:e}){let{attributes:t,listeners:n,setNodeRef:r,transform:i,transition:a}=__e({id:e.id}),o=fC(),s=i_().useTransact(),[c,l]=(0,B.useState)(!1),{data:u,isError:d}=Rj({queryKey:[e.url],queryFn:async()=>e.type===`TILEJSON`&&_v(e.url),retry:!1}),f={transform:Mw.Transform.toString(i),transition:a},p=(0,H.jsxs)(Kp,{open:c,onOpenChange:e=>l(e),children:[(0,H.jsx)(qp,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:`opacity-30 hover:opacity-100 select-none`,title:`Edit`,children:(0,H.jsx)(Wn,{})})}),(0,H.jsxs)(_g,{children:[(0,H.jsx)(hg,{}),(0,H.jsx)(bbt,{layer:e,onDone:()=>l(!1)})]})]});
1515return(0,H.jsxs)(`div`,{ref:r,style:f,className:`py-1 group flex gap-x-1 items-start`,children:[(0,H.jsx)(`div`,{className:`pt-0.5 opacity-20 hover:opacity-100 cursor-ns-resize`,...t,...n,children:(0,H.jsx)(Zt,{})}),(0,H.jsxs)(`div`,{className:`flex-auto`,children:[(0,H.jsxs)(`div`,{className:`flex gap-x-2 items-center`,children:[(0,H.jsx)(`span`,{...t,...n,className:`block select-none truncate flex-auto text-sm`,children:e.name}),d?(0,H.jsxs)(vm,{delayDuration:0,children:[(0,H.jsx)(ym,{children:(0,H.jsx)($t,{className:`text-red-500 dark:text-red-300`})}),(0,H.jsx)(fg,{children:`This TileJSON source failed to load`})]}):null,u&&u?.bounds?(0,H.jsx)(`button`,{type:`button`,title:`Zoom to layer`,className:`opacity-30 hover:opacity-100 select-none`,onClick:()=>{o(le.of(u.bounds))},children:(0,H.jsx)(In,{})}):null,p,(0,H.jsxs)(`div`,{className:`flex items-center gap-x-1`,children:[(0,H.jsx)(`input`,{type:`number`,min:`0`,step:`1`,className:`text-xs
1516          px-1 py-0.5
1517          border-gray-300
1518          rounded-xs
1519          dark:text-white
1520          dark:bg-transparent
1521        opacity-50 hover:opacity-100 focus:opacity-100
1522        w-12`,max:`100`,value:Math.round(e.opacity*100),onChange:async t=>{let n=(0,Ox.default)(t.target.valueAsNumber/100,0,1);Number.isNaN(n)||await s({note:`Change layer opacity`,putLayerConfigs:[{...e,opacity:n}]})}}),(0,H.jsx)(`div`,{className:`text-gray-500 text-xs`,children:`%`})]}),(0,H.jsx)(`div`,{role:`checkbox`,title:`Toggle visibility`,onClick:async()=>{await s({note:`Toggle background layer visibility`,putLayerConfigs:[{...e,visibility:!e.visibility}]})},"aria-checked":e.visibility,className:`opacity-30 hover:opacity-100 select-none`,children:(0,H.jsx)(Hg,{visibility:e.visibility})}),(0,H.jsx)(`div`,{role:`checkbox`,title:`Toggle label visibility`,onClick:async()=>{await s({note:`Toggle label visibility`,putLayerConfigs:[{...e,labelVisibility:!e.labelVisibility}]})},"aria-checked":e.labelVisibility,className:`opacity-30 hover:opacity-100 select-none`,children:(0,H.jsx)(Mse,{visibility:e.labelVisibility})}),(0,H.jsx)(`button`,{type:`button`,className:`opacity-30 hover:opacity-100 select-none`,onClick:async()=>{await s({note:`Delete layer`,deleteLayerConfigs:[e.id]})},children:(0,H.jsx)(Sr,{})})]}),(0,H.jsx)(`div`,{className:`opacity-50 font-semibold`,style:{fontSize:10},children:e.type})]})]},e.id)}function Cbt(){let e=i_().useTransact(),t=[...Yv(Kx).values()],n=Iw(Fw(Xw),Fw(Jw,{coordinateGetter:b_e}));function r(n){let{active:r,over:i}=n;if(r.id!==i?.id){let n=t.findIndex(e=>e.id===r.id),a=t.findIndex(e=>e.id===i?.id),o=lT(t,n,a),s=o.findIndex(e=>e.id===r.id),c=o[s],l=`a0`;try{l=gM(o[s-1]?.at||null,o[s+1]?.at||null)}catch{}e({note:`Reorder layers`,putLayerConfigs:[{...c,at:l}]}).catch(e=>void 0)}}return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex justify-between pb-2`,children:[(0,H.jsx)(`div`,{className:`font-bold`,children:`Layers`}),(0,H.jsx)(`div`,{className:`relative`,children:(0,H.jsx)(xbt,{})})]}),(0,H.jsx)(`div`,{className:`placemark-scrollbar overflow-y-auto`,style:{maxHeight:300},children:(0,H.jsx)(cT,{onDragEnd:r,sensors:n,collisionDetection:mhe,modifiers:[t4e,e4e],children:(0,H.jsx)(`div`,{className:`pt-3 border-t
1523            border-gray-100 dark:border-gray-700`,children:(0,H.jsx)(l_e,{items:t,strategy:a_e,children:t.map(e=>(0,H.jsx)(Sbt,{layerConfig:e},e.id))})})})})]})}var wbt=(0,B.memo)(function(){let e=Xv(Ux),t=sv();return(0,H.jsxs)(`div`,{className:`flex items-center`,children:[(0,H.jsx)(`div`,{className:`block h-10 w-10 p-1 flex items-stretch`,children:(0,H.jsxs)(vm,{children:[(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(Fg,{variant:`quiet`,"aria-label":`Search`,onClick:()=>{e({type:`quickswitcher`})},children:(0,H.jsx)(In,{})})}),(0,H.jsx)(fg,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[`Search`,` `,(0,H.jsx)(Rg,{children:cv(_S,t)})]})})]})}),(0,H.jsxs)(vm,{children:[(0,H.jsxs)(Kp,{children:[(0,H.jsx)(`div`,{className:`h-10 w-10 p-1 flex items-stretch`,children:(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(qp,{"aria-label":`Layers`,asChild:!0,children:(0,H.jsx)(Fg,{variant:`quiet`,children:(0,H.jsx)(wn,{})})})})}),(0,H.jsx)(vg,{size:`md`,children:(0,H.jsx)(B.Suspense,{fallback:(0,H.jsx)(lg,{size:`sm`}),children:(0,H.jsx)(Cbt,{})})})]}),(0,H.jsx)(fg,{side:`bottom`,children:(0,H.jsx)(`span`,{className:`whitespace-nowrap`,children:`Manage background layers`})})]})]})}),Tbt=zv({x:5,y:5});function Ebt(){let e=bM(),t=Xv(Ux),n=xM(),[r]=dbt(),i=r?.get(`load`),a=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{i&&!a.current&&(a.current=!0,(async()=>{try{let r=new URL(i);if(r.protocol===`https:`){let e=await fetch(r),t=await e.arrayBuffer(),i=new File([t],r.pathname.split(`/`).pop()||``,{type:e.headers.get(`Content-Type`)||``}),a=(await ybe(i)).unsafeCoerce();n(i,a,()=>{})}else if(r.protocol===`data:`){let[n,...i]=r.pathname.split(`,`),a=i.join(`,`),[o,s]=n.split(`;`,2),c=BC(s).with(void 0,()=>decodeURIComponent(a)).with(`base64`,()=>atob(a)).otherwise(()=>{throw Error(`Unknown encoding in data url`)});o===`application/json`?e(c,{...GT,type:`geojson`},(...e)=>{console.log(e)}):t({type:`load_text`,initialValue:c})}else pE.error(`Couldn’t handle this ?load argument - urls and data urls are supported`)}catch(e){pE.error(e instanceof Error?e.message:`Failed to load data from URL`)}})())},[i,e,n,t]),null}function Dbt(){let[e,t]=(0,B.useState)(null);wyt();let n=Yv(Xx),r=Tyt(),i=`HORIZONTAL`;switch(n.layout){case`VERTICAL`:i=`VERTICAL`;break;case`AUTO`:i=r?`HORIZONTAL`:`VERTICAL`;break;case`FLOATING`:i=`FLOATING`;break}let a=Iw(Fw(Xw,{activationConstraint:{distance:2}})),[o,s]=Zv(Tbt);return(0,H.jsx)(`main`,{className:Dm([`h-screen flex flex-col bg-white dark:bg-gray-800`,Yv(fS)===`dark`?`dark`:``]),children:(0,H.jsx)(_m,{children:(0,H.jsxs)(kS.Provider,{value:e,children:[(0,H.jsx)(pse,{fallback:e=>(0,H.jsxs)(`div`,{className:`h-20 flex items-center justify-center px-2 gap-x-2`,children:[`An error occurred`,(0,H.jsxs)(Fg,{onClick:()=>e.resetError(),children:[(0,H.jsx)(Er,{}),` Try again`]})]}),children:(0,H.jsxs)(`div`,{className:`h-24`,children:[(0,H.jsx)(W2e,{}),(0,H.jsxs)(`div`,{className:`flex flex-row items-center justify-start overflow-x-auto sm:overflow-visible
1524          border-t border-gray-200 dark:border-gray-900 pl-2 h-12`,children:[(0,H.jsx)(Q2e,{replaceGeometryForId:null}),(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(oNe,{}),(0,H.jsx)(`div`,{className:`flex-auto`}),(0,H.jsx)(`div`,{className:`flex items-center space-x-2`,children:(0,H.jsx)(wbt,{})})]})]})}),(0,H.jsxs)(`div`,{className:Dm(i===`VERTICAL`&&`flex-col`,`flex flex-auto relative border-t border-gray-200 dark:border-gray-900`),children:[i===`HORIZONTAL`?(0,H.jsx)(uyt,{}):i===`FLOATING`?(0,H.jsx)(Cyt,{}):null,(0,H.jsx)(cT,{sensors:a,modifiers:[n4e],onDragEnd:e=>{s(t=>({x:t.x+e.delta.x,y:t.y+e.delta.y}))},children:(0,H.jsx)(Obt,{persistentTransform:o,setMap:t,layout:i})}),i===`HORIZONTAL`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(xyt,{}),(0,H.jsx)(kyt,{side:`left`}),(0,H.jsx)(kyt,{side:`right`})]}):i===`VERTICAL`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Syt,{}),(0,H.jsx)(jyt,{})]}):null]}),(0,H.jsx)(Y$e,{}),(0,H.jsx)(Ebt,{}),(0,H.jsx)(N$e,{}),(0,H.jsx)(B.Suspense,{fallback:null,children:(0,H.jsx)(i4e,{})}),(0,H.jsx)(h4e,{})]})})})}function Obt({setMap:e,layout:t,persistentTransform:n}){let[r,i]=Zv(Xx),a=(0,B.useRef)(null),{attributes:o,listeners:s,setNodeRef:c,transform:l}=Rge({id:`map`});kbt(a.current,t);let u=`bg-gray-100 dark:bg-gray-700 dark:text-gray-100`,d=`dark:bg-black text-gray-300 dark:text-gray-500 hover:text-gray-400`,f=ny((0,B.useCallback)((e,t)=>{t(Xx,{...e(Xx),layout:`FLOATING`}),t(oS,aS.Table),t(Tbt,{x:window.innerWidth-256-32,y:window.innerHeight-256-32-96})},[]));return(0,H.jsxs)(`div`,{className:Dm(t===`FLOATING`?`overflow-hidden absolute w-64 h-64 flex z-50 rounded-sm border border-gray-500 shadow-lg`:`relative flex-auto flex flex-col`),ref:e=>{c(e),a.current=e},style:t===`FLOATING`?{resize:`both`,transform:Mw.Transform.toString(l),top:n.y,left:n.x}:{},children:[(0,H.jsx)(`div`,{className:`flex-auto relative`,children:(0,H.jsx)(z2e,{setMap:e})}),t===`FLOATING`?null:(0,H.jsx)(m4e,{}),(0,H.jsxs)(`div`,{className:`top-2 right-2 absolute
1525      flex items-center justify-between
1526      divide-x divide-gray-300 dark:divide-black
1527      rounded-md border border-gray-300 dark:border-black`,children:[(0,H.jsxs)(vm,{delayDuration:0,
vendor: 8,727 bytes, lines 1527-1533
1527children:[(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:Dm(`block p-2 bg-white rounded-l`,r.layout===`AUTO`?u:d),onClick:()=>{i(e=>({...e,layout:`AUTO`}))},children:(0,H.jsx)(En,{})})}),(0,H.jsxs)(fg,{children:[(0,H.jsx)(gg,{}),`Horizontal layout`]})]}),(0,H.jsxs)(vm,{delayDuration:0,children:[(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:Dm(`block p-2 bg-white`,r.layout===`FLOATING`?u:d),onClick:()=>{f()},children:(0,H.jsx)(tt,{})})}),(0,H.jsxs)(fg,{children:[(0,H.jsx)(gg,{}),`Floating map layout`]})]}),(0,H.jsxs)(vm,{delayDuration:0,children:[(0,H.jsx)(ym,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:Dm(`block p-2 bg-white rounded-r`,r.layout===`VERTICAL`?u:d),onClick:()=>{i(e=>({...e,layout:`VERTICAL`}))},children:(0,H.jsx)(Ar,{})})}),(0,H.jsxs)(fg,{children:[(0,H.jsx)(gg,{}),`Vertical layout`]})]})]}),t===`FLOATING`?(0,H.jsx)(`button`,{className:`absolute top-2 left-2 block p-2
1528        border border-gray-300 dark:border-black
1529        bg-white dark:bg-gray-700
1530        dark:text-white
1531        rounded
1532        touch-none
1533        cursor-move`,...s,...o,children:(0,H.jsx)(Hn,{})}):null]})}function kbt(e,t){let n=(0,B.useContext)(kS);(0,B.useLayoutEffect)(()=>{e&&(e.style.width=``,e.style.height=``),n?.map?.resize()},[e,n]),(0,B.useLayoutEffect)(()=>{if(e){let t=(0,Jgt.default)(e=>{Array.isArray(e)&&e.length&&n?.map?.resize()},50),r=new ResizeObserver(t);return r.observe(e,{box:`border-box`}),()=>r.unobserve(e)}},[e,n])}var Abt=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),jbt=i(((e,t)=>{t.exports=Abt()})),Mbt=i((e=>{ze();var t=jbt(),n=Ve(),r=Mr();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],L=-1;function R(e){return{current:e}}function ee(e){0>L||(e.current=I[L],I[L]=null,L--)}function z(e,t){L++,I[L]=e.current,e.current=t}var te=R(null),ne=R(null),re=R(null),ie=R(null);function ae(e,t){switch(z(re,t),z(ne,e),z(te,null),t.nodeType){case 9:case 11:e=(e
vendor: 424 bytes, line 1533
1533=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ee(te),z(te,e)}function oe(){ee(te),ee(ne),ee(re)}function se(e){e.memoizedState!==null&&z(ie,e);var t=te.current,n=Ud(t,e.type);t!==n&&(z(ne,e),z(te,n))}function ce(e){ne.current===e&&(ee(te),ee(ne)),ie.current===e&&(ee(ie),Jf._currentValue=F
vendor: 2,541 bytes, lines 1533-1540
1533)}var le,ue;function de(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
1534    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
1535`+le+e+ue}var fe=!1;function pe(e,t){if(!e||fe)return``;fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
1536`),l=s.split(`
1537`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
1538`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?de(n):``}function me(e,t){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de(`Lazy`);case 13:return e.child!==t&&t!==null?de(`Suspense Fallback`):de(`Suspense`);case 19:return de(`SuspenseList`);case 0:case 15:return pe(e.type,!1);case 11:return pe(e.type.render,!1);case 1:return pe(e.type,!0);case 31:return de(`Activity`);default:return``}}function he(e){try{var t=``,n=null;do t+=me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
1539Error generating stack: `+e.message+`
1540`+e.stack}}var ge=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,ve=t.unstable_cancelCallback,ye=t.unstable_shouldYield,be=t.unstable_requestPaint,xe=t.unstable_now,Se=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,
vendor: 4,665 bytes, line 1540
1540we=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,Ee=t.unstable_LowPriority,De=t.unstable_IdlePriority,Oe=t.log,ke=t.unstable_setDisableYieldValue,Ae=null,je=null;function Me(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Ne=Math.clz32?Math.clz32:Ie,Pe=Math.log,Fe=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(Pe(e)/Fe|0)|0}var Le=256,Be=262144,B=4194304;function V(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=V(n))):i=V(o):i=V(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=V(n))):i=V(o)):i=V(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ge(){var e=B;return B<<=1,!(B&62914560)&&(B=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ne(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ne(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ne(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e,t){var n=t&-t;return n=n&42?1:Qe(n),(n&(e.suspendedLanes|t))===0?n:0}function Qe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function $e(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function et(){var e=P.p;return e===0?(e=window.event,e===void 0?32:sp(e.type)):e}function tt(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var nt=Math.random().toString(36).slice(2),rt=`__reactFiber$`+nt,it=`__reactProps$`+nt,at=`__reactContainer$`+nt,ot=`__reactEvents$`+nt,st=`__reactListeners$`+nt,ct=`__reactHandles$`+nt,lt=`__reactResources$`+nt,ut=`__reactMarker$`+nt;function dt(e){delete e[rt],delete e[it],delete e[ot],delete e[st],delete e[ct]}function ft(e){var t=e[rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[rt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function pt(e){if(e=e[rt]||e[at]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ht(e){var t=e[lt];return t||=e[lt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function gt(e){e[ut]=!0}var _t=new Set,vt={};function yt(e,t){bt(e,t),bt(e+`Capture`,t)}function bt(e,t){for(vt[e]=t,e=0;e<t.length;e++)_t.add(t[e])}var xt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
1540037D\\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]*$`),St={},Ct={};function wt(e){return ge.call(Ct,e)?!0:ge.call(St,e)?!1:xt.test(e)?Ct[e]=!0:(St[e]=!0,!1)}function Tt(e,t,n){if(wt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Et(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Dt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ot(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function At(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jt(e){if(!e._valueTracker){var t=kt(e)?`checked`:`value`;e._valueTracker=At(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=kt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Nt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function It(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ot(t)):e.value!==``+Ot(t)&&(e.value=``+Ot(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Rt(e,o,Ot(n)):Rt(e,o,Ot(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ot(s):e.removeAttribute(`name`)}function Lt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){jt(e);return}n=n==null?``:``+Ot(n),t=t==null?n:``+Ot(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),jt(e)}function Rt(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function zt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ot(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Bt(e,t,n){if(t!=null&&(t=``+Ot(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ot(n)}function Vt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}
vendor: 9,508 bytes, line 1540
1540n=Ot(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),jt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Wt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Wt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Wt(e,o,t[o])}function Kt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=pt(e);if(t&&(e=t.stateNode)){var n=e[it]||null;a:switch(e=t.stateNode,t.type){case`input`:if(It(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[it]||null;if(!a)throw Error(i(90));It(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Mt(r)}break a;case`textarea`:Bt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(bu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[it]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=f({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=f({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(f({},wn,{dataTransfer:0})),Dn=gn(f({},yn,{relatedTarget:0})),On=gn(f({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(f({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(f({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F
15405`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(f({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(f({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(f({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(f({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(f({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(f({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&`CompositionEvent`in window,Wn=null;on&&`documentMode`in document&&(Wn=document.documentMode);var Gn=on&&`TextEvent`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Ed(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){vd(e,0)}function or(e){if(Mt(mt(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(on){var lr;if(on){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,Qt(e)),rn(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ge.call(t,i)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Er=on&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Nt(r)||(r=Dr,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 72,437 bytes, line 1540
1540sNode:r.focusNode,focusOffset:r.focusOffset}),kr&&br(kr,r)||(kr=r,r=Ed(Or,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Nr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Pr={animationend:Nr(`Animation`,`AnimationEnd`),animationiteration:Nr(`Animation`,`AnimationIteration`),animationstart:Nr(`Animation`,`AnimationStart`),transitionrun:Nr(`Transition`,`TransitionRun`),transitionstart:Nr(`Transition`,`TransitionStart`),transitioncancel:Nr(`Transition`,`TransitionCancel`),transitionend:Nr(`Transition`,`TransitionEnd`)},Fr={},Ir={};on&&(Ir=document.createElement(`div`).style,`AnimationEvent`in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),`TransitionEvent`in window||delete Pr.transitionend.transition);function H(e){if(Fr[e])return Fr[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ir)return Fr[e]=t[n];return e}var Lr=H(`animationend`),Rr=H(`animationiteration`),zr=H(`animationstart`),Br=H(`transitionrun`),Vr=H(`transitionstart`),Hr=H(`transitioncancel`),Ur=H(`transitionend`),Wr=new Map,Gr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),yt(t,[e])}var qr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof Re==`object`&&typeof Re.emit==`function`){Re.emit(`uncaughtException`,e);return}console.error(e)},Jr=[],Yr=0,Xr=0;function Zr(){for(var e=Yr,t=Xr=Yr=0;t<e;){var n=Jr[t];Jr[t++]=null;var r=Jr[t];Jr[t++]=null;var i=Jr[t];Jr[t++]=null;var a=Jr[t];if(Jr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ti(n,i,a)}}function Qr(e,t,n,r){Jr[Yr++]=e,Jr[Yr++]=t,Jr[Yr++]=n,Jr[Yr++]=r,Xr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ne(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=Vf(e,n,te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ai(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ui(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ai(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ai(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ai(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:he(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:he(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Ne(r)-1;r&=~(1<<i),n+=1;var a=32-Ne(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Ne(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,Mi=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[rt]=e,t[it]=r,n){case`dialog`:yd(`cancel`,t),yd(`close`,t);break;case`iframe`:case`object`:case`embed`:yd(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)yd(gd[n],t);break;case`source`:yd(`error`,t);break;case`img`:case`image`:case`link`:yd(`error`,t),yd(`load`,t);break;case`details`:yd(`toggle`,t);break;case`input`:yd(`invalid`,t),Lt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:yd(`invalid`,t);break;case`textarea`:yd(`invalid`,t),Vt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(yd(`beforetoggle`,t),yd(`toggle`,t)),r.onScroll!=null&&yd(`scroll`,t),r.onScrollEnd!=null&&yd(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ai=Ai.return}}function zi(e){if(e!==Ai)return!1;if(!Mi)return Ri(e),Mi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Wd(e.type,e.memoizedProps)),n=!n),n&&ji&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=uf(e)}else t===27?(t=ji,Qd(e.type)?(e=lf,lf=null,ji=e):ji=t):ji=Ai?cf(e.stateNode.nextSibling):null;return!0}function Bi(){ji=Ai=null,Mi=!1}function Vi(){var e=Ni;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=R(null),Wi=null,Gi=null;function Ki(e,t,n){z(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,ee(Ui)}function Ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;yr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ie.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Jf]:e.push(Jf))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=ud(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=N.S;N.S=function(e,t){eu=xe(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=R(null);function _a(){var e=ga.current;return e===null?Fl.pooledCache:e}function va(e,t){t===null?z(ga,ga.current):z(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=Fl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=si(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ui(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=li(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case h:return t=pi(t,e.mode,n),t.return=e,t;case T:return t=Ea(t),f(e,t,n)}if(M(t)||k(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===b)return f(e,ea(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Ea(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===b)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Ea(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Ma(r),i);if(r.$$typeof===b)return _(e,t,n,ea(t,r),i);Pa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Mi&&Ti(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Mi&&Ti(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Mi&&Ti(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Mi&&Ti(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Mi&&Ti(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Mi&&Ti(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Ea(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Ma(o),c);if(o.$$typeof===b)return x(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=x(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Ll&p)===p:(r&p)===p){p!==0&&p===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ra=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=R(null),Za=R(0);function Qa(e,t){e=Ul,z(Za,e),z(Xa,t),Ul=e|t.baseLanes}function $a(){z(Za,Ul),z(Xa,Xa.current)}function eo(){Ul=Za.current,ee(Xa),ee(Za)}var to=R(null),no=null;function ro(e){var t=e.alternate;z(co,co.current&1),z(to,e),no===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(no=e)}function io(e){z(co,co.current),z(to,e),no===null&&(no=e)}function ao(e){e.tag===22?(z(co,co.current),z(to,e),no===null&&(no=e)):oo(e)}function oo(){z(co,co.current),z(to,to.current)}function so(e){ee(to),no===e&&(no=null),ee(co)}var co=R(0);function lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uo=0,fo=null,po=null,mo=null,ho=!1,go=!1,_o=!1,vo=0,yo=0,bo=null,eee=0;function xo(){throw Error(i(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function Co(e,t,n,r,i,a){return uo=a,fo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Is:Ls,_o=!1,a=n(r,i),_o=!1,go&&(a=To(t,n,r,i)),wo(e),a}function wo(e){N.H=Fs;var t=po!==null&&po.next!==null;if(uo=0,mo=po=fo=null,ho=!1,yo=0,bo=null,t)throw Error(i(300));e===null||Zs||(e=e.dependencies,e!==null&&Zi(e)&&(Zs=!0))}function To(e,t,n,r){fo=e;var a=0;do{if(go&&(bo=null),yo=0,go=!1,25<=a)throw Error(i(301));if(a+=1,mo=po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=oee,o=t(n,r)}while(go);return o}function tee(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Mo(t):t,e=e.useState()[0],(po===null?null:po.memoizedState)!==e&&(fo.flags|=1024),t}function Eo(){var e=vo!==0;return vo=0,e}function Do(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Oo(e){if(ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ho=!1}uo=0,mo=po=fo=null,go=!1,yo=vo=0,bo=null}function ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mo===null?fo.memoizedState=mo=e:mo=mo.next=e,mo}function Ao(){if(po===null){var e=fo.alternate;e=e===null?null:e.memoizedState}else e=po.next;var t=mo===null?fo.memoizedState:mo.next;if(t!==null)mo=t,po=e;else{if(e===null)throw fo.alternate===null?Error(i(467)):Error(i(310));po=e,e={memoizedState:po.memoizedState,baseState:po.baseState,baseQueue:po.baseQueue,queue:po.queue,next:null},mo===null?fo.memoizedState=mo=e:mo=mo.next=e}return mo}function jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mo(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=Ta(bo,e,t),t=fo,(mo===null?t.memoizedState:mo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Is:Ls),e}function No(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Mo(e);if(e.$$typeof===b)return $i(e)}throw Error(i(438,String(e)))}function Po(e){var t=null,n=fo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=fo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=jo(),fo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function Fo(e,t){return typeof t==`function`?t(e):t}function Io(e){return Lo(Ao(),po,e)}function Lo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(uo&f)===f:(Ll&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((uo&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,fo.lanes|=p,Gl|=p;f=u.action,_o&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,fo.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(Zs=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ro(e){var t=Ao(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);yr(o,t.memoizedState)||(Zs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function zo(e,t,n){var r=fo,a=Ao(),o=Mi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!yr((po||a).memoizedState,n);if(s&&(a.memoizedState=n,Zs=!0),a=a.queue,us(Ho.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||mo!==null&&mo.memoizedState.tag&1){if(r.flags|=2048,is(9,{destroy:void 0},Vo.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||uo&127||Bo(r,t,n)}return n}function Bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=fo.updateQueue,t===null?(t=jo(),fo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Vo(e,t,n,r){t.value=n,t.getSnapshot=r,Uo(t)&&Wo(e)}function Ho(e,t,n){return n(function(){Uo(t)&&Wo(e)})}function Uo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Wo(e){var t=ei(e,2);t!==null&&hu(t,e,2)}function Go(e){var t=ko();if(typeof e==`function`){var n=e;if(e=n(),_o){Me(!0);try{n()}finally{Me(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:e},t}function Ko(e,t,n,r){return e.baseState=n,Lo(e,po,typeof r==`function`?r:Fo)}function qo(e,t,n,r,a){if(Ms(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Jo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Jo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Yo(e,t,s)}catch(n){Zo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Yo(e,t,a)}catch(n){Zo(e,t,n)}}function Yo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Xo(e,t,n)},function(n){return Zo(e,t,n)}):Xo(e,t,n)}function Xo(e,t,n){t.status=`fulfilled`,t.value=n,Qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Jo(e,n)))}function Zo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Qo(t),t=t.next;while(t!==r)}e.action=null}function Qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $o(e,t){return t}function es(e,t){if(Mi){var n=Fl.formState;if(n!==null){a:{var r=fo;if(Mi){if(ji){b:{for(var i=ji,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=cf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=ko(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:t},n.queue=r,n=ks.bind(null,fo,r),r.dispatch=n,r=Go(!1),a=js.bind(null,fo,!1,r.queue),r=ko(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=qo.bind(null,fo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ts(e){return ns(Ao(),po,e)}function ns(e,t,n){if(t=Lo(e,t,$o)[0],e=Io(Fo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Mo(t)}catch(e){throw e===ba?Sa:e}else r=t;t=Ao();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(fo.flags|=2048,is(9,{destroy:void 0},nee.bind(null,i,n),null)),[r,a,e]}function nee(e,t){e.action=t}function rs(e){var t=Ao(),n=po;if(n!==null)return ns(t,n,e);Ao(),t=t.memoizedState,n=Ao();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=fo.updateQueue,t===null&&(t=jo(),fo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function as(){return Ao().memoizedState}function ss(e,t,n,r){var i=ko();fo.flags|=e,i.memoizedState=is(1|t,{destroy:void 0},n,r===void 0?null:r)}function cs(e,t,n,r){var i=Ao();r=r===void 0?null:r;var a=i.memoizedState.inst;po!==null&&r!==null&&So(r,po.memoizedState.deps)?i.memoizedState=is(t,a,n,r):(fo.flags|=e,i.memoizedState=is(1|t,a,n,r))}function ls(e,t){ss(8390656,8,e,t)}function us(e,t){cs(2048,8,e,t)}function ds(e){fo.flags|=4;var t=fo.updateQueue;if(t===null)t=jo(),fo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function fs(e){var t=Ao().memoizedState;return ds({ref:t,nextImpl:e}),function(){if(Pl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ps(e,t){return cs(4,2,e,t)}function ree(e,t){return cs(4,4,e,t)}function ms(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function hs(e,t,n){n=n==null?null:n.concat([e]),cs(4,4,ms.bind(null,t,e),n)}function gs(){}function _s(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vs(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),_o){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r}function ys(e,t,n){return n===void 0||uo&1073741824&&!(Ll&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),fo.lanes|=e,Gl|=e,n)}function bs(e,t,n,r){return yr(n,t)?n:Xa.current===null?!(uo&42)||uo&1073741824&&!(Ll&261930)?(Zs=!0,e.memoizedState=n):(e=mu(),fo.lanes|=e,Gl|=e,t):(e=ys(e,n,r),yr(e,t)||(Zs=!0),e)}function xs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,js(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ma(c,r),pu(e)):As(e,t,r,pu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ws(e).queue;xs(e,a,t,F,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},pu())}function Es(){return $i(Jf)}function Ds(){return Ao().memoizedState}function Os(){return Ao().memoizedState}function iee(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Va(n);var r=Ha(t,e,n);r!==null&&(hu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function aee(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=$r(e,t,n,r),n!==null&&(hu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,pu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,yr(s,o))return Qr(e,t,i,0),Fl===null&&Zr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return hu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=$r(e,n,r,2),t!==null&&hu(t,e,2)}function Ms(e){var t=e.alternate;return e===fo||t!==null&&t===fo}function Ns(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var Fs={readContext:$i,use:No,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useInsertionEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useSyncExternalStore:xo,useId:xo,useHostTransitionStatus:xo,useFormState:xo,useActionState:xo,useOptimistic:xo,useMemoCache:xo,useCacheRefresh:xo};Fs.useEffectEvent=xo;var Is={readContext:$i,use:No,useCallback:function(e,t){return ko().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ss(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=ko();t=t===void 0?null:t;var r=e();if(_o){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ko();if(n!==void 0){var i=n(t);if(_o){Me(!0);try{n(t)}finally{Me(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=aee.bind(null,fo,e),[r.memoizedState,e]},useRef:function(e){var t=ko();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,n=ks.bind(null,fo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(ko(),e,t)},useTransition:function(){var e=Go(!1);return e=xs.bind(null,fo,e.queue,!0,!1),ko().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=fo,a=ko();if(Mi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Ll&127||Bo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ls(Ho.bind(null,r,o,e),[e]),r.flags|=2048,is(9,{destroy:void 0},Vo.bind(null,r,o,n,t),null),n},useId:function(){var e=ko(),t=Fl.identifierPrefix;if(Mi){var n=wi,r=Ci;n=(r&~(1<<32-Ne(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=eee++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Es,useFormState:es,useActionState:es,useOptimistic:function(e){var t=ko();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,fo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Po,useCacheRefresh:function(){return ko().memoizedState=iee.bind(null,fo)},useEffectEvent:function(e){var t=ko(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:$i,use:No,useCallback:_s,useContext:$i,useEffect:us,useImperativeHandle:hs,useInsertionEffect:ps,useLayoutEffect:ree,useMemo:vs,useReducer:Io,useRef:as,useState:function(){return Io(Fo)},useDebugValue:gs,useDeferredValue:function(e,t){return bs(Ao(),po.memoizedState,e,t)},useTransition:function(){var e=Io(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Ds,useHostTransitionStatus:Es,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){return Ko(Ao(),po,e,t)},useMemoCache:Po,useCacheRefresh:Os};Ls.useEffectEvent=fs;var oee={readContext:$i,use:No,useCallback:_s,useContext:$i,useEffect:us,useImperativeHandle:hs,useInsertionEffect:ps,useLayoutEffect:ree,useMemo:vs,useReducer:Ro,useRef:as,useState:function(){return Ro(Fo)},useDebugValue:gs,useDeferredValue:function(e,t){var n=Ao();return po===null?ys(n,e,t):bs(n,po.memoizedState,e,t)},useTransition:function(){var e=Ro(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Ds,useHostTransitionStatus:Es,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){var n=Ao();return po===null?(n.baseState=e,[e,n.queue.dispatch]):Ko(n,po,e,t)},useMemoCache:Po,useCacheRefresh:Os};oee.useEffectEvent=fs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(hu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(hu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(hu(t,e,n),Ua(t,e,n))}};function Bs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!br(n,r)||!br(i,a):!0}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function Hs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){qr(e)}function Ws(e){console.error(e)}function see(e){qr(e)}function Gs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Gs(e,t)},n}function Js(e){return e=Va(e),e.tag=3,e}function Ys(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ks(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ks(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function cee(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=to.current,n!==null){switch(n.tag){case 31:case 13:return no===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Du(),!1}if(Mi)return t=to.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=qs(e.stateNode,r,a),Wa(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=qs(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Js(a),Ys(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var Xs=Error(i(461)),Zs=!1;function Qs(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function $s(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=Co(e,t,n,o,a,i),s=Eo(),e!==null&&!Zs?(Do(e,t,i),Cc(e,t,i)):(Mi&&s&&Di(t),t.flags|=1,Qs(e,t,r,i),t.child)}function ec(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,tc(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(Zs=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&(Zs=!0);else return t.lanes=e.lanes,Cc(e,t,i)}return lc(e,t,n,r,i)}function nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?$a():Qa(t,a),ao(t);else return r=t.lanes=536870912,ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),$a(),oo(t)):(va(t,a.cachePool),Qa(t,a),oo(t),t.memoizedState=null);return Qs(e,t,i,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),$a(),ao(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return Ia(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,so(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Mi){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(null,e);if(io(t),(e=ji)?(e=rf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return ac(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(io(t),a)if(t.flags&256)t.flags&=-257,t=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Zs||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,Zs||a){if(r=Fl,r!==null&&(s=Ze(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),hu(r,e,s),Xs;Du(),t=oc(e,t,n)}else e=o.treeContext,ji=cf(s.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=ac(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lc(e,t,n,r,i){return Qi(t),n=Co(e,t,n,r,void 0,i),r=Eo(),e!==null&&!Zs?(Do(e,t,i),Cc(e,t,i)):(Mi&&r&&Di(t),t.flags|=1,Qs(e,t,n,i),t.child)}function uc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Eo(),e!==null&&!Zs?(Do(e,t,a),Cc(e,t,a)):(Mi&&r&&Di(t),t.flags|=1,Qs(e,t,n,a),t.child)}function dc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&zs.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Ra||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Ra||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,cc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):Qs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function fc(e,t,n,r){return Bi(),t.flags|=256,Qs(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:ya()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function gc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(co.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Mi){if(a?ro(t):oo(t),(e=ji)?(e=rf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(oo(t),a=t.mode,c=vc({mode:`hidden`,children:c},a),r=ui(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(null,r)):(ro(t),_c(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ro(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?(oo(t),c=r.fallback,a=t.mode,r=vc({mode:`visible`,children:r.children},a),c=ui(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,t=rc(null,r)):(oo(t),t.child=e.child,t.flags|=128,t=null);else if(ro(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=yc(e,t,n)}else if(Zs||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,Zs||s){if(s=Fl,s!==null&&(r=Ze(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),hu(s,e,r),Xs;af(c)||Du(),t=yc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=cf(c.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=_c(t,r.children),t.flags|=4096);return t}return a?(oo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,a,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,rc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(e.child,r)):(ro(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return Ia(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function xc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=co.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(co,o),Qs(e,t,r,n),r=Mi?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&lo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:se(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ro(t),e=Cc(e,t,n),e===null?null:e.sibling):gc(e,t,n):(ro(t),t.flags|=128,null);ro(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(co,co.current),r)break;return null;case 22:return t.lanes=0,nc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Zs=!1,Tc(e,t,n);Zs=!!(e.flags&131072)}else Zs=!1,Mi&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Hs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=$s(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=ec(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),dc(e,t,r,a,n);case 3:a:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ka(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=fc(e,t,r,n);break a}else if(r!==a){a=hi(Error(i(424)),t),Hi(a),t=fc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=cf(e.firstChild),Ai=t,Mi=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=Cc(e,t,n);break a}Qs(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=Df(t.type,null,t.pendingProps,null))?t.memoizedState=n:Mi||(n=t.type,e=t.pendingProps,r=Vd(re.current).createElement(n),r[rt]=t,r[it]=e,Fd(r,n,e),gt(r),t.stateNode=r):t.memoizedState=Df(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&Mi&&(r=t.stateNode=ff(t.type,t.pendingProps,re.current),Ai=t,Pi=!0,a=ji,Qd(t.type)?(lf=a,ji=cf(r.firstChild)):ji=a),Qs(e,t,t.pendingProps.children,n),cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Mi&&((a=r=ji)&&(r=nf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Ai=t,ji=cf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Wd(a,o)?r=null:s!==null&&Wd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,tee,null,null,n),Jf._currentValue=a),cc(e,t),Qs(e,t,r,n),t.child;case 6:return e===null&&Mi&&((e=n=ji)&&(n=fee(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Ii(t)),null;case 13:return gc(e,t,n);case 4:return ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):Qs(e,t,r,n),t.child;case 11:return $s(e,t,t.type,t.pendingProps,n);case 7:return Qs(e,t,t.pendingProps,n),t.child;case 8:return Qs(e,t,t.pendingProps.children,n),t.child;case 12:return Qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),Qs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,Qs(e,t,r,n),t.child;case 14:return ec(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=Fl,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),Ki(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,aa,r))),Qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Da=Ca,xa}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Hf(t))if(wu())e.flags|=8192;else throw Da=Ca,xa}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,Yl|=t)}function jc(e,t){if(!Mi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(ce(t),n=re.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=te.current,zi(t)?Li(t,e):(e=ff(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=te.current,zi(t))Li(t,o);else{var s=Vd(re.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[rt]=t,o[it]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=re.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[rt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ii(t,!0)}else e=Vd(e).createTextNode(r),e[rt]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[rt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(so(t),t):(so(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[rt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(so(t),t):(so(t),null)}return so(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return oe(),e===null&&Sd(t.stateNode.containerInfo),Mc(t),null;case 10:return qi(t.type),Mc(t),null;case 19:if(ee(co),r=t.memoizedState,r===null)return Mc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)jc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lo(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return z(co,co.current&1|2),Mi&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xe()>tu&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}else{if(!a)if(e=lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Mi)return Mc(t),null}else 2*xe()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xe(),e.sibling=null,n=co.current,z(co,a?n&1|2:n&1),Mi&&Ti(t,r.treeForkCount),e);case 22:case 23:return so(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ee(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function lee(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ce(t),null;case 31:if(t.memoizedState!==null){if(so(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(so(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ee(co),null;case 4:return oe(),null;case 10:return qi(t.type),null;case 22:case 23:return so(t),eo(),e!==null&&ee(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Pc(e,t){switch(Oi(t),t.tag){case 3:qi(aa),oe();break;case 26:case 27:case 5:ce(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&so(t);break;case 13:so(t);break;case 19:ee(co);break;case 10:qi(t.type);break;case 22:case 23:so(t),eo(),e!==null&&ee(ga);break;case 24:qi(aa)}}function Fc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Ic(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Uu(e,e.return,t)}}}function Rc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Vc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[it]=t}catch(t){Uu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[rt]=e,t[it]=n}catch(t){Uu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,zd=ep,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},ep=!1,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;
vendor: 4,312 bytes, line 1540
1540try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ya(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,(n.subtreeFlags&8772)!=0):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;Qd(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),pf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null)if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:nl!==null&&(rl?(e=nl,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),wp(e)):$d(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{wp(e)}catch(e){Uu(t,t.return,e)}}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{wp(e)}catch(e){Uu(t,t.return,e)}}function cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Qd(c.type)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ut]||o[rt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head >
1540 title`))),Fd(o,r,n),o[rt]=e,gt(o),r=o;break a;case`link`:var s=zf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=zf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[rt]=e,gt(o),r=o}e.stateNode=r}else Bf(a,e.type,e.stateNode);else e.stateNode=Pf(a,r,e.memoizedProps);
vendor: 40,692 bytes, lines 1540-1541
1540else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Bf(a,e.type,e.stateNode):Pf(a,r,e.memoizedProps))}break;case 27:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Ht(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Rf=null,a=dl,dl=gf(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wp(t.containerInfo)}catch(t){Uu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=gf(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=xe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ef(m,!0):ef(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ht(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:pf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:_l(i,a,n),Fc(4,a);break;case 1:if(_l(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){bl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Uf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=gf(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=0,Fl=null,Il=null,Ll=0,Rl=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return Pl&2&&Ll!==0?Ll&-Ll:N.T===null?et():ud()}function mu(){if(Jl===0)if(!(Ll&536870912)||Mi){var e=Be;Be<<=1,!(Be&3932160)&&(Be=262144),Jl=e}else Jl=536870912;return e=to.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===Fl&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Ll,Jl,!1)),qe(e,n),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Kl|=n),Wl===4&&yu(e,Ll,Jl,!1)),nd(e))}function gu(e,t,n){if(Pl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ue(e,t),a=r?uee(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-xe(),10<a)){if(yu(r,t,Jl,!Bl),He(r,0,!0)!==0)break a;su=t,r.timeoutHandle=qd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);nd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},El(t,a,d);var m=(a&62914560)===a?$l-xe():(a&4194048)===a?eu-xe():0;if(m=hee(d,m),m!==null){su=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!yr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ne(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function bu(){return Pl&6?!0:(rd(0,!1),!1)}function xu(){if(Il!==null){if(Rl===0)var e=Il.return;else e=Il,Gi=Wi=null,Oo(e),Aa=null,ja=0,e=Il;for(;e!==null;)Pc(e.alternate,e),e=e.return;Il=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Fl=e,Il=n=si(e.current,null),Ll=t,Rl=0,zl=null,Bl=!1,Vl=Ue(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ne(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,Zr(),n}function Cu(e,t){fo=null,N.H=Fs,t===ba||t===Sa?(t=Oa(),Rl=3):t===xa?(t=Oa(),Rl=4):Rl=t===Xs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,Il===null&&(Wl=1,Gs(e,hi(t,e.current)))}function wu(){var e=to.current;return e===null?!0:(Ll&4194048)===Ll?no===null:(Ll&62914560)===Ll||Ll&536870912?e===no:!1}function Tu(){var e=N.H;return N.H=Fs,e===null?Fs:e}function Eu(){var e=N.A;return N.A=Ml,e}function Du(){Wl=4,Bl||(Ll&4194048)!==Ll&&to.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||Fl===null||yu(Fl,Ll,Jl,!1)}function Ou(e,t,n){var r=Pl;Pl|=2;var i=Tu(),a=Eu();(Fl!==e||Ll!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(Rl!==0&&Il!==null){var s=Il,c=zl;switch(Rl){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:to.current===null&&(t=!0);var l=Rl;if(Rl=0,zl=null,Mu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=Rl,Rl=0,zl=null,Mu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,Pl=r,N.H=i,N.A=a,Il===null&&(Fl=null,Ll=0,Zr()),o}function ku(){for(;Il!==null;)Au(Il)}function uee(e,t){var n=Pl;Pl|=2;var r=Tu(),a=Eu();Fl!==e||Ll!==t?(nu=null,tu=xe()+500,Su(e,t)):Vl=Ue(e,t);a:do try{if(Rl!==0&&Il!==null){t=Il;var o=zl;b:switch(Rl){case 1:Rl=0,zl=null,Mu(e,t,o,1);break;case 2:case 9:if(wa(o)){Rl=0,zl=null,ju(t);break}t=function(){Rl!==2&&Rl!==9||Fl!==e||(Rl=7),nd(e)},o.then(t,t);break a;case 3:Rl=7;break a;case 4:Rl=5;break a;case 7:wa(o)?(Rl=0,zl=null,ju(t)):(Rl=0,zl=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Il.tag){case 26:s=Il.memoizedState;case 5:case 27:var c=Il;if(s?Hf(s):c.stateNode.complete){Rl=0,zl=null;var l=c.sibling;if(l!==null)Il=l;else{var u=c.return;u===null?Il=null:(Il=u,Nu(u))}break b}}Rl=0,zl=null,Mu(e,t,o,5);break;case 6:Rl=0,zl=null,Mu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}dee();break}catch(t){Cu(e,t)}while(1);return Gi=Wi=null,N.H=r,N.A=a,Pl=n,Il===null?(Fl=null,Ll=0,Zr(),Wl):0}function dee(){for(;Il!==null&&!ye();)Au(Il)}function Au(e){var t=Ec(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Nu(e):Il=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Ll);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Ll);break;case 5:Oo(t);default:Pc(n,t),t=Il=ci(t,Ul),t=Ec(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Il=t}function Mu(e,t,n,r){Gi=Wi=null,Oo(t),Aa=null,ja=0;var i=t.return;try{if(cee(e,i,t,n,Ll)){Wl=1,Gs(e,hi(n,e.current)),Il=null;return}}catch(t){if(i!==null)throw Il=i,t;Wl=1,Gs(e,hi(n,e.current)),Il=null;return}t.flags&32768?(Mi||r===1?e=!0:Vl||Ll&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=to.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Bl);return}e=t.return;var n=Nc(t.alternate,t,Ul);if(n!==null){Il=n;return}if(t=t.sibling,t!==null){Il=t;return}Il=t=e}while(t!==null);Wl===0&&(Wl=5)}function Pu(e,t){do{var n=lee(e.alternate,e);if(n!==null){n.flags&=32767,Il=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Il=e;return}Il=e=n}while(e!==null);Wl=6,Il=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(iu!==0);if(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Xr,Je(e,n,o,s,c,l),e===Fl&&(Il=Fl=null,Ll=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Te,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=s,P.p=a,N.T=r}}iu=1,Iu(),Lu(),Ru()}}function Iu(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{fl(t,e);var a=Bd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Sr(s,h),v=Sr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}ep=!!zd,Bd=zd=null}finally{Pl=i,P.p=r,N.T=n}}e.current=t,iu=2}}function Lu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,P.p=r,N.T=n}}iu=3}}function Ru(){if(iu===4||iu===3){iu=0,be();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),$e(n),t=t.stateNode,je&&typeof je.onCommitFiberRoot==`function`)try{je.onCommitFiberRoot(Ae,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}su&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=$e(su),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,rd(0,!1),je&&typeof je.onPostCommitFiberRoot==`function`)try{je.onPostCommitFiberRoot(Ae,o)}catch{}return!0}finally{P.p=a,N.T=r,zu(e,t)}}function Hu(e,t,n){t=hi(n,t),t=qs(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(qe(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=hi(n,e),n=Js(2),r=Ha(t,n,2),r!==null&&(Ys(n,r,t,e),qe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Ll&n)===n&&(Wl===4||Wl===3&&(Ll&62914560)===Ll&&300>xe()-$l?!(Pl&2)&&Su(e,0):ql|=n,Yl===Ll&&(Yl=0)),nd(e)}function Ku(e,t){t===0&&(t=Ge()),e=ei(e,t),e!==null&&(qe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return _e(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ne(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Ll,a=He(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Kd()&&(e=td);for(var t=xe(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}iu!==0&&iu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ne(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Ll,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ve(r),$e(n)){case 2:case 8:n=we;break;case 32:n=Te;break;case 268435456:n=De;break;default:n=Te}return r=sd.bind(null,e),n=_e(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ve(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Ll;return r=He(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),od(e,xe()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;gu(e,t,!0)}function ld(){Xd(function(){Pl&6?_e(Ce,id):ad()})}function ud(){if(td===0){var e=ua;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[it]||null).action),o=r.submitter;o&&(t=(t=o[it]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);Cs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),Cs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Gr.length;md++){var hd=Gr[md];Kr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`onTransitionEnd`),bt(`onMouseEnter`,[`mouseout`,`mouseover`]),bt(`onMouseLeave`,[`mouseout`,`mouseover`]),bt(`onPointerEnter`,[`pointerout`,`pointerover`]),bt(`onPointerLeave`,[`pointerout`,`pointerover`]),yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}}}}function yd(e,t){var n=t[ot];n===void 0&&(n=t[ot]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,_t.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(sp(t)){case 2:var i=tp;break;case 8:i=np;break;default:i=rp}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ft(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),s=[];a:{var c=Wr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Lr:case Rr:case zr:l=On;break;case Ur:l=zn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(ft(u)||u[at]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ft(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:mt(l),h=u==null?c:mt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ft(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=sr;else if(tr(c))if(cr)v=_r;else{v=hr;var y=mr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Kt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Rt(c,`number`,c.value)}switch(y=r?mt(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(s,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(s,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Zn=!0)),y=Ed(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(Td(e,i,a)),i=an(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=an(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
1541`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Et(e,`class`,r);break;case`tabIndex`:Et(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Et(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){Et(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&yd(`scroll`,e);break;case`onScrollEnd`:r!=null&&yd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Yt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:yd(`beforetoggle`,e),yd(`toggle`,e),Tt(e,`popover`,r);break;case`xlinkActuate`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Tt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,Tt(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Gt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&yd(`scroll`,e);break;case`onScrollEnd`:r!=null&&yd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[it]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Tt(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:yd(`error`,e),yd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,o,s,n,null)}}a&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:yd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Nd(e,t,r,d,n,null)}}Lt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in yd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Nd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&zt(e,!!r,n,!0):zt(e,!!r,t,!1);return;case`textarea`:for(s in yd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Nd(e,t,s,c,n,null)}Vt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Nd(e,t,l,r,n,null)}return;case`dialog`:yd(`beforetoggle`,e),yd(`toggle`,e),yd(`cancel`,e),yd(`close`,e);break;case`iframe`:case`object`:yd(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)yd(gd[r],e);break;case`image`:yd(`error`,e),yd(`load`,e);break;case`details`:yd(`toggle`,e);break;case`embed`:case`source`:case`link`:yd(`error`,e),yd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Nd(e,t,c,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Nd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Nd(e,t,p,m,r,f)}}It(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Nd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Nd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?zt(e,!!n,n?[]:``,!1):zt(e,!!n,t,!0)):zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Nd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Nd(e,t,s,a,r,o)}Bt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Nd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Nd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Nd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Nd(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(e,t,_,void 0,r,p);
vendor: 4,464 bytes, line 1541
1541for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Nd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Nd(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ld(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Wd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e===Gd?!1:(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),wp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ut]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);wp(t)}function ef(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:tf(n),dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ut])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function fee(e,t,n){if(t===``)return null;for(;
vendor: 20,919 bytes, line 1541
1541e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=P.d;P.d={f:pee,r:mee,D:bf,C:xf,L:Sf,m:Cf,X:Tf,S:wf,M:Ef};function pee(){var e=_f.f(),t=bu();return e||t}function mee(e){var t=pt(e);t!==null&&t.tag===5&&t.type===`form`?Ts(t):_f.r(e)}var vf=typeof document>`u`?null:document;function yf(e,t,n){var r=vf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function bf(e){_f.D(e),yf(`dns-prefetch`,e,null)}function xf(e,t){_f.C(e,t),yf(`preconnect`,e,t)}function Sf(e,t,n){_f.L(e,t,n);var r=vf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Of(e);break;case`script`:a=Mf(e)}mf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(kf(a))||t===`script`&&r.querySelector(Nf(a))||(t=r.createElement(`link`),Fd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Cf(e,t){_f.m(e,t);var n=vf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Mf(e)}if(!mf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Nf(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),gt(r),n.head.appendChild(r)}}}function wf(e,t,n){_f.S(e,t,n);var r=vf;if(r&&e){var i=ht(r).hoistableStyles,a=Of(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(kf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&If(e,n);var c=o=r.createElement(`link`);gt(c),Fd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Ff(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Tf(e,t){_f.X(e,t);var n=vf;if(n&&e){var r=ht(n).hoistableScripts,i=Mf(e),a=r.get(i);a||(a=n.querySelector(Nf(i)),a||(e=f({src:e,async:!0},t),(t=mf.get(i))&&Lf(e,t),a=n.createElement(`script`),gt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ef(e,t){_f.M(e,t);var n=vf;if(n&&e){var r=ht(n).hoistableScripts,i=Mf(e),a=r.get(i);a||(a=n.querySelector(Nf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&Lf(e,t),a=n.createElement(`script`),gt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Df(e,t,n,r){var a=(a=re.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Of(n.href),n=ht(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Of(n.href);var o=ht(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(kf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||jf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Mf(n),n=ht(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Of(e){return`href="`+Ft(e)+`"`}function kf(e){return`link[rel="stylesheet"][`+e+`]`}function Af(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function jf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),gt(t),e.head.appendChild(t))}function Mf(e){return`[src="`+Ft(e)+`"]`}function Nf(e){return`script[async]`+e}function Pf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,gt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),gt(r),Fd(r,`style`,a),Ff(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Of(n.href);var o=e.querySelector(kf(a));if(o)return t.state.loading|=4,t.instance=o,gt(o),o;r=Af(n),(a=mf.get(a))&&If(r,a),o=(e.ownerDocument||e).createElement(`link`),gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Ff(o,n.precedence,e),t.instance=o;case`script`:return o=Mf(n.src),(a=e.querySelector(Nf(o)))?(t.instance=a,gt(a),a):(r=n,(a=mf.get(o))&&(r=f({},n),Lf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),gt(a),Fd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ff(r,n.precedence,e));return t.instance}function Ff(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function If(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Lf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Rf=null;function zf(e,t,n){if(Rf===null){var r=new Map,i=Rf=new Map;i.set(n,r)}else i=Rf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ut]||a[rt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Bf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Vf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Hf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Uf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Of(r.href),a=t.querySelector(kf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Gf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,gt(a);return}a=t.ownerDocument||t,r=Af(r),(i=mf.get(i))&&If(r,i),a=a.createElement(`link`),gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Gf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Wf=0;function hee(e,t){return e.stylesheets&&e.count===0&&qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Wf===0&&(Wf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Wf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Gf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Kf=null;function qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Kf=new Map,t.forEach(gee,e),Kf=null,Gf.call(e))}function gee(e,t){if(!(t.state.loading&4)){var n=Kf.get(e);if(n)var r=n.get(null);else{n=new Map,Kf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Gf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Jf={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function _ee(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function vee(e,t,n,r,i,a,o,s,c,l,u,d){return e=new _ee(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function yee(e){return e?(e=ri,e):ri}function Yf(e,t,n,r,i,a){i=yee(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(hu(n,e,t),Ua(n,e,t))}function Xf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zf(e,t){Xf(e,t),(e=e.alternate)&&Xf(e,t)}function Qf(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&hu(t,e,67108864),Zf(e,67108864)}}function $f(e){if(e.tag===13||e.tag===31){var t=pu();t=Qe(t);var n=ei(e,t);n!==null&&hu(n,e,t),Zf(e,t)}}var ep=!0;function tp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,rp(e,t,n,r)}finally{P.p=a,N.T=i}}function np(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,rp(e,t,n,r)}finally{P.p=a,N.T=i}}function rp(e,t,n,r){if(ep){var i=ip(r);if(i===null)wd(e,t,r,ap,n),gp(e,r);else if(bee(i,e,t,n,r))r.stopPropagation();else if(gp(e,r),t&4&&-1<hp.indexOf(e)){for(;i!==null;){var a=pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=V(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ne(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Pl&6)&&(tu=xe()+500,rd(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&hu(s,a,2),bu(),Zf(a,2)}if(a=ip(r),a===null&&wd(e,t,r,ap,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function ip(e){return e=Qt(e),op(e)}var ap=null;function op(e){if(ap=null,e=ft(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ap=e,null}function sp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Se()){case Ce:return 2;case we:return 8;case Te:case Ee:return 32;case De:return 268435456;default:return 32}default:return 32}}var cp=!1,lp=null,up=null,dp=null,fp=new Map,pp=new Map,mp=[],hp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function gp(e,t){switch(e){case`focusin`:case`focusout`:lp=null;break;case`dragenter`:case`dragleave`:up=null;break;case`mouseover`:case`mouseout`:dp=null;break;case`pointerover`:case`pointerout`:fp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:pp.delete(t.pointerId)}}function _p(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=pt(t),t!==null&&Qf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function bee(e,t,n,r,i){switch(t){case`focusin`:return lp=_p(lp,e,t,n,r,i),!0;case`dragenter`:return up=_p(up,e,t,n,r,i),!0;case`mouseover`:return dp=_p(dp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return fp.set(a,_p(fp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,pp.set(a,_p(pp.get(a)||null,e,t,n,r,i)),!0}return!1}function vp(e){var t=ft(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,tt(e.priority,function(){$f(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,tt(e.priority,function(){$f(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function yp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ip(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=pt(n),t!==null&&Qf(t),e.blockedOn=n,!1;t.shift()}return!0}function bp(e,t,n){yp(e)&&n.delete(t)}function xee(){cp=!1,lp!==null&&yp(lp)&&(lp=null),up!==null&&yp(up)&&(up=null),dp!==null&&yp(dp)&&(dp=null),fp.forEach(bp),pp.forEach(bp)}function xp(e,n){e.blockedOn===n&&(e.blockedOn=null,cp||(cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,xee)))}var Sp=null;function Cp(e){Sp!==e&&(Sp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Sp===e&&(Sp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(op(r||n)===null)continue;break}var a=pt(n);a!==null&&(e.splice(t,3),t-=3,Cs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function wp(e){function t(t){return xp(t,e)}lp!==null&&xp(lp,e),up!==null&&xp(up,e),dp!==null&&xp(dp,e),fp.forEach(t),pp.forEach(t);for(var n=0;n<mp.length;n++){var r=mp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<mp.length&&(n=mp[0],n.blockedOn===null);)vp(n),n.blockedOn===null&&mp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[it]||null;if(typeof a==`function`)o||Cp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[it]||null)s=o.formAction;else if(op(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Cp(n)}}}function Tp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ep(e){this._internalRoot=e}Dp.prototype.render=Ep.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Yf(n,pu(),e,t,null,null)},Dp.prototype.unmount=Ep.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Yf(e.current,2,null,e,null,null),bu(),t[at]=null}};function Dp(e){this._internalRoot=e}Dp.prototype.unstable_scheduleHydration=function(e){if(e){var t=et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<mp.length&&t!==0&&t<mp[n].priority;n++);mp.splice(n,0,e),n===0&&vp(e)}};var Op=n.version;if(Op!==`19.2.3`)throw Error(i(527,Op,`19.2.3`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var kp={bundleType:0,version:`19.2.3`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.3`};
1541if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Ap=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ap.isDisabled&&Ap.supportsFiber)try{Ae=Ap.inject(kp),je=Ap}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=see;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=vee(e,1,!1,null,null,n,r,null,o,s,c,Tp),e[at]=t.current,Sd(e),new Ep(t)}})),Nbt=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Mbt()}))(),J9=r({directoryOpen:()=>Lbt,directoryOpenLegacy:()=>Xbt,directoryOpenModern:()=>Wbt,fileOpen:()=>Fbt,fileOpenLegacy:()=>Jbt,fileOpenModern:()=>Vbt,fileSave:()=>zbt,fileSaveLegacy:()=>Qbt,fileSaveModern:()=>Kbt,supported:()=>Y9}),Y9=(()=>{if(typeof self>`u`)return!1;if(`top`in self&&self!==top)try{top.window.document._=0}catch{return!1}return`showOpenFilePicker`in self})(),Pbt=Y9?Promise.resolve().then(function(){return Hbt}):Promise.resolve().then(function(){return Ybt});async function Fbt(...e){return(await Pbt).default(...e)}var Ibt=Y9?Promise.resolve().then(function(){return Gbt}):Promise.resolve().then(function(){return Zbt});async function Lbt(...e){return(await Ibt).default(...e)}var Rbt=Y9?Promise.resolve().then(function(){return qbt}):Promise.resolve().then(function(){return $bt});async function zbt(...e){return(await Rbt).default(...e)}var Bbt=async e=>{let t=await e.getFile();return t.handle=e,t},Vbt=async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach((e,n)=>{t[n]={description:e.description||`Files`,accept:{}},e.mimeTypes?e.mimeTypes.map(r=>{t[n].accept[r]=e.extensions||[]}):t[n].accept[`*/*`]=e.extensions||[]});let n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(Bbt));return e[0].multiple?r:r[0]},Hbt={__proto__:null,default:Vbt};function X9(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return X9=function(e){this.s=e,this.n=e.next},X9.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new X9(e)}var Ubt=async(e,t,n=e.name,r)=>{let i=[],a=[];var o,s=!1,c=!1;try{for(var l,u=function(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new X9(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}(e.values());s=!(l=await u.next()).done;s=!1){let o=l.value,s=`${n}/${o.name}`;o.kind===`file`?a.push(o.getFile().then(t=>(t.directoryHandle=e,t.handle=o,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>s})))):o.kind!==`directory`||!t||r&&r(o)||i.push(Ubt(o,t,s,r))}}catch(e){c=!0,o=e}finally{try{s&&u.return!=null&&await u.return()}finally{if(c)throw o}}return[...(await Promise.all(i)).flat(),...await Promise.all(a)]},Wbt=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||`read`;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:Ubt(t,e.recursive,void 0,e.skipDirectory)},Gbt={__proto__:null,default:Wbt},Kbt=async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||`Untitled`;let a=[],o=null;if(e instanceof Blob&&e.type?o=e.type:e.headers&&e.headers.get(`content-type`)&&(o=e.headers.get(`content-type`)),t.forEach((e,t)=>{a[t]={description:e.description||`Files`,accept:{}},e.mimeTypes?(t===0&&o&&e.mimeTypes.push(o),e.mimeTypes.map(n=>{a[t].accept[n]=e.extensions||[]}
1541)):o?a[t].accept[o]=e.extensions||[]:a[t].accept[`*/*`]=e.extensions||[]}),n)try{await n.getFile()}catch(e){if(n=null,r)throw e}let s=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:a,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(s);let c=await s.createWritable();return`stream`in e?(await e.stream().pipeTo(c),s):`body`in e?(await e.body.pipeTo(c),s):(await c.write(await e),await c.close(),s)},qbt={__proto__:null,default:Kbt},Jbt=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{let r=document.createElement(`input`);r.type=`file`;let i=[...e.map(e=>e.mimeTypes||[]),...e.map(e=>e.extensions||[])].join();r.multiple=e[0].multiple||!1,r.accept=i||``,r.style.display=`none`,document.body.append(r),r.addEventListener(`cancel`,()=>{r.remove(),n(new DOMException(`The user aborted a request.`,`AbortError`))}),r.addEventListener(`change`,()=>{r.remove(),t(r.multiple?Array.from(r.files):r.files[0])}),`showPicker`in HTMLInputElement.prototype?r.showPicker():r.click()})),Ybt={__proto__:null,default:Jbt},Xbt=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{let r=document.createElement(`input`);r.type=`file`,r.webkitdirectory=!0,r.style.display=`none`,document.body.append(r),r.addEventListener(`cancel`,()=>{r.remove(),n(new DOMException(`The user aborted a request.`,`AbortError`))}),r.addEventListener(`change`,()=>{r.remove();let n=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(n=n.filter(t=>t.webkitRelativePath.split(`/`).every(t=>!e[0].skipDirectory({name:t,kind:`directory`})))):n=n.filter(e=>e.webkitRelativePath.split(`/`).length===2),t(n)}),`showPicker`in HTMLInputElement.prototype?r.showPicker():r.click()})),Zbt={__proto__:null,default:Xbt},Qbt=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let n=document.createElement(`a`),r=e;`body`in e&&(r=await async function(e,t){let n=e.getReader(),r=new ReadableStream({start:e=>async function t(){return n.read().then(({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()})}()}),i=await new Response(r).blob();return n.releaseLock(),new Blob([i],{type:t})}(e.body,e.headers.get(`content-type`))),n.download=t.fileName||`Untitled`,n.href=URL.createObjectURL(await r);let i=()=>{typeof a==`function`&&a()},a=t.legacySetup&&t.legacySetup(i,()=>a(),n);return n.addEventListener(`click`,()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null},$bt={__proto__:null,default:Qbt};async function ext(e){let t=e.nativeEvent instanceof DragEvent&&e.nativeEvent.dataTransfer?.items?await W$e(e.nativeEvent.dataTransfer.items):null;if(!t?.length)throw Error(`No files were found in that upload. Maybe it was an empty folder?`);return{type:`file`,data:t[0]}}var txt=()=>mx({predictableActionArguments:!0,id:`editable`,initial:`idle`,context:{inputData:null,dragEvent:null,exportedData:null,error:null},states:{idle:{on:{dragover:`dragging`,pick:`manual_pick`,CONVERT_TEXT:{target:`converting`,actions:[hx({inputData:(e,t)=>({type:`text`,data:``})})]}}},manual_pick:{invoke:{id:`manualPick`,src:(e,t)=>Fbt({description:`Files to convert`}),onDone:{target:`converting`,actions:hx({inputData:(e,t)=>({type:`file`,data:t.data})})},onError:{target:`idle`}}},dragging:{on:{dragleave:`idle`,drop:{target:`grouping`,actions:[hx({dragEvent:(e,t)=>(t instanceof Event&&t.preventDefault(),t)})]}}},error:{on:{DISMISS_ERROR:{target:`idle`}}},grouping:{invoke:{id:`getAndGroupFiles`,src:(e,t)=>ext(t),onDone:{target:`converting`,actions:hx({inputData:(e,t)=>t.data,dragEvent:(e,t)=>null})},onError:{target:`error`,actions:hx({error:(e,t)=>t.data})}}},converting:{on:{exported:{target:`download`,actions:hx({exportedData:(e,t)=>t.exportedData})}}},download:{}},on:{cancel:{target:`idle`,actions:hx({inputData:(e,t)=>null,exportedData:(e,t)=>null})}}},{actions:{preventDefault:(e,t)=>{t instanceof Event&&(t.preventDefault(),t.stopPropagation())}}}),Z9=_x(e=>txt());function nxt(e){let t=new Map,n=new Map;switch(e.type){case`geojson`:{let{features:n}=e.geojson;for(let e of n){let n=VC();t.set(n,{feature:e,at:`a0`,folderId:null,id:n})}break}case`root`:{let r=yM(e.root,[],[],null);for(let e of r.putFeatures)t.set(e.id,e);for(let e of r.putFolders)n.set(e.id,e)}}return{featureMap:t,folderMap:n}}function rxt({children:e}){return(0,H.jsxs)(`div`,{role:`alert`,className:`pb-4 text-md flex items-start gap-x-1 text-red-700 dark:text-red-300`,children:[(0,H.jsx)(vn,{className:`shrink-0`,style:{marginTop:2}}),`Sorry, couldn’t convert that - that file might not be valid, or the correct type. (`,Array.isArray(e)?e.join(`, `):e,`)`]})}function ixt({inputData:e,values:t}
1541){return ve(async({liftEither:n})=>{let r;switch(e.type){case`file`:{let i=await e.data.arrayBuffer();r=await n(await r_.fileToGeoJSON(Qg(i,[i]),t,$g(()=>{})));break}case`text`:r=await n(await bbe(t.text,t,$g(()=>{})))}return await n(await JT(nxt(r),{...t,type:t.exportType}))})}var axt={...GT,type:`geojson`,folderId:null,text:``,exportType:`geojson`,geojsonOptions:gbe};function oxt(){let[e,t]=Zv(Z9),{inputData:n}=e.context;if(!n)return t(`cancel`),null;let r=n.type===`file`?n.data:null;return(0,H.jsx)(eg,{onSubmit:async function(e,r){await ixt({inputData:n,values:e}).ifLeft(e=>{r.setErrors({type:e.message})}).ifRight(e=>{t({type:`exported`,exportedData:e})}).run()},initialValues:axt,children:({values:e})=>(0,H.jsxs)(ig,{className:`max-w-xl w-full`,children:[(0,H.jsx)(`div`,{className:``,children:(0,H.jsxs)(`div`,{children:[n.type===`file`?(0,H.jsxs)(`div`,{className:`text-lg font-bold pb-6 truncate`,children:[(0,H.jsx)(cn,{className:`w-5 h-5 inline-block`}),` `,n.data.name]}):(0,H.jsxs)(`div`,{className:`pb-4`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(bg,{children:`Input text`})}),(0,H.jsx)(yse,{"aria-label":`Data`,as:`textarea`,placeholder:`Paste or type data here…`,name:`text`,autoFocus:!0})]}),(0,H.jsx)(sg,{name:`type`,component:rxt}),(0,H.jsx)(`div`,{className:`text-md font-bold pb-2`,children:`From:`}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(XT,{name:`type`,textOnly:n.type===`text`}),(0,H.jsx)(KA,{}),(0,H.jsx)(sM,{file:r||e.text}),n.type===`file`?(0,H.jsx)(B.Suspense,{fallback:(0,H.jsx)(lg,{}),children:(0,H.jsx)(cM,{file:n.data})}):null]}),(0,H.jsx)(`div`,{className:`border-t border-gray-200 -mx-10 mt-8`}),(0,H.jsx)(`div`,{className:`text-md font-bold pt-6 pb-2`,children:`To:`}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(XT,{exportable:!0,name:`exportType`}),e.exportType===`geojson`?(0,H.jsx)(xxe,{}):null,e.exportType===`csv`?(0,H.jsx)(Vg,{children:`Warning: CSV exports only include Point & MultiPoint features.`}):null]}),(0,H.jsx)(`div`,{className:`pt-8 flex justify-between`,children:(0,H.jsx)(Fg,{type:`submit`,variant:`primary`,size:`md`,onClick:()=>t(`CONVERT_TEXT`),children:`Convert`})})]})}),n.type===`file`?(0,H.jsx)(SM,{file:n.data}):null]})})}function sxt(){let[e,t]=Zv(Z9),{exportedData:n}=e.context;return n?(0,H.jsx)(`div`,{className:``,children:(0,H.jsxs)(`div`,{className:`text-center py-4`,children:[(0,H.jsxs)(`div`,{className:`pb-4`,children:[`Tada! `,n.result.name,` is ready.`]}),(0,H.jsxs)(Fg,{variant:`primary`,size:`md`,onClick:()=>{zbt(n.result.blob,{description:`Save converted file`,fileName:n.result.name,extensions:n.extensions}).catch(e=>{})},children:[(0,H.jsx)(Yt,{}),` Download`]}),(0,H.jsx)(`div`,{className:`border-t border-gray-200 -mx-10 mt-8`}),(0,H.jsxs)(`div`,{className:`pt-8 text-center`,children:[(0,H.jsx)(`button`,{type:`button`,className:`inline inherit text-purple-500 underline`,onClick:()=>t(`cancel`),children:`Start again`}),` · `,(0,H.jsx)(`a`,{className:`text-purple-500 underline`,href:`https://placemark.io`,children:`🌎 Create maps with Placemark.`}),` · `,(0,H.jsx)(`a`,{href:`mailto:[email protected]`,className:`text-purple-500 underline`,children:`Feedback`})]})]})}):(t(`cancel`),null)}function cxt({dragging:e}){let[,t]=Zv(Z9);return(0,H.jsxs)(`div`,{className:`text-sm flex flex-col items-stretch justify-stretch`,onClick:()=>t(`pick`),children:[(0,H.jsx)(`div`,{className:`text-xl text-center transition-all rounded ${e?`outline-purple-500`:`outline-purple-100`} outline-dashed p-20`,children:`Drag a file here to start.`}),(0,H.jsxs)(`div`,{className:`pt-4 flex gap-x-2 items-center text-md`,children:[`Other options:`,(0,H.jsx)(Fg,{size:`md`,onClick:()=>t(`pick`),children:`Open a file`}),(0,H.jsx)(Fg,{size:`md`,onClick:()=>{t(`CONVERT_TEXT`)},children:`Convert text`})]})]})}function lxt(){return(0,H.jsx)(lg,{})}function uxt({error:e}){return(0,H.jsx)(`div`,{className:`max-w-xl w-full`,children:(0,H.jsxs)(`div`,{className:`rounded-lg transition-all
1542          shadow-xs
1543          p-10 bg-white self-center justify-center text-sm flex
1544          flex-col
1545          items-center
1546          justify-stretch`,children:[(0,H.jsx)(`div`,{className:`text-md pb-4`,children:`Sorry, we encountered an error.`}),e?.message?(0,H.jsx)(`div`,{className:`text-center font-monospace`,children:e.message}):null]})})}var Q9=e=>{e.preventDefault()};function dxt(){(0,B.useEffect)(()=>(window.addEventListener(`dragover`,Q9),window.addEventListener(`drop`,Q9),()=>{window.removeEventListener(`dragover`,Q9),window.removeEventListener(`drop`,Q9)}));let[e,t]=Zv(Z9);return(0,H.jsxs)(`div`,{className:`min-h-screen mx-auto flex items-stretch flex-col`,onDragOver:t,onDragLeave:t,onDrop:t,children:[(0,H.jsxs)(`div`,{className:`text-purple-700 py-4 justify-start sm:flex justify-between px-4 text-2xl font-bold`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(ur,{className:`h-6 w-6`}),`Convert map data`]}),(0,H.jsxs)(`div`,{children:[`A free tool from`,` `,(0,H.jsx)(`a`,{className:`underline`,href:`https://placemark.io/`,children:`Placemark`})]})]}),(0,H.jsx)(`div`,{className:`flex justify-center py-10 sm:py-20 px-10 sm:px-0`,children:(0,H.jsxs)(`div`,{className:`max-w-xl w-full`,children:[e.matches(`idle`)||e.matches(`dragging`)?null:(0,H.jsx)(`div`,{className:`pb-4`,children:(0,H.jsxs)(Fg,{type:`button`,variant:`default`,size:`sm`,onClick:()=>{t(`cancel`)},children:[(0,H.jsx)(ir,{}),`Start over`]})}),(0,H.jsx)(`div`,{className:`transition-all p-10 bg-white border border-gray-300 rounded-md shadow-xs
1547            ${e.matches(`dragging`)?`scale-110`:``}
1548            `,children:(0,H.jsxs)(cg,{children:[(e.matches(`idle`)||e.matches(`dragging`))&&(0,H.jsx)(cxt,{dragging:e.matches(`dragging`)}
1548),e.matches(`converting`)&&(0,H.jsx)(oxt,{}),e.matches(`grouping`)&&(0,H.jsx)(lxt,{}),e.matches(`manual_pick`)&&(0,H.jsx)(lg,{}),e.matches(`error`)&&(0,H.jsx)(uxt,{error:e.context.error}),e.matches(`download`)&&(0,H.jsx)(sxt,{})]})}),(e.matches(`idle`)||e.matches(`dragging`))&&(0,H.jsxs)(`div`,{className:`pt-4 text-sm leading-relaxed`,children:[`Supports:`,` `,KT.map((e,t,n)=>(0,H.jsxs)(B.Fragment,{children:[(0,H.jsx)(`span`,{children:e.label}),t===n.length-1?``:(0,H.jsx)(`span`,{children:`, `})]},e.id))]})]})})]})}var fxt=()=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`title`,{children:ile(`Free map file converter`)}),(0,H.jsx)(`meta`,{name:`description`,content:`Convert everything from GeoJSON to KML into formats like CSV and
1549          Excel. Converts all your geospatial data`}),(0,H.jsx)(`style`,{children:`
1550            body {
1551              background: #faf5ff;  /* fallback for old browsers */
1552              background: -webkit-linear-gradient(to right, #faf5ff, #e9d5ff);  /* Chrome 10-25, Safari 5.1-6 */
1553              background: linear-gradient(to right, #faf5ff, #e9d5ff); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
1554            }
1555        `}),(0,H.jsx)(dxt,{})]});function $9({title:e,children:t}){return(0,H.jsxs)(`div`,{className:`space-y-2 p-4`,children:[(0,H.jsx)(`h4`,{className:`font-bold opacity-50 text-xs`,children:e}),(0,H.jsx)(`div`,{children:t})]})}function pxt(){let e=[`xs`,`sm`,`md`],t=[`default`,`primary`,`destructive`];return(0,H.jsx)(`div`,{children:[`dark bg-gray-800 text-white`,``].map(n=>(0,H.jsx)(`div`,{className:n,children:(0,H.jsxs)(`div`,{className:`divide-y divide-gray-200`,children:[(0,H.jsx)($9,{title:`Error trigger`,children:(0,H.jsx)(Fg,{onClick:()=>{throw Error(`test`)},children:`Test`})}),(0,H.jsx)($9,{title:`Button`,children:[!0,!1].map(n=>(0,H.jsx)(`div`,{className:`space-y-2`,children:t.map(t=>(0,H.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,H.jsxs)(B.Fragment,{children:[(0,H.jsxs)(Fg,{disabled:n,size:e,variant:t,children:[e,` / `,t]},e+t),` `]},e))},t))},n.toString()))}),(0,H.jsx)($9,{title:`Inputs`,children:(0,H.jsx)(zg,{type:`text`,placeholder:`Input`})}),(0,H.jsx)($9,{title:`CapsLabel`,children:(0,H.jsx)(mse,{children:`Foo`})}),(0,H.jsx)($9,{title:`Inline error`,children:(0,H.jsx)(YT,{children:`Test error content`})}),(0,H.jsx)($9,{title:`Simple Dialog actions`,children:(0,H.jsx)(eg,{initialValues:{},onSubmit:()=>{},children:(0,H.jsx)(Ug,{onClose:()=>{},action:`Do the thing`})})}),(0,H.jsx)($9,{title:`Checkbox`,children:(0,H.jsx)(eg,{initialValues:{y:!1,x:!0},onSubmit:()=>{},children:(0,H.jsxs)(ig,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(dg,{name:`x`,type:`checkbox`}),` Checkbox!`,(0,H.jsx)(dg,{name:`y`,type:`checkbox`}),` Checkbox!`]})})}),(0,H.jsx)($9,{title:`Loading`,children:(0,H.jsx)(lg,{})}),(0,H.jsx)($9,{title:`Loading xs`,children:(0,H.jsx)(lg,{size:`xs`})}),(0,H.jsx)($9,{title:`Select + action`,children:e.map(e=>(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2 pt-4`,children:[(0,H.jsxs)(`select`,{className:Ig({size:e}),children:[(0,H.jsx)(`option`,{children:`Foo`}),(0,H.jsx)(`option`,{children:`X`})]}),(0,H.jsx)(Fg,{size:e,children:`Do it`})]},e))}),(0,H.jsx)($9,{title:`Menu elements`,children:(0,H.jsxs)(`div`,{className:`flex gap-x-2 items-center`,children:[(0,H.jsx)(zp,{children:(0,H.jsx)(vm,{children:(0,H.jsx)(EL,{children:(0,H.jsx)(kt,{})})})}),(0,H.jsx)(J2e,{onClick:()=>{},label:`Example`,children:(0,H.jsx)(kt,{})})]})}),(0,H.jsx)($9,{title:`Inline link`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,H.jsx)(`input`,{type:`radio`,name:`x`,className:jg}),`Radio button`,(0,H.jsx)(`input`,{type:`radio`,value:`y`,name:`x`,className:jg}),`Radio button`]})}),(0,H.jsx)($9,{title:`Dialog`,children:(0,H.jsx)(`div`,{children:(0,H.jsxs)(Hs,{children:[(0,H.jsx)(Us,{className:Pg({}),children:`Dialog`}),(0,H.jsxs)(Ws,{children:[(0,H.jsx)(hse,{}),(0,H.jsxs)(gse,{children:[(0,H.jsx)(xm,{titleIcon:kt,title:`Test`}),(0,H.jsx)(eg,{initialValues:{y:!1,x:!0},onSubmit:()=>{},children:(0,H.jsx)(ig,{children:(0,H.jsxs)(`div`,{children:[`Test`,(0,H.jsx)(Ug,{action:`Do it`,onClose:()=>{}})]})})})]})]})]})})}),(0,H.jsx)($9,{title:`Error fallback`,children:(0,H.jsx)(`div`,{children:(0,H.jsx)(fse,{error:Error(),resetError:()=>{},componentStack:`x`,eventId:`xxx`})})}),(0,H.jsx)($9,{title:`Inline link`,children:(0,H.jsxs)(`div`,{children:[`This is text with a`,` `,(0,H.jsx)(`a`,{href:`#`,className:Tg,children:`link in the middle`}),`.`]})}),(0,H.jsx)($9,{title:`Tooltip`,children:(0,H.jsxs)(vm,{children:[(0,H.jsx)(ym,{"aria-label":`Show panel`,className:`p-2 trigger`,children:`Tooltip`}),(0,H.jsxs)(fg,{children:[(0,H.jsx)(gg,{}),(0,H.jsx)(`div`,{className:`whitespace-nowrap`,children:`Expand panel`})]})]})})]})}
1555,n))})}var mxt=class{idMap;store;constructor(e,t){this.idMap=e,this.store=t}putPresence=async()=>{};apply(e){let t=this.store.get(Wx),n=this.store.get(Kx);t.featureMap.size||(t={...t,featureMap:new Map}),t.folderMap.size||(t={...t,folderMap:new Map});let r=cy.merge(ay(e.note||`Reverse`),this.deleteFeaturesInner(e.deleteFeatures,t),this.deleteFoldersInner(e.deleteFolders,t),this.putFeaturesInner(e.putFeatures,t),this.putFoldersInner(e.putFolders,t),this.putLayerConfigsInner(e.putLayerConfigs,n),this.deleteLayerConfigsInner(e.deleteLayerConfigs,n));return this.store.set(Wx,{selection:t.selection,featureMap:new Map(Array.from(t.featureMap).sort((e,t)=>pT(e[1],t[1]))),folderMap:new Map(Array.from(t.folderMap).sort((e,t)=>pT(e[1],t[1])))}),(e.putLayerConfigs?.length||e.deleteLayerConfigs?.length)&&this.store.set(Kx,new Map(Array.from(n).sort((e,t)=>pT(e[1],t[1])))),r}useTransact(){return e=>{Xde(e);let t={...oy,...e},n=this.apply(t);return e.quiet||this.store.set($x,ly.pushMoment(this.store.get($x),n)),Promise.resolve()}}useLastPresence(){return null}useMetadata(){let[e,t]=Zv(Ide);return[{type:`memory`,...e},e=>(t(t=>({...t,...e})),Promise.resolve())]}useHistoryControl(){return e=>{let t=ly.shallowCopy(this.store.get($x)),n=t[e].shift();if(!n)return Promise.resolve();let r=this.apply(n);if(cy.isEmpty(r))return Promise.resolve();let i=Qle[e];return t[i]=[r].concat(t[i]),this.store.set($x,t),Promise.resolve()}}deleteFeaturesInner(e,t){let n=Zde(e,t);for(let n of e)t.featureMap.delete(n);return n}deleteLayerConfigsInner(e,t){let n=Qde(e,t);for(let n of e)t.delete(n);return n}deleteFoldersInner(e,t){let n=$de(e,t);for(let n of e)t.folderMap.delete(n);return n}putFoldersInner(e,t){let n=ay(`Put folders`),r=null;for(let i of e){let e=t.folderMap.get(i.id);if(i.at===void 0){r||=mS(t);let e=gM(r,null);r=e,i.at=e}e?n.putFolders.push(e):n.deleteFolders.push(i.id),t.folderMap.set(i.id,i)}return n}putFeaturesInner(e,t){let n=ay(`Put features`),r=(0,nv.default)(()=>Array.from(t.featureMap.values(),e=>e.at).sort()),i=(0,nv.default)(()=>new Set(r())),a=null;for(let o of e){let e=t.featureMap.get(o.id);if(o.at===void 0){a||=mS(t);let e=gM(a,null);a=e,o.at=e}e?n.putFeatures.push(e):(n.deleteFeatures.push(o.id),i().has(o.at)&&(o.at=gM(null,r()[0]))),t.featureMap.set(o.id,o),nZ.pushUUID(this.idMap,o.id)}return n}putLayerConfigsInner(e,t){let n=ay(`Put layer configs`);for(let r of e){let e=t.get(r.id);e?n.putLayerConfigs.push(e):n.deleteLayerConfigs.push(r.id),t.set(r.id,r)}return n}},hxt=new PEe,gxt=Vv();function _xt(){let e=(0,B.useRef)(nZ.empty());return(0,H.jsx)(B.Suspense,{fallback:null,children:(0,H.jsx)(B.StrictMode,{children:(0,H.jsx)(IEe,{client:hxt,children:(0,H.jsx)(_m,{children:(0,H.jsxs)(pbt,{children:[(0,H.jsx)(B9,{path:`/`,children:(0,H.jsx)(Ule,{store:gxt,children:(0,H.jsxs)(Zse.Provider,{value:new mxt(e.current,gxt),children:[(0,H.jsx)(`title`,{children:`Placemark Play`}),(0,H.jsx)(Dbt,{})]})})}),(0,H.jsxs)(B9,{path:`/converter`,children:[(0,H.jsx)(`title`,{children:`Converter`}),(0,H.jsx)(fxt,{})]}),(0,H.jsx)(B9,{path:`/secret-styleguide`,children:(0,H.jsx)(pxt,{})})]})})})})})}(0,Nbt.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(_xt,{}));export{Re as _,HT as a,Lye as c,Vye as d,Rye as f,ze as g,zfe as h,Pye as i,Wye as l,B_e as m,Xj as n,jye as o,VT as p,Vj as r,Uye as s,ZX as t,Hye as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.